[NTOSKRNL] Whitespace fixes only.

This commit is contained in:
Hermès Bélusca-Maïto 2018-04-03 02:17:52 +02:00
parent 45012aa486
commit fa103197ad
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -179,7 +179,7 @@ IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject,
ULONG IdLength; ULONG IdLength;
DPRINT("IoReportDetectedDevice (DeviceObject %p, *DeviceObject %p)\n", DPRINT("IoReportDetectedDevice (DeviceObject %p, *DeviceObject %p)\n",
DeviceObject, DeviceObject ? *DeviceObject : NULL); DeviceObject, DeviceObject ? *DeviceObject : NULL);
ServiceName = DriverObject->DriverExtension->ServiceKeyName; ServiceName = DriverObject->DriverExtension->ServiceKeyName;
@ -274,33 +274,33 @@ IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject,
Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_MULTI_SZ, HardwareId, IdLength * sizeof(WCHAR)); Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_MULTI_SZ, HardwareId, IdLength * sizeof(WCHAR));
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("Failed to write the compatible IDs: 0x%x\n", Status); DPRINT("Failed to write the compatible IDs: 0x%x\n", Status);
ZwClose(InstanceKey); ZwClose(InstanceKey);
return Status; return Status;
} }
/* Add a hardware ID if the driver didn't report one */ /* Add a hardware ID if the driver didn't report one */
RtlInitUnicodeString(&ValueName, L"HardwareID"); RtlInitUnicodeString(&ValueName, L"HardwareID");
if (ZwQueryValueKey(InstanceKey, &ValueName, KeyValueBasicInformation, NULL, 0, &RequiredLength) == STATUS_OBJECT_NAME_NOT_FOUND) if (ZwQueryValueKey(InstanceKey, &ValueName, KeyValueBasicInformation, NULL, 0, &RequiredLength) == STATUS_OBJECT_NAME_NOT_FOUND)
{ {
/* Just use our most specific compatible ID */ /* Just use our most specific compatible ID */
IdLength = 0; IdLength = 0;
IdLength += swprintf(&HardwareId[IdLength], IdLength += swprintf(&HardwareId[IdLength],
L"DETECTED%ls\\%wZ", L"DETECTED%ls\\%wZ",
IfString, IfString,
&ServiceName); &ServiceName);
IdLength++; IdLength++;
HardwareId[IdLength++] = UNICODE_NULL; HardwareId[IdLength++] = UNICODE_NULL;
/* Write the value to the registry */ /* Write the value to the registry */
Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_MULTI_SZ, HardwareId, IdLength * sizeof(WCHAR)); Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_MULTI_SZ, HardwareId, IdLength * sizeof(WCHAR));
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("Failed to write the hardware ID: 0x%x\n", Status); DPRINT("Failed to write the hardware ID: 0x%x\n", Status);
ZwClose(InstanceKey); ZwClose(InstanceKey);
return Status; return Status;
} }
} }
/* Assign the resources to the device node */ /* Assign the resources to the device node */
@ -309,10 +309,10 @@ IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject,
/* Set appropriate flags */ /* Set appropriate flags */
if (DeviceNode->BootResources) if (DeviceNode->BootResources)
IopDeviceNodeSetFlag(DeviceNode, DNF_HAS_BOOT_CONFIG); IopDeviceNodeSetFlag(DeviceNode, DNF_HAS_BOOT_CONFIG);
if (!DeviceNode->ResourceRequirements && !DeviceNode->BootResources) if (!DeviceNode->ResourceRequirements && !DeviceNode->BootResources)
IopDeviceNodeSetFlag(DeviceNode, DNF_NO_RESOURCE_REQUIRED); IopDeviceNodeSetFlag(DeviceNode, DNF_NO_RESOURCE_REQUIRED);
/* Write the resource information to the registry */ /* Write the resource information to the registry */
IopSetDeviceInstanceData(InstanceKey, DeviceNode); IopSetDeviceInstanceData(InstanceKey, DeviceNode);
@ -320,15 +320,15 @@ IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject,
/* If the caller didn't get the resources assigned for us, do it now */ /* If the caller didn't get the resources assigned for us, do it now */
if (!ResourceAssigned) if (!ResourceAssigned)
{ {
Status = IopAssignDeviceResources(DeviceNode); Status = IopAssignDeviceResources(DeviceNode);
/* See if we failed */ /* See if we failed */
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
DPRINT("Assigning resources failed: 0x%x\n", Status); DPRINT("Assigning resources failed: 0x%x\n", Status);
ZwClose(InstanceKey); ZwClose(InstanceKey);
return Status; return Status;
} }
} }
/* Close the instance key handle */ /* Close the instance key handle */