Index: trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
===================================================================
--- trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c	(revision 66827)
+++ trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c	(revision 68458)
@@ -757,8 +757,5 @@
         CRVBOXHGCMINJECT parms;
 
-        parms.hdr.result      = VERR_WRONG_ORDER;
-        parms.hdr.u32ClientID = conn->u32ClientID;
-        parms.hdr.u32Function = SHCRGL_GUEST_FN_INJECT;
-        parms.hdr.cParms      = SHCRGL_CPARMS_INJECT;
+        VBGL_HGCM_HDR_INIT(&parms.hdr, conn->u32ClientID, SHCRGL_GUEST_FN_INJECT, SHCRGL_CPARMS_INJECT);
 
         parms.u32ClientID.type       = VMMDevHGCMParmType_32bit;
@@ -777,8 +774,5 @@
         CRVBOXHGCMWRITE parms;
 
-        parms.hdr.result      = VERR_WRONG_ORDER;
-        parms.hdr.u32ClientID = conn->u32ClientID;
-        parms.hdr.u32Function = SHCRGL_GUEST_FN_WRITE;
-        parms.hdr.cParms      = SHCRGL_CPARMS_WRITE;
+        VBGL_HGCM_HDR_INIT(&parms.hdr, conn->u32ClientID, SHCRGL_GUEST_FN_WRITE, SHCRGL_CPARMS_WRITE);
 
         parms.pBuffer.type                   = VMMDevHGCMParmType_LinAddr_In;
@@ -815,8 +809,5 @@
     RT_NOREF(buf, len);
 
-    parms.hdr.result      = VERR_WRONG_ORDER;
-    parms.hdr.u32ClientID = conn->u32ClientID;
-    parms.hdr.u32Function = SHCRGL_GUEST_FN_READ;
-    parms.hdr.cParms      = SHCRGL_CPARMS_READ;
+    VBGL_HGCM_HDR_INIT(&parms.hdr, conn->u32ClientID, SHCRGL_GUEST_FN_READ, SHCRGL_CPARMS_READ);
 
     CRASSERT(!conn->pBuffer); /* make sure there's no data to process */
@@ -858,8 +849,5 @@
     int rc;
 
-    parms.hdr.result      = VERR_WRONG_ORDER;
-    parms.hdr.u32ClientID = conn->u32ClientID;
-    parms.hdr.u32Function = SHCRGL_GUEST_FN_WRITE_READ;
-    parms.hdr.cParms      = SHCRGL_CPARMS_WRITE_READ;
+    VBGL_HGCM_HDR_INIT(&parms.hdr, conn->u32ClientID, SHCRGL_GUEST_FN_WRITE_READ, SHCRGL_CPARMS_WRITE_READ);
 
     parms.pBuffer.type                   = VMMDevHGCMParmType_LinAddr_In;
@@ -883,8 +871,5 @@
         CRVBOXHGCMWRITEBUFFER wbParms;
 
-        wbParms.hdr.result = VERR_WRONG_ORDER;
-        wbParms.hdr.u32ClientID = conn->u32ClientID;
-        wbParms.hdr.u32Function = SHCRGL_GUEST_FN_WRITE_BUFFER;
-        wbParms.hdr.cParms = SHCRGL_CPARMS_WRITE_BUFFER;
+        VBGL_HGCM_HDR_INIT(&wbParms.hdr, conn->u32ClientID, SHCRGL_GUEST_FN_WRITE_BUFFER, SHCRGL_CPARMS_WRITE_BUFFER);
 
         wbParms.iBufferID.type = VMMDevHGCMParmType_32bit;
@@ -927,8 +912,5 @@
             CRVBOXHGCMWRITEREADBUFFERED wrbParms;
 
-            wrbParms.hdr.result = VERR_WRONG_ORDER;
-            wrbParms.hdr.u32ClientID = conn->u32ClientID;
-            wrbParms.hdr.u32Function = SHCRGL_GUEST_FN_WRITE_READ_BUFFERED;
-            wrbParms.hdr.cParms = SHCRGL_CPARMS_WRITE_READ_BUFFERED;
+            VBGL_HGCM_HDR_INIT(&wrbParms.hdr, conn->u32ClientID, SHCRGL_GUEST_FN_WRITE_READ_BUFFERED, SHCRGL_CPARMS_WRITE_READ_BUFFERED);
 
             crMemcpy(&wrbParms.iBufferID, &wbParms.iBufferID, sizeof(HGCMFunctionParameter));
