mirror of
https://github.com/reactos/reactos.git
synced 2024-09-01 00:03:39 +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,13 +1911,14 @@ 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,
|
*/
|
||||||
&ServiceName,
|
Status = IopGetDriverObject(&DriverObject,
|
||||||
(Type == 2 /* SERVICE_FILE_SYSTEM_DRIVER */ ||
|
&ServiceName,
|
||||||
Type == 8 /* SERVICE_RECOGNIZER_DRIVER */));
|
(Type == 2 /* SERVICE_FILE_SYSTEM_DRIVER */ ||
|
||||||
|
Type == 8 /* SERVICE_RECOGNIZER_DRIVER */));
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -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);
|
||||||
|
@ -1939,8 +1937,8 @@ IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the driver module if it's loaded for the first time
|
* Initialize the driver module if it's loaded for the first time
|
||||||
*/
|
*/
|
||||||
Status = IopCreateDeviceNode(IopRootDeviceNode, NULL, &ServiceName, &DeviceNode);
|
Status = IopCreateDeviceNode(IopRootDeviceNode, NULL, &ServiceName, &DeviceNode);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -2015,8 +2013,8 @@ NtLoadDriver(IN PUNICODE_STRING DriverServiceName)
|
||||||
PreviousMode = KeGetPreviousMode();
|
PreviousMode = KeGetPreviousMode();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check security privileges
|
* Check security privileges
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* FIXME: Uncomment when privileges will be correctly implemented. */
|
/* FIXME: Uncomment when privileges will be correctly implemented. */
|
||||||
#if 0
|
#if 0
|
||||||
|
|
Loading…
Reference in a new issue