From e096622f6ce5b33efe9a8e03f09eafa578efc701 Mon Sep 17 00:00:00 2001 From: Will Thant Date: Tue, 13 Oct 2020 14:49:39 -0700 Subject: [PATCH] stuff --- .../EmbeddedManifestTest/embedded_manifest_test.cpp | 4 ++-- .../EmbeddedTestComponent.vcxproj | 6 ++++++ src/UndockedRegFreeWinRT/TestComponent/Class.idl | 1 + .../TestComponent/TestComponent.vcxproj | 10 ++++++++-- .../UndockedRegFreeWinRT/catalog.cpp | 2 -- .../UndockedRegFreeWinRT/dllmain.cpp | 1 - .../test_apartment_activation.cpp | 5 +++-- 7 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/UndockedRegFreeWinRT/EmbeddedManifestTest/embedded_manifest_test.cpp b/src/UndockedRegFreeWinRT/EmbeddedManifestTest/embedded_manifest_test.cpp index c55bfb4c..01fca18a 100644 --- a/src/UndockedRegFreeWinRT/EmbeddedManifestTest/embedded_manifest_test.cpp +++ b/src/UndockedRegFreeWinRT/EmbeddedManifestTest/embedded_manifest_test.cpp @@ -35,7 +35,7 @@ TEST_CASE("Embedded Exe Manifest Test") } SECTION("Activate TestComponent.MTA") { - winrt::init_apartment(winrt::apartment_type::single_threaded); + winrt::init_apartment(); winrt::TestComponent::ClassMta c; REQUIRE(c.Apartment() == APTTYPE_MTA); winrt::clear_factory_cache(); @@ -63,7 +63,7 @@ TEST_CASE("Embedded Dll Manifest Test") } SECTION("Activate TestComponent.MTA") { - winrt::init_apartment(winrt::apartment_type::single_threaded); + winrt::init_apartment(); winrt::EmbeddedTestComponent::ClassMta c; REQUIRE(c.Apartment() == APTTYPE_MTA); winrt::clear_factory_cache(); diff --git a/src/UndockedRegFreeWinRT/EmbeddedTestComponent/EmbeddedTestComponent.vcxproj b/src/UndockedRegFreeWinRT/EmbeddedTestComponent/EmbeddedTestComponent.vcxproj index 9505112d..66895cde 100644 --- a/src/UndockedRegFreeWinRT/EmbeddedTestComponent/EmbeddedTestComponent.vcxproj +++ b/src/UndockedRegFreeWinRT/EmbeddedTestComponent/EmbeddedTestComponent.vcxproj @@ -130,14 +130,17 @@ EmbeddedTestComponent.manifest shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib; + /APPCONTAINER:NO %(AdditionalOptions) EmbeddedTestComponent.manifest shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib; + /APPCONTAINER:NO %(AdditionalOptions) EmbeddedTestComponent.manifest shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib; + /APPCONTAINER:NO %(AdditionalOptions) -manifest EmbeddedTestComponent.manifest @@ -163,6 +166,9 @@ shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib; shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib; shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib; + /APPCONTAINER:NO %(AdditionalOptions) + /APPCONTAINER:NO %(AdditionalOptions) + /APPCONTAINER:NO %(AdditionalOptions) -manifest EmbeddedTestComponent.manifest diff --git a/src/UndockedRegFreeWinRT/TestComponent/Class.idl b/src/UndockedRegFreeWinRT/TestComponent/Class.idl index 3adfa379..90710fc5 100644 --- a/src/UndockedRegFreeWinRT/TestComponent/Class.idl +++ b/src/UndockedRegFreeWinRT/TestComponent/Class.idl @@ -21,3 +21,4 @@ namespace TestComponent Int32 Apartment; } } + diff --git a/src/UndockedRegFreeWinRT/TestComponent/TestComponent.vcxproj b/src/UndockedRegFreeWinRT/TestComponent/TestComponent.vcxproj index 1d49f3c5..e7a4c1f1 100644 --- a/src/UndockedRegFreeWinRT/TestComponent/TestComponent.vcxproj +++ b/src/UndockedRegFreeWinRT/TestComponent/TestComponent.vcxproj @@ -131,21 +131,24 @@ - _DEBUG;%(PreprocessorDefinitions) + DENTRY_PREFIX=Proxy;DPROXY_CLSID_IS={0xc02907ca, 0x97e8, 0x4a6c, 0xac, 0x41, 0x44, 0xd7, 0xe6, 0xcc, 0x25, 0xd9};%(PreprocessorDefinitions) shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib; + /APPCONTAINER:NO %(AdditionalOptions) shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib; + /APPCONTAINER:NO %(AdditionalOptions) shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib; + /APPCONTAINER:NO %(AdditionalOptions) - NDEBUG;%(PreprocessorDefinitions) + DENTRY_PREFIX=Proxy;DPROXY_CLSID_IS={0xc02907ca, 0x97e8, 0x4a6c, 0xac, 0x41, 0x44, 0xd7, 0xe6, 0xcc, 0x25, 0xd9};%(PreprocessorDefinitions) true @@ -154,6 +157,9 @@ shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib; shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib; shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib; + /APPCONTAINER:NO %(AdditionalOptions) + /APPCONTAINER:NO %(AdditionalOptions) + /APPCONTAINER:NO %(AdditionalOptions) true diff --git a/src/UndockedRegFreeWinRT/UndockedRegFreeWinRT/catalog.cpp b/src/UndockedRegFreeWinRT/UndockedRegFreeWinRT/catalog.cpp index 83211f4d..6f78341d 100644 --- a/src/UndockedRegFreeWinRT/UndockedRegFreeWinRT/catalog.cpp +++ b/src/UndockedRegFreeWinRT/UndockedRegFreeWinRT/catalog.cpp @@ -50,7 +50,6 @@ struct component { if (handle == nullptr) { - LoadLibraryW(module_name.c_str()); handle = LoadLibraryExW(module_name.c_str(), nullptr, LOAD_WITH_ALTERED_SEARCH_PATH); if (handle == nullptr) { @@ -68,7 +67,6 @@ struct component HRESULT GetActivationFactory(HSTRING className, REFIID iid, void** factory) { RETURN_IF_FAILED(LoadModule()); - IActivationFactory* ifactory = nullptr; HRESULT hr = this->get_activation_factory(className, &ifactory); // optimize for IActivationFactory? diff --git a/src/UndockedRegFreeWinRT/UndockedRegFreeWinRT/dllmain.cpp b/src/UndockedRegFreeWinRT/UndockedRegFreeWinRT/dllmain.cpp index 551485bb..49fb0be3 100644 --- a/src/UndockedRegFreeWinRT/UndockedRegFreeWinRT/dllmain.cpp +++ b/src/UndockedRegFreeWinRT/UndockedRegFreeWinRT/dllmain.cpp @@ -437,7 +437,6 @@ HRESULT ExtRoLoadCatalog() nullptr)); RETURN_IF_FAILED(LoadManifestFromPath(asmInfo->lpAssemblyManifestPath)); } - std::cout << "size: " << GetModuleSize() << std::endl; return S_OK; } diff --git a/src/UndockedRegFreeWinRT/UndockedRegFreeWinRTTest/test_apartment_activation.cpp b/src/UndockedRegFreeWinRT/UndockedRegFreeWinRTTest/test_apartment_activation.cpp index 72627b38..190f0ccd 100644 --- a/src/UndockedRegFreeWinRT/UndockedRegFreeWinRTTest/test_apartment_activation.cpp +++ b/src/UndockedRegFreeWinRT/UndockedRegFreeWinRTTest/test_apartment_activation.cpp @@ -30,7 +30,7 @@ TEST_CASE("Undocked Regfree WinRT Activation") winrt::TestComponent::ClassBoth c; REQUIRE(c.Apartment() == APTTYPE_MTA); winrt::clear_factory_cache(); - winrt::uninit_apartment(); + winrt::uninit_partment(); } SECTION("Cross Apartment MTA Activation") { @@ -39,7 +39,8 @@ TEST_CASE("Undocked Regfree WinRT Activation") REQUIRE(c.Apartment() == APTTYPE_MTA); winrt::clear_factory_cache(); winrt::uninit_apartment(); - } + } + SECTION("BLOCK STA To Current MTA") { winrt::init_apartment();