]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qga-vss: Exit with non-zero code when register fail
authorKostiantyn Kostiuk <kkostiuk@redhat.com>
Fri, 20 Jun 2025 08:31:32 +0000 (11:31 +0300)
committerKostiantyn Kostiuk <kkostiuk@redhat.com>
Mon, 30 Jun 2025 10:17:10 +0000 (13:17 +0300)
QGA installer uses rundll32 to run the DLLCOMRegister function
from qga-vss.dll and perform VSS provider registration.
rundll32 ignores the return value of the function and always
exits with a zero exit code. This causes a situation where
the installer does not know the status of VSS provider registration.

This commit forces to change exit code when the VSS provider
registration fails.

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/rundll32

Reviewed-by: Yan Vugenfirer <yvugenfi@redhat.com>
Tested-by: Dehan Meng <demeng@redhat.com>
Message-ID: <20250620083132.28347-1-kkostiuk@redhat.com>
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
qga/vss-win32/install.cpp

index 5cea5bcf7475255cd4acdf44678cd7f2422e548a..6ee2f44a1041cb9415c2c44dd308b2c7fe400ed4 100644 (file)
@@ -385,7 +385,10 @@ out:
 STDAPI_(void) CALLBACK DLLCOMRegister(HWND, HINSTANCE, LPSTR, int);
 STDAPI_(void) CALLBACK DLLCOMRegister(HWND, HINSTANCE, LPSTR, int)
 {
-    COMRegister();
+    HRESULT hr = COMRegister();
+    if (FAILED(hr)) {
+        exit(hr);
+    }
 }
 
 STDAPI_(void) CALLBACK DLLCOMUnregister(HWND, HINSTANCE, LPSTR, int);