forked from aniani/vim
Problem: win32: issues with stable python ABI Solution: if_python3,win32: Fix Python3 stable ABI There were some issues in current stable ABI implementation on Windows: * Python DLL name should be `python3.dll` instead of `python311.dll` and so on. (See: https://docs.python.org/3/c-api/stable.html) * Some non-stable API functions were used: - `_PyObject_NextNotImplemented` - `PyStdPrinter_Type` * `reset_stdin()` and `hook_py_exit()` didn't work with `python3.dll`. `python3.dll` is a special type of DLL called forwarder DLL. It just forwards the functions to other DLL (e.g. `python311.dll`). There were two issues regarding these functions: - `python3.dll` doesn't have import tables. This caused a crash in `get_imported_func_info()`. Add a check whether the specified DLL has an import table. - `reset_stdin()` and `hook_py_exit()` should be applied to the forwarded DLL (e.g. `python311.dll`), not to `python3.dll`. Check the export directory of `python3.dll` to find the forwarded DLL and apply the functions to it. closes: #13260 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Ken Takata <kentkt@csc.jp>
92 lines
3.4 KiB
C
92 lines
3.4 KiB
C
/* os_win32.c */
|
|
void mch_get_exe_name(void);
|
|
HINSTANCE vimLoadLib(const char *name);
|
|
int mch_is_gui_executable(void);
|
|
HINSTANCE find_imported_module_by_funcname(HINSTANCE hInst, const char *funcname);
|
|
void *get_dll_import_func(HINSTANCE hInst, const char *funcname);
|
|
void *hook_dll_import_func(HINSTANCE hInst, const char *funcname, const void *hook);
|
|
HINSTANCE get_forwarded_dll(HINSTANCE hInst);
|
|
int dyn_libintl_init(void);
|
|
void dyn_libintl_end(void);
|
|
void PlatformId(void);
|
|
void mch_setmouse(int on);
|
|
void mch_bevalterm_changed(void);
|
|
int test_mswin_event(char_u *event, dict_T *args);
|
|
void mch_update_cursor(void);
|
|
int mch_char_avail(void);
|
|
int mch_check_messages(void);
|
|
int mch_inchar(char_u *buf, int maxlen, long time, int tb_change_cnt);
|
|
void mch_init(void);
|
|
void mch_exit(int r);
|
|
int mch_check_win(int argc, char **argv);
|
|
void fname_case(char_u *name, int len);
|
|
int mch_get_user_name(char_u *s, int len);
|
|
void mch_get_host_name(char_u *s, int len);
|
|
long mch_get_pid(void);
|
|
int mch_process_running(long pid);
|
|
int mch_dirname(char_u *buf, int len);
|
|
long mch_getperm(char_u *name);
|
|
int mch_setperm(char_u *name, long perm);
|
|
void mch_hide(char_u *name);
|
|
int mch_ishidden(char_u *name);
|
|
int mch_isdir(char_u *name);
|
|
int mch_isrealdir(char_u *name);
|
|
int mch_mkdir(char_u *name);
|
|
int mch_rmdir(char_u *name);
|
|
int mch_is_hard_link(char_u *fname);
|
|
int mch_is_symbolic_link(char_u *name);
|
|
int mch_is_linked(char_u *fname);
|
|
int win32_fileinfo(char_u *fname, BY_HANDLE_FILE_INFORMATION *info);
|
|
int mch_writable(char_u *name);
|
|
int mch_can_exe(char_u *name, char_u **path, int use_path);
|
|
int mch_nodetype(char_u *name);
|
|
vim_acl_T mch_get_acl(char_u *fname);
|
|
void mch_set_acl(char_u *fname, vim_acl_T acl);
|
|
void mch_free_acl(vim_acl_T acl);
|
|
void mch_settmode(tmode_T tmode);
|
|
int mch_get_shellsize(void);
|
|
void mch_set_shellsize(void);
|
|
void mch_new_shellsize(void);
|
|
void mch_set_winsize_now(void);
|
|
int mch_call_shell(char_u *cmd, int options);
|
|
void win32_build_env(dict_T *env, garray_T *gap, int is_terminal);
|
|
void mch_job_start(char *cmd, job_T *job, jobopt_T *options);
|
|
char *mch_job_status(job_T *job);
|
|
job_T *mch_detect_ended_job(job_T *job_list);
|
|
int mch_signal_job(job_T *job, char_u *how);
|
|
void mch_clear_job(job_T *job);
|
|
void mch_set_normal_colors(void);
|
|
void mch_write(char_u *s, int len);
|
|
void mch_delay(long msec, int flags);
|
|
int mch_remove(char_u *name);
|
|
void mch_breakcheck(int force);
|
|
long_u mch_total_mem(int special);
|
|
int mch_wrename(WCHAR *wold, WCHAR *wnew);
|
|
int mch_rename(const char *pszOldFile, const char *pszNewFile);
|
|
char *default_shell(void);
|
|
int mch_access(char *n, int p);
|
|
int mch_open(const char *name, int flags, int mode);
|
|
FILE *mch_fopen(const char *name, const char *mode);
|
|
int mch_copy_file_attribute(char_u *from, char_u *to);
|
|
int get_cmd_argsW(char ***argvp);
|
|
void free_cmd_argsW(void);
|
|
void used_file_arg(char *name, int literal, int full_path, int diff_mode);
|
|
void set_alist_count(void);
|
|
void fix_arg_enc(void);
|
|
int mch_setenv(char *var, char *value, int x);
|
|
int vtp_printf(char *format, ...);
|
|
void get_default_console_color(int *cterm_fg, int *cterm_bg, guicolor_T *gui_fg, guicolor_T *gui_bg);
|
|
void control_console_color_rgb(void);
|
|
int use_vtp(void);
|
|
int is_term_win32(void);
|
|
int has_vtp_working(void);
|
|
int has_conpty_working(void);
|
|
int get_conpty_type(void);
|
|
int is_conpty_stable(void);
|
|
int get_conpty_fix_type(void);
|
|
void resize_console_buf(void);
|
|
char *GetWin32Error(void);
|
|
void stop_timeout(void);
|
|
volatile sig_atomic_t *start_timeout(long msec);
|
|
/* vim: set ft=c : */
|