mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
MSIX: keep PowerRename local COM server in memory (#1222)
This commit is contained in:
@@ -18,7 +18,8 @@ void ModuleRelease()
|
|||||||
{
|
{
|
||||||
if (--g_dwModuleRefCount == 0)
|
if (--g_dwModuleRefCount == 0)
|
||||||
{
|
{
|
||||||
PostThreadMessage(main_thread_id, WM_QUIT, 0, 0);
|
// Do nothing and keep the COM server in memory forever. We might want to introduce delayed shutdown and/or
|
||||||
|
// periodic polling whether a user has disabled us in settings. Tracking this in #1217
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HINSTANCE g_hInst = 0;
|
HINSTANCE g_hInst = 0;
|
||||||
@@ -95,9 +96,9 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
|||||||
main_thread_id = GetCurrentThreadId();
|
main_thread_id = GetCurrentThreadId();
|
||||||
winrt::init_apartment();
|
winrt::init_apartment();
|
||||||
g_hInst = hInstance;
|
g_hInst = hInstance;
|
||||||
auto factory = std::make_unique<CPowerRenameClassLocalFactory>(CLSID_PowerRenameMenu);
|
CPowerRenameClassLocalFactory factory{CLSID_PowerRenameMenu};
|
||||||
DWORD token;
|
DWORD token;
|
||||||
if (!SUCCEEDED(CoRegisterClassObject(CLSID_PowerRenameMenu, factory.get(), CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &token)))
|
if (!SUCCEEDED(CoRegisterClassObject(CLSID_PowerRenameMenu, &factory, CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &token)))
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user