Implement SetupDiGetDeviceInstanceIdW

Fix debug message

svn path=/trunk/; revision=19613
This commit is contained in:
Hervé Poussineau 2005-11-26 08:13:04 +00:00
parent c7f5b6f782
commit a603a1cdc3
3 changed files with 68 additions and 28 deletions

View file

@ -143,7 +143,7 @@ DisplaySelectedDeviceProperties(IN PHARDWARE_PAGE_DATA hpd)
0,
&DeviceInstanceIdLen))
{
DPRINT1("SetupDiGetDeviceInterfaceDetail unexpectedly returned TRUE!\n");
DPRINT1("SetupDiGetDeviceInstanceId unexpectedly returned TRUE!\n");
goto Cleanup;
}

View file

@ -3004,7 +3004,7 @@ BOOL WINAPI SetupDiCallClassInstaller(
{
BOOL ret = FALSE;
TRACE("%ld %p %p\n", InstallFunction, DeviceInfoSet, DeviceInfoData);
TRACE("%u %p %p\n", InstallFunction, DeviceInfoSet, DeviceInfoData);
if (!DeviceInfoSet)
SetLastError(ERROR_INVALID_PARAMETER);
@ -3063,7 +3063,7 @@ BOOL WINAPI SetupDiCallClassInstaller(
DefaultHandler = SetupDiSelectBestCompatDrv;
break;
default:
ERR("Install function %lu not supported\n", InstallFunction);
ERR("Install function %u not supported\n", InstallFunction);
SetLastError(ERROR_NOT_SUPPORTED);
}
@ -3462,6 +3462,71 @@ BOOL WINAPI SetupDiSetDeviceInstallParamsW(
return ret;
}
/***********************************************************************
* SetupDiGetDeviceInstanceIdA(SETUPAPI.@)
*/
BOOL WINAPI SetupDiGetDeviceInstanceIdA(
IN HDEVINFO DeviceInfoSet,
IN PSP_DEVINFO_DATA DeviceInfoData,
OUT PSTR DeviceInstanceId,
IN DWORD DeviceInstanceIdSize,
OUT PDWORD RequiredSize)
{
FIXME ("Stub %p %p %p %d %p\n",
DeviceInfoSet, DeviceInfoData, DeviceInstanceId, DeviceInstanceIdSize, RequiredSize);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/***********************************************************************
* SetupDiGetDeviceInstanceIdW(SETUPAPI.@)
*/
BOOL WINAPI SetupDiGetDeviceInstanceIdW(
IN HDEVINFO DeviceInfoSet,
IN PSP_DEVINFO_DATA DeviceInfoData,
OUT PWSTR DeviceInstanceId,
IN DWORD DeviceInstanceIdSize,
OUT PDWORD RequiredSize)
{
BOOL ret = FALSE;
TRACE("%p %p %p %lu %p\n", DeviceInfoSet, DeviceInfoData,
DeviceInstanceId, DeviceInstanceIdSize, RequiredSize);
if (!DeviceInfoSet)
SetLastError(ERROR_INVALID_HANDLE);
else if (((struct DeviceInfoSet *)DeviceInfoSet)->magic != SETUP_DEV_INFO_SET_MAGIC)
SetLastError(ERROR_INVALID_HANDLE);
else if (!DeviceInfoData)
SetLastError(ERROR_INVALID_PARAMETER);
else if (DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA))
SetLastError(ERROR_INVALID_USER_BUFFER);
else if (!DeviceInstanceId && DeviceInstanceIdSize > 0)
SetLastError(ERROR_INVALID_PARAMETER);
else if (DeviceInstanceId && DeviceInstanceIdSize == 0)
SetLastError(ERROR_INVALID_PARAMETER);
else
{
struct DeviceInfoElement *DevInfo = (struct DeviceInfoElement *)DeviceInfoData->Reserved;
DWORD required;
required = (wcslen(DevInfo->DeviceName) + 1) * sizeof(WCHAR);
if (RequiredSize)
*RequiredSize = required;
if (required <= DeviceInstanceIdSize)
{
wcscpy(DeviceInstanceId, DevInfo->DeviceName);
ret = TRUE;
}
else
SetLastError(ERROR_INSUFFICIENT_BUFFER);
}
TRACE("Returning 0x%p\n", ret);
return ret;
}
/***********************************************************************
* SetupDiCreateDevRegKeyA (SETUPAPI.@)
*/

View file

@ -225,31 +225,6 @@ BOOL WINAPI SetupDiDestroyClassImageList(PSP_CLASSIMAGELIST_DATA ClassImageListD
return TRUE;
}
/***********************************************************************
* SetupDiGetDeviceInstanceIdA(SETUPAPI.@)
*/
BOOL WINAPI SetupDiGetDeviceInstanceIdA(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData,
PSTR DeviceInstanceId, DWORD DeviceInstanceIdSize,
PDWORD RequiredSize)
{
FIXME ("Stub %p %p %p %d %p\n",
DeviceInfoSet, DeviceInfoData, DeviceInstanceId, DeviceInstanceIdSize, RequiredSize);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/***********************************************************************
* SetupDiGetDeviceInstanceIdW(SETUPAPI.@)
*/
BOOL WINAPI SetupDiGetDeviceInstanceIdW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData,
PWSTR DeviceInstanceId, DWORD DeviceInstanceIdSize,
PDWORD RequiredSize)
{
FIXME ("Stub %p %p %p %d %p\n",
DeviceInfoSet, DeviceInfoData, DeviceInstanceId, DeviceInstanceIdSize, RequiredSize);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/***********************************************************************
* SetupDiGetClassDevPropertySheetsA(SETUPAPI.@)