MSIX Dynamic Dependencies (#393)
* Added initial skeleton of DynamicDepedencies Flat-C APIs More expansive skeleton. Fixed some build errors Updated per API Review Updated to match API changes Updated per spec Restructured DynDep API + Test layout New dyndep dirs Added WinRT API. Skeleton, but get past the project-isms. Compiles clean! Changed /W3 to /W4 Implemented most of the WinRT API Removed CreateForUser as WinRT has no Windows.System.User to SID conversion :-( Removed CreateForUser Added ProjectReunion_BootstrapDLL Added MIDL generated .h file Added Detours Added README.md to track when we forked Detours (since they don't provide a nuget package or like artifact we can cleanly consume) Fixed build configurations. Tests don't build for ARM64 due to CppTest not supporting ARM64, otherwise should all be good now Started filling out e.g. Detours initialization for ProjectReunion_DLL. Almost ready to start some testing Added wil::DLLMain() calls to ProjectReunion_[Boostrap]DLL projects Forgot to add new dllmain.cpp. Moved ProjectReunion_BootstrapDLL project under dev in ProjectReunion.sln's view (no change to filesystem layout) Added test Framework packages Got MakeMSIX working! An absolute path sneaked into the sln. Fixed Incorporated feedback Moved makemsix.cmd to the tools directory Updated makemsix.cmd to also sign the generated package Adding tests for Bootstrap API Added Main.Sidecar test project Added Main.Sidecar package for testing. Updating Bootstrap API to find the framework via a dependency of the package providing the LifetimeManager implementation (e.g. Main.Sidecar). Minor build-ism/makefile (well, vcxproj) corrections Added comment about the LifetimeManager's implementation Fixed absolute-ish relative path that snuck in (must have been inserted via VS' Add dialog) Fixed absolute-ish path the snuck into the .sln Simplified nested namespace statements Incorporated feedback Update Main.Sidecar's appxmanifest with COM registration info and other minor corrections Fixed header filename Simplified namespace'ing syntax Incorproated feedback Moved implementation bits into MddCore namespace. Pulled remaining code and pseudocode from spec. Marked work to come with TODO, often pseudocode blocked in #if defined(TODO_Stuff)...#endif so as not to break the build; will be revised shortly as I finish the implementation and light up tests Added FAILFAST checks in MddBootstrapInitialize() to detect multiple initialization Added missing end-tag Fixed Main.Sidecar's manifest and logos. Updated makemsix.cmd to copy Assets\* if exists, and make logo.png optional (should have one or the other, but probably not both) Started to exceptionalize error handling; more to come. Bootstrap test framing in place. But...Main.Sidecar manifest creation fails because there's no typelib :-( More vcxproj hackery needed... Added message loop to Main.Sidecar exe to solve the need-to-live-until-told-to-quit problem. Removed typelib from appxmanifest as unnecessary Removed leftover end-tag in appxmanifest.xml Manifest tweaks. Added Main.Sidecar2 as a WRL alternative to Main.Sidecar, which is incomplete as you can't make a pure C++/WinRT OOP Server today you need a hybrid of C++/WinRT plus WRL; Main.Sidecar's incomplete; ignoring for now while focusing on getting Sidecar2 working. Build fails because the manifest can't find the proxystub dll. The project needs to be split into 3 -- make exe, make proxystub dll, make msix Added Main.Sidecar3*. ProxyStub mostly in place (needs dlldata.c?). More to come Main.Sidecar3 progress Closer to working - Main.Sidecar3.exe looks almost right More tweaks. Almost ther Fiddling with msix makefile. Need more structural changes It's alive! Aliiiiiive! Cleaned up Main.Sidecar variants. Added new files missed in previous commit Bootstrap test almost working! Did some HRESULT->Exception conversion; more to come Force out test thread to be MTA despite CppUnitTest 'conveniently' initializing us as STA First blood! ShutdownWithoutInitialize() passes! And there was much rejoicing Updated Main.Sidecar's PackagedCOM OOP Server. It works (at last)! Minor related improvements. More to come Add .def file for the Main.Sidecar's exe Incorporated a stand-in for ProjectReunion's Framework package so we can test the Bootstrap API before the (real) framework package is created Small tweaks per testing More code cleanup. Bootstrap tests pass! Added TODOs for follow up DUpdated samples to match API Added DynDep tests against current API implementation (e.g. return E_NOTIMPL); update coming with API implementation. Worked out test environment issues where we need packages for product code but don't have packages with locally built binaries like real product code (chicken/egg problems). Changed Detours initialization to FAIL_FAST if anything goes wrong. Keeping HRESULT return for future extensibility so callers are prepared to handle it Implement dynamic package graph Lit up Create+Delete Dialed down the chattiness of nmake projects Fixed up more build errors Checkingpoint Fixed compile errors More checkpointing Add DataStore Cleaned up build warnings. Incorporated DataStore into the UT Implemented GetApplicationData Fixed and enhanced tests. Fixed runtime. It works. Wow. It's aliiiive.... More verification in tests. Remove leaves an extra ';', need to fix Fixed UpdatePath to produce the same PATH after Add+Remove (i.e. same as when we started) Changed Framework.Math.* packages to be trivial Win32 compiled dlls w/no dependencies (save for kernel32.dll) to simplify testing Added Detour'ing functions when ProjectReunion.dll is loaded (DllMain). Fixed Detour'd GetCurrentPackageInfo* to work as expected (bit fiddling is fun for the whole family!). Expanded verifications to include the package graph (GetCurrentPackageInfo*) Fixed test to properly #include Math.*.h Expanded tests to verify Add(ProjectReunion) works as expected Test refinments Generate context ids. Extend tests to a 2-fwk scenario Partial DataStore support Expanded the test suite. Fixed some warnings Expanded test suite. Validating Cleaned up some old style syntax Fixed warnings. Fixing lifetimeKind=FilePath|RegistryKey expiry. Revised the no-static-package-graph detection Expanded the test suite. All tests pass! Remvoed obsolete comment Updated per rebase Fixed warnings only visible in Release builds. Fixed some build issues in some flavors; working on the rest Partial vcxproj/Build fixes - x64=OK. ARM=Fail because MIDL generates #if defined(_ARM_) but VC++ defines _M_ARM_; should we just /D_ARM_ for ARM builds? ARM64=Fail because of some problem in dlldata.c. x86=Fail because 'LNK2001unresolved external symbol _ObjectStublessClient3' in the DynamicDependency.DataStore.ProxyStub project; need to #define something (_MERGE_PROXYSTUB)? Discussing with folks who know more Removed MinimumTargetSystem=NT100 to fix the ObjectStublessClient problem; defaults to NT60 which 'doesn't need to link with ole32 for ObjectStublessClient'. How cryptic LifetimeKind=RegistryKey didn't properly detect if a regkey was missing vs error (outofmemory, etc) Fixed incorrect calling convention on Detour'd functions. x86 tests detected; x64 and compiler didn't Start of DynamicDependencyLifetimeManager - create DDLM based on Main.Sidecar Added appextension to DDLM manifest Fixed ProjectReunion_BootstrapDLL to use MIDL output per-configuration/architecture (not checked in an shared across) Revised Bootstrap API to support hunt for DDLM. Refactored VS projects to play nice (gah!). Now to update the tests to match Bootstrap tests pass! TODO: Update other tests to match and cleanup Fixed Win32 test syntax Fixed test (fake) Reunion framework version to be >= test LifetimeManager <sheepish grin>. Twewaking tests to play nice with DDLM Updated Create_Add_Architectures_Current test. Streamlined bootstrap logic More test update sync for DDLM. Likewise updated some project references More test sync-up-age for DDLM Changed some old HRESULT-error based code to exceptions More exception-ification Removed the Main.Sidecar test projects/artifacts (superseded/formalized as the DDLM) Removed some debugging hackery Revamped WinRT tests for parity with Win32's more extensive tests Fixed an inverted log message check Added MddGetIdForPackageDependencyContext() so WinRT API could work, and generally useful for debugging, troubleshooting and testability. Implemented ScopeIsSystem. Cleanup up some leftover cruft * Preparing to remove obsolete skeletal samples * VS updated the sln after loading * Removed dead entry leftover from a prior bad merge * Added start of UndockedRegFreeWinRT to ProjectReunion_DLL * Reworked URFW #includes to cull out redudancies and consolidate with ProjectReunion existing plumbing. Switched the few WRL uses to WIL * Incorproated URFW's DllMain setup logic. Reverted ComPtr usage to minimize forkage. Baseline looks good as a URFW-fork. Now to add AppxManifest.xml support and test * Reworking WinRT support to better fit with Mdd + URFW architectures * Parse appxmanifest.xml for WinRT inproc servers * Added slightly improved error reporting to makemsix.cmd * Grabbed updated test cert * WinRT support in progress but running into reentrancy issues. Need to refactor the WinRT data to be independent of the PackageGraph data (can't lock non-reentrant mutex and call GetActivationFactory which in turn does a GetActivationFactory and grab the lock already locked... * Reworking WinRT support to avoid reentrancy problems * Checkpointing while revising the WinRT support * Corrected AppxManifest parsing and cleaned up some error reporting * Tweaked error logging to avoid false spew to the debug output * Updated appxmanifest parsing to produce absolute filenames (not package-relative) as needed for use at runtime * Fix WinRT not passing down lifetimeArtifact * Fixed PSID user support. Fixed WinRT's GetFromId(). Added WinRT's missing GetFromIdForSystem() to complement GetFromId() to match Create+CreateForSystem. Fixed some glitches in the WinRT test code. WinRT tests are passing! * Small fix in text code. Something's wrong with the exception throw/catch/something causing process termination in Test::DynamicDependency::Test_WinRT::Create_RegistryLifetime_NoExist and Test::DynamicDependency::Test_WinRT::Create_FileLifetime_NoExist, but I don't see what. Will ping some folks in the morning * Doh! Catching hresult_error, not hresult! Tests now pass as expected. Huzzah! * Removed or fixed up some dated comments. Added thread safeto to WinRTModuleManager. * Updated WinRTPInprocModule.Load handling of m_dll to be threadsafe. Fixed GetActivationLocation to NOT override inbox (Windows.*) namespaced types - aside from the obvious badness, it also results in deadlock during MddBootstrapInitialize() as that needs Windows.Management.Deployment.PackageManager to find the DDLM packages to choose from * Switched PackageGraphNode to use MDD_PACKAGEDEPENDENCY_CONTEXT instead of wil::unique_package_dependency_context to avoid redundant reentrancy foolishness - when we're inside MddRemovePackageDependency should should be using the WIL smart type where its destructor calls MddRemovePackageDependency... The WIL type is for use OUTSIDE the DynamicDependencies implementation, not inside it. Sheepish grin :P * Fixed a lock reentrancy error * Updated spec with DDLM info * Incorporated feedback * Incorporated feedback * TAEF and CppUnitTest can't both be used by a project (incompatible definitions) and CppTest project uses TAEF. Removed the unnecessary CppUnitTest header from CppTest's pch.h * Fixed build break by removing OutDir in Release|x64 flavor of DynamicDependencyLifetimeManager.ProxyStub project (no other flavor specifies this) * Fix IDynamicDependencyLifetimeManager's Makefile.mak support for Win32 (aka x86) * Fixed ARM builds. Partially fixed ARM64 builds (less broken; something still very wrong) * Added References to Framework.Math.Add/Multiply projects so DynDep Test_Win32/WinRT ensure correct build order (fix failures on github CI/pipeline) * Removed dead commented code (leftover from earlier debugging) * Fixed a typo * Fixed AppLifecycle namespace. Fixed project references/dependencies to not (falsely) need or try to use Microsoft.ProjectReunion.winmd * Minor correction of test MSIX manifests * Fixed a regression in Add. Updated Remove to ignore context=null (just like Delete ignores id=null) - NOOP rather than error * Added #include <appmodel.h> to MddBootstrap.h to make it more self-contained * Wired up AppLifecycleTests for Dynamic Dependencies! Genericized (and TAEF'd) the DynDep/Bootstrap test plumbing for reuse across TAEF tests; see inc\ProjectReunion.Test.*.h. Most AppLifecycleFunctionalTests pass - GetACtivatedEventArgsIsNull, GetActivatedEventArgsForProtocol_Win32 and GetActivatedEventArgsForFile_Win32 fail because AppLifecycleTestApp.exe can't find the bootstrapper. Supposed to be in the directory next to the exe; probably something wrong in AppLifecycleTestApp.vcxproj * Updated AppLifecycle tests to use DynamicDependencies. Changed DynamicDependencyLifetimeManager.Msix to use a templated/generated manfiest to match the current build architecture. All tests are passing! * Added files missing from previous commit. Refactored supporting test APIs to be more shrinkwrapped and easier to use (and misuse :P) * Refactored Test APIs to be more shrinkwrapped (easier to use, harder to misuse) * Fixed ARM64 dlldata.c compile error (Hint: -DWIN32 is needed for dlldata.c in ARM64 builds). Removed CppUnitTestFramework-based tests from ConfigurationManager for ARM+ARM64 (CppUnit doesn't support ARM) * Added 'Install Test Certificate' step to the build pipeline. Fingers crossed it's right * Experimenting with a fix to the pipeline adding Install Test Certificates. TBD if we use it or an another solution. This is just experimenting with AzureDevOps to determine options. Will be reverted shortly * Fixed typo * Moved Boostrap packages Setup/Cleanup from Class- to Method-Setup/Cleanup to fix failure during the CI/Pipeline * Added SetupPackages to CLASS_SETUP as an experiment to fix AppLifeCycle's GetActivatedEventArgsIsNull in the github CI/Pipeline. Currently fails because tthe tests METHOD_SETUP declares a custom manifest in TEST_METHOD_PROPERTY with a dependency on the Framework package (to get at the AppLifeCycle API). Theory is adding this during ClassSetup will make the framework available on the machine so when TAEF does the pkgmgr.RegisterPackage() Deployment will be able to resolve the <PackageDependency> and the rest will happily proceed * Shuffled some fixture work and sprinkled in an ugly smattering of printf debuggery to track down how the CI/Pipeline runs tests to figure out what the ultimate fix needs to be. Don't stare at the current code unless you've got a strong stomach <g> * Yet more debug hackery. And the hunt continues * More testery * Expanded printf-debugging logic to provide more execution context (poor man's windbg !token + !peb). * Can't 'include' a manifest when it's also Copied * Rejiggered the GetActivatedEventArgsIsNull (UAP) test to behave as expected * Restored IsolationLevel=Method for UAP tests * Yet more test hackery * Narrowing tests * Yet more narrowing of test to identify solutions * Modified to test fixes for the Protocol test * Added DevCheck.cmd/ps1 to check and (if necessary) fix the development environment * Fixed DevCheck error counting/reporting * Moved diagnostic aids into ProjectReunion.Test.Diagnostics.h * Added -Check... options to DevCheck (specify nothing is equivalent to -CheckAll). Improve DevCheck help. Add 'Setup TAEF Service' to build pipeline * Updated build pipeline command's arguments to setup TAEF service to match the recent change to DevCheck's parameter syntax * Removed accidental duped task * Removed some old debugging code * Disabled the AppLifecycleTests task in the CI/Pipeline as github runs as a built-in Administrator account (Elevated and not a split token) which prevents TAEF RunAs:RestrictedUser from working. Given the CI/Pipeline running as a built-in Administrator account TAEF provides no way for us to work around it thus all AppLifecycleTests are Failed or Blocked (despite passing when run locally), and DynamicDependencies doesn't support Elevation so we can have passing tests that don't verify the actual primary target environment (DynDep, MediumIL) or failing tests that block all checkins. This problem will be solved when test execution (the whole pipeline?) is moved to Helix. When that happens we can reenable these tests. * Add temp/ to .gitignore for temporary files. Added temp\MSTest.pfx generation for inner-loop development needing signed MSIX. NOTE: This will be updated in a future PR to pull MSTest.pfx from the Azure Key Vault. * Added temporary file to unblock development. Will be deleted when DevCheck.cmd is updated to pull MSTest.pfx from the Azure Key Vault * updated projects to use temp\MSTest.pfx to sign packages * Moved temp .pfx generation to BEFORE building projectreunion.sln (as it's needed to build some of the tests). Removed a debugging statement from DevCheck.ps1 * Removed investigation code from AppLifecycleTests * Incorporated Scott's feedback
This commit is contained in:
Родитель
dd559fdd23
Коммит
e86588b528
|
@ -333,6 +333,9 @@ installer/dev/project_reunion_definitions_override.h
|
|||
# Installer test packages
|
||||
!installer/test/testpackages/
|
||||
|
||||
# Local temp storage
|
||||
temp/
|
||||
|
||||
# Project Reunion specific files
|
||||
Microsoft.WinUI.AppX.targets
|
||||
dev/vsix/extension/LICENSE
|
||||
|
|
|
@ -33,12 +33,75 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "inc", "test\inc\inc.vcxitem
|
|||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppLifecycleTestApp", "test\TestApps\AppLifecycleTestApp\AppLifecycleTestApp.vcxproj", "{7C502995-59C3-483B-86BA-815985353633}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DynamicDependency", "DynamicDependency", "{6CD01EF6-D4A4-4801-ADCF-344CF87FF942}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DynamicDependency", "dev\DynamicDependency\DynamicDependency.vcxitems", "{BF055A59-0919-4E34-9B76-DD055495CC5A}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DynamicDependency", "DynamicDependency", "{17B1F036-8FC3-49E6-9464-0C1F96CEAEB9}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DynamicDependency_Test_Win32", "test\DynamicDependency\Test_Win32\DynamicDependency_Test_Win32.vcxproj", "{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{B73AD907-6164-4294-88FB-F3C9C10DA1F1} = {B73AD907-6164-4294-88FB-F3C9C10DA1F1}
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8} = {58E95711-A12F-4C0E-A978-C6B4A0842AC8}
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746} = {F76B776E-86F5-48C5-8FC7-D2795ECC9746}
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3} = {66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ProjectReunion_BootstrapDLL", "dev\ProjectReunion_BootstrapDLL\ProjectReunion_BootstrapDLL.vcxproj", "{F76B776E-86F5-48C5-8FC7-D2795ECC9746}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{B73AD907-6164-4294-88FB-F3C9C10DA1F1} = {B73AD907-6164-4294-88FB-F3C9C10DA1F1}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Detours", "dev\Detours\Detours.vcxproj", "{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "data", "data", "{0C534F12-B076-47E5-A05B-2A711233AC6F}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Framework.Math.Add", "test\DynamicDependency\data\Framework.Math.Add\Framework.Math.Add.vcxproj", "{58E95711-A12F-4C0E-A978-C6B4A0842AC8}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Framework.Math.Multiply", "test\DynamicDependency\data\Framework.Math.Multiply\Framework.Math.Multiply.vcxproj", "{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.ProjectReunion.Framework", "test\DynamicDependency\data\Microsoft.ProjectReunion.Framework\Microsoft.ProjectReunion.Framework.vcxproj", "{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DynamicDependencyDataStore", "DynamicDependencyDataStore", "{441A3BB0-7FD2-4902-AEDB-A1C57B528C77}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DynamicDependency.DataStore", "dev\DynamicDependencyDataStore\DynamicDependency.DataStore\DynamicDependency.DataStore.vcxproj", "{51293DFA-614B-4355-A60D-B30DF3228FD1}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DynamicDependency.DataStore.ProxyStub", "dev\DynamicDependencyDataStore\DynamicDependency.DataStore.ProxyStub\DynamicDependency.DataStore.ProxyStub.vcxproj", "{1A41BB90-CC34-4EDD-9A27-50714CDBC169}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DynamicDependency.DataStore.Msix", "test\DynamicDependency\data\DynamicDependency.DataStore.Msix\DynamicDependencies.DataStore.Msix.vcxproj", "{B71E818A-882E-456A-87E5-4DE4A6602B99}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DynamicDependencyLifetimeManager", "DynamicDependencyLifetimeManager", "{D043D403-31F1-43F1-B2D4-FA8F7090006D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DynamicDependencyLifetimeManager", "dev\DynamicDependencyLifetimeManager\DynamicDependencyLifetimeManager\DynamicDependencyLifetimeManager.vcxproj", "{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DynamicDependencyLifetimeManager.Msix", "test\DynamicDependency\data\DynamicDependencyLifetimeManager.Msix\DynamicDependencyLifetimeManager.Msix.vcxproj", "{A7391725-4EF5-438F-8DE1-645423E46955}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DynamicDependencyLifetimeManager.ProxyStub", "dev\DynamicDependencyLifetimeManager\DynamicDependencyLifetimeManager.ProxyStub\DynamicDependencyLifetimeManager.ProxyStub.vcxproj", "{8C79C46D-1577-44CA-83DF-88B74C3E4586}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IDynamicDependencyLifetimeManager", "dev\DynamicDependencyLifetimeManager\IDynamicDependencyLifetimeManager\IDynamicDependencyLifetimeManager.vcxproj", "{CCD23028-B9D3-410B-836E-20B2E7C08451}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DynamicDependency_Test_WinRT", "test\DynamicDependency\Test_WinRT\DynamicDependency_Test_WinRT.vcxproj", "{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{B73AD907-6164-4294-88FB-F3C9C10DA1F1} = {B73AD907-6164-4294-88FB-F3C9C10DA1F1}
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8} = {58E95711-A12F-4C0E-A978-C6B4A0842AC8}
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746} = {F76B776E-86F5-48C5-8FC7-D2795ECC9746}
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3} = {66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UndockedRegFreeWinRT", "UndockedRegFreeWinRT", "{323E29A9-873F-419B-919E-D18BCE1DE120}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UndockedRegFreeWinRT", "dev\UndockedRegFreeWinRT\UndockedRegFreeWinRT.vcxitems", "{56371CA6-144B-4989-A4E9-391AD4FA7651}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||
dev\UndockedRegFreeWinRT\UndockedRegFreeWinRT.vcxitems*{56371ca6-144b-4989-a4e9-391ad4fa7651}*SharedItemsImports = 9
|
||||
test\CppShared\CppShared.vcxitems*{682ded8c-3a27-48cd-866d-e853ea2024de}*SharedItemsImports = 9
|
||||
test\inc\inc.vcxitems*{7c502995-59c3-483b-86ba-815985353633}*SharedItemsImports = 4
|
||||
test\AppLifecycle\AppLifecycle.vcxitems*{80e07022-9e99-44fe-b875-901fb6c82f52}*SharedItemsImports = 9
|
||||
test\inc\inc.vcxitems*{b567fe2e-3a03-48d0-b2b5-760cdec35891}*SharedItemsImports = 9
|
||||
dev\DynamicDependency\DynamicDependency.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
|
||||
dev\UndockedRegFreeWinRT\UndockedRegFreeWinRT.vcxitems*{b73ad907-6164-4294-88fb-f3c9c10da1f1}*SharedItemsImports = 4
|
||||
dev\DynamicDependency\DynamicDependency.vcxitems*{bf055a59-0919-4e34-9b76-dd055495cc5a}*SharedItemsImports = 9
|
||||
test\CppShared\CppShared.vcxitems*{c62688a1-16a0-4729-b6ed-842f4faa29f3}*SharedItemsImports = 4
|
||||
test\inc\inc.vcxitems*{c62688a1-16a0-4729-b6ed-842f4faa29f3}*SharedItemsImports = 4
|
||||
dev\AppLifecycle\AppLifecycle.vcxitems*{e3a522a3-6635-4a42-bded-1af46a15f63c}*SharedItemsImports = 9
|
||||
|
@ -103,6 +166,7 @@ Global
|
|||
{C62688A1-16A0-4729-B6ED-842F4FAA29F3}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{C62688A1-16A0-4729-B6ED-842F4FAA29F3}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{C62688A1-16A0-4729-B6ED-842F4FAA29F3}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{C62688A1-16A0-4729-B6ED-842F4FAA29F3}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{C62688A1-16A0-4729-B6ED-842F4FAA29F3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C62688A1-16A0-4729-B6ED-842F4FAA29F3}.Debug|x64.Build.0 = Debug|x64
|
||||
{C62688A1-16A0-4729-B6ED-842F4FAA29F3}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
|
@ -143,6 +207,378 @@ Global
|
|||
{7C502995-59C3-483B-86BA-815985353633}.Release|x64.Build.0 = Release|x64
|
||||
{7C502995-59C3-483B-86BA-815985353633}.Release|x86.ActiveCfg = Release|Win32
|
||||
{7C502995-59C3-483B-86BA-815985353633}.Release|x86.Build.0 = Release|Win32
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug_test|Any CPU.ActiveCfg = Release|x64
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug_test|Any CPU.Build.0 = Release|x64
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug_test|ARM.ActiveCfg = Debug|ARM
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug_test|ARM.Build.0 = Debug|ARM
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug_test|ARM64.ActiveCfg = Debug|ARM64
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug_test|ARM64.Build.0 = Debug|ARM64
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug_test|x64.ActiveCfg = Debug|x64
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug_test|x64.Build.0 = Debug|x64
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug_test|x86.ActiveCfg = Debug|Win32
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug_test|x86.Build.0 = Debug|Win32
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug|x64.Build.0 = Debug|x64
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Debug|x86.Build.0 = Debug|Win32
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Release|x64.ActiveCfg = Release|x64
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Release|x64.Build.0 = Release|x64
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Release|x86.ActiveCfg = Release|Win32
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED}.Release|x86.Build.0 = Release|Win32
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug_test|Any CPU.ActiveCfg = Release|x64
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug_test|Any CPU.Build.0 = Release|x64
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug_test|ARM.ActiveCfg = Debug|ARM
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug_test|ARM.Build.0 = Debug|ARM
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug_test|ARM64.ActiveCfg = Debug|ARM64
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug_test|ARM64.Build.0 = Debug|ARM64
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug_test|x64.ActiveCfg = Debug|x64
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug_test|x64.Build.0 = Debug|x64
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug_test|x86.ActiveCfg = Debug|Win32
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug_test|x86.Build.0 = Debug|Win32
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug|x64.Build.0 = Debug|x64
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Debug|x86.Build.0 = Debug|Win32
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Release|ARM.Build.0 = Release|ARM
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Release|x64.ActiveCfg = Release|x64
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Release|x64.Build.0 = Release|x64
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Release|x86.ActiveCfg = Release|Win32
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746}.Release|x86.Build.0 = Release|Win32
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug_test|Any CPU.ActiveCfg = Release|x64
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug_test|Any CPU.Build.0 = Release|x64
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug_test|ARM.ActiveCfg = Debug|ARM
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug_test|ARM.Build.0 = Debug|ARM
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug_test|ARM64.ActiveCfg = Debug|ARM64
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug_test|ARM64.Build.0 = Debug|ARM64
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug_test|x64.ActiveCfg = Debug|x64
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug_test|x64.Build.0 = Debug|x64
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug_test|x86.ActiveCfg = Debug|Win32
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug_test|x86.Build.0 = Debug|Win32
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug|x64.Build.0 = Debug|x64
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Debug|x86.Build.0 = Debug|Win32
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Release|ARM.Build.0 = Release|ARM
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Release|x64.ActiveCfg = Release|x64
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Release|x64.Build.0 = Release|x64
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Release|x86.ActiveCfg = Release|Win32
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33}.Release|x86.Build.0 = Release|Win32
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug_test|Any CPU.ActiveCfg = Release|x64
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug_test|Any CPU.Build.0 = Release|x64
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug_test|ARM.ActiveCfg = Debug|ARM
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug_test|ARM.Build.0 = Debug|ARM
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug_test|ARM64.ActiveCfg = Debug|ARM64
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug_test|ARM64.Build.0 = Debug|ARM64
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug_test|x64.ActiveCfg = Debug|x64
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug_test|x64.Build.0 = Debug|x64
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug_test|x86.ActiveCfg = Debug|Win32
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug_test|x86.Build.0 = Debug|Win32
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug|x64.Build.0 = Debug|x64
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Debug|x86.Build.0 = Debug|Win32
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Release|ARM.Build.0 = Release|ARM
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Release|x64.ActiveCfg = Release|x64
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Release|x64.Build.0 = Release|x64
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Release|x86.ActiveCfg = Release|Win32
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8}.Release|x86.Build.0 = Release|Win32
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug_test|Any CPU.ActiveCfg = Release|x64
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug_test|Any CPU.Build.0 = Release|x64
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug_test|ARM.ActiveCfg = Debug|ARM
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug_test|ARM.Build.0 = Debug|ARM
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug_test|ARM64.ActiveCfg = Debug|ARM64
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug_test|ARM64.Build.0 = Debug|ARM64
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug_test|x64.ActiveCfg = Debug|x64
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug_test|x64.Build.0 = Debug|x64
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug_test|x86.ActiveCfg = Debug|Win32
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug_test|x86.Build.0 = Debug|Win32
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug|x64.Build.0 = Debug|x64
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Debug|x86.Build.0 = Debug|Win32
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Release|ARM.Build.0 = Release|ARM
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Release|x64.ActiveCfg = Release|x64
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Release|x64.Build.0 = Release|x64
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Release|x86.ActiveCfg = Release|Win32
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3}.Release|x86.Build.0 = Release|Win32
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug_test|Any CPU.ActiveCfg = Release|x64
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug_test|Any CPU.Build.0 = Release|x64
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug_test|ARM.ActiveCfg = Release|x64
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug_test|ARM.Build.0 = Release|x64
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug_test|ARM64.ActiveCfg = Release|x64
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug_test|ARM64.Build.0 = Release|x64
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug_test|x64.ActiveCfg = Debug|x64
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug_test|x64.Build.0 = Debug|x64
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug_test|x86.ActiveCfg = Debug|Win32
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug_test|x86.Build.0 = Debug|Win32
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug|ARM.ActiveCfg = Debug|Win32
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug|ARM64.ActiveCfg = Debug|Win32
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug|x64.Build.0 = Debug|x64
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Debug|x86.Build.0 = Debug|Win32
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Release|ARM.ActiveCfg = Release|Win32
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Release|ARM64.ActiveCfg = Release|Win32
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Release|x64.ActiveCfg = Release|x64
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Release|x64.Build.0 = Release|x64
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Release|x86.ActiveCfg = Release|Win32
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE}.Release|x86.Build.0 = Release|Win32
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug_test|Any CPU.ActiveCfg = Release|x64
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug_test|Any CPU.Build.0 = Release|x64
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug_test|ARM.ActiveCfg = Debug|ARM
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug_test|ARM.Build.0 = Debug|ARM
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug_test|ARM64.ActiveCfg = Debug|ARM64
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug_test|ARM64.Build.0 = Debug|ARM64
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug_test|x64.ActiveCfg = Debug|x64
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug_test|x64.Build.0 = Debug|x64
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug_test|x86.ActiveCfg = Debug|Win32
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug_test|x86.Build.0 = Debug|Win32
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug|x64.Build.0 = Debug|x64
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Debug|x86.Build.0 = Debug|Win32
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Release|ARM.Build.0 = Release|ARM
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Release|x64.ActiveCfg = Release|x64
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Release|x64.Build.0 = Release|x64
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Release|x86.ActiveCfg = Release|Win32
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1}.Release|x86.Build.0 = Release|Win32
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug_test|Any CPU.ActiveCfg = Release|x64
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug_test|Any CPU.Build.0 = Release|x64
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug_test|ARM.ActiveCfg = Debug|ARM
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug_test|ARM.Build.0 = Debug|ARM
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug_test|ARM64.ActiveCfg = Debug|ARM64
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug_test|ARM64.Build.0 = Debug|ARM64
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug_test|x64.ActiveCfg = Debug|x64
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug_test|x64.Build.0 = Debug|x64
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug_test|x86.ActiveCfg = Debug|Win32
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug_test|x86.Build.0 = Debug|Win32
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug|x64.Build.0 = Debug|x64
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Debug|x86.Build.0 = Debug|Win32
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Release|ARM.Build.0 = Release|ARM
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Release|x64.ActiveCfg = Release|x64
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Release|x64.Build.0 = Release|x64
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Release|x86.ActiveCfg = Release|Win32
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169}.Release|x86.Build.0 = Release|Win32
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug_test|Any CPU.ActiveCfg = Release|x64
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug_test|Any CPU.Build.0 = Release|x64
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug_test|ARM.ActiveCfg = Release|x64
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug_test|ARM.Build.0 = Release|x64
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug_test|ARM64.ActiveCfg = Release|x64
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug_test|ARM64.Build.0 = Release|x64
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug_test|x64.ActiveCfg = Debug|x64
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug_test|x64.Build.0 = Debug|x64
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug_test|x86.ActiveCfg = Debug|Win32
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug_test|x86.Build.0 = Debug|Win32
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug|ARM.ActiveCfg = Debug|Win32
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug|ARM64.ActiveCfg = Debug|Win32
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug|x64.Build.0 = Debug|x64
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Debug|x86.Build.0 = Debug|Win32
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Release|ARM.ActiveCfg = Release|Win32
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Release|ARM64.ActiveCfg = Release|Win32
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Release|x64.ActiveCfg = Release|x64
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Release|x64.Build.0 = Release|x64
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Release|x86.ActiveCfg = Release|Win32
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99}.Release|x86.Build.0 = Release|Win32
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug_test|Any CPU.ActiveCfg = Debug|Win32
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug_test|Any CPU.Build.0 = Debug|Win32
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug_test|ARM.ActiveCfg = Debug|ARM
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug_test|ARM.Build.0 = Debug|ARM
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug_test|ARM64.ActiveCfg = Debug|ARM64
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug_test|ARM64.Build.0 = Debug|ARM64
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug_test|x64.ActiveCfg = Debug|x64
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug_test|x64.Build.0 = Debug|x64
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug_test|x86.ActiveCfg = Debug|Win32
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug_test|x86.Build.0 = Debug|Win32
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug|x64.Build.0 = Debug|x64
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Debug|x86.Build.0 = Debug|Win32
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Release|ARM.Build.0 = Release|ARM
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Release|x64.ActiveCfg = Release|x64
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Release|x64.Build.0 = Release|x64
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Release|x86.ActiveCfg = Release|Win32
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86}.Release|x86.Build.0 = Release|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug_test|Any CPU.ActiveCfg = Debug|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug_test|Any CPU.Build.0 = Debug|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug_test|ARM.ActiveCfg = Debug|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug_test|ARM.Build.0 = Debug|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug_test|ARM64.ActiveCfg = Debug|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug_test|ARM64.Build.0 = Debug|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug_test|x64.ActiveCfg = Debug|x64
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug_test|x64.Build.0 = Debug|x64
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug_test|x86.ActiveCfg = Debug|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug_test|x86.Build.0 = Debug|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug|ARM.ActiveCfg = Debug|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug|ARM64.ActiveCfg = Debug|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug|x64.Build.0 = Debug|x64
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Debug|x86.Build.0 = Debug|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Release|ARM.ActiveCfg = Release|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Release|ARM64.ActiveCfg = Release|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Release|x64.ActiveCfg = Release|x64
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Release|x64.Build.0 = Release|x64
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Release|x86.ActiveCfg = Release|Win32
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955}.Release|x86.Build.0 = Release|Win32
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug_test|Any CPU.ActiveCfg = Debug|Win32
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug_test|Any CPU.Build.0 = Debug|Win32
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug_test|ARM.ActiveCfg = Debug|ARM
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug_test|ARM.Build.0 = Debug|ARM
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug_test|ARM64.ActiveCfg = Debug|ARM64
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug_test|ARM64.Build.0 = Debug|ARM64
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug_test|x64.ActiveCfg = Debug|x64
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug_test|x64.Build.0 = Debug|x64
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug_test|x86.ActiveCfg = Debug|Win32
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug_test|x86.Build.0 = Debug|Win32
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug|x64.Build.0 = Debug|x64
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Debug|x86.Build.0 = Debug|Win32
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Release|ARM.Build.0 = Release|ARM
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Release|x64.ActiveCfg = Release|x64
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Release|x64.Build.0 = Release|x64
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Release|x86.ActiveCfg = Release|Win32
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586}.Release|x86.Build.0 = Release|Win32
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug_test|Any CPU.ActiveCfg = Debug|Win32
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug_test|Any CPU.Build.0 = Debug|Win32
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug_test|ARM.ActiveCfg = Debug|Win32
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug_test|ARM.Build.0 = Debug|Win32
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug_test|ARM64.ActiveCfg = Debug|Win32
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug_test|ARM64.Build.0 = Debug|Win32
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug_test|x64.ActiveCfg = Debug|x64
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug_test|x64.Build.0 = Debug|x64
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug_test|x86.ActiveCfg = Debug|Win32
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug_test|x86.Build.0 = Debug|Win32
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug|x64.Build.0 = Debug|x64
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Debug|x86.Build.0 = Debug|Win32
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Release|ARM.Build.0 = Release|ARM
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Release|x64.ActiveCfg = Release|x64
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Release|x64.Build.0 = Release|x64
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Release|x86.ActiveCfg = Release|Win32
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451}.Release|x86.Build.0 = Release|Win32
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug_test|Any CPU.ActiveCfg = Debug|Win32
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug_test|Any CPU.Build.0 = Debug|Win32
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug_test|ARM.ActiveCfg = Debug|ARM
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug_test|ARM.Build.0 = Debug|ARM
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug_test|ARM64.ActiveCfg = Debug|ARM64
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug_test|ARM64.Build.0 = Debug|ARM64
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug_test|x64.ActiveCfg = Debug|x64
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug_test|x64.Build.0 = Debug|x64
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug_test|x86.ActiveCfg = Debug|Win32
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug_test|x86.Build.0 = Debug|Win32
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug|x64.Build.0 = Debug|x64
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Debug|x86.Build.0 = Debug|Win32
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Release|x64.ActiveCfg = Release|x64
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Release|x64.Build.0 = Release|x64
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Release|x86.ActiveCfg = Release|Win32
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -157,6 +593,28 @@ Global
|
|||
{AC5FFC80-92FE-4933-BED2-EC5519AC4440} = {8630F7AA-2969-4DC9-8700-9B468C1DC21D}
|
||||
{B567FE2E-3A03-48D0-B2B5-760CDEC35891} = {8630F7AA-2969-4DC9-8700-9B468C1DC21D}
|
||||
{7C502995-59C3-483B-86BA-815985353633} = {AC5FFC80-92FE-4933-BED2-EC5519AC4440}
|
||||
{6CD01EF6-D4A4-4801-ADCF-344CF87FF942} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A}
|
||||
{BF055A59-0919-4E34-9B76-DD055495CC5A} = {6CD01EF6-D4A4-4801-ADCF-344CF87FF942}
|
||||
{17B1F036-8FC3-49E6-9464-0C1F96CEAEB9} = {8630F7AA-2969-4DC9-8700-9B468C1DC21D}
|
||||
{6BAC3B29-3A6B-4B3F-A9AB-A316AA4E48ED} = {17B1F036-8FC3-49E6-9464-0C1F96CEAEB9}
|
||||
{F76B776E-86F5-48C5-8FC7-D2795ECC9746} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A}
|
||||
{D6BC25C5-1AA7-4C4A-A02C-B42DEDBFEA33} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A}
|
||||
{0C534F12-B076-47E5-A05B-2A711233AC6F} = {17B1F036-8FC3-49E6-9464-0C1F96CEAEB9}
|
||||
{58E95711-A12F-4C0E-A978-C6B4A0842AC8} = {0C534F12-B076-47E5-A05B-2A711233AC6F}
|
||||
{66D0D8B1-FAF4-4C6A-8303-07F3BA356FE3} = {0C534F12-B076-47E5-A05B-2A711233AC6F}
|
||||
{9C1A6C58-52D6-4514-9120-5C339C5DF4BE} = {0C534F12-B076-47E5-A05B-2A711233AC6F}
|
||||
{441A3BB0-7FD2-4902-AEDB-A1C57B528C77} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A}
|
||||
{51293DFA-614B-4355-A60D-B30DF3228FD1} = {441A3BB0-7FD2-4902-AEDB-A1C57B528C77}
|
||||
{1A41BB90-CC34-4EDD-9A27-50714CDBC169} = {441A3BB0-7FD2-4902-AEDB-A1C57B528C77}
|
||||
{B71E818A-882E-456A-87E5-4DE4A6602B99} = {0C534F12-B076-47E5-A05B-2A711233AC6F}
|
||||
{D043D403-31F1-43F1-B2D4-FA8F7090006D} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A}
|
||||
{2E5BF0D2-78FA-4B60-A341-F65A0D58BD86} = {D043D403-31F1-43F1-B2D4-FA8F7090006D}
|
||||
{A7391725-4EF5-438F-8DE1-645423E46955} = {0C534F12-B076-47E5-A05B-2A711233AC6F}
|
||||
{8C79C46D-1577-44CA-83DF-88B74C3E4586} = {D043D403-31F1-43F1-B2D4-FA8F7090006D}
|
||||
{CCD23028-B9D3-410B-836E-20B2E7C08451} = {D043D403-31F1-43F1-B2D4-FA8F7090006D}
|
||||
{B2546322-D329-4F6C-9C2E-7EFC3C9ED214} = {17B1F036-8FC3-49E6-9464-0C1F96CEAEB9}
|
||||
{323E29A9-873F-419B-919E-D18BCE1DE120} = {448ED2E5-0B37-4D97-9E6B-8C10A507976A}
|
||||
{56371CA6-144B-4989-A4E9-391AD4FA7651} = {323E29A9-873F-419B-919E-D18BCE1DE120}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {4B3D7591-CFEC-4762-9A07-ABE99938FB77}
|
||||
|
|
|
@ -56,6 +56,14 @@ steps:
|
|||
feedsToUse: config
|
||||
nugetConfigPath: ${{ parameters.nugetConfigPath }}
|
||||
|
||||
- task: powershell@2
|
||||
displayName: 'Create pfx to sign MSIX test packages (DevCheck)'
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: tools\DevCheck.ps1
|
||||
arguments: -CheckTestPfx -Clean -Offline -Verbose
|
||||
workingDirectory: '$(Build.SourcesDirectory)'
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build solution ${{ parameters.solutionPath }}'
|
||||
inputs:
|
||||
|
@ -66,11 +74,29 @@ steps:
|
|||
msbuildArgs: '/p:AppxPackageDir="${{ parameters.appxPackageDir }}" /p:AppxBundle=Never /p:AppxSymbolPackageEnabled=false /binaryLogger:$(Build.SourcesDirectory)/${{ parameters.solutionPath }}.$(buildPlatform).$(buildConfiguration).binlog /p:ProjectReunionVersionBuild=$(builddate_yymm) /p:ProjectReunionVersionRevision=$(builddate_dd)$(buildrevision) /p:VCToolsInstallDir="$(VCToolsInstallDir)\" /p:PGOBuildMode=$(PGOBuildMode)'
|
||||
|
||||
- task: CmdLine@2
|
||||
displayName: 'Run AppLifeCycleTest'
|
||||
displayName: 'Install Test Certificate'
|
||||
inputs:
|
||||
script: 'te.exe CppTest.dll'
|
||||
workingDirectory: '$(Build.SourcesDirectory)\BuildOutput\$(buildConfiguration)\$(buildPlatform)\CppTest'
|
||||
condition: or(eq(variables.buildPlatform, 'x64'), eq(variables.buildPlatform, 'x86'))
|
||||
script: 'certutil.exe -addstore TrustedPeople MSTest.cer'
|
||||
workingDirectory: '$(Build.SourcesDirectory)\build'
|
||||
|
||||
- task: powershell@2
|
||||
displayName: 'Setup TAEF Service (DevCheck)'
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: tools\DevCheck.ps1
|
||||
arguments: -CheckTAEFService -Offline -Verbose
|
||||
workingDirectory: '$(Build.SourcesDirectory)'
|
||||
|
||||
#DISABLED - GitHub runs as a a built-in Administrator (thus Elevated and no split-token)
|
||||
# TAEF Service can't RunAs:RestrictedUser from this account thus all tests Failed or Blocked
|
||||
# and Dynamic Dependencies doesn't support Elevation so it's impossible for this test to
|
||||
# work correctly today. Disabling until we move off GitHub's pipeline for test execution
|
||||
# - task: CmdLine@2
|
||||
# displayName: 'Run AppLifeCycleTest'
|
||||
# inputs:
|
||||
# script: 'te.exe CppTest.dll'
|
||||
# workingDirectory: '$(Build.SourcesDirectory)\BuildOutput\$(buildConfiguration)\$(buildPlatform)\CppTest'
|
||||
# condition: or(eq(variables.buildPlatform, 'x64'), eq(variables.buildPlatform, 'x86'))
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish ${{ parameters.solutionPath }} binlog'
|
||||
|
|
Двоичный файл не отображается.
|
@ -0,0 +1,63 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIILSgIBAzCCCwYGCSqGSIb3DQEHAaCCCvcEggrzMIIK7zCCBggGCSqGSIb3DQEH
|
||||
AaCCBfkEggX1MIIF8TCCBe0GCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcN
|
||||
AQwBAzAOBAjIXdhD2Rgv4AICB9AEggTYfAO/jMECF0pFl2cRPoakYKpKYFPFQeUk
|
||||
xXCyQhYKzLf9VPOWeboOmmhzQ2CXRfMLkSc2xUPeVkha3SrhLFzTrYIJNd0Fn2JI
|
||||
V8EyP3hpWdV5B1EDMe0tI/uQS7oBoAGmxuna7681UpeFDskctiJTtWz0cCVLhLcK
|
||||
amzH+EJi5X1r120fFtGLebb6Fom2ZV0xKNJcEYxZr7cX9e9oE7DtMRZ5DVRd20V0
|
||||
ovtqwLY+6TpmS+a7g95h5jSBM9hYEXq4z1S9rl42iyDvdF74pcjG21+5Z20U04Cl
|
||||
qiySSTcn6GlzWhJevLSEwbREbRWkYEIgE5bZFAfYfgQ3Qas1qI4JadMkcdTkRypR
|
||||
InrArU6hB+H/X8i/tJ2VeCs2rRTYfDqydlzoU6LormoRvbB50bup6O90yw0bsHD9
|
||||
/oIE9fiSnsf8GKzS14JYKMkEpCzrqf7suYYOhV/KwRMqI2E0i5H1ZrlOmGik9vq1
|
||||
RYbh6+028QXBYsBBw80VRWr5OKGyrSP8xcK2Qg7XcDB4aLJ7QPRFQLtOOwWkuVOX
|
||||
SwYJs6N6QXhSvQpfE0dsEgTXyJ3tP7CJuGT6aWEHkHOkwBhH2zQ6lejEMHztWdEv
|
||||
zXis8vGtP5AxrDVx3f055n9hsamw/0R0pnzHMXmX0OJinb3ZuA2RsevQXK0nwLk+
|
||||
Ljok1wcEBVXSUD6Ywd59cB1zdD89F/Tg5zgsNZ8SPhuGUs6ctNL0ymUJMGC3571z
|
||||
clVVDnvM03FH4zhaZDkn4DAIrukDcQX2/6esLTzTsjGxzRTM4Y9YUAXT3C6LnctV
|
||||
Sr0t9JpVILYqh68MonLND0jz8H+zVe2KNj0ROwv8IBGcG8a+klt61QBTlAAG8ee9
|
||||
plqPrHKI62m98upspKn3MzqKN9xVedfB1v1ijO7MZrD8juNzDrSYzO6VlyA+oMjr
|
||||
pXyj9CqMqPGy2/sr5tpWcYEQe8LdEWlRQBVZIdelNkIm3C6jSgSSeSxXDB8IXNt6
|
||||
fHtzCTCj4s0sJqipIOwECEQaSYVJlUKSZLJTYAfdfBLDy/Lz+G6n5/e9RRvWBeJx
|
||||
kqnOmJhXlyZ6wZJO5Fvdv1UF/zRCPUYNyorEXkA9Z82yTJ7KdqAOOUs/fRuiNvOg
|
||||
PezX/qyv2ZzR9LqU0pRrVVhoFV7cyllSDxXqPcR1Iq/a6OdJ3lEc95hUk+4TIioy
|
||||
ch9eFVDUwHJ98K9+7G78d9zQ7VpruE1a/FK9QOoHUPbfl4qpDxSgQfm/weD+qwo+
|
||||
g4jjCby4l4GM23M/dzXbMEL4ilV7BU1tkmqzcF5Zee5zBiIVWLrt/5npuVi/8ZJF
|
||||
N/T8n1VLaLXGHcn7dlI9pl1+88DW2EKGDXor9CuOOOeH2fi0blgRUzD2mRZXnDjE
|
||||
4tfB0FTyUtnN5IVsKSvTEhQnywiByFMj6jPzZ+WmEEbxs3KbQHsofModvAVS/UbW
|
||||
uIojhQ+kT3ncIMZeS2IHbwZTPiAbDn8adg9rFptEQkQMFSyDmHwmRN4HPDGcnQrA
|
||||
gcBJbNLy5unxlwG+pUfttjJaS9q+z/eWyOhLiPI98aEJYrVZ1EQwyGTSYKN9tQ+C
|
||||
GajShWYPkVV7rjBNQCoWUDjuokW7GkeYe2YlZ58YwH7tZb0CkDw4j4WPmSoOcUpf
|
||||
xRd+KVBiGv4Gd/PannezhDGB2zATBgkqhkiG9w0BCRUxBgQEAQAAADBdBgkrBgEE
|
||||
AYI3EQExUB5OAE0AaQBjAHIAbwBzAG8AZgB0ACAAUwB0AHIAbwBuAGcAIABDAHIA
|
||||
eQBwAHQAbwBnAHIAYQBwAGgAaQBjACAAUAByAG8AdgBpAGQAZQByMGUGCSqGSIb3
|
||||
DQEJFDFYHlYAUAB2AGsAVABtAHAAOgA2ADIAOQBhADgAMQBmADQALQA0AGUAMgAz
|
||||
AC0ANABjAGQAMgAtADgAZAAxADMALQA2ADEAZQBjAGUANgBmADEAMwA5AGIAODCC
|
||||
BN8GCSqGSIb3DQEHBqCCBNAwggTMAgEAMIIExQYJKoZIhvcNAQcBMBwGCiqGSIb3
|
||||
DQEMAQMwDgQIu/cm7lKUSWsCAgfQgIIEmIsUvJdZcNiVPybOD6v87I/BFOOg6S0K
|
||||
MV+hJdk9h7yGbIMkYtCW9B1jIHp07Mr/5ANGczkXgkqtPhz2fRqQSzg3LKZJOxpP
|
||||
2zPjRxvWLT06gEIDKZRbvNf+vesr+hw0WomhBHlzXV54aDgVVECEFZaHZnI1TgiR
|
||||
NwsnjXliMUkwQefMHfkFBYHv42twhAHHYdiA67Z3hQAMybASPiLeP6zV1MKuuzth
|
||||
qBwysrPmI3ldBCoAATyE/ythyby9/6NWWODXOy6+ooeMto2eyk+9V1Je3PVW8OKX
|
||||
bljHnrB8eJIEqM9WxV+Vrqk/Hxhq3+Q/vCm1PKQH+5EKkMQIyDdIrdtMvkR8l9AZ
|
||||
P51G7V9/ZUF3fn4m2HCKytkBWZBJI9yJXa+6FCZM2fZRxDdKKfXRcde7+0AqTWRr
|
||||
rSNOhr0cu2ol0bcHKHQHOKjKDNPoDQrVXo6uw+Zhl5+Ly8d50K8zOlqZrru7GpLj
|
||||
xX/VaVdB+fVpjtZIjGA14URrHux0StqGr7Ex7a5Fp4QB6eHkZX35bGO4ME7oZRHL
|
||||
QVDXKDEqhn8BXYE0rKl1F+iTQqkxL72YbiBRu0jxyGSzifX8h4oMijG5PfRJgEkP
|
||||
RLYRjJjxFFKZKJ8E2y5Du4xM0lYdU2td3iQyUkSip+1WVV/88T+ysiWYIa1dp+qt
|
||||
FNiXxOhriUBJ3OuIcgLNJZ1MaDwYHe2yhr4g8AL5xI9fnbjwy3TSHclLGb5hfT5u
|
||||
bFYPAWGvmxwVP2ntgnpjWO86AIl0fAMwHQern2CgnfomhEr7L/SLlAbqdrbD6t29
|
||||
K94Xfacf6CphD8xgsMRKqG7ZIqOSbvQzSm3/810eLbL3ubEl38w33Kj1JWVHJaSN
|
||||
HH5NQfsJm6XrL3aDAVTENVqdTcW/Qg9n9XR/rVgyMbFXpfigWPBlO9aOUravzez/
|
||||
bdsyLohkaaevbj4adqkCMkTYddIebdBoo/+FyAb4uShV/XaO0W+zs9xvqNBXXDf9
|
||||
XJJpJOPn9BK0NTxbb8eA1CwM7dMZNqdoLxGjrc0gRew41ApTUQ+HJDB4+qQxn9Oy
|
||||
1ZREip2Uw1poxgBlNUlVGq5B5JGrZlqVtaJQygCSNHLWvXxUspF36uWQ6z5dqlO1
|
||||
wK0aCziSLsY/gaeqWHvzTEHZvv5yQK3vvMiKT++wgOiiKijNhEoflyoU3hgu1jUR
|
||||
iNhbnIgByIiJkXdnC7gv2UJKvLlIMT45snnmUvmqvRryowqXZ75r7XezmseJ4I21
|
||||
Heamung4U65fojsE1jURlcpt87x33a5coDzluCMTZprODLQZbBj39G4pwE3MKQXh
|
||||
6Im1O9qR4P2sgMx6lluRK94dkkn8+MvlK1GOso5T6HTwrkGgK1Sfpiz50SmbULx3
|
||||
kiA1OVmraipVOrXD5pmT2AFt/vjkWJZMQgis2lOmTpuUz6jfEBUvfXvTXSk48KhG
|
||||
XRnq60R+ABsiW5FBrbwwGZG3hOhVoBdwhlQ5bBw7JTnGNhSPtvHPA7E3ZwhDxpn3
|
||||
4UbIprfWVLrR9BbWayvt34JIN8WZkjH7bwhnZo3Q8yfzN1nk8+gRYkwjgky49UWg
|
||||
9TA7MB8wBwYFKw4DAhoEFG8Ifc9pvQshFzC3cnRPBTfW+FoHBBT2b3CHfQO0hexn
|
||||
tBf4/CkiLemo8AICB9A=
|
||||
-----END CERTIFICATE-----
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
#pragma once
|
||||
|
||||
namespace winrt::Microsoft::ProjectReunion::implementation
|
||||
namespace winrt::Microsoft::ApplicationModel::Activation::implementation
|
||||
{
|
||||
using namespace winrt::Windows::ApplicationModel::Activation;
|
||||
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
#include <pch.h>
|
||||
#include <ActivationRegistrationManager.h>
|
||||
#include <ActivationRegistrationManager.g.cpp>
|
||||
#include <Microsoft.ApplicationModel.Activation.ActivationRegistrationManager.g.cpp>
|
||||
|
||||
#include "LaunchActivatedEventArgs.h"
|
||||
#include "ProtocolActivatedEventArgs.h"
|
||||
#include "FileActivatedEventArgs.h"
|
||||
#include "Association.h"
|
||||
|
||||
namespace winrt::Microsoft::ProjectReunion::implementation
|
||||
namespace winrt::Microsoft::ApplicationModel::Activation::implementation
|
||||
{
|
||||
void ActivationRegistrationManager::RegisterForFileTypeActivation(
|
||||
array_view<hstring const> supportedFileTypes, array_view<hstring const> supportedVerbs,
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
#pragma once
|
||||
|
||||
#include <ActivationRegistrationManager.g.h>
|
||||
#include <Microsoft.ApplicationModel.Activation.ActivationRegistrationManager.g.h>
|
||||
|
||||
namespace winrt::Microsoft::ProjectReunion::implementation
|
||||
namespace winrt::Microsoft::ApplicationModel::Activation::implementation
|
||||
{
|
||||
struct ActivationRegistrationManager
|
||||
{
|
||||
|
@ -21,7 +21,7 @@ namespace winrt::Microsoft::ProjectReunion::implementation
|
|||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::ProjectReunion::factory_implementation
|
||||
namespace winrt::Microsoft::ApplicationModel::Activation::factory_implementation
|
||||
{
|
||||
struct ActivationRegistrationManager : ActivationRegistrationManagerT<ActivationRegistrationManager,
|
||||
implementation::ActivationRegistrationManager>
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
|
||||
#include <pch.h>
|
||||
#include <AppLifecycle.h>
|
||||
#include <AppLifecycle.g.cpp>
|
||||
#include <Microsoft.ApplicationModel.Activation.AppLifecycle.g.cpp>
|
||||
|
||||
#include "LaunchActivatedEventArgs.h"
|
||||
#include "ProtocolActivatedEventArgs.h"
|
||||
#include "FileActivatedEventArgs.h"
|
||||
#include "Association.h"
|
||||
|
||||
namespace winrt::Microsoft::ProjectReunion::implementation
|
||||
namespace winrt::Microsoft::ApplicationModel::Activation::implementation
|
||||
{
|
||||
std::tuple<std::wstring, std::wstring> ParseCommandLine(std::wstring commandLine)
|
||||
{
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
#pragma once
|
||||
|
||||
#include <AppLifecycle.g.h>
|
||||
#include <Microsoft.ApplicationModel.Activation.AppLifecycle.g.h>
|
||||
|
||||
namespace winrt::Microsoft::ProjectReunion::implementation
|
||||
namespace winrt::Microsoft::ApplicationModel::Activation::implementation
|
||||
{
|
||||
struct AppLifecycle
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ namespace winrt::Microsoft::ProjectReunion::implementation
|
|||
};
|
||||
}
|
||||
|
||||
namespace winrt::Microsoft::ProjectReunion::factory_implementation
|
||||
namespace winrt::Microsoft::ApplicationModel::Activation::factory_implementation
|
||||
{
|
||||
struct AppLifecycle : AppLifecycleT<AppLifecycle, implementation::AppLifecycle>
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
namespace Microsoft.ProjectReunion
|
||||
namespace Microsoft.ApplicationModel.Activation
|
||||
{
|
||||
static runtimeclass AppLifecycle
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include <pch.h>
|
||||
#include "Association.h"
|
||||
|
||||
namespace winrt::Microsoft::ProjectReunion::implementation
|
||||
namespace winrt::Microsoft::ApplicationModel::Activation::implementation
|
||||
{
|
||||
HKEY GetRegistrationRoot()
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
#pragma once
|
||||
|
||||
namespace winrt::Microsoft::ProjectReunion::implementation
|
||||
namespace winrt::Microsoft::ApplicationModel::Activation::implementation
|
||||
{
|
||||
static const std::wstring c_protocolArgumentString = L"ms-protocol";
|
||||
static const std::wstring c_fileArgumentString = L"ms-file";
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#include "ActivatedEventArgsBase.h"
|
||||
|
||||
namespace winrt::Microsoft::ProjectReunion::implementation
|
||||
namespace winrt::Microsoft::ApplicationModel::Activation::implementation
|
||||
{
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
using namespace winrt::Windows::ApplicationModel::Activation;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#include "ActivatedEventArgsBase.h"
|
||||
|
||||
namespace winrt::Microsoft::ProjectReunion::implementation
|
||||
namespace winrt::Microsoft::ApplicationModel::Activation::implementation
|
||||
{
|
||||
using namespace winrt::Windows::ApplicationModel::Activation;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <winrt/Windows.Foundation.h>
|
||||
#include "ActivatedEventArgsBase.h"
|
||||
|
||||
namespace winrt::Microsoft::ProjectReunion::implementation
|
||||
namespace winrt::Microsoft::ApplicationModel::Activation::implementation
|
||||
{
|
||||
using namespace winrt::Windows::Foundation::Collections;
|
||||
using namespace winrt::Windows::ApplicationModel::Activation;
|
||||
|
|
|
@ -0,0 +1,356 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|ARM64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{d6bc25c5-1aa7-4c4a-a02c-b42dedbfea33}</ProjectGuid>
|
||||
<RootNamespace>Detours</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<ExceptionHandling>false</ExceptionHandling>
|
||||
<RemoveUnreferencedCodeData>false</RemoveUnreferencedCodeData>
|
||||
<OmitDefaultLibName>true</OmitDefaultLibName>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>
|
||||
</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="detours.h" />
|
||||
<ClInclude Include="detver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="creatwth.cpp" />
|
||||
<ClCompile Include="detours.cpp" />
|
||||
<ClCompile Include="disasm.cpp" />
|
||||
<ClCompile Include="disolarm.cpp" />
|
||||
<ClCompile Include="disolarm64.cpp" />
|
||||
<ClCompile Include="disolia64.cpp" />
|
||||
<ClCompile Include="disolx64.cpp" />
|
||||
<ClCompile Include="disolx86.cpp" />
|
||||
<ClCompile Include="image.cpp" />
|
||||
<ClCompile Include="modules.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="README.md" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<PublicHeaders Include="$(MSBuildThisFileDirectory)detours.h" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,60 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="detours.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="detver.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="disasm.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="disolarm.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="disolarm64.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="disolia64.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="disolx64.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="disolx86.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="image.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="modules.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="detours.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="creatwth.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="README.md" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,6 @@
|
|||
This is a fork of Detours from https://github.com/microsoft/Detours
|
||||
|
||||
Last forked
|
||||
-----------
|
||||
commit e9da64c72f293c0223f293f018067fe68fbdb801
|
||||
Date Sat Aug 22 13:21:24 2020 -0700
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,27 @@
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Common version parameters.
|
||||
//
|
||||
// Microsoft Research Detours Package, Version 4.0.1
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
|
||||
#define _USING_V110_SDK71_ 1
|
||||
#include "winver.h"
|
||||
#if 0
|
||||
#include <windows.h>
|
||||
#include <detours.h>
|
||||
#else
|
||||
#ifndef DETOURS_STRINGIFY
|
||||
#define DETOURS_STRINGIFY_(x) #x
|
||||
#define DETOURS_STRINGIFY(x) DETOURS_STRINGIFY_(x)
|
||||
#endif
|
||||
|
||||
#define VER_FILEFLAGSMASK 0x3fL
|
||||
#define VER_FILEFLAGS 0x0L
|
||||
#define VER_FILEOS 0x00040004L
|
||||
#define VER_FILETYPE 0x00000002L
|
||||
#define VER_FILESUBTYPE 0x00000000L
|
||||
#endif
|
||||
#define VER_DETOURS_BITS DETOURS_STRINGIFY(DETOURS_BITS)
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,2 @@
|
|||
#define DETOURS_ARM_OFFLINE_LIBRARY
|
||||
#include "disasm.cpp"
|
|
@ -0,0 +1,2 @@
|
|||
#define DETOURS_ARM64_OFFLINE_LIBRARY
|
||||
#include "disasm.cpp"
|
|
@ -0,0 +1,2 @@
|
|||
#define DETOURS_IA64_OFFLINE_LIBRARY
|
||||
#include "disasm.cpp"
|
|
@ -0,0 +1,2 @@
|
|||
#define DETOURS_X64_OFFLINE_LIBRARY
|
||||
#include "disasm.cpp"
|
|
@ -0,0 +1,2 @@
|
|||
#define DETOURS_X86_OFFLINE_LIBRARY
|
||||
#include "disasm.cpp"
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,904 @@
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Module Enumeration Functions (modules.cpp of detours.lib)
|
||||
//
|
||||
// Microsoft Research Detours Package, Version 4.0.1
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// Module enumeration functions.
|
||||
//
|
||||
|
||||
// #define DETOUR_DEBUG 1
|
||||
#define DETOURS_INTERNAL
|
||||
#include "detours.h"
|
||||
|
||||
#if DETOURS_VERSION != 0x4c0c1 // 0xMAJORcMINORcPATCH
|
||||
#error detours.h version mismatch
|
||||
#endif
|
||||
|
||||
#define CLR_DIRECTORY OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR]
|
||||
#define IAT_DIRECTORY OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IAT]
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
const GUID DETOUR_EXE_RESTORE_GUID = {
|
||||
0x2ed7a3ff, 0x3339, 0x4a8d,
|
||||
{ 0x80, 0x5c, 0xd4, 0x98, 0x15, 0x3f, 0xc2, 0x8f }};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
PDETOUR_SYM_INFO DetourLoadImageHlp(VOID)
|
||||
{
|
||||
static DETOUR_SYM_INFO symInfo;
|
||||
static PDETOUR_SYM_INFO pSymInfo = NULL;
|
||||
static BOOL failed = false;
|
||||
|
||||
if (failed) {
|
||||
return NULL;
|
||||
}
|
||||
if (pSymInfo != NULL) {
|
||||
return pSymInfo;
|
||||
}
|
||||
|
||||
ZeroMemory(&symInfo, sizeof(symInfo));
|
||||
// Create a real handle to the process.
|
||||
#if 0
|
||||
DuplicateHandle(GetCurrentProcess(),
|
||||
GetCurrentProcess(),
|
||||
GetCurrentProcess(),
|
||||
&symInfo.hProcess,
|
||||
0,
|
||||
FALSE,
|
||||
DUPLICATE_SAME_ACCESS);
|
||||
#else
|
||||
symInfo.hProcess = GetCurrentProcess();
|
||||
#endif
|
||||
|
||||
symInfo.hDbgHelp = LoadLibraryExW(L"dbghelp.dll", NULL, 0);
|
||||
if (symInfo.hDbgHelp == NULL) {
|
||||
abort:
|
||||
failed = true;
|
||||
if (symInfo.hDbgHelp != NULL) {
|
||||
FreeLibrary(symInfo.hDbgHelp);
|
||||
}
|
||||
symInfo.pfImagehlpApiVersionEx = NULL;
|
||||
symInfo.pfSymInitialize = NULL;
|
||||
symInfo.pfSymSetOptions = NULL;
|
||||
symInfo.pfSymGetOptions = NULL;
|
||||
symInfo.pfSymLoadModule64 = NULL;
|
||||
symInfo.pfSymGetModuleInfo64 = NULL;
|
||||
symInfo.pfSymFromName = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
symInfo.pfImagehlpApiVersionEx
|
||||
= (PF_ImagehlpApiVersionEx)GetProcAddress(symInfo.hDbgHelp,
|
||||
"ImagehlpApiVersionEx");
|
||||
symInfo.pfSymInitialize
|
||||
= (PF_SymInitialize)GetProcAddress(symInfo.hDbgHelp, "SymInitialize");
|
||||
symInfo.pfSymSetOptions
|
||||
= (PF_SymSetOptions)GetProcAddress(symInfo.hDbgHelp, "SymSetOptions");
|
||||
symInfo.pfSymGetOptions
|
||||
= (PF_SymGetOptions)GetProcAddress(symInfo.hDbgHelp, "SymGetOptions");
|
||||
symInfo.pfSymLoadModule64
|
||||
= (PF_SymLoadModule64)GetProcAddress(symInfo.hDbgHelp, "SymLoadModule64");
|
||||
symInfo.pfSymGetModuleInfo64
|
||||
= (PF_SymGetModuleInfo64)GetProcAddress(symInfo.hDbgHelp, "SymGetModuleInfo64");
|
||||
symInfo.pfSymFromName
|
||||
= (PF_SymFromName)GetProcAddress(symInfo.hDbgHelp, "SymFromName");
|
||||
|
||||
API_VERSION av;
|
||||
ZeroMemory(&av, sizeof(av));
|
||||
av.MajorVersion = API_VERSION_NUMBER;
|
||||
|
||||
if (symInfo.pfImagehlpApiVersionEx == NULL ||
|
||||
symInfo.pfSymInitialize == NULL ||
|
||||
symInfo.pfSymLoadModule64 == NULL ||
|
||||
symInfo.pfSymGetModuleInfo64 == NULL ||
|
||||
symInfo.pfSymFromName == NULL) {
|
||||
goto abort;
|
||||
}
|
||||
|
||||
symInfo.pfImagehlpApiVersionEx(&av);
|
||||
if (av.MajorVersion < API_VERSION_NUMBER) {
|
||||
goto abort;
|
||||
}
|
||||
|
||||
if (!symInfo.pfSymInitialize(symInfo.hProcess, NULL, FALSE)) {
|
||||
// We won't retry the initialize if it fails.
|
||||
goto abort;
|
||||
}
|
||||
|
||||
if (symInfo.pfSymGetOptions != NULL && symInfo.pfSymSetOptions != NULL) {
|
||||
DWORD dw = symInfo.pfSymGetOptions();
|
||||
|
||||
dw &= ~(SYMOPT_CASE_INSENSITIVE |
|
||||
SYMOPT_UNDNAME |
|
||||
SYMOPT_DEFERRED_LOADS |
|
||||
0);
|
||||
dw |= (
|
||||
#if defined(SYMOPT_EXACT_SYMBOLS)
|
||||
SYMOPT_EXACT_SYMBOLS |
|
||||
#endif
|
||||
#if defined(SYMOPT_NO_UNQUALIFIED_LOADS)
|
||||
SYMOPT_NO_UNQUALIFIED_LOADS |
|
||||
#endif
|
||||
SYMOPT_DEFERRED_LOADS |
|
||||
#if defined(SYMOPT_FAIL_CRITICAL_ERRORS)
|
||||
SYMOPT_FAIL_CRITICAL_ERRORS |
|
||||
#endif
|
||||
#if defined(SYMOPT_INCLUDE_32BIT_MODULES)
|
||||
SYMOPT_INCLUDE_32BIT_MODULES |
|
||||
#endif
|
||||
0);
|
||||
symInfo.pfSymSetOptions(dw);
|
||||
}
|
||||
|
||||
pSymInfo = &symInfo;
|
||||
return pSymInfo;
|
||||
}
|
||||
|
||||
PVOID WINAPI DetourFindFunction(_In_ LPCSTR pszModule,
|
||||
_In_ LPCSTR pszFunction)
|
||||
{
|
||||
/////////////////////////////////////////////// First, try GetProcAddress.
|
||||
//
|
||||
#pragma prefast(suppress:28752, "We don't do the unicode conversion for LoadLibraryExA.")
|
||||
HMODULE hModule = LoadLibraryExA(pszModule, NULL, 0);
|
||||
if (hModule == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PBYTE pbCode = (PBYTE)GetProcAddress(hModule, pszFunction);
|
||||
if (pbCode) {
|
||||
return pbCode;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////// Then try ImageHelp.
|
||||
//
|
||||
DETOUR_TRACE(("DetourFindFunction(%hs, %hs)\n", pszModule, pszFunction));
|
||||
PDETOUR_SYM_INFO pSymInfo = DetourLoadImageHlp();
|
||||
if (pSymInfo == NULL) {
|
||||
DETOUR_TRACE(("DetourLoadImageHlp failed: %d\n",
|
||||
GetLastError()));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (pSymInfo->pfSymLoadModule64(pSymInfo->hProcess, NULL,
|
||||
(PCHAR)pszModule, NULL,
|
||||
(DWORD64)hModule, 0) == 0) {
|
||||
if (ERROR_SUCCESS != GetLastError()) {
|
||||
DETOUR_TRACE(("SymLoadModule64(%p) failed: %d\n",
|
||||
pSymInfo->hProcess, GetLastError()));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT hrRet;
|
||||
CHAR szFullName[512];
|
||||
IMAGEHLP_MODULE64 modinfo;
|
||||
ZeroMemory(&modinfo, sizeof(modinfo));
|
||||
modinfo.SizeOfStruct = sizeof(modinfo);
|
||||
if (!pSymInfo->pfSymGetModuleInfo64(pSymInfo->hProcess, (DWORD64)hModule, &modinfo)) {
|
||||
DETOUR_TRACE(("SymGetModuleInfo64(%p, %p) failed: %d\n",
|
||||
pSymInfo->hProcess, hModule, GetLastError()));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
hrRet = StringCchCopyA(szFullName, sizeof(szFullName)/sizeof(CHAR), modinfo.ModuleName);
|
||||
if (FAILED(hrRet)) {
|
||||
DETOUR_TRACE(("StringCchCopyA failed: %08x\n", hrRet));
|
||||
return NULL;
|
||||
}
|
||||
hrRet = StringCchCatA(szFullName, sizeof(szFullName)/sizeof(CHAR), "!");
|
||||
if (FAILED(hrRet)) {
|
||||
DETOUR_TRACE(("StringCchCatA failed: %08x\n", hrRet));
|
||||
return NULL;
|
||||
}
|
||||
hrRet = StringCchCatA(szFullName, sizeof(szFullName)/sizeof(CHAR), pszFunction);
|
||||
if (FAILED(hrRet)) {
|
||||
DETOUR_TRACE(("StringCchCatA failed: %08x\n", hrRet));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct CFullSymbol : SYMBOL_INFO {
|
||||
CHAR szRestOfName[512];
|
||||
} symbol;
|
||||
ZeroMemory(&symbol, sizeof(symbol));
|
||||
//symbol.ModBase = (ULONG64)hModule;
|
||||
symbol.SizeOfStruct = sizeof(SYMBOL_INFO);
|
||||
#ifdef DBHLPAPI
|
||||
symbol.MaxNameLen = sizeof(symbol.szRestOfName)/sizeof(symbol.szRestOfName[0]);
|
||||
#else
|
||||
symbol.MaxNameLength = sizeof(symbol.szRestOfName)/sizeof(symbol.szRestOfName[0]);
|
||||
#endif
|
||||
|
||||
if (!pSymInfo->pfSymFromName(pSymInfo->hProcess, szFullName, &symbol)) {
|
||||
DETOUR_TRACE(("SymFromName(%hs) failed: %d\n", szFullName, GetLastError()));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if defined(DETOURS_IA64)
|
||||
// On the IA64, we get a raw code pointer from the symbol engine
|
||||
// and have to convert it to a wrapped [code pointer, global pointer].
|
||||
//
|
||||
PPLABEL_DESCRIPTOR pldEntry = (PPLABEL_DESCRIPTOR)DetourGetEntryPoint(hModule);
|
||||
PPLABEL_DESCRIPTOR pldSymbol = new PLABEL_DESCRIPTOR;
|
||||
|
||||
pldSymbol->EntryPoint = symbol.Address;
|
||||
pldSymbol->GlobalPointer = pldEntry->GlobalPointer;
|
||||
return (PBYTE)pldSymbol;
|
||||
#elif defined(DETOURS_ARM)
|
||||
// On the ARM, we get a raw code pointer, which we must convert into a
|
||||
// valied Thumb2 function pointer.
|
||||
return DETOURS_PBYTE_TO_PFUNC(symbol.Address);
|
||||
#else
|
||||
return (PBYTE)symbol.Address;
|
||||
#endif
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////// Module Image Functions.
|
||||
//
|
||||
|
||||
HMODULE WINAPI DetourEnumerateModules(_In_opt_ HMODULE hModuleLast)
|
||||
{
|
||||
PBYTE pbLast = (PBYTE)hModuleLast + MM_ALLOCATION_GRANULARITY;
|
||||
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
ZeroMemory(&mbi, sizeof(mbi));
|
||||
|
||||
// Find the next memory region that contains a mapped PE image.
|
||||
//
|
||||
for (;; pbLast = (PBYTE)mbi.BaseAddress + mbi.RegionSize) {
|
||||
if (VirtualQuery(pbLast, &mbi, sizeof(mbi)) <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Skip uncommitted regions and guard pages.
|
||||
//
|
||||
if ((mbi.State != MEM_COMMIT) ||
|
||||
((mbi.Protect & 0xff) == PAGE_NOACCESS) ||
|
||||
(mbi.Protect & PAGE_GUARD)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
__try {
|
||||
PIMAGE_DOS_HEADER pDosHeader = (PIMAGE_DOS_HEADER)pbLast;
|
||||
if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE ||
|
||||
(DWORD)pDosHeader->e_lfanew > mbi.RegionSize ||
|
||||
(DWORD)pDosHeader->e_lfanew < sizeof(*pDosHeader)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
PIMAGE_NT_HEADERS pNtHeader = (PIMAGE_NT_HEADERS)((PBYTE)pDosHeader +
|
||||
pDosHeader->e_lfanew);
|
||||
if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return (HMODULE)pDosHeader;
|
||||
}
|
||||
#pragma prefast(suppress:28940, "A bad pointer means this probably isn't a PE header.")
|
||||
__except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
|
||||
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PVOID WINAPI DetourGetEntryPoint(_In_opt_ HMODULE hModule)
|
||||
{
|
||||
PIMAGE_DOS_HEADER pDosHeader = (PIMAGE_DOS_HEADER)hModule;
|
||||
if (hModule == NULL) {
|
||||
pDosHeader = (PIMAGE_DOS_HEADER)GetModuleHandleW(NULL);
|
||||
}
|
||||
|
||||
__try {
|
||||
#pragma warning(suppress:6011) // GetModuleHandleW(NULL) never returns NULL.
|
||||
if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE) {
|
||||
SetLastError(ERROR_BAD_EXE_FORMAT);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PIMAGE_NT_HEADERS pNtHeader = (PIMAGE_NT_HEADERS)((PBYTE)pDosHeader +
|
||||
pDosHeader->e_lfanew);
|
||||
if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) {
|
||||
SetLastError(ERROR_INVALID_EXE_SIGNATURE);
|
||||
return NULL;
|
||||
}
|
||||
if (pNtHeader->FileHeader.SizeOfOptionalHeader == 0) {
|
||||
SetLastError(ERROR_EXE_MARKED_INVALID);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PDETOUR_CLR_HEADER pClrHeader = NULL;
|
||||
if (pNtHeader->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
|
||||
if (((PIMAGE_NT_HEADERS32)pNtHeader)->CLR_DIRECTORY.VirtualAddress != 0 &&
|
||||
((PIMAGE_NT_HEADERS32)pNtHeader)->CLR_DIRECTORY.Size != 0) {
|
||||
pClrHeader = (PDETOUR_CLR_HEADER)
|
||||
(((PBYTE)pDosHeader)
|
||||
+ ((PIMAGE_NT_HEADERS32)pNtHeader)->CLR_DIRECTORY.VirtualAddress);
|
||||
}
|
||||
}
|
||||
else if (pNtHeader->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
|
||||
if (((PIMAGE_NT_HEADERS64)pNtHeader)->CLR_DIRECTORY.VirtualAddress != 0 &&
|
||||
((PIMAGE_NT_HEADERS64)pNtHeader)->CLR_DIRECTORY.Size != 0) {
|
||||
pClrHeader = (PDETOUR_CLR_HEADER)
|
||||
(((PBYTE)pDosHeader)
|
||||
+ ((PIMAGE_NT_HEADERS64)pNtHeader)->CLR_DIRECTORY.VirtualAddress);
|
||||
}
|
||||
}
|
||||
|
||||
if (pClrHeader != NULL) {
|
||||
// For MSIL assemblies, we want to use the _Cor entry points.
|
||||
|
||||
HMODULE hClr = GetModuleHandleW(L"MSCOREE.DLL");
|
||||
if (hClr == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SetLastError(NO_ERROR);
|
||||
return GetProcAddress(hClr, "_CorExeMain");
|
||||
}
|
||||
|
||||
SetLastError(NO_ERROR);
|
||||
|
||||
// Pure resource DLLs have neither an entry point nor CLR information
|
||||
// so handle them by returning NULL (LastError is NO_ERROR)
|
||||
if (pNtHeader->OptionalHeader.AddressOfEntryPoint == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return ((PBYTE)pDosHeader) +
|
||||
pNtHeader->OptionalHeader.AddressOfEntryPoint;
|
||||
}
|
||||
__except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
|
||||
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
|
||||
SetLastError(ERROR_EXE_MARKED_INVALID);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
ULONG WINAPI DetourGetModuleSize(_In_opt_ HMODULE hModule)
|
||||
{
|
||||
PIMAGE_DOS_HEADER pDosHeader = (PIMAGE_DOS_HEADER)hModule;
|
||||
if (hModule == NULL) {
|
||||
pDosHeader = (PIMAGE_DOS_HEADER)GetModuleHandleW(NULL);
|
||||
}
|
||||
|
||||
__try {
|
||||
#pragma warning(suppress:6011) // GetModuleHandleW(NULL) never returns NULL.
|
||||
if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE) {
|
||||
SetLastError(ERROR_BAD_EXE_FORMAT);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PIMAGE_NT_HEADERS pNtHeader = (PIMAGE_NT_HEADERS)((PBYTE)pDosHeader +
|
||||
pDosHeader->e_lfanew);
|
||||
if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) {
|
||||
SetLastError(ERROR_INVALID_EXE_SIGNATURE);
|
||||
return NULL;
|
||||
}
|
||||
if (pNtHeader->FileHeader.SizeOfOptionalHeader == 0) {
|
||||
SetLastError(ERROR_EXE_MARKED_INVALID);
|
||||
return NULL;
|
||||
}
|
||||
SetLastError(NO_ERROR);
|
||||
|
||||
return (pNtHeader->OptionalHeader.SizeOfImage);
|
||||
}
|
||||
__except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
|
||||
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
|
||||
SetLastError(ERROR_EXE_MARKED_INVALID);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
HMODULE WINAPI DetourGetContainingModule(_In_ PVOID pvAddr)
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
ZeroMemory(&mbi, sizeof(mbi));
|
||||
|
||||
__try {
|
||||
if (VirtualQuery(pvAddr, &mbi, sizeof(mbi)) <= 0) {
|
||||
SetLastError(ERROR_BAD_EXE_FORMAT);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Skip uncommitted regions and guard pages.
|
||||
//
|
||||
if ((mbi.State != MEM_COMMIT) ||
|
||||
((mbi.Protect & 0xff) == PAGE_NOACCESS) ||
|
||||
(mbi.Protect & PAGE_GUARD)) {
|
||||
SetLastError(ERROR_BAD_EXE_FORMAT);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PIMAGE_DOS_HEADER pDosHeader = (PIMAGE_DOS_HEADER)mbi.AllocationBase;
|
||||
if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE) {
|
||||
SetLastError(ERROR_BAD_EXE_FORMAT);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PIMAGE_NT_HEADERS pNtHeader = (PIMAGE_NT_HEADERS)((PBYTE)pDosHeader +
|
||||
pDosHeader->e_lfanew);
|
||||
if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) {
|
||||
SetLastError(ERROR_INVALID_EXE_SIGNATURE);
|
||||
return NULL;
|
||||
}
|
||||
if (pNtHeader->FileHeader.SizeOfOptionalHeader == 0) {
|
||||
SetLastError(ERROR_EXE_MARKED_INVALID);
|
||||
return NULL;
|
||||
}
|
||||
SetLastError(NO_ERROR);
|
||||
|
||||
return (HMODULE)pDosHeader;
|
||||
}
|
||||
__except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
|
||||
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
|
||||
SetLastError(ERROR_INVALID_EXE_SIGNATURE);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static inline PBYTE RvaAdjust(_Pre_notnull_ PIMAGE_DOS_HEADER pDosHeader, _In_ DWORD raddr)
|
||||
{
|
||||
if (raddr != NULL) {
|
||||
return ((PBYTE)pDosHeader) + raddr;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BOOL WINAPI DetourEnumerateExports(_In_ HMODULE hModule,
|
||||
_In_opt_ PVOID pContext,
|
||||
_In_ PF_DETOUR_ENUMERATE_EXPORT_CALLBACK pfExport)
|
||||
{
|
||||
PIMAGE_DOS_HEADER pDosHeader = (PIMAGE_DOS_HEADER)hModule;
|
||||
if (hModule == NULL) {
|
||||
pDosHeader = (PIMAGE_DOS_HEADER)GetModuleHandleW(NULL);
|
||||
}
|
||||
|
||||
__try {
|
||||
#pragma warning(suppress:6011) // GetModuleHandleW(NULL) never returns NULL.
|
||||
if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE) {
|
||||
SetLastError(ERROR_BAD_EXE_FORMAT);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PIMAGE_NT_HEADERS pNtHeader = (PIMAGE_NT_HEADERS)((PBYTE)pDosHeader +
|
||||
pDosHeader->e_lfanew);
|
||||
if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) {
|
||||
SetLastError(ERROR_INVALID_EXE_SIGNATURE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pNtHeader->FileHeader.SizeOfOptionalHeader == 0) {
|
||||
SetLastError(ERROR_EXE_MARKED_INVALID);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
PIMAGE_EXPORT_DIRECTORY pExportDir
|
||||
= (PIMAGE_EXPORT_DIRECTORY)
|
||||
RvaAdjust(pDosHeader,
|
||||
pNtHeader->OptionalHeader
|
||||
.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress);
|
||||
|
||||
if (pExportDir == NULL) {
|
||||
SetLastError(ERROR_EXE_MARKED_INVALID);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
PBYTE pExportDirEnd = (PBYTE)pExportDir + pNtHeader->OptionalHeader
|
||||
.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].Size;
|
||||
PDWORD pdwFunctions = (PDWORD)RvaAdjust(pDosHeader, pExportDir->AddressOfFunctions);
|
||||
PDWORD pdwNames = (PDWORD)RvaAdjust(pDosHeader, pExportDir->AddressOfNames);
|
||||
PWORD pwOrdinals = (PWORD)RvaAdjust(pDosHeader, pExportDir->AddressOfNameOrdinals);
|
||||
|
||||
for (DWORD nFunc = 0; nFunc < pExportDir->NumberOfFunctions; nFunc++) {
|
||||
PBYTE pbCode = (pdwFunctions != NULL)
|
||||
? (PBYTE)RvaAdjust(pDosHeader, pdwFunctions[nFunc]) : NULL;
|
||||
PCHAR pszName = NULL;
|
||||
|
||||
// if the pointer is in the export region, then it is a forwarder.
|
||||
if (pbCode > (PBYTE)pExportDir && pbCode < pExportDirEnd) {
|
||||
pbCode = NULL;
|
||||
}
|
||||
|
||||
for (DWORD n = 0; n < pExportDir->NumberOfNames; n++) {
|
||||
if (pwOrdinals[n] == nFunc) {
|
||||
pszName = (pdwNames != NULL)
|
||||
? (PCHAR)RvaAdjust(pDosHeader, pdwNames[n]) : NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
ULONG nOrdinal = pExportDir->Base + nFunc;
|
||||
|
||||
if (!pfExport(pContext, nOrdinal, pszName, pbCode)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
SetLastError(NO_ERROR);
|
||||
return TRUE;
|
||||
}
|
||||
__except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
|
||||
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
|
||||
SetLastError(ERROR_EXE_MARKED_INVALID);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL WINAPI DetourEnumerateImportsEx(_In_opt_ HMODULE hModule,
|
||||
_In_opt_ PVOID pContext,
|
||||
_In_opt_ PF_DETOUR_IMPORT_FILE_CALLBACK pfImportFile,
|
||||
_In_opt_ PF_DETOUR_IMPORT_FUNC_CALLBACK_EX pfImportFunc)
|
||||
{
|
||||
PIMAGE_DOS_HEADER pDosHeader = (PIMAGE_DOS_HEADER)hModule;
|
||||
if (hModule == NULL) {
|
||||
pDosHeader = (PIMAGE_DOS_HEADER)GetModuleHandleW(NULL);
|
||||
}
|
||||
|
||||
__try {
|
||||
#pragma warning(suppress:6011) // GetModuleHandleW(NULL) never returns NULL.
|
||||
if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE) {
|
||||
SetLastError(ERROR_BAD_EXE_FORMAT);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
PIMAGE_NT_HEADERS pNtHeader = (PIMAGE_NT_HEADERS)((PBYTE)pDosHeader +
|
||||
pDosHeader->e_lfanew);
|
||||
if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) {
|
||||
SetLastError(ERROR_INVALID_EXE_SIGNATURE);
|
||||
return FALSE;
|
||||
}
|
||||
if (pNtHeader->FileHeader.SizeOfOptionalHeader == 0) {
|
||||
SetLastError(ERROR_EXE_MARKED_INVALID);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
PIMAGE_IMPORT_DESCRIPTOR iidp
|
||||
= (PIMAGE_IMPORT_DESCRIPTOR)
|
||||
RvaAdjust(pDosHeader,
|
||||
pNtHeader->OptionalHeader
|
||||
.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
|
||||
|
||||
if (iidp == NULL) {
|
||||
SetLastError(ERROR_EXE_MARKED_INVALID);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (; iidp->OriginalFirstThunk != 0; iidp++) {
|
||||
|
||||
PCSTR pszName = (PCHAR)RvaAdjust(pDosHeader, iidp->Name);
|
||||
if (pszName == NULL) {
|
||||
SetLastError(ERROR_EXE_MARKED_INVALID);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
PIMAGE_THUNK_DATA pThunks = (PIMAGE_THUNK_DATA)
|
||||
RvaAdjust(pDosHeader, iidp->OriginalFirstThunk);
|
||||
PVOID * pAddrs = (PVOID *)
|
||||
RvaAdjust(pDosHeader, iidp->FirstThunk);
|
||||
|
||||
HMODULE hFile = DetourGetContainingModule(pAddrs[0]);
|
||||
|
||||
if (pfImportFile != NULL) {
|
||||
if (!pfImportFile(pContext, hFile, pszName)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DWORD nNames = 0;
|
||||
if (pThunks) {
|
||||
for (; pThunks[nNames].u1.Ordinal; nNames++) {
|
||||
DWORD nOrdinal = 0;
|
||||
PCSTR pszFunc = NULL;
|
||||
|
||||
if (IMAGE_SNAP_BY_ORDINAL(pThunks[nNames].u1.Ordinal)) {
|
||||
nOrdinal = (DWORD)IMAGE_ORDINAL(pThunks[nNames].u1.Ordinal);
|
||||
}
|
||||
else {
|
||||
pszFunc = (PCSTR)RvaAdjust(pDosHeader,
|
||||
(DWORD)pThunks[nNames].u1.AddressOfData + 2);
|
||||
}
|
||||
|
||||
if (pfImportFunc != NULL) {
|
||||
if (!pfImportFunc(pContext,
|
||||
nOrdinal,
|
||||
pszFunc,
|
||||
&pAddrs[nNames])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pfImportFunc != NULL) {
|
||||
pfImportFunc(pContext, 0, NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (pfImportFile != NULL) {
|
||||
pfImportFile(pContext, NULL, NULL);
|
||||
}
|
||||
SetLastError(NO_ERROR);
|
||||
return TRUE;
|
||||
}
|
||||
__except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
|
||||
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
|
||||
SetLastError(ERROR_EXE_MARKED_INVALID);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// Context for DetourEnumerateImportsThunk, which adapts "regular" callbacks for use with "Ex".
|
||||
struct _DETOUR_ENUMERATE_IMPORTS_THUNK_CONTEXT
|
||||
{
|
||||
PVOID pContext;
|
||||
PF_DETOUR_IMPORT_FUNC_CALLBACK pfImportFunc;
|
||||
};
|
||||
|
||||
// Callback for DetourEnumerateImportsEx that adapts DetourEnumerateImportsEx
|
||||
// for use with a DetourEnumerateImports callback -- derefence the IAT and pass the value on.
|
||||
|
||||
static
|
||||
BOOL
|
||||
CALLBACK
|
||||
DetourEnumerateImportsThunk(_In_ PVOID VoidContext,
|
||||
_In_ DWORD nOrdinal,
|
||||
_In_opt_ PCSTR pszFunc,
|
||||
_In_opt_ PVOID* ppvFunc)
|
||||
{
|
||||
_DETOUR_ENUMERATE_IMPORTS_THUNK_CONTEXT const * const
|
||||
pContext = (_DETOUR_ENUMERATE_IMPORTS_THUNK_CONTEXT*)VoidContext;
|
||||
return pContext->pfImportFunc(pContext->pContext, nOrdinal, pszFunc, ppvFunc ? *ppvFunc : NULL);
|
||||
}
|
||||
|
||||
BOOL WINAPI DetourEnumerateImports(_In_opt_ HMODULE hModule,
|
||||
_In_opt_ PVOID pContext,
|
||||
_In_opt_ PF_DETOUR_IMPORT_FILE_CALLBACK pfImportFile,
|
||||
_In_opt_ PF_DETOUR_IMPORT_FUNC_CALLBACK pfImportFunc)
|
||||
{
|
||||
_DETOUR_ENUMERATE_IMPORTS_THUNK_CONTEXT const context = { pContext, pfImportFunc };
|
||||
|
||||
return DetourEnumerateImportsEx(hModule,
|
||||
(PVOID)&context,
|
||||
pfImportFile,
|
||||
&DetourEnumerateImportsThunk);
|
||||
}
|
||||
|
||||
static PDETOUR_LOADED_BINARY WINAPI GetPayloadSectionFromModule(HMODULE hModule)
|
||||
{
|
||||
PIMAGE_DOS_HEADER pDosHeader = (PIMAGE_DOS_HEADER)hModule;
|
||||
if (hModule == NULL) {
|
||||
pDosHeader = (PIMAGE_DOS_HEADER)GetModuleHandleW(NULL);
|
||||
}
|
||||
|
||||
__try {
|
||||
#pragma warning(suppress:6011) // GetModuleHandleW(NULL) never returns NULL.
|
||||
if (pDosHeader->e_magic != IMAGE_DOS_SIGNATURE) {
|
||||
SetLastError(ERROR_BAD_EXE_FORMAT);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PIMAGE_NT_HEADERS pNtHeader = (PIMAGE_NT_HEADERS)((PBYTE)pDosHeader +
|
||||
pDosHeader->e_lfanew);
|
||||
if (pNtHeader->Signature != IMAGE_NT_SIGNATURE) {
|
||||
SetLastError(ERROR_INVALID_EXE_SIGNATURE);
|
||||
return NULL;
|
||||
}
|
||||
if (pNtHeader->FileHeader.SizeOfOptionalHeader == 0) {
|
||||
SetLastError(ERROR_EXE_MARKED_INVALID);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PIMAGE_SECTION_HEADER pSectionHeaders
|
||||
= (PIMAGE_SECTION_HEADER)((PBYTE)pNtHeader
|
||||
+ sizeof(pNtHeader->Signature)
|
||||
+ sizeof(pNtHeader->FileHeader)
|
||||
+ pNtHeader->FileHeader.SizeOfOptionalHeader);
|
||||
|
||||
for (DWORD n = 0; n < pNtHeader->FileHeader.NumberOfSections; n++) {
|
||||
if (strcmp((PCHAR)pSectionHeaders[n].Name, ".detour") == 0) {
|
||||
if (pSectionHeaders[n].VirtualAddress == 0 ||
|
||||
pSectionHeaders[n].SizeOfRawData == 0) {
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
PBYTE pbData = (PBYTE)pDosHeader + pSectionHeaders[n].VirtualAddress;
|
||||
DETOUR_SECTION_HEADER *pHeader = (DETOUR_SECTION_HEADER *)pbData;
|
||||
if (pHeader->cbHeaderSize < sizeof(DETOUR_SECTION_HEADER) ||
|
||||
pHeader->nSignature != DETOUR_SECTION_HEADER_SIGNATURE) {
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (pHeader->nDataOffset == 0) {
|
||||
pHeader->nDataOffset = pHeader->cbHeaderSize;
|
||||
}
|
||||
SetLastError(NO_ERROR);
|
||||
return (PBYTE)pHeader;
|
||||
}
|
||||
}
|
||||
SetLastError(ERROR_EXE_MARKED_INVALID);
|
||||
return NULL;
|
||||
}
|
||||
__except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
|
||||
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
|
||||
SetLastError(ERROR_EXE_MARKED_INVALID);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
DWORD WINAPI DetourGetSizeOfPayloads(_In_opt_ HMODULE hModule)
|
||||
{
|
||||
PDETOUR_LOADED_BINARY pBinary = GetPayloadSectionFromModule(hModule);
|
||||
if (pBinary == NULL) {
|
||||
// Error set by GetPayloadSectionFromModule.
|
||||
return 0;
|
||||
}
|
||||
|
||||
__try {
|
||||
DETOUR_SECTION_HEADER *pHeader = (DETOUR_SECTION_HEADER *)pBinary;
|
||||
if (pHeader->cbHeaderSize < sizeof(DETOUR_SECTION_HEADER) ||
|
||||
pHeader->nSignature != DETOUR_SECTION_HEADER_SIGNATURE) {
|
||||
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
}
|
||||
SetLastError(NO_ERROR);
|
||||
return pHeader->cbDataSize;
|
||||
}
|
||||
__except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
|
||||
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
_Writable_bytes_(*pcbData)
|
||||
_Readable_bytes_(*pcbData)
|
||||
_Success_(return != NULL)
|
||||
PVOID WINAPI DetourFindPayload(_In_opt_ HMODULE hModule,
|
||||
_In_ REFGUID rguid,
|
||||
_Out_ DWORD *pcbData)
|
||||
{
|
||||
PBYTE pbData = NULL;
|
||||
if (pcbData) {
|
||||
*pcbData = 0;
|
||||
}
|
||||
|
||||
PDETOUR_LOADED_BINARY pBinary = GetPayloadSectionFromModule(hModule);
|
||||
if (pBinary == NULL) {
|
||||
// Error set by GetPayloadSectionFromModule.
|
||||
return NULL;
|
||||
}
|
||||
|
||||
__try {
|
||||
DETOUR_SECTION_HEADER *pHeader = (DETOUR_SECTION_HEADER *)pBinary;
|
||||
if (pHeader->cbHeaderSize < sizeof(DETOUR_SECTION_HEADER) ||
|
||||
pHeader->nSignature != DETOUR_SECTION_HEADER_SIGNATURE) {
|
||||
|
||||
SetLastError(ERROR_INVALID_EXE_SIGNATURE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PBYTE pbBeg = ((PBYTE)pHeader) + pHeader->nDataOffset;
|
||||
PBYTE pbEnd = ((PBYTE)pHeader) + pHeader->cbDataSize;
|
||||
|
||||
for (pbData = pbBeg; pbData < pbEnd;) {
|
||||
DETOUR_SECTION_RECORD *pSection = (DETOUR_SECTION_RECORD *)pbData;
|
||||
|
||||
if (pSection->guid.Data1 == rguid.Data1 &&
|
||||
pSection->guid.Data2 == rguid.Data2 &&
|
||||
pSection->guid.Data3 == rguid.Data3 &&
|
||||
pSection->guid.Data4[0] == rguid.Data4[0] &&
|
||||
pSection->guid.Data4[1] == rguid.Data4[1] &&
|
||||
pSection->guid.Data4[2] == rguid.Data4[2] &&
|
||||
pSection->guid.Data4[3] == rguid.Data4[3] &&
|
||||
pSection->guid.Data4[4] == rguid.Data4[4] &&
|
||||
pSection->guid.Data4[5] == rguid.Data4[5] &&
|
||||
pSection->guid.Data4[6] == rguid.Data4[6] &&
|
||||
pSection->guid.Data4[7] == rguid.Data4[7]) {
|
||||
|
||||
if (pcbData) {
|
||||
*pcbData = pSection->cbBytes - sizeof(*pSection);
|
||||
SetLastError(NO_ERROR);
|
||||
return (PBYTE)(pSection + 1);
|
||||
}
|
||||
}
|
||||
|
||||
pbData = (PBYTE)pSection + pSection->cbBytes;
|
||||
}
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
__except(GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ?
|
||||
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH) {
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
_Writable_bytes_(*pcbData)
|
||||
_Readable_bytes_(*pcbData)
|
||||
_Success_(return != NULL)
|
||||
PVOID WINAPI DetourFindPayloadEx(_In_ REFGUID rguid,
|
||||
_Out_ DWORD * pcbData)
|
||||
{
|
||||
for (HMODULE hMod = NULL; (hMod = DetourEnumerateModules(hMod)) != NULL;) {
|
||||
PVOID pvData;
|
||||
|
||||
pvData = DetourFindPayload(hMod, rguid, pcbData);
|
||||
if (pvData != NULL) {
|
||||
return pvData;
|
||||
}
|
||||
}
|
||||
SetLastError(ERROR_MOD_NOT_FOUND);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BOOL WINAPI DetourRestoreAfterWithEx(_In_reads_bytes_(cbData) PVOID pvData,
|
||||
_In_ DWORD cbData)
|
||||
{
|
||||
PDETOUR_EXE_RESTORE pder = (PDETOUR_EXE_RESTORE)pvData;
|
||||
|
||||
if (pder->cb != sizeof(*pder) || pder->cb > cbData) {
|
||||
SetLastError(ERROR_BAD_EXE_FORMAT);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DWORD dwPermIdh = ~0u;
|
||||
DWORD dwPermInh = ~0u;
|
||||
DWORD dwPermClr = ~0u;
|
||||
DWORD dwIgnore;
|
||||
BOOL fSucceeded = FALSE;
|
||||
BOOL fUpdated32To64 = FALSE;
|
||||
|
||||
if (pder->pclr != NULL && pder->clr.Flags != ((PDETOUR_CLR_HEADER)pder->pclr)->Flags) {
|
||||
// If we had to promote the 32/64-bit agnostic IL to 64-bit, we can't restore
|
||||
// that.
|
||||
fUpdated32To64 = TRUE;
|
||||
}
|
||||
|
||||
if (DetourVirtualProtectSameExecute(pder->pidh, pder->cbidh,
|
||||
PAGE_EXECUTE_READWRITE, &dwPermIdh)) {
|
||||
if (DetourVirtualProtectSameExecute(pder->pinh, pder->cbinh,
|
||||
PAGE_EXECUTE_READWRITE, &dwPermInh)) {
|
||||
|
||||
CopyMemory(pder->pidh, &pder->idh, pder->cbidh);
|
||||
CopyMemory(pder->pinh, &pder->inh, pder->cbinh);
|
||||
|
||||
if (pder->pclr != NULL && !fUpdated32To64) {
|
||||
if (DetourVirtualProtectSameExecute(pder->pclr, pder->cbclr,
|
||||
PAGE_EXECUTE_READWRITE, &dwPermClr)) {
|
||||
CopyMemory(pder->pclr, &pder->clr, pder->cbclr);
|
||||
VirtualProtect(pder->pclr, pder->cbclr, dwPermClr, &dwIgnore);
|
||||
fSucceeded = TRUE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
fSucceeded = TRUE;
|
||||
}
|
||||
VirtualProtect(pder->pinh, pder->cbinh, dwPermInh, &dwIgnore);
|
||||
}
|
||||
VirtualProtect(pder->pidh, pder->cbidh, dwPermIdh, &dwIgnore);
|
||||
}
|
||||
return fSucceeded;
|
||||
}
|
||||
|
||||
BOOL WINAPI DetourRestoreAfterWith()
|
||||
{
|
||||
PVOID pvData;
|
||||
DWORD cbData;
|
||||
|
||||
pvData = DetourFindPayloadEx(DETOUR_EXE_RESTORE_GUID, &cbData);
|
||||
|
||||
if (pvData != NULL && cbData != 0) {
|
||||
return DetourRestoreAfterWithEx(pvData, cbData);
|
||||
}
|
||||
SetLastError(ERROR_MOD_NOT_FOUND);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// End of File
|
|
@ -0,0 +1,269 @@
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Add DLLs to a module import table (uimports.cpp of detours.lib)
|
||||
//
|
||||
// Microsoft Research Detours Package, Version 4.0.1
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// Note that this file is included into creatwth.cpp one or more times
|
||||
// (once for each supported module format).
|
||||
//
|
||||
|
||||
#if DETOURS_VERSION != 0x4c0c1 // 0xMAJORcMINORcPATCH
|
||||
#error detours.h version mismatch
|
||||
#endif
|
||||
|
||||
// UpdateImports32 aka UpdateImports64
|
||||
static BOOL UPDATE_IMPORTS_XX(HANDLE hProcess,
|
||||
HMODULE hModule,
|
||||
__in_ecount(nDlls) LPCSTR *plpDlls,
|
||||
DWORD nDlls)
|
||||
{
|
||||
BOOL fSucceeded = FALSE;
|
||||
DWORD cbNew = 0;
|
||||
|
||||
BYTE * pbNew = NULL;
|
||||
DWORD i;
|
||||
SIZE_T cbRead;
|
||||
DWORD n;
|
||||
|
||||
PBYTE pbModule = (PBYTE)hModule;
|
||||
|
||||
IMAGE_DOS_HEADER idh;
|
||||
ZeroMemory(&idh, sizeof(idh));
|
||||
if (!ReadProcessMemory(hProcess, pbModule, &idh, sizeof(idh), &cbRead)
|
||||
|| cbRead < sizeof(idh)) {
|
||||
|
||||
DETOUR_TRACE(("ReadProcessMemory(idh@%p..%p) failed: %d\n",
|
||||
pbModule, pbModule + sizeof(idh), GetLastError()));
|
||||
|
||||
finish:
|
||||
if (pbNew != NULL) {
|
||||
delete[] pbNew;
|
||||
pbNew = NULL;
|
||||
}
|
||||
return fSucceeded;
|
||||
}
|
||||
|
||||
IMAGE_NT_HEADERS_XX inh;
|
||||
ZeroMemory(&inh, sizeof(inh));
|
||||
|
||||
if (!ReadProcessMemory(hProcess, pbModule + idh.e_lfanew, &inh, sizeof(inh), &cbRead)
|
||||
|| cbRead < sizeof(inh)) {
|
||||
DETOUR_TRACE(("ReadProcessMemory(inh@%p..%p) failed: %d\n",
|
||||
pbModule + idh.e_lfanew,
|
||||
pbModule + idh.e_lfanew + sizeof(inh),
|
||||
GetLastError()));
|
||||
goto finish;
|
||||
}
|
||||
|
||||
if (inh.OptionalHeader.Magic != IMAGE_NT_OPTIONAL_HDR_MAGIC_XX) {
|
||||
DETOUR_TRACE(("Wrong size image (%04x != %04x).\n",
|
||||
inh.OptionalHeader.Magic, IMAGE_NT_OPTIONAL_HDR_MAGIC_XX));
|
||||
SetLastError(ERROR_INVALID_BLOCK);
|
||||
goto finish;
|
||||
}
|
||||
|
||||
// Zero out the bound table so loader doesn't use it instead of our new table.
|
||||
inh.BOUND_DIRECTORY.VirtualAddress = 0;
|
||||
inh.BOUND_DIRECTORY.Size = 0;
|
||||
|
||||
// Find the size of the mapped file.
|
||||
DWORD dwSec = idh.e_lfanew +
|
||||
FIELD_OFFSET(IMAGE_NT_HEADERS_XX, OptionalHeader) +
|
||||
inh.FileHeader.SizeOfOptionalHeader;
|
||||
|
||||
for (i = 0; i < inh.FileHeader.NumberOfSections; i++) {
|
||||
IMAGE_SECTION_HEADER ish;
|
||||
ZeroMemory(&ish, sizeof(ish));
|
||||
|
||||
if (!ReadProcessMemory(hProcess, pbModule + dwSec + sizeof(ish) * i, &ish,
|
||||
sizeof(ish), &cbRead)
|
||||
|| cbRead < sizeof(ish)) {
|
||||
|
||||
DETOUR_TRACE(("ReadProcessMemory(ish@%p..%p) failed: %d\n",
|
||||
pbModule + dwSec + sizeof(ish) * i,
|
||||
pbModule + dwSec + sizeof(ish) * (i + 1),
|
||||
GetLastError()));
|
||||
goto finish;
|
||||
}
|
||||
|
||||
DETOUR_TRACE(("ish[%d] : va=%08x sr=%d\n", i, ish.VirtualAddress, ish.SizeOfRawData));
|
||||
|
||||
// If the file didn't have an IAT_DIRECTORY, we assign it...
|
||||
if (inh.IAT_DIRECTORY.VirtualAddress == 0 &&
|
||||
inh.IMPORT_DIRECTORY.VirtualAddress >= ish.VirtualAddress &&
|
||||
inh.IMPORT_DIRECTORY.VirtualAddress < ish.VirtualAddress + ish.SizeOfRawData) {
|
||||
|
||||
inh.IAT_DIRECTORY.VirtualAddress = ish.VirtualAddress;
|
||||
inh.IAT_DIRECTORY.Size = ish.SizeOfRawData;
|
||||
}
|
||||
}
|
||||
|
||||
DETOUR_TRACE((" Imports: %p..%p\n",
|
||||
(DWORD_PTR)pbModule + inh.IMPORT_DIRECTORY.VirtualAddress,
|
||||
(DWORD_PTR)pbModule + inh.IMPORT_DIRECTORY.VirtualAddress +
|
||||
inh.IMPORT_DIRECTORY.Size));
|
||||
|
||||
DWORD nOldDlls = inh.IMPORT_DIRECTORY.Size / sizeof(IMAGE_IMPORT_DESCRIPTOR);
|
||||
DWORD obRem = sizeof(IMAGE_IMPORT_DESCRIPTOR) * nDlls;
|
||||
DWORD obOld = obRem + sizeof(IMAGE_IMPORT_DESCRIPTOR) * nOldDlls;
|
||||
DWORD obTab = PadToDwordPtr(obOld);
|
||||
DWORD obDll = obTab + sizeof(DWORD_XX) * 4 * nDlls;
|
||||
DWORD obStr = obDll;
|
||||
cbNew = obStr;
|
||||
for (n = 0; n < nDlls; n++) {
|
||||
cbNew += PadToDword((DWORD)strlen(plpDlls[n]) + 1);
|
||||
}
|
||||
|
||||
_Analysis_assume_(cbNew >
|
||||
sizeof(IMAGE_IMPORT_DESCRIPTOR) * (nDlls + nOldDlls)
|
||||
+ sizeof(DWORD_XX) * 4 * nDlls);
|
||||
pbNew = new BYTE [cbNew];
|
||||
if (pbNew == NULL) {
|
||||
DETOUR_TRACE(("new BYTE [cbNew] failed.\n"));
|
||||
goto finish;
|
||||
}
|
||||
ZeroMemory(pbNew, cbNew);
|
||||
|
||||
PBYTE pbBase = pbModule;
|
||||
PBYTE pbNext = pbBase
|
||||
+ inh.OptionalHeader.BaseOfCode
|
||||
+ inh.OptionalHeader.SizeOfCode
|
||||
+ inh.OptionalHeader.SizeOfInitializedData
|
||||
+ inh.OptionalHeader.SizeOfUninitializedData;
|
||||
if (pbBase < pbNext) {
|
||||
pbBase = pbNext;
|
||||
}
|
||||
DETOUR_TRACE(("pbBase = %p\n", pbBase));
|
||||
|
||||
PBYTE pbNewIid = FindAndAllocateNearBase(hProcess, pbModule, pbBase, cbNew);
|
||||
if (pbNewIid == NULL) {
|
||||
DETOUR_TRACE(("FindAndAllocateNearBase failed.\n"));
|
||||
goto finish;
|
||||
}
|
||||
|
||||
PIMAGE_IMPORT_DESCRIPTOR piid = (PIMAGE_IMPORT_DESCRIPTOR)pbNew;
|
||||
DWORD_XX *pt;
|
||||
|
||||
DWORD obBase = (DWORD)(pbNewIid - pbModule);
|
||||
DWORD dwProtect = 0;
|
||||
|
||||
if (inh.IMPORT_DIRECTORY.VirtualAddress != 0) {
|
||||
// Read the old import directory if it exists.
|
||||
DETOUR_TRACE(("IMPORT_DIRECTORY perms=%x\n", dwProtect));
|
||||
|
||||
if (!ReadProcessMemory(hProcess,
|
||||
pbModule + inh.IMPORT_DIRECTORY.VirtualAddress,
|
||||
&piid[nDlls],
|
||||
nOldDlls * sizeof(IMAGE_IMPORT_DESCRIPTOR), &cbRead)
|
||||
|| cbRead < nOldDlls * sizeof(IMAGE_IMPORT_DESCRIPTOR)) {
|
||||
|
||||
DETOUR_TRACE(("ReadProcessMemory(imports) failed: %d\n", GetLastError()));
|
||||
goto finish;
|
||||
}
|
||||
}
|
||||
|
||||
for (n = 0; n < nDlls; n++) {
|
||||
HRESULT hrRet = StringCchCopyA((char*)pbNew + obStr, cbNew - obStr, plpDlls[n]);
|
||||
if (FAILED(hrRet)) {
|
||||
DETOUR_TRACE(("StringCchCopyA failed: %d\n", GetLastError()));
|
||||
goto finish;
|
||||
}
|
||||
|
||||
// After copying the string, we patch up the size "??" bits if any.
|
||||
hrRet = ReplaceOptionalSizeA((char*)pbNew + obStr,
|
||||
cbNew - obStr,
|
||||
DETOURS_STRINGIFY(DETOURS_BITS_XX));
|
||||
if (FAILED(hrRet)) {
|
||||
DETOUR_TRACE(("ReplaceOptionalSizeA failed: %d\n", GetLastError()));
|
||||
goto finish;
|
||||
}
|
||||
|
||||
DWORD nOffset = obTab + (sizeof(DWORD_XX) * (4 * n));
|
||||
piid[n].OriginalFirstThunk = obBase + nOffset;
|
||||
pt = ((DWORD_XX*)(pbNew + nOffset));
|
||||
pt[0] = IMAGE_ORDINAL_FLAG_XX + 1;
|
||||
pt[1] = 0;
|
||||
|
||||
nOffset = obTab + (sizeof(DWORD_XX) * ((4 * n) + 2));
|
||||
piid[n].FirstThunk = obBase + nOffset;
|
||||
pt = ((DWORD_XX*)(pbNew + nOffset));
|
||||
pt[0] = IMAGE_ORDINAL_FLAG_XX + 1;
|
||||
pt[1] = 0;
|
||||
piid[n].TimeDateStamp = 0;
|
||||
piid[n].ForwarderChain = 0;
|
||||
piid[n].Name = obBase + obStr;
|
||||
|
||||
obStr += PadToDword((DWORD)strlen(plpDlls[n]) + 1);
|
||||
}
|
||||
_Analysis_assume_(obStr <= cbNew);
|
||||
|
||||
#if 0
|
||||
for (i = 0; i < nDlls + nOldDlls; i++) {
|
||||
DETOUR_TRACE(("%8d. Look=%08x Time=%08x Fore=%08x Name=%08x Addr=%08x\n",
|
||||
i,
|
||||
piid[i].OriginalFirstThunk,
|
||||
piid[i].TimeDateStamp,
|
||||
piid[i].ForwarderChain,
|
||||
piid[i].Name,
|
||||
piid[i].FirstThunk));
|
||||
if (piid[i].OriginalFirstThunk == 0 && piid[i].FirstThunk == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!WriteProcessMemory(hProcess, pbNewIid, pbNew, obStr, NULL)) {
|
||||
DETOUR_TRACE(("WriteProcessMemory(iid) failed: %d\n", GetLastError()));
|
||||
goto finish;
|
||||
}
|
||||
|
||||
DETOUR_TRACE(("obBaseBef = %08x..%08x\n",
|
||||
inh.IMPORT_DIRECTORY.VirtualAddress,
|
||||
inh.IMPORT_DIRECTORY.VirtualAddress + inh.IMPORT_DIRECTORY.Size));
|
||||
DETOUR_TRACE(("obBaseAft = %08x..%08x\n", obBase, obBase + obStr));
|
||||
|
||||
// If the file doesn't have an IAT_DIRECTORY, we create it...
|
||||
if (inh.IAT_DIRECTORY.VirtualAddress == 0) {
|
||||
inh.IAT_DIRECTORY.VirtualAddress = obBase;
|
||||
inh.IAT_DIRECTORY.Size = cbNew;
|
||||
}
|
||||
|
||||
inh.IMPORT_DIRECTORY.VirtualAddress = obBase;
|
||||
inh.IMPORT_DIRECTORY.Size = cbNew;
|
||||
|
||||
/////////////////////// Update the NT header for the new import directory.
|
||||
//
|
||||
if (!DetourVirtualProtectSameExecuteEx(hProcess, pbModule, inh.OptionalHeader.SizeOfHeaders,
|
||||
PAGE_EXECUTE_READWRITE, &dwProtect)) {
|
||||
DETOUR_TRACE(("VirtualProtectEx(inh) write failed: %d\n", GetLastError()));
|
||||
goto finish;
|
||||
}
|
||||
|
||||
inh.OptionalHeader.CheckSum = 0;
|
||||
|
||||
if (!WriteProcessMemory(hProcess, pbModule, &idh, sizeof(idh), NULL)) {
|
||||
DETOUR_TRACE(("WriteProcessMemory(idh) failed: %d\n", GetLastError()));
|
||||
goto finish;
|
||||
}
|
||||
DETOUR_TRACE(("WriteProcessMemory(idh:%p..%p)\n", pbModule, pbModule + sizeof(idh)));
|
||||
|
||||
if (!WriteProcessMemory(hProcess, pbModule + idh.e_lfanew, &inh, sizeof(inh), NULL)) {
|
||||
DETOUR_TRACE(("WriteProcessMemory(inh) failed: %d\n", GetLastError()));
|
||||
goto finish;
|
||||
}
|
||||
DETOUR_TRACE(("WriteProcessMemory(inh:%p..%p)\n",
|
||||
pbModule + idh.e_lfanew,
|
||||
pbModule + idh.e_lfanew + sizeof(inh)));
|
||||
|
||||
if (!VirtualProtectEx(hProcess, pbModule, inh.OptionalHeader.SizeOfHeaders,
|
||||
dwProtect, &dwProtect)) {
|
||||
DETOUR_TRACE(("VirtualProtectEx(idh) restore failed: %d\n", GetLastError()));
|
||||
goto finish;
|
||||
}
|
||||
|
||||
fSucceeded = TRUE;
|
||||
goto finish;
|
||||
}
|
|
@ -0,0 +1,166 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "DataStore.h"
|
||||
|
||||
#include "DynamicDependencyDataStore_h.h"
|
||||
#include "utf8.h"
|
||||
#include "winrt_msixdynamicdepednency.h"
|
||||
|
||||
#include <wil/winrt.h>
|
||||
|
||||
#include <shlobj.h>
|
||||
|
||||
MddCore::PackageDependency MddCore::DataStore::Load(PCWSTR packageDependencyId)
|
||||
{
|
||||
std::filesystem::path relativeFilename{ L"DynamicDependency" };
|
||||
relativeFilename /= std::wstring(packageDependencyId) + DataStore::fileExtension;
|
||||
|
||||
auto filename{ GetDataStorePathForUser() };
|
||||
filename /= relativeFilename;
|
||||
wil::unique_hfile file{ OpenFileIfExists(filename.c_str()) };
|
||||
if (!file)
|
||||
{
|
||||
filename = GetDataStorePathForSystem();
|
||||
filename /= relativeFilename;
|
||||
file.reset(OpenFileIfExists(filename.c_str()));
|
||||
if (!file)
|
||||
{
|
||||
// Not found
|
||||
return PackageDependency();
|
||||
}
|
||||
}
|
||||
|
||||
LARGE_INTEGER fileSize{};
|
||||
THROW_IF_WIN32_BOOL_FALSE(::GetFileSizeEx(file.get(), &fileSize));
|
||||
const auto dataSize{ fileSize.QuadPart };
|
||||
THROW_HR_IF(HRESULT_FROM_WIN32(ERROR_INVALID_DATA), dataSize > INT32_MAX);
|
||||
if (dataSize == 0)
|
||||
{
|
||||
// 0-byte file is invalid. Perhaps power was lost when written but before flushed?
|
||||
// 'Fix' it i.e. delete it and report not-found
|
||||
file.reset();
|
||||
std::filesystem::remove(filename);
|
||||
return PackageDependency();
|
||||
}
|
||||
|
||||
const auto bufferSize{ static_cast<DWORD>(dataSize) + 1 };
|
||||
std::unique_ptr<char[]> bufferUtf8{ std::make_unique<char[]>(bufferSize) };
|
||||
|
||||
DWORD bytesRead{};
|
||||
THROW_IF_WIN32_BOOL_FALSE(::ReadFile(file.get(), bufferUtf8.get(), bufferSize, &bytesRead, nullptr));
|
||||
file.reset();
|
||||
bufferUtf8[bytesRead] = '\0';
|
||||
auto json{ bufferUtf8.get() };
|
||||
|
||||
return MddCore::PackageDependency::FromJSON(json);
|
||||
}
|
||||
|
||||
void MddCore::DataStore::Save(
|
||||
const MddCore::PackageDependency& packageDependency,
|
||||
const MddCreatePackageDependencyOptions options)
|
||||
{
|
||||
// Package depednencies with LifetimeKind.Process are never saved to disk. They live in memory and end with the process
|
||||
if (packageDependency.LifetimeKind() == MddPackageDependencyLifetimeKind::Process)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto json{ packageDependency.ToJSONUtf8() };
|
||||
|
||||
auto path{ GetDataStorePath(options) };
|
||||
path /= L"DynamicDependency";
|
||||
std::filesystem::create_directory(path);
|
||||
|
||||
auto filename{ path / (packageDependency.Id() + DataStore::fileExtension) };
|
||||
|
||||
wil::unique_hfile file{ ::CreateFileW(filename.c_str(), GENERIC_WRITE, FILE_SHARE_DELETE, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr) };
|
||||
if (!file)
|
||||
{
|
||||
THROW_LAST_ERROR_MSG("%ls", filename.c_str());
|
||||
}
|
||||
|
||||
DWORD bytesWritten{};
|
||||
THROW_IF_WIN32_BOOL_FALSE_MSG(::WriteFile(file.get(), json.c_str(), static_cast<DWORD>(json.length()), &bytesWritten, nullptr), "%ls", filename.c_str());
|
||||
}
|
||||
|
||||
void MddCore::DataStore::Delete(PCWSTR packageDependencyId)
|
||||
{
|
||||
std::filesystem::path relativeFilename{ L"DynamicDependency" };
|
||||
relativeFilename /= std::wstring(packageDependencyId) + DataStore::fileExtension;
|
||||
|
||||
auto filename{ GetDataStorePathForUser() };
|
||||
filename /= relativeFilename;
|
||||
if (!DeleteFileIfExists(filename.c_str()))
|
||||
{
|
||||
filename = GetDataStorePathForSystem();
|
||||
filename /= relativeFilename;
|
||||
DeleteFileIfExists(filename.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
bool MddCore::DataStore::DeleteFileIfExists(PCWSTR filename)
|
||||
{
|
||||
if (!::DeleteFileW(filename))
|
||||
{
|
||||
auto const lastError{ GetLastError() };
|
||||
if ((lastError == ERROR_FILE_NOT_FOUND) || (lastError == ERROR_PATH_NOT_FOUND))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
THROW_HR_MSG(HRESULT_FROM_WIN32(lastError), "Error %d deleting file %ls", lastError, filename);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
HANDLE MddCore::DataStore::OpenFileIfExists(
|
||||
PCWSTR filename)
|
||||
{
|
||||
wil::unique_hfile file{ ::CreateFileW(filename, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, nullptr) };
|
||||
if (!file)
|
||||
{
|
||||
const auto lastError{ GetLastError() };
|
||||
if ((lastError == ERROR_FILE_NOT_FOUND) || (lastError == ERROR_PATH_NOT_FOUND))
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
THROW_WIN32_MSG(lastError, "Error %d opening file %ls", lastError, filename);
|
||||
}
|
||||
return file.release();
|
||||
}
|
||||
|
||||
std::filesystem::path MddCore::DataStore::GetDataStorePath(const MddCreatePackageDependencyOptions options)
|
||||
{
|
||||
if (WI_IsFlagSet(options, MddCreatePackageDependencyOptions::ScopeIsSystem))
|
||||
{
|
||||
return GetDataStorePathForSystem();
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetDataStorePathForUser();
|
||||
}
|
||||
}
|
||||
|
||||
std::filesystem::path MddCore::DataStore::GetDataStorePathForSystem()
|
||||
{
|
||||
wil::unique_cotaskmem_ptr<WCHAR[]> folderPath;
|
||||
THROW_IF_FAILED(SHGetKnownFolderPath(FOLDERID_ProgramData, 0, nullptr, wil::out_param(folderPath)));
|
||||
|
||||
std::filesystem::path path{ folderPath.get() };
|
||||
path /= L"Microsoft";
|
||||
return path;
|
||||
}
|
||||
|
||||
std::filesystem::path MddCore::DataStore::GetDataStorePathForUser()
|
||||
{
|
||||
wil::com_ptr<IDynamicDependencyDataStore> dataStore{ wil::CoCreateInstance<DynamicDependencyDataStore, IDynamicDependencyDataStore>(CLSCTX_LOCAL_SERVER) };
|
||||
|
||||
wil::com_ptr<IUnknown> applicationData_iunknown;
|
||||
THROW_IF_FAILED(dataStore->GetApplicationData(applicationData_iunknown.addressof()));
|
||||
|
||||
auto applicationData{ winrt::convert_from_abi<winrt::Windows::Storage::ApplicationData>(applicationData_iunknown.get()) };
|
||||
|
||||
return std::filesystem::path(applicationData.LocalFolder().Path().c_str());
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "PackageDependency.h"
|
||||
|
||||
namespace MddCore
|
||||
{
|
||||
class DataStore
|
||||
{
|
||||
public:
|
||||
DataStore() = delete;
|
||||
~DataStore() = delete;
|
||||
|
||||
public:
|
||||
static constexpr PCWSTR fileExtension{ L".mdd" };
|
||||
|
||||
static MddCore::PackageDependency Load(PCWSTR packageDependencyId);
|
||||
|
||||
static void Save(
|
||||
const MddCore::PackageDependency& packageDependency,
|
||||
const MddCreatePackageDependencyOptions options);
|
||||
|
||||
static void Delete(PCWSTR packageDependencyId);
|
||||
|
||||
private:
|
||||
static bool DeleteFileIfExists(PCWSTR filename);
|
||||
|
||||
static HANDLE OpenFileIfExists(PCWSTR filename);
|
||||
|
||||
static std::filesystem::path GetDataStorePath(const MddCreatePackageDependencyOptions options);
|
||||
|
||||
static std::filesystem::path GetDataStorePathForSystem();
|
||||
|
||||
static std::filesystem::path GetDataStorePathForUser();
|
||||
};
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Label="Globals">
|
||||
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' < '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||
<HasSharedItems>true</HasSharedItems>
|
||||
<ItemsProjectGuid>{bf055a59-0919-4e34-9b76-dd055495cc5a}</ItemsProjectGuid>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)\..\DynamicDependency.DataStore.ProxyStub</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ProjectCapability Include="SourceItemsFromImports" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)DataStore.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)M.AM.DD.AddPackageDependencyOptions.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)M.AM.DD.CreatePackageDependencyOptions.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)M.AM.DD.PackageDependency.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)M.AM.DD.PackageDependencyContext.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)M.AM.DD.PackageDependencyRank.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)MddDetourPackageGraph.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)MddWinRT.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)MsixDynamicDependency.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)PackageDependency.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)PackageDependencyManager.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)PackageGraph.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)PackageGraphManager.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)PackageGraphNode.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)WinRTModuleManager.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)WinRTPackage.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)appmodel_msixdynamicdependency.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)DataStore.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)M.AM.DD.AddPackageDependencyOptions.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)M.AM.DD.CreatePackageDependencyOptions.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)M.AM.DD.PackageDependency.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)M.AM.DD.PackageDependencyContext.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)M.AM.DD.PackageDependencyRank.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)MddCore.Architecture.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)MddDetourPackageGraph.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)MddWinRT.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)MsixDynamicDependency.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)M.AM.Converters.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)PackageDependency.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)PackageDependencyManager.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)PackageGraph.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)PackageGraphManager.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)PackageGraphNode.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)PackageId.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)PackageInfo.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)utf8.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)wil_msixdynamicdependency.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)WinRTInprocModule.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)WinRTModuleManager.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)WinRTPackage.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)winrt_msixdynamicdepednency.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)winrt_namespaces.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="$(MSBuildThisFileDirectory)M.AM.DynamicDependency.idl" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PublicHeaders Include="$(MSBuildThisFileDirectory)MsixDynamicDependency.h" />
|
||||
<PublicHeaders Include="$(MSBuildThisFileDirectory)wil_msixdynamicdependency.h" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,52 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)M.AM.DD.AddPackageDependencyOptions.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)M.AM.DD.CreatePackageDependencyOptions.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)M.AM.DD.PackageDependency.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)M.AM.DD.PackageDependencyContext.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)M.AM.DD.PackageDependencyRank.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)MsixDynamicDependency.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)PackageGraph.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)MddDetourPackageGraph.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)PackageGraphNode.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)PackageDependency.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)PackageDependencyManager.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)PackageGraphManager.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)DataStore.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)MddWinRT.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)WinRTModuleManager.cpp" />
|
||||
<ClCompile Include="$(MSBuildThisFileDirectory)WinRTPackage.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)M.AM.DD.AddPackageDependencyOptions.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)M.AM.DD.CreatePackageDependencyOptions.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)M.AM.DD.PackageDependency.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)M.AM.DD.PackageDependencyContext.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)M.AM.DD.PackageDependencyRank.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)MsixDynamicDependency.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)M.AM.Converters.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)PackageGraph.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)PackageGraphNode.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)MddDetourPackageGraph.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)wil_msixdynamicdependency.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)PackageDependency.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)PackageId.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)PackageDependencyManager.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)appmodel_msixdynamicdependency.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)PackageInfo.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)winrt_namespaces.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)MddCore.Architecture.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)PackageGraphManager.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)DataStore.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)utf8.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)winrt_msixdynamicdepednency.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)MddWinRT.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)WinRTInprocModule.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)WinRTModuleManager.h" />
|
||||
<ClInclude Include="$(MSBuildThisFileDirectory)WinRTPackage.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="$(MSBuildThisFileDirectory)M.AM.DynamicDependency.idl" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,77 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Microsoft::ApplicationModel::DynamicDependency
|
||||
{
|
||||
inline winrt::Windows::ApplicationModel::PackageVersion ToVersion(PACKAGE_VERSION const& from)
|
||||
{
|
||||
winrt::Windows::ApplicationModel::PackageVersion to{};
|
||||
to.Major = from.Major;
|
||||
to.Minor = from.Minor;
|
||||
to.Build = from.Build;
|
||||
to.Revision = from.Revision;
|
||||
return to;
|
||||
}
|
||||
|
||||
inline PACKAGE_VERSION ToVersion(winrt::Windows::ApplicationModel::PackageVersion const& from)
|
||||
{
|
||||
PACKAGE_VERSION to{};
|
||||
to.Major = from.Major;
|
||||
to.Minor = from.Minor;
|
||||
to.Build = from.Build;
|
||||
to.Revision = from.Revision;
|
||||
return to;
|
||||
}
|
||||
|
||||
inline MddPackageDependencyProcessorArchitectures ToArchitectures(winrt::Microsoft::ApplicationModel::DynamicDependency::PackageDependencyProcessorArchitectures const& architectures)
|
||||
{
|
||||
static_assert(static_cast<int32_t>(winrt::Microsoft::ApplicationModel::DynamicDependency::PackageDependencyProcessorArchitectures::None) == static_cast<int32_t>(MddPackageDependencyProcessorArchitectures::None), "WinRT/MddPackageDependencyProcessorArchitectures::None mismatch");
|
||||
static_assert(static_cast<int32_t>(winrt::Microsoft::ApplicationModel::DynamicDependency::PackageDependencyProcessorArchitectures::Neutral) == static_cast<int32_t>(MddPackageDependencyProcessorArchitectures::Neutral), "WinRT/MddPackageDependencyProcessorArchitectures::Neutral mismatch");
|
||||
static_assert(static_cast<int32_t>(winrt::Microsoft::ApplicationModel::DynamicDependency::PackageDependencyProcessorArchitectures::X86) == static_cast<int32_t>(MddPackageDependencyProcessorArchitectures::X86), "WinRT/MddPackageDependencyProcessorArchitectures::X86 mismatch");
|
||||
static_assert(static_cast<int32_t>(winrt::Microsoft::ApplicationModel::DynamicDependency::PackageDependencyProcessorArchitectures::X64) == static_cast<int32_t>(MddPackageDependencyProcessorArchitectures::X64), "WinRT/MddPackageDependencyProcessorArchitectures::X64 mismatch");
|
||||
static_assert(static_cast<int32_t>(winrt::Microsoft::ApplicationModel::DynamicDependency::PackageDependencyProcessorArchitectures::Arm) == static_cast<int32_t>(MddPackageDependencyProcessorArchitectures::Arm), "WinRT/MddPackageDependencyProcessorArchitectures::Arm mismatch");
|
||||
static_assert(static_cast<int32_t>(winrt::Microsoft::ApplicationModel::DynamicDependency::PackageDependencyProcessorArchitectures::Arm64) == static_cast<int32_t>(MddPackageDependencyProcessorArchitectures::Arm64), "WinRT/MddPackageDependencyProcessorArchitectures::Arm64 mismatch");
|
||||
static_assert(static_cast<int32_t>(winrt::Microsoft::ApplicationModel::DynamicDependency::PackageDependencyProcessorArchitectures::X86OnArm64) == static_cast<int32_t>(MddPackageDependencyProcessorArchitectures::X86OnArm64), "WinRT/MddPackageDependencyProcessorArchitectures::X86OnArm64 mismatch");
|
||||
return static_cast<MddPackageDependencyProcessorArchitectures>(architectures);
|
||||
}
|
||||
|
||||
inline MddPackageDependencyLifetimeKind ToLifetimeKind(winrt::Microsoft::ApplicationModel::DynamicDependency::PackageDependencyLifetimeArtifactKind const& lifetimeArtifactKind)
|
||||
{
|
||||
static_assert(static_cast<int32_t>(winrt::Microsoft::ApplicationModel::DynamicDependency::PackageDependencyLifetimeArtifactKind::Process) == static_cast<int32_t>(MddPackageDependencyLifetimeKind::Process), "WinRT/MddPackageDependencyLifetimeKind::Process mismatch");
|
||||
static_assert(static_cast<int32_t>(winrt::Microsoft::ApplicationModel::DynamicDependency::PackageDependencyLifetimeArtifactKind::FilePath) == static_cast<int32_t>(MddPackageDependencyLifetimeKind::FilePath), "WinRT/MddPackageDependencyLifetimeKind::FilePath mismatch");
|
||||
static_assert(static_cast<int32_t>(winrt::Microsoft::ApplicationModel::DynamicDependency::PackageDependencyLifetimeArtifactKind::RegistryKey) == static_cast<int32_t>(MddPackageDependencyLifetimeKind::RegistryKey), "WinRT/MddPackageDependencyLifetimeKind::ReistryKey mismatch");
|
||||
return static_cast<MddPackageDependencyLifetimeKind>(lifetimeArtifactKind);
|
||||
}
|
||||
|
||||
inline MddCreatePackageDependencyOptions ToCreateOptions(winrt::Microsoft::ApplicationModel::DynamicDependency::CreatePackageDependencyOptions const& options, MddCreatePackageDependencyOptions const& defaultValue = MddCreatePackageDependencyOptions::None)
|
||||
{
|
||||
auto mddOptions{ defaultValue };
|
||||
if (!options.VerifyDependencyResolution())
|
||||
{
|
||||
WI_SetFlag(mddOptions, MddCreatePackageDependencyOptions::DoNotVerifyDependencyResolution);
|
||||
}
|
||||
return mddOptions;
|
||||
}
|
||||
|
||||
inline MddAddPackageDependencyOptions ToAddOptions(winrt::Microsoft::ApplicationModel::DynamicDependency::AddPackageDependencyOptions const& options)
|
||||
{
|
||||
auto mddOptions{ MddAddPackageDependencyOptions::None };
|
||||
if (options.PrependIfRankCollision())
|
||||
{
|
||||
WI_SetFlag(mddOptions, MddAddPackageDependencyOptions::PrependIfRankCollision);
|
||||
}
|
||||
return mddOptions;
|
||||
}
|
||||
|
||||
inline winrt::Microsoft::ApplicationModel::DynamicDependency::PackageDependencyContextId ToContextId(MDD_PACKAGEDEPENDENCY_CONTEXT context)
|
||||
{
|
||||
return winrt::Microsoft::ApplicationModel::DynamicDependency::PackageDependencyContextId{ static_cast<uint64_t>(reinterpret_cast<INT_PTR>(context)) };
|
||||
}
|
||||
|
||||
inline MDD_PACKAGEDEPENDENCY_CONTEXT ToContext(winrt::Microsoft::ApplicationModel::DynamicDependency::PackageDependencyContextId contextId)
|
||||
{
|
||||
return reinterpret_cast<MDD_PACKAGEDEPENDENCY_CONTEXT>(static_cast<INT_PTR>(contextId.Id));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "M.AM.DD.AddPackageDependencyOptions.h"
|
||||
#include "Microsoft.ApplicationModel.DynamicDependency.AddPackageDependencyOptions.g.cpp"
|
||||
|
||||
namespace winrt::Microsoft::ApplicationModel::DynamicDependency::implementation
|
||||
{
|
||||
int32_t AddPackageDependencyOptions::Rank()
|
||||
{
|
||||
return m_rank;
|
||||
}
|
||||
|
||||
void AddPackageDependencyOptions::Rank(int32_t value)
|
||||
{
|
||||
m_rank = value;
|
||||
}
|
||||
|
||||
bool AddPackageDependencyOptions::PrependIfRankCollision()
|
||||
{
|
||||
return m_prependIfRankCollision;
|
||||
}
|
||||
|
||||
void AddPackageDependencyOptions::PrependIfRankCollision(bool value)
|
||||
{
|
||||
m_prependIfRankCollision = value;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Microsoft.ApplicationModel.DynamicDependency.AddPackageDependencyOptions.g.h"
|
||||
|
||||
#include <MsixDynamicDependency.h>
|
||||
|
||||
namespace winrt::Microsoft::ApplicationModel::DynamicDependency::implementation
|
||||
{
|
||||
struct AddPackageDependencyOptions : AddPackageDependencyOptionsT<AddPackageDependencyOptions>
|
||||
{
|
||||
AddPackageDependencyOptions() = default;
|
||||
|
||||
int32_t Rank();
|
||||
void Rank(int32_t value);
|
||||
bool PrependIfRankCollision();
|
||||
void PrependIfRankCollision(bool value);
|
||||
|
||||
private:
|
||||
int32_t m_rank{ MDD_PACKAGE_DEPENDENCY_RANK_DEFAULT };
|
||||
bool m_prependIfRankCollision{};
|
||||
};
|
||||
}
|
||||
namespace winrt::Microsoft::ApplicationModel::DynamicDependency::factory_implementation
|
||||
{
|
||||
struct AddPackageDependencyOptions : AddPackageDependencyOptionsT<AddPackageDependencyOptions, implementation::AddPackageDependencyOptions>
|
||||
{
|
||||
};
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "M.AM.DD.CreatePackageDependencyOptions.h"
|
||||
#include "Microsoft.ApplicationModel.DynamicDependency.CreatePackageDependencyOptions.g.cpp"
|
||||
|
||||
namespace winrt::Microsoft::ApplicationModel::DynamicDependency::implementation
|
||||
{
|
||||
winrt::PackageDependencyProcessorArchitectures CreatePackageDependencyOptions::Architectures()
|
||||
{
|
||||
return m_architectures;
|
||||
}
|
||||
void CreatePackageDependencyOptions::Architectures(Microsoft::ApplicationModel::DynamicDependency::PackageDependencyProcessorArchitectures const& value)
|
||||
{
|
||||
m_architectures = value;
|
||||
}
|
||||
|
||||
bool CreatePackageDependencyOptions::VerifyDependencyResolution()
|
||||
{
|
||||
return m_verifyDependencyResolution;
|
||||
}
|
||||
|
||||
void CreatePackageDependencyOptions::VerifyDependencyResolution(bool value)
|
||||
{
|
||||
m_verifyDependencyResolution = value;
|
||||
}
|
||||
|
||||
winrt::PackageDependencyLifetimeArtifactKind CreatePackageDependencyOptions::LifetimeArtifactKind()
|
||||
{
|
||||
return m_lifetimeArtifactKind;
|
||||
}
|
||||
|
||||
void CreatePackageDependencyOptions::LifetimeArtifactKind(Microsoft::ApplicationModel::DynamicDependency::PackageDependencyLifetimeArtifactKind const& value)
|
||||
{
|
||||
m_lifetimeArtifactKind = value;
|
||||
}
|
||||
|
||||
hstring CreatePackageDependencyOptions::LifetimeArtifact()
|
||||
{
|
||||
return m_lifetimeArtifact;
|
||||
}
|
||||
|
||||
void CreatePackageDependencyOptions::LifetimeArtifact(hstring const& value)
|
||||
{
|
||||
m_lifetimeArtifact = value;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Microsoft.ApplicationModel.DynamicDependency.CreatePackageDependencyOptions.g.h"
|
||||
|
||||
#include "winrt_namespaces.h"
|
||||
|
||||
namespace winrt::Microsoft::ApplicationModel::DynamicDependency::implementation
|
||||
{
|
||||
struct CreatePackageDependencyOptions : CreatePackageDependencyOptionsT<CreatePackageDependencyOptions>
|
||||
{
|
||||
CreatePackageDependencyOptions() = default;
|
||||
|
||||
winrt::PackageDependencyProcessorArchitectures Architectures();
|
||||
void Architectures(Microsoft::ApplicationModel::DynamicDependency::PackageDependencyProcessorArchitectures const& value);
|
||||
bool VerifyDependencyResolution();
|
||||
void VerifyDependencyResolution(bool value);
|
||||
winrt::PackageDependencyLifetimeArtifactKind LifetimeArtifactKind();
|
||||
void LifetimeArtifactKind(Microsoft::ApplicationModel::DynamicDependency::PackageDependencyLifetimeArtifactKind const& value);
|
||||
hstring LifetimeArtifact();
|
||||
void LifetimeArtifact(hstring const& value);
|
||||
|
||||
private:
|
||||
winrt::PackageDependencyProcessorArchitectures m_architectures{ winrt::PackageDependencyProcessorArchitectures::None };
|
||||
bool m_verifyDependencyResolution{};
|
||||
winrt::PackageDependencyLifetimeArtifactKind m_lifetimeArtifactKind{ winrt::PackageDependencyLifetimeArtifactKind::Process };
|
||||
hstring m_lifetimeArtifact;
|
||||
};
|
||||
}
|
||||
namespace winrt::Microsoft::ApplicationModel::DynamicDependency::factory_implementation
|
||||
{
|
||||
struct CreatePackageDependencyOptions : CreatePackageDependencyOptionsT<CreatePackageDependencyOptions, implementation::CreatePackageDependencyOptions>
|
||||
{
|
||||
};
|
||||
}
|
|
@ -0,0 +1,124 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "M.AM.DD.PackageDependency.h"
|
||||
#include "Microsoft.ApplicationModel.DynamicDependency.PackageDependency.g.cpp"
|
||||
|
||||
#include "M.AM.DD.PackageDependencyContext.h"
|
||||
|
||||
#include "PackageDependencyManager.h"
|
||||
|
||||
#include <MsixDynamicDependency.h>
|
||||
#include <wil/resource.h>
|
||||
#include <wil_msixdynamicdependency.h>
|
||||
|
||||
#include <M.AM.Converters.h>
|
||||
|
||||
namespace winrt::Microsoft::ApplicationModel::DynamicDependency::implementation
|
||||
{
|
||||
PackageDependency::PackageDependency(hstring const& id) :
|
||||
m_id(id)
|
||||
{
|
||||
}
|
||||
|
||||
winrt::PackageDependency PackageDependency::GetFromId(hstring const& id)
|
||||
{
|
||||
auto tokenUser{ wil::get_token_information<TOKEN_USER>(GetCurrentThreadEffectiveToken()) };
|
||||
auto exists{ MddCore::PackageDependencyManager::ExistsPackageDependency(tokenUser->User.Sid, id.c_str()) };
|
||||
if (!exists)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
return winrt::make<implementation::PackageDependency>(id);
|
||||
}
|
||||
|
||||
winrt::PackageDependency PackageDependency::GetFromIdForSystem(hstring const& id)
|
||||
{
|
||||
auto exists{ MddCore::PackageDependencyManager::ExistsPackageDependency(nullptr, id.c_str()) };
|
||||
if (!exists)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
return winrt::make<implementation::PackageDependency>(id);
|
||||
}
|
||||
|
||||
winrt::PackageDependency PackageDependency::Create(hstring const& packageFamilyName, Windows::ApplicationModel::PackageVersion const& minVersion)
|
||||
{
|
||||
auto tokenUser{ wil::get_token_information<TOKEN_USER>(GetCurrentThreadEffectiveToken()) };
|
||||
const auto mddMinVersion{ ::Microsoft::ApplicationModel::DynamicDependency::ToVersion(minVersion) };
|
||||
const auto mddArchitectures{ MddPackageDependencyProcessorArchitectures::None };
|
||||
const auto mddLifetimeKind{ MddPackageDependencyLifetimeKind::Process };
|
||||
const PCWSTR mddLifetimeArtifact{};
|
||||
const auto mddOptions{ MddCreatePackageDependencyOptions::None };
|
||||
return Create(tokenUser->User.Sid, packageFamilyName.c_str(), mddMinVersion, mddArchitectures, mddLifetimeKind, mddLifetimeArtifact, mddOptions);
|
||||
}
|
||||
|
||||
winrt::PackageDependency PackageDependency::Create(hstring const& packageFamilyName, Windows::ApplicationModel::PackageVersion const& minVersion, winrt::CreatePackageDependencyOptions const& options)
|
||||
{
|
||||
auto tokenUser{ wil::get_token_information<TOKEN_USER>(GetCurrentThreadEffectiveToken()) };
|
||||
const auto mddMinVersion{ ::Microsoft::ApplicationModel::DynamicDependency::ToVersion(minVersion) };
|
||||
const auto mddArchitectures{ ::Microsoft::ApplicationModel::DynamicDependency::ToArchitectures(options.Architectures()) };
|
||||
const auto mddLifetimeKind{ ::Microsoft::ApplicationModel::DynamicDependency::ToLifetimeKind(options.LifetimeArtifactKind()) };
|
||||
const auto mddLifetimeArtifact{ options.LifetimeArtifact().c_str() };
|
||||
const auto mddOptions{ ::Microsoft::ApplicationModel::DynamicDependency::ToCreateOptions(options) };
|
||||
return Create(tokenUser->User.Sid, packageFamilyName.c_str(), mddMinVersion, mddArchitectures, mddLifetimeKind, mddLifetimeArtifact, mddOptions);
|
||||
}
|
||||
|
||||
winrt::PackageDependency PackageDependency::CreateForSystem(hstring const& packageFamilyName, Windows::ApplicationModel::PackageVersion const& minVersion, winrt::CreatePackageDependencyOptions const& options)
|
||||
{
|
||||
const auto mddMinVersion{ ::Microsoft::ApplicationModel::DynamicDependency::ToVersion(minVersion) };
|
||||
const auto mddArchitectures{ ::Microsoft::ApplicationModel::DynamicDependency::ToArchitectures(options.Architectures()) };
|
||||
const auto mddLifetimeKind{ ::Microsoft::ApplicationModel::DynamicDependency::ToLifetimeKind(options.LifetimeArtifactKind()) };
|
||||
const auto mddLifetimeArtifact{ options.LifetimeArtifact().c_str() };
|
||||
auto mddOptions{ ::Microsoft::ApplicationModel::DynamicDependency::ToCreateOptions(options, MddCreatePackageDependencyOptions::ScopeIsSystem) };
|
||||
return Create(nullptr, packageFamilyName.c_str(), mddMinVersion, mddArchitectures, mddLifetimeKind, mddLifetimeArtifact, mddOptions);
|
||||
}
|
||||
|
||||
hstring PackageDependency::Id()
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
void PackageDependency::Delete()
|
||||
{
|
||||
MddDeletePackageDependency(m_id.c_str());
|
||||
}
|
||||
|
||||
winrt::PackageDependencyContext PackageDependency::Add()
|
||||
{
|
||||
const auto rank{ MDD_PACKAGE_DEPENDENCY_RANK_DEFAULT };
|
||||
const auto mddOptions{ MddAddPackageDependencyOptions::None };
|
||||
wil::unique_package_dependency_context packageDependencyContext;
|
||||
winrt::check_hresult(MddAddPackageDependency(m_id.c_str(), rank, mddOptions, &packageDependencyContext, nullptr));
|
||||
auto context{ winrt::make<implementation::PackageDependencyContext>(packageDependencyContext.get()) };
|
||||
packageDependencyContext.release();
|
||||
return context;
|
||||
}
|
||||
|
||||
winrt::PackageDependencyContext PackageDependency::Add(Microsoft::ApplicationModel::DynamicDependency::AddPackageDependencyOptions const& options)
|
||||
{
|
||||
const auto rank{ options.Rank() };
|
||||
const auto mddOptions{ ::Microsoft::ApplicationModel::DynamicDependency::ToAddOptions(options) };
|
||||
wil::unique_package_dependency_context packageDependencyContext;
|
||||
winrt::check_hresult(MddAddPackageDependency(m_id.c_str(), rank, mddOptions, &packageDependencyContext, nullptr));
|
||||
auto context{ winrt::make<implementation::PackageDependencyContext>(packageDependencyContext.get()) };
|
||||
packageDependencyContext.release();
|
||||
return context;
|
||||
}
|
||||
|
||||
winrt::PackageDependency PackageDependency::Create(
|
||||
PSID userSid,
|
||||
PCWSTR packageFamilyName,
|
||||
PACKAGE_VERSION minVersion,
|
||||
MddPackageDependencyProcessorArchitectures architectures,
|
||||
MddPackageDependencyLifetimeKind lifetimeKind,
|
||||
PCWSTR lifetimeArtifact,
|
||||
MddCreatePackageDependencyOptions options)
|
||||
{
|
||||
wil::unique_process_heap_string packageDependencyId;
|
||||
winrt::check_hresult(MddTryCreatePackageDependency(userSid, packageFamilyName, minVersion, architectures, lifetimeKind, lifetimeArtifact, options, wil::out_param(packageDependencyId)));
|
||||
return GetFromId(packageDependencyId.get());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Microsoft.ApplicationModel.DynamicDependency.PackageDependency.g.h"
|
||||
|
||||
#include "winrt_namespaces.h"
|
||||
|
||||
namespace winrt::Microsoft::ApplicationModel::DynamicDependency::implementation
|
||||
{
|
||||
struct PackageDependency : PackageDependencyT<PackageDependency>
|
||||
{
|
||||
PackageDependency() = default;
|
||||
|
||||
PackageDependency(hstring const& id);
|
||||
|
||||
static winrt::PackageDependency GetFromId(hstring const& id);
|
||||
static winrt::PackageDependency GetFromIdForSystem(hstring const& id);
|
||||
static winrt::PackageDependency Create(hstring const& packageFamilyName, Windows::ApplicationModel::PackageVersion const& minVersion);
|
||||
static winrt::PackageDependency Create(hstring const& packageFamilyName, Windows::ApplicationModel::PackageVersion const& minVersion, winrt::CreatePackageDependencyOptions const& options);
|
||||
static winrt::PackageDependency CreateForSystem(hstring const& packageFamilyName, Windows::ApplicationModel::PackageVersion const& minVersion, winrt::CreatePackageDependencyOptions const& options);
|
||||
hstring Id();
|
||||
void Delete();
|
||||
winrt::PackageDependencyContext Add();
|
||||
winrt::PackageDependencyContext Add(Microsoft::ApplicationModel::DynamicDependency::AddPackageDependencyOptions const& options);
|
||||
|
||||
private:
|
||||
static winrt::PackageDependency Create(
|
||||
PSID userSid,
|
||||
PCWSTR packageFamilyName,
|
||||
PACKAGE_VERSION minVersion,
|
||||
MddPackageDependencyProcessorArchitectures architectures,
|
||||
MddPackageDependencyLifetimeKind lifetimeKind,
|
||||
PCWSTR lifetimeArtifact,
|
||||
MddCreatePackageDependencyOptions options);
|
||||
|
||||
private:
|
||||
hstring m_id;
|
||||
};
|
||||
}
|
||||
namespace winrt::Microsoft::ApplicationModel::DynamicDependency::factory_implementation
|
||||
{
|
||||
struct PackageDependency : PackageDependencyT<PackageDependency, implementation::PackageDependency>
|
||||
{
|
||||
};
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "M.AM.DD.PackageDependencyContext.h"
|
||||
#include "Microsoft.ApplicationModel.DynamicDependency.PackageDependencyContext.g.cpp"
|
||||
|
||||
#include <M.AM.Converters.h>
|
||||
|
||||
namespace winrt::Microsoft::ApplicationModel::DynamicDependency::implementation
|
||||
{
|
||||
PackageDependencyContext::PackageDependencyContext(Microsoft::ApplicationModel::DynamicDependency::PackageDependencyContextId const& contextId) :
|
||||
m_contextId(contextId)
|
||||
{
|
||||
}
|
||||
PackageDependencyContext::PackageDependencyContext(MDD_PACKAGEDEPENDENCY_CONTEXT context) :
|
||||
m_contextId(::Microsoft::ApplicationModel::DynamicDependency::ToContextId(context))
|
||||
{
|
||||
}
|
||||
winrt::PackageDependencyContextId PackageDependencyContext::ContextId()
|
||||
{
|
||||
return m_contextId;
|
||||
}
|
||||
|
||||
hstring PackageDependencyContext::PackageDependencyId()
|
||||
{
|
||||
wil::unique_process_heap_string id;
|
||||
winrt::check_hresult(MddGetIdForPackageDependencyContext(::Microsoft::ApplicationModel::DynamicDependency::ToContext(m_contextId), wil::out_param(id)));
|
||||
return winrt::hstring(id.get());
|
||||
}
|
||||
|
||||
hstring PackageDependencyContext::PackageFullName()
|
||||
{
|
||||
auto id{ PackageDependencyId() };
|
||||
wil::unique_process_heap_string packageFullName;
|
||||
winrt::check_hresult(MddGetResolvedPackageFullNameForPackageDependency(id.c_str(), wil::out_param(packageFullName)));
|
||||
return winrt::hstring(packageFullName.get());
|
||||
}
|
||||
|
||||
void PackageDependencyContext::Remove()
|
||||
{
|
||||
MddRemovePackageDependency(::Microsoft::ApplicationModel::DynamicDependency::ToContext(m_contextId));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Microsoft.ApplicationModel.DynamicDependency.PackageDependencyContext.g.h"
|
||||
|
||||
#include "winrt_namespaces.h"
|
||||
|
||||
#include <MsixDynamicDependency.h>
|
||||
|
||||
namespace winrt::Microsoft::ApplicationModel::DynamicDependency::implementation
|
||||
{
|
||||
struct PackageDependencyContext : PackageDependencyContextT<PackageDependencyContext>
|
||||
{
|
||||
PackageDependencyContext() = default;
|
||||
|
||||
PackageDependencyContext(MDD_PACKAGEDEPENDENCY_CONTEXT context);
|
||||
PackageDependencyContext(Microsoft::ApplicationModel::DynamicDependency::PackageDependencyContextId const& contextId);
|
||||
|
||||
winrt::PackageDependencyContextId ContextId();
|
||||
hstring PackageDependencyId();
|
||||
hstring PackageFullName();
|
||||
void Remove();
|
||||
|
||||
private:
|
||||
winrt::PackageDependencyContextId m_contextId;
|
||||
};
|
||||
}
|
||||
namespace winrt::Microsoft::ApplicationModel::DynamicDependency::factory_implementation
|
||||
{
|
||||
struct PackageDependencyContext : PackageDependencyContextT<PackageDependencyContext, implementation::PackageDependencyContext>
|
||||
{
|
||||
};
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "M.AM.DD.PackageDependencyRank.h"
|
||||
#include "Microsoft.ApplicationModel.DynamicDependency.PackageDependencyRank.g.cpp"
|
||||
|
||||
#include <MsixDynamicDependency.h>
|
||||
|
||||
namespace winrt::Microsoft::ApplicationModel::DynamicDependency::implementation
|
||||
{
|
||||
int32_t PackageDependencyRank::Default()
|
||||
{
|
||||
return MDD_PACKAGE_DEPENDENCY_RANK_DEFAULT;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Microsoft.ApplicationModel.DynamicDependency.PackageDependencyRank.g.h"
|
||||
|
||||
namespace winrt::Microsoft::ApplicationModel::DynamicDependency::implementation
|
||||
{
|
||||
struct PackageDependencyRank
|
||||
{
|
||||
PackageDependencyRank() = default;
|
||||
|
||||
static int32_t Default();
|
||||
};
|
||||
}
|
||||
namespace winrt::Microsoft::ApplicationModel::DynamicDependency::factory_implementation
|
||||
{
|
||||
struct PackageDependencyRank : PackageDependencyRankT<PackageDependencyRank, implementation::PackageDependencyRank>
|
||||
{
|
||||
};
|
||||
}
|
|
@ -0,0 +1,307 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
namespace Microsoft.ApplicationModel.DynamicDependency
|
||||
{
|
||||
/// CPU architectures to optionally filter available packages against a package dependency.
|
||||
/// These generally correspond to processor architecture types supported by MSIX.
|
||||
/// @see Windows.System.ProcessorArchitecture
|
||||
[flags]
|
||||
enum PackageDependencyProcessorArchitectures
|
||||
{
|
||||
None = 0,
|
||||
Neutral = 0x00000001,
|
||||
X86 = 0x00000002,
|
||||
X64 = 0x00000004,
|
||||
Arm = 0x00000008,
|
||||
Arm64 = 0x00000010,
|
||||
X86OnArm64 = 0x00000020,
|
||||
};
|
||||
|
||||
enum PackageDependencyLifetimeArtifactKind
|
||||
{
|
||||
/// The current process is the lifetime artifact. The package dependency
|
||||
/// is implicitly deleted when the process terminates.
|
||||
Process,
|
||||
|
||||
/// The lifetime artifact is an absolute filename or path.
|
||||
/// The package dependency is implicitly deleted when this is deleted.
|
||||
FilePath,
|
||||
|
||||
/// The lifetime artifact is a registry key in the format
|
||||
/// 'root\\subkey' where root is one of the following: HKLM, HKCU, HKCR, HKU.
|
||||
/// The package dependency is implicitly deleted when this is deleted.
|
||||
RegistryKey,
|
||||
};
|
||||
|
||||
/// Options when 'pinning' a package dependency
|
||||
runtimeclass CreatePackageDependencyOptions
|
||||
{
|
||||
CreatePackageDependencyOptions();
|
||||
|
||||
/// Optional filtering by cpu architecture(s)
|
||||
PackageDependencyProcessorArchitectures Architectures;
|
||||
|
||||
/// Do not verify at least 1 matching package exists when pinning a package dependency
|
||||
/// @note Default value is `true`
|
||||
Boolean VerifyDependencyResolution;
|
||||
|
||||
/// The kind of lifetime artifact for this package dependency.
|
||||
PackageDependencyLifetimeArtifactKind LifetimeArtifactKind;
|
||||
|
||||
/// The lifetime artifact when pinning a package dependency. The value depends on the LifetimeArtifactKind value.
|
||||
String LifetimeArtifact;
|
||||
};
|
||||
|
||||
static runtimeclass PackageDependencyRank
|
||||
{
|
||||
/// The default value is zero (0).
|
||||
static Int32 Default { get; };
|
||||
};
|
||||
|
||||
/// Options when adding a package dependency
|
||||
runtimeclass AddPackageDependencyOptions
|
||||
{
|
||||
AddPackageDependencyOptions();
|
||||
|
||||
/// The rank when adding the package dependency to a a package graph.
|
||||
/// @note A package graph is sorted in ascending order from -infinity...0...+infinity
|
||||
/// @note The default value is PackageDependencyRank.Default
|
||||
Int32 Rank;
|
||||
|
||||
/// If a package dependency is added to a package graph with a package of the same rank (aka a collision on rank)
|
||||
/// and this option is true the resolved package dependency is prepended to the set of packages of the same rank.
|
||||
/// By default resolved package dependencies are appended to the set of packages with the same rank.
|
||||
Boolean PrependIfRankCollision;
|
||||
};
|
||||
|
||||
/// TBD
|
||||
runtimeclass PackageDependency
|
||||
{
|
||||
/// Create an intstance of the package dependency identified by id defined for the current user.
|
||||
///
|
||||
/// @return null if the package dependency cannot be found for the user.
|
||||
///
|
||||
/// @see Create(String, PackageVersion)
|
||||
/// @see Create(String, PackageVersion, CreatePackageDependencyOptions)
|
||||
/// @see GetFromIdForSystem()
|
||||
static PackageDependency GetFromId(String id);
|
||||
|
||||
/// Create an intstance of the package dependency identified by id defined for the system.
|
||||
///
|
||||
/// @return null if the package dependency cannot be found for the system.
|
||||
///
|
||||
/// @see CreateForSystem()
|
||||
/// @see GetFromId()
|
||||
static PackageDependency GetFromIdForSystem(String id);
|
||||
|
||||
/// Return the package dependency id.
|
||||
String Id { get; };
|
||||
|
||||
/// Define a package dependency for the current user. The criteria for a PackageDependency
|
||||
/// (package family name, minimum version, etc) may match multiple
|
||||
/// packages, but ensures Deployment won't remove a package if it's
|
||||
/// the only one satisfying the PackageDependency.
|
||||
///
|
||||
/// @note A package matching a PackageDependency pin can still be removed
|
||||
/// as long as there's another package that satisfies the PackageDependency.
|
||||
/// For example, if Fwk-v1 is installed and a PackageDependency specifies
|
||||
/// MinVersion=1 and then Fwk-v2 is installed, Deployment could remove
|
||||
/// Fwk-v1 because Fwk-v2 will satisfy the PackageDependency. After Fwk-v1
|
||||
/// is removed Deployment won't remove Fwk-v2 because it's the only package
|
||||
/// satisfying the PackageDependency. Thus Fwk-v1 and Fwk-v2 (and any other
|
||||
/// package matching the PackageDependency) are 'loosely pinned'. Deployment
|
||||
/// guarantees it won't remove a package if it would make a PackageDependency
|
||||
/// unsatisfied.
|
||||
///
|
||||
/// A PackageDependency specifies criteria (package family, minimum version, etc)
|
||||
/// and not a specific package. Deployment reserves the right to use a different
|
||||
/// package (e.g. higher version) to satisfy the PackageDependency if/when
|
||||
/// one becomes available.
|
||||
///
|
||||
/// @param packageFamilyName the package family to pin
|
||||
/// @param minVersion the minimum version to pin
|
||||
///
|
||||
/// @note This fails if the package dependency cannot be resolved to a specific package.
|
||||
///
|
||||
/// @see Create(String, PackageVersion, CreatePackageDependencyOptions)
|
||||
/// @see CreateForSystem()
|
||||
static PackageDependency Create(
|
||||
String packageFamilyName,
|
||||
Windows.ApplicationModel.PackageVersion minVersion);
|
||||
|
||||
/// Define a package dependency for the current user. The criteria for a PackageDependency
|
||||
/// (package family name, minimum version, etc) may match multiple
|
||||
/// packages, but ensures Deployment won't remove a package if it's
|
||||
/// the only one satisfying the PackageDependency.
|
||||
///
|
||||
/// @note A package matching a PackageDependency pin can still be removed
|
||||
/// as long as there's another package that satisfies the PackageDependency.
|
||||
/// For example, if Fwk-v1 is installed and a PackageDependency specifies
|
||||
/// MinVersion=1 and then Fwk-v2 is installed, Deployment could remove
|
||||
/// Fwk-v1 because Fwk-v2 will satisfy the PackageDependency. After Fwk-v1
|
||||
/// is removed Deployment won't remove Fwk-v2 because it's the only package
|
||||
/// satisfying the PackageDependency. Thus Fwk-v1 and Fwk-v2 (and any other
|
||||
/// package matching the PackageDependency) are 'loosely pinned'. Deployment
|
||||
/// guarantees it won't remove a package if it would make a PackageDependency
|
||||
/// unsatisfied.
|
||||
///
|
||||
/// A PackageDependency specifies criteria (package family, minimum version, etc)
|
||||
/// and not a specific package. Deployment reserves the right to use a different
|
||||
/// package (e.g. higher version) to satisfy the PackageDependency if/when
|
||||
/// one becomes available.
|
||||
///
|
||||
/// @param packageFamilyName the package family to pin
|
||||
/// @param minVersion the minimum version to pin
|
||||
/// @param options additional options affecting the package dependency
|
||||
///
|
||||
/// @note This fails if the package dependency cannot be resolved to a specific package (null is returned).
|
||||
/// This package resolution check is skipped if MddCreatePackageDependencyOptions.VerifyDependencyResolution=false
|
||||
/// is specified. This is useful if a package satisfying the dependency
|
||||
/// will be installed after the package dependency is defined.
|
||||
///
|
||||
/// @see Create(String, PackageVersion)
|
||||
/// @see CreateForSystem()
|
||||
static PackageDependency Create(
|
||||
String packageFamilyName,
|
||||
Windows.ApplicationModel.PackageVersion minVersion,
|
||||
CreatePackageDependencyOptions options);
|
||||
|
||||
/// Define a package dependency for the system (i.e. all users). The criteria for a PackageDependency
|
||||
/// (package family name, minimum version, etc) may match multiple
|
||||
/// packages, but ensures Deployment won't remove a package if it's
|
||||
/// the only one satisfying the PackageDependency.
|
||||
///
|
||||
/// @note A package matching a PackageDependency pin can still be removed
|
||||
/// as long as there's another package that satisfies the PackageDependency.
|
||||
/// For example, if Fwk-v1 is installed and a PackageDependency specifies
|
||||
/// MinVersion=1 and then Fwk-v2 is installed, Deployment could remove
|
||||
/// Fwk-v1 because Fwk-v2 will satisfy the PackageDependency. After Fwk-v1
|
||||
/// is removed Deployment won't remove Fwk-v2 because it's the only package
|
||||
/// satisfying the PackageDependency. Thus Fwk-v1 and Fwk-v2 (and any other
|
||||
/// package matching the PackageDependency) are 'loosely pinned'. Deployment
|
||||
/// guarantees it won't remove a package if it would make a PackageDependency
|
||||
/// unsatisfied.
|
||||
///
|
||||
/// A PackageDependency specifies criteria (package family, minimum version, etc)
|
||||
/// and not a specific package. Deployment reserves the right to use a different
|
||||
/// package (e.g. higher version) to satisfy the PackageDependency if/when
|
||||
/// one becomes available.
|
||||
///
|
||||
/// @param user the user scope of the package dependency. If null the caller's user context is used
|
||||
/// @param packageFamilyName the package family to pin
|
||||
/// @param minVersion the minimum version to pin
|
||||
/// @param options additional options affecting the package dependency
|
||||
///
|
||||
/// @note This fails if the package dependency cannot be resolved to a specific package.
|
||||
/// This package resolution check is skipped if MddCreatePackageDependencyOptions.VerifyDependencyResolution=false
|
||||
/// is specified. This is useful for installers pinning a package dependency for all users on a system.
|
||||
///
|
||||
/// @see Create(String, PackageVersion)
|
||||
/// @see Create(String, PackageVersion, CreatePackageDependencyOptions)
|
||||
static PackageDependency CreateForSystem(
|
||||
String packageFamilyName,
|
||||
Windows.ApplicationModel.PackageVersion minVersion,
|
||||
CreatePackageDependencyOptions options);
|
||||
|
||||
/// Delete a defined package dependency.
|
||||
/// @note The package depenency id useless after Delete. The property is valid but attempting to use it fails e.g. PackageDependency.GetFromId(id) returns null.
|
||||
void Delete();
|
||||
|
||||
/// Resolve a previously pinned PackageDependency to a specific package and
|
||||
/// add it to the calling process' package graph. Once the dependency has
|
||||
/// been added other code-loading methods (LoadLibrary, CoCreateInstance, etc)
|
||||
/// can find the binaries in the resolved package.
|
||||
///
|
||||
/// Package resolution is specific to a user. The same package dependency can
|
||||
/// resolve to different packages for different users on a system.
|
||||
///
|
||||
/// This adds the resolved package to the process' package graph.
|
||||
/// A process' package graph is used to search for DLLs (per Dynamic-Link Library Search Order),
|
||||
/// WinRT objects and other resources; the caller can now load DLLs, activate
|
||||
/// WinRT objects and use other resources from the framework package until
|
||||
/// PackageDependencyContext.Remove() is called (or the process ends).
|
||||
/// The package dependency Id must match a package dependency defined
|
||||
/// for the calling user or the system (via CreateForSystem) or an exception is raised.
|
||||
///
|
||||
/// Each successful call adds the resolved packaged to the
|
||||
/// calling process' package graph, even if already present. There is no
|
||||
/// duplicate 'detection' or 'filtering' applied by the API (multiple
|
||||
/// references to a package is not harmful). Once resolution is complete
|
||||
/// the package stays resolved for that user until the last reference across
|
||||
/// all processes for that user is removed via PackageDependencyContext.Remove()
|
||||
/// (or process termination).
|
||||
///
|
||||
/// Calls to Add() can be balanced by a PackageDependencyContext.Remove()
|
||||
/// to remove the entry from the package graph.
|
||||
PackageDependencyContext Add();
|
||||
|
||||
/// Resolve a previously pinned PackageDependency to a specific package and
|
||||
/// add it to the calling process' package graph. Once the dependency has
|
||||
/// been added other code-loading methods (LoadLibrary, CoCreateInstance, etc)
|
||||
/// can find the binaries in the resolved package.
|
||||
///
|
||||
/// Package resolution is specific to a user. The same package dependency can
|
||||
/// resolve to different packages for different users on a system.
|
||||
///
|
||||
/// This adds the resolved package to the process' package graph.
|
||||
/// A process' package graph is used to search for DLLs (per Dynamic-Link Library Search Order),
|
||||
/// WinRT objects and other resources; the caller can now load DLLs, activate
|
||||
/// WinRT objects and use other resources from the framework package until
|
||||
/// PackageDependencyContext.Remove() is called (or the process ends).
|
||||
/// The package dependency Id must match a package dependency defined
|
||||
/// for the calling user or the system (via CreateForSystem) or an exception is raised.
|
||||
///
|
||||
/// Each successful call adds the resolved packaged to the
|
||||
/// calling process' package graph, even if already present. There is no
|
||||
/// duplicate 'detection' or 'filtering' applied by the API (multiple
|
||||
/// references to a package is not harmful). Once resolution is complete
|
||||
/// the package stays resolved for that user until the last reference across
|
||||
/// all processes for that user is removed via PackageDependencyContext.Remove()
|
||||
/// (or process termination).
|
||||
///
|
||||
/// This adds the resolved package to the caller's package graph, per rank.
|
||||
/// A process' package graph is a list of packages sorted by rank in ascending
|
||||
/// order (-infinity...0...+infinity). If package(s) are present in the
|
||||
/// package graph with the same rank the resolved package is
|
||||
/// (by default) added after others of the same rank. To add a package
|
||||
/// before others of the same rank, specify PackageDependency.PrependIfRankCollision.
|
||||
///
|
||||
/// Calls to Add() can be balanced by a PackageDependencyContext.Remove() (or object destruction)
|
||||
/// to remove the entry from the package graph.
|
||||
PackageDependencyContext Add(AddPackageDependencyOptions options);
|
||||
};
|
||||
|
||||
/// A unique identifier for a resolved package dependency
|
||||
struct PackageDependencyContextId
|
||||
{
|
||||
UInt64 Id;
|
||||
};
|
||||
|
||||
/// This object provides access to information about a package dependency context.
|
||||
/// The resolved package dependency is removed from the caller's package graph via
|
||||
/// .Remove() or when the object is destroyed.
|
||||
///
|
||||
/// Calling .Remove() or destroying this object is the moral equivalent of Windows' AddDllDirectory().
|
||||
///
|
||||
/// @note This does not unload loaded resources (DLLs etc). After removing
|
||||
/// a package dependency any files loaded from the package can continue
|
||||
/// to be used; future package dependency resolution (via new calls to
|
||||
/// PackageDependency.Add) will fail to see the removed package dependency.
|
||||
runtimeclass PackageDependencyContext
|
||||
{
|
||||
/// Create an intstance of the package dependency context identified by context
|
||||
PackageDependencyContext(PackageDependencyContextId contextId);
|
||||
|
||||
/// Returns the package dependency context id
|
||||
PackageDependencyContextId ContextId { get; };
|
||||
|
||||
/// Return the package dependency id.
|
||||
String PackageDependencyId{ get; };
|
||||
|
||||
/// Returns the package full name of the resolved package for this context
|
||||
String PackageFullName { get; };
|
||||
|
||||
void Remove();
|
||||
};
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#if !defined(MDDCORE_ARCHITECTURE_H)
|
||||
#define MDDCORE_ARCHITECTURE_H
|
||||
|
||||
namespace MddCore
|
||||
{
|
||||
enum class Architecture : int32_t // per PACKAGE_ID.processorArchitecture
|
||||
{
|
||||
X86 = winrt::Windows::System::ProcessorArchitecture::X86, // 0 = PROCESSOR_ARCHITECTURE_INTEL
|
||||
X64 = winrt::Windows::System::ProcessorArchitecture::X64, // 9 = PROCESSOR_ARCHITECTURE_AMD64
|
||||
Arm = winrt::Windows::System::ProcessorArchitecture::Arm, // 5 = PROCESSOR_ARCHITECTURE_ARM
|
||||
Arm64 = winrt::Windows::System::ProcessorArchitecture::Arm64, // 12 = PROCESSOR_ARCHITECTURE_ARM64
|
||||
X86OnArm64 = winrt::Windows::System::ProcessorArchitecture::X86OnArm64, // 14 = PROCESSOR_ARCHITECTURE_IA32_ON_ARM64
|
||||
Neutral = winrt::Windows::System::ProcessorArchitecture::Neutral, // 11 = PROCESSOR_ARCHITECTURE_NEUTRAL
|
||||
Unknown = winrt::Windows::System::ProcessorArchitecture::Unknown, // 0xFFFF = PROCESSOR_ARCHITECTURE_UNKNOWN
|
||||
};
|
||||
}
|
||||
|
||||
#endif // MDDCORE_ARCHITECTURE_H
|
|
@ -0,0 +1,104 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "MddDetourPackageGraph.h"
|
||||
|
||||
#include "PackageGraphManager.h"
|
||||
|
||||
#include <../Detours/detours.h>
|
||||
|
||||
// Windows provides HRESULT_FROM_WIN32() but not the reverse. We need that for compat reasons.
|
||||
// Define WIN32_FROM_HRESULT() to covert an HRESULT to a Win32 Error Code if the HRESULT's facility
|
||||
// is FACILITY_WIN32. See https://devblogs.microsoft.com/oldnewthing/20061103-07/?p=29133 for more details
|
||||
#if !defined(WIN32_FROM_HRESULT)
|
||||
inline DWORD Win32FromHResult(const HRESULT hr)
|
||||
{
|
||||
if (HRESULT_FACILITY(hr) == FACILITY_WIN32)
|
||||
{
|
||||
return static_cast<DWORD>(HRESULT_CODE(hr));
|
||||
}
|
||||
else
|
||||
{
|
||||
return static_cast<DWORD>(hr);
|
||||
}
|
||||
}
|
||||
#define WIN32_FROM_HRESULT(hr) Win32FromHResult(hr)
|
||||
#endif
|
||||
|
||||
static LONG (WINAPI* TrueGetCurrentPackageInfo)(
|
||||
const UINT32 flags,
|
||||
UINT32* bufferLength,
|
||||
BYTE* buffer,
|
||||
UINT32* count) = GetCurrentPackageInfo;
|
||||
|
||||
LONG WINAPI DynamicGetCurrentPackageInfo(
|
||||
const UINT32 flags,
|
||||
UINT32* bufferLength,
|
||||
BYTE* buffer,
|
||||
UINT32* count);
|
||||
|
||||
static LONG (WINAPI* TrueGetCurrentPackageInfo2)(
|
||||
const UINT32 flags,
|
||||
PackagePathType packagePathType,
|
||||
UINT32* bufferLength,
|
||||
BYTE* buffer,
|
||||
UINT32* count) = GetCurrentPackageInfo2;
|
||||
|
||||
LONG WINAPI DynamicGetCurrentPackageInfo2(
|
||||
const UINT32 flags,
|
||||
PackagePathType packagePathType,
|
||||
UINT32* bufferLength,
|
||||
BYTE* buffer,
|
||||
UINT32* count);
|
||||
|
||||
HRESULT WINAPI MddDetourPackageGraphInitialize() noexcept
|
||||
{
|
||||
// Detour package graph APIs to our implementation
|
||||
FAIL_FAST_IF_WIN32_ERROR(DetourUpdateThread(GetCurrentThread()));
|
||||
FAIL_FAST_IF_WIN32_ERROR(DetourAttach(&(PVOID&)TrueGetCurrentPackageInfo, DynamicGetCurrentPackageInfo));
|
||||
FAIL_FAST_IF_WIN32_ERROR(DetourAttach(&(PVOID&)TrueGetCurrentPackageInfo2, DynamicGetCurrentPackageInfo2));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT _MddDetourPackageGraphShutdown() noexcept
|
||||
{
|
||||
// Stop Detour'ing package graph APIs to our implementation
|
||||
FAIL_FAST_IF_WIN32_ERROR(DetourDetach(&(PVOID&)TrueGetCurrentPackageInfo, DynamicGetCurrentPackageInfo));
|
||||
FAIL_FAST_IF_WIN32_ERROR(DetourDetach(&(PVOID&)TrueGetCurrentPackageInfo2, DynamicGetCurrentPackageInfo2));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void WINAPI MddDetourPackageGraphShutdown() noexcept
|
||||
{
|
||||
_MddDetourPackageGraphShutdown();
|
||||
}
|
||||
|
||||
LONG WINAPI DynamicGetCurrentPackageInfo(
|
||||
const UINT32 flags,
|
||||
UINT32* bufferLength,
|
||||
BYTE* buffer,
|
||||
UINT32* count)
|
||||
{
|
||||
return DynamicGetCurrentPackageInfo2(flags, PackagePathType_Install, bufferLength, buffer, count);
|
||||
}
|
||||
|
||||
LONG WINAPI DynamicGetCurrentPackageInfo2(
|
||||
const UINT32 flags,
|
||||
PackagePathType packagePathType,
|
||||
UINT32* bufferLength,
|
||||
BYTE* buffer,
|
||||
UINT32* count)
|
||||
{
|
||||
return WIN32_FROM_HRESULT(MddCore::PackageGraphManager::GetCurrentPackageInfo2(flags, packagePathType, bufferLength, buffer, count, TrueGetCurrentPackageInfo2));
|
||||
}
|
||||
|
||||
LONG WINAPI GetCurrentStaticPackageInfo(
|
||||
const UINT32 flags,
|
||||
UINT32* bufferLength,
|
||||
BYTE* buffer,
|
||||
UINT32* count) noexcept
|
||||
{
|
||||
return TrueGetCurrentPackageInfo(flags, bufferLength, buffer, count);
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#if !defined(MDDDETOURPACKAGEGRAPH_H)
|
||||
#define MDDDETOURPACKAGEGRAPH_H
|
||||
|
||||
HRESULT WINAPI MddDetourPackageGraphInitialize() noexcept;
|
||||
|
||||
void WINAPI MddDetourPackageGraphShutdown() noexcept;
|
||||
|
||||
LONG WINAPI GetCurrentStaticPackageInfo(
|
||||
const UINT32 flags,
|
||||
UINT32* bufferLength,
|
||||
BYTE* buffer,
|
||||
UINT32* count) noexcept;
|
||||
|
||||
#endif // MDDDETOURPACKAGEGRAPH_H
|
|
@ -0,0 +1,54 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "MddWinRT.h"
|
||||
|
||||
#include "WinRTModuleManager.h"
|
||||
|
||||
HRESULT MddCore::WinRT::ToThreadingType(
|
||||
MddCore::WinRT::ThreadingModel threadingModel,
|
||||
ABI::Windows::Foundation::ThreadingType& threadingType,
|
||||
HRESULT errorIfUnknown) noexcept
|
||||
{
|
||||
if (threadingModel == MddCore::WinRT::ThreadingModel::Both)
|
||||
{
|
||||
threadingType = ABI::Windows::Foundation::ThreadingType::ThreadingType_BOTH;
|
||||
}
|
||||
else if (threadingModel == MddCore::WinRT::ThreadingModel::STA)
|
||||
{
|
||||
threadingType = ABI::Windows::Foundation::ThreadingType::ThreadingType_STA;
|
||||
}
|
||||
else if (threadingModel == MddCore::WinRT::ThreadingModel::MTA)
|
||||
{
|
||||
threadingType = ABI::Windows::Foundation::ThreadingType::ThreadingType_MTA;
|
||||
}
|
||||
else
|
||||
{
|
||||
RETURN_HR_MSG(errorIfUnknown, "Unknown MddCore::WinRT::ThreadingModel %d", static_cast<int>(threadingModel));
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT MddCore::WinRT::GetThreadingModel(
|
||||
HSTRING className,
|
||||
ABI::Windows::Foundation::ThreadingType& threadingType) noexcept try
|
||||
{
|
||||
if (!MddCore::WinRTModuleManager::GetThreadingType(className, threadingType))
|
||||
{
|
||||
return REGDB_E_CLASSNOTREG;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
CATCH_RETURN();
|
||||
|
||||
HRESULT MddCore::WinRT::GetActivationFactory(
|
||||
HSTRING className,
|
||||
REFIID iid,
|
||||
void** factory) noexcept try
|
||||
{
|
||||
*factory = MddCore::WinRTModuleManager::GetActivationFactory(className, iid);
|
||||
return S_OK;
|
||||
}
|
||||
CATCH_RETURN();
|
|
@ -0,0 +1,38 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#if !defined(MDDWINRT_H)
|
||||
#define MDDWINRT_H
|
||||
|
||||
#include <activationregistration.h>
|
||||
|
||||
namespace MddCore::WinRT
|
||||
{
|
||||
enum class ThreadingModel
|
||||
{
|
||||
Unknown,
|
||||
Both,
|
||||
STA,
|
||||
MTA
|
||||
};
|
||||
|
||||
static_assert(static_cast<int>(MddCore::WinRT::ThreadingModel::Both) == static_cast<int>(ABI::Windows::Foundation::ThreadingType::ThreadingType_BOTH) + 1);
|
||||
static_assert(static_cast<int>(MddCore::WinRT::ThreadingModel::STA) == static_cast<int>(ABI::Windows::Foundation::ThreadingType::ThreadingType_STA) + 1);
|
||||
static_assert(static_cast<int>(MddCore::WinRT::ThreadingModel::MTA) == static_cast<int>(ABI::Windows::Foundation::ThreadingType::ThreadingType_MTA) + 1);
|
||||
|
||||
HRESULT ToThreadingType(
|
||||
MddCore::WinRT::ThreadingModel threadingModel,
|
||||
ABI::Windows::Foundation::ThreadingType& threadingType,
|
||||
HRESULT errorIfUnknown = REGDB_E_CLASSNOTREG) noexcept;
|
||||
|
||||
HRESULT GetThreadingModel(
|
||||
HSTRING className,
|
||||
ABI::Windows::Foundation::ThreadingType& threading_model) noexcept;
|
||||
|
||||
HRESULT GetActivationFactory(
|
||||
HSTRING className,
|
||||
REFIID iid,
|
||||
void** factory) noexcept;
|
||||
}
|
||||
|
||||
#endif // MDDWINRT_H
|
|
@ -0,0 +1,121 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "msixdynamicdependency.h"
|
||||
|
||||
#include "MddDetourPackageGraph.h"
|
||||
#include "PackageDependencyManager.h"
|
||||
#include "PackageGraphManager.h"
|
||||
|
||||
namespace MddCore
|
||||
{
|
||||
bool IsStaticPackageGraphEmpty()
|
||||
{
|
||||
// Check the static package graph
|
||||
UINT32 n = 0;
|
||||
const auto rc{ GetCurrentStaticPackageInfo(PACKAGE_FILTER_HEAD, &n, nullptr, nullptr) };
|
||||
(void) LOG_HR_IF_MSG(HRESULT_FROM_WIN32(rc), (rc != APPMODEL_ERROR_NO_PACKAGE) && (rc != ERROR_INSUFFICIENT_BUFFER), "GetCurrentStaticPackageInfo rc=%d", rc);
|
||||
return rc == APPMODEL_ERROR_NO_PACKAGE;
|
||||
}
|
||||
}
|
||||
|
||||
STDAPI MddTryCreatePackageDependency(
|
||||
PSID user,
|
||||
_In_ PCWSTR packageFamilyName,
|
||||
PACKAGE_VERSION minVersion,
|
||||
MddPackageDependencyProcessorArchitectures packageDependencyProcessorArchitectures,
|
||||
MddPackageDependencyLifetimeKind lifetimeKind,
|
||||
PCWSTR lifetimeArtifact,
|
||||
MddCreatePackageDependencyOptions options,
|
||||
_Outptr_result_maybenull_ PWSTR* packageDependencyId) noexcept try
|
||||
{
|
||||
*packageDependencyId = nullptr;
|
||||
|
||||
// Dynamic Dependencies requires a non-packaged process
|
||||
RETURN_HR_IF(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), !MddCore::IsStaticPackageGraphEmpty());
|
||||
|
||||
MddCore::PackageDependencyManager::CreatePackageDependency(user, packageFamilyName, minVersion, packageDependencyProcessorArchitectures, lifetimeKind, lifetimeArtifact, options, packageDependencyId);
|
||||
return S_OK;
|
||||
}
|
||||
CATCH_RETURN();
|
||||
|
||||
STDAPI_(void) MddDeletePackageDependency(
|
||||
_In_ PCWSTR packageDependencyId) noexcept try
|
||||
{
|
||||
// Dynamic Dependencies requires a non-packaged process
|
||||
THROW_HR_IF(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), !MddCore::IsStaticPackageGraphEmpty());
|
||||
|
||||
MddCore::PackageDependencyManager::DeletePackageDependency(packageDependencyId);
|
||||
}
|
||||
CATCH_LOG();
|
||||
|
||||
STDAPI MddAddPackageDependency(
|
||||
_In_ PCWSTR packageDependencyId,
|
||||
INT32 rank,
|
||||
MddAddPackageDependencyOptions options,
|
||||
_Out_ MDD_PACKAGEDEPENDENCY_CONTEXT* packageDependencyContext,
|
||||
_Outptr_opt_result_maybenull_ PWSTR* packageFullName) noexcept try
|
||||
{
|
||||
*packageDependencyContext = nullptr;
|
||||
if (packageFullName)
|
||||
{
|
||||
*packageFullName = nullptr;
|
||||
}
|
||||
|
||||
// Dynamic Dependencies requires a non-packaged process
|
||||
RETURN_HR_IF(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), !MddCore::IsStaticPackageGraphEmpty());
|
||||
|
||||
RETURN_IF_FAILED(MddCore::PackageGraphManager::AddToPackageGraph(packageDependencyId, rank, options, packageDependencyContext, packageFullName));
|
||||
return S_OK;
|
||||
}
|
||||
CATCH_RETURN();
|
||||
|
||||
STDAPI_(void) MddRemovePackageDependency(
|
||||
_In_ MDD_PACKAGEDEPENDENCY_CONTEXT packageDependencyContext) noexcept try
|
||||
{
|
||||
// Dynamic Dependencies requires a non-packaged process
|
||||
LOG_HR_IF(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), !MddCore::IsStaticPackageGraphEmpty());
|
||||
|
||||
MddCore::PackageGraphManager::RemoveFromPackageGraph(packageDependencyContext);
|
||||
}
|
||||
CATCH_LOG();
|
||||
|
||||
STDAPI MddGetResolvedPackageFullNameForPackageDependency(
|
||||
_In_ PCWSTR packageDependencyId,
|
||||
_Outptr_result_maybenull_ PWSTR* packageFullName) noexcept try
|
||||
{
|
||||
*packageFullName = nullptr;
|
||||
|
||||
// Dynamic Dependencies requires a non-packaged process
|
||||
RETURN_HR_IF(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), !MddCore::IsStaticPackageGraphEmpty());
|
||||
|
||||
RETURN_HR_IF(E_INVALIDARG, !packageDependencyId || (packageDependencyId[0] == L'\0'));
|
||||
|
||||
wil::unique_process_heap_string fullName;
|
||||
RETURN_IF_FAILED(MddCore::PackageGraphManager::ResolvePackageDependency(packageDependencyId, MddAddPackageDependencyOptions::None, fullName));
|
||||
|
||||
*packageFullName = fullName.release();
|
||||
return S_OK;
|
||||
}
|
||||
CATCH_RETURN();
|
||||
|
||||
STDAPI MddGetIdForPackageDependencyContext(
|
||||
_In_ MDD_PACKAGEDEPENDENCY_CONTEXT packageDependencyContext,
|
||||
_Outptr_result_maybenull_ PWSTR* packageDependencyId) noexcept try
|
||||
{
|
||||
*packageDependencyId = nullptr;
|
||||
|
||||
// Dynamic Dependencies requires a non-packaged process
|
||||
RETURN_HR_IF(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), !MddCore::IsStaticPackageGraphEmpty());
|
||||
|
||||
RETURN_HR_IF(E_INVALIDARG, !packageDependencyContext);
|
||||
|
||||
wil::unique_process_heap_string id;
|
||||
RETURN_IF_FAILED(MddCore::PackageGraphManager::GetPackageDependencyForContext(packageDependencyContext, id));
|
||||
|
||||
*packageDependencyId = id.release();
|
||||
return S_OK;
|
||||
}
|
||||
CATCH_RETURN();
|
|
@ -0,0 +1,190 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#if !defined(MSIXDYNAMICDEPENDENCY_H)
|
||||
#define MSIXDYNAMICDEPENDENCY_H
|
||||
|
||||
#include <appmodel.h>
|
||||
|
||||
enum class MddCreatePackageDependencyOptions : uint32_t
|
||||
{
|
||||
None = 0,
|
||||
|
||||
/// Disable dependency resolution when pinning a package dependency.
|
||||
DoNotVerifyDependencyResolution = 0x00000001,
|
||||
|
||||
/// Define the package dependency for the system, accessible to all users
|
||||
/// (default is the package dependency is defined for a specific user).
|
||||
/// This option requires the caller has adminitrative privileges.
|
||||
ScopeIsSystem = 0x00000002,
|
||||
};
|
||||
DEFINE_ENUM_FLAG_OPERATORS(MddCreatePackageDependencyOptions)
|
||||
|
||||
enum class MddPackageDependencyLifetimeKind
|
||||
{
|
||||
/// The current process is the lifetime artifact. The package dependency
|
||||
/// is implicitly deleted when the process terminates.
|
||||
Process = 0,
|
||||
|
||||
/// The lifetime artifact is an absolute filename or path.
|
||||
/// The package dependency is implicitly deleted when this is deleted.
|
||||
FilePath = 1,
|
||||
|
||||
/// The lifetime artifact is a registry key in the format
|
||||
/// 'root\\subkey' where root is one of the following: HKLM, HKCU, HKCR, HKU.
|
||||
/// The package dependency is implicitly deleted when this is deleted.
|
||||
RegistryKey = 2,
|
||||
};
|
||||
|
||||
enum class MddAddPackageDependencyOptions : uint32_t
|
||||
{
|
||||
None = 0,
|
||||
PrependIfRankCollision = 0x00000001,
|
||||
};
|
||||
DEFINE_ENUM_FLAG_OPERATORS(MddAddPackageDependencyOptions)
|
||||
|
||||
#define MDD_PACKAGE_DEPENDENCY_RANK_DEFAULT 0
|
||||
|
||||
enum class MddPackageDependencyProcessorArchitectures : uint32_t
|
||||
{
|
||||
None = 0,
|
||||
Neutral = 0x00000001,
|
||||
X86 = 0x00000002,
|
||||
X64 = 0x00000004,
|
||||
Arm = 0x00000008,
|
||||
Arm64 = 0x00000010,
|
||||
X86OnArm64 = 0x00000020,
|
||||
};
|
||||
DEFINE_ENUM_FLAG_OPERATORS(MddPackageDependencyProcessorArchitectures)
|
||||
|
||||
DECLARE_HANDLE(MDD_PACKAGEDEPENDENCY_CONTEXT);
|
||||
|
||||
/// Define a package dependency. The criteria for a PackageDependency
|
||||
/// (package family name, minimum version, etc)
|
||||
/// may match multiple packages, but ensures Deployment won't remove
|
||||
/// a package if it's the only one satisfying the PackageDependency.
|
||||
///
|
||||
/// @note A package matching a PackageDependency pin can still be removed
|
||||
/// as long as there's another package that satisfies the PackageDependency.
|
||||
/// For example, if Fwk-v1 is installed and a PackageDependency specifies
|
||||
/// MinVersion=1 and then Fwk-v2 is installed, Deployment could remove
|
||||
/// Fwk-v1 because Fwk-v2 will satisfy the PackageDependency. After Fwk-v1
|
||||
/// is removed Deployment won't remove Fwk-v2 because it's the only package
|
||||
/// satisfying the PackageDependency. Thus Fwk-v1 and Fwk-v2 (and any other
|
||||
/// package matching the PackageDependency) are 'loosely pinned'. Deployment
|
||||
/// guarantees it won't remove a package if it would make a PackageDependency
|
||||
/// unsatisfied.
|
||||
///
|
||||
/// A PackageDependency specifies criteria (package family, minimum version, etc)
|
||||
/// and not a specific package. Deployment reserves the right to use a different
|
||||
/// package (e.g. higher version) to satisfy the PackageDependency if/when
|
||||
/// one becomes available.
|
||||
///
|
||||
/// @param user the user scope of the package dependency. If NULL the caller's
|
||||
/// user context is used. MUST be NULL if MddCreatePackageDependencyOptions::ScopeIsSystem
|
||||
/// is specified
|
||||
/// @param lifetimeArtifact MUST be NULL if lifetimeKind=MddPackageDependencyLifetimeKind::Process
|
||||
/// @param packageDependencyId allocated via HeapAlloc; use HeapFree to deallocate
|
||||
///
|
||||
/// @note MddTryCreatePackageDependency() fails if the PackageDependency cannot be resolved to a specific
|
||||
/// package. This package resolution check is skipped if
|
||||
/// MddCreatePackageDependencyOptions::DoNotVerifyDependencyResolution is specified. This is useful
|
||||
/// for installers running as user contexts other than the target user (e.g. installers
|
||||
/// running as LocalSystem).
|
||||
STDAPI MddTryCreatePackageDependency(
|
||||
PSID user,
|
||||
_In_ PCWSTR packageFamilyName,
|
||||
PACKAGE_VERSION minVersion,
|
||||
MddPackageDependencyProcessorArchitectures packageDependencyProcessorArchitectures,
|
||||
MddPackageDependencyLifetimeKind lifetimeKind,
|
||||
PCWSTR lifetimeArtifact,
|
||||
MddCreatePackageDependencyOptions options,
|
||||
_Outptr_result_maybenull_ PWSTR* packageDependencyId) noexcept;
|
||||
|
||||
/// Undefine a package dependency. Removing a pin on a PackageDependency is typically done at uninstall-time.
|
||||
/// This implicitly occurs if the package dependency's 'lifetime artifact' (specified via MddTryCreatePackageDependency)
|
||||
/// is deleted. Packages that are not referenced by other packages and have no pins are elegible to be removed.
|
||||
///
|
||||
/// @warn MddDeletePackageDependency() requires the caller have administrative privileges
|
||||
/// if the package dependency was pinned with MddCreatePackageDependencyOptions::ScopeIsSystem.
|
||||
STDAPI_(void) MddDeletePackageDependency(
|
||||
_In_ PCWSTR packageDependencyId) noexcept;
|
||||
|
||||
/// Resolve a previously-pinned PackageDependency to a specific package and
|
||||
/// add it to the invoking process' package graph. Once the dependency has
|
||||
/// been added other code-loading methods (LoadLibrary, CoCreateInstance, etc)
|
||||
/// can find the binaries in the resolved package.
|
||||
///
|
||||
/// Package resolution is specific to a user and can return different values
|
||||
/// for different users on a system.
|
||||
///
|
||||
/// Each successful MddAddPackageDependency() adds the resolved packaged to the
|
||||
/// calling process' package graph, even if already present. There is no
|
||||
/// duplicate 'detection' or 'filtering' applied by the API (multiple
|
||||
/// references from a package is not harmful). Once resolution is complete
|
||||
/// the package dependency stays resolved for that user until the last reference across
|
||||
/// all processes for that user is removed via MddRemovePackageDependency (or
|
||||
/// process termination).
|
||||
///
|
||||
/// MddAddPackageDependency() adds the resolved package to the caller's package graph,
|
||||
/// per the rank specified. A process' package graph is a list of packages sorted by
|
||||
/// rank in ascending order (-infinity...0...+infinity). If package(s) are present in the
|
||||
/// package graph with the same rank as the call to MddAddPackageDependency the resolved
|
||||
/// package is (by default) added after others of the same rank. To add a package
|
||||
/// before others o the same rank, specify MddAddPackageDependencyOptions::PrependIfRankCollision.
|
||||
///
|
||||
/// Every MddAddPackageDependency can be balanced by a MddRemovePackageDependency
|
||||
/// to remove the entry from the package graph. If the process terminates all package
|
||||
/// references are removed, but any pins stay behind.
|
||||
///
|
||||
/// MddAddPackageDependency adds the resolved package to the process' package
|
||||
/// graph, per the rank and options parameters. The process' package
|
||||
/// graph is used to search for DLLs (per Dynamic-Link Library Search Order),
|
||||
/// WinRT objects and other resources; the caller can now load DLLs, activate
|
||||
/// WinRT objects and use other resources from the framework package until
|
||||
/// MddRemovePackageDependency is called. The packageDependencyId parameter
|
||||
/// must match a package dependency defined for the calling user or the
|
||||
/// system (i.e. pinned with MddCreatePackageDependencyOptions::ScopeIsSystem) else
|
||||
/// an error is returned.
|
||||
///
|
||||
/// @param packageDependencyContext valid until passed to MddRemovePackageDependency()
|
||||
/// @param packageFullName allocated via HeapAlloc; use HeapFree to deallocate
|
||||
STDAPI MddAddPackageDependency(
|
||||
_In_ PCWSTR packageDependencyId,
|
||||
INT32 rank,
|
||||
MddAddPackageDependencyOptions options,
|
||||
_Out_ MDD_PACKAGEDEPENDENCY_CONTEXT* packageDependencyContext,
|
||||
_Outptr_opt_result_maybenull_ PWSTR* packageFullName) noexcept;
|
||||
|
||||
/// Remove a resolved PackageDependency from the current process' package graph
|
||||
/// (i.e. undo MddAddPackageDependency). Used at runtime (i.e. the moral equivalent
|
||||
/// of Windows' RemoveDllDirectory()).
|
||||
///
|
||||
/// @note This does not unload loaded resources (DLLs etc). After removing
|
||||
/// a package dependency any files loaded from the package can continue
|
||||
/// to be used; future file resolution will fail to see the removed
|
||||
/// package dependency.
|
||||
STDAPI_(void) MddRemovePackageDependency(
|
||||
_In_ MDD_PACKAGEDEPENDENCY_CONTEXT packageDependencyContext) noexcept;
|
||||
|
||||
/// Return the package full name that would be used if the
|
||||
/// PackageDependency were to be resolved. Does not add the
|
||||
/// package to the process graph.
|
||||
///
|
||||
/// @param packageFullName allocated via HeapAlloc; use HeapFree to deallocate.
|
||||
/// If the package dependency cannot be resolved the function
|
||||
/// succeeds but packageFullName is nullptr.
|
||||
STDAPI MddGetResolvedPackageFullNameForPackageDependency(
|
||||
_In_ PCWSTR packageDependencyId,
|
||||
_Outptr_result_maybenull_ PWSTR* packageFullName) noexcept;
|
||||
|
||||
/// Return the package dependency for the context.
|
||||
///
|
||||
/// @param packageDependencyId allocated via HeapAlloc; use HeapFree to deallocate.
|
||||
/// If the package dependency context cannot be resolved
|
||||
/// the function succeeds but packageDependencyId is nullptr.
|
||||
STDAPI MddGetIdForPackageDependencyContext(
|
||||
_In_ MDD_PACKAGEDEPENDENCY_CONTEXT packageDependencyContext,
|
||||
_Outptr_result_maybenull_ PWSTR* packageDependencyId) noexcept;
|
||||
|
||||
#endif // MSIXDYNAMICDEPENDENCY_H
|
|
@ -0,0 +1,199 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "utf8.h"
|
||||
|
||||
#include "PackageDependency.h"
|
||||
|
||||
namespace JSON = winrt::Windows::Data::Json;
|
||||
|
||||
void MddCore::PackageDependency::GenerateId()
|
||||
{
|
||||
GUID id{};
|
||||
THROW_IF_FAILED(CoCreateGuid(&id));
|
||||
const size_t idAsStringLength{ ARRAYSIZE(L"{33221100-5544-7766-8899-aabbccddeeff}") - 1 };
|
||||
WCHAR idAsString[idAsStringLength + 1]{};
|
||||
FAIL_FAST_HR_IF(HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), StringFromGUID2(id, idAsString, idAsStringLength + 1) != idAsStringLength + 1);
|
||||
idAsString[idAsStringLength - 1] = L'\0';
|
||||
m_packageDependencyId.assign(idAsString + 1);
|
||||
}
|
||||
|
||||
std::vector<std::wstring> MddCore::PackageDependency::FindPackagesByFamily() const
|
||||
{
|
||||
UINT32 count{};
|
||||
UINT32 bufferLength{};
|
||||
const LONG rc{ FindPackagesByPackageFamily(m_packageFamilyName.c_str(), PACKAGE_FILTER_HEAD | PACKAGE_FILTER_DIRECT, &count, nullptr, &bufferLength, nullptr, nullptr) };
|
||||
if (rc == ERROR_SUCCESS)
|
||||
{
|
||||
// The package family has no packages registered to the user
|
||||
return std::vector<std::wstring>();
|
||||
}
|
||||
else if (rc != ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
THROW_WIN32(rc);
|
||||
}
|
||||
|
||||
auto packageFullNames{ wil::make_unique_cotaskmem<PWSTR[]>(count) };
|
||||
auto buffer{ wil::make_unique_cotaskmem<WCHAR[]>(bufferLength) };
|
||||
THROW_IF_WIN32_ERROR(FindPackagesByPackageFamily(m_packageFamilyName.c_str(), PACKAGE_FILTER_HEAD | PACKAGE_FILTER_DIRECT, &count, packageFullNames.get(), &bufferLength, buffer.get(), nullptr));
|
||||
|
||||
std::vector<std::wstring> packageFullNamesList;
|
||||
auto packageFullName{ *packageFullNames.get() };
|
||||
for (UINT32 index=0; index < count; ++index, ++packageFullName)
|
||||
{
|
||||
packageFullNamesList.push_back(std::wstring(packageFullName));
|
||||
}
|
||||
return packageFullNamesList;
|
||||
}
|
||||
|
||||
std::wstring MddCore::PackageDependency::ToJSON() const
|
||||
{
|
||||
JSON::JsonObject json;
|
||||
json.SetNamedValue(winrt::hstring(L"PackageFamilyName"), JSON::JsonValue::CreateStringValue(winrt::hstring(m_packageFamilyName)));
|
||||
json.SetNamedValue(winrt::hstring(L"MinVersion"), JSON::JsonValue::CreateStringValue(winrt::hstring(std::to_wstring(m_minVersion.Version))));
|
||||
json.SetNamedValue(winrt::hstring(L"ProcessorArchitectures"), JSON::JsonValue::CreateStringValue(std::wstring(L"0x") + std::to_wstring(static_cast<uint32_t>(m_packageDependencyProcessorArchitectures))));
|
||||
json.SetNamedValue(winrt::hstring(L"LifetimeKind"), JSON::JsonValue::CreateStringValue(winrt::hstring(ToString(m_lifetimeKind))));
|
||||
json.SetNamedValue(winrt::hstring(L"LifetimeArtifact"), JSON::JsonValue::CreateStringValue(winrt::hstring(m_lifetimeArtifact)));
|
||||
json.SetNamedValue(winrt::hstring(L"Options"), JSON::JsonValue::CreateStringValue(std::wstring(L"0x") + std::to_wstring(static_cast<uint32_t>(m_options))));
|
||||
return std::wstring(json.ToString());
|
||||
}
|
||||
|
||||
std::string MddCore::PackageDependency::ToJSONUtf8() const
|
||||
{
|
||||
return to_utf8(ToJSON());
|
||||
}
|
||||
|
||||
MddCore::PackageDependency MddCore::PackageDependency::FromJSON(const winrt::hstring& json)
|
||||
{
|
||||
MddCore::PackageDependency packageDependency;
|
||||
|
||||
JSON::JsonObject object{ JSON::JsonObject::Parse(json) };
|
||||
packageDependency.m_packageFamilyName = object.GetNamedString(winrt::hstring(L"PackageFamilyName"));
|
||||
packageDependency.m_minVersion = PACKAGE_VERSION{ uint64_from_string(object.GetNamedString(winrt::hstring(L"MinVersion")).c_str()) };
|
||||
packageDependency.m_packageDependencyProcessorArchitectures = static_cast<MddPackageDependencyProcessorArchitectures>(uint32_from_string(object.GetNamedString(winrt::hstring(L"ProcessorArchitectures")).c_str()));
|
||||
packageDependency.LifetimeKind(object.GetNamedString(winrt::hstring(L"LifetimeKind")));
|
||||
packageDependency.m_lifetimeArtifact = object.GetNamedString(winrt::hstring(L"LifetimeArtifact"));
|
||||
packageDependency.m_options = static_cast<MddCreatePackageDependencyOptions>(uint32_from_string(object.GetNamedString(winrt::hstring(L"Options")).c_str()));
|
||||
|
||||
return packageDependency;
|
||||
}
|
||||
|
||||
MddCore::PackageDependency MddCore::PackageDependency::FromJSON(PCSTR jsonUtf8)
|
||||
{
|
||||
return FromJSON(utf8_to_hstring(jsonUtf8));
|
||||
}
|
||||
|
||||
bool MddCore::PackageDependency::IsExpired() const
|
||||
{
|
||||
switch (m_lifetimeKind)
|
||||
{
|
||||
case MddPackageDependencyLifetimeKind::Process:
|
||||
return false;
|
||||
case MddPackageDependencyLifetimeKind::FilePath:
|
||||
return !std::filesystem::exists(m_lifetimeArtifact);
|
||||
case MddPackageDependencyLifetimeKind::RegistryKey:
|
||||
return !IsRegistryKeyExists(m_lifetimeArtifact);
|
||||
default:
|
||||
FAIL_FAST_HR(E_UNEXPECTED);
|
||||
}
|
||||
}
|
||||
|
||||
bool MddCore::PackageDependency::IsRegistryKeyExists(
|
||||
const std::wstring& key)
|
||||
{
|
||||
PCWSTR subkey{};
|
||||
auto root{ ParseRegistryKey(key, subkey) };
|
||||
|
||||
wil::unique_hkey hkey;
|
||||
auto rc{ ::RegOpenKeyExW(root, subkey, 0, KEY_READ, wil::out_param(hkey)) };
|
||||
if (rc == ERROR_SUCCESS)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if ((rc == ERROR_FILE_NOT_FOUND) || (rc == ERROR_PATH_NOT_FOUND))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
THROW_HR_MSG(HRESULT_FROM_WIN32(rc), "RegOpenKey failed %d", rc);
|
||||
}
|
||||
|
||||
HKEY MddCore::PackageDependency::ParseRegistryKey(
|
||||
const std::wstring& key,
|
||||
PCWSTR& subkey)
|
||||
{
|
||||
size_t offset{};
|
||||
auto root{ ParseRegistryKey(key, offset) };
|
||||
subkey = key.c_str() + offset;
|
||||
return root;
|
||||
}
|
||||
|
||||
HKEY MddCore::PackageDependency::ParseRegistryKey(
|
||||
const std::wstring& key,
|
||||
size_t& offsetToSubkey)
|
||||
{
|
||||
HKEY root{};
|
||||
auto offset{ key.find(L'\\') };
|
||||
THROW_HR_IF_MSG(E_INVALIDARG, offset == std::wstring::npos, "Invalid RegistryKey %ls", key.c_str());
|
||||
THROW_HR_IF_MSG(E_INVALIDARG, offset == 0, "Invalid RegistryKey %ls", key.c_str());
|
||||
auto prefix{ key.substr(0, offset) };
|
||||
if (prefix == L"HKCR")
|
||||
{
|
||||
root = HKEY_CLASSES_ROOT;
|
||||
}
|
||||
else if (prefix == L"HKCU")
|
||||
{
|
||||
root = HKEY_CURRENT_USER;
|
||||
}
|
||||
else if (prefix == L"HKLM")
|
||||
{
|
||||
root = HKEY_LOCAL_MACHINE;
|
||||
}
|
||||
else if (prefix == L"HKU")
|
||||
{
|
||||
root = HKEY_USERS;
|
||||
}
|
||||
else
|
||||
{
|
||||
THROW_HR_MSG(E_INVALIDARG, "Invalid RegistryKey %ls", key.c_str());
|
||||
}
|
||||
THROW_HR_IF_MSG(E_INVALIDARG, key.length() == prefix.length(), "Invalid RegistryKey %ls", key.c_str());
|
||||
|
||||
offsetToSubkey = ++offset;
|
||||
return root;
|
||||
}
|
||||
|
||||
winrt::hstring MddCore::PackageDependency::ToString(const MddPackageDependencyLifetimeKind lifetimeKind)
|
||||
{
|
||||
switch (lifetimeKind)
|
||||
{
|
||||
case MddPackageDependencyLifetimeKind::Process: return winrt::hstring(L"Process");
|
||||
case MddPackageDependencyLifetimeKind::FilePath: return winrt::hstring(L"FilePath");
|
||||
case MddPackageDependencyLifetimeKind::RegistryKey: return winrt::hstring(L"RegistryKey");
|
||||
default: FAIL_FAST_HR(E_UNEXPECTED);
|
||||
}
|
||||
}
|
||||
|
||||
void MddCore::PackageDependency::LifetimeKind(const winrt::hstring& lifetimeKind)
|
||||
{
|
||||
auto s{ lifetimeKind.c_str() };
|
||||
if (CompareStringOrdinal(s, -1, L"Process", -1, TRUE) == CSTR_EQUAL)
|
||||
{
|
||||
m_lifetimeKind = MddPackageDependencyLifetimeKind::Process;
|
||||
}
|
||||
else if (CompareStringOrdinal(s, -1, L"FilePath", -1, TRUE) == CSTR_EQUAL)
|
||||
{
|
||||
m_lifetimeKind = MddPackageDependencyLifetimeKind::FilePath;
|
||||
}
|
||||
else if (CompareStringOrdinal(s, -1, L"RegistryKey", -1, TRUE) == CSTR_EQUAL)
|
||||
{
|
||||
m_lifetimeKind = MddPackageDependencyLifetimeKind::RegistryKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
THROW_WIN32(ERROR_INVALID_DATA);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,321 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "MsixDynamicDependency.h"
|
||||
#include "MddCore.Architecture.h"
|
||||
|
||||
namespace MddCore
|
||||
{
|
||||
class PackageDependency
|
||||
{
|
||||
public:
|
||||
PackageDependency() = default;
|
||||
|
||||
PackageDependency(
|
||||
const PSID user,
|
||||
const std::wstring& packageFamilyName,
|
||||
const PACKAGE_VERSION minVersion,
|
||||
const MddPackageDependencyProcessorArchitectures packageDependencyProcessorArchitectures,
|
||||
const MddPackageDependencyLifetimeKind lifetimeKind,
|
||||
PCWSTR lifetimeArtifact,
|
||||
const MddCreatePackageDependencyOptions options) :
|
||||
m_packageFamilyName(packageFamilyName),
|
||||
m_minVersion(minVersion),
|
||||
m_packageDependencyProcessorArchitectures(packageDependencyProcessorArchitectures),
|
||||
m_lifetimeKind(lifetimeKind),
|
||||
m_lifetimeArtifact(lifetimeArtifact ? std::wstring(lifetimeArtifact) : std::wstring()),
|
||||
m_options(options)
|
||||
{
|
||||
User(user);
|
||||
}
|
||||
|
||||
PackageDependency(
|
||||
const PSID user,
|
||||
const std::wstring& packageFamilyName,
|
||||
const PACKAGE_VERSION minVersion,
|
||||
const MddPackageDependencyProcessorArchitectures packageDependencyProcessorArchitectures,
|
||||
const MddPackageDependencyLifetimeKind lifetimeKind,
|
||||
const std::wstring& lifetimeArtifact,
|
||||
const MddCreatePackageDependencyOptions options) :
|
||||
m_packageFamilyName(packageFamilyName),
|
||||
m_minVersion(minVersion),
|
||||
m_packageDependencyProcessorArchitectures(packageDependencyProcessorArchitectures),
|
||||
m_lifetimeKind(lifetimeKind),
|
||||
m_lifetimeArtifact(lifetimeArtifact),
|
||||
m_options(options)
|
||||
{
|
||||
User(user);
|
||||
}
|
||||
|
||||
~PackageDependency() = default;
|
||||
|
||||
PackageDependency(const PackageDependency& other) :
|
||||
m_packageFamilyName(other.m_packageFamilyName),
|
||||
m_minVersion(other.m_minVersion),
|
||||
m_packageDependencyProcessorArchitectures(other.m_packageDependencyProcessorArchitectures),
|
||||
m_lifetimeKind(other.m_lifetimeKind),
|
||||
m_lifetimeArtifact(other.m_lifetimeArtifact),
|
||||
m_options(other.m_options),
|
||||
m_packageDependencyId(other.m_packageDependencyId)
|
||||
{
|
||||
User(other.m_user.get());
|
||||
}
|
||||
|
||||
PackageDependency(PackageDependency&& other) :
|
||||
m_user(std::move(other.m_user)),
|
||||
m_packageFamilyName(std::move(other.m_packageFamilyName)),
|
||||
m_minVersion(std::move(other.m_minVersion)),
|
||||
m_packageDependencyProcessorArchitectures(std::move(other.m_packageDependencyProcessorArchitectures)),
|
||||
m_lifetimeKind(std::move(other.m_lifetimeKind)),
|
||||
m_lifetimeArtifact(std::move(other.m_lifetimeArtifact)),
|
||||
m_options(std::move(other.m_options)),
|
||||
m_packageDependencyId(std::move(other.m_packageDependencyId))
|
||||
{
|
||||
}
|
||||
|
||||
PackageDependency& operator=(const PackageDependency& other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
Reset();
|
||||
User(other.m_user.get());
|
||||
m_packageFamilyName = other.m_packageFamilyName;
|
||||
m_minVersion = other.m_minVersion;
|
||||
m_packageDependencyProcessorArchitectures = other.m_packageDependencyProcessorArchitectures;
|
||||
m_lifetimeKind = other.m_lifetimeKind;
|
||||
m_lifetimeArtifact = other.m_lifetimeArtifact;
|
||||
m_options = other.m_options;
|
||||
m_packageDependencyId = other.m_packageDependencyId;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
PackageDependency& operator=(PackageDependency&& other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
Reset();
|
||||
m_user = std::move(other.m_user);
|
||||
m_packageFamilyName = std::move(other.m_packageFamilyName);
|
||||
m_minVersion = std::move(other.m_minVersion);
|
||||
m_packageDependencyProcessorArchitectures = std::move(other.m_packageDependencyProcessorArchitectures);
|
||||
m_lifetimeKind = std::move(other.m_lifetimeKind);
|
||||
m_lifetimeArtifact = std::move(other.m_lifetimeArtifact);
|
||||
m_options = std::move(other.m_options);
|
||||
m_packageDependencyId = std::move(other.m_packageDependencyId);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_user.reset();
|
||||
m_packageFamilyName.clear();
|
||||
m_minVersion = PACKAGE_VERSION{};
|
||||
m_packageDependencyProcessorArchitectures = MddPackageDependencyProcessorArchitectures::None;
|
||||
m_lifetimeKind = MddPackageDependencyLifetimeKind::Process;
|
||||
m_lifetimeArtifact.clear();
|
||||
m_options = MddCreatePackageDependencyOptions::None;
|
||||
m_packageDependencyId.clear();
|
||||
}
|
||||
|
||||
void GenerateId();
|
||||
|
||||
void User(PSID user)
|
||||
{
|
||||
if (user)
|
||||
{
|
||||
const auto sidLength{ GetLengthSid(user) };
|
||||
wil::unique_any_psid sid{ static_cast<PSID>(::LocalAlloc(LMEM_FIXED, sidLength)) };
|
||||
THROW_IF_NULL_ALLOC(sid);
|
||||
THROW_IF_WIN32_BOOL_FALSE(CopySid(sidLength, sid.get(), user));
|
||||
m_user = std::move(sid);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_user.reset();
|
||||
}
|
||||
}
|
||||
|
||||
PSID User() const
|
||||
{
|
||||
return m_user.get();
|
||||
}
|
||||
|
||||
PSID User()
|
||||
{
|
||||
return m_user.get();
|
||||
}
|
||||
|
||||
const std::wstring& PackageFamilyName() const
|
||||
{
|
||||
return m_packageFamilyName;
|
||||
}
|
||||
|
||||
void PackageFamilyName(const std::wstring& packageFamilyName)
|
||||
{
|
||||
m_packageFamilyName = packageFamilyName;
|
||||
}
|
||||
|
||||
const PACKAGE_VERSION& MinVersion() const
|
||||
{
|
||||
return m_minVersion;
|
||||
}
|
||||
|
||||
void MinVersion(const PACKAGE_VERSION& minVersion)
|
||||
{
|
||||
m_minVersion = minVersion;
|
||||
}
|
||||
|
||||
MddPackageDependencyProcessorArchitectures Architectures() const
|
||||
{
|
||||
return m_packageDependencyProcessorArchitectures;
|
||||
}
|
||||
|
||||
void Architectures(const MddPackageDependencyProcessorArchitectures packageDependencyProcessorArchitectures)
|
||||
{
|
||||
m_packageDependencyProcessorArchitectures = packageDependencyProcessorArchitectures;
|
||||
}
|
||||
|
||||
MddPackageDependencyLifetimeKind LifetimeKind() const
|
||||
{
|
||||
return m_lifetimeKind;
|
||||
}
|
||||
|
||||
void LifetimeKind(const MddPackageDependencyLifetimeKind lifetimeKind)
|
||||
{
|
||||
m_lifetimeKind = lifetimeKind;
|
||||
}
|
||||
|
||||
const std::wstring& LifetimeArtifact() const
|
||||
{
|
||||
return m_lifetimeArtifact;
|
||||
}
|
||||
|
||||
void LifetimeArtifact(const std::wstring& lifetimeArtifact)
|
||||
{
|
||||
m_lifetimeArtifact = lifetimeArtifact;
|
||||
}
|
||||
|
||||
MddCreatePackageDependencyOptions Options() const
|
||||
{
|
||||
return m_options;
|
||||
}
|
||||
|
||||
void Options(const MddCreatePackageDependencyOptions options)
|
||||
{
|
||||
m_options = options;
|
||||
}
|
||||
|
||||
const std::wstring& Id() const
|
||||
{
|
||||
return m_packageDependencyId;
|
||||
}
|
||||
|
||||
void Id(const std::wstring& id)
|
||||
{
|
||||
m_packageDependencyId = id;
|
||||
}
|
||||
|
||||
const std::wstring& PackageFullName() const
|
||||
{
|
||||
return m_packageFullName;
|
||||
}
|
||||
|
||||
std::vector<std::wstring> FindPackagesByFamily() const;
|
||||
|
||||
bool IsArchitectureInArchitectures(const MddCore::Architecture architecture) const
|
||||
{
|
||||
const auto architectureAsArchitectures{ ToArchitectures(architecture) };
|
||||
return WI_IsAnyFlagSet(m_packageDependencyProcessorArchitectures, architectureAsArchitectures);
|
||||
}
|
||||
|
||||
static MddPackageDependencyProcessorArchitectures ToArchitectures(const MddCore::Architecture architecture)
|
||||
{
|
||||
switch (architecture)
|
||||
{
|
||||
case MddCore::Architecture::X86: return MddPackageDependencyProcessorArchitectures::X86;
|
||||
case MddCore::Architecture::X64: return MddPackageDependencyProcessorArchitectures::X64;
|
||||
case MddCore::Architecture::Arm: return MddPackageDependencyProcessorArchitectures::Arm;
|
||||
case MddCore::Architecture::Arm64: return MddPackageDependencyProcessorArchitectures::Arm64;
|
||||
case MddCore::Architecture::X86OnArm64: return MddPackageDependencyProcessorArchitectures::X86OnArm64;
|
||||
case MddCore::Architecture::Neutral: return MddPackageDependencyProcessorArchitectures::Neutral;
|
||||
case MddCore::Architecture::Unknown: THROW_HR_MSG(E_UNEXPECTED, "Unsupported architecture 0x%X", architecture);
|
||||
default: THROW_HR_MSG(E_UNEXPECTED, "Unknown architecture 0x%X", architecture);
|
||||
}
|
||||
}
|
||||
|
||||
bool operator!() const
|
||||
{
|
||||
return m_packageDependencyId.empty();
|
||||
}
|
||||
|
||||
std::wstring ToJSON() const;
|
||||
std::string ToJSONUtf8() const;
|
||||
|
||||
static PackageDependency FromJSON(const winrt::hstring& json);
|
||||
static PackageDependency FromJSON(PCSTR jsonUtf8);
|
||||
|
||||
bool IsExpired() const;
|
||||
|
||||
private:
|
||||
static bool IsRegistryKeyExists(
|
||||
const std::wstring& key);
|
||||
|
||||
static HKEY ParseRegistryKey(
|
||||
const std::wstring& key,
|
||||
PCWSTR& subkey);
|
||||
|
||||
static HKEY ParseRegistryKey(
|
||||
const std::wstring& key,
|
||||
size_t& offsetToSubkey);
|
||||
|
||||
private:
|
||||
static winrt::hstring ToString(const MddPackageDependencyLifetimeKind lifetimeKind);
|
||||
|
||||
void LifetimeKind(const winrt::hstring& lifetimeKind);
|
||||
|
||||
static int32_t int32_from_string(PCWSTR s)
|
||||
{
|
||||
if (!s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
auto base{ (((s[0] == L'0') && s[1] == L'x') ? 16 : 10) };
|
||||
return wcstol(s, nullptr, base);
|
||||
}
|
||||
|
||||
static uint32_t uint32_from_string(PCWSTR s)
|
||||
{
|
||||
if (!s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
auto base{ (((s[0] == L'0') && s[1] == L'x') ? 16 : 10) };
|
||||
return wcstoul(s, nullptr, base);
|
||||
}
|
||||
|
||||
static uint64_t uint64_from_string(PCWSTR s)
|
||||
{
|
||||
if (!s)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
auto base{ (((s[0] == L'0') && s[1] == L'x') ? 16 : 10) };
|
||||
return wcstoull(s, nullptr, base);
|
||||
}
|
||||
|
||||
private:
|
||||
wil::unique_any_psid m_user;
|
||||
std::wstring m_packageFamilyName;
|
||||
PACKAGE_VERSION m_minVersion{};
|
||||
MddPackageDependencyProcessorArchitectures m_packageDependencyProcessorArchitectures = MddPackageDependencyProcessorArchitectures::None;
|
||||
MddPackageDependencyLifetimeKind m_lifetimeKind = MddPackageDependencyLifetimeKind::Process;
|
||||
std::wstring m_lifetimeArtifact;
|
||||
MddCreatePackageDependencyOptions m_options = MddCreatePackageDependencyOptions::None;
|
||||
std::wstring m_packageDependencyId;
|
||||
std::wstring m_packageFullName;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,169 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "PackageDependencyManager.h"
|
||||
|
||||
#include "DataStore.h"
|
||||
#include "PackageGraph.h"
|
||||
|
||||
static std::mutex g_lock;
|
||||
std::vector<MddCore::PackageDependency> g_packageDependencies;
|
||||
|
||||
bool MddCore::PackageDependencyManager::ExistsPackageDependency(
|
||||
PSID user,
|
||||
_In_ PCWSTR packageDependencyId)
|
||||
{
|
||||
auto lock{ std::unique_lock<std::mutex>(g_lock) };
|
||||
|
||||
// Find it (if we can)
|
||||
auto packageDependency{ GetPackageDependency(packageDependencyId) };
|
||||
if (packageDependency)
|
||||
{
|
||||
auto packageDependencyUser{ packageDependency->User() };
|
||||
if (user)
|
||||
{
|
||||
// We're expecting a definition for the specifiedd user
|
||||
return packageDependencyUser && !!EqualSid(user, packageDependencyUser);
|
||||
}
|
||||
else
|
||||
{
|
||||
// We're not expecting a user (i.e. it's for System)
|
||||
return !packageDependencyUser;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void MddCore::PackageDependencyManager::CreatePackageDependency(
|
||||
PSID user,
|
||||
_In_ PCWSTR packageFamilyName,
|
||||
PACKAGE_VERSION minVersion,
|
||||
MddPackageDependencyProcessorArchitectures packageDependencyProcessorArchitectures,
|
||||
MddPackageDependencyLifetimeKind lifetimeKind,
|
||||
PCWSTR lifetimeArtifact,
|
||||
MddCreatePackageDependencyOptions options,
|
||||
_Outptr_result_maybenull_ PWSTR* packageDependencyId)
|
||||
{
|
||||
*packageDependencyId = nullptr;
|
||||
|
||||
MddCore::PackageDependency packageDependency(user, packageFamilyName, minVersion, packageDependencyProcessorArchitectures, lifetimeKind, lifetimeArtifact, options);
|
||||
Verify(packageDependency);
|
||||
packageDependency.GenerateId();
|
||||
|
||||
MddCore::DataStore::Save(packageDependency, options);
|
||||
|
||||
auto lock{ std::unique_lock<std::mutex>(g_lock) };
|
||||
|
||||
g_packageDependencies.push_back(packageDependency);
|
||||
|
||||
auto id{ wil::make_process_heap_string(packageDependency.Id().c_str()) };
|
||||
*packageDependencyId = id.release();
|
||||
}
|
||||
|
||||
void MddCore::PackageDependencyManager::CreatePackageDependency(
|
||||
const MddCore::PackageDependency& packageDependency,
|
||||
_Outptr_result_maybenull_ PWSTR* packageDependencyId)
|
||||
{
|
||||
// Make a new PackageDependency object with the definition parts of the provided one
|
||||
CreatePackageDependency(packageDependency.User(), packageDependency.PackageFamilyName().c_str(),
|
||||
packageDependency.MinVersion(), packageDependency.Architectures(),
|
||||
packageDependency.LifetimeKind(), packageDependency.LifetimeArtifact().c_str(), packageDependency.Options(),
|
||||
packageDependencyId);
|
||||
}
|
||||
|
||||
void MddCore::PackageDependencyManager::DeletePackageDependency(
|
||||
_In_ PCWSTR packageDependencyId)
|
||||
{
|
||||
if (!packageDependencyId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto lock{ std::unique_lock<std::mutex>(g_lock) };
|
||||
|
||||
for (size_t index=0; index < g_packageDependencies.size(); ++index)
|
||||
{
|
||||
const auto& packageDependency{ g_packageDependencies[index] };
|
||||
if (CompareStringOrdinal(packageDependency.Id().c_str(), -1, packageDependencyId, -1, TRUE) == CSTR_EQUAL)
|
||||
{
|
||||
g_packageDependencies.erase(g_packageDependencies.begin() + index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MddCore::DataStore::Delete(packageDependencyId);
|
||||
}
|
||||
|
||||
const MddCore::PackageDependency* MddCore::PackageDependencyManager::GetPackageDependency(
|
||||
_In_ PCWSTR packageDependencyId)
|
||||
{
|
||||
// Find it (if we can)
|
||||
auto packageDependency{ GetPackageDependencyInMemory(packageDependencyId) };
|
||||
if (!packageDependency)
|
||||
{
|
||||
packageDependency = GetPackageDependencyInDataStore(packageDependencyId);
|
||||
}
|
||||
return packageDependency;
|
||||
}
|
||||
|
||||
const MddCore::PackageDependency* MddCore::PackageDependencyManager::GetPackageDependencyInMemory(
|
||||
_In_ PCWSTR packageDependencyId)
|
||||
{
|
||||
// Check the in-memory list
|
||||
for (size_t index=0; index < g_packageDependencies.size(); ++index)
|
||||
{
|
||||
const auto& packageDependency{ g_packageDependencies[index] };
|
||||
if (CompareStringOrdinal(packageDependency.Id().c_str(), -1, packageDependencyId, -1, TRUE) == CSTR_EQUAL)
|
||||
{
|
||||
// Gotcha!
|
||||
return &packageDependency;
|
||||
}
|
||||
}
|
||||
|
||||
// Not found
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/// @warning This method assumes \c packageDependencyId is not in the in-memory list
|
||||
const MddCore::PackageDependency* MddCore::PackageDependencyManager::GetPackageDependencyInDataStore(
|
||||
_In_ PCWSTR packageDependencyId)
|
||||
{
|
||||
auto packageDependency{ MddCore::DataStore::Load(packageDependencyId) };
|
||||
if (!packageDependency)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Has it expired?
|
||||
if (packageDependency.IsExpired())
|
||||
{
|
||||
// GC the expired package dependency
|
||||
MddCore::DataStore::Delete(packageDependencyId);
|
||||
|
||||
// Not found
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Add it to the in-memory list
|
||||
g_packageDependencies.push_back(packageDependency);
|
||||
|
||||
// Gotcha!
|
||||
return &g_packageDependencies.back();
|
||||
}
|
||||
|
||||
void MddCore::PackageDependencyManager::Verify(
|
||||
const MddCore::PackageDependency& packageDependency)
|
||||
{
|
||||
// Verify the package dependency's lifetime artifact
|
||||
THROW_HR_IF(HRESULT_FROM_WIN32(ERROR_CONTEXT_EXPIRED), packageDependency.IsExpired());
|
||||
|
||||
// Verify the package dependency's dependency resolution (if necessary)
|
||||
if (WI_IsFlagClear(packageDependency.Options(), MddCreatePackageDependencyOptions::DoNotVerifyDependencyResolution))
|
||||
{
|
||||
MddAddPackageDependencyOptions options{};
|
||||
wil::unique_process_heap_string packageFullName;
|
||||
THROW_IF_FAILED(MddCore::PackageGraph::ResolvePackageDependency(packageDependency, options, packageFullName));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "PackageDependency.h"
|
||||
|
||||
namespace MddCore
|
||||
{
|
||||
/// @note Unless otherwise stated, all public static methods are thread safe and acquire the global lock if necessary.
|
||||
/// @note Unless otherwise stated, all private static methods assume the global lock managed by their caller and held for their duration.
|
||||
class PackageDependencyManager
|
||||
{
|
||||
public:
|
||||
PackageDependencyManager() = delete;
|
||||
~PackageDependencyManager() = delete;
|
||||
|
||||
public:
|
||||
static bool ExistsPackageDependency(
|
||||
PSID user,
|
||||
_In_ PCWSTR packageDependencyId);
|
||||
|
||||
static void CreatePackageDependency(
|
||||
PSID user,
|
||||
_In_ PCWSTR packageFamilyName,
|
||||
PACKAGE_VERSION minVersion,
|
||||
MddPackageDependencyProcessorArchitectures packageDependencyProcessorArchitectures,
|
||||
MddPackageDependencyLifetimeKind lifetimeKind,
|
||||
PCWSTR lifetimeArtifact,
|
||||
MddCreatePackageDependencyOptions options,
|
||||
_Outptr_result_maybenull_ PWSTR* packageDependencyId);
|
||||
|
||||
static void CreatePackageDependency(
|
||||
const MddCore::PackageDependency& packageDependency,
|
||||
_Outptr_result_maybenull_ PWSTR* packageDependencyId);
|
||||
|
||||
static void DeletePackageDependency(
|
||||
_In_ PCWSTR packageDependencyId);
|
||||
|
||||
public:
|
||||
/// @warning Unlocked data access. Caller's responsible for thread safety.
|
||||
static const PackageDependency* GetPackageDependency(
|
||||
_In_ PCWSTR packageDependencyId);
|
||||
|
||||
private:
|
||||
static const PackageDependency* GetPackageDependencyInMemory(
|
||||
_In_ PCWSTR packageDependencyId);
|
||||
|
||||
static const PackageDependency* GetPackageDependencyInDataStore(
|
||||
_In_ PCWSTR packageDependencyId);
|
||||
|
||||
static void Verify(
|
||||
const MddCore::PackageDependency& packageDependency);
|
||||
};
|
||||
}
|
|
@ -0,0 +1,396 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "PackageGraph.h"
|
||||
|
||||
#include "PackageGraphNode.h"
|
||||
#include "PackageDependencyManager.h"
|
||||
#include "PackageId.h"
|
||||
#include "WinRTModuleManager.h"
|
||||
|
||||
#include <wil/win32_helpers.h>
|
||||
|
||||
HRESULT MddCore::PackageGraph::Add(
|
||||
_In_ PCWSTR packageDependencyId,
|
||||
INT32 rank,
|
||||
MddAddPackageDependencyOptions options,
|
||||
MDD_PACKAGEDEPENDENCY_CONTEXT& packageDependencyContext,
|
||||
_Outptr_opt_result_maybenull_ PWSTR* packageFullName)
|
||||
{
|
||||
wil::unique_process_heap_string fullName;
|
||||
RETURN_IF_FAILED(ResolvePackageDependency(packageDependencyId, options, fullName));
|
||||
MDD_PACKAGEDEPENDENCY_CONTEXT context{};
|
||||
RETURN_IF_FAILED(Add(fullName.get(), rank, options, packageDependencyId, context));
|
||||
|
||||
packageDependencyContext = std::move(context);
|
||||
if (packageFullName)
|
||||
{
|
||||
*packageFullName = fullName.release();
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT MddCore::PackageGraph::Add(
|
||||
_In_ PCWSTR packageFullName,
|
||||
INT32 rank,
|
||||
MddAddPackageDependencyOptions options,
|
||||
_In_ PCWSTR packageDependencyId,
|
||||
MDD_PACKAGEDEPENDENCY_CONTEXT& context)
|
||||
{
|
||||
// Load the package's information
|
||||
PackageGraphNode packageGraphNode(packageFullName, rank, packageDependencyId);
|
||||
packageGraphNode.GenerateContext();
|
||||
|
||||
// Load the WinRT definitions (if any)
|
||||
std::shared_ptr<MddCore::WinRTPackage> winrtPackage{ packageGraphNode.CreateWinRTPackage() };
|
||||
winrtPackage->ParseAppxManifest();
|
||||
|
||||
// Find the insertion point where to add the new package graph node to the package graph
|
||||
size_t index{};
|
||||
for (; index < m_packageGraphNodes.size(); ++index)
|
||||
{
|
||||
auto& node{ m_packageGraphNodes[index] };
|
||||
if (node.Rank() < rank)
|
||||
{
|
||||
// Too soon. Keep looking
|
||||
continue;
|
||||
}
|
||||
else if (rank < node.Rank())
|
||||
{
|
||||
// Gotcha!
|
||||
break;
|
||||
}
|
||||
|
||||
if (node.Rank() == rank)
|
||||
{
|
||||
// Match! Insert before items of the same rank?
|
||||
if (WI_IsFlagSet(options, MddAddPackageDependencyOptions::PrependIfRankCollision))
|
||||
{
|
||||
// Gotcha!
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Append to items of this rank
|
||||
for (size_t nextIndex=index+1; nextIndex < m_packageGraphNodes.size(); ++nextIndex)
|
||||
{
|
||||
auto& nextNode{ m_packageGraphNodes[nextIndex] };
|
||||
if (nextNode.Rank() > rank)
|
||||
{
|
||||
// Gotcha!
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add the new node to the package graph
|
||||
if (index < m_packageGraphNodes.size())
|
||||
{
|
||||
m_packageGraphNodes.insert(m_packageGraphNodes.begin() + index, std::move(packageGraphNode));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_packageGraphNodes.push_back(std::move(packageGraphNode));
|
||||
}
|
||||
|
||||
// Add the package's WinRT information
|
||||
MddCore::WinRTModuleManager::Insert(index, winrtPackage);
|
||||
winrtPackage.reset();
|
||||
|
||||
// The DLL Search Order must be updated when we update the package graph
|
||||
auto& node{ m_packageGraphNodes[index] };
|
||||
AddToDllSearchOrder(node);
|
||||
|
||||
context = node.Context();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT MddCore::PackageGraph::ResolvePackageDependency(
|
||||
PCWSTR packageDependencyId,
|
||||
MddAddPackageDependencyOptions options,
|
||||
wil::unique_process_heap_string& packageFullName) noexcept try
|
||||
{
|
||||
packageFullName.reset();
|
||||
|
||||
// Get the package dependency
|
||||
auto foundPackageDependency{ MddCore::PackageDependencyManager::GetPackageDependency(packageDependencyId) };
|
||||
THROW_HR_IF(HRESULT_FROM_WIN32(ERROR_NOT_FOUND), !foundPackageDependency);
|
||||
|
||||
// Is the package dependency already resolved?
|
||||
const auto& packageDependency{ *foundPackageDependency };
|
||||
if (!packageDependency.PackageFullName().empty())
|
||||
{
|
||||
packageFullName = wil::make_process_heap_string(packageDependency.PackageFullName().c_str());
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// Rewsolve it
|
||||
return ResolvePackageDependency(packageDependency, options, packageFullName);
|
||||
}
|
||||
CATCH_RETURN();
|
||||
|
||||
HRESULT MddCore::PackageGraph::ResolvePackageDependency(
|
||||
const MddCore::PackageDependency& packageDependency,
|
||||
MddAddPackageDependencyOptions /*options*/,
|
||||
wil::unique_process_heap_string& packageFullName)
|
||||
{
|
||||
// Determine the packages in the family
|
||||
const auto foundPackageFullNames{ packageDependency.FindPackagesByFamily() };
|
||||
|
||||
// Find the best fit package in the family (if any)
|
||||
MddCore::PackageId bestFit;
|
||||
winrt::Windows::Management::Deployment::PackageManager packageManager;
|
||||
for (const auto& candidatePackageFullName : foundPackageFullNames)
|
||||
{
|
||||
auto candidate{ MddCore::PackageId::FromPackageFullName(candidatePackageFullName.c_str()) };
|
||||
|
||||
// Do we already have a higher version under consideration?
|
||||
if (bestFit && (bestFit.Version().Version > candidate.Version().Version))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Package version must meet the minVersion filter
|
||||
if (candidate.Version().Version < packageDependency.MinVersion().Version)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Package architecture must meet the architecture filter
|
||||
if (packageDependency.Architectures() == MddPackageDependencyProcessorArchitectures::None)
|
||||
{
|
||||
if (!IsPackageABetterFitPerArchitecture(bestFit, candidate))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!packageDependency.IsArchitectureInArchitectures(candidate.Architecture()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Package status must be OK to use a package
|
||||
winrt::hstring currentUser;
|
||||
auto package{ packageManager.FindPackageForUser(currentUser, candidate.PackageFullName()) };
|
||||
auto status{ package.Status() };
|
||||
if (!status.VerifyIsOK())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// The new candidate is better than the current champion
|
||||
bestFit = std::move(candidate);
|
||||
}
|
||||
|
||||
// Did we fail to find a match?
|
||||
THROW_HR_IF(HRESULT_FROM_WIN32(ERROR_NOT_FOUND), bestFit.PackageFullName().empty());
|
||||
|
||||
// We have a winner!
|
||||
packageFullName = std::move(wil::make_process_heap_string(bestFit.PackageFullName().c_str()));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT MddCore::PackageGraph::Remove(
|
||||
MDD_PACKAGEDEPENDENCY_CONTEXT context)
|
||||
{
|
||||
for (size_t index=0; index < m_packageGraphNodes.size(); ++index)
|
||||
{
|
||||
auto& node{ m_packageGraphNodes[index] };
|
||||
if (node.Context() == context)
|
||||
{
|
||||
// Detach the node from the package graph before updating the DLL Search Order
|
||||
auto detachedNode{ std::move(node) };
|
||||
m_packageGraphNodes.erase(m_packageGraphNodes.begin() + index);
|
||||
|
||||
// The DLL Search Order must be updated when we update the package graph
|
||||
RemoveFromDllSearchOrder(detachedNode);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
RETURN_WIN32(ERROR_INVALID_HANDLE);
|
||||
}
|
||||
|
||||
HRESULT MddCore::PackageGraph::GetPackageDependencyForContext(
|
||||
_In_ MDD_PACKAGEDEPENDENCY_CONTEXT context,
|
||||
wil::unique_process_heap_string& packageDependencyId)
|
||||
{
|
||||
for (size_t index=0; index < m_packageGraphNodes.size(); ++index)
|
||||
{
|
||||
auto& node{ m_packageGraphNodes[index] };
|
||||
if (node.Context() == context)
|
||||
{
|
||||
packageDependencyId = wil::make_process_heap_string(node.Id().c_str());
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
RETURN_WIN32(ERROR_INVALID_HANDLE);
|
||||
}
|
||||
|
||||
bool MddCore::PackageGraph::IsPackageABetterFitPerArchitecture(
|
||||
const PackageId& bestFit,
|
||||
const PackageId& candidate)
|
||||
{
|
||||
// Is the package a contender?
|
||||
const auto currentArchitecture{ GetCurrentArchitecture() };
|
||||
if ((candidate.Architecture() != MddCore::Architecture::Neutral) && (candidate.Architecture() != currentArchitecture))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Do we have a best-fit candidate yet?
|
||||
if (!bestFit)
|
||||
{
|
||||
// We do now :-)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Is the new package a better fit than the current champion?
|
||||
|
||||
// Architecture-specific is always better than architecture-neutral
|
||||
if ((bestFit.Architecture() == MddCore::Architecture::Neutral) && (candidate.Architecture() != MddCore::Architecture::Neutral))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// We have a new winner!
|
||||
return true;
|
||||
}
|
||||
|
||||
void MddCore::PackageGraph::AddToDllSearchOrder(PackageGraphNode& package)
|
||||
{
|
||||
// Update the PATH environment variable
|
||||
UpdatePath();
|
||||
|
||||
// Update the AddDllDirectory list
|
||||
package.AddDllDirectories();
|
||||
}
|
||||
|
||||
void MddCore::PackageGraph::UpdatePath()
|
||||
{
|
||||
// PATH is mutable by anyone in the process, at any time.
|
||||
// We can't even guarantee our pathlist is unchanged over the life
|
||||
// of the process. Others could have altered part of out PATH addition.
|
||||
// Unfortunately it's not only possible to dynamically add the same
|
||||
// package to the package graph, there are desirable scenarios for it
|
||||
// (e.g. plugin type scenarios).
|
||||
//
|
||||
// As a pratical matter, we'll follow this algorithm:
|
||||
//
|
||||
// Remove our previous addition to PATH (if present)
|
||||
// Prepend our new pathlist to PATH
|
||||
//
|
||||
// We'll assume for 'removal' our previous pathlist is an unmodified
|
||||
// block and if not, we won't try to micromanage removing it piecemeal.
|
||||
// If it's not an unmodified block the app's done something unexpected
|
||||
// and we can't reliably predict exactly what's up or how to respond.
|
||||
|
||||
// Build the package graph path list (semi-colon delimited)
|
||||
std::wstring pathList{ BuildPathList() };
|
||||
|
||||
// Build the new PATH
|
||||
std::wstring newPath;
|
||||
|
||||
// Get the current PATH environment variable
|
||||
auto pathEnvironmentVariable{ wil::TryGetEnvironmentVariableW(L"PATH") };
|
||||
std::wstring path{ !pathEnvironmentVariable ? L"" : pathEnvironmentVariable.get() };
|
||||
if (!pathEnvironmentVariable)
|
||||
{
|
||||
// We are the PATH
|
||||
newPath = pathList;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Remove the previous pathlist from PATH
|
||||
if (m_pathListLastAddedToPath.empty())
|
||||
{
|
||||
// Nothing to remove so use the PATH environment variable as-is
|
||||
newPath = std::move(path);
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto& oldPathList{ m_pathListLastAddedToPath };
|
||||
size_t offset = path.find(oldPathList);
|
||||
for (; offset != std::wstring::npos; offset = path.find(oldPathList, offset + 1))
|
||||
{
|
||||
// Is this a false positive?
|
||||
if ((offset != 0) && (path[offset - 1] != L';'))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
auto offsetAfterOldPathList{ offset + oldPathList.length() };
|
||||
if ((offsetAfterOldPathList < path.length()) && (path[offsetAfterOldPathList] != L';'))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Gotcha!
|
||||
|
||||
// At this point we know...
|
||||
// ...the old pathlist is the start-of-string or prefixed with ";"
|
||||
// ...the old pathlist is the end-of-string or suffixed with ";"
|
||||
// If we have both we need to remove one.
|
||||
// If we're at the start of PATH we need to remove the trailing ";"
|
||||
// If we're at the end of PATH we need to remove the leading ";"
|
||||
// Simplifying matters, if we're not at the end of the string we can remove
|
||||
// the trailer else remove the leader
|
||||
|
||||
// Keep everything before the old pathlist (if anything exists before it)
|
||||
newPath = path.substr(0, offset);
|
||||
|
||||
// Skip the old path list and the trailing ";" (if any)
|
||||
if (offsetAfterOldPathList < path.length())
|
||||
{
|
||||
newPath += path.substr(offsetAfterOldPathList + 1);
|
||||
}
|
||||
|
||||
// Done!
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Prepend the new pathlist to PATH
|
||||
if (!pathList.empty())
|
||||
{
|
||||
newPath = pathList + L";" + newPath;
|
||||
}
|
||||
}
|
||||
|
||||
// Update the PATH enironment variable
|
||||
PCWSTR newPathEnvironmentVariable{ (newPath.length() > 0 ? newPath.c_str() : nullptr) };
|
||||
THROW_IF_WIN32_BOOL_FALSE(SetEnvironmentVariableW(L"PATH", newPathEnvironmentVariable));
|
||||
|
||||
// Remember the path list we added to PATH for future updates
|
||||
m_pathListLastAddedToPath = pathList;
|
||||
}
|
||||
|
||||
void MddCore::PackageGraph::RemoveFromDllSearchOrder(PackageGraphNode& package)
|
||||
{
|
||||
// Update the AddDllDirectory list
|
||||
package.RemoveDllDirectories();
|
||||
|
||||
// Update the PATH environment variable
|
||||
UpdatePath();
|
||||
}
|
||||
|
||||
std::wstring MddCore::PackageGraph::BuildPathList()
|
||||
{
|
||||
std::wstring pathlist;
|
||||
for (size_t index=0; index < m_packageGraphNodes.size(); ++index)
|
||||
{
|
||||
const auto& node{ m_packageGraphNodes[index] };
|
||||
if (index > 0)
|
||||
{
|
||||
pathlist += L';';
|
||||
}
|
||||
pathlist += node.PathList();
|
||||
}
|
||||
return pathlist;
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#if !defined(PACKAGEGRAPH_H)
|
||||
#define PACKAGEGRAPH_H
|
||||
|
||||
#include "MsixDynamicDependency.h"
|
||||
|
||||
#include "PackageId.h"
|
||||
#include "PackageGraphNode.h"
|
||||
#include "PackageDependency.h"
|
||||
|
||||
namespace MddCore
|
||||
{
|
||||
class PackageGraph
|
||||
{
|
||||
public:
|
||||
PackageGraph() = default;
|
||||
|
||||
~PackageGraph() = default;
|
||||
|
||||
HRESULT Add(
|
||||
_In_ PCWSTR packageDependencyId,
|
||||
INT32 rank,
|
||||
MddAddPackageDependencyOptions options,
|
||||
MDD_PACKAGEDEPENDENCY_CONTEXT& packageDependencyContext,
|
||||
_Outptr_opt_result_maybenull_ PWSTR* packageFullName);
|
||||
|
||||
private:
|
||||
HRESULT Add(
|
||||
_In_ PCWSTR packageFullName,
|
||||
INT32 rank,
|
||||
MddAddPackageDependencyOptions options,
|
||||
_In_ PCWSTR packageDependencyId,
|
||||
MDD_PACKAGEDEPENDENCY_CONTEXT& context);
|
||||
|
||||
public:
|
||||
HRESULT ResolvePackageDependency(
|
||||
PCWSTR packageDependencyId,
|
||||
MddAddPackageDependencyOptions options,
|
||||
wil::unique_process_heap_string& packageFullName) noexcept;
|
||||
|
||||
static HRESULT ResolvePackageDependency(
|
||||
const MddCore::PackageDependency& packageDependency,
|
||||
MddAddPackageDependencyOptions options,
|
||||
wil::unique_process_heap_string& packageFullName);
|
||||
|
||||
public:
|
||||
HRESULT Remove(
|
||||
MDD_PACKAGEDEPENDENCY_CONTEXT context);
|
||||
|
||||
public:
|
||||
HRESULT GetPackageDependencyForContext(
|
||||
_In_ MDD_PACKAGEDEPENDENCY_CONTEXT context,
|
||||
wil::unique_process_heap_string& packageDependencyId);
|
||||
|
||||
private:
|
||||
static bool IsPackageABetterFitPerArchitecture(
|
||||
const MddCore::PackageId& bestFit,
|
||||
const MddCore::PackageId& candidate);
|
||||
|
||||
void AddToDllSearchOrder(PackageGraphNode& package);
|
||||
|
||||
void RemoveFromDllSearchOrder(PackageGraphNode& package);
|
||||
|
||||
inline static MddCore::Architecture GetCurrentArchitecture()
|
||||
{
|
||||
#if defined(_M_ARM)
|
||||
return Architecture::Arm;
|
||||
#elif defined(_M_ARM64)
|
||||
return Architecture::Arm64;
|
||||
#elif defined(_M_IX86)
|
||||
return Architecture::X86;
|
||||
#elif defined(_M_X64)
|
||||
return Architecture::X64;
|
||||
#else
|
||||
# error "Unknown processor architecture"
|
||||
#endif
|
||||
}
|
||||
|
||||
void UpdatePath();
|
||||
|
||||
std::wstring BuildPathList();
|
||||
|
||||
public:
|
||||
const std::vector<MddCore::PackageGraphNode>& PackageGraphNodes() const
|
||||
{
|
||||
return m_packageGraphNodes;
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<MddCore::PackageGraphNode> m_packageGraphNodes;
|
||||
std::wstring m_pathListLastAddedToPath;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PACKAGEGRAPH_H
|
|
@ -0,0 +1,245 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "PackageGraphManager.h"
|
||||
|
||||
std::mutex MddCore::PackageGraphManager::s_lock;
|
||||
MddCore::PackageGraph MddCore::PackageGraphManager::s_packageGraph;
|
||||
|
||||
HRESULT MddCore::PackageGraphManager::ResolvePackageDependency(
|
||||
PCWSTR packageDependencyId,
|
||||
MddAddPackageDependencyOptions options,
|
||||
wil::unique_process_heap_string& packageFullName)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(s_lock);
|
||||
|
||||
return s_packageGraph.ResolvePackageDependency(packageDependencyId, options, packageFullName);
|
||||
}
|
||||
|
||||
HRESULT MddCore::PackageGraphManager::AddToPackageGraph(
|
||||
PCWSTR packageDependencyId,
|
||||
INT32 rank,
|
||||
MddAddPackageDependencyOptions options,
|
||||
_Out_ MDD_PACKAGEDEPENDENCY_CONTEXT* context,
|
||||
_Outptr_opt_result_maybenull_ PWSTR* packageFullName)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(s_lock);
|
||||
|
||||
return s_packageGraph.Add(packageDependencyId, rank, options, *context, packageFullName);
|
||||
}
|
||||
|
||||
void MddCore::PackageGraphManager::RemoveFromPackageGraph(
|
||||
MDD_PACKAGEDEPENDENCY_CONTEXT context)
|
||||
{
|
||||
if (!context)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> lock(s_lock);
|
||||
|
||||
(void) LOG_IF_FAILED(s_packageGraph.Remove(context));
|
||||
}
|
||||
|
||||
HRESULT MddCore::PackageGraphManager::GetPackageDependencyForContext(
|
||||
_In_ MDD_PACKAGEDEPENDENCY_CONTEXT context,
|
||||
wil::unique_process_heap_string& packageDependencyId)
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(s_lock);
|
||||
|
||||
return s_packageGraph.GetPackageDependencyForContext(context, packageDependencyId);
|
||||
}
|
||||
|
||||
// On success, buffer is a byte[] containing PACKAGE_INFO[count] followed by all variable length data.
|
||||
// Pointers in PACKAGE_INFO (all PWSTR) are null or point to their value in the variable length data.
|
||||
//
|
||||
// On success but \c bufferLength is too small to hold all the data, we still set bufferLength to the
|
||||
// size needed for all this data but return ERROR_INSUFFICIENT_BUFFER (as an HRESULT).
|
||||
HRESULT MddCore::PackageGraphManager::GetCurrentPackageInfo2(
|
||||
const UINT32 flags,
|
||||
PackagePathType packagePathType,
|
||||
UINT32* bufferLength,
|
||||
BYTE* buffer,
|
||||
UINT32* count,
|
||||
GetCurrentPackageInfo2Function getCurrentPackageInfo2) noexcept try
|
||||
{
|
||||
if (count)
|
||||
{
|
||||
*count = 0;
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> lock(s_lock);
|
||||
|
||||
// Is the package graph empty?
|
||||
if (s_packageGraph.PackageGraphNodes().empty())
|
||||
{
|
||||
// No dynamic package data. Is there a static package graph?
|
||||
UINT32 length{};
|
||||
const LONG rc{ getCurrentPackageInfo2(flags, packagePathType, &length, nullptr, nullptr) };
|
||||
if (rc == APPMODEL_ERROR_NO_PACKAGE)
|
||||
{
|
||||
// No static package data either
|
||||
RETURN_WIN32(APPMODEL_ERROR_NO_PACKAGE);
|
||||
}
|
||||
}
|
||||
|
||||
// We manage the package graph as a list of nodes, where each contain contains information about 1+ package.
|
||||
//
|
||||
// Find all the packages across the package graph that match our filter criteria (see flags in
|
||||
// https://docs.microsoft.com/en-us/windows/win32/api/appmodel/nf-appmodel-getcurrentpackageinfo2).
|
||||
//
|
||||
// Then compute the size needed for all the data.
|
||||
//
|
||||
// The if the buffer's big enough, serialize the data into buffer.
|
||||
//
|
||||
// Either way, set bufferLength with the buffer size needed for all the data.
|
||||
|
||||
std::vector<const MddCore::PackageGraphNode*> matchingPackageInfo;
|
||||
|
||||
UINT32 staticPackageGraphBufferLength{};
|
||||
wil::unique_cotaskmem_ptr<BYTE[]> staticPackageGraphBuffer;
|
||||
const PACKAGE_INFO* staticPackageInfo{};
|
||||
UINT32 staticPackagesCount{};
|
||||
|
||||
UINT32 dynamicPackagesCount{};
|
||||
for (auto& packageGraphNode : s_packageGraph.PackageGraphNodes())
|
||||
{
|
||||
if (packageGraphNode.IsDynamic())
|
||||
{
|
||||
// It's dynamic data we manage. Does the node have any matching packages?
|
||||
const auto countMatchingPackages{ packageGraphNode.CountMatchingPackages(flags, packagePathType) };
|
||||
if (countMatchingPackages > 0)
|
||||
{
|
||||
matchingPackageInfo.push_back(&packageGraphNode);
|
||||
dynamicPackagesCount += countMatchingPackages;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// It's static data the OS manages. Does the node have any matching packages?
|
||||
LONG rc{ getCurrentPackageInfo2(flags, packagePathType, &staticPackageGraphBufferLength, nullptr, nullptr) };
|
||||
if (rc == APPMODEL_ERROR_NO_PACKAGE)
|
||||
{
|
||||
// The process has no static package info
|
||||
// Nothing to do
|
||||
}
|
||||
else if (rc == ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
// We've got 1+ match! Get the data
|
||||
staticPackageGraphBuffer = wil::make_unique_cotaskmem<BYTE[]>(staticPackageGraphBufferLength);
|
||||
RETURN_IF_WIN32_ERROR(getCurrentPackageInfo2(flags, packagePathType, &staticPackageGraphBufferLength, staticPackageGraphBuffer.get(), &staticPackagesCount));
|
||||
staticPackageInfo = reinterpret_cast<PACKAGE_INFO*>(staticPackageGraphBuffer.get());
|
||||
}
|
||||
else
|
||||
{
|
||||
RETURN_WIN32(rc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update the total 'count' (if any)
|
||||
const auto totalPackagesCount{ staticPackagesCount + dynamicPackagesCount };
|
||||
if (count)
|
||||
{
|
||||
*count = totalPackagesCount;
|
||||
}
|
||||
|
||||
// Do we have anything to report?
|
||||
if (totalPackagesCount == 0)
|
||||
{
|
||||
// No matches!
|
||||
*bufferLength = 0;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// Compute the buffer length used/needed and fill buffer (if we can)
|
||||
auto bufferNeeded{ SerializePackageInfoToBuffer(flags, packagePathType, *bufferLength, buffer, matchingPackageInfo, dynamicPackagesCount, staticPackageInfo, staticPackagesCount) };
|
||||
const auto isInsufficientBuffer{ *bufferLength < bufferNeeded };
|
||||
*bufferLength = bufferNeeded;
|
||||
RETURN_HR_IF(HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), isInsufficientBuffer);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
CATCH_RETURN();
|
||||
|
||||
UINT32 MddCore::PackageGraphManager::SerializePackageInfoToBuffer(
|
||||
const UINT32 flags,
|
||||
const PackagePathType packagePathType,
|
||||
const UINT32 bufferLength,
|
||||
BYTE* buffer,
|
||||
const std::vector<const MddCore::PackageGraphNode*>& matchingPackageInfo,
|
||||
const UINT32 dynamicPackagesCount,
|
||||
const PACKAGE_INFO* staticPackageInfo,
|
||||
const UINT32 staticPackagesCount)
|
||||
{
|
||||
// Setup our initial pointers to write the PACKAGE_INFO[] and the variable length data
|
||||
const auto totalPackagesCount{ dynamicPackagesCount + staticPackagesCount };
|
||||
UINT32 bufferNeeded{ sizeof(PACKAGE_INFO) * totalPackagesCount };
|
||||
auto toPackageInfo{ reinterpret_cast<PACKAGE_INFO*>(buffer) };
|
||||
|
||||
// Let's do it...
|
||||
for (auto& matchingPackageGraphNode : matchingPackageInfo)
|
||||
{
|
||||
UINT32 fromPackagesCount{};
|
||||
const void* fromPackagesBuffer{};
|
||||
wil::unique_cotaskmem_ptr<BYTE[]> dynamicPackagesBuffer;
|
||||
|
||||
if (matchingPackageGraphNode)
|
||||
{
|
||||
// It's dynamic package data
|
||||
fromPackagesCount = std::move(matchingPackageGraphNode->GetMatchingPackages(flags, packagePathType, dynamicPackagesBuffer));
|
||||
fromPackagesBuffer = dynamicPackagesBuffer.get();
|
||||
}
|
||||
else
|
||||
{
|
||||
// It's static package data
|
||||
fromPackagesCount = staticPackagesCount;
|
||||
fromPackagesBuffer = staticPackageInfo;
|
||||
}
|
||||
auto fromPackageInfo{ static_cast<const PACKAGE_INFO*>(fromPackagesBuffer) };
|
||||
|
||||
// Copy the package info to the buffer
|
||||
for (UINT32 index=0; index < fromPackagesCount; ++index, ++fromPackageInfo, ++toPackageInfo)
|
||||
{
|
||||
// Copy over the fixed length data
|
||||
if (bufferNeeded <= bufferLength)
|
||||
{
|
||||
memset(toPackageInfo, 0, sizeof(*toPackageInfo));
|
||||
toPackageInfo->flags = fromPackageInfo->flags;
|
||||
toPackageInfo->packageId.processorArchitecture = fromPackageInfo->packageId.processorArchitecture;
|
||||
toPackageInfo->packageId.version = fromPackageInfo->packageId.version;
|
||||
}
|
||||
SerializeStringToBuffer(bufferLength, buffer, bufferNeeded, toPackageInfo->path, fromPackageInfo->path);
|
||||
SerializeStringToBuffer(bufferLength, buffer, bufferNeeded, toPackageInfo->packageFullName, fromPackageInfo->packageFullName);
|
||||
SerializeStringToBuffer(bufferLength, buffer, bufferNeeded, toPackageInfo->packageFamilyName, fromPackageInfo->packageFamilyName);
|
||||
SerializeStringToBuffer(bufferLength, buffer, bufferNeeded, toPackageInfo->packageId.name, fromPackageInfo->packageId.name);
|
||||
SerializeStringToBuffer(bufferLength, buffer, bufferNeeded, toPackageInfo->packageId.publisher, fromPackageInfo->packageId.publisher);
|
||||
SerializeStringToBuffer(bufferLength, buffer, bufferNeeded, toPackageInfo->packageId.resourceId, fromPackageInfo->packageId.resourceId);
|
||||
SerializeStringToBuffer(bufferLength, buffer, bufferNeeded, toPackageInfo->packageId.publisherId, fromPackageInfo->packageId.publisherId);
|
||||
}
|
||||
}
|
||||
|
||||
return bufferNeeded;
|
||||
}
|
||||
|
||||
void MddCore::PackageGraphManager::SerializeStringToBuffer(
|
||||
const UINT32 bufferLength,
|
||||
BYTE*& buffer,
|
||||
UINT32& bufferNeeded,
|
||||
PWSTR& to,
|
||||
PCWSTR from)
|
||||
{
|
||||
if (from)
|
||||
{
|
||||
const auto bufferUsed{ bufferNeeded };
|
||||
const auto size{ wcssize(from) };
|
||||
bufferNeeded += size;
|
||||
if (bufferNeeded <= bufferLength)
|
||||
{
|
||||
memcpy(buffer + bufferUsed, from, size);
|
||||
to = reinterpret_cast<PWSTR>(buffer + bufferUsed);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#if !defined(PACKAGEGRAPHMANAGER_H)
|
||||
#define PACKAGEGRAPHMANAGER_H
|
||||
|
||||
#include <PackageGraph.h>
|
||||
|
||||
namespace MddCore
|
||||
{
|
||||
class PackageGraphManager
|
||||
{
|
||||
public:
|
||||
static HRESULT ResolvePackageDependency(
|
||||
PCWSTR packageDependencyId,
|
||||
MddAddPackageDependencyOptions options,
|
||||
wil::unique_process_heap_string& packageFullName);
|
||||
|
||||
static HRESULT AddToPackageGraph(
|
||||
_In_ PCWSTR packageDependencyId,
|
||||
INT32 rank,
|
||||
MddAddPackageDependencyOptions options,
|
||||
_Out_ MDD_PACKAGEDEPENDENCY_CONTEXT* packageDependencyContext,
|
||||
_Outptr_opt_result_maybenull_ PWSTR* packageFullName);
|
||||
|
||||
static void RemoveFromPackageGraph(
|
||||
MDD_PACKAGEDEPENDENCY_CONTEXT context);
|
||||
|
||||
static HRESULT GetPackageDependencyForContext(
|
||||
_In_ MDD_PACKAGEDEPENDENCY_CONTEXT context,
|
||||
wil::unique_process_heap_string& packageDependencyId);
|
||||
|
||||
public:
|
||||
typedef LONG (WINAPI* GetCurrentPackageInfo2Function)(
|
||||
const UINT32 flags,
|
||||
PackagePathType packagePathType,
|
||||
UINT32* bufferLength,
|
||||
BYTE* buffer,
|
||||
UINT32* count);
|
||||
|
||||
static HRESULT GetCurrentPackageInfo2(
|
||||
const UINT32 flags,
|
||||
PackagePathType packagePathType,
|
||||
UINT32* bufferLength,
|
||||
BYTE* buffer,
|
||||
UINT32* count,
|
||||
GetCurrentPackageInfo2Function getCurrentPackageInfo2) noexcept;
|
||||
|
||||
private:
|
||||
static UINT32 SerializePackageInfoToBuffer(
|
||||
const UINT32 flags,
|
||||
const PackagePathType packagePathType,
|
||||
const UINT32 bufferLength,
|
||||
BYTE* buffer,
|
||||
const std::vector<const MddCore::PackageGraphNode*>& matchingPackageInfo,
|
||||
const UINT32 dynamicPackagesCount,
|
||||
const PACKAGE_INFO* staticPackageInfo,
|
||||
const UINT32 staticPackagesCount);
|
||||
|
||||
static void SerializeStringToBuffer(
|
||||
const UINT32 bufferLength,
|
||||
BYTE*& buffer,
|
||||
UINT32& bufferNeeded,
|
||||
PWSTR& to,
|
||||
PCWSTR from);
|
||||
|
||||
static inline UINT32 wcssize(PCWSTR s)
|
||||
{
|
||||
return static_cast<UINT32>((wcslen(s) + 1) * sizeof(*s));
|
||||
}
|
||||
|
||||
private:
|
||||
static std::mutex s_lock;
|
||||
static MddCore::PackageGraph s_packageGraph;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PACKAGEGRAPHMANAGER_H
|
|
@ -0,0 +1,112 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "PackageGraphNode.h"
|
||||
|
||||
volatile MDD_PACKAGEDEPENDENCY_CONTEXT MddCore::PackageGraphNode::s_lastContext{};
|
||||
|
||||
MddCore::PackageGraphNode::PackageGraphNode(
|
||||
_In_ PCWSTR packageFullName,
|
||||
INT32 rank,
|
||||
_In_ PCWSTR packageDependencyId) :
|
||||
m_rank(rank),
|
||||
m_id(packageDependencyId)
|
||||
{
|
||||
THROW_IF_WIN32_ERROR(OpenPackageInfoByFullName(packageFullName, 0, &m_packageInfoReference));
|
||||
m_packageInfo = std::move(MddCore::PackageInfo::FromPackageInfoReference(m_packageInfoReference.get()));
|
||||
|
||||
BuildPathList();
|
||||
}
|
||||
|
||||
UINT32 MddCore::PackageGraphNode::CountMatchingPackages(
|
||||
const UINT32 flags,
|
||||
const PackagePathType packagePathType) const
|
||||
{
|
||||
UINT32 bufferLength{};
|
||||
UINT32 count{};
|
||||
const LONG rc{ ::GetPackageInfo2(m_packageInfoReference.get(), flags, packagePathType, &bufferLength, nullptr, &count) };
|
||||
if ((rc != ERROR_SUCCESS) && (rc != ERROR_INSUFFICIENT_BUFFER))
|
||||
{
|
||||
THROW_WIN32(rc);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
UINT32 MddCore::PackageGraphNode::GetMatchingPackages(
|
||||
const UINT32 flags,
|
||||
const PackagePathType packagePathType,
|
||||
wil::unique_cotaskmem_ptr<BYTE[]>& buffer) const
|
||||
{
|
||||
UINT32 bufferLength{};
|
||||
const LONG rc{ ::GetPackageInfo2(m_packageInfoReference.get(), flags, packagePathType, &bufferLength, nullptr, nullptr) };
|
||||
if (rc == ERROR_SUCCESS)
|
||||
{
|
||||
// Success with no buffer can only mean count==0
|
||||
return 0;
|
||||
}
|
||||
else if (rc != ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
THROW_WIN32(rc);
|
||||
}
|
||||
buffer = std::move(wil::make_unique_cotaskmem<BYTE[]>(bufferLength));
|
||||
UINT32 count{};
|
||||
THROW_IF_WIN32_ERROR(::GetPackageInfo2(m_packageInfoReference.get(), flags, packagePathType, &bufferLength, buffer.get(), &count));
|
||||
return count;
|
||||
}
|
||||
|
||||
void MddCore::PackageGraphNode::GenerateContext()
|
||||
{
|
||||
#if defined(_WIN64)
|
||||
m_context = reinterpret_cast<MDD_PACKAGEDEPENDENCY_CONTEXT>(InterlockedIncrement64(reinterpret_cast<volatile LONG64*>(&s_lastContext)));
|
||||
#else
|
||||
m_context = reinterpret_cast<MDD_PACKAGEDEPENDENCY_CONTEXT>(InterlockedIncrement(reinterpret_cast<volatile LONG*>(&s_lastContext)));
|
||||
#endif
|
||||
}
|
||||
|
||||
void MddCore::PackageGraphNode::AddDllDirectories()
|
||||
{
|
||||
for (size_t index=0; index < m_packageInfo.Count(); ++index)
|
||||
{
|
||||
const auto& package{ m_packageInfo.Package(index) };
|
||||
|
||||
wil::unique_dll_directory_cookie cookie(AddDllDirectory(package.path));
|
||||
THROW_LAST_ERROR_IF_NULL(cookie);
|
||||
|
||||
m_addDllDirectoryCookies.push_back(std::move(cookie));
|
||||
}
|
||||
}
|
||||
|
||||
void MddCore::PackageGraphNode::RemoveDllDirectories()
|
||||
{
|
||||
m_addDllDirectoryCookies.clear();
|
||||
}
|
||||
|
||||
void MddCore::PackageGraphNode::BuildPathList()
|
||||
{
|
||||
// Should only be called if we have package info
|
||||
FAIL_FAST_HR_IF(E_UNEXPECTED, m_packageInfo.Count() == 0);
|
||||
|
||||
// Build a semi-colon delimited list of paths for the packages in the package info
|
||||
std::wstring pathList;
|
||||
for (size_t index=0; index < m_packageInfo.Count(); ++index)
|
||||
{
|
||||
const auto& package{ m_packageInfo.Package(index) };
|
||||
if (index > 0)
|
||||
{
|
||||
pathList += L';';
|
||||
}
|
||||
pathList += package.path;
|
||||
}
|
||||
m_pathList = std::move(pathList);
|
||||
}
|
||||
|
||||
std::shared_ptr<MddCore::WinRTPackage> MddCore::PackageGraphNode::CreateWinRTPackage() const
|
||||
{
|
||||
const auto& package{ m_packageInfo.Package(0) };
|
||||
|
||||
return std::make_shared<MddCore::WinRTPackage>(m_context, package.path);
|
||||
}
|
|
@ -0,0 +1,143 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <appmodel.h>
|
||||
|
||||
#include "MsixDynamicDependency.h"
|
||||
|
||||
#include <wil/resource.h>
|
||||
#include "wil_msixdynamicdependency.h"
|
||||
|
||||
#include "PackageInfo.h"
|
||||
#include "WinRTPackage.h"
|
||||
|
||||
namespace MddCore
|
||||
{
|
||||
class PackageGraphNode
|
||||
{
|
||||
public:
|
||||
PackageGraphNode() = default;
|
||||
|
||||
~PackageGraphNode()
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
PackageGraphNode(const PackageGraphNode& other) = delete;
|
||||
|
||||
PackageGraphNode(PackageGraphNode&& other) :
|
||||
m_packageInfoReference(std::move(other.m_packageInfoReference)),
|
||||
m_packageInfo(std::move(other.m_packageInfo)),
|
||||
m_rank(std::move(other.m_rank)),
|
||||
m_pathList(std::move(other.m_pathList)),
|
||||
m_context(std::move(other.m_context)),
|
||||
m_addDllDirectoryCookies(std::move(other.m_addDllDirectoryCookies)),
|
||||
m_id(std::move(other.m_id))
|
||||
{
|
||||
}
|
||||
|
||||
PackageGraphNode(
|
||||
_In_ PCWSTR packageFullName,
|
||||
INT32 rank,
|
||||
_In_ PCWSTR packageDependencyId);
|
||||
|
||||
PackageGraphNode& operator=(PackageGraphNode& other) = delete;
|
||||
|
||||
PackageGraphNode& operator=(PackageGraphNode&& other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
Reset();
|
||||
m_packageInfoReference = std::move(other.m_packageInfoReference);
|
||||
m_packageInfo = std::move(other.m_packageInfo);
|
||||
m_rank = std::move(other.m_rank);
|
||||
m_pathList = std::move(other.m_pathList);
|
||||
m_context = std::move(other.m_context);
|
||||
m_addDllDirectoryCookies = std::move(other.m_addDllDirectoryCookies);
|
||||
m_id = std::move(other.m_id);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_addDllDirectoryCookies.clear();
|
||||
m_context = nullptr;
|
||||
m_pathList.clear();
|
||||
m_rank = MDD_PACKAGE_DEPENDENCY_RANK_DEFAULT;
|
||||
m_packageInfo.Reset();
|
||||
m_packageInfoReference.reset();
|
||||
m_id.clear();
|
||||
}
|
||||
|
||||
bool IsDynamic() const
|
||||
{
|
||||
return !IsStatic();
|
||||
}
|
||||
|
||||
bool IsStatic() const
|
||||
{
|
||||
return !m_packageInfoReference.get();
|
||||
}
|
||||
|
||||
UINT32 CountMatchingPackages(
|
||||
const UINT32 flags,
|
||||
const PackagePathType packagePathType) const;
|
||||
|
||||
UINT32 GetMatchingPackages(
|
||||
const UINT32 flags,
|
||||
const PackagePathType packagePathType,
|
||||
wil::unique_cotaskmem_ptr<BYTE[]>& buffer) const;
|
||||
|
||||
const MddCore::PackageInfo& PackageInfo() const
|
||||
{
|
||||
return m_packageInfo;
|
||||
}
|
||||
|
||||
int32_t Rank() const
|
||||
{
|
||||
return m_rank;
|
||||
}
|
||||
|
||||
const std::wstring& PathList() const
|
||||
{
|
||||
return m_pathList;
|
||||
}
|
||||
|
||||
MDD_PACKAGEDEPENDENCY_CONTEXT Context()
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
|
||||
const std::wstring Id() const
|
||||
{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
void GenerateContext();
|
||||
|
||||
void AddDllDirectories();
|
||||
|
||||
void RemoveDllDirectories();
|
||||
|
||||
private:
|
||||
void BuildPathList();
|
||||
|
||||
public:
|
||||
std::shared_ptr<MddCore::WinRTPackage> CreateWinRTPackage() const;
|
||||
|
||||
private:
|
||||
static volatile MDD_PACKAGEDEPENDENCY_CONTEXT s_lastContext;
|
||||
|
||||
private:
|
||||
mutable wil::unique_package_info_reference m_packageInfoReference;
|
||||
MddCore::PackageInfo m_packageInfo;
|
||||
INT32 m_rank{ MDD_PACKAGE_DEPENDENCY_RANK_DEFAULT };
|
||||
std::wstring m_pathList;
|
||||
MDD_PACKAGEDEPENDENCY_CONTEXT m_context{};
|
||||
std::vector<wil::unique_dll_directory_cookie> m_addDllDirectoryCookies;
|
||||
std::wstring m_id;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#if !defined(PACKAGEID_H)
|
||||
#define PACKAGEID_H
|
||||
|
||||
#include "MddCore.Architecture.h"
|
||||
|
||||
namespace MddCore
|
||||
{
|
||||
class PackageId
|
||||
{
|
||||
public:
|
||||
static PackageId FromPackageFullName(PCWSTR packageFullName)
|
||||
{
|
||||
PackageId packageId;
|
||||
UINT32 bufferLength{ sizeof(packageId.m_buffer) };
|
||||
THROW_IF_WIN32_ERROR(PackageIdFromFullName(packageFullName, PACKAGE_INFORMATION_BASIC, &bufferLength, packageId.m_buffer));
|
||||
packageId.m_packageId = reinterpret_cast<PACKAGE_ID*>(packageId.m_buffer);
|
||||
packageId.m_packageFullName = packageFullName;
|
||||
return packageId;
|
||||
}
|
||||
|
||||
PackageId() = default;
|
||||
|
||||
PackageId(PackageId&& other) :
|
||||
m_packageFullName(std::move(other.m_packageFullName))
|
||||
{
|
||||
memcpy(m_buffer, other.m_buffer, sizeof(m_buffer));
|
||||
m_packageId = reinterpret_cast<PACKAGE_ID*>(m_buffer);
|
||||
|
||||
other.m_packageId = nullptr;
|
||||
memset(other.m_buffer, 0, sizeof(other.m_buffer));
|
||||
}
|
||||
|
||||
~PackageId() = default;
|
||||
|
||||
PackageId& operator=(PackageId&& other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
m_packageFullName = std::move(other.m_packageFullName);
|
||||
memcpy(m_buffer, other.m_buffer, sizeof(m_buffer));
|
||||
m_packageId = reinterpret_cast<PACKAGE_ID*>(m_buffer);
|
||||
|
||||
other.m_packageId = nullptr;
|
||||
memset(other.m_buffer, 0, sizeof(other.m_buffer));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
const std::wstring& PackageFullName() const
|
||||
{
|
||||
return m_packageFullName;
|
||||
}
|
||||
|
||||
PCWSTR Name() const
|
||||
{
|
||||
return m_packageId->name;
|
||||
}
|
||||
|
||||
PACKAGE_VERSION Version() const
|
||||
{
|
||||
return m_packageId->version;
|
||||
}
|
||||
|
||||
MddCore::Architecture Architecture() const
|
||||
{
|
||||
return static_cast<MddCore::Architecture>(m_packageId->processorArchitecture);
|
||||
}
|
||||
|
||||
PCWSTR ResourceId() const
|
||||
{
|
||||
return m_packageId->resourceId;
|
||||
}
|
||||
|
||||
PCWSTR PublisherId() const
|
||||
{
|
||||
return m_packageId->publisherId;
|
||||
}
|
||||
|
||||
explicit operator bool() const
|
||||
{
|
||||
return m_packageId != nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
std::wstring m_packageFullName;
|
||||
const PACKAGE_ID * m_packageId{};
|
||||
BYTE m_buffer[sizeof(PACKAGE_ID) + (PACKAGE_NAME_MAX_LENGTH + 1 +
|
||||
PACKAGE_RESOURCEID_MAX_LENGTH + 1 +
|
||||
PACKAGE_PUBLISHERID_MAX_LENGTH + 1) * sizeof(WCHAR)]{};
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PACKAGEID_H
|
|
@ -0,0 +1,93 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#if !defined(PACKAGEINFO_H)
|
||||
#define PACKAGEINFO_H
|
||||
|
||||
namespace MddCore
|
||||
{
|
||||
class PackageInfo
|
||||
{
|
||||
public:
|
||||
static PackageInfo FromPackageInfoReference(
|
||||
PACKAGE_INFO_REFERENCE packageInfoReference,
|
||||
const UINT32 flags = PACKAGE_FILTER_HEAD | PACKAGE_FILTER_DIRECT | PACKAGE_FILTER_OPTIONAL | PACKAGE_FILTER_RESOURCE | PACKAGE_FILTER_BUNDLE,
|
||||
const PackagePathType packagePathType = PackagePathType_Effective)
|
||||
{
|
||||
UINT32 bufferLength{};
|
||||
const LONG rc{ ::GetPackageInfo2(packageInfoReference, flags, packagePathType, &bufferLength, nullptr, nullptr) };
|
||||
THROW_HR_IF(HRESULT_FROM_WIN32(rc), rc != ERROR_INSUFFICIENT_BUFFER);
|
||||
std::unique_ptr<BYTE[]> buffer{ std::make_unique<BYTE[]>(bufferLength) };
|
||||
UINT32 count{};
|
||||
THROW_IF_WIN32_ERROR(::GetPackageInfo2(packageInfoReference, flags, packagePathType, &bufferLength, buffer.get(), &count));
|
||||
|
||||
auto packageInfo{ PackageInfo(buffer.get(), count) };
|
||||
buffer.release();
|
||||
return packageInfo;
|
||||
}
|
||||
|
||||
PackageInfo() = default;
|
||||
|
||||
PackageInfo(PackageInfo&& other) :
|
||||
m_packageInfoBuffer(std::move(other.m_packageInfoBuffer)),
|
||||
m_count(other.m_count)
|
||||
{
|
||||
m_packageInfo = reinterpret_cast<PACKAGE_INFO*>(m_packageInfoBuffer.get());
|
||||
|
||||
other.m_packageInfo = nullptr;
|
||||
}
|
||||
|
||||
PackageInfo(void* buffer, size_t count) :
|
||||
m_packageInfoBuffer(static_cast<BYTE*>(buffer)),
|
||||
m_count(count)
|
||||
{
|
||||
m_packageInfo = reinterpret_cast<PACKAGE_INFO*>(m_packageInfoBuffer.get());
|
||||
}
|
||||
|
||||
~PackageInfo() = default;
|
||||
|
||||
PackageInfo& operator=(PackageInfo&& other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
m_packageInfoBuffer = std::move(other.m_packageInfoBuffer);
|
||||
m_packageInfo = reinterpret_cast<PACKAGE_INFO*>(m_packageInfoBuffer.get());
|
||||
m_count = other.m_count;
|
||||
|
||||
other.m_packageInfo = nullptr;
|
||||
other.m_count = 0;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_packageInfo = nullptr;
|
||||
m_packageInfoBuffer.reset();
|
||||
m_count = 0;
|
||||
}
|
||||
|
||||
const PACKAGE_INFO* Packages() const
|
||||
{
|
||||
return m_packageInfo;
|
||||
}
|
||||
|
||||
const PACKAGE_INFO& Package(const size_t index) const
|
||||
{
|
||||
THROW_HR_IF(E_BOUNDS, index >= m_count);
|
||||
return m_packageInfo[index];
|
||||
}
|
||||
|
||||
size_t Count() const
|
||||
{
|
||||
return m_count;
|
||||
}
|
||||
|
||||
private:
|
||||
PACKAGE_INFO* m_packageInfo{};
|
||||
std::unique_ptr<BYTE[]> m_packageInfoBuffer;
|
||||
size_t m_count{};
|
||||
};
|
||||
}
|
||||
|
||||
#endif // PACKAGEINFO_H
|
|
@ -0,0 +1,120 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#if !defined(WINRTINPROCMODULE_H)
|
||||
#define WINRTINPROCMODULE_H
|
||||
|
||||
#include <activationregistration.h>
|
||||
#include <activation.h>
|
||||
|
||||
#include "MddWinRT.h"
|
||||
|
||||
//TODO Components won't respect COM lifetime. workaround to get them in the COM list? See dev\UndockedRegFreeWinRT\catalog.cpp
|
||||
|
||||
namespace MddCore
|
||||
{
|
||||
class WinRTInprocModule
|
||||
{
|
||||
public:
|
||||
WinRTInprocModule() = default;
|
||||
|
||||
WinRTInprocModule(WinRTInprocModule&& other) :
|
||||
m_path(std::move(other.m_path)),
|
||||
m_dll(std::move(other.m_dll)),
|
||||
m_dllGetActivationFactory(std::move(other.m_dllGetActivationFactory))
|
||||
{
|
||||
m_inprocServers.insert(std::make_move_iterator(other.m_inprocServers.begin()), std::make_move_iterator(other.m_inprocServers.end()));
|
||||
}
|
||||
|
||||
~WinRTInprocModule() = default;
|
||||
|
||||
MddCore::WinRT::ThreadingModel Find(const std::wstring& activatableClassId)
|
||||
{
|
||||
auto iterator = m_inprocServers.find(activatableClassId);
|
||||
if (iterator != m_inprocServers.end())
|
||||
{
|
||||
return iterator->second;
|
||||
}
|
||||
return MddCore::WinRT::ThreadingModel::Unknown;
|
||||
}
|
||||
|
||||
void* GetActivationFactory(
|
||||
HSTRING className,
|
||||
const std::wstring& activatableClassId,
|
||||
REFIID iid)
|
||||
{
|
||||
Load();
|
||||
|
||||
IActivationFactory* ifactory{};
|
||||
THROW_IF_FAILED(m_dllGetActivationFactory(className, &ifactory));
|
||||
|
||||
//TODO optimize for IActivationFactory? See GetActivationFactory() in dev\UndockedRegFreeWinRT\catalog.cpp
|
||||
void* factory{};
|
||||
const auto hr{ ifactory->QueryInterface(iid, &factory) };
|
||||
ifactory->Release();
|
||||
THROW_IF_FAILED_MSG(hr, "Error 0x%X in ifactory->QueryInterface(%ls)", hr, activatableClassId.c_str());
|
||||
return factory;
|
||||
}
|
||||
|
||||
public:
|
||||
const std::wstring& Path() const
|
||||
{
|
||||
return m_path;
|
||||
}
|
||||
|
||||
void Path(const std::filesystem::path& path)
|
||||
{
|
||||
m_path = path;
|
||||
}
|
||||
|
||||
const std::unordered_map<std::wstring, MddCore::WinRT::ThreadingModel>& InprocServers() const
|
||||
{
|
||||
return m_inprocServers;
|
||||
}
|
||||
|
||||
void AddInprocServer(
|
||||
const std::wstring& activatableClassId,
|
||||
MddCore::WinRT::ThreadingModel threadingModel)
|
||||
{
|
||||
// No dupes allowed
|
||||
auto iterator{ m_inprocServers.find(activatableClassId) };
|
||||
if (iterator != m_inprocServers.end())
|
||||
{
|
||||
THROW_HR_MSG(HRESULT_FROM_WIN32(ERROR_OBJECT_ALREADY_EXISTS), "%ls", activatableClassId.c_str());
|
||||
}
|
||||
|
||||
m_inprocServers[activatableClassId] = threadingModel;
|
||||
}
|
||||
|
||||
private:
|
||||
void Load()
|
||||
{
|
||||
auto lock{ std::unique_lock<std::mutex>(m_lock) };
|
||||
|
||||
if (!m_dll)
|
||||
{
|
||||
wil::unique_hmodule dll{ LoadLibraryExW(m_path.c_str(), nullptr, LOAD_WITH_ALTERED_SEARCH_PATH) };
|
||||
THROW_HR_IF_NULL(HRESULT_FROM_WIN32(GetLastError()), dll);
|
||||
|
||||
auto dllGetActivationFactory{ reinterpret_cast<DllGetActivationFactory>(GetProcAddress(dll.get(), "DllGetActivationFactory")) };
|
||||
THROW_HR_IF_NULL(HRESULT_FROM_WIN32(GetLastError()), dllGetActivationFactory);
|
||||
|
||||
m_dll = std::move(dll);
|
||||
m_dllGetActivationFactory = std::move(dllGetActivationFactory);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
std::wstring m_path;
|
||||
std::unordered_map<std::wstring, MddCore::WinRT::ThreadingModel> m_inprocServers;
|
||||
|
||||
std::mutex m_lock;
|
||||
wil::unique_hmodule m_dll;
|
||||
|
||||
typedef HRESULT(__stdcall* DllGetActivationFactory)(HSTRING, IActivationFactory**);
|
||||
DllGetActivationFactory m_dllGetActivationFactory{};
|
||||
};
|
||||
}
|
||||
|
||||
#endif // WINRTINPROCMODULE_H
|
|
@ -0,0 +1,81 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "WinRTModuleManager.h"
|
||||
|
||||
std::mutex MddCore::WinRTModuleManager::s_lock;
|
||||
std::vector<std::shared_ptr<MddCore::WinRTPackage>> MddCore::WinRTModuleManager::s_winrtPackages;
|
||||
|
||||
bool MddCore::WinRTModuleManager::GetThreadingType(
|
||||
HSTRING className,
|
||||
ABI::Windows::Foundation::ThreadingType& threadingType)
|
||||
{
|
||||
auto lock{ std::unique_lock<std::mutex>(s_lock) };
|
||||
|
||||
auto threadingModel{ MddCore::WinRTModuleManager::GetThreadingModel(className) };
|
||||
if (threadingModel == MddCore::WinRT::ThreadingModel::Unknown)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
THROW_IF_FAILED(ToThreadingType(threadingModel, threadingType));
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
MddCore::WinRT::ThreadingModel MddCore::WinRTModuleManager::GetThreadingModel(
|
||||
HSTRING className)
|
||||
{
|
||||
if (!s_winrtPackages.empty())
|
||||
{
|
||||
std::wstring activatableClassId{ WindowsGetStringRawBuffer(className, nullptr) };
|
||||
for (auto& winrtPackage : s_winrtPackages)
|
||||
{
|
||||
auto threadingModel{ winrtPackage->GetThreadingModel(activatableClassId) };
|
||||
if (threadingModel != MddCore::WinRT::ThreadingModel::Unknown)
|
||||
{
|
||||
return threadingModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
return MddCore::WinRT::ThreadingModel::Unknown;
|
||||
}
|
||||
|
||||
void* MddCore::WinRTModuleManager::GetActivationFactory(
|
||||
HSTRING className,
|
||||
REFIID iid)
|
||||
{
|
||||
auto lock{ std::unique_lock<std::mutex>(s_lock) };
|
||||
|
||||
if (!s_winrtPackages.empty())
|
||||
{
|
||||
std::wstring activatableClassId{ WindowsGetStringRawBuffer(className, nullptr) };
|
||||
for (auto& winrtPackage : s_winrtPackages)
|
||||
{
|
||||
auto factory{ winrtPackage->GetActivationFactory(className, activatableClassId, iid) };
|
||||
if (factory)
|
||||
{
|
||||
return factory;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void MddCore::WinRTModuleManager::Insert(
|
||||
size_t index,
|
||||
std::shared_ptr<MddCore::WinRTPackage>& winrtPackage)
|
||||
{
|
||||
auto lock{ std::unique_lock<std::mutex>(s_lock) };
|
||||
|
||||
if (index < s_winrtPackages.size())
|
||||
{
|
||||
s_winrtPackages.insert(s_winrtPackages.begin() + index, std::move(winrtPackage));
|
||||
}
|
||||
else
|
||||
{
|
||||
s_winrtPackages.push_back(std::move(winrtPackage));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#if !defined(WINRTMODULEMANAGER_H)
|
||||
#define WINRTMODULEMANAGER_H
|
||||
|
||||
#include "WinRTPackage.h"
|
||||
|
||||
namespace MddCore
|
||||
{
|
||||
class WinRTModuleManager
|
||||
{
|
||||
public:
|
||||
static bool GetThreadingType(
|
||||
HSTRING className,
|
||||
ABI::Windows::Foundation::ThreadingType& threadingType);
|
||||
|
||||
private:
|
||||
static MddCore::WinRT::ThreadingModel GetThreadingModel(
|
||||
HSTRING className);
|
||||
|
||||
public:
|
||||
static void* GetActivationFactory(
|
||||
HSTRING className,
|
||||
REFIID iid);
|
||||
|
||||
static void Insert(
|
||||
size_t index,
|
||||
std::shared_ptr<MddCore::WinRTPackage>& winrtPackage);
|
||||
|
||||
private:
|
||||
static std::mutex s_lock;
|
||||
static std::vector<std::shared_ptr<MddCore::WinRTPackage>> s_winrtPackages;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // WINRTMODULEMANAGER_H
|
|
@ -0,0 +1,231 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include "WinRTPackage.h"
|
||||
|
||||
MddCore::WinRT::ThreadingModel MddCore::WinRTPackage::GetThreadingModel(
|
||||
const std::wstring& activatableClassId)
|
||||
{
|
||||
// Find the activation factory
|
||||
if (!m_inprocModules.empty())
|
||||
{
|
||||
for (size_t index = 0; index < m_inprocModules.size(); ++index)
|
||||
{
|
||||
auto& inprocModule{ m_inprocModules[index] };
|
||||
|
||||
auto threadingModel{ inprocModule.Find(activatableClassId) };
|
||||
if (threadingModel != MddCore::WinRT::ThreadingModel::Unknown)
|
||||
{
|
||||
return threadingModel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Not found
|
||||
return MddCore::WinRT::ThreadingModel::Unknown;
|
||||
}
|
||||
|
||||
void* MddCore::WinRTPackage::GetActivationFactory(
|
||||
HSTRING className,
|
||||
const std::wstring& activatableClassId,
|
||||
REFIID iid)
|
||||
{
|
||||
// Find the activation factory
|
||||
if (!m_inprocModules.empty())
|
||||
{
|
||||
for (size_t index = 0; index < m_inprocModules.size(); ++index)
|
||||
{
|
||||
auto& inprocModule{ m_inprocModules[index] };
|
||||
|
||||
auto threadingModel{ inprocModule.Find(activatableClassId) };
|
||||
if (threadingModel != MddCore::WinRT::ThreadingModel::Unknown)
|
||||
{
|
||||
//TODO change to return shared_ptr<inprocModule> rather than void*factory
|
||||
// so the object (and its DLL) isn't destroyed while upstack is calling the factory*.
|
||||
// Or perhaps caller's changed to return shared_ptr<winrtPackage>? TBD
|
||||
return inprocModule.GetActivationFactory(className, activatableClassId, iid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Not found
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/// Parse a package's appxmanifest for WinRT inproc server definitions e.g.
|
||||
/// ~~~~~
|
||||
/// <Extension Category="windows.inProcessServer"...>
|
||||
/// <InProcessServer>
|
||||
/// <Path>foo.dll</Path>
|
||||
/// <ActivatableClass ActivatableClassId="Blah.YaddaYadda" ThreadingModel="both"/>
|
||||
/// ~~~~~
|
||||
/// A package can have multiple such <Extension>s but each has 1 <InProcessServer> child element.
|
||||
///
|
||||
/// <InProcessServer> is unique in the manifest. <InProcessServer> isn't used by anything else in the manifest
|
||||
/// and unlikely to be so it's safe to target this as our 'root' of parsing activity.
|
||||
///
|
||||
/// <InProcessServer>'s children:
|
||||
/// * 1x <Path>
|
||||
/// * 1+ <ActivatableClassId>
|
||||
///
|
||||
/// <ActivatableClass>'s attributes:
|
||||
/// * ActivatableClassId=string
|
||||
/// * ThreadingModel = "both" | "STA" | "MTA"
|
||||
void MddCore::WinRTPackage::ParseAppxManifest()
|
||||
{
|
||||
std::filesystem::path filename{ m_packagePath };
|
||||
filename /= L"appxmanifest.xml";
|
||||
wil::com_ptr<IStream> appxManifestStream;
|
||||
THROW_IF_FAILED_MSG(SHCreateStreamOnFileEx(filename.c_str(), STGM_READ, FILE_ATTRIBUTE_NORMAL, FALSE, nullptr, appxManifestStream.addressof()), "Error in SHCreateSreamOnFileEx(%ls)", filename.c_str());
|
||||
|
||||
wil::com_ptr<IXmlReader> xmlReader;
|
||||
auto appxManifestIUnknown = appxManifestStream.query<IUnknown>();
|
||||
THROW_IF_FAILED(CreateXmlReader(__uuidof(IXmlReader), reinterpret_cast<void**>(xmlReader.addressof()), nullptr));
|
||||
THROW_IF_FAILED(xmlReader->SetInput(appxManifestIUnknown.get()));
|
||||
for (;;)
|
||||
{
|
||||
XmlNodeType nodeType{};
|
||||
const HRESULT hr{ xmlReader->Read(&nodeType) };
|
||||
THROW_IF_FAILED_MSG(hr, "Error 0x%X reading %ls", hr, filename.c_str());
|
||||
if (hr == S_FALSE)
|
||||
{
|
||||
// S_FALSE = end-of-input. We're done
|
||||
break;
|
||||
}
|
||||
|
||||
if (nodeType == XmlNodeType_Element)
|
||||
{
|
||||
PCWSTR localName{};
|
||||
THROW_IF_FAILED(xmlReader->GetLocalName(&localName, nullptr));
|
||||
if (CompareStringOrdinal(localName, -1, L"InProcessServer", -1, FALSE) == CSTR_EQUAL)
|
||||
{
|
||||
ParseAppxManifest_InProcessServer(xmlReader.get(), filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// See ParseAppxManifest for <InProcessServer>'s schema
|
||||
void MddCore::WinRTPackage::ParseAppxManifest_InProcessServer(
|
||||
IXmlReader* xmlReader,
|
||||
const std::filesystem::path& filename)
|
||||
{
|
||||
MddCore::WinRTInprocModule winrtInProcModule;
|
||||
for (;;)
|
||||
{
|
||||
XmlNodeType nodeType{};
|
||||
HRESULT hr{ xmlReader->Read(&nodeType) };
|
||||
THROW_IF_FAILED_MSG(hr, "Error 0x%X parsing <InProcessServer> in %ls", hr, filename.c_str());
|
||||
if (hr == S_FALSE)
|
||||
{
|
||||
// S_FALSE = end-of-input. We're done
|
||||
break;
|
||||
}
|
||||
|
||||
if (nodeType == XmlNodeType_Element)
|
||||
{
|
||||
PCWSTR localName{};
|
||||
THROW_IF_FAILED(xmlReader->GetLocalName(&localName, nullptr));
|
||||
if (CompareStringOrdinal(localName, -1, L"Path", -1, FALSE) == CSTR_EQUAL)
|
||||
{
|
||||
std::filesystem::path absoluteFilename{ m_packagePath };
|
||||
absoluteFilename /= ParseAppxManifest_GetElementText(xmlReader, L"Path", filename);
|
||||
winrtInProcModule.Path(absoluteFilename);
|
||||
}
|
||||
else if (CompareStringOrdinal(localName, -1, L"ActivatableClass", -1, FALSE) == CSTR_EQUAL)
|
||||
{
|
||||
// Walk all attributes parsing those we're interested in.
|
||||
// Use this pattern for better performance than multiple MoveToAttributeByName calls.
|
||||
std::wstring activatableClassId;
|
||||
MddCore::WinRT::ThreadingModel threadingModel{};
|
||||
hr = xmlReader->MoveToFirstAttribute();
|
||||
for (;;)
|
||||
{
|
||||
THROW_IF_FAILED_MSG(hr, "Error 0x%X parsing <ActivatableClass> in %ls", hr, filename.c_str());
|
||||
if (hr == S_FALSE)
|
||||
{
|
||||
// S_FALSE = end-of-input. We're done
|
||||
break;
|
||||
}
|
||||
|
||||
THROW_IF_FAILED(xmlReader->GetLocalName(&localName, nullptr));
|
||||
|
||||
PCWSTR value{};
|
||||
THROW_IF_FAILED(xmlReader->GetValue(&value, nullptr));
|
||||
|
||||
if (CompareStringOrdinal(localName, -1, L"ActivatableClassId", -1, FALSE) == CSTR_EQUAL)
|
||||
{
|
||||
activatableClassId = value;
|
||||
}
|
||||
else if (CompareStringOrdinal(localName, -1, L"ThreadingModel", -1, FALSE) == CSTR_EQUAL)
|
||||
{
|
||||
if (CompareStringOrdinal(value, -1, L"both", -1, FALSE) == CSTR_EQUAL)
|
||||
{
|
||||
threadingModel = MddCore::WinRT::ThreadingModel::Both;
|
||||
}
|
||||
else if (CompareStringOrdinal(value, -1, L"STA", -1, FALSE) == CSTR_EQUAL)
|
||||
{
|
||||
threadingModel = MddCore::WinRT::ThreadingModel::STA;
|
||||
}
|
||||
else if (CompareStringOrdinal(value, -1, L"MTA", -1, FALSE) == CSTR_EQUAL)
|
||||
{
|
||||
threadingModel = MddCore::WinRT::ThreadingModel::MTA;
|
||||
}
|
||||
else
|
||||
{
|
||||
THROW_HR_MSG(APPX_E_INVALID_MANIFEST, "Error 0x%X parsing <ActivatableClass> in %ls", hr, filename.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
// Next!
|
||||
hr =xmlReader->MoveToNextAttribute();
|
||||
}
|
||||
THROW_HR_IF_MSG(APPX_E_INVALID_MANIFEST, activatableClassId.empty() || (threadingModel == MddCore::WinRT::ThreadingModel::Unknown), "Error 0x%X parsing <ActivatableClass> in %ls", hr, filename.c_str());
|
||||
winrtInProcModule.AddInprocServer(activatableClassId, threadingModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
THROW_HR_IF_MSG(APPX_E_INVALID_MANIFEST, winrtInProcModule.Path().empty() || winrtInProcModule.InprocServers().empty(), "Error 0x%X parsing <ActivatableClass> in %ls", APPX_E_INVALID_MANIFEST, filename.c_str());
|
||||
|
||||
// Gotcha!
|
||||
m_inprocModules.push_back(std::move(winrtInProcModule));
|
||||
}
|
||||
|
||||
std::wstring MddCore::WinRTPackage::ParseAppxManifest_GetElementText(
|
||||
IXmlReader* xmlReader,
|
||||
PCWSTR elementName,
|
||||
const std::filesystem::path& filename)
|
||||
{
|
||||
std::wstring text;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
XmlNodeType nodeType{};
|
||||
HRESULT hr{ xmlReader->Read(&nodeType) };
|
||||
THROW_IF_FAILED_MSG(hr, "Error 0x%X parsing <%ls> in %ls", hr, elementName, filename.c_str());
|
||||
if (hr == S_FALSE)
|
||||
{
|
||||
// S_FALSE = end-of-input. We're done
|
||||
break;
|
||||
}
|
||||
|
||||
if (nodeType == XmlNodeType_EndElement)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else if ((nodeType == XmlNodeType_Text) || (nodeType == XmlNodeType_CDATA))
|
||||
{
|
||||
PCWSTR value{};
|
||||
THROW_IF_FAILED(xmlReader->GetValue(&value, nullptr));
|
||||
text.append(value);
|
||||
}
|
||||
else if (nodeType == XmlNodeType_Element)
|
||||
{
|
||||
THROW_HR_MSG(E_UNEXPECTED, "Error 0x%X parsing <%ls> in %ls", E_UNEXPECTED, elementName, filename.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#if !defined(WINRTPACKAGE_H)
|
||||
#define WINRTPACKAGE_H
|
||||
|
||||
#include <xmllite.h>
|
||||
|
||||
#include "WinRTInprocModule.h"
|
||||
|
||||
namespace MddCore
|
||||
{
|
||||
class WinRTPackage
|
||||
{
|
||||
public:
|
||||
WinRTPackage() = default;
|
||||
|
||||
WinRTPackage(
|
||||
MDD_PACKAGEDEPENDENCY_CONTEXT context,
|
||||
const std::wstring& packagePath) :
|
||||
m_context(context),
|
||||
m_packagePath(packagePath)
|
||||
{
|
||||
}
|
||||
|
||||
WinRTPackage(WinRTPackage&& other) :
|
||||
m_context(std::move(other.m_context)),
|
||||
m_packagePath(std::move(other.m_packagePath))
|
||||
{
|
||||
for (auto& inprocModule : other.m_inprocModules)
|
||||
{
|
||||
m_inprocModules.push_back(std::move(inprocModule));
|
||||
}
|
||||
}
|
||||
|
||||
~WinRTPackage() = default;
|
||||
|
||||
MddCore::WinRT::ThreadingModel GetThreadingModel(
|
||||
const std::wstring& activatableClassId);
|
||||
|
||||
void* GetActivationFactory(
|
||||
HSTRING className,
|
||||
const std::wstring& activatableClassId,
|
||||
REFIID iid);
|
||||
|
||||
void ParseAppxManifest();
|
||||
|
||||
private:
|
||||
void ParseAppxManifest_InProcessServer(
|
||||
IXmlReader* xmlReader,
|
||||
const std::filesystem::path& filename);
|
||||
|
||||
static std::wstring ParseAppxManifest_GetElementText(
|
||||
IXmlReader* xmlReader,
|
||||
PCWSTR elementName,
|
||||
const std::filesystem::path& filename);
|
||||
|
||||
private:
|
||||
MDD_PACKAGEDEPENDENCY_CONTEXT m_context{};
|
||||
std::wstring m_packagePath;
|
||||
std::vector<WinRTInprocModule> m_inprocModules;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // WINRTPACKAGE_H
|
|
@ -0,0 +1,31 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include <appmodel.h>
|
||||
|
||||
// Modern variants of appmodel.h
|
||||
namespace appmodel
|
||||
{
|
||||
inline std::wstring GetPackagePath(PCWSTR packageFullName)
|
||||
{
|
||||
// Paths can be long but typically short(ish). We can use a quick fixed buffer
|
||||
// as an optimization and fallback to dynamic allocation if need be
|
||||
WCHAR path[MAX_PATH];
|
||||
UINT32 pathLength{ ARRAYSIZE(path) };
|
||||
const auto rc{ ::GetPackagePathByFullName(packageFullName, &pathLength, path) };
|
||||
if (rc == ERROR_SUCCESS)
|
||||
{
|
||||
return std::wstring(path);
|
||||
}
|
||||
else if (rc != ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
THROW_WIN32(rc);
|
||||
}
|
||||
|
||||
// It's bigger than a breadbox. Allocate memory
|
||||
std::unique_ptr<WCHAR[]> pathBuffer{ std::make_unique<WCHAR[]>(pathLength) };
|
||||
THROW_IF_NULL_ALLOC(pathBuffer);
|
||||
THROW_IF_WIN32_ERROR(::GetPackagePathByFullName(packageFullName, &pathLength, pathBuffer.get()));
|
||||
return std::wstring(pathBuffer.get());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
#include <appmodel.h>
|
||||
#include <shlwapi.h>
|
||||
#include <xmllite.h>
|
||||
|
||||
#include <unknwn.h>
|
||||
#include <appmodel.h>
|
||||
#include <MsixDynamicDependency.h>
|
||||
|
||||
#include <filesystem>
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
|
||||
#include <wil/cppwinrt.h>
|
||||
#include <wil/token_helpers.h>
|
||||
#include <wil/win32_helpers.h>
|
||||
#include <wil/resource.h>
|
||||
#include <wil/result_macros.h>
|
||||
#include <wil/com.h>
|
||||
|
||||
#include <appmodel_msixdynamicdependency.h>
|
||||
#include <wil_msixdynamicdependency.h>
|
||||
|
||||
#include <winrt/Windows.Foundation.h>
|
||||
#include <winrt/Windows.Foundation.Collections.h>
|
||||
|
||||
#include <winrt/Windows.ApplicationModel.h>
|
||||
#include <winrt/Windows.Data.Json.h>
|
||||
#include <winrt/Windows.Management.Deployment.h>
|
||||
#include <winrt/Windows.Storage.h>
|
||||
#include <winrt/Windows.System.h>
|
|
@ -0,0 +1,49 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
namespace MddCore
|
||||
{
|
||||
inline winrt::hstring utf8_to_hstring(PCSTR utf8)
|
||||
{
|
||||
if (!utf8)
|
||||
{
|
||||
return winrt::hstring();
|
||||
}
|
||||
|
||||
const auto lengthIncludingNullTerminator{ MultiByteToWideChar(CP_UTF8, 0, utf8, -1, nullptr, 0) };
|
||||
THROW_IF_WIN32_BOOL_FALSE(lengthIncludingNullTerminator);
|
||||
|
||||
std::unique_ptr<WCHAR[]> s{ std::make_unique<WCHAR[]>(lengthIncludingNullTerminator) };
|
||||
|
||||
THROW_IF_WIN32_BOOL_FALSE(MultiByteToWideChar(CP_UTF8, 0, utf8, -1, s.get(), lengthIncludingNullTerminator));
|
||||
s[lengthIncludingNullTerminator - 1] = L'\0';
|
||||
return winrt::hstring(s.get());
|
||||
}
|
||||
|
||||
inline std::string to_utf8(PCWSTR s)
|
||||
{
|
||||
if (!s)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const auto lengthIncludingNullTerminator{ WideCharToMultiByte(CP_UTF8, 0, s, -1, nullptr, 0, nullptr, nullptr) };
|
||||
THROW_IF_WIN32_BOOL_FALSE(lengthIncludingNullTerminator);
|
||||
|
||||
std::unique_ptr<char[]> utf8{ std::make_unique<char[]>(lengthIncludingNullTerminator) };
|
||||
|
||||
THROW_IF_WIN32_BOOL_FALSE(WideCharToMultiByte(CP_UTF8, 0, s, -1, utf8.get(), lengthIncludingNullTerminator, nullptr, nullptr));
|
||||
utf8[lengthIncludingNullTerminator - 1] = '\0';
|
||||
return std::string(utf8.get());
|
||||
}
|
||||
|
||||
inline std::string to_utf8(const std::wstring& s)
|
||||
{
|
||||
return to_utf8(s.c_str());
|
||||
}
|
||||
|
||||
inline std::string to_utf8(const winrt::hstring& s)
|
||||
{
|
||||
return to_utf8(s.c_str());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
namespace wil
|
||||
{
|
||||
#if defined(_APISETLIBLOADER_) && !defined(__WIL_APISETLIBLOADER_)
|
||||
#define __WIL_APISETLIBLOADER_
|
||||
typedef unique_any<DLL_DIRECTORY_COOKIE, decltype(&::RemoveDllDirectory), ::RemoveDllDirectory> unique_dll_directory_cookie;
|
||||
#endif // __WIL_APISETLIBLOADER_
|
||||
|
||||
#if defined(MSIXDYNAMICDEPENDENCY_H) && !defined(__WIL_MSIXDYNAMICDEPENDENCY_H)
|
||||
#define __WIL_MSIXDYNAMICDEPENDENCY_H
|
||||
typedef unique_any<MDD_PACKAGEDEPENDENCY_CONTEXT, decltype(&::MddRemovePackageDependency), ::MddRemovePackageDependency> unique_package_dependency_context;
|
||||
#endif // __WIL_MSIXDYNAMICDEPENDENCY_H
|
||||
|
||||
#if defined(_APPMODEL_H_) && !defined(__WIL_APPMODEL_H_) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||
#define __WIL_APPMODEL_H_
|
||||
typedef unique_any<PACKAGE_INFO_REFERENCE, decltype(&::ClosePackageInfo), ::ClosePackageInfo> unique_package_info_reference;
|
||||
#endif // __WIL_APPMODEL_H_
|
||||
#if defined(__WIL_APPMODEL_H_) && !defined(__WIL_APPMODEL_H_STL) && defined(WIL_RESOURCE_STL)
|
||||
#define __WIL_APPMODEL_H_STL
|
||||
typedef shared_any<unique_package_info_reference> shared_package_info_reference;
|
||||
typedef weak_any<shared_package_info_reference> weak_package_info_reference;
|
||||
#endif // __WIL_APPMODEL_H_STL
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace winrt
|
||||
{
|
||||
// Per https://docs.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/interop-winrt-abi#convert_from_abi-function
|
||||
template <typename T>
|
||||
T convert_from_abi(::IUnknown* from)
|
||||
{
|
||||
T to{ nullptr }; // `T` is a projected type.
|
||||
|
||||
winrt::check_hresult(from->QueryInterface(winrt::guid_of<T>(),
|
||||
winrt::put_abi(to)));
|
||||
|
||||
return to;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace winrt
|
||||
{
|
||||
using namespace winrt::Microsoft::ApplicationModel::DynamicDependency;
|
||||
}
|
|
@ -0,0 +1,427 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|ARM64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{1a41bb90-cc34-4edd-9a27-50714cdbc169}</ProjectGuid>
|
||||
<RootNamespace>DynamicDependency.DataStore.ProxyStub</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>DynamicDependency.DataStore.ProxyStub</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
<IntDir>$(PlatformTarget)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
<IntDir>$(PlatformTarget)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>DynamicDependency.DataStore.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_ARM_;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>DynamicDependency.DataStore.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_ARM_;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>DynamicDependency.DataStore.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>DynamicDependency.DataStore.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>DynamicDependency.DataStore.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>DynamicDependency.DataStore.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreAllDefaultLibraries>
|
||||
</IgnoreAllDefaultLibraries>
|
||||
<ModuleDefinitionFile>DynamicDependency.DataStore.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>DynamicDependency.DataStore.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(PlatformTarget)\$(Configuration)\dlldata.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(PlatformTarget)\$(Configuration)\DynamicDependencyDataStore_i.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(PlatformTarget)\$(Configuration)\DynamicDependencyDataStore_p.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="DynamicDependencyDataStore.idl" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="DynamicDependency.DataStore.def" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<PublicHeaders Include="$(MSBuildThisFileDirectory)$(PlatformTarget)\$(Configuration)\DynamicDependencyDataStore_h.h" />
|
||||
<PublicHeaders Include="$(MSBuildThisFileDirectory)DynamicDependencyDataStore.idl" />
|
||||
</ItemGroup>
|
||||
<!-- Include header files from the dev chunks -->
|
||||
<Target Name="CopyFiles" AfterTargets="AfterBuild">
|
||||
<Copy SourceFiles="@(PublicHeaders)" DestinationFolder="$(OutDir)" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="framework.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="pch.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(PlatformTarget)\$(Configuration)\dlldata.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(PlatformTarget)\$(Configuration)\DynamicDependencyDataStore_i.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(PlatformTarget)\$(Configuration)\DynamicDependencyDataStore_p.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="DynamicDependencyDataStore.idl">
|
||||
<Filter>Source Files</Filter>
|
||||
</Midl>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="DynamicDependency.DataStore.def">
|
||||
<Filter>Source Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,3 @@
|
|||
EXPORTS
|
||||
DllCanUnloadNow PRIVATE
|
||||
DllGetClassObject PRIVATE
|
|
@ -0,0 +1,26 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
import "oaidl.idl";
|
||||
import "ocidl.idl";
|
||||
|
||||
[object]
|
||||
[uuid(DDEB4D6A-E146-476d-B729-0BFB1A29A86E)]
|
||||
[pointer_default(unique)]
|
||||
interface IDynamicDependencyDataStore : IUnknown
|
||||
{
|
||||
HRESULT GetApplicationData([out, retval] IUnknown** applicationData);
|
||||
|
||||
HRESULT GetPackageFullName([out, retval] LPWSTR* packageFullName);
|
||||
};
|
||||
|
||||
[uuid(1BF712E5-41ED-46a5-8402-2D40725F691E)]
|
||||
[version(1.0)]
|
||||
library DynamicDependencyDataStoreLib
|
||||
{
|
||||
[uuid(D1AD16C7-EC59-4765-BF95-9A243EB00507)]
|
||||
coclass DynamicDependencyDataStore
|
||||
{
|
||||
[default] interface IDynamicDependencyDataStore;
|
||||
};
|
||||
};
|
|
@ -0,0 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#include <windows.h>
|
|
@ -0,0 +1,4 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#ifndef PCH_H
|
||||
#define PCH_H
|
||||
|
||||
#include "framework.h"
|
||||
|
||||
#endif //PCH_H
|
|
@ -0,0 +1,356 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|ARM64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{51293dfa-614b-4355-a60d-b30df3228fd1}</ProjectGuid>
|
||||
<RootNamespace>DynamicDependency.DataStore</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>DynamicDependency.DataStore</ProjectName>
|
||||
<CppWinRTModernIDL>true</CppWinRTModernIDL>
|
||||
<CppWinRTFastAbi>true</CppWinRTFastAbi>
|
||||
<CppWinRTOptimized>true</CppWinRTOptimized>
|
||||
<CppWinRTGenerateWindowsMetadata>true</CppWinRTGenerateWindowsMetadata>
|
||||
<CppWinRTNamespaceMergeDepth>9</CppWinRTNamespaceMergeDepth>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependency.DataStore.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="winmain.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DynamicDependency.DataStore.ProxyStub\DynamicDependency.DataStore.ProxyStub.vcxproj">
|
||||
<Project>{1a41bb90-cc34-4edd-9a27-50714cdbc169}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
</ImportGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200703.9\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="winmain.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <unknwn.h>
|
||||
#include <appmodel.h>
|
||||
|
||||
#include <thread>
|
||||
#include <mutex>
|
||||
|
||||
// Temporarily disable C4324 because WRL generates a false (well, irrelevant) warning
|
||||
// 'Microsoft::WRL::Details::StaticStorage<Microsoft::WRL::Details::OutOfProcModuleBase<ModuleT>::GenericReleaseNotifier<T>,Microsoft::WRL::Details::StorageInstance::OutOfProcCallbackBuffer1,ModuleT>': structure was padded due to alignment specifier
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4324)
|
||||
#include <wrl.h>
|
||||
#pragma warning(pop)
|
||||
|
||||
#include <wil/cppwinrt.h>
|
||||
#include <wil/token_helpers.h>
|
||||
#include <wil/resource.h>
|
||||
#include <wil/result_macros.h>
|
||||
|
||||
#include <winrt/Windows.Foundation.h>
|
||||
#include <winrt/Windows.Foundation.Collections.h>
|
||||
|
||||
#include <winrt/Windows.Storage.h>
|
|
@ -0,0 +1,83 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include <DynamicDependencyDataStore_h.h>
|
||||
|
||||
// Temporarily disable C4324 because WRL generates a false (well, irrelevant) warning
|
||||
// 'Microsoft::WRL::Details::StaticStorage<Microsoft::WRL::Details::OutOfProcModuleBase<ModuleT>::GenericReleaseNotifier<T>,Microsoft::WRL::Details::StorageInstance::OutOfProcCallbackBuffer1,ModuleT>': structure was padded due to alignment specifier
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4324)
|
||||
#include <wrl.h>
|
||||
#pragma warning(pop)
|
||||
|
||||
using namespace Microsoft::WRL;
|
||||
|
||||
// Implement the DataStore as a classic COM Out-of-Proc server, via WRL
|
||||
// See https://docs.microsoft.com/en-us/cpp/cppcx/wrl/how-to-create-a-classic-com-component-using-wrl?redirectedfrom=MSDN&view=vs-2019 for more details
|
||||
|
||||
struct __declspec(uuid("D1AD16C7-EC59-4765-BF95-9A243EB00507")) DynamicDependencyDataStoreImpl WrlFinal : RuntimeClass<RuntimeClassFlags<ClassicCom>, IDynamicDependencyDataStore>
|
||||
{
|
||||
STDMETHODIMP GetApplicationData(/*[out, retval]*/ IUnknown** applicationData)
|
||||
{
|
||||
*applicationData = nullptr;
|
||||
|
||||
auto appData = winrt::Windows::Storage::ApplicationData::Current();
|
||||
auto appDataIUnkown = winrt::get_unknown(appData);
|
||||
winrt::copy_to_abi(appDataIUnkown, *applicationData);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP GetPackageFullName(/*[out, retval]*/ PWSTR* packageFullName)
|
||||
{
|
||||
*packageFullName = nullptr;
|
||||
|
||||
WCHAR fullName[PACKAGE_FULL_NAME_MAX_LENGTH + 1]{};
|
||||
UINT32 fullNameLength = ARRAYSIZE(fullName);
|
||||
RETURN_IF_FAILED(GetCurrentPackageFullName(&fullNameLength, fullName));
|
||||
auto fullNameCoTaskMem = wil::make_cotaskmem_string_nothrow(fullName);
|
||||
RETURN_IF_NULL_ALLOC(fullNameCoTaskMem);
|
||||
|
||||
*packageFullName = fullNameCoTaskMem.release();
|
||||
return S_OK;
|
||||
}
|
||||
};
|
||||
CoCreatableClass(DynamicDependencyDataStoreImpl);
|
||||
|
||||
wil::unique_event g_endOfTheLine;
|
||||
|
||||
void EndOfTheLine()
|
||||
{
|
||||
g_endOfTheLine.SetEvent();
|
||||
}
|
||||
|
||||
int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, PSTR /*lpCmdLine*/, int /*nCmdShow*/)
|
||||
{
|
||||
::CoInitializeEx(nullptr, COINITBASE_MULTITHREADED);
|
||||
|
||||
wil::unique_event endOfTheLine(::CreateEventW(nullptr, TRUE, FALSE, nullptr));
|
||||
RETURN_LAST_ERROR_IF_NULL(endOfTheLine);
|
||||
g_endOfTheLine = std::move(endOfTheLine);
|
||||
|
||||
auto& module = Module<OutOfProc>::Create(EndOfTheLine);
|
||||
RETURN_IF_FAILED(module.RegisterObjects());
|
||||
|
||||
g_endOfTheLine.wait();
|
||||
|
||||
(void)LOG_IF_FAILED(module.UnregisterObjects());
|
||||
module.Terminate();
|
||||
|
||||
::CoUninitialize();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
STDAPI_(BOOL) DllMain(_In_opt_ HINSTANCE hinst, DWORD reason, _In_opt_ void*)
|
||||
{
|
||||
if (reason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
DisableThreadLibraryCalls(hinst);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
|
@ -0,0 +1,438 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|ARM64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{8c79c46d-1577-44ca-83df-88b74c3e4586}</ProjectGuid>
|
||||
<RootNamespace>DynamicDependencyLifetimeManager.ProxyStub</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>DynamicDependencyLifetimeManager.ProxyStub</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<CustomBuildAfterTargets>PostBuildEvent</CustomBuildAfterTargets>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)\..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>DynamicDependencyLifetimeManager.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<AdditionalIncludeDirectories>$(OutDir)\..\IDynamicDependencyLifetimeManager</AdditionalIncludeDirectories>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_ARM_;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)\..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>DynamicDependencyLifetimeManager.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<AdditionalIncludeDirectories>$(OutDir)\..\IDynamicDependencyLifetimeManager</AdditionalIncludeDirectories>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_ARM_;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)\..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>DynamicDependencyLifetimeManager.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<AdditionalIncludeDirectories>$(OutDir)\..\IDynamicDependencyLifetimeManager</AdditionalIncludeDirectories>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)\..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>DynamicDependencyLifetimeManager.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<AdditionalIncludeDirectories>$(OutDir)\..\IDynamicDependencyLifetimeManager</AdditionalIncludeDirectories>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)\..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>DynamicDependencyLifetimeManager.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<AdditionalIncludeDirectories>$(OutDir)\..\IDynamicDependencyLifetimeManager</AdditionalIncludeDirectories>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)\..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>DynamicDependencyLifetimeManager.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<AdditionalIncludeDirectories>$(OutDir)\..\IDynamicDependencyLifetimeManager</AdditionalIncludeDirectories>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)\..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreAllDefaultLibraries>
|
||||
</IgnoreAllDefaultLibraries>
|
||||
<ModuleDefinitionFile>DynamicDependencyLifetimeManager.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<AdditionalIncludeDirectories>$(OutDir)\..\IDynamicDependencyLifetimeManager</AdditionalIncludeDirectories>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)\..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ModuleDefinitionFile>DynamicDependencyLifetimeManager.def</ModuleDefinitionFile>
|
||||
</Link>
|
||||
<Midl>
|
||||
<AdditionalIncludeDirectories>$(OutDir)\..\IDynamicDependencyLifetimeManager</AdditionalIncludeDirectories>
|
||||
<DllDataFileName>dlldata.c</DllDataFileName>
|
||||
<GenerateTypeLibrary>false</GenerateTypeLibrary>
|
||||
<OutputDirectory>$(PlatformTarget)\$(Configuration)\</OutputDirectory>
|
||||
</Midl>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="$(PlatformTarget)\$(Configuration)\dlldata.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(PlatformTarget)\$(Configuration)\DynamicDependencyLifetimeManager_i.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(PlatformTarget)\$(Configuration)\DynamicDependencyLifetimeManager_p.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="DynamicDependencyLifetimeManager.idl" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="DynamicDependencyLifetimeManager.def" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<PublicHeaders Include="$(MSBuildThisFileDirectory)$(PlatformTarget)\$(Configuration)\DynamicDependencyLifetimeManager_h.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\IDynamicDependencyLifetimeManager\IDynamicDependencyLifetimeManager.vcxproj">
|
||||
<Project>{ccd23028-b9d3-410b-836e-20b2e7c08451}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<!-- Include header files from the dev chunks -->
|
||||
<Target Name="CopyFiles" AfterTargets="AfterBuild">
|
||||
<Copy SourceFiles="@(PublicHeaders)" DestinationFolder="$(OutDir)" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="framework.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="pch.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(PlatformTarget)\$(Configuration)\dlldata.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(PlatformTarget)\$(Configuration)\DynamicDependencyLifetimeManager_i.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(PlatformTarget)\$(Configuration)\DynamicDependencyLifetimeManager_p.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="DynamicDependencyLifetimeManager.idl">
|
||||
<Filter>Source Files</Filter>
|
||||
</Midl>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="DynamicDependencyLifetimeManager.def">
|
||||
<Filter>Source Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,3 @@
|
|||
EXPORTS
|
||||
DllCanUnloadNow PRIVATE
|
||||
DllGetClassObject PRIVATE
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
import "oaidl.idl";
|
||||
import "ocidl.idl";
|
||||
|
||||
#include "IDynamicDependencyLifetimeManager.idl"
|
||||
|
||||
[uuid(1BF712E5-41ED-46a5-8402-2D40725F691E)]
|
||||
[version(1.0)]
|
||||
library MsixDynamicDependency
|
||||
{
|
||||
[uuid(32E7CF70-038C-429a-BD49-88850F1B4A11)]
|
||||
coclass DynamicDependencyLifetimeManager
|
||||
{
|
||||
[default] interface IDynamicDependencyLifetimeManager;
|
||||
};
|
||||
};
|
|
@ -0,0 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#include <windows.h>
|
|
@ -0,0 +1,4 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
|
@ -0,0 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#ifndef PCH_H
|
||||
#define PCH_H
|
||||
|
||||
#include "framework.h"
|
||||
|
||||
#endif //PCH_H
|
|
@ -0,0 +1,347 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|ARM64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{2e5bf0d2-78fa-4b60-a341-f65a0d58bd86}</ProjectGuid>
|
||||
<RootNamespace>DynamicDependencyLifetimeManager</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<ProjectName>DynamicDependencyLifetimeManager</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependencyLifetimeManager.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependencyLifetimeManager.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependencyLifetimeManager.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependencyLifetimeManager.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependencyLifetimeManager.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependencyLifetimeManager.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependencyLifetimeManager.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory);$(OutDir)..\DynamicDependencyLifetimeManager.ProxyStub;$(OutDir)..\ProjectReunion_BootstrapDLL</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<AdditionalDependencies>onecore.lib;onecoreuap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<ProjectReference>
|
||||
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||
</ProjectReference>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="winmain.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DynamicDependencyLifetimeManager.ProxyStub\DynamicDependencyLifetimeManager.ProxyStub.vcxproj">
|
||||
<Project>{8c79c46d-1577-44ca-83df-88b74c3e4586}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
|
||||
</ImportGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="winmain.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,4 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See LICENSE in the project root for license information.
|
||||
|
||||
#include "pch.h"
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче