Commit 634cba84 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

setupapi: Implement SetupDiEnumDeviceInfo.

parent a7ad54ef
......@@ -769,15 +769,38 @@ BOOL WINAPI SetupDiEnumDeviceInfo(
DWORD index,
PSP_DEVINFO_DATA info)
{
FIXME("%p %d %p\n", devinfo, index, info);
BOOL ret = FALSE;
TRACE("%p %d %p\n", devinfo, index, info);
if(info==NULL)
return FALSE;
if(info->cbSize < sizeof(*info))
return FALSE;
SetLastError(ERROR_NO_MORE_ITEMS);
return FALSE;
if (devinfo && devinfo != (HDEVINFO)INVALID_HANDLE_VALUE)
{
struct DeviceInfoSet *list = (struct DeviceInfoSet *)devinfo;
if (list->magic == SETUP_DEVICE_INFO_SET_MAGIC)
{
if (index < list->cDevices)
{
if (info->cbSize == sizeof(SP_DEVINFO_DATA))
{
memcpy(info, &list->devices[index], info->cbSize);
ret = TRUE;
}
else
SetLastError(ERROR_INVALID_USER_BUFFER);
}
else
SetLastError(ERROR_NO_MORE_ITEMS);
}
else
SetLastError(ERROR_INVALID_HANDLE);
}
else
SetLastError(ERROR_INVALID_HANDLE);
return ret;
}
/***********************************************************************
......
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