mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
src: dll,dotnet: add out-of-line API's
This commit is contained in:
parent
f938bf5e3f
commit
f9b8bfc020
@ -961,11 +961,14 @@ FSP_API VOID FspFileSystemSendResponse(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
* The current operation context.
|
* The current operation context.
|
||||||
*/
|
*/
|
||||||
FSP_API FSP_FILE_SYSTEM_OPERATION_CONTEXT *FspFileSystemGetOperationContext(VOID);
|
FSP_API FSP_FILE_SYSTEM_OPERATION_CONTEXT *FspFileSystemGetOperationContext(VOID);
|
||||||
|
FSP_API PWSTR FspFileSystemMountPointF(FSP_FILE_SYSTEM *FileSystem);
|
||||||
static inline
|
static inline
|
||||||
PWSTR FspFileSystemMountPoint(FSP_FILE_SYSTEM *FileSystem)
|
PWSTR FspFileSystemMountPoint(FSP_FILE_SYSTEM *FileSystem)
|
||||||
{
|
{
|
||||||
return FileSystem->MountPoint;
|
return FileSystem->MountPoint;
|
||||||
}
|
}
|
||||||
|
FSP_API NTSTATUS FspFileSystemEnterOperationF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
FSP_FSCTL_TRANSACT_REQ *Request, FSP_FSCTL_TRANSACT_RSP *Response);
|
||||||
static inline
|
static inline
|
||||||
NTSTATUS FspFileSystemEnterOperation(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS FspFileSystemEnterOperation(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request, FSP_FSCTL_TRANSACT_RSP *Response)
|
FSP_FSCTL_TRANSACT_REQ *Request, FSP_FSCTL_TRANSACT_RSP *Response)
|
||||||
@ -975,6 +978,8 @@ NTSTATUS FspFileSystemEnterOperation(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
|
|
||||||
return FileSystem->EnterOperation(FileSystem, Request, Response);
|
return FileSystem->EnterOperation(FileSystem, Request, Response);
|
||||||
}
|
}
|
||||||
|
FSP_API NTSTATUS FspFileSystemLeaveOperationF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
FSP_FSCTL_TRANSACT_REQ *Request, FSP_FSCTL_TRANSACT_RSP *Response);
|
||||||
static inline
|
static inline
|
||||||
NTSTATUS FspFileSystemLeaveOperation(FSP_FILE_SYSTEM *FileSystem,
|
NTSTATUS FspFileSystemLeaveOperation(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FSCTL_TRANSACT_REQ *Request, FSP_FSCTL_TRANSACT_RSP *Response)
|
FSP_FSCTL_TRANSACT_REQ *Request, FSP_FSCTL_TRANSACT_RSP *Response)
|
||||||
@ -984,6 +989,9 @@ NTSTATUS FspFileSystemLeaveOperation(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
|
|
||||||
return FileSystem->LeaveOperation(FileSystem, Request, Response);
|
return FileSystem->LeaveOperation(FileSystem, Request, Response);
|
||||||
}
|
}
|
||||||
|
FSP_API VOID FspFileSystemSetOperationGuardF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
FSP_FILE_SYSTEM_OPERATION_GUARD *EnterOperation,
|
||||||
|
FSP_FILE_SYSTEM_OPERATION_GUARD *LeaveOperation);
|
||||||
static inline
|
static inline
|
||||||
VOID FspFileSystemSetOperationGuard(FSP_FILE_SYSTEM *FileSystem,
|
VOID FspFileSystemSetOperationGuard(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FILE_SYSTEM_OPERATION_GUARD *EnterOperation,
|
FSP_FILE_SYSTEM_OPERATION_GUARD *EnterOperation,
|
||||||
@ -1002,12 +1010,17 @@ VOID FspFileSystemSetOperationGuard(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
* @see
|
* @see
|
||||||
* FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY
|
* FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY
|
||||||
*/
|
*/
|
||||||
|
FSP_API VOID FspFileSystemSetOperationGuardStrategyF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY GuardStrategy);
|
||||||
static inline
|
static inline
|
||||||
VOID FspFileSystemSetOperationGuardStrategy(FSP_FILE_SYSTEM *FileSystem,
|
VOID FspFileSystemSetOperationGuardStrategy(FSP_FILE_SYSTEM *FileSystem,
|
||||||
FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY GuardStrategy)
|
FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY GuardStrategy)
|
||||||
{
|
{
|
||||||
FileSystem->OpGuardStrategy = GuardStrategy;
|
FileSystem->OpGuardStrategy = GuardStrategy;
|
||||||
}
|
}
|
||||||
|
FSP_API VOID FspFileSystemSetOperationF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
ULONG Index,
|
||||||
|
FSP_FILE_SYSTEM_OPERATION *Operation);
|
||||||
static inline
|
static inline
|
||||||
VOID FspFileSystemSetOperation(FSP_FILE_SYSTEM *FileSystem,
|
VOID FspFileSystemSetOperation(FSP_FILE_SYSTEM *FileSystem,
|
||||||
ULONG Index,
|
ULONG Index,
|
||||||
@ -1015,6 +1028,8 @@ VOID FspFileSystemSetOperation(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
{
|
{
|
||||||
FileSystem->Operations[Index] = Operation;
|
FileSystem->Operations[Index] = Operation;
|
||||||
}
|
}
|
||||||
|
FSP_API VOID FspFileSystemGetDispatcherResultF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
NTSTATUS *PDispatcherResult);
|
||||||
static inline
|
static inline
|
||||||
VOID FspFileSystemGetDispatcherResult(FSP_FILE_SYSTEM *FileSystem,
|
VOID FspFileSystemGetDispatcherResult(FSP_FILE_SYSTEM *FileSystem,
|
||||||
NTSTATUS *PDispatcherResult)
|
NTSTATUS *PDispatcherResult)
|
||||||
@ -1023,6 +1038,8 @@ VOID FspFileSystemGetDispatcherResult(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
*PDispatcherResult = FileSystem->DispatcherResult;
|
*PDispatcherResult = FileSystem->DispatcherResult;
|
||||||
MemoryBarrier();
|
MemoryBarrier();
|
||||||
}
|
}
|
||||||
|
FSP_API VOID FspFileSystemSetDispatcherResultF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
NTSTATUS DispatcherResult);
|
||||||
static inline
|
static inline
|
||||||
VOID FspFileSystemSetDispatcherResult(FSP_FILE_SYSTEM *FileSystem,
|
VOID FspFileSystemSetDispatcherResult(FSP_FILE_SYSTEM *FileSystem,
|
||||||
NTSTATUS DispatcherResult)
|
NTSTATUS DispatcherResult)
|
||||||
@ -1031,12 +1048,15 @@ VOID FspFileSystemSetDispatcherResult(FSP_FILE_SYSTEM *FileSystem,
|
|||||||
return;
|
return;
|
||||||
InterlockedCompareExchange(&FileSystem->DispatcherResult, DispatcherResult, 0);
|
InterlockedCompareExchange(&FileSystem->DispatcherResult, DispatcherResult, 0);
|
||||||
}
|
}
|
||||||
|
FSP_API VOID FspFileSystemSetDebugLogF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
UINT32 DebugLog);
|
||||||
static inline
|
static inline
|
||||||
VOID FspFileSystemSetDebugLog(FSP_FILE_SYSTEM *FileSystem,
|
VOID FspFileSystemSetDebugLog(FSP_FILE_SYSTEM *FileSystem,
|
||||||
UINT32 DebugLog)
|
UINT32 DebugLog)
|
||||||
{
|
{
|
||||||
FileSystem->DebugLog = DebugLog;
|
FileSystem->DebugLog = DebugLog;
|
||||||
}
|
}
|
||||||
|
FSP_API BOOLEAN FspFileSystemIsOperationCaseSensitiveF(VOID);
|
||||||
static inline
|
static inline
|
||||||
BOOLEAN FspFileSystemIsOperationCaseSensitive(VOID)
|
BOOLEAN FspFileSystemIsOperationCaseSensitive(VOID)
|
||||||
{
|
{
|
||||||
|
64
src/dll/fs.c
64
src/dll/fs.c
@ -619,3 +619,67 @@ FSP_API FSP_FILE_SYSTEM_OPERATION_CONTEXT *FspFileSystemGetOperationContext(VOID
|
|||||||
{
|
{
|
||||||
return (FSP_FILE_SYSTEM_OPERATION_CONTEXT *)TlsGetValue(FspFileSystemTlsKey);
|
return (FSP_FILE_SYSTEM_OPERATION_CONTEXT *)TlsGetValue(FspFileSystemTlsKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Out-of-Line
|
||||||
|
*/
|
||||||
|
|
||||||
|
FSP_API PWSTR FspFileSystemMountPointF(FSP_FILE_SYSTEM *FileSystem)
|
||||||
|
{
|
||||||
|
return FspFileSystemMountPoint(FileSystem);
|
||||||
|
}
|
||||||
|
|
||||||
|
FSP_API NTSTATUS FspFileSystemEnterOperationF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
FSP_FSCTL_TRANSACT_REQ *Request, FSP_FSCTL_TRANSACT_RSP *Response)
|
||||||
|
{
|
||||||
|
return FspFileSystemEnterOperation(FileSystem, Request, Response);
|
||||||
|
}
|
||||||
|
|
||||||
|
FSP_API NTSTATUS FspFileSystemLeaveOperationF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
FSP_FSCTL_TRANSACT_REQ *Request, FSP_FSCTL_TRANSACT_RSP *Response)
|
||||||
|
{
|
||||||
|
return FspFileSystemLeaveOperation(FileSystem, Request, Response);
|
||||||
|
}
|
||||||
|
|
||||||
|
FSP_API VOID FspFileSystemSetOperationGuardF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
FSP_FILE_SYSTEM_OPERATION_GUARD *EnterOperation,
|
||||||
|
FSP_FILE_SYSTEM_OPERATION_GUARD *LeaveOperation)
|
||||||
|
{
|
||||||
|
FspFileSystemSetOperationGuard(FileSystem, EnterOperation, LeaveOperation);
|
||||||
|
}
|
||||||
|
|
||||||
|
FSP_API VOID FspFileSystemSetOperationGuardStrategyF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY GuardStrategy)
|
||||||
|
{
|
||||||
|
FspFileSystemSetOperationGuardStrategy(FileSystem, GuardStrategy);
|
||||||
|
}
|
||||||
|
|
||||||
|
FSP_API VOID FspFileSystemSetOperationF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
ULONG Index,
|
||||||
|
FSP_FILE_SYSTEM_OPERATION *Operation)
|
||||||
|
{
|
||||||
|
FspFileSystemSetOperation(FileSystem, Index, Operation);
|
||||||
|
}
|
||||||
|
|
||||||
|
FSP_API VOID FspFileSystemGetDispatcherResultF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
NTSTATUS *PDispatcherResult)
|
||||||
|
{
|
||||||
|
FspFileSystemGetDispatcherResult(FileSystem, PDispatcherResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
FSP_API VOID FspFileSystemSetDispatcherResultF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
NTSTATUS DispatcherResult)
|
||||||
|
{
|
||||||
|
FspFileSystemSetDispatcherResult(FileSystem, DispatcherResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
FSP_API VOID FspFileSystemSetDebugLogF(FSP_FILE_SYSTEM *FileSystem,
|
||||||
|
UINT32 DebugLog)
|
||||||
|
{
|
||||||
|
FspFileSystemSetDebugLog(FileSystem, DebugLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
FSP_API BOOLEAN FspFileSystemIsOperationCaseSensitiveF(VOID)
|
||||||
|
{
|
||||||
|
return FspFileSystemIsOperationCaseSensitive();
|
||||||
|
}
|
||||||
|
@ -162,12 +162,10 @@ namespace Fsp
|
|||||||
if (0 <= Result)
|
if (0 <= Result)
|
||||||
{
|
{
|
||||||
Api.SetUserContext(_FileSystem, this);
|
Api.SetUserContext(_FileSystem, this);
|
||||||
#if false
|
Api.FspFileSystemSetOperationGuardStrategy(_FileSystem, Synchronized ?
|
||||||
FspFileSystemSetOperationGuardStrategy(_FileSystem, Synchronized ?
|
1/*FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY_COARSE*/ :
|
||||||
FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY_COARSE :
|
0/*FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY_FINE*/);
|
||||||
FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY_FINE);
|
Api.FspFileSystemSetDebugLog(_FileSystem, DebugLog);
|
||||||
FspFileSystemSetDebugLog(_FileSystem, DebugLog);
|
|
||||||
#endif
|
|
||||||
Result = Api.FspFileSystemSetMountPointEx(_FileSystem, MountPoint,
|
Result = Api.FspFileSystemSetMountPointEx(_FileSystem, MountPoint,
|
||||||
SecurityDescriptor);
|
SecurityDescriptor);
|
||||||
if (0 <= Result)
|
if (0 <= Result)
|
||||||
@ -187,10 +185,7 @@ namespace Fsp
|
|||||||
}
|
}
|
||||||
public String MountPoint()
|
public String MountPoint()
|
||||||
{
|
{
|
||||||
return "UNKNOWN";
|
return IntPtr.Zero != _FileSystem ? Api.FspFileSystemMountPoint(_FileSystem) : null;
|
||||||
#if false
|
|
||||||
return 0 != _FileSystem ? FspFileSystemMountPoint(_FileSystem) : 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
public IntPtr FileSystemHandle()
|
public IntPtr FileSystemHandle()
|
||||||
{
|
{
|
||||||
|
@ -440,6 +440,18 @@ namespace Fsp.Interop
|
|||||||
internal delegate Int32 FspFileSystemStopDispatcher(
|
internal delegate Int32 FspFileSystemStopDispatcher(
|
||||||
IntPtr FileSystem);
|
IntPtr FileSystem);
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
|
[return: MarshalAs(UnmanagedType.LPWStr)]
|
||||||
|
internal delegate String FspFileSystemMountPointF(
|
||||||
|
IntPtr FileSystem);
|
||||||
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
|
internal delegate void FspFileSystemSetOperationGuardStrategyF(
|
||||||
|
IntPtr FileSystem,
|
||||||
|
Int32 GuardStrategy);
|
||||||
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
|
internal delegate void FspFileSystemSetDebugLogF(
|
||||||
|
IntPtr FileSystem,
|
||||||
|
UInt32 DebugLog);
|
||||||
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
internal delegate Boolean FspFileSystemAddDirInfo(
|
internal delegate Boolean FspFileSystemAddDirInfo(
|
||||||
IntPtr DirInfo,
|
IntPtr DirInfo,
|
||||||
IntPtr Buffer,
|
IntPtr Buffer,
|
||||||
@ -585,6 +597,9 @@ namespace Fsp.Interop
|
|||||||
internal static Proto.FspFileSystemRemoveMountPoint FspFileSystemRemoveMountPoint;
|
internal static Proto.FspFileSystemRemoveMountPoint FspFileSystemRemoveMountPoint;
|
||||||
internal static Proto.FspFileSystemStartDispatcher FspFileSystemStartDispatcher;
|
internal static Proto.FspFileSystemStartDispatcher FspFileSystemStartDispatcher;
|
||||||
internal static Proto.FspFileSystemStopDispatcher FspFileSystemStopDispatcher;
|
internal static Proto.FspFileSystemStopDispatcher FspFileSystemStopDispatcher;
|
||||||
|
internal static Proto.FspFileSystemMountPointF FspFileSystemMountPoint;
|
||||||
|
internal static Proto.FspFileSystemSetOperationGuardStrategyF FspFileSystemSetOperationGuardStrategy;
|
||||||
|
internal static Proto.FspFileSystemSetDebugLogF FspFileSystemSetDebugLog;
|
||||||
internal static Proto.FspFileSystemAddDirInfo _FspFileSystemAddDirInfo;
|
internal static Proto.FspFileSystemAddDirInfo _FspFileSystemAddDirInfo;
|
||||||
internal static Proto.FspFileSystemFindReparsePoint FspFileSystemFindReparsePoint;
|
internal static Proto.FspFileSystemFindReparsePoint FspFileSystemFindReparsePoint;
|
||||||
internal static Proto.FspFileSystemResolveReparsePoints FspFileSystemResolveReparsePoints;
|
internal static Proto.FspFileSystemResolveReparsePoints FspFileSystemResolveReparsePoints;
|
||||||
@ -803,6 +818,9 @@ namespace Fsp.Interop
|
|||||||
FspFileSystemRemoveMountPoint = GetEntryPoint<Proto.FspFileSystemRemoveMountPoint>(Module);
|
FspFileSystemRemoveMountPoint = GetEntryPoint<Proto.FspFileSystemRemoveMountPoint>(Module);
|
||||||
FspFileSystemStartDispatcher = GetEntryPoint<Proto.FspFileSystemStartDispatcher>(Module);
|
FspFileSystemStartDispatcher = GetEntryPoint<Proto.FspFileSystemStartDispatcher>(Module);
|
||||||
FspFileSystemStopDispatcher = GetEntryPoint<Proto.FspFileSystemStopDispatcher>(Module);
|
FspFileSystemStopDispatcher = GetEntryPoint<Proto.FspFileSystemStopDispatcher>(Module);
|
||||||
|
FspFileSystemMountPoint = GetEntryPoint<Proto.FspFileSystemMountPointF>(Module);
|
||||||
|
FspFileSystemSetOperationGuardStrategy = GetEntryPoint<Proto.FspFileSystemSetOperationGuardStrategyF>(Module);
|
||||||
|
FspFileSystemSetDebugLog = GetEntryPoint<Proto.FspFileSystemSetDebugLogF>(Module);
|
||||||
_FspFileSystemAddDirInfo = GetEntryPoint<Proto.FspFileSystemAddDirInfo>(Module);
|
_FspFileSystemAddDirInfo = GetEntryPoint<Proto.FspFileSystemAddDirInfo>(Module);
|
||||||
FspFileSystemFindReparsePoint = GetEntryPoint<Proto.FspFileSystemFindReparsePoint>(Module);
|
FspFileSystemFindReparsePoint = GetEntryPoint<Proto.FspFileSystemFindReparsePoint>(Module);
|
||||||
FspFileSystemResolveReparsePoints = GetEntryPoint<Proto.FspFileSystemResolveReparsePoints>(Module);
|
FspFileSystemResolveReparsePoints = GetEntryPoint<Proto.FspFileSystemResolveReparsePoints>(Module);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user