Commit 69d3afc9 authored by Eric Kohl's avatar Eric Kohl Committed by Alexandre Julliard

- Implement SetupDiBuildClassInfoListExA,

SetupDiClassGuidsFromNameExA, SetupDiCreateDeviceInfoListExA and SetupDiOpenClassRegKeyExA using MultiByteToUnicode. - Retrieve OS version upon process attach.
parent c2c87daf
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
#include "rpc.h" #include "rpc.h"
#include "rpcdce.h" #include "rpcdce.h"
#include "setupapi_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(setupapi); WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
...@@ -90,8 +92,25 @@ BOOL WINAPI SetupDiBuildClassInfoListExA( ...@@ -90,8 +92,25 @@ BOOL WINAPI SetupDiBuildClassInfoListExA(
LPCSTR MachineName, LPCSTR MachineName,
PVOID Reserved) PVOID Reserved)
{ {
FIXME("\n"); LPWSTR MachineNameW = NULL;
return FALSE; 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;
} }
/*********************************************************************** /***********************************************************************
...@@ -267,8 +286,36 @@ BOOL WINAPI SetupDiClassGuidsFromNameExA( ...@@ -267,8 +286,36 @@ BOOL WINAPI SetupDiClassGuidsFromNameExA(
LPCSTR MachineName, LPCSTR MachineName,
PVOID Reserved) PVOID Reserved)
{ {
LPWSTR ClassNameW = NULL;
LPWSTR MachineNameW = NULL;
BOOL bResult;
FIXME("\n"); 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; return FALSE;
}
}
bResult = SetupDiClassGuidsFromNameExW(ClassNameW, ClassGuidList,
ClassGuidListSize, RequiredSize,
MachineNameW, Reserved);
if (MachineNameW)
MyFree(MachineNameW);
MyFree(ClassNameW);
return bResult;
} }
/*********************************************************************** /***********************************************************************
...@@ -502,8 +549,25 @@ SetupDiCreateDeviceInfoListExA(const GUID *ClassGuid, ...@@ -502,8 +549,25 @@ SetupDiCreateDeviceInfoListExA(const GUID *ClassGuid,
PCSTR MachineName, PCSTR MachineName,
PVOID Reserved) PVOID Reserved)
{ {
FIXME("\n"); LPWSTR MachineNameW = NULL;
HDEVINFO hDevInfo;
TRACE("\n");
if (MachineName)
{
MachineNameW = MultiByteToUnicode(MachineName, CP_ACP);
if (MachineNameW == NULL)
return (HDEVINFO)INVALID_HANDLE_VALUE; return (HDEVINFO)INVALID_HANDLE_VALUE;
}
hDevInfo = SetupDiCreateDeviceInfoListExW(ClassGuid, hwndParent,
MachineNameW, Reserved);
if (MachineNameW)
MyFree(MachineNameW);
return hDevInfo;
} }
/*********************************************************************** /***********************************************************************
...@@ -587,17 +651,10 @@ BOOL WINAPI SetupDiGetActualSectionToInstallW( ...@@ -587,17 +651,10 @@ BOOL WINAPI SetupDiGetActualSectionToInstallW(
PWSTR *Extension) PWSTR *Extension)
{ {
WCHAR szBuffer[MAX_PATH]; WCHAR szBuffer[MAX_PATH];
OSVERSIONINFOW OsVersionInfo;
DWORD dwLength; DWORD dwLength;
DWORD dwFullLength; DWORD dwFullLength;
LONG lLineCount = -1; LONG lLineCount = -1;
OsVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
if (!GetVersionExW(&OsVersionInfo))
{
return FALSE;
}
lstrcpyW(szBuffer, InfSectionName); lstrcpyW(szBuffer, InfSectionName);
dwLength = lstrlenW(szBuffer); dwLength = lstrlenW(szBuffer);
...@@ -1048,8 +1105,25 @@ HKEY WINAPI SetupDiOpenClassRegKeyExA( ...@@ -1048,8 +1105,25 @@ HKEY WINAPI SetupDiOpenClassRegKeyExA(
PCSTR MachineName, PCSTR MachineName,
PVOID Reserved) PVOID Reserved)
{ {
FIXME("\n"); PWSTR MachineNameW = NULL;
HKEY hKey;
TRACE("\n");
if (MachineName)
{
MachineNameW = MultiByteToUnicode(MachineName, CP_ACP);
if (MachineNameW == NULL)
return INVALID_HANDLE_VALUE; return INVALID_HANDLE_VALUE;
}
hKey = SetupDiOpenClassRegKeyExW(ClassGuid, samDesired,
Flags, MachineNameW, Reserved);
if (MachineNameW)
MyFree(MachineNameW);
return hKey;
} }
...@@ -1125,7 +1199,7 @@ HKEY WINAPI SetupDiOpenClassRegKeyExW( ...@@ -1125,7 +1199,7 @@ HKEY WINAPI SetupDiOpenClassRegKeyExW(
} }
/*********************************************************************** /***********************************************************************
* SetupDiOpenDeviceInterfaceA (SETUPAPI.@) * SetupDiOpenDeviceInterfaceW (SETUPAPI.@)
*/ */
BOOL WINAPI SetupDiOpenDeviceInterfaceW( BOOL WINAPI SetupDiOpenDeviceInterfaceW(
HDEVINFO DeviceInfoSet, HDEVINFO DeviceInfoSet,
......
...@@ -54,4 +54,6 @@ UINT CALLBACK QUEUE_callback_WtoA( void *context, UINT notification, UINT_PTR, U ...@@ -54,4 +54,6 @@ UINT CALLBACK QUEUE_callback_WtoA( void *context, UINT notification, UINT_PTR, U
#define _S_IWRITE 0x0080 #define _S_IWRITE 0x0080
#define _S_IREAD 0x0100 #define _S_IREAD 0x0100
extern OSVERSIONINFOW OsVersionInfo;
#endif /* __SETUPAPI_PRIVATE_H */ #endif /* __SETUPAPI_PRIVATE_H */
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
#include "wine/debug.h" #include "wine/debug.h"
OSVERSIONINFOW OsVersionInfo;
static HINSTANCE CABINET_hInstance = 0; static HINSTANCE CABINET_hInstance = 0;
static HFDI (__cdecl *sc_FDICreate)(PFNALLOC, PFNFREE, PFNOPEN, static HFDI (__cdecl *sc_FDICreate)(PFNALLOC, PFNFREE, PFNOPEN,
...@@ -674,6 +676,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) ...@@ -674,6 +676,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
switch (fdwReason) { switch (fdwReason) {
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hinstDLL); DisableThreadLibraryCalls(hinstDLL);
OsVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW);
if (!GetVersionExW(&OsVersionInfo))
return FALSE;
break; break;
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
UnloadCABINETDll(); UnloadCABINETDll();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment