Author: hpoussin
Date: Sat Apr 22 18:08:43 2006
New Revision: 21708
URL:
http://svn.reactos.ru/svn/reactos?rev=21708&view=rev
Log:
Don't dereference device objects if they were not referenced
Remove one hack from kbdclass
Modified:
trunk/reactos/base/setup/usetup/console.c
trunk/reactos/drivers/input/kbdclass/kbdclass.c
trunk/reactos/drivers/input/mouclass/mouclass.c
Modified: trunk/reactos/base/setup/usetup/console.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/base/setup/usetup/console.c…
==============================================================================
--- trunk/reactos/base/setup/usetup/console.c (original)
+++ trunk/reactos/base/setup/usetup/console.c Sat Apr 22 18:08:43 2006
@@ -52,17 +52,16 @@
NTSTATUS
ConAllocConsole(VOID)
{
+ UNICODE_STRING ScreenName = RTL_CONSTANT_STRING(L"\\??\\BlueScreen");
+ UNICODE_STRING KeyboardName =
RTL_CONSTANT_STRING(L"\\Device\\KeyboardClass0");
OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK IoStatusBlock;
- UNICODE_STRING Name;
NTSTATUS Status;
CONSOLE_SCREEN_BUFFER_INFO csbi;
/* Open the screen */
- RtlInitUnicodeString(&Name,
- L"\\??\\BlueScreen");
InitializeObjectAttributes(&ObjectAttributes,
- &Name,
+ &ScreenName,
0,
NULL,
NULL);
@@ -76,10 +75,8 @@
return(Status);
/* Open the keyboard */
- RtlInitUnicodeString(&Name,
- L"\\??\\Keyboard");
InitializeObjectAttributes(&ObjectAttributes,
- &Name,
+ &KeyboardName,
0,
NULL,
NULL);
Modified: trunk/reactos/drivers/input/kbdclass/kbdclass.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/input/kbdclass/kbdc…
==============================================================================
--- trunk/reactos/drivers/input/kbdclass/kbdclass.c (original)
+++ trunk/reactos/drivers/input/kbdclass/kbdclass.c Sat Apr 22 18:08:43 2006
@@ -284,7 +284,6 @@
OUT PDEVICE_OBJECT *ClassDO OPTIONAL)
{
PCLASS_DRIVER_EXTENSION DriverExtension;
- UNICODE_STRING SymbolicLinkName = RTL_CONSTANT_STRING(L"\\??\\Keyboard");
ULONG DeviceId = 0;
ULONG PrefixLength;
UNICODE_STRING DeviceNameU;
@@ -374,10 +373,6 @@
DriverExtension->RegistryPath.Buffer,
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);
if (ClassDO)
@@ -597,7 +592,6 @@
if (!NT_SUCCESS(Status))
{
DPRINT("ConnectPortDriver() failed with status 0x%08lx\n", Status);
- ObDereferenceObject(Fdo);
goto cleanup;
}
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
Modified: trunk/reactos/drivers/input/mouclass/mouclass.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/drivers/input/mouclass/mouc…
==============================================================================
--- trunk/reactos/drivers/input/mouclass/mouclass.c (original)
+++ trunk/reactos/drivers/input/mouclass/mouclass.c Sat Apr 22 18:08:43 2006
@@ -569,7 +569,6 @@
if (!NT_SUCCESS(Status))
{
DPRINT("ConnectPortDriver() failed with status 0x%08lx\n", Status);
- ObDereferenceObject(Fdo);
goto cleanup;
}
Fdo->Flags &= ~DO_DEVICE_INITIALIZING;