67{
78
80 {
83 }
84
86
87
88 switch (dwCreationDisposition)
89 {
92 break;
93
96 break;
97
100 break;
101
104 break;
105
108 break;
109
110 default:
113 }
114
115
117 if (pszConsoleFileName)
118 {
120 dwDesiredAccess,
123 }
124
125
126
127
129 {
130
131
133 }
134
137
140
143
146
148 {
150 dwDesiredAccess |=
DELETE;
151 }
152
154 {
157 else
158 {
161
164 }
165 }
166 else
168
171
174
176
177
179
180
181
182
184 &NtPathU,
187 {
188 WARN(
"Invalid path\n");
191 }
192
193 TRACE(
"NtPathU \'%wZ\'\n", &NtPathU);
194
195 TrailingBackslash =
FALSE;
198 {
199 TrailingBackslash =
TRUE;
200 }
201
202 if (hTemplateFile !=
NULL)
203 {
205
206 for (;;)
207 {
208
209
212 &EaInformation,
216 {
217
219 0,
222 {
224 0,
226
227
228
231 }
232
239 0,
242
244 {
245
246
248 break;
249 }
250 else
251 {
253 0,
256
258 {
259
260
261 break;
262 }
263 }
264 }
265 else
266 {
267
268
269
270 break;
271 }
272 }
273 }
274
275
277 &NtPathU,
278 0,
281
282 if (lpSecurityAttributes)
283 {
286
288 }
289
292
293
295 dwDesiredAccess,
300 dwShareMode,
301 dwCreationDisposition,
305
307 0,
309
310
312 {
314 0,
316 }
317
318
320 {
321
322
323
324
325
328 {
330 }
332 TrailingBackslash)
333 {
335 }
336 else
337 {
339 }
340
342 }
343
344
345
346
347
349 {
351 }
353 {
355 }
356 else
357 {
359 }
360
362}
#define FILE_NON_DIRECTORY_FILE
#define FILE_DELETE_ON_CLOSE
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
LPCWSTR IntCheckForConsoleFileName(IN LPCWSTR pszName, IN DWORD dwDesiredAccess)
HANDLE WINAPI OpenConsoleW(LPCWSTR wsName, DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwShareMode)
IN PVCB IN PDIRENT OUT PULONG EaLength
_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
#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
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 BOOLEAN NTAPI RtlDosPathNameToNtPathName_U(_In_opt_z_ PCWSTR DosPathName, _Out_ PUNICODE_STRING NtPathName, _Out_opt_ PCWSTR *NtFileNamePart, _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo)
#define FILE_ATTRIBUTE_VALID_FLAGS
#define FILE_READ_ATTRIBUTES
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 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)
DWORD BaseSetLastNTError(IN NTSTATUS Status)
#define STATUS_BUFFER_TOO_SMALL
LPVOID lpSecurityDescriptor
#define STATUS_FILE_IS_A_DIRECTORY
#define STATUS_OBJECT_NAME_COLLISION
#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