Skip to content

Commit

Permalink
GDK 2406 (#602)
Browse files Browse the repository at this point in the history
* GDK 2406

* Added VS2022.sln
  • Loading branch information
NandoCT1014 authored Jun 19, 2024
1 parent b1f4d50 commit 8744d20
Show file tree
Hide file tree
Showing 44 changed files with 4,073 additions and 2,489 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<MSBuildAllProjects Condition="'$(MSBuildVersion)' == '' Or '$(MSBuildVersion)' &lt; '16.0'">$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<ItemsProjectGuid>{1e320494-894e-4feb-90ca-df4fe20499f4}</ItemsProjectGuid>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>XSAPI_NO_PPL=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectCapability Include="SourceItemsFromImports" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Events\events_service_api.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Events\events_service_etw.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Events\events_service_gdk.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Events\events_service.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Events\events_service_etw.h" />
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Events\events_service_gdk.h" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source">
<UniqueIdentifier>{a7468e1e-9c65-4f1a-97db-702dd3013d46}</UniqueIdentifier>
</Filter>
<Filter Include="Source\Shared">
<UniqueIdentifier>{83fa3d12-617a-48df-9de0-edffcc78503e}</UniqueIdentifier>
</Filter>
<Filter Include="Source\Shared\WinRT">
<UniqueIdentifier>{7758f7f5-95ff-453a-a531-200c4dec6794}</UniqueIdentifier>
</Filter>
<Filter Include="Source\Services">
<UniqueIdentifier>{b451b690-ab47-47b5-a948-e9a544907b98}</UniqueIdentifier>
</Filter>
<Filter Include="Source\Services\Events">
<UniqueIdentifier>{4593c653-a41d-403c-90d3-098726781331}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Events\events_service_api.cpp">
<Filter>Source\Services\Events</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Events\events_service_gdk.cpp">
<Filter>Source\Services\Events</Filter>
</ClCompile>
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Events\events_service_etw.cpp">
<Filter>Source\Services\Events</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Events\events_service.h">
<Filter>Source\Services\Events</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Events\events_service_gdk.h">
<Filter>Source\Services\Events</Filter>
</ClInclude>
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Services\Events\events_service_etw.h">
<Filter>Source\Services\Events</Filter>
</ClInclude>
</ItemGroup>
</Project>
15 changes: 15 additions & 0 deletions Build/Microsoft.Xbox.Services.Win32.C.Dll.def
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@ EXPORTS
HCHttpCallSetContext
HCHttpCallSetTracing
HCInitialize
HCIsInitialized
HCMemGetFunctions
HCMemSetFunctions
HCMockAddMock
HCMockCallCloseHandle
HCMockCallCreate
HCMockCallDuplicateHandle
HCMockClearMocks
HCMockRemoveMock
HCMockResponseSetHeader
Expand All @@ -79,27 +82,33 @@ EXPORTS
HCSettingsSetTraceLevel
HCSetWebSocketFunctions
HCTraceImplMessage
HCTraceImplMessage_v
HCTraceImplScopeId
HCTraceSetClientCallback
HCTraceSetEtwEnabled
HCTraceSetPlatformCallbacks
HCTraceSetTraceToDebugger
HCWebSocketCloseHandle
HCWebSocketConnectAsync
HCWebSocketCreate
HCWebSocketDisconnect
HCWebSocketDuplicateHandle
HCWebSocketGetBinaryMessageFragmentEventFunction
HCWebSocketGetEventFunctions
HCWebSocketGetHeader
HCWebSocketGetHeaderAtIndex
HCWebSocketGetNumHeaders
HCWebSocketGetProxyUri
HCWebSocketSendBinaryMessageAsync
HCWebSocketSendMessageAsync
HCWebSocketSetBinaryMessageFragmentEventFunction
HCWebSocketSetHeader
HCWebSocketSetMaxReceiveBufferSize
HCWebSocketSetProxyDecryptsHttps
HCWebSocketSetProxyUri
XalAddUserWithUiAsync
XalAddUserWithUiResult
XalCheckUcsConsentForAllUsers
XalCleanupAsync
XalCleanupResult
XalCompareUsers
Expand All @@ -116,11 +125,14 @@ EXPORTS
XalPlatformCryptoSetCallbacks
XalPlatformDateTimeSetCallbacks
XalPlatformRemoteConnectCancelPrompt
XalPlatformRemoteConnectClearEventHandlers
XalPlatformRemoteConnectSetEventHandlers
XalPlatformStorageClearComplete
XalPlatformStorageClearEventHandlers
XalPlatformStorageReadComplete
XalPlatformStorageSetEventHandlers
XalPlatformStorageWriteComplete
XalPlatformWebClearEventHandler
XalPlatformWebSetEventHandler
XalPlatformWebShowUrlComplete
XalSignOutUserAsync
Expand All @@ -131,6 +143,7 @@ EXPORTS
XalTryAddUserByIdAsync
XalTryAddUserByIdResult
XalUserCheckPrivilege
XalUserCheckUcsConsent
XalUserCloseHandle
XalUserCloseSignoutDeferral
XalUserDuplicateHandle
Expand All @@ -149,6 +162,8 @@ EXPORTS
XalUserGetTokenAndSignatureSilentlyResultSize
XalUserIsDevice
XalUserIsGuest
XalUserManageUcsConsentWithUiAsync
XalUserManageUcsConsentWithUiResult
XalUserRegisterChangeEventHandler
XalUserResolveIssueWithUiAsync
XalUserResolveIssueWithUiResult
Expand Down
2 changes: 1 addition & 1 deletion External/Xal/External/libHttpClient
Submodule libHttpClient updated 111 files
14 changes: 13 additions & 1 deletion External/Xal/Source/Xal/Include/Xal/xal.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ STDAPI XalSignOutUserResult(
/// </summary>
/// <param name="localId">The local id it to look up.</param>
/// <param name="user">The user object.</param>
/// <returns>Result code for this API operation. Possible values are S_OK, E_XAL_NOTINITIALIZED, or E_FAIL.</returns>
/// <returns>Result code for this API operation. Possible values are S_OK, E_XAL_NOTINITIALIZED, or E_FAIL.</returns>
/// <remarks>
/// If no user can be found matching the local id, E_XAL_USERNOTFOUND is returned.
/// </remarks>
Expand All @@ -270,6 +270,18 @@ STDAPI XalFindUserByLocalId(
_Out_ XalUserHandle* user
) noexcept;

/// <summary>
/// Checks if the given consent is opted in by all the users in the user set.
/// </summary>
/// <param name="consentModelName">The UCS consent model name.</param>
/// <param name="canOptIn">True if all the users in the user set are opted in.</param>
/// <returns>Result code for this API operation. Possible values are S_OK,
/// E_XAL_NOTINITIALIZED, E_XAL_UNLISTEDCONSENT, or E_FAIL.</returns>
STDAPI XalCheckUcsConsentForAllUsers(
_In_z_ char const* consentModelName,
_Out_ bool* canOptIn
) noexcept;

}

// Back compat apis
Expand Down
24 changes: 17 additions & 7 deletions External/Xal/Source/Xal/Include/Xal/xal_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ extern "C"
// Xal on Android has several hard requirements for how it is used with JNI.
// Xal functions may fail if these requirements are not met.
//
// First and foremost, XalInitialize must be called from a thread which
// First and foremost, XalInitialize must be called from a thread which
// originated from Java. If this does not happen, Xal will not be able to load
// any of the java classes its Android implementation depends on.
//
// Xal also expects the client to be responsible for attaching and detaching
// threads to the Java Virtual Machine. Any thread Xal is running on for
// Android should be attached to the Java VM. This is done to save the cost of
// repeatedly attaching and detaching to the Java VM.
// threads to the Java Virtual Machine. Any thread Xal is running on for
// Android should be attached to the Java VM. This is done to save the cost of
// repeatedly attaching and detaching to the Java VM.
// The recommended pattern for threads that may need to do JNI calls, including
// the ones that Xal will be run on, is to attach when the thread starts and
// the ones that Xal will be run on, is to attach when the thread starts and
// detach just before the thread terminates.
//
// Xal is configured to work with JNI_VERSION_1_6. Therefore this should be the
// Xal is configured to work with JNI_VERSION_1_6. Therefore this should be the
// return value of the JNI_OnLoad value exported by the native library which
// consumes Xal. More information about JNI_OnLoad can be found in the JNI
// consumes Xal. More information about JNI_OnLoad can be found in the JNI
// invocation documentation.

//------------------------------------------------------------------------------
Expand Down Expand Up @@ -101,6 +101,16 @@ typedef struct XalAndroidArgs
/// </summary>
_Field_z_ char const* redirectUri;

/// <summary>
/// The number of consents present in the ucsConsents array
/// </summary>
uint32_t ucsConsentCount;

/// <summary>
/// An optional list of consent requests to UCS
/// </summary>
_Field_size_(ucsConsentCount) char const** ucsConsents;

} XalAndroidArgs;

