mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 00:43:00 -05:00
memfs
This commit is contained in:
parent
7936c4df24
commit
830d2fde71
@ -341,6 +341,8 @@ NTSTATUS MemfsCreate(ULONG Flags, ULONG MaxFileNodes, ULONG MaxFileSize,
|
||||
PWSTR DevicePath = (Flags & MemfsNet) ?
|
||||
L"" FSP_FSCTL_NET_DEVICE_NAME : L"" FSP_FSCTL_DISK_DEVICE_NAME;
|
||||
MEMFS *Memfs;
|
||||
MEMFS_FILE_NODE *RootNode;
|
||||
BOOLEAN Inserted;
|
||||
|
||||
*PMemfs = 0;
|
||||
|
||||
@ -380,6 +382,27 @@ NTSTATUS MemfsCreate(ULONG Flags, ULONG MaxFileNodes, ULONG MaxFileSize,
|
||||
MemfsEnterOperation,
|
||||
MemfsLeaveOperation);
|
||||
|
||||
/*
|
||||
* Create root directory.
|
||||
*/
|
||||
|
||||
Result = MemfsFileNodeCreate(L"", &RootNode);
|
||||
if (!NT_SUCCESS(Result))
|
||||
{
|
||||
MemfsDelete(Memfs);
|
||||
return Result;
|
||||
}
|
||||
|
||||
RootNode->FileAttributes = FILE_ATTRIBUTE_DIRECTORY;
|
||||
|
||||
Result = MemfsFileNodeMapInsert(Memfs->FileNodeMap, RootNode, &Inserted);
|
||||
if (!NT_SUCCESS(Result))
|
||||
{
|
||||
MemfsFileNodeDelete(RootNode);
|
||||
MemfsDelete(Memfs);
|
||||
return Result;
|
||||
}
|
||||
|
||||
*PMemfs = Memfs;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
Loading…
x
Reference in New Issue
Block a user