• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetModuleHandleEx函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetModuleHandleEx函数的典型用法代码示例。如果您正苦于以下问题:C++ GetModuleHandleEx函数的具体用法?C++ GetModuleHandleEx怎么用?C++ GetModuleHandleEx使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetModuleHandleEx函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: OpenProcess

int CSDShellExt::GetExtensionDirectory(wchar_t *path) {
    HMODULE moduleHandle = NULL;
    HANDLE processHandle =  NULL;

    processHandle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, false, GetCurrentProcessId());

    if(processHandle == NULL) {
        //
        // failed to get process handle
        //
        return 0;
    }

    if(GetModuleHandleEx(0, L"SDShellNative.dll", &moduleHandle) == 0) {
        if(GetModuleHandleEx(0, L"SDShellNative32.dll", &moduleHandle) == 0) {
            //
            // try get for 64 bit version instead
            //
            if(GetModuleHandleEx(0, L"SDShellNative64.dll", &moduleHandle) == 0) {
                //
                // failed
                //
                CloseHandle(processHandle);
                return 0;
            }
        }
    }

    //
    // get the file path
    //
    if(GetModuleFileNameEx(processHandle, moduleHandle, path, MAX_PATH) == 0) {
        //
        // failed
        //
        CloseHandle(processHandle);
        return 0;
    }

    //
    // extract directory
    //
    int length = wcslen(path);

    for(int i = length - 1;i > 0;i--) {
        if(path[i] == '\\') {
            //
            // end the string here
            //
            path[i + 1] = 0;
            break;
        }
    }

    CloseHandle(processHandle);
    return 1;
}
开发者ID:datascicat,项目名称:SecureDelete,代码行数:57,代码来源:SDShellExt.cpp


示例2: strcat

void ofxPS3::StartSettingsDialog()
{
   HWND        hwnd;
   MSG         msg;
   WNDCLASS    wndclass;
   char        szAppName[64] = "PS3 Eye settings: ";
   strcat(szAppName,GUIDToString(guid).c_str());
   wndclass.style         = 0;
   wndclass.lpfnWndProc   = ofxPS3::WndProc;
   wndclass.cbClsExtra    = 0;
   wndclass.cbWndExtra    = 0;
   HMODULE hInstance;
   GetModuleHandleEx(0,NULL,&hInstance);
   wndclass.hInstance     = hInstance;
   wndclass.hIcon         = LoadIconA(hInstance, szAppName);
   wndclass.hCursor       = LoadCursor(NULL, IDC_ARROW);
   wndclass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
   //wndclass.lpszMenuName  = szAppName;
   //wndclass.lpszClassName = szAppName;
   RegisterClass(&wndclass);

   InitCommonControls(); 

   hwnd = CreateWindowA(szAppName,
      szAppName,
      DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE,
	  0, 0, 465, cameraPixelMode ? 410 : 110,
      NULL, NULL, hInstance, 0);
   SetWindowLongPtr(hwnd,GWLP_USERDATA,(LONG_PTR)(this));
   while (GetMessage(&msg, NULL, 0, 0)) 
   {
      TranslateMessage(&msg);
      DispatchMessage(&msg);
   }
}
开发者ID:kitronyx,项目名称:ccvs,代码行数:35,代码来源:ofxPS3.cpp


示例3: WAI_PREFIX

WAI_NOINLINE
WAI_FUNCSPEC
int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length)
{
  HMODULE module;
  int length = -1;

#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable: 4054)
#endif
  if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (LPCTSTR)
  #if defined(_MSC_VER)
  _ReturnAddress()
  #else
  __builtin_extract_return_addr(__builtin_return_address(0))
  #endif
  , &module))
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
  {
    length = WAI_PREFIX(getModulePath_)(module, out, capacity, dirname_length);
  }

  return length;
}
开发者ID:RobertLeahy,项目名称:whereami,代码行数:27,代码来源:whereami.c


示例4: QueryRecycleBinThreadProc

