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
62b69d64
Commit
62b69d64
authored
Dec 08, 2005
by
Rein Klazes
Committed by
Alexandre Julliard
Dec 08, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: RegCreateKeyEx fix.
On Win9x,ME RegCreateKeyEx ignores the backslash character if the subkey begins with one. With a regression test.
parent
b86efe5d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
registry.c
dlls/advapi32/registry.c
+5
-1
registry.c
dlls/advapi32/tests/registry.c
+15
-0
No files found.
dlls/advapi32/registry.c
View file @
62b69d64
...
@@ -206,7 +206,11 @@ DWORD WINAPI RegCreateKeyExA( HKEY hkey, LPCSTR name, DWORD reserved, LPSTR clas
...
@@ -206,7 +206,11 @@ DWORD WINAPI RegCreateKeyExA( HKEY hkey, LPCSTR name, DWORD reserved, LPSTR clas
NTSTATUS
status
;
NTSTATUS
status
;
if
(
reserved
)
return
ERROR_INVALID_PARAMETER
;
if
(
reserved
)
return
ERROR_INVALID_PARAMETER
;
if
(
!
is_version_nt
())
access
=
KEY_ALL_ACCESS
;
/* Win95 ignores the access mask */
if
(
!
is_version_nt
())
{
access
=
KEY_ALL_ACCESS
;
/* Win95 ignores the access mask */
if
(
name
&&
*
name
==
'\\'
)
name
++
;
/* win9x,ME ignores one (and only one) beginning backslash */
}
else
if
(
!
(
access
&
KEY_ACCESS_MASK
)
||
(
access
&
~
KEY_ACCESS_MASK
))
return
ERROR_ACCESS_DENIED
;
else
if
(
!
(
access
&
KEY_ACCESS_MASK
)
||
(
access
&
~
KEY_ACCESS_MASK
))
return
ERROR_ACCESS_DENIED
;
if
(
!
(
hkey
=
get_special_root_hkey
(
hkey
)))
return
ERROR_INVALID_HANDLE
;
if
(
!
(
hkey
=
get_special_root_hkey
(
hkey
)))
return
ERROR_INVALID_HANDLE
;
...
...
dlls/advapi32/tests/registry.c
View file @
62b69d64
...
@@ -476,6 +476,12 @@ static void test_reg_open_key(void)
...
@@ -476,6 +476,12 @@ static void test_reg_open_key(void)
/* send in NULL hkResult */
/* send in NULL hkResult */
ret
=
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
,
NULL
);
ret
=
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Wine
\\
Test"
,
NULL
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
ret
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %ld
\n
"
,
ret
);
/* beginning backslash character */
ret
=
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"
\\
Software
\\
Wine
\\
Test"
,
&
hkResult
);
ok
(
ret
==
ERROR_BAD_PATHNAME
||
/* NT/2k/XP */
ret
==
ERROR_FILE_NOT_FOUND
/* Win9x,ME */
,
"expected ERROR_BAD_PATHNAME or ERROR_FILE_NOT_FOUND, got %ld
\n
"
,
ret
);
}
}
static
void
test_reg_create_key
(
void
)
static
void
test_reg_create_key
(
void
)
...
@@ -492,6 +498,15 @@ static void test_reg_create_key(void)
...
@@ -492,6 +498,15 @@ static void test_reg_create_key(void)
/* clean up */
/* clean up */
RegDeleteKey
(
hkey2
,
NULL
);
RegDeleteKey
(
hkey2
,
NULL
);
RegDeleteKey
(
hkey1
,
NULL
);
RegDeleteKey
(
hkey1
,
NULL
);
/* beginning backslash character */
ret
=
RegCreateKeyExA
(
hkey_main
,
"
\\
Subkey3"
,
0
,
NULL
,
0
,
KEY_NOTIFY
,
NULL
,
&
hkey1
,
NULL
);
if
(
!
(
GetVersion
()
&
0x80000000
))
ok
(
ret
==
ERROR_BAD_PATHNAME
,
"expected ERROR_BAD_PATHNAME, got %ld
\n
"
,
ret
);
else
{
ok
(
!
ret
,
"RegCreateKeyExA failed with error %ld
\n
"
,
ret
);
RegDeleteKey
(
hkey1
,
NULL
);
}
}
}
static
void
test_reg_close_key
(
void
)
static
void
test_reg_close_key
(
void
)
...
...
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