- Add a minimal implementation of SetupScanFileQueueW
- In SetupDiBuildDriverInfoList, add found drivers in the right driver
list
- In SetupDiEnumDriverInfoW, enumerate the right driver list if
DeviceInfoData is not NULL
Modified: trunk/reactos/lib/setupapi/devinst.c
Modified: trunk/reactos/lib/setupapi/queue.c
_____
Modified: trunk/reactos/lib/setupapi/devinst.c
--- trunk/reactos/lib/setupapi/devinst.c 2005-12-28 13:27:40 UTC
(rev 20393)
+++ trunk/reactos/lib/setupapi/devinst.c 2005-12-28 14:21:05 UTC
(rev 20394)
@@ -5389,6 +5389,7 @@
SetLastError(ERROR_INVALID_USER_BUFFER);
else
{
+ PLIST_ENTRY pDriverListHead = &list->DriverListHead;
BOOL Result;
InstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS_W);
@@ -5396,6 +5397,13 @@
if (!Result)
goto done;
+ if (DeviceInfoData)
+ {
+ struct DeviceInfoElement *devInfo = (struct
DeviceInfoElement *)DeviceInfoData->Reserved;
+ if (!(devInfo->CreationFlags & DICD_INHERIT_CLASSDRVS))
+ pDriverListHead = &devInfo->DriverListHead;
+ }
+
if (DriverType == SPDIT_COMPATDRIVER)
{
/* Get hardware IDs list */
@@ -5633,7 +5641,7 @@
{
/* FIXME: read [ControlFlags] /
ExcludeFromSelect */
if (!AddDriverToList(
- &list->DriverListHead,
+ pDriverListHead,
DriverType,
&ClassGuid,
ContextDevice,
@@ -5689,7 +5697,7 @@
if (wcsicmp(DeviceId, currentId) ==
0)
{
AddDriverToList(
- &((struct DeviceInfoElement
*)DeviceInfoData->Reserved)->DriverListHead,
+ pDriverListHead,
DriverType,
&ClassGuid,
ContextDevice,
@@ -5710,7 +5718,7 @@
if (wcsicmp(DeviceId,
currentId) == 0)
{
AddDriverToList(
- &((struct
DeviceInfoElement *)DeviceInfoData->Reserved)->DriverListHead,
+ pDriverListHead,
DriverType,
&ClassGuid,
ContextDevice,
@@ -6106,8 +6114,6 @@
SetLastError(ERROR_INVALID_HANDLE);
else if (DriverType != SPDIT_CLASSDRIVER && DriverType !=
SPDIT_COMPATDRIVER)
SetLastError(ERROR_INVALID_PARAMETER);
- else if (DriverType == SPDIT_CLASSDRIVER && DeviceInfoData)
- SetLastError(ERROR_INVALID_PARAMETER);
else if (DriverType == SPDIT_COMPATDRIVER && !DeviceInfoData)
SetLastError(ERROR_INVALID_PARAMETER);
else if (DriverInfoData->cbSize != sizeof(SP_DRVINFO_DATA_V1_W) &&
DriverInfoData->cbSize != sizeof(SP_DRVINFO_DATA_V2_W))
@@ -6118,8 +6124,7 @@
PLIST_ENTRY ItemList;
if (DeviceInfoData)
devInfo = (struct DeviceInfoElement
*)DeviceInfoData->Reserved;
- if (DriverType == SPDIT_CLASSDRIVER ||
- (devInfo && devInfo->CreationFlags &
DICD_INHERIT_CLASSDRVS))
+ if (!devInfo || (devInfo->CreationFlags &
DICD_INHERIT_CLASSDRVS))
{
ListHead = &((struct DeviceInfoSet
*)DeviceInfoSet)->DriverListHead;
}
_____
Modified: trunk/reactos/lib/setupapi/queue.c
--- trunk/reactos/lib/setupapi/queue.c 2005-12-28 13:27:40 UTC (rev
20393)
+++ trunk/reactos/lib/setupapi/queue.c 2005-12-28 14:21:05 UTC (rev
20394)
@@ -1200,11 +1200,43 @@
/***********************************************************************
* SetupScanFileQueueW (SETUPAPI.@)
*/
-BOOL WINAPI SetupScanFileQueueW( HSPFILEQ queue, DWORD flags, HWND
window,
+BOOL WINAPI SetupScanFileQueueW( HSPFILEQ handle, DWORD flags, HWND
window,
PSP_FILE_CALLBACK_W callback, PVOID
context, PDWORD result )
{
- FIXME("stub\n");
- return FALSE;
+ struct file_queue *queue = handle;
+ struct file_op *op;
+ BOOL allnodesprocessed = FALSE;
+ FILEPATHS_W paths;
+
+ paths.Source = paths.Target = NULL;
+ *result = FALSE;
+
+ if ( flags & (SPQ_SCAN_FILE_PRESENCE | SPQ_SCAN_FILE_VALIDITY |
SPQ_SCAN_USE_CALLBACKEX | SPQ_SCAN_INFORM_USER |
SPQ_SCAN_PRUNE_COPY_QUEUE /*| SPQ_SCAN_USE_CALLBACK_SIGNERINFO |
SPQ_SCAN_PRUNE_DELREN*/) )
+ {
+ FIXME( "flags ignored 0x%lx\n", flags & (SPQ_SCAN_FILE_PRESENCE
| SPQ_SCAN_FILE_VALIDITY | SPQ_SCAN_USE_CALLBACKEX |
SPQ_SCAN_INFORM_USER | SPQ_SCAN_PRUNE_COPY_QUEUE /*|
SPQ_SCAN_USE_CALLBACK_SIGNERINFO | SPQ_SCAN_PRUNE_DELREN*/) );
+ }
+
+ if (queue->copy_queue.count)
+ {
+ for (op = queue->copy_queue.head; op; op = op->next)
+ {
+ build_filepathsW( op, &paths );
+ if (flags & SPQ_SCAN_USE_CALLBACK)
+ {
+ /* FIXME: sometimes set param 2 to SPQ_DELAYED_COPY */
+ if (NO_ERROR != callback( context,
SPFILENOTIFY_QUEUESCAN, (UINT)paths.Target, 0 ))
+ goto done;
+ }
+ }
+ }
+
+ *result = TRUE;
+ allnodesprocessed = TRUE;
+
+ done:
+ HeapFree( GetProcessHeap(), 0, (void *)paths.Source );
+ HeapFree( GetProcessHeap(), 0, (void *)paths.Target );
+ return allnodesprocessed;
}