?? directplay.pas
字號:
unit DirectPlay;
(*==========================================================================;
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: dplay.h dplobby.h
* Content: DirectPlay include files
*
* DirectX 7 Delphi adaptation by Erik Unger
*
* Modified: 13-Jan-2000
*
* Download: http://www.delphi-jedi.org/DelphiGraphics/
* E-Mail: Erik.Unger@gmx.at
*
***************************************************************************)
interface
{$MINENUMSIZE 4}
{$ALIGN ON}
uses
Windows;
var
DPlayDLL : HMODULE = 0;
(*==========================================================================;
*
* Copyright (C) 1994-1997 Microsoft Corporation. All Rights Reserved.
*
* File: dplay.h
* Content: DirectPlay include file
*
***************************************************************************)
function DPErrorString(Value: HResult) : string;
type
{$IFDEF UNICODE}
PCharAW = PWideChar;
{$ELSE}
PCharAW = PAnsiChar;
{$ENDIF}
const
// {D1EB6D20-8923-11d0-9D97-00A0C90A43CB}
CLSID_DirectPlay: TGUID =
(D1:$d1eb6d20;D2:$8923;D3:$11d0;D4:($9d,$97,$00,$a0,$c9,$a,$43,$cb));
(*
* GUIDS used by Service Providers shipped with DirectPlay
* Use these to identify Service Provider returned by EnumConnections
*)
// GUID for IPX service provider
// {685BC400-9D2C-11cf-A9CD-00AA006886E3}
DPSPGUID_IPX: TGUID =
(D1:$685bc400;D2:$9d2c;D3:$11cf;D4:($a9,$cd,$00,$aa,$00,$68,$86,$e3));
// GUID for TCP/IP service provider
// 36E95EE0-8577-11cf-960C-0080C7534E82
DPSPGUID_TCPIP: TGUID =
(D1:$36E95EE0;D2:$8577;D3:$11cf;D4:($96,$0c,$00,$80,$c7,$53,$4e,$82));
// GUID for Serial service provider
// {0F1D6860-88D9-11cf-9C4E-00A0C905425E}
DPSPGUID_SERIAL: TGUID =
(D1:$f1d6860;D2:$88d9;D3:$11cf;D4:($9c,$4e,$00,$a0,$c9,$05,$42,$5e));
// GUID for Modem service provider
// {44EAA760-CB68-11cf-9C4E-00A0C905425E}
DPSPGUID_MODEM: TGUID =
(D1:$44eaa760;D2:$cb68;D3:$11cf;D4:($9c,$4e,$00,$a0,$c9,$05,$42,$5e));
(****************************************************************************
*
* DirectPlay Structures
*
* Various structures used to invoke DirectPlay.
*
****************************************************************************)
type
(*
* TDPID
* DirectPlay player and group ID
*)
TDPID = DWORD;
PDPID = ^TDPID;
const
(*
* DPID that system messages come from
*)
DPID_SYSMSG = 0;
(*
* DPID representing all players in the session
*)
DPID_ALLPLAYERS = 0;
(*
* DPID representing the server player
*)
DPID_SERVERPLAYER = 1;
(*
* DPID representing the maximum ID in the range of DPID's reserved for
* use by DirectPlay.
*)
DPID_RESERVEDRANGE = 100;
(*
* The player ID is unknown (used with e.g. DPSESSION_NOMESSAGEID)
*)
DPID_UNKNOWN = $FFFFFFFF;
type
(*
* DPCAPS
* Used to obtain the capabilities of a DirectPlay object
*)
PDPCaps = ^TDPCaps;
TDPCaps = packed record
dwSize: DWORD; // Size of structure, in bytes
dwFlags: DWORD; // DPCAPS_xxx flags
dwMaxBufferSize: DWORD; // Maximum message size, in bytes, for this service provider
dwMaxQueueSize: DWORD; // Obsolete.
dwMaxPlayers: DWORD; // Maximum players/groups (local + remote)
dwHundredBaud: DWORD; // Bandwidth in 100 bits per second units;
// i.e. 24 is 2400, 96 is 9600, etc.
dwLatency: DWORD; // Estimated latency; 0 = unknown
dwMaxLocalPlayers: DWORD; // Maximum # of locally created players allowed
dwHeaderLength: DWORD; // Maximum header length, in bytes, on messages
// added by the service provider
dwTimeout: DWORD; // Service provider's suggested timeout value
// This is how long DirectPlay will wait for
// responses to system messages
end;
const
(*
* This DirectPlay object is the session host. If the host exits the
* session, another application will become the host and receive a
* DPSYS_HOST system message.
*)
DPCAPS_ISHOST = $00000002;
(*
* The service provider bound to this DirectPlay object can optimize
* group messaging.
*)
DPCAPS_GROUPOPTIMIZED = $00000008;
(*
* The service provider bound to this DirectPlay object can optimize
* keep alives (see DPSESSION_KEEPALIVE)
*)
DPCAPS_KEEPALIVEOPTIMIZED = $00000010;
(*
* The service provider bound to this DirectPlay object can optimize
* guaranteed message delivery.
*)
DPCAPS_GUARANTEEDOPTIMIZED = $00000020;
(*
* This DirectPlay object supports guaranteed message delivery.
*)
DPCAPS_GUARANTEEDSUPPORTED = $00000040;
(*
* This DirectPlay object supports digital signing of messages.
*)
DPCAPS_SIGNINGSUPPORTED = $00000080;
(*
* This DirectPlay object supports encryption of messages.
*)
DPCAPS_ENCRYPTIONSUPPORTED = $00000100;
(*
* This DirectPlay player was created on this machine
*)
DPPLAYERCAPS_LOCAL = $00000800;
(*
* Current Open settings supports all forms of Cancel
*)
DPCAPS_ASYNCCANCELSUPPORTED = $00001000;
(*
* Current Open settings supports CancelAll, but not Cancel
*)
DPCAPS_ASYNCCANCELALLSUPPORTED = $00002000;
(*
* Current Open settings supports Send Timeouts for sends
*)
DPCAPS_SENDTIMEOUTSUPPORTED = $00004000;
(*
* Current Open settings supports send priority
*)
DPCAPS_SENDPRIORITYSUPPORTED = $00008000;
(*
* Current Open settings supports DPSEND_ASYNC flag
*)
DPCAPS_ASYNCSUPPORTED = $00010000;
type
(*
* TDPSessionDesc2
* Used to describe the properties of a DirectPlay
* session instance
*)
PDPSessionDesc2 = ^TDPSessionDesc2;
TDPSessionDesc2 = packed record
dwSize: DWORD; // Size of structure
dwFlags: DWORD; // DPSESSION_xxx flags
guidInstance: TGUID; // ID for the session instance
guidApplication: TGUID; // GUID of the DirectPlay application.
// GUID_NULL for all applications.
dwMaxPlayers: DWORD; // Maximum # players allowed in session
dwCurrentPlayers: DWORD; // Current # players in session (read only)
case integer of
0 : (
lpszSessionName: PCharAW; // Name of the session
lpszPassword: PCharAW; // Password of the session (optional)
dwReserved1: DWORD; // Reserved for future MS use.
dwReserved2: DWORD;
dwUser1: DWORD; // For use by the application
dwUser2: DWORD;
dwUser3: DWORD;
dwUser4: DWORD;
);
1 : (
lpszSessionNameA: PAnsiChar; // Name of the session
lpszPasswordA: PAnsiChar // Password of the session (optional)
);
2 : (
lpszSessionNameW: PWideChar;
lpszPasswordW: PWideChar
);
end;
const
(*
* Applications cannot create new players in this session.
*)
DPSESSION_NEWPLAYERSDISABLED = $00000001;
(*
* If the DirectPlay object that created the session, the host,
* quits, then the host will attempt to migrate to another
* DirectPlay object so that new players can continue to be created
* and new applications can join the session.
*)
DPSESSION_MIGRATEHOST = $00000004;
(*
* This flag tells DirectPlay not to set the idPlayerTo and idPlayerFrom
* fields in player messages. This cuts two DWORD's off the message
* overhead.
*)
DPSESSION_NOMESSAGEID = $00000008;
(*
* This flag tells DirectPlay to not allow any new applications to
* join the session. Applications already in the session can still
* create new players.
*)
DPSESSION_JOINDISABLED = $00000020;
(*
* This flag tells DirectPlay to detect when remote players
* exit abnormally (e.g. their computer or modem gets unplugged)
*)
DPSESSION_KEEPALIVE = $00000040;
(*
* This flag tells DirectPlay not to send a message to all players
* when a players remote data changes
*)
DPSESSION_NODATAMESSAGES = $00000080;
(*
* This flag indicates that the session belongs to a secure server
* and needs user authentication
*)
DPSESSION_SECURESERVER = $00000100;
(*
* This flag indicates that the session is private and requirs a password
* for EnumSessions as well as Open.
*)
DPSESSION_PRIVATE = $00000200;
(*
* This flag indicates that the session requires a password for joining.
*)
DPSESSION_PASSWORDREQUIRED = $00000400;
(*
* This flag tells DirectPlay to route all messages through the server
*)
DPSESSION_MULTICASTSERVER = $00000800;
(*
* This flag tells DirectPlay to only download information about the
* DPPLAYER_SERVERPLAYER.
*)
DPSESSION_CLIENTSERVER = $00001000;
(*
* This flag tells DirectPlay to use the protocol built into dplay
* for reliability and statistics all the time. When this bit is
* set, only other sessions with this bit set can join or be joined.
*)
DPSESSION_DIRECTPLAYPROTOCOL = $00002000;
(*
* This flag tells DirectPlay that preserving order of received
* packets is not important, when using reliable delivery. This
* will allow messages to be indicated out of order if preceding
* messages have not yet arrived. Otherwise DPLAY will wait for
* earlier messages before delivering later reliable messages.
*)
DPSESSION_NOPRESERVEORDER = $00004000;
(*
* This flag tells DirectPlay to optimize communication for latency
*)
DPSESSION_OPTIMIZELATENCY = $00008000;
type
(*
* TDPName
* Used to hold the name of a DirectPlay entity
* like a player or a group
*)
PDPName = ^TDPName;
TDPName = packed record
dwSize: DWORD; // Size of structure
dwFlags: DWORD; // Not used. Must be zero.
case Integer of
0 : (
lpszShortName : PCharAW; // The short or friendly name
lpszLongName : PCharAW; // The long or formal name
);
1 : (
lpszShortNameA : PAnsiChar;
lpszLongNameA : PAnsiChar;
);
2 : (
lpszShortNameW : PWideChar;
lpszLongNameW : PWideChar;
);
end;
(*
* TDPCredentials
* Used to hold the user name and password of a DirectPlay user
*)
PDPCredentials = ^TDPCredentials;
TDPCredentials = packed record
dwSize: DWORD; // Size of structure
dwFlags: DWORD; // Not used. Must be zero.
case Integer of
0 : (
lpszUsername: PCharAW; // User name of the account
lpszPassword: PCharAW; // Password of the account
lpszDomain: PCharAW; // Domain name of the account
);
1 : (
lpszUsernameA: PAnsiChar; // User name of the account
lpszPasswordA: PAnsiChar; // Password of the account
lpszDomainA: PAnsiChar; // Domain name of the account
);
2 : (
lpszUsernameW: PWideChar; // User name of the account
lpszPasswordW: PWideChar; // Password of the account
lpszDomainW: PWideChar; // Domain name of the account
);
end;
(*
* TDPSecurityDesc
* Used to describe the security properties of a DirectPlay
* session instance
*)
PDPSecurityDesc = ^TDPSecurityDesc;
TDPSecurityDesc = packed record
dwSize: DWORD; // Size of structure
dwFlags: DWORD; // Not used. Must be zero.
case Integer of
0 : (
lpszSSPIProvider : PCharAW; // SSPI provider name
lpszCAPIProvider : PCharAW; // CAPI provider name
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -