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.
|
||||
*/
|
||||
FSP_API FSP_FILE_SYSTEM_OPERATION_CONTEXT *FspFileSystemGetOperationContext(VOID);
|
||||
FSP_API PWSTR FspFileSystemMountPointF(FSP_FILE_SYSTEM *FileSystem);
|
||||
static inline
|
||||
PWSTR FspFileSystemMountPoint(FSP_FILE_SYSTEM *FileSystem)
|
||||
{
|
||||
return FileSystem->MountPoint;
|
||||
}
|
||||
FSP_API NTSTATUS FspFileSystemEnterOperationF(FSP_FILE_SYSTEM *FileSystem,
|
||||
FSP_FSCTL_TRANSACT_REQ *Request, FSP_FSCTL_TRANSACT_RSP *Response);
|
||||
static inline
|
||||
NTSTATUS FspFileSystemEnterOperation(FSP_FILE_SYSTEM *FileSystem,
|
||||
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);
|
||||
}
|
||||
FSP_API NTSTATUS FspFileSystemLeaveOperationF(FSP_FILE_SYSTEM *FileSystem,
|
||||
FSP_FSCTL_TRANSACT_REQ *Request, FSP_FSCTL_TRANSACT_RSP *Response);
|
||||
static inline
|
||||
NTSTATUS FspFileSystemLeaveOperation(FSP_FILE_SYSTEM *FileSystem,
|
||||
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);
|
||||
}
|
||||
FSP_API VOID FspFileSystemSetOperationGuardF(FSP_FILE_SYSTEM *FileSystem,
|
||||
FSP_FILE_SYSTEM_OPERATION_GUARD *EnterOperation,
|
||||
FSP_FILE_SYSTEM_OPERATION_GUARD *LeaveOperation);
|
||||
static inline
|
||||
VOID FspFileSystemSetOperationGuard(FSP_FILE_SYSTEM *FileSystem,
|
||||
FSP_FILE_SYSTEM_OPERATION_GUARD *EnterOperation,
|
||||
@ -1002,12 +1010,17 @@ VOID FspFileSystemSetOperationGuard(FSP_FILE_SYSTEM *FileSystem,
|
||||
* @see
|
||||
* FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY
|
||||
*/
|
||||
FSP_API VOID FspFileSystemSetOperationGuardStrategyF(FSP_FILE_SYSTEM *FileSystem,
|
||||
FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY GuardStrategy);
|
||||
static inline
|
||||
VOID FspFileSystemSetOperationGuardStrategy(FSP_FILE_SYSTEM *FileSystem,
|
||||
FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY GuardStrategy)
|
||||
{
|
||||
FileSystem->OpGuardStrategy = GuardStrategy;
|
||||
}
|
||||
FSP_API VOID FspFileSystemSetOperationF(FSP_FILE_SYSTEM *FileSystem,
|
||||
ULONG Index,
|
||||
FSP_FILE_SYSTEM_OPERATION *Operation);
|
||||
static inline
|
||||
VOID FspFileSystemSetOperation(FSP_FILE_SYSTEM *FileSystem,
|
||||
ULONG Index,
|
||||
@ -1015,6 +1028,8 @@ VOID FspFileSystemSetOperation(FSP_FILE_SYSTEM *FileSystem,
|
||||
{
|
||||
FileSystem->Operations[Index] = Operation;
|
||||
}
|
||||
FSP_API VOID FspFileSystemGetDispatcherResultF(FSP_FILE_SYSTEM *FileSystem,
|
||||
NTSTATUS *PDispatcherResult);
|
||||
static inline
|
||||
VOID FspFileSystemGetDispatcherResult(FSP_FILE_SYSTEM *FileSystem,
|
||||
NTSTATUS *PDispatcherResult)
|
||||
@ -1023,6 +1038,8 @@ VOID FspFileSystemGetDispatcherResult(FSP_FILE_SYSTEM *FileSystem,
|
||||
*PDispatcherResult = FileSystem->DispatcherResult;
|
||||
MemoryBarrier();
|
||||
}
|
||||
FSP_API VOID FspFileSystemSetDispatcherResultF(FSP_FILE_SYSTEM *FileSystem,
|
||||
NTSTATUS DispatcherResult);
|
||||
static inline
|
||||
VOID FspFileSystemSetDispatcherResult(FSP_FILE_SYSTEM *FileSystem,
|
||||
NTSTATUS DispatcherResult)
|
||||
@ -1031,12 +1048,15 @@ VOID FspFileSystemSetDispatcherResult(FSP_FILE_SYSTEM *FileSystem,
|
||||
return;
|
||||
InterlockedCompareExchange(&FileSystem->DispatcherResult, DispatcherResult, 0);
|
||||
}
|
||||
FSP_API VOID FspFileSystemSetDebugLogF(FSP_FILE_SYSTEM *FileSystem,
|
||||
UINT32 DebugLog);
|
||||
static inline
|
||||
VOID FspFileSystemSetDebugLog(FSP_FILE_SYSTEM *FileSystem,
|
||||
UINT32 DebugLog)
|
||||
{
|
||||
FileSystem->DebugLog = DebugLog;
|
||||
}
|
||||
FSP_API BOOLEAN FspFileSystemIsOperationCaseSensitiveF(VOID);
|
||||
static inline
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
Api.SetUserContext(_FileSystem, this);
|
||||
#if false
|
||||
FspFileSystemSetOperationGuardStrategy(_FileSystem, Synchronized ?
|
||||
FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY_COARSE :
|
||||
FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY_FINE);
|
||||
FspFileSystemSetDebugLog(_FileSystem, DebugLog);
|
||||
#endif
|
||||
Api.FspFileSystemSetOperationGuardStrategy(_FileSystem, Synchronized ?
|
||||
1/*FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY_COARSE*/ :
|
||||
0/*FSP_FILE_SYSTEM_OPERATION_GUARD_STRATEGY_FINE*/);
|
||||
Api.FspFileSystemSetDebugLog(_FileSystem, DebugLog);
|
||||
Result = Api.FspFileSystemSetMountPointEx(_FileSystem, MountPoint,
|
||||
SecurityDescriptor);
|
||||
if (0 <= Result)
|
||||
@ -187,10 +185,7 @@ namespace Fsp
|
||||
}
|
||||
public String MountPoint()
|
||||
{
|
||||
return "UNKNOWN";
|
||||
#if false
|
||||
return 0 != _FileSystem ? FspFileSystemMountPoint(_FileSystem) : 0;
|
||||
#endif
|
||||
return IntPtr.Zero != _FileSystem ? Api.FspFileSystemMountPoint(_FileSystem) : null;
|
||||
}
|
||||
public IntPtr FileSystemHandle()
|
||||
{
|
||||
|
@ -440,6 +440,18 @@ namespace Fsp.Interop
|
||||
internal delegate Int32 FspFileSystemStopDispatcher(
|
||||
IntPtr FileSystem);
|
||||
[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(
|
||||
IntPtr DirInfo,
|
||||
IntPtr Buffer,
|
||||
@ -585,6 +597,9 @@ namespace Fsp.Interop
|
||||
internal static Proto.FspFileSystemRemoveMountPoint FspFileSystemRemoveMountPoint;
|
||||
internal static Proto.FspFileSystemStartDispatcher FspFileSystemStartDispatcher;
|
||||
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.FspFileSystemFindReparsePoint FspFileSystemFindReparsePoint;
|
||||
internal static Proto.FspFileSystemResolveReparsePoints FspFileSystemResolveReparsePoints;
|
||||
@ -803,6 +818,9 @@ namespace Fsp.Interop
|
||||
FspFileSystemRemoveMountPoint = GetEntryPoint<Proto.FspFileSystemRemoveMountPoint>(Module);
|
||||
FspFileSystemStartDispatcher = GetEntryPoint<Proto.FspFileSystemStartDispatcher>(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);
|
||||
FspFileSystemFindReparsePoint = GetEntryPoint<Proto.FspFileSystemFindReparsePoint>(Module);
|
||||
FspFileSystemResolveReparsePoints = GetEntryPoint<Proto.FspFileSystemResolveReparsePoints>(Module);
|
||||
|
Loading…
x
Reference in New Issue
Block a user