Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
5ae62e3d
Commit
5ae62e3d
authored
May 28, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for dirids that map to a CSIDL value (based on a patch
by Mike McCormack).
parent
e2a7b289
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
Makefile.in
dlls/setupapi/Makefile.in
+1
-0
dirid.c
dlls/setupapi/dirid.c
+26
-0
No files found.
dlls/setupapi/Makefile.in
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)
...
...
dlls/setupapi/dirid.c
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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment