Author: janderwald
Date: Sun Dec 31 18:28:20 2006
New Revision: 25252
URL:
http://svn.reactos.org/svn/reactos?rev=25252&view=rev
Log:
- check if IoCreateDevice succeeded...
Modified:
trunk/reactos/drivers/base/blue/blue.c
Modified: trunk/reactos/drivers/base/blue/blue.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/blue/blue.c?r…
==============================================================================
--- trunk/reactos/drivers/base/blue/blue.c (original)
+++ trunk/reactos/drivers/base/blue/blue.c Sun Dec 31 18:28:20 2006
@@ -801,6 +801,7 @@
DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{
PDEVICE_OBJECT DeviceObject;
+ NTSTATUS Status;
UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\BlueScreen");
UNICODE_STRING SymlinkName = RTL_CONSTANT_STRING(L"\\??\\BlueScreen");
@@ -812,13 +813,18 @@
DriverObject->MajorFunction[IRP_MJ_WRITE] = ScrWrite;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL ] = ScrIoControl;
- IoCreateDevice (DriverObject,
- sizeof(DEVICE_EXTENSION),
- &DeviceName,
- FILE_DEVICE_SCREEN,
- 0,
- TRUE,
- &DeviceObject);
+ Status = IoCreateDevice (DriverObject,
+ sizeof(DEVICE_EXTENSION),
+ &DeviceName,
+ FILE_DEVICE_SCREEN,
+ 0,
+ TRUE,
+ &DeviceObject);
+
+ if (!NT_SUCCESS(Status))
+ {
+ return Status;
+ }
IoCreateSymbolicLink (&SymlinkName, &DeviceName);