Index: trunk/src/VBox/Main/cbinding/tstXPCOMCCall.c
===================================================================
--- trunk/src/VBox/Main/cbinding/tstXPCOMCCall.c	(revision 19138)
+++ trunk/src/VBox/Main/cbinding/tstXPCOMCCall.c	(revision 19375)
@@ -31,33 +31,9 @@
 #include <unistd.h>
 
-static char *nsIDToString(nsID *guid);
 static void listVMs(IVirtualBox *virtualBox, ISession *session, nsIEventQueue *queue);
-static void registerCallBack(IVirtualBox *virtualBox, ISession *session, nsID *machineId, nsIEventQueue *queue);
-static void startVM(IVirtualBox *virtualBox, ISession *session, nsID *id, nsIEventQueue *queue);
+static void registerCallBack(IVirtualBox *virtualBox, ISession *session, PRUnichar *machineId, nsIEventQueue *queue);
+static void startVM(IVirtualBox *virtualBox, ISession *session, PRUnichar *id, nsIEventQueue *queue);
 
 int volatile g_refcount = 0;
-
-/**
- * Helper function to convert an nsID into a human readable string.
- *
- * @returns result string, allocated. Has to be freed using free()
- * @param   guid Pointer to nsID that will be converted.
- */
-static char *nsIDToString(nsID *guid)
-{
-    /* Avoid magic number 39. Yes, sizeof "literal" includes the NUL byte. */
-    char *res = malloc(sizeof "{12345678-1234-1234-1234-123456789012}");
-
-    if (res != NULL)
-    {
-        sprintf(res, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
-                (unsigned)guid->m0, (unsigned)guid->m1, (unsigned)guid->m2,
-                (unsigned)guid->m3[0], (unsigned)guid->m3[1],
-                (unsigned)guid->m3[2], (unsigned)guid->m3[3],
-                (unsigned)guid->m3[4], (unsigned)guid->m3[5],
-                (unsigned)guid->m3[6], (unsigned)guid->m3[7]);
-    }
-    return res;
-}
 
 /**
@@ -275,5 +251,5 @@
  * @param   queue      handle to the event queue
  */
-static void registerCallBack(IVirtualBox *virtualBox, ISession *session, nsID *machineId, nsIEventQueue *queue)
+static void registerCallBack(IVirtualBox *virtualBox, ISession *session, PRUnichar *machineId, nsIEventQueue *queue)
 {
     IConsole *console = NULL;
@@ -402,15 +378,14 @@
         }
 
-
-        {
-            nsID  *iid = NULL;
-            char  *uuidString;
-
-            machine->vtbl->GetId(machine, &iid);
-            uuidString = nsIDToString(iid);
-            printf("\tUUID:        %s\n", uuidString);
-
-            free(uuidString);
-            g_pVBoxFuncs->pfnComUnallocMem(iid);
+        {
+            PRUnichar *uuidUtf16 = NULL;
+            char      *uuidUtf8  = NULL;
+
+            machine->vtbl->GetId(machine, &uuidUtf16);
+            g_pVBoxFuncs->pfnUtf16ToUtf8(uuidUtf16, &uuidUtf8);
+            printf("\tUUID:        %s\n", uuidUtf8);
+
+            g_pVBoxFuncs->pfnUtf8Free(uuidUtf8);
+            g_pVBoxFuncs->pfnUtf16Free(uuidUtf16);
         }
 
@@ -470,10 +445,10 @@
         if (machine)
         {
-            nsID  *iid = NULL;
-
-            machine->vtbl->GetId(machine, &iid);
-            startVM(virtualBox, session, iid, queue);
-
-            g_pVBoxFuncs->pfnComUnallocMem(iid);
+            PRUnichar *uuidUtf16 = NULL;
+
+            machine->vtbl->GetId(machine, &uuidUtf16);
+            startVM(virtualBox, session, uuidUtf16, queue);
+
+            g_pVBoxFuncs->pfnUtf16Free(uuidUtf16);
         }
     }
@@ -503,5 +478,5 @@
  */
 
