INSSAuthenticator::Initialize

The INSSAuthenticator::Initialize method is called by the NetShow server at startup.

Syntax

HRESULT Initialize (
INSSServerContext *SvrCtx,
DWORD *dwFlags,
LPBSTR  pbstrDefaultRealm
);

Parameters

[in] SvrCtx

Specifies a pointer to the server context. The server context contains name/value pairs of information (properties) about the server. These properties can be retrieved by using the IPropertyMap interface. Properties supported for the server context include the following;

Property Name Description
NSS_SERVER_NAME A string value containing the server’s name.
NSS_VIRTUAL_SERVER_NAME A string value containing the server’s alias.
NSS_SERVER_VERSION_HI The high-order 32 bits of a 64-bit integer specifying the version of NetShow Server. The most significant 16 bits of this property indicate the version. The least significant 16 bits of this property indicate the minor version.
NSS_SERVER_VERSION_LO The low-order 32 bits of a 64-bit integer specifying the version of th NetShow Server. The most significant 16 bits of this property indicate the minor version. The least significant 16 bits of this property indicate the build number.

[out] dwFlags

Specifies a pointer to a flag indicating the format of data passed between the client, the server, and the authenticator. The value NS_TEXT_WIRE_PROTOCOL indicates that the data will be sent as a uuencoded ASCII string. Otherwise, the data is passed in binary form.

[Out] pbstrDefaultRealm

Specifies a pointer to the default realm. This realm string will be passed to the user as part of every challenge. If an authenticator always uses the same realm for user names, it should make domain\ computer-name as the default realm. Using a default realm helps to boost the performance of the server. If, on the other hand, an authenticator adopts a multi-step challenge/response scheme, this parameter should return a NULL pointer. In this case, the GetChallenge method should be used to obtain the realm each time the server challenges the client.

Return Values

This method should return S_OK upon successful completion, or an HRESULT error value.

Remarks

The default realm may be overridden through the appropriate registry key.

Additional properties can be added to the server context. The properties contained in the server context are available from the time the server starts up until it shuts down.

The following sample code demonstrates a skeletal implementation of this method:

HRESULT CSampleAuthenticator::Initialize( 
    INSSServerContext *SvrCtx,
    DWORD *dwFlags )
{
  //
  // Do authenticator initialization here.
  //
  *dwFlags = NS_TEXT_WIRE_PROTOCOL; // set for uuencoded data
  return( S_OK );
}
© 1996-1998 Microsoft Corporation. All rights reserved.