Added some comments.
Some checks failed
MSBuild / build (push) Has been cancelled
Generate DLL Progress JSONs / generate_commit (push) Has been cancelled
Deploy static content to Pages / deploy (push) Has been cancelled

This commit is contained in:
Tyler Jaacks 2024-10-27 23:24:41 -05:00
parent da81868bc4
commit c904187d1a

View File

@ -3,6 +3,10 @@
#include "CoreApplicationX.h" #include "CoreApplicationX.h"
/* Concrete class for the CoreApplicationResourceAvailability.
* This class is required because the Windows does not provide a
* concrete implementation for this interface or the interface itself.
*/
class CCoreApplicationResourceAvailabilityX : public ICoreApplicationResourceAvailabilityX class CCoreApplicationResourceAvailabilityX : public ICoreApplicationResourceAvailabilityX
{ {
LONG m_RefCount = 1; LONG m_RefCount = 1;
@ -90,6 +94,7 @@ public:
} }
}; };
/* This function is used to compare the class name of the classId with the classIdName. */
inline bool IsClassName(HSTRING classId, const char* classIdName) inline bool IsClassName(HSTRING classId, const char* classIdName)
{ {
const wchar_t* classIdString = WindowsGetStringRawBuffer(classId, nullptr); const wchar_t* classIdString = WindowsGetStringRawBuffer(classId, nullptr);
@ -99,19 +104,31 @@ inline bool IsClassName(HSTRING classId, const char* classIdName)
return (classIdStringUTF8 == classIdName); return (classIdStringUTF8 == classIdName);
} }
/* Function pointers for the DllGetForCurrentThread */
typedef HRESULT(*DllGetForCurrentThreadFunc) (ICoreWindowStatic*, CoreWindow**); typedef HRESULT(*DllGetForCurrentThreadFunc) (ICoreWindowStatic*, CoreWindow**);
/* Function pointers for the DllGetForCurrentThread */
typedef HRESULT(*DllGetForCurrentThreadFunc_App) (ICoreApplication*, winrt::Windows::ApplicationModel::Core::CoreApplication**); typedef HRESULT(*DllGetForCurrentThreadFunc_App) (ICoreApplication*, winrt::Windows::ApplicationModel::Core::CoreApplication**);
/* Function pointers for the CoreApplicationFactory's QueryInterface */
typedef HRESULT(*CoreApplicationFactory_QueryInterface) (IUnknown* pFactory, REFIID iid, void** ppv); typedef HRESULT(*CoreApplicationFactory_QueryInterface) (IUnknown* pFactory, REFIID iid, void** ppv);
/* Function pointers for the DllGetActivationFactory */
typedef HRESULT(*DllGetActivationFactoryFunc) (HSTRING, IActivationFactory**); typedef HRESULT(*DllGetActivationFactoryFunc) (HSTRING, IActivationFactory**);
/* Function pointers for the DllGetForCurrentThread */
DllGetForCurrentThreadFunc pDllGetForCurrentThread = nullptr; DllGetForCurrentThreadFunc pDllGetForCurrentThread = nullptr;
/* Function pointers for the DllGetForCurrentThread */
DllGetForCurrentThreadFunc_App pDllGetForCurrentThread_App = nullptr; DllGetForCurrentThreadFunc_App pDllGetForCurrentThread_App = nullptr;
/* Function pointers for the CoreApplicationFactory's QueryInterface */
CoreApplicationFactory_QueryInterface pCoreApplicationFactory_QueryInterface = nullptr; CoreApplicationFactory_QueryInterface pCoreApplicationFactory_QueryInterface = nullptr;
/* Function pointers for the DllGetActivationFactory */
DllGetActivationFactoryFunc pDllGetActivationFactory = nullptr; DllGetActivationFactoryFunc pDllGetActivationFactory = nullptr;
/* Function pointers for the DllGetForCurrentThread */
HRESULT(STDMETHODCALLTYPE* TrueGetForCurrentThread)(ICoreWindowStatic* staticWindow, CoreWindow** window); HRESULT(STDMETHODCALLTYPE* TrueGetForCurrentThread)(ICoreWindowStatic* staticWindow, CoreWindow** window);
/* Function pointers for the DllGetForCurrentThread */
HRESULT(STDMETHODCALLTYPE* TrueGetForCurrentThread_App)(ICoreApplication* application, winrt::Windows::ApplicationModel::Core::CoreApplication** Application); HRESULT(STDMETHODCALLTYPE* TrueGetForCurrentThread_App)(ICoreApplication* application, winrt::Windows::ApplicationModel::Core::CoreApplication** Application);
/* Function pointers for the CoreApplicationFactory's QueryInterface */
HRESULT(STDMETHODCALLTYPE* TrueCoreApplicationFactory_QueryInterface)(IUnknown* factory, REFIID iid, void** ppv); HRESULT(STDMETHODCALLTYPE* TrueCoreApplicationFactory_QueryInterface)(IUnknown* factory, REFIID iid, void** ppv);
/* Function pointers for the WinRT RoGetActivationFactory function. */
HRESULT(WINAPI* TrueRoGetActivationFactory)(HSTRING classId, REFIID iid, void** factory) = RoGetActivationFactory; HRESULT(WINAPI* TrueRoGetActivationFactory)(HSTRING classId, REFIID iid, void** factory) = RoGetActivationFactory;
/* Hook for ICoreWindowStatic's GetCurrentThread function. */ /* Hook for ICoreWindowStatic's GetCurrentThread function. */