@@ -1060,8 +1042,5 @@
     CRASSERT(!conn->pBuffer);
 
-    parms.hdr.result      = VERR_WRONG_ORDER;
-    parms.hdr.u32ClientID = conn->u32ClientID;
-    parms.hdr.u32Function = SHCRGL_GUEST_FN_READ;
-    parms.hdr.cParms      = SHCRGL_CPARMS_READ;
+    VBGL_HGCM_HDR_INIT(&parms.hdr, conn->u32ClientID, SHCRGL_GUEST_FN_READ, SHCRGL_CPARMS_READ);
 
     parms.pBuffer.type                   = VMMDevHGCMParmType_LinAddr_Out;
@@ -1266,8 +1245,5 @@
     RT_NOREF(vMajor, vMinor);
 
-    parms.hdr.result      = VERR_WRONG_ORDER;
-    parms.hdr.u32ClientID = conn->u32ClientID;
-    parms.hdr.u32Function = SHCRGL_GUEST_FN_SET_VERSION;
-    parms.hdr.cParms      = SHCRGL_CPARMS_SET_VERSION;
+    VBGL_HGCM_HDR_INIT(&parms.hdr, conn->u32ClientID, SHCRGL_GUEST_FN_SET_VERSION, SHCRGL_CPARMS_SET_VERSION);
 
     parms.vMajor.type      = VMMDevHGCMParmType_32bit;
@@ -1303,8 +1279,5 @@
     int rc;
 
-    caps.hdr.result      = VERR_WRONG_ORDER;
-    caps.hdr.u32ClientID = conn->u32ClientID;
-    caps.hdr.u32Function = SHCRGL_GUEST_FN_GET_CAPS_LEGACY;
-    caps.hdr.cParms      = SHCRGL_CPARMS_GET_CAPS_LEGACY;
+    VBGL_HGCM_HDR_INIT(&caps.hdr, conn->u32ClientID, SHCRGL_GUEST_FN_GET_CAPS_LEGACY, SHCRGL_CPARMS_GET_CAPS_LEGACY);
 
     caps.Caps.type       = VMMDevHGCMParmType_32bit;
@@ -1338,8 +1311,5 @@
     int rc;
 
-    parms.hdr.result      = VERR_WRONG_ORDER;
-    parms.hdr.u32ClientID = conn->u32ClientID;
-    parms.hdr.u32Function = SHCRGL_GUEST_FN_SET_PID;
-    parms.hdr.cParms      = SHCRGL_CPARMS_SET_PID;
+    VBGL_HGCM_HDR_INIT(&parms.hdr, conn->u32ClientID, SHCRGL_GUEST_FN_SET_PID, SHCRGL_CPARMS_SET_PID);
 
     parms.u64PID.type     = VMMDevHGCMParmType_64bit;
Index: trunk/src/VBox/GuestHost/OpenGL/util/vboxhgsmi.c
===================================================================
--- trunk/src/VBox/GuestHost/OpenGL/util/vboxhgsmi.c	(revision 66827)
+++ trunk/src/VBox/GuestHost/OpenGL/util/vboxhgsmi.c	(revision 68458)
@@ -1146,8 +1146,5 @@
     int rc;
 
-    parms.hdr.result      = VERR_WRONG_ORDER;
-    parms.hdr.u32ClientID = conn->u32ClientID;
-    parms.hdr.u32Function = SHCRGL_GUEST_FN_SET_VERSION;
-    parms.hdr.cParms      = SHCRGL_CPARMS_SET_VERSION;
+    VBGL_HGCM_HDR_INIT(&parms.hdr, conn->u32ClientID, SHCRGL_GUEST_FN_SET_VERSION, SHCRGL_CPARMS_SET_VERSION);
 
     parms.vMajor.type      = VMMDevHGCMParmType_32bit;
@@ -1178,8 +1175,5 @@
     int rc;
 
-    parms.hdr.result      = VERR_WRONG_ORDER;
-    parms.hdr.u32ClientID = conn->u32ClientID;
-    parms.hdr.u32Function = SHCRGL_GUEST_FN_SET_PID;
-    parms.hdr.cParms      = SHCRGL_CPARMS_SET_PID;
+    VBGL_HGCM_HDR_INIT(&parms.hdr, conn->u32ClientID, SHCRGL_GUEST_FN_SET_PID, SHCRGL_CPARMS_SET_PID);
 
     parms.u64PID.type     = VMMDevHGCMParmType_64bit;
