EnumSessionsCallback2

BOOL EnumSessionsCallback2(LPDPSESSIONDESC2 lpThisSD,

LPDWORD lpdwTimeOut, DWORD dwFlags

LPVOID lpContext);

Application-defined callback function for the IDirectPlay2::EnumSessions method.

·Returns TRUE to continue the enumeration or FALSE to stop it.

lpThisSD

Address of a DPSESSIONDESC2 structure describing the enumerated session. This parameter will be set to NULL if the enumeration has timed out.

lpdwTimeOut

Address of a variable containing the current time-out value. This parameter can be reset when the DPESC_TIMEDOUT flag is returned if you want to wait longer for sessions to reply.

dwFlags

Typically, this flag is set to zero.

DPESC_TIMEDOUT

The enumeration has timed out. Reset lpdwTimeOut and return TRUE to continue, or FALSE to stop the enumeration.

lpContext

Address of an application-defined context.

Any pointers returned in a callback function are temporary and are valid only in the body of the callback function. If the application needs to save pointer information, it must allocate memory to hold the data, copy the data, and then store the pointer to this new data. In this function, lpThisSD is temporary. Also note that the pointers inside the structure specified in the lpThisSD parameter—lpszSessionName / lpszSessionNameA and lpszPassword / lpszPasswordA—are also temporary.