#include <ddk/ntddk.h>
#include <windows.h>

int main(void)
{
    UNICODE_STRING FileName = { 0, 2, L"" };
    OBJECT_ATTRIBUTES ObjectAttributes;
    IO_STATUS_BLOCK IoStatusBlock;
    HANDLE CurrentDirectoryHandle;
    HANDLE FileHandle;

    CurrentDirectoryHandle = (HANDLE)((int ****)NtCurrentTeb())[12][4][11];

    InitializeObjectAttributes(&ObjectAttributes,
                               &FileName,
                               OBJ_CASE_INSENSITIVE | OBJ_INHERIT,
                               CurrentDirectoryHandle,
                               NULL);

    NtOpenFile(&FileHandle,
               SYNCHRONIZE | FILE_TRAVERSE,
               &ObjectAttributes,
               &IoStatusBlock,
               FILE_SHARE_VALID_FLAGS,
               FILE_DIRECTORY_FILE |
               FILE_SYNCHRONOUS_IO_NONALERT |
               FILE_OPEN_FOR_BACKUP_INTENT);

    return 0;
}
