sys: notify implementation

This commit is contained in:
Bill Zissimopoulos 2020-10-09 15:19:51 -07:00
parent 92b7989999
commit 6b4b1dff6c
No known key found for this signature in database
GPG Key ID: 3D4F95D52C7B3EA3

View File

@ -1218,6 +1218,9 @@ static VOID FspVolumeNotifyWork(PVOID NotifyWorkItem0)
FileName.Length = FileName.Length =
FileName.MaximumLength = (USHORT)(NotifyInfoSize - sizeof(FSP_FSCTL_NOTIFY_INFO)); FileName.MaximumLength = (USHORT)(NotifyInfoSize - sizeof(FSP_FSCTL_NOTIFY_INFO));
FileName.Buffer = NotifyInfo->FileNameBuf; FileName.Buffer = NotifyInfo->FileNameBuf;
if (sizeof(WCHAR) * 2/* not empty or root */ <= FileName.Length &&
L'\\' == FileName.Buffer[FileName.Length / sizeof(WCHAR) - 1])
FileName.Length -= sizeof(WCHAR);
if (!FspFileNameIsValid(&FileName, FsvolDeviceExtension->VolumeParams.MaxComponentLength, if (!FspFileNameIsValid(&FileName, FsvolDeviceExtension->VolumeParams.MaxComponentLength,
FsvolDeviceExtension->VolumeParams.NamedStreams ? &StreamPart : 0, FsvolDeviceExtension->VolumeParams.NamedStreams ? &StreamPart : 0,
@ -1249,8 +1252,7 @@ static VOID FspVolumeNotifyWork(PVOID NotifyWorkItem0)
Result = RtlAppendUnicodeStringToString(&FullFileName, &AbsFileName); Result = RtlAppendUnicodeStringToString(&FullFileName, &AbsFileName);
if (NT_SUCCESS(Result)) if (NT_SUCCESS(Result))
{ {
if (sizeof(WCHAR) * 2/* not empty or root */ <= AbsFileName.Length && if (sizeof(WCHAR) * 2/* not empty or root */ <= AbsFileName.Length)
L'\\' != AbsFileName.Buffer[AbsFileName.Length / sizeof(WCHAR) - 1])
Result = RtlAppendUnicodeToString(&FullFileName, L"\\"); Result = RtlAppendUnicodeToString(&FullFileName, L"\\");
} }
if (NT_SUCCESS(Result)) if (NT_SUCCESS(Result))