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.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/Common/BaseCom.cpp b/src/Common/BaseCom.cpp
index 32859b11..3eaaf809 100644
--- a/src/Common/BaseCom.cpp
+++ b/src/Common/BaseCom.cpp
@@ -45,12 +45,13 @@ HRESULT CreateElevatedComObject (HWND hwnd, REFGUID guid, REFIID iid, void **ppv
BOOL ComGetInstanceBase (HWND hWnd, REFCLSID clsid, REFIID iid, void **tcServer)
{
BOOL r;
+ HRESULT hr;
if (IsUacSupported ())
{
while (true)
{
- r = CreateElevatedComObject (hWnd, clsid, iid, tcServer) == S_OK;
+ r = (hr = CreateElevatedComObject (hWnd, clsid, iid, tcServer)) == S_OK;
if (r)
break;
else
@@ -64,11 +65,16 @@ BOOL ComGetInstanceBase (HWND hWnd, REFCLSID clsid, REFIID iid, void **tcServer)
}
else
{
- r = CoCreateInstance (clsid, NULL, CLSCTX_LOCAL_SERVER, iid, tcServer) == S_OK;
+ r = (hr = CoCreateInstance (clsid, NULL, CLSCTX_LOCAL_SERVER, iid, tcServer)) == S_OK;
if (!r)
Error ("UAC_INIT_ERROR", hWnd);
}
+ if (!r)
+ {
+ SetLastError((DWORD) hr);
+ }
+
return r;
}
@@ -485,4 +491,14 @@ DWORD BaseCom::UpdateSetupConfigFile (BOOL bForInstall)
}
return ERROR_SUCCESS;
-} \ No newline at end of file
+}
+
+DWORD BaseCom::NotifyService(DWORD dwNotifyCode)
+{
+ return SendServiceNotification(dwNotifyCode);
+}
+
+DWORD BaseCom::FastFileResize (BSTR filePath, __int64 fileSize)
+{
+ return ::FastResizeFile (filePath, fileSize);
+}