DWORD WINAPI QueryRecycleBinThreadProc(void* pParam)
{
	// NOTE: Do not use CRT functions (since thread was created with CreateThread())!

	SHQUERYRBINFO rbi = {0};
	rbi.cbSize = sizeof(SHQUERYRBINFO);
	SHQueryRecycleBin(NULL, &rbi);
	g_BinCount = (double)rbi.i64NumItems;
	g_BinSize = (double)rbi.i64Size;

	EnterCriticalSection(&g_CriticalSection);
	HMODULE module = NULL;
	if (g_FreeInstanceInThread)
	{
		DWORD flags = GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT;
		GetModuleHandleEx(flags, (LPCWSTR)DllMain, &module);
		g_FreeInstanceInThread = false;
	}

	g_Thread = false;
	LeaveCriticalSection(&g_CriticalSection);

	if (module)
	{
		// Decrement the ref count and possibly unload the module if this is
		// the last instance.
		FreeLibraryAndExitThread(module, 0);
	}

	return 0;
}
开发者ID:JamesAC,项目名称:rainmeter,代码行数:31,代码来源:RecycleManager.cpp


示例5: global_symbols_link

    static dynamic_link_handle global_symbols_link( const wchar_t* library, const dynamic_link_descriptor descriptors[], size_t required ) {
        ::tbb::internal::suppress_unused_warning( library );
        dynamic_link_handle library_handle;
#if _WIN32
        if ( GetModuleHandleEx( 0, library, &library_handle ) ) {
            if ( resolve_symbols( library_handle, descriptors, required ) )
                return library_handle;
            else
                FreeLibrary( library_handle );
        }
#else /* _WIN32 */
    #if !__TBB_DYNAMIC_LOAD_ENABLED /* only __TBB_WEAK_SYMBOLS_PRESENT is defined */
        if ( !dlopen ) return 0;
    #endif /* !__TBB_DYNAMIC_LOAD_ENABLED */
        library_handle = dlopen( NULL, RTLD_LAZY );
    #if !__ANDROID__
        // On Android dlopen( NULL ) returns NULL if it is called during dynamic module initialization.
        LIBRARY_ASSERT( library_handle, "The handle for the main program is NULL" );
    #endif
        // Check existence of the first symbol only, then use it to find the library and load all necessary symbols.
        pointer_to_handler handler;
        dynamic_link_descriptor desc;
        desc.name = descriptors[0].name;
        desc.handler = &handler;
        if ( resolve_symbols( library_handle, &desc, 1 ) )
            return pin_symbols( library_handle, desc, descriptors, required );
#endif /* _WIN32 */
        return 0;
    }
开发者ID:rpgfreak128,项目名称:LoLUpdater,代码行数:29,代码来源:dynamic_link.cpp


示例6: loadPathHack

void loadPathHack (char buf[256], void *addr)
{
  HMODULE h;
  size_t sz;
  DWORD k;
  BOOL brc;
  char libBuf[1024];

  buf[0] = '\0';
  brc = GetModuleHandleEx (GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
                           GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
                           (LPCTSTR)addr, &h);
  if (brc) {  /* OK: got a handle */
    k = GetModuleFileName (h, libBuf, sizeof(libBuf));
    if (k > 0) {                /* success */
      /* do some trimming later */
      sz = strlen(libBuf);
      if (sz <= 255) {
        memcpy (buf, libBuf, sz);
        buf[sz] = '\0';
      }
    }
  }

  return;
} /* loadPathHack */
开发者ID:lolow,项目名称:gdxtools,代码行数:26,代码来源:loadpathutil.c


示例7: Finalize

