- Implement SetupDiBuildClassInfoListExA, SetupDiClassGuidsFromNameExA,
SetupDiCreateDeviceInfoListExA and SetupDiOpenClassRegKeyExA using
MultiByteToUnicode.
- Retrieve OS version upon process attach.
Modified: trunk/reactos/lib/setupapi/devinst.c
Modified: trunk/reactos/lib/setupapi/setupapi_private.h
Modified: trunk/reactos/lib/setupapi/setupcab.c
_____
Modified: trunk/reactos/lib/setupapi/devinst.c
--- trunk/reactos/lib/setupapi/devinst.c 2005-01-31 23:58:10 UTC
(rev 13374)
+++ trunk/reactos/lib/setupapi/devinst.c 2005-02-01 13:58:33 UTC
(rev 13375)
@@ -20,7 +20,7 @@
#include "config.h"
#include "wine/port.h"
-
+
#include <stdarg.h>
#include "windef.h"
@@ -38,7 +38,9 @@
#include "rpc.h"
#include "rpcdce.h"
+#include "setupapi_private.h"
+
WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
/* Unicode constants */
@@ -90,8 +92,26 @@
LPCSTR MachineName,
PVOID Reserved)
{
- FIXME("\n");
- return FALSE;
+ LPWSTR MachineNameW = NULL;
+ BOOL bResult;
+
+ TRACE("\n");
+
+ if (MachineName)
+ {
+ MachineNameW = MultiByteToUnicode(MachineName, CP_ACP);
+ if (MachineNameW == NULL)
+ return FALSE;
+ }
+
+ bResult = SetupDiBuildClassInfoListExW(Flags, ClassGuidList,
+ ClassGuidListSize,
RequiredSize,
+ MachineNameW, Reserved);
+
+ if (MachineNameW)
+ MyFree(MachineNameW);
+
+ return bResult;
}
/***********************************************************************
@@ -237,9 +257,9 @@
DWORD ClassGuidListSize,
PDWORD RequiredSize)
{
- return SetupDiClassGuidsFromNameExA(ClassName, ClassGuidList,
- ClassGuidListSize, RequiredSize,
- NULL, NULL);
+ return SetupDiClassGuidsFromNameExA(ClassName, ClassGuidList,
+ ClassGuidListSize,
RequiredSize,
+ NULL, NULL);
}
/***********************************************************************
@@ -251,9 +271,9 @@
DWORD ClassGuidListSize,
PDWORD RequiredSize)
{
- return SetupDiClassGuidsFromNameExW(ClassName, ClassGuidList,
- ClassGuidListSize, RequiredSize,
- NULL, NULL);
+ return SetupDiClassGuidsFromNameExW(ClassName, ClassGuidList,
+ ClassGuidListSize,
RequiredSize,
+ NULL, NULL);
}
/***********************************************************************
@@ -267,8 +287,36 @@
LPCSTR MachineName,
PVOID Reserved)
{
- FIXME("\n");
- return FALSE;
+ LPWSTR ClassNameW = NULL;
+ LPWSTR MachineNameW = NULL;
+ BOOL bResult;
+
+ FIXME("\n");
+
+ ClassNameW = MultiByteToUnicode(ClassName, CP_ACP);
+ if (ClassNameW == NULL)
+ return FALSE;
+
+ if (MachineNameW)
+ {
+ MachineNameW = MultiByteToUnicode(MachineName, CP_ACP);
+ if (MachineNameW == NULL)
+ {
+ MyFree(ClassNameW);
+ return FALSE;
+ }
+ }
+
+ bResult = SetupDiClassGuidsFromNameExW(ClassNameW, ClassGuidList,
+ ClassGuidListSize,
RequiredSize,
+ MachineNameW, Reserved);
+
+ if (MachineNameW)
+ MyFree(MachineNameW);
+
+ MyFree(ClassNameW);
+
+ return bResult;
}
/***********************************************************************
@@ -502,8 +550,25 @@
PCSTR MachineName,
PVOID Reserved)
{
- FIXME("\n");
- return (HDEVINFO)INVALID_HANDLE_VALUE;
+ LPWSTR MachineNameW = NULL;
+ HDEVINFO hDevInfo;
+
+ TRACE("\n");
+
+ if (MachineName)
+ {
+ MachineNameW = MultiByteToUnicode(MachineName, CP_ACP);
+ if (MachineNameW == NULL)
+ return (HDEVINFO)INVALID_HANDLE_VALUE;
+ }
+
+ hDevInfo = SetupDiCreateDeviceInfoListExW(ClassGuid, hwndParent,
+ MachineNameW, Reserved);
+
+ if (MachineNameW)
+ MyFree(MachineNameW);
+
+ return hDevInfo;
}
/***********************************************************************
@@ -587,17 +652,10 @@
PWSTR *Extension)
{
WCHAR szBuffer[MAX_PATH];
- OSVERSIONINFOW OsVersionInfo;
DWORD dwLength;
DWORD dwFullLength;
LONG lLineCount = -1;
- OsVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
- if (!GetVersionExW(&OsVersionInfo))
- {
- return FALSE;
- }
-
lstrcpyW(szBuffer, InfSectionName);
dwLength = lstrlenW(szBuffer);
@@ -1048,8 +1106,25 @@
PCSTR MachineName,
PVOID Reserved)
{
- FIXME("\n");
- return INVALID_HANDLE_VALUE;
+ PWSTR MachineNameW = NULL;
+ HKEY hKey;
+
+ TRACE("\n");
+
+ if (MachineName)
+ {
+ MachineNameW = MultiByteToUnicode(MachineName, CP_ACP);
+ if (MachineNameW == NULL)
+ return INVALID_HANDLE_VALUE;
+ }
+
+ hKey = SetupDiOpenClassRegKeyExW(ClassGuid, samDesired,
+ Flags, MachineNameW, Reserved);
+
+ if (MachineNameW)
+ MyFree(MachineNameW);
+
+ return hKey;
}
@@ -1125,7 +1200,7 @@
}
/***********************************************************************
- * SetupDiOpenDeviceInterfaceA (SETUPAPI.@)
+ * SetupDiOpenDeviceInterfaceW (SETUPAPI.@)
*/
BOOL WINAPI SetupDiOpenDeviceInterfaceW(
HDEVINFO DeviceInfoSet,
_____
Modified: trunk/reactos/lib/setupapi/setupapi_private.h
--- trunk/reactos/lib/setupapi/setupapi_private.h 2005-01-31
23:58:10 UTC (rev 13374)
+++ trunk/reactos/lib/setupapi/setupapi_private.h 2005-02-01
13:58:33 UTC (rev 13375)
@@ -54,4 +54,6 @@
#define _S_IWRITE 0x0080
#define _S_IREAD 0x0100
+extern OSVERSIONINFOW OsVersionInfo;
+
#endif /* __SETUPAPI_PRIVATE_H */
_____
Modified: trunk/reactos/lib/setupapi/setupcab.c
--- trunk/reactos/lib/setupapi/setupcab.c 2005-01-31 23:58:10 UTC
(rev 13374)
+++ trunk/reactos/lib/setupapi/setupcab.c 2005-02-01 13:58:33 UTC
(rev 13375)
@@ -44,6 +44,8 @@
#include "wine/debug.h"
+OSVERSIONINFOW OsVersionInfo;
+
static HINSTANCE CABINET_hInstance = 0;
static HFDI (__cdecl *sc_FDICreate)(PFNALLOC, PFNFREE, PFNOPEN,
@@ -674,6 +676,9 @@
switch (fdwReason) {
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hinstDLL);
+ OsVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
+ if (!GetVersionExW(&OsVersionInfo))
+ return FALSE;
break;
case DLL_PROCESS_DETACH:
UnloadCABINETDll();