From 45ea5993c693812ff6fff6f549f84d073221107a Mon Sep 17 00:00:00 2001 From: David Hall Date: Thu, 22 Aug 2019 13:57:51 -0600 Subject: [PATCH] Added create/open flags to CreationOption enum --- PInvoke/Kernel32/FileApi.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/PInvoke/Kernel32/FileApi.cs b/PInvoke/Kernel32/FileApi.cs index 9d042ded..b42aac93 100644 --- a/PInvoke/Kernel32/FileApi.cs +++ b/PInvoke/Kernel32/FileApi.cs @@ -183,6 +183,26 @@ namespace Vanara.PInvoke FILE_NOTIFY_CHANGE_SECURITY = 0x00000100, } + /// Options for file and other type creation or opening. + [PInvokeData("fileapi.h")] + public enum CreationOption + { + /// Create new if one does not already exist. + CREATE_NEW = 1, + + /// Always create new, overwriting any existing. + CREATE_ALWAYS = 2, + + /// Open existing. + OPEN_EXISTING = 3, + + /// Alway open, creating new if doesn't exist. + OPEN_ALWAYS = 4, + + /// Truncate existing. + TRUNCATE_EXISTING = 5, + } + /// File type values returned by . [PInvokeData("WinUser.h", MSDNShortId = "aa364960")] [Flags]