mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 00:43:00 -05:00
dll: API polishing
This commit is contained in:
parent
03611b6210
commit
067a0f1b37
@ -136,8 +136,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param VolumeInfo [out]
|
* @param VolumeInfo [out]
|
||||||
* Pointer to a structure that will receive the volume information on successful return
|
* Pointer to a structure that will receive the volume information on successful return
|
||||||
* from this call.
|
* from this call.
|
||||||
@ -145,15 +143,12 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* STATUS_SUCCESS or error code.
|
* STATUS_SUCCESS or error code.
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*GetVolumeInfo)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*GetVolumeInfo)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
FSP_FSCTL_VOLUME_INFO *VolumeInfo);
|
FSP_FSCTL_VOLUME_INFO *VolumeInfo);
|
||||||
/**
|
/**
|
||||||
* Set volume label.
|
* Set volume label.
|
||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param VolumeLabel
|
* @param VolumeLabel
|
||||||
* The new label for the volume.
|
* The new label for the volume.
|
||||||
* @param VolumeInfo [out]
|
* @param VolumeInfo [out]
|
||||||
@ -163,7 +158,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* STATUS_SUCCESS or error code.
|
* STATUS_SUCCESS or error code.
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*SetVolumeLabel)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*SetVolumeLabel)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PWSTR VolumeLabel,
|
PWSTR VolumeLabel,
|
||||||
FSP_FSCTL_VOLUME_INFO *VolumeInfo);
|
FSP_FSCTL_VOLUME_INFO *VolumeInfo);
|
||||||
/**
|
/**
|
||||||
@ -202,13 +196,8 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileName
|
* @param FileName
|
||||||
* The name of the file or directory to be created.
|
* The name of the file or directory to be created.
|
||||||
* @param CaseSensitive
|
|
||||||
* Whether to treat the FileName as case-sensitive or case-insensitive. Case-sensitive
|
|
||||||
* file systems always treat FileName as case-sensitive regardless of this parameter.
|
|
||||||
* @param CreateOptions
|
* @param CreateOptions
|
||||||
* Create options for this request. This parameter has the same meaning as the
|
* Create options for this request. This parameter has the same meaning as the
|
||||||
* CreateOptions parameter of the NtCreateFile API. User mode file systems should typically
|
* CreateOptions parameter of the NtCreateFile API. User mode file systems should typically
|
||||||
@ -216,12 +205,18 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* directory rather than a file. Some file systems may also want to pay attention to the
|
* directory rather than a file. Some file systems may also want to pay attention to the
|
||||||
* FILE_NO_INTERMEDIATE_BUFFERING and FILE_WRITE_THROUGH flags, although these are
|
* FILE_NO_INTERMEDIATE_BUFFERING and FILE_WRITE_THROUGH flags, although these are
|
||||||
* typically handled by the FSD component.
|
* typically handled by the FSD component.
|
||||||
|
* @param GrantedAccess
|
||||||
|
* Determines the specific access rights that have been granted for this request. Upon
|
||||||
|
* receiving this call all access checks have been performed and the user mode file system
|
||||||
|
* need not perform any additional checks. However this parameter may be useful to a user
|
||||||
|
* mode file system; for example the WinFsp-FUSE layer uses this parameter to determine
|
||||||
|
* which flags to use in its POSIX open() call.
|
||||||
* @param FileAttributes
|
* @param FileAttributes
|
||||||
* File attributes to apply to the newly created file or directory.
|
* File attributes to apply to the newly created file or directory.
|
||||||
* @param SecurityDescriptor
|
* @param SecurityDescriptor
|
||||||
* Security descriptor to apply to the newly created file or directory. This security
|
* Security descriptor to apply to the newly created file or directory. This security
|
||||||
* descriptor will always be in self-relative format. Its length can be retrieved using the
|
* descriptor will always be in self-relative format. Its length can be retrieved using the
|
||||||
* Windows GetSecurityDescriptorLength API.
|
* Windows GetSecurityDescriptorLength API. Will be NULL for named streams.
|
||||||
* @param AllocationSize
|
* @param AllocationSize
|
||||||
* Allocation size for the newly created file.
|
* Allocation size for the newly created file.
|
||||||
* @param PFileNode [out]
|
* @param PFileNode [out]
|
||||||
@ -237,8 +232,7 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* STATUS_SUCCESS or error code.
|
* STATUS_SUCCESS or error code.
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*Create)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*Create)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
PWSTR FileName, UINT32 CreateOptions, UINT32 GrantedAccess,
|
||||||
PWSTR FileName, BOOLEAN CaseSensitive, UINT32 CreateOptions,
|
|
||||||
UINT32 FileAttributes, PSECURITY_DESCRIPTOR SecurityDescriptor, UINT64 AllocationSize,
|
UINT32 FileAttributes, PSECURITY_DESCRIPTOR SecurityDescriptor, UINT64 AllocationSize,
|
||||||
PVOID *PFileNode, FSP_FSCTL_FILE_INFO *FileInfo);
|
PVOID *PFileNode, FSP_FSCTL_FILE_INFO *FileInfo);
|
||||||
/**
|
/**
|
||||||
@ -246,19 +240,20 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileName
|
* @param FileName
|
||||||
* The name of the file or directory to be opened.
|
* The name of the file or directory to be opened.
|
||||||
* @param CaseSensitive
|
|
||||||
* Whether to treat the FileName as case-sensitive or case-insensitive. Case-sensitive
|
|
||||||
* file systems always treat FileName as case-sensitive regardless of this parameter.
|
|
||||||
* @param CreateOptions
|
* @param CreateOptions
|
||||||
* Create options for this request. This parameter has the same meaning as the
|
* Create options for this request. This parameter has the same meaning as the
|
||||||
* CreateOptions parameter of the NtCreateFile API. User mode file systems typically
|
* CreateOptions parameter of the NtCreateFile API. User mode file systems typically
|
||||||
* do not need to do anything special with respect to this parameter. Some file systems may
|
* do not need to do anything special with respect to this parameter. Some file systems may
|
||||||
* also want to pay attention to the FILE_NO_INTERMEDIATE_BUFFERING and FILE_WRITE_THROUGH
|
* also want to pay attention to the FILE_NO_INTERMEDIATE_BUFFERING and FILE_WRITE_THROUGH
|
||||||
* flags, although these are typically handled by the FSD component.
|
* flags, although these are typically handled by the FSD component.
|
||||||
|
* @param GrantedAccess
|
||||||
|
* Determines the specific access rights that have been granted for this request. Upon
|
||||||
|
* receiving this call all access checks have been performed and the user mode file system
|
||||||
|
* need not perform any additional checks. However this parameter may be useful to a user
|
||||||
|
* mode file system; for example the WinFsp-FUSE layer uses this parameter to determine
|
||||||
|
* which flags to use in its POSIX open() call.
|
||||||
* @param PFileNode [out]
|
* @param PFileNode [out]
|
||||||
* Pointer that will receive the file node on successful return from this call. The file
|
* Pointer that will receive the file node on successful return from this call. The file
|
||||||
* node is a void pointer (or an integer that can fit in a pointer) that is used to
|
* node is a void pointer (or an integer that can fit in a pointer) that is used to
|
||||||
@ -272,16 +267,13 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* STATUS_SUCCESS or error code.
|
* STATUS_SUCCESS or error code.
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*Open)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*Open)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
PWSTR FileName, UINT32 CreateOptions, UINT32 GrantedAccess,
|
||||||
PWSTR FileName, BOOLEAN CaseSensitive, UINT32 CreateOptions,
|
|
||||||
PVOID *PFileNode, FSP_FSCTL_FILE_INFO *FileInfo);
|
PVOID *PFileNode, FSP_FSCTL_FILE_INFO *FileInfo);
|
||||||
/**
|
/**
|
||||||
* Overwrite a file.
|
* Overwrite a file.
|
||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the file to overwrite.
|
* The file node of the file to overwrite.
|
||||||
* @param FileAttributes
|
* @param FileAttributes
|
||||||
@ -296,7 +288,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* STATUS_SUCCESS or error code.
|
* STATUS_SUCCESS or error code.
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*Overwrite)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*Overwrite)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, UINT32 FileAttributes, BOOLEAN ReplaceFileAttributes,
|
PVOID FileNode, UINT32 FileAttributes, BOOLEAN ReplaceFileAttributes,
|
||||||
FSP_FSCTL_FILE_INFO *FileInfo);
|
FSP_FSCTL_FILE_INFO *FileInfo);
|
||||||
/**
|
/**
|
||||||
@ -324,8 +315,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the file or directory to cleanup.
|
* The file node of the file or directory to cleanup.
|
||||||
* @param FileName
|
* @param FileName
|
||||||
@ -339,28 +328,22 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* CanDelete
|
* CanDelete
|
||||||
*/
|
*/
|
||||||
VOID (*Cleanup)(FSP_FILE_SYSTEM *FileSystem,
|
VOID (*Cleanup)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, PWSTR FileName, BOOLEAN Delete);
|
PVOID FileNode, PWSTR FileName, BOOLEAN Delete);
|
||||||
/**
|
/**
|
||||||
* Close a file.
|
* Close a file.
|
||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the file or directory to be closed.
|
* The file node of the file or directory to be closed.
|
||||||
*/
|
*/
|
||||||
VOID (*Close)(FSP_FILE_SYSTEM *FileSystem,
|
VOID (*Close)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode);
|
PVOID FileNode);
|
||||||
/**
|
/**
|
||||||
* Read a file.
|
* Read a file.
|
||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the file to be read.
|
* The file node of the file to be read.
|
||||||
* @param Buffer
|
* @param Buffer
|
||||||
@ -376,7 +359,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* operation.
|
* operation.
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*Read)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*Read)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, PVOID Buffer, UINT64 Offset, ULONG Length,
|
PVOID FileNode, PVOID Buffer, UINT64 Offset, ULONG Length,
|
||||||
PULONG PBytesTransferred);
|
PULONG PBytesTransferred);
|
||||||
/**
|
/**
|
||||||
@ -384,8 +366,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the file to be written.
|
* The file node of the file to be written.
|
||||||
* @param Buffer
|
* @param Buffer
|
||||||
@ -409,7 +389,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* operation.
|
* operation.
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*Write)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*Write)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, PVOID Buffer, UINT64 Offset, ULONG Length,
|
PVOID FileNode, PVOID Buffer, UINT64 Offset, ULONG Length,
|
||||||
BOOLEAN WriteToEndOfFile, BOOLEAN ConstrainedIo,
|
BOOLEAN WriteToEndOfFile, BOOLEAN ConstrainedIo,
|
||||||
PULONG PBytesTransferred, FSP_FSCTL_FILE_INFO *FileInfo);
|
PULONG PBytesTransferred, FSP_FSCTL_FILE_INFO *FileInfo);
|
||||||
@ -420,23 +399,18 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the file to be flushed. When NULL the whole volume is being flushed.
|
* The file node of the file to be flushed. When NULL the whole volume is being flushed.
|
||||||
* @return
|
* @return
|
||||||
* STATUS_SUCCESS or error code.
|
* STATUS_SUCCESS or error code.
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*Flush)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*Flush)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode);
|
PVOID FileNode);
|
||||||
/**
|
/**
|
||||||
* Get file or directory information.
|
* Get file or directory information.
|
||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the file or directory to get information for.
|
* The file node of the file or directory to get information for.
|
||||||
* @param FileInfo [out]
|
* @param FileInfo [out]
|
||||||
@ -446,7 +420,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* STATUS_SUCCESS or error code.
|
* STATUS_SUCCESS or error code.
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*GetFileInfo)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*GetFileInfo)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode,
|
PVOID FileNode,
|
||||||
FSP_FSCTL_FILE_INFO *FileInfo);
|
FSP_FSCTL_FILE_INFO *FileInfo);
|
||||||
/**
|
/**
|
||||||
@ -454,8 +427,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the file or directory to set information for.
|
* The file node of the file or directory to set information for.
|
||||||
* @param FileAttributes
|
* @param FileAttributes
|
||||||
@ -477,7 +448,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* STATUS_SUCCESS or error code.
|
* STATUS_SUCCESS or error code.
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*SetBasicInfo)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*SetBasicInfo)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, UINT32 FileAttributes,
|
PVOID FileNode, UINT32 FileAttributes,
|
||||||
UINT64 CreationTime, UINT64 LastAccessTime, UINT64 LastWriteTime,
|
UINT64 CreationTime, UINT64 LastAccessTime, UINT64 LastWriteTime,
|
||||||
FSP_FSCTL_FILE_INFO *FileInfo);
|
FSP_FSCTL_FILE_INFO *FileInfo);
|
||||||
@ -503,8 +473,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the file to set the file/allocation size for.
|
* The file node of the file to set the file/allocation size for.
|
||||||
* @param NewSize
|
* @param NewSize
|
||||||
@ -518,7 +486,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* STATUS_SUCCESS or error code.
|
* STATUS_SUCCESS or error code.
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*SetFileSize)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*SetFileSize)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, UINT64 NewSize, BOOLEAN SetAllocationSize,
|
PVOID FileNode, UINT64 NewSize, BOOLEAN SetAllocationSize,
|
||||||
FSP_FSCTL_FILE_INFO *FileInfo);
|
FSP_FSCTL_FILE_INFO *FileInfo);
|
||||||
/**
|
/**
|
||||||
@ -536,8 +503,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the file or directory to test for deletion.
|
* The file node of the file or directory to test for deletion.
|
||||||
* @param FileName
|
* @param FileName
|
||||||
@ -548,7 +513,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* Cleanup
|
* Cleanup
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*CanDelete)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*CanDelete)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, PWSTR FileName);
|
PVOID FileNode, PWSTR FileName);
|
||||||
/**
|
/**
|
||||||
* Renames a file or directory.
|
* Renames a file or directory.
|
||||||
@ -564,8 +528,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the file or directory to be renamed.
|
* The file node of the file or directory to be renamed.
|
||||||
* @param FileName
|
* @param FileName
|
||||||
@ -578,7 +540,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* STATUS_SUCCESS or error code.
|
* STATUS_SUCCESS or error code.
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*Rename)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*Rename)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode,
|
PVOID FileNode,
|
||||||
PWSTR FileName, PWSTR NewFileName, BOOLEAN ReplaceIfExists);
|
PWSTR FileName, PWSTR NewFileName, BOOLEAN ReplaceIfExists);
|
||||||
/**
|
/**
|
||||||
@ -599,7 +560,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* STATUS_SUCCESS or error code.
|
* STATUS_SUCCESS or error code.
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*GetSecurity)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*GetSecurity)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode,
|
PVOID FileNode,
|
||||||
PSECURITY_DESCRIPTOR SecurityDescriptor, SIZE_T *PSecurityDescriptorSize);
|
PSECURITY_DESCRIPTOR SecurityDescriptor, SIZE_T *PSecurityDescriptorSize);
|
||||||
/**
|
/**
|
||||||
@ -610,24 +570,28 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the file or directory to set the security descriptor for.
|
* The file node of the file or directory to set the security descriptor for.
|
||||||
* @param SecurityInformation
|
* @param SecurityInformation
|
||||||
* Indicates what part of the file or directory security descriptor to change.
|
* Describes what parts of the file or directory security descriptor should
|
||||||
* @param SecurityDescriptor
|
* be modified.
|
||||||
* Security descriptor to apply to the file or directory. This security descriptor will
|
* @param ModificationDescriptor
|
||||||
* always be in self-relative format.
|
* Describes the modifications to apply to the file or directory security descriptor.
|
||||||
|
* @param AccessToken
|
||||||
|
* A handle to a token that can be used to verify whether the requested modifications
|
||||||
|
* are allowed.
|
||||||
* @return
|
* @return
|
||||||
* STATUS_SUCCESS or error code.
|
* STATUS_SUCCESS or error code.
|
||||||
|
* @see
|
||||||
|
* FspSetSecurityDescriptor
|
||||||
|
* FspDeleteSecurityDescriptor
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*SetSecurity)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*SetSecurity)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode,
|
PVOID FileNode,
|
||||||
SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor);
|
SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR ModificationDescriptor,
|
||||||
|
HANDLE AccessToken);
|
||||||
/**
|
/**
|
||||||
* Read a directory.
|
* Read a directory.
|
||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the directory to be read.
|
* The file node of the directory to be read.
|
||||||
* @param Buffer
|
* @param Buffer
|
||||||
@ -652,7 +616,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* FspFileSystemAddDirInfo
|
* FspFileSystemAddDirInfo
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*ReadDirectory)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*ReadDirectory)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, PVOID Buffer, UINT64 Offset, ULONG Length,
|
PVOID FileNode, PVOID Buffer, UINT64 Offset, ULONG Length,
|
||||||
PWSTR Pattern,
|
PWSTR Pattern,
|
||||||
PULONG PBytesTransferred);
|
PULONG PBytesTransferred);
|
||||||
@ -705,8 +668,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the reparse point.
|
* The file node of the reparse point.
|
||||||
* @param FileName
|
* @param FileName
|
||||||
@ -723,7 +684,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* SetReparsePoint
|
* SetReparsePoint
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*GetReparsePoint)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*GetReparsePoint)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode,
|
PVOID FileNode,
|
||||||
PWSTR FileName, PVOID Buffer, PSIZE_T PSize);
|
PWSTR FileName, PVOID Buffer, PSIZE_T PSize);
|
||||||
/**
|
/**
|
||||||
@ -731,8 +691,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the reparse point.
|
* The file node of the reparse point.
|
||||||
* @param FileName
|
* @param FileName
|
||||||
@ -748,7 +706,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* GetReparsePoint
|
* GetReparsePoint
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*SetReparsePoint)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*SetReparsePoint)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode,
|
PVOID FileNode,
|
||||||
PWSTR FileName, PVOID Buffer, SIZE_T Size);
|
PWSTR FileName, PVOID Buffer, SIZE_T Size);
|
||||||
/**
|
/**
|
||||||
@ -756,8 +713,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the reparse point.
|
* The file node of the reparse point.
|
||||||
* @param FileName
|
* @param FileName
|
||||||
@ -770,7 +725,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* STATUS_SUCCESS or error code.
|
* STATUS_SUCCESS or error code.
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*DeleteReparsePoint)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*DeleteReparsePoint)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode,
|
PVOID FileNode,
|
||||||
PWSTR FileName, PVOID Buffer, SIZE_T Size);
|
PWSTR FileName, PVOID Buffer, SIZE_T Size);
|
||||||
/**
|
/**
|
||||||
@ -778,8 +732,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
*
|
*
|
||||||
* @param FileSystem
|
* @param FileSystem
|
||||||
* The file system on which this request is posted.
|
* The file system on which this request is posted.
|
||||||
* @param Request
|
|
||||||
* The request posted by the kernel mode FSD.
|
|
||||||
* @param FileNode
|
* @param FileNode
|
||||||
* The file node of the file or directory to get stream information for.
|
* The file node of the file or directory to get stream information for.
|
||||||
* @param Buffer
|
* @param Buffer
|
||||||
@ -794,7 +746,6 @@ typedef struct _FSP_FILE_SYSTEM_INTERFACE
|
|||||||
* FspFileSystemAddStreamInfo
|
* FspFileSystemAddStreamInfo
|
||||||
*/
|
*/
|
||||||
NTSTATUS (*GetStreamInfo)(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS (*GetStreamInfo)(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, PVOID Buffer, ULONG Length,
|
PVOID FileNode, PVOID Buffer, ULONG Length,
|
||||||
PULONG PBytesTransferred);
|
PULONG PBytesTransferred);
|
||||||
|
|
||||||
@ -825,6 +776,11 @@ typedef struct _FSP_FILE_SYSTEM
|
|||||||
SRWLOCK OpGuardLock;
|
SRWLOCK OpGuardLock;
|
||||||
BOOLEAN UmFileNodeIsUserContext2;
|
BOOLEAN UmFileNodeIsUserContext2;
|
||||||
} FSP_FILE_SYSTEM;
|
} FSP_FILE_SYSTEM;
|
||||||
|
typedef struct _FSP_FILE_SYSTEM_OPERATION_CONTEXT
|
||||||
|
{
|
||||||
|
FSP_FSCTL_TRANSACT_REQ *Request;
|
||||||
|
FSP_FSCTL_TRANSACT_RSP *Response;
|
||||||
|
} FSP_FILE_SYSTEM_OPERATION_CONTEXT;
|
||||||
/**
|
/**
|
||||||
* Create a file system object.
|
* Create a file system object.
|
||||||
*
|
*
|
||||||
@ -924,6 +880,17 @@ FSP_API VOID FspFileSystemStopDispatcher(FSP_FILE_SYSTEM *FileSystem);
|
|||||||
*/
|
*/
|
||||||
FSP_API VOID FspFileSystemSendResponse(FSP_FILE_SYSTEM *FileSystem,
|
FSP_API VOID FspFileSystemSendResponse(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_RSP *Response);
|
FSP_FSCTL_TRANSACT_RSP *Response);
|
||||||
|
/**
|
||||||
|
* Get the current operation context.
|
||||||
|
*
|
||||||
|
* This function may be used only when servicing one of the FSP_FILE_SYSTEM_INTERFACE operations.
|
||||||
|
* The current operation context is stored in thread local storage. It allows access to the
|
||||||
|
* Request and Response associated with this operation.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* The current operation context.
|
||||||
|
*/
|
||||||
|
FSP_API FSP_FILE_SYSTEM_OPERATION_CONTEXT *FspFileSystemGetOperationContext(VOID);
|
||||||
static inline
|
static inline
|
||||||
PWSTR FspFileSystemMountPoint(FSP_FILE_SYSTEM *FileSystem)
|
PWSTR FspFileSystemMountPoint(FSP_FILE_SYSTEM *FileSystem)
|
||||||
{
|
{
|
||||||
@ -1000,6 +967,12 @@ VOID FspFileSystemSetDebugLog(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
{
|
{
|
||||||
FileSystem->DebugLog = DebugLog;
|
FileSystem->DebugLog = DebugLog;
|
||||||
}
|
}
|
||||||
|
static inline
|
||||||
|
BOOLEAN FspFileSystemIsOperationCaseSensitive(VOID)
|
||||||
|
{
|
||||||
|
FSP_FSCTL_TRANSACT_REQ *Request = FspFileSystemGetOperationContext()->Request;
|
||||||
|
return FspFsctlTransactCreateKind == Request->Kind && Request->Req.Create.CaseSensitive;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Operations
|
* Operations
|
||||||
@ -1266,10 +1239,54 @@ FSP_API NTSTATUS FspCreateSecurityDescriptor(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
FSP_FSCTL_TRANSACT_REQ *Request,
|
||||||
PSECURITY_DESCRIPTOR ParentDescriptor,
|
PSECURITY_DESCRIPTOR ParentDescriptor,
|
||||||
PSECURITY_DESCRIPTOR *PSecurityDescriptor);
|
PSECURITY_DESCRIPTOR *PSecurityDescriptor);
|
||||||
FSP_API NTSTATUS FspSetSecurityDescriptor(FSP_FILE_SYSTEM *FileSystem,
|
/**
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
* Modify security descriptor.
|
||||||
|
*
|
||||||
|
* This is a helper for implementing the SetSecurity operation.
|
||||||
|
*
|
||||||
|
* @param InputDescriptor
|
||||||
|
* The input security descriptor to be modified.
|
||||||
|
* @param SecurityInformation
|
||||||
|
* Describes what parts of the InputDescriptor should be modified. This should contain
|
||||||
|
* the same value passed to the SetSecurity SecurityInformation parameter.
|
||||||
|
* @param ModificationDescriptor
|
||||||
|
* Describes the modifications to apply to the InputDescriptor. This should contain
|
||||||
|
* the same value passed to the SetSecurity ModificationDescriptor parameter.
|
||||||
|
* @param AccessToken
|
||||||
|
* A handle to a token that can be used to verify whether the requested modifications
|
||||||
|
* are allowed. This should contain the same value passed to the SetSecurity AccessToken
|
||||||
|
* parameter.
|
||||||
|
* @param PSecurityDescriptor [out]
|
||||||
|
* Pointer to a memory location that will receive the resulting security descriptor.
|
||||||
|
* This security descriptor can be later freed using FspDeleteSecurityDescriptor.
|
||||||
|
* @return
|
||||||
|
* STATUS_SUCCESS or error code.
|
||||||
|
* @see
|
||||||
|
* SetSecurity
|
||||||
|
* FspDeleteSecurityDescriptor
|
||||||
|
*/
|
||||||
|
FSP_API NTSTATUS FspSetSecurityDescriptor(
|
||||||
PSECURITY_DESCRIPTOR InputDescriptor,
|
PSECURITY_DESCRIPTOR InputDescriptor,
|
||||||
|
SECURITY_INFORMATION SecurityInformation,
|
||||||
|
PSECURITY_DESCRIPTOR ModificationDescriptor,
|
||||||
|
HANDLE AccessToken,
|
||||||
PSECURITY_DESCRIPTOR *PSecurityDescriptor);
|
PSECURITY_DESCRIPTOR *PSecurityDescriptor);
|
||||||
|
/**
|
||||||
|
* Delete security descriptor.
|
||||||
|
*
|
||||||
|
* This is a helper for implementing the SetSecurity operation.
|
||||||
|
*
|
||||||
|
* @param SecurityDescriptor
|
||||||
|
* The security descriptor to be deleted.
|
||||||
|
* @param CreateFunc
|
||||||
|
* Function used to create the security descriptor. This parameter should be
|
||||||
|
* set to FspSetSecurityDescriptor for the public API.
|
||||||
|
* @return
|
||||||
|
* STATUS_SUCCESS or error code.
|
||||||
|
* @see
|
||||||
|
* SetSecurity
|
||||||
|
* FspSetSecurityDescriptor
|
||||||
|
*/
|
||||||
FSP_API VOID FspDeleteSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor,
|
FSP_API VOID FspDeleteSecurityDescriptor(PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
NTSTATUS (*CreateFunc)());
|
NTSTATUS (*CreateFunc)());
|
||||||
static inline
|
static inline
|
||||||
|
30
src/dll/fs.c
30
src/dll/fs.c
@ -25,6 +25,7 @@ enum
|
|||||||
static FSP_FILE_SYSTEM_INTERFACE FspFileSystemNullInterface;
|
static FSP_FILE_SYSTEM_INTERFACE FspFileSystemNullInterface;
|
||||||
|
|
||||||
static INIT_ONCE FspFileSystemInitOnce = INIT_ONCE_STATIC_INIT;
|
static INIT_ONCE FspFileSystemInitOnce = INIT_ONCE_STATIC_INIT;
|
||||||
|
static DWORD FspFileSystemTlsKey = TLS_OUT_OF_INDEXES;
|
||||||
static NTSTATUS (NTAPI *FspNtOpenSymbolicLinkObject)(
|
static NTSTATUS (NTAPI *FspNtOpenSymbolicLinkObject)(
|
||||||
PHANDLE LinkHandle, ACCESS_MASK DesiredAccess, POBJECT_ATTRIBUTES ObjectAttributes);
|
PHANDLE LinkHandle, ACCESS_MASK DesiredAccess, POBJECT_ATTRIBUTES ObjectAttributes);
|
||||||
static NTSTATUS (NTAPI *FspNtMakeTemporaryObject)(
|
static NTSTATUS (NTAPI *FspNtMakeTemporaryObject)(
|
||||||
@ -37,6 +38,8 @@ static BOOL WINAPI FspFileSystemInitialize(
|
|||||||
{
|
{
|
||||||
HANDLE Handle;
|
HANDLE Handle;
|
||||||
|
|
||||||
|
FspFileSystemTlsKey = TlsAlloc();
|
||||||
|
|
||||||
Handle = GetModuleHandleW(L"ntdll.dll");
|
Handle = GetModuleHandleW(L"ntdll.dll");
|
||||||
if (0 != Handle)
|
if (0 != Handle)
|
||||||
{
|
{
|
||||||
@ -55,6 +58,20 @@ static BOOL WINAPI FspFileSystemInitialize(
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID FspFileSystemFinalize(BOOLEAN Dynamic)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* This function is called during DLL_PROCESS_DETACH. We must therefore keep
|
||||||
|
* finalization tasks to a minimum.
|
||||||
|
*
|
||||||
|
* We must free our TLS key (if any). We only do so if the library
|
||||||
|
* is being explicitly unloaded (rather than the process exiting).
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (Dynamic && TLS_OUT_OF_INDEXES != FspFileSystemTlsKey)
|
||||||
|
TlsFree(FspFileSystemTlsKey);
|
||||||
|
}
|
||||||
|
|
||||||
FSP_API NTSTATUS FspFileSystemCreate(PWSTR DevicePath,
|
FSP_API NTSTATUS FspFileSystemCreate(PWSTR DevicePath,
|
||||||
const FSP_FSCTL_VOLUME_PARAMS *VolumeParams,
|
const FSP_FSCTL_VOLUME_PARAMS *VolumeParams,
|
||||||
const FSP_FILE_SYSTEM_INTERFACE *Interface,
|
const FSP_FILE_SYSTEM_INTERFACE *Interface,
|
||||||
@ -69,6 +86,8 @@ FSP_API NTSTATUS FspFileSystemCreate(PWSTR DevicePath,
|
|||||||
Interface = &FspFileSystemNullInterface;
|
Interface = &FspFileSystemNullInterface;
|
||||||
|
|
||||||
InitOnceExecuteOnce(&FspFileSystemInitOnce, FspFileSystemInitialize, 0, 0);
|
InitOnceExecuteOnce(&FspFileSystemInitOnce, FspFileSystemInitialize, 0, 0);
|
||||||
|
if (TLS_OUT_OF_INDEXES == FspFileSystemTlsKey)
|
||||||
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
|
||||||
FileSystem = MemAlloc(sizeof *FileSystem);
|
FileSystem = MemAlloc(sizeof *FileSystem);
|
||||||
if (0 == FileSystem)
|
if (0 == FileSystem)
|
||||||
@ -395,6 +414,7 @@ static DWORD WINAPI FspFileSystemDispatcherThread(PVOID FileSystem0)
|
|||||||
SIZE_T RequestSize, ResponseSize;
|
SIZE_T RequestSize, ResponseSize;
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request = 0;
|
FSP_FSCTL_TRANSACT_REQ *Request = 0;
|
||||||
FSP_FSCTL_TRANSACT_RSP *Response = 0;
|
FSP_FSCTL_TRANSACT_RSP *Response = 0;
|
||||||
|
FSP_FILE_SYSTEM_OPERATION_CONTEXT OperationContext;
|
||||||
HANDLE DispatcherThread = 0;
|
HANDLE DispatcherThread = 0;
|
||||||
|
|
||||||
Request = MemAlloc(FSP_FSCTL_TRANSACT_BUFFER_SIZEMIN);
|
Request = MemAlloc(FSP_FSCTL_TRANSACT_BUFFER_SIZEMIN);
|
||||||
@ -416,6 +436,10 @@ static DWORD WINAPI FspFileSystemDispatcherThread(PVOID FileSystem0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OperationContext.Request = Request;
|
||||||
|
OperationContext.Response = Response;
|
||||||
|
TlsSetValue(FspFileSystemTlsKey, &OperationContext);
|
||||||
|
|
||||||
memset(Response, 0, sizeof *Response);
|
memset(Response, 0, sizeof *Response);
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
@ -479,6 +503,7 @@ static DWORD WINAPI FspFileSystemDispatcherThread(PVOID FileSystem0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
TlsSetValue(FspFileSystemTlsKey, 0);
|
||||||
MemFree(Response);
|
MemFree(Response);
|
||||||
MemFree(Request);
|
MemFree(Request);
|
||||||
|
|
||||||
@ -556,3 +581,8 @@ FSP_API VOID FspFileSystemSendResponse(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
FspFsctlStop(FileSystem->VolumeHandle);
|
FspFsctlStop(FileSystem->VolumeHandle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FSP_API FSP_FILE_SYSTEM_OPERATION_CONTEXT *FspFileSystemGetOperationContext(VOID)
|
||||||
|
{
|
||||||
|
return (FSP_FILE_SYSTEM_OPERATION_CONTEXT *)TlsGetValue(FspFileSystemTlsKey);
|
||||||
|
}
|
||||||
|
@ -369,8 +369,8 @@ static NTSTATUS FspFileSystemOpCreate_FileCreate(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
memset(&OpenFileInfo, 0, sizeof OpenFileInfo);
|
memset(&OpenFileInfo, 0, sizeof OpenFileInfo);
|
||||||
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
||||||
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
||||||
Result = FileSystem->Interface->Create(FileSystem, Request,
|
Result = FileSystem->Interface->Create(FileSystem,
|
||||||
(PWSTR)Request->Buffer, Request->Req.Create.CaseSensitive, Request->Req.Create.CreateOptions,
|
(PWSTR)Request->Buffer, Request->Req.Create.CreateOptions, GrantedAccess,
|
||||||
Request->Req.Create.FileAttributes, ObjectDescriptor, Request->Req.Create.AllocationSize,
|
Request->Req.Create.FileAttributes, ObjectDescriptor, Request->Req.Create.AllocationSize,
|
||||||
&FileNode, &OpenFileInfo.FileInfo);
|
&FileNode, &OpenFileInfo.FileInfo);
|
||||||
FspDeleteSecurityDescriptor(ObjectDescriptor, FspCreateSecurityDescriptor);
|
FspDeleteSecurityDescriptor(ObjectDescriptor, FspCreateSecurityDescriptor);
|
||||||
@ -408,8 +408,8 @@ static NTSTATUS FspFileSystemOpCreate_FileOpen(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
memset(&OpenFileInfo, 0, sizeof OpenFileInfo);
|
memset(&OpenFileInfo, 0, sizeof OpenFileInfo);
|
||||||
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
||||||
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
||||||
Result = FileSystem->Interface->Open(FileSystem, Request,
|
Result = FileSystem->Interface->Open(FileSystem,
|
||||||
(PWSTR)Request->Buffer, Request->Req.Create.CaseSensitive, Request->Req.Create.CreateOptions,
|
(PWSTR)Request->Buffer, Request->Req.Create.CreateOptions, GrantedAccess,
|
||||||
&FileNode, &OpenFileInfo.FileInfo);
|
&FileNode, &OpenFileInfo.FileInfo);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
return Result;
|
return Result;
|
||||||
@ -453,8 +453,8 @@ static NTSTATUS FspFileSystemOpCreate_FileOpenIf(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
memset(&OpenFileInfo, 0, sizeof OpenFileInfo);
|
memset(&OpenFileInfo, 0, sizeof OpenFileInfo);
|
||||||
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
||||||
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
||||||
Result = FileSystem->Interface->Open(FileSystem, Request,
|
Result = FileSystem->Interface->Open(FileSystem,
|
||||||
(PWSTR)Request->Buffer, Request->Req.Create.CaseSensitive, Request->Req.Create.CreateOptions,
|
(PWSTR)Request->Buffer, Request->Req.Create.CreateOptions, GrantedAccess,
|
||||||
&FileNode, &OpenFileInfo.FileInfo);
|
&FileNode, &OpenFileInfo.FileInfo);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
{
|
{
|
||||||
@ -480,8 +480,8 @@ static NTSTATUS FspFileSystemOpCreate_FileOpenIf(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
memset(&OpenFileInfo, 0, sizeof OpenFileInfo);
|
memset(&OpenFileInfo, 0, sizeof OpenFileInfo);
|
||||||
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
||||||
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
||||||
Result = FileSystem->Interface->Create(FileSystem, Request,
|
Result = FileSystem->Interface->Create(FileSystem,
|
||||||
(PWSTR)Request->Buffer, Request->Req.Create.CaseSensitive, Request->Req.Create.CreateOptions,
|
(PWSTR)Request->Buffer, Request->Req.Create.CreateOptions, GrantedAccess,
|
||||||
Request->Req.Create.FileAttributes, ObjectDescriptor, Request->Req.Create.AllocationSize,
|
Request->Req.Create.FileAttributes, ObjectDescriptor, Request->Req.Create.AllocationSize,
|
||||||
&FileNode, &OpenFileInfo.FileInfo);
|
&FileNode, &OpenFileInfo.FileInfo);
|
||||||
FspDeleteSecurityDescriptor(ObjectDescriptor, FspCreateSecurityDescriptor);
|
FspDeleteSecurityDescriptor(ObjectDescriptor, FspCreateSecurityDescriptor);
|
||||||
@ -521,8 +521,8 @@ static NTSTATUS FspFileSystemOpCreate_FileOverwrite(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
memset(&OpenFileInfo, 0, sizeof OpenFileInfo);
|
memset(&OpenFileInfo, 0, sizeof OpenFileInfo);
|
||||||
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
||||||
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
||||||
Result = FileSystem->Interface->Open(FileSystem, Request,
|
Result = FileSystem->Interface->Open(FileSystem,
|
||||||
(PWSTR)Request->Buffer, Request->Req.Create.CaseSensitive, Request->Req.Create.CreateOptions,
|
(PWSTR)Request->Buffer, Request->Req.Create.CreateOptions, GrantedAccess,
|
||||||
&FileNode, &OpenFileInfo.FileInfo);
|
&FileNode, &OpenFileInfo.FileInfo);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
return Result;
|
return Result;
|
||||||
@ -566,8 +566,8 @@ static NTSTATUS FspFileSystemOpCreate_FileOverwriteIf(FSP_FILE_SYSTEM *FileSyste
|
|||||||
memset(&OpenFileInfo, 0, sizeof OpenFileInfo);
|
memset(&OpenFileInfo, 0, sizeof OpenFileInfo);
|
||||||
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
||||||
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
||||||
Result = FileSystem->Interface->Open(FileSystem, Request,
|
Result = FileSystem->Interface->Open(FileSystem,
|
||||||
(PWSTR)Request->Buffer, Request->Req.Create.CaseSensitive, Request->Req.Create.CreateOptions,
|
(PWSTR)Request->Buffer, Request->Req.Create.CreateOptions, GrantedAccess,
|
||||||
&FileNode, &OpenFileInfo.FileInfo);
|
&FileNode, &OpenFileInfo.FileInfo);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
{
|
{
|
||||||
@ -593,8 +593,8 @@ static NTSTATUS FspFileSystemOpCreate_FileOverwriteIf(FSP_FILE_SYSTEM *FileSyste
|
|||||||
memset(&OpenFileInfo, 0, sizeof OpenFileInfo);
|
memset(&OpenFileInfo, 0, sizeof OpenFileInfo);
|
||||||
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
||||||
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
||||||
Result = FileSystem->Interface->Create(FileSystem, Request,
|
Result = FileSystem->Interface->Create(FileSystem,
|
||||||
(PWSTR)Request->Buffer, Request->Req.Create.CaseSensitive, Request->Req.Create.CreateOptions,
|
(PWSTR)Request->Buffer, Request->Req.Create.CreateOptions, GrantedAccess,
|
||||||
Request->Req.Create.FileAttributes, ObjectDescriptor, Request->Req.Create.AllocationSize,
|
Request->Req.Create.FileAttributes, ObjectDescriptor, Request->Req.Create.AllocationSize,
|
||||||
&FileNode, &OpenFileInfo.FileInfo);
|
&FileNode, &OpenFileInfo.FileInfo);
|
||||||
FspDeleteSecurityDescriptor(ObjectDescriptor, FspCreateSecurityDescriptor);
|
FspDeleteSecurityDescriptor(ObjectDescriptor, FspCreateSecurityDescriptor);
|
||||||
@ -637,8 +637,8 @@ static NTSTATUS FspFileSystemOpCreate_FileOpenTargetDirectory(FSP_FILE_SYSTEM *F
|
|||||||
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
OpenFileInfo.NormalizedName = (PVOID)Response->Buffer;
|
||||||
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
OpenFileInfo.NormalizedNameSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
||||||
FspPathSuffix((PWSTR)Request->Buffer, &Parent, &Suffix, Root);
|
FspPathSuffix((PWSTR)Request->Buffer, &Parent, &Suffix, Root);
|
||||||
Result = FileSystem->Interface->Open(FileSystem, Request,
|
Result = FileSystem->Interface->Open(FileSystem,
|
||||||
Parent, Request->Req.Create.CaseSensitive, Request->Req.Create.CreateOptions,
|
Parent, Request->Req.Create.CreateOptions, GrantedAccess,
|
||||||
&FileNode, &OpenFileInfo.FileInfo);
|
&FileNode, &OpenFileInfo.FileInfo);
|
||||||
FspPathCombine((PWSTR)Request->Buffer, Suffix);
|
FspPathCombine((PWSTR)Request->Buffer, Suffix);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
@ -806,7 +806,7 @@ FSP_API NTSTATUS FspFileSystemOpOverwrite(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
return STATUS_INVALID_DEVICE_REQUEST;
|
return STATUS_INVALID_DEVICE_REQUEST;
|
||||||
|
|
||||||
memset(&FileInfo, 0, sizeof FileInfo);
|
memset(&FileInfo, 0, sizeof FileInfo);
|
||||||
Result = FileSystem->Interface->Overwrite(FileSystem, Request,
|
Result = FileSystem->Interface->Overwrite(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.Overwrite),
|
(PVOID)USERCONTEXT(Request->Req.Overwrite),
|
||||||
Request->Req.Overwrite.FileAttributes,
|
Request->Req.Overwrite.FileAttributes,
|
||||||
Request->Req.Overwrite.Supersede,
|
Request->Req.Overwrite.Supersede,
|
||||||
@ -814,7 +814,7 @@ FSP_API NTSTATUS FspFileSystemOpOverwrite(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
{
|
{
|
||||||
if (0 != FileSystem->Interface->Close)
|
if (0 != FileSystem->Interface->Close)
|
||||||
FileSystem->Interface->Close(FileSystem, Request,
|
FileSystem->Interface->Close(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.Overwrite));
|
(PVOID)USERCONTEXT(Request->Req.Overwrite));
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
@ -827,7 +827,7 @@ FSP_API NTSTATUS FspFileSystemOpCleanup(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
FSP_FSCTL_TRANSACT_REQ *Request, FSP_FSCTL_TRANSACT_RSP *Response)
|
FSP_FSCTL_TRANSACT_REQ *Request, FSP_FSCTL_TRANSACT_RSP *Response)
|
||||||
{
|
{
|
||||||
if (0 != FileSystem->Interface->Cleanup)
|
if (0 != FileSystem->Interface->Cleanup)
|
||||||
FileSystem->Interface->Cleanup(FileSystem, Request,
|
FileSystem->Interface->Cleanup(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.Cleanup),
|
(PVOID)USERCONTEXT(Request->Req.Cleanup),
|
||||||
0 != Request->FileName.Size ? (PWSTR)Request->Buffer : 0,
|
0 != Request->FileName.Size ? (PWSTR)Request->Buffer : 0,
|
||||||
0 != Request->Req.Cleanup.Delete);
|
0 != Request->Req.Cleanup.Delete);
|
||||||
@ -839,7 +839,7 @@ FSP_API NTSTATUS FspFileSystemOpClose(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
FSP_FSCTL_TRANSACT_REQ *Request, FSP_FSCTL_TRANSACT_RSP *Response)
|
FSP_FSCTL_TRANSACT_REQ *Request, FSP_FSCTL_TRANSACT_RSP *Response)
|
||||||
{
|
{
|
||||||
if (0 != FileSystem->Interface->Close)
|
if (0 != FileSystem->Interface->Close)
|
||||||
FileSystem->Interface->Close(FileSystem, Request,
|
FileSystem->Interface->Close(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.Close));
|
(PVOID)USERCONTEXT(Request->Req.Close));
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
@ -855,7 +855,7 @@ FSP_API NTSTATUS FspFileSystemOpRead(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
return STATUS_INVALID_DEVICE_REQUEST;
|
return STATUS_INVALID_DEVICE_REQUEST;
|
||||||
|
|
||||||
BytesTransferred = 0;
|
BytesTransferred = 0;
|
||||||
Result = FileSystem->Interface->Read(FileSystem, Request,
|
Result = FileSystem->Interface->Read(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.Read),
|
(PVOID)USERCONTEXT(Request->Req.Read),
|
||||||
(PVOID)Request->Req.Read.Address,
|
(PVOID)Request->Req.Read.Address,
|
||||||
Request->Req.Read.Offset,
|
Request->Req.Read.Offset,
|
||||||
@ -881,7 +881,7 @@ FSP_API NTSTATUS FspFileSystemOpWrite(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
return STATUS_INVALID_DEVICE_REQUEST;
|
return STATUS_INVALID_DEVICE_REQUEST;
|
||||||
|
|
||||||
BytesTransferred = 0;
|
BytesTransferred = 0;
|
||||||
Result = FileSystem->Interface->Write(FileSystem, Request,
|
Result = FileSystem->Interface->Write(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.Write),
|
(PVOID)USERCONTEXT(Request->Req.Write),
|
||||||
(PVOID)Request->Req.Write.Address,
|
(PVOID)Request->Req.Write.Address,
|
||||||
Request->Req.Write.Offset,
|
Request->Req.Write.Offset,
|
||||||
@ -908,7 +908,7 @@ FSP_API NTSTATUS FspFileSystemOpFlushBuffers(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
if (0 == FileSystem->Interface->Flush)
|
if (0 == FileSystem->Interface->Flush)
|
||||||
return STATUS_SUCCESS; /* liar! */
|
return STATUS_SUCCESS; /* liar! */
|
||||||
|
|
||||||
return FileSystem->Interface->Flush(FileSystem, Request,
|
return FileSystem->Interface->Flush(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.FlushBuffers));
|
(PVOID)USERCONTEXT(Request->Req.FlushBuffers));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -922,7 +922,7 @@ FSP_API NTSTATUS FspFileSystemOpQueryInformation(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
return STATUS_INVALID_DEVICE_REQUEST;
|
return STATUS_INVALID_DEVICE_REQUEST;
|
||||||
|
|
||||||
memset(&FileInfo, 0, sizeof FileInfo);
|
memset(&FileInfo, 0, sizeof FileInfo);
|
||||||
Result = FileSystem->Interface->GetFileInfo(FileSystem, Request,
|
Result = FileSystem->Interface->GetFileInfo(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.QueryInformation), &FileInfo);
|
(PVOID)USERCONTEXT(Request->Req.QueryInformation), &FileInfo);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
return Result;
|
return Result;
|
||||||
@ -943,7 +943,7 @@ FSP_API NTSTATUS FspFileSystemOpSetInformation(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
{
|
{
|
||||||
case 4/*FileBasicInformation*/:
|
case 4/*FileBasicInformation*/:
|
||||||
if (0 != FileSystem->Interface->SetBasicInfo)
|
if (0 != FileSystem->Interface->SetBasicInfo)
|
||||||
Result = FileSystem->Interface->SetBasicInfo(FileSystem, Request,
|
Result = FileSystem->Interface->SetBasicInfo(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.SetInformation),
|
(PVOID)USERCONTEXT(Request->Req.SetInformation),
|
||||||
Request->Req.SetInformation.Info.Basic.FileAttributes,
|
Request->Req.SetInformation.Info.Basic.FileAttributes,
|
||||||
Request->Req.SetInformation.Info.Basic.CreationTime,
|
Request->Req.SetInformation.Info.Basic.CreationTime,
|
||||||
@ -953,14 +953,14 @@ FSP_API NTSTATUS FspFileSystemOpSetInformation(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
break;
|
break;
|
||||||
case 19/*FileAllocationInformation*/:
|
case 19/*FileAllocationInformation*/:
|
||||||
if (0 != FileSystem->Interface->SetFileSize)
|
if (0 != FileSystem->Interface->SetFileSize)
|
||||||
Result = FileSystem->Interface->SetFileSize(FileSystem, Request,
|
Result = FileSystem->Interface->SetFileSize(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.SetInformation),
|
(PVOID)USERCONTEXT(Request->Req.SetInformation),
|
||||||
Request->Req.SetInformation.Info.Allocation.AllocationSize, TRUE,
|
Request->Req.SetInformation.Info.Allocation.AllocationSize, TRUE,
|
||||||
&FileInfo);
|
&FileInfo);
|
||||||
break;
|
break;
|
||||||
case 20/*FileEndOfFileInformation*/:
|
case 20/*FileEndOfFileInformation*/:
|
||||||
if (0 != FileSystem->Interface->SetFileSize)
|
if (0 != FileSystem->Interface->SetFileSize)
|
||||||
Result = FileSystem->Interface->SetFileSize(FileSystem, Request,
|
Result = FileSystem->Interface->SetFileSize(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.SetInformation),
|
(PVOID)USERCONTEXT(Request->Req.SetInformation),
|
||||||
Request->Req.SetInformation.Info.EndOfFile.FileSize, FALSE,
|
Request->Req.SetInformation.Info.EndOfFile.FileSize, FALSE,
|
||||||
&FileInfo);
|
&FileInfo);
|
||||||
@ -968,7 +968,7 @@ FSP_API NTSTATUS FspFileSystemOpSetInformation(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
case 13/*FileDispositionInformation*/:
|
case 13/*FileDispositionInformation*/:
|
||||||
if (0 != FileSystem->Interface->GetFileInfo)
|
if (0 != FileSystem->Interface->GetFileInfo)
|
||||||
{
|
{
|
||||||
Result = FileSystem->Interface->GetFileInfo(FileSystem, Request,
|
Result = FileSystem->Interface->GetFileInfo(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.SetInformation), &FileInfo);
|
(PVOID)USERCONTEXT(Request->Req.SetInformation), &FileInfo);
|
||||||
if (NT_SUCCESS(Result) && 0 != (FileInfo.FileAttributes & FILE_ATTRIBUTE_READONLY))
|
if (NT_SUCCESS(Result) && 0 != (FileInfo.FileAttributes & FILE_ATTRIBUTE_READONLY))
|
||||||
{
|
{
|
||||||
@ -978,7 +978,7 @@ FSP_API NTSTATUS FspFileSystemOpSetInformation(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
if (0 != FileSystem->Interface->CanDelete)
|
if (0 != FileSystem->Interface->CanDelete)
|
||||||
if (Request->Req.SetInformation.Info.Disposition.Delete)
|
if (Request->Req.SetInformation.Info.Disposition.Delete)
|
||||||
Result = FileSystem->Interface->CanDelete(FileSystem, Request,
|
Result = FileSystem->Interface->CanDelete(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.SetInformation),
|
(PVOID)USERCONTEXT(Request->Req.SetInformation),
|
||||||
(PWSTR)Request->Buffer);
|
(PWSTR)Request->Buffer);
|
||||||
else
|
else
|
||||||
@ -995,7 +995,7 @@ FSP_API NTSTATUS FspFileSystemOpSetInformation(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
STATUS_OBJECT_NAME_NOT_FOUND != Result)
|
STATUS_OBJECT_NAME_NOT_FOUND != Result)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Result = FileSystem->Interface->Rename(FileSystem, Request,
|
Result = FileSystem->Interface->Rename(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.SetInformation),
|
(PVOID)USERCONTEXT(Request->Req.SetInformation),
|
||||||
(PWSTR)Request->Buffer,
|
(PWSTR)Request->Buffer,
|
||||||
(PWSTR)(Request->Buffer + Request->Req.SetInformation.Info.Rename.NewFileName.Offset),
|
(PWSTR)(Request->Buffer + Request->Req.SetInformation.Info.Rename.NewFileName.Offset),
|
||||||
@ -1021,7 +1021,7 @@ FSP_API NTSTATUS FspFileSystemOpQueryVolumeInformation(FSP_FILE_SYSTEM *FileSyst
|
|||||||
return STATUS_INVALID_DEVICE_REQUEST;
|
return STATUS_INVALID_DEVICE_REQUEST;
|
||||||
|
|
||||||
memset(&VolumeInfo, 0, sizeof VolumeInfo);
|
memset(&VolumeInfo, 0, sizeof VolumeInfo);
|
||||||
Result = FileSystem->Interface->GetVolumeInfo(FileSystem, Request, &VolumeInfo);
|
Result = FileSystem->Interface->GetVolumeInfo(FileSystem, &VolumeInfo);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
return Result;
|
return Result;
|
||||||
|
|
||||||
@ -1041,7 +1041,7 @@ FSP_API NTSTATUS FspFileSystemOpSetVolumeInformation(FSP_FILE_SYSTEM *FileSystem
|
|||||||
{
|
{
|
||||||
case 2/*FileFsLabelInformation*/:
|
case 2/*FileFsLabelInformation*/:
|
||||||
if (0 != FileSystem->Interface->SetVolumeLabel)
|
if (0 != FileSystem->Interface->SetVolumeLabel)
|
||||||
Result = FileSystem->Interface->SetVolumeLabel(FileSystem, Request,
|
Result = FileSystem->Interface->SetVolumeLabel(FileSystem,
|
||||||
(PWSTR)Request->Buffer,
|
(PWSTR)Request->Buffer,
|
||||||
&VolumeInfo);
|
&VolumeInfo);
|
||||||
break;
|
break;
|
||||||
@ -1064,7 +1064,7 @@ FSP_API NTSTATUS FspFileSystemOpQueryDirectory(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
return STATUS_INVALID_DEVICE_REQUEST;
|
return STATUS_INVALID_DEVICE_REQUEST;
|
||||||
|
|
||||||
BytesTransferred = 0;
|
BytesTransferred = 0;
|
||||||
Result = FileSystem->Interface->ReadDirectory(FileSystem, Request,
|
Result = FileSystem->Interface->ReadDirectory(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.QueryDirectory),
|
(PVOID)USERCONTEXT(Request->Req.QueryDirectory),
|
||||||
(PVOID)Request->Req.QueryDirectory.Address,
|
(PVOID)Request->Req.QueryDirectory.Address,
|
||||||
Request->Req.QueryDirectory.Offset,
|
Request->Req.QueryDirectory.Offset,
|
||||||
@ -1098,7 +1098,7 @@ FSP_API NTSTATUS FspFileSystemOpFileSystemControl(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
memset(ReparseData, 0, sizeof *ReparseData);
|
memset(ReparseData, 0, sizeof *ReparseData);
|
||||||
|
|
||||||
Size = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
Size = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
||||||
Result = FileSystem->Interface->GetReparsePoint(FileSystem, Request,
|
Result = FileSystem->Interface->GetReparsePoint(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.FileSystemControl),
|
(PVOID)USERCONTEXT(Request->Req.FileSystemControl),
|
||||||
(PWSTR)Request->Buffer, ReparseData, &Size);
|
(PWSTR)Request->Buffer, ReparseData, &Size);
|
||||||
if (NT_SUCCESS(Result))
|
if (NT_SUCCESS(Result))
|
||||||
@ -1115,7 +1115,7 @@ FSP_API NTSTATUS FspFileSystemOpFileSystemControl(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
ReparseData = (PREPARSE_DATA_BUFFER)
|
ReparseData = (PREPARSE_DATA_BUFFER)
|
||||||
(Request->Buffer + Request->Req.FileSystemControl.Buffer.Offset);
|
(Request->Buffer + Request->Req.FileSystemControl.Buffer.Offset);
|
||||||
|
|
||||||
Result = FileSystem->Interface->SetReparsePoint(FileSystem, Request,
|
Result = FileSystem->Interface->SetReparsePoint(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.FileSystemControl),
|
(PVOID)USERCONTEXT(Request->Req.FileSystemControl),
|
||||||
(PWSTR)Request->Buffer,
|
(PWSTR)Request->Buffer,
|
||||||
ReparseData,
|
ReparseData,
|
||||||
@ -1128,7 +1128,7 @@ FSP_API NTSTATUS FspFileSystemOpFileSystemControl(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
ReparseData = (PREPARSE_DATA_BUFFER)
|
ReparseData = (PREPARSE_DATA_BUFFER)
|
||||||
(Request->Buffer + Request->Req.FileSystemControl.Buffer.Offset);
|
(Request->Buffer + Request->Req.FileSystemControl.Buffer.Offset);
|
||||||
|
|
||||||
Result = FileSystem->Interface->DeleteReparsePoint(FileSystem, Request,
|
Result = FileSystem->Interface->DeleteReparsePoint(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.FileSystemControl),
|
(PVOID)USERCONTEXT(Request->Req.FileSystemControl),
|
||||||
(PWSTR)Request->Buffer,
|
(PWSTR)Request->Buffer,
|
||||||
ReparseData,
|
ReparseData,
|
||||||
@ -1150,7 +1150,7 @@ FSP_API NTSTATUS FspFileSystemOpQuerySecurity(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
return STATUS_INVALID_DEVICE_REQUEST;
|
return STATUS_INVALID_DEVICE_REQUEST;
|
||||||
|
|
||||||
SecurityDescriptorSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
SecurityDescriptorSize = FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX;
|
||||||
Result = FileSystem->Interface->GetSecurity(FileSystem, Request,
|
Result = FileSystem->Interface->GetSecurity(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.QuerySecurity),
|
(PVOID)USERCONTEXT(Request->Req.QuerySecurity),
|
||||||
Response->Buffer, &SecurityDescriptorSize);
|
Response->Buffer, &SecurityDescriptorSize);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
@ -1168,10 +1168,11 @@ FSP_API NTSTATUS FspFileSystemOpSetSecurity(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
if (0 == FileSystem->Interface->SetSecurity)
|
if (0 == FileSystem->Interface->SetSecurity)
|
||||||
return STATUS_INVALID_DEVICE_REQUEST;
|
return STATUS_INVALID_DEVICE_REQUEST;
|
||||||
|
|
||||||
return FileSystem->Interface->SetSecurity(FileSystem, Request,
|
return FileSystem->Interface->SetSecurity(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.SetSecurity),
|
(PVOID)USERCONTEXT(Request->Req.SetSecurity),
|
||||||
Request->Req.SetSecurity.SecurityInformation,
|
Request->Req.SetSecurity.SecurityInformation,
|
||||||
(PSECURITY_DESCRIPTOR)Request->Buffer);
|
(PSECURITY_DESCRIPTOR)Request->Buffer,
|
||||||
|
(HANDLE)Request->Req.SetSecurity.AccessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
FSP_API NTSTATUS FspFileSystemOpQueryStreamInformation(FSP_FILE_SYSTEM *FileSystem,
|
FSP_API NTSTATUS FspFileSystemOpQueryStreamInformation(FSP_FILE_SYSTEM *FileSystem,
|
||||||
@ -1184,7 +1185,7 @@ FSP_API NTSTATUS FspFileSystemOpQueryStreamInformation(FSP_FILE_SYSTEM *FileSyst
|
|||||||
return STATUS_INVALID_DEVICE_REQUEST;
|
return STATUS_INVALID_DEVICE_REQUEST;
|
||||||
|
|
||||||
BytesTransferred = 0;
|
BytesTransferred = 0;
|
||||||
Result = FileSystem->Interface->GetStreamInfo(FileSystem, Request,
|
Result = FileSystem->Interface->GetStreamInfo(FileSystem,
|
||||||
(PVOID)USERCONTEXT(Request->Req.QueryStreamInformation),
|
(PVOID)USERCONTEXT(Request->Req.QueryStreamInformation),
|
||||||
Response->Buffer,
|
Response->Buffer,
|
||||||
FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX,
|
FSP_FSCTL_TRANSACT_RSP_BUFFER_SIZEMAX,
|
||||||
|
@ -691,7 +691,6 @@ static NTSTATUS fsp_fuse_intf_GetReparsePointByName(
|
|||||||
PWSTR FileName, BOOLEAN IsDirectory, PVOID Buffer, PSIZE_T PSize);
|
PWSTR FileName, BOOLEAN IsDirectory, PVOID Buffer, PSIZE_T PSize);
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_GetVolumeInfo(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_GetVolumeInfo(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
FSP_FSCTL_VOLUME_INFO *VolumeInfo)
|
FSP_FSCTL_VOLUME_INFO *VolumeInfo)
|
||||||
{
|
{
|
||||||
struct fuse *f = FileSystem->UserContext;
|
struct fuse *f = FileSystem->UserContext;
|
||||||
@ -715,7 +714,6 @@ static NTSTATUS fsp_fuse_intf_GetVolumeInfo(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_SetVolumeLabel(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_SetVolumeLabel(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PWSTR VolumeLabel,
|
PWSTR VolumeLabel,
|
||||||
FSP_FSCTL_VOLUME_INFO *VolumeInfo)
|
FSP_FSCTL_VOLUME_INFO *VolumeInfo)
|
||||||
{
|
{
|
||||||
@ -758,8 +756,7 @@ exit:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_Create(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_Create(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
PWSTR FileName, UINT32 CreateOptions, UINT32 GrantedAccess,
|
||||||
PWSTR FileName, BOOLEAN CaseSensitive, UINT32 CreateOptions,
|
|
||||||
UINT32 FileAttributes, PSECURITY_DESCRIPTOR SecurityDescriptor, UINT64 AllocationSize,
|
UINT32 FileAttributes, PSECURITY_DESCRIPTOR SecurityDescriptor, UINT64 AllocationSize,
|
||||||
PVOID *PFileNode, FSP_FSCTL_FILE_INFO *FileInfo)
|
PVOID *PFileNode, FSP_FSCTL_FILE_INFO *FileInfo)
|
||||||
{
|
{
|
||||||
@ -914,8 +911,7 @@ exit:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_Open(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_Open(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
PWSTR FileName, UINT32 CreateOptions, UINT32 GrantedAccess,
|
||||||
PWSTR FileName, BOOLEAN CaseSensitive, UINT32 CreateOptions,
|
|
||||||
PVOID *PFileNode, FSP_FSCTL_FILE_INFO *FileInfo)
|
PVOID *PFileNode, FSP_FSCTL_FILE_INFO *FileInfo)
|
||||||
{
|
{
|
||||||
struct fuse *f = FileSystem->UserContext;
|
struct fuse *f = FileSystem->UserContext;
|
||||||
@ -941,7 +937,7 @@ static NTSTATUS fsp_fuse_intf_Open(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
memset(&fi, 0, sizeof fi);
|
memset(&fi, 0, sizeof fi);
|
||||||
switch (Request->Req.Create.DesiredAccess & (FILE_READ_DATA | FILE_WRITE_DATA))
|
switch (GrantedAccess & (FILE_READ_DATA | FILE_WRITE_DATA))
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
case FILE_READ_DATA:
|
case FILE_READ_DATA:
|
||||||
@ -1017,7 +1013,6 @@ exit:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_Overwrite(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_Overwrite(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, UINT32 FileAttributes, BOOLEAN ReplaceFileAttributes,
|
PVOID FileNode, UINT32 FileAttributes, BOOLEAN ReplaceFileAttributes,
|
||||||
FSP_FSCTL_FILE_INFO *FileInfo)
|
FSP_FSCTL_FILE_INFO *FileInfo)
|
||||||
{
|
{
|
||||||
@ -1055,7 +1050,6 @@ static NTSTATUS fsp_fuse_intf_Overwrite(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static VOID fsp_fuse_intf_Cleanup(FSP_FILE_SYSTEM *FileSystem,
|
static VOID fsp_fuse_intf_Cleanup(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, PWSTR FileName, BOOLEAN Delete)
|
PVOID FileNode, PWSTR FileName, BOOLEAN Delete)
|
||||||
{
|
{
|
||||||
struct fuse *f = FileSystem->UserContext;
|
struct fuse *f = FileSystem->UserContext;
|
||||||
@ -1092,7 +1086,6 @@ static VOID fsp_fuse_intf_Cleanup(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static VOID fsp_fuse_intf_Close(FSP_FILE_SYSTEM *FileSystem,
|
static VOID fsp_fuse_intf_Close(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode)
|
PVOID FileNode)
|
||||||
{
|
{
|
||||||
struct fuse *f = FileSystem->UserContext;
|
struct fuse *f = FileSystem->UserContext;
|
||||||
@ -1126,7 +1119,6 @@ static VOID fsp_fuse_intf_Close(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_Read(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_Read(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, PVOID Buffer, UINT64 Offset, ULONG Length,
|
PVOID FileNode, PVOID Buffer, UINT64 Offset, ULONG Length,
|
||||||
PULONG PBytesTransferred)
|
PULONG PBytesTransferred)
|
||||||
{
|
{
|
||||||
@ -1161,7 +1153,6 @@ static NTSTATUS fsp_fuse_intf_Read(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_Write(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_Write(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, PVOID Buffer, UINT64 Offset, ULONG Length,
|
PVOID FileNode, PVOID Buffer, UINT64 Offset, ULONG Length,
|
||||||
BOOLEAN WriteToEndOfFile, BOOLEAN ConstrainedIo,
|
BOOLEAN WriteToEndOfFile, BOOLEAN ConstrainedIo,
|
||||||
PULONG PBytesTransferred, FSP_FSCTL_FILE_INFO *FileInfo)
|
PULONG PBytesTransferred, FSP_FSCTL_FILE_INFO *FileInfo)
|
||||||
@ -1224,7 +1215,6 @@ success:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_Flush(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_Flush(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode)
|
PVOID FileNode)
|
||||||
{
|
{
|
||||||
struct fuse *f = FileSystem->UserContext;
|
struct fuse *f = FileSystem->UserContext;
|
||||||
@ -1264,7 +1254,6 @@ static NTSTATUS fsp_fuse_intf_Flush(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_GetFileInfo(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_GetFileInfo(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode,
|
PVOID FileNode,
|
||||||
FSP_FSCTL_FILE_INFO *FileInfo)
|
FSP_FSCTL_FILE_INFO *FileInfo)
|
||||||
{
|
{
|
||||||
@ -1282,7 +1271,6 @@ static NTSTATUS fsp_fuse_intf_GetFileInfo(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_SetBasicInfo(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_SetBasicInfo(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, UINT32 FileAttributes,
|
PVOID FileNode, UINT32 FileAttributes,
|
||||||
UINT64 CreationTime, UINT64 LastAccessTime, UINT64 LastWriteTime,
|
UINT64 CreationTime, UINT64 LastAccessTime, UINT64 LastWriteTime,
|
||||||
FSP_FSCTL_FILE_INFO *FileInfo)
|
FSP_FSCTL_FILE_INFO *FileInfo)
|
||||||
@ -1361,7 +1349,6 @@ static NTSTATUS fsp_fuse_intf_SetBasicInfo(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_SetFileSize(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_SetFileSize(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, UINT64 NewSize, BOOLEAN SetAllocationSize,
|
PVOID FileNode, UINT64 NewSize, BOOLEAN SetAllocationSize,
|
||||||
FSP_FSCTL_FILE_INFO *FileInfo)
|
FSP_FSCTL_FILE_INFO *FileInfo)
|
||||||
{
|
{
|
||||||
@ -1445,7 +1432,6 @@ static int fsp_fuse_intf_CanDeleteAddDirInfoOld(fuse_dirh_t dh, const char *name
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_CanDelete(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_CanDelete(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, PWSTR FileName)
|
PVOID FileNode, PWSTR FileName)
|
||||||
{
|
{
|
||||||
struct fuse *f = FileSystem->UserContext;
|
struct fuse *f = FileSystem->UserContext;
|
||||||
@ -1479,7 +1465,6 @@ static NTSTATUS fsp_fuse_intf_CanDelete(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_Rename(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_Rename(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode,
|
PVOID FileNode,
|
||||||
PWSTR FileName, PWSTR NewFileName, BOOLEAN ReplaceIfExists)
|
PWSTR FileName, PWSTR NewFileName, BOOLEAN ReplaceIfExists)
|
||||||
{
|
{
|
||||||
@ -1513,7 +1498,6 @@ static NTSTATUS fsp_fuse_intf_Rename(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_GetSecurity(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_GetSecurity(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode,
|
PVOID FileNode,
|
||||||
PSECURITY_DESCRIPTOR SecurityDescriptorBuf, SIZE_T *PSecurityDescriptorSize)
|
PSECURITY_DESCRIPTOR SecurityDescriptorBuf, SIZE_T *PSecurityDescriptorSize)
|
||||||
{
|
{
|
||||||
@ -1531,9 +1515,9 @@ static NTSTATUS fsp_fuse_intf_GetSecurity(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_SetSecurity(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_SetSecurity(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode,
|
PVOID FileNode,
|
||||||
SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR Ignored)
|
SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR ModificationDescriptor,
|
||||||
|
HANDLE AccessToken)
|
||||||
{
|
{
|
||||||
struct fuse *f = FileSystem->UserContext;
|
struct fuse *f = FileSystem->UserContext;
|
||||||
struct fsp_fuse_file_desc *filedesc = FileNode;
|
struct fsp_fuse_file_desc *filedesc = FileNode;
|
||||||
@ -1560,7 +1544,11 @@ static NTSTATUS fsp_fuse_intf_SetSecurity(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
Result = FspSetSecurityDescriptor(FileSystem, Request, SecurityDescriptor,
|
Result = FspSetSecurityDescriptor(
|
||||||
|
SecurityDescriptor,
|
||||||
|
SecurityInformation,
|
||||||
|
ModificationDescriptor,
|
||||||
|
AccessToken,
|
||||||
&NewSecurityDescriptor);
|
&NewSecurityDescriptor);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
goto exit;
|
goto exit;
|
||||||
@ -1663,7 +1651,6 @@ int fsp_fuse_intf_AddDirInfoOld(fuse_dirh_t dh, const char *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_ReadDirectory(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_ReadDirectory(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode, PVOID Buffer, UINT64 Offset, ULONG Length,
|
PVOID FileNode, PVOID Buffer, UINT64 Offset, ULONG Length,
|
||||||
PWSTR Pattern,
|
PWSTR Pattern,
|
||||||
PULONG PBytesTransferred)
|
PULONG PBytesTransferred)
|
||||||
@ -1871,7 +1858,6 @@ exit:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_GetReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_GetReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode,
|
PVOID FileNode,
|
||||||
PWSTR FileName, PVOID Buffer, PSIZE_T PSize)
|
PWSTR FileName, PVOID Buffer, PSIZE_T PSize)
|
||||||
{
|
{
|
||||||
@ -1886,7 +1872,6 @@ static NTSTATUS fsp_fuse_intf_GetReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_SetReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_SetReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode,
|
PVOID FileNode,
|
||||||
PWSTR FileName, PVOID Buffer, SIZE_T Size)
|
PWSTR FileName, PVOID Buffer, SIZE_T Size)
|
||||||
{
|
{
|
||||||
@ -1971,6 +1956,8 @@ static NTSTATUS fsp_fuse_intf_SetReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
if (0 == (ReparseData->SymbolicLinkReparseBuffer.Flags & SYMLINK_FLAG_RELATIVE) &&
|
if (0 == (ReparseData->SymbolicLinkReparseBuffer.Flags & SYMLINK_FLAG_RELATIVE) &&
|
||||||
ReparseTargetPathLength >= sizeof(WCHAR) && L'\\' == ReparseTargetPath[0])
|
ReparseTargetPathLength >= sizeof(WCHAR) && L'\\' == ReparseTargetPath[0])
|
||||||
{
|
{
|
||||||
|
FSP_FSCTL_TRANSACT_REQ *Request = FspFileSystemGetOperationContext()->Request;
|
||||||
|
|
||||||
/* we do not support absolute paths that point outside this file system */
|
/* we do not support absolute paths that point outside this file system */
|
||||||
if (0 == Request->Req.FileSystemControl.TargetOnFileSystem)
|
if (0 == Request->Req.FileSystemControl.TargetOnFileSystem)
|
||||||
return STATUS_ACCESS_DENIED;
|
return STATUS_ACCESS_DENIED;
|
||||||
@ -2081,7 +2068,6 @@ exit:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS fsp_fuse_intf_DeleteReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS fsp_fuse_intf_DeleteReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode,
|
PVOID FileNode,
|
||||||
PWSTR FileName, PVOID Buffer, SIZE_T Size)
|
PWSTR FileName, PVOID Buffer, SIZE_T Size)
|
||||||
{
|
{
|
||||||
|
@ -412,16 +412,15 @@ FSP_API NTSTATUS FspCreateSecurityDescriptor(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
FSP_API NTSTATUS FspSetSecurityDescriptor(FSP_FILE_SYSTEM *FileSystem,
|
FSP_API NTSTATUS FspSetSecurityDescriptor(
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PSECURITY_DESCRIPTOR InputDescriptor,
|
PSECURITY_DESCRIPTOR InputDescriptor,
|
||||||
|
SECURITY_INFORMATION SecurityInformation,
|
||||||
|
PSECURITY_DESCRIPTOR ModificationDescriptor,
|
||||||
|
HANDLE AccessToken,
|
||||||
PSECURITY_DESCRIPTOR *PSecurityDescriptor)
|
PSECURITY_DESCRIPTOR *PSecurityDescriptor)
|
||||||
{
|
{
|
||||||
*PSecurityDescriptor = 0;
|
*PSecurityDescriptor = 0;
|
||||||
|
|
||||||
if (FspFsctlTransactSetSecurityKind != Request->Kind)
|
|
||||||
return STATUS_INVALID_PARAMETER;
|
|
||||||
|
|
||||||
if (0 == InputDescriptor)
|
if (0 == InputDescriptor)
|
||||||
return STATUS_NO_SECURITY_ON_OBJECT;
|
return STATUS_NO_SECURITY_ON_OBJECT;
|
||||||
|
|
||||||
@ -455,11 +454,11 @@ FSP_API NTSTATUS FspSetSecurityDescriptor(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
InputDescriptor = CopiedDescriptor;
|
InputDescriptor = CopiedDescriptor;
|
||||||
|
|
||||||
if (!SetPrivateObjectSecurity(
|
if (!SetPrivateObjectSecurity(
|
||||||
Request->Req.SetSecurity.SecurityInformation,
|
SecurityInformation,
|
||||||
(PVOID)Request->Buffer,
|
ModificationDescriptor,
|
||||||
&InputDescriptor,
|
&InputDescriptor,
|
||||||
&FspFileGenericMapping,
|
&FspFileGenericMapping,
|
||||||
(HANDLE)Request->Req.SetSecurity.AccessToken))
|
AccessToken))
|
||||||
{
|
{
|
||||||
HeapFree(ProcessHeap, 0, CopiedDescriptor);
|
HeapFree(ProcessHeap, 0, CopiedDescriptor);
|
||||||
return FspNtStatusFromWin32(GetLastError());
|
return FspNtStatusFromWin32(GetLastError());
|
||||||
|
@ -405,12 +405,10 @@ static NTSTATUS GetReparsePointByName(
|
|||||||
PWSTR FileName, BOOLEAN IsDirectory, PVOID Buffer, PSIZE_T PSize);
|
PWSTR FileName, BOOLEAN IsDirectory, PVOID Buffer, PSIZE_T PSize);
|
||||||
|
|
||||||
static NTSTATUS SetFileSize(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS SetFileSize(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0, UINT64 NewSize, BOOLEAN SetAllocationSize,
|
PVOID FileNode0, UINT64 NewSize, BOOLEAN SetAllocationSize,
|
||||||
FSP_FSCTL_FILE_INFO *FileInfo);
|
FSP_FSCTL_FILE_INFO *FileInfo);
|
||||||
|
|
||||||
static NTSTATUS GetVolumeInfo(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS GetVolumeInfo(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
FSP_FSCTL_VOLUME_INFO *VolumeInfo)
|
FSP_FSCTL_VOLUME_INFO *VolumeInfo)
|
||||||
{
|
{
|
||||||
MEMFS *Memfs = (MEMFS *)FileSystem->UserContext;
|
MEMFS *Memfs = (MEMFS *)FileSystem->UserContext;
|
||||||
@ -425,7 +423,6 @@ static NTSTATUS GetVolumeInfo(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS SetVolumeLabel(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS SetVolumeLabel(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PWSTR VolumeLabel,
|
PWSTR VolumeLabel,
|
||||||
FSP_FSCTL_VOLUME_INFO *VolumeInfo)
|
FSP_FSCTL_VOLUME_INFO *VolumeInfo)
|
||||||
{
|
{
|
||||||
@ -499,8 +496,7 @@ static NTSTATUS GetSecurityByName(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS Create(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS Create(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
PWSTR FileName, UINT32 CreateOptions, UINT32 GrantedAccess,
|
||||||
PWSTR FileName, BOOLEAN CaseSensitive, UINT32 CreateOptions,
|
|
||||||
UINT32 FileAttributes, PSECURITY_DESCRIPTOR SecurityDescriptor, UINT64 AllocationSize,
|
UINT32 FileAttributes, PSECURITY_DESCRIPTOR SecurityDescriptor, UINT64 AllocationSize,
|
||||||
PVOID *PFileNode, FSP_FSCTL_FILE_INFO *FileInfo)
|
PVOID *PFileNode, FSP_FSCTL_FILE_INFO *FileInfo)
|
||||||
{
|
{
|
||||||
@ -617,8 +613,7 @@ static NTSTATUS Create(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS Open(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS Open(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
PWSTR FileName, UINT32 CreateOptions, UINT32 GrantedAccess,
|
||||||
PWSTR FileName, BOOLEAN CaseSensitive, UINT32 CreateOptions,
|
|
||||||
PVOID *PFileNode, FSP_FSCTL_FILE_INFO *FileInfo)
|
PVOID *PFileNode, FSP_FSCTL_FILE_INFO *FileInfo)
|
||||||
{
|
{
|
||||||
MEMFS *Memfs = (MEMFS *)FileSystem->UserContext;
|
MEMFS *Memfs = (MEMFS *)FileSystem->UserContext;
|
||||||
@ -644,7 +639,7 @@ static NTSTATUS Open(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
* TBD.
|
* TBD.
|
||||||
*/
|
*/
|
||||||
if (0 == (FileNode->FileInfo.FileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
|
if (0 == (FileNode->FileInfo.FileAttributes & FILE_ATTRIBUTE_DIRECTORY) &&
|
||||||
Request->Req.Create.DesiredAccess & (FILE_WRITE_DATA | FILE_APPEND_DATA))
|
(GrantedAccess & (FILE_WRITE_DATA | FILE_APPEND_DATA)))
|
||||||
FileNode->FileInfo.FileAttributes |= FILE_ATTRIBUTE_ARCHIVE;
|
FileNode->FileInfo.FileAttributes |= FILE_ATTRIBUTE_ARCHIVE;
|
||||||
|
|
||||||
FileNode->RefCount++;
|
FileNode->RefCount++;
|
||||||
@ -666,7 +661,6 @@ static NTSTATUS Open(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS Overwrite(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS Overwrite(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0, UINT32 FileAttributes, BOOLEAN ReplaceFileAttributes,
|
PVOID FileNode0, UINT32 FileAttributes, BOOLEAN ReplaceFileAttributes,
|
||||||
FSP_FSCTL_FILE_INFO *FileInfo)
|
FSP_FSCTL_FILE_INFO *FileInfo)
|
||||||
{
|
{
|
||||||
@ -705,7 +699,6 @@ static BOOLEAN CleanupEnumFn(MEMFS_FILE_NODE *FileNode, PVOID Context0)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static VOID Cleanup(FSP_FILE_SYSTEM *FileSystem,
|
static VOID Cleanup(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0, PWSTR FileName, BOOLEAN Delete)
|
PVOID FileNode0, PWSTR FileName, BOOLEAN Delete)
|
||||||
{
|
{
|
||||||
MEMFS *Memfs = (MEMFS *)FileSystem->UserContext;
|
MEMFS *Memfs = (MEMFS *)FileSystem->UserContext;
|
||||||
@ -734,7 +727,6 @@ static VOID Cleanup(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static VOID Close(FSP_FILE_SYSTEM *FileSystem,
|
static VOID Close(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0)
|
PVOID FileNode0)
|
||||||
{
|
{
|
||||||
MEMFS *Memfs = (MEMFS *)FileSystem->UserContext;
|
MEMFS *Memfs = (MEMFS *)FileSystem->UserContext;
|
||||||
@ -745,7 +737,6 @@ static VOID Close(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS Read(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS Read(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0, PVOID Buffer, UINT64 Offset, ULONG Length,
|
PVOID FileNode0, PVOID Buffer, UINT64 Offset, ULONG Length,
|
||||||
PULONG PBytesTransferred)
|
PULONG PBytesTransferred)
|
||||||
{
|
{
|
||||||
@ -767,7 +758,6 @@ static NTSTATUS Read(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS Write(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS Write(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0, PVOID Buffer, UINT64 Offset, ULONG Length,
|
PVOID FileNode0, PVOID Buffer, UINT64 Offset, ULONG Length,
|
||||||
BOOLEAN WriteToEndOfFile, BOOLEAN ConstrainedIo,
|
BOOLEAN WriteToEndOfFile, BOOLEAN ConstrainedIo,
|
||||||
PULONG PBytesTransferred, FSP_FSCTL_FILE_INFO *FileInfo)
|
PULONG PBytesTransferred, FSP_FSCTL_FILE_INFO *FileInfo)
|
||||||
@ -805,7 +795,7 @@ static NTSTATUS Write(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
Offset = FileNode->FileInfo.FileSize;
|
Offset = FileNode->FileInfo.FileSize;
|
||||||
EndOffset = Offset + Length;
|
EndOffset = Offset + Length;
|
||||||
if (EndOffset > FileNode->FileInfo.FileSize)
|
if (EndOffset > FileNode->FileInfo.FileSize)
|
||||||
SetFileSize(FileSystem, Request, FileNode, EndOffset, FALSE, FileInfo);
|
SetFileSize(FileSystem, FileNode, EndOffset, FALSE, FileInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy((PUINT8)FileNode->FileData + Offset, Buffer, (size_t)(EndOffset - Offset));
|
memcpy((PUINT8)FileNode->FileData + Offset, Buffer, (size_t)(EndOffset - Offset));
|
||||||
@ -817,7 +807,6 @@ static NTSTATUS Write(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS Flush(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS Flush(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode)
|
PVOID FileNode)
|
||||||
{
|
{
|
||||||
/* nothing to do, since we do not cache anything */
|
/* nothing to do, since we do not cache anything */
|
||||||
@ -825,7 +814,6 @@ NTSTATUS Flush(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS GetFileInfo(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS GetFileInfo(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0,
|
PVOID FileNode0,
|
||||||
FSP_FSCTL_FILE_INFO *FileInfo)
|
FSP_FSCTL_FILE_INFO *FileInfo)
|
||||||
{
|
{
|
||||||
@ -837,7 +825,6 @@ static NTSTATUS GetFileInfo(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS SetBasicInfo(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS SetBasicInfo(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0, UINT32 FileAttributes,
|
PVOID FileNode0, UINT32 FileAttributes,
|
||||||
UINT64 CreationTime, UINT64 LastAccessTime, UINT64 LastWriteTime,
|
UINT64 CreationTime, UINT64 LastAccessTime, UINT64 LastWriteTime,
|
||||||
FSP_FSCTL_FILE_INFO *FileInfo)
|
FSP_FSCTL_FILE_INFO *FileInfo)
|
||||||
@ -864,7 +851,6 @@ static NTSTATUS SetBasicInfo(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS SetFileSize(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS SetFileSize(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0, UINT64 NewSize, BOOLEAN SetAllocationSize,
|
PVOID FileNode0, UINT64 NewSize, BOOLEAN SetAllocationSize,
|
||||||
FSP_FSCTL_FILE_INFO *FileInfo)
|
FSP_FSCTL_FILE_INFO *FileInfo)
|
||||||
{
|
{
|
||||||
@ -898,7 +884,7 @@ static NTSTATUS SetFileSize(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
UINT64 AllocationUnit = MEMFS_SECTOR_SIZE * MEMFS_SECTORS_PER_ALLOCATION_UNIT;
|
UINT64 AllocationUnit = MEMFS_SECTOR_SIZE * MEMFS_SECTORS_PER_ALLOCATION_UNIT;
|
||||||
UINT64 AllocationSize = (NewSize + AllocationUnit - 1) / AllocationUnit * AllocationUnit;
|
UINT64 AllocationSize = (NewSize + AllocationUnit - 1) / AllocationUnit * AllocationUnit;
|
||||||
|
|
||||||
NTSTATUS Result = SetFileSize(FileSystem, Request, FileNode, AllocationSize, TRUE,
|
NTSTATUS Result = SetFileSize(FileSystem, FileNode, AllocationSize, TRUE,
|
||||||
FileInfo);
|
FileInfo);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
return Result;
|
return Result;
|
||||||
@ -917,7 +903,6 @@ static NTSTATUS SetFileSize(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS CanDelete(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS CanDelete(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0, PWSTR FileName)
|
PVOID FileNode0, PWSTR FileName)
|
||||||
{
|
{
|
||||||
MEMFS *Memfs = (MEMFS *)FileSystem->UserContext;
|
MEMFS *Memfs = (MEMFS *)FileSystem->UserContext;
|
||||||
@ -946,7 +931,6 @@ static BOOLEAN RenameEnumFn(MEMFS_FILE_NODE *FileNode, PVOID Context0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS Rename(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS Rename(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0,
|
PVOID FileNode0,
|
||||||
PWSTR FileName, PWSTR NewFileName, BOOLEAN ReplaceIfExists)
|
PWSTR FileName, PWSTR NewFileName, BOOLEAN ReplaceIfExists)
|
||||||
{
|
{
|
||||||
@ -1034,7 +1018,6 @@ exit:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS GetSecurity(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS GetSecurity(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0,
|
PVOID FileNode0,
|
||||||
PSECURITY_DESCRIPTOR SecurityDescriptor, SIZE_T *PSecurityDescriptorSize)
|
PSECURITY_DESCRIPTOR SecurityDescriptor, SIZE_T *PSecurityDescriptorSize)
|
||||||
{
|
{
|
||||||
@ -1059,9 +1042,9 @@ static NTSTATUS GetSecurity(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS SetSecurity(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS SetSecurity(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0,
|
PVOID FileNode0,
|
||||||
SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor)
|
SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR ModificationDescriptor,
|
||||||
|
HANDLE AccessToken)
|
||||||
{
|
{
|
||||||
MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0;
|
MEMFS_FILE_NODE *FileNode = (MEMFS_FILE_NODE *)FileNode0;
|
||||||
PSECURITY_DESCRIPTOR NewSecurityDescriptor, FileSecurity;
|
PSECURITY_DESCRIPTOR NewSecurityDescriptor, FileSecurity;
|
||||||
@ -1073,7 +1056,11 @@ static NTSTATUS SetSecurity(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
FileNode = FileNode->MainFileNode;
|
FileNode = FileNode->MainFileNode;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Result = FspSetSecurityDescriptor(FileSystem, Request, FileNode->FileSecurity,
|
Result = FspSetSecurityDescriptor(
|
||||||
|
FileNode->FileSecurity,
|
||||||
|
SecurityInformation,
|
||||||
|
ModificationDescriptor,
|
||||||
|
AccessToken,
|
||||||
&NewSecurityDescriptor);
|
&NewSecurityDescriptor);
|
||||||
if (!NT_SUCCESS(Result))
|
if (!NT_SUCCESS(Result))
|
||||||
return Result;
|
return Result;
|
||||||
@ -1143,7 +1130,6 @@ static BOOLEAN ReadDirectoryEnumFn(MEMFS_FILE_NODE *FileNode, PVOID Context0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS ReadDirectory(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS ReadDirectory(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0, PVOID Buffer, UINT64 Offset, ULONG Length,
|
PVOID FileNode0, PVOID Buffer, UINT64 Offset, ULONG Length,
|
||||||
PWSTR Pattern,
|
PWSTR Pattern,
|
||||||
PULONG PBytesTransferred)
|
PULONG PBytesTransferred)
|
||||||
@ -1222,7 +1208,6 @@ static NTSTATUS GetReparsePointByName(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS GetReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS GetReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0,
|
PVOID FileNode0,
|
||||||
PWSTR FileName, PVOID Buffer, PSIZE_T PSize)
|
PWSTR FileName, PVOID Buffer, PSIZE_T PSize)
|
||||||
{
|
{
|
||||||
@ -1246,7 +1231,6 @@ static NTSTATUS GetReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS SetReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS SetReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0,
|
PVOID FileNode0,
|
||||||
PWSTR FileName, PVOID Buffer, SIZE_T Size)
|
PWSTR FileName, PVOID Buffer, SIZE_T Size)
|
||||||
{
|
{
|
||||||
@ -1287,7 +1271,6 @@ static NTSTATUS SetReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS DeleteReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS DeleteReparsePoint(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0,
|
PVOID FileNode0,
|
||||||
PWSTR FileName, PVOID Buffer, SIZE_T Size)
|
PWSTR FileName, PVOID Buffer, SIZE_T Size)
|
||||||
{
|
{
|
||||||
@ -1358,7 +1341,6 @@ static BOOLEAN GetStreamInfoEnumFn(MEMFS_FILE_NODE *FileNode, PVOID Context0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS GetStreamInfo(FSP_FILE_SYSTEM *FileSystem,
|
static NTSTATUS GetStreamInfo(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
|
||||||
PVOID FileNode0, PVOID Buffer, ULONG Length,
|
PVOID FileNode0, PVOID Buffer, ULONG Length,
|
||||||
PULONG PBytesTransferred)
|
PULONG PBytesTransferred)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user