Platform SDK: DirectX |
The DirectPlay4.SecureOpen method creates or joins a secure session. When joining a secure session, use this method to supply logon credentials.
When creating a new session, the host computer can specify an alternate security package to use. When joining a session, a computer can specify a user name and password.
object.SecureOpen(sessionDesc DirectPlaySessionData, _ flags As CONST_DPOPENFLAGS, _ security As DPSECURITYDESC, credentials As DPCREDENTIALS))
If a session is to be created, then the application must completely initialize the DirectPlaySessionData object with the properties of the session to be created, except for the instance GUID, which DirectPlay will supply.
The DPSESSION_SECURESERVER flag must be set to indicate that all computers attempting to open the session must be authenticated. If you don't specify the DPSESSION_SECURESERVER flag, SecureOpen will open an unsecured session, just as if you had called DirectPlay4.Open.
If the method fails, an error is raised and Err.Number may be set to one of the following values:
This method returns DPERR_LOGONDENIED after being called with invalid credentials or without credentials when credentials are required. The application must collect the user's credentials and call SecureOpen again.
When joining a session, first call SecureOpen with no credentials. If the method returns DPERR_LOGONDENIED, then the application must collect the user name and password from the user and call SecureOpen again, passing in the user's credentials through the credentials parameter. If the method returns DP_OK, then the player was able to log on with the credentials he or she had specified earlier during system log-on (network log-on in NTLM).