void Init_GL_ARB_vertex_array_object() { LoadProc(_glBindVertexArray, "glBindVertexArray"); LoadProc(_glDeleteVertexArrays, "glDeleteVertexArrays"); LoadProc(_glGenVertexArrays, "glGenVertexArrays"); LoadProc(_glIsVertexArray, "glIsVertexArray"); }
static int InstallDll(BOOL install, const WCHAR *strDll, const WCHAR *command_line) { HRESULT hr; DLLINSTALL pfInstall; HMODULE DllHandle = NULL; pfInstall = LoadProc(strDll, "DllInstall", &DllHandle); if (!pfInstall) return GETPROCADDRESS_FAILED; hr = pfInstall(install, command_line); if(FAILED(hr)) { if (install) output_write(STRING_INSTALL_FAILED, strDll); else output_write(STRING_UNINSTALL_FAILED, strDll); return DLLSERVER_FAILED; } if (install) output_write(STRING_INSTALL_SUCCESSFUL, strDll); else output_write(STRING_UNINSTALL_SUCCESSFUL, strDll); if(DllHandle) FreeLibrary(DllHandle); return 0; }
static DWORD DoDllUnregisterServer(LPCWSTR DllName) { HRESULT hr; DLLUNREGISTERSERVER pfDllUnregisterServer = NULL; HMODULE DllHandle = NULL; pfDllUnregisterServer = LoadProc(DllName, "DllUnregisterServer", &DllHandle); hr = pfDllUnregisterServer(); if(FAILED(hr)) { fprintf(stderr, "Failed to unregister dll %s\n", wine_dbgstr_w(DllName)); return 1; } printf("Successfully unregistered dll %s\n", wine_dbgstr_w(DllName)); if(DllHandle) FreeLibrary(DllHandle); return 0; }
static int UnregisterDll(const WCHAR* strDll) { HRESULT hr; DLLUNREGISTER pfUnregister; HMODULE DllHandle = NULL; pfUnregister = LoadProc(strDll, "DllUnregisterServer", &DllHandle); if (!pfUnregister) return GETPROCADDRESS_FAILED; hr = pfUnregister(); if(FAILED(hr)) { output_write(STRING_UNREGISTER_FAILED, strDll); return DLLSERVER_FAILED; } output_write(STRING_UNREGISTER_SUCCESSFUL, strDll); if(DllHandle) FreeLibrary(DllHandle); return 0; }
void Init_GL_ARB_vertex_buffer_object() { LoadProc(_glBindBufferARB, "glBindBufferARB"); LoadProc(_glDeleteBuffersARB, "glDeleteBuffersARB"); LoadProc(_glGenBuffersARB, "glGenBuffersARB"); LoadProc(_glIsBufferARB, "glIsBufferARB"); LoadProc(_glBufferDataARB, "glBufferDataARB"); LoadProc(_glBufferSubDataARB, "glBufferSubDataARB"); LoadProc(_glGetBufferSubDataARB, "glGetBufferSubDataARB"); LoadProc(_glMapBufferARB, "glMapBufferARB"); LoadProc(_glUnmapBufferARB, "glUnmapBufferARB"); LoadProc(_glGetBufferParameterivARB, "glGetBufferParameterivARB"); LoadProc(_glGetBufferPointervARB, "glGetBufferPointervARB"); }
bool iGAPILoader::Init( bool forceDefault ) { if ( gxDLL_ ) return true; TCHAR name[MAX_PATH]; _tcscpy( name, _T("gx.dll") ); HMODULE dll = LoadLibrary( name ); if ( dll ) { if ( gxDLL_ ) { FreeLibrary( gxDLL_ ); gxDLL_ = 0; } BOOL ok = TRUE; ok &= LoadProc( dll, this->GXOpenDisplay, _T("?GXOpenDisplay@@YAHPAUHWND__@@K@Z"), false ); ok &= LoadProc( dll, this->GXCloseDisplay, _T("?GXCloseDisplay@@YAHXZ"), false ); ok &= LoadProc( dll, this->GXBeginDraw, _T("?GXBeginDraw@@YAPAXXZ"), false ); ok &= LoadProc( dll, this->GXEndDraw, _T("?GXEndDraw@@YAHXZ"), false ); ok &= LoadProc( dll, this->GXSuspend, _T("?GXSuspend@@YAHXZ"), false ); ok &= LoadProc( dll, this->GXResume, _T("?GXResume@@YAHXZ"), false ); ok &= LoadProc( dll, this->GXGetDisplayProperties,_T("?GXGetDisplayProperties@@YA?AUGXDisplayProperties@@XZ"), false ); ok &= LoadProc( dll, this->GXSetViewport, _T("?GXSetViewport@@YAHKKKK@Z"), true ); ok &= LoadProc( dll, this->GXIsDisplayDRAMBuffer, _T("?GXIsDisplayDRAMBuffer@@YAHXZ"), true ); ok &= LoadProc( dll, this->GXOpenInput, _T("?GXOpenInput@@YAHXZ"), false ); ok &= LoadProc( dll, this->GXCloseInput, _T("?GXCloseInput@@YAHXZ"), false ); ok &= LoadProc( dll, this->GXGetDefaultKeys, _T("?GXGetDefaultKeys@@YA?AUGXKeyList@@H@Z"), false ); if ( !ok ) { FreeLibrary( dll ); return false; } gxDLL_ = dll; // patch optional fun if ( !this->GXSetViewport ) { this->GXSetViewport = fakeGXSetViewport; } if ( !this->GXIsDisplayDRAMBuffer ) { this->GXIsDisplayDRAMBuffer = fakeGXIsDisplayDRAMBuffer; } return true; } return false; }