Skip to content

Commit

Permalink
2110 GDK QFE5 (#587)
Browse files Browse the repository at this point in the history
* 2110 GDK QFE5
  • Loading branch information
natiskan authored Jun 8, 2022
1 parent f2aa2b6 commit b80b8d4
Show file tree
Hide file tree
Showing 30 changed files with 724 additions and 29 deletions.
2 changes: 1 addition & 1 deletion External/Xal/External/libHttpClient
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ STDAPI XblAchievementsManagerDoWork(
_Outptr_result_maybenull_ const XblAchievementsManagerEvent** achievementsEvents,
_Out_ size_t* achievementsEventsCount
) XBL_NOEXCEPT
try
{
INIT_OUT_PTR_PARAM(achievementsEvents);

Expand All @@ -149,12 +150,14 @@ STDAPI XblAchievementsManagerDoWork(
}
);
}
CATCH_RETURN()

STDAPI XblAchievementsManagerGetAchievement(
_In_ uint64_t xboxUserId,
_In_ const char* achievementId,
_Outptr_result_maybenull_ XblAchievementsManagerResultHandle* achievementResult
) XBL_NOEXCEPT
try
{
RETURN_HR_INVALIDARGUMENT_IF(achievementId == nullptr || achievementResult == nullptr);
RETURN_HR_INVALIDARGUMENT_IF_EMPTY_STRING(achievementId);
Expand All @@ -176,13 +179,15 @@ STDAPI XblAchievementsManagerGetAchievement(
}
);
}
CATCH_RETURN()

STDAPI XblAchievementsManagerGetAchievements(
_In_ uint64_t xboxUserId,
_In_ XblAchievementOrderBy sortField,
_In_ XblAchievementsManagerSortOrder sortOrder,
_Outptr_result_maybenull_ XblAchievementsManagerResultHandle* achievementsResult
) XBL_NOEXCEPT
try
{
INIT_OUT_PTR_PARAM(achievementsResult);

Expand Down Expand Up @@ -229,6 +234,7 @@ STDAPI XblAchievementsManagerGetAchievements(
}
);
}
CATCH_RETURN()

STDAPI XblAchievementsManagerGetAchievementsByState(
_In_ uint64_t xboxUserId,
Expand All @@ -237,6 +243,7 @@ STDAPI XblAchievementsManagerGetAchievementsByState(
_In_ XblAchievementProgressState achievementState,
_Outptr_result_maybenull_ XblAchievementsManagerResultHandle* achievementsResult
) XBL_NOEXCEPT
try
{
INIT_OUT_PTR_PARAM(achievementsResult);

Expand Down Expand Up @@ -291,12 +298,14 @@ STDAPI XblAchievementsManagerGetAchievementsByState(
}
);
}
CATCH_RETURN()

STDAPI XblAchievementsManagerUpdateAchievement(
_In_ uint64_t xboxUserId,
_In_ const char* achievementId,
_In_ uint8_t currentProgress
) XBL_NOEXCEPT
try
{
return ApiImpl([&](AchievementsManager& achievementsManager)
{
Expand All @@ -314,4 +323,5 @@ STDAPI XblAchievementsManagerUpdateAchievement(
return S_OK;
}
);
}
}
CATCH_RETURN()
2 changes: 2 additions & 0 deletions Source/Services/Achievements/achievements_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,11 @@ STDAPI XblAchievementsResultGetNextResult(
_In_ XAsyncBlock* async,
_Out_ XblAchievementsResultHandle* result
) XBL_NOEXCEPT
try
{
return XAsyncGetResult(async, nullptr, sizeof(XblAchievementsResultHandle), result, nullptr);
}
CATCH_RETURN()

