Exemple #1
0
                                           save_err=rffi.RFFI_SAVE_LASTERROR)
    _GetCurrentProcessId = winexternal('GetCurrentProcessId', [], DWORD)

    def GetCurrentProcessId():
        return rffi.cast(lltype.Signed, _GetCurrentProcessId())

    _GetConsoleCP = winexternal('GetConsoleCP', [], DWORD)
    _GetConsoleOutputCP = winexternal('GetConsoleOutputCP', [], DWORD)

    def GetConsoleCP():
        return rffi.cast(lltype.Signed, _GetConsoleCP())

    def GetConsoleOutputCP():
        return rffi.cast(lltype.Signed, _GetConsoleOutputCP())

    _wenviron_items, _wgetenv, _wputenv = make_env_impls(win32=True)

    _GetStdHandle = winexternal('GetStdHandle', [DWORD], HANDLE)

    def GetStdHandle(handle_id):
        return _GetStdHandle(handle_id)

    CONSOLE_SCREEN_BUFFER_INFO_P = lltype.Ptr(CONSOLE_SCREEN_BUFFER_INFO)
    GetConsoleScreenBufferInfo = winexternal(
        "GetConsoleScreenBufferInfo", [HANDLE, CONSOLE_SCREEN_BUFFER_INFO_P],
        BOOL)

    _GetHandleInformation = winexternal('GetHandleInformation',
                                        [HANDLE, LPDWORD], BOOL)
    _SetHandleInformation = winexternal('SetHandleInformation',
                                        [HANDLE, DWORD, DWORD], BOOL)
Exemple #2
0
        PROCESS_SUSPEND_RESUME (0x0800)
        PROCESS_TERMINATE (0x0001)
        PROCESS_VM_OPERATION (0x0008)
        PROCESS_VM_READ (0x0010)
        PROCESS_VM_WRITE (0x0020)
        SYNCHRONIZE (0x00100000L)
        '''
        handle = _OpenProcess(*args)
        if handle == NULL_HANDLE:
            raise lastSavedWindowsError("OpenProcess")
        return handle
    TerminateProcess = winexternal(
        'TerminateProcess', [HANDLE, rffi.UINT], BOOL,
        save_err=rffi.RFFI_SAVE_LASTERROR)
    GenerateConsoleCtrlEvent = winexternal(
        'GenerateConsoleCtrlEvent', [DWORD, DWORD], BOOL,
        save_err=rffi.RFFI_SAVE_LASTERROR)
    _GetCurrentProcessId = winexternal(
        'GetCurrentProcessId', [], DWORD)
    def GetCurrentProcessId():
        return rffi.cast(lltype.Signed, _GetCurrentProcessId())

    _GetConsoleCP = winexternal('GetConsoleCP', [], DWORD)
    _GetConsoleOutputCP = winexternal('GetConsoleOutputCP', [], DWORD)
    def GetConsoleCP():
        return rffi.cast(lltype.Signed, _GetConsoleCP())
    def GetConsoleOutputCP():
        return rffi.cast(lltype.Signed, _GetConsoleOutputCP())

    _wenviron_items, _wgetenv, _wputenv = make_env_impls(win32=True)