NativeFileIONtCreateFile Method |
Calls NT API NtCreateFile() function and encapsulates returned handle in a SafeFileHandle object.
Namespace:
Arsenal.ImageMounter.IO
Assembly:
Arsenal.ImageMounter (in Arsenal.ImageMounter.dll) Version: 1.0.0.0 (3.4.140.0)
Syntax public static SafeFileHandle NtCreateFile(
string FileName,
NativeFileIONtObjectAttributes ObjectAttributes,
FileAccess DesiredAccess,
FileShare ShareMode,
NativeFileIONtCreateDisposition CreationDisposition,
NativeFileIONtCreateOptions CreationOption,
FileAttributes FileAttributes,
SafeFileHandle RootDirectory,
out NativeFileIONtFileCreated WasCreated
)
Public Shared Function NtCreateFile (
FileName As String,
ObjectAttributes As NativeFileIONtObjectAttributes,
DesiredAccess As FileAccess,
ShareMode As FileShare,
CreationDisposition As NativeFileIONtCreateDisposition,
CreationOption As NativeFileIONtCreateOptions,
FileAttributes As FileAttributes,
RootDirectory As SafeFileHandle,
<OutAttribute> ByRef WasCreated As NativeFileIONtFileCreated
) As SafeFileHandle
public:
static SafeFileHandle^ NtCreateFile(
String^ FileName,
NativeFileIONtObjectAttributes ObjectAttributes,
FileAccess DesiredAccess,
FileShare ShareMode,
NativeFileIONtCreateDisposition CreationDisposition,
NativeFileIONtCreateOptions CreationOption,
FileAttributes FileAttributes,
SafeFileHandle^ RootDirectory,
[OutAttribute] NativeFileIONtFileCreated% WasCreated
)
static member NtCreateFile :
FileName : string *
ObjectAttributes : NativeFileIONtObjectAttributes *
DesiredAccess : FileAccess *
ShareMode : FileShare *
CreationDisposition : NativeFileIONtCreateDisposition *
CreationOption : NativeFileIONtCreateOptions *
FileAttributes : FileAttributes *
RootDirectory : SafeFileHandle *
WasCreated : NativeFileIONtFileCreated byref -> SafeFileHandle
Parameters
- FileName
- Type: SystemString
Name of file to open. - ObjectAttributes
- Type: Arsenal.ImageMounter.IONativeFileIONtObjectAttributes
Object attributes. - DesiredAccess
- Type: System.IOFileAccess
File access to request. - ShareMode
- Type: System.IOFileShare
Share mode to request. - CreationDisposition
- Type: Arsenal.ImageMounter.IONativeFileIONtCreateDisposition
Open/creation mode. - CreationOption
- Type: Arsenal.ImageMounter.IONativeFileIONtCreateOptions
Specifies whether to request overlapped I/O. - FileAttributes
- Type: System.IOFileAttributes
Attributes for created file. - RootDirectory
- Type: Microsoft.Win32.SafeHandlesSafeFileHandle
Root directory to start path parsing from, or null for rooted path. - WasCreated
- Type: Arsenal.ImageMounter.IONativeFileIONtFileCreated
Return information about whether a file was created, existing file opened etc.
Return Value
Type:
SafeFileHandleNTSTATUS value indicating result of the operation.
See Also