B
Bruno van Dooren
Hi,
i need to create a .NET class that will provide the same functionality as
the windows 'run as' command.
it seems that this code is not available in the .NET framework.
I have found an example that will logon he desired creadentials to get a
security token.
the only thing i need to do now is to import the function
BOOL CreateProcessAsUser(
HANDLE hToken,
LPCTSTR lpApplicationName,
LPTSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCTSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
);
i know how to pass simple things like integers, handles etc, but that
function call uses a number of pointers to win32 structures to set and get
information. how do i need to pass those? i assume that i have to create
equivalent structs?
I have lookde into the .NET framework, but it does not seem to support
strting a process as another user?
I know i can impersonate another user, but would that not affect the
application that i am starting the new process from?
i need to create a .NET class that will provide the same functionality as
the windows 'run as' command.
it seems that this code is not available in the .NET framework.
I have found an example that will logon he desired creadentials to get a
security token.
the only thing i need to do now is to import the function
BOOL CreateProcessAsUser(
HANDLE hToken,
LPCTSTR lpApplicationName,
LPTSTR lpCommandLine,
LPSECURITY_ATTRIBUTES lpProcessAttributes,
LPSECURITY_ATTRIBUTES lpThreadAttributes,
BOOL bInheritHandles,
DWORD dwCreationFlags,
LPVOID lpEnvironment,
LPCTSTR lpCurrentDirectory,
LPSTARTUPINFO lpStartupInfo,
LPPROCESS_INFORMATION lpProcessInformation
);
i know how to pass simple things like integers, handles etc, but that
function call uses a number of pointers to win32 structures to set and get
information. how do i need to pass those? i assume that i have to create
equivalent structs?
I have lookde into the .NET framework, but it does not seem to support
strting a process as another user?
I know i can impersonate another user, but would that not affect the
application that i am starting the new process from?