Added Windows.Xbox.Services.idl and Controller/Gamepad fixes

This commit is contained in:
Rodrigo Todescatto
2026-02-07 17:56:59 -03:00
parent 3a40329a84
commit a08d6dbf66
3 changed files with 23 additions and 6 deletions

View File

@@ -0,0 +1,12 @@
//All GUIDs came from "EmbeddedXvd/Windows/System32/config/SOFTWARE" and "appmodel.dll".
namespace Windows.Xbox.Services
{
[interface_name("IXboxLiveConfiguration", fdeeeb27-66b0-465b-9dfb-99c62a62f7bc)]
[static_name("IXboxLiveConfigurationStatics", af86e2e0-b12d-4c6a-9c5a-d7aa65101e90)]
runtimeclass XboxLiveConfiguration
{
String TitleId { get; };
String PrimaryServiceConfigId { get; };
String SandboxId { get; };
};
};

View File

@@ -1,4 +1,5 @@
#include "Windows.Xbox.Input.Controller.h"
#include "Windows.Xbox.Input.Gamepad.h"
#include "WinDurangoWinRT.h"
namespace winrt::Windows::Xbox::Input::implementation
@@ -30,8 +31,14 @@ namespace winrt::Windows::Xbox::Input::implementation
winrt::Windows::Foundation::Collections::IVectorView<winrt::Windows::Xbox::Input::Controller> Controller::Controllers()
{
p_wd->log.Warn("WinDurango::WinRT::Windows::Xbox::Input", "Unimplemented: Controllers");
throw hresult_not_implemented();
auto vector = winrt::single_threaded_vector<winrt::Windows::Xbox::Input::Controller>();
for (auto const &gamepad : Gamepad::Gamepads())
{
vector.Append(gamepad.as<winrt::Windows::Xbox::Input::Controller>());
}
return vector.GetView();
}
winrt::event_token Controller::ControllerAdded(winrt::Windows::Foundation::EventHandler<winrt::Windows::Xbox::Input::ControllerAddedEventArgs> const& handler)
@@ -99,8 +106,7 @@ namespace winrt::Windows::Xbox::Input::implementation
hstring Controller::Type()
{
p_wd->log.Warn("WinDurango::WinRT::Windows::Xbox::Input", "Unimplemented: Type");
throw hresult_not_implemented();
return L"";
}
winrt::Windows::Xbox::System::User Controller::User()

View File

@@ -174,8 +174,7 @@ namespace winrt::Windows::Xbox::Input::implementation
hstring Gamepad::Type()
{
p_wd->log.Warn("WinDurango::WinRT::Windows::Xbox::Input", "Unimplemented: Type");
throw hresult_not_implemented();
return L"";
}
winrt::Windows::Xbox::System::User Gamepad::User()