29 WCHAR filename_w[32768];
34 if (!MultiByteToWideChar(CP_UTF8,
43 lib->
handle = LoadLibraryExW(filename_w,
NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
54 LocalFree((
void*)lib->
errmsg);
69 return uv__dlerror(lib,
"", *ptr ? 0 : GetLastError());
79 static const CHAR fallback_error[] =
"error: %1!d!";
81 args[0] = (DWORD_PTR) errorno;
83 FormatMessageA(FORMAT_MESSAGE_FROM_STRING |
84 FORMAT_MESSAGE_ARGUMENT_ARRAY |
85 FORMAT_MESSAGE_ALLOCATE_BUFFER,
106 res = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
107 FORMAT_MESSAGE_FROM_SYSTEM |
108 FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, errorno,
109 MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
113 GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND)) {
114 res = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
115 FORMAT_MESSAGE_FROM_SYSTEM |
116 FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, errorno,
120 if (res && errorno == ERROR_BAD_EXE_FORMAT && strstr(lib->
errmsg,
"%1")) {
124 res = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
125 FORMAT_MESSAGE_ARGUMENT_ARRAY |
126 FORMAT_MESSAGE_FROM_STRING,
128 0, 0, (LPSTR) &lib->
errmsg, 0, (va_list*) &
arg);
static const char * arg(RzAnalysis *a, csh *handle, cs_insn *insn, char *buf, int n)
static struct sockaddr static addrlen static backlog const void msg
_W64 unsigned int uintptr_t
const char * uv_dlerror(const uv_lib_t *lib)
int uv_dlopen(const char *filename, uv_lib_t *lib)
void uv_dlclose(uv_lib_t *lib)
int uv_dlsym(uv_lib_t *lib, const char *name, void **ptr)
static void uv__format_fallback_error(uv_lib_t *lib, int errorno)
static int uv__dlerror(uv_lib_t *lib, const char *filename, DWORD errorno)
#define ERROR_MUI_FILE_NOT_FOUND