Many changes (#118)

* many changes

* imgui attempt (lots of flickering)

* flickering fixed

lesson learned: don't call present twice

* Prevent unimplemented crashes

* unlockin + systemui keyboard

* force aspect ratio, connectedstorage stuff

---------

Co-authored-by: Darien Johnson <84008186+CADIndie@users.noreply.github.com>
This commit is contained in:
Unixian
2025-01-15 16:21:40 -05:00
committed by GitHub
parent 74da423c8a
commit 475a5fbdad
55 changed files with 2767 additions and 202 deletions

View File

@@ -45,15 +45,25 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XAudio2_9_x", "dlls\XAudio2
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Detours", "thirdparty\Detours\vc\Detours.vcxproj", "{37489709-8054-4903-9C49-A79846049FC9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "imgui", "imgui", "{EEA5001B-6451-4AA8-8475-443003893536}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "imgui", "imgui", "{114E77CB-6130-4235-A0F4-3392FA3997C6}"
ProjectSection(SolutionItems) = preProject
thirdparty\imgui\imconfig.h = thirdparty\imgui\imconfig.h
thirdparty\imgui\imgui.cpp = thirdparty\imgui\imgui.cpp
thirdparty\imgui\imgui.h = thirdparty\imgui\imgui.h
thirdparty\imgui\imgui_demo.cpp = thirdparty\imgui\imgui_demo.cpp
thirdparty\imgui\imgui_draw.cpp = thirdparty\imgui\imgui_draw.cpp
thirdparty\imgui\backends\imgui_impl_dx11.cpp = thirdparty\imgui\backends\imgui_impl_dx11.cpp
thirdparty\imgui\backends\imgui_impl_dx11.h = thirdparty\imgui\backends\imgui_impl_dx11.h
thirdparty\imgui\backends\imgui_impl_dx12.cpp = thirdparty\imgui\backends\imgui_impl_dx12.cpp
thirdparty\imgui\backends\imgui_impl_dx12.h = thirdparty\imgui\backends\imgui_impl_dx12.h
thirdparty\imgui_impl_uwp.cpp = thirdparty\imgui_impl_uwp.cpp
thirdparty\imgui_impl_uwp.h = thirdparty\imgui_impl_uwp.h
thirdparty\imgui\imgui_internal.h = thirdparty\imgui\imgui_internal.h
thirdparty\imgui\imgui_tables.cpp = thirdparty\imgui\imgui_tables.cpp
thirdparty\imgui\imgui_widgets.cpp = thirdparty\imgui\imgui_widgets.cpp
thirdparty\imgui\imstb_rectpack.h = thirdparty\imgui\imstb_rectpack.h
thirdparty\imgui\imstb_textedit.h = thirdparty\imgui\imstb_textedit.h
thirdparty\imgui\imstb_truetype.h = thirdparty\imgui\imstb_truetype.h
EndProjectSection
EndProject
Global
@@ -576,7 +586,7 @@ Global
{4A5072B4-8304-4CC4-88C1-CF875110FF47} = {BF759166-26A8-4B46-8423-8091158F2EA5}
{0C02E6B1-4532-4194-8891-11DDC164C0A8} = {BF759166-26A8-4B46-8423-8091158F2EA5}
{37489709-8054-4903-9C49-A79846049FC9} = {243DBE8A-7A46-42B5-9FEC-A8E7CB67CE81}
{EEA5001B-6451-4AA8-8475-443003893536} = {243DBE8A-7A46-42B5-9FEC-A8E7CB67CE81}
{114E77CB-6130-4235-A0F4-3392FA3997C6} = {243DBE8A-7A46-42B5-9FEC-A8E7CB67CE81}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {30EA489C-CFA4-4816-BE12-8BCE129039C5}

View File

@@ -1 +1 @@
#pragma once
#pragma once

View File

@@ -15,4 +15,6 @@ EXPORTS
DXGIXGetFrameStatistics = DXGIXGetFrameStatistics_X @13
DXGIXPresentArray = DXGIXPresentArray_X @14
DXGIXSetFrameNotification = DXGIXSetFrameNotification_X @15
DXGIXSetVLineNotification = DXGIXSetVLineNotification_X @16
DXGIXSetVLineNotification = DXGIXSetVLineNotification_X @16
WD11XNotify = WD11XNotify_X @17
WDWaitForKeyboard = WDWaitForKeyboard @18

View File

@@ -93,7 +93,7 @@ namespace d3d11x
virtual HRESULT STDMETHODCALLTYPE CreateSwapChainForCoreWindow(
IGraphicsUnknown* pDevice,
IUnknown* pWindow,
const DXGI_SWAP_CHAIN_DESC1* pDesc,
DXGI_SWAP_CHAIN_DESC1* pDesc,
IDXGIOutput* pRestrictToOutput,
IDXGISwapChain1_X** ppSwapChain) PURE;

View File

@@ -3,6 +3,13 @@
#include "ID3DWrappers.h"
#include <windows.ui.core.h>
#include "../kernelx/CoreWindowWrapperX.h"
#include "overlay/overlay.h"
#define DXGI_SWAPCHAIN_FLAG_MASK DXGI_SWAP_CHAIN_FLAG_NONPREROTATED | DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH | DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE \
| DXGI_SWAP_CHAIN_FLAG_RESTRICTED_CONTENT | DXGI_SWAP_CHAIN_FLAG_RESTRICT_SHARED_RESOURCE_DRIVER | DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY | DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT \
| DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER | DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO | DXGI_SWAP_CHAIN_FLAG_YUV_VIDEO \
| DXGI_SWAP_CHAIN_FLAG_HW_PROTECTED | DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING \
| DXGI_SWAP_CHAIN_FLAG_RESTRICTED_TO_ALL_HOLOGRAPHIC_DISPLAYS
namespace d3d11x
{
@@ -114,12 +121,46 @@ namespace d3d11x
return m_realFactory->CreateSwapChainForHwnd(reinterpret_cast<IUnknown*>(pDevice), hWnd, pDesc, pFullscreenDesc, pRestrictToOutput, ppSwapChain);
}
HRESULT __stdcall IDXGIFactoryWrapper::CreateSwapChainForCoreWindow(IGraphicsUnknown* pDevice, IUnknown* pWindow, const DXGI_SWAP_CHAIN_DESC1* pDesc, IDXGIOutput* pRestrictToOutput, IDXGISwapChain1_X** ppSwapChain)
HRESULT __stdcall IDXGIFactoryWrapper::CreateSwapChainForCoreWindow(IGraphicsUnknown* pDevice, IUnknown* pWindow, DXGI_SWAP_CHAIN_DESC1* pDesc, IDXGIOutput* pRestrictToOutput, IDXGISwapChain1_X** ppSwapChain)
{
IDXGISwapChain1* swap = nullptr;
HRESULT hr = m_realFactory->CreateSwapChainForCoreWindow(reinterpret_cast<IUnknown*>(pDevice), reinterpret_cast<CoreWindowWrapperX*>(pWindow)->m_realWindow, pDesc, pRestrictToOutput, &swap);
HRESULT hr;
pDesc->Flags &= DXGI_SWAPCHAIN_FLAG_MASK;
pDesc->Scaling = DXGI_SCALING_ASPECT_RATIO_STRETCH;
if (pWindow == nullptr)
{
ComPtr<ICoreWindowStatic> coreWindowStatic;
RoGetActivationFactory(Wrappers::HStringReference(RuntimeClass_Windows_UI_Core_CoreWindow).Get( ), IID_PPV_ARGS(&coreWindowStatic));
ComPtr<ICoreWindow> coreWindow;
coreWindowStatic->GetForCurrentThread(&coreWindow);
pWindow = coreWindow.Get( );
hr = m_realFactory->CreateSwapChainForCoreWindow(reinterpret_cast<IUnknown*>(pDevice), pWindow, pDesc, pRestrictToOutput, &swap);
*ppSwapChain = new IDXGISwapChainWrapper(swap);
}
else
{
hr = m_realFactory->CreateSwapChainForCoreWindow(reinterpret_cast<IUnknown*>(pDevice), reinterpret_cast<CoreWindowWrapperX*>(pWindow)->m_realWindow, pDesc, pRestrictToOutput, &swap);
*ppSwapChain = new IDXGISwapChainWrapper(swap);
}
if (WinDurango::g_Overlay == nullptr)
{
::ID3D11Device2* device;
pDevice->QueryInterface(__uuidof(ID3D11Device), reinterpret_cast<void**>(&device));
device = reinterpret_cast<d3d11x::D3D11DeviceXWrapperX*>(device)->m_realDevice;
::ID3D11DeviceContext* ctx{};
device->GetImmediateContext(&ctx);
WinDurango::g_Overlay = new WinDurango::Overlay(device, ctx, reinterpret_cast<IDXGISwapChainWrapper*>(*ppSwapChain)->m_realSwapchain);
WinDurango::g_Overlay->Initialize( );
}
*ppSwapChain = new IDXGISwapChainWrapper(swap);
return hr;
}

View File

@@ -1,9 +1,35 @@
#include "pch.h"
#include <chrono>
#include <thread>
#include "IDXGIWrappers.h"
#include "ID3DWrappers.h"
#include "overlay/overlay.h"
namespace d3d11x
{
// s/o to stackoverflow
template<std::intmax_t FPS>
class frame_rater {
public:
frame_rater( ) :
time_between_frames{ 1 },
tp{ std::chrono::steady_clock::now( ) }
{
}
void sleep( ) {
tp += time_between_frames;
std::this_thread::sleep_until(tp);
}
private:
std::chrono::duration<double, std::ratio<1, FPS>> time_between_frames;
std::chrono::time_point<std::chrono::steady_clock, decltype(time_between_frames)> tp;
};
inline frame_rater<60> fps60 = {};
HRESULT IDXGISwapChainWrapper::QueryInterface(REFIID riid, void** ppvObject)
{
@@ -68,6 +94,7 @@ namespace d3d11x
HRESULT __stdcall IDXGISwapChainWrapper::Present(UINT SyncInterval, UINT Flags)
{
WinDurango::g_Overlay->Present( );
return m_realSwapchain->Present(SyncInterval, Flags);
}
@@ -148,6 +175,13 @@ namespace d3d11x
HRESULT __stdcall IDXGISwapChainWrapper::Present1(UINT SyncInterval, UINT PresentFlags, const DXGI_PRESENT_PARAMETERS* pPresentParameters)
{
WinDurango::g_Overlay->Present( );
if (pPresentParameters == nullptr) {
//fps60.sleep( );
return m_realSwapchain->Present(SyncInterval, PresentFlags);
}
return m_realSwapchain->Present1(SyncInterval, PresentFlags, pPresentParameters);
}

View File

@@ -64,7 +64,7 @@ namespace d3d11x
HRESULT STDMETHODCALLTYPE CreateSwapChainForCoreWindow(
IGraphicsUnknown* pDevice,
IUnknown* pWindow,
const DXGI_SWAP_CHAIN_DESC1* pDesc,
DXGI_SWAP_CHAIN_DESC1* pDesc,
IDXGIOutput* pRestrictToOutput,
IDXGISwapChain1_X** ppSwapChain) override;
@@ -316,7 +316,7 @@ namespace d3d11x
private:
public:
IDXGISwapChain1* m_realSwapchain;
};

View File

@@ -3,9 +3,11 @@
#include "pch.h"
#include <cstdio>
#include <mutex>
#include "d3d_x/d3d_x.hpp"
#include "ID3DWrappers.h"
#include "overlay/overlay.h"
HRESULT _stdcall D3DQuerySEQCounters_X(D3D_SEQ_COUNTER_DATA* pData)
{
@@ -208,7 +210,7 @@ HRESULT __stdcall D3D11XCreateDeviceX_X(
auto flags = pParameters->Flags & CREATE_DEVICE_FLAG_MASK;
#ifdef _DEBUG
flags |= D3D11_CREATE_DEVICE_DEBUG;
//flags |= D3D11_CREATE_DEVICE_DEBUG;
#endif
HRESULT hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, 0, flags, featurelevels, _ARRAYSIZE(featurelevels), D3D11_SDK_VERSION, reinterpret_cast<ID3D11Device**>(ppDevice), NULL, reinterpret_cast<ID3D11DeviceContext**>(ppImmediateContext));
@@ -247,4 +249,33 @@ HRESULT __stdcall D3D11CreateDeviceAndSwapChain_X(
printf("!!! Game is trying to initialize D3D11 through NORMAL D3D11 !!!");
printf("SDK Version: %d\n", SDKVersion);
return D3D11CreateDeviceAndSwapChain(pAdapter, DriverType, Software, Flags, pFeatureLevels, FeatureLevels, SDKVersion, pSwapChainDesc, ppSwapChain, ppDevice, pFeatureLevel, ppImmediateContext);
}
std::mutex g_NotifyMutex;
// this function exists for other WinDurango dlls to notify the graphics component of an action
// for right now, this is used for signaling when a keyboard is requested by a game and rendering it using ImGUI
void WD11XNotify_X(WDEVENT_TYPE event)
{
const std::lock_guard lock(g_NotifyMutex);
printf("[d3d11_x] received notification\n");
switch (event)
{
case WDEVENT_TYPE_INVALID:
throw std::exception("this shouldn't happen, check code that sends events.");
case WDEVENT_TYPE_KEYBOARD_ENGAGE:
printf("[d3d11_x] keyboard engage\n");
WinDurango::g_Overlay->EnableKeyboard( );
break;
}
}
void WDWaitForKeyboard(const char** outText)
{
printf("[d3d11_x] waiting for keyboard\n");
WaitForSingleObject(WinDurango::g_KeyboardFinished, INFINITE);
*outText = WinDurango::g_KeyboardText;
}

View File

@@ -106,6 +106,13 @@ typedef enum DXGIX_VLINECOUNTER
// UINT ESRAMUsageBytes;
//};
typedef enum WDEVENT_TYPE : int
{
WDEVENT_TYPE_INVALID = 0,
WDEVENT_TYPE_KEYBOARD_ENGAGE
} WDEVENT_TYPE;
extern "C" const GUID DXGI_DEBUG_ALL;
DEFINE_GUID(DXGI_DEBUG_DX, 0x35cdd7fc, 0x13b2, 0x421d, 0xa5, 0xd7, 0x7e, 0x44, 0x51, 0x28, 0x7d, 0x64);
DEFINE_GUID(DXGI_DEBUG_DXGI, 0x25cddaa4, 0xb1c6, 0x47e1, 0xac, 0x3e, 0x98, 0x87, 0x5b, 0x5a, 0x2e, 0x2a);

View File

@@ -45,9 +45,11 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<TargetName>d3d11_x</TargetName>
<IncludePath>$(SolutionDir)thirdparty\imgui;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>d3d11_x</TargetName>
<IncludePath>$(SolutionDir)thirdparty\imgui;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
@@ -63,7 +65,7 @@
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>d3d10.lib;d3d11.lib;dxgi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>d3d10.lib;d3d11.lib;dxgi.lib;%(AdditionalDependencies);runtimeobject.lib</AdditionalDependencies>
<ModuleDefinitionFile>Exports.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
@@ -84,11 +86,19 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalDependencies>d3d11.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>d3d11.lib;%(AdditionalDependencies);runtimeobject.lib</AdditionalDependencies>
<ModuleDefinitionFile>Exports.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\thirdparty\imgui\backends\imgui_impl_dx11.h" />
<ClInclude Include="..\..\thirdparty\imgui\imconfig.h" />
<ClInclude Include="..\..\thirdparty\imgui\imgui.h" />
<ClInclude Include="..\..\thirdparty\imgui\imgui_internal.h" />
<ClInclude Include="..\..\thirdparty\imgui\imstb_rectpack.h" />
<ClInclude Include="..\..\thirdparty\imgui\imstb_textedit.h" />
<ClInclude Include="..\..\thirdparty\imgui\imstb_truetype.h" />
<ClInclude Include="..\..\thirdparty\imgui_impl_uwp.h" />
<ClInclude Include="d3d11_x.h" />
<ClInclude Include="d3d_x\d3d11_x_device.h" />
<ClInclude Include="d3d_x\d3d_x.hpp" />
@@ -98,9 +108,38 @@
<ClInclude Include="ID3DWrappers.h" />
<ClInclude Include="ID3DX.h" />
<ClInclude Include="IDXGIWrappers.h" />
<ClInclude Include="overlay\overlay.h" />
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\thirdparty\imgui\backends\imgui_impl_dx11.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\thirdparty\imgui\imgui.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\thirdparty\imgui\imgui_demo.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\thirdparty\imgui\imgui_draw.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\thirdparty\imgui\imgui_tables.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\thirdparty\imgui\imgui_widgets.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\..\thirdparty\imgui_impl_uwp.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="d3d11_x.cpp" />
<ClCompile Include="d3d_x\d3d11_x_device.cpp" />
<ClCompile Include="dllmain.cpp" />
@@ -113,6 +152,7 @@
<ClCompile Include="IDXGIDeviceWrapper.cpp" />
<ClCompile Include="IDXGIFactoryWrapper.cpp" />
<ClCompile Include="IDXGISwapChainWrapper.cpp" />
<ClCompile Include="overlay\overlay.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>

View File

@@ -57,6 +57,33 @@
<ClInclude Include="ID3DDeviceContext.h">
<Filter>Header Files\ID3D</Filter>
</ClInclude>
<ClInclude Include="overlay\overlay.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\thirdparty\imgui_impl_uwp.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\thirdparty\imgui\imconfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\thirdparty\imgui\imgui.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\thirdparty\imgui\imgui_internal.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\thirdparty\imgui\imstb_rectpack.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\thirdparty\imgui\imstb_textedit.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\thirdparty\imgui\imstb_truetype.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\thirdparty\imgui\backends\imgui_impl_dx11.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="d3d11_x.cpp">
@@ -98,6 +125,30 @@
<ClCompile Include="ID3D11BufferWrapper.cpp">
<Filter>Source Files\ID3D</Filter>
</ClCompile>
<ClCompile Include="overlay\overlay.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\thirdparty\imgui_impl_uwp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\thirdparty\imgui\imgui.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\thirdparty\imgui\imgui_demo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\thirdparty\imgui\imgui_draw.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\thirdparty\imgui\imgui_tables.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\thirdparty\imgui\imgui_widgets.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\thirdparty\imgui\backends\imgui_impl_dx11.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="Exports.def.bak" />

View File

@@ -79,6 +79,9 @@ HRESULT d3d11x::D3D11DeviceXWrapperX::CreateTexture2D(
ID3D11Texture2D* texture2d = nullptr;
pDesc->MiscFlags &= TEXTURE_MISCFLAGS_MASK; // remove all flags that are xbox-one only flags
if (pDesc->Usage == D3D11_USAGE_DYNAMIC)
pDesc->CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
HRESULT hr = m_realDevice->CreateTexture2D(pDesc, pInitialData, &texture2d);
printf("[CreateTexture2D] created texture at 0x%llX\n", texture2d);
@@ -468,6 +471,8 @@ HRESULT d3d11x::D3D11DeviceXWrapperX::SetGpuMemoryPriority(
void d3d11x::D3D11DeviceXWrapperX::GetGpuHardwareConfiguration(
_Out_ d3d11x::D3D11X_GPU_HARDWARE_CONFIGURATION* pGpuHardwareConfiguration)
{
printf("[D3D11DeviceXWrapperX] GetGpuHardwareConfiguration");
static d3d11x::D3D11X_GPU_HARDWARE_CONFIGURATION dummyHardwareConfig = { 0, D3D11X_HARDWARE_VERSION_XBOX_ONE, 0 };
printf("[D3D11DeviceXWrapperX] GetGpuHardwareConfiguration\n");
*pGpuHardwareConfiguration = dummyHardwareConfig;
}
#pragma endregion

View File

@@ -130,7 +130,19 @@ namespace d3d11x
struct D3D11X_DESCRIPTOR_VERTEX_BUFFER_VIEW;
struct D3D11X_SAMPLER_STATE_DESC;
struct D3D11X_DESCRIPTOR_SAMPLER_STATE;
struct D3D11X_GPU_HARDWARE_CONFIGURATION;
typedef enum D3D11X_HARDWARE_VERSION
{
D3D11X_HARDWARE_VERSION_XBOX_ONE = 0,
D3D11X_HARDWARE_VERSION_XBOX_ONE_S = 1,
D3D11X_HARDWARE_VERSION_XBOX_ONE_X = 2,
D3D11X_HARDWARE_VERSION_XBOX_ONE_X_DEVKIT = 3
} D3D11X_HARDWARE_VERSION;
struct D3D11X_GPU_HARDWARE_CONFIGURATION {
UINT64 GpuFrequency;
D3D11X_HARDWARE_VERSION HardwareVersion;
UINT32 GpuCuCount;
};
typedef UINT(*D3D11XHANGBEGINCALLBACK) (UINT64 Flags);
typedef void (*D3D11XHANGPRINTCALLBACK) (const CHAR* strLine);
@@ -795,7 +807,7 @@ namespace d3d11x
HRESULT SetGpuMemoryPriority(UINT) override;
void GetGpuHardwareConfiguration(D3D11X_GPU_HARDWARE_CONFIGURATION*) override;
private:
public:
::ID3D11Device2* m_realDevice;
};

View File

@@ -0,0 +1,209 @@
#include "pch.h"
#include "overlay.h"
#include "../../../thirdparty/imgui/imgui.h"
#include "../../../thirdparty/imgui/backends/imgui_impl_dx11.h"
#include "../../../thirdparty/imgui_impl_uwp.h"
#include <winrt/windows.graphics.display.h>
WinDurango::Overlay::Overlay(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, IDXGISwapChain1* pSwapchain):
m_pRenderTargetView(nullptr)
{
m_pDevice = pDevice;
m_pContext = pContext;
m_pSwapchain = pSwapchain;
}
WinDurango::Overlay::~Overlay()
{
Shutdown( );
m_pDevice = nullptr;
m_pContext = nullptr;
m_pSwapchain = nullptr;
}
// This should be called when Run is called by the game inside the wrapper.
void WinDurango::Overlay::Initialize()
{
g_KeyboardFinished = CreateEventA(NULL, FALSE, FALSE, "KeyboardFinished");
ID3D11Texture2D* pBackBuffer;
m_pSwapchain->GetBuffer(0, IID_PPV_ARGS(&pBackBuffer));
m_pDevice->CreateRenderTargetView(pBackBuffer, nullptr, &m_pRenderTargetView);
IMGUI_CHECKVERSION( );
ImGui::CreateContext( );
ImGuiIO& io = ImGui::GetIO( ); (void) io;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
io.Fonts->AddFontFromFileTTF("c:\\Windows\\Fonts\\segoeui.ttf", 18.0f);
ImGui::StyleColorsDark( );
ImGui_ImplUwp_InitForCurrentView( );
ImGui_ImplDX11_Init(m_pDevice, m_pContext);
}
void WinDurango::Overlay::Shutdown()
{
ImGui_ImplDX11_Shutdown( );
ImGui_ImplUwp_Shutdown( );
ImGui::DestroyContext( );
}
void WinDurango::Overlay::EnableKeyboard()
{
m_bKeyboard = true;
}
void WinDurango::Overlay::Present( )
{
ImGui_ImplDX11_NewFrame( );
ImGui_ImplUwp_NewFrame( );
ImGui::NewFrame( );
if (m_bKeyboard)
{
ImGui::SetNextWindowSize(ImVec2(500, 300));
ImGui::Begin("WinDurango Keyboard Input", &m_bKeyboard, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoCollapse);
//static bool isUppercase = false;
//static bool isSymbols = false;
//const char* keys[] = {
// "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=",
// "Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "[", "]",
// "A", "S", "D", "F", "G", "H", "J", "K", "L", ";", "'",
// "Z", "X", "C", "V", "B", "N", "M", ",", ".", "/"
//};
//const char* symbols[] = {
// "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+",
// "~", "`", "|", "\\", "{", "}", "[", "]", ":", ";", "\"", "'",
// "<", ">", "?", "/", ",", ".", "=", "-"
//};
ImGui::InputText("Buffer", g_KeyboardText, IM_ARRAYSIZE(g_KeyboardText));
//if (ImGui::Button(isUppercase ? "Lowercase" : "Uppercase"))
//{
// isUppercase = !isUppercase;
//}
//ImGui::SameLine();
//if (ImGui::Button(isSymbols ? "Letters" : "Symbols"))
//{
// isSymbols = !isSymbols;
//}
//ImGui::NewLine();
//const char** currentKeys = isSymbols ? symbols : keys;
ImVec2 buttonSize = ImVec2(30, 30); // Set a fixed size for all buttons
//for (int i = 0; i < 12; ++i)
//{
// if (ImGui::Button(currentKeys[i], buttonSize))
// {
// size_t len = strlen(g_KeyboardText);
// if (len < 255)
// {
// g_KeyboardText[len] = isUppercase ? currentKeys[i][0] : tolower(currentKeys[i][0]);
// g_KeyboardText[len + 1] = '\0';
// }
// }
// ImGui::SameLine();
//}
//ImGui::NewLine();
//for (int i = 12; i < 24; ++i)
//{
// if (ImGui::Button(currentKeys[i], buttonSize))
// {
// size_t len = strlen(g_KeyboardText);
// if (len < 255)
// {
// g_KeyboardText[len] = isUppercase ? currentKeys[i][0] : tolower(currentKeys[i][0]);
// g_KeyboardText[len + 1] = '\0';
// }
// }
// ImGui::SameLine();
//}
//ImGui::NewLine();
//if (!isSymbols)
//{
// for (int i = 24; i < 35; ++i)
// {
// if (ImGui::Button(currentKeys[ i ], buttonSize))
// {
// size_t len = strlen(g_KeyboardText);
// if (len < 255)
// {
// g_KeyboardText[ len ] = isUppercase ? currentKeys[ i ][ 0 ] : tolower(currentKeys[ i ][ 0 ]);
// g_KeyboardText[ len + 1 ] = '\0';
// }
// }
// ImGui::SameLine( );
// }
//}
//else
//{
// for (int i = 24; i < 32; ++i)
// {
// if (ImGui::Button(currentKeys[ i ], buttonSize))
// {
// size_t len = strlen(g_KeyboardText);
// if (len < 255)
// {
// g_KeyboardText[ len ] = isUppercase ? currentKeys[ i ][ 0 ] : tolower(currentKeys[ i ][ 0 ]);
// g_KeyboardText[ len + 1 ] = '\0';
// }
// }
// ImGui::SameLine( );
// }
//}
//ImGui::NewLine();
//if (!isSymbols)
//{
// for (int i = 35; i < 44; ++i)
// {
// if (ImGui::Button(currentKeys[ i ], buttonSize))
// {
// size_t len = strlen(g_KeyboardText);
// if (len < 255)
// {
// g_KeyboardText[ len ] = isUppercase ? currentKeys[ i ][ 0 ] : tolower(currentKeys[ i ][ 0 ]);
// g_KeyboardText[ len + 1 ] = '\0';
// }
// }
// ImGui::SameLine( );
// }
//}
//ImGui::NewLine();
if (ImGui::Button("OK", buttonSize) || ImGui::IsKeyPressed(ImGuiKey_GamepadStart))
{
m_bKeyboard = false;
SetEvent(g_KeyboardFinished);
}
//if (ImGui::IsKeyPressed(ImGuiKey_GamepadBack))
//{
// size_t len = strlen(g_KeyboardText);
// if (len > 0)
// {
// g_KeyboardText[len - 1] = '\0';
// }
//}
ImGui::End();
}
ImGui::Render();
m_pContext->OMSetRenderTargets(1, &m_pRenderTargetView, nullptr);
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
}

View File

@@ -0,0 +1,28 @@
#pragma once
namespace WinDurango
{
class Overlay
{
public:
Overlay(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, IDXGISwapChain1* pSwapchain);
~Overlay( );
void Initialize();
void Shutdown( );
void EnableKeyboard( );
void Present( );
private:
bool m_bOpen = false;
bool m_bKeyboard = false;
ID3D11Device* m_pDevice = nullptr;
ID3D11DeviceContext* m_pContext = nullptr;
IDXGISwapChain1* m_pSwapchain = nullptr;
ID3D11RenderTargetView* m_pRenderTargetView;
};
inline Overlay* g_Overlay = nullptr;
inline HANDLE g_KeyboardFinished;
inline char g_KeyboardText[ 256 ];
}

View File

@@ -145,7 +145,7 @@ HRESULT CoreApplicationWrapperX::QueryInterface(const IID& riid, void** ppvObjec
WideCharToMultiByte(CP_UTF8, 0, iidwstr, -1, iidstr, sizeof(iidstr), nullptr, nullptr);
MessageBoxA(nullptr, iidstr, typeid(*this).name(), MB_OK);
}
*ppvObject = nullptr;
return E_NOINTERFACE;
}

View File

@@ -1,6 +1,105 @@
#include "pch.h"
#include "CurrentAppWrapper.hpp"
HRESULT LicenseInformationWrapperX::QueryInterface(const IID& riid, void** ppvObject)
{
if (riid == __uuidof(ILicenseInformationX))
{
*ppvObject = reinterpret_cast<ICurrentAppX*>(this);
AddRef();
return S_OK;
}
HRESULT hr = m_realLicenseInformation->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);
printf("[CurrentAppWrapperX] Interface Not Implemented: %s\n", iidstr);
}
*ppvObject = nullptr;
return E_NOINTERFACE;
}
ULONG LicenseInformationWrapperX::AddRef()
{
return InterlockedIncrement(&m_RefCount);
}
ULONG LicenseInformationWrapperX::Release()
{
ULONG refCount = InterlockedDecrement(&m_RefCount);
if (refCount == 0)
{
m_realLicenseInformation->Release();
delete this;
}
return refCount;
}
HRESULT LicenseInformationWrapperX::GetIids(ULONG* iidCount, IID** iids)
{
return m_realLicenseInformation->GetIids(iidCount, iids);
}
HRESULT LicenseInformationWrapperX::GetRuntimeClassName(HSTRING* className)
{
return m_realLicenseInformation->GetRuntimeClassName(className);
}
HRESULT LicenseInformationWrapperX::GetTrustLevel(TrustLevel* trustLevel)
{
return m_realLicenseInformation->GetTrustLevel(trustLevel);
}
HRESULT LicenseInformationWrapperX::get_ProductLicenses(
ABI::Windows::Foundation::Collections::__FIMapView_2_HSTRING_Windows__CApplicationModel__CStore__CProductLicense_t**
value)
{
printf("[LicenseInformationWrapperX] get_ProductLicenses\n");
return E_NOTIMPL;
}
HRESULT LicenseInformationWrapperX::get_IsActive(boolean* value)
{
printf("[LicenseInformationWrapperX] get_IsActive\n");
return E_NOTIMPL;
}
HRESULT LicenseInformationWrapperX::get_IsTrial(boolean* value)
{
printf("[LicenseInformationWrapperX] get_IsTrial\n");
*value = false;
return S_OK;
}
HRESULT LicenseInformationWrapperX::get_ExpirationDate(ABI::Windows::Foundation::DateTime* value)
{
printf("[LicenseInformationWrapperX] get_ExpirationDate\n");
return E_NOTIMPL;
}
HRESULT LicenseInformationWrapperX::add_LicenseChanged(
ABI::Windows::ApplicationModel::Store::ILicenseChangedEventHandler* handler, EventRegistrationToken* cookie)
{
HRESULT hr = m_realLicenseInformation->add_LicenseChanged(handler, cookie);
printf("[LicenseInformationWrapperX] add_LicenseChanged\n");
if (SUCCEEDED(hr))
handler->Invoke();
return hr;
}
HRESULT LicenseInformationWrapperX::remove_LicenseChanged(EventRegistrationToken cookie)
{
printf("[LicenseInformationWrapperX] remove_LicenseChanged\n");
return E_NOTIMPL;
}
HRESULT __stdcall CurrentAppWrapperX::QueryInterface(REFIID riid, void** ppvObject)
{
if (riid == __uuidof(ICurrentAppX))

View File

@@ -97,6 +97,53 @@ public:
// ) override;
//};
class LicenseInformationWrapperX : public ILicenseInformationX
{
public:
LicenseInformationWrapperX(ABI::Windows::ApplicationModel::Store::ILicenseInformation* realLicenseInformation)
: m_realLicenseInformation(realLicenseInformation)
{
m_RefCount++;
}
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_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;
private:
long m_RefCount = 1;
ABI::Windows::ApplicationModel::Store::ILicenseInformation* m_realLicenseInformation;
};
class CurrentAppWrapperX : ICurrentAppX
{
public:

View File

@@ -2,7 +2,7 @@ LIBRARY kernelx
EXPORTS
XMemAlloc = XMemAlloc_X @504
XMemAllocDefault = XMemAllocDefault_X @505
EventRegister = NTDLL.EventRegister @95
EventRegister = Advapi32.EventRegister @95
XMemFree = XMemFree_X @507
XMemFreeDefault = XMemFreeDefault_X @508
XMemSetAllocationHooks = XMemSetAllocationHooks_X @514
@@ -98,15 +98,15 @@ EXPORTS
EnumSystemLocalesA = Kernel32.EnumSystemLocalesA @89
EnumSystemLocalesEx = Kernel32.EnumSystemLocalesEx @90
EnumSystemLocalesW = Kernel32.EnumSystemLocalesW @91
EventActivityIdControl = Kernel32.EventActivityIdControl @92
EventEnabled = Kernel32.EventEnabled @93
EventProviderEnabled = Kernel32.EventProviderEnabled @94
EventSetInformation = Kernel32.EventSetInformation @96
EventUnregister = Kernel32.EventUnregister @97
EventWrite = Kernel32.EventWrite @98
EventWriteEx = Kernel32.EventWriteEx @99
EventWriteString = Kernel32.EventWriteString @100
EventWriteTransfer = Kernel32.EventWriteTransfer @101
EventActivityIdControl = Advapi32.EventActivityIdControl @92
EventEnabled = Advapi32.EventEnabled @93
EventProviderEnabled = Advapi32.EventProviderEnabled @94
EventSetInformation = Advapi32.EventSetInformation @96
EventUnregister = Advapi32.EventUnregister @97
EventWrite = Advapi32.EventWrite @98
EventWriteEx = Advapi32.EventWriteEx @99
EventWriteString = Advapi32.EventWriteString @100
EventWriteTransfer = Advapi32.EventWriteTransfer @101
ExitProcess = Kernel32.ExitProcess @102
ExitThread = Kernel32.ExitThread @103
ExpandEnvironmentStringsW = Kernel32.ExpandEnvironmentStringsW @104
@@ -300,7 +300,7 @@ EXPORTS
LeaveCriticalSection = Kernel32.LeaveCriticalSection @293
LeaveCriticalSectionWhenCallbackReturns = Kernel32.LeaveCriticalSectionWhenCallbackReturns @294
LoadLibraryExA = Kernel32.LoadLibraryExA @295
LoadLibraryExW = Kernel32.LoadLibraryExW @296
LoadLibraryExW = LoadLibraryExW_X @296
LoadLibraryW = Kernel32.LoadLibraryW @297
LoadPackagedLibrary = Kernel32.LoadPackagedLibrary @298
LoadResource = Kernel32.LoadResource @299

View File

@@ -23,6 +23,8 @@ inline HRESULT WINAPI GetActivationFactoryRedirect(PCWSTR str, REFIID riid, void
if (FAILED(hr = WindowsCreateStringReference(str, wcslen(str), &classNameHeader, &className)))
return hr;
//printf("GetActivationFactoryRedirect: %S\n", str);
hr = RoGetActivationFactory_Hook(className, riid, ppFactory);
WindowsDeleteString(className);
return hr;
@@ -181,9 +183,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID reserved)
DetourAttach(&reinterpret_cast<PVOID&>(TrueGetFileAttributesExW), GetFileAttributesExW_Hook);
DetourAttach(&reinterpret_cast<PVOID&>(TrueFindFirstFileW), FindFirstFileW_Hook);
DetourAttach(&reinterpret_cast<PVOID&>(TrueDeleteFileW), DeleteFileW_Hook);
DetourAttach(&reinterpret_cast<PVOID&>(TrueLoadLibraryExW), LoadLibraryExW_Hook);
DetourAttach(&reinterpret_cast<PVOID&>(TrueLoadLibraryW), LoadLibraryW_Hook);
DetourAttach(&reinterpret_cast<PVOID&>(TrueLoadLibraryExA), LoadLibraryExA_Hook);
//DetourAttach(&reinterpret_cast<PVOID&>(TrueLoadLibraryExW), LoadLibraryExW_Hook);
DetourTransactionCommit();
}

View File

@@ -46,12 +46,13 @@ HANDLE(WINAPI* TrueFindFirstFileW)(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFind
BOOL(WINAPI* TrueDeleteFileW)(LPCWSTR lpFileName) = DeleteFileW;
HMODULE(WINAPI* TrueLoadLibraryExW)(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags) = LoadLibraryExW;
HMODULE(WINAPI* TrueLoadLibraryExA)(_In_ LPCSTR lpLibFileName, _Reserved_ HANDLE hFile, _In_ DWORD dwFlags) = LoadLibraryExA;
HRESULT(STDMETHODCALLTYPE* TrueGetLicenseInformation)(
ABI::Windows::ApplicationModel::Store::ILicenseInformation** value
) = nullptr;
HMODULE(WINAPI* TrueLoadLibraryW)(_In_ LPCWSTR lpLibFileName) = LoadLibraryW;
HMODULE WINAPI LoadLibraryExW_Hook(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
HMODULE WINAPI LoadLibraryExW_X(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
{
printf("LoadLibraryExW_X: %S\n", lpLibFileName);
if (wcscmp(lpLibFileName, L"xaudio2_9.dll") == 0 ||
wcscmp(lpLibFileName, L"xaudio2_9d.dll") == 0)
{
@@ -77,12 +78,12 @@ HMODULE WINAPI LoadLibraryExW_Hook(LPCWSTR lpLibFileName, HANDLE hFile, DWORD
!(wcscmp(callerfileName, L"xaudio2_9_x.dll") == 0))
{
LPCWSTR proxyXAudioModule = L"xaudio2_9_x.dll";
return TrueLoadLibraryExW(proxyXAudioModule, hFile, dwFlags);
return LoadLibraryExW(proxyXAudioModule, hFile, dwFlags);
}
}
return TrueLoadLibraryExW(lpLibFileName, hFile, dwFlags);
return LoadLibraryExW(lpLibFileName, hFile, dwFlags);
}
@@ -223,24 +224,24 @@ HRESULT STDMETHODCALLTYPE GetForCurrentThread_Hook(ICoreWindowStatic* pThis, Cor
if (*ppWindow == NULL)
return hr;
if (IsXboxCallee())
*reinterpret_cast<ICoreWindowX**>(ppWindow) = new CoreWindowWrapperX(*ppWindow);
return hr;
}
template <typename T>
inline T get_method(void* table_base, std::uintptr_t index) {
inline T GetVTableMethod(void* table_base, std::uintptr_t index) {
return (T)((*reinterpret_cast<std::uintptr_t**>(table_base))[index]);
}
HRESULT STDMETHODCALLTYPE CurrentAppActivateInstance_Hook(IActivationFactory* thisptr, IInspectable** instance)
{
HRESULT hr = TrueActivateInstance(thisptr, instance);
*instance = reinterpret_cast<IInspectable*>(new CurrentAppWrapperX(reinterpret_cast<Store::ICurrentApp*>(*instance)));
if (FAILED(hr))
return hr;
*instance = reinterpret_cast<Store::ILicenseInformation*>(new LicenseInformationWrapperX(reinterpret_cast<Store::ILicenseInformation*>(*instance)));
return hr;
}
@@ -253,21 +254,21 @@ inline HRESULT WINAPI RoGetActivationFactory_Hook(HSTRING classId, REFIID iid, v
//wprintf(L"%ls\n", rawString);
auto hr = 0;
if (IsClassName(classId, "Windows.ApplicationModel.Store.CurrentApp"))
{
hr = TrueRoGetActivationFactory(classId, iid, factory);
if (FAILED(hr))
return hr;
//TrueActivateInstance = get_method<decltype(TrueActivateInstance)>(*factory, 6);
//DetourTransactionBegin();
//DetourUpdateThread(GetCurrentThread());
//DetourAttach(&TrueActivateInstance, CurrentAppActivateInstance_Hook);
//DetourTransactionCommit();
if (IsClassName(classId, "Windows.ApplicationModel.Store.CurrentApp"))
{
hr = TrueRoGetActivationFactory(classId, iid, factory);
if (FAILED(hr))
return hr;
}
// @unixian: is there a better way to do this? it works, but we never know if the vtable will change (microsoft please don't make breaking ABI changes)
TrueActivateInstance = GetVTableMethod<decltype(TrueActivateInstance)>(*factory, 6);
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourAttach(&TrueActivateInstance, CurrentAppActivateInstance_Hook);
DetourTransactionCommit();
}
if (IsClassName(classId, "Windows.ApplicationModel.Core.CoreApplication"))
{
@@ -333,7 +334,5 @@ inline HRESULT WINAPI RoGetActivationFactory_Hook(HSTRING classId, REFIID iid, v
if (SUCCEEDED(hr))
return fallbackFactory.CopyTo(iid, factory);
return TrueRoGetActivationFactory(classId, iid, factory);
return hr;
}
return TrueRoGetActivationFactory(classId, iid, factory);
}

View File

@@ -8,4 +8,5 @@ MFCreateMediaType = MFCreateMediaType_X @45
MFStartup = MFStartup_X @125
MFShutdown = MFShutdown_X @126
MFCreateNV12ToRGB32ConverterX = MFCreateNV12ToRGB32ConverterX_X @128
MFCreateWaveFormatExFromMFMediaType = MFCreateWaveFormatExFromMFMediaType_X @129
MFCreateWaveFormatExFromMFMediaType = MFCreateWaveFormatExFromMFMediaType_X @129
MFInitMediaTypeFromWaveFormatEx = MFInitMediaTypeFromWaveFormatEx_X @130

View File

@@ -1,5 +1,7 @@
#include "pch.h"
#include <mmreg.h>
HRESULT MFCreateDxvaSampleRendererX_X(void* pDevice, void* pAttribute, void** pObject)
{
return E_NOTIMPL;
@@ -54,4 +56,13 @@ HRESULT __fastcall MFCreateNV12ToRGB32ConverterX_X(void*, void*, void*)
HRESULT(MFCreateWaveFormatExFromMFMediaType_X)(void* pMFType, void** ppWF, UINT32* pcbSize, UINT32 Flags) {
return E_NOTIMPL;
}
HRESULT MFInitMediaTypeFromWaveFormatEx_X(
void* pMFType,
const WAVEFORMATEX* pWaveFormat,
UINT32 cbBufSize
)
{
return E_NOTIMPL;
}

View File

@@ -7,34 +7,36 @@
#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
{
printf("[ConnectedStorage] Container %S requested creation\n", name.c_str());
// printf("[ConnectedStorage] Container %S requested creation\n", name.c_str());
if (!co_await DoesFolderExist(storagePath + L"\\" + name))
if (!co_await DoesFolderExist(m_storagePath + L"\\" + name))
{
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(storagePath);
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(m_storagePath);
co_await folder.CreateFolderAsync(name);
}
printf("[ConnectedStorage] Container %S created\n", name.c_str());
//printf("[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(storagePath + L"\\" + containerName)) {
if (!co_await DoesFolderExist(m_storagePath + L"\\" + containerName)) {
co_await CreateContainer(containerName);
//printf("[ConnectedStorage] Container %S created\n", containerName.c_str( ));
printf("[ConnectedStorage] Container %S created\n", containerName.c_str( ));
}
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(storagePath + L"\\" + containerName);
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(m_storagePath + L"\\" + containerName);
for (auto const& pair : data)
{
auto fileName = pair.Key();
printf("FileName -> %ls | folder -> %ls\n", fileName.c_str(), folder.Path().c_str());
//printf("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>();
@@ -51,28 +53,98 @@ winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::Rea
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) const
winrt::Windows::Foundation::Collections::IIterable<winrt::hstring> blobsToDelete,
winrt::hstring displayName) const
{
if (!co_await DoesFolderExist(storagePath + L"\\" + containerName)) {
if (!co_await DoesFolderExist(m_storagePath + L"\\" + containerName)) {
co_await CreateContainer(containerName);
//printf("[ConnectedStorage] Container %S created\n", containerName.c_str( ));
printf("[ConnectedStorage] Container %S created\n", containerName.c_str( ));
}
auto folder = co_await winrt::Windows::Storage::StorageFolder::GetFolderFromPathAsync(storagePath + L"\\" + containerName);
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 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);
}
//for (auto const& blobName : blobsToDelete)
//{
// auto file = co_await folder.GetFileAsync(blobName);
// co_await file.DeleteAsync();
//}
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::hstring WinDurango::impl::ConnectedStorage::ObtainPackageName()
@@ -101,12 +173,13 @@ winrt::Windows::Foundation::IAsyncOperation<bool> WinDurango::impl::ConnectedSto
try
{
co_await folder.GetFileAsync(path);
co_return true;
}
catch (...)
{
co_return false;
}
co_return true;
}
winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::CreateDirectories(const wchar_t* storageType, winrt::hstring& storagePath)
@@ -136,9 +209,9 @@ winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::Cre
storagePath = folderPath;
}
winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::InitializeStorage()
winrt::Windows::Foundation::IAsyncAction WinDurango::impl::ConnectedStorage::InitializeStorage(const wchar_t* name)
{
co_await CreateDirectories(L"UserStorage", storagePath);
co_await CreateDirectories(name, m_storagePath);
printf("[ConnectedStorage] User storage initialized at %S\n", storagePath.c_str());
printf("[ConnectedStorage] User storage initialized at %S\n", m_storagePath.c_str());
}

View File

@@ -2,28 +2,35 @@
#include <winrt/base.h>
#include <winrt/Windows.Storage.h>
// forward declare
namespace winrt::Windows::Xbox::Storage
{
struct ContainerInfo2;
struct BlobInfo;
}
namespace WinDurango::impl
{
class ConnectedStorage
{
public:
winrt::Windows::Foundation::IAsyncAction InitializeStorage( );
winrt::Windows::Foundation::IAsyncAction InitializeStorage( const wchar_t* name );
winrt::Windows::Foundation::IAsyncAction CreateContainer(winrt::hstring name) const;
winrt::Windows::Foundation::IAsyncAction Read(winrt::hstring containerName, winrt::Windows::Foundation::Collections::IMapView<winrt::hstring, winrt::Windows::Storage::Streams::IBuffer> data) const;
winrt::Windows::Foundation::IAsyncAction 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) const;
winrt::Windows::Foundation::IAsyncAction 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;
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::Storage::BlobInfo>> GetBlobInfoAsync(winrt::hstring parentContainerName, winrt::hstring blobNamePrefix);
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::Storage::ContainerInfo2>> GetContainerInfo2Async( );
static winrt::Windows::Foundation::IAsyncAction CreateDirectories(const wchar_t* storageType, winrt::hstring &storagePath);
static winrt::Windows::Foundation::IAsyncOperation<bool> DoesFolderExist(winrt::hstring path);
static winrt::Windows::Foundation::IAsyncOperation<bool> DoesFileExist(winrt::Windows::Storage::StorageFolder folder, winrt::hstring path);
private:
static winrt::hstring ObtainPackageName( );
winrt::hstring storagePath;
winrt::hstring m_storagePath;
};
inline ConnectedStorage* s_userStorage;
inline HANDLE h_ContainerWriteEvent;
inline winrt::hstring h_DesiredContainerName;
}
inline ConnectedStorage* s_machineStorage;
}

View File

@@ -137,7 +137,7 @@ namespace winrt::Microsoft::Xbox::GameChat::implementation
}
winrt::Windows::Foundation::Collections::IVectorView<winrt::Microsoft::Xbox::GameChat::ChatUser> ChatManager::GetChatUsers()
{
throw hresult_not_implemented();
return winrt::single_threaded_vector<winrt::Microsoft::Xbox::GameChat::ChatUser>( ).GetView();
}
void ChatManager::MuteUserFromAllChannels(winrt::Microsoft::Xbox::GameChat::ChatUser const& user)
{

View File

@@ -23,12 +23,12 @@
namespace winrt::Windows::Xbox::Input::implementation
{
winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::Input::IController> Controller::Controllers()
winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::Input::IController> Controller::Controllers( )
{
IController dummyController = winrt::make<Controller>();
auto vector = winrt::single_threaded_vector<IController>();
IController dummyController = winrt::make<Controller>( );
auto vector = winrt::single_threaded_vector<IController>( );
vector.Append(dummyController);
return vector.GetView();
return vector.GetView( );
}
winrt::event_token Controller::ControllerAdded(winrt::Windows::Foundation::EventHandler<winrt::Windows::Xbox::Input::ControllerAddedEventArgs> const& handler)
{
@@ -37,7 +37,7 @@ namespace winrt::Windows::Xbox::Input::implementation
void Controller::ControllerAdded(winrt::event_token const& token) noexcept
{
printf("[ControllerAdded] STUBBED\n");
throw hresult_not_implemented();
throw hresult_not_implemented( );
}
winrt::event_token Controller::ControllerRemoved(winrt::Windows::Foundation::EventHandler<winrt::Windows::Xbox::Input::ControllerRemovedEventArgs> const& handler)
{
@@ -46,7 +46,7 @@ namespace winrt::Windows::Xbox::Input::implementation
void Controller::ControllerRemoved(winrt::event_token const& token) noexcept
{
printf("[ControllerRemoved] STUBBED\n");
throw hresult_not_implemented();
throw hresult_not_implemented( );
}
winrt::event_token Controller::ControllerPairingChanged(winrt::Windows::Foundation::EventHandler<winrt::Windows::Xbox::Input::ControllerPairingChangedEventArgs> const& handler)
{
@@ -55,69 +55,69 @@ namespace winrt::Windows::Xbox::Input::implementation
void Controller::ControllerPairingChanged(winrt::event_token const& token) noexcept
{
printf("[ControllerPairingChanged] STUBBED\n");
throw hresult_not_implemented();
throw hresult_not_implemented( );
}
winrt::event_token Controller::ControllerOrderChanged(winrt::Windows::Foundation::EventHandler<winrt::Windows::Xbox::Input::ControllerOrderChangedEventArgs> const& handler)
{
printf("[ControllerOrderChanged] STUBBED\n");
throw hresult_not_implemented();
throw hresult_not_implemented( );
}
void Controller::ControllerOrderChanged(winrt::event_token const& token) noexcept
{
printf("[ControllerOrderChanged] STUBBED\n");
throw hresult_not_implemented();
throw hresult_not_implemented( );
}
winrt::Windows::Xbox::Input::IController Controller::GetControllerById(uint64_t controllerId)
{
printf("[GetControllerById] STUBBED\n");
throw hresult_not_implemented();
throw hresult_not_implemented( );
}
void Controller::GetControllerMetadata(uint64_t controllerId, winrt::Windows::Xbox::Input::MetadataVersion const& metadataVersion, com_array<uint8_t>& ppMetadata)
{
printf("[GetControllerMetadata] STUBBED\n");
throw hresult_not_implemented();
throw hresult_not_implemented( );
}
winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::Input::IController> Controller::GetControllersOrderedLeftToRight(winrt::Windows::Xbox::Input::ControllerOrderFilter const& orderFilter)
{
printf("[GetControllersOrderedLeftToRight] STUBBED\n");
throw hresult_not_implemented();
throw hresult_not_implemented( );
}
uint64_t Controller::Id()
uint64_t Controller::Id( )
{
return 1;
}
hstring Controller::Type()
hstring Controller::Type( )
{
return L"Windows.Xbox.Input.Controller";
}
winrt::Windows::Xbox::System::User Controller::User()
winrt::Windows::Xbox::System::User Controller::User( )
{
printf("[User] STUBBED\n");
throw hresult_not_implemented();
throw hresult_not_implemented( );
}
winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::System::IAudioDeviceInfo> Controller::AudioDevices()
winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::System::IAudioDeviceInfo> Controller::AudioDevices( )
{
printf("[AudioDevices] STUBBED\n");
throw hresult_not_implemented();
throw hresult_not_implemented( );
}
winrt::Windows::Xbox::Input::GameControllerVersionInfo Controller::FirmwareVersionInfo()
winrt::Windows::Xbox::Input::GameControllerVersionInfo Controller::FirmwareVersionInfo( )
{
printf("[FirmwareVersionInfo] STUBBED\n");
throw hresult_not_implemented();
throw hresult_not_implemented( );
}
winrt::Windows::Xbox::Input::GameControllerVersionInfo Controller::HardwareVersionInfo()
winrt::Windows::Xbox::Input::GameControllerVersionInfo Controller::HardwareVersionInfo( )
{
printf("[HardwareVersionInfo] STUBBED\n");
throw hresult_not_implemented();
throw hresult_not_implemented( );
}
uint16_t Controller::HardwareProductId()
uint16_t Controller::HardwareProductId( )
{
printf("[HardwareProductId] STUBBED\n");
throw hresult_not_implemented();
throw hresult_not_implemented( );
}
uint16_t Controller::HardwareVendorId()
uint16_t Controller::HardwareVendorId( )
{
printf("[HardwareVendorId] STUBBED\n");
throw hresult_not_implemented();
throw hresult_not_implemented( );
}
}
}

View File

@@ -25,66 +25,80 @@ namespace winrt::Windows::Xbox::Management::Deployment::implementation
{
winrt::Windows::Xbox::Management::Deployment::PackageTransferWatcher PackageTransferWatcher::Create(winrt::Windows::ApplicationModel::Package const& package, winrt::Windows::Foundation::Collections::IIterable<uint32_t> const& chunkIds)
{
throw hresult_not_implemented();
printf("PackageTransferWatcher::Create\n");
return winrt::make<winrt::Windows::Xbox::Management::Deployment::implementation::PackageTransferWatcher>();
}
winrt::Windows::Xbox::Management::Deployment::PackageTransferWatcher PackageTransferWatcher::Create(winrt::Windows::ApplicationModel::Package const& package)
{
throw hresult_not_implemented();
printf("PackageTransferWatcher::Create\n");
return winrt::make<winrt::Windows::Xbox::Management::Deployment::implementation::PackageTransferWatcher>();
}
winrt::Windows::Xbox::Management::Deployment::PackageTransferWatcher PackageTransferWatcher::CreateForChunkSpecifiers(winrt::Windows::ApplicationModel::Package const& package, winrt::Windows::Xbox::Management::Deployment::ChunkSpecifiers const& specifiers)
{
printf("PackageTransferWatcher::CreateForChunkSpecifiers\n");
throw hresult_not_implemented();
}
winrt::Windows::Xbox::Management::Deployment::PackageTransferWatcher PackageTransferWatcher::CreateForContentPackage(winrt::Windows::Xbox::Management::Deployment::IContentPackage const& package)
{
printf("PackageTransferWatcher::CreateForContentPackage\n");
throw hresult_not_implemented();
}
winrt::Windows::Xbox::Management::Deployment::PackageTransferWatcher PackageTransferWatcher::CreateForDownloadableContentPackage(winrt::Windows::Xbox::Management::Deployment::IDownloadableContentPackage const& package)
{
printf("PackageTransferWatcher::CreateForDownloadableContentPackage\n");
throw hresult_not_implemented();
}
winrt::Windows::Foundation::Collections::IVectorView<uint32_t> PackageTransferWatcher::ChunkIds()
{
printf("PackageTransferWatcher::ChunkIds\n");
throw hresult_not_implemented();
}
winrt::event_token PackageTransferWatcher::ChunkCompleted(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Xbox::Management::Deployment::PackageTransferWatcher, winrt::Windows::Xbox::Management::Deployment::ChunkCompletedEventArgs> const& handler)
{
printf("PackageTransferWatcher::ChunkCompleted\n");
throw hresult_not_implemented();
}
void PackageTransferWatcher::ChunkCompleted(winrt::event_token const& cookie) noexcept
{
printf("PackageTransferWatcher::ChunkCompleted\n");
throw hresult_not_implemented();
}
winrt::event_token PackageTransferWatcher::ProgressChanged(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Xbox::Management::Deployment::PackageTransferWatcher, winrt::Windows::Xbox::Management::Deployment::ProgressChangedEventArgs> const& handler)
{
throw hresult_not_implemented();
return {};
}
void PackageTransferWatcher::ProgressChanged(winrt::event_token const& cookie) noexcept
{
throw hresult_not_implemented();
printf("PackageTransferWatcher::ProgressChanged\n");
}
winrt::event_token PackageTransferWatcher::TransferCompleted(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Xbox::Management::Deployment::PackageTransferWatcher, winrt::Windows::Xbox::Management::Deployment::TransferCompletedEventArgs> const& handler)
{
printf("PackageTransferWatcher::TransferCompleted\n");
throw hresult_not_implemented();
}
void PackageTransferWatcher::TransferCompleted(winrt::event_token const& cookie) noexcept
{
printf("PackageTransferWatcher::TransferCompleted\n");
throw hresult_not_implemented();
}
winrt::Windows::Xbox::Management::Deployment::PackageTransferStatus PackageTransferWatcher::TransferStatus()
{
printf("PackageTransferWatcher::TransferStatus\n");
throw hresult_not_implemented();
}
winrt::Windows::Xbox::Management::Deployment::PackageTransferType PackageTransferWatcher::TransferType()
{
printf("PackageTransferWatcher::TransferType\n");
throw hresult_not_implemented();
}
winrt::event_token PackageTransferWatcher::TransferStatusChanged(winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Xbox::Management::Deployment::PackageTransferWatcher, winrt::Windows::Xbox::Management::Deployment::TransferStatusChangedEventArgs> const& handler)
{
printf("PackageTransferWatcher::TransferStatusChanged\n");
throw hresult_not_implemented();
}
void PackageTransferWatcher::TransferStatusChanged(winrt::event_token const& cookie) noexcept
{
printf("PackageTransferWatcher::TransferStatusChanged\n");
throw hresult_not_implemented();
}
}

View File

@@ -26,17 +26,22 @@ namespace winrt::Windows::Xbox::Services::implementation
{
hstring XboxLiveConfiguration::TitleId()
{
printf("[TitleId] STUBBED\n");
printf("TODO: XboxLiveConfiguration::TitleId\n");
return L"0";
}
hstring XboxLiveConfiguration::PrimaryServiceConfigId()
{
printf("TODO: XboxLiveConfiguration::PrimaryServiceConfigId\n");
return L"000013";
}
hstring XboxLiveConfiguration::PrimaryServiceConfigId()
{
printf("[PrimaryServiceConfigId] STUBBED\n");
printf("TODO: XboxLiveConfiguration::PrimaryServiceConfigId\n");
return L"0";
}
hstring XboxLiveConfiguration::SandboxId()
{
printf("[SandboxId] STUBBED\n");
throw hresult_not_implemented();
printf("TODO: XboxLiveConfiguration::SandboxId\n");
return L"0";
}
}

View File

@@ -35,29 +35,7 @@ namespace winrt::Windows::Xbox::Storage::implementation
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::Storage::BlobInfo>> BlobInfoQueryResult::GetBlobInfoAsync()
{
winrt::Windows::Foundation::Collections::IVector<winrt::Windows::Xbox::Storage::BlobInfo> blobInfoVector = winrt::single_threaded_vector<winrt::Windows::Xbox::Storage::BlobInfo>( );
hstring s_prefix = prefix;
hstring storagePath = winrt::Windows::Storage::ApplicationData::Current( ).LocalFolder( ).Path( ) + L"\\WinDurango\\UserStorage\\" + parentName;
if (!co_await WinDurango::impl::ConnectedStorage::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) {
// @Bagieta: if you know better way of checking this feel free to change this
std::wstring_view str_view{ file.Name( ) };
if (!str_view._Starts_with(s_prefix))
continue;
auto folderProperties = co_await file.GetBasicPropertiesAsync( );
uint32_t size = folderProperties.Size( );
blobInfoVector.Append({ file.Name( ), size});
}
co_return blobInfoVector.GetView( );
co_return co_await m_connectedStorage->GetBlobInfoAsync(parentName, prefix);
}
winrt::Windows::Foundation::IAsyncOperation<uint32_t> BlobInfoQueryResult::GetItemCountAsync()
{

View File

@@ -27,9 +27,10 @@ namespace winrt::Windows::Xbox::Storage::implementation
struct BlobInfoQueryResult : BlobInfoQueryResultT<BlobInfoQueryResult>
{
BlobInfoQueryResult() = default;
BlobInfoQueryResult(hstring parent, hstring prefix){
BlobInfoQueryResult(hstring parent, hstring prefix, WinDurango::impl::ConnectedStorage* connectedStorage){
this->parentName = parent;
this->prefix = prefix;
m_connectedStorage = connectedStorage;
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::Storage::BlobInfo>> GetBlobInfoAsync(uint32_t startIndex, uint32_t maxNumberOfItems);
@@ -39,5 +40,6 @@ namespace winrt::Windows::Xbox::Storage::implementation
private:
hstring parentName;
hstring prefix;
WinDurango::impl::ConnectedStorage* m_connectedStorage = nullptr;
};
}

View File

@@ -35,11 +35,11 @@ namespace winrt::Windows::Xbox::Storage::implementation
}
winrt::Windows::Foundation::IAsyncAction ConnectedStorageContainer::SubmitUpdatesAsync(winrt::Windows::Foundation::Collections::IMapView<hstring, winrt::Windows::Storage::Streams::IBuffer> blobsToWrite, winrt::Windows::Foundation::Collections::IIterable<hstring> blobsToDelete)
{
co_await WinDurango::impl::s_userStorage->Upload(Name( ), blobsToWrite, blobsToDelete);
co_await m_connectedStorage->Upload(Name( ), blobsToWrite, blobsToDelete);
}
winrt::Windows::Foundation::IAsyncAction ConnectedStorageContainer::ReadAsync(winrt::Windows::Foundation::Collections::IMapView<hstring, winrt::Windows::Storage::Streams::IBuffer> blobsToRead)
{
co_await WinDurango::impl::s_userStorage->Read(Name( ), blobsToRead);
co_await m_connectedStorage->Read(Name( ), blobsToRead);
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IMapView<hstring, winrt::Windows::Storage::Streams::IBuffer>> ConnectedStorageContainer::GetAsync(winrt::Windows::Foundation::Collections::IIterable<hstring> blobsToRead)
{
@@ -51,7 +51,7 @@ namespace winrt::Windows::Xbox::Storage::implementation
}
winrt::Windows::Foundation::IAsyncAction ConnectedStorageContainer::SubmitUpdatesAsync(winrt::Windows::Foundation::Collections::IMapView<hstring, winrt::Windows::Storage::Streams::IBuffer> blobsToWrite, winrt::Windows::Foundation::Collections::IIterable<hstring> blobsToDelete, hstring displayName)
{
co_await WinDurango::impl::s_userStorage->Upload(Name( ), blobsToWrite, blobsToDelete);
co_await m_connectedStorage->Upload(Name(), blobsToWrite, blobsToDelete, displayName);
}
winrt::Windows::Foundation::IAsyncAction ConnectedStorageContainer::SubmitPropertySetUpdatesAsync(winrt::Windows::Foundation::Collections::IPropertySet blobsToWrite, winrt::Windows::Foundation::Collections::IIterable<hstring> blobsToDelete, hstring displayName)
{
@@ -59,6 +59,6 @@ namespace winrt::Windows::Xbox::Storage::implementation
}
winrt::Windows::Xbox::Storage::BlobInfoQueryResult ConnectedStorageContainer::CreateBlobInfoQuery(hstring const& blobNamePrefix)
{
return winrt::make<winrt::Windows::Xbox::Storage::implementation::BlobInfoQueryResult>(Name(), blobNamePrefix);
return winrt::make<winrt::Windows::Xbox::Storage::implementation::BlobInfoQueryResult>(Name(), blobNamePrefix, m_connectedStorage);
}
}

View File

@@ -20,14 +20,20 @@
// This assertion helps prevent accidental modification of generated files.
//static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
namespace WinDurango::impl
{
class ConnectedStorage;
}
namespace winrt::Windows::Xbox::Storage::implementation
{
struct ConnectedStorageContainer : ConnectedStorageContainerT<ConnectedStorageContainer>
{
ConnectedStorageContainer() = default;
ConnectedStorageContainer(hstring name)
ConnectedStorageContainer(hstring name, WinDurango::impl::ConnectedStorage* connectedStorage)
{
containerName = name;
m_connectedStorage = connectedStorage;
}
hstring Name();
@@ -42,5 +48,6 @@ namespace winrt::Windows::Xbox::Storage::implementation
public:
hstring containerName;
WinDurango::impl::ConnectedStorage* m_connectedStorage = nullptr;
};
}

View File

@@ -5,9 +5,7 @@
#include "Windows.Xbox.Storage.ConnectedStorageSpace.g.cpp"
#include "Windows.Xbox.System.Console.h"
#include "Windows.Xbox.System.User.h"
#include "../ConnectedStorage/ConnectedStorage.h"
#include "Windows.Xbox.Storage.ContainerInfoQueryResult.h"
#include <synchapi.h>
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
@@ -33,7 +31,7 @@ namespace winrt::Windows::Xbox::Storage::implementation
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::Storage::ConnectedStorageSpace> ConnectedStorageSpace::GetForUserAsync(winrt::Windows::Xbox::System::User user)
{
if (userStorageSpace == Storage::ConnectedStorageSpace(nullptr)) {
auto storageClass = winrt::make<implementation::ConnectedStorageSpace>( );
auto storageClass = winrt::make<implementation::ConnectedStorageSpace>( WinDurango::impl::s_userStorage );
}
co_return userStorageSpace;
@@ -41,31 +39,31 @@ namespace winrt::Windows::Xbox::Storage::implementation
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::Storage::ConnectedStorageSpace> ConnectedStorageSpace::GetForUserAsync(winrt::Windows::Xbox::System::User user, hstring serviceConfigurationId)
{
if (userStorageSpace == Storage::ConnectedStorageSpace(nullptr)) {
userStorageSpace = winrt::make<implementation::ConnectedStorageSpace>( );
userStorageSpace = winrt::make<implementation::ConnectedStorageSpace>( WinDurango::impl::s_userStorage );
}
co_return userStorageSpace;
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::Storage::ConnectedStorageSpace> ConnectedStorageSpace::GetForMachineAsync()
{
if (userStorageSpace == Storage::ConnectedStorageSpace(nullptr)) {
userStorageSpace = winrt::make<implementation::ConnectedStorageSpace>( );
if (machineStorageSpace == Storage::ConnectedStorageSpace(nullptr)) {
machineStorageSpace = winrt::make<implementation::ConnectedStorageSpace>( WinDurango::impl::s_machineStorage );
}
co_return userStorageSpace;
co_return machineStorageSpace;
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::Storage::ConnectedStorageSpace> ConnectedStorageSpace::GetForMachineAsync(hstring serviceConfigurationId)
{
if (userStorageSpace == Storage::ConnectedStorageSpace(nullptr)) {
userStorageSpace = winrt::make<implementation::ConnectedStorageSpace>( );
if (machineStorageSpace == Storage::ConnectedStorageSpace(nullptr)) {
machineStorageSpace = winrt::make<implementation::ConnectedStorageSpace>(WinDurango::impl::s_machineStorage);
}
co_return userStorageSpace;
co_return machineStorageSpace;
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::Storage::ConnectedStorageSpace> ConnectedStorageSpace::GetSyncOnDemandForUserAsync(winrt::Windows::Xbox::System::User user)
{
if (userStorageSpace == Storage::ConnectedStorageSpace(nullptr)) {
userStorageSpace = winrt::make<implementation::ConnectedStorageSpace>( );
auto storageClass = winrt::make<implementation::ConnectedStorageSpace>(WinDurango::impl::s_userStorage);
}
co_return userStorageSpace;
@@ -73,7 +71,7 @@ namespace winrt::Windows::Xbox::Storage::implementation
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::Storage::ConnectedStorageSpace> ConnectedStorageSpace::GetSyncOnDemandForUserAsync(winrt::Windows::Xbox::System::User user, hstring serviceConfigurationId)
{
if (userStorageSpace == Storage::ConnectedStorageSpace(nullptr)) {
userStorageSpace = winrt::make<implementation::ConnectedStorageSpace>( );
auto storageClass = winrt::make<implementation::ConnectedStorageSpace>(WinDurango::impl::s_userStorage);
}
co_return userStorageSpace;
@@ -92,23 +90,20 @@ namespace winrt::Windows::Xbox::Storage::implementation
}
winrt::Windows::Xbox::Storage::ConnectedStorageContainer ConnectedStorageSpace::CreateContainer(hstring const& containerName)
{
if (WinDurango::impl::s_userStorage == nullptr)
if (WinDurango::impl::s_userStorage == nullptr || WinDurango::impl::s_machineStorage == nullptr)
assert("s_userStorage is null");
if (containers == nullptr)
containers = winrt::single_threaded_map<hstring, winrt::Windows::Xbox::Storage::ConnectedStorageContainer>( );
if (!containers.HasKey(containerName)) {
winrt::Windows::Xbox::Storage::ConnectedStorageContainer container = winrt::make<ConnectedStorageContainer>(containerName);
winrt::Windows::Xbox::Storage::ConnectedStorageContainer container = winrt::make<ConnectedStorageContainer>(containerName, m_connectedStorage);
containers.Insert(containerName, container);
SetEvent(WinDurango::impl::h_ContainerWriteEvent);
return container;
}
else {
return containers.Lookup(containerName);
}
return containers.Lookup(containerName);
}
winrt::Windows::Foundation::IAsyncAction ConnectedStorageSpace::DeleteContainerAsync(hstring containerName)
@@ -118,7 +113,7 @@ namespace winrt::Windows::Xbox::Storage::implementation
winrt::Windows::Xbox::Storage::ContainerInfoQueryResult ConnectedStorageSpace::CreateContainerInfoQuery(hstring const& containerNamePrefix)
{
return winrt::make<winrt::Windows::Xbox::Storage::implementation::ContainerInfoQueryResult>(containerNamePrefix);
return winrt::make<winrt::Windows::Xbox::Storage::implementation::ContainerInfoQueryResult>(containerNamePrefix, m_connectedStorage);
}
winrt::Windows::Foundation::IAsyncOperation<int32_t> ConnectedStorageSpace::GetRemainingBytesInQuotaAsync()
{

View File

@@ -3,6 +3,8 @@
#include <winrt/Windows.Foundation.Collections.h>
#include "../ConnectedStorage/ConnectedStorage.h"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
@@ -27,6 +29,10 @@ namespace winrt::Windows::Xbox::Storage::implementation
struct ConnectedStorageSpace : ConnectedStorageSpaceT<ConnectedStorageSpace>
{
ConnectedStorageSpace() = default;
ConnectedStorageSpace(WinDurango::impl::ConnectedStorage* connectedStorage)
{
m_connectedStorage = connectedStorage;
}
static winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::Storage::ConnectedStorageSpace> GetForUserAsync(winrt::Windows::Xbox::System::User user);
static winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::Storage::ConnectedStorageSpace> GetForUserAsync(winrt::Windows::Xbox::System::User user, hstring serviceConfigurationId);
@@ -43,10 +49,12 @@ namespace winrt::Windows::Xbox::Storage::implementation
winrt::Windows::Foundation::IAsyncOperation<int32_t> GetRemainingBytesInQuotaAsync( );
winrt::Windows::Foundation::IAsyncOperation<int64_t> GetRemainingBytesInQuota64Async( );
inline static winrt::Windows::Xbox::Storage::ConnectedStorageSpace userStorageSpace = { nullptr };
inline static winrt::Windows::Xbox::Storage::ConnectedStorageSpace machineStorageSpace = { nullptr };
inline static winrt::Windows::Xbox::Storage::ConnectedStorageContainer staticContainer = { nullptr };
private:
inline static winrt::Windows::Foundation::Collections::IMap<hstring, winrt::Windows::Xbox::Storage::ConnectedStorageContainer> containers;
WinDurango::impl::ConnectedStorage* m_connectedStorage = nullptr;
};
}
namespace winrt::Windows::Xbox::Storage::factory_implementation

View File

@@ -6,6 +6,7 @@
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Storage.FileProperties.h>
#include <winrt/Windows.Foundation.Collections.h>
#include "../ConnectedStorage/ConnectedStorage.h"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
@@ -46,20 +47,6 @@ namespace winrt::Windows::Xbox::Storage::implementation
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::Storage::ContainerInfo2>> ContainerInfoQueryResult::GetContainerInfo2Async()
{
winrt::Windows::Foundation::Collections::IVector<winrt::Windows::Xbox::Storage::ContainerInfo2> containerInfoVector = winrt::single_threaded_vector<winrt::Windows::Xbox::Storage::ContainerInfo2>( );
hstring storagePath = winrt::Windows::Storage::ApplicationData::Current( ).LocalFolder( ).Path( ) + L"\\WinDurango\\UserStorage";
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( );
containerInfoVector.Append({ folder.Name(), size, folder.DisplayName(), date, false});
}
co_return containerInfoVector.GetView( );
co_return co_await m_connectedStorage->GetContainerInfo2Async();
}
}

View File

@@ -20,13 +20,19 @@
// This assertion helps prevent accidental modification of generated files.
//////////static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
namespace WinDurango::impl
{
class ConnectedStorage;
}
namespace winrt::Windows::Xbox::Storage::implementation
{
struct ContainerInfoQueryResult : ContainerInfoQueryResultT<ContainerInfoQueryResult>
{
ContainerInfoQueryResult() = default;
ContainerInfoQueryResult(hstring containerNamePrefix) {
ContainerInfoQueryResult(hstring containerNamePrefix, WinDurango::impl::ConnectedStorage* connectedStorage) {
this->containerNamePrefix = containerNamePrefix;
m_connectedStorage = connectedStorage;
}
@@ -37,5 +43,6 @@ namespace winrt::Windows::Xbox::Storage::implementation
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::Storage::ContainerInfo2>> GetContainerInfo2Async();
private:
hstring containerNamePrefix;
WinDurango::impl::ConnectedStorage* m_connectedStorage = nullptr;
};
}

View File

@@ -0,0 +1,34 @@
#include "pch.h"
#include "Windows.Xbox.UI.Accessibility.h"
#include "Windows.Xbox.UI.Accessibility.g.cpp"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
//static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
namespace winrt::Windows::Xbox::UI::implementation
{
void Accessibility::SetSpeechToTextPositionHint(winrt::Windows::Xbox::UI::SpeechToTextPositionHint const& position)
{
throw hresult_not_implemented();
}
void Accessibility::SendSpeechToTextString(hstring const& speakerName, hstring const& content, winrt::Windows::Xbox::UI::SpeechToTextType const& type)
{
throw hresult_not_implemented();
}
}

View File

@@ -0,0 +1,38 @@
#pragma once
#include "Windows.Xbox.UI.Accessibility.g.h"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
//static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
namespace winrt::Windows::Xbox::UI::implementation
{
struct Accessibility
{
Accessibility() = default;
static void SetSpeechToTextPositionHint(winrt::Windows::Xbox::UI::SpeechToTextPositionHint const& position);
static void SendSpeechToTextString(hstring const& speakerName, hstring const& content, winrt::Windows::Xbox::UI::SpeechToTextType const& type);
};
}
namespace winrt::Windows::Xbox::UI::factory_implementation
{
struct Accessibility : AccessibilityT<Accessibility, implementation::Accessibility>
{
};
}

View File

@@ -0,0 +1,30 @@
#include "pch.h"
#include "Windows.Xbox.UI.AccountPickerResult.h"
#include "Windows.Xbox.UI.AccountPickerResult.g.cpp"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
//static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
namespace winrt::Windows::Xbox::UI::implementation
{
winrt::Windows::Xbox::System::IUser AccountPickerResult::User()
{
return System::User::Users( ).GetAt(0);
}
}

View File

@@ -0,0 +1,31 @@
#pragma once
#include "Windows.Xbox.UI.AccountPickerResult.g.h"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
//static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
namespace winrt::Windows::Xbox::UI::implementation
{
struct AccountPickerResult : AccountPickerResultT<AccountPickerResult>
{
AccountPickerResult() = default;
winrt::Windows::Xbox::System::IUser User();
};
}

View File

@@ -0,0 +1,30 @@
#include "pch.h"
#include "Windows.Xbox.UI.AddRemoveFriendResult.h"
#include "Windows.Xbox.UI.AddRemoveFriendResult.g.cpp"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
//static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
namespace winrt::Windows::Xbox::UI::implementation
{
winrt::Windows::Xbox::UI::AddRemoveFriendResultStatus AddRemoveFriendResult::Status()
{
throw hresult_not_implemented();
}
}

View File

@@ -0,0 +1,31 @@
#pragma once
#include "Windows.Xbox.UI.AddRemoveFriendResult.g.h"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
//static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
namespace winrt::Windows::Xbox::UI::implementation
{
struct AddRemoveFriendResult : AddRemoveFriendResultT<AddRemoveFriendResult>
{
AddRemoveFriendResult() = default;
winrt::Windows::Xbox::UI::AddRemoveFriendResultStatus Status();
};
}

View File

@@ -0,0 +1,82 @@
#include "pch.h"
#include "Windows.Xbox.UI.KeyboardOptions.h"
#include "Windows.Xbox.UI.KeyboardOptions.g.cpp"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
//static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
namespace winrt::Windows::Xbox::UI::implementation
{
hstring KeyboardOptions::DefaultText()
{
throw hresult_not_implemented();
}
void KeyboardOptions::DefaultText(hstring const& value)
{
throw hresult_not_implemented();
}
hstring KeyboardOptions::TitleText()
{
throw hresult_not_implemented();
}
void KeyboardOptions::TitleText(hstring const& value)
{
throw hresult_not_implemented();
}
hstring KeyboardOptions::DescriptionText()
{
throw hresult_not_implemented();
}
void KeyboardOptions::DescriptionText(hstring const& value)
{
throw hresult_not_implemented();
}
uint32_t KeyboardOptions::MaxLength()
{
throw hresult_not_implemented();
}
void KeyboardOptions::MaxLength(uint32_t value)
{
throw hresult_not_implemented();
}
bool KeyboardOptions::LengthIndicatorVisibility()
{
throw hresult_not_implemented();
}
void KeyboardOptions::LengthIndicatorVisibility(bool value)
{
throw hresult_not_implemented();
}
uint32_t KeyboardOptions::LengthIndicatorThreshold()
{
throw hresult_not_implemented();
}
void KeyboardOptions::LengthIndicatorThreshold(uint32_t value)
{
throw hresult_not_implemented();
}
winrt::Windows::Xbox::UI::VirtualKeyboardInputScope KeyboardOptions::InputScope()
{
throw hresult_not_implemented();
}
void KeyboardOptions::InputScope(winrt::Windows::Xbox::UI::VirtualKeyboardInputScope const& value)
{
throw hresult_not_implemented();
}
}

View File

@@ -0,0 +1,50 @@
#pragma once
#include "Windows.Xbox.UI.KeyboardOptions.g.h"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
//static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
namespace winrt::Windows::Xbox::UI::implementation
{
struct KeyboardOptions : KeyboardOptionsT<KeyboardOptions>
{
KeyboardOptions() = default;
hstring DefaultText();
void DefaultText(hstring const& value);
hstring TitleText();
void TitleText(hstring const& value);
hstring DescriptionText();
void DescriptionText(hstring const& value);
uint32_t MaxLength();
void MaxLength(uint32_t value);
bool LengthIndicatorVisibility();
void LengthIndicatorVisibility(bool value);
uint32_t LengthIndicatorThreshold();
void LengthIndicatorThreshold(uint32_t value);
winrt::Windows::Xbox::UI::VirtualKeyboardInputScope InputScope();
void InputScope(winrt::Windows::Xbox::UI::VirtualKeyboardInputScope const& value);
};
}
namespace winrt::Windows::Xbox::UI::factory_implementation
{
struct KeyboardOptions : KeyboardOptionsT<KeyboardOptions, implementation::KeyboardOptions>
{
};
}

View File

@@ -0,0 +1,149 @@
#include "pch.h"
#include "Windows.Xbox.UI.SystemUI.h"
#include <iostream>
#include "Windows.Xbox.UI.AccountPickerResult.h"
#include "Windows.Xbox.UI.SystemUI.g.cpp"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
//static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
void* g_pD3D11XEventFunc = nullptr;
void* g_pWDWaitForKeyboardFunc = nullptr;
namespace winrt::Windows::Xbox::UI::implementation
{
winrt::Windows::Foundation::IAsyncAction SystemUI::ShowEpgAsync(winrt::Windows::Xbox::System::IUser requestingUser, winrt::Windows::Foundation::Collections::IIterable<winrt::Windows::Foundation::Collections::IKeyValuePair<hstring, winrt::Windows::Foundation::IInspectable>> propertySet)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction SystemUI::ShowMiniguideAsync(winrt::Windows::Xbox::System::IUser requestingUser)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction SystemUI::ShowProfileCardAsync(winrt::Windows::Xbox::System::IUser requestingUser, hstring targetXuid)
{
co_return;
}
winrt::Windows::Foundation::IAsyncAction SystemUI::ShowSendInvitesAsync(winrt::Windows::Xbox::System::IUser requestingUser)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::UI::AccountPickerResult> SystemUI::ShowAccountPickerAsync(winrt::Windows::Xbox::Input::IController controller, winrt::Windows::Xbox::UI::AccountPickerOptions options)
{
printf("TODO: SystemUI::ShowAccountPickerAsync (this function just returns the first user in User::Users)\n");
co_return winrt::make<implementation::AccountPickerResult>( );
}
winrt::Windows::Foundation::IAsyncOperation<hstring> SystemUI::ShowVirtualKeyboardAsync(hstring defaultText, hstring titleText, hstring descriptionText, winrt::Windows::Xbox::UI::VirtualKeyboardInputScope inputScope)
{
co_await resume_background( );
if (!g_pD3D11XEventFunc && !g_pWDWaitForKeyboardFunc)
{
g_pD3D11XEventFunc = GetProcAddress(GetModuleHandle(L"d3d11_x.dll"), "WD11XNotify");
g_pWDWaitForKeyboardFunc = GetProcAddress(GetModuleHandle(L"d3d11_x.dll"), "WDWaitForKeyboard");
}
reinterpret_cast<void(__stdcall*)(int)>(g_pD3D11XEventFunc)(1);
const char* text = nullptr;
reinterpret_cast<void(__stdcall*)(const char**)>(g_pWDWaitForKeyboardFunc)(&text);
co_return winrt::to_hstring(text);
}
winrt::Windows::Foundation::IAsyncAction SystemUI::LaunchPartyAsync(winrt::Windows::Xbox::System::IUser requestingUser)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction SystemUI::LaunchAchievementsAsync(winrt::Windows::Xbox::System::IUser requestingUser, uint32_t titleId)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction SystemUI::ShowPartyAndSendPartyInvitesAsync(winrt::Windows::Xbox::System::IUser requestingUser, winrt::Windows::Foundation::Collections::IVectorView<hstring> recipientUserIdList)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction SystemUI::ShowCreateLookingForGroupAsync(winrt::Windows::Xbox::System::IUser requestingUser, winrt::Windows::Foundation::Collections::IVectorView<hstring> preselectedTags, hstring preselectedDescription, uint32_t defaultNeedCount)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction SystemUI::ShowUserLookingForGroupsAsync(winrt::Windows::Xbox::System::IUser requestingUser)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction SystemUI::ShowLookingForGroupResultsAsync(winrt::Windows::Xbox::System::IUser requestingUser, winrt::Windows::Foundation::Collections::IVectorView<hstring> tags)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction SystemUI::LaunchKinectSetupAsync(winrt::Windows::Xbox::System::IUser requestingUser)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction SystemUI::LaunchRecentPlayersAsync(winrt::Windows::Xbox::System::IUser requestingUser)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction SystemUI::SnapDefaultBroadcastApp(winrt::Windows::Xbox::System::IUser requestingUser)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction SystemUI::ShowComposeMessageAsync(winrt::Windows::Xbox::System::IUser requestingUser, hstring defaultMessageText, winrt::Windows::Foundation::Collections::IVector<hstring> recipientUserIdList)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::UI::AddRemoveFriendResult> SystemUI::ShowAddRemoveFriendAsync(winrt::Windows::Xbox::System::IUser requestingUser, hstring targetUserId)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<hstring>> SystemUI::ShowPeoplePickerAsync(winrt::Windows::Xbox::System::IUser requestingUser, hstring promptText, winrt::Windows::Foundation::Collections::IVectorView<hstring> selectFromUserIdList, winrt::Windows::Foundation::Collections::IVectorView<hstring> preselectedUserIdList, uint32_t minimumSelectionCount, uint32_t maximumSelectionCount)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncOperation<bool> SystemUI::TrySnapSelf()
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncOperation<bool> SystemUI::TrySnapOther(winrt::Windows::Foundation::Uri snapTargetUri, winrt::Windows::Xbox::System::IUser user)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncAction SystemUI::ShowMiniguideWithCommandAsync(winrt::Windows::Xbox::System::IUser requestingUser, winrt::Windows::Xbox::UI::MiniguideCommand initialCommand)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncOperation<hstring> SystemUI::ShowVirtualKeyboardWithOptionsAsync(winrt::Windows::Xbox::UI::KeyboardOptions options)
{
throw hresult_not_implemented();
}
void SystemUI::SetNotificationPositionHint(winrt::Windows::Xbox::UI::NotificationPositionHint const& value)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::UI::WebAuthenticationResult> SystemUI::AuthenticateAsync(winrt::Windows::Xbox::System::IUser requestingUser, winrt::Windows::Xbox::UI::WebAuthenticationOptions options, winrt::Windows::Foundation::Uri requestUri, winrt::Windows::Foundation::Uri callbackUri)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::UI::WebAuthenticationResult> SystemUI::AuthenticateAsync(winrt::Windows::Xbox::System::IUser requestingUser, winrt::Windows::Xbox::UI::WebAuthenticationOptions options, winrt::Windows::Foundation::Uri requestUri)
{
throw hresult_not_implemented();
}
winrt::Windows::Foundation::Uri SystemUI::GetCurrentApplicationCallbackUri(winrt::Windows::Xbox::System::IUser const& requestingUser)
{
throw hresult_not_implemented();
}
}

View File

@@ -0,0 +1,62 @@
#pragma once
#include "Windows.Xbox.UI.SystemUI.g.h"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
//static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
namespace winrt::Windows::Xbox::UI::implementation
{
struct SystemUI
{
SystemUI() = default;
static winrt::Windows::Foundation::IAsyncAction ShowEpgAsync(winrt::Windows::Xbox::System::IUser requestingUser, winrt::Windows::Foundation::Collections::IIterable<winrt::Windows::Foundation::Collections::IKeyValuePair<hstring, winrt::Windows::Foundation::IInspectable>> propertySet);
static winrt::Windows::Foundation::IAsyncAction ShowMiniguideAsync(winrt::Windows::Xbox::System::IUser requestingUser);
static winrt::Windows::Foundation::IAsyncAction ShowProfileCardAsync(winrt::Windows::Xbox::System::IUser requestingUser, hstring targetXuid);
static winrt::Windows::Foundation::IAsyncAction ShowSendInvitesAsync(winrt::Windows::Xbox::System::IUser requestingUser);
static winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::UI::AccountPickerResult> ShowAccountPickerAsync(winrt::Windows::Xbox::Input::IController controller, winrt::Windows::Xbox::UI::AccountPickerOptions options);
static winrt::Windows::Foundation::IAsyncOperation<hstring> ShowVirtualKeyboardAsync(hstring defaultText, hstring titleText, hstring descriptionText, winrt::Windows::Xbox::UI::VirtualKeyboardInputScope inputScope);
static winrt::Windows::Foundation::IAsyncAction LaunchPartyAsync(winrt::Windows::Xbox::System::IUser requestingUser);
static winrt::Windows::Foundation::IAsyncAction LaunchAchievementsAsync(winrt::Windows::Xbox::System::IUser requestingUser, uint32_t titleId);
static winrt::Windows::Foundation::IAsyncAction ShowPartyAndSendPartyInvitesAsync(winrt::Windows::Xbox::System::IUser requestingUser, winrt::Windows::Foundation::Collections::IVectorView<hstring> recipientUserIdList);
static winrt::Windows::Foundation::IAsyncAction ShowCreateLookingForGroupAsync(winrt::Windows::Xbox::System::IUser requestingUser, winrt::Windows::Foundation::Collections::IVectorView<hstring> preselectedTags, hstring preselectedDescription, uint32_t defaultNeedCount);
static winrt::Windows::Foundation::IAsyncAction ShowUserLookingForGroupsAsync(winrt::Windows::Xbox::System::IUser requestingUser);
static winrt::Windows::Foundation::IAsyncAction ShowLookingForGroupResultsAsync(winrt::Windows::Xbox::System::IUser requestingUser, winrt::Windows::Foundation::Collections::IVectorView<hstring> tags);
static winrt::Windows::Foundation::IAsyncAction LaunchKinectSetupAsync(winrt::Windows::Xbox::System::IUser requestingUser);
static winrt::Windows::Foundation::IAsyncAction LaunchRecentPlayersAsync(winrt::Windows::Xbox::System::IUser requestingUser);
static winrt::Windows::Foundation::IAsyncAction SnapDefaultBroadcastApp(winrt::Windows::Xbox::System::IUser requestingUser);
static winrt::Windows::Foundation::IAsyncAction ShowComposeMessageAsync(winrt::Windows::Xbox::System::IUser requestingUser, hstring defaultMessageText, winrt::Windows::Foundation::Collections::IVector<hstring> recipientUserIdList);
static winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::UI::AddRemoveFriendResult> ShowAddRemoveFriendAsync(winrt::Windows::Xbox::System::IUser requestingUser, hstring targetUserId);
static winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::Collections::IVectorView<hstring>> ShowPeoplePickerAsync(winrt::Windows::Xbox::System::IUser requestingUser, hstring promptText, winrt::Windows::Foundation::Collections::IVectorView<hstring> selectFromUserIdList, winrt::Windows::Foundation::Collections::IVectorView<hstring> preselectedUserIdList, uint32_t minimumSelectionCount, uint32_t maximumSelectionCount);
static winrt::Windows::Foundation::IAsyncOperation<bool> TrySnapSelf();
static winrt::Windows::Foundation::IAsyncOperation<bool> TrySnapOther(winrt::Windows::Foundation::Uri snapTargetUri, winrt::Windows::Xbox::System::IUser user);
static winrt::Windows::Foundation::IAsyncAction ShowMiniguideWithCommandAsync(winrt::Windows::Xbox::System::IUser requestingUser, winrt::Windows::Xbox::UI::MiniguideCommand initialCommand);
static winrt::Windows::Foundation::IAsyncOperation<hstring> ShowVirtualKeyboardWithOptionsAsync(winrt::Windows::Xbox::UI::KeyboardOptions options);
static void SetNotificationPositionHint(winrt::Windows::Xbox::UI::NotificationPositionHint const& value);
static winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::UI::WebAuthenticationResult> AuthenticateAsync(winrt::Windows::Xbox::System::IUser requestingUser, winrt::Windows::Xbox::UI::WebAuthenticationOptions options, winrt::Windows::Foundation::Uri requestUri, winrt::Windows::Foundation::Uri callbackUri);
static winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Xbox::UI::WebAuthenticationResult> AuthenticateAsync(winrt::Windows::Xbox::System::IUser requestingUser, winrt::Windows::Xbox::UI::WebAuthenticationOptions options, winrt::Windows::Foundation::Uri requestUri);
static winrt::Windows::Foundation::Uri GetCurrentApplicationCallbackUri(winrt::Windows::Xbox::System::IUser const& requestingUser);
};
}
namespace winrt::Windows::Xbox::UI::factory_implementation
{
struct SystemUI : SystemUIT<SystemUI, implementation::SystemUI>
{
};
}

View File

@@ -0,0 +1,38 @@
#include "pch.h"
#include "Windows.Xbox.UI.WebAuthenticationResult.h"
#include "Windows.Xbox.UI.WebAuthenticationResult.g.cpp"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
//static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
namespace winrt::Windows::Xbox::UI::implementation
{
hstring WebAuthenticationResult::ResponseData()
{
throw hresult_not_implemented();
}
winrt::Windows::Xbox::UI::WebAuthenticationStatus WebAuthenticationResult::ResponseStatus()
{
throw hresult_not_implemented();
}
uint32_t WebAuthenticationResult::ResponseErrorDetail()
{
throw hresult_not_implemented();
}
}

View File

@@ -0,0 +1,33 @@
#pragma once
#include "Windows.Xbox.UI.WebAuthenticationResult.g.h"
// WARNING: This file is automatically generated by a tool. Do not directly
// add this file to your project, as any changes you make will be lost.
// This file is a stub you can use as a starting point for your implementation.
//
// To add a copy of this file to your project:
// 1. Copy this file from its original location to the location where you store
// your other source files (e.g. the project root).
// 2. Add the copied file to your project. In Visual Studio, you can use
// Project -> Add Existing Item.
// 3. Delete this comment and the 'static_assert' (below) from the copied file.
// Do not modify the original file.
//
// To update an existing file in your project:
// 1. Copy the relevant changes from this file and merge them into the copy
// you made previously.
//
// This assertion helps prevent accidental modification of generated files.
//static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance.");
namespace winrt::Windows::Xbox::UI::implementation
{
struct WebAuthenticationResult : WebAuthenticationResultT<WebAuthenticationResult>
{
WebAuthenticationResult() = default;
hstring ResponseData();
winrt::Windows::Xbox::UI::WebAuthenticationStatus ResponseStatus();
uint32_t ResponseErrorDetail();
};
}

View File

@@ -9,7 +9,13 @@ DWORD WINAPI ThreadProc(LPVOID lpParam)
if (WinDurango::impl::s_userStorage == nullptr)
{
WinDurango::impl::s_userStorage = new WinDurango::impl::ConnectedStorage();
WinDurango::impl::s_userStorage->InitializeStorage().get();
WinDurango::impl::s_userStorage->InitializeStorage(L"UserStorage").get();
}
if (WinDurango::impl::s_machineStorage == nullptr)
{
WinDurango::impl::s_machineStorage = new WinDurango::impl::ConnectedStorage( );
WinDurango::impl::s_machineStorage->InitializeStorage(L"MachineStorage").get( );
}
return 1;
@@ -21,9 +27,6 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID reserved)
printf("[winrt_x] DllMain invoked");
CreateThread(nullptr, 0, ThreadProc, nullptr, 0, nullptr);
}
else if (dwReason == DLL_PROCESS_DETACH) {
CloseHandle(WinDurango::impl::h_ContainerWriteEvent);
}
return TRUE;
}

View File

@@ -454,6 +454,12 @@
<ClInclude Include="Implementation\Windows.Xbox.System.Launcher.h" />
<ClInclude Include="Implementation\Windows.Xbox.System.User.h" />
<ClInclude Include="Implementation\Windows.Xbox.System.UserDisplayInfo.h" />
<ClInclude Include="Implementation\Windows.Xbox.UI.Accessibility.h" />
<ClInclude Include="Implementation\Windows.Xbox.UI.AccountPickerResult.h" />
<ClInclude Include="Implementation\Windows.Xbox.UI.AddRemoveFriendResult.h" />
<ClInclude Include="Implementation\Windows.Xbox.UI.KeyboardOptions.h" />
<ClInclude Include="Implementation\Windows.Xbox.UI.SystemUI.h" />
<ClInclude Include="Implementation\Windows.Xbox.UI.WebAuthenticationResult.h" />
<ClInclude Include="pch.h" />
</ItemGroup>
<ItemGroup>
@@ -776,6 +782,12 @@
<ClCompile Include="Implementation\Windows.Xbox.System.Launcher.cpp" />
<ClCompile Include="Implementation\Windows.Xbox.System.User.cpp" />
<ClCompile Include="Implementation\Windows.Xbox.System.UserDisplayInfo.cpp" />
<ClCompile Include="Implementation\Windows.Xbox.UI.Accessibility.cpp" />
<ClCompile Include="Implementation\Windows.Xbox.UI.AccountPickerResult.cpp" />
<ClCompile Include="Implementation\Windows.Xbox.UI.AddRemoveFriendResult.cpp" />
<ClCompile Include="Implementation\Windows.Xbox.UI.KeyboardOptions.cpp" />
<ClCompile Include="Implementation\Windows.Xbox.UI.SystemUI.cpp" />
<ClCompile Include="Implementation\Windows.Xbox.UI.WebAuthenticationResult.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
@@ -831,6 +843,7 @@
<Midl Include="External\Windows.Xbox.Storage.idl" />
<Midl Include="External\Windows.Xbox.System.idl" />
<Midl Include="External\Windows.Xbox.Achievements.idl" />
<Midl Include="External\Windows.Xbox.UI.idl" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@@ -440,6 +440,12 @@
<ClCompile Include="Implementation\Windows.Xbox.ApplicationModel.Store.ProductPurchasedEventArgs.cpp" />
<ClCompile Include="ConnectedStorage\ConnectedStorage.cpp" />
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="Implementation\Windows.Xbox.UI.Accessibility.cpp" />
<ClCompile Include="Implementation\Windows.Xbox.UI.AccountPickerResult.cpp" />
<ClCompile Include="Implementation\Windows.Xbox.UI.AddRemoveFriendResult.cpp" />
<ClCompile Include="Implementation\Windows.Xbox.UI.KeyboardOptions.cpp" />
<ClCompile Include="Implementation\Windows.Xbox.UI.SystemUI.cpp" />
<ClCompile Include="Implementation\Windows.Xbox.UI.WebAuthenticationResult.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
@@ -864,6 +870,12 @@
</ClInclude>
<ClInclude Include="Implementation\Windows.Xbox.ApplicationModel.Store.ProductPurchasedEventArgs.h" />
<ClInclude Include="ConnectedStorage\ConnectedStorage.h" />
<ClInclude Include="Implementation\Windows.Xbox.UI.Accessibility.h" />
<ClInclude Include="Implementation\Windows.Xbox.UI.AccountPickerResult.h" />
<ClInclude Include="Implementation\Windows.Xbox.UI.AddRemoveFriendResult.h" />
<ClInclude Include="Implementation\Windows.Xbox.UI.KeyboardOptions.h" />
<ClInclude Include="Implementation\Windows.Xbox.UI.SystemUI.h" />
<ClInclude Include="Implementation\Windows.Xbox.UI.WebAuthenticationResult.h" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
@@ -948,5 +960,6 @@
<Midl Include="External\Microsoft.Xbox.Services.Tournaments.idl" />
<Midl Include="External\Microsoft.Xbox.Services.UserStatistics.idl" />
<Midl Include="External\Windows.Kinect.idl" />
<Midl Include="External\Windows.Xbox.UI.idl" />
</ItemGroup>
</Project>

22
symlink.ps1 Normal file
View File

@@ -0,0 +1,22 @@
$game_path = "C:\\Users\\unixian\\Desktop\\reversing\\xb1\\minecraft_lce_xb1\\Mount"
$out_dll_dir = "C:\\Users\\unixian\\Documents\\GitHub\\WinDurango\\x64\\Debug"
function make-link ($dll_name) {
Copy-Item "$out_dll_dir\\$dll_name" "$game_path\\$dll_name" -Force
}
Add-AppxPackage -Register "$game_path\\AppxManifest.xml"
make-link("winrt_x.dll")
make-link("AcpHal.dll")
make-link("appmodel.dll")
make-link("common.dll")
make-link("d3d11_x.dll")
make-link("etwplus.dll")
make-link("kernelx.dll")
make-link("mfplat.dll")
#make-link("MMDevAPI.dll")
make-link("XboxIntegratedMultiplayer.dll")
make-link("xg_x.dll")
make-link("XFrontPanelDisplay.dll")
make-link("XAudio2_9_x.dll")

1169
thirdparty/imgui_impl_uwp.cpp vendored Normal file

File diff suppressed because it is too large Load Diff

27
thirdparty/imgui_impl_uwp.h vendored Normal file
View File

@@ -0,0 +1,27 @@
// dear imgui: Platform Backend for Universal Windows Platform
// This needs to be used along with a Renderer (e.g. DirectX11, DirectX12, SDL2..)
// Implemented features:
// [X] Platform: Clipboard support (for Win32 & UWP this is actually part of core dear imgui)
// [X] Platform: Mouse support. Can discriminate Mouse/TouchScreen/Pen.
// [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space).
// [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'.
// [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'.
// Configs:
// #define IMGUI_DISABLE_UWP_DEFAULT_CLIPBOARD_FUNCTIONS // Don't implement default WinRT clipboard handler.
// #define IMGUI_IMPL_UWP_DISABLE_GAMEPAD // Don't implement default XInput gamepad handler.
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
// If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp.
// Read online: https://github.com/ocornut/imgui/tree/master/docs
#pragma once
#include "imgui.h" // IMGUI_IMPL_API
IMGUI_IMPL_API bool ImGui_ImplUwp_Init(void* core_window); // ABI::Windows::UI::Core::ICoreWindow*
IMGUI_IMPL_API bool ImGui_ImplUwp_InitForCurrentView();
IMGUI_IMPL_API bool ImGui_ImplUwp_InitForSwapChainPanel(void* swapchain_panel); // ABI::Windows::UI::Xaml::Controls::ISwapChainPanel*
IMGUI_IMPL_API void ImGui_ImplUwp_Shutdown();
IMGUI_IMPL_API void ImGui_ImplUwp_NewFrame();