📄 dplay8.h
字号:
/*==========================================================================
*
* Copyright (C) 1998-2002 Microsoft Corporation. All Rights Reserved.
*
* File: DPlay8.h
* Content: DirectPlay8 include file
*
***************************************************************************/
#ifndef __DIRECTPLAY8_H__
#define __DIRECTPLAY8_H__
#include <ole2.h> // for DECLARE_INTERFACE_ and HRESULT
#include "dpaddr.h"
#ifdef __cplusplus
extern "C" {
#endif
/****************************************************************************
*
* DirectPlay8 CLSIDs
*
****************************************************************************/
// {743F1DC6-5ABA-429f-8BDF-C54D03253DC2}
DEFINE_GUID(CLSID_DirectPlay8Client,
0x743f1dc6, 0x5aba, 0x429f, 0x8b, 0xdf, 0xc5, 0x4d, 0x3, 0x25, 0x3d, 0xc2);
// {DA825E1B-6830-43d7-835D-0B5AD82956A2}
DEFINE_GUID(CLSID_DirectPlay8Server,
0xda825e1b, 0x6830, 0x43d7, 0x83, 0x5d, 0xb, 0x5a, 0xd8, 0x29, 0x56, 0xa2);
// {286F484D-375E-4458-A272-B138E2F80A6A}
DEFINE_GUID(CLSID_DirectPlay8Peer,
0x286f484d, 0x375e, 0x4458, 0xa2, 0x72, 0xb1, 0x38, 0xe2, 0xf8, 0xa, 0x6a);
// CLSIDs added for DirectX 9
// {FC47060E-6153-4b34-B975-8E4121EB7F3C}
DEFINE_GUID(CLSID_DirectPlay8ThreadPool,
0xfc47060e, 0x6153, 0x4b34, 0xb9, 0x75, 0x8e, 0x41, 0x21, 0xeb, 0x7f, 0x3c);
// {E4C1D9A2-CBF7-48bd-9A69-34A55E0D8941}
DEFINE_GUID(CLSID_DirectPlay8NATResolver,
0xe4c1d9a2, 0xcbf7, 0x48bd, 0x9a, 0x69, 0x34, 0xa5, 0x5e, 0xd, 0x89, 0x41);
/****************************************************************************
*
* DirectPlay8 Interface IIDs
*
****************************************************************************/
typedef REFIID DP8REFIID;
// {5102DACD-241B-11d3-AEA7-006097B01411}
DEFINE_GUID(IID_IDirectPlay8Client,
0x5102dacd, 0x241b, 0x11d3, 0xae, 0xa7, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
// {5102DACE-241B-11d3-AEA7-006097B01411}
DEFINE_GUID(IID_IDirectPlay8Server,
0x5102dace, 0x241b, 0x11d3, 0xae, 0xa7, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
// {5102DACF-241B-11d3-AEA7-006097B01411}
DEFINE_GUID(IID_IDirectPlay8Peer,
0x5102dacf, 0x241b, 0x11d3, 0xae, 0xa7, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
// IIDs added for DirectX 9
// {0D22EE73-4A46-4a0d-89B2-045B4D666425}
DEFINE_GUID(IID_IDirectPlay8ThreadPool,
0xd22ee73, 0x4a46, 0x4a0d, 0x89, 0xb2, 0x4, 0x5b, 0x4d, 0x66, 0x64, 0x25);
// {A9E213F2-9A60-486f-BF3B-53408B6D1CBB}
DEFINE_GUID(IID_IDirectPlay8NATResolver,
0xa9e213f2, 0x9a60, 0x486f, 0xbf, 0x3b, 0x53, 0x40, 0x8b, 0x6d, 0x1c, 0xbb);
/****************************************************************************
*
* DirectPlay8 Service Provider GUIDs
*
****************************************************************************/
// {53934290-628D-11D2-AE0F-006097B01411}
DEFINE_GUID(CLSID_DP8SP_IPX,
0x53934290, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
// {6D4A3650-628D-11D2-AE0F-006097B01411}
DEFINE_GUID(CLSID_DP8SP_MODEM,
0x6d4a3650, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
// {743B5D60-628D-11D2-AE0F-006097B01411}
DEFINE_GUID(CLSID_DP8SP_SERIAL,
0x743b5d60, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
// {EBFE7BA0-628D-11D2-AE0F-006097B01411}
DEFINE_GUID(CLSID_DP8SP_TCPIP,
0xebfe7ba0, 0x628d, 0x11d2, 0xae, 0xf, 0x0, 0x60, 0x97, 0xb0, 0x14, 0x11);
// Service providers added for DirectX 9
// {995513AF-3027-4b9a-956E-C772B3F78006}
DEFINE_GUID(CLSID_DP8SP_BLUETOOTH,
0x995513af, 0x3027, 0x4b9a, 0x95, 0x6e, 0xc7, 0x72, 0xb3, 0xf7, 0x80, 0x6);
/****************************************************************************
*
* DirectPlay8 Interface Pointer definitions
*
****************************************************************************/
typedef struct IDirectPlay8Client *PDIRECTPLAY8CLIENT;
typedef struct IDirectPlay8Server *PDIRECTPLAY8SERVER;
typedef struct IDirectPlay8Peer *PDIRECTPLAY8PEER;
// Interface pointers added for DirectX 9
typedef struct IDirectPlay8ThreadPool *PDIRECTPLAY8THREADPOOL;
typedef struct IDirectPlay8NATResolver *PDIRECTPLAY8NATRESOLVER;
/****************************************************************************
*
* DirectPlay8 Forward Declarations For External Types
*
****************************************************************************/
typedef struct IDirectPlay8LobbiedApplication *PDNLOBBIEDAPPLICATION;
typedef struct IDirectPlay8Address IDirectPlay8Address;
/****************************************************************************
*
* DirectPlay8 Callback Functions
*
****************************************************************************/
//
// Callback Function Type Definition
//
typedef HRESULT (WINAPI *PFNDPNMESSAGEHANDLER)(PVOID,DWORD,PVOID);
/****************************************************************************
*
* DirectPlay8 Datatypes (Non-Structure / Non-Message)
*
****************************************************************************/
//
// Player IDs. Used to uniquely identify a player in a session
//
typedef DWORD DPNID, *PDPNID;
//
// Used as identifiers for operations
//
typedef DWORD DPNHANDLE, *PDPNHANDLE;
/****************************************************************************
*
* DirectPlay8 Message Identifiers
*
****************************************************************************/
#define DPN_MSGID_OFFSET 0xFFFF0000
#define DPN_MSGID_ADD_PLAYER_TO_GROUP ( DPN_MSGID_OFFSET | 0x0001 )
#define DPN_MSGID_APPLICATION_DESC ( DPN_MSGID_OFFSET | 0x0002 )
#define DPN_MSGID_ASYNC_OP_COMPLETE ( DPN_MSGID_OFFSET | 0x0003 )
#define DPN_MSGID_CLIENT_INFO ( DPN_MSGID_OFFSET | 0x0004 )
#define DPN_MSGID_CONNECT_COMPLETE ( DPN_MSGID_OFFSET | 0x0005 )
#define DPN_MSGID_CREATE_GROUP ( DPN_MSGID_OFFSET | 0x0006 )
#define DPN_MSGID_CREATE_PLAYER ( DPN_MSGID_OFFSET | 0x0007 )
#define DPN_MSGID_DESTROY_GROUP ( DPN_MSGID_OFFSET | 0x0008 )
#define DPN_MSGID_DESTROY_PLAYER ( DPN_MSGID_OFFSET | 0x0009 )
#define DPN_MSGID_ENUM_HOSTS_QUERY ( DPN_MSGID_OFFSET | 0x000a )
#define DPN_MSGID_ENUM_HOSTS_RESPONSE ( DPN_MSGID_OFFSET | 0x000b )
#define DPN_MSGID_GROUP_INFO ( DPN_MSGID_OFFSET | 0x000c )
#define DPN_MSGID_HOST_MIGRATE ( DPN_MSGID_OFFSET | 0x000d )
#define DPN_MSGID_INDICATE_CONNECT ( DPN_MSGID_OFFSET | 0x000e )
#define DPN_MSGID_INDICATED_CONNECT_ABORTED ( DPN_MSGID_OFFSET | 0x000f )
#define DPN_MSGID_PEER_INFO ( DPN_MSGID_OFFSET | 0x0010 )
#define DPN_MSGID_RECEIVE ( DPN_MSGID_OFFSET | 0x0011 )
#define DPN_MSGID_REMOVE_PLAYER_FROM_GROUP ( DPN_MSGID_OFFSET | 0x0012 )
#define DPN_MSGID_RETURN_BUFFER ( DPN_MSGID_OFFSET | 0x0013 )
#define DPN_MSGID_SEND_COMPLETE ( DPN_MSGID_OFFSET | 0x0014 )
#define DPN_MSGID_SERVER_INFO ( DPN_MSGID_OFFSET | 0x0015 )
#define DPN_MSGID_TERMINATE_SESSION ( DPN_MSGID_OFFSET | 0x0016 )
// Messages added for DirectX 9
#define DPN_MSGID_CREATE_THREAD ( DPN_MSGID_OFFSET | 0x0017 )
#define DPN_MSGID_DESTROY_THREAD ( DPN_MSGID_OFFSET | 0x0018 )
#define DPN_MSGID_NAT_RESOLVER_QUERY ( DPN_MSGID_OFFSET | 0x0101 )
/****************************************************************************
*
* DirectPlay8 Constants
*
****************************************************************************/
#define DPNID_ALL_PLAYERS_GROUP 0
//
// DESTROY_GROUP reasons
//
#define DPNDESTROYGROUPREASON_NORMAL 0x0001
#define DPNDESTROYGROUPREASON_AUTODESTRUCTED 0x0002
#define DPNDESTROYGROUPREASON_SESSIONTERMINATED 0x0003
//
// DESTROY_PLAYER reasons
//
#define DPNDESTROYPLAYERREASON_NORMAL 0x0001
#define DPNDESTROYPLAYERREASON_CONNECTIONLOST 0x0002
#define DPNDESTROYPLAYERREASON_SESSIONTERMINATED 0x0003
#define DPNDESTROYPLAYERREASON_HOSTDESTROYEDPLAYER 0x0004
#define DPN_MAX_APPDESC_RESERVEDDATA_SIZE 64
/****************************************************************************
*
* DirectPlay8 Flags
*
****************************************************************************/
//
// Asynchronous operation flags (for Async Ops)
//
#define DPNOP_SYNC 0x80000000
//
// Add player to group flags (for AddPlayerToGroup)
//
#define DPNADDPLAYERTOGROUP_SYNC DPNOP_SYNC
//
// Cancel flags
//
#define DPNCANCEL_CONNECT 0x00000001
#define DPNCANCEL_ENUM 0x00000002
#define DPNCANCEL_SEND 0x00000004
#define DPNCANCEL_ALL_OPERATIONS 0x00008000
// Flags added for DirectX 9
#define DPNCANCEL_PLAYER_SENDS 0x80000000
#define DPNCANCEL_PLAYER_SENDS_PRIORITY_HIGH (DPNCANCEL_PLAYER_SENDS | 0x00010000)
#define DPNCANCEL_PLAYER_SENDS_PRIORITY_NORMAL (DPNCANCEL_PLAYER_SENDS | 0x00020000)
#define DPNCANCEL_PLAYER_SENDS_PRIORITY_LOW (DPNCANCEL_PLAYER_SENDS | 0x00040000)
//
// Close flags (for Close, added for DirectX 9)
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -