From d31bfdc0be317b0ddf3fae371d52da9c69c3062c Mon Sep 17 00:00:00 2001 From: Yao Sun Date: Fri, 18 Mar 2022 13:14:40 -0700 Subject: [PATCH 1/9] Add inproc project --- src/AppInstallerCLI.sln | 36 ++ src/AppInstallerCLI/AppInstallerCLI.vcxproj | 4 +- ...osoft.Management.Deployment.InProc.vcxproj | 309 ++++++++++++++++++ ...nagement.Deployment.InProc.vcxproj.filters | 34 ++ .../PropertySheet.props | 16 + .../Source.def | 3 + .../dllmain.cpp | 45 +++ .../packages.config | 5 + .../pch.cpp | 4 + .../pch.h | 4 + src/WinGetServer/WinGetServer.vcxproj | 2 +- 11 files changed, 459 insertions(+), 3 deletions(-) create mode 100644 src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj create mode 100644 src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj.filters create mode 100644 src/Microsoft.Management.Deployment.InProc/PropertySheet.props create mode 100644 src/Microsoft.Management.Deployment.InProc/Source.def create mode 100644 src/Microsoft.Management.Deployment.InProc/dllmain.cpp create mode 100644 src/Microsoft.Management.Deployment.InProc/packages.config create mode 100644 src/Microsoft.Management.Deployment.InProc/pch.cpp create mode 100644 src/Microsoft.Management.Deployment.InProc/pch.h diff --git a/src/AppInstallerCLI.sln b/src/AppInstallerCLI.sln index e1e19ecdff..fc3645a93b 100644 --- a/src/AppInstallerCLI.sln +++ b/src/AppInstallerCLI.sln @@ -147,6 +147,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WindowsPackageManager", "Wi EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "COMServer", "COMServer\COMServer.vcxitems", "{409CD681-22A4-469D-88AE-CB5E4836E07A}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Management.Deployment.InProc", "Microsoft.Management.Deployment.InProc\Microsoft.Management.Deployment.InProc.vcxproj", "{9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution ManifestSchema\ManifestSchema.vcxitems*{1622da16-914f-4f57-a259-d5169003cc8c}*SharedItemsImports = 4 @@ -1003,6 +1005,40 @@ Global {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.TestRelease|x64.Build.0 = Release|x64 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.TestRelease|x86.ActiveCfg = Release|Win32 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.TestRelease|x86.Build.0 = Release|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Debug|ARM.ActiveCfg = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Debug|ARM64.ActiveCfg = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Debug|x64.ActiveCfg = Debug|x64 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Debug|x64.Build.0 = Debug|x64 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Debug|x86.ActiveCfg = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Debug|x86.Build.0 = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Fuzzing|Any CPU.ActiveCfg = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Fuzzing|Any CPU.Build.0 = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Fuzzing|ARM.ActiveCfg = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Fuzzing|ARM.Build.0 = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Fuzzing|ARM64.ActiveCfg = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Fuzzing|ARM64.Build.0 = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Fuzzing|x64.ActiveCfg = Debug|x64 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Fuzzing|x64.Build.0 = Debug|x64 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Fuzzing|x86.ActiveCfg = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Fuzzing|x86.Build.0 = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Release|Any CPU.ActiveCfg = Release|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Release|ARM.ActiveCfg = Release|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Release|ARM64.ActiveCfg = Release|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Release|x64.ActiveCfg = Release|x64 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Release|x64.Build.0 = Release|x64 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Release|x86.ActiveCfg = Release|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.Release|x86.Build.0 = Release|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|Any CPU.ActiveCfg = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|Any CPU.Build.0 = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|ARM.ActiveCfg = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|ARM.Build.0 = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|ARM64.ActiveCfg = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|ARM64.Build.0 = Debug|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|x64.ActiveCfg = Release|x64 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|x64.Build.0 = Release|x64 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|x86.ActiveCfg = Release|Win32 + {9AC3C6A4-1875-4D3E-BF9C-C31E81EFF6B4}.TestRelease|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/AppInstallerCLI/AppInstallerCLI.vcxproj b/src/AppInstallerCLI/AppInstallerCLI.vcxproj index ad8607ef85..0789e19a64 100644 --- a/src/AppInstallerCLI/AppInstallerCLI.vcxproj +++ b/src/AppInstallerCLI/AppInstallerCLI.vcxproj @@ -191,7 +191,7 @@ Console false - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) + %(AdditionalDependencies) $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) @@ -253,7 +253,7 @@ true true false - wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) + %(AdditionalDependencies) $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) diff --git a/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj b/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj new file mode 100644 index 0000000000..d088752a64 --- /dev/null +++ b/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj @@ -0,0 +1,309 @@ + + + + + true + true + true + 15.0 + Win32Proj + {9ac3c6a4-1875-4d3e-bf9c-c31e81eff6b4} + MicrosoftManagementDeploymentInProc + 10.0.22000.0 + 10.0.17763.0 + true + true + false + + + + + Debug + ARM + + + Debug + ARM64 + + + Debug + Win32 + + + Release + ARM + + + Release + ARM64 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + DynamicLibrary + v140 + v141 + v142 + v143 + Unicode + + + true + true + + + false + true + false + + + Spectre + + + Spectre + + + Spectre + + + Spectre + + + + + + + + + + + + + + + true + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + true + ..\CodeAnalysis.ruleset + + + true + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + true + ..\CodeAnalysis.ruleset + + + true + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + true + ..\CodeAnalysis.ruleset + + + true + $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ + true + true + ..\CodeAnalysis.ruleset + + + false + $(SolutionDir)x86\$(Configuration)\$(ProjectName)\ + true + false + ..\CodeAnalysis.ruleset + + + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + false + ..\CodeAnalysis.ruleset + + + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + false + ..\CodeAnalysis.ruleset + + + false + $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ + true + false + ..\CodeAnalysis.ruleset + + + + Use + pch.h + $(IntDir)pch.pch + _CONSOLE;%(PreprocessorDefinitions) + Level4 + %(AdditionalOptions) /permissive- /bigobj /D _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING + + + + + Disabled + _DEBUG;%(PreprocessorDefinitions) + $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) + $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) + $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) + true + true + true + false + false + false + stdcpp17 + stdcpp17 + stdcpp17 + true + true + true + true + true + true + + + false + Windows + Windows + Windows + Windows + Source.def + Source.def + Source.def + Source.def + wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + + + WIN32;%(PreprocessorDefinitions) + $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) + true + false + stdcpp17 + true + true + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + + + MaxSpeed + true + true + NDEBUG;%(PreprocessorDefinitions) + $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) + $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) + $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) + $(ProjectDir)..\WindowsPackageManager;%(AdditionalIncludeDirectories) + true + true + true + true + Guard + Guard + Guard + Guard + stdcpp17 + stdcpp17 + stdcpp17 + stdcpp17 + true + true + true + true + false + false + false + false + + + true + true + false + Windows + Windows + Windows + Windows + Source.def + Source.def + Source.def + Source.def + wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + $(ProjectDir)..\manifest\shared.manifest %(AdditionalManifestFiles) + + + + + + + + + Create + + + + + {2046b5af-666d-4ce8-8d3e-c32c57908a56} + + + + + + + + + + + + + + + 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}. + + + + + + \ No newline at end of file diff --git a/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj.filters b/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj.filters new file mode 100644 index 0000000000..05f4d2f009 --- /dev/null +++ b/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj.filters @@ -0,0 +1,34 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + + + Source Files + + + Source Files + + + + + + + \ No newline at end of file diff --git a/src/Microsoft.Management.Deployment.InProc/PropertySheet.props b/src/Microsoft.Management.Deployment.InProc/PropertySheet.props new file mode 100644 index 0000000000..c6b0691ddd --- /dev/null +++ b/src/Microsoft.Management.Deployment.InProc/PropertySheet.props @@ -0,0 +1,16 @@ + + + + + + + + \ No newline at end of file diff --git a/src/Microsoft.Management.Deployment.InProc/Source.def b/src/Microsoft.Management.Deployment.InProc/Source.def new file mode 100644 index 0000000000..a0f6f5cee5 --- /dev/null +++ b/src/Microsoft.Management.Deployment.InProc/Source.def @@ -0,0 +1,3 @@ +EXPORTS +DllCanUnloadNow PRIVATE +DllGetClassObject PRIVATE diff --git a/src/Microsoft.Management.Deployment.InProc/dllmain.cpp b/src/Microsoft.Management.Deployment.InProc/dllmain.cpp new file mode 100644 index 0000000000..4df30d3273 --- /dev/null +++ b/src/Microsoft.Management.Deployment.InProc/dllmain.cpp @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#include "pch.h" +#include + +BOOL WINDOWS_PACKAGE_MANAGER_API_CALLING_CONVENTION DllMain( + HMODULE hModule, + DWORD reason, + LPVOID /* lpReserved */) +{ + BOOLEAN success = TRUE; + switch (reason) + { + case DLL_PROCESS_ATTACH: + { + + } + break; + + case DLL_PROCESS_DETACH: + { + if (module != NULL) + { + delete module; + module = NULL; + } + EventUnregisterMicrosoft_Windows_AppxPackagingOM(); + TraceLoggingUnregister(AppxPackagingProvider::Provider()); + + BOOLEAN isProcessExiting = (reserved != NULL); +#if defined(__APPXPACKAGING_DOWNLEVEL_WINRT__) + Appx::Packaging::DownlevelWinrt::DllProcessDetach(isProcessExiting); +#endif + Downlevel::DllProcessDetach(isProcessExiting); +#if !defined(APPX_DOWNLEVEL) + Common::CommonLibraryDllProcessDetach(isProcessExiting); +#endif + } + break; + + default: + break; + } + return success; +} diff --git a/src/Microsoft.Management.Deployment.InProc/packages.config b/src/Microsoft.Management.Deployment.InProc/packages.config new file mode 100644 index 0000000000..5e899619db --- /dev/null +++ b/src/Microsoft.Management.Deployment.InProc/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/Microsoft.Management.Deployment.InProc/pch.cpp b/src/Microsoft.Management.Deployment.InProc/pch.cpp new file mode 100644 index 0000000000..855ee69a1e --- /dev/null +++ b/src/Microsoft.Management.Deployment.InProc/pch.cpp @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +#include "pch.h" diff --git a/src/Microsoft.Management.Deployment.InProc/pch.h b/src/Microsoft.Management.Deployment.InProc/pch.h new file mode 100644 index 0000000000..a479344805 --- /dev/null +++ b/src/Microsoft.Management.Deployment.InProc/pch.h @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#define WIN32_LEAN_AND_MEAN +#include \ No newline at end of file diff --git a/src/WinGetServer/WinGetServer.vcxproj b/src/WinGetServer/WinGetServer.vcxproj index 3d3a06e9b9..6490cbd0b6 100644 --- a/src/WinGetServer/WinGetServer.vcxproj +++ b/src/WinGetServer/WinGetServer.vcxproj @@ -107,7 +107,7 @@ Windows false $(OutDir)..\Microsoft.Management.Deployment;$(OutDir)..\AppInstallerCLICore;$(OutDir)..\JsonCppLib;$(OutDir)..\AppInstallerRepositoryCore;$(OutDir)..\YamlCppLib;$(OutDir)..\AppInstallerCommonCore;$(OutDir)..\cpprestsdk;%(AdditionalLibraryDirectories) - Microsoft.Management.Deployment.Server.lib;AppInstallerCLICore.lib;AppInstallerCommonCore.lib;AppInstallerRepositoryCore.lib;JsonCppLib.lib;YamlCppLib.lib;cpprestsdk.lib;wininet.lib;shell32.lib;winsqlite3.lib;shlwapi.lib;icuuc.lib;icuin.lib;urlmon.lib;Advapi32.lib;winhttp.lib;onecoreuap.lib;msi.lib;%(AdditionalDependencies) + %(AdditionalDependencies) From fc3ebfdb40d434d5803a51b14305cb222d97bfca Mon Sep 17 00:00:00 2001 From: Yao Sun Date: Fri, 18 Mar 2022 16:12:31 -0700 Subject: [PATCH 2/9] Intermediate --- .../dllmain.cpp | 63 +++++++++--------- .../pch.h | 3 +- .../CreateCompositePackageCatalogOptions.h | 7 +- .../FindPackagesOptions.h | 7 +- .../InstallOptions.h | 7 +- .../Microsoft.Management.Deployment.vcxproj | 1 + .../PackageManager.h | 7 +- .../PackageMatchFilter.h | 7 +- .../UninstallOptions.h | 7 +- .../WindowsPackageManager.h | 12 ++++ .../WindowsPackageManager.vcxproj | 16 ++--- src/WindowsPackageManager/main.cpp | 66 +++++++++++++++++++ 12 files changed, 134 insertions(+), 69 deletions(-) diff --git a/src/Microsoft.Management.Deployment.InProc/dllmain.cpp b/src/Microsoft.Management.Deployment.InProc/dllmain.cpp index 4df30d3273..c6cd4b9991 100644 --- a/src/Microsoft.Management.Deployment.InProc/dllmain.cpp +++ b/src/Microsoft.Management.Deployment.InProc/dllmain.cpp @@ -3,43 +3,46 @@ #include "pch.h" #include -BOOL WINDOWS_PACKAGE_MANAGER_API_CALLING_CONVENTION DllMain( - HMODULE hModule, - DWORD reason, - LPVOID /* lpReserved */) +extern "C" { - BOOLEAN success = TRUE; - switch (reason) + BOOL WINDOWS_PACKAGE_MANAGER_API_CALLING_CONVENTION DllMain( + HMODULE /* hModule */, + DWORD reason, + LPVOID /* lpReserved */) { - case DLL_PROCESS_ATTACH: - { - - } - break; + switch (reason) + { + case DLL_PROCESS_ATTACH: + { + if (FAILED(WindowsPackageManagerInProcModuleInitialize())) + { + return FALSE; + } + } + break; - case DLL_PROCESS_DETACH: - { - if (module != NULL) + case DLL_PROCESS_DETACH: { - delete module; - module = NULL; + WindowsPackageManagerInProcModuleTerminate(); } - EventUnregisterMicrosoft_Windows_AppxPackagingOM(); - TraceLoggingUnregister(AppxPackagingProvider::Provider()); + break; - BOOLEAN isProcessExiting = (reserved != NULL); -#if defined(__APPXPACKAGING_DOWNLEVEL_WINRT__) - Appx::Packaging::DownlevelWinrt::DllProcessDetach(isProcessExiting); -#endif - Downlevel::DllProcessDetach(isProcessExiting); -#if !defined(APPX_DOWNLEVEL) - Common::CommonLibraryDllProcessDetach(isProcessExiting); -#endif + default: + return TRUE; + } + return TRUE; } - break; - default: - break; + WINDOWS_PACKAGE_MANAGER_API DllGetClassObject( + REFCLSID rclsid, + REFIID riid, + LPVOID* ppv) + { + RETURN_HR(WindowsPackageManagerInProcModuleGetClassObject(rclsid, riid, ppv)); + } + + WINDOWS_PACKAGE_MANAGER_API DllCanUnloadNow() + { + return WindowsPackageManagerInProcModuleTerminate() ? S_OK : S_FALSE; } - return success; } diff --git a/src/Microsoft.Management.Deployment.InProc/pch.h b/src/Microsoft.Management.Deployment.InProc/pch.h index a479344805..098c04e086 100644 --- a/src/Microsoft.Management.Deployment.InProc/pch.h +++ b/src/Microsoft.Management.Deployment.InProc/pch.h @@ -1,4 +1,5 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #define WIN32_LEAN_AND_MEAN -#include \ No newline at end of file +#include +#include \ No newline at end of file diff --git a/src/Microsoft.Management.Deployment/CreateCompositePackageCatalogOptions.h b/src/Microsoft.Management.Deployment/CreateCompositePackageCatalogOptions.h index 5bdfe28ab4..dc880ffc16 100644 --- a/src/Microsoft.Management.Deployment/CreateCompositePackageCatalogOptions.h +++ b/src/Microsoft.Management.Deployment/CreateCompositePackageCatalogOptions.h @@ -2,14 +2,11 @@ // Licensed under the MIT License. #pragma once #include "CreateCompositePackageCatalogOptions.g.h" +#include "Public/ComClsids.h" namespace winrt::Microsoft::Management::Deployment::implementation { -#if USE_PROD_CLSIDS - [uuid("526534B8-7E46-47C8-8416-B1685C327D37")] -#else - [uuid("EE160901-B317-4EA7-9CC6-5355C6D7D8A7")] -#endif + [uuid(WINGET_OUTOFPROC_COM_CLSID_CreateCompositePackageCatalogOptions)] struct CreateCompositePackageCatalogOptions : CreateCompositePackageCatalogOptionsT { CreateCompositePackageCatalogOptions() = default; diff --git a/src/Microsoft.Management.Deployment/FindPackagesOptions.h b/src/Microsoft.Management.Deployment/FindPackagesOptions.h index a3cb2af30a..d9c3bc6a63 100644 --- a/src/Microsoft.Management.Deployment/FindPackagesOptions.h +++ b/src/Microsoft.Management.Deployment/FindPackagesOptions.h @@ -2,14 +2,11 @@ // Licensed under the MIT License. #pragma once #include "FindPackagesOptions.g.h" +#include "Public/ComClsids.h" namespace winrt::Microsoft::Management::Deployment::implementation { -#if USE_PROD_CLSIDS - [uuid("572DED96-9C60-4526-8F92-EE7D91D38C1A")] -#else - [uuid("1BD8FF3A-EC50-4F69-AEEE-DF4C9D3BAA96")] -#endif + [uuid(WINGET_OUTOFPROC_COM_CLSID_FindPackagesOptions)] struct FindPackagesOptions : FindPackagesOptionsT { FindPackagesOptions() = default; diff --git a/src/Microsoft.Management.Deployment/InstallOptions.h b/src/Microsoft.Management.Deployment/InstallOptions.h index e95fab3813..9d38f4cacd 100644 --- a/src/Microsoft.Management.Deployment/InstallOptions.h +++ b/src/Microsoft.Management.Deployment/InstallOptions.h @@ -2,14 +2,11 @@ // Licensed under the MIT License. #pragma once #include "InstallOptions.g.h" +#include "Public/ComClsids.h" namespace winrt::Microsoft::Management::Deployment::implementation { -#if USE_PROD_CLSIDS - [uuid("1095F097-EB96-453B-B4E6-1613637F3B14")] -#else - [uuid("44FE0580-62F7-44D4-9E91-AA9614AB3E86")] -#endif + [uuid(WINGET_OUTOFPROC_COM_CLSID_InstallOptions)] struct InstallOptions : InstallOptionsT { InstallOptions(); diff --git a/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj b/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj index 1345c5a64f..f84a27ece4 100644 --- a/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj +++ b/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj @@ -154,6 +154,7 @@ + diff --git a/src/Microsoft.Management.Deployment/PackageManager.h b/src/Microsoft.Management.Deployment/PackageManager.h index 2d3086c7c9..bc40538b59 100644 --- a/src/Microsoft.Management.Deployment/PackageManager.h +++ b/src/Microsoft.Management.Deployment/PackageManager.h @@ -2,14 +2,11 @@ // Licensed under the MIT License. #pragma once #include "PackageManager.g.h" +#include "Public/ComClsids.h" namespace winrt::Microsoft::Management::Deployment::implementation { -#if USE_PROD_CLSIDS - [uuid("C53A4F16-787E-42A4-B304-29EFFB4BF597")] -#else - [uuid("74CB3139-B7C5-4B9E-9388-E6616DEA288C")] -#endif + [uuid(WINGET_OUTOFPROC_COM_CLSID_PackageManager)] struct PackageManager : PackageManagerT { PackageManager() = default; diff --git a/src/Microsoft.Management.Deployment/PackageMatchFilter.h b/src/Microsoft.Management.Deployment/PackageMatchFilter.h index e6d25b602b..df05665c14 100644 --- a/src/Microsoft.Management.Deployment/PackageMatchFilter.h +++ b/src/Microsoft.Management.Deployment/PackageMatchFilter.h @@ -2,14 +2,11 @@ // Licensed under the MIT License. #pragma once #include "PackageMatchFilter.g.h" +#include "Public/ComClsids.h" namespace winrt::Microsoft::Management::Deployment::implementation { -#if USE_PROD_CLSIDS - [uuid("D02C9DAF-99DC-429C-B503-4E504E4AB000")] -#else - [uuid("3F85B9F4-487A-4C48-9035-2903F8A6D9E8")] -#endif + [uuid(WINGET_OUTOFPROC_COM_CLSID_PackageMatchFilter)] struct PackageMatchFilter : PackageMatchFilterT { PackageMatchFilter() = default; diff --git a/src/Microsoft.Management.Deployment/UninstallOptions.h b/src/Microsoft.Management.Deployment/UninstallOptions.h index d56ecae072..24ef9677dc 100644 --- a/src/Microsoft.Management.Deployment/UninstallOptions.h +++ b/src/Microsoft.Management.Deployment/UninstallOptions.h @@ -2,14 +2,11 @@ // Licensed under the MIT License. #pragma once #include "UninstallOptions.g.h" +#include "Public/ComClsids.h" namespace winrt::Microsoft::Management::Deployment::implementation { -#if USE_PROD_CLSIDS - [uuid("E1D9A11E-9F85-4D87-9C17-2B93143ADB8D")] -#else - [uuid("AA2A5C04-1AD9-46C4-B74F-6B334AD7EB8C")] -#endif + [uuid(WINGET_OUTOFPROC_COM_CLSID_UninstallOptions)] struct UninstallOptions : UninstallOptionsT { UninstallOptions(); diff --git a/src/WindowsPackageManager/WindowsPackageManager.h b/src/WindowsPackageManager/WindowsPackageManager.h index 023197c9ed..a7850f3a75 100644 --- a/src/WindowsPackageManager/WindowsPackageManager.h +++ b/src/WindowsPackageManager/WindowsPackageManager.h @@ -23,4 +23,16 @@ extern "C" // Unregisters the server module class factories. WINDOWS_PACKAGE_MANAGER_API WindowsPackageManagerServerModuleUnregister(); + + // Creates module for in-proc COM invocation. + WINDOWS_PACKAGE_MANAGER_API WindowsPackageManagerInProcModuleInitialize(); + + // Try to terminate the module for in-proc COM. Returns false if there's still active objects. + bool WINDOWS_PACKAGE_MANAGER_API_CALLING_CONVENTION WindowsPackageManagerInProcModuleTerminate(); + + // DllGetClassObject for in-proc COM for cpp winrt runtime classes. + WINDOWS_PACKAGE_MANAGER_API WindowsPackageManagerInProcModuleGetClassObject( + REFCLSID rclsid, + REFIID riid, + LPVOID* ppv); } diff --git a/src/WindowsPackageManager/WindowsPackageManager.vcxproj b/src/WindowsPackageManager/WindowsPackageManager.vcxproj index 84dfdc61bc..dbefa80f56 100644 --- a/src/WindowsPackageManager/WindowsPackageManager.vcxproj +++ b/src/WindowsPackageManager/WindowsPackageManager.vcxproj @@ -163,9 +163,9 @@ Disabled _DEBUG;%(PreprocessorDefinitions) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) true true true @@ -207,7 +207,7 @@ WIN32;%(PreprocessorDefinitions) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) true false stdcpp17 @@ -224,10 +224,10 @@ true true NDEBUG;%(PreprocessorDefinitions) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) true true true diff --git a/src/WindowsPackageManager/main.cpp b/src/WindowsPackageManager/main.cpp index 972176038a..a5cf68df37 100644 --- a/src/WindowsPackageManager/main.cpp +++ b/src/WindowsPackageManager/main.cpp @@ -10,9 +10,11 @@ #include "WindowsPackageManager.h" #include +#include using namespace winrt::Microsoft::Management::Deployment; +// CreatorMap for out-of-proc com registration CoCreatableClassWrlCreatorMapInclude(PackageManager); CoCreatableClassWrlCreatorMapInclude(FindPackagesOptions); CoCreatableClassWrlCreatorMapInclude(CreateCompositePackageCatalogOptions); @@ -20,6 +22,46 @@ CoCreatableClassWrlCreatorMapInclude(InstallOptions); CoCreatableClassWrlCreatorMapInclude(UninstallOptions); CoCreatableClassWrlCreatorMapInclude(PackageMatchFilter); +namespace +{ + CLSID GetClsidFromString() + + CLSID GetRedirectedClsidFromInProcClsid(REFCLSID clsid) + { + using namespace winrt::Microsoft::Management::Deployment::implementation; + + if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_PackageManager)) + { + return __uuidof(winrt::Microsoft::Management::Deployment::implementation::PackageManager); + } + else if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_FindPackagesOptions)) + { + return __uuidof(winrt::Microsoft::Management::Deployment::implementation::FindPackagesOptions); + } + else if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_CreateCompositePackageCatalogOptions)) + { + return __uuidof(winrt::Microsoft::Management::Deployment::implementation::CreateCompositePackageCatalogOptions); + } + else if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_InstallOptions)) + { + return __uuidof(winrt::Microsoft::Management::Deployment::implementation::InstallOptions); + } + else if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_UninstallOptions)) + { + return __uuidof(winrt::Microsoft::Management::Deployment::implementation::UninstallOptions); + } + else if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_PackageMatchFilter)) + { + return __uuidof(winrt::Microsoft::Management::Deployment::implementation::PackageMatchFilter); + } + else + { + return CLSID_NULL; + } + } + +} + extern "C" { int WINDOWS_PACKAGE_MANAGER_API_CALLING_CONVENTION WindowsPackageManagerCLIMain(int argc, wchar_t const** argv) try @@ -54,4 +96,28 @@ extern "C" RETURN_HR(::Microsoft::WRL::Module<::Microsoft::WRL::ModuleType::OutOfProc>::GetModule().UnregisterObjects()); } CATCH_RETURN(); + + WINDOWS_PACKAGE_MANAGER_API WindowsPackageManagerInProcModuleInitialize() try + { + ::Microsoft::WRL::Module<::Microsoft::WRL::ModuleType::InProc>::Create(); + return S_OK; + } + CATCH_RETURN(); + + bool WINDOWS_PACKAGE_MANAGER_API_CALLING_CONVENTION WindowsPackageManagerInProcModuleTerminate() try + { + return ::Microsoft::WRL::Module<::Microsoft::WRL::ModuleType::InProc>::GetModule().Terminate(); + } + CATCH_RETURN(); + + WINDOWS_PACKAGE_MANAGER_API WindowsPackageManagerInProcModuleGetClassObject( + REFCLSID rclsid, + REFIID riid, + LPVOID* ppv) try + { + CLSID redirectedClsid = GetRedirectedClsidFromInProcClsid(rclsid); + RETURN_HR_IF(CLASS_E_CLASSNOTAVAILABLE, IsEqualCLSID(redirectedClsid, CLSID_NULL)); + RETURN_HR(::Microsoft::WRL::Module<::Microsoft::WRL::ModuleType::InProc>::GetModule().GetClassObject(redirectedClsid, riid, ppv)); + } + CATCH_RETURN(); } From 539e069f41f44592b932a8196ecba690d4b5a661 Mon Sep 17 00:00:00 2001 From: Yao Sun Date: Fri, 18 Mar 2022 17:14:02 -0700 Subject: [PATCH 3/9] Built --- .../ComClsids.cpp | 49 ++++++++++++++ .../Microsoft.Management.Deployment.vcxproj | 1 + ...soft.Management.Deployment.vcxproj.filters | 65 +++++++++++++++++++ .../PackageMatchFilter.h | 7 ++ .../Public/ComClsids.h | 34 ++++++++++ src/WindowsPackageManager/Source.def | 3 + .../WindowsPackageManager.vcxproj | 16 ++--- src/WindowsPackageManager/main.cpp | 42 +----------- 8 files changed, 168 insertions(+), 49 deletions(-) create mode 100644 src/Microsoft.Management.Deployment/ComClsids.cpp create mode 100644 src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj.filters create mode 100644 src/Microsoft.Management.Deployment/Public/ComClsids.h diff --git a/src/Microsoft.Management.Deployment/ComClsids.cpp b/src/Microsoft.Management.Deployment/ComClsids.cpp new file mode 100644 index 0000000000..b02dd3d2ae --- /dev/null +++ b/src/Microsoft.Management.Deployment/ComClsids.cpp @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#include "pch.h" +#include "Public/ComClsids.h" +#pragma warning( push ) +#pragma warning ( disable : 4467 ) +// 4467 Allow use of uuid attribute for com object creation. +#include "PackageManager.h" +#include "FindPackagesOptions.h" +#include "CreateCompositePackageCatalogOptions.h" +#include "InstallOptions.h" +#include "UninstallOptions.h" +#include "PackageMatchFilter.h" +#pragma warning( pop ) + +namespace winrt::Microsoft::Management::Deployment +{ + CLSID GetRedirectedClsidFromInProcClsid(REFCLSID clsid) + { + if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_PackageManager)) + { + return __uuidof(winrt::Microsoft::Management::Deployment::implementation::PackageManager); + } + else if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_FindPackagesOptions)) + { + return __uuidof(winrt::Microsoft::Management::Deployment::implementation::FindPackagesOptions); + } + else if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_CreateCompositePackageCatalogOptions)) + { + return __uuidof(winrt::Microsoft::Management::Deployment::implementation::CreateCompositePackageCatalogOptions); + } + else if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_InstallOptions)) + { + return __uuidof(winrt::Microsoft::Management::Deployment::implementation::InstallOptions); + } + else if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_UninstallOptions)) + { + return __uuidof(winrt::Microsoft::Management::Deployment::implementation::UninstallOptions); + } + else if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_PackageMatchFilter)) + { + return __uuidof(winrt::Microsoft::Management::Deployment::implementation::PackageMatchFilter); + } + else + { + return CLSID_NULL; + } + } +} \ No newline at end of file diff --git a/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj b/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj index f84a27ece4..4613289587 100644 --- a/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj +++ b/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj @@ -160,6 +160,7 @@ + diff --git a/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj.filters b/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj.filters new file mode 100644 index 0000000000..18aa3e0a7b --- /dev/null +++ b/src/Microsoft.Management.Deployment/Microsoft.Management.Deployment.vcxproj.filters @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Public + + + + + + + + + + + + + {9c3907ed-84d9-4485-9b15-04c50717f0ab} + + + \ No newline at end of file diff --git a/src/Microsoft.Management.Deployment/PackageMatchFilter.h b/src/Microsoft.Management.Deployment/PackageMatchFilter.h index df05665c14..94d75a8031 100644 --- a/src/Microsoft.Management.Deployment/PackageMatchFilter.h +++ b/src/Microsoft.Management.Deployment/PackageMatchFilter.h @@ -4,6 +4,13 @@ #include "PackageMatchFilter.g.h" #include "Public/ComClsids.h" +#if !defined(INCLUDE_ONLY_INTERFACE_METHODS) +namespace AppInstaller::Repository +{ + struct PackageMatchFilter; +} +#endif + namespace winrt::Microsoft::Management::Deployment::implementation { [uuid(WINGET_OUTOFPROC_COM_CLSID_PackageMatchFilter)] diff --git a/src/Microsoft.Management.Deployment/Public/ComClsids.h b/src/Microsoft.Management.Deployment/Public/ComClsids.h new file mode 100644 index 0000000000..aa04828bc6 --- /dev/null +++ b/src/Microsoft.Management.Deployment/Public/ComClsids.h @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. +#pragma once +#include + +// clsids for out-of-proc com invocation +#if USE_PROD_CLSIDS +#define WINGET_OUTOFPROC_COM_CLSID_PackageManager "C53A4F16-787E-42A4-B304-29EFFB4BF597" +#define WINGET_OUTOFPROC_COM_CLSID_FindPackagesOptions "572DED96-9C60-4526-8F92-EE7D91D38C1A" +#define WINGET_OUTOFPROC_COM_CLSID_CreateCompositePackageCatalogOptions "526534B8-7E46-47C8-8416-B1685C327D37" +#define WINGET_OUTOFPROC_COM_CLSID_InstallOptions "1095F097-EB96-453B-B4E6-1613637F3B14" +#define WINGET_OUTOFPROC_COM_CLSID_UninstallOptions "E1D9A11E-9F85-4D87-9C17-2B93143ADB8D" +#define WINGET_OUTOFPROC_COM_CLSID_PackageMatchFilter "D02C9DAF-99DC-429C-B503-4E504E4AB000" +#else +#define WINGET_OUTOFPROC_COM_CLSID_PackageManager "74CB3139-B7C5-4B9E-9388-E6616DEA288C" +#define WINGET_OUTOFPROC_COM_CLSID_FindPackagesOptions "1BD8FF3A-EC50-4F69-AEEE-DF4C9D3BAA96" +#define WINGET_OUTOFPROC_COM_CLSID_CreateCompositePackageCatalogOptions "EE160901-B317-4EA7-9CC6-5355C6D7D8A7" +#define WINGET_OUTOFPROC_COM_CLSID_InstallOptions "44FE0580-62F7-44D4-9E91-AA9614AB3E86" +#define WINGET_OUTOFPROC_COM_CLSID_UninstallOptions "AA2A5C04-1AD9-46C4-B74F-6B334AD7EB8C" +#define WINGET_OUTOFPROC_COM_CLSID_PackageMatchFilter "3F85B9F4-487A-4C48-9035-2903F8A6D9E8" +#endif + +namespace winrt::Microsoft::Management::Deployment +{ + // clsid constants for in-proc com invocation + const CLSID WINGET_INPROC_COM_CLSID_PackageManager = { 0x2DDE4456, 0x64D9, 0x4673, 0x8F, 0x7E, 0xA4, 0xF1, 0x9A, 0x2E, 0x6C, 0xC3 }; // 2DDE4456-64D9-4673-8F7E-A4F19A2E6CC3 + const CLSID WINGET_INPROC_COM_CLSID_FindPackagesOptions = { 0x96B9A53A, 0x9228, 0x4DA0, 0xB0, 0x13, 0xBB, 0x1B, 0x20, 0x31, 0xAB, 0x3D }; // 96B9A53A-9228-4DA0-B013-BB1B2031AB3D + const CLSID WINGET_INPROC_COM_CLSID_CreateCompositePackageCatalogOptions = { 0x768318A6, 0x2EB5, 0x400D, 0x84, 0xD0, 0xDF, 0x35, 0x34, 0xC3, 0x0F, 0x5D }; // 768318A6-2EB5-400D-84D0-DF3534C30F5D + const CLSID WINGET_INPROC_COM_CLSID_InstallOptions = { 0xE2AF3BA8, 0x8A88, 0x4766, 0x9D, 0xDA, 0xAE, 0x40, 0x13, 0xAD, 0xE2, 0x86 }; // E2AF3BA8-8A88-4766-9DDA-AE4013ADE286 + const CLSID WINGET_INPROC_COM_CLSID_UninstallOptions = { 0x869CB959, 0xEB54, 0x425C, 0xA1, 0xE4, 0x1A, 0x1C, 0x29, 0x1C, 0x64, 0xE9 }; // 869CB959-EB54-425C-A1E4-1A1C291C64E9 + const CLSID WINGET_INPROC_COM_CLSID_PackageMatchFilter = { 0x57DC8962, 0x7343, 0x42CD, 0xB9, 0x1C, 0x04, 0xF6, 0xA2, 0x5D, 0xB1, 0xD0 }; // 57DC8962-7343-42CD-B91C-04F6A25DB1D0 + + CLSID GetRedirectedClsidFromInProcClsid(REFCLSID clsid); +} \ No newline at end of file diff --git a/src/WindowsPackageManager/Source.def b/src/WindowsPackageManager/Source.def index c4fb834177..c57681a3f9 100644 --- a/src/WindowsPackageManager/Source.def +++ b/src/WindowsPackageManager/Source.def @@ -5,3 +5,6 @@ EXPORTS WindowsPackageManagerServerModuleCreate WindowsPackageManagerServerModuleRegister WindowsPackageManagerServerModuleUnregister + WindowsPackageManagerInProcModuleInitialize + WindowsPackageManagerInProcModuleTerminate + WindowsPackageManagerInProcModuleGetClassObject diff --git a/src/WindowsPackageManager/WindowsPackageManager.vcxproj b/src/WindowsPackageManager/WindowsPackageManager.vcxproj index dbefa80f56..9279588e1f 100644 --- a/src/WindowsPackageManager/WindowsPackageManager.vcxproj +++ b/src/WindowsPackageManager/WindowsPackageManager.vcxproj @@ -163,9 +163,9 @@ Disabled _DEBUG;%(PreprocessorDefinitions) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) true true true @@ -207,7 +207,7 @@ WIN32;%(PreprocessorDefinitions) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\JsonCppLib\json;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) true false stdcpp17 @@ -224,10 +224,10 @@ true true NDEBUG;%(PreprocessorDefinitions) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) - $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\Microsoft.Management.Deployment;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) + $(ProjectDir);$(ProjectDir)..\AppInstallerCLICore\Public\;$(ProjectDir)..\AppInstallerCommonCore;$(ProjectDir)..\AppInstallerRepositoryCore;$(ProjectDir)..\AppInstallerCommonCore\Public;$(ProjectDir)..\Microsoft.Management.Deployment\Public;%(AdditionalIncludeDirectories) true true true diff --git a/src/WindowsPackageManager/main.cpp b/src/WindowsPackageManager/main.cpp index a5cf68df37..a6595bd556 100644 --- a/src/WindowsPackageManager/main.cpp +++ b/src/WindowsPackageManager/main.cpp @@ -10,7 +10,7 @@ #include "WindowsPackageManager.h" #include -#include +#include using namespace winrt::Microsoft::Management::Deployment; @@ -22,46 +22,6 @@ CoCreatableClassWrlCreatorMapInclude(InstallOptions); CoCreatableClassWrlCreatorMapInclude(UninstallOptions); CoCreatableClassWrlCreatorMapInclude(PackageMatchFilter); -namespace -{ - CLSID GetClsidFromString() - - CLSID GetRedirectedClsidFromInProcClsid(REFCLSID clsid) - { - using namespace winrt::Microsoft::Management::Deployment::implementation; - - if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_PackageManager)) - { - return __uuidof(winrt::Microsoft::Management::Deployment::implementation::PackageManager); - } - else if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_FindPackagesOptions)) - { - return __uuidof(winrt::Microsoft::Management::Deployment::implementation::FindPackagesOptions); - } - else if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_CreateCompositePackageCatalogOptions)) - { - return __uuidof(winrt::Microsoft::Management::Deployment::implementation::CreateCompositePackageCatalogOptions); - } - else if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_InstallOptions)) - { - return __uuidof(winrt::Microsoft::Management::Deployment::implementation::InstallOptions); - } - else if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_UninstallOptions)) - { - return __uuidof(winrt::Microsoft::Management::Deployment::implementation::UninstallOptions); - } - else if (IsEqualCLSID(clsid, WINGET_INPROC_COM_CLSID_PackageMatchFilter)) - { - return __uuidof(winrt::Microsoft::Management::Deployment::implementation::PackageMatchFilter); - } - else - { - return CLSID_NULL; - } - } - -} - extern "C" { int WINDOWS_PACKAGE_MANAGER_API_CALLING_CONVENTION WindowsPackageManagerCLIMain(int argc, wchar_t const** argv) try From 6af5a0f8c2a3d59d25ba40370f7cde6cf7343fad Mon Sep 17 00:00:00 2001 From: Yao Sun Date: Mon, 21 Mar 2022 09:35:55 -0700 Subject: [PATCH 4/9] Working --- .../Helpers.cpp | 18 +++++++++++++----- src/WindowsPackageManager/main.cpp | 12 +++++++++--- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/Microsoft.Management.Deployment/Helpers.cpp b/src/Microsoft.Management.Deployment/Helpers.cpp index 9490dc0074..5c228082b6 100644 --- a/src/Microsoft.Management.Deployment/Helpers.cpp +++ b/src/Microsoft.Management.Deployment/Helpers.cpp @@ -21,13 +21,21 @@ namespace winrt::Microsoft::Management::Deployment::implementation callAttributes.Flags = RPC_QUERY_CLIENT_PID; rpcStatus = RpcServerInqCallAttributes(nullptr, &callAttributes); - if ((rpcStatus != RPC_S_NO_CALL_ACTIVE) && - !((rpcStatus == RPC_S_OK) && HandleToULong(callAttributes.ClientPID) == GetCurrentProcessId())) + if (rpcStatus == RPC_S_NO_CALL_ACTIVE || + (rpcStatus == RPC_S_OK && HandleToULong(callAttributes.ClientPID) == GetCurrentProcessId())) { - DWORD callerProcessId = HandleToULong(callAttributes.ClientPID); - return { S_OK, callerProcessId }; + // in-proc is supported now. + return { S_OK, GetCurrentProcessId() }; + } + else if (rpcStatus == RPC_S_OK) + { + // out-of-proc case. + return { S_OK, HandleToULong(callAttributes.ClientPID) }; + } + else + { + return { E_ACCESSDENIED, 0 }; } - return { E_ACCESSDENIED, 0 }; } std::wstring_view GetStringForCapability(Capability capability) diff --git a/src/WindowsPackageManager/main.cpp b/src/WindowsPackageManager/main.cpp index a6595bd556..9dc5cb4485 100644 --- a/src/WindowsPackageManager/main.cpp +++ b/src/WindowsPackageManager/main.cpp @@ -64,11 +64,17 @@ extern "C" } CATCH_RETURN(); - bool WINDOWS_PACKAGE_MANAGER_API_CALLING_CONVENTION WindowsPackageManagerInProcModuleTerminate() try + bool WINDOWS_PACKAGE_MANAGER_API_CALLING_CONVENTION WindowsPackageManagerInProcModuleTerminate() { - return ::Microsoft::WRL::Module<::Microsoft::WRL::ModuleType::InProc>::GetModule().Terminate(); + try + { + return ::Microsoft::WRL::Module<::Microsoft::WRL::ModuleType::InProc>::GetModule().Terminate(); + } + catch (...) + { + return false; + } } - CATCH_RETURN(); WINDOWS_PACKAGE_MANAGER_API WindowsPackageManagerInProcModuleGetClassObject( REFCLSID rclsid, From cbd36a5c42251b78b2fbef75c6d5111a859d5166 Mon Sep 17 00:00:00 2001 From: Yao Sun Date: Mon, 21 Mar 2022 12:33:09 -0700 Subject: [PATCH 5/9] sxs manifest --- ....Management.Deployment.InProc.dll.manifest | 36 +++++++++++++++++++ ...osoft.Management.Deployment.InProc.vcxproj | 5 +++ ...nagement.Deployment.InProc.vcxproj.filters | 10 ++++-- 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.dll.manifest diff --git a/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.dll.manifest b/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.dll.manifest new file mode 100644 index 0000000000..341f7a73ad --- /dev/null +++ b/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.dll.manifest @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + diff --git a/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj b/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj index d088752a64..3abcd7bc01 100644 --- a/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj +++ b/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj @@ -293,6 +293,11 @@ + + + true + + diff --git a/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj.filters b/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj.filters index 05f4d2f009..3b66a402ed 100644 --- a/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj.filters +++ b/src/Microsoft.Management.Deployment.InProc/Microsoft.Management.Deployment.InProc.vcxproj.filters @@ -28,7 +28,13 @@ - - + + + + Source Files + + + + \ No newline at end of file From 8340311d7d58c48ffdea4c49f0bf72868c35c27a Mon Sep 17 00:00:00 2001 From: Yao Sun Date: Mon, 21 Mar 2022 14:04:11 -0700 Subject: [PATCH 6/9] Remove pri dependency --- src/AppInstallerCLICore/COMContext.h | 1 + src/AppInstallerCLICore/ExecutionReporter.cpp | 2 +- src/AppInstallerCLICore/ExecutionReporter.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/AppInstallerCLICore/COMContext.h b/src/AppInstallerCLICore/COMContext.h index 0508e9981c..5cd9cde1e8 100644 --- a/src/AppInstallerCLICore/COMContext.h +++ b/src/AppInstallerCLICore/COMContext.h @@ -38,6 +38,7 @@ namespace AppInstaller::CLI::Execution // When no Console streams need involvement, construct NullStreams instead to pass to Context COMContext() : NullStream(), CLI::Execution::Context(*m_nullOut, *m_nullIn) { + Reporter.SetChannel(Reporter::Channel::Disabled); Reporter.SetProgressSink(this); SetFlags(CLI::Execution::ContextFlag::AgreementsAcceptedByCaller); } diff --git a/src/AppInstallerCLICore/ExecutionReporter.cpp b/src/AppInstallerCLICore/ExecutionReporter.cpp index 66adad14ad..cf6d59d99b 100644 --- a/src/AppInstallerCLICore/ExecutionReporter.cpp +++ b/src/AppInstallerCLICore/ExecutionReporter.cpp @@ -74,7 +74,7 @@ namespace AppInstaller::CLI::Execution OutputStream Reporter::GetBasicOutputStream() { - return {*m_out, m_channel == Channel::Output }; + return { *m_out, m_channel == Channel::Output }; } void Reporter::SetChannel(Channel channel) diff --git a/src/AppInstallerCLICore/ExecutionReporter.h b/src/AppInstallerCLICore/ExecutionReporter.h index 258d496208..9aac540e43 100644 --- a/src/AppInstallerCLICore/ExecutionReporter.h +++ b/src/AppInstallerCLICore/ExecutionReporter.h @@ -44,6 +44,7 @@ namespace AppInstaller::CLI::Execution { Output, Completion, + Disabled, }; // The level for the Output channel. From 0a4332c02e89c29864e3558ece05708828b24dee Mon Sep 17 00:00:00 2001 From: Yao Sun Date: Mon, 21 Mar 2022 14:30:39 -0700 Subject: [PATCH 7/9] spelling --- .github/actions/spelling/allow.txt | 4 +++- .github/actions/spelling/expect.txt | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt index 92342b3c0e..223114c557 100644 --- a/.github/actions/spelling/allow.txt +++ b/.github/actions/spelling/allow.txt @@ -54,6 +54,7 @@ cguid chrono cin cla +CLASSNOTAVAILABLE CLSCTX cmake cmdlet @@ -355,6 +356,7 @@ OSVERSIONINFOEXW outfile OUTOFDISKSPACE OUTOFMEMORY +OUTOFPROC OWC packagefamilyname packageidentifier @@ -381,7 +383,7 @@ png posix powershell pplx -PPV +ppv pragma PRECONFIG preindexed diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index e34f3bc6de..5da652bbd1 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -142,6 +142,7 @@ GHS gity Globals Google +guiddef hackathon hashtable helplib From e5d398b4ec53a2ba0de3f4aaa764eb960c134ea3 Mon Sep 17 00:00:00 2001 From: Yao Sun Date: Sun, 27 Mar 2022 17:33:14 -0700 Subject: [PATCH 8/9] PR comments --- .../dllmain.cpp | 61 +++++++++---------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/src/Microsoft.Management.Deployment.InProc/dllmain.cpp b/src/Microsoft.Management.Deployment.InProc/dllmain.cpp index c6cd4b9991..09fa11223e 100644 --- a/src/Microsoft.Management.Deployment.InProc/dllmain.cpp +++ b/src/Microsoft.Management.Deployment.InProc/dllmain.cpp @@ -3,46 +3,43 @@ #include "pch.h" #include -extern "C" +EXTERN_C BOOL WINAPI DllMain( + HMODULE /* hModule */, + DWORD reason, + LPVOID /* lpReserved */) { - BOOL WINDOWS_PACKAGE_MANAGER_API_CALLING_CONVENTION DllMain( - HMODULE /* hModule */, - DWORD reason, - LPVOID /* lpReserved */) + switch (reason) { - switch (reason) - { - case DLL_PROCESS_ATTACH: - { - if (FAILED(WindowsPackageManagerInProcModuleInitialize())) - { - return FALSE; - } - } - break; - - case DLL_PROCESS_DETACH: + case DLL_PROCESS_ATTACH: + { + if (FAILED(WindowsPackageManagerInProcModuleInitialize())) { - WindowsPackageManagerInProcModuleTerminate(); - } - break; - - default: - return TRUE; + return FALSE; } - return TRUE; } + break; - WINDOWS_PACKAGE_MANAGER_API DllGetClassObject( - REFCLSID rclsid, - REFIID riid, - LPVOID* ppv) + case DLL_PROCESS_DETACH: { - RETURN_HR(WindowsPackageManagerInProcModuleGetClassObject(rclsid, riid, ppv)); + WindowsPackageManagerInProcModuleTerminate(); } + break; - WINDOWS_PACKAGE_MANAGER_API DllCanUnloadNow() - { - return WindowsPackageManagerInProcModuleTerminate() ? S_OK : S_FALSE; + default: + return TRUE; } + return TRUE; +} + +STDAPI DllGetClassObject( + REFCLSID rclsid, + REFIID riid, + LPVOID* ppv) +{ + RETURN_HR(WindowsPackageManagerInProcModuleGetClassObject(rclsid, riid, ppv)); +} + +STDAPI DllCanUnloadNow() +{ + return WindowsPackageManagerInProcModuleTerminate() ? S_OK : S_FALSE; } From 4157e3d04a90378324df3edc232a9ec6fba413a7 Mon Sep 17 00:00:00 2001 From: Yao Sun Date: Sun, 27 Mar 2022 17:46:33 -0700 Subject: [PATCH 9/9] spelling --- .github/actions/spelling/allow.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt index 223114c557..a9f338aee5 100644 --- a/.github/actions/spelling/allow.txt +++ b/.github/actions/spelling/allow.txt @@ -488,6 +488,7 @@ sscanf sstream STATFLAG STATSTG +STDAPI stdcall stderr stdexcept