mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
Use Guid specified in device info set (if available) in SetupDiGetClassDevsExW.
Update some documentation (taken from Wine) svn path=/trunk/; revision=23999
This commit is contained in:
@@ -129,6 +129,9 @@ SetupDiBuildClassInfoList(
|
||||
/***********************************************************************
|
||||
* SetupDiBuildClassInfoListExA (SETUPAPI.@)
|
||||
*
|
||||
* Returns a list of setup class GUIDs that identify the classes
|
||||
* that are installed on a local or remote macine.
|
||||
*
|
||||
* PARAMS
|
||||
* Flags [I] control exclusion of classes from the list.
|
||||
* ClassGuidList [O] pointer to a GUID-typed array that receives a list of setup class GUIDs.
|
||||
@@ -906,10 +909,10 @@ cleanup:
|
||||
* SETUP_CreateDevicesListFromEnumerator
|
||||
*
|
||||
* PARAMS
|
||||
* list [I] Device info set to fill with discovered devices.
|
||||
* list [IO] Device info set to fill with discovered devices.
|
||||
* pClassGuid [I] If specified, only devices which belong to this class will be added.
|
||||
* Enumerator [I] Location to search devices to add.
|
||||
* hEnumeratorKey [O] Registry key corresponding to Enumerator key. Must have KEY_ENUMERATE_SUB_KEYS right.
|
||||
* hEnumeratorKey [I] Registry key corresponding to Enumerator key. Must have KEY_ENUMERATE_SUB_KEYS right.
|
||||
*
|
||||
* RETURNS
|
||||
* Success: ERROR_SUCCESS.
|
||||
@@ -1169,45 +1172,58 @@ SetupDiGetClassDevsExW(
|
||||
if (Flags & DIGCF_PROFILE)
|
||||
FIXME(": flag DIGCF_PROFILE ignored\n");
|
||||
|
||||
/* FIXME: list->ClassGuid is never used! */
|
||||
if (Flags & DIGCF_ALLCLASSES)
|
||||
pClassGuid = NULL;
|
||||
else if (ClassGuid)
|
||||
pClassGuid = ClassGuid;
|
||||
else
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (Flags & DIGCF_DEVICEINTERFACE)
|
||||
{
|
||||
rc = SETUP_CreateInterfaceList(list, MachineName, ClassGuid, Enumerator, Flags & DIGCF_PRESENT);
|
||||
if (rc != ERROR_SUCCESS)
|
||||
{
|
||||
SetLastError(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
ret = hDeviceInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Determine which class(es) should be included in the deviceset */
|
||||
if (Flags & DIGCF_ALLCLASSES)
|
||||
rc = SETUP_CreateDevicesList(list, MachineName, NULL, Enumerator);
|
||||
{
|
||||
/* The caller wants all classes. Check if
|
||||
* the deviceset limits us to one class */
|
||||
if (IsEqualIID(&list->ClassGuid, &GUID_NULL))
|
||||
pClassGuid = NULL;
|
||||
else
|
||||
pClassGuid = &list->ClassGuid;
|
||||
}
|
||||
else if (ClassGuid)
|
||||
rc = SETUP_CreateDevicesList(list, MachineName, pClassGuid, Enumerator);
|
||||
{
|
||||
/* The caller wants one class. Check if it matches deviceset class */
|
||||
if (IsEqualIID(&list->ClassGuid, ClassGuid)
|
||||
|| IsEqualIID(&list->ClassGuid, &GUID_NULL))
|
||||
{
|
||||
pClassGuid = ClassGuid;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
else if (!IsEqualIID(&list->ClassGuid, &GUID_NULL))
|
||||
{
|
||||
/* No class specified. Try to use the one of the deviceset */
|
||||
if (IsEqualIID(&list->ClassGuid, &GUID_NULL))
|
||||
pClassGuid = &list->ClassGuid;
|
||||
else
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
goto cleanup;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLastError(ERROR_INVALID_PARAMETER);
|
||||
goto cleanup;
|
||||
}
|
||||
if (rc != ERROR_SUCCESS)
|
||||
{
|
||||
SetLastError(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
ret = hDeviceInfo;
|
||||
rc = SETUP_CreateDevicesList(list, MachineName, pClassGuid, Enumerator);
|
||||
}
|
||||
if (rc != ERROR_SUCCESS)
|
||||
{
|
||||
SetLastError(rc);
|
||||
goto cleanup;
|
||||
}
|
||||
ret = hDeviceInfo;
|
||||
|
||||
cleanup:
|
||||
if (!DeviceInfoSet && hDeviceInfo != INVALID_HANDLE_VALUE && hDeviceInfo != ret)
|
||||
|
||||
@@ -83,7 +83,7 @@ SetupDiCreateDeviceInfoList(
|
||||
IN CONST GUID *ClassGuid OPTIONAL,
|
||||
IN HWND hwndParent OPTIONAL)
|
||||
{
|
||||
return SetupDiCreateDeviceInfoListExW(ClassGuid, hwndParent, NULL, NULL);
|
||||
return SetupDiCreateDeviceInfoListExW(ClassGuid, hwndParent, NULL, NULL);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -112,8 +112,7 @@ SetupDiCreateDeviceInfoListExA(
|
||||
hDevInfo = SetupDiCreateDeviceInfoListExW(ClassGuid, hwndParent,
|
||||
MachineNameW, Reserved);
|
||||
|
||||
if (MachineNameW)
|
||||
MyFree(MachineNameW);
|
||||
MyFree(MachineNameW);
|
||||
|
||||
return hDevInfo;
|
||||
}
|
||||
@@ -148,6 +147,20 @@ GetErrorCodeFromCrCode(const IN CONFIGRET cr)
|
||||
|
||||
/***********************************************************************
|
||||
* SetupDiCreateDeviceInfoListExW (SETUPAPI.@)
|
||||
*
|
||||
* Create an empty DeviceInfoSet list.
|
||||
*
|
||||
* PARAMS
|
||||
* ClassGuid [I] if not NULL only devices with GUID ClcassGuid are associated
|
||||
* with this list.
|
||||
* hwndParent [I] hwnd needed for interface related actions.
|
||||
* MachineName [I] name of machine to create emtpy DeviceInfoSet list, if NULL
|
||||
* local regestry will be used.
|
||||
* Reserved [I] must be NULL
|
||||
*
|
||||
* RETURNS
|
||||
* Success: empty list.
|
||||
* Failure: INVALID_HANDLE_VALUE.
|
||||
*/
|
||||
HDEVINFO WINAPI
|
||||
SetupDiCreateDeviceInfoListExW(
|
||||
@@ -175,7 +188,7 @@ SetupDiCreateDeviceInfoListExW(
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
goto cleanup;
|
||||
}
|
||||
memset(list, 0, sizeof(struct DeviceInfoSet));
|
||||
ZeroMemory(list, sizeof(struct DeviceInfoSet));
|
||||
|
||||
list->magic = SETUP_DEV_INFO_SET_MAGIC;
|
||||
memcpy(
|
||||
@@ -805,7 +818,7 @@ CreateDeviceInfoElement(
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
memset(deviceInfo, 0, size);
|
||||
ZeroMemory(deviceInfo, size);
|
||||
|
||||
cr = CM_Locate_DevNode_ExW(&deviceInfo->dnDevInst, (DEVINSTID_W)InstancePath, CM_LOCATE_DEVNODE_PHANTOM, list->hMachine);
|
||||
if (cr != CR_SUCCESS)
|
||||
@@ -1510,7 +1523,7 @@ SetupDiCallClassInstaller(
|
||||
coinstaller = HeapAlloc(GetProcessHeap(), 0, sizeof(struct CoInstallerElement));
|
||||
if (!coinstaller)
|
||||
continue;
|
||||
memset(coinstaller, 0, sizeof(struct CoInstallerElement));
|
||||
ZeroMemory(coinstaller, sizeof(struct CoInstallerElement));
|
||||
if (GetFunctionPointer(ptr, &coinstaller->Module, (PVOID*)&coinstaller->Function) == ERROR_SUCCESS)
|
||||
InsertTailList(&DeviceCoInstallersListHead, &coinstaller->ListEntry);
|
||||
else
|
||||
@@ -1554,7 +1567,7 @@ SetupDiCallClassInstaller(
|
||||
coinstaller = HeapAlloc(GetProcessHeap(), 0, sizeof(struct CoInstallerElement));
|
||||
if (!coinstaller)
|
||||
continue;
|
||||
memset(coinstaller, 0, sizeof(struct CoInstallerElement));
|
||||
ZeroMemory(coinstaller, sizeof(struct CoInstallerElement));
|
||||
if (GetFunctionPointer(ptr, &coinstaller->Module, (PVOID*)&coinstaller->Function) == ERROR_SUCCESS)
|
||||
InsertTailList(&ClassCoInstallersListHead, &coinstaller->ListEntry);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user