30 DWORD dwDesiredAccess,
33 DWORD dwCreationDisposition,
34 DWORD dwFlagsAndAttributes,
49 dwCreationDisposition,
61 DWORD dwDesiredAccess,
64 DWORD dwCreationDisposition,
65 DWORD dwFlagsAndAttributes,
88 switch (dwCreationDisposition)
117 if (pszConsoleFileName)
150 dwDesiredAccess |=
DELETE;
188 WARN(
"Invalid path\n");
193 TRACE(
"NtPathU \'%wZ\'\n", &NtPathU);
195 TrailingBackslash =
FALSE;
199 TrailingBackslash =
TRUE;
202 if (hTemplateFile !=
NULL)
282 if (lpSecurityAttributes)
301 dwCreationDisposition,
383 TRACE(
"OpenFile('%s', lpReOpenBuff %p, uStyle %x)\n",
lpFileName, lpReOpenBuff, uStyle);
385 if (lpReOpenBuff ==
NULL)
440 switch (uStyle & 0x70)
#define FILE_NON_DIRECTORY_FILE
#define FILE_DELETE_ON_CLOSE
#define DEBUG_CHANNEL(args)
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define ERROR_NOT_ENOUGH_MEMORY
#define NT_SUCCESS(StatCode)
#define ERROR_INVALID_PARAMETER
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define FILE_ATTRIBUTE_NORMAL
#define ERROR_ACCESS_DENIED
LPCWSTR IntCheckForConsoleFileName(IN LPCWSTR pszName, IN DWORD dwDesiredAccess)
HANDLE WINAPI OpenConsoleW(LPCWSTR wsName, DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwShareMode)
HFILE WINAPI OpenFile(LPCSTR lpFileName, LPOFSTRUCT lpReOpenBuff, UINT uStyle)
BOOL WINAPI OpenDataFile(HANDLE hFile, DWORD dwUnused)
HANDLE WINAPI ReOpenFile(IN HANDLE hOriginalFile, IN DWORD dwDesiredAccess, IN DWORD dwShareMode, IN DWORD dwFlags)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
UINT WINAPI GetDriveTypeA(IN LPCSTR lpRootPathName)
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
PWCHAR FilenameA2W(LPCSTR NameA, BOOL alloc)
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
DWORD WINAPI GetFullPathNameA(IN LPCSTR lpFileName, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart)
IN PVCB IN PDIRENT OUT PULONG EaLength
struct _FileName FileName
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE _In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG FileAttributes
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
#define FILE_OVERWRITE_IF
#define FILE_OPEN_REPARSE_POINT
#define FILE_SYNCHRONOUS_IO_NONALERT
#define FILE_NO_INTERMEDIATE_BUFFERING
#define FILE_RANDOM_ACCESS
#define FILE_WRITE_THROUGH
#define FILE_OPEN_NO_RECALL
#define FILE_SEQUENTIAL_ONLY
#define FILE_OPEN_REMOTE_INSTANCE
#define FILE_OPEN_FOR_BACKUP_INTENT
#define OBJ_CASE_INSENSITIVE
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
NTSTATUS NTAPI NtQueryEaFile(IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock, OUT PVOID Buffer, IN ULONG Length, IN BOOLEAN ReturnSingleEntry, IN PVOID EaList OPTIONAL, IN ULONG EaListLength, IN PULONG EaIndex OPTIONAL, IN BOOLEAN RestartScan)
#define FILE_FLAG_OPEN_REPARSE_POINT
#define ERROR_ALREADY_EXISTS
#define TRUNCATE_EXISTING
#define FILE_FLAG_OVERLAPPED
#define FILE_FLAG_NO_BUFFERING
#define FILE_FLAG_POSIX_SEMANTICS
#define FILE_FLAG_BACKUP_SEMANTICS
#define FILE_FLAG_OPEN_NO_RECALL
#define FILE_FLAG_RANDOM_ACCESS
#define FILE_FLAG_DELETE_ON_CLOSE
#define FILE_FLAG_SEQUENTIAL_SCAN
#define ERROR_FILE_NOT_FOUND
#define FILE_FLAG_WRITE_THROUGH
static OUT PIO_STATUS_BLOCK IoStatusBlock
#define InitializeObjectAttributes(p, n, a, r, s)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToOemString(POEM_STRING DestinationString, PCUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI NTSTATUS NTAPI RtlOemStringToUnicodeString(PUNICODE_STRING DestinationString, PCOEM_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI BOOLEAN NTAPI RtlDosPathNameToNtPathName_U(_In_opt_z_ PCWSTR DosPathName, _Out_ PUNICODE_STRING NtPathName, _Out_opt_ PCWSTR *NtFileNamePart, _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo)
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
#define FILE_ATTRIBUTE_VALID_FLAGS
#define FILE_READ_ATTRIBUTES
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI NtQueryInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, OUT PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
#define FILE_ATTRIBUTE_DIRECTORY
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
DWORD BaseSetLastNTError(IN NTSTATUS Status)
#define STATUS_BUFFER_TOO_SMALL
CHAR szPathName[OFS_MAXPATHNAME]
LPVOID lpSecurityDescriptor
#define STATUS_FILE_IS_A_DIRECTORY
#define STATUS_OBJECT_NAME_COLLISION
#define INVALID_FILE_ATTRIBUTES
DWORD WINAPI GetLastError(void)
#define OF_SHARE_DENY_READ
#define OF_SHARE_EXCLUSIVE
#define OF_SHARE_DENY_NONE
struct _OFSTRUCT OFSTRUCT
#define OF_SHARE_DENY_WRITE
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define ERROR_PATH_NOT_FOUND
#define ERROR_FILE_EXISTS
_Must_inspect_result_ _In_ ULONG Flags
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG _In_opt_ PVOID EaBuffer