mirror of
https://github.com/idapython/src
synced 2026-06-08 14:47:00 +00:00
IDAPython for IDA 7.7
This commit is contained in:
+7
-2
@@ -42,12 +42,12 @@ bool ext_api_t::load(qstring *errbuf)
|
||||
if ( lib_handle == nullptr )
|
||||
return false;
|
||||
|
||||
#define BIND_SYMBOL(Name) \
|
||||
#define BIND_SYMBOL_x(Name, fail) \
|
||||
do \
|
||||
{ \
|
||||
* (FARPROC *) &Name ## _ptr = GetProcAddress( \
|
||||
(HMODULE) lib_handle, TEXT(#Name)); \
|
||||
if ( Name ## _ptr == nullptr ) \
|
||||
if ( Name ## _ptr == nullptr && fail ) \
|
||||
{ \
|
||||
errbuf->sprnt("GetProcAddress(\"%s\") failed: %s", \
|
||||
#Name, qstrerror(-1)); \
|
||||
@@ -55,6 +55,9 @@ bool ext_api_t::load(qstring *errbuf)
|
||||
} \
|
||||
} while ( 0 )
|
||||
|
||||
#define BIND_SYMBOL(Name) BIND_SYMBOL_x(Name, true)
|
||||
#define BIND_SYMBOL_WEAK(Name) BIND_SYMBOL_x(Name, false)
|
||||
|
||||
BIND_SYMBOL(PyEval_SetTrace);
|
||||
BIND_SYMBOL(PyRun_SimpleStringFlags);
|
||||
BIND_SYMBOL(PyRun_StringFlags);
|
||||
@@ -66,6 +69,8 @@ bool ext_api_t::load(qstring *errbuf)
|
||||
BIND_SYMBOL(PyFunction_New);
|
||||
BIND_SYMBOL(PyFunction_GetCode);
|
||||
BIND_SYMBOL(_PyLong_AsByteArray);
|
||||
BIND_SYMBOL_WEAK(PyEval_ThreadsInitialized);
|
||||
BIND_SYMBOL_WEAK(PyEval_InitThreads);
|
||||
|
||||
#undef BIND_SYMBOL
|
||||
|
||||
|
||||
Reference in New Issue
Block a user