PLUGIN_EXPORT void Finalize(void* data)
{
	Measure* measure = (Measure*)data;

	std::unique_lock<std::recursive_mutex> lock(measure->mutex);

	if (measure->threadActive)
	{
		// Increment ref count of this module so that it will not be
		// unloaded prior to thread completion.
		DWORD flags = GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS;
		HMODULE module;
		GetModuleHandleEx(flags, (LPCWSTR)DllMain, &module);

		if (measure->hProc != INVALID_HANDLE_VALUE &&
			!TerminateApp(measure->hProc, measure->dwPID, (measure->state == SW_HIDE)))
		{
			measure->value = 105.0f;
			RmLogF(measure->rm, LOG_ERROR, err_Terminate, measure->program.c_str());	// Could not terminate process (very rare!)
		}

		// Tell the thread to perform any cleanup
		measure->threadActive = false;
		return;
	}

	lock.unlock();
	delete measure;
}
开发者ID:NighthawkSLO,项目名称:rainmeter,代码行数:29,代码来源:PluginRunCommand.cpp


示例8: hookDXGI

/// @param hDXGI must be a valid module handle.
void hookDXGI(HMODULE hDXGI, bool preonly) {
	wchar_t modulename[MODULEFILEPATH_BUFLEN];
	GetModuleFileNameW(NULL, modulename, ARRAY_NUM_ELEMENTS(modulename));
	ods("DXGI: hookDXGI in App '%ls'", modulename);

	// Add a ref to ourselves; we do NOT want to get unloaded directly from this process.
	HMODULE hTempSelf = NULL;
	GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, reinterpret_cast<LPCTSTR>(&hookDXGI), &hTempSelf);

	bHooked = true;

	// Can we use the prepatch data?
	GetModuleFileNameW(hDXGI, modulename, ARRAY_NUM_ELEMENTS(modulename));
	if (_wcsicmp(dxgi->wcFileName, modulename) == 0) {
		// The module seems to match the one we prepared d3dd for.

		unsigned char *raw = (unsigned char *) hDXGI;
		HookPresentRaw((voidFunc)(raw + dxgi->offsetPresent));
		HookResizeRaw((voidFunc)(raw + dxgi->offsetResize));

	} else if (! preonly) {
		ods("DXGI: Interface changed, can't rawpatch. Current: %ls ; Previously: %ls", modulename, dxgi->wcFileName);
	} else {
		bHooked = false;
	}
}
开发者ID:MumbleTransifexBot,项目名称:mumble,代码行数:27,代码来源:dxgi.cpp


示例9: defined

bool Renderer::initializeCompiler()
{
#if defined(ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES)
    // Find a D3DCompiler module that had already been loaded based on a predefined list of versions.
    static TCHAR* d3dCompilerNames[] = ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES;

    for (size_t i = 0; i < ArraySize(d3dCompilerNames); ++i)
    {
        if (GetModuleHandleEx(0, d3dCompilerNames[i], &mD3dCompilerModule))
        {
            break;
        }
    }
#else
    // Load the version of the D3DCompiler DLL associated with the Direct3D version ANGLE was built with.
    mD3dCompilerModule = LoadLibrary(D3DCOMPILER_DLL);
#endif  // ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES

    if (!mD3dCompilerModule)
    {
        ERR("No D3D compiler module found - aborting!\n");
        return false;
    }

    mD3DCompileFunc = reinterpret_cast<pCompileFunc>(GetProcAddress(mD3dCompilerModule, "D3DCompile"));
    ASSERT(mD3DCompileFunc);

    return mD3DCompileFunc != NULL;
}
开发者ID:ConradIrwin,项目名称:gecko-dev,代码行数:29,代码来源:Renderer.cpp


示例10: MyLoadLibraryA

static HMODULE WINAPI
MyLoadLibraryA(LPCSTR lpLibFileName)
{
    if (VERBOSITY >= 2) {
        debugPrintf("%s(\"%s\")\n", __FUNCTION__, lpLibFileName);
    }

    if (VERBOSITY > 0) {
        const char *szBaseName = getBaseName(lpLibFileName);
        for (unsigned i = 0; i < numReplacements; ++i) {
            if (stricmp(szBaseName, replacements[i].szMatchModule) == 0) {
                debugPrintf("%s(\"%s\")\n", __FUNCTION__, lpLibFileName);
#ifdef __GNUC__
                void *caller = __builtin_return_address (0);

                HMODULE hModule = 0;
                BOOL bRet = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
                                              (LPCTSTR)caller,
                                              &hModule);
                assert(bRet);
                char szCaller[256];
                DWORD dwRet = GetModuleFileNameA(hModule, szCaller, sizeof szCaller);
                assert(dwRet);
                debugPrintf("  called from %s\n", szCaller);
#endif
                break;
            }
        }
    }

    return MyLoadLibrary(lpLibFileName);
}
开发者ID:hadrien-psydk,项目名称:apitrace,代码行数:32,代码来源:injectee.cpp


