From: Sameeh Jubran <sameeh@daynix.com>
To: qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com
Cc: Yan Vugenfirer <yan@daynix.com>
Subject: [Qemu-devel] [PATCH] qga-win: VSS: Handle VSS_E_PROVIDER_ALREADY_REGISTERED error
Date: Wed, 22 Nov 2017 13:30:14 +0200 [thread overview]
Message-ID: <20171122113014.2512-1-sameeh@daynix.com> (raw)
From: Sameeh Jubran <sjubran@redhat.com>
We can get VSS_E_PROVIDER_ALREADY_REGISTERED error if for some
reason the uninstall of qemu-ga didn't complete successfully.
In this case we can try to unregister the component service
and attempt to register it again.
Signed-off-by: Sameeh Jubran <sjubran@redhat.com>
---
qga/vss-win32/install.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
index 51838eeb26..e7bc5e1d9d 100644
--- a/qga/vss-win32/install.cpp
+++ b/qga/vss-win32/install.cpp
@@ -443,6 +443,15 @@ STDAPI DllRegisterServer(void)
VSS_PROV_SOFTWARE,
const_cast<WCHAR*>(QGA_PROVIDER_VERSION),
g_gProviderVersion);
+ if (hr == (long int) VSS_E_PROVIDER_ALREADY_REGISTERED) {
+ DllUnregisterServer();
+ hr = pVssAdmin->RegisterProvider(g_gProviderId, CLSID_QGAVSSProvider,
+ const_cast<WCHAR * >(QGA_PROVIDER_LNAME),
+ VSS_PROV_SOFTWARE,
+ const_cast<WCHAR * >(QGA_PROVIDER_VERSION),
+ g_gProviderVersion);
+ }
+
if (FAILED(hr)) {
errmsg_dialog(hr, "RegisterProvider failed");
}
--
2.13.6
next reply other threads:[~2017-11-22 11:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-22 11:30 Sameeh Jubran [this message]
2017-11-22 11:57 ` [Qemu-devel] [PATCH] qga-win: VSS: Handle VSS_E_PROVIDER_ALREADY_REGISTERED error no-reply
2017-11-28 23:17 ` Michael Roth
2017-11-30 13:45 ` Sameeh Jubran
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171122113014.2512-1-sameeh@daynix.com \
--to=sameeh@daynix.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=yan@daynix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).