Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
5ae62e3d
Commit
5ae62e3d
authored
20 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Added support for dirids that map to a CSIDL value (based on a patch
by Mike McCormack).
parent
e2a7b289
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/setupapi/Makefile.in
+1
-0
1 addition, 0 deletions
dlls/setupapi/Makefile.in
dlls/setupapi/dirid.c
+26
-0
26 additions, 0 deletions
dlls/setupapi/dirid.c
with
27 additions
and
0 deletions
dlls/setupapi/Makefile.in
+
1
−
0
View file @
5ae62e3d
...
...
@@ -5,6 +5,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
setupapi.dll
IMPORTS
=
user32 version advapi32 kernel32 ntdll
DELAYIMPORTS
=
shell32
ALTNAMES
=
setupx.dll
EXTRALIBS
=
$(
LIBUNICODE
)
...
...
This diff is collapsed.
Click to expand it.
dlls/setupapi/dirid.c
+
26
−
0
View file @
5ae62e3d
...
...
@@ -29,6 +29,7 @@
#include
"winuser.h"
#include
"winnls.h"
#include
"setupapi.h"
#include
"shlobj.h"
#include
"wine/unicode.h"
#include
"setupapi_private.h"
#include
"wine/debug.h"
...
...
@@ -36,6 +37,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
setupapi
);
#define MAX_SYSTEM_DIRID DIRID_PRINTPROCESSOR
#define MIN_CSIDL_DIRID 0x4000
#define MAX_CSIDL_DIRID 0x403f
struct
user_dirid
{
...
...
@@ -47,6 +50,7 @@ static int nb_user_dirids; /* number of user dirids in use */
static
int
alloc_user_dirids
;
/* number of allocated user dirids */
static
struct
user_dirid
*
user_dirids
;
static
const
WCHAR
*
system_dirids
[
MAX_SYSTEM_DIRID
+
1
];
static
const
WCHAR
*
csidl_dirids
[
MAX_CSIDL_DIRID
-
MIN_CSIDL_DIRID
+
1
];
/* retrieve the string for unknown dirids */
static
const
WCHAR
*
get_unknown_dirid
(
void
)
...
...
@@ -146,6 +150,21 @@ static const WCHAR *create_system_dirid( int dirid )
return
str
;
}
static
const
WCHAR
*
get_csidl_dir
(
DWORD
csidl
)
{
WCHAR
buffer
[
MAX_PATH
],
*
str
;
int
len
;
if
(
!
SHGetSpecialFolderPathW
(
NULL
,
buffer
,
csidl
,
TRUE
))
{
FIXME
(
"CSIDL %lx not found
\n
"
,
csidl
);
return
get_unknown_dirid
();
}
len
=
(
strlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
);
if
((
str
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
memcpy
(
str
,
buffer
,
len
);
return
str
;
}
/* retrieve the string corresponding to a dirid, or NULL if none */
const
WCHAR
*
DIRID_get_string
(
HINF
hinf
,
int
dirid
)
{
...
...
@@ -160,6 +179,13 @@ const WCHAR *DIRID_get_string( HINF hinf, int dirid )
ERR
(
"user id %d not found
\n
"
,
dirid
);
return
NULL
;
}
else
if
(
dirid
>=
MIN_CSIDL_DIRID
)
{
if
(
dirid
>
MAX_CSIDL_DIRID
)
return
get_unknown_dirid
();
dirid
-=
MIN_CSIDL_DIRID
;
if
(
!
csidl_dirids
[
dirid
])
csidl_dirids
[
dirid
]
=
get_csidl_dir
(
dirid
);
return
csidl_dirids
[
dirid
];
}
else
{
if
(
dirid
>
MAX_SYSTEM_DIRID
)
return
get_unknown_dirid
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment