Manually applying Gunnars patch became it's easier this way - and a good chance to...
authorRobert Dickenson <robd@reactos.org>
Thu, 7 Nov 2002 02:45:29 +0000 (02:45 +0000)
committerRobert Dickenson <robd@reactos.org>
Thu, 7 Nov 2002 02:45:29 +0000 (02:45 +0000)
svn path=/trunk/; revision=3715

reactos/include/ddk/fsfuncs.h
reactos/include/ddk/fstypes.h
reactos/include/ddk/iodef.h
reactos/include/ddk/iotypes.h
reactos/include/ntos/heap.h

index 72434d5..51adca6 100644 (file)
@@ -1,8 +1,23 @@
 #ifndef __INCLUDE_DDK_FSFUNCS_H
 #define __INCLUDE_DDK_FSFUNCS_H
-/* $Id: fsfuncs.h,v 1.16 2002/09/08 10:47:44 chorns Exp $ */
+/* $Id: fsfuncs.h,v 1.17 2002/11/07 02:44:49 robd Exp $ */
 #define FlagOn(x,f) ((x) & (f))
 
+VOID
+STDCALL
+FsRtlFreeFileLock(
+       IN PFILE_LOCK FileLock
+       );
+
+PFILE_LOCK
+STDCALL
+FsRtlAllocateFileLock (
+    IN PCOMPLETE_LOCK_IRP_ROUTINE   CompleteLockIrpRoutine OPTIONAL,
+    IN PUNLOCK_ROUTINE              UnlockRoutine OPTIONAL
+    );
+
+#define FsRtlAreThereCurrentFileLocks(FL) (((FL)->FastIoIsQuestionable))
+
 BOOLEAN STDCALL
 FsRtlAddLargeMcbEntry(IN PLARGE_MCB Mcb,
                      IN LONGLONG Vbn,
index 0bc6993..5b9c0f9 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef __INCLUDE_DDK_FSTYPES_H
 #define __INCLUDE_DDK_FSTYPES_H
-/* $Id: fstypes.h,v 1.7 2002/09/08 10:47:44 chorns Exp $ */
+/* $Id: fstypes.h,v 1.8 2002/11/07 02:44:49 robd Exp $ */
 
 #define FSRTL_TAG      TAG('F','S','r','t')
 
@@ -14,6 +14,23 @@ typedef struct _FILE_LOCK_INFO {
     LARGE_INTEGER   EndingByte;
 } FILE_LOCK_INFO, *PFILE_LOCK_INFO;
 
+typedef struct _FILE_LOCK_TOC {
+       KSPIN_LOCK                      SpinLock;
+       LIST_ENTRY                      GrantedListHead;
+       LIST_ENTRY                      PendingListHead;
+} FILE_LOCK_TOC, *PFILE_LOCK_TOC;
+
+typedef struct _FILE_LOCK_GRANTED {
+       LIST_ENTRY                      ListEntry;
+       FILE_LOCK_INFO          Lock;
+} FILE_LOCK_GRANTED, *PFILE_LOCK_GRANTED;
+
+typedef struct _FILE_LOCK_PENDING {
+       LIST_ENTRY                      ListEntry;
+       PIRP                            Irp;
+       PVOID                           Context;
+} FILE_LOCK_PENDING, *PFILE_LOCK_PENDING;
+
 // raw internal file lock struct returned from FsRtlGetNextFileLock
 typedef struct _FILE_SHARED_LOCK_ENTRY {
     PVOID           Unknown1;
index 4d199cd..4d0b4e9 100644 (file)
@@ -248,6 +248,14 @@ enum
 
 #define IRP_MJ_SCSI  IRP_MJ_INTERNAL_DEVICE_CONTROL
 
+/*
+ * Minor function numbers for IRP_MJ_LOCK_CONTROL
+ */
+#define IRP_MN_LOCK                     0x01
+#define IRP_MN_UNLOCK_SINGLE            0x02
+#define IRP_MN_UNLOCK_ALL               0x03
+#define IRP_MN_UNLOCK_ALL_BY_KEY        0x04
+
 /*
  * Minor function numbers for IRP_MJ_FILE_SYSTEM_CONTROL
  */
index 5cff95c..1426a4e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: iotypes.h,v 1.43 2002/10/05 10:53:36 dwelch Exp $
+/* $Id: iotypes.h,v 1.44 2002/11/07 02:44:49 robd Exp $
  *
  */
 
@@ -432,6 +432,14 @@ typedef struct __attribute__((packed)) _IO_STACK_LOCATION
          struct _SCSI_REQUEST_BLOCK *Srb;
        } Scsi;
 
+         //byte range file locking
+         struct 
+       {
+      PLARGE_INTEGER Length;
+      ULONG Key;
+      LARGE_INTEGER ByteOffset;
+    } LockControl;
+
       /* Paramters for other calls */
       struct
        {
index 5efac19..391d638 100644 (file)
@@ -18,7 +18,7 @@
 #define HEAP_NO_SERIALIZE      (1)
 #define HEAP_ZERO_MEMORY       (8)
 #define HEAP_REALLOC_IN_PLACE_ONLY     (16)
-#define HEAP_GROWABLE (32)
+#define HEAP_GROWABLE (2)
 #define HEAP_NO_VALLOC (64)
 
 #endif /* __INCLUDE_HEAP_H */