Files
mandy/third_party/xtaskqueue/Source/Task/XTaskQueueDiagnostics.h
IAmNotSiob 36bc1200ad Runtime: offline xgameruntime shim (XGameRuntime, XSystem, XTaskQueue, XAsync)
Every GDK title calls XGameRuntimeInitialize first and builds its async work on
XTaskQueue/XAsync. Add an xgameruntime.dll shim table for those, ahead of the
executable: XGameRuntimeInitialize/Uninitialize (reference counted),
XSystemGetDeviceType (Series X; LEONIDA_DEVICE_TYPE overrides) and
XSystemGetConsoleId (placeholder), plus the 23 XTaskQueue/XAsync functions.

XTaskQueue/XAsync come from microsoft/libHttpClient (MIT), copied unmodified
into third_party/xtaskqueue (task queue only, no HTTP stack); a small pch.h
stand-in lets them build alone. xgameruntime_test drives the table through
the shim registry the way a title boots. Nothing goes online.
2026-11-21 23:06:10 +01:00

51 lines
1.4 KiB
C

// Copyright(c) Microsoft Corporation. All rights reserved.
//
#pragma once
#include "XTaskQueue.h"
#if defined(HC_ENABLE_UNNAMED_OBJECT_DIAGNOSTICS)
struct XTaskQueueSyncObjectCounts
{
uint64_t constructed;
uint64_t destroyed;
uint64_t live;
};
struct XTaskQueueSyncObjectSnapshot
{
XTaskQueueSyncObjectCounts mutex;
XTaskQueueSyncObjectCounts recursiveMutex;
XTaskQueueSyncObjectCounts conditionVariable;
XTaskQueueSyncObjectCounts conditionVariableAny;
bool usesUnnamedConstructors;
};
/// <summary>
/// Gets aggregate construction and destruction counts for the synchronization
/// wrappers used by this module. Available only in diagnostic test builds.
/// </summary>
STDAPI XTaskQueueGetSyncObjectDiagnosticSnapshot(
_Out_ XTaskQueueSyncObjectSnapshot* snapshot
) noexcept;
/// <summary>
/// Constructs and destroys one of each synchronization wrapper, including a
/// recursive re-entry, and returns snapshots at each test boundary.
/// </summary>
STDAPI XTaskQueueRunSyncObjectDiagnosticProbe(
_Out_ XTaskQueueSyncObjectSnapshot* before,
_Out_ XTaskQueueSyncObjectSnapshot* during,
_Out_ XTaskQueueSyncObjectSnapshot* after
) noexcept;
/// <summary>
/// Closes per-process queue handles and waits for outstanding TaskQueue
/// lifecycle references to drain. This is an existing private test API.
/// </summary>
STDAPI_(bool) XTaskQueueUninitialize(
_In_ uint32_t timeoutMilliseconds
) noexcept;
#endif