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
62f52103
Commit
62f52103
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: Fix the error code on load failure.
Signed-off-by:
Akihiro Sagawa
<
sagawa.aki@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cb555215
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
registry.c
dlls/advapi32/registry.c
+6
-6
registry.c
dlls/advapi32/tests/registry.c
+3
-5
No files found.
dlls/advapi32/registry.c
View file @
62f52103
...
...
@@ -3133,6 +3133,10 @@ static INT load_string(HINSTANCE hModule, UINT resId, LPWSTR *pResString)
/* Strings are length-prefixed. Lowest nibble of resId is an index. */
idxString
=
resId
&
0xf
;
while
(
idxString
--
)
pString
+=
*
pString
+
1
;
if
(
!*
pString
)
{
SetLastError
(
ERROR_NOT_FOUND
);
return
0
;
}
*
pResString
=
pString
+
1
;
return
*
pString
;
...
...
@@ -3153,11 +3157,11 @@ static LONG load_mui_string(const WCHAR *file_name, UINT res_id, WCHAR *buffer,
hModule
=
LoadLibraryExW
(
file_name
,
NULL
,
LOAD_LIBRARY_AS_DATAFILE
|
LOAD_LIBRARY_AS_IMAGE_RESOURCE
);
if
(
!
hModule
)
return
ERROR_BADKEY
;
return
GetLastError
()
;
size
=
load_string
(
hModule
,
res_id
,
&
string
);
if
(
!
size
)
{
result
=
ERROR_FILE_NOT_FOUND
;
result
=
GetLastError
()
;
goto
cleanup
;
}
*
req_chars
=
size
+
1
;
...
...
@@ -3210,10 +3214,6 @@ cleanup:
* RETURNS
* Success: ERROR_SUCCESS,
* Failure: nonzero error code from winerror.h
*
* NOTES
* This is an API of Windows Vista, which wasn't available at the time this code
* was written. We have to check for the correct behaviour once it's available.
*/
LSTATUS
WINAPI
RegLoadMUIStringW
(
HKEY
hKey
,
LPCWSTR
pwszValue
,
LPWSTR
pwszBuffer
,
DWORD
cbBuffer
,
LPDWORD
pcbData
,
DWORD
dwFlags
,
LPCWSTR
pwszBaseDir
)
...
...
dlls/advapi32/tests/registry.c
View file @
62f52103
...
...
@@ -3854,7 +3854,6 @@ static void test_RegLoadMUIString(void)
BOOL
use_sysdir
;
DWORD
expected
;
DWORD
broken_ret
;
BOOL
todo
;
}
test_case
[]
=
{
/* 0 */
{
""
,
REG_SZ
,
FALSE
,
ERROR_INVALID_DATA
},
...
...
@@ -3868,9 +3867,9 @@ static void test_RegLoadMUIString(void)
{
"@%WineMuiTest2%"
,
REG_EXPAND_SZ
,
TRUE
,
ERROR_SUCCESS
},
/* 8 */
{
"@%WineMuiExe%,a"
,
REG_SZ
,
FALSE
,
ERROR_INVALID_DATA
},
{
"@%WineMuiExe%,-4"
,
REG_SZ
,
FALSE
,
ERROR_NOT_FOUND
,
ERROR_FILE_NOT_FOUND
,
TRUE
},
{
"@%WineMuiExe%,-39"
,
REG_SZ
,
FALSE
,
ERROR_RESOURCE_NAME_NOT_FOUND
,
0
,
TRUE
},
{
"@%WineMuiDat%,-16"
,
REG_EXPAND_SZ
,
FALSE
,
ERROR_BAD_EXE_FORMAT
,
ERROR_FILE_NOT_FOUND
,
TRUE
},
{
"@%WineMuiExe%,-4"
,
REG_SZ
,
FALSE
,
ERROR_NOT_FOUND
,
ERROR_FILE_NOT_FOUND
},
{
"@%WineMuiExe%,-39"
,
REG_SZ
,
FALSE
,
ERROR_RESOURCE_NAME_NOT_FOUND
},
{
"@%WineMuiDat%,-16"
,
REG_EXPAND_SZ
,
FALSE
,
ERROR_BAD_EXE_FORMAT
,
ERROR_FILE_NOT_FOUND
},
};
if
(
!
pRegLoadMUIStringA
||
!
pRegLoadMUIStringW
)
...
...
@@ -4013,7 +4012,6 @@ static void test_RegLoadMUIString(void)
ret
=
pRegLoadMUIStringW
(
hkey_main
,
tz_valueW
,
bufW
,
ARRAY_SIZE
(
bufW
),
&
size
,
0
,
test_case
[
i
].
use_sysdir
?
sysdirW
:
NULL
);
todo_wine_if
(
test_case
[
i
].
todo
)
ok
(
ret
==
test_case
[
i
].
expected
||
broken
(
test_case
[
i
].
value
[
0
]
==
'%'
&&
ret
==
ERROR_SUCCESS
/* vista */
)
||
broken
(
test_case
[
i
].
broken_ret
&&
ret
==
test_case
[
i
].
broken_ret
/* vista */
),
...
...
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