Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3e009d8
xgameruntime: Fix build warnings.
olivi-r Apr 1, 2026
11fd614
xgameruntime: Replace INITIALIZE_OPTIONS with XGameRuntimeOptions.
olivi-r Apr 28, 2026
276ecd6
xgameruntime: Add xgameruntimefeature header.
olivi-r Apr 21, 2026
381825a
xgameruntime: Refactor xasync & xtaskqueue.
olivi-r Apr 5, 2026
152f6d6
xgameruntime: Convert XThreading definition to idl.
olivi-r Apr 5, 2026
7518efd
xgameruntime: Fix XSystem definition.
olivi-r Apr 21, 2026
2a0c2f6
xgameruntime: Convert XNetworking definition to idl.
olivi-r Apr 5, 2026
be267ec
xgameruntime: Stub XAccessibility/XSpeechSynthesizer.
olivi-r Apr 27, 2026
dd06361
xgameruntime: Stub XUser.
olivi-r Apr 22, 2026
037557f
xgameruntime: Stub XAppCapture.
olivi-r Apr 27, 2026
743ba33
xgameruntime: Stub XDisplay, implement XLauncher.
olivi-r Jan 31, 2026
d805a8a
xgameruntime: Stub XError.
olivi-r Apr 26, 2026
c953c3a
xgameruntime: Stub XGame.
olivi-r Apr 16, 2026
154d0c8
xgameruntime: Stub XGameActivation.
olivi-r Apr 26, 2026
47ca441
xgameruntime: Stub XGameEvent.
olivi-r Apr 26, 2026
75b5f14
xgameruntime: Stub XGameInvite.
olivi-r Apr 26, 2026
b1e90a8
xgameruntime: Stub XGameProtocol.
LukasPAH Apr 27, 2026
95700de
xgameruntime: Stub XGameSave/XGameSaveFiles.
olivi-r Apr 27, 2026
3a76dbf
xgameruntime: Stub XGameStreaming.
olivi-r Apr 28, 2026
c48bba8
xgameruntime: Stub XGameUi.
olivi-r Apr 28, 2026
ecf6a05
xgameruntime: Stub XPackage.
olivi-r Apr 26, 2026
12051dd
xgameruntime: Stub XPersistentLocalStorage.
olivi-r Apr 26, 2026
8361df1
xgameruntime: Stub XStore.
olivi-r Apr 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dlls/xgameruntime/GDKComponent/InitInternalGDKC.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ HRESULT WINAPI GDKC_InitAPI(
ULONG gdkVer,
ULONG gsVer,
CHAR mode,
INITIALIZE_OPTIONS *options
const XGameRuntimeOptions *options
) {
HRESULT status = S_OK;

Expand Down
2 changes: 1 addition & 1 deletion dlls/xgameruntime/GDKComponent/InitInternalGDKC.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@

#include "../private.h"

HRESULT WINAPI GDKC_InitAPI( ULONG gdkVer, ULONG gsVer, CHAR mode, INITIALIZE_OPTIONS *options );
HRESULT WINAPI GDKC_InitAPI( ULONG gdkVer, ULONG gsVer, CHAR mode, const XGameRuntimeOptions *options );

#endif
8 changes: 4 additions & 4 deletions dlls/xgameruntime/GDKComponent/System/Networking/HTTPClient.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,22 +198,22 @@ static HRESULT httpclient_ObtainThumbprints( HINTERNET inetRequest, SIZE_T *thum
if ( numElements >= 1 )
{
// leaf = element[0]
TRY_ADD_THUMBPRINT_FROM_CERT( simple->rgpElement[0]->pCertContext, ThumbprintType_Leaf );
TRY_ADD_THUMBPRINT_FROM_CERT( simple->rgpElement[0]->pCertContext, XNetworkingThumbprintType_Leaf );
}
if ( numElements >= 2 )
{
// issuer = element[1] (immediate issuer of leaf)
TRY_ADD_THUMBPRINT_FROM_CERT( simple->rgpElement[1]->pCertContext, ThumbprintType_Issuer );
TRY_ADD_THUMBPRINT_FROM_CERT( simple->rgpElement[1]->pCertContext, XNetworkingThumbprintType_Issuer );
}
if ( numElements >= 1 )
{
// root = last element
TRY_ADD_THUMBPRINT_FROM_CERT( simple->rgpElement[numElements - 1]->pCertContext, ThumbprintType_Root );
TRY_ADD_THUMBPRINT_FROM_CERT( simple->rgpElement[numElements - 1]->pCertContext, XNetworkingThumbprintType_Root );
}
} else
{
// chain not available: at least try server cert (leaf)
TRY_ADD_THUMBPRINT_FROM_CERT( certContext, ThumbprintType_Leaf );
TRY_ADD_THUMBPRINT_FROM_CERT( certContext, XNetworkingThumbprintType_Leaf );
}

if (idx > 0)
Expand Down
89 changes: 44 additions & 45 deletions dlls/xgameruntime/GDKComponent/System/Networking/XNetworking.c

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

struct x_networking
{
IXNetworkingImpl IXNetworkingImpl_iface;
IXNetworkingImpl2 IXNetworkingImpl2_iface;
LONG ref;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static VOID STDMETHODCALLTYPE atomic_vector_Visit( IAtomicVector* iface, AtomicV
PVOID element;
struct atomic_vector *impl = impl_from_IAtomicVector( iface );

TRACE( "iface %p, visitor %p, impl->size is %lld.\n", iface, visitor, impl->size );
TRACE( "iface %p, visitor %p, impl->size is %Iu.\n", iface, visitor, impl->size );

AcquireSRWLockShared( &impl->lock );

Expand Down
34 changes: 17 additions & 17 deletions dlls/xgameruntime/GDKComponent/System/Threading/XAsync.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ static HRESULT WINAPI selfProviderOperation( XAsyncOp op, const XAsyncProviderDa

switch ( op )
{
case Begin:
case XAsyncOp_Begin:
return XAsyncSchedule(data->async, 0);

case DoWork:
case XAsyncOp_DoWork:
work = (XAsyncWork *)data->context;
hr = work( data->async );
XAsyncComplete( data->async, hr, 0 );
break;

case Cancel:
case Cleanup:
case GetResult:
case XAsyncOp_Cancel:
case XAsyncOp_Cleanup:
case XAsyncOp_GetResult:
break;
}

Expand Down Expand Up @@ -334,7 +334,7 @@ static HRESULT AllocStateNoCompletion( XAsyncBlock* asyncBlock, AsyncBlockIntern

XTaskQueueHandle queue;

TRACE( "asyncBlock %p, internal %p, contextSize %lld.\n", asyncBlock, internal, contextSize );
TRACE( "asyncBlock %p, internal %p, contextSize %Iu.\n", asyncBlock, internal, contextSize );

if (!(stateImpl = calloc( 1, sizeof(*stateImpl) ))) return E_OUTOFMEMORY;

Expand Down Expand Up @@ -392,7 +392,7 @@ static HRESULT AllocState( XAsyncBlock* asyncBlock, SIZE_T contextSize )
HRESULT hr;
AsyncBlockInternal* internal;

TRACE( "asyncBlock %p, contextSize %lld.\n", asyncBlock, contextSize );
TRACE( "asyncBlock %p, contextSize %Iu.\n", asyncBlock, contextSize );

if ( !asyncBlock )
return E_INVALIDARG;
Expand Down Expand Up @@ -441,7 +441,7 @@ static void CleanupProviderForLocation( IAsyncState *state, ProviderCleanupLocat

if ( InterlockedCompareExchange( &stateImpl->providerCleanup, 0, 0 ) == InterlockedCompareExchange( &stateImpl->providerCleanup, location, CleanupLocation_CleanedUp ) )
{
stateImpl->providerCallback( Cleanup, &stateImpl->providerData );
stateImpl->providerCallback( XAsyncOp_Cleanup, &stateImpl->providerData );
}

return;
Expand Down Expand Up @@ -495,7 +495,7 @@ static void SignalWait( IAsyncState* state )
}
}

static void CALLBACK CompletionCallback( void* context, BOOL canceled )
static void CALLBACK CompletionCallback( void* context, BOOLEAN canceled )
{
IAsyncState *state = (IAsyncState *)context;
XAsyncBlock* asyncBlock;
Expand Down Expand Up @@ -527,7 +527,7 @@ static HRESULT SignalCompletion( IAsyncState *state )
if ( stateImpl->providerData.async->callback != NULL )
{
state->lpVtbl->AddRef( state );
hr = XTaskQueueSubmitDelayedCallback( stateImpl->queue, Completion, 0, (PVOID)state, CompletionCallback );
hr = XTaskQueueSubmitDelayedCallback( stateImpl->queue, XTaskQueuePort_Completion, 0, (PVOID)state, CompletionCallback );

if ( SUCCEEDED( hr ) )
{
Expand Down Expand Up @@ -556,7 +556,7 @@ static void CleanupState( IAsyncState *state)
}


static void CALLBACK WorkerCallback( PVOID context, BOOL canceled )
static void CALLBACK WorkerCallback( PVOID context, BOOLEAN canceled )
{
HRESULT callStatus;
IAsyncState *state = (IAsyncState *)context;
Expand Down Expand Up @@ -608,7 +608,7 @@ static void CALLBACK WorkerCallback( PVOID context, BOOL canceled )
}
else
{
callStatus = stateImpl->providerCallback( DoWork, &stateImpl->providerData );
callStatus = stateImpl->providerCallback( XAsyncOp_DoWork, &stateImpl->providerData );

// Work routine can return E_PENDING if there is more work to do. Otherwise
// it either needs to be a failure or it should have called XAsyncComplete, which
Expand Down Expand Up @@ -767,7 +767,7 @@ VOID XAsyncCancel( XAsyncBlock* asyncBlock )

if ( TrySetProviderCleanup( state, CleanupLocation_InCancel ) )
{
stateImpl->providerCallback( Cancel, &stateImpl->providerData );
stateImpl->providerCallback( XAsyncOp_Cancel, &stateImpl->providerData );
RevertProviderCleanup( state, CleanupLocation_InCancel );
}
}
Expand Down Expand Up @@ -795,7 +795,7 @@ HRESULT XAsyncRun( XAsyncBlock* asyncBlock, XAsyncWork* work )
return hr;
}

HRESULT XAsyncBegin( XAsyncBlock* asyncBlock, PVOID context, PVOID identity, LPCSTR identityName, XAsyncProviderCallback* provider )
HRESULT XAsyncBegin( XAsyncBlock* asyncBlock, PVOID context, const void *identity, LPCSTR identityName, XAsyncProvider* provider )
{
HRESULT hr;
IAsyncState *state;
Expand Down Expand Up @@ -825,7 +825,7 @@ HRESULT XAsyncBegin( XAsyncBlock* asyncBlock, PVOID context, PVOID identity, LPC
stateImpl->identityName = identityName;
stateImpl->providerData.context = context;

hr = stateImpl->providerCallback( Begin, &stateImpl->providerData );
hr = stateImpl->providerCallback( XAsyncOp_Begin, &stateImpl->providerData );
if ( FAILED( hr ) )
{
XAsyncComplete( asyncBlock, hr, 0 );
Expand Down Expand Up @@ -875,7 +875,7 @@ HRESULT XAsyncSchedule( XAsyncBlock* asyncBlock, UINT32 delayInMs )

state->lpVtbl->AddRef( state );

hr = XTaskQueueSubmitDelayedCallback( stateImpl->queue, Work, delayInMs, (PVOID)state, WorkerCallback );
hr = XTaskQueueSubmitDelayedCallback( stateImpl->queue, XTaskQueuePort_Work, delayInMs, (PVOID)state, WorkerCallback );

state->lpVtbl->Release( state );

Expand All @@ -895,7 +895,7 @@ VOID XAsyncComplete( XAsyncBlock* asyncBlock, HRESULT result, SIZE_T requiredBuf
struct x_async_block_guard *impl;
struct async_state *stateImpl = NULL;

TRACE( "asyncBlock %p, result %#lx, requiredBufferSize %lld.\n", asyncBlock, result, requiredBufferSize );
TRACE( "asyncBlock %p, result %#lx, requiredBufferSize %Iu.\n", asyncBlock, result, requiredBufferSize );

if ( result == E_PENDING )
{
Expand Down
4 changes: 2 additions & 2 deletions dlls/xgameruntime/GDKComponent/System/Threading/XAsync.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct async_state
LONG /* ProviderCleanupLocation */ providerCleanup;
LONG workScheduled;
BOOLEAN valid;
XAsyncProviderCallback *providerCallback;
XAsyncProvider *providerCallback;
XAsyncProviderData providerData;
XAsyncBlock providerAsyncBlock;
XAsyncBlock* userAsyncBlock;
Expand All @@ -136,7 +136,7 @@ HRESULT XAsyncGetStatus( XAsyncBlock* asyncBlock, BOOLEAN wait );
HRESULT XAsyncGetResultSize( XAsyncBlock* asyncBlock, SIZE_T* bufferSize );
VOID XAsyncCancel( XAsyncBlock* asyncBlock );
HRESULT XAsyncRun( XAsyncBlock* asyncBlock, XAsyncWork* work );
HRESULT XAsyncBegin( XAsyncBlock* asyncBlock, PVOID context, PVOID identity, LPCSTR identityName, XAsyncProviderCallback* provider );
HRESULT XAsyncBegin( XAsyncBlock* asyncBlock, PVOID context, const void *identity, LPCSTR identityName, XAsyncProvider* provider );
HRESULT XAsyncSchedule( XAsyncBlock* asyncBlock, UINT32 delayInMs );
VOID XAsyncComplete( XAsyncBlock* asyncBlock, HRESULT result, SIZE_T requiredBufferSize );

Expand Down
38 changes: 19 additions & 19 deletions dlls/xgameruntime/GDKComponent/System/Threading/XTaskQueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,17 +433,17 @@ static HRESULT WINAPI x_task_queue_port_Initialize( IXTaskQueuePort *iface, XTas

switch (mode)
{
case Manual:
case XTaskQueueDispatchMode_Manual:
// nothing
break;

case ThreadPool:
case SerializedThreadPool:
case XTaskQueueDispatchMode_ThreadPool:
case XTaskQueueDispatchMode_SerializedThreadPool:
hr = impl->threadPool->lpVtbl->Initialize( impl->threadPool, iface, x_task_queue_port_ThreadPoolOperation );
if ( FAILED( hr ) ) return hr;
break;

case Immediate:
case XTaskQueueDispatchMode_Immediate:
// nothing
break;
}
Expand Down Expand Up @@ -694,7 +694,7 @@ static BOOLEAN x_task_queue_port_DrainOneItem( IXTaskQueuePort *iface )

TRACE( "iface %p.\n", iface );

if ( impl->suspended && impl->dispatchMode != Immediate )
if ( impl->suspended && impl->dispatchMode != XTaskQueueDispatchMode_Immediate )
{
return FALSE;
}
Expand Down Expand Up @@ -1191,7 +1191,7 @@ static VOID x_task_queue_port_ProcessThreadPoolCallback( IXTaskQueuePort *iface,
InterlockedIncrement( &impl->processingCallback );
wasProcessing = InterlockedCompareExchange( &impl->processingCallback, 0, 0 );

if ( impl->dispatchMode == SerializedThreadPool )
if ( impl->dispatchMode == XTaskQueueDispatchMode_SerializedThreadPool )
{
if ( wasProcessing == 0 )
{
Expand Down Expand Up @@ -1241,16 +1241,16 @@ static VOID x_task_queue_port_NotifyItemQueued( IXTaskQueuePort *iface )

TRACE( "iface %p.\n", iface );

if ( !impl->suspended || impl->dispatchMode == Immediate)
if ( !impl->suspended || impl->dispatchMode == XTaskQueueDispatchMode_Immediate)
{
switch (impl->dispatchMode)
{
case Manual:
case XTaskQueueDispatchMode_Manual:
// nothing
break;

case SerializedThreadPool:
case ThreadPool:
case XTaskQueueDispatchMode_SerializedThreadPool:
case XTaskQueueDispatchMode_ThreadPool:
// Addref before submitting to the thread pool in case we
// are released while there there are outstanding threadpool
// items. The threadpool does not cancel outstanding callbacks
Expand All @@ -1260,7 +1260,7 @@ static VOID x_task_queue_port_NotifyItemQueued( IXTaskQueuePort *iface )
impl->threadPool->lpVtbl->Submit( impl->threadPool );
break;

case Immediate:
case XTaskQueueDispatchMode_Immediate:
// We will handle this after we invoke
// callback submitted.
break;
Expand All @@ -1270,7 +1270,7 @@ static VOID x_task_queue_port_NotifyItemQueued( IXTaskQueuePort *iface )
// If the queue is immediate, drain the newly queued item
// now.

if (impl->dispatchMode == Immediate)
if (impl->dispatchMode == XTaskQueueDispatchMode_Immediate)
{
iface->lpVtbl->DrainOneItem( iface );
}
Expand Down Expand Up @@ -1530,12 +1530,12 @@ static HRESULT WINAPI x_task_queue_GetPortContext( IXTaskQueue *iface, XTaskQueu

switch( port )
{
case Work:
case XTaskQueuePort_Work:
*portContext = &workContext->IXTaskQueuePortContext_iface;
IUnknown_AddRef( *portContext );
break;

case Completion:
case XTaskQueuePort_Completion:
*portContext = &completionContext->IXTaskQueuePortContext_iface;
IUnknown_AddRef( *portContext );
break;
Expand Down Expand Up @@ -1842,15 +1842,15 @@ HRESULT XTaskQueueCreate( XTaskQueueDispatchMode workDispatchMode, XTaskQueueDis
workContext->IXTaskQueuePortContext_iface.lpVtbl = &x_task_queue_port_context_vtbl;
workContext->callbackSubmitted = impl->callbackSubmitted;
workContext->queue = &impl->IXTaskQueue_iface;
workContext->type = Work;
workContext->type = XTaskQueuePort_Work;
workContext->ref = 1;

impl->workPort = &workContext->IXTaskQueuePortContext_iface;

completionContext->IXTaskQueuePortContext_iface.lpVtbl = &x_task_queue_port_context_vtbl;
completionContext->callbackSubmitted = impl->callbackSubmitted;
completionContext->queue = &impl->IXTaskQueue_iface;
completionContext->type = Completion;
completionContext->type = XTaskQueuePort_Completion;
completionContext->ref = 1;

impl->completionPort = &completionContext->IXTaskQueuePortContext_iface;
Expand Down Expand Up @@ -1923,15 +1923,15 @@ HRESULT XTaskQueueCreateComposite( XTaskQueuePortHandle workPort, XTaskQueuePort
workContext->IXTaskQueuePortContext_iface.lpVtbl = &x_task_queue_port_context_vtbl;
workContext->callbackSubmitted = impl->callbackSubmitted;
workContext->queue = &impl->IXTaskQueue_iface;
workContext->type = Work;
workContext->type = XTaskQueuePort_Work;
workContext->ref = 1;

impl->workPort = &workContext->IXTaskQueuePortContext_iface;

completionContext->IXTaskQueuePortContext_iface.lpVtbl = &x_task_queue_port_context_vtbl;
completionContext->callbackSubmitted = impl->callbackSubmitted;
completionContext->queue = &impl->IXTaskQueue_iface;
completionContext->type = Completion;
completionContext->type = XTaskQueuePort_Completion;
completionContext->ref = 1;

impl->completionPort = &completionContext->IXTaskQueuePortContext_iface;
Expand Down Expand Up @@ -2082,7 +2082,7 @@ VOID XTaskQueueResumeTermination( XTaskQueueHandle queue )

impl = queue->headQueue;

hr = impl->lpVtbl->GetPortContext( impl, Work, &portContext );
hr = impl->lpVtbl->GetPortContext( impl, XTaskQueuePort_Work, &portContext );
if ( FAILED( hr ) ) return;

queuePort = portContext->lpVtbl->get_Port( portContext );
Expand Down
8 changes: 8 additions & 0 deletions dlls/xgameruntime/GDKComponent/System/Threading/XTaskQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ typedef struct IXTaskQueueWaitCallback IXTaskQueueWaitCallback;
static const UINT32 TASK_QUEUE_SIGNATURE = 0x41515545;
static const UINT32 TASK_QUEUE_PORT_SIGNATURE = 0x41515553;

typedef enum XTaskQueuePortStatus
{
PortStatus_Active,
PortStatus_Canceled,
PortStatus_Terminating,
PortStatus_Terminated
} XTaskQueuePortStatus;

typedef enum TerminationLevel
{
TerminationLevel_None,
Expand Down
Loading