📄 dplay8.h
字号:
//
// Set client info flags (For SetClientInfo)
//
#define DPNSETCLIENTINFO_SYNC DPNOP_SYNC
//
// Set group info flags (For SetGroupInfo)
//
#define DPNSETGROUPINFO_SYNC DPNOP_SYNC
//
// Set peer info flags (For SetPeerInfo)
//
#define DPNSETPEERINFO_SYNC DPNOP_SYNC
//
// Set server info flags (For SetServerInfo)
//
#define DPNSETSERVERINFO_SYNC DPNOP_SYNC
//
// SP capabilities flags
//
#define DPNSPCAPS_SUPPORTSDPNSRV 0x0001
#define DPNSPCAPS_SUPPORTSBROADCAST 0x0002
#define DPNSPCAPS_SUPPORTSALLADAPTERS 0x0004
/****************************************************************************
*
* DirectPlay8 Structures (Non-Message)
*
****************************************************************************/
//
// Application description
//
typedef struct _DPN_APPLICATION_DESC
{
DWORD dwSize; // Size of this structure
DWORD dwFlags; // Flags (DPNSESSION_...)
GUID guidInstance; // Instance GUID
GUID guidApplication; // Application GUID
DWORD dwMaxPlayers; // Maximum # of players allowed (0=no limit)
DWORD dwCurrentPlayers; // Current # of players allowed
WCHAR *pwszSessionName; // Name of the session
WCHAR *pwszPassword; // Password for the session
PVOID pvReservedData;
DWORD dwReservedDataSize;
PVOID pvApplicationReservedData;
DWORD dwApplicationReservedDataSize;
} DPN_APPLICATION_DESC, *PDPN_APPLICATION_DESC;
//
// Generic Buffer Description
//
typedef struct _BUFFERDESC
{
DWORD dwBufferSize;
BYTE * pBufferData;
} BUFFERDESC, DPN_BUFFER_DESC, *PDPN_BUFFER_DESC;
typedef BUFFERDESC FAR * PBUFFERDESC;
//
// DirectPlay8 capabilities
//
typedef struct _DPN_CAPS
{
DWORD dwSize; // Size of this structure
DWORD dwFlags; // Flags
DWORD dwConnectTimeout; // ms before a connect request times out
DWORD dwConnectRetries; // # of times to attempt the connection
DWORD dwTimeoutUntilKeepAlive; // ms of inactivity before a keep alive is sent
} DPN_CAPS, *PDPN_CAPS;
// Connection Statistics information
typedef struct _DPN_CONNECTION_INFO
{
DWORD dwSize;
DWORD dwRoundTripLatencyMS;
DWORD dwThroughputBPS;
DWORD dwPeakThroughputBPS;
DWORD dwBytesSentGuaranteed;
DWORD dwPacketsSentGuaranteed;
DWORD dwBytesSentNonGuaranteed;
DWORD dwPacketsSentNonGuaranteed;
DWORD dwBytesRetried; // Guaranteed only
DWORD dwPacketsRetried; // Guaranteed only
DWORD dwBytesDropped; // Non Guaranteed only
DWORD dwPacketsDropped; // Non Guaranteed only
DWORD dwMessagesTransmittedHighPriority;
DWORD dwMessagesTimedOutHighPriority;
DWORD dwMessagesTransmittedNormalPriority;
DWORD dwMessagesTimedOutNormalPriority;
DWORD dwMessagesTransmittedLowPriority;
DWORD dwMessagesTimedOutLowPriority;
DWORD dwBytesReceivedGuaranteed;
DWORD dwPacketsReceivedGuaranteed;
DWORD dwBytesReceivedNonGuaranteed;
DWORD dwPacketsReceivedNonGuaranteed;
DWORD dwMessagesReceived;
} DPN_CONNECTION_INFO, *PDPN_CONNECTION_INFO;
//
// Group information strucutre
//
typedef struct _DPN_GROUP_INFO
{
DWORD dwSize; // size of this structure
DWORD dwInfoFlags; // information contained
PWSTR pwszName; // Unicode Name
PVOID pvData; // data block
DWORD dwDataSize; // size in BYTES of data block
DWORD dwGroupFlags; // group flags (DPNGROUP_...)
} DPN_GROUP_INFO, *PDPN_GROUP_INFO;
//
// Player information structure
//
typedef struct _DPN_PLAYER_INFO
{
DWORD dwSize; // size of this structure
DWORD dwInfoFlags; // information contained
PWSTR pwszName; // Unicode Name
PVOID pvData; // data block
DWORD dwDataSize; // size in BYTES of data block
DWORD dwPlayerFlags; // player flags (DPNPLAYER_...)
} DPN_PLAYER_INFO, *PDPN_PLAYER_INFO;
typedef struct _DPN_SECURITY_CREDENTIALS DPN_SECURITY_CREDENTIALS, *PDPN_SECURITY_CREDENTIALS;
typedef struct _DPN_SECURITY_DESC DPN_SECURITY_DESC, *PDPN_SECURITY_DESC;
//
// Service provider & adapter enumeration structure
//
typedef struct _DPN_SERVICE_PROVIDER_INFO
{
DWORD dwFlags;
GUID guid; // SP Guid
WCHAR *pwszName; // Friendly Name
PVOID pvReserved;
DWORD dwReserved;
} DPN_SERVICE_PROVIDER_INFO, *PDPN_SERVICE_PROVIDER_INFO;
//
// Service provider caps structure
//
typedef struct _DPN_SP_CAPS
{
DWORD dwSize; // Size of this structure
DWORD dwFlags; // Flags ((DPNSPCAPS_...)
DWORD dwNumThreads; // # of worker threads to use
DWORD dwDefaultEnumCount; // default # of enum requests
DWORD dwDefaultEnumRetryInterval; // default ms between enum requests
DWORD dwDefaultEnumTimeout; // default enum timeout
DWORD dwMaxEnumPayloadSize; // maximum size in bytes for enum payload data
DWORD dwBuffersPerThread; // number of receive buffers per thread
DWORD dwSystemBufferSize; // amount of buffering to do in addition to posted receive buffers
} DPN_SP_CAPS, *PDPN_SP_CAPS;
/****************************************************************************
*
* IDirectPlay8 message handler call back structures
*
****************************************************************************/
//
// Add player to group strucutre for message handler
// (DPN_MSGID_ADD_PLAYER_TO_GROUP)
//
typedef struct _DPNMSG_ADD_PLAYER_TO_GROUP
{
DWORD dwSize; // Size of this structure
DPNID dpnidGroup; // DPNID of group
PVOID pvGroupContext; // Group context value
DPNID dpnidPlayer; // DPNID of added player
PVOID pvPlayerContext; // Player context value
} DPNMSG_ADD_PLAYER_TO_GROUP, *PDPNMSG_ADD_PLAYER_TO_GROUP;
//
// Async operation completion structure for message handler
// (DPN_MSGID_ASYNC_OP_COMPLETE)
//
typedef struct _DPNMSG_ASYNC_OP_COMPLETE
{
DWORD dwSize; // Size of this structure
DPNHANDLE hAsyncOp; // DirectPlay8 async operation handle
PVOID pvUserContext; // User context supplied
HRESULT hResultCode; // HRESULT of operation
} DPNMSG_ASYNC_OP_COMPLETE, *PDPNMSG_ASYNC_OP_COMPLETE;
//
// Client info structure for message handler
// (DPN_MSGID_CLIENT_INFO)
//
typedef struct _DPNMSG_CLIENT_INFO
{
DWORD dwSize; // Size of this structure
DPNID dpnidClient; // DPNID of client
PVOID pvPlayerContext; // Player context value
} DPNMSG_CLIENT_INFO, *PDPNMSG_CLIENT_INFO;
//
// Connect complete structure for message handler
// (DPN_MSGID_CONNECT_COMPLETE)
//
typedef struct _DPNMSG_CONNECT_COMPLETE
{
DWORD dwSize; // Size of this structure
DPNHANDLE hAsyncOp; // DirectPlay8 Async operation handle
PVOID pvUserContext; // User context supplied at Connect
HRESULT hResultCode; // HRESULT of connection attempt
PVOID pvApplicationReplyData; // Connection reply data from Host/Server
DWORD dwApplicationReplyDataSize; // Size (in bytes) of pvApplicationReplyData
} DPNMSG_CONNECT_COMPLETE, *PDPNMSG_CONNECT_COMPLETE;
//
// Create group structure for message handler
// (DPN_MSGID_CREATE_GROUP)
//
typedef struct _DPNMSG_CREATE_GROUP
{
DWORD dwSize; // Size of this structure
DPNID dpnidGroup; // DPNID of new group
DPNID dpnidOwner; // Owner of newgroup
PVOID pvGroupContext; // Group context value
} DPNMSG_CREATE_GROUP, *PDPNMSG_CREATE_GROUP;
//
// Create player structure for message handler
// (DPN_MSGID_CREATE_PLAYER)
//
typedef struct _DPNMSG_CREATE_PLAYER
{
DWORD dwSize; // Size of this structure
DPNID dpnidPlayer; // DPNID of new player
PVOID pvPlayerContext; // Player context value
} DPNMSG_CREATE_PLAYER, *PDPNMSG_CREATE_PLAYER;
//
// Destroy group structure for message handler
// (DPN_MSGID_DESTROY_GROUP)
//
typedef struct _DPNMSG_DESTROY_GROUP
{
DWORD dwSize; // Size of this structure
DPNID dpnidGroup; // DPNID of destroyed group
PVOID pvGroupContext; // Group context value
DWORD dwReason; // Information only
} DPNMSG_DESTROY_GROUP, *PDPNMSG_DESTROY_GROUP;
//
// Destroy player structure for message handler
// (DPN_MSGID_DESTROY_PLAYER)
//
typedef struct _DPNMSG_DESTROY_PLAYER
{
DWORD dwSize; // Size of this structure
DPNID dpnidPlayer; // DPNID of leaving player
PVOID pvPlayerContext; // Player context value
DWORD dwReason; // Information only
} DPNMSG_DESTROY_PLAYER, *PDPNMSG_DESTROY_PLAYER;
//
// Enumeration request received structure for message handler
// (DPN_MSGID_ENUM_HOSTS_QUERY)
//
typedef struct _DPNMSG_ENUM_HOSTS_QUERY
{
DWORD dwSize; // Size of this structure.
IDirectPlay8Address *pAddressSender; // Address of client who sent the request
IDirectPlay8Address *pAddressDevice; // Address of device request was received on
PVOID pvReceivedData; // Request data (set on client)
DWORD dwReceivedDataSize; // Request data size (set on client)
DWORD dwMaxResponseDataSize; // Max allowable size of enum response
PVOID pvResponseData; // Optional query repsonse (user set)
DWORD dwResponseDataSize; // Optional query response size (user set)
PVOID pvResponseContext; // Optional query response context (user set)
} DPNMSG_ENUM_HOSTS_QUERY, *PDPNMSG_ENUM_HOSTS_QUERY;
//
// Enumeration response received structure for message handler
// (DPN_MSGID_ENUM_HOSTS_RESPONSE)
//
typedef struct _DPNMSG_ENUM_HOSTS_RESPONSE
{
DWORD dwSize; // Size of this structure
IDirectPlay8Address *pAddressSender; // Address of host who responded
IDirectPlay8Address *pAddressDevice; // Device response was received on
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -