mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
sys: FspFsvolDeviceLockVolumeNotify
This commit is contained in:
parent
66f3620808
commit
2e441534a3
@ -1398,6 +1398,18 @@ VOID FspFsvolDeviceGetVolumeInfo(PDEVICE_OBJECT DeviceObject, FSP_FSCTL_VOLUME_I
|
||||
BOOLEAN FspFsvolDeviceTryGetVolumeInfo(PDEVICE_OBJECT DeviceObject, FSP_FSCTL_VOLUME_INFO *VolumeInfo);
|
||||
VOID FspFsvolDeviceSetVolumeInfo(PDEVICE_OBJECT DeviceObject, const FSP_FSCTL_VOLUME_INFO *VolumeInfo);
|
||||
VOID FspFsvolDeviceInvalidateVolumeInfo(PDEVICE_OBJECT DeviceObject);
|
||||
static inline
|
||||
VOID FspFsvolDeviceLockVolumeNotify(PDEVICE_OBJECT DeviceObject)
|
||||
{
|
||||
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject);
|
||||
ExAcquireFastMutexUnsafe(&FsvolDeviceExtension->VolumeNotifyMutex);
|
||||
}
|
||||
static inline
|
||||
VOID FspFsvolDeviceUnlockVolumeNotify(PDEVICE_OBJECT DeviceObject)
|
||||
{
|
||||
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject);
|
||||
ExReleaseFastMutexUnsafe(&FsvolDeviceExtension->VolumeNotifyMutex);
|
||||
}
|
||||
#if defined(FSP_CFG_REJECT_EARLY_IRP)
|
||||
static inline
|
||||
BOOLEAN FspFsvolDeviceReadyToAcceptIrp(PDEVICE_OBJECT DeviceObject)
|
||||
|
@ -490,12 +490,12 @@ static VOID FspVolumeDeleteNoLock(
|
||||
FspMupUnregister(Globals->FsmupDeviceObject, FsvolDeviceObject);
|
||||
}
|
||||
|
||||
ExAcquireFastMutex(&FsvolDeviceExtension->VolumeNotifyMutex);
|
||||
FspFsvolDeviceLockVolumeNotify(FsvolDeviceObject);
|
||||
if (1 <= FsvolDeviceExtension->VolumeNotifyCount)
|
||||
FspFsvolDeviceFileRenameReleaseOwner(FsvolDeviceObject,
|
||||
&FsvolDeviceExtension->VolumeNotifyCount);
|
||||
FsvolDeviceExtension->VolumeNotifyCount = -1;
|
||||
ExReleaseFastMutex(&FsvolDeviceExtension->VolumeNotifyMutex);
|
||||
FspFsvolDeviceUnlockVolumeNotify(FsvolDeviceObject);
|
||||
|
||||
/* release the volume device object */
|
||||
FspDeviceDereference(FsvolDeviceObject);
|
||||
@ -1257,7 +1257,7 @@ static NTSTATUS FspVolumeNotifyLock(
|
||||
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(FsvolDeviceObject);
|
||||
NTSTATUS Result = STATUS_SUCCESS;
|
||||
|
||||
ExAcquireFastMutex(&FsvolDeviceExtension->VolumeNotifyMutex);
|
||||
FspFsvolDeviceLockVolumeNotify(FsvolDeviceObject);
|
||||
if (0 == FsvolDeviceExtension->VolumeNotifyCount)
|
||||
{
|
||||
if (FspFsvolDeviceFileRenameTryAcquireShared(FsvolDeviceObject))
|
||||
@ -1271,7 +1271,7 @@ static NTSTATUS FspVolumeNotifyLock(
|
||||
}
|
||||
else if (0 < FsvolDeviceExtension->VolumeNotifyCount)
|
||||
FsvolDeviceExtension->VolumeNotifyCount++;
|
||||
ExReleaseFastMutex(&FsvolDeviceExtension->VolumeNotifyMutex);
|
||||
FspFsvolDeviceUnlockVolumeNotify(FsvolDeviceObject);
|
||||
|
||||
FspDeviceDereference(FsvolDeviceObject);
|
||||
|
||||
@ -1369,7 +1369,7 @@ static VOID FspVolumeNotifyWork(PVOID NotifyWorkItem0)
|
||||
|
||||
if (Unlock)
|
||||
{
|
||||
ExAcquireFastMutex(&FsvolDeviceExtension->VolumeNotifyMutex);
|
||||
FspFsvolDeviceLockVolumeNotify(FsvolDeviceObject);
|
||||
if (1 == FsvolDeviceExtension->VolumeNotifyCount)
|
||||
{
|
||||
FspFsvolDeviceFileRenameReleaseOwner(FsvolDeviceObject,
|
||||
@ -1378,7 +1378,7 @@ static VOID FspVolumeNotifyWork(PVOID NotifyWorkItem0)
|
||||
}
|
||||
else if (1 < FsvolDeviceExtension->VolumeNotifyCount)
|
||||
FsvolDeviceExtension->VolumeNotifyCount--;
|
||||
ExReleaseFastMutex(&FsvolDeviceExtension->VolumeNotifyMutex);
|
||||
FspFsvolDeviceUnlockVolumeNotify(FsvolDeviceObject);
|
||||
}
|
||||
|
||||
FspFsvolDeviceVolumeDeleteReleaseOwner(FsvolDeviceObject, NotifyWorkItem);
|
||||
|
Loading…
x
Reference in New Issue
Block a user