mirror of
				https://github.com/winfsp/winfsp.git
				synced 2025-11-03 20:48:08 -06:00 
			
		
		
		
	sys: FspFsvolCreateComplete: populate FileNode and FileDesc before name normalization
This commit is contained in:
		@@ -808,6 +808,16 @@ NTSTATUS FspFsvolCreateComplete(
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* populate the FileNode/FileDesc fields from the Response */
 | 
					        /* populate the FileNode/FileDesc fields from the Response */
 | 
				
			||||||
 | 
					        FileNode->UserContext = Response->Rsp.Create.Opened.UserContext;
 | 
				
			||||||
 | 
					        FileNode->IndexNumber = Response->Rsp.Create.Opened.FileInfo.IndexNumber;
 | 
				
			||||||
 | 
					        FileNode->IsDirectory = BooleanFlagOn(Response->Rsp.Create.Opened.FileInfo.FileAttributes,
 | 
				
			||||||
 | 
					            FILE_ATTRIBUTE_DIRECTORY);
 | 
				
			||||||
 | 
					        FileNode->IsRootDirectory = FileNode->IsDirectory &&
 | 
				
			||||||
 | 
					            sizeof(WCHAR) == FileNode->FileName.Length && L'\\' == FileNode->FileName.Buffer[0];
 | 
				
			||||||
 | 
					        FileDesc->UserContext2 = Response->Rsp.Create.Opened.UserContext2;
 | 
				
			||||||
 | 
					        FileDesc->DeleteOnClose = BooleanFlagOn(IrpSp->Parameters.Create.Options, FILE_DELETE_ON_CLOSE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        /* handle normalized names */
 | 
				
			||||||
        if (!FsvolDeviceExtension->VolumeParams.CaseSensitiveSearch)
 | 
					        if (!FsvolDeviceExtension->VolumeParams.CaseSensitiveSearch)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            /* is there a normalized file name as part of the response? */
 | 
					            /* is there a normalized file name as part of the response? */
 | 
				
			||||||
@@ -843,14 +853,6 @@ NTSTATUS FspFsvolCreateComplete(
 | 
				
			|||||||
                RtlCopyMemory(FileNode->FileName.Buffer, NormalizedName.Buffer, NormalizedName.Length);
 | 
					                RtlCopyMemory(FileNode->FileName.Buffer, NormalizedName.Buffer, NormalizedName.Length);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        FileNode->UserContext = Response->Rsp.Create.Opened.UserContext;
 | 
					 | 
				
			||||||
        FileNode->IndexNumber = Response->Rsp.Create.Opened.FileInfo.IndexNumber;
 | 
					 | 
				
			||||||
        FileNode->IsDirectory = BooleanFlagOn(Response->Rsp.Create.Opened.FileInfo.FileAttributes,
 | 
					 | 
				
			||||||
            FILE_ATTRIBUTE_DIRECTORY);
 | 
					 | 
				
			||||||
        FileNode->IsRootDirectory = FileNode->IsDirectory &&
 | 
					 | 
				
			||||||
            sizeof(WCHAR) == FileNode->FileName.Length && L'\\' == FileNode->FileName.Buffer[0];
 | 
					 | 
				
			||||||
        FileDesc->UserContext2 = Response->Rsp.Create.Opened.UserContext2;
 | 
					 | 
				
			||||||
        FileDesc->DeleteOnClose = BooleanFlagOn(IrpSp->Parameters.Create.Options, FILE_DELETE_ON_CLOSE);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* open the FileNode */
 | 
					        /* open the FileNode */
 | 
				
			||||||
        Result = FspFileNodeOpen(FileNode, FileObject,
 | 
					        Result = FspFileNodeOpen(FileNode, FileObject,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user