From: Ben Chalmers Date: Thu, 2 Jan 2014 09:27:40 +0000 (+0000) Subject: [CA-119964] Do not fail when WMI Remove does not provide a respose object X-Git-Tag: 8.1.0-rc1~25^2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a72b3358ec245cd8dff1996b18a0d576682f6481;p=pvdrivers%2Fwin%2Fxeniface.git [CA-119964] Do not fail when WMI Remove does not provide a respose object This is the expected behavior - it never provides a response object (Also add some additional logging to help spot reasons for failure) Signed-off-by: Ben Chalmers --- diff --git a/src/win32stubagent/WmiAccessor.cpp b/src/win32stubagent/WmiAccessor.cpp index 2d5a103..e69a875 100644 --- a/src/win32stubagent/WmiAccessor.cpp +++ b/src/win32stubagent/WmiAccessor.cpp @@ -1143,20 +1143,26 @@ int WmiSessionRemoveEntry(WMIAccessor** wmi, void **sessionhandle, if (FAILED(methodExec(wmi,*session, L"RemoveValue", inMethodInst, &outMethodInst))) goto methodexecfailed; - if (outMethodInst==NULL) - goto sessionExec; outMethodInst->Release(); err=0; + inMethodInst->Release(); + VariantClear(&vpath); + return err; methodexecfailed: + OutputDebugString(__FUNCTION__ " MethodExecFailed"); methodputfailed: + OutputDebugString(__FUNCTION__ " MethodPutFailed"); inMethodInst->Release(); sessionstart: + OutputDebugString(__FUNCTION__ " SessionStartFailed"); VariantClear(&vpath); sessionExec: + OutputDebugString(__FUNCTION__ " SessionExecFailed"); setvpath: + OutputDebugString(__FUNCTION__ " SetVpathFailed"); return err; } diff --git a/src/win32stubagent/XService.cpp b/src/win32stubagent/XService.cpp index 44931a9..646563d 100644 --- a/src/win32stubagent/XService.cpp +++ b/src/win32stubagent/XService.cpp @@ -85,6 +85,7 @@ void PrintError(const char *func, DWORD err) 0, NULL); OutputDebugString((LPTSTR)lpMsgBuf); + XsLog("%s failed: %s (%x)", func, lpMsgBuf, err); XenstorePrintf("control/error", "%s failed: %s (%x)", func, lpMsgBuf, err); LocalFree(lpMsgBuf); } @@ -695,8 +696,8 @@ BOOL Run() } if (fail) { XsLog("Resetting"); - ReportEvent(eventLog, EVENTLOG_SUCCESS, 0, EVENT_XENUSER_UNEXPECTED, NULL, 0, 0, - NULL, NULL); + ReportEvent(eventLog, EVENTLOG_SUCCESS, 0, EVENT_XENUSER_UNEXPECTED, NULL, 0, 0, + NULL, NULL); break; } }