📄 dplay8.h
字号:
DWORD dwReceiveFlags; // Flags describing how message was received
} DPNMSG_RECEIVE, *PDPNMSG_RECEIVE;
//
// Remove player from group structure for message handler
// (DPN_MSGID_REMOVE_PLAYER_FROM_GROUP)
//
typedef struct _DPNMSG_REMOVE_PLAYER_FROM_GROUP
{
DWORD dwSize; // Size of this structure
DPNID dpnidGroup; // DPNID of group
PVOID pvGroupContext; // Group context value
DPNID dpnidPlayer; // DPNID of deleted player
PVOID pvPlayerContext; // Player context value
} DPNMSG_REMOVE_PLAYER_FROM_GROUP, *PDPNMSG_REMOVE_PLAYER_FROM_GROUP;
//
// Returned buffer structure for message handler
// (DPN_MSGID_RETURN_BUFFER)
//
typedef struct _DPNMSG_RETURN_BUFFER
{
DWORD dwSize; // Size of this structure
HRESULT hResultCode; // Return value of operation
PVOID pvBuffer; // Buffer being returned
PVOID pvUserContext; // Context associated with buffer
} DPNMSG_RETURN_BUFFER, *PDPNMSG_RETURN_BUFFER;
//
// Send complete structure for message handler
// (DPN_MSGID_SEND_COMPLETE)
//
typedef struct _DPNMSG_SEND_COMPLETE
{
DWORD dwSize; // Size of this structure
DPNHANDLE hAsyncOp; // DirectPlay8 Async operation handle
PVOID pvUserContext; // User context supplied at Send/SendTo
HRESULT hResultCode; // HRESULT of send
DWORD dwSendTime; // Send time in ms
// Fields added for DirectX 9
DWORD dwFirstFrameRTT; // RTT of the first frame in the message
DWORD dwFirstFrameRetryCount; // Retry count of the first frame
DWORD dwSendCompleteFlags; // Flags describing how message was sent
DPN_BUFFER_DESC *pBuffers; // Pointer to array of buffers sent, if DirectPlay did not make a copy
DWORD dwNumBuffers; // Number of buffers in previous array
} DPNMSG_SEND_COMPLETE, *PDPNMSG_SEND_COMPLETE;
//
// Server info structure for message handler
// (DPN_MSGID_SERVER_INFO)
//
typedef struct _DPNMSG_SERVER_INFO
{
DWORD dwSize; // Size of this structure
DPNID dpnidServer; // DPNID of server
PVOID pvPlayerContext; // Player context value
} DPNMSG_SERVER_INFO, *PDPNMSG_SERVER_INFO;
//
// Terminated session structure for message handler
// (DPN_MSGID_TERMINATE_SESSION)
//
typedef struct _DPNMSG_TERMINATE_SESSION
{
DWORD dwSize; // Size of this structure
HRESULT hResultCode; // Reason
PVOID pvTerminateData; // Data passed from Host/Server
DWORD dwTerminateDataSize;// Size (in bytes) of pvTerminateData
} DPNMSG_TERMINATE_SESSION, *PDPNMSG_TERMINATE_SESSION;
//
// Message structures added for DirectX 9
//
//
// Create thread info structure for message handler
// (DPN_MSGID_CREATE_THREAD)
//
typedef struct _DPNMSG_CREATE_THREAD
{
DWORD dwSize; // Size of this structure
DWORD dwFlags; // Flags describing this thread
DWORD dwProcessorNum; // Index of processor to which thread is bound
PVOID pvUserContext; // Thread context value
} DPNMSG_CREATE_THREAD, *PDPNMSG_CREATE_THREAD;
//
// Destroy thread info structure for message handler
// (DPN_MSGID_DESTROY_THREAD)
//
typedef struct _DPNMSG_DESTROY_THREAD
{
DWORD dwSize; // Size of this structure
DWORD dwProcessorNum; // Index of processor to which thread was bound
PVOID pvUserContext; // Thread context value
} DPNMSG_DESTROY_THREAD, *PDPNMSG_DESTROY_THREAD;
//
// Query-to-resolve-NAT-address structure for message handler
// (DPN_MSGID_NAT_RESOLVER_QUERY)
//
typedef struct _DPNMSG_NAT_RESOLVER_QUERY
{
DWORD dwSize; // Size of this structure.
IDirectPlay8Address *pAddressSender; // Address of client that sent the query
IDirectPlay8Address *pAddressDevice; // Address of device on which query was received
WCHAR *pwszUserString; // User specified string, or NULL if none
} DPNMSG_NAT_RESOLVER_QUERY, *PDPNMSG_NAT_RESOLVER_QUERY;
/****************************************************************************
*
* DirectPlay8 Functions
*
****************************************************************************/
/*
* This function is no longer supported. It is recommended that CoCreateInstance be used to create
* DirectPlay8 objects.
*
* extern HRESULT WINAPI DirectPlay8Create( const CLSID * pcIID, void **ppvInterface, IUnknown *pUnknown );
*
*/
/****************************************************************************
*
* DirectPlay8 Application Interfaces
*
****************************************************************************/
//
// COM definition for DirectPlay8 Client interface
//
#undef INTERFACE // External COM Implementation
#define INTERFACE IDirectPlay8Client
DECLARE_INTERFACE_(IDirectPlay8Client,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ DP8REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDirectPlay8Client methods ***/
STDMETHOD(Initialize) (THIS_ PVOID const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) PURE;
STDMETHOD(EnumServiceProviders) (THIS_ const GUID *const pguidServiceProvider, const GUID *const pguidApplication, DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer, PDWORD const pcbEnumData, PDWORD const pcReturned, const DWORD dwFlags) PURE;
STDMETHOD(EnumHosts) (THIS_ PDPN_APPLICATION_DESC const pApplicationDesc,IDirectPlay8Address *const pAddrHost,IDirectPlay8Address *const pDeviceInfo,PVOID const pUserEnumData,const DWORD dwUserEnumDataSize,const DWORD dwEnumCount,const DWORD dwRetryInterval,const DWORD dwTimeOut,PVOID const pvUserContext,DPNHANDLE *const pAsyncHandle,const DWORD dwFlags) PURE;
STDMETHOD(CancelAsyncOperation) (THIS_ const DPNHANDLE hAsyncHandle, const DWORD dwFlags) PURE;
STDMETHOD(Connect) (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address *const pHostAddr,IDirectPlay8Address *const pDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,const void *const pvUserConnectData,const DWORD dwUserConnectDataSize,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE;
STDMETHOD(Send) (THIS_ const DPN_BUFFER_DESC *const prgBufferDesc,const DWORD cBufferDesc,const DWORD dwTimeOut,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE;
STDMETHOD(GetSendQueueInfo) (THIS_ DWORD *const pdwNumMsgs, DWORD *const pdwNumBytes, const DWORD dwFlags) PURE;
STDMETHOD(GetApplicationDesc) (THIS_ DPN_APPLICATION_DESC *const pAppDescBuffer, DWORD *const pcbDataSize, const DWORD dwFlags) PURE;
STDMETHOD(SetClientInfo) (THIS_ const DPN_PLAYER_INFO *const pdpnPlayerInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
STDMETHOD(GetServerInfo) (THIS_ DPN_PLAYER_INFO *const pdpnPlayerInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE;
STDMETHOD(GetServerAddress) (THIS_ IDirectPlay8Address **const pAddress,const DWORD dwFlags) PURE;
STDMETHOD(Close) (THIS_ const DWORD dwFlags) PURE;
STDMETHOD(ReturnBuffer) (THIS_ const DPNHANDLE hBufferHandle,const DWORD dwFlags) PURE;
STDMETHOD(GetCaps) (THIS_ DPN_CAPS *const pdpCaps,const DWORD dwFlags) PURE;
STDMETHOD(SetCaps) (THIS_ const DPN_CAPS *const pdpCaps, const DWORD dwFlags) PURE;
STDMETHOD(SetSPCaps) (THIS_ const GUID * const pguidSP, const DPN_SP_CAPS *const pdpspCaps, const DWORD dwFlags ) PURE;
STDMETHOD(GetSPCaps) (THIS_ const GUID * const pguidSP,DPN_SP_CAPS *const pdpspCaps,const DWORD dwFlags) PURE;
STDMETHOD(GetConnectionInfo) (THIS_ DPN_CONNECTION_INFO *const pdpConnectionInfo,const DWORD dwFlags) PURE;
STDMETHOD(RegisterLobby) (THIS_ const DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication *const pIDP8LobbiedApplication,const DWORD dwFlags) PURE;
};
//
// COM definition for DirectPlay8 Server interface
//
#undef INTERFACE // External COM Implementation
#define INTERFACE IDirectPlay8Server
DECLARE_INTERFACE_(IDirectPlay8Server,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ DP8REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDirectPlay8Server methods ***/
STDMETHOD(Initialize) (THIS_ PVOID const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) PURE;
STDMETHOD(EnumServiceProviders) (THIS_ const GUID *const pguidServiceProvider,const GUID *const pguidApplication,DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer,PDWORD const pcbEnumData,PDWORD const pcReturned,const DWORD dwFlags) PURE;
STDMETHOD(CancelAsyncOperation) (THIS_ const DPNHANDLE hAsyncHandle,const DWORD dwFlags) PURE;
STDMETHOD(GetSendQueueInfo) (THIS_ const DPNID dpnid,DWORD *const pdwNumMsgs, DWORD *const pdwNumBytes, const DWORD dwFlags) PURE;
STDMETHOD(GetApplicationDesc) (THIS_ DPN_APPLICATION_DESC *const pAppDescBuffer, DWORD *const pcbDataSize, const DWORD dwFlags) PURE;
STDMETHOD(SetServerInfo) (THIS_ const DPN_PLAYER_INFO *const pdpnPlayerInfo,PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
STDMETHOD(GetClientInfo) (THIS_ const DPNID dpnid,DPN_PLAYER_INFO *const pdpnPlayerInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE;
STDMETHOD(GetClientAddress) (THIS_ const DPNID dpnid,IDirectPlay8Address **const pAddress,const DWORD dwFlags) PURE;
STDMETHOD(GetLocalHostAddresses) (THIS_ IDirectPlay8Address **const prgpAddress,DWORD *const pcAddress,const DWORD dwFlags) PURE;
STDMETHOD(SetApplicationDesc) (THIS_ const DPN_APPLICATION_DESC *const pad, const DWORD dwFlags) PURE;
STDMETHOD(Host) (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address **const prgpDeviceInfo,const DWORD cDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,void *const pvPlayerContext,const DWORD dwFlags) PURE;
STDMETHOD(SendTo) (THIS_ const DPNID dpnid,const DPN_BUFFER_DESC *const prgBufferDesc,const DWORD cBufferDesc,const DWORD dwTimeOut,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE;
STDMETHOD(CreateGroup) (THIS_ const DPN_GROUP_INFO *const pdpnGroupInfo,void *const pvGroupContext,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE;
STDMETHOD(DestroyGroup) (THIS_ const DPNID idGroup, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
STDMETHOD(AddPlayerToGroup) (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
STDMETHOD(RemovePlayerFromGroup) (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
STDMETHOD(SetGroupInfo) (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
STDMETHOD(GetGroupInfo) (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE;
STDMETHOD(EnumPlayersAndGroups) (THIS_ DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE;
STDMETHOD(EnumGroupMembers) (THIS_ const DPNID dpnid, DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE;
STDMETHOD(Close) (THIS_ const DWORD dwFlags) PURE;
STDMETHOD(DestroyClient) (THIS_ const DPNID dpnidClient, const void *const pvDestroyData, const DWORD dwDestroyDataSize, const DWORD dwFlags) PURE;
STDMETHOD(ReturnBuffer) (THIS_ const DPNHANDLE hBufferHandle,const DWORD dwFlags) PURE;
STDMETHOD(GetPlayerContext) (THIS_ const DPNID dpnid,PVOID *const ppvPlayerContext,const DWORD dwFlags) PURE;
STDMETHOD(GetGroupContext) (THIS_ const DPNID dpnid,PVOID *const ppvGroupContext,const DWORD dwFlags) PURE;
STDMETHOD(GetCaps) (THIS_ DPN_CAPS *const pdpCaps,const DWORD dwFlags) PURE;
STDMETHOD(SetCaps) (THIS_ const DPN_CAPS *const pdpCaps, const DWORD dwFlags) PURE;
STDMETHOD(SetSPCaps) (THIS_ const GUID * const pguidSP, const DPN_SP_CAPS *const pdpspCaps, const DWORD dwFlags ) PURE;
STDMETHOD(GetSPCaps) (THIS_ const GUID * const pguidSP, DPN_SP_CAPS *const pdpspCaps,const DWORD dwFlags) PURE;
STDMETHOD(GetConnectionInfo) (THIS_ const DPNID dpnid, DPN_CONNECTION_INFO *const pdpConnectionInfo,const DWORD dwFlags) PURE;
STDMETHOD(RegisterLobby) (THIS_ const DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication *const pIDP8LobbiedApplication,const DWORD dwFlags) PURE;
};
//
// COM definition for DirectPlay8 Peer interface
//
#undef INTERFACE // External COM Implementation
#define INTERFACE IDirectPlay8Peer
DECLARE_INTERFACE_(IDirectPlay8Peer,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ DP8REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDirectPlay8Peer methods ***/
STDMETHOD(Initialize) (THIS_ PVOID const pvUserContext, const PFNDPNMESSAGEHANDLER pfn, const DWORD dwFlags) PURE;
STDMETHOD(EnumServiceProviders) (THIS_ const GUID *const pguidServiceProvider, const GUID *const pguidApplication, DPN_SERVICE_PROVIDER_INFO *const pSPInfoBuffer, DWORD *const pcbEnumData, DWORD *const pcReturned, const DWORD dwFlags) PURE;
STDMETHOD(CancelAsyncOperation) (THIS_ const DPNHANDLE hAsyncHandle, const DWORD dwFlags) PURE;
STDMETHOD(Connect) (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address *const pHostAddr,IDirectPlay8Address *const pDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,const void *const pvUserConnectData,const DWORD dwUserConnectDataSize,void *const pvPlayerContext,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE;
STDMETHOD(SendTo) (THIS_ const DPNID dpnid,const DPN_BUFFER_DESC *const prgBufferDesc,const DWORD cBufferDesc,const DWORD dwTimeOut,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE;
STDMETHOD(GetSendQueueInfo) (THIS_ const DPNID dpnid, DWORD *const pdwNumMsgs, DWORD *const pdwNumBytes, const DWORD dwFlags) PURE;
STDMETHOD(Host) (THIS_ const DPN_APPLICATION_DESC *const pdnAppDesc,IDirectPlay8Address **const prgpDeviceInfo,const DWORD cDeviceInfo,const DPN_SECURITY_DESC *const pdnSecurity,const DPN_SECURITY_CREDENTIALS *const pdnCredentials,void *const pvPlayerContext,const DWORD dwFlags) PURE;
STDMETHOD(GetApplicationDesc) (THIS_ DPN_APPLICATION_DESC *const pAppDescBuffer, DWORD *const pcbDataSize, const DWORD dwFlags) PURE;
STDMETHOD(SetApplicationDesc) (THIS_ const DPN_APPLICATION_DESC *const pad, const DWORD dwFlags) PURE;
STDMETHOD(CreateGroup) (THIS_ const DPN_GROUP_INFO *const pdpnGroupInfo,void *const pvGroupContext,void *const pvAsyncContext,DPNHANDLE *const phAsyncHandle,const DWORD dwFlags) PURE;
STDMETHOD(DestroyGroup) (THIS_ const DPNID idGroup, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
STDMETHOD(AddPlayerToGroup) (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
STDMETHOD(RemovePlayerFromGroup) (THIS_ const DPNID idGroup, const DPNID idClient, PVOID const pvAsyncContext, DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
STDMETHOD(SetGroupInfo) (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
STDMETHOD(GetGroupInfo) (THIS_ const DPNID dpnid,DPN_GROUP_INFO *const pdpnGroupInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE;
STDMETHOD(EnumPlayersAndGroups) (THIS_ DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE;
STDMETHOD(EnumGroupMembers) (THIS_ const DPNID dpnid, DPNID *const prgdpnid, DWORD *const pcdpnid, const DWORD dwFlags) PURE;
STDMETHOD(SetPeerInfo) (THIS_ const DPN_PLAYER_INFO *const pdpnPlayerInfo,PVOID const pvAsyncContext,DPNHANDLE *const phAsyncHandle, const DWORD dwFlags) PURE;
STDMETHOD(GetPeerInfo) (THIS_ const DPNID dpnid,DPN_PLAYER_INFO *const pdpnPlayerInfo,DWORD *const pdwSize,const DWORD dwFlags) PURE;
STDMETHOD(GetPeerAddress) (THIS_ const DPNID dpnid,IDirectPlay8Address **const ppAddress,const DWORD dwFlags) PURE;
STDMETHOD(GetLocalHostAddresses) (THIS_ IDirectPlay8Address **const prgpAddress,DWORD *const pcAddress,const DWORD dwFlags) PURE;
STDMETHOD(Close) (THIS_ const DWORD dwFlags) PURE;
STDMETHOD(EnumHosts) (THIS_ PDPN_APPLICATION_DESC const pApplicationDesc,IDirectPlay8Address *const pAddrHost,IDirectPlay8Address *const pDeviceInfo,PVOID const pUserEnumData,const DWORD dwUserEnumDataSize,const DWORD dwEnumCount,const DWORD dwRetryInterval,const DWORD dwTimeOut,PVOID const pvUserContext,DPNHANDLE *const pAsyncHandle,const DWORD dwFlags) PURE;
STDMETHOD(DestroyPeer) (THIS_ const DPNID dpnidClient, const void *const pvDestroyData, const DWORD dwDestroyDataSize, const DWORD dwFlags) PURE;
STDMETHOD(ReturnBuffer) (THIS_ const DPNHANDLE hBufferHandle,const DWORD dwFlags) PURE;
STDMETHOD(GetPlayerContext) (THIS_ const DPNID dpnid,PVOID *const ppvPlayerContext,const DWORD dwFlags) PURE;
STDMETHOD(GetGroupContext) (THIS_ const DPNID dpnid,PVOID *const ppvGroupContext,const DWORD dwFlags) PURE;
STDMETHOD(GetCaps) (THIS_ DPN_CAPS *const pdpCaps,const DWORD dwFlags) PURE;
STDMETHOD(SetCaps) (THIS_ const DPN_CAPS *const pdpCaps, const DWORD dwFlags) PURE;
STDMETHOD(SetSPCaps) (THIS_ const GUID * const pguidSP, const DPN_SP_CAPS *const pdpspCaps, const DWORD dwFlags ) PURE;
STDMETHOD(GetSPCaps) (THIS_ const GUID * const pguidSP, DPN_SP_CAPS *const pdpspCaps,const DWORD dwFlags) PURE;
STDMETHOD(GetConnectionInfo) (THIS_ const DPNID dpnid, DPN_CONNECTION_INFO *const pdpConnectionInfo,const DWORD dwFlags) PURE;
STDMETHOD(RegisterLobby) (THIS_ const DPNHANDLE dpnHandle, struct IDirectPlay8LobbiedApplication *const pIDP8LobbiedApplication,const DWORD dwFlags) PURE;
STDMETHOD(TerminateSession) (THIS_ void *const pvTerminateData,const DWORD dwTerminateDataSize,const DWORD dwFlags) PURE;
};
//
// COM definition for DirectPlay8 Thread Pool interface
//
#undef INTERFACE // External COM Implementation
#define INTERFACE IDirectPlay8ThreadPool
DECLARE_INTERFACE_(IDirectPlay8ThreadPool,IUnknown)
{
/*** IUnknown methods ***/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -