mirror of
https://github.com/LegacyUpdate/LegacyUpdate.git
synced 2025-01-22 06:01:50 -05:00
I think we're meant to call CoInitializeEx() on launcher startup
This commit is contained in:
parent
02b09374b6
commit
c139ecd196
2 changed files with 8 additions and 5 deletions
|
@ -40,7 +40,7 @@ static const LPWSTR GetUpdateSiteURL() {
|
|||
}
|
||||
|
||||
void LaunchUpdateSite(int argc, LPWSTR *argv, int nCmdShow) {
|
||||
HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
||||
HRESULT hr = S_OK;
|
||||
IWebBrowser2 *browser;
|
||||
VARIANT url;
|
||||
VARIANT flags;
|
||||
|
@ -48,10 +48,6 @@ void LaunchUpdateSite(int argc, LPWSTR *argv, int nCmdShow) {
|
|||
LPTSTR siteURL;
|
||||
HMONITOR monitor;
|
||||
|
||||
if (!SUCCEEDED(hr)) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
// If running on 2k/XP, make sure we're elevated. If not, show Run As prompt.
|
||||
if (!AtLeastWinVista() && !IsUserAdmin()) {
|
||||
LPWSTR args = (LPWSTR)LocalAlloc(LPTR, 512 * sizeof(WCHAR));
|
||||
|
|
|
@ -35,6 +35,12 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
|
|||
g_hInstance = hInstance;
|
||||
Startup();
|
||||
|
||||
HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
||||
if (!SUCCEEDED(hr)) {
|
||||
ExitProcess(hr);
|
||||
return hr;
|
||||
}
|
||||
|
||||
int argc;
|
||||
LPWSTR *argv = CommandLineToArgvW(GetCommandLineW(), &argc);
|
||||
|
||||
|
@ -116,6 +122,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
|
|||
}
|
||||
}
|
||||
|
||||
CoUninitialize();
|
||||
ExitProcess(msg.wParam);
|
||||
return msg.wParam;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue