#include <shlobj.h>
#include <process.h>
#include <Tlhelp32.h>
#include <Dbghelp.h>
#pragma comment(lib, "Dbghelp.lib")
#include <iostream>
#include <string>
#include <process.h>
#include <Tlhelp32.h>
#include <Dbghelp.h>
#pragma comment(lib, "Dbghelp.lib")
#include <iostream>
#include <string>
using namespace std;
BOOL EnabledDebugPrivilege()
{
HANDLE hToken;
BOOL fOk=FALSE;
if(OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES,&hToken))
{
TOKEN_PRIVILEGES tp;
tp.PrivilegeCount=1;
LookupPrivilegeValue(NULL,SE_DEBUG_NAME,&tp.Privileges[0].Luid);
tp.Privileges[0].Attributes=SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken,FALSE,&tp,sizeof(tp),NULL,NULL);
fOk=(GetLastError()==ERROR_SUCCESS);
CloseHandle(hToken);
}
return fOk;
}