Windows: defines NtCurrentProcess and uses it

This commit is contained in:
李通洲
2026-02-13 16:18:24 +08:00
parent dee4b36a46
commit df87cdfa6e
5 changed files with 11 additions and 4 deletions
+2 -1
View File
@@ -1,13 +1,14 @@
#include "bootmgr.h"
#include "efi_helper.h"
#include "common/io.h"
#include "common/windows/nt.h"
#include <windows.h>
const char* enablePrivilege(const wchar_t* privilege)
{
FF_AUTO_CLOSE_FD HANDLE token = NULL;
if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token))
if (!OpenProcessToken(NtCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token))
return "OpenProcessToken() failed";
TOKEN_PRIVILEGES tp = {