Really fix the build, but make bootcd does not work yet.
[reactos.git] / reactos / ntoskrnl / inbv / inbv.c
index a9ef354..815b546 100755 (executable)
 /* INCLUDES ******************************************************************/
 
 #include <ntoskrnl.h>
-#include <ntos/bootvid.h>
-#include <ddk/ntbootvid.h>
+#include "../../drivers/base/bootvid/ntbootvid.h"
 #define NDEBUG
 #include <internal/debug.h>
 
+#if defined (ALLOC_PRAGMA)
+#pragma alloc_text(INIT, InbvEnableBootDriver)
+#endif
+
 
 /* GLOBALS *******************************************************************/
 
@@ -37,9 +40,8 @@ InbvCheckBootVid(VOID)
     {
       NTSTATUS Status;
       OBJECT_ATTRIBUTES ObjectAttributes;
-      UNICODE_STRING BootVidName;
+      UNICODE_STRING BootVidName = RTL_CONSTANT_STRING(L"\\Device\\BootVid");
 
-      RtlRosInitUnicodeStringFromLiteral(&BootVidName, L"\\Device\\BootVid");
       InitializeObjectAttributes(&ObjectAttributes,
                                 &BootVidName,
                                 0,
@@ -117,7 +119,7 @@ InbvEnableBootDriver(IN BOOLEAN Enable)
       /* Notify the hal we will acquire the display. */
       HalAcquireDisplayOwnership(InbvResetDisplayParameters);
 
-      Status = NtDeviceIoControlFile(BootVidDevice,
+      Status = ZwDeviceIoControlFile(BootVidDevice,
                                     NULL,
                                     NULL,
                                     NULL,
@@ -136,7 +138,7 @@ InbvEnableBootDriver(IN BOOLEAN Enable)
     }
   else
     {
-      Status = NtDeviceIoControlFile(BootVidDevice,
+      Status = ZwDeviceIoControlFile(BootVidDevice,
                                     NULL,
                                     NULL,
                                     NULL,
@@ -153,10 +155,10 @@ InbvEnableBootDriver(IN BOOLEAN Enable)
       BootVidDriverInstalled = FALSE;
       /* Notify the hal we have released the display. */
       HalReleaseDisplayOwnership();
-
-      NtClose(BootVidDevice);
-      BootVidDevice = NULL;
     }
+
+  ZwClose(BootVidDevice);
+  BootVidDevice = NULL;
 }