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
452ddeb3
Commit
452ddeb3
authored
Apr 05, 2004
by
Juan Lang
Committed by
Alexandre Julliard
Apr 05, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use symbolic constants for magic numbers in SHGetFolderPathW, avoid
doing MultiByteToWideChar on values that don't need it,
parent
09733db5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
15 deletions
+23
-15
shellpath.c
dlls/shell32/shellpath.c
+23
-15
No files found.
dlls/shell32/shellpath.c
View file @
452ddeb3
...
...
@@ -714,6 +714,9 @@ typedef struct
#define HKLM HKEY_LOCAL_MACHINE
#define HKCU HKEY_CURRENT_USER
#define HKEY_UNIMPLEMENTED (HKEY)1
#define HKEY_WINDOWSPATH (HKEY)2
#define HKEY_EMPTY (HKEY)3
static
const
CSIDL_DATA
CSIDL_Data
[]
=
{
{
/* CSIDL_DESKTOP */
...
...
@@ -722,7 +725,7 @@ static const CSIDL_DATA CSIDL_Data[] =
"Desktop"
},
{
/* CSIDL_INTERNET */
0
,
(
HKEY
)
1
,
/* FIXME */
0
,
HKEY_UNIMPLEMENTED
,
/* FIXME */
NULL
,
NULL
,
},
...
...
@@ -767,7 +770,7 @@ static const CSIDL_DATA CSIDL_Data[] =
"SendTo"
},
{
/* CSIDL_BITBUCKET - Recycle Bin */
0
,
(
HKEY
)
1
,
/* FIXME */
0
,
HKEY_UNIMPLEMENTED
,
/* FIXME */
NULL
,
"recycled"
},
...
...
@@ -777,7 +780,7 @@ static const CSIDL_DATA CSIDL_Data[] =
"Start Menu"
},
{
/* CSIDL_MYDOCUMENTS */
0
,
(
HKEY
)
1
,
/* FIXME */
0
,
HKEY_UNIMPLEMENTED
,
/* FIXME */
NULL
,
NULL
},
...
...
@@ -802,12 +805,12 @@ static const CSIDL_DATA CSIDL_Data[] =
"Desktop"
},
{
/* CSIDL_DRIVES */
0
,
(
HKEY
)
1
,
/* FIXME */
0
,
HKEY_UNIMPLEMENTED
,
/* FIXME */
NULL
,
"My Computer"
},
{
/* CSIDL_NETWORK */
0
,
(
HKEY
)
1
,
/* FIXME */
0
,
HKEY_EMPTY
,
NULL
,
"Network Neighborhood"
},
...
...
@@ -862,12 +865,12 @@ static const CSIDL_DATA CSIDL_Data[] =
"Local Settings
\\
Application Data"
,
},
{
/* CSIDL_ALTSTARTUP */
0
,
(
HKEY
)
1
,
/* FIXME */
0
,
HKEY_UNIMPLEMENTED
,
/* FIXME */
NULL
,
NULL
},
{
/* CSIDL_COMMON_ALTSTARTUP */
0
,
(
HKEY
)
1
,
/* FIXME */
0
,
HKEY_UNIMPLEMENTED
,
/* FIXME */
NULL
,
NULL
},
...
...
@@ -997,7 +1000,7 @@ static const CSIDL_DATA CSIDL_Data[] =
/*"Documents and Settings\\"*/
"All Users
\\
Documents
\\
My Video"
},
{
/* CSIDL_RESOURCES */
0
,
(
HKEY
)
2
,
0
,
HKEY_WINDOWSPATH
,
NULL
,
"Resources"
},
...
...
@@ -1059,19 +1062,19 @@ HRESULT WINAPI SHGetFolderPathW(
ERR
(
"folder 0x%04lx unknown or not allowed
\n
"
,
folder
);
return
E_FAIL
;
}
if
(
CSIDL_Data
[
folder
].
hRootKey
==
(
HKEY
)
1
)
if
(
CSIDL_Data
[
folder
].
hRootKey
==
HKEY_UNIMPLEMENTED
)
{
FIXME
(
"folder 0x%04lx unknown, please add.
\n
"
,
folder
);
return
E_FAIL
;
}
dwCsidlFlags
=
CSIDL_Data
[
folder
].
dwFlags
;
hRootKey
=
CSIDL_Data
[
folder
].
hRootKey
;
MultiByteToWideChar
(
CP_ACP
,
0
,
CSIDL_Data
[
folder
].
szValueName
,
-
1
,
szValueName
,
MAX_PATH
)
;
MultiByteToWideChar
(
CP_ACP
,
0
,
CSIDL_Data
[
folder
].
szDefaultPath
,
-
1
,
szDefaultPath
,
MAX_PATH
);
if
(
CSIDL_Data
[
folder
].
hRootKey
==
HKEY_EMPTY
)
{
*
pszPath
=
'\0'
;
return
S_OK
;
}
/* Special case for some values that don't exist in registry */
if
(
CSIDL_Data
[
folder
].
hRootKey
==
(
HKEY
)
2
)
if
(
CSIDL_Data
[
folder
].
hRootKey
==
HKEY_WINDOWSPATH
)
{
GetWindowsDirectoryW
(
pszPath
,
MAX_PATH
);
PathAddBackslashW
(
pszPath
);
...
...
@@ -1079,6 +1082,11 @@ HRESULT WINAPI SHGetFolderPathW(
return
S_OK
;
}
dwCsidlFlags
=
CSIDL_Data
[
folder
].
dwFlags
;
hRootKey
=
CSIDL_Data
[
folder
].
hRootKey
;
MultiByteToWideChar
(
CP_ACP
,
0
,
CSIDL_Data
[
folder
].
szValueName
,
-
1
,
szValueName
,
MAX_PATH
);
MultiByteToWideChar
(
CP_ACP
,
0
,
CSIDL_Data
[
folder
].
szDefaultPath
,
-
1
,
szDefaultPath
,
MAX_PATH
);
if
(
dwCsidlFlags
&
CSIDL_MYFLAG_SHFOLDER
)
{
/* user shell folders */
...
...
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