Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
e798d25f
Commit
e798d25f
authored
May 26, 2019
by
Akihiro Sagawa
Committed by
Alexandre Julliard
May 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Expand environment variables even if REG_SZ type is used.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1ed4c150
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
14 deletions
+9
-14
registry.c
dlls/advapi32/registry.c
+8
-13
registry.c
dlls/advapi32/tests/registry.c
+1
-1
No files found.
dlls/advapi32/registry.c
View file @
e798d25f
...
...
@@ -3253,20 +3253,15 @@ LSTATUS WINAPI RegLoadMUIStringW(HKEY hKey, LPCWSTR pwszValue, LPWSTR pwszBuffer
goto
cleanup
;
}
/* Expand environment variables, if appropriate, or copy the original string over. */
if
(
dwValueType
==
REG_EXPAND_SZ
)
{
cbData
=
ExpandEnvironmentStringsW
(
pwszTempBuffer
,
NULL
,
0
)
*
sizeof
(
WCHAR
);
if
(
!
cbData
)
goto
cleanup
;
pwszExpandedBuffer
=
heap_alloc
(
cbData
);
if
(
!
pwszExpandedBuffer
)
{
result
=
ERROR_NOT_ENOUGH_MEMORY
;
goto
cleanup
;
}
ExpandEnvironmentStringsW
(
pwszTempBuffer
,
pwszExpandedBuffer
,
cbData
/
sizeof
(
WCHAR
));
}
else
{
pwszExpandedBuffer
=
heap_alloc
(
cbData
);
memcpy
(
pwszExpandedBuffer
,
pwszTempBuffer
,
cbData
);
/* Expand environment variables regardless of the type. */
cbData
=
ExpandEnvironmentStringsW
(
pwszTempBuffer
,
NULL
,
0
)
*
sizeof
(
WCHAR
);
if
(
!
cbData
)
goto
cleanup
;
pwszExpandedBuffer
=
heap_alloc
(
cbData
);
if
(
!
pwszExpandedBuffer
)
{
result
=
ERROR_NOT_ENOUGH_MEMORY
;
goto
cleanup
;
}
ExpandEnvironmentStringsW
(
pwszTempBuffer
,
pwszExpandedBuffer
,
cbData
/
sizeof
(
WCHAR
));
/* Parse the value and load the string. */
{
...
...
dlls/advapi32/tests/registry.c
View file @
e798d25f
...
...
@@ -3862,7 +3862,7 @@ static void test_RegLoadMUIString(void)
{
"@unknown.dll"
,
REG_SZ
,
TRUE
,
ERROR_INVALID_DATA
,
0
,
TRUE
},
{
"@unknown.dll,-10"
,
REG_SZ
,
TRUE
,
ERROR_FILE_NOT_FOUND
},
/* 4 */
{
with_env_var
,
REG_SZ
,
FALSE
,
ERROR_SUCCESS
,
0
,
TRUE
},
{
with_env_var
,
REG_SZ
,
FALSE
,
ERROR_SUCCESS
},
{
with_env_var
,
REG_EXPAND_SZ
,
FALSE
,
ERROR_SUCCESS
},
{
"%WineMuiTest1%"
,
REG_EXPAND_SZ
,
TRUE
,
ERROR_INVALID_DATA
},
{
"@%WineMuiTest2%"
,
REG_EXPAND_SZ
,
TRUE
,
ERROR_SUCCESS
},
...
...
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