Index: /trunk/include/VBox/err.h
===================================================================
--- /trunk/include/VBox/err.h	(revision 76254)
+++ /trunk/include/VBox/err.h	(revision 76255)
@@ -1735,4 +1735,8 @@
 /** Unexpected PCI region change during VGA saved state loading. */
 #define VERR_VGA_UNEXPECTED_PCI_REGION_LOAD_CHANGE  (-3502)
+/** Unabled to locate or load the OpenGL library. */
+#define VERR_VGA_GL_LOAD_FAILURE                    (-3503)
+/** Unabled to locate an OpenGL symbol. */
+#define VERR_VGA_GL_SYMBOL_NOT_FOUND                (-3504)
 /** @} */
 
Index: /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp
===================================================================
--- /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp	(revision 76254)
+++ /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.cpp	(revision 76255)
@@ -19,7 +19,8 @@
 #include "DevVGA-SVGA3d-glLdr.h"
 
+#include <VBox/vmm/pdmdev.h>
+#include <VBox/err.h>
 #include <iprt/assert.h>
 #include <iprt/cdefs.h>
-#include <iprt/err.h>
 #include <iprt/ldr.h>
 #include <iprt/log.h>
@@ -126,10 +127,23 @@
 
 #define GLGETPROC_(ProcName, NameSuffix) do { \
-    *(PFNRT *)&pfn_##ProcName = OGLGETPROCADDRESS(#ProcName NameSuffix); \
-    AssertLogRelMsgReturn(pfn_##ProcName, ("%s missing\n", #ProcName NameSuffix), VERR_NOT_IMPLEMENTED); \
+    *(PFNRT *)&pfn_##ProcName = pfnRet = OGLGETPROCADDRESS(#ProcName NameSuffix); \
+    if (pfnRet) { /* likely */ } \
+    else \
+    { \
+        AssertLogRelMsg(pfnRet, ("%s missing\n", #ProcName NameSuffix)); \
+        return PDMDevHlpVMSetError(pDevIns, VERR_VGA_GL_SYMBOL_NOT_FOUND, RT_SRC_POS, \
+                                   "Missing OpenGL symbol '%s'\n", #ProcName NameSuffix); \
+    } \
 } while(0)
 
-int glLdrInit(void)
-{
+int glLdrInit(PPDMDEVINS pDevIns)
+{
+    /** @todo r=bird: Perhaps make this template include file driven? See
+     * include/VBox/dbus.h, include/VBox/dbus-calls.h and iprt/runtime-loader.h for
+     * instance.  Regardless, it would be would be nice if we could move up the
+     * RTLdrLoadSystem/dlopen bits and have separate error reporting for those,
+     * making use of VERR_VGA_GL_LOAD_FAILURE.  I can look into that, but
+     * probably only after the release is out... */
+
     pfn_glAlphaFunc = 0;
     pfn_glBindTexture = 0;
@@ -211,4 +225,5 @@
 #endif
 
+    PFNRT pfnRet;
     GLGETPROC_(glAlphaFunc, "");
     GLGETPROC_(glBindTexture, "");
@@ -294,6 +309,7 @@
 }
 
-int glLdrGetExtFunctions(void)
-{
+int glLdrGetExtFunctions(PPDMDEVINS pDevIns)
+{
+    PFNRT pfnRet;
     GLGETPROC_(glBlendColor, "");
     GLGETPROC_(glBlendEquation, "");
Index: /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h
===================================================================
--- /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h	(revision 76254)
+++ /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-glLdr.h	(revision 76255)
@@ -23,5 +23,5 @@
 #endif
 
-#include <iprt/types.h>
+#include <VBox/types.h>
 
 /** @todo VBOX_VMSVGA3D_GL_HACK_LEVEL is not necessary when dynamic loading is used. */
@@ -78,10 +78,10 @@
 #endif
 
-/* Load OpenGL library and initialize function pointers. */
-int glLdrInit(void);
-/* Resolve an OpenGL function name. */
+/** Load OpenGL library and initialize function pointers. */
+int glLdrInit(PPDMDEVINS pDevIns);
+/** Resolve an OpenGL function name. */
 PFNRT glLdrGetProcAddress(const char *pszSymbol);
-/* Get pointers to extension function. They are available on Windows only when OpenGL context is set. */
-int glLdrGetExtFunctions(void);
+/** Get pointers to extension function. They are available on Windows only when OpenGL context is set. */
+int glLdrGetExtFunctions(PPDMDEVINS pDevIns);
 
 /*
Index: /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h
===================================================================
--- /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h	(revision 76254)
+++ /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-internal.h	(revision 76255)
@@ -40,5 +40,5 @@
 
 #if defined(VMSVGA3D_DYNAMIC_LOAD) && defined(VMSVGA3D_OPENGL)
-#include "DevVGA-SVGA3d-glLdr.h"
+# include "DevVGA-SVGA3d-glLdr.h"
 #endif
 
Index: /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
===================================================================
--- /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp	(revision 76254)
+++ /trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp	(revision 76255)
@@ -592,5 +592,5 @@
 
 #ifdef VMSVGA3D_DYNAMIC_LOAD
-    rc = glLdrInit();
+    rc = glLdrInit(pThis->pDevInsR3);
     if (RT_FAILURE(rc))
     {
@@ -812,5 +812,5 @@
 #ifdef VMSVGA3D_DYNAMIC_LOAD
     /* Context is set and it is possible now to resolve extension functions. */
-    rc = glLdrGetExtFunctions();
+    rc = glLdrGetExtFunctions(pThis->pDevInsR3);
     if (RT_FAILURE(rc))
     {
