mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 16:45:50 +00:00
[NTOS:FORMATTING]
- Try to fix indentation in iomgr/driver.c. Whitespace changes only svn path=/trunk/; revision=64931
This commit is contained in:
parent
5892b26e03
commit
863c3c8c19
1 changed files with 649 additions and 643 deletions
|
@ -39,7 +39,8 @@ PLIST_ENTRY IopGroupTable;
|
|||
|
||||
/* PRIVATE FUNCTIONS **********************************************************/
|
||||
|
||||
NTSTATUS NTAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
IopInvalidDeviceRequest(
|
||||
PDEVICE_OBJECT DeviceObject,
|
||||
PIRP Irp)
|
||||
|
@ -64,8 +65,7 @@ IopDeleteDriver(IN PVOID ObjectBody)
|
|||
ASSERT(!DriverObject->DeviceObject);
|
||||
|
||||
/* Get the extension and loop them */
|
||||
DriverExtension = IoGetDrvObjExtension(DriverObject)->
|
||||
ClientDriverExtension;
|
||||
DriverExtension = IoGetDrvObjExtension(DriverObject)->ClientDriverExtension;
|
||||
while (DriverExtension)
|
||||
{
|
||||
/* Get the next one */
|
||||
|
@ -98,7 +98,8 @@ IopDeleteDriver(IN PVOID ObjectBody)
|
|||
}
|
||||
}
|
||||
|
||||
NTSTATUS FASTCALL
|
||||
NTSTATUS
|
||||
FASTCALL
|
||||
IopGetDriverObject(
|
||||
PDRIVER_OBJECT *DriverObject,
|
||||
PUNICODE_STRING ServiceName,
|
||||
|
@ -132,8 +133,7 @@ IopGetDriverObject(
|
|||
DPRINT("Driver name: '%wZ'\n", &DriverName);
|
||||
|
||||
/* Open driver object */
|
||||
Status = ObReferenceObjectByName(
|
||||
&DriverName,
|
||||
Status = ObReferenceObjectByName(&DriverName,
|
||||
OBJ_OPENIF | OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, /* Attributes */
|
||||
NULL, /* PassedAccessState */
|
||||
0, /* DesiredAccess */
|
||||
|
@ -141,7 +141,6 @@ IopGetDriverObject(
|
|||
KernelMode,
|
||||
NULL, /* ParseContext */
|
||||
(PVOID*)&Object);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT("Failed to reference driver object, status=0x%08x\n", Status);
|
||||
|
@ -193,7 +192,6 @@ IopSuffixUnicodeString(
|
|||
*
|
||||
* Display 'Loading XXX...' message.
|
||||
*/
|
||||
|
||||
VOID
|
||||
FASTCALL
|
||||
INIT_FUNCTION
|
||||
|
@ -234,7 +232,6 @@ IopDisplayLoadingMessage(PUNICODE_STRING ServiceName)
|
|||
* Remarks
|
||||
* The input image path isn't freed on error.
|
||||
*/
|
||||
|
||||
NTSTATUS
|
||||
FASTCALL
|
||||
IopNormalizeImagePath(
|
||||
|
@ -246,8 +243,7 @@ IopNormalizeImagePath(
|
|||
|
||||
DPRINT("Normalizing image path '%wZ' for service '%wZ'\n", ImagePath, ServiceName);
|
||||
|
||||
RtlCopyMemory(
|
||||
&InputImagePath,
|
||||
RtlCopyMemory(&InputImagePath,
|
||||
ImagePath,
|
||||
sizeof(UNICODE_STRING));
|
||||
|
||||
|
@ -256,20 +252,22 @@ IopNormalizeImagePath(
|
|||
ImagePath->Length = 0;
|
||||
ImagePath->MaximumLength =
|
||||
(33 * sizeof(WCHAR)) + ServiceName->Length + sizeof(UNICODE_NULL);
|
||||
ImagePath->Buffer = ExAllocatePool(NonPagedPool, ImagePath->MaximumLength);
|
||||
ImagePath->Buffer = ExAllocatePool(NonPagedPool,
|
||||
ImagePath->MaximumLength);
|
||||
if (ImagePath->Buffer == NULL)
|
||||
return STATUS_NO_MEMORY;
|
||||
|
||||
RtlAppendUnicodeToString(ImagePath, L"\\SystemRoot\\system32\\drivers\\");
|
||||
RtlAppendUnicodeStringToString(ImagePath, ServiceName);
|
||||
RtlAppendUnicodeToString(ImagePath, L".sys");
|
||||
} else
|
||||
if (InputImagePath.Buffer[0] != L'\\')
|
||||
}
|
||||
else if (InputImagePath.Buffer[0] != L'\\')
|
||||
{
|
||||
ImagePath->Length = 0;
|
||||
ImagePath->MaximumLength =
|
||||
12 * sizeof(WCHAR) + InputImagePath.Length + sizeof(UNICODE_NULL);
|
||||
ImagePath->Buffer = ExAllocatePool(NonPagedPool, ImagePath->MaximumLength);
|
||||
ImagePath->Buffer = ExAllocatePool(NonPagedPool,
|
||||
ImagePath->MaximumLength);
|
||||
if (ImagePath->Buffer == NULL)
|
||||
return STATUS_NO_MEMORY;
|
||||
|
||||
|
@ -297,8 +295,8 @@ IopNormalizeImagePath(
|
|||
* Return Value
|
||||
* Status
|
||||
*/
|
||||
|
||||
NTSTATUS FASTCALL
|
||||
NTSTATUS
|
||||
FASTCALL
|
||||
IopLoadServiceModule(
|
||||
IN PUNICODE_STRING ServiceName,
|
||||
OUT PLDR_DATA_TABLE_ENTRY *ModuleObject)
|
||||
|
@ -350,7 +348,6 @@ IopLoadServiceModule(
|
|||
/*
|
||||
* Get information about the service.
|
||||
*/
|
||||
|
||||
RtlZeroMemory(QueryTable, sizeof(QueryTable));
|
||||
|
||||
RtlInitUnicodeString(&ServiceImagePath, NULL);
|
||||
|
@ -364,7 +361,10 @@ IopLoadServiceModule(
|
|||
QueryTable[1].EntryContext = &ServiceImagePath;
|
||||
|
||||
Status = RtlQueryRegistryValues(RTL_REGISTRY_HANDLE,
|
||||
(PWSTR)ServiceKey, QueryTable, NULL, NULL);
|
||||
(PWSTR)ServiceKey,
|
||||
QueryTable,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
ZwClose(ServiceKey);
|
||||
ZwClose(CCSKey);
|
||||
|
@ -379,7 +379,6 @@ IopLoadServiceModule(
|
|||
/*
|
||||
* Normalize the image path for all later processing.
|
||||
*/
|
||||
|
||||
Status = IopNormalizeImagePath(&ServiceImagePath, ServiceName);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -391,7 +390,6 @@ IopLoadServiceModule(
|
|||
/*
|
||||
* Case for disabled drivers
|
||||
*/
|
||||
|
||||
if (ServiceStart >= 4)
|
||||
{
|
||||
/* We can't load this */
|
||||
|
@ -412,7 +410,6 @@ IopLoadServiceModule(
|
|||
/*
|
||||
* Now check if the module was loaded successfully.
|
||||
*/
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT("Module loading failed (Status %x)\n", Status);
|
||||
|
@ -450,8 +447,8 @@ MmFreeDriverInitialization(IN PLDR_DATA_TABLE_ENTRY LdrEntry);
|
|||
* On successful return this contains the driver object representing
|
||||
* the loaded driver.
|
||||
*/
|
||||
|
||||
NTSTATUS FASTCALL
|
||||
NTSTATUS
|
||||
FASTCALL
|
||||
IopInitializeDriverModule(
|
||||
IN PDEVICE_NODE DeviceNode,
|
||||
IN PLDR_DATA_TABLE_ENTRY ModuleObject,
|
||||
|
@ -504,8 +501,7 @@ IopInitializeDriverModule(
|
|||
else
|
||||
DriverName.Length = 0;
|
||||
|
||||
Status = IopCreateDriver(
|
||||
DriverName.Length > 0 ? &DriverName : NULL,
|
||||
Status = IopCreateDriver(DriverName.Length > 0 ? &DriverName : NULL,
|
||||
DriverEntry,
|
||||
&RegistryKey,
|
||||
ServiceName,
|
||||
|
@ -535,8 +531,8 @@ IopInitializeDriverModule(
|
|||
*
|
||||
* Internal routine used by IopAttachFilterDrivers.
|
||||
*/
|
||||
|
||||
NTSTATUS NTAPI
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
IopAttachFilterDriversCallback(
|
||||
PWSTR ValueName,
|
||||
ULONG ValueType,
|
||||
|
@ -577,8 +573,11 @@ IopAttachFilterDriversCallback(
|
|||
if (!NT_SUCCESS(Status))
|
||||
return Status;
|
||||
|
||||
Status = IopInitializeDriverModule(DeviceNode, ModuleObject, &ServiceName,
|
||||
FALSE, &DriverObject);
|
||||
Status = IopInitializeDriverModule(DeviceNode,
|
||||
ModuleObject,
|
||||
&ServiceName,
|
||||
FALSE,
|
||||
&DriverObject);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return Status;
|
||||
}
|
||||
|
@ -605,8 +604,8 @@ IopAttachFilterDriversCallback(
|
|||
* Set to TRUE for loading lower level filters or FALSE for upper
|
||||
* level filters.
|
||||
*/
|
||||
|
||||
NTSTATUS FASTCALL
|
||||
NTSTATUS
|
||||
FASTCALL
|
||||
IopAttachFilterDrivers(
|
||||
PDEVICE_NODE DeviceNode,
|
||||
BOOLEAN Lower)
|
||||
|
@ -619,8 +618,10 @@ IopAttachFilterDrivers(
|
|||
NTSTATUS Status;
|
||||
|
||||
/* Open enumeration root key */
|
||||
Status = IopOpenRegistryKeyEx(&EnumRootKey, NULL,
|
||||
&EnumRoot, KEY_READ);
|
||||
Status = IopOpenRegistryKeyEx(&EnumRootKey,
|
||||
NULL,
|
||||
&EnumRoot,
|
||||
KEY_READ);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("ZwOpenKey() failed with Status %08X\n", Status);
|
||||
|
@ -628,8 +629,10 @@ IopAttachFilterDrivers(
|
|||
}
|
||||
|
||||
/* Open subkey */
|
||||
Status = IopOpenRegistryKeyEx(&SubKey, EnumRootKey,
|
||||
&DeviceNode->InstancePath, KEY_READ);
|
||||
Status = IopOpenRegistryKeyEx(&SubKey,
|
||||
EnumRootKey,
|
||||
&DeviceNode->InstancePath,
|
||||
KEY_READ);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("ZwOpenKey() failed with Status %08X\n", Status);
|
||||
|
@ -648,8 +651,7 @@ IopAttachFilterDrivers(
|
|||
QueryTable[0].Flags = 0;
|
||||
QueryTable[0].DefaultType = REG_NONE;
|
||||
|
||||
Status = RtlQueryRegistryValues(
|
||||
RTL_REGISTRY_HANDLE,
|
||||
Status = RtlQueryRegistryValues(RTL_REGISTRY_HANDLE,
|
||||
(PWSTR)SubKey,
|
||||
QueryTable,
|
||||
DeviceNode,
|
||||
|
@ -674,8 +676,7 @@ IopAttachFilterDrivers(
|
|||
QueryTable[0].EntryContext = &Class;
|
||||
QueryTable[0].Flags = RTL_QUERY_REGISTRY_REQUIRED | RTL_QUERY_REGISTRY_DIRECT;
|
||||
|
||||
Status = RtlQueryRegistryValues(
|
||||
RTL_REGISTRY_HANDLE,
|
||||
Status = RtlQueryRegistryValues(RTL_REGISTRY_HANDLE,
|
||||
(PWSTR)SubKey,
|
||||
QueryTable,
|
||||
DeviceNode,
|
||||
|
@ -692,8 +693,10 @@ IopAttachFilterDrivers(
|
|||
{
|
||||
UNICODE_STRING ControlClass = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Class");
|
||||
|
||||
Status = IopOpenRegistryKeyEx(&EnumRootKey, NULL,
|
||||
&ControlClass, KEY_READ);
|
||||
Status = IopOpenRegistryKeyEx(&EnumRootKey,
|
||||
NULL,
|
||||
&ControlClass,
|
||||
KEY_READ);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("ZwOpenKey() failed with Status %08X\n", Status);
|
||||
|
@ -701,8 +704,10 @@ IopAttachFilterDrivers(
|
|||
}
|
||||
|
||||
/* Open subkey */
|
||||
Status = IopOpenRegistryKeyEx(&SubKey, EnumRootKey,
|
||||
&Class, KEY_READ);
|
||||
Status = IopOpenRegistryKeyEx(&SubKey,
|
||||
EnumRootKey,
|
||||
&Class,
|
||||
KEY_READ);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* It's okay if there's no class key */
|
||||
|
@ -720,8 +725,7 @@ IopAttachFilterDrivers(
|
|||
QueryTable[0].Flags = 0;
|
||||
QueryTable[0].DefaultType = REG_NONE;
|
||||
|
||||
Status = RtlQueryRegistryValues(
|
||||
RTL_REGISTRY_HANDLE,
|
||||
Status = RtlQueryRegistryValues(RTL_REGISTRY_HANDLE,
|
||||
(PWSTR)SubKey,
|
||||
QueryTable,
|
||||
DeviceNode,
|
||||
|
@ -836,7 +840,6 @@ LdrProcessDriverModule(PLDR_DATA_TABLE_ENTRY LdrEntry,
|
|||
*
|
||||
* Initialize a driver that is already loaded in memory.
|
||||
*/
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
INIT_FUNCTION
|
||||
|
@ -886,7 +889,10 @@ IopInitializeBuiltinDriver(IN PLDR_DATA_TABLE_ENTRY BootLdrEntry)
|
|||
* Determine the right device object
|
||||
*/
|
||||
/* Use IopRootDeviceNode for now */
|
||||
Status = IopCreateDeviceNode(IopRootDeviceNode, NULL, &ServiceName, &DeviceNode);
|
||||
Status = IopCreateDeviceNode(IopRootDeviceNode,
|
||||
NULL,
|
||||
&ServiceName,
|
||||
&DeviceNode);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("Driver '%wZ' load failed, status (%x)\n", ModuleName, Status);
|
||||
|
@ -912,8 +918,11 @@ IopInitializeBuiltinDriver(IN PLDR_DATA_TABLE_ENTRY BootLdrEntry)
|
|||
/*
|
||||
* Initialize the driver
|
||||
*/
|
||||
Status = IopInitializeDriverModule(DeviceNode, LdrEntry,
|
||||
&DeviceNode->ServiceName, FALSE, &DriverObject);
|
||||
Status = IopInitializeDriverModule(DeviceNode,
|
||||
LdrEntry,
|
||||
&DeviceNode->ServiceName,
|
||||
FALSE,
|
||||
&DriverObject);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -1269,7 +1278,6 @@ IopUnloadDriver(PUNICODE_STRING DriverServiceName, BOOLEAN UnloadPnpDrivers)
|
|||
/*
|
||||
* Get path of service...
|
||||
*/
|
||||
|
||||
RtlZeroMemory(QueryTable, sizeof(QueryTable));
|
||||
|
||||
RtlInitUnicodeString(&ImagePath, NULL);
|
||||
|
@ -1279,7 +1287,10 @@ IopUnloadDriver(PUNICODE_STRING DriverServiceName, BOOLEAN UnloadPnpDrivers)
|
|||
QueryTable[0].EntryContext = &ImagePath;
|
||||
|
||||
Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE,
|
||||
DriverServiceName->Buffer, QueryTable, NULL, NULL);
|
||||
DriverServiceName->Buffer,
|
||||
QueryTable,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -1291,7 +1302,6 @@ IopUnloadDriver(PUNICODE_STRING DriverServiceName, BOOLEAN UnloadPnpDrivers)
|
|||
/*
|
||||
* Normalize the image path for all later processing.
|
||||
*/
|
||||
|
||||
Status = IopNormalizeImagePath(&ImagePath, &ServiceName);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -1304,7 +1314,6 @@ IopUnloadDriver(PUNICODE_STRING DriverServiceName, BOOLEAN UnloadPnpDrivers)
|
|||
/*
|
||||
* Free the service path
|
||||
*/
|
||||
|
||||
ExFreePool(ImagePath.Buffer);
|
||||
|
||||
/*
|
||||
|
@ -1927,7 +1936,6 @@ IopLoadUnloadDriver(
|
|||
/*
|
||||
* Get service type.
|
||||
*/
|
||||
|
||||
RtlZeroMemory(&QueryTable, sizeof(QueryTable));
|
||||
|
||||
RtlInitUnicodeString(&ImagePath, NULL);
|
||||
|
@ -1953,7 +1961,6 @@ IopLoadUnloadDriver(
|
|||
/*
|
||||
* Normalize the image path for all later processing.
|
||||
*/
|
||||
|
||||
Status = IopNormalizeImagePath(&ImagePath, &ServiceName);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
|
@ -1978,7 +1985,6 @@ IopLoadUnloadDriver(
|
|||
/*
|
||||
* Load the driver module
|
||||
*/
|
||||
|
||||
DPRINT("Loading module from %wZ\n", &ImagePath);
|
||||
Status = MmLoadSystemImage(&ImagePath, NULL, NULL, 0, (PVOID)&ModuleObject, &BaseAddress);
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue