#include <../arch/arch.h>

#ifdef	ARCH_WINDOWING_SUPPORTED

V_LOCAL vboolean V_CALL
vgl_load_proc_real(char *proc_name,void **ptr_ret, vboolean *terminate)
{
	/* NOTE: at this point LibV global lock must be hold */
	PROC proc = wglGetProcAddress((LPCSTR)proc_name);
	if(*ptr_ret && *ptr_ret != proc)
	{
		/*
		 * Different implementation (M$ generic after HW or vice versa).
		 */
		*terminate = true;
		return false;
	}
	if(proc)
	{
		*ptr_ret = (void*)proc;
		return true;
	}
	return false;
}

vboolean (V_CALL *vgl_load_proc)(char *proc_name,void **ptr_ret,
	vboolean *terminate_ret) = vgl_load_proc_real;

#endif	/* ARCH_WINDOWING_SUPPORTED */
