Subj : Re: getprocessaffinitymask To : borland.public.cpp.borlandcpp From : Jeff Kish Date : Wed Oct 01 2003 05:25 pm On Wed, 01 Oct 2003 10:51:58 -0700, Bob Gonder wrote: >Jeff Kish wrote: > >>make a comment here? This code keeps getting executed: MessageBox( >>"Exit Error", "OpenProcessToken() failed", MB_OK); >> >>is PROCESS_ALL_ACCESS the problem or something else? > >Did you try it with TOKEN_ALL_ACCESS ? > >> if (!OpenProcessToken(GetCurrentProcess(), >> PROCESS_ALL_ACCESS, &hToken)) >> { >> MessageBox( "Exit Error", "OpenProcessToken() failed", MB_OK); >> return; >> } Say, that works better, but now this code is executing (man a battle every step of the way)... if (BResult == 0) { MessageBox("Unable to getprocessaffinitymask","cant continue",MB_OK); return; } which means that this code is returning a zero: DWORD dwProcessAM; DWORD dwSystemAM; BOOL BResult = GetProcessAffinityMask(hToken, // handle to the process of interest &dwProcessAM, // pointer to structure to receive process affinity mask &dwSystemAM); // pointer to structure to receive system affinity mask Any suggestions? Thanks much! Jeff Kish .