Index: /trunk/src/VBox/Additions/3D/win/VBoxICD/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Additions/3D/win/VBoxICD/Makefile.kmk	(revision 75620)
+++ /trunk/src/VBox/Additions/3D/win/VBoxICD/Makefile.kmk	(revision 75621)
@@ -20,5 +20,5 @@
 
 VBOX_PATH_GL_GEN = $(PATH_OBJ)/VBoxGLgen
-VBOX_GL_ICD_DEF_FILE = $(VBOX_PATH_MESA)/src/gallium/state_trackers/wgl/opengl32.def
+VBOX_GL_ICD_DEF_FILE = $(VBOX_PATH_MESA)/src/gallium/state_trackers/wgl/opengl32.mingw.def
 
 BLDDIRS += $(VBOX_PATH_GL_GEN)/
@@ -35,5 +35,5 @@
 
 VBoxICD_SOURCES     = \
-	$(VBOX_GL_ICD_DEF_FILE) \
+	$(VBOX_PATH_MESA)/src/gallium/state_trackers/wgl/opengl32.def \
 	$(VBOX_PATH_GL_GEN)/forwarders.asm \
 	$(VBOX_PATH_GL_GEN)/pfns.c \
Index: /trunk/src/VBox/Additions/3D/win/VBoxICD/icd_forwarders.py
===================================================================
--- /trunk/src/VBox/Additions/3D/win/VBoxICD/icd_forwarders.py	(revision 75620)
+++ /trunk/src/VBox/Additions/3D/win/VBoxICD/icd_forwarders.py	(revision 75621)
@@ -22,8 +22,17 @@
 
     names = []
+    cbArgs = []
     for line in exports_file.readlines():
         line = line.strip()
         if len(line) > 0 and line[0] != ';' and line != 'EXPORTS':
-            names.append(line)
+            # Parse 'glAccum = glAccum@8'
+            words = line.split('=', 1)
+
+            # Function name
+            names.append(words[0].strip())
+
+            # Size of arguments in bytes
+            words = words[1].split('@')
+            cbArgs.append(words[1].strip())
 
     exports_file.close()
@@ -40,5 +49,6 @@
     asm_file.write('%include "iprt/asmdefs.mac"\n')
     asm_file.write('\n')
-    asm_file.write(';;;; %define ICD_LAZY_LOAD ; Enable this to lazy load the ICD DLL (does not work on Win64)\n')
+    asm_file.write(';;;; Enable ICD_LAZY_LOAD to lazy load the ICD DLL (does not work on Win64)\n')
+    asm_file.write('; %define ICD_LAZY_LOAD 1\n')
     asm_file.write('\n')
     asm_file.write('%ifdef RT_ARCH_AMD64\n')
@@ -55,4 +65,5 @@
     for index in range(len(names)):
         fn = names[index]
+        cbRet = cbArgs[index]
         asm_file.write('\n')
         asm_file.write('BEGINPROC_EXPORTED %s\n' % fn)
@@ -71,5 +82,9 @@
         asm_file.write('    or    xAX, xAX\n')
         asm_file.write('    jnz   l_jmp_to_%s\n' % fn)
+        asm_file.write('%ifdef RT_ARCH_AMD64\n')
         asm_file.write('    ret\n')
+        asm_file.write('%else ; X86\n')
+        asm_file.write('    ret %s\n' % cbRet)
+        asm_file.write('%endif\n')
         asm_file.write('l_jmp_to_%s:\n' % fn)
         asm_file.write('    jmp   xAX\n')
Index: /trunk/src/VBox/Additions/3D/win/VBoxICD/icd_pfns.py
===================================================================
--- /trunk/src/VBox/Additions/3D/win/VBoxICD/icd_pfns.py	(revision 75620)
+++ /trunk/src/VBox/Additions/3D/win/VBoxICD/icd_pfns.py	(revision 75621)
@@ -25,5 +25,9 @@
         line = line.strip()
         if len(line) > 0 and line[0] != ';' and line != 'EXPORTS':
-            names.append(line)
+            # Parse 'glAccum = glAccum@8'
+            words = line.split('=')
+
+            # Function name
+            names.append(words[0].strip())
 
     exports_file.close()
