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
7be8beab
Commit
7be8beab
authored
Feb 23, 2018
by
Katayama Hirofumi MZ
Committed by
Alexandre Julliard
Feb 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Don't attempt to un-expand ComputerName in PathUnExpandEnvStrings.
Signed-off-by:
Thomas Faber
<
thomas.faber@reactos.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fb6b3cc8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
path.c
dlls/shlwapi/path.c
+0
-2
path.c
dlls/shlwapi/tests/path.c
+16
-2
No files found.
dlls/shlwapi/path.c
View file @
7be8beab
...
...
@@ -4105,7 +4105,6 @@ BOOL WINAPI PathUnExpandEnvStringsA(LPCSTR path, LPSTR buffer, UINT buf_len)
static
const
WCHAR
allusersprofileW
[]
=
{
'%'
,
'A'
,
'L'
,
'L'
,
'U'
,
'S'
,
'E'
,
'R'
,
'S'
,
'P'
,
'R'
,
'O'
,
'F'
,
'I'
,
'L'
,
'E'
,
'%'
,
0
};
static
const
WCHAR
appdataW
[]
=
{
'%'
,
'A'
,
'P'
,
'P'
,
'D'
,
'A'
,
'T'
,
'A'
,
'%'
,
0
};
static
const
WCHAR
computernameW
[]
=
{
'%'
,
'C'
,
'O'
,
'M'
,
'P'
,
'U'
,
'T'
,
'E'
,
'R'
,
'N'
,
'A'
,
'M'
,
'E'
,
'%'
,
0
};
static
const
WCHAR
programfilesW
[]
=
{
'%'
,
'P'
,
'r'
,
'o'
,
'g'
,
'r'
,
'a'
,
'm'
,
'F'
,
'i'
,
'l'
,
'e'
,
's'
,
'%'
,
0
};
static
const
WCHAR
systemrootW
[]
=
{
'%'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'R'
,
'o'
,
'o'
,
't'
,
'%'
,
0
};
static
const
WCHAR
systemdriveW
[]
=
{
'%'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'%'
,
0
};
...
...
@@ -4142,7 +4141,6 @@ BOOL WINAPI PathUnExpandEnvStringsW(LPCWSTR path, LPWSTR buffer, UINT buf_len)
struct
envvars_map
envvars
[]
=
{
{
allusersprofileW
,
sizeof
(
allusersprofileW
)
/
sizeof
(
WCHAR
)
},
{
appdataW
,
sizeof
(
appdataW
)
/
sizeof
(
WCHAR
)
},
{
computernameW
,
sizeof
(
computernameW
)
/
sizeof
(
WCHAR
)
},
{
programfilesW
,
sizeof
(
programfilesW
)
/
sizeof
(
WCHAR
)
},
{
systemrootW
,
sizeof
(
systemrootW
)
/
sizeof
(
WCHAR
)
},
{
systemdriveW
,
sizeof
(
systemdriveW
)
/
sizeof
(
WCHAR
)
},
...
...
dlls/shlwapi/tests/path.c
View file @
7be8beab
...
...
@@ -1463,10 +1463,11 @@ static void test_PathUnExpandEnvStrings(void)
static
const
WCHAR
sysrootW
[]
=
{
'%'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'R'
,
'o'
,
'o'
,
't'
,
'%'
,
0
};
static
const
WCHAR
sysdriveW
[]
=
{
'%'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'%'
,
0
};
static
const
WCHAR
nonpathW
[]
=
{
'p'
,
'a'
,
't'
,
'h'
,
0
};
static
const
WCHAR
computernameW
[]
=
{
'C'
,
'O'
,
'M'
,
'P'
,
'U'
,
'T'
,
'E'
,
'R'
,
'N'
,
'A'
,
'M'
,
'E'
,
0
};
static
const
char
sysrootA
[]
=
"%SystemRoot%"
;
static
const
char
sysdriveA
[]
=
"%SystemDrive%"
;
WCHAR
pathW
[
MAX_PATH
],
buffW
[
MAX_PATH
],
sysdrvW
[
3
];
char
path
[
MAX_PATH
],
buff
[
MAX_PATH
],
sysdrvA
[
3
],
envvarA
[
1
0
];
WCHAR
pathW
[
MAX_PATH
],
buffW
[
MAX_PATH
],
sysdrvW
[
3
]
,
envvarW
[
30
]
;
char
path
[
MAX_PATH
],
buff
[
MAX_PATH
],
sysdrvA
[
3
],
envvarA
[
3
0
];
BOOL
ret
;
UINT
len
;
...
...
@@ -1476,6 +1477,19 @@ static void test_PathUnExpandEnvStrings(void)
return
;
}
/* The value of ComputerName is not a path */
ret
=
GetEnvironmentVariableA
(
"COMPUTERNAME"
,
envvarA
,
sizeof
(
envvarA
));
ok
(
ret
,
"got %d
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
pPathUnExpandEnvStringsA
(
envvarA
,
buff
,
sizeof
(
buff
));
ok
(
!
ret
&&
GetLastError
()
==
0xdeadbeef
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
ret
=
GetEnvironmentVariableW
(
computernameW
,
envvarW
,
sizeof
(
envvarW
)
/
sizeof
(
WCHAR
));
ok
(
ret
,
"got %d
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
ret
=
pPathUnExpandEnvStringsW
(
envvarW
,
buffW
,
sizeof
(
buffW
)
/
sizeof
(
WCHAR
));
ok
(
!
ret
&&
GetLastError
()
==
0xdeadbeef
,
"got %d, error %d
\n
"
,
ret
,
GetLastError
());
/* something that can't be represented with env var */
strcpy
(
path
,
"somepath_name"
);
strcpy
(
buff
,
"xx"
);
...
...
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