mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-08 04:52:10 -05:00
sys: FspFsvolDeviceLookupContext
This commit is contained in:
parent
3dee2eaf75
commit
c87b8c948a
@ -24,6 +24,7 @@ BOOLEAN FspDeviceRetain(PDEVICE_OBJECT DeviceObject);
|
|||||||
VOID FspDeviceRelease(PDEVICE_OBJECT DeviceObject);
|
VOID FspDeviceRelease(PDEVICE_OBJECT DeviceObject);
|
||||||
VOID FspFsctlDeviceVolumeCreated(PDEVICE_OBJECT DeviceObject);
|
VOID FspFsctlDeviceVolumeCreated(PDEVICE_OBJECT DeviceObject);
|
||||||
VOID FspFsctlDeviceVolumeDeleted(PDEVICE_OBJECT DeviceObject);
|
VOID FspFsctlDeviceVolumeDeleted(PDEVICE_OBJECT DeviceObject);
|
||||||
|
PVOID FspFsvolDeviceLookupContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier);
|
||||||
NTSTATUS FspFsvolDeviceInsertContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier, PVOID Context,
|
NTSTATUS FspFsvolDeviceInsertContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier, PVOID Context,
|
||||||
PBOOLEAN PInserted);
|
PBOOLEAN PInserted);
|
||||||
VOID FspFsvolDeviceDeleteContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier,
|
VOID FspFsvolDeviceDeleteContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier,
|
||||||
@ -304,10 +305,26 @@ VOID FspFsctlDeviceVolumeDeleted(PDEVICE_OBJECT DeviceObject)
|
|||||||
IoUnregisterFileSystem(DeviceObject);
|
IoUnregisterFileSystem(DeviceObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PVOID FspFsvolDeviceLookupContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier)
|
||||||
|
{
|
||||||
|
// !PAGED_CODE(); /* because of fast mutex use in GenericTable */
|
||||||
|
|
||||||
|
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject);
|
||||||
|
ASSERT(FspFsvolDeviceExtensionKind == FsvolDeviceExtension->Base.Kind);
|
||||||
|
|
||||||
|
PVOID Result;
|
||||||
|
|
||||||
|
ExAcquireFastMutex(&FsvolDeviceExtension->GenericTableFastMutex);
|
||||||
|
Result = RtlLookupElementGenericTableAvl(&FsvolDeviceExtension->GenericTable, &Identifier);
|
||||||
|
ExReleaseFastMutex(&FsvolDeviceExtension->GenericTableFastMutex);
|
||||||
|
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
|
|
||||||
NTSTATUS FspFsvolDeviceInsertContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier, PVOID Context,
|
NTSTATUS FspFsvolDeviceInsertContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier, PVOID Context,
|
||||||
PBOOLEAN PInserted)
|
PBOOLEAN PInserted)
|
||||||
{
|
{
|
||||||
// !PAGED_CODE();
|
// !PAGED_CODE(); /* because of fast mutex use in GenericTable */
|
||||||
|
|
||||||
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject);
|
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject);
|
||||||
ASSERT(FspFsvolDeviceExtensionKind == FsvolDeviceExtension->Base.Kind);
|
ASSERT(FspFsvolDeviceExtensionKind == FsvolDeviceExtension->Base.Kind);
|
||||||
@ -328,14 +345,15 @@ NTSTATUS FspFsvolDeviceInsertContext(PDEVICE_OBJECT DeviceObject, UINT64 Identif
|
|||||||
VOID FspFsvolDeviceDeleteContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier,
|
VOID FspFsvolDeviceDeleteContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier,
|
||||||
PBOOLEAN PDeleted)
|
PBOOLEAN PDeleted)
|
||||||
{
|
{
|
||||||
// !PAGED_CODE();
|
// !PAGED_CODE(); /* because of fast mutex use in GenericTable */
|
||||||
|
|
||||||
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject);
|
FSP_FSVOL_DEVICE_EXTENSION *FsvolDeviceExtension = FspFsvolDeviceExtension(DeviceObject);
|
||||||
ASSERT(FspFsvolDeviceExtensionKind == FsvolDeviceExtension->Base.Kind);
|
ASSERT(FspFsvolDeviceExtensionKind == FsvolDeviceExtension->Base.Kind);
|
||||||
|
|
||||||
|
BOOLEAN Deleted;
|
||||||
|
|
||||||
ExAcquireFastMutex(&FsvolDeviceExtension->GenericTableFastMutex);
|
ExAcquireFastMutex(&FsvolDeviceExtension->GenericTableFastMutex);
|
||||||
BOOLEAN Deleted = RtlDeleteElementGenericTableAvl(&FsvolDeviceExtension->GenericTable,
|
Deleted = RtlDeleteElementGenericTableAvl(&FsvolDeviceExtension->GenericTable, &Identifier);
|
||||||
&Identifier);
|
|
||||||
ExReleaseFastMutex(&FsvolDeviceExtension->GenericTableFastMutex);
|
ExReleaseFastMutex(&FsvolDeviceExtension->GenericTableFastMutex);
|
||||||
|
|
||||||
if (0 != PDeleted)
|
if (0 != PDeleted)
|
||||||
@ -345,7 +363,7 @@ VOID FspFsvolDeviceDeleteContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier,
|
|||||||
static RTL_GENERIC_COMPARE_RESULTS NTAPI FspFsvolDeviceCompareElement(
|
static RTL_GENERIC_COMPARE_RESULTS NTAPI FspFsvolDeviceCompareElement(
|
||||||
PRTL_AVL_TABLE Table, PVOID FirstElement, PVOID SecondElement)
|
PRTL_AVL_TABLE Table, PVOID FirstElement, PVOID SecondElement)
|
||||||
{
|
{
|
||||||
// !PAGED_CODE();
|
// !PAGED_CODE(); /* because of fast mutex use in GenericTable */
|
||||||
|
|
||||||
if (FirstElement < SecondElement)
|
if (FirstElement < SecondElement)
|
||||||
return GenericLessThan;
|
return GenericLessThan;
|
||||||
@ -359,16 +377,16 @@ static RTL_GENERIC_COMPARE_RESULTS NTAPI FspFsvolDeviceCompareElement(
|
|||||||
static PVOID NTAPI FspFsvolDeviceAllocateElement(
|
static PVOID NTAPI FspFsvolDeviceAllocateElement(
|
||||||
PRTL_AVL_TABLE Table, CLONG ByteSize)
|
PRTL_AVL_TABLE Table, CLONG ByteSize)
|
||||||
{
|
{
|
||||||
// !PAGED_CODE();
|
// !PAGED_CODE(); /* because of fast mutex use in GenericTable */
|
||||||
|
|
||||||
/* allocate from non-paged pool because of fast mutex use in GenericTable */
|
/* allocate from non-paged pool because of fast mutex use */
|
||||||
return ExAllocatePoolWithTag(NonPagedPool, ByteSize, FSP_TAG);
|
return ExAllocatePoolWithTag(NonPagedPool, ByteSize, FSP_TAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
static VOID NTAPI FspFsvolDeviceFreeElement(
|
static VOID NTAPI FspFsvolDeviceFreeElement(
|
||||||
PRTL_AVL_TABLE Table, PVOID Buffer)
|
PRTL_AVL_TABLE Table, PVOID Buffer)
|
||||||
{
|
{
|
||||||
// !PAGED_CODE();
|
// !PAGED_CODE(); /* because of fast mutex use in GenericTable */
|
||||||
|
|
||||||
ExFreePoolWithTag(Buffer, FSP_TAG);
|
ExFreePoolWithTag(Buffer, FSP_TAG);
|
||||||
}
|
}
|
||||||
|
@ -341,6 +341,7 @@ BOOLEAN FspDeviceRetain(PDEVICE_OBJECT DeviceObject);
|
|||||||
VOID FspDeviceRelease(PDEVICE_OBJECT DeviceObject);
|
VOID FspDeviceRelease(PDEVICE_OBJECT DeviceObject);
|
||||||
VOID FspFsctlDeviceVolumeCreated(PDEVICE_OBJECT DeviceObject);
|
VOID FspFsctlDeviceVolumeCreated(PDEVICE_OBJECT DeviceObject);
|
||||||
VOID FspFsctlDeviceVolumeDeleted(PDEVICE_OBJECT DeviceObject);
|
VOID FspFsctlDeviceVolumeDeleted(PDEVICE_OBJECT DeviceObject);
|
||||||
|
PVOID FspFsvolDeviceLookupContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier);
|
||||||
NTSTATUS FspFsvolDeviceInsertContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier, PVOID Context,
|
NTSTATUS FspFsvolDeviceInsertContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier, PVOID Context,
|
||||||
PBOOLEAN PInserted);
|
PBOOLEAN PInserted);
|
||||||
VOID FspFsvolDeviceDeleteContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier,
|
VOID FspFsvolDeviceDeleteContext(PDEVICE_OBJECT DeviceObject, UINT64 Identifier,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user