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
d6a504ea
Commit
d6a504ea
authored
Dec 03, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Dec 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Implement SetupDiDeleteDeviceInterfaceData().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c05b54d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
8 deletions
+53
-8
devinst.c
dlls/setupapi/devinst.c
+28
-6
setupapi.spec
dlls/setupapi/setupapi.spec
+1
-1
devinst.c
dlls/setupapi/tests/devinst.c
+24
-1
No files found.
dlls/setupapi/devinst.c
View file @
d6a504ea
...
...
@@ -576,6 +576,16 @@ static void remove_device_iface(struct device_iface *iface)
iface
->
flags
|=
SPINT_REMOVED
;
}
static
void
delete_device_iface
(
struct
device_iface
*
iface
)
{
list_remove
(
&
iface
->
entry
);
RegCloseKey
(
iface
->
refstr_key
);
RegCloseKey
(
iface
->
class_key
);
heap_free
(
iface
->
refstr
);
heap_free
(
iface
->
symlink
);
heap_free
(
iface
);
}
static
void
remove_device
(
struct
device
*
device
)
{
WCHAR
id
[
MAX_DEVICE_ID_LEN
],
*
p
;
...
...
@@ -622,12 +632,7 @@ static void delete_device(struct device *device)
LIST_FOR_EACH_ENTRY_SAFE
(
iface
,
next
,
&
device
->
interfaces
,
struct
device_iface
,
entry
)
{
list_remove
(
&
iface
->
entry
);
RegCloseKey
(
iface
->
refstr_key
);
RegCloseKey
(
iface
->
class_key
);
heap_free
(
iface
->
refstr
);
heap_free
(
iface
->
symlink
);
heap_free
(
iface
);
delete_device_iface
(
iface
);
}
free_devnode
(
device
->
devnode
);
list_remove
(
&
device
->
entry
);
...
...
@@ -1599,6 +1604,23 @@ BOOL WINAPI SetupDiRemoveDeviceInterface(HDEVINFO devinfo, SP_DEVICE_INTERFACE_D
}
/***********************************************************************
* SetupDiDeleteDeviceInterfaceData (SETUPAPI.@)
*/
BOOL
WINAPI
SetupDiDeleteDeviceInterfaceData
(
HDEVINFO
devinfo
,
SP_DEVICE_INTERFACE_DATA
*
iface_data
)
{
struct
device_iface
*
iface
;
TRACE
(
"devinfo %p, iface_data %p.
\n
"
,
devinfo
,
iface_data
);
if
(
!
(
iface
=
get_device_iface
(
devinfo
,
iface_data
)))
return
FALSE
;
delete_device_iface
(
iface
);
return
TRUE
;
}
/***********************************************************************
* SetupDiEnumDeviceInfo (SETUPAPI.@)
*/
BOOL
WINAPI
SetupDiEnumDeviceInfo
(
HDEVINFO
devinfo
,
DWORD
index
,
SP_DEVINFO_DATA
*
device_data
)
...
...
dlls/setupapi/setupapi.spec
View file @
d6a504ea
...
...
@@ -302,7 +302,7 @@
@ stdcall SetupDiCreateDeviceInterfaceRegKeyW(ptr ptr long long ptr wstr)
@ stdcall SetupDiDeleteDevRegKey(ptr ptr long long long)
@ stdcall SetupDiDeleteDeviceInfo(ptr ptr)
@ st
ub SetupDiDeleteDeviceInterfaceData
@ st
dcall SetupDiDeleteDeviceInterfaceData(ptr ptr)
@ stdcall SetupDiDeleteDeviceInterfaceRegKey(ptr ptr long)
@ stub SetupDiDeleteDeviceRegKey
@ stdcall SetupDiDestroyClassImageList(ptr)
...
...
dlls/setupapi/tests/devinst.c
View file @
d6a504ea
...
...
@@ -650,6 +650,15 @@ static void test_device_iface(void)
check_device_iface
(
set
,
&
device
,
&
guid2
,
0
,
SPINT_REMOVED
,
"
\\\\
?
\\
ROOT#LEGACY_BOGUS#0000#{6A55B5A5-3F65-11DB-B704-0011955C2BDB}"
);
check_device_iface
(
set
,
&
device
,
&
guid2
,
1
,
0
,
NULL
);
ret
=
SetupDiEnumDeviceInterfaces
(
set
,
&
device
,
&
guid
,
0
,
&
iface
);
ok
(
ret
,
"Failed to enumerate interfaces, error %#x.
\n
"
,
GetLastError
());
ret
=
SetupDiDeleteDeviceInterfaceData
(
set
,
&
iface
);
ok
(
ret
,
"Failed to delete interface, error %#x.
\n
"
,
GetLastError
());
check_device_iface
(
set
,
&
device
,
&
guid
,
0
,
0
,
"
\\\\
?
\\
ROOT#LEGACY_BOGUS#0000#{6A55B5A4-3F65-11DB-B704-0011955C2BDB}
\\
Oogah"
);
check_device_iface
(
set
,
&
device
,
&
guid
,
1
,
0
,
"
\\\\
?
\\
ROOT#LEGACY_BOGUS#0000#{6A55B5A4-3F65-11DB-B704-0011955C2BDB}
\\
test"
);
check_device_iface
(
set
,
&
device
,
&
guid
,
2
,
0
,
NULL
);
ret
=
SetupDiDestroyDeviceInfoList
(
set
);
ok
(
ret
,
"Failed to destroy device list, error %#x.
\n
"
,
GetLastError
());
}
...
...
@@ -862,14 +871,28 @@ static void test_register_device_iface(void)
ok
(
ret
,
"Failed to create device, error %#x.
\n
"
,
GetLastError
());
ret
=
SetupDiCreateDeviceInterfaceA
(
set
,
&
device
,
&
guid
,
NULL
,
0
,
&
iface
);
ok
(
ret
,
"Failed to create interface, error %#x.
\n
"
,
GetLastError
());
ret
=
SetupDiCreateDeviceInterfaceA
(
set
,
&
device
,
&
guid
,
"removed"
,
0
,
&
iface
);
ok
(
ret
,
"Failed to create interface, error %#x.
\n
"
,
GetLastError
());
ret
=
SetupDiCreateDeviceInterfaceA
(
set
,
&
device
,
&
guid
,
"deleted"
,
0
,
&
iface
);
ok
(
ret
,
"Failed to create interface, error %#x.
\n
"
,
GetLastError
());
ret
=
SetupDiRegisterDeviceInfo
(
set
,
&
device
,
0
,
NULL
,
NULL
,
NULL
);
ok
(
ret
,
"Failed to register device, error %#x.
\n
"
,
GetLastError
());
ret
=
SetupDiEnumDeviceInterfaces
(
set
,
&
device
,
&
guid
,
1
,
&
iface
);
ok
(
ret
,
"Failed to enumerate interfaces, error %#x.
\n
"
,
GetLastError
());
ret
=
SetupDiRemoveDeviceInterface
(
set
,
&
iface
);
ok
(
ret
,
"Failed to delete interface, error %#x.
\n
"
,
GetLastError
());
ret
=
SetupDiEnumDeviceInterfaces
(
set
,
&
device
,
&
guid
,
2
,
&
iface
);
ok
(
ret
,
"Failed to enumerate interfaces, error %#x.
\n
"
,
GetLastError
());
ret
=
SetupDiDeleteDeviceInterfaceData
(
set
,
&
iface
);
ok
(
ret
,
"Failed to delete interface, error %#x.
\n
"
,
GetLastError
());
set2
=
SetupDiGetClassDevsA
(
&
guid
,
NULL
,
0
,
DIGCF_DEVICEINTERFACE
);
ok
(
set2
!=
INVALID_HANDLE_VALUE
,
"Failed to create device list, error %#x.
\n
"
,
GetLastError
());
check_device_iface
(
set2
,
NULL
,
&
guid
,
0
,
0
,
"
\\\\
?
\\
root#legacy_bogus#0000#{6a55b5a4-3f65-11db-b704-0011955c2bdb}"
);
check_device_iface
(
set2
,
NULL
,
&
guid
,
1
,
0
,
NULL
);
check_device_iface
(
set2
,
NULL
,
&
guid
,
1
,
0
,
"
\\\\
?
\\
root#legacy_bogus#0000#{6a55b5a4-3f65-11db-b704-0011955c2bdb}
\\
deleted"
);
check_device_iface
(
set2
,
NULL
,
&
guid
,
2
,
0
,
NULL
);
ret
=
SetupDiRemoveDevice
(
set
,
&
device
);
ok
(
ret
,
"Failed to remove device, error %#x.
\n
"
,
GetLastError
());
...
...
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