[NPFS]
[reactos.git] / reactos / drivers / filesystems / npfs / npfs.c
index 147f410..825abe3 100644 (file)
@@ -19,9 +19,10 @@ NTSTATUS NTAPI
 DriverEntry(PDRIVER_OBJECT DriverObject,
             PUNICODE_STRING RegistryPath)
 {
-    PNPFS_DEVICE_EXTENSION DeviceExtension;
     PDEVICE_OBJECT DeviceObject;
     UNICODE_STRING DeviceName;
+    PNPFS_VCB Vcb;
+    PNPFS_FCB Fcb;
     NTSTATUS Status;
 
     DPRINT("Named Pipe FSD 0.0.2\n");
@@ -56,7 +57,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
 
     RtlInitUnicodeString(&DeviceName, L"\\Device\\NamedPipe");
     Status = IoCreateDevice(DriverObject,
-        sizeof(NPFS_DEVICE_EXTENSION),
+        sizeof(NPFS_VCB),
         &DeviceName,
         FILE_DEVICE_NAMED_PIPE,
         0,
@@ -68,21 +69,29 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
         return Status;
     }
 
-    /* initialize the device object */
+    /* Initialize the device object */
     DeviceObject->Flags |= DO_DIRECT_IO;
     DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
 
-    /* initialize the device extension */
-    DeviceExtension = DeviceObject->DeviceExtension;
-    InitializeListHead(&DeviceExtension->PipeListHead);
-    InitializeListHead(&DeviceExtension->ThreadListHead);
-    KeInitializeMutex(&DeviceExtension->PipeListLock, 0);
-    DeviceExtension->EmptyWaiterCount = 0;
+    /* Initialize the Volume Control Block (VCB) */
+    Vcb = (PNPFS_VCB)DeviceObject->DeviceExtension;
+    InitializeListHead(&Vcb->PipeListHead);
+    InitializeListHead(&Vcb->ThreadListHead);
+    KeInitializeMutex(&Vcb->PipeListLock, 0);
+    Vcb->EmptyWaiterCount = 0;
 
     /* set the size quotas */
-    DeviceExtension->MinQuota = PAGE_SIZE;
-    DeviceExtension->DefaultQuota = 8 * PAGE_SIZE;
-    DeviceExtension->MaxQuota = 64 * PAGE_SIZE;
+    Vcb->MinQuota = PAGE_SIZE;
+    Vcb->DefaultQuota = 8 * PAGE_SIZE;
+    Vcb->MaxQuota = 64 * PAGE_SIZE;
+
+    Fcb = ExAllocatePool(NonPagedPool, sizeof(NPFS_FCB));
+    Fcb->Type = FCB_DIRECTORY;
+    Fcb->Vcb = Vcb;
+
+
+
+    Vcb->RootFcb = Fcb;
 
     return STATUS_SUCCESS;
 }