Skip to main content
Initializes the library instance.

Syntax

Parameters

args   _In_
Type: XblInitArgs*
Platform-specific args for XblInitialize.

Return value

Type: HRESULT HRESULT return code for this API operation. Possible error codes include the following. This list isn’t exhaustive.

Remarks

Call XGameRuntimeInitialize before you call this function. Call this function before any other Xbl* function, except for XblMemSetFunctions and XblMemGetFunctions. Call this function once for each instance of the XSAPI library that you link. Don’t call it again until XblCleanupAsync completes. If you statically link XSAPI into more than one DLL, each DLL has its own copy of the XSAPI state, and calling XblInitialize in one DLL doesn’t initialize XSAPI in the others. To share one XSAPI instance across DLLs, use Microsoft.Xbox.Services.C.Thunks.dll. If you set custom memory functions with XblMemSetFunctions, call XblCleanupAsync and wait for it to finish before you shut down your memory manager. After this function succeeds, create an XBOX services context for each signed-in user by calling XblContextCreateHandle. For more information, see How to use XBOX services APIs.

Requirements

Header: xbox_live_global_c.h Library: Microsoft.Xbox.Services.142.C.lib or Microsoft.Xbox.Services.143.C.lib

See also

xbox_live_global_c
Last modified on October 29, 2026