示例11: GetFnOffsetInModule

int GetFnOffsetInModule(voidFunc fnptr, wchar_t *refmodulepath, unsigned int refmodulepathLen, const std::string &logPrefix, const std::string &fnName) {

	HMODULE hModule = NULL;

	if (! GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (char *) fnptr, &hModule)) {
		ods((logPrefix + ": Failed to get module for " + fnName).c_str());
		return -1;
	}

	const bool bInit = refmodulepath[0] == '\0';
	if (bInit) {
		GetModuleFileNameW(hModule, refmodulepath, refmodulepathLen);
	} else {
		wchar_t modulename[MODULEFILEPATH_BUFLEN];
		GetModuleFileNameW(hModule, modulename, ARRAY_NUM_ELEMENTS(modulename));
		if (_wcsicmp(modulename, refmodulepath) != 0) {
			ods((logPrefix + ": " + fnName + " functions module path does not match previously found. Now: '%ls', Previously: '%ls'").c_str(), modulename, refmodulepath);
			return -2;
		}
	}

	unsigned char *fn = reinterpret_cast<unsigned char *>(fnptr);
	unsigned char *base = reinterpret_cast<unsigned char *>(hModule);
	unsigned long off = static_cast<unsigned long>(fn - base);

	// XXX: convert this function to use something other than int.
	// Issue mumble-voip/mumble#1924.
	if (off > static_cast<unsigned long>(std::numeric_limits<int>::max())) {
		ods("Internal overlay error: GetFnOffsetInModule() offset greater than return type can hold.");
		return -1;
	}

	return static_cast<int>(off);
}
开发者ID:CimpianAlin,项目名称:mumble,代码行数:34,代码来源:lib.cpp


示例12: GetModuleHandleEx

ds::ds()
{
    HMODULE hModule = NULL;
    BOOL bRc = GetModuleHandleEx(
                   GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
                   ( LPCSTR)this, &hModule );
    if ( bRc )
    {
        GetModuleFileName(hModule, g_szProjectName, MAX_PATH);
        FreeLibrary(hModule);
        DebugOut(
            "\n*******************Memory Check %s!\n\n",
            g_szProjectName );
    }
    else
    {
        OutputDebugString("\n*******************GetModuleHandleEx Failed!\n\n");
    }



    _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE );
    _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDERR );
    /*
    * Set the debug-heap flag to keep freed blocks in the
    * heap's linked list - This will allow us to catch any
    * inadvertent use of freed memory
    */
    //int tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
    //tmpDbgFlag |= _CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF;
    //_CrtSetDbgFlag(tmpDbgFlag);
}
开发者ID:fatrar,项目名称:yiqiulib,代码行数:32,代码来源:MemCheck.cpp


示例13: WinMain

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow )
{
	char    cBuff[MAX_PATH];
	DWORD   dwPID;
	HANDLE  hProcs;

	// get the calling exe path
	GetModuleFileName(NULL, cBuff, sizeof(cBuff));

	// get PID
	dwPID = GetProcessPathID(cBuff);
	if (!dwPID)
	{
		MessageBox(0, "Couldn't get PID :(", NULL, MB_ICONERROR);
		return -1;
	}
	// get procs.dll base
	hProcs = GetModuleHandleEx(dwPID, "procs.dll");
	if (!hProcs)
	{
		MessageBox(0, "GetModuleHandleEx failed :(", NULL, MB_ICONERROR);
		return -1;
	}

	// print result
	wsprintf(cBuff, "My PID: 0x%08lX\nProcs.dll base: 0x%08lX", dwPID, hProcs);
	MessageBox(0, cBuff, ":D", MB_ICONINFORMATION | MB_SYSTEMMODAL);

	return 0;
}
开发者ID:giantbranch,项目名称:MyLearningCode,代码行数:33,代码来源:USEPROCS.C


