mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 17:42:58 +00:00
Don't dereference device objects if they were not referenced
Remove one hack from kbdclass svn path=/trunk/; revision=21708
This commit is contained in:
parent
d7c29a3b3f
commit
99ea202a07
3 changed files with 4 additions and 14 deletions
|
@ -52,17 +52,16 @@ ConGetConsoleScreenBufferInfo(PCONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInf
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
ConAllocConsole(VOID)
|
ConAllocConsole(VOID)
|
||||||
{
|
{
|
||||||
|
UNICODE_STRING ScreenName = RTL_CONSTANT_STRING(L"\\??\\BlueScreen");
|
||||||
|
UNICODE_STRING KeyboardName = RTL_CONSTANT_STRING(L"\\Device\\KeyboardClass0");
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
IO_STATUS_BLOCK IoStatusBlock;
|
IO_STATUS_BLOCK IoStatusBlock;
|
||||||
UNICODE_STRING Name;
|
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||||
|
|
||||||
/* Open the screen */
|
/* Open the screen */
|
||||||
RtlInitUnicodeString(&Name,
|
|
||||||
L"\\??\\BlueScreen");
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&ScreenName,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
@ -76,10 +75,8 @@ ConAllocConsole(VOID)
|
||||||
return(Status);
|
return(Status);
|
||||||
|
|
||||||
/* Open the keyboard */
|
/* Open the keyboard */
|
||||||
RtlInitUnicodeString(&Name,
|
|
||||||
L"\\??\\Keyboard");
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&KeyboardName,
|
||||||
0,
|
0,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
|
@ -284,7 +284,6 @@ CreateClassDeviceObject(
|
||||||
OUT PDEVICE_OBJECT *ClassDO OPTIONAL)
|
OUT PDEVICE_OBJECT *ClassDO OPTIONAL)
|
||||||
{
|
{
|
||||||
PCLASS_DRIVER_EXTENSION DriverExtension;
|
PCLASS_DRIVER_EXTENSION DriverExtension;
|
||||||
UNICODE_STRING SymbolicLinkName = RTL_CONSTANT_STRING(L"\\??\\Keyboard");
|
|
||||||
ULONG DeviceId = 0;
|
ULONG DeviceId = 0;
|
||||||
ULONG PrefixLength;
|
ULONG PrefixLength;
|
||||||
UNICODE_STRING DeviceNameU;
|
UNICODE_STRING DeviceNameU;
|
||||||
|
@ -374,10 +373,6 @@ cleanup:
|
||||||
DriverExtension->RegistryPath.Buffer,
|
DriverExtension->RegistryPath.Buffer,
|
||||||
DriverExtension->RegistryPath.MaximumLength);
|
DriverExtension->RegistryPath.MaximumLength);
|
||||||
|
|
||||||
/* HACK: 1st stage setup needs a keyboard to open it in user-mode
|
|
||||||
* Create a link to user space... */
|
|
||||||
IoCreateSymbolicLink(&SymbolicLinkName, &DeviceNameU);
|
|
||||||
|
|
||||||
ExFreePool(DeviceNameU.Buffer);
|
ExFreePool(DeviceNameU.Buffer);
|
||||||
|
|
||||||
if (ClassDO)
|
if (ClassDO)
|
||||||
|
@ -597,7 +592,6 @@ ClassAddDevice(
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("ConnectPortDriver() failed with status 0x%08lx\n", Status);
|
DPRINT("ConnectPortDriver() failed with status 0x%08lx\n", Status);
|
||||||
ObDereferenceObject(Fdo);
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
|
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
|
||||||
|
|
|
@ -569,7 +569,6 @@ ClassAddDevice(
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("ConnectPortDriver() failed with status 0x%08lx\n", Status);
|
DPRINT("ConnectPortDriver() failed with status 0x%08lx\n", Status);
|
||||||
ObDereferenceObject(Fdo);
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
|
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue