3.4.5.2.15.2 IVdsSwProvider::CreatePack (Opnum 4)

The CreatePack method creates a disk pack.

 HRESULT CreatePack(
   [out] IVdsPack** ppPack
 );

ppPack: A pointer to an IVdsPack interface that, if the operation is successfully completed, receives the IVdsPack interface of the newly created disk pack. Callers MUST release the interface when they are done with it.

Return Values: The method MUST return zero or a non-error HRESULT (as specified in [MS-ERREF]) to indicate success, or return an implementation-specific nonzero error code to indicate failure. For the HRESULT values predefined by the Virtual Disk Service Remote Protocol, see section 2.2.3.

When the server receives this message, it MUST validate the following parameter:

  • Verify that ppPack is not NULL.

The server MUST perform the following:

  • Create a new pack object that implements the IVdsPack interface and assign it a unique VDS_OBJECT_ID.

  • Set the provider pointer of the disk pack object to this provider object.

  • Add the pack object to the list of storage management objects.

  • For each callback object that is registered in the list of callback objects, call the IVdsAdviseSink::OnNotify (Opnum 3) method of the callback object with a VDS_NOTIFICATION structure that has the following attributes:

    • objectType member is VDS_NTT_PACK.

    • Pack member is a VDS_PACK_NOTIFICATION with the following attributes:

      • ulEvent is VDS_NF_PACK_ARRIVE.

      • packId is the VDS_OBJECT_ID of the pack object that was added.

  • Set the pointer that ppPack references to the IVdsPack interface of the pack object.

  • Return an HRESULT indicating failure or success.