Impersonate a process

From: Arik Poznanski (
Date: 09/16/03

Date: Tue, 16 Sep 2003 06:47:45 -0700

I want to change my process security token to another user.
basically what I need is when the app loads, it displays a
user/pass dialog.
and then it changes the security token of the process as
if it was run as the entered user/pass. according to what
I heard, I can do something like this in two ways. 1)
making another application that will display the dialog
and then open my application with Api's like
CreateProcessAsUser or CreateProcessWithLogon. 2) Use
impersonation to change the security token of the process.
I really prefer the second way, but I don't know where to
start. and I don't know if it really is possible, I only
found clues on how to impersonate a thread.. not a process.

Waiting for answer..

Arik Poznanski