Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

So I'm using the CreateFile function for a C# project that I'm currently working on. I've seen some examples that pass 0 as the argument for dwFlagsAndAttributes.

While I'm reading through the documentation it doesn't specify what setting dwFlagsAndAttributes = 0 entails. Is this just a way of setting no flags or attributes?

The C# syntax for this method is:

[DllImport("kernel32.dll", SetLastError = true)]
static extern SafeFileHandle CreateFile(string lpFileName, 
       FileAccess dwDesiredAccess, uint dwShareMode, IntPtr lpSecurityAttributes,
       FileMode dwCreationDisposition, uint dwFlagsAndAttributes, 
       IntPtr hTemplateFile);

Any help is greatly appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
879 views
Welcome To Ask or Share your Answers For Others

1 Answer

Yup, it just means that the file is nothing special (ie, it doesnt match any of the File Attribute Constants attributes.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...