Don't assume that a device without driver doesn't need any driver. It can simply not be installed

Better debugging messages

svn path=/trunk/; revision=27000
This commit is contained in:
Hervé Poussineau 2007-06-04 19:32:28 +00:00
parent 5423d567cc
commit 5f83cc2f85
3 changed files with 16 additions and 17 deletions

View file

@ -2806,7 +2806,7 @@ NtCancelIoFile(IN HANDLE FileHandle,
} }
/* Lower the IRQL */ /* Lower the IRQL */
KeLowerIrql(OldIrql); KfLowerIrql(OldIrql);
} }
} }

View file

@ -786,14 +786,11 @@ IopResetDevice(PPLUGPLAY_CONTROL_RESET_DEVICE_DATA ResetDeviceData)
NTSTATUS Status = STATUS_SUCCESS; NTSTATUS Status = STATUS_SUCCESS;
UNICODE_STRING DeviceInstance; UNICODE_STRING DeviceInstance;
DPRINT("IopResetDevice() called\n");
DPRINT("Device name: %wZ\n", &ResetDeviceData->DeviceInstance);
Status = IopCaptureUnicodeString(&DeviceInstance, &ResetDeviceData->DeviceInstance); Status = IopCaptureUnicodeString(&DeviceInstance, &ResetDeviceData->DeviceInstance);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ return Status;
return Status;
} DPRINT("IopResetDevice(%wZ)\n", &DeviceInstance);
/* Get the device object */ /* Get the device object */
DeviceObject = IopGetDeviceObjectFromDeviceInstance(&DeviceInstance); DeviceObject = IopGetDeviceObjectFromDeviceInstance(&DeviceInstance);

View file

@ -1651,7 +1651,11 @@ IopGetParentIdPrefix(PDEVICE_NODE DeviceNode,
* instance path, the following test is required :( * instance path, the following test is required :(
*/ */
if (DeviceNode->Parent->InstancePath.Length == 0) if (DeviceNode->Parent->InstancePath.Length == 0)
{
DPRINT1("Parent of %wZ has NULL Instance path, please report!\n",
&DeviceNode->InstancePath);
return STATUS_UNSUCCESSFUL; return STATUS_UNSUCCESSFUL;
}
/* 1. Try to retrieve ParentIdPrefix from registry */ /* 1. Try to retrieve ParentIdPrefix from registry */
KeyNameBufferLength = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[0]) + MAX_PATH * sizeof(WCHAR); KeyNameBufferLength = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[0]) + MAX_PATH * sizeof(WCHAR);
@ -2205,7 +2209,6 @@ IopActionConfigureChildServices(PDEVICE_NODE DeviceNode,
PDEVICE_NODE ParentDeviceNode; PDEVICE_NODE ParentDeviceNode;
PUNICODE_STRING Service; PUNICODE_STRING Service;
UNICODE_STRING ClassGUID; UNICODE_STRING ClassGUID;
UNICODE_STRING NullString = RTL_CONSTANT_STRING(L"");
NTSTATUS Status; NTSTATUS Status;
DPRINT("IopActionConfigureChildServices(%p, %p)\n", DeviceNode, Context); DPRINT("IopActionConfigureChildServices(%p, %p)\n", DeviceNode, Context);
@ -2253,14 +2256,14 @@ IopActionConfigureChildServices(PDEVICE_NODE DeviceNode,
RtlInitUnicodeString(&ClassGUID, NULL); RtlInitUnicodeString(&ClassGUID, NULL);
QueryTable[0].Name = L"Service"; QueryTable[0].Name = L"Service";
QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT; QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED;
QueryTable[0].EntryContext = Service; QueryTable[0].EntryContext = Service;
QueryTable[1].Name = L"ClassGUID"; QueryTable[1].Name = L"ClassGUID";
QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT; QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT;
QueryTable[1].EntryContext = &ClassGUID; QueryTable[1].EntryContext = &ClassGUID;
QueryTable[1].DefaultType = REG_SZ; QueryTable[1].DefaultType = REG_SZ;
QueryTable[1].DefaultData = &NullString; QueryTable[1].DefaultData = L"";
QueryTable[1].DefaultLength = 0; QueryTable[1].DefaultLength = 0;
RtlAppendUnicodeToString(&RegKey, L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\"); RtlAppendUnicodeToString(&RegKey, L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\");
@ -2271,10 +2274,9 @@ IopActionConfigureChildServices(PDEVICE_NODE DeviceNode,
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("RtlQueryRegistryValues() failed (Status %x)\n", Status);
/* FIXME: Log the error */ /* FIXME: Log the error */
CPRINT("Could not retrieve configuration for device %S (Status %x)\n", DPRINT1("Could not retrieve configuration for device %wZ (Status 0x%08x)\n",
DeviceNode->InstancePath.Buffer, Status); &DeviceNode->InstancePath, Status);
IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED); IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED);
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
@ -2288,14 +2290,14 @@ IopActionConfigureChildServices(PDEVICE_NODE DeviceNode,
/* Device has a ClassGUID value, but no Service value. /* Device has a ClassGUID value, but no Service value.
* Suppose it is using the NULL driver, so state the * Suppose it is using the NULL driver, so state the
* device is started */ * device is started */
DPRINT("%wZ is using NULL driver\n", &DeviceNode->InstancePath); DPRINT1("%wZ is using NULL driver\n", &DeviceNode->InstancePath);
IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED); IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED);
DeviceNode->Flags |= DN_STARTED; DeviceNode->Flags |= DN_STARTED;
} }
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
DPRINT("Got Service %S\n", Service->Buffer); DPRINT1("Got Service %S\n", Service->Buffer);
} }
return STATUS_SUCCESS; return STATUS_SUCCESS;
@ -2418,8 +2420,8 @@ IopActionInitChildServices(PDEVICE_NODE DeviceNode,
} }
else else
{ {
DPRINT("Service %S is disabled or already initialized\n", DPRINT("Device %wZ is disabled or already initialized\n",
DeviceNode->ServiceName.Buffer); &DeviceNode->InstancePath);
} }
return STATUS_SUCCESS; return STATUS_SUCCESS;