Reformat to the generic style of this file (indentation=3spaces, no tabs, functions declarations generalized).

Not everything maybe fixed, but at least it isn't a mess of TABs and spaces anymore.

*No code changes, pure formatting*

svn path=/trunk/; revision=19953
This commit is contained in:
Aleksey Bragin 2005-12-07 18:33:12 +00:00
parent db41ecbbff
commit 2e8b6ad70c

View file

@ -109,9 +109,9 @@ IopSetRootDeviceInstanceData(PDEVICE_NODE DeviceNode);
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
PDEVICE_NODE FASTCALL PDEVICE_NODE
IopGetDeviceNode( FASTCALL
PDEVICE_OBJECT DeviceObject) IopGetDeviceNode(PDEVICE_OBJECT DeviceObject)
{ {
return ((PEXTENDED_DEVOBJ_EXTENSION)DeviceObject->DeviceObjectExtension)->DeviceNode; return ((PEXTENDED_DEVOBJ_EXTENSION)DeviceObject->DeviceObjectExtension)->DeviceNode;
} }
@ -147,8 +147,7 @@ IopQueryDeviceCapabilities(PDEVICE_NODE DeviceNode,
*/ */
VOID VOID
STDCALL STDCALL
IoInvalidateDeviceRelations( IoInvalidateDeviceRelations(IN PDEVICE_OBJECT DeviceObject,
IN PDEVICE_OBJECT DeviceObject,
IN DEVICE_RELATION_TYPE Type) IN DEVICE_RELATION_TYPE Type)
{ {
IopInvalidateDeviceRelations(IopGetDeviceNode(DeviceObject), Type); IopInvalidateDeviceRelations(IopGetDeviceNode(DeviceObject), Type);
@ -159,8 +158,7 @@ IoInvalidateDeviceRelations(
*/ */
NTSTATUS NTSTATUS
STDCALL STDCALL
IoGetDeviceProperty( IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject,
IN PDEVICE_OBJECT DeviceObject,
IN DEVICE_REGISTRY_PROPERTY DeviceProperty, IN DEVICE_REGISTRY_PROPERTY DeviceProperty,
IN ULONG BufferLength, IN ULONG BufferLength,
OUT PVOID PropertyBuffer, OUT PVOID PropertyBuffer,
@ -218,7 +216,6 @@ IoGetDeviceProperty(
break; break;
case DevicePropertyAddress: case DevicePropertyAddress:
/* Query the device caps */ /* Query the device caps */
Status = IopQueryDeviceCapabilities(DeviceNode, &DeviceCaps); Status = IopQueryDeviceCapabilities(DeviceNode, &DeviceCaps);
if (NT_SUCCESS(Status) && (DeviceCaps.Address != (ULONG)-1)) if (NT_SUCCESS(Status) && (DeviceCaps.Address != (ULONG)-1))
@ -297,8 +294,7 @@ IoGetDeviceProperty(
KeyNameBuffer = ExAllocatePool(PagedPool, KeyNameBuffer = ExAllocatePool(PagedPool,
(49 * sizeof(WCHAR)) + DeviceNode->InstancePath.Length); (49 * sizeof(WCHAR)) + DeviceNode->InstancePath.Length);
DPRINT("KeyNameBuffer: 0x%p, value %S\n", DPRINT("KeyNameBuffer: 0x%p, value %S\n", KeyNameBuffer, RegistryPropertyName);
KeyNameBuffer, RegistryPropertyName);
if (KeyNameBuffer == NULL) if (KeyNameBuffer == NULL)
return STATUS_INSUFFICIENT_RESOURCES; return STATUS_INSUFFICIENT_RESOURCES;
@ -412,8 +408,7 @@ IoGetDeviceProperty(
*/ */
VOID VOID
STDCALL STDCALL
IoInvalidateDeviceState( IoInvalidateDeviceState(IN PDEVICE_OBJECT PhysicalDeviceObject)
IN PDEVICE_OBJECT PhysicalDeviceObject)
{ {
} }
@ -434,8 +429,7 @@ IoInvalidateDeviceState(
*/ */
NTSTATUS NTSTATUS
STDCALL STDCALL
IoOpenDeviceRegistryKey( IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject,
IN PDEVICE_OBJECT DeviceObject,
IN ULONG DevInstKeyType, IN ULONG DevInstKeyType,
IN ACCESS_MASK DesiredAccess, IN ACCESS_MASK DesiredAccess,
OUT PHANDLE DevInstRegKey) OUT PHANDLE DevInstRegKey)
@ -567,9 +561,7 @@ IoOpenDeviceRegistryKey(
*/ */
VOID VOID
STDCALL STDCALL
IoRequestDeviceEject( IoRequestDeviceEject(IN PDEVICE_OBJECT PhysicalDeviceObject)
IN PDEVICE_OBJECT PhysicalDeviceObject
)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
@ -789,8 +781,7 @@ IopFreeDeviceNode(PDEVICE_NODE DeviceNode)
} }
NTSTATUS NTSTATUS
IopInitiatePnpIrp( IopInitiatePnpIrp(PDEVICE_OBJECT DeviceObject,
PDEVICE_OBJECT DeviceObject,
PIO_STATUS_BLOCK IoStatusBlock, PIO_STATUS_BLOCK IoStatusBlock,
ULONG MinorFunction, ULONG MinorFunction,
PIO_STACK_LOCATION Stack OPTIONAL) PIO_STACK_LOCATION Stack OPTIONAL)
@ -828,8 +819,7 @@ IopInitiatePnpIrp(
if (Stack) if (Stack)
{ {
RtlMoveMemory( RtlMoveMemory(&IrpSp->Parameters,
&IrpSp->Parameters,
&Stack->Parameters, &Stack->Parameters,
sizeof(Stack->Parameters)); sizeof(Stack->Parameters));
} }
@ -837,8 +827,7 @@ IopInitiatePnpIrp(
Status = IoCallDriver(TopDeviceObject, Irp); Status = IoCallDriver(TopDeviceObject, Irp);
if (Status == STATUS_PENDING) if (Status == STATUS_PENDING)
{ {
KeWaitForSingleObject( KeWaitForSingleObject(&Event,
&Event,
Executive, Executive,
KernelMode, KernelMode,
FALSE, FALSE,
@ -853,8 +842,7 @@ IopInitiatePnpIrp(
NTSTATUS NTSTATUS
IopTraverseDeviceTreeNode( IopTraverseDeviceTreeNode(PDEVICETREE_TRAVERSE_CONTEXT Context)
PDEVICETREE_TRAVERSE_CONTEXT Context)
{ {
PDEVICE_NODE ParentDeviceNode; PDEVICE_NODE ParentDeviceNode;
PDEVICE_NODE ChildDeviceNode; PDEVICE_NODE ChildDeviceNode;
@ -890,8 +878,7 @@ IopTraverseDeviceTreeNode(
NTSTATUS NTSTATUS
IopTraverseDeviceTree( IopTraverseDeviceTree(PDEVICETREE_TRAVERSE_CONTEXT Context)
PDEVICETREE_TRAVERSE_CONTEXT Context)
{ {
NTSTATUS Status; NTSTATUS Status;
@ -916,7 +903,8 @@ IopTraverseDeviceTree(
} }
static NTSTATUS static
NTSTATUS
IopCreateDeviceKeyPath(PWSTR Path, IopCreateDeviceKeyPath(PWSTR Path,
PHANDLE Handle) PHANDLE Handle)
{ {
@ -994,7 +982,8 @@ IopCreateDeviceKeyPath(PWSTR Path,
} }
static NTSTATUS static
NTSTATUS
IopSetDeviceInstanceData(HANDLE InstanceKey, IopSetDeviceInstanceData(HANDLE InstanceKey,
PDEVICE_NODE DeviceNode) PDEVICE_NODE DeviceNode)
{ {
@ -1008,8 +997,7 @@ IopSetDeviceInstanceData(HANDLE InstanceKey,
DPRINT("IopSetDeviceInstanceData() called\n"); DPRINT("IopSetDeviceInstanceData() called\n");
/* Create the 'LogConf' key */ /* Create the 'LogConf' key */
RtlInitUnicodeString(&KeyName, RtlInitUnicodeString(&KeyName, L"LogConf");
L"LogConf");
InitializeObjectAttributes(&ObjectAttributes, InitializeObjectAttributes(&ObjectAttributes,
&KeyName, &KeyName,
OBJ_CASE_INSENSITIVE, OBJ_CASE_INSENSITIVE,
@ -1032,8 +1020,7 @@ IopSetDeviceInstanceData(HANDLE InstanceKey,
{ {
ListSize = CM_RESOURCE_LIST_SIZE(DeviceNode->BootResources); ListSize = CM_RESOURCE_LIST_SIZE(DeviceNode->BootResources);
RtlInitUnicodeString(&KeyName, RtlInitUnicodeString(&KeyName, L"BootConfig");
L"BootConfig");
Status = ZwSetValueKey(LogConfKey, Status = ZwSetValueKey(LogConfKey,
&KeyName, &KeyName,
0, 0,
@ -1047,8 +1034,7 @@ IopSetDeviceInstanceData(HANDLE InstanceKey,
if (DeviceNode->ResourceRequirements != NULL && if (DeviceNode->ResourceRequirements != NULL &&
DeviceNode->ResourceRequirements->ListSize != 0) DeviceNode->ResourceRequirements->ListSize != 0)
{ {
RtlInitUnicodeString(&KeyName, RtlInitUnicodeString(&KeyName, L"BasicConfigVector");
L"BasicConfigVector");
Status = ZwSetValueKey(LogConfKey, Status = ZwSetValueKey(LogConfKey,
&KeyName, &KeyName,
0, 0,
@ -1102,8 +1088,7 @@ IopSetDeviceInstanceData(HANDLE InstanceKey,
NTSTATUS NTSTATUS
IopAssignDeviceResources( IopAssignDeviceResources(PDEVICE_NODE DeviceNode)
PDEVICE_NODE DeviceNode)
{ {
PIO_RESOURCE_LIST ResourceList; PIO_RESOURCE_LIST ResourceList;
PIO_RESOURCE_DESCRIPTOR ResourceDescriptor; PIO_RESOURCE_DESCRIPTOR ResourceDescriptor;
@ -1362,8 +1347,7 @@ ByeBye:
*/ */
NTSTATUS NTSTATUS
IopGetParentIdPrefix( IopGetParentIdPrefix(PDEVICE_NODE DeviceNode,
PDEVICE_NODE DeviceNode,
PUNICODE_STRING ParentIdPrefix) PUNICODE_STRING ParentIdPrefix)
{ {
ULONG KeyNameBufferLength; ULONG KeyNameBufferLength;
@ -1438,9 +1422,10 @@ IopGetParentIdPrefix(
RtlInitUnicodeString(&KeyValue, (PWSTR)ParentIdPrefixInformation->Data); RtlInitUnicodeString(&KeyValue, (PWSTR)ParentIdPrefixInformation->Data);
/* 3. Try to write the ParentIdPrefix to registry */ /* 3. Try to write the ParentIdPrefix to registry */
Status = ZwSetValueKey( Status = ZwSetValueKey(hKey,
hKey, &ValueName, &ValueName,
0, REG_SZ, 0,
REG_SZ,
(PVOID)KeyValue.Buffer, (PVOID)KeyValue.Buffer,
(wcslen(KeyValue.Buffer) + 1) * sizeof(WCHAR)); (wcslen(KeyValue.Buffer) + 1) * sizeof(WCHAR));
@ -1478,8 +1463,7 @@ cleanup:
*/ */
NTSTATUS NTSTATUS
IopActionInterrogateDeviceStack( IopActionInterrogateDeviceStack(PDEVICE_NODE DeviceNode,
PDEVICE_NODE DeviceNode,
PVOID Context) PVOID Context)
{ {
IO_STATUS_BLOCK IoStatusBlock; IO_STATUS_BLOCK IoStatusBlock;
@ -1542,8 +1526,7 @@ IopActionInterrogateDeviceStack(
DPRINT("Sending IRP_MN_QUERY_ID.BusQueryDeviceID to device stack\n"); DPRINT("Sending IRP_MN_QUERY_ID.BusQueryDeviceID to device stack\n");
Stack.Parameters.QueryId.IdType = BusQueryDeviceID; Stack.Parameters.QueryId.IdType = BusQueryDeviceID;
Status = IopInitiatePnpIrp( Status = IopInitiatePnpIrp(DeviceNode->PhysicalDeviceObject,
DeviceNode->PhysicalDeviceObject,
&IoStatusBlock, &IoStatusBlock,
IRP_MN_QUERY_ID, IRP_MN_QUERY_ID,
&Stack); &Stack);
@ -1586,8 +1569,7 @@ IopActionInterrogateDeviceStack(
DPRINT("Sending IRP_MN_QUERY_ID.BusQueryInstanceID to device stack\n"); DPRINT("Sending IRP_MN_QUERY_ID.BusQueryInstanceID to device stack\n");
Stack.Parameters.QueryId.IdType = BusQueryInstanceID; Stack.Parameters.QueryId.IdType = BusQueryInstanceID;
Status = IopInitiatePnpIrp( Status = IopInitiatePnpIrp(DeviceNode->PhysicalDeviceObject,
DeviceNode->PhysicalDeviceObject,
&IoStatusBlock, &IoStatusBlock,
IRP_MN_QUERY_ID, IRP_MN_QUERY_ID,
&Stack); &Stack);
@ -1631,8 +1613,7 @@ IopActionInterrogateDeviceStack(
(49 * sizeof(WCHAR)) + DeviceNode->InstancePath.Length); (49 * sizeof(WCHAR)) + DeviceNode->InstancePath.Length);
wcscpy(KeyBuffer, L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\"); wcscpy(KeyBuffer, L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\");
wcscat(KeyBuffer, DeviceNode->InstancePath.Buffer); wcscat(KeyBuffer, DeviceNode->InstancePath.Buffer);
Status = IopCreateDeviceKeyPath(KeyBuffer, Status = IopCreateDeviceKeyPath(KeyBuffer, &InstanceKey);
&InstanceKey);
ExFreePool(KeyBuffer); ExFreePool(KeyBuffer);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
@ -1642,8 +1623,7 @@ IopActionInterrogateDeviceStack(
{ {
/* Set 'Capabilities' value */ /* Set 'Capabilities' value */
RtlInitUnicodeString(&ValueName, RtlInitUnicodeString(&ValueName, L"Capabilities");
L"Capabilities");
Status = ZwSetValueKey(InstanceKey, Status = ZwSetValueKey(InstanceKey,
&ValueName, &ValueName,
0, 0,
@ -1654,8 +1634,7 @@ IopActionInterrogateDeviceStack(
/* Set 'UINumber' value */ /* Set 'UINumber' value */
if (DeviceCapabilities.UINumber != (ULONG)-1) if (DeviceCapabilities.UINumber != (ULONG)-1)
{ {
RtlInitUnicodeString(&ValueName, RtlInitUnicodeString(&ValueName, L"UINumber");
L"UINumber");
Status = ZwSetValueKey(InstanceKey, Status = ZwSetValueKey(InstanceKey,
&ValueName, &ValueName,
0, 0,
@ -1668,8 +1647,7 @@ IopActionInterrogateDeviceStack(
DPRINT("Sending IRP_MN_QUERY_ID.BusQueryHardwareIDs to device stack\n"); DPRINT("Sending IRP_MN_QUERY_ID.BusQueryHardwareIDs to device stack\n");
Stack.Parameters.QueryId.IdType = BusQueryHardwareIDs; Stack.Parameters.QueryId.IdType = BusQueryHardwareIDs;
Status = IopInitiatePnpIrp( Status = IopInitiatePnpIrp(DeviceNode->PhysicalDeviceObject,
DeviceNode->PhysicalDeviceObject,
&IoStatusBlock, &IoStatusBlock,
IRP_MN_QUERY_ID, IRP_MN_QUERY_ID,
&Stack); &Stack);
@ -1693,8 +1671,7 @@ IopActionInterrogateDeviceStack(
DPRINT("TotalLength: %hu\n", TotalLength); DPRINT("TotalLength: %hu\n", TotalLength);
DPRINT("\n"); DPRINT("\n");
RtlInitUnicodeString(&ValueName, RtlInitUnicodeString(&ValueName, L"HardwareID");
L"HardwareID");
Status = ZwSetValueKey(InstanceKey, Status = ZwSetValueKey(InstanceKey,
&ValueName, &ValueName,
0, 0,
@ -1739,8 +1716,7 @@ IopActionInterrogateDeviceStack(
DPRINT("TotalLength: %hu\n", TotalLength); DPRINT("TotalLength: %hu\n", TotalLength);
DPRINT("\n"); DPRINT("\n");
RtlInitUnicodeString(&ValueName, RtlInitUnicodeString(&ValueName, L"CompatibleIDs");
L"CompatibleIDs");
Status = ZwSetValueKey(InstanceKey, Status = ZwSetValueKey(InstanceKey,
&ValueName, &ValueName,
0, 0,
@ -1803,8 +1779,7 @@ IopActionInterrogateDeviceStack(
if (NT_SUCCESS(Status)) if (NT_SUCCESS(Status))
{ {
DPRINT("LocationInformation: %S\n", (PWSTR)IoStatusBlock.Information); DPRINT("LocationInformation: %S\n", (PWSTR)IoStatusBlock.Information);
RtlInitUnicodeString(&ValueName, RtlInitUnicodeString(&ValueName, L"LocationInformation");
L"LocationInformation");
Status = ZwSetValueKey(InstanceKey, Status = ZwSetValueKey(InstanceKey,
&ValueName, &ValueName,
0, 0,
@ -1927,8 +1902,7 @@ IopActionInterrogateDeviceStack(
*/ */
NTSTATUS NTSTATUS
IopActionConfigureChildServices( IopActionConfigureChildServices(PDEVICE_NODE DeviceNode,
PDEVICE_NODE DeviceNode,
PVOID Context) PVOID Context)
{ {
RTL_QUERY_REGISTRY_TABLE QueryTable[3]; RTL_QUERY_REGISTRY_TABLE QueryTable[3];
@ -2053,8 +2027,7 @@ IopActionConfigureChildServices(
*/ */
NTSTATUS NTSTATUS
IopActionInitChildServices( IopActionInitChildServices(PDEVICE_NODE DeviceNode,
PDEVICE_NODE DeviceNode,
PVOID Context, PVOID Context,
BOOLEAN BootDrivers) BOOLEAN BootDrivers)
{ {
@ -2159,8 +2132,7 @@ IopActionInitChildServices(
*/ */
NTSTATUS NTSTATUS
IopActionInitAllServices( IopActionInitAllServices(PDEVICE_NODE DeviceNode,
PDEVICE_NODE DeviceNode,
PVOID Context) PVOID Context)
{ {
return IopActionInitChildServices(DeviceNode, Context, FALSE); return IopActionInitChildServices(DeviceNode, Context, FALSE);
@ -2174,8 +2146,7 @@ IopActionInitAllServices(
* BootDrivers = TRUE. * BootDrivers = TRUE.
*/ */
NTSTATUS NTSTATUS
IopActionInitBootServices( IopActionInitBootServices(PDEVICE_NODE DeviceNode,
PDEVICE_NODE DeviceNode,
PVOID Context) PVOID Context)
{ {
return IopActionInitChildServices(DeviceNode, Context, TRUE); return IopActionInitChildServices(DeviceNode, Context, TRUE);
@ -2198,8 +2169,7 @@ IopActionInitBootServices(
* Status * Status
*/ */
NTSTATUS NTSTATUS
IopInitializePnpServices( IopInitializePnpServices(IN PDEVICE_NODE DeviceNode,
IN PDEVICE_NODE DeviceNode,
IN BOOLEAN BootDrivers) IN BOOLEAN BootDrivers)
{ {
DEVICETREE_TRAVERSE_CONTEXT Context; DEVICETREE_TRAVERSE_CONTEXT Context;
@ -2228,8 +2198,7 @@ IopInitializePnpServices(
NTSTATUS NTSTATUS
IopInvalidateDeviceRelations( IopInvalidateDeviceRelations(IN PDEVICE_NODE DeviceNode,
IN PDEVICE_NODE DeviceNode,
IN DEVICE_RELATION_TYPE Type) IN DEVICE_RELATION_TYPE Type)
{ {
DEVICETREE_TRAVERSE_CONTEXT Context; DEVICETREE_TRAVERSE_CONTEXT Context;
@ -2377,7 +2346,9 @@ IopInvalidateDeviceRelations(
} }
static NTSTATUS INIT_FUNCTION static
NTSTATUS
INIT_FUNCTION
IopSetRootDeviceInstanceData(PDEVICE_NODE DeviceNode) IopSetRootDeviceInstanceData(PDEVICE_NODE DeviceNode)
{ {
#if 0 #if 0