All stubs

The entire DirectPlay implementation is a stub. Every function and method compiles, returns success codes, and does nothing. No network I/O, session discovery, or message passing is performed. These stubs exist solely so that game code that references DirectPlay APIs can compile and link without modification.

Purpose

Planet Blupi (and some builds of Speedy Blupi) reference DirectPlay for optional multiplayer networking. The target games generally degrade gracefully when networking fails — they fall back to single-player mode. The stubs make this work by making every call "succeed" with no real sessions found and no real messages exchanged.

Global functions

DirectPlayCreate function Stub
HRESULT WINAPI DirectPlayCreate(
    LPGUID lpGUID,
    LPDIRECTPLAY* lplpDP,
    IUnknown* pUnkOuter
);

Creates a stub IDirectPlay object. The object supports QueryInterface to obtain an IDirectPlay2A stub. No actual networking is set up.

DirectPlayEnumerateA / DirectPlayEnumerateW function Stub
HRESULT WINAPI DirectPlayEnumerateA(LPDPENUMDPCALLBACKA lpEnumCallback, LPVOID lpContext);
HRESULT WINAPI DirectPlayEnumerateW(LPDPENUMDPCALLBACKW lpEnumCallback, LPVOID lpContext);

Do not call the callback (no service providers are enumerated). Return DP_OK.

IDirectPlay2A interface

Obtained via IDirectPlay::QueryInterface with IID_IDirectPlay2A.

MethodStatusStub behavior
EnumSessions Stub Callback is never called (no sessions found). Returns DP_OK.
Open Stub Returns DP_OK without opening anything.
CreatePlayer Stub Sets *lpidPlayer = 1. Returns DP_OK.
Send Stub Returns DP_OK. No data is sent.
Receive Stub Returns DP_OK. No messages in queue; output pointers unchanged.
Close Stub Returns DP_OK.

Key types

DPID

typedef DWORD_PTR DPID, *LPDPID;

Player identifier. Uses pointer-sized storage for ABI safety on 32-bit and 64-bit hosts.

DPSESSIONDESC2

Session descriptor used for enumeration and open/join. Declared in the header for compile compatibility; no instances are created by the stub implementation.

Result codes

ConstantMeaning
DP_OKSuccess (all stubs return this)
DPERR_INVALIDPARAMSReturned by DirectPlayCreate if lplpDP is NULL
DPERR_OUTOFMEMORYReturned if the stub object allocation fails

All other DPERR_* constants are defined for compile compatibility only.

Extending DirectPlay

If your game actually needs multiplayer, the stub layer is a starting point. You would replace the DirectPlay2AImpl class in src/directplay/DirectPlay.cpp with a real implementation backed by SDL_Net, ENet, or a custom UDP layer. See Developer Notes for guidance.