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
dadcb201
Commit
dadcb201
authored
Sep 21, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Sep 24, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Implement SetupDiDeleteDeviceInterfaceRegKey.
parent
e69520ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
20 deletions
+80
-20
devinst.c
dlls/setupapi/devinst.c
+79
-20
setupapi.spec
dlls/setupapi/setupapi.spec
+1
-0
No files found.
dlls/setupapi/devinst.c
View file @
dadcb201
...
...
@@ -2224,6 +2224,33 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyA(
return
key
;
}
static
PWSTR
SETUPDI_GetInstancePath
(
struct
InterfaceInfo
*
ifaceInfo
)
{
static
const
WCHAR
hash
[]
=
{
'#'
,
0
};
PWSTR
instancePath
=
NULL
;
if
(
ifaceInfo
->
referenceString
)
{
instancePath
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
ifaceInfo
->
referenceString
)
+
2
)
*
sizeof
(
WCHAR
));
if
(
instancePath
)
{
lstrcpyW
(
instancePath
,
hash
);
lstrcatW
(
instancePath
,
ifaceInfo
->
referenceString
);
}
else
SetLastError
(
ERROR_OUTOFMEMORY
);
}
else
{
instancePath
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
hash
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
instancePath
)
lstrcpyW
(
instancePath
,
hash
);
}
return
instancePath
;
}
/***********************************************************************
* SetupDiCreateDeviceInterfaceRegKeyW (SETUPAPI.@)
*/
...
...
@@ -2271,28 +2298,10 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyW(
if
(
!
(
l
=
RegCreateKeyExW
(
interfacesKey
,
bracedGuidString
,
0
,
NULL
,
0
,
samDesired
,
NULL
,
&
parent
,
NULL
)))
{
static
const
WCHAR
hash
[]
=
{
'#'
,
0
};
struct
InterfaceInfo
*
ifaceInfo
=
(
struct
InterfaceInfo
*
)
DeviceInterfaceData
->
Reserved
;
LPCWSTR
instancePath
=
NULL
;
LPWSTR
referencePath
=
NULL
;
PWSTR
instancePath
=
SETUPDI_GetInstancePath
(
ifaceInfo
);
if
(
ifaceInfo
->
referenceString
)
{
referencePath
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
ifaceInfo
->
referenceString
)
+
2
)
*
sizeof
(
WCHAR
));
if
(
referencePath
)
{
lstrcpyW
(
referencePath
,
hash
);
lstrcatW
(
referencePath
,
ifaceInfo
->
referenceString
);
instancePath
=
referencePath
;
}
else
SetLastError
(
ERROR_OUTOFMEMORY
);
}
else
instancePath
=
hash
;
if
(
instancePath
)
{
LONG
l
;
...
...
@@ -2307,7 +2316,7 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyW(
else
if
(
InfHandle
)
FIXME
(
"INF section installation unsupported
\n
"
);
}
HeapFree
(
GetProcessHeap
(),
0
,
refere
ncePath
);
HeapFree
(
GetProcessHeap
(),
0
,
insta
ncePath
);
RegCloseKey
(
parent
);
}
else
...
...
@@ -2320,6 +2329,56 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyW(
}
/***********************************************************************
* SetupDiDeleteDeviceInterfaceRegKey (SETUPAPI.@)
*/
BOOL
WINAPI
SetupDiDeleteDeviceInterfaceRegKey
(
HDEVINFO
DeviceInfoSet
,
PSP_DEVICE_INTERFACE_DATA
DeviceInterfaceData
,
DWORD
Reserved
)
{
struct
DeviceInfoSet
*
set
=
(
struct
DeviceInfoSet
*
)
DeviceInfoSet
;
HKEY
parent
;
BOOL
ret
=
FALSE
;
TRACE
(
"%p %p %d
\n
"
,
DeviceInfoSet
,
DeviceInterfaceData
,
Reserved
);
if
(
!
DeviceInfoSet
||
DeviceInfoSet
==
(
HDEVINFO
)
INVALID_HANDLE_VALUE
||
set
->
magic
!=
SETUP_DEVICE_INFO_SET_MAGIC
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
FALSE
;
}
if
(
!
DeviceInterfaceData
||
DeviceInterfaceData
->
cbSize
!=
sizeof
(
SP_DEVICE_INTERFACE_DATA
)
||
!
DeviceInterfaceData
->
Reserved
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
parent
=
SetupDiOpenClassRegKeyExW
(
&
DeviceInterfaceData
->
InterfaceClassGuid
,
KEY_ALL_ACCESS
,
DIOCR_INTERFACE
,
NULL
,
NULL
);
if
(
parent
!=
INVALID_HANDLE_VALUE
)
{
struct
InterfaceInfo
*
ifaceInfo
=
(
struct
InterfaceInfo
*
)
DeviceInterfaceData
->
Reserved
;
PWSTR
instancePath
=
SETUPDI_GetInstancePath
(
ifaceInfo
);
if
(
instancePath
)
{
LONG
l
=
RegDeleteKeyW
(
parent
,
instancePath
);
if
(
l
)
SetLastError
(
l
);
else
ret
=
TRUE
;
HeapFree
(
GetProcessHeap
(),
0
,
instancePath
);
}
RegCloseKey
(
parent
);
}
return
ret
;
}
/***********************************************************************
* SetupDiEnumDeviceInterfaces (SETUPAPI.@)
*
* PARAMS
...
...
dlls/setupapi/setupapi.spec
View file @
dadcb201
...
...
@@ -295,6 +295,7 @@
@ stub SetupDiDeleteDevRegKey
@ stub SetupDiDeleteDeviceInfo
@ stub SetupDiDeleteDeviceInterfaceData
@ stdcall SetupDiDeleteDeviceInterfaceRegKey(ptr ptr long)
@ stub SetupDiDeleteDeviceRegKey
@ stub SetupDiDestroyClassImageList
@ stdcall SetupDiDestroyDeviceInfoList(long)
...
...
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