#include <apicache.h>
Static Public Methods | |
bool | GetFullApiName (std::string &out, const char *dll, int ordinal) |
Return api name given dll and ordinal return false if not found change string passed if found. More... | |
Static Private Attributes | |
const int | numCachedDlls = 4 |
const DllFunctions | cachedDlls [] |
|
Return api name given dll and ordinal return false if not found change string passed if found.
Definition at line 36 of file apicache.cpp. References cachedDlls, ApiCache::DllFunctions::count, ApiCache::DllFunctions::name, ApiCache::DllFunctions::names, numCachedDlls, and ApiCache::DllFunctions::ords. Referenced by SymbolsAddImport(), and PeFile::WriteImport().
00037 { 00038 // find dll 00039 // FIXME do a best search, dll should be ordered 00040 const DllFunctions *dll; 00041 for(dll = cachedDlls; ; ) 00042 { 00043 if (stricmp(dll->name,dllName)==0) 00044 break; 00045 ++dll; 00046 if (dll == (cachedDlls + numCachedDlls) ) 00047 return false; 00048 } 00049 00050 // find function 00051 const int *pend = dll->ords + dll->count; 00052 const int *p = lower_bound(dll->ords,pend,ordinal); 00053 if ( pend == p || *p != ordinal) 00054 return false; 00055 out = dll->names[p-dll->ords]; 00056 return true; 00057 } |
|
Initial value: { { "odbc32", 181, ords_odbc32, names_odbc32 }, { "oleaut32", 289, ords_oleaut32, names_oleaut32 }, { "ws2_32", 107, ords_ws2_32, names_ws2_32 }, { "wsock32", 81, ords_wsock32, names_wsock32 }, } Definition at line 436 of file apiexp.h. Referenced by GetFullApiName(). |
|
Definition at line 443 of file apiexp.h. Referenced by GetFullApiName(). |