mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 08:52:57 +00:00
Handle MachineName parameter in SetupDiCreateDeviceInfoListExW
Eric, can you take care of the change in CM_Connect_MachineW? svn path=/trunk/; revision=22449
This commit is contained in:
parent
521b9caad9
commit
67950a1150
3 changed files with 17 additions and 19 deletions
|
@ -251,7 +251,14 @@ CONFIGRET WINAPI CM_Connect_MachineW(
|
||||||
|
|
||||||
TRACE("%s %p\n", debugstr_w(UNCServerName), phMachine);
|
TRACE("%s %p\n", debugstr_w(UNCServerName), phMachine);
|
||||||
|
|
||||||
pMachine = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MACHINE_INFO));
|
if (!UNCServerName)
|
||||||
|
{
|
||||||
|
FIXME("Connection to local machine not implemented\n");
|
||||||
|
*phMachine = NULL;
|
||||||
|
return CR_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
pMachine = HeapAlloc(GetProcessHeap(), 0, sizeof(MACHINE_INFO));
|
||||||
if (pMachine == NULL)
|
if (pMachine == NULL)
|
||||||
return CR_OUT_OF_MEMORY;
|
return CR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
|
|
@ -1701,6 +1701,8 @@ SetupDiInstallClassExW(
|
||||||
PVOID callback_context = NULL;
|
PVOID callback_context = NULL;
|
||||||
|
|
||||||
hDeviceInfo = SetupDiCreateDeviceInfoList(NULL, NULL);
|
hDeviceInfo = SetupDiCreateDeviceInfoList(NULL, NULL);
|
||||||
|
if (hDeviceInfo == INVALID_HANDLE_VALUE)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
InstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
|
InstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
|
||||||
if (!SetupDiGetDeviceInstallParamsW(hDeviceInfo, NULL, &InstallParams))
|
if (!SetupDiGetDeviceInstallParamsW(hDeviceInfo, NULL, &InstallParams))
|
||||||
|
|
|
@ -160,7 +160,7 @@ SetupDiCreateDeviceInfoListExW(
|
||||||
LPWSTR UNCServerName = NULL;
|
LPWSTR UNCServerName = NULL;
|
||||||
DWORD size;
|
DWORD size;
|
||||||
DWORD rc;
|
DWORD rc;
|
||||||
//CONFIGRET cr;
|
CONFIGRET cr;
|
||||||
HDEVINFO ret = (HDEVINFO)INVALID_HANDLE_VALUE;;
|
HDEVINFO ret = (HDEVINFO)INVALID_HANDLE_VALUE;;
|
||||||
|
|
||||||
TRACE("%s %p %s %p\n", debugstr_guid(ClassGuid), hwndParent,
|
TRACE("%s %p %s %p\n", debugstr_guid(ClassGuid), hwndParent,
|
||||||
|
@ -169,7 +169,7 @@ SetupDiCreateDeviceInfoListExW(
|
||||||
size = FIELD_OFFSET(struct DeviceInfoSet, szData);
|
size = FIELD_OFFSET(struct DeviceInfoSet, szData);
|
||||||
if (MachineName)
|
if (MachineName)
|
||||||
size += (strlenW(MachineName) + 3) * sizeof(WCHAR);
|
size += (strlenW(MachineName) + 3) * sizeof(WCHAR);
|
||||||
list = HeapAlloc(GetProcessHeap(), 0, size);
|
list = MyMalloc(size);
|
||||||
if (!list)
|
if (!list)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
@ -193,13 +193,14 @@ SetupDiCreateDeviceInfoListExW(
|
||||||
SetLastError(rc);
|
SetLastError(rc);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
UNCServerName = HeapAlloc(GetProcessHeap(), 0, (strlenW(MachineName) + 3) * sizeof(WCHAR));
|
UNCServerName = MyMalloc((strlenW(MachineName) + 3) * sizeof(WCHAR));
|
||||||
if (!UNCServerName)
|
if (!UNCServerName)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UNCServerName[0] = UNCServerName[1] = '\\';
|
||||||
strcpyW(UNCServerName + 2, MachineName);
|
strcpyW(UNCServerName + 2, MachineName);
|
||||||
list->szData[0] = list->szData[1] = '\\';
|
list->szData[0] = list->szData[1] = '\\';
|
||||||
strcpyW(list->szData + 2, MachineName);
|
strcpyW(list->szData + 2, MachineName);
|
||||||
|
@ -207,27 +208,15 @@ SetupDiCreateDeviceInfoListExW(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DWORD Size = MAX_PATH;
|
|
||||||
list->HKLM = HKEY_LOCAL_MACHINE;
|
list->HKLM = HKEY_LOCAL_MACHINE;
|
||||||
UNCServerName = HeapAlloc(GetProcessHeap(), 0, (MAX_PATH + 2) * sizeof(WCHAR));
|
|
||||||
if (!UNCServerName)
|
|
||||||
{
|
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
if (!GetComputerNameW(UNCServerName + 2, &Size))
|
|
||||||
goto cleanup;
|
|
||||||
list->MachineName = NULL;
|
list->MachineName = NULL;
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
UNCServerName[0] = UNCServerName[1] = '\\';
|
|
||||||
cr = CM_Connect_MachineW(UNCServerName, &list->hMachine);
|
cr = CM_Connect_MachineW(UNCServerName, &list->hMachine);
|
||||||
if (cr != CR_SUCCESS)
|
if (cr != CR_SUCCESS)
|
||||||
{
|
{
|
||||||
SetLastError(GetErrorCodeFromCrCode(cr));
|
SetLastError(GetErrorCodeFromCrCode(cr));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
InitializeListHead(&list->DriverListHead);
|
InitializeListHead(&list->DriverListHead);
|
||||||
InitializeListHead(&list->ListHead);
|
InitializeListHead(&list->ListHead);
|
||||||
|
|
||||||
|
@ -240,10 +229,10 @@ cleanup:
|
||||||
{
|
{
|
||||||
if (list->HKLM != NULL && list->HKLM != HKEY_LOCAL_MACHINE)
|
if (list->HKLM != NULL && list->HKLM != HKEY_LOCAL_MACHINE)
|
||||||
RegCloseKey(list->HKLM);
|
RegCloseKey(list->HKLM);
|
||||||
HeapFree(GetProcessHeap(), 0, list);
|
MyFree(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HeapFree(GetProcessHeap(), 0, UNCServerName);
|
MyFree(UNCServerName);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue