⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 directplay8.pas

📁 3D GameStudio 的Delphi开发包
💻 PAS
📖 第 1 页 / 共 5 页
字号:
    pvGroupContext: Pointer;    // Group context value
  end;
  {$EXTERNALSYM _DPNMSG_GROUP_INFO}
  DPNMSG_GROUP_INFO = _DPNMSG_GROUP_INFO;
  {$EXTERNALSYM DPNMSG_GROUP_INFO}
  TDPNMsgGroupInfo = _DPNMSG_GROUP_INFO;

  //
  // Migrate host structure for message handler
  // (DPN_MSGID_HOST_MIGRATE)
  //
  PDPNMsgHostMigrate = ^TDPNMsgHostMigrate;
  _DPNMSG_HOST_MIGRATE = packed record
    dwSize: DWORD;             // Size of this structure
    dpnidNewHost: TDPNID;      // DPNID of new Host player
    pvPlayerContext: Pointer;  // Player context value
  end;
  {$EXTERNALSYM _DPNMSG_HOST_MIGRATE}
  DPNMSG_HOST_MIGRATE = _DPNMSG_HOST_MIGRATE;
  {$EXTERNALSYM DPNMSG_HOST_MIGRATE}
  TDPNMsgHostMigrate = _DPNMSG_HOST_MIGRATE;

  //
  // Indicate connect structure for message handler
  // (DPN_MSGID_INDICATE_CONNECT)
  //
  PDPNMsgIndicateConnect = ^TDPNMsgIndicateConnect;
  _DPNMSG_INDICATE_CONNECT = packed record
    dwSize: DWORD;                        // Size of this structure
    pvUserConnectData: Pointer;           // Connecting player data
    dwUserConnectDataSize: DWORD;         // Size (in bytes) of pvUserConnectData
    pvReplyData: Pointer;                 // Connection reply data
    dwReplyDataSize: DWORD;               // Size (in bytes) of pvReplyData
    pvReplyContext: Pointer;              // Buffer context for pvReplyData
    pvPlayerContext: Pointer;             // Player context preset
    pAddressPlayer: IDirectPlay8Address;  // Address of connecting player
    pAddressDevice: IDirectPlay8Address;  // Address of device receiving connect attempt
  end;
  {$EXTERNALSYM _DPNMSG_INDICATE_CONNECT}
  DPNMSG_INDICATE_CONNECT = _DPNMSG_INDICATE_CONNECT;
  {$EXTERNALSYM DPNMSG_INDICATE_CONNECT}
  TDPNMsgIndicateConnect = _DPNMSG_INDICATE_CONNECT;

  //
  // Indicated connect aborted structure for message handler
  // (DPN_MSGID_INDICATED_CONNECT_ABORTED)
  //
  PDPNMsgIndicatedConnectAborted = ^TDPNMsgIndicatedConnectAborted;
  _DPNMSG_INDICATED_CONNECT_ABORTED = packed record
    dwSize: DWORD;            // Size of this structure
    pvPlayerContext: Pointer; // Player context preset from DPNMSG_INDICATE_CONNECT
  end;
  {$EXTERNALSYM _DPNMSG_INDICATED_CONNECT_ABORTED}
  DPNMSG_INDICATED_CONNECT_ABORTED = _DPNMSG_INDICATED_CONNECT_ABORTED;
  {$EXTERNALSYM DPNMSG_INDICATED_CONNECT_ABORTED}
  TDPNMsgIndicatedConnectAborted = _DPNMSG_INDICATED_CONNECT_ABORTED;

  //
  // Peer info structure for message handler
  // (DPN_MSGID_PEER_INFO)
  //
  PDPNMsgPeerInfo = ^TDPNMsgPeerInfo;
  _DPNMSG_PEER_INFO = packed record
    dwSize: DWORD;              // Size of this structure
    dpnidPeer: TDPNID;          // DPNID of peer
    pvPlayerContext: Pointer;   // Player context value
  end;
  {$EXTERNALSYM _DPNMSG_PEER_INFO}
  DPNMSG_PEER_INFO = _DPNMSG_PEER_INFO;
  {$EXTERNALSYM DPNMSG_PEER_INFO}
  TDPNMsgPeerInfo = _DPNMSG_PEER_INFO;

  //
  // Receive structure for message handler
  // (DPN_MSGID_RECEIVE)
  //
  PDPNMsgReceive = ^TDPNMsgReceive;
  _DPNMSG_RECEIVE = packed record
    dwSize: DWORD;             // Size of this structure
    dpnidSender: TDPNID;       // DPNID of sending player
    pvPlayerContext: Pointer;  // Player context value of sending player
    pReceiveData: PByte;       // Received data
    dwReceiveDataSize: DWORD;  // Size (in bytes) of pReceiveData
    hBufferHandle: TDPNHandle; // Buffer handle for pReceiveData

    // Fields added for DirectX 9
    dwReceiveFlags: DWORD;     // Flags describing how message was received
  end;
  {$EXTERNALSYM _DPNMSG_RECEIVE}
  DPNMSG_RECEIVE = _DPNMSG_RECEIVE;
  {$EXTERNALSYM DPNMSG_RECEIVE}
  TDPNMsgReceive = _DPNMSG_RECEIVE;

  //
  // Remove player from group structure for message handler
  // (DPN_MSGID_REMOVE_PLAYER_FROM_GROUP)
  //
  PDPNMsgRemovePlayerFromGroup = ^TDPNMsgRemovePlayerFromGroup;
  _DPNMSG_REMOVE_PLAYER_FROM_GROUP = packed record
    dwSize: DWORD;               // Size of this structure
    dpnidGroup: TDPNID;          // DPNID of group
    pvGroupContext: Pointer;     // Group context value
    dpnidPlayer: TDPNID;         // DPNID of deleted player
    pvPlayerContext: Pointer;    // Player context value
  end;
  {$EXTERNALSYM _DPNMSG_REMOVE_PLAYER_FROM_GROUP}
  DPNMSG_REMOVE_PLAYER_FROM_GROUP = _DPNMSG_REMOVE_PLAYER_FROM_GROUP;
  {$EXTERNALSYM DPNMSG_REMOVE_PLAYER_FROM_GROUP}
  TDPNMsgRemovePlayerFromGroup = _DPNMSG_REMOVE_PLAYER_FROM_GROUP;

  //
  // Returned buffer structure for message handler
  // (DPN_MSGID_RETURN_BUFFER)
  //
  PDPNMsgReturnBuffer = ^TDPNMsgReturnBuffer;
  _DPNMSG_RETURN_BUFFER = packed record
    dwSize: DWORD;          // Size of this structure
    hResultCode: HRESULT;   // Return value of operation
    pvBuffer: Pointer;      // Buffer being returned
    pvUserContext: Pointer; // Context associated with buffer
  end;
  {$EXTERNALSYM _DPNMSG_RETURN_BUFFER}
  DPNMSG_RETURN_BUFFER = _DPNMSG_RETURN_BUFFER;
  {$EXTERNALSYM DPNMSG_RETURN_BUFFER}
  TDPNMsgReturnBuffer = _DPNMSG_RETURN_BUFFER;

  //
  // Send complete structure for message handler
  // (DPN_MSGID_SEND_COMPLETE)
  //
  PDPNMsgSendComplete = ^TDPNMsgSendComplete;
  _DPNMSG_SEND_COMPLETE = packed record
    dwSize: DWORD;          // Size of this structure
    hAsyncOp: TDPNHandle;   // DirectPlay8 Async operation handle
    pvUserContext: Pointer; // User context supplied at Send/SendTo
    hResultCode: HRESULT;   // HRESULT of send
    dwSendTime: DWORD;      // Send time in ms

    // Fields added for DirectX 9
    dwFirstFrameRTT: DWORD;		// RTT of the first frame in the message
    dwFirstFrameRetryCount: DWORD;	// Retry count of the first frame
    dwSendCompleteFlags: DWORD;	// Flags describing how message was sent
    pBuffers: PDPNBufferDesc;				// Pointer to array of buffers sent, if DirectPlay did not make a copy
    dwNumBuffers: DWORD;			// Number of buffers in previous array
  end;
  {$EXTERNALSYM _DPNMSG_SEND_COMPLETE}
  DPNMSG_SEND_COMPLETE = _DPNMSG_SEND_COMPLETE;
  {$EXTERNALSYM DPNMSG_SEND_COMPLETE}
  TDPNMsgSendComplete = _DPNMSG_SEND_COMPLETE;

  //
  // Server info structure for message handler
  // (DPN_MSGID_SERVER_INFO)
  //
  PDPNMsgServerInfo = ^TDPNMsgServerInfo;
  _DPNMSG_SERVER_INFO = packed record
    dwSize: DWORD;              // Size of this structure
    dpnidServer: TDPNID;        // DPNID of server
    pvPlayerContext: Pointer;   // Player context value
  end;
  {$EXTERNALSYM _DPNMSG_SERVER_INFO}
  DPNMSG_SERVER_INFO = _DPNMSG_SERVER_INFO;
  {$EXTERNALSYM DPNMSG_SERVER_INFO}
  TDPNMsgServerInfo = _DPNMSG_SERVER_INFO;

  //
  // Terminated session structure for message handler
  // (DPN_MSGID_TERMINATE_SESSION)
  //
  PDPNMsgTerminateSession = ^TDPNMsgTerminateSession;
  _DPNMSG_TERMINATE_SESSION = packed record
    dwSize: DWORD;              // Size of this structure
    hResultCode: HRESULT;       // Reason
    pvTerminateData: Pointer;   // Data passed from Host/Server
    dwTerminateDataSize: DWORD; // Size (in bytes) of pvTerminateData
  end;
  {$EXTERNALSYM _DPNMSG_TERMINATE_SESSION}
  DPNMSG_TERMINATE_SESSION = _DPNMSG_TERMINATE_SESSION;
  {$EXTERNALSYM DPNMSG_TERMINATE_SESSION}
  TDPNMsgTerminateSession = _DPNMSG_TERMINATE_SESSION;

  //
  // Message structures added for DirectX 9
  //

  //
  // Create thread info structure for message handler
  // (DPN_MSGID_CREATE_THREAD)
  //
  PDPNMsgCreateThread = ^TDPNMsgCreateThread;
  _DPNMSG_CREATE_THREAD = packed record
    dwSize: DWORD;				// Size of this structure
    dwFlags: DWORD;			// Flags describing this thread
    dwProcessorNum: DWORD;		// Index of processor to which thread is bound
    pvUserContext: Pointer;		// Thread context value
  end;
  {$EXTERNALSYM _DPNMSG_CREATE_THREAD}
  DPNMSG_CREATE_THREAD = _DPNMSG_CREATE_THREAD;
  {$EXTERNALSYM DPNMSG_CREATE_THREAD}
  TDPNMsgCreateThread = _DPNMSG_CREATE_THREAD;

  //
  // Destroy thread info structure for message handler
  // (DPN_MSGID_DESTROY_THREAD)
  //
  PDPNMsgDestroyThread = ^TDPNMsgDestroyThread;
  _DPNMSG_DESTROY_THREAD = packed record
    dwSize:	DWORD;				// Size of this structure
    dwProcessorNum:	DWORD;		// Index of processor to which thread was bound
    pvUserContext:	Pointer;		// Thread context value
  end;
  {$EXTERNALSYM _DPNMSG_DESTROY_THREAD}
  DPNMSG_DESTROY_THREAD = _DPNMSG_DESTROY_THREAD;
  {$EXTERNALSYM DPNMSG_DESTROY_THREAD}
  TDPNMsgDestroyThread = _DPNMSG_DESTROY_THREAD;


  //
  // Query-to-resolve-NAT-address structure for message handler
  // (DPN_MSGID_NAT_RESOLVER_QUERY)
  //
  PDPNMsgNatResolverQuery = ^TDPNMsgNatResolverQuery;
  _DPNMSG_NAT_RESOLVER_QUERY = packed record
    dwSize: DWORD;				// Size of this structure.
    pAddressSender: IDirectPlay8Address;	// Address of client that sent the query
    pAddressDevice: IDirectPlay8Address;	// Address of device on which query was received
    pwszUserString: PWideChar;	// User specified string, or NULL if none
  end;
  {$EXTERNALSYM _DPNMSG_NAT_RESOLVER_QUERY}
  DPNMSG_NAT_RESOLVER_QUERY = _DPNMSG_NAT_RESOLVER_QUERY;
  {$EXTERNALSYM DPNMSG_NAT_RESOLVER_QUERY}
  TDPNMsgNatResolverQuery = _DPNMSG_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 GUID * pcIID, void **ppvInterface, IUnknown *pUnknown);
 *
 *)
 

(****************************************************************************
 *
 * DirectPlay8Lobby Interface Pointer
 *
 ****************************************************************************)

  IDirectPlay8LobbiedApplication = interface;

(****************************************************************************
 *
 * DirectPlay8 Application Interfaces
 *
 ****************************************************************************)

  //
  // COM definition for DirectPlay8 Client interface
  //
  {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8Client);'}
  {$EXTERNALSYM IDirectPlay8Client}
  IDirectPlay8Client = interface(IUnknown)
    ['{5102dacd-241b-11d3-aea7-006097b01411}']
    (*** IDirectPlay8Client methods ***)
    function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; dwFlags: DWORD): HResult; stdcall;
    function EnumServiceProviders(pguidServiceProvider, pguidApplication: PGUID;
      pSPInfoBuffer: PDPNServiceProviderInfo; out pcbEnumData, pcReturned: DWORD;
      dwFlags: DWORD): HResult; stdcall;
    function EnumHosts(const pApplicationDesc: TDPNApplicationDesc;
      pAddrHost, pDeviceInfo: IDirectPlay8Address; pUserEnumData: Pointer;
      dwUserEnumDataSize, dwEnumCount, dwRetryInterval, dwTimeOut: DWORD;
      pvUserContext: Pointer; pAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
    function CancelAsyncOperation(hAsyncHandle: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
    function Connect(const pdnAppDesc: TDPNApplicationDesc;
      pHostAddr: IDirectPlay8Address; pDeviceInfo: IDirectPlay8Address;
      pdnSecurity: PDPNSecurityDesc; pdnCredentials: PDPNSecurityCredentials;
      pvUserConnectData: Pointer; dwUserConnectDataSize: DWORD; pvAsyncContext: Pointer;
      phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
    function Send(const prgBufferDesc: TDPNBufferDesc; cBufferDesc, dwTimeOut: DWORD;
      pvAsyncContext: Pointer; phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
    function GetSendQueueInfo(pdwNumMsgs, pdwNumBytes: PDWORD; dwFlags: DWORD): HResult; stdcall;
    function GetApplicationDesc(pAppDescBuffer: PDPNApplicationDesc; var pcbDataSize: DWORD; dwFlags: DWORD): HResult; stdcall;
    function SetClientInfo(const pdpnPlayerInfo: TDPNPlayerInfo; pvAsyncContext: Pointer;
      phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
    function GetServerInfo(pdpnPlayerInfo: PDPNPlayerInfo; var pdwSize: DWORD; dwFlags: DWORD): HResult; stdcall;
    function GetServerAddress(out pAddress: IDirectPlay8Address; dwFlags: DWORD): HResult; stdcall;
    function Close(dwFlags: DWORD): HResult; stdcall;
    function ReturnBuffer(hBufferHandle: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
    function GetCaps(pdpCaps: PDPNCaps; dwFlags: DWORD): HResult; stdcall; //Translator: pdpCaps can be either PDPNCaps or PDPNCapsEx
    function SetCaps(pdpCaps: PDPNCaps; dwFlags: DWORD): HResult; stdcall; //Translator: pdpCaps can be either PDPNCaps or PDPNCapsEx
    function SetSPCaps(const pguidSP: TGUID; const pdpspCaps: TDPNSpCaps; dwFlags: DWORD): HResult; stdcall;
    function GetSPCaps(const pguidSP: TGUID; var pdpspCaps: TDPNSpCaps; dwFlags: DWORD): HResult; stdcall;
    function GetConnectionInfo(var pdpConnectionInfo: TDPNConnectionInfo; dwFlags: DWORD): HResult; stdcall;
    function RegisterLobby(dpnHandle: TDPNHandle; pIDP8LobbiedApplication: IDirectPlay8LobbiedApplication; dwFlags: DWORD): HResult; stdcall;
  end;

  //
  // COM definition for DirectPlay8 Server interface
  //
  {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectPlay8Server);'}
  {$EXTERNALSYM IDirectPlay8Server}
  IDirectPlay8Server = interface(IUnknown)
    ['{5102dace-241b-11d3-aea7-006097b01411}']
    (*** IDirectPlay8Server methods ***)
    function Initialize(pvUserContext: Pointer; pfn: TFNDPNMessageHandler; dwFlags: DWORD): HResult; stdcall;
    function EnumServiceProviders(pguidServiceProvider, pguidApplication: PGUID;
      pSPInfoBuffer: PDPNServiceProviderInfo; out pcbEnumData, pcReturned: DWORD;
      dwFlags: DWORD): HResult; stdcall;
    function CancelAsyncOperation(hAsyncHandle: TDPNHandle; dwFlags: DWORD): HResult; stdcall;
    function GetSendQueueInfo(dpnid: TDPNID; pdwNumMsgs, pdwNumBytes: PDWORD; dwFlags: DWORD): HResult; stdcall;
    function GetApplicationDesc(pAppDescBuffer: PDPNApplicationDesc; var pcbDataSize: DWORD; dwFlags: DWORD): HResult; stdcall;
    function SetServerInfo(pdpnPlayerInfo: PDPNPlayerInfo; pvAsyncContext: Pointer; phAsyncHandle: PDPNHandle; dwFlags: DWORD): HResult; stdcall;
    function GetClientInfo(dpnid: TDPNID; pdpnPlayerInfo: PDPNPlayerInfo; pdwSize: PDWORD; dwFlags: DWORD): HResult; stdcall;
    function GetClientAddress(dpnid: TDPNID; out pAddress: IDirectPlay8Address; dwFlags: DWORD): HResult; stdcall;
    function GetLocalHostAddresses(out prgpAddress: IDirectPlay8Address; var pcAddress: DWORD; dwFlags: DWORD): HResult; stdcall;
    function SetApplicationDesc(const pad: TDPNApplicationDesc; dwFlags: DWORD): HResult; stdcall;
    function Host(const pdnAppDesc: TDPNApplicationDesc; prgpDeviceInfo: PIDirectPlay8Address;
      cDeviceInfo: DWORD; pdnSecurity: PDPNSecurityDesc; pdnCredentials: PDPNSecurityCredentials;
      pvPlayerContext: Pointer; dwFlags: DWORD): HResult; stdcall;
    function SendTo(dpnid: TDPNID; const prgBufferDesc: TDPNBufferDesc; cBufferDesc, dwTimeOut: DWORD;
      pvAsyncContext: Pointer; phAsyncHandle: PDPNHandle; dwFlags

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -