Author: ekohl
Date: Sun Jan 3 16:20:09 2010
New Revision: 44912
URL:
http://svn.reactos.org/svn/reactos?rev=44912&view=rev
Log:
Fix indentation. No code changes.
Modified:
trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/plugpla…
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/plugplay.c [iso-8859-1] Sun Jan 3 16:20:09 2010
@@ -18,8 +18,8 @@
typedef struct _PNP_EVENT_ENTRY
{
- LIST_ENTRY ListEntry;
- PLUGPLAY_EVENT_BLOCK Event;
+ LIST_ENTRY ListEntry;
+ PLUGPLAY_EVENT_BLOCK Event;
} PNP_EVENT_ENTRY, *PPNP_EVENT_ENTRY;
@@ -95,21 +95,21 @@
static NTSTATUS
IopRemovePlugPlayEvent(VOID)
{
- /* Remove a pnp event entry from the tail of the queue */
- if (!IsListEmpty(&IopPnpEventQueueHead))
- {
- ExFreePool(RemoveTailList(&IopPnpEventQueueHead));
- }
-
- /* Signal the next pnp event in the queue */
- if (!IsListEmpty(&IopPnpEventQueueHead))
- {
- KeSetEvent(&IopPnpNotifyEvent,
- 0,
- FALSE);
- }
-
- return STATUS_SUCCESS;
+ /* Remove a pnp event entry from the tail of the queue */
+ if (!IsListEmpty(&IopPnpEventQueueHead))
+ {
+ ExFreePool(RemoveTailList(&IopPnpEventQueueHead));
+ }
+
+ /* Signal the next pnp event in the queue */
+ if (!IsListEmpty(&IopPnpEventQueueHead))
+ {
+ KeSetEvent(&IopPnpNotifyEvent,
+ 0,
+ FALSE);
+ }
+
+ return STATUS_SUCCESS;
}
static PDEVICE_OBJECT
@@ -148,8 +148,7 @@
return NULL;
if (DeviceInstance == NULL ||
- DeviceInstance->Length == 0
- )
+ DeviceInstance->Length == 0)
{
if (IopRootDeviceNode->PhysicalDeviceObject)
{
@@ -173,35 +172,39 @@
Name.Buffer = NULL;
_SEH2_TRY
{
- Name.Length = SrcName->Length;
- Name.MaximumLength = SrcName->MaximumLength;
- if (Name.Length > Name.MaximumLength)
- {
- Status = STATUS_INVALID_PARAMETER;
- _SEH2_LEAVE;
- }
- if (Name.MaximumLength)
- {
- ProbeForRead(SrcName->Buffer,
- Name.MaximumLength,
- sizeof(WCHAR));
- Name.Buffer = ExAllocatePool(NonPagedPool, Name.MaximumLength);
- if (Name.Buffer == NULL)
- {
- Status = STATUS_INSUFFICIENT_RESOURCES;
- _SEH2_LEAVE;
- }
- memcpy(Name.Buffer, SrcName->Buffer, Name.MaximumLength);
- }
- *DstName = Name;
+ Name.Length = SrcName->Length;
+ Name.MaximumLength = SrcName->MaximumLength;
+ if (Name.Length > Name.MaximumLength)
+ {
+ Status = STATUS_INVALID_PARAMETER;
+ _SEH2_LEAVE;
+ }
+
+ if (Name.MaximumLength)
+ {
+ ProbeForRead(SrcName->Buffer,
+ Name.MaximumLength,
+ sizeof(WCHAR));
+ Name.Buffer = ExAllocatePool(NonPagedPool, Name.MaximumLength);
+ if (Name.Buffer == NULL)
+ {
+ Status = STATUS_INSUFFICIENT_RESOURCES;
+ _SEH2_LEAVE;
+ }
+
+ memcpy(Name.Buffer, SrcName->Buffer, Name.MaximumLength);
+ }
+
+ *DstName = Name;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
- if (Name.Buffer) ExFreePool(Name.Buffer);
+ if (Name.Buffer)
+ ExFreePool(Name.Buffer);
Status = _SEH2_GetExceptionCode();
}
_SEH2_END;
-
+
return Status;
}
@@ -221,12 +224,12 @@
Status = IopCaptureUnicodeString(&DeviceInstance,
&PropertyData->DeviceInstance);
if (!NT_SUCCESS(Status))
{
- return Status;
+ return Status;
}
_SEH2_TRY
{
- Property = PropertyData->Property;
+ Property = PropertyData->Property;
BufferSize = PropertyData->BufferSize;
ProbeForWrite(PropertyData->Buffer,
BufferSize,
@@ -238,7 +241,7 @@
_SEH2_YIELD(return _SEH2_GetExceptionCode());
}
_SEH2_END;
-
+
/* Get the device object */
DeviceObject = IopGetDeviceObjectFromDeviceInstance(&DeviceInstance);
ExFreePool(DeviceInstance.Buffer);
@@ -250,9 +253,8 @@
Buffer = ExAllocatePool(NonPagedPool, BufferSize);
if (Buffer == NULL)
{
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
Status = IoGetDeviceProperty(DeviceObject,
Property,
@@ -264,17 +266,18 @@
if (NT_SUCCESS(Status))
{
- _SEH2_TRY
- {
- memcpy(Buffer, PropertyData->Buffer, BufferSize);
- PropertyData->BufferSize = BufferSize;
- }
- _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- Status = _SEH2_GetExceptionCode();
- }
- _SEH2_END;
- }
+ _SEH2_TRY
+ {
+ memcpy(Buffer, PropertyData->Buffer, BufferSize);
+ PropertyData->BufferSize = BufferSize;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = _SEH2_GetExceptionCode();
+ }
+ _SEH2_END;
+ }
+
ExFreePool(Buffer);
return Status;
}
@@ -298,16 +301,16 @@
Status = IopCaptureUnicodeString(&TargetDeviceInstance,
&RelatedDeviceData->TargetDeviceInstance);
if (!NT_SUCCESS(Status))
{
- return Status;
+ return Status;
}
_SEH2_TRY
{
- Relation = RelatedDeviceData->Relation;
- MaximumLength = RelatedDeviceData->RelatedDeviceInstanceLength;
- ProbeForWrite(RelatedDeviceData->RelatedDeviceInstance,
- MaximumLength,
- sizeof(WCHAR));
+ Relation = RelatedDeviceData->Relation;
+ MaximumLength = RelatedDeviceData->RelatedDeviceInstanceLength;
+ ProbeForWrite(RelatedDeviceData->RelatedDeviceInstance,
+ MaximumLength,
+ sizeof(WCHAR));
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -323,13 +326,13 @@
TRUE))
{
DeviceNode = IopRootDeviceNode;
- ExFreePool(TargetDeviceInstance.Buffer);
+ ExFreePool(TargetDeviceInstance.Buffer);
}
else
{
/* Get the device object */
DeviceObject = IopGetDeviceObjectFromDeviceInstance(&TargetDeviceInstance);
- ExFreePool(TargetDeviceInstance.Buffer);
+ ExFreePool(TargetDeviceInstance.Buffer);
if (DeviceObject == NULL)
return STATUS_NO_SUCH_DEVICE;
@@ -424,12 +427,12 @@
_SEH2_TRY
{
- Operation = StatusData->Operation;
- if (Operation == PNP_SET_DEVICE_STATUS)
- {
- DeviceStatus = StatusData->DeviceStatus;
- DeviceProblem = StatusData->DeviceProblem;
- }
+ Operation = StatusData->Operation;
+ if (Operation == PNP_SET_DEVICE_STATUS)
+ {
+ DeviceStatus = StatusData->DeviceStatus;
+ DeviceProblem = StatusData->DeviceProblem;
+ }
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -469,16 +472,16 @@
if (Operation == PNP_GET_DEVICE_STATUS)
{
- _SEH2_TRY
- {
- StatusData->DeviceStatus = DeviceStatus;
- StatusData->DeviceProblem = DeviceProblem;
- }
- _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- Status = _SEH2_GetExceptionCode();
- }
- _SEH2_END;
+ _SEH2_TRY
+ {
+ StatusData->DeviceStatus = DeviceStatus;
+ StatusData->DeviceProblem = DeviceProblem;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = _SEH2_GetExceptionCode();
+ }
+ _SEH2_END;
}
return Status;
@@ -499,7 +502,7 @@
Status = IopCaptureUnicodeString(&DeviceInstance,
&DepthData->DeviceInstance);
if (!NT_SUCCESS(Status))
{
- return Status;
+ return Status;
}
/* Get the device object */
@@ -512,7 +515,7 @@
_SEH2_TRY
{
- DepthData->Depth = DeviceNode->Level;
+ DepthData->Depth = DeviceNode->Level;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
@@ -630,59 +633,59 @@
OUT PPLUGPLAY_EVENT_BLOCK Buffer,
IN ULONG BufferSize)
{
- PPNP_EVENT_ENTRY Entry;
- NTSTATUS Status;
-
- DPRINT("NtGetPlugPlayEvent() called\n");
-
- /* Function can only be called from user-mode */
- if (KeGetPreviousMode() == KernelMode)
- {
- DPRINT1("NtGetPlugPlayEvent cannot be called from kernel mode!\n");
- return STATUS_ACCESS_DENIED;
- }
-
- /* Check for Tcb privilege */
- if (!SeSinglePrivilegeCheck(SeTcbPrivilege,
- UserMode))
- {
- DPRINT1("NtGetPlugPlayEvent: Caller does not hold the SeTcbPrivilege
privilege!\n");
- return STATUS_PRIVILEGE_NOT_HELD;
- }
-
- /* Wait for a PnP event */
- DPRINT("Waiting for pnp notification event\n");
- Status = KeWaitForSingleObject(&IopPnpNotifyEvent,
- UserRequest,
- KernelMode,
- FALSE,
- NULL);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("KeWaitForSingleObject() failed (Status %lx)\n", Status);
- return Status;
- }
-
- /* Get entry from the tail of the queue */
- Entry = CONTAINING_RECORD(IopPnpEventQueueHead.Blink,
- PNP_EVENT_ENTRY,
- ListEntry);
-
- /* Check the buffer size */
- if (BufferSize < Entry->Event.TotalSize)
- {
- DPRINT1("Buffer is too small for the pnp-event\n");
- return STATUS_BUFFER_TOO_SMALL;
- }
-
- /* Copy event data to the user buffer */
- memcpy(Buffer,
- &Entry->Event,
- Entry->Event.TotalSize);
-
- DPRINT("NtGetPlugPlayEvent() done\n");
-
- return STATUS_SUCCESS;
+ PPNP_EVENT_ENTRY Entry;
+ NTSTATUS Status;
+
+ DPRINT("NtGetPlugPlayEvent() called\n");
+
+ /* Function can only be called from user-mode */
+ if (KeGetPreviousMode() == KernelMode)
+ {
+ DPRINT1("NtGetPlugPlayEvent cannot be called from kernel mode!\n");
+ return STATUS_ACCESS_DENIED;
+ }
+
+ /* Check for Tcb privilege */
+ if (!SeSinglePrivilegeCheck(SeTcbPrivilege,
+ UserMode))
+ {
+ DPRINT1("NtGetPlugPlayEvent: Caller does not hold the SeTcbPrivilege
privilege!\n");
+ return STATUS_PRIVILEGE_NOT_HELD;
+ }
+
+ /* Wait for a PnP event */
+ DPRINT("Waiting for pnp notification event\n");
+ Status = KeWaitForSingleObject(&IopPnpNotifyEvent,
+ UserRequest,
+ KernelMode,
+ FALSE,
+ NULL);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("KeWaitForSingleObject() failed (Status %lx)\n", Status);
+ return Status;
+ }
+
+ /* Get entry from the tail of the queue */
+ Entry = CONTAINING_RECORD(IopPnpEventQueueHead.Blink,
+ PNP_EVENT_ENTRY,
+ ListEntry);
+
+ /* Check the buffer size */
+ if (BufferSize < Entry->Event.TotalSize)
+ {
+ DPRINT1("Buffer is too small for the pnp-event\n");
+ return STATUS_BUFFER_TOO_SMALL;
+ }
+
+ /* Copy event data to the user buffer */
+ memcpy(Buffer,
+ &Entry->Event,
+ Entry->Event.TotalSize);
+
+ DPRINT("NtGetPlugPlayEvent() done\n");
+
+ return STATUS_SUCCESS;
}
/*