3.2.4.4.1.54 IVolumeClient::Initialize (Opnum 71)

The Initialize method initializes the dialog between the client and the server.

 HRESULT Initialize(
   [in] IUnknown* notificationInterface,
   [out] unsigned long* ulIDLVersion,
   [out] DWORD* pdwFlags,
   [out] LdmObjectId* clientId,
   [in] unsigned long cRemote
 );

notificationInterface: Pointer to the client's IUnknown interface from which the server can query the IDMNotify interface used for sending notifications to the client.

ulIDLVersion:  The value of LDM_IDL_VERSION found in the IDL file with which the server was built.<180>

pdwFlags: Bitmap of information flags about the server. The value of this field is generated by combining zero or more of the following applicable flags with a logical OR operation.

Value

Meaning

SYSFLAG_SERVER

0x00000001

Server is running on Windows 2000 Server operating system and Windows Server 2003 operating system.

SYSFLAG_ALPHA

0x00000002

Server is running on an Alpha processor.<181>

SYSFLAG_SYSPART_SECURE

0x00000004

System partition for the server is secure.<182>

SYSFLAG_NEC_98

0x00000008

Server is an NEC 98 computer, which supports assignment of drive letters A and B to partitions or volumes.<183>

SYSFLAG_LAPTOP

0x00000010

Server is a laptop and does not support dynamic disks.

SYSFLAG_WOLFPACK

0x00000020

Server is running on a Microsoft Cluster Server (MSCS) cluster.

clientId: Pointer to the client's OID.

cRemote: If set to 0, indicates that the client is on the same machine as the server. If nonzero, the client is on a different machine than the server.

Return Values: The method MUST return 0 or a nonerror HRESULT on success, or an implementation-specific nonzero error code on failure (as specified in [MS-ERREF]; see also section 2.2.1 for HRESULT values predefined by the Disk Management Remote Protocol).

This is the first protocol message that a client sends to the server. Other protocol messages that are sent prior to this one MAY be ignored by the server.<184>

After the server receives this message, it MUST validate the parameters:

  1. Verify that notificationInterface is not NULL.

  2. Verify that ulIDLVersion is not NULL.

  3. Verify that pdwFlags is not NULL.

  4. Verify that clientId is not NULL.

  5. Verify that the client has not previously called the Initialize method.

If parameter validation fails, the server MUST immediately fail the operation, returning an appropriate error as its response to the client.

Otherwise, the server MUST process the message as follows:

  1. Add the client object to the list of clients that are connected to the server:

    • Generate a new unique identifier for the client and save it in the id field of the client object. If the cRemote parameter is nonzero, the server MUST be ready to send notifications to the remote client.

    • Reference and save the pointer to the IDMNotify interface that is specified by notificationInterface in the notifyInterface field of the client object.<185>

  2. If successful, the identifier of the new client MUST be returned in the output parameter clientId.

  3. If successful, the value of LDM_IDL_VERSION found in the IDL file with which the server was built MUST be returned in the output parameter ulIDLVersion.

  4. If successful, a bitmap of flags that contain information about the server MUST be returned in the output parameter pdwFlags.

  5. Return a response to the client that contains the output parameters previously mentioned and the status of the operation.

After the client object is added to the list of clients that are connected to the server, the server MUST be ready to receive and process any protocol messages from that client and send notifications to the client.