Re: [python-win32] how to use CreateProcessWithLogonW

2009-06-03 Thread Emin.shopper Martinian.shopper
Thanks! That is awesome! I just had to search and replace Structure with ctypes.Structure and sizeof with ctypes.sizeof, save as logonw.py and then was able to successfully test via x = logonw.CreateProcessWithLogonW(user,domain,password,0,'C:\\Python25\python.exe','C:\\Python25\python.exe -i')

Re: [python-win32] how to use CreateProcessWithLogonW

2009-06-02 Thread Emin.shopper Martinian.shopper
On Mon, Jun 1, 2009 at 1:32 PM, Tim Roberts t...@probo.com wrote: Emin.shopper Martinian.shopper wrote: Dear Experts, Can someone provide an example of how to use CreateProcessWithLogonW? It's really just a combination of LogonUser and CreateProcess. Right, the problem is that I don't see

Re: [python-win32] how to use CreateProcessWithLogonW

2009-06-02 Thread Tim Roberts
Emin.shopper Martinian.shopper wrote: On Mon, Jun 1, 2009 at 1:32 PM, Tim Roberts t...@probo.com wrote: Emin.shopper Martinian.shopper wrote: Dear Experts, Can someone provide an example of how to use CreateProcessWithLogonW? It's really just a combination of LogonUser and

Re: [python-win32] how to use CreateProcessWithLogonW

2009-06-02 Thread Mario Alejandro Vilas Jerez
How about this? import ctypes NULL = 0 TRUE = 1 FALSE = 0 INVALID_HANDLE_VALUE = -1 WORD = ctypes.c_ushort DWORD = ctypes.c_uint LPSTR = ctypes.c_char_p LPBYTE = LPSTR HANDLE = DWORD # typedef struct _PROCESS_INFORMATION { # HANDLE hProcess; # HANDLE hThread; # DWORD

[python-win32] how to use CreateProcessWithLogonW

2009-06-01 Thread Emin.shopper Martinian.shopper
Dear Experts, Can someone provide an example of how to use CreateProcessWithLogonW? I am having some issues with the subprocess module and how it interacts with win32security.ImpersonateLoggedOnUser. Specifically, I use the latter to change users but the new user does not seem to be properly

Re: [python-win32] how to use CreateProcessWithLogonW

2009-06-01 Thread Tim Roberts
Emin.shopper Martinian.shopper wrote: Dear Experts, Can someone provide an example of how to use CreateProcessWithLogonW? It's really just a combination of LogonUser and CreateProcess. It uses the first four parameters you passed to LogonUser, plus the parameters you would have passed to