return result;
}
private boolean setPrivilege(Pointer hToken, String lpszPrivilege, boolean bEnablePrivilege)
{
TOKEN_PRIVILEGES tp = new TOKEN_PRIVILEGES();
MyAdvapi.LUID luid = new MyAdvapi.LUID();
luid.size();
if (!MyAdvapi.INSTANCE.LookupPrivilegeValueA(null, lpszPrivilege, luid))
return false;
tp.Privileges[0].Luid = luid;
tp.write();
if (bEnablePrivilege)
tp.Privileges[0].Attributes = MyAdvapi.SE_PRIVILEGE_ENABLED;
else
tp.Privileges[0].Attributes = 0;
int size = tp.size();
boolean result = MyAdvapi.INSTANCE.AdjustTokenPrivileges(hToken, false, tp, 0, null, null);
// return GetLastError() == ERROR_SUCCESS;
if (!result)
{
int errNr = MyKernel32.INSTANCE.GetLastError();