-static void startVM(IVirtualBox *virtualBox, ISession *session, nsID *id, nsIEventQueue *queue)
+static void startVM(IVirtualBox *virtualBox, ISession *session, PRUnichar *id, nsIEventQueue *queue)
 {
     nsresult rc;
@@ -539,5 +514,5 @@
     {
         PRBool completed;
-        nsresult resultCode;
+        PRInt32 resultCode;
 
         printf("Waiting for the remote session to open...\n");
Index: trunk/src/VBox/Main/cbinding/tstXPCOMCGlue.c
===================================================================
--- trunk/src/VBox/Main/cbinding/tstXPCOMCGlue.c	(revision 19138)
+++ trunk/src/VBox/Main/cbinding/tstXPCOMCGlue.c	(revision 19375)
@@ -30,30 +30,6 @@
 #include <stdlib.h>
 
-static char *nsIDToString(nsID *guid);
 static void listVMs(IVirtualBox *virtualBox, ISession *session);
-static void startVM(IVirtualBox *virtualBox, ISession *session, nsID *id);
-
-/**
- * Helper function to convert an nsID into a human readable string.
- *
- * @returns result string, allocated. Has to be freed using free()
- * @param   guid Pointer to nsID that will be converted.
- */
-static char *nsIDToString(nsID *guid)
-{
-    /* Avoid magic number 39. Yes, sizeof "literal" includes the NUL byte. */
-    char *res = malloc(sizeof "{12345678-1234-1234-1234-123456789012}");
-
-    if (res != NULL)
-    {
-        sprintf(res, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
-                (unsigned)guid->m0, (unsigned)guid->m1, (unsigned)guid->m2,
-                (unsigned)guid->m3[0], (unsigned)guid->m3[1],
-                (unsigned)guid->m3[2], (unsigned)guid->m3[3],
-                (unsigned)guid->m3[4], (unsigned)guid->m3[5],
-                (unsigned)guid->m3[6], (unsigned)guid->m3[7]);
-    }
-    return res;
-}
+static void startVM(IVirtualBox *virtualBox, ISession *session, PRUnichar *id);
 
 /**
@@ -129,13 +105,13 @@
 
         {
-            nsID  *iid = NULL;
-            char  *uuidString;
-
-            machine->vtbl->GetId(machine, &iid);
-            uuidString = nsIDToString(iid);
-            printf("\tUUID:        %s\n", uuidString);
-
-            free(uuidString);
-            g_pVBoxFuncs->pfnComUnallocMem(iid);
+            PRUnichar *uuidUtf16 = NULL;
+            char      *uuidUtf8  = NULL;
+
+            machine->vtbl->GetId(machine, &uuidUtf16);
+            g_pVBoxFuncs->pfnUtf16ToUtf8(uuidUtf16, &uuidUtf8);
+            printf("\tUUID:        %s\n", uuidUtf8);
+
+            g_pVBoxFuncs->pfnUtf8Free(uuidUtf8);
+            g_pVBoxFuncs->pfnUtf16Free(uuidUtf16);
         }
 
@@ -195,10 +171,10 @@
         if (machine)
         {
-            nsID  *iid = NULL;
-
-            machine->vtbl->GetId(machine, &iid);
-            startVM(virtualBox, session, iid);
-
-            g_pVBoxFuncs->pfnComUnallocMem(iid);
+            PRUnichar *uuidUtf16 = NULL;
+
+            machine->vtbl->GetId(machine, &uuidUtf16);
+            startVM(virtualBox, session, uuidUtf16);
+
+            g_pVBoxFuncs->pfnUtf16Free(uuidUtf16);
         }
     }
@@ -226,5 +202,5 @@
  * @param   id         identifies the machine to start
  */
-static void startVM(IVirtualBox *virtualBox, ISession *session, nsID *id)
+static void startVM(IVirtualBox *virtualBox, ISession *session, PRUnichar *id)
 {
     nsresult rc;
@@ -262,5 +238,5 @@
     {
         PRBool completed;
-        nsresult resultCode;
+        PRInt32 resultCode;
 
         printf("Waiting for the remote session to open...\n");
