mirror of
https://github.com/WinDurango/WinDurango.git
synced 2026-01-09 12:53:28 -06:00
100 lines
3.1 KiB
C++
100 lines
3.1 KiB
C++
#include "pch.h"
|
|
#include "CurrentAppWrapper.hpp"
|
|
|
|
HRESULT __stdcall CurrentAppWrapperX::QueryInterface(REFIID riid, void** ppvObject)
|
|
{
|
|
if (riid == __uuidof(IUnknown) || riid == __uuidof(ABI::Windows::ApplicationModel::Store::ICurrentApp))
|
|
{
|
|
*ppvObject = reinterpret_cast<ABI::Windows::ApplicationModel::Store::ICurrentApp*>(this);
|
|
AddRef();
|
|
return S_OK;
|
|
}
|
|
char iidstr[sizeof("{AAAAAAAA-BBBB-CCCC-DDEE-FFGGHHIIJJKK}")];
|
|
OLECHAR iidwstr[sizeof(iidstr)];
|
|
StringFromGUID2(riid, iidwstr, ARRAYSIZE(iidwstr));
|
|
WideCharToMultiByte(CP_UTF8, 0, iidwstr, -1, iidstr, sizeof(iidstr), nullptr, nullptr);
|
|
printf("[CurrentAppWrapperX] Interface Not Implemented: %s\n", iidstr);
|
|
*ppvObject = nullptr;
|
|
return E_NOINTERFACE;
|
|
}
|
|
|
|
ULONG __stdcall CurrentAppWrapperX::AddRef()
|
|
{
|
|
return InterlockedIncrement(&m_RefCount);
|
|
}
|
|
|
|
ULONG __stdcall CurrentAppWrapperX::Release()
|
|
{
|
|
ULONG refCount = InterlockedDecrement(&m_RefCount);
|
|
if (refCount == 0)
|
|
{
|
|
delete this;
|
|
}
|
|
return refCount;
|
|
}
|
|
|
|
HRESULT CurrentAppWrapperX::GetIids(ULONG* iidCount, IID** iids)
|
|
{
|
|
printf("[CurrentAppWrapperX] GetIids\n");
|
|
return m_realFactory->GetIids(iidCount, iids);
|
|
}
|
|
|
|
HRESULT CurrentAppWrapperX::GetRuntimeClassName(HSTRING* className)
|
|
{
|
|
printf("[CurrentAppWrapperX] GetRuntimeClassName\n");
|
|
return m_realFactory->GetRuntimeClassName(className);
|
|
}
|
|
|
|
HRESULT CurrentAppWrapperX::GetTrustLevel(TrustLevel* trustLevel)
|
|
{
|
|
printf("[CurrentAppWrapperX] GetTrustLevel\n");
|
|
return m_realFactory->GetTrustLevel(trustLevel);
|
|
}
|
|
|
|
HRESULT CurrentAppWrapperX::get_LicenseInformation(ABI::Windows::ApplicationModel::Store::ILicenseInformation** value)
|
|
{
|
|
printf("[CurrentAppWrapperX] get_LicenseInformation\n");
|
|
return E_NOTIMPL;
|
|
}
|
|
|
|
HRESULT CurrentAppWrapperX::get_LinkUri(ABI::Windows::Foundation::IUriRuntimeClass** value)
|
|
{
|
|
return m_realCurrentApp->get_LinkUri(value);
|
|
}
|
|
|
|
HRESULT CurrentAppWrapperX::get_AppId(GUID* value)
|
|
{
|
|
return m_realCurrentApp->get_AppId(value);
|
|
}
|
|
|
|
HRESULT CurrentAppWrapperX::RequestAppPurchaseAsync(boolean includeReceipt,
|
|
ABI::Windows::Foundation::__FIAsyncOperation_1_HSTRING_t** requestAppPurchaseOperation)
|
|
{
|
|
return m_realCurrentApp->RequestAppPurchaseAsync(includeReceipt, requestAppPurchaseOperation);
|
|
}
|
|
|
|
HRESULT CurrentAppWrapperX::RequestProductPurchaseAsync(HSTRING productId, boolean includeReceipt,
|
|
ABI::Windows::Foundation::__FIAsyncOperation_1_HSTRING_t** requestProductPurchaseOperation)
|
|
{
|
|
return E_FAIL;
|
|
}
|
|
|
|
HRESULT CurrentAppWrapperX::LoadListingInformationAsync(
|
|
ABI::Windows::Foundation::__FIAsyncOperation_1_Windows__CApplicationModel__CStore__CListingInformation_t**
|
|
loadListingOperation)
|
|
{
|
|
return m_realCurrentApp->LoadListingInformationAsync(loadListingOperation);
|
|
}
|
|
|
|
HRESULT CurrentAppWrapperX::GetAppReceiptAsync(
|
|
ABI::Windows::Foundation::__FIAsyncOperation_1_HSTRING_t** appReceiptOperation)
|
|
{
|
|
return m_realCurrentApp->GetAppReceiptAsync(appReceiptOperation);
|
|
}
|
|
|
|
HRESULT CurrentAppWrapperX::GetProductReceiptAsync(HSTRING productId,
|
|
ABI::Windows::Foundation::__FIAsyncOperation_1_HSTRING_t** getProductReceiptOperation)
|
|
{
|
|
return m_realCurrentApp->GetProductReceiptAsync(productId, getProductReceiptOperation);
|
|
}
|