diff --git a/dlls/d3d11_x/ID3DWrappers.h b/dlls/d3d11_x/ID3DWrappers.h index 5514269..dda04ae 100644 --- a/dlls/d3d11_x/ID3DWrappers.h +++ b/dlls/d3d11_x/ID3DWrappers.h @@ -463,7 +463,7 @@ namespace d3d11x _In_reads_opt_(NumClassInstances) ID3D11ClassInstance* const* ppClassInstances, UINT NumClassInstances) { - m_realDeviceCtx->PSSetShader(pPixelShader, ppClassInstances, NumClassInstances); + m_realDeviceCtx->PSSetShader(pPixelShader, nullptr, 0); } virtual void STDMETHODCALLTYPE PSSetSamplers( @@ -479,7 +479,7 @@ namespace d3d11x _In_reads_opt_(NumClassInstances) ID3D11ClassInstance* const* ppClassInstances, UINT NumClassInstances) { - m_realDeviceCtx->VSSetShader(pVertexShader, ppClassInstances, NumClassInstances); + m_realDeviceCtx->VSSetShader(pVertexShader, nullptr, 0); } virtual void STDMETHODCALLTYPE DrawIndexed( @@ -681,7 +681,7 @@ namespace d3d11x _In_reads_opt_(NumClassInstances) ID3D11ClassInstance* const* ppClassInstances, UINT NumClassInstances) { - m_realDeviceCtx->GSSetShader(pShader, ppClassInstances, NumClassInstances); + m_realDeviceCtx->GSSetShader(pShader, nullptr, 0); } @@ -1075,7 +1075,7 @@ namespace d3d11x _In_reads_opt_(NumClassInstances) ID3D11ClassInstance* const* ppClassInstances, UINT NumClassInstances) { - m_realDeviceCtx->HSSetShader(pHullShader, ppClassInstances, NumClassInstances); + m_realDeviceCtx->HSSetShader(pHullShader, nullptr, 0); } virtual void STDMETHODCALLTYPE HSSetSamplers( @@ -1143,7 +1143,7 @@ namespace d3d11x _In_reads_opt_(NumClassInstances) ID3D11ClassInstance* const* ppClassInstances, UINT NumClassInstances) { - m_realDeviceCtx->DSSetShader(pDomainShader, ppClassInstances, NumClassInstances); + m_realDeviceCtx->DSSetShader(pDomainShader, nullptr, 0); } virtual void STDMETHODCALLTYPE DSSetSamplers( @@ -1221,7 +1221,7 @@ namespace d3d11x _In_reads_opt_(NumClassInstances) ID3D11ClassInstance* const* ppClassInstances, UINT NumClassInstances) { - m_realDeviceCtx->CSSetShader(pComputeShader, ppClassInstances, NumClassInstances); + m_realDeviceCtx->CSSetShader(pComputeShader, nullptr, 0); } virtual void STDMETHODCALLTYPE CSSetSamplers( @@ -2102,7 +2102,7 @@ namespace d3d11x virtual void (InsertWaitUntilIdle)( _In_ UINT Flags) { - printf("[ID3D11DeviceContextX] InsertWaitUntilIdle NOT IMPLEMENTED\n"); + //printf("[ID3D11DeviceContextX] InsertWaitUntilIdle NOT IMPLEMENTED\n"); } virtual UINT64 (InsertFence)( diff --git a/dlls/kernelx/CoreApplicationWrapperX.h b/dlls/kernelx/CoreApplicationWrapperX.h index 56c21c1..4375817 100644 --- a/dlls/kernelx/CoreApplicationWrapperX.h +++ b/dlls/kernelx/CoreApplicationWrapperX.h @@ -19,7 +19,6 @@ public: { return m_realFactory->ActivateInstance(instance); } -public: // ICoreApplicationX INT32 _abi_get_Id(HSTRING* value) override; diff --git a/dlls/kernelx/CoreWindowWrapperX.cpp b/dlls/kernelx/CoreWindowWrapperX.cpp index 7afb7dd..93b8bdb 100644 --- a/dlls/kernelx/CoreWindowWrapperX.cpp +++ b/dlls/kernelx/CoreWindowWrapperX.cpp @@ -51,6 +51,10 @@ INT32 CoreWindowWrapperX::_abi_get_Visible(boolean* value) INT32 CoreWindowWrapperX::_abi_Activate() { + auto view = winrt::Windows::UI::ViewManagement::ApplicationView::GetForCurrentView(); + view.TryEnterFullScreenMode(); + view.PreferredLaunchWindowingMode(winrt::Windows::UI::ViewManagement::ApplicationViewWindowingMode::FullScreen); + printf("[CoreWindowWrapperX] --> _abi_Activate\n"); return m_realWindow->Activate(); } diff --git a/dlls/kernelx/CoreWindowWrapperX.h b/dlls/kernelx/CoreWindowWrapperX.h index ed9d01a..cf891ed 100644 --- a/dlls/kernelx/CoreWindowWrapperX.h +++ b/dlls/kernelx/CoreWindowWrapperX.h @@ -1,5 +1,7 @@ #pragma once +#include #include "ICoreWindowX.h" +#include class CoreWindowWrapperX : public ICoreWindowX diff --git a/dlls/kernelx/CurrentAppWrapper.cpp b/dlls/kernelx/CurrentAppWrapper.cpp new file mode 100644 index 0000000..511c986 --- /dev/null +++ b/dlls/kernelx/CurrentAppWrapper.cpp @@ -0,0 +1,99 @@ +#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(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); +} diff --git a/dlls/kernelx/CurrentAppWrapper.hpp b/dlls/kernelx/CurrentAppWrapper.hpp new file mode 100644 index 0000000..2bcb76d --- /dev/null +++ b/dlls/kernelx/CurrentAppWrapper.hpp @@ -0,0 +1,165 @@ +#pragma once +#include + +MIDL_INTERFACE("d52dc065-da3f-4685-995e-9b482eb5e603") + ICurrentAppX : public IInspectable +{ +public: + virtual HRESULT STDMETHODCALLTYPE get_LicenseInformation( + ABI::Windows::ApplicationModel::Store::ILicenseInformation* * value + ) = 0; + virtual HRESULT STDMETHODCALLTYPE get_LinkUri( + ABI::Windows::Foundation::IUriRuntimeClass** value + ) = 0; + virtual HRESULT STDMETHODCALLTYPE get_AppId( + GUID* value + ) = 0; + virtual HRESULT STDMETHODCALLTYPE RequestAppPurchaseAsync( + boolean includeReceipt, + __FIAsyncOperation_1_HSTRING** requestAppPurchaseOperation + ) = 0; + virtual HRESULT STDMETHODCALLTYPE RequestProductPurchaseAsync( + HSTRING productId, + boolean includeReceipt, + __FIAsyncOperation_1_HSTRING** requestProductPurchaseOperation + ) = 0; + virtual HRESULT STDMETHODCALLTYPE LoadListingInformationAsync( + __FIAsyncOperation_1_Windows__CApplicationModel__CStore__CListingInformation** loadListingOperation + ) = 0; + virtual HRESULT STDMETHODCALLTYPE GetAppReceiptAsync( + __FIAsyncOperation_1_HSTRING** appReceiptOperation + ) = 0; + virtual HRESULT STDMETHODCALLTYPE GetProductReceiptAsync( + HSTRING productId, + __FIAsyncOperation_1_HSTRING** getProductReceiptOperation + ) = 0; +}; + +MIDL_INTERFACE("8eb7dc30-f170-4ed5-8e21-1516da3fd367") +ILicenseInformationX : public IInspectable +{ +public: + virtual HRESULT STDMETHODCALLTYPE get_ProductLicenses( + __FIMapView_2_HSTRING_Windows__CApplicationModel__CStore__CProductLicense * *value + ) = 0; + virtual HRESULT STDMETHODCALLTYPE get_IsActive( + boolean* value + ) = 0; + virtual HRESULT STDMETHODCALLTYPE get_IsTrial( + boolean* value + ) = 0; + virtual HRESULT STDMETHODCALLTYPE get_ExpirationDate( + ABI::Windows::Foundation::DateTime* value + ) = 0; + virtual HRESULT STDMETHODCALLTYPE add_LicenseChanged( + ABI::Windows::ApplicationModel::Store::ILicenseChangedEventHandler* handler, + EventRegistrationToken* cookie + ) = 0; + virtual HRESULT STDMETHODCALLTYPE remove_LicenseChanged( + EventRegistrationToken cookie + ) = 0; +}; + +//class LicenseInformationWrapperX : public RuntimeClass { +//public: +// LicenseInformationWrapperX(ComPtr realFactory) +// : m_realFactory(realFactory) +// { +// HRESULT hr = m_realFactory.As(&m_realLicenseInformation); +// if (FAILED(hr)) { +// return; +// } +// } +// HRESULT QueryInterface(const IID& riid, void** ppvObject) override; +// ULONG AddRef() override; +// ULONG Release() override; +// HRESULT GetIids(ULONG* iidCount, IID** iids) override; +// HRESULT GetRuntimeClassName(HSTRING* className) override; +// HRESULT GetTrustLevel(TrustLevel* trustLevel) override; +// HRESULT STDMETHODCALLTYPE get_ProductLicenses( +// __FIMapView_2_HSTRING_Windows__CApplicationModel__CStore__CProductLicense** value +// ) override; +// HRESULT STDMETHODCALLTYPE get_IsActive( +// boolean* value +// ) override; +// HRESULT STDMETHODCALLTYPE get_IsTrial( +// boolean* value +// ) override; +// HRESULT STDMETHODCALLTYPE get_ExpirationDate( +// ABI::Windows::Foundation::DateTime* value +// ) override; +// HRESULT STDMETHODCALLTYPE add_LicenseChanged( +// ABI::Windows::ApplicationModel::Store::ILicenseChangedEventHandler* handler, +// EventRegistrationToken* cookie +// ) override; +// HRESULT STDMETHODCALLTYPE remove_LicenseChanged( +// EventRegistrationToken cookie +// ) override; +//}; + +class CurrentAppWrapperX : public RuntimeClass +{ +public: + CurrentAppWrapperX(ComPtr realFactory) + : m_realFactory(realFactory) + { + HRESULT hr = m_realFactory.As(&m_realCurrentApp); + if (FAILED(hr)) { + return; + } + } + + HRESULT STDMETHODCALLTYPE ActivateInstance(__RPC__deref_out_opt IInspectable** instance) override + { + return m_realFactory->ActivateInstance(instance); + } + + HRESULT QueryInterface(REFIID riid, void** ppvObject) override; + ULONG AddRef() override; + ULONG Release() override; + + HRESULT GetIids(ULONG* iidCount, IID** iids) override; + HRESULT GetRuntimeClassName(HSTRING* className) override; + HRESULT GetTrustLevel(TrustLevel* trustLevel) override; + + HRESULT STDMETHODCALLTYPE get_LicenseInformation( + ABI::Windows::ApplicationModel::Store::ILicenseInformation** value + ) override; + + HRESULT STDMETHODCALLTYPE get_LinkUri( + ABI::Windows::Foundation::IUriRuntimeClass** value + ) override; + + HRESULT STDMETHODCALLTYPE get_AppId( + GUID* value + ) override; + + HRESULT STDMETHODCALLTYPE RequestAppPurchaseAsync( + boolean includeReceipt, + __FIAsyncOperation_1_HSTRING** requestAppPurchaseOperation + ) override; + + HRESULT STDMETHODCALLTYPE RequestProductPurchaseAsync( + HSTRING productId, + boolean includeReceipt, + __FIAsyncOperation_1_HSTRING** requestProductPurchaseOperation + ) override; + + HRESULT STDMETHODCALLTYPE LoadListingInformationAsync( + __FIAsyncOperation_1_Windows__CApplicationModel__CStore__CListingInformation** loadListingOperation + ) override; + + HRESULT STDMETHODCALLTYPE GetAppReceiptAsync( + __FIAsyncOperation_1_HSTRING** appReceiptOperation + ) override; + + HRESULT STDMETHODCALLTYPE GetProductReceiptAsync( + HSTRING productId, + __FIAsyncOperation_1_HSTRING** getProductReceiptOperation + ) override; + +private: + long m_RefCount = 1; + ComPtr m_realFactory; + ComPtr m_realCurrentApp; +}; \ No newline at end of file diff --git a/dlls/kernelx/kernelx.vcxproj b/dlls/kernelx/kernelx.vcxproj index 031f4b2..8095204 100644 --- a/dlls/kernelx/kernelx.vcxproj +++ b/dlls/kernelx/kernelx.vcxproj @@ -95,6 +95,7 @@ + @@ -109,6 +110,7 @@ + diff --git a/dlls/kernelx/kernelx.vcxproj.filters b/dlls/kernelx/kernelx.vcxproj.filters index eca7674..3c7bdcd 100644 --- a/dlls/kernelx/kernelx.vcxproj.filters +++ b/dlls/kernelx/kernelx.vcxproj.filters @@ -16,6 +16,9 @@ Windows.ApplicationModel.Core\FrameworkViewSource + + Windows.ApplicationModel.Store\CurrentApp + @@ -44,6 +47,9 @@ Windows.ApplicationModel.Core\FrameworkViewSource + + Windows.ApplicationModel.Store\CurrentApp + @@ -69,5 +75,11 @@ {c767c192-a92b-4536-b8a9-51f27fa78800} + + {0ea04282-48ba-45bf-a20f-e7d51e2651c0} + + + {19e1cefa-5dbe-43ed-a9ad-b22278e05c1a} + \ No newline at end of file diff --git a/dlls/winrt_x/winrt_x.vcxproj b/dlls/winrt_x/winrt_x.vcxproj index c113df5..c2a7b79 100644 --- a/dlls/winrt_x/winrt_x.vcxproj +++ b/dlls/winrt_x/winrt_x.vcxproj @@ -116,7 +116,7 @@ - shell32.lib;%(AdditionalDependencies) + xinput.lib;shell32.lib;%(AdditionalDependencies) @@ -130,7 +130,7 @@ true true - shell32.lib;%(AdditionalDependencies) + xinput.lib;shell32.lib;%(AdditionalDependencies)