Skip to content

Commit

Permalink
Internal. Use CoInitializeEx
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximus5 committed Jul 11, 2020
1 parent 611d621 commit 3d06c82
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/ConEmu/LoadImg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static GdipCreateBitmapFromHBITMAP_t GdipCreateBitmapFromHBITMAP = NULL;
//
// if (!gbMStreamCoInitialized)
// {
// HRESULT hr = CoInitialize(NULL);
// HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
// gbMStreamCoInitialized = TRUE;
// }
// };
Expand All @@ -99,7 +99,7 @@ static GdipCreateBitmapFromHBITMAP_t GdipCreateBitmapFromHBITMAP = NULL;
//
// if (!gbMStreamCoInitialized)
// {
// HRESULT hr = CoInitialize(NULL);
// HRESULT hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
// gbMStreamCoInitialized = TRUE;
// }
// };
Expand Down
3 changes: 2 additions & 1 deletion src/ConEmuBg/ConEmuBg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,9 @@ struct GDIPlusDecoder
}

bool result = false;
HRESULT hrCoInitialized = CoInitialize(NULL);
HRESULT hrCoInitialized = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
bCoInitialized = SUCCEEDED(hrCoInitialized);
_ASSERTE(bCoInitialized);
//wchar_t FullPath[MAX_PATH*2+15]; FullPath[0] = 0;
hGDIPlus = LoadLibraryW(L"GdiPlus.dll");

Expand Down
3 changes: 2 additions & 1 deletion src/ConEmuTh/Display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ DWORD WINAPI CeFullPanelInfo::DisplayThread(LPVOID lpvParam)
{
MSG msg;
HANDLE hReady = (HANDLE)lpvParam;
const bool comInitialized = SUCCEEDED(CoInitialize(NULL));
const bool comInitialized = SUCCEEDED(CoInitializeEx(nullptr, COINIT_MULTITHREADED));
_ASSERTE(comInitialized);
_ASSERTE(gpImgCache);
gnConEmuFadeMsg = RegisterWindowMessage(CONEMUMSG_PNLVIEWFADE);
gnConEmuSettingsMsg = RegisterWindowMessage(CONEMUMSG_PNLVIEWSETTINGS);
Expand Down
2 changes: 1 addition & 1 deletion src/ConEmuTh/ImgCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ CImgCache::CImgCache(HMODULE hSelf)
*mpsz_ModuleSlash = 0;

// Prepare root storage file pathname
SetCacheLocation(nullptr); // Use %TEMP% by default
SetCacheLocation(NULL); // Use %TEMP% by default

LoadModules();

Expand Down
2 changes: 1 addition & 1 deletion src/ConEmuTh/ImgCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class CImgLoader : public CQueueProcessor<IMAGE_CACHE_INFO*>
{
if (!mb_comInitialized)
{
mb_comInitialized = SUCCEEDED(CoInitialize(NULL));
mb_comInitialized = SUCCEEDED(CoInitializeEx(nullptr, COINIT_MULTITHREADED));
}
return S_OK;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ConEmuTh/Modules/gdip/gdip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ struct GDIPlusDecoder
nErrNumber = 0;
//pszPluginKey = pInit->pRegKey;
//ReloadConfig();
HRESULT hrCoInitialized = CoInitialize(NULL);
HRESULT hrCoInitialized = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
bCoInitialized = SUCCEEDED(hrCoInitialized);
wchar_t FullPath[MAX_PATH*2+15]; FullPath[0] = 0;
//if (ghModule)
Expand Down
2 changes: 1 addition & 1 deletion src/ConEmuTh/Modules/ico/ico.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ struct ICODecoder
BOOL Init(struct CET_Init* pInit)
{
pInit->pContext = this;
HRESULT hrCoInitialized = CoInitialize(NULL);
HRESULT hrCoInitialized = CoInitializeEx(nullptr, COINIT_MULTITHREADED);
gbCoInitialized = SUCCEEDED(hrCoInitialized);
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
Gdiplus::Status lRc = GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
Expand Down
2 changes: 1 addition & 1 deletion src/ConEmuTh/QueueProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ class CQueueProcessor
{
return mb_TerminateRequested;
};
// Здесь потомок может выполнить CoInitialize например
// Здесь потомок может выполнить CoInitializeEx например
virtual HRESULT OnThreadStarted()
{
return S_OK;
Expand Down

0 comments on commit 3d06c82

Please sign in to comment.