| 69 | |
| 70 | |
| 71 | NTSTATUS FilesAPI::CreateDir(LPCWSTR DirPath) { |
| 72 | UNICODE_STRING Path; |
| 73 | RtlInitUnicodeString(&Path, DirPath); |
| 74 | |
| 75 | OBJECT_ATTRIBUTES ObjectAttributes; |
| 76 | InitializeObjectAttributes( |
| 77 | &ObjectAttributes, |
| 78 | &Path, |
| 79 | OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, |
| 80 | NULL, |
| 81 | NULL |
| 82 | ); |
| 83 | |
| 84 | IO_STATUS_BLOCK IoStatusBlock = {}; |
| 85 | LARGE_INTEGER AllocationSize = {}; |
| 86 | |
| 87 | HANDLE hDir = NULL; |
| 88 | NTSTATUS Status = ZwCreateFile( |
| 89 | &hDir, |
| 90 | SYNCHRONIZE, |
| 91 | &ObjectAttributes, |
| 92 | &IoStatusBlock, |
| 93 | &AllocationSize, |
| 94 | FILE_ATTRIBUTE_NORMAL, |
| 95 | 0, // Non-shared access |
| 96 | FILE_CREATE, |
| 97 | FILE_DIRECTORY_FILE, |
| 98 | NULL, |
| 99 | 0 |
| 100 | ); |
| 101 | if (NT_SUCCESS(Status) && hDir) ZwClose(hDir); |
| 102 | return Status; |
| 103 | } |
| 104 | |
| 105 | NTSTATUS FilesAPI::DeleteFile(LPCWSTR FilePath) { |
| 106 | UNICODE_STRING Path; |
nothing calls this directly
no outgoing calls
no test coverage detected