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
8fff6eeb
Commit
8fff6eeb
authored
Nov 30, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Dec 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Delete all empty parent keys of a removed device key.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
24736edf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
31 deletions
+17
-31
devinst.c
dlls/setupapi/devinst.c
+17
-0
devinst.c
dlls/setupapi/tests/devinst.c
+0
-31
No files found.
dlls/setupapi/devinst.c
View file @
8fff6eeb
...
...
@@ -578,7 +578,9 @@ static void remove_device_iface(struct device_iface *iface)
static
void
remove_device
(
struct
device
*
device
)
{
WCHAR
id
[
MAX_DEVICE_ID_LEN
],
*
p
;
struct
device_iface
*
iface
;
HKEY
enum_key
;
LIST_FOR_EACH_ENTRY
(
iface
,
&
device
->
interfaces
,
struct
device_iface
,
entry
)
{
...
...
@@ -587,6 +589,21 @@ static void remove_device(struct device *device)
RegDeleteTreeW
(
device
->
key
,
NULL
);
RegDeleteKeyW
(
device
->
key
,
emptyW
);
/* delete all empty parents of the key */
if
(
!
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
Enum
,
0
,
0
,
&
enum_key
))
{
strcpyW
(
id
,
device
->
instanceId
);
while
((
p
=
strrchrW
(
id
,
'\\'
)))
{
*
p
=
0
;
RegDeleteKeyW
(
enum_key
,
id
);
}
RegCloseKey
(
enum_key
);
}
RegCloseKey
(
device
->
key
);
device
->
key
=
NULL
;
device
->
removed
=
TRUE
;
...
...
dlls/setupapi/tests/devinst.c
View file @
8fff6eeb
...
...
@@ -466,9 +466,6 @@ static void test_get_device_instance_id(void)
static
void
test_register_device_info
(
void
)
{
static
const
WCHAR
bogus
[]
=
{
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'S'
,
'e'
,
't'
,
'\\'
,
'E'
,
'n'
,
'u'
,
'm'
,
'\\'
,
'R'
,
'o'
,
'o'
,
't'
,
'\\'
,
'L'
,
'E'
,
'G'
,
'A'
,
'C'
,
'Y'
,
'_'
,
'B'
,
'O'
,
'G'
,
'U'
,
'S'
,
0
};
SP_DEVINFO_DATA
device
=
{
0
};
BOOL
ret
;
HDEVINFO
set
;
...
...
@@ -526,9 +523,6 @@ static void test_register_device_info(void)
ok
(
GetLastError
()
==
ERROR_NO_MORE_ITEMS
,
"Got unexpected error %#x.
\n
"
,
GetLastError
());
SetupDiDestroyDeviceInfoList
(
set
);
/* remove once Wine is fixed */
devinst_RegDeleteTreeW
(
HKEY_LOCAL_MACHINE
,
bogus
);
}
static
void
check_device_iface_
(
int
line
,
HDEVINFO
set
,
SP_DEVINFO_DATA
*
device
,
...
...
@@ -662,10 +656,6 @@ static void test_device_iface(void)
static
void
test_device_iface_detail
(
void
)
{
static
const
WCHAR
bogus
[]
=
{
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'S'
,
'e'
,
't'
,
'\\'
,
'E'
,
'n'
,
'u'
,
'm'
,
'\\'
,
'R'
,
'o'
,
'o'
,
't'
,
'\\'
,
'L'
,
'E'
,
'G'
,
'A'
,
'C'
,
'Y'
,
'_'
,
'B'
,
'O'
,
'G'
,
'U'
,
'S'
,
0
};
static
const
char
path
[]
=
"
\\\\
?
\\
root#legacy_bogus#0000#{6a55b5a4-3f65-11db-b704-0011955c2bdb}"
;
SP_DEVICE_INTERFACE_DETAIL_DATA_A
*
detail
;
SP_DEVICE_INTERFACE_DATA
iface
=
{
sizeof
(
iface
)};
...
...
@@ -737,9 +727,6 @@ static void test_device_iface_detail(void)
heap_free
(
detail
);
SetupDiDestroyDeviceInfoList
(
set
);
/* remove once Wine is fixed */
devinst_RegDeleteTreeW
(
HKEY_LOCAL_MACHINE
,
bogus
);
}
static
void
test_device_key
(
void
)
...
...
@@ -849,7 +836,6 @@ todo_wine {
SetupDiDestroyDeviceInfoList
(
set
);
/* remove once Wine is fixed */
devinst_RegDeleteTreeW
(
HKEY_LOCAL_MACHINE
,
bogus
);
devinst_RegDeleteTreeW
(
HKEY_LOCAL_MACHINE
,
classKey
);
}
...
...
@@ -890,9 +876,6 @@ static void test_register_device_iface(void)
SetupDiDestroyDeviceInfoList
(
set
);
SetupDiDestroyDeviceInfoList
(
set2
);
/* remove once Wine is fixed */
devinst_RegDeleteTreeW
(
HKEY_LOCAL_MACHINE
,
bogus
);
}
static
void
test_registry_property_a
(
void
)
...
...
@@ -992,14 +975,7 @@ todo_wine {
SetupDiDestroyDeviceInfoList
(
set
);
res
=
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
bogus
,
&
key
);
todo_wine
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"Key should not exist.
\n
"
);
/* FIXME: Remove when Wine is fixed */
if
(
res
==
ERROR_SUCCESS
)
{
/* Wine doesn't delete the information currently */
RegDeleteKeyA
(
HKEY_LOCAL_MACHINE
,
bogus
);
}
}
static
void
test_registry_property_w
(
void
)
...
...
@@ -1103,14 +1079,7 @@ todo_wine {
SetupDiDestroyDeviceInfoList
(
set
);
res
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
bogus
,
&
key
);
todo_wine
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"Key should not exist.
\n
"
);
/* FIXME: Remove when Wine is fixed */
if
(
res
==
ERROR_SUCCESS
)
{
/* Wine doesn't delete the information currently */
RegDeleteKeyW
(
HKEY_LOCAL_MACHINE
,
bogus
);
}
}
static
void
test_get_inf_class
(
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