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
e6e96d3e
Commit
e6e96d3e
authored
Sep 21, 2006
by
Damjan Jovanovic
Committed by
Alexandre Julliard
Sep 26, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Brace the guid in SetupDiOpenClassRegKeyExW.
parent
9ae4e8d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
4 deletions
+33
-4
devinst.c
dlls/setupapi/devinst.c
+7
-3
Makefile.in
dlls/setupapi/tests/Makefile.in
+1
-1
devinst.c
dlls/setupapi/tests/devinst.c
+25
-0
No files found.
dlls/setupapi/devinst.c
View file @
e6e96d3e
...
...
@@ -1413,6 +1413,7 @@ HKEY WINAPI SetupDiOpenClassRegKeyExW(
PVOID
Reserved
)
{
LPWSTR
lpGuidString
;
WCHAR
bracedGuidString
[
39
];
HKEY
hClassesKey
;
HKEY
hClassKey
;
LPCWSTR
lpKeyName
;
...
...
@@ -1455,19 +1456,22 @@ HKEY WINAPI SetupDiOpenClassRegKeyExW(
RegCloseKey
(
hClassesKey
);
return
INVALID_HANDLE_VALUE
;
}
bracedGuidString
[
0
]
=
'{'
;
memcpy
(
&
bracedGuidString
[
1
],
lpGuidString
,
36
*
sizeof
(
WCHAR
));
bracedGuidString
[
37
]
=
'}'
;
bracedGuidString
[
38
]
=
0
;
RpcStringFreeW
(
&
lpGuidString
);
if
(
RegOpenKeyExW
(
hClassesKey
,
lp
GuidString
,
braced
GuidString
,
0
,
KEY_ALL_ACCESS
,
&
hClassKey
))
{
RpcStringFreeW
(
&
lpGuidString
);
RegCloseKey
(
hClassesKey
);
return
INVALID_HANDLE_VALUE
;
}
RpcStringFreeW
(
&
lpGuidString
);
RegCloseKey
(
hClassesKey
);
return
hClassKey
;
...
...
dlls/setupapi/tests/Makefile.in
View file @
e6e96d3e
...
...
@@ -3,7 +3,7 @@ TOPOBJDIR = ../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
setupapi.dll
IMPORTS
=
setupapi kernel32
IMPORTS
=
setupapi
advapi32
kernel32
CTESTS
=
\
devinst.c
\
...
...
dlls/setupapi/tests/devinst.c
View file @
e6e96d3e
...
...
@@ -87,6 +87,7 @@ static void test_SetupDiOpenClassRegKeyExA(void)
/* This is a unique guid for testing purposes */
GUID
guid
=
{
0x6a55b5a4
,
0x3f65
,
0x11db
,
{
0xb7
,
0x04
,
0x00
,
0x11
,
0x95
,
0x5c
,
0x2b
,
0xdb
}};
static
const
CHAR
guidString
[]
=
"{6a55b5a4-3f65-11db-b704-0011955c2bdb}"
;
HKEY
hkey
;
/* Check return value for non-existent key */
...
...
@@ -94,6 +95,30 @@ static void test_SetupDiOpenClassRegKeyExA(void)
DIOCR_INSTALLER
,
NULL
,
NULL
);
ok
(
hkey
==
INVALID_HANDLE_VALUE
,
"returned %p (expected INVALID_HANDLE_VALUE)
\n
"
,
hkey
);
/* Test it for a key that exists */
hkey
=
SetupDiOpenClassRegKey
(
NULL
,
KEY_ALL_ACCESS
);
if
(
hkey
!=
INVALID_HANDLE_VALUE
)
{
HKEY
classKey
;
if
(
RegCreateKeyA
(
hkey
,
guidString
,
&
classKey
)
==
ERROR_SUCCESS
)
{
RegCloseKey
(
classKey
);
SetLastError
(
0xdeadbeef
);
classKey
=
pSetupDiOpenClassRegKeyExA
(
&
guid
,
KEY_ALL_ACCESS
,
DIOCR_INSTALLER
,
NULL
,
NULL
);
ok
(
classKey
!=
INVALID_HANDLE_VALUE
,
"opening class registry key failed with error %ld
\n
"
,
GetLastError
());
if
(
classKey
!=
INVALID_HANDLE_VALUE
)
RegCloseKey
(
classKey
);
RegDeleteKeyA
(
hkey
,
guidString
);
}
else
trace
(
"failed to create registry key for test
\n
"
);
}
else
trace
(
"failed to open classes key
\n
"
);
}
START_TEST
(
devinst
)
...
...
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