Re: CreateProcessWithLogonW error



A word of caution here: if you have multiple threads that may end up trying
to change the process token at the same time you are likely to run into
random failures if you use this method. If this situation happens to be
true for the OP's program, a better choice is to use ImpersonateSelf and
operate on the threads token.

"Kellie Fitton" <KELLIEFITTON@xxxxxxxxx> wrote in message
news:1137992063.366817.224290@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> Ok, if you have been granted those privileges, then you can use
> the following APIs to enable them from your application:
>
> GetCurrentProcess()
> OpenProcessToken() using TOKEN_ADJUST_PRIVILEGES |
> TOKEN_QUERY
> LookupPrivilegeValue() using SE_TCB_NAME,
> AdjustTokenPrivileges()
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getcurrentprocess.asp
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/openprocesstoken.asp
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/lookupprivilegevalue.asp
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secauthz/security/adjusttokenprivileges.asp
>
> Kellie.
>


.



Relevant Pages

  • Re: Multi-core?
    ... (i.e. DLLs can run on multiple threads in a multi-threaded host), ... ActiveX EXEs support thread-pools and thread-per-object, ... understanding is you'll need APIs. ...
    (microsoft.public.vb.general.discussion)
  • Re: threading best practices?
    ... to talk to the KDC multiple times per session. ... obtained with one library context and used in another. ... know when the same object can be used in multiple threads ... An example is some APIs have a flag that tells them to ...
    (comp.protocols.kerberos)
  • Re: threads (java-style)
    ... Therefore native APIs for Winows/Novell/Linux/Mac... ... platform in an uniformous way. ... > Im writing a windows-based program that uses multiple threads. ... > Could anyone tell me the easiest way to create a multiple threaded program ...
    (comp.lang.cpp)
  • Re: Multi-core?
    ... (i.e. DLLs can run on multiple threads in a multi-threaded host), ... ActiveX EXEs support thread-pools and thread-per-object, ... understanding is you'll need APIs. ...
    (microsoft.public.vb.general.discussion)