示例14: addLibrary

	bool addLibrary(char* libraryName,void* addressContained)
	{
		HMODULE module;

		if(GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,(LPCSTR)addressContained,&module))
		{
			HANDLE process =  GetCurrentProcess();
			_MODULEINFO moduleInfo;

			if(GetModuleInformation(process,module,&moduleInfo,sizeof moduleInfo))
			{
				CloseHandle(process);

				LibraryInfo* libraryInfo = new LibraryInfo;

				libraryInfo->baseAddress = (void*) moduleInfo.lpBaseOfDll;
				libraryInfo->length = moduleInfo.SizeOfImage;
				libraryInfo->handle = module;

				LibraryNameToLibraryInfo->insert(libraryName,libraryInfo);

				return true;
			}
		}

		return false;
	}
开发者ID:ShootingKing-AM,项目名称:OrpheuPack2.3,代码行数:27,代码来源:librariesManager.cpp


示例15: _zbar_processor_open

int _zbar_processor_open (zbar_processor_t *proc,
                          char *title,
                          unsigned width,
                          unsigned height)
{
    HMODULE hmod = NULL;
    if(!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
                          GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
                          (void*)_zbar_processor_open, (HINSTANCE*)&hmod))
        return(err_capture(proc, SEV_ERROR, ZBAR_ERR_WINAPI, __func__,
                           "failed to obtain module handle"));

    ATOM wca = win_register_class(hmod);
    if(!wca)
        return(err_capture(proc, SEV_ERROR, ZBAR_ERR_WINAPI, __func__,
                           "failed to register window class"));

    RECT r = { 0, 0, width, height };
    AdjustWindowRectEx(&r, WIN_STYLE, 0, EXT_STYLE);
    proc->display = CreateWindowEx(EXT_STYLE, (LPCTSTR)(long)wca,
                                   "ZBar", WIN_STYLE,
                                   CW_USEDEFAULT, CW_USEDEFAULT,
                                   r.right - r.left, r.bottom - r.top,
                                   NULL, NULL, hmod, proc);

    if(!proc->display)
        return(err_capture(proc, SEV_ERROR, ZBAR_ERR_WINAPI, __func__,
                           "failed to open window"));
    return(0);
}
开发者ID:liumeng1201,项目名称:qrcode_scan,代码行数:30,代码来源:win.c


示例16: lcb_create_libuv_io_opts

LCBUV_API
lcb_error_t lcb_create_libuv_io_opts(int version,
                                     lcb_io_opt_t *io,
                                     lcbuv_options_t *options)
{
    lcb_io_opt_t iop;
    uv_loop_t *loop = NULL;
    my_iops_t *ret;

    if (version != 0) {
        return LCB_PLUGIN_VERSION_MISMATCH;
    }

#ifdef _WIN32
    {
        /** UV unloading on Windows doesn't work well */
        HMODULE module;
        /* We need to provide a symbol */
        static int dummy;
        BOOL result;
        result = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
                                   GET_MODULE_HANDLE_EX_FLAG_PIN,
                                   (LPCSTR)&dummy,
                                   &module);
        if (!result) {
            return LCB_EINTERNAL;
        }
    }
#endif

    ret = calloc(1, sizeof(*ret));

    if (!ret) {
        return LCB_CLIENT_ENOMEM;
    }

    iop = &ret->base;
    iop->version = 2;
    iop->destructor = iops_lcb_dtor;
    iop->v.v2.get_procs = wire_iops2;

    ret->iops_refcount = 1;

    *io = iop;
    if (options) {
        if (options->v.v0.loop) {
            ret->external_loop = 1;
            loop = options->v.v0.loop;
        }
        ret->startstop_noop = options->v.v0.startsop_noop;
    }

    if (!loop) {
        loop = uv_loop_new();
    }

    ret->loop = loop;

    return LCB_SUCCESS;
}
开发者ID:00christian00,项目名称:couchnode,代码行数:60,代码来源:plugin-libuv.c


