}
VBOX_UTF8_TO_UTF16(def->parent.name, &name);
- if (!name) {
- virReportOOMError();
- goto cleanup;
- }
if (def->parent.description) {
VBOX_UTF8_TO_UTF16(def->parent.description, &description);
- if (!description) {
- virReportOOMError();
- goto cleanup;
- }
}
rc = gVBoxAPI.UIConsole.TakeSnapshot(console, name, description, &progress);
goto cleanup;
}
VBOX_UTF16_TO_UTF8(nameUtf16, &name);
- if (!name) {
- virReportOOMError();
- goto cleanup;
- }
ret = virGetDomainSnapshot(dom, name);
}
VBOX_UTF16_TO_UTF8(nameUtf16, &name);
- if (!name) {
- virReportOOMError();
- goto cleanup;
- }
ret = virGetDomainSnapshot(dom, name);
}
VBOX_UTF16_TO_UTF8(nameUtf16, &name);
- if (!name) {
- virReportOOMError();
- goto cleanup;
- }
ret = STREQ(snapshot->name, name);
} \
} while (0)
-#define VBOX_UTF16_TO_UTF8(arg1, arg2) gVBoxAPI.UPFN.Utf16ToUtf8(data->pFuncs, arg1, arg2)
-#define VBOX_UTF8_TO_UTF16(arg1, arg2) gVBoxAPI.UPFN.Utf8ToUtf16(data->pFuncs, arg1, arg2)
+#define VBOX_UTF16_TO_UTF8(arg1, arg2) \
+ do { \
+ gVBoxAPI.UPFN.Utf16ToUtf8(data->pFuncs, arg1, arg2); \
+ if (!*(arg2)) \
+ abort(); \
+ } while (0)
+
+#define VBOX_UTF8_TO_UTF16(arg1, arg2) \
+ do { \
+ gVBoxAPI.UPFN.Utf8ToUtf16(data->pFuncs, arg1, arg2); \
+ if (!*(arg2)) \
+ abort(); \
+ } while (0)
#define VBOX_ADDREF(arg) gVBoxAPI.nsUISupports.AddRef((void *)(arg))