typedef XalAndroidArgs XalInitArgs;
Expand Down
10 changes: 10 additions & 0 deletions External/Xal/Source/Xal/Include/Xal/xal_apple.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ typedef struct XalAppleArgs
/// The app custom redirect URI. (Optional on macOS).
/// </summary>
_Field_z_ char const* redirectUri;

/// <summary>
/// The number of consents present in the ucsConsents array
/// </summary>
uint32_t ucsConsentCount;

/// <summary>
/// An optional list of consent requests to UCS
/// </summary>
_Field_size_(ucsConsentCount) char const** ucsConsents;
} XalAppleArgs;

typedef XalAppleArgs XalInitArgs;
Expand Down
10 changes: 10 additions & 0 deletions External/Xal/Source/Xal/Include/Xal/xal_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ typedef struct XalGenericArgs
/// </summary>
_Field_z_ char const* redirectUri;

/// <summary>
/// The number of consents present in the ucsConsents array
/// </summary>
uint32_t ucsConsentCount;

/// <summary>
/// An optional list of consent requests to UCS
/// </summary>
_Field_size_(ucsConsentCount) char const** ucsConsents;

bool useRemoteAuth;

XalGenericDeviceInfo deviceInfo;
Expand Down
1 change: 1 addition & 0 deletions External/Xal/Source/Xal/Include/Xal/xal_gsdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ extern "C"
// GDK types
//------------------------------------------------------------------------------

