foo.cc: In function 'int main()':
foo.cc:7:27: error: expected ')' before '*' token
7 | typedef int (__stdcall *PFN_RtlAdjustPrivilege)(INT, BOOL, BOOL, INT*);
| ~ ^~
| )
foo.cc:8:27: error: expected ')' before '*' token
8 | typedef int (__stdcall *PFN_ZwShutdownSt)(INT);
| ~ ^~
| )
foo.cc:10:5: error: 'HMODULE' was not declared in this scope
10 | HMODULE hModule = ::LoadLibrary(("ntdll.dll"));
| ^~~~~~~
foo.cc:11:9: error: 'hModule' was not declared in this scope
11 | if (hModule != NULL)
| ^~~~~~~
foo.cc:13:9: error: 'PFN_RtlAdjustPrivilege' was not declared in this scope
13 | PFN_RtlAdjustPrivilege pfnRtl = (PFN_RtlAdjustPrivilege)GetProcAddress(hModule, "RtlAdjustPrivilege");
| ^~~~~~~~~~~~~~~~~~~~~~
foo.cc:14:9: error: 'PFN_ZwShutdownSt' was not declared in this scope
14 | PFN_ZwShutdownSt pfnShutdown = (PFN_ZwShutdownSt)GetProcAddress(hModule, "ZwShutdownSys" "tem");
| ^~~~~~~~~~~~~~~~
foo.cc:15:14: error: 'pfnRtl' was not declared in this scope
15 | if ((pfnRtl != NULL) && (pfnShutdown != NULL ))
| ^~~~~~
foo.cc:15:34: error: 'pfnShutdown' was not declared in this scope
15 | if ((pfnRtl != NULL) && (pfnShutdown != NULL ))
| ^~~~~~~~~~~
foo.cc:18:54: error: 'TRUE' was not declared in this scope
18 | int nRet= pfnRtl( SE_SHUTDOWN_PRIVILEGE, TRUE, TRUE, &en);
| ^~~~
foo.cc:19:22: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
19 | if (nRet == 0x0C000007C)
| ~~~~~^~~~~~~~~~~~~~
foo.cc:20:60: error: 'FALSE' was not declared in this scope
20 | nRet = pfnRtl(SE_SHUTDOWN_PRIVILEGE, TRUE, FALSE, &en);
| ^~~~~
[Hydro](https://hydro.ac)提供评测服务