vbox: Introduce vboxUniformedPFN::ClearException()

The ClearException() method clears the latest exception inside of
VirtualBox. This needed because obtaining an exception via
GetException() does not clear it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Michal Privoznik 2023-01-21 10:33:07 +01:00
parent 52aefc9d31
commit ab37a858eb
2 changed files with 7 additions and 0 deletions

View File

@ -486,6 +486,11 @@ static HRESULT _pfnGetException(PCVBOXXPCOM pFuncs, IErrorInfo **ppException)
return pFuncs->pfnGetException(ppException); return pFuncs->pfnGetException(ppException);
} }
static HRESULT _pfnClearException(PCVBOXXPCOM pFuncs)
{
return pFuncs->pfnClearException();
}
static void _vboxIIDInitialize(vboxIID *iid) static void _vboxIIDInitialize(vboxIID *iid)
{ {
memset(iid, 0, sizeof(vboxIID)); memset(iid, 0, sizeof(vboxIID));
@ -2224,6 +2229,7 @@ static vboxUniformedPFN _UPFN = {
.Utf16ToUtf8 = _pfnUtf16ToUtf8, .Utf16ToUtf8 = _pfnUtf16ToUtf8,
.Utf8ToUtf16 = _pfnUtf8ToUtf16, .Utf8ToUtf16 = _pfnUtf8ToUtf16,
.GetException = _pfnGetException, .GetException = _pfnGetException,
.ClearException = _pfnClearException,
}; };
static vboxUniformedIID _UIID = { static vboxUniformedIID _UIID = {

View File

@ -110,6 +110,7 @@ typedef struct {
int (*Utf16ToUtf8)(PCVBOXXPCOM pFuncs, const PRUnichar *pwszString, char **ppszString); int (*Utf16ToUtf8)(PCVBOXXPCOM pFuncs, const PRUnichar *pwszString, char **ppszString);
int (*Utf8ToUtf16)(PCVBOXXPCOM pFuncs, const char *pszString, PRUnichar **ppwszString); int (*Utf8ToUtf16)(PCVBOXXPCOM pFuncs, const char *pszString, PRUnichar **ppwszString);
HRESULT (*GetException)(PCVBOXXPCOM pFuncs, nsIException **ppException); HRESULT (*GetException)(PCVBOXXPCOM pFuncs, nsIException **ppException);
HRESULT (*ClearException)(PCVBOXXPCOM pFuncs);
} vboxUniformedPFN; } vboxUniformedPFN;
/* Functions for vboxIID */ /* Functions for vboxIID */