1
0
mirror of https://github.com/winfsp/winfsp.git synced 2026-03-06 07:39:33 -06:00

dll: use adaptive locks when starting/stopping FSD

This commit is contained in:
Bill Zissimopoulos
2023-12-12 12:36:41 +00:00
parent be5faf34bc
commit 65bf8c5319
3 changed files with 107 additions and 5 deletions

View File

@@ -106,6 +106,21 @@ NTSTATUS FspGetModuleFileName(
ULONG Size,
PWSTR RelativePath);
typedef struct
{
SRWLOCK Lock;
HANDLE Handle;
UINT64 Offset;
} FSP_ADAPTIVE_LOCK;
#define FSP_ADAPTIVE_LOCK_INIT { SRWLOCK_INIT, INVALID_HANDLE_VALUE, 0 }
VOID FspAdaptiveLockAcquire(
FSP_ADAPTIVE_LOCK *Lock,
PWSTR FileName,
UINT64 Offset,
DWORD Timeout);
VOID FspAdaptiveLockRelease(
FSP_ADAPTIVE_LOCK *Lock);
#define FspFileSystemDirectoryBufferEntryInvalid ((ULONG)-1)
VOID FspFileSystemPeekInDirectoryBuffer(PVOID *PDirBuffer,
PUINT8 *PBuffer, PULONG *PIndex, PULONG PCount);