#define XAL_OS_ERRORS 1
#define XAL_OS_IMPL 1

typedef XUserHandle XalUserHandle;
Expand Down
45 changes: 35 additions & 10 deletions External/Xal/Source/Xal/Include/Xal/xal_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#include <Xal/xal_xdk.h>
#elif HC_PLATFORM == HC_PLATFORM_GDK
#include <Xal/xal_gsdk.h>
#elif HC_PLATFORM == HC_PLATFORM_GRTS
#include <Xal/xal_grts.h>
#elif HC_PLATFORM == HC_PLATFORM_ANDROID
#include <Xal/xal_android.h>
#elif HC_PLATFORM_IS_APPLE
Expand All @@ -42,14 +40,12 @@
#define XAL_ENABLE_BACK_COMPAT_SHIMS 1
#endif

#if HC_PLATFORM == HC_PLATFORM_GRTS
#ifndef FEATURE_ASSERTS_ENABLED
#if defined(DBG)
#define FEATURE_ASSERTS_ENABLED 1
#else
#define FEATURE_ASSERTS_ENABLED 0
#endif
#ifndef XAL_OS_ERRORS
#define XAL_OS_ERRORS 0
#endif

#ifndef XAL_CUSTOM_ALLOCATOR
#define XAL_CUSTOM_ALLOCATOR 1
#endif

extern "C"
Expand Down Expand Up @@ -87,6 +83,8 @@ extern "C"
#define E_XAL_CONTENT_ISOLATION MAKE_E_HC(0x5119L) // 0x89235119
#define E_XAL_SANDBOX_NOT_ALLOWED MAKE_E_HC(0x511AL) // 0x8923511A
#define E_XAL_GAMEWINDOWNOTFOREGROUND MAKE_E_HC(0x511BL) // 0x8923511B
#define E_XAL_UNLISTEDCONSENT MAKE_E_HC(0x511CL) // 0x8923511C
#define E_XAL_CONSENTNOTAPPLICABLE MAKE_E_HC(0x511DL) // 0x8923511D

// E_XAL_INTERNAL_* values should never be returned to callers of XAL.
#define E_XAL_INTERNAL_SWITCHUSER MAKE_E_HC(0x5171L) // 0x89235171
Expand All @@ -98,7 +96,7 @@ extern "C"
#define E_XAL_INTERNAL_NODISPLAYCLAIMSFOUND MAKE_E_HC(0x5177L) // 0x89235177

// GDK has system definitions for some error values
#if HC_PLATFORM == HC_PLATFORM_GDK || HC_PLATFORM == HC_PLATFORM_GRTS
#if XAL_OS_ERRORS
#undef E_XAL_USERSETFULL
#undef E_XAL_USERSIGNEDOUT
#undef E_XAL_UIREQUIRED
Expand Down Expand Up @@ -267,6 +265,28 @@ typedef enum XalGamerPictureSize
XalGamerPictureSize_ExtraLarge = 3,
} XalGamerPictureSize;

/// <summary>
/// Enum defining the possible consent states.
/// </summary>
/// <remarks>
/// The different states provide additional information for the client to adapt
/// the UX, but only Opted In can be used as a positive signal, the rest should
/// all be treated as Opted Out.
/// </remarks>
typedef enum XalConsentState
{
/// <summary>Unkown consent state due to query failure</summary>
/// <remarks>Should treat as Opted Out</remarks>
XalConsentState_QueryFailure = 0,
/// <summary>Model does not exist or does not apply for user</summary>
/// <remarks>Should treat as Opted Out</remarks>
XalConsentState_NotApplicable = 1,
/// <summary>User has been opted out</summary>
XalConsentState_OptedOut = 2,
/// <summary>User has been opted in</summary>
XalConsentState_OptedIn = 3,
} XalConsentState;

/// <summary>
/// Enum defining the various gamertag components.
/// </summary>
Expand Down Expand Up @@ -384,6 +404,11 @@ typedef struct XalUserGetTokenAndSignatureArgs
/// Get a token for all users.
/// </summary>
bool allUsers;

/// <summary>
/// Get a token with or without TitleIdentity.
/// </summary>
bool ignoreTitleIdentity;
} XalUserGetTokenAndSignatureArgs;

/// <summary>
Expand Down
Loading

0 comments on commit 8744d20

Please sign in to comment.