Browse Source

INTFileStore: Added LockFile and UnlockFile methods

Tal Aloni 7 years ago
parent
commit
36a0768457

+ 10 - 0
SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs

@@ -382,6 +382,16 @@ namespace SMBLibrary
             return NTStatus.STATUS_SUCCESS;
             return NTStatus.STATUS_SUCCESS;
         }
         }
 
 
+        public NTStatus LockFile(object handle, long byteOffset, long length, bool exclusiveLock)
+        {
+            return NTStatus.STATUS_NOT_SUPPORTED;
+        }
+
+        public NTStatus UnlockFile(object handle, long byteOffset, long length)
+        {
+            return NTStatus.STATUS_NOT_SUPPORTED;
+        }
+
         public NTStatus NotifyChange(out object ioRequest, object handle, NotifyChangeFilter completionFilter, bool watchTree, int outputBufferSize, OnNotifyChangeCompleted onNotifyChangeCompleted, object context)
         public NTStatus NotifyChange(out object ioRequest, object handle, NotifyChangeFilter completionFilter, bool watchTree, int outputBufferSize, OnNotifyChangeCompleted onNotifyChangeCompleted, object context)
         {
         {
             ioRequest = null;
             ioRequest = null;

+ 4 - 0
SMBLibrary/NTFileStore/INTFileStore.cs

@@ -28,6 +28,10 @@ namespace SMBLibrary
 
 
         NTStatus FlushFileBuffers(object handle);
         NTStatus FlushFileBuffers(object handle);
 
 
+        NTStatus LockFile(object handle, long byteOffset, long length, bool exclusiveLock);
+
+        NTStatus UnlockFile(object handle, long byteOffset, long length);
+
         NTStatus QueryDirectory(out List<QueryDirectoryFileInformation> result, object handle, string fileName, FileInformationClass informationClass);
         NTStatus QueryDirectory(out List<QueryDirectoryFileInformation> result, object handle, string fileName, FileInformationClass informationClass);
 
 
         NTStatus GetFileInformation(out FileInformation result, object handle, FileInformationClass informationClass);
         NTStatus GetFileInformation(out FileInformation result, object handle, FileInformationClass informationClass);

+ 10 - 0
SMBLibrary/NTFileStore/NamedPipeStore.cs

@@ -99,6 +99,16 @@ namespace SMBLibrary
             return NTStatus.STATUS_SUCCESS;
             return NTStatus.STATUS_SUCCESS;
         }
         }
 
 
+        public NTStatus LockFile(object handle, long byteOffset, long length, bool exclusiveLock)
+        {
+            return NTStatus.STATUS_NOT_SUPPORTED;
+        }
+
+        public NTStatus UnlockFile(object handle, long byteOffset, long length)
+        {
+            return NTStatus.STATUS_NOT_SUPPORTED;
+        }
+
         public NTStatus DeviceIOControl(object handle, uint ctlCode, byte[] input, out byte[] output, int maxOutputLength)
         public NTStatus DeviceIOControl(object handle, uint ctlCode, byte[] input, out byte[] output, int maxOutputLength)
         {
         {
             output = null;
             output = null;

+ 10 - 1
SMBLibrary/Win32/NTFileStore/NTDirectoryFileSystem.cs

@@ -110,7 +110,6 @@ namespace SMBLibrary.Win32
 
 
         public NTDirectoryFileSystem(string path) : this(new DirectoryInfo(path))
         public NTDirectoryFileSystem(string path) : this(new DirectoryInfo(path))
         {
         {
-
         }
         }
 
 
         public NTDirectoryFileSystem(DirectoryInfo directory)
         public NTDirectoryFileSystem(DirectoryInfo directory)
@@ -226,6 +225,16 @@ namespace SMBLibrary.Win32
             return NtFlushBuffersFile((IntPtr)handle, out ioStatusBlock);
             return NtFlushBuffersFile((IntPtr)handle, out ioStatusBlock);
         }
         }
 
 
+        public NTStatus LockFile(object handle, long byteOffset, long length, bool exclusiveLock)
+        {
+            return NTStatus.STATUS_NOT_SUPPORTED;
+        }
+
+        public NTStatus UnlockFile(object handle, long byteOffset, long length)
+        {
+            return NTStatus.STATUS_NOT_SUPPORTED;
+        }
+
         public NTStatus QueryDirectory(out List<QueryDirectoryFileInformation> result, object handle, string fileName, FileInformationClass informationClass)
         public NTStatus QueryDirectory(out List<QueryDirectoryFileInformation> result, object handle, string fileName, FileInformationClass informationClass)
         {
         {
             IO_STATUS_BLOCK ioStatusBlock;
             IO_STATUS_BLOCK ioStatusBlock;