Click or drag to resize

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
)

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: SafeFileHandle
NTSTATUS value indicating result of the operation.
See Also