From 3b90908e014e18ecfdb21cb595e9ebc425a7be23 Mon Sep 17 00:00:00 2001 From: Alberto Alonso Date: Tue, 24 Nov 2020 20:02:02 +0200 Subject: [PATCH 1/3] Document the NotifyInfo fields for the .NET interop layer. --- src/dotnet/Interop.cs | 49 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) diff --git a/src/dotnet/Interop.cs b/src/dotnet/Interop.cs index 04b5bc4e..068c096b 100644 --- a/src/dotnet/Interop.cs +++ b/src/dotnet/Interop.cs @@ -337,6 +337,47 @@ namespace Fsp.Interop } } + /// + /// Enumeration of all the possible values for NotifyInfo.Action + /// + public enum NotifyInfoAction : UInt32 + { + FileActionAdded = 1, + FileActionRemoved = 2, + FileActionModified = 3, + FileActionRenamedOldName = 4, + FileActionRenamedNewName = 5, + FileActionAddedStream = 6, + FileActionRemovedStream = 7, + FileActionModifiedStream = 8, + FileActionRemovedByDelete = 9, + FileActionIdNotTunnelled = 10, + FileActionTunnelledIdCollision = 11, + } + + + /// + /// Enumeration of all the possible values for NotifyInfo.Filter + /// + [Flags] + public enum NotifyInfoFilter : UInt32 + { + FileNotifyNone = 0x00000, + FileNotifyChangeFileName = 0x00001, + FileNotifyChangeDirName = 0x00002, + FileNotifyChangeName = FileNotifyChangeFileName | FileNotifyChangeDirName, + FileNotifyChangeAttributes = 0x00004, + FileNotifyChangeSize = 0x00008, + FileNotifyChangeLastWrite = 0x00010, + FileNotifyChangeLastAccess = 0x00020, + FileNotifyChangeCreation = 0x00040, + FileNotifyChangeEa = 0x00080, + FileNotifyChangeSecurity = 0x00100, + FileNotifyChangeStreamName = 0x00200, + FileNotifyChangeStreamSize = 0x00400, + FileNotifyChangeStreamWrite = 0x00800, + } + /// /// Contains file change notification information. /// @@ -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); From 21a636aaae98381829ee1987c5e23318ed4169c5 Mon Sep 17 00:00:00 2001 From: Alberto Alonso Date: Tue, 24 Nov 2020 20:07:31 +0200 Subject: [PATCH 2/3] Update Contributors.asciidoc --- Contributors.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/Contributors.asciidoc b/Contributors.asciidoc index dd4c6e2b..8723d53a 100644 --- a/Contributors.asciidoc +++ b/Contributors.asciidoc @@ -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 From 2f1a5b98e2e2ad20d7e81049abd23222ea90c10c Mon Sep 17 00:00:00 2001 From: Alberto Alonso Date: Thu, 26 Nov 2020 15:00:03 +0200 Subject: [PATCH 3/3] Update NotifyInfoAction and NotifyInfoFilter enum constants for more readability. --- src/dotnet/Interop.cs | 60 +++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/dotnet/Interop.cs b/src/dotnet/Interop.cs index 068c096b..49ca54e2 100644 --- a/src/dotnet/Interop.cs +++ b/src/dotnet/Interop.cs @@ -340,42 +340,42 @@ namespace Fsp.Interop /// /// Enumeration of all the possible values for NotifyInfo.Action /// - public enum NotifyInfoAction : UInt32 - { - FileActionAdded = 1, - FileActionRemoved = 2, - FileActionModified = 3, - FileActionRenamedOldName = 4, - FileActionRenamedNewName = 5, - FileActionAddedStream = 6, - FileActionRemovedStream = 7, - FileActionModifiedStream = 8, - FileActionRemovedByDelete = 9, - FileActionIdNotTunnelled = 10, - FileActionTunnelledIdCollision = 11, + 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, } /// /// Enumeration of all the possible values for NotifyInfo.Filter /// - [Flags] - public enum NotifyInfoFilter : UInt32 - { - FileNotifyNone = 0x00000, - FileNotifyChangeFileName = 0x00001, - FileNotifyChangeDirName = 0x00002, - FileNotifyChangeName = FileNotifyChangeFileName | FileNotifyChangeDirName, - FileNotifyChangeAttributes = 0x00004, - FileNotifyChangeSize = 0x00008, - FileNotifyChangeLastWrite = 0x00010, - FileNotifyChangeLastAccess = 0x00020, - FileNotifyChangeCreation = 0x00040, - FileNotifyChangeEa = 0x00080, - FileNotifyChangeSecurity = 0x00100, - FileNotifyChangeStreamName = 0x00200, - FileNotifyChangeStreamSize = 0x00400, - FileNotifyChangeStreamWrite = 0x00800, + [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, } ///