dll: fuse: fsp_fuse_notify

Correctly compute Windows change notification filter and action
from FUSE change notification action.
This commit is contained in:
Bill Zissimopoulos 2020-10-19 18:17:05 -07:00
parent d5ab701e3c
commit cd21d26b93
No known key found for this signature in database
GPG Key ID: 3D4F95D52C7B3EA3

View File

@ -655,7 +655,7 @@ FSP_FUSE_API int fsp_fuse_notify(struct fsp_fuse_env *env,
else if (action & FSP_FUSE_NOTIFY_CREATE)
{
NotifyInfo.V.Filter = FILE_NOTIFY_CHANGE_FILE_NAME;
NotifyInfo.V.Action = FILE_ACTION_REMOVED;
NotifyInfo.V.Action = FILE_ACTION_ADDED;
}
else if (action & FSP_FUSE_NOTIFY_UNLINK)
{
@ -665,26 +665,30 @@ FSP_FUSE_API int fsp_fuse_notify(struct fsp_fuse_env *env,
if (action & (FSP_FUSE_NOTIFY_CHMOD | FSP_FUSE_NOTIFY_CHOWN))
{
NotifyInfo.V.Filter = FILE_NOTIFY_CHANGE_SECURITY;
NotifyInfo.V.Action = FILE_ACTION_MODIFIED;
NotifyInfo.V.Filter |= FILE_NOTIFY_CHANGE_SECURITY;
if (0 == NotifyInfo.V.Action)
NotifyInfo.V.Action = FILE_ACTION_MODIFIED;
}
if (action & FSP_FUSE_NOTIFY_UTIME)
{
NotifyInfo.V.Filter = FILE_NOTIFY_CHANGE_LAST_ACCESS | FILE_NOTIFY_CHANGE_LAST_WRITE;
NotifyInfo.V.Action = FILE_ACTION_MODIFIED;
NotifyInfo.V.Filter |= FILE_NOTIFY_CHANGE_LAST_ACCESS | FILE_NOTIFY_CHANGE_LAST_WRITE;
if (0 == NotifyInfo.V.Action)
NotifyInfo.V.Action = FILE_ACTION_MODIFIED;
}
if (action & FSP_FUSE_NOTIFY_CHFLAGS)
{
NotifyInfo.V.Filter = FILE_NOTIFY_CHANGE_ATTRIBUTES;
NotifyInfo.V.Action = FILE_ACTION_MODIFIED;
NotifyInfo.V.Filter |= FILE_NOTIFY_CHANGE_ATTRIBUTES;
if (0 == NotifyInfo.V.Action)
NotifyInfo.V.Action = FILE_ACTION_MODIFIED;
}
if (action & FSP_FUSE_NOTIFY_TRUNCATE)
{
NotifyInfo.V.Filter = FILE_NOTIFY_CHANGE_SIZE;
NotifyInfo.V.Action = FILE_ACTION_MODIFIED;
NotifyInfo.V.Filter |= FILE_NOTIFY_CHANGE_SIZE;
if (0 == NotifyInfo.V.Action)
NotifyInfo.V.Action = FILE_ACTION_MODIFIED;
}
Result = FspFileSystemNotify(f->FileSystem, &NotifyInfo.V, NotifyInfo.V.Size);