Implement SetupDiGetClassDevs(Ex)A/W
Modified: trunk/reactos/include/wine/setupapi.h
Modified: trunk/reactos/lib/setupapi/devinst.c
_____
Modified: trunk/reactos/include/wine/setupapi.h
--- trunk/reactos/include/wine/setupapi.h 2005-07-05 12:06:27 UTC
(rev 16424)
+++ trunk/reactos/include/wine/setupapi.h 2005-07-05 12:59:14 UTC
(rev 16425)
@@ -613,7 +613,7 @@
#define ERROR_NO_SUCH_INTERFACE_DEVICE
ERROR_NO_SUCH_DEVICE_INTERFACE
#define ERROR_NOT_INSTALLED
(APPLICATION_ERROR_MASK|ERROR_SEVERITY_ERROR|0x1000)
-/* flags for SetupDiGetClassDevs */
+/* flags for SetupDiGetClassDevs(Ex) */
#define DIGCF_DEFAULT 0x00000001
#define DIGCF_PRESENT 0x00000002
#define DIGCF_ALLCLASSES 0x00000004
@@ -741,6 +741,9 @@
HDEVINFO WINAPI SetupDiGetClassDevsA(CONST GUID *,LPCSTR,HWND,DWORD);
HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID *,LPCWSTR,HWND,DWORD);
#define SetupDiGetClassDevs
WINELIB_NAME_AW(SetupDiGetClassDevs)
+HDEVINFO WINAPI SetupDiGetClassDevsExA(CONST GUID
*,LPCSTR,HWND,DWORD,LPCSTR,PVOID);
+HDEVINFO WINAPI SetupDiGetClassDevsExW(CONST GUID
*,LPCWSTR,HWND,DWORD,LPCWSTR,PVOID);
+#define SetupDiGetClassDevsEx
WINELIB_NAME_AW(SetupDiGetClassDevsEx)
BOOL WINAPI SetupDiGetDeviceInterfaceDetailA(HDEVINFO,
PSP_DEVICE_INTERFACE_DATA, PSP_DEVICE_INTERFACE_DETAIL_DATA_A,
DWORD, PDWORD,
PSP_DEVINFO_DATA);
BOOL WINAPI SetupDiGetDeviceInterfaceDetailW(HDEVINFO,
PSP_DEVICE_INTERFACE_DATA, PSP_DEVICE_INTERFACE_DETAIL_DATA_W,
_____
Modified: trunk/reactos/lib/setupapi/devinst.c
--- trunk/reactos/lib/setupapi/devinst.c 2005-07-05 12:06:27 UTC
(rev 16424)
+++ trunk/reactos/lib/setupapi/devinst.c 2005-07-05 12:59:14 UTC
(rev 16425)
@@ -949,8 +949,37 @@
HWND parent,
DWORD flags)
{
+ return SetupDiGetClassDevsExA(class, enumstr, parent,
+ flags, NULL, NULL);
+}
+
+/**********************************************************************
*
+ * SetupDiGetClassDevsW (SETUPAPI.@)
+ */
+HDEVINFO WINAPI SetupDiGetClassDevsW(
+ CONST GUID *class,
+ LPCWSTR enumstr,
+ HWND parent,
+ DWORD flags)
+{
+ return SetupDiGetClassDevsExW(class, enumstr, parent,
+ flags, NULL, NULL);
+}
+
+/**********************************************************************
*
+ * SetupDiGetClassDevsExA (SETUPAPI.@)
+ */
+HDEVINFO WINAPI SetupDiGetClassDevsExA(
+ CONST GUID *class,
+ LPCSTR enumstr,
+ HWND parent,
+ DWORD flags,
+ LPCSTR machine,
+ PVOID reserved)
+{
HDEVINFO ret;
LPWSTR enumstrW = NULL;
+ LPWSTR machineW = NULL;
if (enumstr)
{
@@ -963,10 +992,22 @@
}
MultiByteToWideChar(CP_ACP, 0, enumstr, -1, enumstrW, len);
}
- ret = SetupDiGetClassDevsW(class, enumstrW, parent, flags);
- HeapFree(GetProcessHeap(), 0, enumstrW);
+ if (machine)
+ {
+ int len = MultiByteToWideChar(CP_ACP, 0, machine, -1, NULL, 0);
+ machineW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
+ if (!machineW)
+ {
+ ret = (HDEVINFO)INVALID_HANDLE_VALUE;
+ goto end;
+ }
+ MultiByteToWideChar(CP_ACP, 0, machine, -1, machineW, len);
+ }
+ ret = SetupDiGetClassDevsExW(class, enumstrW, parent, flags,
machineW, reserved);
end:
+ HeapFree(GetProcessHeap(), 0, enumstrW);
+ HeapFree(GetProcessHeap(), 0, machineW);
return ret;
}
@@ -1079,7 +1120,6 @@
return INVALID_HANDLE_VALUE;
}
- FIXME("subKeys %ld, maxSubKey %ld\n", subKeys, maxSubKey);
for (i = 0; i < subKeys; i++)
{
deviceInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(DeviceInfo)
+ maxSubKey * sizeof(WCHAR));
@@ -1108,13 +1148,15 @@
}
/***********************************************************************
- * SetupDiGetClassDevsW (SETUPAPI.@)
+ * SetupDiGetClassDevsExW (SETUPAPI.@)
*/
-HDEVINFO WINAPI SetupDiGetClassDevsW(
+HDEVINFO WINAPI SetupDiGetClassDevsExW(
CONST GUID *class,
LPCWSTR enumstr,
HWND parent,
- DWORD flags)
+ DWORD flags,
+ LPCWSTR machine,
+ PVOID reserved)
{
HDEVINFO ret = (HDEVINFO)INVALID_HANDLE_VALUE;
@@ -1141,7 +1183,7 @@
else
#else
{
- ret = SETUP_CreateDevListFromClass(NULL, (LPGUID)class);
+ ret = SETUP_CreateDevListFromClass(machine, (LPGUID)class);
}
#endif
}