Merge branch 'main' into main

This commit is contained in:
CT5
2025-11-03 13:16:14 +11:00
committed by GitHub
18 changed files with 1150 additions and 643 deletions
+3 -1
View File
@@ -400,4 +400,6 @@ FodyWeavers.xsd
# IDL files
/dlls/winrt_x/External/*
!/dlls/winrt_x/External/Windows.Xbox.Media.GameTransportControls.idl
!/dlls/winrt_x/External/Windows.UI.Core.idl
!/dlls/winrt_x/External/Windows.UI.Core.idl
/dlls/winrt_x/External/Windows.Xbox.Media.GameTransportControls.idl
/dlls/winrt_x/External/README.txt
+347 -109
View File
@@ -1,210 +1,448 @@
#include "pch.h"
#include "CoreApplicationWrapperX.h"
#include "FrameworkViewSourceWrapper.h"
using namespace ABI::Windows::ApplicationModel::Core;
// ============================================================================
// ICoreApplicationExit Implementation
// ============================================================================
HRESULT CoreApplicationWrapperX::Exit()
{
printf("[CoreApplicationWrapperX] ICoreApplicationExit::Exit() called — forwarding to realExit.\n");
printf("[CoreApplicationWrapperX] ICoreApplicationExit::Exit() called — forwarding to realExit.\n");
if (realExit) {
return realExit->Exit();
}
if (!realExit)
{
printf("[CoreApplicationWrapperX] WARNING: realExit is null!\n");
return E_POINTER;
}
printf("[CoreApplicationWrapperX] WARNING: realExit is null!\n");
return E_FAIL;
HRESULT hr = realExit->Exit();
if (FAILED(hr))
{
printf("[CoreApplicationWrapperX] Exit() failed with HRESULT=0x%08X\n", hr);
}
return hr;
}
HRESULT CoreApplicationWrapperX::add_Exiting(__FIEventHandler_1_IInspectable* handler, EventRegistrationToken* token)
{
printf("[CoreApplicationWrapperX] add_Exiting called\n");
return realExit ? realExit->add_Exiting(handler, token) : E_FAIL;
printf("[CoreApplicationWrapperX] add_Exiting called\n");
if (!realExit)
{
printf("[CoreApplicationWrapperX] WARNING: realExit is null in add_Exiting!\n");
return E_POINTER;
}
return realExit->add_Exiting(handler, token);
}
HRESULT CoreApplicationWrapperX::remove_Exiting(EventRegistrationToken token)
{
printf("[CoreApplicationWrapperX] remove_Exiting called\n");
return realExit ? realExit->remove_Exiting(token) : E_FAIL;
printf("[CoreApplicationWrapperX] remove_Exiting called\n");
if (!realExit)
{
printf("[CoreApplicationWrapperX] WARNING: realExit is null in remove_Exiting!\n");
return E_POINTER;
}
return realExit->remove_Exiting(token);
}
// ============================================================================
// IInspectable Implementation
// ============================================================================
HRESULT CoreApplicationWrapperX::GetIids(ULONG* iidCount, IID** iids)
{
printf("GetIids\n");
return m_realFactory->GetIids(iidCount, iids);
printf("[CoreApplicationWrapperX] GetIids\n");
if (!iidCount || !iids)
{
return E_POINTER;
}
if (!m_realFactory)
{
printf("[CoreApplicationWrapperX] ERROR: m_realFactory is null in GetIids!\n");
return E_POINTER;
}
return m_realFactory->GetIids(iidCount, iids);
}
HRESULT CoreApplicationWrapperX::GetRuntimeClassName(HSTRING* className)
{
printf("GetRuntimeClassName\n");
return m_realFactory->GetRuntimeClassName(className);
printf("[CoreApplicationWrapperX] GetRuntimeClassName\n");
if (!className)
{
return E_POINTER;
}
if (!m_realFactory)
{
printf("[CoreApplicationWrapperX] ERROR: m_realFactory is null in GetRuntimeClassName!\n");
return E_POINTER;
}
return m_realFactory->GetRuntimeClassName(className);
}
HRESULT CoreApplicationWrapperX::GetTrustLevel(TrustLevel* trustLevel)
{
printf("GetTrustLevel\n");
return m_realFactory->GetTrustLevel(trustLevel);
printf("[CoreApplicationWrapperX] GetTrustLevel\n");
if (!trustLevel)
{
return E_POINTER;
}
if (!m_realFactory)
{
printf("[CoreApplicationWrapperX] ERROR: m_realFactory is null in GetTrustLevel!\n");
return E_POINTER;
}
return m_realFactory->GetTrustLevel(trustLevel);
}
// ============================================================================
// ICoreApplicationX Implementation (Resuming/Suspending)
// ============================================================================
INT32 CoreApplicationWrapperX::_abi_add_Resuming(__FIEventHandler_1_IInspectable* handler, EventRegistrationToken* token)
{
printf("_abi_add_Resuming\n");
//return m_realCoreApplication->add_Resuming(handler, token);
return S_OK;
printf("[CoreApplicationWrapperX] _abi_add_Resuming\n");
if (!m_realCoreApplication)
{
printf("[CoreApplicationWrapperX] WARNING: m_realCoreApplication is null!\n");
return E_POINTER;
}
// Actually forward the call - don't just return S_OK
return m_realCoreApplication->add_Resuming(handler, token);
}
INT32 CoreApplicationWrapperX::_abi_remove_Resuming(EventRegistrationToken token)
{
printf("_abi_remove_Resuming\n");
return m_realCoreApplication->remove_Resuming(token);
printf("[CoreApplicationWrapperX] _abi_remove_Resuming\n");
if (!m_realCoreApplication)
{
printf("[CoreApplicationWrapperX] WARNING: m_realCoreApplication is null!\n");
return E_POINTER;
}
return m_realCoreApplication->remove_Resuming(token);
}
INT32 CoreApplicationWrapperX::_abi_add_Suspending(__FIEventHandler_1_Windows__CApplicationModel__CSuspendingEventArgs* handler, EventRegistrationToken* token)
{
printf("_abi_add_Suspending\n");
//return m_realCoreApplication->add_Suspending(handler, token);
return S_OK;
printf("[CoreApplicationWrapperX] _abi_add_Suspending\n");
if (!m_realCoreApplication)
{
printf("[CoreApplicationWrapperX] WARNING: m_realCoreApplication is null!\n");
return E_POINTER;
}
// Actually forward the call - don't just return S_OK
return m_realCoreApplication->add_Suspending(handler, token);
}
INT32 CoreApplicationWrapperX::_abi_remove_Suspending(EventRegistrationToken token)
{
printf("_abi_remove_Suspending\n");
return m_realCoreApplication->remove_Suspending(token);
printf("[CoreApplicationWrapperX] _abi_remove_Suspending\n");
if (!m_realCoreApplication)
{
printf("[CoreApplicationWrapperX] WARNING: m_realCoreApplication is null!\n");
return E_POINTER;
}
return m_realCoreApplication->remove_Suspending(token);
}
// ============================================================================
// ICoreApplicationResourceAvailabilityX Implementation
// ============================================================================
HRESULT CoreApplicationWrapperX::_abi_get_ResourceAvailability(ResourceAvailability* resourceAvailability)
{
// TODO: Stubbed for now.
*resourceAvailability = ResourceAvailability_Full;
printf("_abi_get_ResourceAvailability\n");
return S_OK;
printf("[CoreApplicationWrapperX] _abi_get_ResourceAvailability\n");
if (!resourceAvailability)
{
return E_POINTER;
}
// Stubbed: Always return full availability for Xbox
*resourceAvailability = ResourceAvailability_Full;
return S_OK;
}
HRESULT CoreApplicationWrapperX::_abi_add_ResourceAvailabilityChanged(winrt::Windows::Foundation::EventHandler<IInspectable>* handler, EventRegistrationToken* token)
{
printf("_abi_add_ResourceAvailabilityChanged\n");
//Stubbed at this moment.
return 0;
printf("[CoreApplicationWrapperX] _abi_add_ResourceAvailabilityChanged (stubbed)\n");
if (!token)
{
return E_POINTER;
}
// Stubbed: Return a dummy token
token->value = 0;
return S_OK;
}
HRESULT CoreApplicationWrapperX::_abi_remove_ResourceAvailabilityChanged(EventRegistrationToken token)
{
printf("_abi_remove_ResourceAvailabilityChanged\n");
//Stubbed at this moment.
return 0;
printf("[CoreApplicationWrapperX] _abi_remove_ResourceAvailabilityChanged (stubbed)\n");
// Stubbed: Nothing to do
return S_OK;
}
// ============================================================================
// ICoreApplicationGpuPolicy Implementation
// ============================================================================
HRESULT CoreApplicationWrapperX::get_DisableKinectGpuReservation(bool* pOutValue)
{
*pOutValue = this->m_KinectGpuReservation;
return S_OK;
printf("[CoreApplicationWrapperX] get_DisableKinectGpuReservation -> %d\n", m_KinectGpuReservation);
if (!pOutValue)
{
return E_POINTER;
}
*pOutValue = m_KinectGpuReservation;
return S_OK;
}
HRESULT CoreApplicationWrapperX::set_DisableKinectGpuReservation(bool value)
{
this->m_KinectGpuReservation = value;
return S_OK;
printf("[CoreApplicationWrapperX] set_DisableKinectGpuReservation <- %d\n", value);
m_KinectGpuReservation = value;
return S_OK;
}
// ============================================================================
// ICoreApplication Implementation
// ============================================================================
INT32 CoreApplicationWrapperX::_abi_GetCurrentView(ABI::Windows::ApplicationModel::Core::ICoreApplicationView** value)
{
printf("[CoreApplicationWrapperX] ---> _abi_GetCurrentView\n");
return m_realCoreApplication->GetCurrentView(value);
printf("[CoreApplicationWrapperX] _abi_GetCurrentView\n");
if (!value)
{
return E_POINTER;
}
if (!m_realCoreApplication)
{
printf("[CoreApplicationWrapperX] ERROR: m_realCoreApplication is null!\n");
return E_POINTER;
}
return m_realCoreApplication->GetCurrentView(value);
}
INT32 CoreApplicationWrapperX::_abi_Run(ABI::Windows::ApplicationModel::Core::IFrameworkViewSource* viewSource)
{
printf("_abi_Run\n");
printf("[CoreApplicationWrapperX] _abi_Run - Wrapping IFrameworkViewSource\n");
// Wrap the ViewSource and pass it to the original function
FrameworkViewSourceWrapper* wrappedViewSource = new FrameworkViewSourceWrapper(viewSource);
return m_realCoreApplication->Run(wrappedViewSource);
if (!viewSource)
{
printf("[CoreApplicationWrapperX] ERROR: viewSource is null!\n");
return E_POINTER;
}
if (!m_realCoreApplication)
{
printf("[CoreApplicationWrapperX] ERROR: m_realCoreApplication is null!\n");
return E_POINTER;
}
// Wrap the ViewSource and pass it to the original function
FrameworkViewSourceWrapper* wrappedViewSource = new (std::nothrow) FrameworkViewSourceWrapper(viewSource);
if (!wrappedViewSource)
{
printf("[CoreApplicationWrapperX] ERROR: Failed to allocate FrameworkViewSourceWrapper!\n");
return E_OUTOFMEMORY;
}
HRESULT hr = m_realCoreApplication->Run(wrappedViewSource);
// Release our reference (m_realCoreApplication should have AddRef'd if it needs it)
wrappedViewSource->Release();
if (FAILED(hr))
{
printf("[CoreApplicationWrapperX] Run() failed with HRESULT=0x%08X\n", hr);
}
return hr;
}
INT32 CoreApplicationWrapperX::_abi_get_Id(HSTRING* value)
{
printf("_abi_get_Id\n");
return m_realCoreApplication->get_Id(value);
printf("[CoreApplicationWrapperX] _abi_get_Id\n");
if (!value)
{
return E_POINTER;
}
if (!m_realCoreApplication)
{
printf("[CoreApplicationWrapperX] ERROR: m_realCoreApplication is null!\n");
return E_POINTER;
}
return m_realCoreApplication->get_Id(value);
}
INT32 CoreApplicationWrapperX::_abi_get_Properties(ABI::Windows::Foundation::Collections::IPropertySet** value)
{
printf("_abi_get_Properties\n");
return m_realCoreApplication->get_Properties(value);
printf("[CoreApplicationWrapperX] _abi_get_Properties\n");
if (!value)
{
return E_POINTER;
}
if (!m_realCoreApplication)
{
printf("[CoreApplicationWrapperX] ERROR: m_realCoreApplication is null!\n");
return E_POINTER;
}
return m_realCoreApplication->get_Properties(value);
}
// ============================================================================
// IUnknown Implementation (QueryInterface, AddRef, Release)
// ============================================================================
HRESULT CoreApplicationWrapperX::QueryInterface(const IID& riid, void** ppvObject)
{
LPOLESTR str = nullptr;
StringFromIID(riid, &str);
wprintf(L"CoreApplicationWrapperX [QI] IID Requested: %s\n", str);
CoTaskMemFree(str);
if (!ppvObject)
{
return E_POINTER;
}
if (riid == __uuidof(IActivationFactory) || riid == __uuidof(IUnknown))
{
*ppvObject = static_cast<IActivationFactory*>(this);
AddRef();
return S_OK;
}
*ppvObject = nullptr;
if (riid == __uuidof(ICoreApplicationX))
{
*ppvObject = static_cast<ICoreApplicationX*>(this);
AddRef();
return S_OK;
}
if (riid == __uuidof(ICoreApplicationExit))
{
*ppvObject = this;
AddRef();
return S_OK;
}
if (riid == __uuidof(ICoreApplicationResourceAvailabilityX)) // allow ICoreApplicationResourceAvailabilityX interface
{
*ppvObject = static_cast<ICoreApplicationResourceAvailabilityX*>(this);
AddRef();
return S_OK;
}
LPOLESTR str = nullptr;
if (SUCCEEDED(StringFromIID(riid, &str)))
{
wprintf(L"CoreApplicationWrapperX [QI] IID Requested: %s\n", str);
CoTaskMemFree(str);
}
if (riid == __uuidof(ICoreApplicationGpuPolicy)) // allow ICoreApplicationResourceAvailabilityX interface
{
*ppvObject = static_cast<ICoreApplicationGpuPolicy*>(this);
AddRef();
return S_OK;
}
// Handle our wrapper interfaces first
if (riid == __uuidof(IActivationFactory) || riid == __uuidof(IUnknown))
{
*ppvObject = static_cast<IActivationFactory*>(this);
AddRef();
printf(" -> Returning IActivationFactory/IUnknown\n");
return S_OK;
}
if (riid == __uuidof(ICoreApplicationExit)) {
printf("ICoreApplicationExit CALLED - GAME OVER BRO\n");
*ppvObject = this;
AddRef();
return S_OK;
}
if (riid == __uuidof(IInspectable))
{
// Use IActivationFactory as the path to IInspectable to avoid ambiguity
*ppvObject = static_cast<IInspectable*>(static_cast<IActivationFactory*>(this));
AddRef();
printf(" -> Returning IInspectable\n");
return S_OK;
}
// DEBUG
HRESULT hr = m_realFactory->QueryInterface(riid, ppvObject);
if(FAILED(hr))
{
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);
MessageBoxA(nullptr, iidstr, typeid(*this).name(), MB_OK);
}
*ppvObject = nullptr;
return E_NOINTERFACE;
if (riid == __uuidof(ICoreApplicationX))
{
*ppvObject = static_cast<ICoreApplicationX*>(this);
AddRef();
printf(" -> Returning ICoreApplicationX\n");
return S_OK;
}
if (riid == __uuidof(ICoreApplicationExit))
{
*ppvObject = static_cast<ICoreApplicationExit*>(this);
AddRef();
printf(" -> Returning ICoreApplicationExit\n");
return S_OK;
}
if (riid == __uuidof(ICoreApplicationResourceAvailabilityX))
{
*ppvObject = static_cast<ICoreApplicationResourceAvailabilityX*>(this);
AddRef();
printf(" -> Returning ICoreApplicationResourceAvailabilityX\n");
return S_OK;
}
if (riid == __uuidof(ICoreApplicationGpuPolicy))
{
*ppvObject = static_cast<ICoreApplicationGpuPolicy*>(this);
AddRef();
printf(" -> Returning ICoreApplicationGpuPolicy\n");
return S_OK;
}
// Try delegating to the real factory
if (m_realFactory)
{
HRESULT hr = m_realFactory->QueryInterface(riid, ppvObject);
if (SUCCEEDED(hr))
{
printf(" -> Delegated to m_realFactory (SUCCESS)\n");
return hr;
}
else
{
printf(" -> Delegated to m_realFactory (FAILED: 0x%08X)\n", hr);
}
}
// Show MessageBox for debugging unhandled interfaces
char iidstr[64];
OLECHAR iidwstr[64];
StringFromGUID2(riid, iidwstr, ARRAYSIZE(iidwstr));
WideCharToMultiByte(CP_UTF8, 0, iidwstr, -1, iidstr, sizeof(iidstr), nullptr, nullptr);
printf(" -> E_NOINTERFACE for IID: %s\n", iidstr);
MessageBoxA(nullptr, iidstr, "CoreApplicationWrapperX - Unhandled Interface", MB_OK | MB_ICONWARNING);
return E_NOINTERFACE;
}
ULONG CoreApplicationWrapperX::AddRef()
{
return InterlockedIncrement(&m_RefCount);
ULONG refCount = InterlockedIncrement(&m_RefCount);
printf("[CoreApplicationWrapperX] AddRef() -> %lu\n", refCount);
return refCount;
}
ULONG CoreApplicationWrapperX::Release()
{
ULONG refCount = InterlockedDecrement(&m_RefCount);
if (refCount == 0)
delete this;
return refCount;
}
ULONG refCount = InterlockedDecrement(&m_RefCount);
printf("[CoreApplicationWrapperX] Release() -> %lu\n", refCount);
if (refCount == 0)
{
printf("[CoreApplicationWrapperX] Deleting instance\n");
delete this;
}
return refCount;
}
+189 -55
View File
@@ -1,102 +1,236 @@
#include "pch.h"
#include "FrameworkViewWrapper.h"
#include <winrt/Windows.Foundation.h>
HRESULT __stdcall FrameworkViewWrapper::Initialize(ABI::Windows::ApplicationModel::Core::ICoreApplicationView* applicationView)
{
return m_realView->Initialize(applicationView);
if (!m_realView)
{
wprintf(L"ERROR: m_realView is null in Initialize()\n");
return E_POINTER;
}
HRESULT hr = m_realView->Initialize(applicationView);
if (FAILED(hr))
{
wprintf(L"Initialize failed with HRESULT=0x%08X\n", hr);
}
return hr;
}
HRESULT __stdcall FrameworkViewWrapper::SetWindow(ABI::Windows::UI::Core::ICoreWindow* window)
{
// Finally Wraps the coreWindow with xbox CoreWindow
window = reinterpret_cast<ICoreWindow*>(new CoreWindowWrapperX((CoreWindow*)window));
return m_realView->SetWindow(window);
}
if (!m_realView)
{
wprintf(L"ERROR: m_realView is null in SetWindow()\n");
return E_POINTER;
}
if (!window)
{
wprintf(L"ERROR: window parameter is null in SetWindow()\n");
return E_INVALIDARG;
}
// Wrap the CoreWindow with Xbox CoreWindow wrapper
ICoreWindow* wrappedWindow = reinterpret_cast<ICoreWindow*>(
new (std::nothrow) CoreWindowWrapperX(reinterpret_cast<CoreWindow*>(window)));
if (!wrappedWindow)
{
wprintf(L"ERROR: Failed to create CoreWindowWrapperX\n");
return E_OUTOFMEMORY;
}
// Pass to real view (it should AddRef if it needs to keep it)
HRESULT hr = m_realView->SetWindow(wrappedWindow);
// Release our reference
wrappedWindow->Release();
if (FAILED(hr))
{
wprintf(L"SetWindow failed with HRESULT=0x%08X\n", hr);
}
return hr;
}
HRESULT __stdcall FrameworkViewWrapper::Load(HSTRING entryPoint)
{
return m_realView->Load(entryPoint);
if (!m_realView)
{
wprintf(L"ERROR: m_realView is null in Load()\n");
return E_POINTER;
}
HRESULT hr = m_realView->Load(entryPoint);
if (FAILED(hr))
{
wprintf(L"Load failed with HRESULT=0x%08X\n", hr);
}
return hr;
}
#include <winrt/Windows.Foundation.h> // Include necessary namespace for Platform::COMException
HRESULT __stdcall FrameworkViewWrapper::Run()
{
if (!m_realView)
{
wprintf(L"ERROR: m_realView is null in Run()\n");
return E_POINTER;
}
HRESULT __stdcall FrameworkViewWrapper::Run()
{
try
{
wprintf(L"Entering Run()\n");
return m_realView->Run();
}
catch (winrt::hresult_error const& ex) // Replace Platform::COMException with winrt::hresult_error
{
wprintf(L"COMException caught in Run: HRESULT=0x%08X\n", ex.code());
throw; // Re-throw for debugger, or return E_FAIL
}
try
{
wprintf(L"Entering Run()\n");
HRESULT hr = m_realView->Run();
if (FAILED(hr))
{
wprintf(L"Run failed with HRESULT=0x%08X\n", hr);
}
else
{
wprintf(L"Run completed successfully\n");
}
return hr;
}
catch (winrt::hresult_error const& ex)
{
wprintf(L"winrt::hresult_error caught in Run: HRESULT=0x%08X, Message=%s\n",
ex.code(), ex.message().c_str());
return ex.code();
}
catch (std::exception const& ex)
{
wprintf(L"std::exception caught in Run: %S\n", ex.what());
return E_FAIL;
}
catch (...)
{
wprintf(L"Unknown exception caught in Run\n");
return E_FAIL;
}
}
HRESULT __stdcall FrameworkViewWrapper::Uninitialize(void)
{
return m_realView->Uninitialize();
if (!m_realView)
{
wprintf(L"ERROR: m_realView is null in Uninitialize()\n");
return E_POINTER;
}
HRESULT hr = m_realView->Uninitialize();
if (FAILED(hr))
{
wprintf(L"Uninitialize failed with HRESULT=0x%08X\n", hr);
}
return hr;
}
HRESULT FrameworkViewWrapper::QueryInterface(const IID& riid, void** ppvObject)
{
LPOLESTR str = nullptr;
StringFromIID(riid, &str);
wprintf(L"FrameworkViewWrapper [QI] IID Requested: %s\n", str);
CoTaskMemFree(str);
if (!ppvObject)
{
return E_POINTER;
}
if (riid == __uuidof(IFrameworkView) ||
riid == __uuidof(ICoreApplicationExit) ||
riid == __uuidof(IUnknown) ||
riid == __uuidof(IInspectable))
{
*ppvObject = this;
AddRef();
return S_OK;
}
else
{
/*/ DEBUG
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);
MessageBoxA(nullptr, iidstr, typeid(*this).name(), MB_OK);*/
}
*ppvObject = nullptr;
return m_realView->QueryInterface(riid, ppvObject);
LPOLESTR str = nullptr;
if (SUCCEEDED(StringFromIID(riid, &str)))
{
wprintf(L"FrameworkViewWrapper [QI] IID Requested: %s\n", str);
CoTaskMemFree(str);
}
// Check for interfaces we implement directly
if (riid == __uuidof(IFrameworkView) ||
riid == __uuidof(ICoreApplicationExit) ||
riid == __uuidof(IUnknown) ||
riid == __uuidof(IInspectable))
{
*ppvObject = static_cast<IFrameworkView*>(this);
AddRef();
return S_OK;
}
// Delegate to real view
if (m_realView)
{
return m_realView->QueryInterface(riid, ppvObject);
}
return E_NOINTERFACE;
}
ULONG FrameworkViewWrapper::AddRef()
{
return InterlockedIncrement(&m_RefCount);
ULONG refCount = InterlockedIncrement(&m_RefCount);
wprintf(L"FrameworkViewWrapper::AddRef() -> %lu\n", refCount);
return refCount;
}
ULONG FrameworkViewWrapper::Release()
{
ULONG refCount = InterlockedDecrement(&m_RefCount);
if (refCount == 0)
delete this;
return refCount;
ULONG refCount = InterlockedDecrement(&m_RefCount);
wprintf(L"FrameworkViewWrapper::Release() -> %lu\n", refCount);
if (refCount == 0)
{
wprintf(L"FrameworkViewWrapper: Deleting instance\n");
delete this;
}
return refCount;
}
HRESULT FrameworkViewWrapper::GetIids(ULONG* iidCount, IID** iids)
{
return m_realView->GetIids(iidCount, iids);
if (!iidCount || !iids)
{
return E_POINTER;
}
if (!m_realView)
{
wprintf(L"ERROR: m_realView is null in GetIids()\n");
return E_POINTER;
}
return m_realView->GetIids(iidCount, iids);
}
HRESULT FrameworkViewWrapper::GetRuntimeClassName(HSTRING* className)
{
return m_realView->GetRuntimeClassName(className);
if (!className)
{
return E_POINTER;
}
if (!m_realView)
{
wprintf(L"ERROR: m_realView is null in GetRuntimeClassName()\n");
return E_POINTER;
}
return m_realView->GetRuntimeClassName(className);
}
HRESULT FrameworkViewWrapper::GetTrustLevel(TrustLevel* trustLevel)
{
return m_realView->GetTrustLevel(trustLevel);
if (!trustLevel)
{
return E_POINTER;
}
if (!m_realView)
{
wprintf(L"ERROR: m_realView is null in GetTrustLevel()\n");
return E_POINTER;
}
return m_realView->GetTrustLevel(trustLevel);
}
+29 -3
View File
@@ -69,11 +69,34 @@ inline void UnLoadMods()
{
FreeLibrary(mod);
}
}
#include <winrt/Windows.Services.Store.h>
#include <winrt/Windows.Foundation.h>
winrt::Windows::Foundation::IAsyncOperation<winrt::hstring> GetProductIdAsync()
{
auto storeContext = winrt::Windows::Services::Store::StoreContext::GetDefault();
auto appLicense = co_await storeContext.GetAppLicenseAsync();
winrt::hstring productId = appLicense.SkuStoreId();
co_return productId;
}
std::string GetPackageName() {
winrt::hstring GamePackage = winrt::Windows::ApplicationModel::Package::Current().Id().FamilyName();
std::string packageName = winrt::to_string(GamePackage);
size_t underscorePos = packageName.find('_');
if (underscorePos != std::string::npos) {
packageName = packageName.substr(0, underscorePos);
}
return packageName;
}
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID reserved)
{
winrt::hstring GamePackage = winrt::Windows::ApplicationModel::Package::Current().Id().FamilyName();
std::string packageName = GetPackageName();
InitializeCriticalSection(&XMemSetAllocationHooksLock_X);
if (DetourIsHelperProcess()) return TRUE;
@@ -123,9 +146,12 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID reserved)
{
printf("Forza Horizon 2 Presents Fast & Furious");
}
if (GamePackage == L"HappyDungeons_zyyfzks419954")
if (packageName == "HappyDungeons")
{
printf("Happy Happy Happy Dungeons Dungeons Dungeons\n");
}
if (packageName == "HappyWars")
{
printf("Happy Wars Detected!");
}
#endif
+2 -1
View File
@@ -64,7 +64,7 @@
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
@@ -86,6 +86,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -1,234 +0,0 @@
#include "pch.h"
#include "ConnectedStorage.h"
#include <shlobj.h>
#include <strsafe.h>
#include <winrt/Windows.Storage.Streams.h>
#include <winrt/Windows.ApplicationModel.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <robuffer.h>
#include "../Implementation/Windows.Xbox.Storage.BlobInfoQueryResult.h"
#include <winrt/Windows.Storage.FileProperties.h>
winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::CreateContainer(winrt::hstring name) const
{
// LOG_WARNING("[ConnectedStorage] Container %S requested creation\n", name.c_str());
if (!co_await DoesFolderExist(m_storagePath + L"\\" + name))
{
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(m_storagePath);
co_await folder.CreateFolderAsync(name);
}
//LOG_WARNING("[ConnectedStorage] Container %S created\n", name.c_str());
}
winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::Read(
winrt::hstring containerName, winrt::Windows::Foundation::Collections::IMapView<winrt::hstring, winrt::Windows::Storage::Streams::IBuffer> data) const
{
if (!co_await DoesFolderExist(m_storagePath + L"\\" + containerName)) {
co_await CreateContainer(containerName);
LOG_INFO("[ConnectedStorage] Container %S created\n", containerName.c_str( ));
}
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(m_storagePath + L"\\" + containerName);
for (auto const& pair : data)
{
auto fileName = pair.Key();
//LOG_INFO("FileName -> %ls | folder -> %ls\n", fileName.c_str(), folder.Path().c_str());
auto file = co_await folder.GetFileAsync(fileName);
auto fileBuffer = co_await winrt::Windows::Storage::FileIO::ReadBufferAsync(file);
auto bufferByteAccess = fileBuffer.as<Windows::Storage::Streams::IBufferByteAccess>();
uint8_t* fileData = nullptr;
bufferByteAccess->Buffer(&fileData);
auto dataBuffer = pair.Value();
auto dataBufferByteAccess = dataBuffer.as<Windows::Storage::Streams::IBufferByteAccess>();
uint8_t* dataBufferData = nullptr;
dataBufferByteAccess->Buffer(&dataBufferData);
memcpy(dataBufferData, fileData, fileBuffer.Length());
}
}
winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::Upload(
winrt::hstring containerName,
winrt::Windows::Foundation::Collections::IMapView<winrt::hstring, winrt::Windows::Storage::Streams::IBuffer> blobsToWrite,
winrt::Windows::Foundation::Collections::IIterable<winrt::hstring> blobsToDelete,
winrt::hstring displayName) const
{
if (!co_await DoesFolderExist(m_storagePath + L"\\" + containerName)) {
co_await CreateContainer(containerName);
LOG_INFO("[ConnectedStorage] Container %S created\n", containerName.c_str( ));
}
// if a displayName is provided, inside the folder create a txt called wd_displayname.txt with the displayName
if (!displayName.empty( ))
{
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(m_storagePath + L"\\" + containerName);
auto file = co_await folder.CreateFileAsync(L"wd_displayname.txt", winrt::Windows::Storage::CreationCollisionOption::ReplaceExisting);
co_await winrt::Windows::Storage::FileIO::WriteTextAsync(file, displayName);
}
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(m_storagePath + L"\\" + containerName);
if (blobsToWrite != nullptr)
for (auto const& pair : blobsToWrite)
{
auto fileName = pair.Key();
auto dataBuffer = pair.Value();
auto file = co_await folder.CreateFileAsync(fileName, winrt::Windows::Storage::CreationCollisionOption::ReplaceExisting);
co_await winrt::Windows::Storage::FileIO::WriteBufferAsync(file, dataBuffer);
}
if (blobsToDelete != nullptr)
for (auto const& blobName : blobsToDelete)
{
auto file = co_await folder.GetFileAsync(blobName);
co_await file.DeleteAsync();
}
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::
Storage::BlobInfo>> WinDurango::impl::ConnectedStorage::GetBlobInfoAsync(winrt::hstring parentContainerName,
winrt::hstring blobNamePrefix)
{
winrt::Windows::Foundation::Collections::IVector<winrt::Windows::Xbox::Storage::BlobInfo> blobInfoVector = winrt::single_threaded_vector<winrt::Windows::Xbox::Storage::BlobInfo>( );
winrt::hstring s_prefix = blobNamePrefix;
winrt::hstring storagePath = m_storagePath + L"\\" + parentContainerName;
if (!co_await DoesFolderExist(storagePath))
co_return blobInfoVector.GetView( );
auto storageFolder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(storagePath);
auto files = co_await storageFolder.GetFilesAsync( );
for (auto file : files) {
std::wstring_view str_view{ file.Name( ) };
if (!str_view._Starts_with(s_prefix))
continue;
winrt::Windows::Storage::FileProperties::BasicProperties folderProperties = co_await file.GetBasicPropertiesAsync( );
uint32_t size = folderProperties.Size( );
blobInfoVector.Append({ file.Name( ), size });
}
co_return blobInfoVector.GetView( );
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::
Storage::ContainerInfo2>> WinDurango::impl::ConnectedStorage::GetContainerInfo2Async()
{
winrt::Windows::Foundation::Collections::IVector<winrt::Windows::Xbox::Storage::ContainerInfo2> containerInfoVector = winrt::single_threaded_vector<winrt::Windows::Xbox::Storage::ContainerInfo2>( );
winrt::hstring storagePath = m_storagePath;
auto storageFolder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(storagePath);
auto folders = co_await storageFolder.GetFoldersAsync( );
for (auto folder : folders) {
auto folderProperties = co_await folder.GetBasicPropertiesAsync( );
uint64_t size = folderProperties.Size( );
winrt::Windows::Foundation::DateTime date = folderProperties.DateModified( );
// check if the folder contains a file called "wd_displayname.txt" and if so, read it
winrt::hstring displayName = {};
if (co_await DoesFileExist(folder, L"wd_displayname.txt"))
{
auto file = co_await folder.GetFileAsync(L"wd_displayname.txt");
displayName = co_await winrt::Windows::Storage::FileIO::ReadTextAsync(file);
}
if (displayName.empty( ))
displayName = folder.DisplayName( );
containerInfoVector.Append({ folder.Name( ), size, displayName, date, false });
}
co_return containerInfoVector.GetView( );
}
winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::DeleteContainer(winrt::hstring containerName)
{
winrt::hstring containerPath = m_storagePath + L"\\" + containerName;
if (co_await DoesFolderExist(containerPath)) {
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(containerPath);
co_await folder.DeleteAsync( );
}
}
winrt::hstring WinDurango::impl::ConnectedStorage::ObtainPackageName()
{
return winrt::Windows::ApplicationModel::Package::Current( ).Id( ).FamilyName( );
}
winrt::Windows::Foundation::IAsyncOperation<bool> WinDurango::impl::ConnectedStorage::DoesFolderExist(
winrt::hstring path)
{
try
{
co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(path);
}
catch (...)
{
co_return false;
}
co_return true;
}
winrt::Windows::Foundation::IAsyncOperation<bool> WinDurango::impl::ConnectedStorage::DoesFileExist(
winrt::Windows::Storage::StorageFolder folder, winrt::hstring path)
{
try
{
co_await folder.GetFileAsync(path);
co_return true;
}
catch (winrt::hresult_error const& ex)
{
if (ex.code( ) == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
{
co_return false; // File does not exist
}
else
{
// Log unexpected errors for debugging
LOG_ERROR("Unexpected error while checking file existence: %ls\n", ex.message( ).c_str( ));
throw; // Re-throw unexpected exceptions
}
}
}
winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::CreateDirectories(const wchar_t* storageType, winrt::hstring& storagePath)
{
co_await winrt::resume_background( );
winrt::hstring packageName = ObtainPackageName( );
if (packageName.empty( )) {
co_return;
}
winrt::hstring folderPath = winrt::Windows::Storage::ApplicationData::Current( ).LocalFolder( ).Path( ) + L"\\WinDurango";
if (!co_await DoesFolderExist(folderPath)) {
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(winrt::Windows::Storage::ApplicationData::Current( ).LocalFolder( ).Path( ));
co_await folder.CreateFolderAsync(L"WinDurango");
}
folderPath = folderPath + L"\\" + storageType;
if (!co_await DoesFolderExist(folderPath))
{
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(winrt::Windows::Storage::ApplicationData::Current( ).LocalFolder( ).Path( ) + L"\\WinDurango");
co_await folder.CreateFolderAsync(storageType);
}
storagePath = folderPath;
}
winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::InitializeStorage(const wchar_t* name)
{
co_await CreateDirectories(name, m_storagePath);
LOG_INFO("[ConnectedStorage] User storage initialized at %S\n", m_storagePath.c_str());
}
@@ -0,0 +1,486 @@
#include "pch.h"
#include "Windows.Xbox.Storage.ConnectedStorage.h"
#include <shlobj.h>
#include <strsafe.h>
#include <winrt/Windows.Storage.Streams.h>
#include <winrt/Windows.ApplicationModel.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <robuffer.h>
#include "../Implementation/Windows.Xbox.Storage.BlobInfoQueryResult.h"
#include <winrt/Windows.Storage.FileProperties.h>
winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::CreateContainer(winrt::hstring name) const
{
if (m_storagePath.empty( )) {
LOG_ERROR("[ConnectedStorage] Storage path not initialized\n");
co_return;
}
winrt::hstring containerPath = m_storagePath + L"\\" + name;
if (!co_await DoesFolderExist(containerPath))
{
try
{
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(m_storagePath);
co_await folder.CreateFolderAsync(name, winrt::Windows::Storage::CreationCollisionOption::OpenIfExists);
LOG_INFO("[ConnectedStorage] Container %S created\n", name.c_str( ));
}
catch (winrt::hresult_error const& ex)
{
LOG_ERROR("[ConnectedStorage] Failed to create container %S: %S\n", name.c_str( ), ex.message( ).c_str( ));
throw;
}
}
}
winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::Read(
winrt::hstring containerName,
winrt::Windows::Foundation::Collections::IMapView<winrt::hstring, winrt::Windows::Storage::Streams::IBuffer> data) const
{
if (data == nullptr) {
LOG_WARNING("[ConnectedStorage] Read called with null data map\n");
co_return;
}
if (m_storagePath.empty( )) {
LOG_ERROR("[ConnectedStorage] Storage path not initialized\n");
co_return;
}
winrt::hstring containerPath = m_storagePath + L"\\" + containerName;
if (!co_await DoesFolderExist(containerPath)) {
co_await CreateContainer(containerName);
LOG_INFO("[ConnectedStorage] Container %S created during read\n", containerName.c_str( ));
}
try
{
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(containerPath);
for (auto const& pair : data)
{
try
{
auto fileName = pair.Key( );
auto dataBuffer = pair.Value( );
if (dataBuffer == nullptr) {
LOG_WARNING("[ConnectedStorage] Null buffer for file %S\n", fileName.c_str( ));
continue;
}
auto file = co_await folder.GetFileAsync(fileName);
auto fileBuffer = co_await winrt::Windows::Storage::FileIO::ReadBufferAsync(file);
// Validate buffer capacity
if (dataBuffer.Capacity( ) < fileBuffer.Length( )) {
LOG_ERROR("[ConnectedStorage] Buffer too small for file %S (need %u, have %u)\n",
fileName.c_str( ), fileBuffer.Length( ), dataBuffer.Capacity( ));
continue;
}
// Get raw buffer pointers
auto bufferByteAccess = fileBuffer.as<Windows::Storage::Streams::IBufferByteAccess>( );
uint8_t* fileData = nullptr;
bufferByteAccess->Buffer(&fileData);
auto dataBufferByteAccess = dataBuffer.as<Windows::Storage::Streams::IBufferByteAccess>( );
uint8_t* dataBufferData = nullptr;
dataBufferByteAccess->Buffer(&dataBufferData);
if (fileData != nullptr && dataBufferData != nullptr) {
memcpy(dataBufferData, fileData, fileBuffer.Length( ));
dataBuffer.Length(fileBuffer.Length( )); // Set the actual data length
LOG_INFO("[ConnectedStorage] Successfully read file %S (%u bytes)\n", fileName.c_str( ), fileBuffer.Length( ));
}
else {
LOG_ERROR("[ConnectedStorage] Failed to get buffer pointers for file %S\n", fileName.c_str( ));
}
}
catch (winrt::hresult_error const& ex)
{
LOG_ERROR("[ConnectedStorage] Failed to read file %S: %S (0x%08X)\n",
pair.Key( ).c_str( ), ex.message( ).c_str( ), static_cast<uint32_t>(ex.code( )));
}
}
}
catch (winrt::hresult_error const& ex)
{
LOG_ERROR("[ConnectedStorage] Failed to access container %S: %S\n",
containerName.c_str( ), ex.message( ).c_str( ));
throw;
}
}
winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::Upload(
winrt::hstring containerName,
winrt::Windows::Foundation::Collections::IMapView<winrt::hstring, winrt::Windows::Storage::Streams::IBuffer> blobsToWrite,
winrt::Windows::Foundation::Collections::IIterable<winrt::hstring> blobsToDelete,
winrt::hstring displayName) const
{
if (m_storagePath.empty( )) {
LOG_ERROR("[ConnectedStorage] Storage path not initialized\n");
co_return;
}
winrt::hstring containerPath = m_storagePath + L"\\" + containerName;
if (!co_await DoesFolderExist(containerPath)) {
co_await CreateContainer(containerName);
LOG_INFO("[ConnectedStorage] Container %S created during upload\n", containerName.c_str( ));
}
try
{
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(containerPath);
// Write display name if provided
if (!displayName.empty( ))
{
try
{
auto file = co_await folder.CreateFileAsync(L"wd_displayname.txt",
winrt::Windows::Storage::CreationCollisionOption::ReplaceExisting);
co_await winrt::Windows::Storage::FileIO::WriteTextAsync(file, displayName);
LOG_INFO("[ConnectedStorage] Display name written: %S\n", displayName.c_str( ));
}
catch (winrt::hresult_error const& ex)
{
LOG_ERROR("[ConnectedStorage] Failed to write display name: %S\n", ex.message( ).c_str( ));
}
}
// Write blobs
if (blobsToWrite != nullptr)
{
for (auto const& pair : blobsToWrite)
{
try
{
auto fileName = pair.Key( );
auto dataBuffer = pair.Value( );
if (dataBuffer == nullptr) {
LOG_WARNING("[ConnectedStorage] Null buffer for file %S, skipping\n", fileName.c_str( ));
continue;
}
auto file = co_await folder.CreateFileAsync(fileName,
winrt::Windows::Storage::CreationCollisionOption::ReplaceExisting);
co_await winrt::Windows::Storage::FileIO::WriteBufferAsync(file, dataBuffer);
LOG_INFO("[ConnectedStorage] Written file %S (%u bytes)\n", fileName.c_str( ), dataBuffer.Length( ));
}
catch (winrt::hresult_error const& ex)
{
LOG_ERROR("[ConnectedStorage] Failed to write file %S: %S\n",
pair.Key( ).c_str( ), ex.message( ).c_str( ));
}
}
}
// Delete blobs
if (blobsToDelete != nullptr)
{
for (auto const& blobName : blobsToDelete)
{
try
{
auto file = co_await folder.GetFileAsync(blobName);
co_await file.DeleteAsync( );
LOG_INFO("[ConnectedStorage] Deleted file %S\n", blobName.c_str( ));
}
catch (winrt::hresult_error const& ex)
{
// File might not exist, which is acceptable
if (ex.code( ) != HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) {
LOG_ERROR("[ConnectedStorage] Failed to delete file %S: %S\n",
blobName.c_str( ), ex.message( ).c_str( ));
}
}
}
}
}
catch (winrt::hresult_error const& ex)
{
LOG_ERROR("[ConnectedStorage] Failed to access container %S: %S\n",
containerName.c_str( ), ex.message( ).c_str( ));
throw;
}
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::Storage::BlobInfo>>
WinDurango::impl::ConnectedStorage::GetBlobInfoAsync(
winrt::hstring parentContainerName,
winrt::hstring blobNamePrefix)
{
winrt::Windows::Foundation::Collections::IVector<winrt::Windows::Xbox::Storage::BlobInfo> blobInfoVector =
winrt::single_threaded_vector<winrt::Windows::Xbox::Storage::BlobInfo>( );
if (m_storagePath.empty( )) {
LOG_ERROR("[ConnectedStorage] Storage path not initialized\n");
co_return blobInfoVector.GetView( );
}
winrt::hstring storagePath = m_storagePath + L"\\" + parentContainerName;
if (!co_await DoesFolderExist(storagePath)) {
LOG_INFO("[ConnectedStorage] Container %S does not exist for blob query\n", parentContainerName.c_str( ));
co_return blobInfoVector.GetView( );
}
try
{
auto storageFolder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(storagePath);
auto files = co_await storageFolder.GetFilesAsync( );
for (auto file : files)
{
std::wstring_view fileName{ file.Name( ) };
// Skip display name metadata file
if (fileName == L"wd_displayname.txt") {
continue;
}
// Check prefix match
if (!blobNamePrefix.empty( ) && !fileName.starts_with(blobNamePrefix)) {
continue;
}
try
{
auto fileProperties = co_await file.GetBasicPropertiesAsync( );
uint32_t size = static_cast<uint32_t>(fileProperties.Size( ));
blobInfoVector.Append({ file.Name( ), size });
}
catch (winrt::hresult_error const& ex)
{
LOG_ERROR("[ConnectedStorage] Failed to get properties for %S: %S\n",
file.Name( ).c_str( ), ex.message( ).c_str( ));
}
}
}
catch (winrt::hresult_error const& ex)
{
LOG_ERROR("[ConnectedStorage] Failed to query blobs in container %S: %S\n",
parentContainerName.c_str( ), ex.message( ).c_str( ));
}
co_return blobInfoVector.GetView( );
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::Storage::ContainerInfo2>>
WinDurango::impl::ConnectedStorage::GetContainerInfo2Async( )
{
winrt::Windows::Foundation::Collections::IVector<winrt::Windows::Xbox::Storage::ContainerInfo2> containerInfoVector =
winrt::single_threaded_vector<winrt::Windows::Xbox::Storage::ContainerInfo2>( );
if (m_storagePath.empty( )) {
LOG_ERROR("[ConnectedStorage] Storage path not initialized\n");
co_return containerInfoVector.GetView( );
}
try
{
auto storageFolder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(m_storagePath);
auto folders = co_await storageFolder.GetFoldersAsync( );
for (auto folder : folders)
{
try
{
auto folderProperties = co_await folder.GetBasicPropertiesAsync( );
uint64_t size = folderProperties.Size( );
winrt::Windows::Foundation::DateTime date = folderProperties.DateModified( );
// Check for custom display name
winrt::hstring displayName = {};
if (co_await DoesFileExist(folder, L"wd_displayname.txt"))
{
try
{
auto file = co_await folder.GetFileAsync(L"wd_displayname.txt");
displayName = co_await winrt::Windows::Storage::FileIO::ReadTextAsync(file);
}
catch (winrt::hresult_error const& ex)
{
LOG_WARNING("[ConnectedStorage] Failed to read display name for %S: %S\n",
folder.Name( ).c_str( ), ex.message( ).c_str( ));
}
}
if (displayName.empty( )) {
displayName = folder.DisplayName( );
}
containerInfoVector.Append({ folder.Name( ), size, displayName, date, false });
}
catch (winrt::hresult_error const& ex)
{
LOG_ERROR("[ConnectedStorage] Failed to get info for container %S: %S\n",
folder.Name( ).c_str( ), ex.message( ).c_str( ));
}
}
}
catch (winrt::hresult_error const& ex)
{
LOG_ERROR("[ConnectedStorage] Failed to query containers: %S\n", ex.message( ).c_str( ));
}
co_return containerInfoVector.GetView( );
}
winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::DeleteContainer(winrt::hstring containerName)
{
if (m_storagePath.empty( )) {
LOG_ERROR("[ConnectedStorage] Storage path not initialized\n");
co_return;
}
winrt::hstring containerPath = m_storagePath + L"\\" + containerName;
if (co_await DoesFolderExist(containerPath))
{
try
{
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(containerPath);
co_await folder.DeleteAsync( );
LOG_INFO("[ConnectedStorage] Container %S deleted\n", containerName.c_str( ));
}
catch (winrt::hresult_error const& ex)
{
LOG_ERROR("[ConnectedStorage] Failed to delete container %S: %S\n",
containerName.c_str( ), ex.message( ).c_str( ));
throw;
}
}
else
{
LOG_WARNING("[ConnectedStorage] Container %S does not exist, cannot delete\n", containerName.c_str( ));
}
}
winrt::hstring WinDurango::impl::ConnectedStorage::ObtainPackageName( )
{
try
{
return winrt::Windows::ApplicationModel::Package::Current( ).Id( ).FamilyName( );
}
catch (winrt::hresult_error const& ex)
{
LOG_ERROR("[ConnectedStorage] Failed to obtain package name: %S\n", ex.message( ).c_str( ));
return {};
}
}
winrt::Windows::Foundation::IAsyncOperation<bool> WinDurango::impl::ConnectedStorage::DoesFolderExist(winrt::hstring path)
{
try
{
co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(path);
co_return true;
}
catch (winrt::hresult_error const& ex)
{
if (ex.code( ) == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) ||
ex.code( ) == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND))
{
co_return false;
}
else
{
LOG_ERROR("[ConnectedStorage] Unexpected error checking folder existence %S: %S\n",
path.c_str( ), ex.message( ).c_str( ));
throw;
}
}
}
winrt::Windows::Foundation::IAsyncOperation<bool> WinDurango::impl::ConnectedStorage::DoesFileExist(
winrt::Windows::Storage::StorageFolder folder,
winrt::hstring path)
{
try
{
co_await folder.GetFileAsync(path);
co_return true;
}
catch (winrt::hresult_error const& ex)
{
if (ex.code( ) == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
{
co_return false;
}
else
{
LOG_ERROR("[ConnectedStorage] Unexpected error checking file existence %S: %S\n",
path.c_str( ), ex.message( ).c_str( ));
throw;
}
}
}
winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::CreateDirectories(
const wchar_t* storageType,
winrt::hstring& storagePath)
{
// CRITICAL FIX: Removed co_await winrt::resume_background() to prevent threading violations
// WinRT async operations are already non-blocking and must stay on correct apartment thread
winrt::hstring packageName = ObtainPackageName( );
if (packageName.empty( )) {
LOG_ERROR("[ConnectedStorage] Failed to obtain package name\n");
co_return;
}
try
{
auto localFolder = winrt::Windows::Storage::ApplicationData::Current( ).LocalFolder( );
winrt::hstring basePath = localFolder.Path( );
winrt::hstring winDurangoPath = basePath + L"\\WinDurango";
// Create WinDurango folder if needed
if (!co_await DoesFolderExist(winDurangoPath))
{
co_await localFolder.CreateFolderAsync(L"WinDurango",
winrt::Windows::Storage::CreationCollisionOption::OpenIfExists);
LOG_INFO("[ConnectedStorage] Created WinDurango base folder\n");
}
// Create storage type folder
winrt::hstring folderPath = winDurangoPath + L"\\" + storageType;
if (!co_await DoesFolderExist(folderPath))
{
auto winDurangoFolder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(winDurangoPath);
co_await winDurangoFolder.CreateFolderAsync(storageType,
winrt::Windows::Storage::CreationCollisionOption::OpenIfExists);
LOG_INFO("[ConnectedStorage] Created storage type folder: %S\n", storageType);
}
storagePath = folderPath;
}
catch (winrt::hresult_error const& ex)
{
LOG_ERROR("[ConnectedStorage] Failed to create directories for %S: %S\n",
storageType, ex.message( ).c_str( ));
throw;
}
}
winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::InitializeStorage(const wchar_t* name)
{
try
{
co_await CreateDirectories(name, m_storagePath);
LOG_INFO("[ConnectedStorage] User storage initialized at %S\n", m_storagePath.c_str( ));
}
catch (winrt::hresult_error const& ex)
{
LOG_ERROR("[ConnectedStorage] Failed to initialize storage: %S\n", ex.message( ).c_str( ));
throw;
}
}
-18
View File
@@ -1,18 +0,0 @@
If you want to build this project, you should generate those files based on winmds.
To learn more:
https://learn.microsoft.com/en-us/cpp/cppcx/wrl/use-winmdidl-and-midlrt-to-create-h-files-from-windows-metadata?view=msvc-170
After putting all those files, build, it should auto generate all needed files etc.
656kB Windows.Xbox.ApplicationModel.State.idl
33,379kB Windows.Xbox.ApplicationModel.State.Internal.idl
10,655kB Windows.Xbox.ApplicationModel.Store.idl
3,316kB Windows.Xbox.idl
53,430kB Windows.Xbox.Input.idl
68,873kB Windows.Xbox.Management.Deployment.idl
516kB Windows.Xbox.Management.idl
33,135kB Windows.Xbox.Media.idl
3,030kB Windows.Xbox.Shell.idl
833kB Windows.Xbox.Shell.Social.idl
29,850kB Windows.Xbox.System.idl
5,236 Windows.Xbox.Achievements.idl
@@ -1,169 +0,0 @@
//
// File generated by WinMDIDL version 8.00.0021
//
// Forward Declare
namespace Windows
{
namespace Xbox
{
namespace Media
{
apicontract GameTransportControlsContract;
typedef enum GamePlaybackStatus GamePlaybackStatus;
typedef enum SoundLevel SoundLevel;
typedef enum GameTransportControlsButton GameTransportControlsButton;
typedef enum GameTransportControlsProperty GameTransportControlsProperty;
interface IGameTransportControls;
interface IGameTransportControlsButtonPressedEventArgs;
interface IGameTransportControlsPropertyChangedEventArgs;
runtimeclass GameTransportControls;
runtimeclass GameTransportControlsButtonPressedEventArgs;
runtimeclass GameTransportControlsPropertyChangedEventArgs;
}
}
}
// Generic instantiations
namespace Windows
{
namespace Xbox
{
namespace Media
{
declare
{
interface Windows.Foundation.TypedEventHandler<Windows.Xbox.Media.GameTransportControls*, Windows.Xbox.Media.GameTransportControlsButtonPressedEventArgs*>;
interface Windows.Foundation.TypedEventHandler<Windows.Xbox.Media.GameTransportControls*, Windows.Xbox.Media.GameTransportControlsPropertyChangedEventArgs*>;
}
}
}
}
// Type definition
namespace Windows
{
namespace Xbox
{
namespace Media
{
[contractversion(1.0)]
apicontract GameTransportControlsContract
{
}
enum GamePlaybackStatus
{
Closed = 0,
Changing = 1,
Stopped = 2,
Playing = 3,
Paused = 4
};
enum SoundLevel
{
Muted = 0,
Low = 1,
Full = 2
};
enum GameTransportControlsButton
{
Play = 0,
Pause = 1,
Menu = 2,
View = 3,
Back = 4,
MaxButtons = 5
};
enum GameTransportControlsProperty
{
SoundLevel = 0
};
[contract(Windows.Xbox.Media.GameTransportControlsContract, 1.0)]
[exclusiveto(Windows.Xbox.Media.GameTransportControls)]
[uuid(F5BA60D7-9303-44CD-AC0C-4E532702CD00)]
[version(1.0)]
interface IGameTransportControls : IInspectable
{
[propget] HRESULT Title([out][retval] HSTRING* value);
[propput] HRESULT Title([in] HSTRING value);
[propget] HRESULT Subtitle([out][retval] HSTRING* value);
[propput] HRESULT Subtitle([in] HSTRING value);
[propget] HRESULT PlaybackStatus([out][retval] Windows.Xbox.Media.GamePlaybackStatus* value);
[propput] HRESULT PlaybackStatus([in] Windows.Xbox.Media.GamePlaybackStatus value);
[propget] HRESULT SoundLevel([out][retval] Windows.Xbox.Media.SoundLevel* value);
[propget] HRESULT IsEnabled([out][retval] boolean* value);
[propput] HRESULT IsEnabled([in] boolean value);
[propget] HRESULT IsPlayEnabled([out][retval] boolean* value);
[propput] HRESULT IsPlayEnabled([in] boolean value);
[propget] HRESULT IsPauseEnabled([out][retval] boolean* value);
[propput] HRESULT IsPauseEnabled([in] boolean value);
[propget] HRESULT IsMenuEnabled([out][retval] boolean* value);
[propput] HRESULT IsMenuEnabled([in] boolean value);
[propget] HRESULT IsViewEnabled([out][retval] boolean* value);
[propput] HRESULT IsViewEnabled([in] boolean value);
[propget] HRESULT IsBackEnabled([out][retval] boolean* value);
[propput] HRESULT IsBackEnabled([in] boolean value);
[eventadd] HRESULT ButtonPressed([in] Windows.Foundation.TypedEventHandler<Windows.Xbox.Media.GameTransportControls*, Windows.Xbox.Media.GameTransportControlsButtonPressedEventArgs*>* handler,[out][retval] EventRegistrationToken* token);
[eventremove] HRESULT ButtonPressed([in] EventRegistrationToken token);
[eventadd] HRESULT PropertyChanged([in] Windows.Foundation.TypedEventHandler<Windows.Xbox.Media.GameTransportControls*, Windows.Xbox.Media.GameTransportControlsPropertyChangedEventArgs*>* handler,[out][retval] EventRegistrationToken* token);
[eventremove] HRESULT PropertyChanged([in] EventRegistrationToken token);
}
[exclusiveto(Windows.Xbox.Media.GameTransportControlsButtonPressedEventArgs)]
[uuid(B7F47116-A56F-4DC8-9E11-92031F4A87C2)]
[version(1.0)]
interface IGameTransportControlsButtonPressedEventArgs : IInspectable
{
[propget] HRESULT Button([out][retval] Windows.Xbox.Media.GameTransportControlsButton* value);
}
[exclusiveto(Windows.Xbox.Media.GameTransportControlsPropertyChangedEventArgs)]
[uuid(D0CA0936-339B-4CB3-8EEB-737607F56E08)]
[version(1.0)]
interface IGameTransportControlsPropertyChangedEventArgs : IInspectable
{
[propget] HRESULT Property([out][retval] Windows.Xbox.Media.GameTransportControlsProperty* value);
}
[activatable(Windows.Xbox.Media.GameTransportControlsContract, 1.0)]
[contract(Windows.Xbox.Media.GameTransportControlsContract, 1.0)]
[version(1.0)]
[marshaling_behavior(agile)]
[threading(mta)]
runtimeclass GameTransportControls
{
[default] interface Windows.Xbox.Media.IGameTransportControls;
}
[version(1.0)]
[marshaling_behavior(agile)]
runtimeclass GameTransportControlsButtonPressedEventArgs
{
[default] interface Windows.Xbox.Media.IGameTransportControlsButtonPressedEventArgs;
}
[marshaling_behavior(agile)]
[version(1.0)]
runtimeclass GameTransportControlsPropertyChangedEventArgs
{
[default] interface Windows.Xbox.Media.IGameTransportControlsPropertyChangedEventArgs;
}
}
}
}
@@ -9,13 +9,11 @@
namespace winrt::Windows::Xbox::Input::implementation
{
winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::Input::IGamepad> Gamepad::Gamepads()
winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::Input::IGamepad> Gamepad::Gamepads( )
{
wprintf(L"Gamepad || Gamepads Queried!\n");
if (staticGamepads == Foundation::Collections::IVector<winrt::Windows::Xbox::Input::IGamepad>(nullptr) || staticGamepads.Size( ) == 0) {
staticGamepads = winrt::single_threaded_vector<Input::IGamepad>( );
LOG_INFO_W(L"Gamepad || Gamepads Queried!\n");
for (DWORD gamepad = 0; gamepad < XUSER_MAX_COUNT; gamepad++)
{
XINPUT_CAPABILITIES capabilities;
@@ -37,84 +35,118 @@ namespace winrt::Windows::Xbox::Input::implementation
return staticGamepads.GetView( );
}
winrt::event_token Gamepad::GamepadAdded(winrt::Windows::Foundation::EventHandler<winrt::Windows::Xbox::Input::GamepadAddedEventArgs> const& handler)
{
wprintf(L"Gamepad || Gamepad Added!\n");
LOG_NOT_IMPLEMENTED(); return {};
LOG_INFO_W(L"Gamepad || Gamepad Added!\n");
LOG_WARNING("Gamepad || GamepadAdded event is not implemented, returning empty token.");
return {};
}
void Gamepad::GamepadAdded(winrt::event_token const& token) noexcept
{
wprintf(L"Gamepad || Gamepad Added!\n");
LOG_NOT_IMPLEMENTED(); throw hresult_not_implemented();
LOG_INFO_W(L"Gamepad || Gamepad Added!\n");
LOG_NOT_IMPLEMENTED( );
throw hresult_not_implemented( );
}
winrt::event_token Gamepad::GamepadRemoved(winrt::Windows::Foundation::EventHandler<winrt::Windows::Xbox::Input::GamepadRemovedEventArgs> const& handler)
{
wprintf(L"Gamepad || Gamepad Removed!\n");
LOG_NOT_IMPLEMENTED(); return {};
LOG_INFO_W(L"Gamepad || Gamepad Removed!\n");
LOG_NOT_IMPLEMENTED( );
return {};
}
void Gamepad::GamepadRemoved(winrt::event_token const& token) noexcept
{
wprintf(L"Gamepad || Gamepad Removed!\n");
LOG_NOT_IMPLEMENTED(); throw hresult_not_implemented();
LOG_INFO_W(L"Gamepad || Gamepad Removed!\n");
LOG_NOT_IMPLEMENTED( );
throw hresult_not_implemented( );
}
uint64_t Gamepad::Id()
uint64_t Gamepad::Id( )
{
wprintf(L"Gamepad || Gamepad ID ( %d ) Queried!\n", m_id);
LOG_INFO_W(L"Gamepad || Gamepad ID ( %d ) Queried!\n", m_id);
return m_id;
}
hstring Gamepad::Type()
hstring Gamepad::Type( )
{
return L"Windows.Xbox.Input.Gamepad";
}
winrt::Windows::Xbox::System::User Gamepad::User()
winrt::Windows::Xbox::System::User Gamepad::User( )
{
wprintf(L"Gamepad || User Queried!\n");
return System::implementation::User::Users( ).GetAt(Id());
LOG_INFO_W(L"Gamepad || User Queried!\n");
return System::implementation::User::Users( ).GetAt(Id( ));
}
winrt::Windows::Xbox::Input::INavigationReading Gamepad::GetNavigationReading()
winrt::Windows::Xbox::Input::INavigationReading Gamepad::GetNavigationReading( )
{
LOG_NOT_IMPLEMENTED(); throw hresult_not_implemented();
LOG_NOT_IMPLEMENTED( );
throw hresult_not_implemented( );
}
winrt::Windows::Xbox::Input::RawNavigationReading Gamepad::GetRawNavigationReading()
winrt::Windows::Xbox::Input::RawNavigationReading Gamepad::GetRawNavigationReading( )
{
RawNavigationReading dummyNavigationReading = RawNavigationReading( );
dummyNavigationReading.Timestamp = GetTickCount64( );
dummyNavigationReading.Buttons |= NavigationButtons::Up;
return dummyNavigationReading;
dummyNavigationReading.Buttons |= NavigationButtons::Up;
return dummyNavigationReading;
}
winrt::event_token Gamepad::NavigationReadingChanged(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Xbox::Input::NavigationController, winrt::Windows::Xbox::Input::INavigationReadingChangedEventArgs> const& handler)
{
LOG_NOT_IMPLEMENTED(); throw hresult_not_implemented();
LOG_NOT_IMPLEMENTED( );
throw hresult_not_implemented( );
}
void Gamepad::NavigationReadingChanged(winrt::event_token const& token) noexcept
{
LOG_NOT_IMPLEMENTED(); throw hresult_not_implemented();
LOG_NOT_IMPLEMENTED( );
throw hresult_not_implemented( );
}
void Gamepad::SetVibration(winrt::Windows::Xbox::Input::GamepadVibration const& value)
{
XINPUT_VIBRATION vibration;
ZeroMemory(&vibration, sizeof(XINPUT_VIBRATION));
vibration.wLeftMotorSpeed = value.LeftMotorLevel * 65535;
vibration.wRightMotorSpeed = value.RightMotorLevel * 65535;
vibration.wLeftMotorSpeed = static_cast<WORD>(value.LeftMotorLevel * 65535);
vibration.wRightMotorSpeed = static_cast<WORD>(value.RightMotorLevel * 65535);
XInputSetState(m_id, &vibration);
}
winrt::Windows::Xbox::Input::IGamepadReading Gamepad::GetCurrentReading()
winrt::Windows::Xbox::Input::IGamepadReading Gamepad::GetCurrentReading( )
{
return winrt::make<implementation::GamepadReading>(GetRawCurrentReading());
return winrt::make<implementation::GamepadReading>(GetRawCurrentReading( ));
}
winrt::Windows::Xbox::Input::RawGamepadReading Gamepad::GetRawCurrentReading()
winrt::Windows::Xbox::Input::RawGamepadReading Gamepad::GetRawCurrentReading( )
{
XINPUT_STATE xiState;
ZeroMemory(&xiState, sizeof(XINPUT_STATE));
ZeroMemory(&xiState, sizeof(XINPUT_STATE));
RawGamepadReading reading = {};
if (XInputGetState(m_id, &xiState) == ERROR_SUCCESS)
DWORD result = XInputGetState(m_id, &xiState);
if (result == ERROR_SUCCESS)
{
// Debug logging - remove after testing
if (xiState.Gamepad.wButtons != 0)
{
LOG_INFO_W(L"Gamepad || Controller %d - Button mask: 0x%04X\n", m_id, xiState.Gamepad.wButtons);
}
for (int i = 0; i < ARRAYSIZE(gamepadButtons); i++)
{
if (xiState.Gamepad.wButtons & gamepadButtons[ i ].first)
{
reading.Buttons |= gamepadButtons[ i ].second;
// Debug: Log when Start button is detected
if (gamepadButtons[ i ].first == XINPUT_GAMEPAD_START)
{
LOG_INFO_W(L"Gamepad || START BUTTON DETECTED!\n");
}
}
}
@@ -125,6 +157,10 @@ namespace winrt::Windows::Xbox::Input::implementation
reading.RightThumbstickX = xiState.Gamepad.sThumbRX / 32768.f;
reading.RightThumbstickY = xiState.Gamepad.sThumbRY / 32768.f;
}
else
{
LOG_WARNING_W(L"Gamepad || XInputGetState failed for controller %d with error: %d\n", m_id, result);
}
float lx = 0.0f;
float ly = 0.0f;
@@ -186,16 +222,21 @@ namespace winrt::Windows::Xbox::Input::implementation
return reading;
}
winrt::event_token Gamepad::ReadingChanged(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Xbox::Input::Gamepad, winrt::Windows::Xbox::Input::IGamepadReadingChangedEventArgs> const& handler)
{
LOG_NOT_IMPLEMENTED(); throw hresult_not_implemented();
LOG_NOT_IMPLEMENTED( );
throw hresult_not_implemented( );
}
void Gamepad::ReadingChanged(winrt::event_token const& token) noexcept
{
LOG_NOT_IMPLEMENTED(); throw hresult_not_implemented();
LOG_NOT_IMPLEMENTED( );
throw hresult_not_implemented( );
}
bool Gamepad::IsTrusted()
bool Gamepad::IsTrusted( )
{
return true;
}
}
}
@@ -2,7 +2,7 @@
#include "Windows.Xbox.Storage.BlobInfoQueryResult.h"
#include "Windows.Xbox.Storage.BlobInfoQueryResult.g.cpp"
#include <winrt/Windows.Foundation.Collections.h>
#include "../ConnectedStorage/ConnectedStorage.h"
#include "../ConnectedStorage/Windows.Xbox.Storage.ConnectedStorage.h"
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Storage.FileProperties.h>
#include <hstring.h>
@@ -1,7 +1,7 @@
#include "pch.h"
#include "Windows.Xbox.Storage.ConnectedStorageContainer.h"
#include "Windows.Xbox.Storage.ConnectedStorageContainer.g.cpp"
#include "../ConnectedStorage/ConnectedStorage.h"
#include "../ConnectedStorage/Windows.Xbox.Storage.ConnectedStorage.h"
#include "Windows.Xbox.Storage.BlobInfoQueryResult.h"
@@ -3,7 +3,7 @@
#include <winrt/Windows.Foundation.Collections.h>
#include "../ConnectedStorage/ConnectedStorage.h"
#include "../ConnectedStorage/Windows.Xbox.Storage.ConnectedStorage.h"
namespace winrt::Windows::Xbox::Storage::implementation
{
@@ -2,11 +2,11 @@
#include "Windows.Xbox.Storage.ContainerInfoQueryResult.h"
#include "Windows.Xbox.Storage.ContainerInfoQueryResult.g.cpp"
#include <winrt/Windows.ApplicationModel.h>
#include "../ConnectedStorage/ConnectedStorage.h"
#include "../ConnectedStorage/Windows.Xbox.Storage.ConnectedStorage.h"
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Storage.FileProperties.h>
#include <winrt/Windows.Foundation.Collections.h>
#include "../ConnectedStorage/ConnectedStorage.h"
#include "../ConnectedStorage/Windows.Xbox.Storage.ConnectedStorage.h"
namespace winrt::Windows::Xbox::Storage::implementation
{
+1 -1
View File
@@ -1,6 +1,6 @@
#include "pch.h"
#include "../common/Config.h"
#include "ConnectedStorage/ConnectedStorage.h"
#include "ConnectedStorage/Windows.Xbox.Storage.ConnectedStorage.h"
DWORD WINAPI ThreadProc(LPVOID lpParam)
{
+2 -2
View File
@@ -163,7 +163,7 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="common.h" />
<ClInclude Include="ConnectedStorage\ConnectedStorage.h" />
<ClInclude Include="ConnectedStorage\Windows.Xbox.Storage.ConnectedStorage.h" />
<ClInclude Include="Implementation\Microsoft.Xbox.GameChat.AccessibilitySettingsChangedEventArgs.h" />
<ClInclude Include="Implementation\Microsoft.Xbox.GameChat.ChannelUpdatedEventArgs.h" />
<ClInclude Include="Implementation\Microsoft.Xbox.GameChat.ChatManager.h" />
@@ -553,7 +553,7 @@
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="ConnectedStorage\ConnectedStorage.cpp" />
<ClCompile Include="ConnectedStorage\Windows.Xbox.Storage.ConnectedStorage.cpp" />
<ClCompile Include="Implementation\Microsoft.Xbox.GameChat.AccessibilitySettingsChangedEventArgs.cpp" />
<ClCompile Include="Implementation\Microsoft.Xbox.GameChat.ChannelUpdatedEventArgs.cpp" />
<ClCompile Include="Implementation\Microsoft.Xbox.GameChat.ChatManager.cpp" />
+9 -9
View File
@@ -155,12 +155,12 @@
<Filter Include="Implementation\Windows\Xbox\Speech\Recognition">
<UniqueIdentifier>{8bbdeb8d-b4d2-47a9-9d8b-c61fa4c912e9}</UniqueIdentifier>
</Filter>
<Filter Include="Implementation\WinDurango">
<UniqueIdentifier>{39c5e887-fef6-48c2-9f60-7ddf8b3acdbf}</UniqueIdentifier>
</Filter>
<Filter Include="Implementation\Windows\Xbox\SmartGlass">
<UniqueIdentifier>{a9003d68-6bbb-43e4-ab6e-f1243e316c7c}</UniqueIdentifier>
</Filter>
<Filter Include="Implementation\Windows\Xbox\Storage\WinDurango">
<UniqueIdentifier>{39c5e887-fef6-48c2-9f60-7ddf8b3acdbf}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp" />
@@ -1243,9 +1243,6 @@
<ClCompile Include="Implementation\Windows.Xbox.Speech.Recognition.SpeechSequenceRule.cpp">
<Filter>Implementation\Windows\Xbox\Speech\Recognition</Filter>
</ClCompile>
<ClCompile Include="ConnectedStorage\ConnectedStorage.cpp">
<Filter>Implementation\WinDurango</Filter>
</ClCompile>
<ClCompile Include="Implementation\Windows.Xbox.SmartGlass.SmartGlassAuxiliaryStream.cpp">
<Filter>Implementation\Windows\Xbox\SmartGlass</Filter>
</ClCompile>
@@ -1327,6 +1324,9 @@
<ClCompile Include="Implementation\Windows.Xbox.Multiplayer.MultiplayerSessionReference.cpp">
<Filter>Implementation\Windows\Xbox\Multiplayer</Filter>
</ClCompile>
<ClCompile Include="ConnectedStorage\Windows.Xbox.Storage.ConnectedStorage.cpp">
<Filter>Implementation\Windows\Xbox\Storage\WinDurango</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Implementation\Microsoft.Xbox.GameChat.TextMessageReceivedEventArgs.h">
@@ -2405,9 +2405,6 @@
<Filter>Implementation\Windows\Xbox\Speech\Recognition</Filter>
</ClInclude>
<ClInclude Include="common.h" />
<ClInclude Include="ConnectedStorage\ConnectedStorage.h">
<Filter>Implementation\WinDurango</Filter>
</ClInclude>
<ClInclude Include="Implementation\Windows.Xbox.Input.ControllerInputManager.h">
<Filter>Implementation\Windows\Xbox\Input</Filter>
</ClInclude>
@@ -2492,6 +2489,9 @@
<ClInclude Include="Implementation\Windows.Xbox.Multiplayer.MultiplayerSessionReference.h">
<Filter>Implementation\Windows\Xbox\Multiplayer</Filter>
</ClInclude>
<ClInclude Include="ConnectedStorage\Windows.Xbox.Storage.ConnectedStorage.h">
<Filter>Implementation\Windows\Xbox\Storage\WinDurango</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="winrt_x.def" />