Example #1
0
	VdmHelper::VdmHelper() : hCWPHook(0), hGMHook(0)
	{
#ifdef _WIN64
		hvdm = ::LoadLibrary(_T("VDMHelper64.dll"));
#else
		hvdm = ::LoadLibrary(_T("VDMHelper32.dll"));
#endif
		GPA(hvdm, VDMHookProc1);
		GPA(hvdm, VDMHookProc2);
		GPA(hvdm, VDMAllocGuid);
		GPA(hvdm, VDMReleaseGuid);
		GPA(hvdm, VDMInject);
		RequestMoveWindowToDesktopMessage = RegisterWindowMessage(RequestMoveWindowToDesktop);
	}
Example #2
0
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved)
{
	TRACE("(%p, %d, %p)\n", hInstance, Reason, Reserved);

	switch(Reason)
	{
	case DLL_PROCESS_ATTACH:
		COMDLG32_hInstance = hInstance;
		DisableThreadLibraryCalls(hInstance);

		SHELL32_hInstance = GetModuleHandleA("SHELL32.DLL");

		if (!SHELL32_hInstance)
		{
			ERR("loading of shell32 failed\n");
			return FALSE;
		}

		/* ITEMIDLIST */
		GPA(COMDLG32_PIDL_ILIsEqual, SHELL32_hInstance, (LPCSTR)21L);
		GPA(COMDLG32_PIDL_ILCombine, SHELL32_hInstance, (LPCSTR)25L);
		GPA(COMDLG32_PIDL_ILGetNext, SHELL32_hInstance, (LPCSTR)153L);
		GPA(COMDLG32_PIDL_ILClone, SHELL32_hInstance, (LPCSTR)18L);
		GPA(COMDLG32_PIDL_ILRemoveLastID, SHELL32_hInstance, (LPCSTR)17L);

		/* SHELL */

		GPA(COMDLG32_SHAlloc, SHELL32_hInstance, (LPCSTR)196L);
		GPA(COMDLG32_SHFree, SHELL32_hInstance, (LPCSTR)195L);
		/* for the first versions of shell32 SHGetFolderPathA is in SHFOLDER.DLL */
		COMDLG32_SHGetFolderPathA = (void*)GetProcAddress(SHELL32_hInstance,"SHGetFolderPathA");
		if (!COMDLG32_SHGetFolderPathA)
		{
		  SHFOLDER_hInstance = LoadLibraryA("SHFOLDER.DLL");
		  GPA(COMDLG32_SHGetFolderPathA, SHFOLDER_hInstance,"SHGetFolderPathA");
		}

		/* for the first versions of shell32 SHGetFolderPathW is in SHFOLDER.DLL */
		COMDLG32_SHGetFolderPathW = (void*)GetProcAddress(SHELL32_hInstance,"SHGetFolderPathW");
		if (!COMDLG32_SHGetFolderPathW)
		{
		  SHFOLDER_hInstance = LoadLibraryA("SHFOLDER.DLL");
		  GPA(COMDLG32_SHGetFolderPathW, SHFOLDER_hInstance,"SHGetFolderPathW");
		}

		break;

	case DLL_PROCESS_DETACH:
            if (COMDLG32_TlsIndex != TLS_OUT_OF_INDEXES) TlsFree(COMDLG32_TlsIndex);
            if(SHFOLDER_hInstance) FreeLibrary(SHFOLDER_hInstance);
            break;
	}
	return TRUE;
}
Example #3
0
int main(void) {

	int moreNumbers = 1;
	float considering;
	float total = 0.0;
	int grades = 0, maxGrade = 0, minGrade=100;
	int totals[5];
	char letter;

	printf("\n"); // just to make it clean
	while(moreNumbers) {
		printf("Enter next score (negative to stop) -- ");
		scanf("%f", &considering);
		clearRestOfBuffer();

		if(considering < 0) { // spec only requires that -1 work but why not all negative
			moreNumbers = 0; break;
		} else if (considering > 100) {
			printf("Invalid score, please try again.\n");
		} else {

			total = total + considering;
			grades++;
			letter = determineLetterGrade(round(considering));
			totals[(letter - 65 == 5) ? (letter - 66) : (letter - 65)]++;

			if(considering > maxGrade)
				maxGrade = considering;

			if(considering < minGrade)
				minGrade = considering;

			printf("Score = %6.2f  Grade = %c\n", considering, letter);
		}

	}

	// Reports section

	printf("\n--------------------------\n");
	printf("  Number of scores %5d\n", grades);

	int i, offset;
	for(i=0; i < 5; i++) {
		offset = (i==4) ? 1:0;
		printf("  Number of %c's    %5d\n", (char) (i + 65 + offset), totals[i] );
	}

	printf("  High score      %6.2f\n", (float) maxGrade);
	printf("  Low score       %6.2f\n", (float) minGrade);
	printf("  Average score   %6.2f\n", total/grades);
	printf("  Exam GPA        %6.2f\n", GPA(totals));

	printf("--------------------------\n\n");

	return 0;
}
Example #4
0
qboolean WGL_Init( const char *dllname ) {
    if( ( glw.hinstOpenGL = LoadLibrary( dllname ) ) == NULL ) {
        return qfalse;
    }

    qwglDrawBuffer              = GPA( "glDrawBuffer" );
    qwglGetString               = GPA( "glGetString" );

    qwglChoosePixelFormat       = GPA( "wglChoosePixelFormat" );
    qwglDescribePixelFormat     = GPA( "wglDescribePixelFormat" );
    qwglSetPixelFormat          = GPA( "wglSetPixelFormat" );
    qwglSwapBuffers             = GPA( "wglSwapBuffers" );

    qwglCreateContext           = GPA( "wglCreateContext" );
    qwglDeleteContext           = GPA( "wglDeleteContext" );
    qwglGetProcAddress          = GPA( "wglGetProcAddress" );
    qwglMakeCurrent             = GPA( "wglMakeCurrent" );

    return qtrue;
}
Example #5
0
static qboolean JVM_JNI_Init()
{
	if(javaLib)
		return qtrue;

	Com_Printf("Loading \"%s\"...\n", jvm_javaLib->string);
	if((javaLib = Sys_LoadLibrary(jvm_javaLib->string)) == 0)
	{
#ifdef _WIN32
		return qfalse;
#else
		char            fn[1024];

		Com_Printf("JVM_JNI_Init() failed:\n\"%s\"\n", Sys_LibraryError());

		Q_strncpyz(fn, Sys_Cwd(), sizeof(fn));
		strncat(fn, "/", sizeof(fn) - strlen(fn) - 1);
		strncat(fn, jvm_javaLib->string, sizeof(fn) - strlen(fn) - 1);

		if((javaLib = Sys_LoadLibrary(fn)) == 0)
		{
			Com_Printf("JVM_JNI_Init() failed:\n\"%s\"\n", Sys_LibraryError());
			return qfalse;
		}
#endif							/* _WIN32 */
	}

	javaEnabled = qtrue;

	QJNI_CreateJavaVM = GPA("JNI_CreateJavaVM");
	QJNI_GetCreatedJavaVMs = GPA("JNI_GetCreatedJavaVMs");

	if(!javaEnabled)
	{
		//JVM_JNI_Shutdown();
		return qfalse;
	}

	return qtrue;
}
Example #6
0
int main(){
    struct student studentArr[3];
    
 
     printf("請輸入第一個學生姓名:");
     scanf("%s",studentArr[0].name);
     printf("請輸入第一個學生成績:");
     scanf("%d",&studentArr[0].score);
    
    
     printf("請輸入第二個學生姓名:");
     scanf("%s",studentArr[1].name);
     printf("請輸入第二個學生成績:");
     scanf("%d",&studentArr[1].score);
     
     printf("請輸入第三個學生姓名:");
     scanf("%s",studentArr[2].name);
     printf("請輸入第三個學生成績:");
     scanf("%d",&studentArr[2].score); 
    
    
    
     printf("第一個學生:%s\n",studentArr[0].name);
     printf("分數:%d\n",studentArr[0].score);
     printf("GPA:%c\n",GPA(studentArr[0].score));
      
    
    
     printf("第二個學生:%s\n",studentArr[1].name);
     printf("分數:%d\n",studentArr[1].score);
     printf("GPA:%c\n",GPA(studentArr[1].score));
     
     printf("第三個學生:%s\n",studentArr[2].name);
     printf("分數:%d\n",studentArr[2].score);
     printf("GPA:%c\n",GPA(studentArr[2].score));
     
     
 system("PAUSE");
 return 0;   
}
Example #7
0
/*
=================
CL_cURL_Init
=================
*/
qboolean CL_cURL_Init()
{
#ifdef USE_CURL_DLOPEN
    if(cURLLib)
        return qtrue;


    Com_Printf("Loading \"%s\"...", cl_cURLLib->string);
    if( (cURLLib = Sys_LoadLibrary(cl_cURLLib->string)) == 0 )
    {
#ifdef _WIN32
        return qfalse;
#else
        char fn[1024];

        Q_strncpyz( fn, Sys_Cwd( ), sizeof( fn ) );
        strncat(fn, "/", sizeof(fn)-strlen(fn)-1);
        strncat(fn, cl_cURLLib->string, sizeof(fn)-strlen(fn)-1);

        if((cURLLib = Sys_LoadLibrary(fn)) == 0)
        {
#ifdef ALTERNATE_CURL_LIB
            // On some linux distributions there is no libcurl.so.3, but only libcurl.so.4. That one works too.
            if( (cURLLib = Sys_LoadLibrary(ALTERNATE_CURL_LIB)) == 0 )
            {
                return qfalse;
            }
#else
            return qfalse;
#endif
        }
#endif /* _WIN32 */
    }

    clc.cURLEnabled = qtrue;

    qcurl_version = GPA("curl_version");

    qcurl_easy_init = GPA("curl_easy_init");
    qcurl_easy_setopt = GPA("curl_easy_setopt");
    qcurl_easy_perform = GPA("curl_easy_perform");
    qcurl_easy_cleanup = GPA("curl_easy_cleanup");
    qcurl_easy_getinfo = GPA("curl_easy_getinfo");
    qcurl_easy_duphandle = GPA("curl_easy_duphandle");
    qcurl_easy_reset = GPA("curl_easy_reset");
    qcurl_easy_strerror = GPA("curl_easy_strerror");

    qcurl_multi_init = GPA("curl_multi_init");
    qcurl_multi_add_handle = GPA("curl_multi_add_handle");
    qcurl_multi_remove_handle = GPA("curl_multi_remove_handle");
    qcurl_multi_fdset = GPA("curl_multi_fdset");
    qcurl_multi_perform = GPA("curl_multi_perform");
    qcurl_multi_cleanup = GPA("curl_multi_cleanup");
    qcurl_multi_info_read = GPA("curl_multi_info_read");
    qcurl_multi_strerror = GPA("curl_multi_strerror");

    if(!clc.cURLEnabled)
    {
        CL_cURL_Shutdown();
        Com_Printf("FAIL One or more symbols not found\n");
        return qfalse;
    }
    Com_Printf("OK\n");

    return qtrue;
#else
    clc.cURLEnabled = qtrue;
    return qtrue;
#endif /* USE_CURL_DLOPEN */
}
Example #8
0
/*
=================
QAL_Init
=================
*/
qboolean QAL_Init(const char *libname)
{
	if(OpenALLib)
		return qtrue;

	Com_Printf( "Loading \"%s\"...\n", libname);
	if( (OpenALLib = Sys_LoadLibrary(libname)) == 0 )
	{
#ifdef _WIN32
		return qfalse;
#else
		char fn[1024];
		Q_strncpyz( fn, Sys_Cwd( ), sizeof( fn ) );
		strncat(fn, "/", sizeof(fn) - strlen(fn) - 1);
		strncat(fn, libname, sizeof(fn) - strlen(fn) - 1);

		if( (OpenALLib = Sys_LoadLibrary(fn)) == 0 )
		{
			return qfalse;
		}
#endif
	}

	alinit_fail = qfalse;

	qalEnable = GPA("alEnable");
	qalDisable = GPA("alDisable");
	qalIsEnabled = GPA("alIsEnabled");
	qalGetString = GPA("alGetString");
	qalGetBooleanv = GPA("alGetBooleanv");
	qalGetIntegerv = GPA("alGetIntegerv");
	qalGetFloatv = GPA("alGetFloatv");
	qalGetDoublev = GPA("alGetDoublev");
	qalGetBoolean = GPA("alGetBoolean");
	qalGetInteger = GPA("alGetInteger");
	qalGetFloat = GPA("alGetFloat");
	qalGetDouble = GPA("alGetDouble");
	qalGetError = GPA("alGetError");
	qalIsExtensionPresent = GPA("alIsExtensionPresent");
	qalGetProcAddress = GPA("alGetProcAddress");
	qalGetEnumValue = GPA("alGetEnumValue");
	qalListenerf = GPA("alListenerf");
	qalListener3f = GPA("alListener3f");
	qalListenerfv = GPA("alListenerfv");
	qalListeneri = GPA("alListeneri");
	qalGetListenerf = GPA("alGetListenerf");
	qalGetListener3f = GPA("alGetListener3f");
	qalGetListenerfv = GPA("alGetListenerfv");
	qalGetListeneri = GPA("alGetListeneri");
	qalGenSources = GPA("alGenSources");
	qalDeleteSources = GPA("alDeleteSources");
	qalIsSource = GPA("alIsSource");
	qalSourcef = GPA("alSourcef");
	qalSource3f = GPA("alSource3f");
	qalSourcefv = GPA("alSourcefv");
	qalSourcei = GPA("alSourcei");
	qalGetSourcef = GPA("alGetSourcef");
	qalGetSource3f = GPA("alGetSource3f");
	qalGetSourcefv = GPA("alGetSourcefv");
	qalGetSourcei = GPA("alGetSourcei");
	qalSourcePlayv = GPA("alSourcePlayv");
	qalSourceStopv = GPA("alSourceStopv");
	qalSourceRewindv = GPA("alSourceRewindv");
	qalSourcePausev = GPA("alSourcePausev");
	qalSourcePlay = GPA("alSourcePlay");
	qalSourceStop = GPA("alSourceStop");
	qalSourceRewind = GPA("alSourceRewind");
	qalSourcePause = GPA("alSourcePause");
	qalSourceQueueBuffers = GPA("alSourceQueueBuffers");
	qalSourceUnqueueBuffers = GPA("alSourceUnqueueBuffers");
	qalGenBuffers = GPA("alGenBuffers");
	qalDeleteBuffers = GPA("alDeleteBuffers");
	qalIsBuffer = GPA("alIsBuffer");
	qalBufferData = GPA("alBufferData");
	qalGetBufferf = GPA("alGetBufferf");
	qalGetBufferi = GPA("alGetBufferi");
	qalDopplerFactor = GPA("alDopplerFactor");
	qalDopplerVelocity = GPA("alDopplerVelocity");
	qalDistanceModel = GPA("alDistanceModel");

	qalcCreateContext = GPA("alcCreateContext");
	qalcMakeContextCurrent = GPA("alcMakeContextCurrent");
	qalcProcessContext = GPA("alcProcessContext");
	qalcSuspendContext = GPA("alcSuspendContext");
	qalcDestroyContext = GPA("alcDestroyContext");
	qalcGetCurrentContext = GPA("alcGetCurrentContext");
	qalcGetContextsDevice = GPA("alcGetContextsDevice");
	qalcOpenDevice = GPA("alcOpenDevice");
	qalcCloseDevice = GPA("alcCloseDevice");
	qalcGetError = GPA("alcGetError");
	qalcIsExtensionPresent = GPA("alcIsExtensionPresent");
	qalcGetProcAddress = GPA("alcGetProcAddress");
	qalcGetEnumValue = GPA("alcGetEnumValue");
	qalcGetString = GPA("alcGetString");
	qalcGetIntegerv = GPA("alcGetIntegerv");
	qalcCaptureOpenDevice = GPA("alcCaptureOpenDevice");
	qalcCaptureCloseDevice = GPA("alcCaptureCloseDevice");
	qalcCaptureStart = GPA("alcCaptureStart");
	qalcCaptureStop = GPA("alcCaptureStop");
	qalcCaptureSamples = GPA("alcCaptureSamples");

	if(alinit_fail)
	{
		QAL_Shutdown();
		Com_Printf( " One or more symbols not found\n");
		return qfalse;
	}

	return qtrue;
}
/*
=================
CL_cURL_Init
=================
*/
qboolean CL_cURL_Init()
{
#if USE_CURL_DLOPEN
	if(cURLLib)
		return qtrue;


	Com_Printf("Loading \"%s\"...", cl_cURLLib->string);
	if( (cURLLib = OBJLOAD(cl_cURLLib->string)) == 0 )
	{
#ifdef _WIN32
		return qfalse;
#else
		char fn[1024];
		getcwd(fn, sizeof(fn));
		strncat(fn, "/", sizeof(fn)-strlen(fn)-1);
		strncat(fn, cl_cURLLib->string, sizeof(fn)-strlen(fn)-1);

		if( (cURLLib = OBJLOAD(fn)) == 0 )
		{
			return qfalse;
		}
#endif /* _WIN32 */
	}

	clc.cURLEnabled = qtrue;

	qcurl_version = GPA("curl_version");

	qcurl_easy_init = GPA("curl_easy_init");
	qcurl_easy_setopt = GPA("curl_easy_setopt");
	qcurl_easy_perform = GPA("curl_easy_perform");
	qcurl_easy_cleanup = GPA("curl_easy_cleanup");
	qcurl_easy_getinfo = GPA("curl_easy_getinfo");
	qcurl_easy_duphandle = GPA("curl_easy_duphandle");
	qcurl_easy_reset = GPA("curl_easy_reset");
	qcurl_easy_strerror = GPA("curl_easy_strerror");
	
	qcurl_multi_init = GPA("curl_multi_init");
	qcurl_multi_add_handle = GPA("curl_multi_add_handle");
	qcurl_multi_remove_handle = GPA("curl_multi_remove_handle");
	qcurl_multi_fdset = GPA("curl_multi_fdset");
	qcurl_multi_perform = GPA("curl_multi_perform");
	qcurl_multi_cleanup = GPA("curl_multi_cleanup");
	qcurl_multi_info_read = GPA("curl_multi_info_read");
	qcurl_multi_strerror = GPA("curl_multi_strerror");

	if(!clc.cURLEnabled)
	{
		CL_cURL_Shutdown();
		Com_Printf("FAIL One or more symbols not found\n");
		return qfalse;
	}
	Com_Printf("OK\n");

	return qtrue;
#else
	clc.cURLEnabled = qtrue;
	return qtrue;
#endif /* USE_CURL_DLOPEN */
}
Example #10
0
/*
=================
CL_cURL_Init
=================
*/
qboolean CL_cURL_Init()
{
#ifdef USE_CURL_DLOPEN
	if(cURLLib)
		return qtrue;


	Com_Printf("Loading \"%s\"...", cl_cURLLib->string);
	if(!(cURLLib = Sys_LoadDll(cl_cURLLib->string, qtrue)))
	{
#ifdef ALTERNATE_CURL_LIB
		// On some linux distributions there is no libcurl.so.3, but only libcurl.so.4. That one works too.
		if(!(cURLLib = Sys_LoadDll(ALTERNATE_CURL_LIB, qtrue)))
#endif
			return qfalse;
	}

	clc.cURLEnabled = qtrue;

	qcurl_version = GPA("curl_version");

	qcurl_easy_init = GPA("curl_easy_init");
	qcurl_easy_setopt = GPA("curl_easy_setopt");
	qcurl_easy_perform = GPA("curl_easy_perform");
	qcurl_easy_cleanup = GPA("curl_easy_cleanup");
	qcurl_easy_getinfo = GPA("curl_easy_getinfo");
	qcurl_easy_duphandle = GPA("curl_easy_duphandle");
	qcurl_easy_reset = GPA("curl_easy_reset");
	qcurl_easy_strerror = GPA("curl_easy_strerror");
	
	qcurl_multi_init = GPA("curl_multi_init");
	qcurl_multi_add_handle = GPA("curl_multi_add_handle");
	qcurl_multi_remove_handle = GPA("curl_multi_remove_handle");
	qcurl_multi_fdset = GPA("curl_multi_fdset");
	qcurl_multi_perform = GPA("curl_multi_perform");
	qcurl_multi_cleanup = GPA("curl_multi_cleanup");
	qcurl_multi_info_read = GPA("curl_multi_info_read");
	qcurl_multi_strerror = GPA("curl_multi_strerror");

	if(!clc.cURLEnabled)
	{
		CL_cURL_Shutdown();
		Com_Printf("FAIL One or more symbols not found\n");
		return qfalse;
	}
	Com_Printf("OK\n");

	return qtrue;
#else
	clc.cURLEnabled = qtrue;
	return qtrue;
#endif /* USE_CURL_DLOPEN */
}
Example #11
0
static DWORD Sys_ExceptionHandler( DWORD exceptionCode, LPEXCEPTION_POINTERS exceptionInfo ) {
	STACKFRAME stackFrame;
	PCONTEXT context;
	SYMBOL_INFO *symbol;
	int count, ret;
	DWORD64 offset;
	BYTE buffer[sizeof( SYMBOL_INFO ) + 256 - 1];
	IMAGEHLP_MODULE moduleInfo;
	char path[MAX_PATH];
	char execdir[MAX_PATH];
	char *p;
	HMODULE helpModule, shellModule;
	SYSTEMTIME systemTime;
	static char *monthNames[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
		"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
	OSVERSIONINFO	vinfo;

#ifndef DEDICATED_ONLY
	VID_Shutdown();
#endif

	ret = MessageBox( NULL, APPLICATION " has encountered an unhandled exception and needs to be terminated.\n"
		"Would you like to generate a crash report?",
		"Unhandled Exception",
		MB_ICONERROR|MB_YESNO );
	if( ret == IDNO ) {
		return EXCEPTION_CONTINUE_SEARCH;
	}

	helpModule = LoadLibrary( "dbghelp.dll" );
	if( !helpModule ) {
		return EXCEPTION_CONTINUE_SEARCH;
	}

#define GPA( x, y )															\
	do {																	\
		p ## y = ( x )GetProcAddress( helpModule, #y );						\
		if( !p ## y ) { \
			FreeLibrary(helpModule); \
			return EXCEPTION_CONTINUE_SEARCH;								\
		}																	\
	} while( 0 )

	GPA( SETSYMOPTIONS, SymSetOptions );
	GPA( SYMGETMODULEINFO, SymGetModuleInfo );
	GPA( SYMCLEANUP, SymCleanup );
	GPA( SYMINITIALIZE, SymInitialize );
	GPA( ENUMERATELOADEDMODULES, EnumerateLoadedModules );
	GPA( STACKWALK, StackWalk );
	GPA( SYMFROMADDR, SymFromAddr );
	GPA( SYMFUNCTIONTABLEACCESS, SymFunctionTableAccess );
	GPA( SYMGETMODULEBASE, SymGetModuleBase );

	pSymSetOptions( SYMOPT_LOAD_ANYTHING|SYMOPT_DEBUG|SYMOPT_FAIL_CRITICAL_ERRORS );
	processHandle = GetCurrentProcess();
	threadHandle = GetCurrentThread();

	GetModuleFileName( NULL, execdir, sizeof( execdir ) - 1 );
	execdir[sizeof( execdir ) - 1] = 0;
	p = strrchr( execdir, '\\' );
	if( p ) {
		*p = 0;
	}
	
	GetSystemTime( &systemTime );

	Com_sprintf( path, sizeof( path ), "%s\\" APPLICATION "_CrashReport.txt", execdir );
	crashReport = fopen( path, "a" );
	if( !crashReport ) {
		return EXCEPTION_CONTINUE_SEARCH;
	}

	pSymInitialize( processHandle, execdir, TRUE );

	fprintf( crashReport, "Crash report generated %s %u %u, %02u:%02u:%02u UTC\n",
		monthNames[systemTime.wMonth % 12], systemTime.wDay, systemTime.wYear,
		systemTime.wHour, systemTime.wMinute, systemTime.wSecond );
	fprintf( crashReport, "by " APPLICATION " v" VERSION ", built " __DATE__", " __TIME__ "\n" );

	vinfo.dwOSVersionInfoSize = sizeof( vinfo );
	if( GetVersionEx( &vinfo ) ) {
		fprintf( crashReport, "\nWindows version: %u.%u (build %u) %s\n",
			vinfo.dwMajorVersion, vinfo.dwMinorVersion, vinfo.dwBuildNumber, vinfo.szCSDVersion );
	}

	strcpy( moduleName, "unknown" );

	context = exceptionInfo->ContextRecord;

	fprintf( crashReport, "\nLoaded modules:\n" );
	pEnumerateLoadedModules( processHandle, EnumModulesCallback, ( PVOID )context->Eip );

	fprintf( crashReport, "\nException information:\n" );
	fprintf( crashReport, "Code: %08x\n", exceptionCode );
	fprintf( crashReport, "Address: %08x (%s)\n",
		context->Eip, moduleName );

	fprintf( crashReport, "\nThread context:\n" );
	fprintf( crashReport, "EIP: %08x EBP: %08x ESP: %08x\n",
		context->Eip, context->Ebp, context->Esp );
	fprintf( crashReport, "EAX: %08x EBX: %08x ECX: %08x\n",
		context->Eax, context->Ebx, context->Ecx );
	fprintf( crashReport, "EDX: %08x ESI: %08x EDI: %08x\n",
		context->Edx, context->Esi, context->Edi );

	memset( &stackFrame, 0, sizeof( stackFrame ) );
	stackFrame.AddrPC.Offset = context->Eip;
	stackFrame.AddrPC.Mode = AddrModeFlat;
	stackFrame.AddrFrame.Offset = context->Ebp;
	stackFrame.AddrFrame.Mode = AddrModeFlat;
	stackFrame.AddrStack.Offset = context->Esp;
	stackFrame.AddrStack.Mode = AddrModeFlat;	

	fprintf( crashReport, "\nStack trace:\n" );
	count = 0;
	symbol = ( SYMBOL_INFO * )buffer;
	symbol->SizeOfStruct = sizeof( *symbol );
	symbol->MaxNameLen = 256;
	while( pStackWalk( IMAGE_FILE_MACHINE_I386,
		processHandle,
		threadHandle,
		&stackFrame,
		context,
		NULL,
		pSymFunctionTableAccess,
		pSymGetModuleBase,
		NULL ) )
	{
		fprintf( crashReport, "%d: %08x %08x %08x %08x ",
			count,
			stackFrame.Params[0],
			stackFrame.Params[1],
			stackFrame.Params[2],
			stackFrame.Params[3] );

		moduleInfo.SizeOfStruct = sizeof( moduleInfo );
		if( pSymGetModuleInfo( processHandle, stackFrame.AddrPC.Offset, &moduleInfo ) ) {
			if( moduleInfo.SymType != SymNone && moduleInfo.SymType != SymExport &&
				pSymFromAddr( processHandle, stackFrame.AddrPC.Offset, &offset, symbol ) )
			{
				fprintf( crashReport, "%s!%s+%#x\n", 
					moduleInfo.ModuleName,
					symbol->Name, offset );
			} else {
				fprintf( crashReport, "%s!%#x\n",
					moduleInfo.ModuleName,
					stackFrame.AddrPC.Offset );
			}
		} else {
			fprintf( crashReport, "%#x\n",
				stackFrame.AddrPC.Offset );
		}
		count++;
	}

	fclose( crashReport );

	shellModule = LoadLibrary( "shell32.dll" );
	if( shellModule ) {
		pShellExecute = ( SHELLEXECUTE )GetProcAddress( shellModule, "ShellExecuteA" );
		if( pShellExecute ) {
			pShellExecute( NULL, "open", path, NULL, execdir, SW_SHOW );
		}
	}

	pSymCleanup( processHandle );

	ExitProcess( 1 );
	return EXCEPTION_CONTINUE_SEARCH;
}
Example #12
0
/*
-----------------------------------------------------------------------------
 Function: OpenAL_Init -Setup interface to OpenAL.
 
 Parameters: dllname -[in] Name of the OpenAL dynamic link library.            
 
 Returns: true on success, otherwise false.
 
 Notes: 
		This is responsible for binding our al function pointers to 
		the appropriate OpenAL stuff. In Windows this means doing a 
		LoadLibrary and a bunch of calls to GetProcAddress. On other
		operating systems we need to do the right thing, whatever that
		might be.

-----------------------------------------------------------------------------
*/
PUBLIC _boolean OpenAL_Init( const char *dllname )
{

#ifdef _WIN32

	char buffer[ 1024 ], *ptr;

	SearchPath( NULL, dllname, NULL, sizeof( buffer ) - 1, buffer, &ptr );

	Com_Printf( "...calling LoadLibrary( %s ): ", buffer );
	
	if( ( hinstOpenAL = LoadLibrary( dllname ) ) == 0 )
	{
		char *buf = NULL;

		Com_Printf( "failed\n" );

		FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, 
						NULL, GetLastError(), 
						MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ),
						(LPTSTR) &buf, 0, NULL );

		Com_Printf( "%s\n", buf );
		
		return false;
	}	

