Merge pull request #335 from alonsohki/document-notifyinfo-fields

Document the NotifyInfo fields for the .NET interop layer.
This commit is contained in:
Bill Zissimopoulos 2020-11-27 10:28:37 -08:00 committed by GitHub
commit 2d0df701e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 4 deletions

View File

@ -54,6 +54,7 @@ This CONTRIBUTOR AGREEMENT applies to any contribution that you make to the WinF
CONTRIBUTOR LIST
----------------
|===
|Alberto Alonso |alberto at alonso.xyz
|Ben Rubson |ben.rubson at gmail.com
|Bill Zissimopoulos |billziss at navimatics.com
|Brett Dutro |brett.dutro at gmail.com

View File

@ -337,6 +337,47 @@ namespace Fsp.Interop
}
}
/// <summary>
/// Enumeration of all the possible values for NotifyInfo.Action
/// </summary>
public enum NotifyInfoAction : UInt32
{
Added = 1,
Removed = 2,
Modified = 3,
RenamedOldName = 4,
RenamedNewName = 5,
AddedStream = 6,
RemovedStream = 7,
ModifiedStream = 8,
RemovedByDelete = 9,
IdNotTunnelled = 10,
TunnelledIdCollision = 11,
}
/// <summary>
/// Enumeration of all the possible values for NotifyInfo.Filter
/// </summary>
[Flags]
public enum NotifyInfoFilter : UInt32
{
None = 0x00000,
ChangeFileName = 0x00001,
ChangeDirName = 0x00002,
ChangeName = ChangeFileName | ChangeDirName,
ChangeAttributes = 0x00004,
ChangeSize = 0x00008,
ChangeLastWrite = 0x00010,
ChangeLastAccess = 0x00020,
ChangeCreation = 0x00040,
ChangeEa = 0x00080,
ChangeSecurity = 0x00100,
ChangeStreamName = 0x00200,
ChangeStreamSize = 0x00400,
ChangeStreamWrite = 0x00800,
}
/// <summary>
/// Contains file change notification information.
/// </summary>
@ -344,8 +385,8 @@ namespace Fsp.Interop
public struct NotifyInfo
{
public String FileName;
public UInt32 Action;
public UInt32 Filter;
public NotifyInfoAction Action;
public NotifyInfoFilter Filter;
}
[StructLayout(LayoutKind.Sequential)]
@ -1158,8 +1199,8 @@ namespace Fsp.Interop
for (int I = 0; NotifyInfoArray.Length > I; I++)
{
NotifyInfoInternal Internal = default(NotifyInfoInternal);
Internal.Action = NotifyInfoArray[I].Action;
Internal.Filter = NotifyInfoArray[I].Filter;
Internal.Action = (UInt32)NotifyInfoArray[I].Action;
Internal.Filter = (UInt32)NotifyInfoArray[I].Filter;
Internal.SetFileNameBuf(NotifyInfoArray[I].FileName);
FspFileSystemAddNotifyInfo(
ref Internal, (IntPtr)P, (UInt32)Length, out BytesTransferred);