VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/BaseCom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/BaseCom.cpp')
-rw-r--r--src/Common/BaseCom.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/Common/BaseCom.cpp b/src/Common/BaseCom.cpp
index 349edabc..9a0c26f7 100644
--- a/src/Common/BaseCom.cpp
+++ b/src/Common/BaseCom.cpp
@@ -43,12 +43,27 @@ BOOL ComGetInstanceBase (HWND hWnd, REFCLSID clsid, REFIID iid, void **tcServer)
BOOL r;
if (IsUacSupported ())
- r = CreateElevatedComObject (hWnd, clsid, iid, tcServer) == S_OK;
+ {
+ while (true)
+ {
+ r = CreateElevatedComObject (hWnd, clsid, iid, tcServer) == S_OK;
+ if (r)
+ break;
+ else
+ {
+ if (IDRETRY == ErrorRetryCancel ("UAC_INIT_ERROR", hWnd))
+ continue;
+ else
+ break;
+ }
+ }
+ }
else
+ {
r = CoCreateInstance (clsid, NULL, CLSCTX_LOCAL_SERVER, iid, tcServer) == S_OK;
-
- if (!r)
- Error ("UAC_INIT_ERROR", hWnd);
+ if (!r)
+ Error ("UAC_INIT_ERROR", hWnd);
+ }
return r;
}