Helpers.h (808B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 #pragma once 4 #include "Public/CoCreatableMicrosoftManagementDeploymentClass.h" 5 6 namespace winrt::Microsoft::Management::Deployment::implementation 7 { 8 void SetComCallerName(std::string name); 9 std::string GetComCallerName(std::string defaultNameIfNotSet); 10 11 enum class Capability 12 { 13 PackageManagement, 14 PackageQuery 15 }; 16 17 HRESULT EnsureProcessHasCapability(Capability requiredCapability, DWORD callerProcessId); 18 HRESULT EnsureComCallerHasCapability(Capability requiredCapability); 19 std::pair<HRESULT, DWORD> GetCallerProcessId(); 20 std::wstring TryGetCallerProcessInfo(DWORD callerProcessId); 21 std::string GetCallerName(); 22 bool IsBackgroundProcessForPolicy(); 23 }