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
ba864263
Commit
ba864263
authored
Feb 29, 2008
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Mar 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setupapi: Implement CM_Get_Device_ID and add a stub for CM_Get_Parent.
parent
f6cbd9a0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
24 deletions
+81
-24
devinst.c
dlls/setupapi/devinst.c
+74
-6
setupapi.spec
dlls/setupapi/setupapi.spec
+2
-2
stubs.c
dlls/setupapi/stubs.c
+5
-16
No files found.
dlls/setupapi/devinst.c
View file @
ba864263
...
...
@@ -454,13 +454,16 @@ static HKEY SETUPDI_CreateDrvKey(struct DeviceInfo *devInfo)
static
struct
DeviceInfo
*
SETUPDI_AllocateDeviceInfo
(
struct
DeviceInfoSet
*
set
,
DWORD
devId
,
LPCWSTR
instanceId
,
BOOL
phantom
)
{
struct
DeviceInfo
*
devInfo
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
struct
DeviceInfo
));
struct
DeviceInfo
*
devInfo
=
NULL
;
HANDLE
devInst
=
GlobalAlloc
(
GMEM_FIXED
,
sizeof
(
struct
DeviceInfo
));
if
(
devInst
)
devInfo
=
GlobalLock
(
devInst
);
if
(
devInfo
)
{
devInfo
->
set
=
set
;
devInfo
->
devId
=
devId
;
devInfo
->
devId
=
(
DWORD
)
devInst
;
devInfo
->
instanceId
=
HeapAlloc
(
GetProcessHeap
(),
0
,
(
lstrlenW
(
instanceId
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
devInfo
->
instanceId
)
...
...
@@ -477,10 +480,12 @@ static struct DeviceInfo *SETUPDI_AllocateDeviceInfo(struct DeviceInfoSet *set,
(
LPBYTE
)
&
phantom
,
sizeof
(
phantom
));
}
list_init
(
&
devInfo
->
interfaces
);
GlobalUnlock
(
devInst
);
}
else
{
HeapFree
(
GetProcessHeap
(),
0
,
devInfo
);
GlobalUnlock
(
devInst
);
GlobalFree
(
devInst
);
devInfo
=
NULL
;
}
}
...
...
@@ -514,7 +519,7 @@ static void SETUPDI_FreeDeviceInfo(struct DeviceInfo *devInfo)
SETUPDI_FreeInterfaceInstances
(
iface
);
HeapFree
(
GetProcessHeap
(),
0
,
iface
);
}
HeapFree
(
GetProcessHeap
(),
0
,
devInfo
);
GlobalFree
((
HANDLE
)
devInfo
->
devId
);
}
/* Adds a device with GUID guid and identifer devInst to set. Allocates a
...
...
@@ -551,7 +556,7 @@ static BOOL SETUPDI_AddDeviceToSet(struct DeviceInfoSet *set,
DeviceInfoData
->
cbSize
=
sizeof
(
SP_DEVINFO_DATA
);
memcpy
(
&
DeviceInfoData
->
ClassGuid
,
guid
,
sizeof
(
GUID
));
DeviceInfoData
->
DevInst
=
devIn
st
;
DeviceInfoData
->
DevInst
=
devIn
fo
->
devId
;
DeviceInfoData
->
Reserved
=
(
ULONG_PTR
)
devInfo
;
SETUPDI_GuidToString
(
guid
,
classGuidStr
);
SetupDiSetDeviceRegistryPropertyW
((
HDEVINFO
)
set
,
...
...
@@ -3848,3 +3853,66 @@ BOOL WINAPI SetupDiDeleteDevRegKey(
}
return
ret
;
}
/***********************************************************************
* CM_Get_Device_IDA (SETUPAPI.@)
*/
CONFIGRET
WINAPI
CM_Get_Device_IDA
(
DEVINST
dnDevInst
,
PSTR
Buffer
,
ULONG
BufferLen
,
ULONG
ulFlags
)
{
struct
DeviceInfo
*
devInfo
=
GlobalLock
((
HANDLE
)
dnDevInst
);
TRACE
(
"%x->%p, %p, %u %u
\n
"
,
dnDevInst
,
devInfo
,
Buffer
,
BufferLen
,
ulFlags
);
if
(
!
devInfo
)
return
CR_NO_SUCH_DEVINST
;
WideCharToMultiByte
(
CP_ACP
,
0
,
devInfo
->
instanceId
,
-
1
,
Buffer
,
BufferLen
,
0
,
0
);
TRACE
(
"Returning %s
\n
"
,
debugstr_a
(
Buffer
));
return
CR_SUCCESS
;
}
/***********************************************************************
* CM_Get_Device_IDW (SETUPAPI.@)
*/
CONFIGRET
WINAPI
CM_Get_Device_IDW
(
DEVINST
dnDevInst
,
LPWSTR
Buffer
,
ULONG
BufferLen
,
ULONG
ulFlags
)
{
struct
DeviceInfo
*
devInfo
=
GlobalLock
((
HANDLE
)
dnDevInst
);
TRACE
(
"%x->%p, %p, %u %u
\n
"
,
dnDevInst
,
devInfo
,
Buffer
,
BufferLen
,
ulFlags
);
if
(
!
devInfo
)
{
WARN
(
"dev instance %d not found!
\n
"
,
dnDevInst
);
return
CR_NO_SUCH_DEVINST
;
}
lstrcpynW
(
Buffer
,
devInfo
->
instanceId
,
BufferLen
);
TRACE
(
"Returning %s
\n
"
,
debugstr_w
(
Buffer
));
GlobalUnlock
((
HANDLE
)
dnDevInst
);
return
CR_SUCCESS
;
}
/***********************************************************************
* CM_Get_Device_ID_Size (SETUPAPI.@)
*/
CONFIGRET
WINAPI
CM_Get_Device_ID_Size
(
PULONG
pulLen
,
DEVINST
dnDevInst
,
ULONG
ulFlags
)
{
struct
DeviceInfo
*
ppdevInfo
=
GlobalLock
((
HANDLE
)
dnDevInst
);
TRACE
(
"%x->%p, %p, %u
\n
"
,
dnDevInst
,
ppdevInfo
,
pulLen
,
ulFlags
);
if
(
!
ppdevInfo
)
{
WARN
(
"dev instance %d not found!
\n
"
,
dnDevInst
);
return
CR_NO_SUCH_DEVINST
;
}
*
pulLen
=
lstrlenW
(
ppdevInfo
->
instanceId
);
GlobalUnlock
((
HANDLE
)
dnDevInst
);
return
CR_SUCCESS
;
}
dlls/setupapi/setupapi.spec
View file @
ba864263
...
...
@@ -72,7 +72,7 @@
@ stub CM_Get_DevNode_Status
@ stub CM_Get_DevNode_Status_Ex
@ stdcall CM_Get_Device_IDA(ptr ptr long long)
@ st
ub CM_Get_Device_IDW
@ st
dcall CM_Get_Device_IDW(ptr ptr long long)
@ stub CM_Get_Device_ID_ExA
@ stub CM_Get_Device_ID_ExW
@ stdcall CM_Get_Device_ID_ListA(ptr ptr long long)
...
...
@@ -115,7 +115,7 @@
@ stub CM_Get_Next_Log_Conf_Ex
@ stub CM_Get_Next_Res_Des
@ stub CM_Get_Next_Res_Des_Ex
@ st
ub CM_Get_Parent
@ st
dcall CM_Get_Parent(ptr long long)
@ stub CM_Get_Parent_Ex
@ stub CM_Get_Res_Des_Data
@ stub CM_Get_Res_Des_Data_Ex
...
...
dlls/setupapi/stubs.c
View file @
ba864263
...
...
@@ -28,6 +28,7 @@
#include "winreg.h"
#include "cfgmgr32.h"
#include "setupapi.h"
#include "winnls.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
setupapi
);
...
...
@@ -70,17 +71,6 @@ CONFIGRET WINAPI CM_Disconnect_Machine(HMACHINE handle)
}
/***********************************************************************
* CM_Get_Device_IDA (SETUPAPI.@)
*/
CONFIGRET
WINAPI
CM_Get_Device_IDA
(
DEVINST
dnDevInst
,
PSTR
Buffer
,
ULONG
BufferLen
,
ULONG
ulFlags
)
{
FIXME
(
"%x, %p, %u %u
\n
"
,
dnDevInst
,
Buffer
,
BufferLen
,
ulFlags
);
Buffer
[
0
]
=
0
;
return
CR_SUCCESS
;
}
/***********************************************************************
* CM_Get_Device_ID_ListA (SETUPAPI.@)
*/
...
...
@@ -93,13 +83,12 @@ CONFIGRET WINAPI CM_Get_Device_ID_ListA(
}
/***********************************************************************
*
CM_Get_Device_ID_Size
(SETUPAPI.@)
*
CM_Get_Parent
(SETUPAPI.@)
*/
CONFIGRET
WINAPI
CM_Get_Device_ID_Size
(
PULONG
pulLen
,
DEVINST
dnDevInst
,
ULONG
ulFlags
)
DWORD
WINAPI
CM_Get_Parent
(
PDEVINST
pdnDevInst
,
DEVINST
dnDevInst
,
ULONG
ulFlags
)
{
FIXME
(
"%p
%x %u
\n
"
,
pulLen
,
dnDevInst
,
ulFlags
);
*
p
ulLen
=
1
;
FIXME
(
"%p
0x%08x 0x%08x stub
\n
"
,
pdnDevInst
,
dnDevInst
,
ulFlags
);
*
p
dnDevInst
=
dnDevInst
;
return
CR_SUCCESS
;
}
...
...
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