<html><head></head><body>In fact, the declaration of OpenProcessToken in the Python extensions for Windows is :<br>
int = OpenProcessToken( processHandle, desiredAccess ).<br>
I suppose the integer returns is the token handle.<br>
<br>
Regards<br>
<br>
Carlo Bertuccini wrote:<br>
<blockquote type="cite" cite="mid:dqbX5.38997$hk4.1468335@news.infostrada.it"><pre wrap="">Hi Patrick,<br><br></pre>
<blockquote type="cite"><pre wrap="">hProcess = GetCurrentProcess()<br>processToken = OpenProcessToken(hProcess, TOKEN_ADJUST_PRIVILEGES |<br>TOKEN_QUERY)<br></pre></blockquote>
<pre wrap=""><!----><br>There is something strange in your code ... this is the declaration of<br>OpenProcessToken:<br><br>BOOL OpenProcessToken(<br> HANDLE ProcessHandle, // handle to process<br> DWORD DesiredAccess, // desired access to process<br> PHANDLE TokenHandle // pointer to handle of open access token<br> );<br><br>The "ProcessToken" is not the Token Handle, but a boolean value: the result<br>of the function.<br>The AdjustTokenPrivileges needs the real Token Handle in order to set the<br>new privileges.<br><br>Regards,<br>--<br>- Carlo -<br><a class="moz-txt-link-abbreviated" href="mailto:c.bertu@libero.it">c.bertu@libero.it</a><br><br><br><br><br><br><br></pre>
</blockquote>
<br>
</body></html>