示例17: TRACE_EVENT0

bool Renderer::initializeCompiler()
{
    TRACE_EVENT0("gpu", "initializeCompiler");
#if defined(ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES)
    // Find a D3DCompiler module that had already been loaded based on a predefined list of versions.
    static TCHAR* d3dCompilerNames[] = ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES;

    for (size_t i = 0; i < ArraySize(d3dCompilerNames); ++i)
    {
        if (GetModuleHandleEx(0, d3dCompilerNames[i], &mD3dCompilerModule))
        {
            break;
        }
    }
#endif  // ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES

    // Load the compiler DLL specified by the environment, or default to QT_D3DCOMPILER_DLL
#if !defined(ANGLE_OS_WINRT)
    const wchar_t *defaultCompiler = _wgetenv(L"QT_D3DCOMPILER_DLL");
    if (!defaultCompiler)
        defaultCompiler = QT_D3DCOMPILER_DLL;
#else // !ANGLE_OS_WINRT
#  ifdef _DEBUG
    const wchar_t *defaultCompiler = L"d3dcompiler_qtd.dll";
#  else
    const wchar_t *defaultCompiler = L"d3dcompiler_qt.dll";
#  endif
#endif // ANGLE_OS_WINRT

    const wchar_t *compilerDlls[] = {
        defaultCompiler,
        L"d3dcompiler_47.dll",
        L"d3dcompiler_46.dll",
        L"d3dcompiler_45.dll",
        L"d3dcompiler_44.dll",
        L"d3dcompiler_43.dll",
        0
    };

    // Load the first available known compiler DLL
    for (int i = 0; compilerDlls[i]; ++i)
    {
        // Load the version of the D3DCompiler DLL associated with the Direct3D version ANGLE was built with.
        mD3dCompilerModule = LoadLibrary(compilerDlls[i]);
        if (mD3dCompilerModule)
            break;
    }

    if (!mD3dCompilerModule)
    {
        ERR("No D3D compiler module found - aborting!\n");
        return false;
    }

    mD3DCompileFunc = reinterpret_cast<pCompileFunc>(GetProcAddress(mD3dCompilerModule, "D3DCompile"));
    ASSERT(mD3DCompileFunc);

    return mD3DCompileFunc != NULL;
}
开发者ID:0x163mL,项目名称:phantomjs,代码行数:59,代码来源:Renderer.cpp


示例18: GetModuleFromAddress

/*
 * GetModuleFromAddress
 *      Finds module handle from some address inside it
 */
static HMODULE GetModuleFromAddress(LPVOID address)
{
    HMODULE module;
    if(GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS|GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
                         (char*)address, &module))
        return module;
    return nullptr;
}
开发者ID:victor2566,项目名称:modloader,代码行数:12,代码来源:exception.cpp


示例19: wutil_LibModuleHandle

HMODULE wutil_LibModuleHandle()
{
	HMODULE hModule;
	const DWORD flags = GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS|GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT;
	const BOOL ok = GetModuleHandleEx(flags, (LPCWSTR)&wutil_LibModuleHandle, &hModule);
	// (avoid ENSURE etc. because we're called from debug_DisplayError)
	wdbg_assert(ok);
	return hModule;
}
开发者ID:Gallaecio,项目名称:0ad,代码行数:9,代码来源:wutil.cpp


示例20: GetModuleFromAddress

static HMODULE GetModuleFromAddress(void * address)
{

    DWORD flags = GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT |
        GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS;
    HMODULE module = 0;
    GetModuleHandleEx(flags, (LPCWSTR)address, &module);
    return module;
}
开发者ID:91yuan,项目名称:bones,代码行数:9,代码来源:panel.cpp



注:本文中的GetModuleHandleEx函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetModuleHandleW函数代码示例发布时间:2022-05-30
下一篇:
C++ GetModuleHandle函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap