[NTFS]
[reactos.git] / reactos / drivers / filesystems / ntfs / misc.c
index d676b22..c365f03 100644 (file)
@@ -31,9 +31,6 @@
 #define NDEBUG
 #include <debug.h>
 
-/* GLOBALS *****************************************************************/
-
-
 /* FUNCTIONS ****************************************************************/
 
 /*
 BOOLEAN
 NtfsIsIrpTopLevel(PIRP Irp)
 {
-  BOOLEAN      ReturnCode = FALSE;
-  
-  TRACE_(NTFS, "NtfsIsIrpTopLevel()\n");
+    BOOLEAN ReturnCode = FALSE;
 
-  if (IoGetTopLevelIrp() == NULL)
-  {
-    IoSetTopLevelIrp(Irp);
-    ReturnCode = TRUE;
-  }
+    TRACE_(NTFS, "NtfsIsIrpTopLevel()\n");
 
-  return ReturnCode;
+    if (IoGetTopLevelIrp() == NULL)
+    {
+        IoSetTopLevelIrp(Irp);
+        ReturnCode = TRUE;
+    }
+
+    return ReturnCode;
 }
 
 /*
@@ -69,29 +66,47 @@ PNTFS_IRP_CONTEXT
 NtfsAllocateIrpContext(PDEVICE_OBJECT DeviceObject,
                        PIRP Irp)
 {
-  PNTFS_IRP_CONTEXT IrpContext;
-  PIO_STACK_LOCATION IoStackLocation;
-  
-  TRACE_(NTFS, "NtfsAllocateIrpContext()\n");
-  
-  IrpContext = (PNTFS_IRP_CONTEXT)ExAllocatePoolWithTag(NonPagedPool, sizeof(NTFS_IRP_CONTEXT), 'PRIN');
-  if (IrpContext == NULL)
-    return NULL;
-  RtlZeroMemory(IrpContext, sizeof(NTFS_IRP_CONTEXT));
-
-  IrpContext->Identifier.Type = NTFS_TYPE_IRP_CONTEST;
-  IrpContext->Identifier.Size = sizeof(NTFS_IRP_CONTEXT);
-  IrpContext->Irp = Irp;
-  IrpContext->DeviceObject = DeviceObject;
-  if (Irp)
-  {
-    IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
-    ASSERT(IoStackLocation);
-
-    IrpContext->MajorFunction = IoStackLocation->MajorFunction;
-    IrpContext->MinorFunction = IoStackLocation->MinorFunction;
-    IrpContext->IsTopLevel = (IoGetTopLevelIrp() == Irp);
-  }
-  
-  return IrpContext;
+    PNTFS_IRP_CONTEXT IrpContext;
+    PIO_STACK_LOCATION IoStackLocation;
+
+    TRACE_(NTFS, "NtfsAllocateIrpContext()\n");
+
+    IrpContext = (PNTFS_IRP_CONTEXT)ExAllocatePoolWithTag(NonPagedPool,
+                                                          sizeof(NTFS_IRP_CONTEXT),
+                                                          'PRIN');
+    if (IrpContext == NULL)
+        return NULL;
+
+    RtlZeroMemory(IrpContext, sizeof(NTFS_IRP_CONTEXT));
+
+    IrpContext->Identifier.Type = NTFS_TYPE_IRP_CONTEST;
+    IrpContext->Identifier.Size = sizeof(NTFS_IRP_CONTEXT);
+    IrpContext->Irp = Irp;
+    IrpContext->DeviceObject = DeviceObject;
+
+    if (Irp)
+    {
+        IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
+        ASSERT(IoStackLocation);
+
+        IrpContext->MajorFunction = IoStackLocation->MajorFunction;
+        IrpContext->MinorFunction = IoStackLocation->MinorFunction;
+        IrpContext->IsTopLevel = (IoGetTopLevelIrp() == Irp);
+    }
+
+    return IrpContext;
+}
+
+/* See:
+ -> http://msdn.microsoft.com/en-us/library/ms724228
+ -> http://bos.asmhackers.net/docs/filesystems/ntfs/standard.html#layout
+ */
+VOID
+NtfsDateTimeToFileTime(ULONGLONG NtfsTime,
+                       PLARGE_INTEGER SystemTime)
+{
+
+    SystemTime->QuadPart = NtfsTime + 116444736000000000;
 }
+
+/* EOF */