mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 16:33:02 -05:00
sys: file, callbacks: acquire MainFileNode resources if exists
This commit is contained in:
parent
87b2d4ca4c
commit
016d015fe6
@ -116,7 +116,9 @@ NTSTATUS FspAcquireForModWrite(
|
|||||||
Success = FspFileNodeTryAcquireExclusiveF(FileNode, FspFileNodeAcquireFull, FALSE);
|
Success = FspFileNodeTryAcquireExclusiveF(FileNode, FspFileNodeAcquireFull, FALSE);
|
||||||
if (Success)
|
if (Success)
|
||||||
{
|
{
|
||||||
*ResourceToRelease = FileNode->Header.PagingIoResource;
|
*ResourceToRelease = 0 == FileNode->MainFileNode ?
|
||||||
|
FileNode->Header.PagingIoResource :
|
||||||
|
FileNode->MainFileNode->Header.PagingIoResource;
|
||||||
Result = STATUS_SUCCESS;
|
Result = STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -240,6 +240,9 @@ VOID FspFileNodeAcquireSharedF(FSP_FILE_NODE *FileNode, ULONG Flags)
|
|||||||
{
|
{
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
if (0 != FileNode->MainFileNode)
|
||||||
|
FileNode = FileNode->MainFileNode;
|
||||||
|
|
||||||
FSP_FILE_NODE_GET_FLAGS();
|
FSP_FILE_NODE_GET_FLAGS();
|
||||||
FSP_FILE_NODE_ASSERT_FLAGS_CLR();
|
FSP_FILE_NODE_ASSERT_FLAGS_CLR();
|
||||||
|
|
||||||
@ -256,6 +259,9 @@ BOOLEAN FspFileNodeTryAcquireSharedF(FSP_FILE_NODE *FileNode, ULONG Flags, BOOLE
|
|||||||
{
|
{
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
if (0 != FileNode->MainFileNode)
|
||||||
|
FileNode = FileNode->MainFileNode;
|
||||||
|
|
||||||
FSP_FILE_NODE_GET_FLAGS();
|
FSP_FILE_NODE_GET_FLAGS();
|
||||||
FSP_FILE_NODE_ASSERT_FLAGS_CLR();
|
FSP_FILE_NODE_ASSERT_FLAGS_CLR();
|
||||||
|
|
||||||
@ -289,6 +295,9 @@ VOID FspFileNodeAcquireExclusiveF(FSP_FILE_NODE *FileNode, ULONG Flags)
|
|||||||
{
|
{
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
if (0 != FileNode->MainFileNode)
|
||||||
|
FileNode = FileNode->MainFileNode;
|
||||||
|
|
||||||
FSP_FILE_NODE_GET_FLAGS();
|
FSP_FILE_NODE_GET_FLAGS();
|
||||||
FSP_FILE_NODE_ASSERT_FLAGS_CLR();
|
FSP_FILE_NODE_ASSERT_FLAGS_CLR();
|
||||||
|
|
||||||
@ -305,6 +314,9 @@ BOOLEAN FspFileNodeTryAcquireExclusiveF(FSP_FILE_NODE *FileNode, ULONG Flags, BO
|
|||||||
{
|
{
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
if (0 != FileNode->MainFileNode)
|
||||||
|
FileNode = FileNode->MainFileNode;
|
||||||
|
|
||||||
FSP_FILE_NODE_GET_FLAGS();
|
FSP_FILE_NODE_GET_FLAGS();
|
||||||
FSP_FILE_NODE_ASSERT_FLAGS_CLR();
|
FSP_FILE_NODE_ASSERT_FLAGS_CLR();
|
||||||
|
|
||||||
@ -338,6 +350,9 @@ VOID FspFileNodeConvertExclusiveToSharedF(FSP_FILE_NODE *FileNode, ULONG Flags)
|
|||||||
{
|
{
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
if (0 != FileNode->MainFileNode)
|
||||||
|
FileNode = FileNode->MainFileNode;
|
||||||
|
|
||||||
FSP_FILE_NODE_GET_FLAGS();
|
FSP_FILE_NODE_GET_FLAGS();
|
||||||
|
|
||||||
if (Flags & FspFileNodeAcquirePgio)
|
if (Flags & FspFileNodeAcquirePgio)
|
||||||
@ -351,6 +366,9 @@ VOID FspFileNodeSetOwnerF(FSP_FILE_NODE *FileNode, ULONG Flags, PVOID Owner)
|
|||||||
{
|
{
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
if (0 != FileNode->MainFileNode)
|
||||||
|
FileNode = FileNode->MainFileNode;
|
||||||
|
|
||||||
FSP_FILE_NODE_GET_FLAGS();
|
FSP_FILE_NODE_GET_FLAGS();
|
||||||
|
|
||||||
Owner = (PVOID)((UINT_PTR)Owner | 3);
|
Owner = (PVOID)((UINT_PTR)Owner | 3);
|
||||||
@ -366,6 +384,9 @@ VOID FspFileNodeReleaseF(FSP_FILE_NODE *FileNode, ULONG Flags)
|
|||||||
{
|
{
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
if (0 != FileNode->MainFileNode)
|
||||||
|
FileNode = FileNode->MainFileNode;
|
||||||
|
|
||||||
FSP_FILE_NODE_GET_FLAGS();
|
FSP_FILE_NODE_GET_FLAGS();
|
||||||
FSP_FILE_NODE_ASSERT_FLAGS_SET();
|
FSP_FILE_NODE_ASSERT_FLAGS_SET();
|
||||||
|
|
||||||
@ -382,6 +403,9 @@ VOID FspFileNodeReleaseOwnerF(FSP_FILE_NODE *FileNode, ULONG Flags, PVOID Owner)
|
|||||||
{
|
{
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
if (0 != FileNode->MainFileNode)
|
||||||
|
FileNode = FileNode->MainFileNode;
|
||||||
|
|
||||||
FSP_FILE_NODE_GET_FLAGS();
|
FSP_FILE_NODE_GET_FLAGS();
|
||||||
FSP_FILE_NODE_ASSERT_FLAGS_SET();
|
FSP_FILE_NODE_ASSERT_FLAGS_SET();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user