mirror of
https://github.com/reactos/reactos.git
synced 2024-09-14 14:51:27 +00:00
[NTOSKRNL]
Code formatting, and don't hardcode L"\\Driver\\" but use the #define DRIVER_ROOT_NAME instead. svn path=/trunk/; revision=59800
This commit is contained in:
parent
566a7607c1
commit
2d60181421
|
@ -1191,7 +1191,7 @@ IopUnloadDriver(PUNICODE_STRING DriverServiceName, BOOLEAN UnloadPnpDrivers)
|
||||||
ObjectName.MaximumLength = ObjectName.Length + sizeof(WCHAR);
|
ObjectName.MaximumLength = ObjectName.Length + sizeof(WCHAR);
|
||||||
ObjectName.Buffer = ExAllocatePool(PagedPool, ObjectName.MaximumLength);
|
ObjectName.Buffer = ExAllocatePool(PagedPool, ObjectName.MaximumLength);
|
||||||
if (!ObjectName.Buffer) return STATUS_INSUFFICIENT_RESOURCES;
|
if (!ObjectName.Buffer) return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
wcscpy(ObjectName.Buffer, L"\\Driver\\");
|
wcscpy(ObjectName.Buffer, DRIVER_ROOT_NAME);
|
||||||
memcpy(ObjectName.Buffer + 8, Start, ObjectName.Length - 8 * sizeof(WCHAR));
|
memcpy(ObjectName.Buffer + 8, Start, ObjectName.Length - 8 * sizeof(WCHAR));
|
||||||
ObjectName.Buffer[ObjectName.Length/sizeof(WCHAR)] = 0;
|
ObjectName.Buffer[ObjectName.Length/sizeof(WCHAR)] = 0;
|
||||||
|
|
||||||
|
@ -1452,7 +1452,7 @@ try_again:
|
||||||
{
|
{
|
||||||
/* Create a random name and set up the string*/
|
/* Create a random name and set up the string*/
|
||||||
NameLength = (USHORT)swprintf(NameBuffer,
|
NameLength = (USHORT)swprintf(NameBuffer,
|
||||||
L"\\Driver\\%08u",
|
DRIVER_ROOT_NAME L"%08u",
|
||||||
KeTickCount);
|
KeTickCount);
|
||||||
LocalDriverName.Length = NameLength * sizeof(WCHAR);
|
LocalDriverName.Length = NameLength * sizeof(WCHAR);
|
||||||
LocalDriverName.MaximumLength = LocalDriverName.Length + sizeof(UNICODE_NULL);
|
LocalDriverName.MaximumLength = LocalDriverName.Length + sizeof(UNICODE_NULL);
|
||||||
|
@ -1886,7 +1886,6 @@ IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams)
|
||||||
Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE,
|
Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE,
|
||||||
LoadParams->ServiceName->Buffer,
|
LoadParams->ServiceName->Buffer,
|
||||||
QueryTable, NULL, NULL);
|
QueryTable, NULL, NULL);
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("RtlQueryRegistryValues() failed (Status %lx)\n", Status);
|
DPRINT("RtlQueryRegistryValues() failed (Status %lx)\n", Status);
|
||||||
|
@ -1901,7 +1900,6 @@ IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Status = IopNormalizeImagePath(&ImagePath, &ServiceName);
|
Status = IopNormalizeImagePath(&ImagePath, &ServiceName);
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("IopNormalizeImagePath() failed (Status %x)\n", Status);
|
DPRINT("IopNormalizeImagePath() failed (Status %x)\n", Status);
|
||||||
|
@ -1913,10 +1911,11 @@ IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams)
|
||||||
DPRINT("FullImagePath: '%wZ'\n", &ImagePath);
|
DPRINT("FullImagePath: '%wZ'\n", &ImagePath);
|
||||||
DPRINT("Type: %lx\n", Type);
|
DPRINT("Type: %lx\n", Type);
|
||||||
|
|
||||||
/* Get existing DriverObject pointer (in case the driver has
|
/*
|
||||||
already been loaded and initialized) */
|
* Get existing DriverObject pointer (in case the driver
|
||||||
Status = IopGetDriverObject(
|
* has already been loaded and initialized).
|
||||||
&DriverObject,
|
*/
|
||||||
|
Status = IopGetDriverObject(&DriverObject,
|
||||||
&ServiceName,
|
&ServiceName,
|
||||||
(Type == 2 /* SERVICE_FILE_SYSTEM_DRIVER */ ||
|
(Type == 2 /* SERVICE_FILE_SYSTEM_DRIVER */ ||
|
||||||
Type == 8 /* SERVICE_RECOGNIZER_DRIVER */));
|
Type == 8 /* SERVICE_RECOGNIZER_DRIVER */));
|
||||||
|
@ -1929,7 +1928,6 @@ IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams)
|
||||||
|
|
||||||
DPRINT("Loading module from %wZ\n", &ImagePath);
|
DPRINT("Loading module from %wZ\n", &ImagePath);
|
||||||
Status = MmLoadSystemImage(&ImagePath, NULL, NULL, 0, (PVOID)&ModuleObject, &BaseAddress);
|
Status = MmLoadSystemImage(&ImagePath, NULL, NULL, 0, (PVOID)&ModuleObject, &BaseAddress);
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("MmLoadSystemImage() failed (Status %lx)\n", Status);
|
DPRINT("MmLoadSystemImage() failed (Status %lx)\n", Status);
|
||||||
|
|
Loading…
Reference in a new issue