mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-22 08:23:05 -05:00
dll: fuseintf: Open, Close implementation
This commit is contained in:
parent
a9868ba883
commit
bc777f2d91
@ -377,6 +377,7 @@ static NTSTATUS fsp_fuse_intf_Open(FSP_FILE_SYSTEM *FileSystem,
|
||||
memcpy(FileInfo, &FileInfoBuf, sizeof FileInfoBuf);
|
||||
|
||||
filedesc->PosixPath = contexthdr->PosixPath;
|
||||
filedesc->IsDirectory = !!(FileInfoBuf.FileAttributes & FILE_ATTRIBUTE_DIRECTORY);
|
||||
filedesc->OpenFlags = fi.flags;
|
||||
filedesc->FileHandle = fi.fh;
|
||||
contexthdr->PosixPath = 0;
|
||||
@ -409,6 +410,27 @@ static VOID fsp_fuse_intf_Close(FSP_FILE_SYSTEM *FileSystem,
|
||||
FSP_FSCTL_TRANSACT_REQ *Request,
|
||||
PVOID FileNode)
|
||||
{
|
||||
struct fuse *f = FileSystem->UserContext;
|
||||
struct fsp_fuse_file_desc *filedesc = (PVOID)(UINT_PTR)Request->Req.Close.UserContext2;
|
||||
struct fuse_file_info fi;
|
||||
|
||||
memset(&fi, 0, sizeof fi);
|
||||
fi.flags = filedesc->OpenFlags;
|
||||
fi.fh = filedesc->FileHandle;
|
||||
|
||||
if (filedesc->IsDirectory)
|
||||
{
|
||||
if (0 != f->ops.releasedir)
|
||||
f->ops.releasedir(filedesc->PosixPath, &fi);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (0 != f->ops.release)
|
||||
f->ops.release(filedesc->PosixPath, &fi);
|
||||
}
|
||||
|
||||
MemFree(filedesc->PosixPath);
|
||||
MemFree(filedesc);
|
||||
}
|
||||
|
||||
static NTSTATUS fsp_fuse_intf_Read(FSP_FILE_SYSTEM *FileSystem,
|
||||
|
@ -48,6 +48,7 @@ struct fsp_fuse_context_header
|
||||
struct fsp_fuse_file_desc
|
||||
{
|
||||
char *PosixPath;
|
||||
BOOLEAN IsDirectory;
|
||||
int OpenFlags;
|
||||
UINT64 FileHandle;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user