[HEADERS]
[reactos.git] / reactos / drivers / storage / class / ramdisk / ramdisk.c
index 59f3d24..1ebe196 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <initguid.h>
 #include <ntddk.h>
+#include <ntifs.h>
 #include <ntdddisk.h>
 #include <ntddcdrm.h>
 #include <scsi.h>
@@ -17,7 +18,6 @@
 #include <ntddvol.h>
 #include <mountdev.h>
 #include <mountmgr.h>
-#include <helper.h>
 #include <ketypes.h>
 #include <iotypes.h>
 #include <rtlfuncs.h>
@@ -28,6 +28,8 @@
 #define NDEBUG
 #include <debug.h>
 
+#define DO_XIP   0x00020000
+
 /* GLOBALS ********************************************************************/
 
 #define RAMDISK_SESSION_SIZE \
@@ -494,7 +496,7 @@ RamdiskCreateDiskDevice(IN PRAMDISK_BUS_EXTENSION DeviceExtension,
         Length = GuidString.Length + 32;
         Buffer = ExAllocatePoolWithTag(NonPagedPool,
                                        Length,
-                                       TAG('R', 'a', 'm', 'd'));
+                                       'dmaR');
         if (!Buffer)
         {
             //
@@ -543,7 +545,7 @@ RamdiskCreateDiskDevice(IN PRAMDISK_BUS_EXTENSION DeviceExtension,
             SymbolicLinkName.Length = GuidString.Length + 34;
             Buffer = ExAllocatePoolWithTag(NonPagedPool,
                                            SymbolicLinkName.MaximumLength,
-                                           TAG('R', 'a', 'm', 'd'));
+                                           'dmaR');
             SymbolicLinkName.Buffer = Buffer;
             if (Buffer)
             {
@@ -619,7 +621,7 @@ RamdiskCreateDiskDevice(IN PRAMDISK_BUS_EXTENSION DeviceExtension,
         DiskLength = Input->DiskLength;
                ExInitializeFastMutex(&DriveExtension->DiskListLock);
            IoInitializeRemoveLock(&DriveExtension->RemoveLock,
-                               TAG('R', 'a', 'm', 'd'),
+                               'dmaR',
                                0,
                                1);
         DriveExtension->DriveDeviceName = DeviceName;
@@ -1013,7 +1015,8 @@ RamdiskWorkerThread(IN PDEVICE_OBJECT DeviceObject,
         IoReleaseRemoveLock(&DeviceExtension->RemoveLock, Irp);
         Irp->IoStatus.Status = Status;
         Irp->IoStatus.Information = 0;
-        return IoCompleteRequest(Irp, IO_DISK_INCREMENT);
+        IoCompleteRequest(Irp, IO_DISK_INCREMENT);
+        return;
     }
     
     //
@@ -1021,7 +1024,7 @@ RamdiskWorkerThread(IN PDEVICE_OBJECT DeviceObject,
     //
     Irp->IoStatus.Status = Status;
     Irp->IoStatus.Information = 0;
-    return IoCompleteRequest(Irp, IO_NO_INCREMENT);
+    IoCompleteRequest(Irp, IO_NO_INCREMENT);
 }
 
 NTSTATUS
@@ -1199,7 +1202,7 @@ RamdiskGetPartitionInfo(IN PIRP Irp,
     NTSTATUS Status;
     PPARTITION_INFORMATION PartitionInfo;
     PVOID BaseAddress;
-    LARGE_INTEGER Zero = {{0}};
+    LARGE_INTEGER Zero = {{0, 0}};
     ULONG Length;
     PIO_STACK_LOCATION IoStackLocation;
     
@@ -1811,7 +1814,7 @@ RamdiskQueryDeviceRelations(IN DEVICE_RELATION_TYPE Type,
                                                             Objects) +
                                                FinalCount *
                                                sizeof(PDEVICE_OBJECT),
-                                               TAG('R', 'a', 'm', 'd'));
+                                               'dmaR');
     if (!OurDeviceRelations)
     {
         //
@@ -2231,7 +2234,7 @@ RamdiskAddDevice(IN PDRIVER_OBJECT DriverObject,
            DeviceExtension->Type = RamdiskBus;
                ExInitializeFastMutex(&DeviceExtension->DiskListLock);
            IoInitializeRemoveLock(&DeviceExtension->RemoveLock,
-                               TAG('R', 'a', 'm', 'd'),
+                               'dmaR',
                                0,
                                1);
                InitializeListHead(&DeviceExtension->DiskList);
@@ -2308,7 +2311,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject,
     PCHAR BootDeviceName, CommandLine;
     PDEVICE_OBJECT PhysicalDeviceObject = NULL;
     NTSTATUS Status;
-    DPRINT1("RAM Disk Driver Initialized\n");
+    DPRINT("RAM Disk Driver Initialized\n");
     
     //
     // Query ramdisk parameters
@@ -2322,7 +2325,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject,
     DriverRegistryPath.Buffer = ExAllocatePoolWithTag(PagedPool,
                                                       RegistryPath->Length +
                                                       sizeof(WCHAR),
-                                                      TAG('R', 'a', 'm', 'd'));
+                                                      'dmaR');
     if (!DriverRegistryPath.Buffer) return STATUS_INSUFFICIENT_RESOURCES;
     RtlCopyUnicodeString(&DriverRegistryPath, RegistryPath);