Microsoft DirectX 8.1 (Visual Basic)

DirectPlay8Client.EnumHosts

Enumerates applications that host Microsoft® DirectPlay® games. When an application is found meeting the enumeration criteria, the DirectPlay8Event.EnumHostsResponse method is called in the application's message handler. This method contains a DPNMSG_ENUM_HOSTS_RESPONSE message type that contains a DPN_APPLICATION_DESC type that describes the applications found.

EnumHosts(ApplicationDesc As DPN_APPLICATION_DESC, _
    AddrHost As DirectPlay8Address, _
    DeviceInfo As DirectPlay8Address, _
    lRetryCount As Long, _
    lRetryInterval As Long, _
    lTimeOut As Long, _
    lFlags As  CONST_DPNOPERATIONS, _
    UserData As Any, _
    UserDataSize As Long) As Long

Parts

ApplicationDesc
DPN_APPLICATION_DESC structure that specifies which application hosts to enumerate. You can specify the following fields to reduce the number of responses to the enumeration.
guidApplication
GUID of the application to find; if not specified, all are searched for.
Password
Password to provide; secure sessions will not respond without a password.
AddrHost
DirectPlay8Address object that specifies the address of the computer that is hosting the application.
DeviceInfo
DirectPlay8Address object that specifies the service provider and settings to enumerate.
lRetryCount
Value that specifies how many times the enumeration data will be sent. You can set this parameter to zero to specify the default value. If you set this value to INFINITE, the enumeration will continue until canceled.
lRetryInterval
Value that specifies the time, in milliseconds, between successive enumeration attempts. Set this parameter to 0 to use the default value.
lTimeOut
Number of milliseconds for the enumeration to run. If 0 is specified, a default value is used. If INFINITE is specified, the enumeration continues until it is canceled.
lEnumPeriod
Value specifying how often to re-enumerate. If 0 is specified, a default value is used.
lFlags
Flag from the CONST_DPNOPERATIONS enumeration that controls how this method is processed. The following flag can be set for this method.
DPNOP_SYNC
Causes the method to process synchronously.
UserData
Block of data that is sent in the enumeration request to the host. The size of the data can be limited depending on the network type, but 512 bytes is supported at a minimum.
UserDataSize
Size of the data in the UserData parameter.

Return Values

Returns the asynchronous handle for this operation. This is the handle that is used in lAsyncHandle parameter of the DirectPlay8Client.CancelAsyncOperation method to cancel the request, if the request is processed asynchronously.

Error Codes

If the method fails, Err.Number can be set to one of the following values.

DPNERR_TIMEDOUT
DPNERR_INVALIDFLAGS
DPNERR_INVALIDPARAM

Remarks

Because of the variety of ways enumeration can happen, it is not recommended that an application specify lEnumPeriod unless the application has some specific media knowledge.