BOOL EnableDebugPriv( BOOL bAdd )
{
HANDLE hToken = NULL;
LUID SeDebugNameValue;
TOKEN_PRIVILEGES tp;
BOOL rv = FALSE;
if ( OpenProcessToken( GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken ) )
{
if ( LookupPrivilegeValue( NULL, SE_DEBUG_NAME, &SeDebugNameValue ) )
{
tp.PrivilegeCount = 1;
tp.Privileges[0].Luid = SeDebugNameValue;
tp.Privileges[0].Attributes = bAdd ? SE_PRIVILEGE_ENABLED : 0;
rv = AdjustTokenPrivileges( hToken, FALSE, &tp, sizeof(TOKEN_PRIVILEGES), NULL, NULL );
}
CloseHandle( hToken );
}
return rv;
}
if ( !EnableDebugPriv(TRUE) )
Printf(L"SysUtils: DEBUG privilege is not available\r\n");
TCC: (Sys) Not all privileges or groups referenced are assigned to the caller.
hello -- thx for the info ... My ID is part of the admin group and it seems that the directive is not workingI think it means you need to be running as administrator.
I think Rex means processes 0 and 4. Elevated, you can query any other process.You have to be admin, and you have to be elevated. And you still can't query any of the system processes.