本文整理汇总了C++中FindModule函数的典型用法代码示例。如果您正苦于以下问题:C++ FindModule函数的具体用法?C++ FindModule怎么用?C++ FindModule使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FindModule函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: params
void SystemWrapper::CMD_UnloadModule(char *cmdLine)
{
TokenLine params(cmdLine);
if (params.CountToken() < 2) {
Printf("Syntax: unloadmodule <module> [<name>]\n");
return;
}
ISystemModule *module = nullptr;
switch (params.CountToken()) {
case 2:
module = FindModule(params.GetToken(1));
break;
case 3:
module = FindModule(params.GetToken(1), params.GetToken(2));
break;
}
if (!module) {
Printf("Module not found.\n");
return;
}
RemoveModule(module);
}
开发者ID:Chuvi-w,项目名称:rehlds,代码行数:25,代码来源:SystemWrapper.cpp
示例2: LoadModule
Module* VirtualMachine::LoadModule(const ModuleName &name, bool noreflection, bool debug, Module *hint)
{
// Check for an already loaded module.
// TODO: Add security.
LoadedModulesByName::iterator it = loadedModulesByName.find(name.name);
if(it != loadedModulesByName.end())
return it->second;
// Use the filename if present
if(!name.filename.empty())
return LoadModule(name.filename, debug);
// Try to load the module.
std::string baseName = name.name + ".cbm";
std::string fileName;
if(FindModule(baseName, &fileName, hint))
return LoadModule(fileName, noreflection, debug);
// Try to load embedded module.
// ELF module.
baseName = "lib" + name.name + ".so";
if(FindModule(baseName, &fileName, hint))
return LoadModule(fileName, noreflection, debug);
// PE module.
baseName = name.name + ".dll";
if(FindModule(baseName, &fileName, hint))
return LoadModule(fileName, noreflection, debug);
return NULL;
}
开发者ID:ronsaldo,项目名称:chela,代码行数:31,代码来源:VirtualMachine.cpp
示例3: GetModuleInformation
BOOL
WINAPI
GetModuleInformation(
HANDLE hProcess,
HMODULE hModule,
LPMODULEINFO lpmodinfo,
DWORD cb
)
{
LDR_DATA_TABLE_ENTRY LdrEntryData;
MODULEINFO modinfo;
if (cb < sizeof(MODULEINFO)) {
SetLastError( ERROR_INSUFFICIENT_BUFFER );
return(FALSE);
}
if (!FindModule(hProcess, hModule, &LdrEntryData)) {
return(0);
}
modinfo.lpBaseOfDll = (PVOID) hModule;
modinfo.SizeOfImage = LdrEntryData.SizeOfImage;
modinfo.EntryPoint = LdrEntryData.EntryPoint;
try {
*lpmodinfo = modinfo;
}
except (EXCEPTION_EXECUTE_HANDLER) {
SetLastError( RtlNtStatusToDosError( GetExceptionCode() ) );
return(FALSE);
}
return(TRUE);
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:35,代码来源:module.c
示例4: ASSERT_CHECK_RET
LWRESULT Cx_PluginLoader::RegisterPlugin(const Ix_Module* pModule)
{
ASSERT_CHECK_RET(LWDP_MODULE_LOG, LWDP_PARAMETER_ERROR, (pModule), "RegisterPlugin Para Error");
if (FindModule(pModule->GetModuleMODID()) >= 0)
{
return false;
}
MODULE moduleInfo;
moduleInfo.modid = pModule->GetModuleMODID();
moduleInfo.module = (Ix_Module *)pModule;
moduleInfo.owned = (pModule->GetModuleInstance())? true: false;
moduleInfo.inited = false;
int32_ moduleIndex = GetPluginIndex(pModule->GetModuleMODID());
if (moduleIndex >= 0)
{
ASSERT_CHECK_RET(LWDP_MODULE_LOG, false, (m_modules[moduleIndex] != NULL), "Get Plugin Index Error");
*m_modules[moduleIndex] = moduleInfo;
}
else
{
moduleIndex = m_modules.size();
MODULE* module = new MODULE;
*module = moduleInfo;
m_modules.push_back(module);
}
RegisterClassEntryTable(moduleIndex);
return LWDP_OK;
}
开发者ID:dangermanGls,项目名称:Lwdp,代码行数:32,代码来源:Cx_PluginLoader.cpp
示例5: GetFixedFuncAddr
//////////////////////////////////////////////////////////////////////////
//
// ƯÁ¤ ¹ÙÀ̳ʸ® ÆÐÄ¡
//
//////////////////////////////////////////////////////////////////////////
BOOL CRawHookMgr::preHook(LPVOID pfnOld, unsigned char* cBuff, size_t copysize)
{
pfnOld = GetFixedFuncAddr(pfnOld);
if(NULL == pfnOld) return FALSE;
// ÇÔ¼ö°¡ µé¾îÀÖ´Â ¸ðµâÀ» ¾Ë¾Æ³½´Ù
HMODULE hModule = HandleFromAddress(pfnOld);
if(NULL == hModule) return FALSE;
// ÇöÀç °ü¸®µÇ°í ÀÖ´Â ¸ðµâµé Áß ÀÌ ¸ðµâÀÌ Àִ ã¾Æº¸°í
CRawHookedModule* pModule = FindModule(hModule);
// ¾øÀ¸¸é »õ ¸ðµâ µî·Ï
if( NULL == pModule )
{
pModule = new CRawHookedModule();
if( pModule->Init( hModule ) == FALSE )
{
delete pModule;
return FALSE;
}
m_listModules.push_back(pModule);
}
return pModule->preHook(pfnOld, cBuff, copysize);
}
开发者ID:CodeGenerater,项目名称:araltrans02,代码行数:31,代码来源:RawHookMgr.cpp
示例6: VoiceUnregister
static INT_PTR VoiceUnregister(WPARAM wParam, LPARAM lParam)
{
char *moduleName = (char *) wParam;
if (moduleName == NULL || moduleName[0] == 0)
return -1;
VoiceProvider *module = FindModule(moduleName);
if (module == NULL)
return -2;
for(int i = calls.getCount() - 1; i >= 0; --i)
{
VoiceCall *call = &calls[i];
if (call->module == module)
{
call->Drop();
call->SetState(VOICE_STATE_ENDED);
calls.remove(i);
}
}
modules.remove(module);
if (hwnd_frame != NULL)
PostMessage(hwnd_frame, WMU_REFRESH, 0, 0);
return 0;
}
开发者ID:Robyer,项目名称:miranda-plugins,代码行数:30,代码来源:voiceservice.cpp
示例7: XN_VALIDATE_INPUT_PTR
XnStatus XnDeviceBase::UnregisterFromPropertyChange(const XnChar* Module, const XnChar* PropertyName, XnCallbackHandle hCallback)
{
XnStatus nRetVal = XN_STATUS_OK;
XN_VALIDATE_INPUT_PTR(Module);
XN_VALIDATE_INPUT_PTR(PropertyName);
XN_VALIDATE_INPUT_PTR(hCallback);
XnPropertyCallback* pRealCookie = (XnPropertyCallback*)hCallback;
XnDeviceModule* pModule;
nRetVal = FindModule(Module, &pModule);
XN_IS_STATUS_OK(nRetVal);
// first unregister it from property
nRetVal = pModule->UnregisterFromOnPropertyValueChanged(PropertyName, pRealCookie->hCallback);
XN_IS_STATUS_OK(nRetVal);
XnValue val = pRealCookie;
XnList::Iterator it = m_PropertyCallbacks.Find(val);
if (it != m_PropertyCallbacks.end())
{
m_PropertyCallbacks.Remove(it);
}
// now free the memory
XN_DELETE(pRealCookie);
return (XN_STATUS_OK);
}
开发者ID:0pascal0,项目名称:SensorKinect,代码行数:30,代码来源:XnDeviceBase.cpp
示例8: FindModule
XnStatus XnDeviceBase::RegisterToPropertyChange(const XnChar* Module, const XnChar* PropertyName, XnDeviceOnPropertyChangedEventHandler Handler, void* pCookie, XnCallbackHandle* phCallback)
{
XnStatus nRetVal = XN_STATUS_OK;
XnDeviceModule* pModule;
nRetVal = FindModule(Module, &pModule);
XN_IS_STATUS_OK(nRetVal);
XnPropertyCallback* pRealCookie;
XN_VALIDATE_NEW(pRealCookie, XnPropertyCallback, GetDeviceHandle(), Module, PropertyName, Handler, pCookie);
// register
nRetVal = pModule->RegisterForOnPropertyValueChanged(PropertyName, PropertyValueChangedCallback, pRealCookie, &pRealCookie->hCallback);
if (nRetVal != XN_STATUS_OK)
{
XN_DELETE(pRealCookie);
return (nRetVal);
}
m_PropertyCallbacks.AddLast(pRealCookie);
*phCallback = pRealCookie;
return (XN_STATUS_OK);
}
开发者ID:0pascal0,项目名称:SensorKinect,代码行数:25,代码来源:XnDeviceBase.cpp
示例9: GD_ASSERT
Bool ModuleManager::LoadModule( const Char* pModuleName, const Char* pModuleDir )
{
GD_ASSERT(pModuleName);
GD_ASSERT(pModuleDir);
Char fullPath[260];
if( IsModuleLoaded(pModuleName) )
return true;
strcpy(fullPath, pModuleDir);
strcat(fullPath, pModuleName);
Handle libHandle = Core::OpenLibrary( fullPath );
if( !libHandle )
throw ModuleNotFoundException( pModuleName, Here );
Module* module = const_cast<Module*>(FindModule(pModuleName));
if( !module )
throw ModuleNotRegisteredException( pModuleName, Here );
module->mHandle = libHandle;
module->mDynamicLoad = true;
return true;
}
开发者ID:SebastienLussier,项目名称:Gamedesk,代码行数:26,代码来源:ModuleManager.cpp
示例10: FindModule
void Cx_ObjectFactory::ReleaseModule(HMODULE hModule)
{
int index = FindModule(hModule);
ASSERT(index >= 0);
MODULE* item = m_modules[index];
CLSIDS::const_iterator it = item->clsids.begin();
for (; it != item->clsids.end(); ++it)
{
CLSMAP::iterator mit = m_clsmap.find(it->str());
if (mit != m_clsmap.end())
{
m_clsmap.erase(mit);
}
}
if (item->owned)
{
FreeLibrary(hModule);
}
// don't remove: m_modules.erase(m_modules.begin() + index);
item->hdll = NULL;
item->module = NULL;
item->clsids.clear();
}
开发者ID:1070094289,项目名称:x3c,代码行数:27,代码来源:Cx_ObjectFactory.cpp
示例11: NOTIFY_DEBUG_MESSAGE
//////////////////////////////////////////////////////////////////////////
//
// ƯÁ¤ ÇÔ¼ö ÈÄÅ·
//
//////////////////////////////////////////////////////////////////////////
BOOL CRawHookMgr::Hook(LPVOID pfnOld, LPVOID pfnNew, BOOL bWriteCallCode, INT nHookType)
{
NOTIFY_DEBUG_MESSAGE(_T("CRawHookMgr:Hook: called, pfnOld=%p, pfnNew=%p, bWrite=%s\n"), pfnOld, pfnNew, (bWriteCallCode?_T("TRUE"):_T("FALSE")));
pfnOld = GetFixedFuncAddr(pfnOld);
if(NULL == pfnOld) return FALSE;
// ÇÔ¼ö°¡ µé¾îÀÖ´Â ¸ðµâÀ» ¾Ë¾Æ³½´Ù
HMODULE hModule = HandleFromAddress(pfnOld);
if(NULL == hModule) return FALSE;
// ÇöÀç °ü¸®µÇ°í ÀÖ´Â ¸ðµâµé Áß ÀÌ ¸ðµâÀÌ Àִ ã¾Æº¸°í
CRawHookedModule* pModule = FindModule(hModule);
// ¾øÀ¸¸é »õ ¸ðµâ µî·Ï
if( NULL == pModule )
{
pModule = new CRawHookedModule();
if( pModule->Init( hModule ) == FALSE )
{
delete pModule;
return FALSE;
}
m_listModules.push_back(pModule);
}
// ¸ðµâ°´Ã¼¿¡ ÀÌ ÇÔ¼ö¸¦ ÈÄÅ·Ç϶ó Áö½Ã
if(nHookType == ATHOOKTYPE_SOURCE) return pModule->Hook2(pfnOld, pfnNew, bWriteCallCode);
else return pModule->Hook(pfnOld, pfnNew, bWriteCallCode);
}
开发者ID:CodeGenerater,项目名称:araltrans02,代码行数:35,代码来源:RawHookMgr.cpp
示例12: InjectDLL
static bool InjectDLL(HANDLE process, const char* dllname)
{
SIZE_T bytesRet = 0;
DWORD oldProtect = 0;
LPVOID remote_addr = NULL;
HANDLE hThread = NULL;
size_t len = strlen(dllname) + 1;
remote_addr = ::VirtualAllocEx(process, 0, 1024, MEM_COMMIT|MEM_RESERVE, PAGE_EXECUTE_READWRITE);
if(remote_addr==NULL) { return false; }
::VirtualProtectEx(process, remote_addr, len, PAGE_EXECUTE_READWRITE, &oldProtect);
::WriteProcessMemory(process, remote_addr, dllname, len, &bytesRet);
::VirtualProtectEx(process, remote_addr, len, oldProtect, &oldProtect);
HMODULE kernel32 = ::GetModuleHandleA(KernelDLLFileName);
HMODULE tkernel32 = FindModule(process, KernelDLLFileName);
void *loadlib = ::GetProcAddress(kernel32, "LoadLibraryA");
void *entrypoint = (void*) ((size_t)tkernel32+((size_t)loadlib-(size_t)kernel32));
hThread = ::CreateRemoteThread(process, NULL, 0, (LPTHREAD_START_ROUTINE)entrypoint, remote_addr, 0, NULL);
// デバッガがスレッド止めてるので以下の Wait は永久停止を招く
//::WaitForSingleObject(hThread, INFINITE);
//::VirtualFreeEx(process, remote_addr, 0, MEM_RELEASE);
return hThread!=nullptr;
}
开发者ID:WilliamChao,项目名称:MemoryLeakBuster,代码行数:25,代码来源:mlbInjector.cpp
示例13: FindModule
InterModuleData Global::ModuleInternalApiCall(const String& module, int method, void* arg) {
Module* mod = FindModule(module);
if (mod == NULL)
return InterModuleData();
void* data = mod->InternalApiCall(method, arg);
return InterModuleData(data, mod, method);
};
开发者ID:schoentoon,项目名称:tripping-cyril,代码行数:7,代码来源:Global.cpp
示例14: EnumerateThreads
bool Injector::Inject(DWORD processID)
{
HANDLE process = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, processID);
if(!process) {
return false;
}
std::vector<HANDLE> threads;
EnumerateThreads(process, [&](DWORD tid){
if(HANDLE thread=::OpenThread(THREAD_ALL_ACCESS, FALSE, tid)) {
::SuspendThread(thread);
threads.push_back(thread);
}
});
{
HMODULE kernel32 = ::GetModuleHandleA(KernelDLLFileName);
HMODULE tkernel32 = FindModule(process, KernelDLLFileName);
void *base = ::GetProcAddress(kernel32, "SetUnhandledExceptionFilter");
void *tbase = (void*) ((size_t)tkernel32+((size_t)base-(size_t)kernel32));
SetThreadTrap(process, tbase);
}
std::for_each(threads.begin(), threads.end(), [](HANDLE thread){
::ResumeThread(thread);
});
std::string dll_path = std::getenv("USERPROFILE");
dll_path += AddInDir;
dll_path += MLBDllFileName;
bool result = InjectDLL(process, dll_path.c_str());
::CloseHandle(process);
return result;
}
开发者ID:WilliamChao,项目名称:MemoryLeakBuster,代码行数:33,代码来源:mlbInjector.cpp
示例15: FindModule
bool CModules::UnloadModule(const CString& sModule, CString& sRetMsg) {
CString sMod = sModule; // Make a copy incase the reference passed in is from CModule::GetModName()
CModule* pModule = FindModule(sMod);
sRetMsg = "";
if (!pModule) {
sRetMsg = "Module [" + sMod + "] not loaded.";
return false;
}
bool bSuccess;
GLOBALMODULECALL(OnModuleUnloading(pModule, bSuccess, sRetMsg), pModule->GetUser(), NULL, return bSuccess);
ModHandle p = pModule->GetDLL();
if (p) {
delete pModule;
for (iterator it = begin(); it != end(); ++it) {
if (*it == pModule) {
erase(it);
break;
}
}
dlclose(p);
sRetMsg = "Module [" + sMod + "] unloaded";
return true;
}
sRetMsg = "Unable to unload module [" + sMod + "]";
return false;
}
开发者ID:BGCX261,项目名称:znc-msvc-svn-to-git,代码行数:34,代码来源:Modules.cpp
示例16: FindModule
//---------------------------------------------------------------------------
void __fastcall TGUIConfiguration::FreeResourceModule(HANDLE Instance)
{
TLibModule * MainModule = FindModule(HInstance);
if ((unsigned)Instance != MainModule->Instance)
{
FreeLibrary(static_cast<HMODULE>(Instance));
}
}
开发者ID:seebigsea,项目名称:winscp,代码行数:9,代码来源:GUIConfiguration.cpp
示例17: FindModule
Renderer* Plugin::FindRenderer(const char* rendererName)
{
Module* module = FindModule(eMT_Renderer, rendererName);
if( module )
{
return (Renderer*)module->mModulePointer;
}
return 0;
}
开发者ID:RonOHara-GG,项目名称:PTEngine,代码行数:9,代码来源:Plugin.cpp
示例18: a_get_module_mask
A_STATUS a_get_module_mask(A_CHAR *module_name, A_UINT32 *pMask)
{
ATH_DEBUG_MODULE_DBG_INFO *pInfo = FindModule(module_name);
if (NULL == pInfo) {
return A_ERROR;
}
*pMask = pInfo->CurrentMask;
return A_OK;
}
开发者ID:ArthySundaram,项目名称:firstrepo,代码行数:11,代码来源:common_drv.c
示例19: FindModule
//_____________________________________________________________________________
THaAnalysisObject::EStatus THaReacPointFoil::Init( const TDatime& run_time )
{
// Initialize the module.
// Locate the spectrometer apparatus named in fSpectroName and save
// pointer to it.
// Standard initialization. Calls this object's DefineVariables().
if( THaPhysicsModule::Init( run_time ) != kOK )
return fStatus;
fSpectro = static_cast<THaSpectrometer*>
( FindModule( fSpectroName.Data(), "THaSpectrometer"));
if( !fSpectro )
return fStatus;
if( fBeamName.Length() > 0 )
fBeam = static_cast<THaBeam*>( FindModule( fBeamName.Data(), "THaBeam") );
return fStatus;
}
开发者ID:hansenjo,项目名称:analyzer,代码行数:21,代码来源:THaReacPointFoil.C
示例20: a_set_module_mask
A_STATUS a_set_module_mask(A_CHAR *module_name, A_UINT32 Mask)
{
ATH_DEBUG_MODULE_DBG_INFO *pInfo = FindModule(module_name);
if (NULL == pInfo) {
return A_ERROR;
}
pInfo->CurrentMask = Mask;
A_PRINTF("Module %s, new mask: 0x%8.8X \n",module_name,pInfo->CurrentMask);
return A_OK;
}
开发者ID:ArthySundaram,项目名称:firstrepo,代码行数:12,代码来源:common_drv.c
注:本文中的FindModule函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论