#elif __unix__

	Com_Printf( "...calling dlopen( %s ): ", dllname );
	
	if( ( OpenALLib = dlopen( dllname, RTLD_LAZY | RTLD_GLOBAL ) ) == 0 )
	{
		Com_Printf( "failed\n" );

		Com_Printf( "%s\n", dlerror() );
		
		return false;
	}

#else

	#error "Please define interface to OpenAL library!"

#endif


	Com_Printf( "succeeded\n" );


	if( ! (pfalcCloseDevice				= (ALCCLOSEDEVICE)GPA( "alcCloseDevice" )) ) return false;
	if( ! (pfalcCreateContext			= (ALCCREATECONTEXT)GPA( "alcCreateContext" )) ) return false;
	if( ! (pfalcDestroyContext			= (ALCDESTROYCONTEXT)GPA( "alcDestroyContext" )) ) return false;
	if( ! (pfalcGetContextsDevice		= (ALCGETCONTEXTSDEVICE)GPA( "alcGetContextsDevice" )) ) return false;
	if( ! (pfalcGetCurrentContext		= (ALCGETCURRENTCONTEXT)GPA( "alcGetCurrentContext" )) ) return false;
	if( ! (pfalcGetEnumValue			= (ALCGETENUMVALUE)GPA( "alcGetEnumValue" )) ) return false;
	if( ! (pfalcGetError				= (ALCGETERROR)GPA( "alcGetError" )) ) return false;
	if( ! (pfalcGetIntegerv				= (ALCGETINTEGERV)GPA( "alcGetIntegerv" )) ) return false;
	if( ! (pfalcGetProcAddress			= (ALCGETPROCADDRESS)GPA( "alcGetProcAddress" )) ) return false;
	if( ! (pfalcGetString				= (ALCGETSTRING)GPA( "alcGetString" )) ) return false;
	if( ! (pfalcIsExtensionPresent		= (ALCISEXTENSIONPRESENT)GPA( "alcIsExtensionPresent" )) ) return false;
	if( ! (pfalcMakeContextCurrent		= (ALCMAKECONTEXTCURRENT)GPA( "alcMakeContextCurrent" )) ) return false;
	if( ! (pfalcOpenDevice				= (ALCOPENDEVICE)GPA( "alcOpenDevice" )) ) return false;
	if( ! (pfalcProcessContext			= (ALCPROCESSCONTEXT)GPA( "alcProcessContext" )) ) return false;
	if( ! (pfalcSuspendContext			= (ALCSUSPENDCONTEXT)GPA( "alcSuspendContext" )) ) return false;


	if( ! (pfalGenBuffers				= (ALGENBUFFERS)GPA("alGenBuffers")) ) return false;
	if( ! (pfalDeleteBuffers			= (ALDELETEBUFFERS)GPA("alDeleteBuffers")) ) return false;
	if( ! (pfalIsBuffer					= (ALISBUFFER)GPA("alIsBuffer")) ) return false;
	if( ! (pfalBufferData				= (ALBUFFERDATA)GPA("alBufferData")) ) return false;
	if( ! (pfalGetBufferf				= (ALGETBUFFERF)GPA("alGetBufferf")) ) return false;
	if( ! (pfalGetBufferi				= (ALGETBUFFERI)GPA("alGetBufferi")) ) return false;
	if( ! (pfalEnable					= (ALENABLE)GPA("alEnable")) ) return false;
	if( ! (pfalDisable					= (ALDISABLE)GPA("alDisable")) ) return false;
	if( ! (pfalDopplerFactor			= (ALDOPPLERFACTOR)GPA("alDopplerFactor")) ) return false;
	if( ! (pfalDopplerVelocity			= (ALDOPPLERVELOCITY)GPA("alDopplerVelocity")) ) return false;
	if( ! (pfalDistanceModel			= (ALDISTANCEMODEL)GPA("alDistanceModel")) ) return false;
	if( ! (pfalGetBoolean				= (ALGETBOOLEAN)GPA("alGetBoolean")) ) return false;
	if( ! (pfalGetBooleanv				= (ALGETBOOLEANV)GPA("alGetBooleanv")) ) return false;
	if( ! (pfalGetDouble				= (ALGETDOUBLE)GPA("alGetDouble")) ) return false;
	if( ! (pfalGetDoublev				= (ALGETDOUBLEV)GPA("alGetDoublev")) ) return false;
	if( ! (pfalGetFloat					= (ALGETFLOAT)GPA("alGetFloat")) ) return false;
	if( ! (pfalGetFloatv				= (ALGETFLOATV)GPA("alGetFloatv")) ) return false;
	if( ! (pfalGetInteger				= (ALGETINTEGER)GPA("alGetInteger")) ) return false;
	if( ! (pfalGetIntegerv				= (ALGETINTEGERV)GPA("alGetIntegerv")) ) return false;
	if( ! (pfalGetEnumValue				= (ALGETENUMVALUE)GPA("alGetEnumValue")) ) return false;
	if( ! (pfalGetError					= (ALGETERROR)GPA("alGetError")) ) return false;
	if( ! (pfalGetProcAddress			= (ALGETPROCADDRESS)GPA("alGetProcAddress")) ) return false;
	if( ! (pfalGetString				= (ALGETSTRING)GPA("alGetString")) ) return false;
	if( ! (pfalIsExtensionPresent		= (ALISEXTENSIONPRESENT)GPA("alIsExtensionPresent")) ) return false;
	if( ! (pfalIsEnabled				= (ALISENABLED)GPA("alIsEnabled")) ) return false;
	if( ! (pfalListenerf				= (ALLISTENERF)GPA("alListenerf")) ) return false;
	if( ! (pfalListener3f				= (ALLISTENER3F)GPA("alListener3f")) ) return false;
	if( ! (pfalListenerfv				= (ALLISTENERFV)GPA("alListenerfv")) ) return false;
	if( ! (pfalListeneri				= (ALLISTENERI)GPA("alListeneri")) ) return false;
	if( ! (pfalGetListenerf				= (ALGETLISTENERF)GPA("alGetListenerf")) ) return false;
	if( ! (pfalGetListener3f			= (ALGETLISTENER3F)GPA("alGetListener3f")) ) return false;
	if( ! (pfalGetListenerfv			= (ALGETLISTENERFV)GPA("alGetListenerfv")) ) return false;
	if( ! (pfalGetListeneri				= (ALGETLISTENERI)GPA("alGetListeneri")) ) return false;
	if( ! (pfalGenSources				= (ALGENSOURCES)GPA("alGenSources")) ) return false;
	if( ! (pfalDeleteSources			= (ALDELETESOURCES)GPA("alDeleteSources")) ) return false;
	if( ! (pfalIsSource					= (ALISSOURCE)GPA("alIsSource")) ) return false;
	if( ! (pfalSourcef					= (ALSOURCEF)GPA("alSourcef")) ) return false;
	if( ! (pfalSourcefv					= (ALSOURCEFV)GPA("alSourcefv")) ) return false;
	if( ! (pfalSource3f					= (ALSOURCE3F)GPA("alSource3f")) ) return false;
	if( ! (pfalSourcei					= (ALSOURCEI)GPA("alSourcei")) ) return false;
	if( ! (pfalGetSourcef				= (ALGETSOURCEF)GPA("alGetSourcef")) ) return false;
	if( ! (pfalGetSource3f				= (ALGETSOURCE3F)GPA("alGetSource3f")) ) return false;
	if( ! (pfalGetSourcefv				= (ALGETSOURCEFV)GPA("alGetSourcefv")) ) return false;
	if( ! (pfalGetSourcei				= (ALGETSOURCEI)GPA("alGetSourcei")) ) return false;
	if( ! (pfalSourcePlay				= (ALSOURCEPLAY)GPA("alSourcePlay")) ) return false;
	if( ! (pfalSourcePlayv				= (ALSOURCEPLAYV)GPA("alSourcePlayv")) ) return false;
	if( ! (pfalSourcePause				= (ALSOURCEPAUSE)GPA("alSourcePause")) ) return false;
	if( ! (pfalSourcePausev				= (ALSOURCEPAUSEV)GPA("alSourcePausev")) ) return false;
	if( ! (pfalSourceStop				= (ALSOURCESTOP)GPA("alSourceStop")) ) return false;
	if( ! (pfalSourceStopv				= (ALSOURCESTOPV)GPA("alSourceStopv")) ) return false;
	if( ! (pfalSourceRewind				= (ALSOURCEREWIND)GPA("alSourceRewind")) ) return false;
	if( ! (pfalSourceRewindv			= (ALSOURCEREWINDV)GPA("alSourceRewindv")) ) return false;
	if( ! (pfalSourceQueueBuffers		= (ALSOURCEQUEUEBUFFERS)GPA("alSourceQueueBuffers")) ) return false;
	if( ! (pfalSourceUnqueueBuffers		= (ALSOURCEUNQUEUEBUFFERS)GPA("alSourceUnqueueBuffers")) ) return false;


	return true;

}
void GL2Init()
{
    #define GPA(x) wglGetProcAddress(x)

    // OpenGL 1.2.
    glCopyTexSubImage3D         = reinterpret_cast<PFNGLCOPYTEXSUBIMAGE3DPROC>(GPA("glCopyTexSubImage3D"));
    glDrawRangeElements         = reinterpret_cast<PFNGLDRAWRANGEELEMENTSPROC>(GPA("glDrawRangeElements"));
    glTexImage3D                = reinterpret_cast<PFNGLTEXIMAGE3DPROC>(GPA("glTexImage3D"));
    glTexSubImage3D             = reinterpret_cast<PFNGLTEXSUBIMAGE3DPROC>(GPA("glTexSubImage3D"));

    // OpenGL 1.3.
    glActiveTexture             = reinterpret_cast<PFNGLACTIVETEXTUREPROC>(GPA("glActiveTexture"));
    glClientActiveTexture       = reinterpret_cast<PFNGLCLIENTACTIVETEXTUREPROC>(GPA("glClientActiveTexture"));
    glMultiTexCoord1d           = reinterpret_cast<PFNGLMULTITEXCOORD1DPROC>(GPA("glMultiTexCoord1d"));
    glMultiTexCoord1dv          = reinterpret_cast<PFNGLMULTITEXCOORD1DVPROC>(GPA("glMultiTexCoord1dv"));
    glMultiTexCoord1f           = reinterpret_cast<PFNGLMULTITEXCOORD1FPROC>(GPA("glMultiTexCoord1f"));
    glMultiTexCoord1fv          = reinterpret_cast<PFNGLMULTITEXCOORD1FVPROC>(GPA("glMultiTexCoord1fv"));
    glMultiTexCoord1i           = reinterpret_cast<PFNGLMULTITEXCOORD1IPROC>(GPA("glMultiTexCoord1i"));
    glMultiTexCoord1iv          = reinterpret_cast<PFNGLMULTITEXCOORD1IVPROC>(GPA("glMultiTexCoord1iv"));
    glMultiTexCoord1s           = reinterpret_cast<PFNGLMULTITEXCOORD1SPROC>(GPA("glMultiTexCoord1s"));
    glMultiTexCoord1sv          = reinterpret_cast<PFNGLMULTITEXCOORD1SVPROC>(GPA("glMultiTexCoord1sv"));
    glMultiTexCoord2d           = reinterpret_cast<PFNGLMULTITEXCOORD2DPROC>(GPA("glMultiTexCoord2d"));
    glMultiTexCoord2dv          = reinterpret_cast<PFNGLMULTITEXCOORD2DVPROC>(GPA("glMultiTexCoord2dv"));
    glMultiTexCoord2f           = reinterpret_cast<PFNGLMULTITEXCOORD2FPROC>(GPA("glMultiTexCoord2f"));
    glMultiTexCoord2fv          = reinterpret_cast<PFNGLMULTITEXCOORD2FVPROC>(GPA("glMultiTexCoord2fv"));
    glMultiTexCoord2i           = reinterpret_cast<PFNGLMULTITEXCOORD2IPROC>(GPA("glMultiTexCoord2i"));
    glMultiTexCoord2iv          = reinterpret_cast<PFNGLMULTITEXCOORD2IVPROC>(GPA("glMultiTexCoord2iv"));
    glMultiTexCoord2s           = reinterpret_cast<PFNGLMULTITEXCOORD2SPROC>(GPA("glMultiTexCoord2s"));
    glMultiTexCoord2sv          = reinterpret_cast<PFNGLMULTITEXCOORD2SVPROC>(GPA("glMultiTexCoord2sv"));
    glMultiTexCoord3d           = reinterpret_cast<PFNGLMULTITEXCOORD3DPROC>(GPA("glMultiTexCoord3d"));
    glMultiTexCoord3dv          = reinterpret_cast<PFNGLMULTITEXCOORD3DVPROC>(GPA("glMultiTexCoord3dv"));
    glMultiTexCoord3f           = reinterpret_cast<PFNGLMULTITEXCOORD3FPROC>(GPA("glMultiTexCoord3f"));
    glMultiTexCoord3fv          = reinterpret_cast<PFNGLMULTITEXCOORD3FVPROC>(GPA("glMultiTexCoord3fv"));
    glMultiTexCoord3i           = reinterpret_cast<PFNGLMULTITEXCOORD3IPROC>(GPA("glMultiTexCoord3i"));
    glMultiTexCoord3iv          = reinterpret_cast<PFNGLMULTITEXCOORD3IVPROC>(GPA("glMultiTexCoord3iv"));
    glMultiTexCoord3s           = reinterpret_cast<PFNGLMULTITEXCOORD3SPROC>(GPA("glMultiTexCoord3s"));
    glMultiTexCoord3sv          = reinterpret_cast<PFNGLMULTITEXCOORD3SVPROC>(GPA("glMultiTexCoord3sv"));
    glMultiTexCoord4d           = reinterpret_cast<PFNGLMULTITEXCOORD4DPROC>(GPA("glMultiTexCoord4d"));
    glMultiTexCoord4dv          = reinterpret_cast<PFNGLMULTITEXCOORD4DVPROC>(GPA("glMultiTexCoord4dv"));
    glMultiTexCoord4f           = reinterpret_cast<PFNGLMULTITEXCOORD4FPROC>(GPA("glMultiTexCoord4f"));
    glMultiTexCoord4fv          = reinterpret_cast<PFNGLMULTITEXCOORD4FVPROC>(GPA("glMultiTexCoord4fv"));
    glMultiTexCoord4i           = reinterpret_cast<PFNGLMULTITEXCOORD4IPROC>(GPA("glMultiTexCoord4i"));
    glMultiTexCoord4iv          = reinterpret_cast<PFNGLMULTITEXCOORD4IVPROC>(GPA("glMultiTexCoord4iv"));
    glMultiTexCoord4s           = reinterpret_cast<PFNGLMULTITEXCOORD4SPROC>(GPA("glMultiTexCoord4s"));
    glMultiTexCoord4sv          = reinterpret_cast<PFNGLMULTITEXCOORD4SVPROC>(GPA("glMultiTexCoord4sv"));
    glLoadTransposeMatrixf      = reinterpret_cast<PFNGLLOADTRANSPOSEMATRIXFPROC>(GPA("glLoadTransposeMatrixf"));
    glLoadTransposeMatrixd      = reinterpret_cast<PFNGLLOADTRANSPOSEMATRIXDPROC>(GPA("glLoadTransposeMatrixd"));
    glMultTransposeMatrixf      = reinterpret_cast<PFNGLMULTTRANSPOSEMATRIXFPROC>(GPA("glMultTransposeMatrixf"));
    glMultTransposeMatrixd      = reinterpret_cast<PFNGLMULTTRANSPOSEMATRIXDPROC>(GPA("glMultTransposeMatrixd"));
    glSampleCoverage            = reinterpret_cast<PFNGLSAMPLECOVERAGEPROC>(GPA("glSampleCoverage"));
    glCompressedTexImage3D      = reinterpret_cast<PFNGLCOMPRESSEDTEXIMAGE3DPROC>(GPA("glCompressedTexImage3D"));
    glCompressedTexImage2D      = reinterpret_cast<PFNGLCOMPRESSEDTEXIMAGE2DPROC>(GPA("glCompressedTexImage2D"));
    glCompressedTexImage1D      = reinterpret_cast<PFNGLCOMPRESSEDTEXIMAGE1DPROC>(GPA("glCompressedTexImage1D"));
    glCompressedTexSubImage3D   = reinterpret_cast<PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC>(GPA("glCompressedTexSubImage3D"));
    glCompressedTexSubImage2D   = reinterpret_cast<PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC>(GPA("glCompressedTexSubImage2D"));
    glCompressedTexSubImage1D   = reinterpret_cast<PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC>(GPA("glCompressedTexSubImage1D"));
    glGetCompressedTexImage     = reinterpret_cast<PFNGLGETCOMPRESSEDTEXIMAGEPROC>(GPA("glGetCompressedTexImage"));

    // OpenGL 1.4.
    glMultiDrawArrays           = reinterpret_cast<PFNGLMULTIDRAWARRAYSPROC>(GPA("glMultiDrawArrays"));
    glMultiDrawElements         = reinterpret_cast<PFNGLMULTIDRAWELEMENTSPROC>(GPA("glMultiDrawElements"));
    glPointParameterf           = reinterpret_cast<PFNGLPOINTPARAMETERFPROC>(GPA("glPointParameterf"));
    glPointParameterfv          = reinterpret_cast<PFNGLPOINTPARAMETERFVPROC>(GPA("glPointParameterfv"));
    glSecondaryColor3b          = reinterpret_cast<PFNGLSECONDARYCOLOR3BPROC>(GPA("glSecondaryColor3b"));
    glSecondaryColor3bv         = reinterpret_cast<PFNGLSECONDARYCOLOR3BVPROC>(GPA("glSecondaryColor3bv"));
    glSecondaryColor3d          = reinterpret_cast<PFNGLSECONDARYCOLOR3DPROC>(GPA("glSecondaryColor3d"));
    glSecondaryColor3dv         = reinterpret_cast<PFNGLSECONDARYCOLOR3DVPROC>(GPA("glSecondaryColor3dv"));
    glSecondaryColor3f          = reinterpret_cast<PFNGLSECONDARYCOLOR3FPROC>(GPA("glSecondaryColor3f"));
    glSecondaryColor3fv         = reinterpret_cast<PFNGLSECONDARYCOLOR3FVPROC>(GPA("glSecondaryColor3fv"));
    glSecondaryColor3i          = reinterpret_cast<PFNGLSECONDARYCOLOR3IPROC>(GPA("glSecondaryColor3i"));
    glSecondaryColor3iv         = reinterpret_cast<PFNGLSECONDARYCOLOR3IVPROC>(GPA("glSecondaryColor3iv"));
    glSecondaryColor3s          = reinterpret_cast<PFNGLSECONDARYCOLOR3SPROC>(GPA("glSecondaryColor3s"));
    glSecondaryColor3sv         = reinterpret_cast<PFNGLSECONDARYCOLOR3SVPROC>(GPA("glSecondaryColor3sv"));
    glSecondaryColor3ub         = reinterpret_cast<PFNGLSECONDARYCOLOR3UBPROC>(GPA("glSecondaryColor3ub"));
    glSecondaryColor3ubv        = reinterpret_cast<PFNGLSECONDARYCOLOR3UBVPROC>(GPA("glSecondaryColor3ubv"));
    glSecondaryColor3ui         = reinterpret_cast<PFNGLSECONDARYCOLOR3UIPROC>(GPA("glSecondaryColor3ui"));
    glSecondaryColor3uiv        = reinterpret_cast<PFNGLSECONDARYCOLOR3UIVPROC>(GPA("glSecondaryColor3uiv"));
    glSecondaryColor3us         = reinterpret_cast<PFNGLSECONDARYCOLOR3USPROC>(GPA("glSecondaryColor3us"));
    glSecondaryColor3usv        = reinterpret_cast<PFNGLSECONDARYCOLOR3USVPROC>(GPA("glSecondaryColor3usv"));
    glSecondaryColorPointer     = reinterpret_cast<PFNGLSECONDARYCOLORPOINTERPROC>(GPA("glSecondaryColorPointer"));
    glBlendFuncSeparate         = reinterpret_cast<PFNGLBLENDFUNCSEPARATEPROC>(GPA("glBlendFuncSeparate"));
    glWindowPos2d               = reinterpret_cast<PFNGLWINDOWPOS2DPROC>(GPA("glWindowPos2d"));
    glWindowPos2f               = reinterpret_cast<PFNGLWINDOWPOS2FPROC>(GPA("glWindowPos2f"));
    glWindowPos2i               = reinterpret_cast<PFNGLWINDOWPOS2IPROC>(GPA("glWindowPos2i"));
    glWindowPos2s               = reinterpret_cast<PFNGLWINDOWPOS2SPROC>(GPA("glWindowPos2s"));
    glWindowPos2dv              = reinterpret_cast<PFNGLWINDOWPOS2DVPROC>(GPA("glWindowPos2dv"));
    glWindowPos2fv              = reinterpret_cast<PFNGLWINDOWPOS2FVPROC>(GPA("glWindowPos2fv"));
    glWindowPos2iv              = reinterpret_cast<PFNGLWINDOWPOS2IVPROC>(GPA("glWindowPos2iv"));
    glWindowPos2sv              = reinterpret_cast<PFNGLWINDOWPOS2SVPROC>(GPA("glWindowPos2sv"));
    glWindowPos3d               = reinterpret_cast<PFNGLWINDOWPOS3DPROC>(GPA("glWindowPos3d"));
    glWindowPos3f               = reinterpret_cast<PFNGLWINDOWPOS3FPROC>(GPA("glWindowPos3f"));
    glWindowPos3i               = reinterpret_cast<PFNGLWINDOWPOS3IPROC>(GPA("glWindowPos3i"));
    glWindowPos3s               = reinterpret_cast<PFNGLWINDOWPOS3SPROC>(GPA("glWindowPos3s"));
    glWindowPos3dv              = reinterpret_cast<PFNGLWINDOWPOS3DVPROC>(GPA("glWindowPos3dv"));
    glWindowPos3fv              = reinterpret_cast<PFNGLWINDOWPOS3FVPROC>(GPA("glWindowPos3fv"));
    glWindowPos3iv              = reinterpret_cast<PFNGLWINDOWPOS3IVPROC>(GPA("glWindowPos3iv"));
    glWindowPos3sv              = reinterpret_cast<PFNGLWINDOWPOS3SVPROC>(GPA("glWindowPos3sv"));

    // OpenGL 1.5.
    glGenQueries                = reinterpret_cast<PFNGLGENQUERIESPROC>(GPA("glGenQueries"));
    glDeleteQueries             = reinterpret_cast<PFNGLDELETEQUERIESPROC>(GPA("glDeleteQueries"));
    glIsQuery                   = reinterpret_cast<PFNGLISQUERYPROC>(GPA("glIsQuery"));
    glBeginQuery                = reinterpret_cast<PFNGLBEGINQUERYPROC>(GPA("glBeginQuery"));
    glEndQuery                  = reinterpret_cast<PFNGLENDQUERYPROC>(GPA("glEndQuery"));
    glGetQueryiv                = reinterpret_cast<PFNGLGETQUERYIVPROC>(GPA("glGetQueryiv"));
    glGetQueryObjectiv          = reinterpret_cast<PFNGLGETQUERYOBJECTIVPROC>(GPA("glGetQueryObjectiv"));
    glGetQueryObjectuiv         = reinterpret_cast<PFNGLGETQUERYOBJECTUIVPROC>(GPA("glGetQueryObjectuiv"));
    glBindBuffer                = reinterpret_cast<PFNGLBINDBUFFERPROC>(GPA("glBindBuffer"));
    glDeleteBuffers             = reinterpret_cast<PFNGLDELETEBUFFERSPROC>(GPA("glDeleteBuffers"));
    glGenBuffers                = reinterpret_cast<PFNGLGENBUFFERSPROC>(GPA("glGenBuffers"));
    glIsBuffer                  = reinterpret_cast<PFNGLISBUFFERPROC>(GPA("glIsBuffer"));
    glBufferData                = reinterpret_cast<PFNGLBUFFERDATAPROC>(GPA("glBufferData"));
    glBufferSubData             = reinterpret_cast<PFNGLBUFFERSUBDATAPROC>(GPA("glBufferSubData"));
    glGetBufferSubData          = reinterpret_cast<PFNGLGETBUFFERSUBDATAPROC>(GPA("glGetBufferSubData"));
    glMapBuffer                 = reinterpret_cast<PFNGLMAPBUFFERPROC>(GPA("glMapBuffer"));
    glUnmapBuffer               = reinterpret_cast<PFNGLUNMAPBUFFERPROC>(GPA("glUnmapBuffer"));
    glGetBufferParameteriv      = reinterpret_cast<PFNGLGETBUFFERPARAMETERIVPROC>(GPA("glGetBufferParameteriv"));
    glGetBufferPointerv         = reinterpret_cast<PFNGLGETBUFFERPOINTERVPROC>(GPA("glGetBufferPointerv"));

    // OpenGL 2.0.
    glBlendEquationSeparate     = reinterpret_cast<PFNGLBLENDEQUATIONSEPARATEPROC>(GPA("glBlendEquationSeparate"));
    glDrawBuffers               = reinterpret_cast<PFNGLDRAWBUFFERSPROC>(GPA("glDrawBuffers"));
    glStencilOpSeparate         = reinterpret_cast<PFNGLSTENCILOPSEPARATEPROC>(GPA("glStencilOpSeparate"));
    glStencilFuncSeparate       = reinterpret_cast<PFNGLSTENCILFUNCSEPARATEPROC>(GPA("glStencilFuncSeparate"));
    glStencilMaskSeparate       = reinterpret_cast<PFNGLSTENCILMASKSEPARATEPROC>(GPA("glStencilMaskSeparate"));
    glAttachShader              = reinterpret_cast<PFNGLATTACHSHADERPROC>(GPA("glAttachShader"));
    glBindAttribLocation        = reinterpret_cast<PFNGLBINDATTRIBLOCATIONPROC>(GPA("glBindAttribLocation"));
    glCompileShader             = reinterpret_cast<PFNGLCOMPILESHADERPROC>(GPA("glCompileShader"));
    glCreateProgram             = reinterpret_cast<PFNGLCREATEPROGRAMPROC>(GPA("glCreateProgram"));
    glCreateShader              = reinterpret_cast<PFNGLCREATESHADERPROC>(GPA("glCreateShader"));
    glDeleteProgram             = reinterpret_cast<PFNGLDELETEPROGRAMPROC>(GPA("glDeleteProgram"));
    glDeleteShader              = reinterpret_cast<PFNGLDELETESHADERPROC>(GPA("glDeleteShader"));
    glDetachShader              = reinterpret_cast<PFNGLDETACHSHADERPROC>(GPA("glDetachShader"));
    glDisableVertexAttribArray  = reinterpret_cast<PFNGLDISABLEVERTEXATTRIBARRAYPROC>(GPA("glDisableVertexAttribArray"));
    glEnableVertexAttribArray   = reinterpret_cast<PFNGLENABLEVERTEXATTRIBARRAYPROC>(GPA("glEnableVertexAttribArray"));
    glGetActiveAttrib           = reinterpret_cast<PFNGLGETACTIVEATTRIBPROC>(GPA("glGetActiveAttrib"));
    glGetActiveUniform          = reinterpret_cast<PFNGLGETACTIVEUNIFORMPROC>(GPA("glGetActiveUniform"));
    glGetAttachedShaders        = reinterpret_cast<PFNGLGETATTACHEDSHADERSPROC>(GPA("glGetAttachedShaders"));
    glGetAttribLocation         = reinterpret_cast<PFNGLGETATTRIBLOCATIONPROC>(GPA("glGetAttribLocation"));
    glGetProgramiv              = reinterpret_cast<PFNGLGETPROGRAMIVPROC>(GPA("glGetProgramiv"));
    glGetProgramInfoLog         = reinterpret_cast<PFNGLGETPROGRAMINFOLOGPROC>(GPA("glGetProgramInfoLog"));
    glGetShaderiv               = reinterpret_cast<PFNGLGETSHADERIVPROC>(GPA("glGetShaderiv"));
    glGetShaderInfoLog          = reinterpret_cast<PFNGLGETSHADERINFOLOGPROC>(GPA("glGetShaderInfoLog"));
    glGetShaderSource           = reinterpret_cast<PFNGLGETSHADERSOURCEPROC>(GPA("glGetShaderSource"));
    glGetUniformLocation        = reinterpret_cast<PFNGLGETUNIFORMLOCATIONPROC>(GPA("glGetUniformLocation"));
    glGetUniformfv              = reinterpret_cast<PFNGLGETUNIFORMFVPROC>(GPA("glGetUniformfv"));
    glGetUniformiv              = reinterpret_cast<PFNGLGETUNIFORMIVPROC>(GPA("glGetUniformiv"));
    glGetVertexAttribdv         = reinterpret_cast<PFNGLGETVERTEXATTRIBDVPROC>(GPA("glGetVertexAttribdv"));
    glGetVertexAttribfv         = reinterpret_cast<PFNGLGETVERTEXATTRIBFVPROC>(GPA("glGetVertexAttribfv"));
    glGetVertexAttribiv         = reinterpret_cast<PFNGLGETVERTEXATTRIBIVPROC>(GPA("glGetVertexAttribiv"));
    glGetVertexAttribPointerv   = reinterpret_cast<PFNGLGETVERTEXATTRIBPOINTERVPROC>(GPA("glGetVertexAttribPointerv"));
    glIsProgram                 = reinterpret_cast<PFNGLISPROGRAMPROC>(GPA("glIsProgram"));
    glIsShader                  = reinterpret_cast<PFNGLISSHADERPROC>(GPA("glIsShader"));
    glLinkProgram               = reinterpret_cast<PFNGLLINKPROGRAMPROC>(GPA("glLinkProgram"));
    glShaderSource              = reinterpret_cast<PFNGLSHADERSOURCEPROC>(GPA("glShaderSource"));
    glUseProgram                = reinterpret_cast<PFNGLUSEPROGRAMPROC>(GPA("glUseProgram"));
    glUniform1f                 = reinterpret_cast<PFNGLUNIFORM1FPROC>(GPA("glUniform1f"));
    glUniform2f                 = reinterpret_cast<PFNGLUNIFORM2FPROC>(GPA("glUniform2f"));
    glUniform3f                 = reinterpret_cast<PFNGLUNIFORM3FPROC>(GPA("glUniform3f"));
    glUniform4f                 = reinterpret_cast<PFNGLUNIFORM4FPROC>(GPA("glUniform4f"));
    glUniform1i                 = reinterpret_cast<PFNGLUNIFORM1IPROC>(GPA("glUniform1i"));
    glUniform2i                 = reinterpret_cast<PFNGLUNIFORM2IPROC>(GPA("glUniform2i"));
    glUniform3i                 = reinterpret_cast<PFNGLUNIFORM3IPROC>(GPA("glUniform3i"));
    glUniform4i                 = reinterpret_cast<PFNGLUNIFORM4IPROC>(GPA("glUniform4i"));
    glUniform1fv                = reinterpret_cast<PFNGLUNIFORM1FVPROC>(GPA("glUniform1fv"));
    glUniform2fv                = reinterpret_cast<PFNGLUNIFORM2FVPROC>(GPA("glUniform2fv"));
    glUniform3fv                = reinterpret_cast<PFNGLUNIFORM3FVPROC>(GPA("glUniform3fv"));
    glUniform4fv                = reinterpret_cast<PFNGLUNIFORM4FVPROC>(GPA("glUniform4fv"));
    glUniform1iv                = reinterpret_cast<PFNGLUNIFORM1IVPROC>(GPA("glUniform1iv"));
    glUniform2iv                = reinterpret_cast<PFNGLUNIFORM2IVPROC>(GPA("glUniform2iv"));
    glUniform3iv                = reinterpret_cast<PFNGLUNIFORM3IVPROC>(GPA("glUniform3iv"));
    glUniform4iv                = reinterpret_cast<PFNGLUNIFORM4IVPROC>(GPA("glUniform4iv"));
    glUniformMatrix2fv          = reinterpret_cast<PFNGLUNIFORMMATRIX2FVPROC>(GPA("glUniformMatrix2fv"));
    glUniformMatrix3fv          = reinterpret_cast<PFNGLUNIFORMMATRIX3FVPROC>(GPA("glUniformMatrix3fv"));
    glUniformMatrix4fv          = reinterpret_cast<PFNGLUNIFORMMATRIX4FVPROC>(GPA("glUniformMatrix4fv"));
    glValidateProgram           = reinterpret_cast<PFNGLVALIDATEPROGRAMPROC>(GPA("glValidateProgram"));
    glVertexAttrib1d            = reinterpret_cast<PFNGLVERTEXATTRIB1DPROC>(GPA("glVertexAttrib1d"));
    glVertexAttrib1dv           = reinterpret_cast<PFNGLVERTEXATTRIB1DVPROC>(GPA("glVertexAttrib1dv"));
    glVertexAttrib1f            = reinterpret_cast<PFNGLVERTEXATTRIB1FPROC>(GPA("glVertexAttrib1f"));
    glVertexAttrib1fv           = reinterpret_cast<PFNGLVERTEXATTRIB1FVPROC>(GPA("glVertexAttrib1fv"));
    glVertexAttrib1s            = reinterpret_cast<PFNGLVERTEXATTRIB1SPROC>(GPA("glVertexAttrib1s"));
    glVertexAttrib1sv           = reinterpret_cast<PFNGLVERTEXATTRIB1SVPROC>(GPA("glVertexAttrib1sv"));
    glVertexAttrib2d            = reinterpret_cast<PFNGLVERTEXATTRIB2DPROC>(GPA("glVertexAttrib2d"));
    glVertexAttrib2dv           = reinterpret_cast<PFNGLVERTEXATTRIB2DVPROC>(GPA("glVertexAttrib2dv"));
    glVertexAttrib2f            = reinterpret_cast<PFNGLVERTEXATTRIB2FPROC>(GPA("glVertexAttrib2f"));
    glVertexAttrib2fv           = reinterpret_cast<PFNGLVERTEXATTRIB2FVPROC>(GPA("glVertexAttrib2fv"));
    glVertexAttrib2s            = reinterpret_cast<PFNGLVERTEXATTRIB2SPROC>(GPA("glVertexAttrib2s"));
    glVertexAttrib2sv           = reinterpret_cast<PFNGLVERTEXATTRIB2SVPROC>(GPA("glVertexAttrib2sv"));
    glVertexAttrib3d            = reinterpret_cast<PFNGLVERTEXATTRIB3DPROC>(GPA("glVertexAttrib3d"));
    glVertexAttrib3dv           = reinterpret_cast<PFNGLVERTEXATTRIB3DVPROC>(GPA("glVertexAttrib3dv"));
    glVertexAttrib3f            = reinterpret_cast<PFNGLVERTEXATTRIB3FPROC>(GPA("glVertexAttrib3f"));
    glVertexAttrib3fv           = reinterpret_cast<PFNGLVERTEXATTRIB3FVPROC>(GPA("glVertexAttrib3fv"));
    glVertexAttrib3s            = reinterpret_cast<PFNGLVERTEXATTRIB3SPROC>(GPA("glVertexAttrib3s"));
    glVertexAttrib3sv           = reinterpret_cast<PFNGLVERTEXATTRIB3SVPROC>(GPA("glVertexAttrib3sv"));
    glVertexAttrib4Nbv          = reinterpret_cast<PFNGLVERTEXATTRIB4NBVPROC>(GPA("glVertexAttrib4Nbv"));
    glVertexAttrib4Niv          = reinterpret_cast<PFNGLVERTEXATTRIB4NIVPROC>(GPA("glVertexAttrib4Niv"));
    glVertexAttrib4Nsv          = reinterpret_cast<PFNGLVERTEXATTRIB4NSVPROC>(GPA("glVertexAttrib4Nsv"));
    glVertexAttrib4Nub          = reinterpret_cast<PFNGLVERTEXATTRIB4NUBPROC>(GPA("glVertexAttrib4Nub"));
    glVertexAttrib4Nubv         = reinterpret_cast<PFNGLVERTEXATTRIB4NUBVPROC>(GPA("glVertexAttrib4Nubv"));
    glVertexAttrib4Nuiv         = reinterpret_cast<PFNGLVERTEXATTRIB4NUIVPROC>(GPA("glVertexAttrib4Nuiv"));
    glVertexAttrib4Nusv         = reinterpret_cast<PFNGLVERTEXATTRIB4NUSVPROC>(GPA("glVertexAttrib4Nusv"));
    glVertexAttrib4bv           = reinterpret_cast<PFNGLVERTEXATTRIB4BVPROC>(GPA("glVertexAttrib4bv"));
    glVertexAttrib4d            = reinterpret_cast<PFNGLVERTEXATTRIB4DPROC>(GPA("glVertexAttrib4d"));
    glVertexAttrib4dv           = reinterpret_cast<PFNGLVERTEXATTRIB4DVPROC>(GPA("glVertexAttrib4dv"));
    glVertexAttrib4f            = reinterpret_cast<PFNGLVERTEXATTRIB4FPROC>(GPA("glVertexAttrib4f"));
    glVertexAttrib4fv           = reinterpret_cast<PFNGLVERTEXATTRIB4FVPROC>(GPA("glVertexAttrib4fv"));
    glVertexAttrib4iv           = reinterpret_cast<PFNGLVERTEXATTRIB4IVPROC>(GPA("glVertexAttrib4iv"));
    glVertexAttrib4s            = reinterpret_cast<PFNGLVERTEXATTRIB4SPROC>(GPA("glVertexAttrib4s"));
    glVertexAttrib4sv           = reinterpret_cast<PFNGLVERTEXATTRIB4SVPROC>(GPA("glVertexAttrib4sv"));
    glVertexAttrib4ubv          = reinterpret_cast<PFNGLVERTEXATTRIB4UBVPROC>(GPA("glVertexAttrib4ubv"));
    glVertexAttrib4uiv          = reinterpret_cast<PFNGLVERTEXATTRIB4UIVPROC>(GPA("glVertexAttrib4uiv"));
    glVertexAttrib4usv          = reinterpret_cast<PFNGLVERTEXATTRIB4USVPROC>(GPA("glVertexAttrib4usv"));
    glVertexAttribPointer       = reinterpret_cast<PFNGLVERTEXATTRIBPOINTERPROC>(GPA("glVertexAttribPointer"));

    // OpenGL 2.1.
    glUniformMatrix2x3fv        = reinterpret_cast<PFNGLUNIFORMMATRIX2X3FVPROC>(GPA("glUniformMatrix2x3fv"));
    glUniformMatrix3x2fv        = reinterpret_cast<PFNGLUNIFORMMATRIX3X2FVPROC>(GPA("glUniformMatrix3x2fv"));
    glUniformMatrix2x4fv        = reinterpret_cast<PFNGLUNIFORMMATRIX2X4FVPROC>(GPA("glUniformMatrix2x4fv"));
    glUniformMatrix4x2fv        = reinterpret_cast<PFNGLUNIFORMMATRIX4X2FVPROC>(GPA("glUniformMatrix4x2fv"));
    glUniformMatrix3x4fv        = reinterpret_cast<PFNGLUNIFORMMATRIX3X4FVPROC>(GPA("glUniformMatrix3x4fv"));
    glUniformMatrix4x3fv        = reinterpret_cast<PFNGLUNIFORMMATRIX4X3FVPROC>(GPA("glUniformMatrix4x3fv"));

    #undef GPA
}
Example #14
0
int load_pgpsdk_dll(HMODULE mod) {

	GPA(_pgp_init);
	GPA(_pgp_done);
	GPA(_pgp_open_keyrings);
	GPA(_pgp_close_keyrings);
	GPA(_pgp_get_version);
	GPA(_pgp_get_error);
	GPA(_pgp_size_keyid);
	GPA(_pgp_select_keyid);
	GPA(_pgp_encrypt_keydb);
	GPA(_pgp_decrypt_keydb);
//	GPA(_pgp_check_key);
	GPA(_pgp_encrypt_key);
	GPA(_pgp_decrypt_key);

	return 1;
}
Example #15
0
BOOL NtdllBitmap::InitializeNtdllBitmap()
{
	RtlInitializeBitMap = NULL;
	RtlFindClearBits = NULL;
	RtlFindClearBitsAndSet = NULL;
	RtlFindClearRuns = NULL;
	RtlFindLastBackwardRunClear = NULL;
	RtlFindLongestRunClear = NULL;
	RtlFindNextForwardRunClear = NULL;
	RtlFindSetBits = NULL;
	RtlFindSetBitsAndClear = NULL;
	RtlSetAllBits = NULL;
	RtlSetBits = NULL;
	RtlClearAllBits = NULL;
	RtlClearBits = NULL;
	RtlNumberOfClearBits = NULL;
	RtlNumberOfSetBits = NULL;
	RtlAreBitsClear = NULL;
	RtlAreBitsSet = NULL;

	INIT();
	GPA(RtlInitializeBitMap);
	GPA(RtlFindClearBits);
	GPA(RtlFindClearBitsAndSet);
	GPA(RtlFindClearRuns);
	GPA(RtlFindLastBackwardRunClear);
	GPA(RtlFindLongestRunClear);
	GPA(RtlFindNextForwardRunClear);
	GPA(RtlFindSetBits);
	GPA(RtlFindSetBitsAndClear);
	GPA(RtlSetAllBits);
	GPA(RtlSetBits);
	GPA(RtlClearAllBits);
	GPA(RtlClearBits);
	GPA(RtlNumberOfClearBits);
	GPA(RtlNumberOfSetBits);
	GPA(RtlAreBitsClear);
	GPA(RtlAreBitsSet);

	return TRUE;
}
Example #16
0
/*
=======================================================================================================================================
QAL_Init
=======================================================================================================================================
*/
qboolean QAL_Init(const char *libname) {

	if (OpenALLib) {
		return qtrue;
	}

	if (!(OpenALLib = Sys_LoadDll(libname, qtrue)))
		return qfalse;

	alinit_fail = qfalse;

	qalEnable = GPA("alEnable");
	qalDisable = GPA("alDisable");
	qalIsEnabled = GPA("alIsEnabled");
	qalGetString = GPA("alGetString");
	qalGetBooleanv = GPA("alGetBooleanv");
	qalGetIntegerv = GPA("alGetIntegerv");
	qalGetFloatv = GPA("alGetFloatv");
	qalGetDoublev = GPA("alGetDoublev");
	qalGetBoolean = GPA("alGetBoolean");
	qalGetInteger = GPA("alGetInteger");
	qalGetFloat = GPA("alGetFloat");
	qalGetDouble = GPA("alGetDouble");
	qalGetError = GPA("alGetError");
	qalIsExtensionPresent = GPA("alIsExtensionPresent");
	qalGetProcAddress = GPA("alGetProcAddress");
	qalGetEnumValue = GPA("alGetEnumValue");
	qalListenerf = GPA("alListenerf");
	qalListener3f = GPA("alListener3f");
	qalListenerfv = GPA("alListenerfv");
	qalListeneri = GPA("alListeneri");
	qalGetListenerf = GPA("alGetListenerf");
	qalGetListener3f = GPA("alGetListener3f");
	qalGetListenerfv = GPA("alGetListenerfv");
	qalGetListeneri = GPA("alGetListeneri");
	qalGenSources = GPA("alGenSources");
	qalDeleteSources = GPA("alDeleteSources");
	qalIsSource = GPA("alIsSource");
	qalSourcef = GPA("alSourcef");
	qalSource3f = GPA("alSource3f");
	qalSourcefv = GPA("alSourcefv");
	qalSourcei = GPA("alSourcei");
	qalGetSourcef = GPA("alGetSourcef");
	qalGetSource3f = GPA("alGetSource3f");
	qalGetSourcefv = GPA("alGetSourcefv");
	qalGetSourcei = GPA("alGetSourcei");
	qalSourcePlayv = GPA("alSourcePlayv");
	qalSourceStopv = GPA("alSourceStopv");
	qalSourceRewindv = GPA("alSourceRewindv");
	qalSourcePausev = GPA("alSourcePausev");
	qalSourcePlay = GPA("alSourcePlay");
	qalSourceStop = GPA("alSourceStop");
	qalSourceRewind = GPA("alSourceRewind");
	qalSourcePause = GPA("alSourcePause");
	qalSourceQueueBuffers = GPA("alSourceQueueBuffers");
	qalSourceUnqueueBuffers = GPA("alSourceUnqueueBuffers");
	qalGenBuffers = GPA("alGenBuffers");
	qalDeleteBuffers = GPA("alDeleteBuffers");
	qalIsBuffer = GPA("alIsBuffer");
	qalBufferData = GPA("alBufferData");
	qalGetBufferf = GPA("alGetBufferf");
	qalGetBufferi = GPA("alGetBufferi");
	qalDopplerFactor = GPA("alDopplerFactor");
	qalSpeedOfSound = GPA("alSpeedOfSound");
	qalDistanceModel = GPA("alDistanceModel");

	qalcCreateContext = GPA("alcCreateContext");
	qalcMakeContextCurrent = GPA("alcMakeContextCurrent");
	qalcProcessContext = GPA("alcProcessContext");
	qalcSuspendContext = GPA("alcSuspendContext");
	qalcDestroyContext = GPA("alcDestroyContext");
	qalcGetCurrentContext = GPA("alcGetCurrentContext");
	qalcGetContextsDevice = GPA("alcGetContextsDevice");
	qalcOpenDevice = GPA("alcOpenDevice");
	qalcCloseDevice = GPA("alcCloseDevice");
	qalcGetError = GPA("alcGetError");
	qalcIsExtensionPresent = GPA("alcIsExtensionPresent");
	qalcGetProcAddress = GPA("alcGetProcAddress");
	qalcGetEnumValue = GPA("alcGetEnumValue");
	qalcGetString = GPA("alcGetString");
	qalcGetIntegerv = GPA("alcGetIntegerv");
	qalcCaptureOpenDevice = GPA("alcCaptureOpenDevice");
	qalcCaptureCloseDevice = GPA("alcCaptureCloseDevice");
	qalcCaptureStart = GPA("alcCaptureStart");
	qalcCaptureStop = GPA("alcCaptureStop");
	qalcCaptureSamples = GPA("alcCaptureSamples");

	if (alinit_fail) {
		QAL_Shutdown();
		Com_Printf(" One or more symbols not found\n");
		return qfalse;
	}

	return qtrue;
}
Example #17
0
/*
* QAL_Init
*/
bool QAL_Init( const char *libname, bool verbose )
{
	if( OpenALLib )
		return true;

	if( verbose )
		Com_Printf( "Loading OpenAL library: %s\n", libname );

	if( ( OpenALLib = OBJLOAD( libname ) ) == 0 )
	{
#ifdef _WIN32
		return false;
#else
		char fn[2048];

		if( getcwd( fn, sizeof( fn ) ) == NULL )
			return false;

		Q_strncatz( fn, "/", sizeof( fn ) );
		Q_strncatz( fn, libname, sizeof( fn ) );

		if( ( OpenALLib = OBJLOAD( fn ) ) == 0 )
			return false;
#endif
	}

	alinit_fail = false;

	qalEnable = GPA( "alEnable" );
	qalDisable = GPA( "alDisable" );
	qalIsEnabled = GPA( "alIsEnabled" );
	qalGetString = GPA( "alGetString" );
	qalGetBooleanv = GPA( "alGetBooleanv" );
	qalGetIntegerv = GPA( "alGetIntegerv" );
	qalGetFloatv = GPA( "alGetFloatv" );
	qalGetDoublev = GPA( "alGetDoublev" );
	qalGetBoolean = GPA( "alGetBoolean" );
	qalGetInteger = GPA( "alGetInteger" );
	qalGetFloat = GPA( "alGetFloat" );
	qalGetDouble = GPA( "alGetDouble" );
	qalGetError = GPA( "alGetError" );
	qalIsExtensionPresent = GPA( "alIsExtensionPresent" );
	qalGetProcAddress = GPA( "alGetProcAddress" );
	qalGetEnumValue = GPA( "alGetEnumValue" );
	qalListenerf = GPA( "alListenerf" );
	qalListener3f = GPA( "alListener3f" );
	qalListenerfv = GPA( "alListenerfv" );
	qalListeneri = GPA( "alListeneri" );
	qalGetListenerf = GPA( "alGetListenerf" );
	qalGetListener3f = GPA( "alGetListener3f" );
	qalGetListenerfv = GPA( "alGetListenerfv" );
	qalGetListeneri = GPA( "alGetListeneri" );
	qalGenSources = GPA( "alGenSources" );
	qalDeleteSources = GPA( "alDeleteSources" );
	qalIsSource = GPA( "alIsSource" );
	qalSourcef = GPA( "alSourcef" );
	qalSource3f = GPA( "alSource3f" );
	qalSourcefv = GPA( "alSourcefv" );
	qalSourcei = GPA( "alSourcei" );
	qalGetSourcef = GPA( "alGetSourcef" );
	qalGetSource3f = GPA( "alGetSource3f" );
	qalGetSourcefv = GPA( "alGetSourcefv" );
	qalGetSourcei = GPA( "alGetSourcei" );
	qalSourcePlayv = GPA( "alSourcePlayv" );
	qalSourceStopv = GPA( "alSourceStopv" );
	qalSourceRewindv = GPA( "alSourceRewindv" );
	qalSourcePausev = GPA( "alSourcePausev" );
	qalSourcePlay = GPA( "alSourcePlay" );
	qalSourceStop = GPA( "alSourceStop" );
	qalSourceRewind = GPA( "alSourceRewind" );
	qalSourcePause = GPA( "alSourcePause" );
	qalSourceQueueBuffers = GPA( "alSourceQueueBuffers" );
	qalSourceUnqueueBuffers = GPA( "alSourceUnqueueBuffers" );
	qalGenBuffers = GPA( "alGenBuffers" );
	qalDeleteBuffers = GPA( "alDeleteBuffers" );
	qalIsBuffer = GPA( "alIsBuffer" );
	qalBufferData = GPA( "alBufferData" );
	qalGetBufferf = GPA( "alGetBufferf" );
	qalGetBufferi = GPA( "alGetBufferi" );
	qalDopplerFactor = GPA( "alDopplerFactor" );
	qalDopplerVelocity = GPA( "alDopplerVelocity" );
	qalSpeedOfSound = GPA( "alSpeedOfSound" );
	qalDistanceModel = GPA( "alDistanceModel" );

	qalcCreateContext = GPA( "alcCreateContext" );
	qalcMakeContextCurrent = GPA( "alcMakeContextCurrent" );
	qalcProcessContext = GPA( "alcProcessContext" );
	qalcSuspendContext = GPA( "alcSuspendContext" );
	qalcDestroyContext = GPA( "alcDestroyContext" );
	qalcGetCurrentContext = GPA( "alcGetCurrentContext" );
	qalcGetContextsDevice = GPA( "alcGetContextsDevice" );
	qalcOpenDevice = GPA( "alcOpenDevice" );
	qalcCloseDevice = GPA( "alcCloseDevice" );
	qalcGetError = GPA( "alcGetError" );
	qalcIsExtensionPresent = GPA( "alcIsExtensionPresent" );
	qalcGetProcAddress = GPA( "alcGetProcAddress" );
	qalcGetEnumValue = GPA( "alcGetEnumValue" );
	qalcGetString = GPA( "alcGetString" );
	qalcGetIntegerv = GPA( "alcGetIntegerv" );

	if( alinit_fail )
	{
		QAL_Shutdown();
		Com_Printf( " Error: One or more symbols not found.\n" );
		return false;
	}

	return true;
}
Example #18
0
// be careful to avoid using any non-trivial C runtime functions here!
// C runtime structures may be already corrupted and unusable at this point.
LONG WINAPI Sys_ExceptionFilter(LPEXCEPTION_POINTERS exceptionInfo)
{
    STACKFRAME64 stackFrame;
    PEXCEPTION_RECORD exception;
    PCONTEXT context;
    DWORD64 pc;
    SYMBOL_INFO *symbol;
    int count, ret, i;
    DWORD64 offset;
    BYTE buffer[sizeof(SYMBOL_INFO) + 256 - 1];
    IMAGEHLP_MODULE64 moduleInfo;
    char path[MAX_PATH];
    char execdir[MAX_PATH];
    HMODULE moduleHandle;
    SYSTEMTIME systemTime;
    OSVERSIONINFO vinfo;
    DWORD len;
    LONG action;

    // give previous filter a chance to handle this exception
    if (prevExceptionFilter) {
        action = prevExceptionFilter(exceptionInfo);
        if (action != EXCEPTION_CONTINUE_SEARCH) {
            return action;
        }
    }

    // debugger present? not our business
    if (IsDebuggerPresent()) {
        return EXCEPTION_CONTINUE_SEARCH;
    }

    // called from different thread? not our business
    if (GetCurrentThread() != mainProcessThread) {
        return EXCEPTION_CONTINUE_SEARCH;
    }

#if USE_CLIENT
    Win_Shutdown();
#endif

    ret = MessageBox(NULL,
                     PRODUCT " has encountered an unhandled "
                     "exception and needs to be terminated.\n"
                     "Would you like to generate a crash report?",
                     CRASH_TITLE,
                     MB_ICONERROR | MB_YESNO
#if !USE_CLIENT
                     | MB_SERVICE_NOTIFICATION
#endif
                    );
    if (ret == IDNO) {
        return EXCEPTION_EXECUTE_HANDLER;
    }

#define LL(x)                                   \
    do {                                        \
        moduleHandle = LoadLibrary(x);          \
        if (!moduleHandle) {                    \
            return EXCEPTION_CONTINUE_SEARCH;   \
        }                                       \
    } while(0)

#define GPA(x, y)                                   \
    do {                                            \
        p##y = (x)GetProcAddress(moduleHandle, #y); \
        if (!p##y) {                                \
            return EXCEPTION_CONTINUE_SEARCH;       \
        }                                           \
    } while(0)

    LL("dbghelp.dll");
    GPA(SETSYMOPTIONS, SymSetOptions);
    GPA(SYMGETMODULEINFO64, SymGetModuleInfo64);
    GPA(SYMCLEANUP, SymCleanup);
    GPA(SYMINITIALIZE, SymInitialize);
    GPA(ENUMERATELOADEDMODULES64, EnumerateLoadedModules64);
    GPA(STACKWALK64, StackWalk64);
    GPA(SYMFROMADDR, SymFromAddr);
    GPA(SYMFUNCTIONTABLEACCESS64, SymFunctionTableAccess64);
    GPA(SYMGETMODULEBASE64, SymGetModuleBase64);

    LL("version.dll");
    GPA(GETFILEVERSIONINFOA, GetFileVersionInfoA);
    GPA(VERQUERYVALUEA, VerQueryValueA);

    LL("shell32.dll");
    GPA(SHELLEXECUTEA, ShellExecuteA);

    // get base directory to save crash dump to
    len = GetModuleFileName(NULL, execdir, sizeof(execdir));
    if (!len || len >= sizeof(execdir)) {
        return EXCEPTION_CONTINUE_SEARCH;
    }

    while (--len) {
        if (execdir[len] == '\\') {
            break;
        }
    }

    if (!len || len + 24 >= MAX_PATH) {
        return EXCEPTION_CONTINUE_SEARCH;
    }

    execdir[len] = 0;

    CopyMemory(path, execdir, len);
    CopyMemory(path + len, "\\Q2PRO_CrashReportXX.txt", 25);
    for (i = 0; i < 100; i++) {
        path[len + 18] = '0' + i / 10;
        path[len + 19] = '0' + i % 10;
        crashReport = CreateFile(
                          path,
                          GENERIC_WRITE,
                          FILE_SHARE_READ,
                          NULL,
                          CREATE_NEW,
                          FILE_ATTRIBUTE_NORMAL,
                          NULL);

        if (crashReport != INVALID_HANDLE_VALUE) {
            break;
        }

        if (GetLastError() != ERROR_FILE_EXISTS) {
            MessageBox(NULL,
                       "Couldn't create crash report. "
                       "Base directory is not writable.",
                       CRASH_TITLE,
                       MB_ICONERROR);
            return EXCEPTION_EXECUTE_HANDLER;
        }
    }

    if (i == 100) {
        MessageBox(NULL,
                   "Couldn't create crash report. "
                   "All report slots are full.\n"
                   "Please remove existing reports from base directory.",
                   CRASH_TITLE,
                   MB_ICONERROR);
        return EXCEPTION_EXECUTE_HANDLER;
    }

    pSymSetOptions(
        SYMOPT_LOAD_ANYTHING |
        SYMOPT_DEBUG |
        SYMOPT_FAIL_CRITICAL_ERRORS);

    processHandle = GetCurrentProcess();
    threadHandle = GetCurrentThread();

    pSymInitialize(processHandle, execdir, TRUE);

    GetSystemTime(&systemTime);
    write_report(
        "Crash report generated %s %u %u, %02u:%02u:%02u UTC\r\n",
        monthNames[(systemTime.wMonth - 1) % 12],
        systemTime.wDay,
        systemTime.wYear,
        systemTime.wHour,
        systemTime.wMinute,
        systemTime.wSecond);
    write_report(
        "by " APPLICATION " " VERSION
        ", built " __DATE__", " __TIME__ "\r\n");

    vinfo.dwOSVersionInfoSize = sizeof(vinfo);
    if (GetVersionEx(&vinfo)) {
        write_report(
            "\r\nWindows version: %u.%u (build %u) %s\r\n",
            vinfo.dwMajorVersion,
            vinfo.dwMinorVersion,
            vinfo.dwBuildNumber,
            vinfo.szCSDVersion);
    } else {
        write_report("GetVersionEx failed with error %#x\r\n",
                     GetLastError());
    }

    // oh no, dbghelp is not backwards and forwards compatible
    // why in hell is it different from other windows DLLs?
    for (i = 0; i < 4; i++) {
        len = tryModuleSizes[i];
        if (i && len >= sizeof(moduleInfo)) {
            continue;
        }
        moduleInfo.SizeOfStruct = len;
        if (pSymGetModuleInfo64(
                processHandle,
                (DWORD64)((INT_PTR)hGlobalInstance),
                &moduleInfo)) {
            moduleInfoSize = len;
            if (i) {
                write_report(
                    "Module info size is %u (not %u)\r\n",
                    len, tryModuleSizes[0]);
            }
            break;
        }
    }

    if (i == 4) {
        // bad luck
        write_report("SymGetModuleInfo64 is f****d up :(");
        moduleInfoSize = sizeof(moduleInfo);
    }

    CopyMemory(faultyModuleName, "unknown", 8);

    exception = exceptionInfo->ExceptionRecord;
    context = exceptionInfo->ContextRecord;

#ifdef _WIN64
    pc = context->Rip;
#else
    pc = (DWORD64)context->Eip;
#endif

    write_report("\r\nLoaded modules:\r\n");
    ret = pEnumerateLoadedModules64(
              processHandle,
              enum_modules_callback,
              &pc
          );
    if (!ret) {
        write_report("EnumerateLoadedModules64 failed with error %#x\r\n",
                     GetLastError());
    }

    write_report("\r\nException information:\r\n");
    write_report("Code: %#08x\r\n", exception->ExceptionCode);
    write_report("Address: %"PRIxx" (%s)\r\n", WORDxx(pc), faultyModuleName);

    write_report("\r\nThread context:\r\n");
#ifdef _WIN64
    write_report("RIP: %"PRIxx64" RBP: %"PRIxx64" RSP: %"PRIxx64"\r\n",
                 context->Rip, context->Rbp, context->Rsp);
    write_report("RAX: %"PRIxx64" RBX: %"PRIxx64" RCX: %"PRIxx64"\r\n",
                 context->Rax, context->Rbx, context->Rcx);
    write_report("RDX: %"PRIxx64" RSI: %"PRIxx64" RDI: %"PRIxx64"\r\n",
                 context->Rdx, context->Rsi, context->Rdi);
    write_report("R8 : %"PRIxx64" R9 : %"PRIxx64" R10: %"PRIxx64"\r\n",
                 context->R8, context->R9, context->R10);
    write_report("R11: %"PRIxx64" R12: %"PRIxx64" R13: %"PRIxx64"\r\n",
                 context->R11, context->R12, context->R13);
    write_report("R14: %"PRIxx64" R15: %"PRIxx64"\r\n",
                 context->R14, context->R15);
#else
    write_report("EIP: %"PRIxx32" EBP: %"PRIxx32" ESP: %"PRIxx32"\r\n",
                 context->Eip, context->Ebp, context->Esp);
    write_report("EAX: %"PRIxx32" EBX: %"PRIxx32" ECX: %"PRIxx32"\r\n",
                 context->Eax, context->Ebx, context->Ecx);
    write_report("EDX: %"PRIxx32" ESI: %"PRIxx32" EDI: %"PRIxx32"\r\n",
                 context->Edx, context->Esi, context->Edi);
#endif

    ZeroMemory(&stackFrame, sizeof(stackFrame));
#ifdef _WIN64
    stackFrame.AddrPC.Offset = context->Rip;
    stackFrame.AddrFrame.Offset = context->Rbp;
    stackFrame.AddrStack.Offset = context->Rsp;
#else
    stackFrame.AddrPC.Offset = context->Eip;
    stackFrame.AddrFrame.Offset = context->Ebp;
    stackFrame.AddrStack.Offset = context->Esp;
#endif
    stackFrame.AddrPC.Mode = AddrModeFlat;
    stackFrame.AddrFrame.Mode = AddrModeFlat;
    stackFrame.AddrStack.Mode = AddrModeFlat;

    write_report("\r\nStack trace:\r\n");
    count = 0;
    symbol = (SYMBOL_INFO *)buffer;
    symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
    symbol->MaxNameLen = 256;
    while (pStackWalk64(
#ifdef _WIN64
               IMAGE_FILE_MACHINE_AMD64,
#else
               IMAGE_FILE_MACHINE_I386,
#endif
               processHandle,
               threadHandle,
               &stackFrame,
               context,
               NULL,
               pSymFunctionTableAccess64,
               pSymGetModuleBase64,
               NULL)) {
        write_report(
            "%d: %"PRIxx" %"PRIxx" %"PRIxx" %"PRIxx" ",
            count,
            WORDxx(stackFrame.Params[0]),
            WORDxx(stackFrame.Params[1]),
            WORDxx(stackFrame.Params[2]),
            WORDxx(stackFrame.Params[3]));

        moduleInfo.SizeOfStruct = moduleInfoSize;
        if (pSymGetModuleInfo64(
                processHandle,
                stackFrame.AddrPC.Offset,
                &moduleInfo)) {
            if (moduleInfo.SymType != SymNone &&
                moduleInfo.SymType != SymExport &&
                pSymFromAddr(
                    processHandle,
                    stackFrame.AddrPC.Offset,
                    &offset,
                    symbol)) {
                write_report("%s!%s+%"PRIxx32"\r\n",
                             moduleInfo.ModuleName,
                             symbol->Name, (DWORD32)offset);
            } else {
                write_report("%s!%"PRIxx"\r\n",
                             moduleInfo.ModuleName,
                             WORDxx(stackFrame.AddrPC.Offset));
            }
        } else {
            write_report("%"PRIxx"\r\n",
                         WORDxx(stackFrame.AddrPC.Offset));
        }

        count++;
    }

    CloseHandle(crashReport);

    pSymCleanup(processHandle);

    pShellExecuteA(NULL, "open", path, NULL, execdir, SW_SHOW);

    return EXCEPTION_EXECUTE_HANDLER;
}
Example #19
0
void WGL_InitExtensions( unsigned mask ) {
    if( mask & QWGL_EXT_swap_control ) {
        qwglSwapIntervalEXT     = GPA( "wglSwapIntervalEXT" );
    }
}
Example #20
0
// *INDENT-OFF*
int QGL_Init()
{
	ri.Printf(PRINT_ALL, "...initializing QGL\n");

	if(GLimp_sdl_init_video() == qfalse)
		return qfalse;

	qglBindTexture               = dllBindTexture = GPA( "glBindTexture" );
	qglBlendFunc                 = dllBlendFunc = GPA( "glBlendFunc" );
	qglClear                     = dllClear = GPA( "glClear" );
	qglClearColor                = dllClearColor = GPA( "glClearColor" );
	qglClearDepth                = dllClearDepth = GPA( "glClearDepth" );
	qglClearStencil              = dllClearStencil = GPA( "glClearStencil" );
	qglColorMask                 = dllColorMask = GPA( "glColorMask" );
	qglCopyPixels                = dllCopyPixels = GPA( "glCopyPixels" );
	qglCopyTexImage1D            = dllCopyTexImage1D = GPA( "glCopyTexImage1D" );
	qglCopyTexImage2D            = dllCopyTexImage2D = GPA( "glCopyTexImage2D" );
	qglCopyTexSubImage1D         = dllCopyTexSubImage1D = GPA( "glCopyTexSubImage1D" );
	qglCopyTexSubImage2D         = dllCopyTexSubImage2D = GPA( "glCopyTexSubImage2D" );
	qglCullFace                  = dllCullFace = GPA( "glCullFace" );
	qglDeleteTextures            = dllDeleteTextures = GPA( "glDeleteTextures" );
	qglDepthFunc                 = dllDepthFunc = GPA( "glDepthFunc" );
	qglDepthMask                 = dllDepthMask = GPA( "glDepthMask" );
	qglDepthRange                = dllDepthRange = GPA( "glDepthRange" );
	qglDisable                   = dllDisable = GPA( "glDisable" );
	qglDrawArrays                = dllDrawArrays = GPA( "glDrawArrays" );
	qglDrawBuffer                = dllDrawBuffer = GPA( "glDrawBuffer" );
	qglDrawElements              = dllDrawElements = GPA( "glDrawElements" );
	qglEnable                    = dllEnable                    = GPA( "glEnable" );
	qglFinish                    = dllFinish                    = GPA( "glFinish" );
	qglFlush                     = dllFlush                     = GPA( "glFlush" );
	qglFrontFace                 = dllFrontFace                 = GPA( "glFrontFace" );
	qglGenTextures               = dllGenTextures               = GPA( "glGenTextures" );
	qglGetBooleanv               = dllGetBooleanv               = GPA( "glGetBooleanv" );
	qglGetError                  = dllGetError                  = GPA( "glGetError" );
	qglGetFloatv                 = dllGetFloatv                 = GPA( "glGetFloatv" );
	qglGetIntegerv               = dllGetIntegerv               = GPA( "glGetIntegerv" );
	qglGetString                 = dllGetString                 = GPA( "glGetString" );
	qglGetTexParameterfv         = dllGetTexParameterfv         = GPA( "glGetTexParameterfv" );
	qglGetTexParameteriv         = dllGetTexParameteriv         = GPA( "glGetTexParameteriv" );
	qglHint                      = dllHint                      = GPA( "glHint" );
	qglIsEnabled                 = dllIsEnabled                 = GPA( "glIsEnabled" );
	qglIsTexture                 = dllIsTexture                 = GPA( "glIsTexture" );
	qglLineWidth                 = dllLineWidth                 = GPA( "glLineWidth" );
	qglPolygonMode               = dllPolygonMode               = GPA( "glPolygonMode" );
	qglPolygonOffset             = dllPolygonOffset             = GPA( "glPolygonOffset" );
	qglReadPixels                = dllReadPixels                = GPA( "glReadPixels" );
	qglScissor                   = dllScissor                   = GPA( "glScissor" );
	qglStencilFunc               = dllStencilFunc               = GPA( "glStencilFunc" );
	qglStencilMask               = dllStencilMask               = GPA( "glStencilMask" );
	qglStencilOp                 = dllStencilOp                 = GPA( "glStencilOp" );
	qglTexImage1D                = dllTexImage1D                = GPA( "glTexImage1D" );
	qglTexImage2D                = dllTexImage2D                = GPA( "glTexImage2D" );
	qglTexParameterf             = dllTexParameterf             = GPA( "glTexParameterf" );
	qglTexParameterfv            = dllTexParameterfv            = GPA( "glTexParameterfv" );
	qglTexParameteri             = dllTexParameteri             = GPA( "glTexParameteri" );
	qglTexParameteriv            = dllTexParameteriv            = GPA( "glTexParameteriv" );
	qglTexSubImage1D             = dllTexSubImage1D             = GPA( "glTexSubImage1D" );
	qglTexSubImage2D             = dllTexSubImage2D             = GPA( "glTexSubImage2D" );
	qglViewport                  = dllViewport                  = GPA( "glViewport" );

	// check logging
	QGL_EnableLogging(r_logFile->integer);

	return qtrue;
}
Example #21
0
/*
 =================
 QAL_Init

 Binds our QAL function pointers to the appropriate AL stuff
 =================
*/
qboolean QAL_Init (const char *driver){

	Com_Printf("...initializing QAL\n", LOG_CLIENT);

	Com_Printf("...calling dlopen( '%s' ): ", LOG_CLIENT, driver);

	if ((alState.ALlib = dlopen(driver, RTLD_NOW)) == NULL)
	{
		Com_Printf("failed\n", LOG_CLIENT);
		return false;
	}
	Com_Printf("succeeded\n", LOG_CLIENT);

	qalcOpenDevice				= (ALCOPENDEVICE)GPA("alcOpenDevice");
	qalcCloseDevice				= (ALCCLOSEDEVICE)GPA("alcCloseDevice");
	qalcCreateContext			= (ALCCREATECONTEXT)GPA("alcCreateContext");
	qalcDestroyContext			= (ALCDESTROYCONTEXT)GPA("alcDestroyContext");
	qalcMakeContextCurrent		= (ALCMAKECONTEXTCURRENT)GPA("alcMakeContextCurrent");
	qalcProcessContext			= (ALCPROCESSCONTEXT)GPA("alcProcessContext");
	qalcSuspendContext			= (ALCSUSPENDCONTEXT)GPA("alcSuspendContext");
	qalcGetCurrentContext		= (ALCGETCURRENTCONTEXT)GPA("alcGetCurrentContext");
	qalcGetContextsDevice		= (ALCGETCONTEXTSDEVICE)GPA("alcGetContextsDevice");
	qalcGetString				= (ALCGETSTRING)GPA("alcGetString");
	qalcGetIntegerv				= (ALCGETINTEGERV)GPA("alcGetIntegerv");
	qalcGetError				= (ALCGETERROR)GPA("alcGetError");
	qalcIsExtensionPresent		= (ALCISEXTENSIONPRESENT)GPA("alcIsExtensionPresent");
	qalcGetProcAddress			= (ALCGETPROCADDRESS)GPA("alcGetProcAddress");
	qalcGetEnumValue			= (ALCGETENUMVALUE)GPA("alcGetEnumValue");

	qalBufferData				= (ALBUFFERDATA)GPA("alBufferData");
	qalDeleteBuffers			= (ALDELETEBUFFERS)GPA("alDeleteBuffers");
	qalDeleteSources			= (ALDELETESOURCES)GPA("alDeleteSources");
	qalDisable					= (ALDISABLE)GPA("alDisable");
	qalDistanceModel			= (ALDISTANCEMODEL)GPA("alDistanceModel");
	qalDopplerFactor			= (ALDOPPLERFACTOR)GPA("alDopplerFactor");
	qalDopplerVelocity			= (ALDOPPLERVELOCITY)GPA("alDopplerVelocity");
	qalEnable					= (ALENABLE)GPA("alEnable");
	qalGenBuffers				= (ALGENBUFFERS)GPA("alGenBuffers");
	qalGenSources				= (ALGENSOURCES)GPA("alGenSources");
	qalGetBoolean				= (ALGETBOOLEAN)GPA("alGetBoolean");
	qalGetBooleanv				= (ALGETBOOLEANV)GPA("alGetBooleanv");
	qalGetBufferf				= (ALGETBUFFERF)GPA("alGetBufferf");
	qalGetBufferi				= (ALGETBUFFERI)GPA("alGetBufferi");
	qalGetDouble				= (ALGETDOUBLE)GPA("alGetDouble");
	qalGetDoublev				= (ALGETDOUBLEV)GPA("alGetDoublev");
	qalGetEnumValue				= (ALGETENUMVALUE)GPA("alGetEnumValue");
	qalGetError					= (ALGETERROR)GPA("alGetError");
	qalGetFloat					= (ALGETFLOAT)GPA("alGetFloat");
	qalGetFloatv				= (ALGETFLOATV)GPA("alGetFloatv");
	qalGetInteger				= (ALGETINTEGER)GPA("alGetInteger");
	qalGetIntegerv				= (ALGETINTEGERV)GPA("alGetIntegerv");
	qalGetListener3f			= (ALGETLISTENER3F)GPA("alGetListener3f");
	qalGetListenerf				= (ALGETLISTENERF)GPA("alGetListenerf");
	qalGetListenerfv			= (ALGETLISTENERFV)GPA("alGetListenerfv");
	qalGetListeneri				= (ALGETLISTENERI)GPA("alGetListeneri");
	qalGetProcAddress			= (ALGETPROCADDRESS)GPA("alGetProcAddress");
	qalGetSource3f				= (ALGETSOURCE3F)GPA("alGetSource3f");
	qalGetSourcef				= (ALGETSOURCEF)GPA("alGetSourcef");
	qalGetSourcefv				= (ALGETSOURCEFV)GPA("alGetSourcefv");
	qalGetSourcei				= (ALGETSOURCEI)GPA("alGetSourcei");
	qalGetString				= (ALGETSTRING)GPA("alGetString");
	qalHint						= (ALHINT)GPA("alHint");
	qalIsBuffer					= (ALISBUFFER)GPA("alIsBuffer");
	qalIsEnabled				= (ALISENABLED)GPA("alIsEnabled");
	qalIsExtensionPresent		= (ALISEXTENSIONPRESENT)GPA("alIsExtensionPresent");
	qalIsSource					= (ALISSOURCE)GPA("alIsSource");
	qalListener3f				= (ALLISTENER3F)GPA("alListener3f");
	qalListenerf				= (ALLISTENERF)GPA("alListenerf");
	qalListenerfv				= (ALLISTENERFV)GPA("alListenerfv");
	qalListeneri				= (ALLISTENERI)GPA("alListeneri");
	qalSource3f					= (ALSOURCE3F)GPA("alSource3f");
	qalSourcef					= (ALSOURCEF)GPA("alSourcef");
	qalSourcefv					= (ALSOURCEFV)GPA("alSourcefv");
	qalSourcei					= (ALSOURCEI)GPA("alSourcei");
	qalSourcePause				= (ALSOURCEPAUSE)GPA("alSourcePause");
	qalSourcePausev				= (ALSOURCEPAUSEV)GPA("alSourcePausev");
	qalSourcePlay				= (ALSOURCEPLAY)GPA("alSourcePlay");
	qalSourcePlayv				= (ALSOURCEPLAYV)GPA("alSourcePlayv");
	qalSourceQueueBuffers		= (ALSOURCEQUEUEBUFFERS)GPA("alSourceQueueBuffers");
	qalSourceRewind				= (ALSOURCEREWIND)GPA("alSourceRewind");
	qalSourceRewindv			= (ALSOURCEREWINDV)GPA("alSourceRewindv");
	qalSourceStop				= (ALSOURCESTOP)GPA("alSourceStop");
	qalSourceStopv				= (ALSOURCESTOPV)GPA("alSourceStopv");
	qalSourceUnqueueBuffers		= (ALSOURCEUNQUEUEBUFFERS)GPA("alSourceUnqueueBuffers");

	qalEAXGet					= NULL;
	qalEAXSet					= NULL;

	openal_active = true;

	return true;
}