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
d2045611
Commit
d2045611
authored
Mar 04, 2024
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Mar 04, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Check NULL return key pointers when creating registry keys.
Fix Warlords Battlecry III (433280) crashes at launch.
parent
8dc5242e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
registry.c
dlls/advapi32/registry.c
+6
-0
registry.c
dlls/kernelbase/registry.c
+2
-0
No files found.
dlls/advapi32/registry.c
View file @
d2045611
...
...
@@ -70,6 +70,9 @@ LSTATUS WINAPI RegOverridePredefKey( HKEY hkey, HKEY override )
*/
LSTATUS
WINAPI
RegCreateKeyW
(
HKEY
hkey
,
LPCWSTR
lpSubKey
,
PHKEY
phkResult
)
{
if
(
!
phkResult
)
return
ERROR_INVALID_PARAMETER
;
return
RegCreateKeyExW
(
hkey
,
lpSubKey
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
MAXIMUM_ALLOWED
,
NULL
,
phkResult
,
NULL
);
}
...
...
@@ -82,6 +85,9 @@ LSTATUS WINAPI RegCreateKeyW( HKEY hkey, LPCWSTR lpSubKey, PHKEY phkResult )
*/
LSTATUS
WINAPI
RegCreateKeyA
(
HKEY
hkey
,
LPCSTR
lpSubKey
,
PHKEY
phkResult
)
{
if
(
!
phkResult
)
return
ERROR_INVALID_PARAMETER
;
return
RegCreateKeyExA
(
hkey
,
lpSubKey
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
MAXIMUM_ALLOWED
,
NULL
,
phkResult
,
NULL
);
}
...
...
dlls/kernelbase/registry.c
View file @
d2045611
...
...
@@ -592,6 +592,7 @@ LSTATUS WINAPI DECLSPEC_HOTPATCH RegCreateKeyExW( HKEY hkey, LPCWSTR name, DWORD
{
UNICODE_STRING
nameW
,
classW
;
if
(
!
retkey
)
return
ERROR_BADKEY
;
if
(
reserved
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
(
hkey
=
get_special_root_hkey
(
hkey
)))
return
ERROR_INVALID_HANDLE
;
...
...
@@ -633,6 +634,7 @@ LSTATUS WINAPI DECLSPEC_HOTPATCH RegCreateKeyExA( HKEY hkey, LPCSTR name, DWORD
ANSI_STRING
nameA
,
classA
;
NTSTATUS
status
;
if
(
!
retkey
)
return
ERROR_BADKEY
;
if
(
reserved
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
is_version_nt
())
{
...
...
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