3.1.4.4.2 AddDiffArea (Opnum 3)

The AddDiffArea method creates a shadow copy storage association for a shadow copy.

 HRESULT AddDiffArea(
   [in] VSS_PWSZ pwszVolumeName,
   [in] VSS_PWSZ pwszDiffAreaVolumeName,
   [in] LONGLONG llMaximumDiffSpace
 );

pwszVolumeName:  A null-terminated UNICODE string that contains the drive letter, mount point, or volume mount name of the volume for which the shadow copy is made. This is the original volume.

pwszDiffAreaVolumeName: A null-terminated UNICODE string that contains the drive letter, mount point, or volume mount name of the volume on which the shadow copy storage is located for the volume that is specified in pwszVolumeName. This is the shadow copy storage volume.

llMaximumDiffSpace: The maximum number of BYTEs that the shadow copy storage will occupy. The server MAY automatically delete shadow copies based on an implementation-specific algorithm that reclaims space for newer shadow copies.

Return Values: The method MUST return the following error code for the specific conditions.

Return value/code

Description

0x8004230d 

VSS_E_OBJECT_ALREADY_EXISTS

The object already exists on the server.

0x80070057

E_INVALIDARG

R returned when pwszVolumeName or pwszDiffAreaVolumeName is NULL, or if llMaximumDiffSpace is 0.

0x8004230c

VSS_E_VOLUME_NOT_SUPPORTED

Returned when the pwszVolumeName does not support shadow copies, or pwszDiffAreaVolumeName does not support shadow copy storage.

0x8004231e

VSS_E_MAXIMUM_DIFF-AREA_ASSOCIATIONS_REACHED

Returned when the maximum number of diff area associations for pwszVolumeName has been reached.

0x80042306

VSS_E_PROVIDER_VETO

Returned when the snapshot provider receives an expected error and tries to veto the impending operation.

0x80070005

E_ACCESSDENIED

Returned when the user making the request does not have sufficient privileges to perform the operation.

For any other conditions, the method MUST return zero when it has succeeded or an implementation-specific nonzero error code on failure.

No exceptions are thrown except those that are thrown by the underlying RPC protocol specified in [MS-RPCE].

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

  • The pwszVolumeName parameter is not NULL.

  • The volume that is contained in the pwszVolumeName parameter supports shadow copies.

  • The pwszDiffAreaVolumeName parameter is not NULL.

  • The volume that is contained in the pwszDiffAreaVolumeName parameter supports shadow copy storage.

  • The llMaximumDiffSpace parameter is greater than zero.

The server MUST create a new shadow copy storage association that has the specified maximum size property in the server abstract model or return an implementation-specific nonzero error code or an error code from the preceding table.