STDAPI XblAchievementsUpdateAchievementAsyncInternal(
_In_ XblContextHandle xboxLiveContextHandle,
Expand Down
2 changes: 2 additions & 0 deletions Source/Services/Common/xbox_live_context_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ CATCH_RETURN()
void XblSetApiType(
_In_ XblApiType apiType
) XBL_NOEXCEPT
try
{
auto state = GlobalState::Get();
if (state)
{
state->ApiType = apiType;
}
}
CATCH_RETURN_WITH(;)
14 changes: 13 additions & 1 deletion Source/Services/Common/xbox_live_context_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,25 @@ STDAPI XblContextSettingsGetLongHttpTimeout(
_In_ XblContextHandle context,
_Out_ uint32_t* timeoutInSeconds
) XBL_NOEXCEPT
try
{
RETURN_HR_INVALIDARGUMENT_IF(context == nullptr || timeoutInSeconds == nullptr);
*timeoutInSeconds = context->Settings()->LongHttpTimeout();
return S_OK;
}
CATCH_RETURN()

STDAPI XblContextSettingsSetLongHttpTimeout(
_In_ XblContextHandle context,
_In_ uint32_t timeoutInSeconds
) XBL_NOEXCEPT
try
{
RETURN_HR_INVALIDARGUMENT_IF(context == nullptr);
context->Settings()->SetLongHttpTimeout(timeoutInSeconds);
return S_OK;
}
CATCH_RETURN()

STDAPI XblContextSettingsGetHttpRetryDelay(
_In_ XblContextHandle context,
Expand Down Expand Up @@ -188,39 +192,47 @@ STDAPI XblContextSettingsGetUseCoreDispatcherForEventRouting(
_In_ XblContextHandle context,
_Out_ bool* useDispatcher
) XBL_NOEXCEPT
try
{
RETURN_HR_INVALIDARGUMENT_IF(context == nullptr || useDispatcher == nullptr);
*useDispatcher = context->Settings()->UseCoreDispatcherForEventRouting();
return S_OK;
}
CATCH_RETURN()

STDAPI XblContextSettingsSetUseCoreDispatcherForEventRouting(
_In_ XblContextHandle context,
_In_ bool useDispatcher
) XBL_NOEXCEPT
try
{
RETURN_HR_INVALIDARGUMENT_IF(context == nullptr);
context->Settings()->SetUseCoreDispatcherForEventRouting(useDispatcher);
return S_OK;
}
CATCH_RETURN()
#endif

STDAPI XblContextSettingsGetUseCrossPlatformQosServers(
_In_ XblContextHandle context,
_Out_ bool* value
) XBL_NOEXCEPT
try
{
RETURN_HR_INVALIDARGUMENT_IF(context == nullptr || value == nullptr);
*value = context->Settings()->UseCrossplatformQosServers();
return S_OK;
}
CATCH_RETURN()

STDAPI XblContextSettingsSetUseCrossPlatformQosServers(
_In_ XblContextHandle context,
_In_ bool value
) XBL_NOEXCEPT
try
{
RETURN_HR_INVALIDARGUMENT_IF_NULL(context);
context->Settings()->SetUseCrossplatformQosServers(value);
return S_OK;
}
}
CATCH_RETURN()
26 changes: 18 additions & 8 deletions Source/Services/Common/xbox_live_global_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ STDAPI XblMemSetFunctions(
_In_opt_ XblMemAllocFunction memAllocFunc,
_In_opt_ XblMemFreeFunction memFreeFunc
) XBL_NOEXCEPT
try
{
if (GlobalState::Get())
{
Expand Down Expand Up @@ -47,18 +48,21 @@ STDAPI XblMemSetFunctions(

return S_OK;
}
CATCH_RETURN()

STDAPI XblMemGetFunctions(
_Out_ XblMemAllocFunction* memAllocFunc,
_Out_ XblMemFreeFunction* memFreeFunc
) XBL_NOEXCEPT
try
{
RETURN_HR_INVALIDARGUMENT_IF(memAllocFunc == nullptr || memFreeFunc == nullptr);

*memAllocFunc = g_pMemAllocHook;
*memFreeFunc = g_pMemFreeHook;
return S_OK;
}
CATCH_RETURN()

STDAPI XblInitialize(
_In_ const XblInitArgs* args
Expand Down Expand Up @@ -112,16 +116,17 @@ CATCH_RETURN();

STDAPI_(XblErrorCondition)
XblGetErrorCondition(
_In_ HRESULT hr
_In_ HRESULT inHr
) XBL_NOEXCEPT
try
{
if (SUCCEEDED(hr))
if (SUCCEEDED(inHr))
{
return XblErrorCondition::NoError;
}
else if (HRESULT_FACILITY(hr) == FACILITY_HTTP)
else if (HRESULT_FACILITY(inHr) == FACILITY_HTTP)
{
switch (hr)
switch (inHr)
{
case HTTP_E_STATUS_NOT_MODIFIED:
return XblErrorCondition::Http304NotModified;
Expand All @@ -139,18 +144,18 @@ XblGetErrorCondition(
return XblErrorCondition::HttpGeneric;
}
}
else if (HRESULT_FACILITY(hr) == FACILITY_INTERNET)
else if (HRESULT_FACILITY(inHr) == FACILITY_INTERNET)
{
return XblErrorCondition::Network;
}
else if ((hr >= (unsigned)xbl_error_code::AM_E_XASD_UNEXPECTED && hr <= (unsigned)xbl_error_code::AM_E_XTITLE_TIMEOUT) ||
(hr >= (unsigned)xbl_error_code::XO_E_DEVMODE_NOT_AUTHORIZED && hr <= (unsigned)xbl_error_code::XO_E_CONTENT_NOT_AUTHORIZED))
else if ((inHr >= (unsigned)xbl_error_code::AM_E_XASD_UNEXPECTED && inHr <= (unsigned)xbl_error_code::AM_E_XTITLE_TIMEOUT) ||
(inHr >= (unsigned)xbl_error_code::XO_E_DEVMODE_NOT_AUTHORIZED && inHr <= (unsigned)xbl_error_code::XO_E_CONTENT_NOT_AUTHORIZED))
{
return XblErrorCondition::Auth;
}
else
{
switch (hr)
switch (inHr)
{
case ONL_E_ACTION_REQUIRED:
case E_XBL_AUTH_UNKNOWN_ERROR:
Expand All @@ -166,6 +171,7 @@ XblGetErrorCondition(
}
}
}
CATCH_RETURN_WITH(XblErrorCondition::GenericError)

STDAPI_(void) XblDisableAssertsForXboxLiveThrottlingInDevSandboxes(
_In_ XblConfigSetting setting
Expand Down Expand Up @@ -195,6 +201,7 @@ STDAPI_(XblFunctionContext) XblAddServiceCallRoutedHandler(
_In_ XblCallRoutedHandler handler,
_In_opt_ void* context
) XBL_NOEXCEPT
try
{
auto state{ GlobalState::Get() };
if (state && handler)
Expand All @@ -206,15 +213,18 @@ STDAPI_(XblFunctionContext) XblAddServiceCallRoutedHandler(
return XblFunctionContext{ 0 };
}
}
CATCH_RETURN()

STDAPI_(void) XblRemoveServiceCallRoutedHandler(
_In_ XblFunctionContext token
) XBL_NOEXCEPT
try
{
auto state{ GlobalState::Get() };
if (state)
{
state->RemoveServiceCallRoutedHandler(token);
}
}
CATCH_RETURN_WITH(;)

6 changes: 6 additions & 0 deletions Source/Services/Events/events_service_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,33 @@ STDAPI XblEventsWriteInGameEvent(
_In_opt_z_ const char* dimensions,
_In_opt_z_ const char* measurements
) XBL_NOEXCEPT
try
{
RETURN_HR_INVALIDARGUMENT_IF(xboxLiveContext == nullptr || eventName == nullptr);
VERIFY_XBL_INITIALIZED();

return xboxLiveContext->EventsService()->WriteInGameEvent(eventName, dimensions, measurements);
}
CATCH_RETURN()

#if XSAPI_INTERNAL_EVENTS_SERVICE

STDAPI XblEventsSetStorageAllotment(
uint64_t storageAllotmentInBytes
) XBL_NOEXCEPT
try
{
return events::EventQueue::SetStorageAllotment(storageAllotmentInBytes);
}
CATCH_RETURN()

STDAPI XblEventsSetMaxFileSize(
uint64_t maxFileSizeInByes
) XBL_NOEXCEPT
try
{
return events::EventQueue::SetMaxFileSize(maxFileSizeInByes);
}
CATCH_RETURN()

#endif // !XSAPI_ETW_EVENTS_SERVICE
Loading

0 comments on commit b80b8d4

Please sign in to comment.