This commit is contained in:
Will Thant 2020-10-13 14:49:39 -07:00
Родитель 88de5b7c5b
Коммит e096622f6c
7 изменённых файлов: 20 добавлений и 9 удалений

Просмотреть файл

@ -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();

Просмотреть файл

@ -130,14 +130,17 @@
<Link>
<ManifestFile Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">EmbeddedTestComponent.manifest</ManifestFile>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib;</AdditionalDependencies>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">/APPCONTAINER:NO %(AdditionalOptions)</AdditionalOptions>
</Link>
<Link>
<ManifestFile Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EmbeddedTestComponent.manifest</ManifestFile>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib;</AdditionalDependencies>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">/APPCONTAINER:NO %(AdditionalOptions)</AdditionalOptions>
</Link>
<Link>
<ManifestFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EmbeddedTestComponent.manifest</ManifestFile>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib;</AdditionalDependencies>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/APPCONTAINER:NO %(AdditionalOptions)</AdditionalOptions>
</Link>
<Manifest>
<AdditionalManifestFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">-manifest EmbeddedTestComponent.manifest</AdditionalManifestFiles>
@ -163,6 +166,9 @@
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib;</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib;</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|x64'">shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib;</AdditionalDependencies>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">/APPCONTAINER:NO %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">/APPCONTAINER:NO %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/APPCONTAINER:NO %(AdditionalOptions)</AdditionalOptions>
</Link>
<Manifest>
<AdditionalManifestFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">-manifest EmbeddedTestComponent.manifest</AdditionalManifestFiles>

Просмотреть файл

@ -21,3 +21,4 @@ namespace TestComponent
Int32 Apartment;
}
}

Просмотреть файл

@ -131,21 +131,24 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>DENTRY_PREFIX=Proxy;DPROXY_CLSID_IS={0xc02907ca, 0x97e8, 0x4a6c, 0xac, 0x41, 0x44, 0xd7, 0xe6, 0xcc, 0x25, 0xd9};%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib;</AdditionalDependencies>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">/APPCONTAINER:NO %(AdditionalOptions)</AdditionalOptions>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib;</AdditionalDependencies>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">/APPCONTAINER:NO %(AdditionalOptions)</AdditionalOptions>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib;</AdditionalDependencies>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/APPCONTAINER:NO %(AdditionalOptions)</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>DENTRY_PREFIX=Proxy;DPROXY_CLSID_IS={0xc02907ca, 0x97e8, 0x4a6c, 0xac, 0x41, 0x44, 0xd7, 0xe6, 0xcc, 0x25, 0xd9};%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</BrowseInformation>
</ClCompile>
<Link>
@ -154,6 +157,9 @@
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib;</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib;</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|x64'">shlwapi.lib;runtimeobject.lib;Ole32.lib;kernel32.Lib;OleAut32.lib;</AdditionalDependencies>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">/APPCONTAINER:NO %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">/APPCONTAINER:NO %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/APPCONTAINER:NO %(AdditionalOptions)</AdditionalOptions>
</Link>
<Bscmake>
<PreserveSbr Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</PreserveSbr>

Просмотреть файл

@ -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?

Просмотреть файл

@ -437,7 +437,6 @@ HRESULT ExtRoLoadCatalog()
nullptr));
RETURN_IF_FAILED(LoadManifestFromPath(asmInfo->lpAssemblyManifestPath));
}
std::cout << "size: " << GetModuleSize() << std::endl;
return S_OK;
}

Просмотреть файл

@ -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();