62 lines
2.8 KiB
C++
62 lines
2.8 KiB
C++
//
|
|
// Created by Shell on 2026/6/20.
|
|
//
|
|
|
|
#ifndef SEADISK_WINFSP_ADAPTER_HPP
|
|
#define SEADISK_WINFSP_ADAPTER_HPP
|
|
#include "seafile_file_system.hpp"
|
|
|
|
namespace seafile::fs {
|
|
class WinFSPAdapter {
|
|
public:
|
|
static NTSTATUS GetVolumeInfo(FSP_FILE_SYSTEM *FileSystem, FSP_FSCTL_VOLUME_INFO *VolumeInfo);
|
|
|
|
static NTSTATUS SvcStart(FSP_SERVICE *Service, ULONG argc, PWSTR *argv);
|
|
|
|
static NTSTATUS SvcStop(FSP_SERVICE *Service);
|
|
|
|
|
|
static NTSTATUS SetVolumeLabel_(FSP_FILE_SYSTEM *FileSystem, PWSTR VolumeLabel,
|
|
FSP_FSCTL_VOLUME_INFO *VolumeInfo);
|
|
|
|
static NTSTATUS GetSecurityByName(FSP_FILE_SYSTEM *FileSystem, PWSTR FileName, PUINT32 PFileAttributes,
|
|
PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
SIZE_T *PSecurityDescriptorSize);
|
|
|
|
static NTSTATUS Open(FSP_FILE_SYSTEM *FileSystem, PWSTR FileName, UINT32 CreateOptions, UINT32 GrantedAccess,
|
|
PVOID *PFileContext,
|
|
FSP_FSCTL_FILE_INFO *FileInfo);
|
|
|
|
static NTSTATUS Create(FSP_FILE_SYSTEM *FileSystem,
|
|
PWSTR FileName, UINT32 CreateOptions, UINT32 GrantedAccess,
|
|
UINT32 FileAttributes, PSECURITY_DESCRIPTOR SecurityDescriptor, UINT64 AllocationSize,
|
|
PVOID *PFileContext, FSP_FSCTL_FILE_INFO *FileInfo);
|
|
|
|
static NTSTATUS Read(FSP_FILE_SYSTEM *FileSystem,
|
|
PVOID FileContext, PVOID Buffer, UINT64 Offset, ULONG Length,
|
|
PULONG PBytesTransferred);
|
|
|
|
static NTSTATUS GetFileInfo(FSP_FILE_SYSTEM *FileSystem, HANDLE Handle, FSP_FSCTL_FILE_INFO *FileInfo);
|
|
|
|
|
|
static VOID Close(FSP_FILE_SYSTEM *FileSystem, PVOID FileContext0);
|
|
|
|
static NTSTATUS ReadDirectory(FSP_FILE_SYSTEM *FileSystem, PVOID FileContext0, PWSTR Pattern, PWSTR Marker,
|
|
PVOID Buffer, ULONG BufferLength, PULONG PBytesTransferred);
|
|
|
|
static NTSTATUS GetDirInfoByName(FSP_FILE_SYSTEM *FileSystem,
|
|
PVOID FileContext, PWSTR FileName,
|
|
FSP_FSCTL_DIR_INFO *DirInfo);
|
|
|
|
static NTSTATUS SetSecurity(FSP_FILE_SYSTEM *FileSystem,
|
|
PVOID FileContext,
|
|
SECURITY_INFORMATION SecurityInformation,
|
|
PSECURITY_DESCRIPTOR ModificationDescriptor);
|
|
|
|
static NTSTATUS GetSecurity(FSP_FILE_SYSTEM *FileSystem,
|
|
PVOID FileContext,
|
|
PSECURITY_DESCRIPTOR SecurityDescriptor, SIZE_T *PSecurityDescriptorSize);
|
|
};
|
|
}
|
|
#endif //SEADISK_WINFSP_ADAPTER_HPP
|