(executable, args, _p_attr, _t_attr,
                  inherit_handles, creation_flags, env, cwd,
                  startup_info)
Create a process supporting unicode executable and args for win32

    Python implementation of CreateProcess using CreateProcessW for Win32
Create a process supporting unicode executable and args for win32
Create a process supporting unicode executable and args for win32
def CreateProcess(executable, args, _p_attr, _t_attr,
                  inherit_handles, creation_flags, env, cwd,
                  startup_info):
    """Create a process supporting unicode executable and args for win32

    Python implementation of CreateProcess using CreateProcessW for Win32

    """

    si = STARTUPINFOW(
        dwFlags=startup_info.dwFlags,
        wShowWindow=startup_info.wShowWindow,
        cb=sizeof(STARTUPINFOW),
        ## XXXvlab: not sure of the casting here to ints.
        hStdInput=int(startup_info.hStdInput),
        hStdOutput=int(startup_info.hStdOutput),
        hStdError=int(startup_info.hStdError),
    )

    wenv = None
    if env is not None:
        ## LPCWSTR seems to be c_wchar_p, so let's say CWSTR is c_wchar
        env = (u''.join([u'%s=%s\0' % (k, v) for k, v in env.items()])) + u'\0'
        wenv = (c_wchar * len(env))()
        wenv.value = env

    pi = PROCESS_INFORMATION()
    creation_flags |= CREATE_UNICODE_ENVIRONMENT

    if CreateProcessW(executable, args, None, None,
                      inherit_handles, creation_flags,
                      wenv, cwd, byref(si), byref(pi)):
        return (DUMMY_HANDLE(pi.hProcess), DUMMY_HANDLE(pi.hThread),
                pi.dwProcessId, pi.dwThreadId)
    raise WinError()
def CreateProcess ( executable , args , _p_attr , _t_attr , inherit_handles , creation_flags , env , cwd , startup_info ) : si = STARTUPINFOW ( dwFlags = startup_info . dwFlags , wShowWindow = startup_info . wShowWindow , cb = sizeof ( STARTUPINFOW ) , ## XXXvlab: not sure of the casting here to ints. hStdInput = int ( startup_info . hStdInput ) , hStdOutput = int ( startup_info . hStdOutput ) , hStdError = int ( startup_info . hStdError ) , ) wenv = None if env is not None : ## LPCWSTR seems to be c_wchar_p, so let's say CWSTR is c_wchar env = ( u'' . join ( [ u'%s=%s\0' % ( k , v ) for k , v in env . items ( ) ] ) ) + u'\0' wenv = ( c_wchar * len ( env ) ) ( ) wenv . value = env pi = PROCESS_INFORMATION ( ) creation_flags |= CREATE_UNICODE_ENVIRONMENT if CreateProcessW ( executable , args , None , None , inherit_handles , creation_flags , wenv , cwd , byref ( si ) , byref ( pi ) ) : return ( DUMMY_HANDLE ( pi . hProcess ) , DUMMY_HANDLE ( pi . hThread ) , pi . dwProcessId , pi . dwThreadId ) raise WinError ( )