3.1.4.4.3 ChangeDiffAreaMaximumSize (Opnum 4)

The ChangeDiffAreaMaximumSize method changes the maximum size of a shadow copy storage association on the server.

 HRESULT ChangeDiffAreaMaximumSize(
   [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 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

0x80042308

VSS_E_OBJECT_NOT_FOUND

The object does not exist on the server.

0x80070057

E_INVALIDARG

Returned when pwszVolumeName or pwszDiffAreaVolume is NULL.

0x8004231d

VSS_E_VOLUME_IN_USE

Returned when llMaximumDiffSpace is zero, and the diff area cannot be deleted because shadow copies are still being stored.

0x8004231f

VSS_E_INSUFFICIENT_STORAGE

Returned if a nonzero size is specified in llMaximumDiffSpace that is smaller than the size required for storing a single shadow copy.

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 [MS-RPCE].

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

  • The pwszVolumeName parameter is not NULL.

  • The pwszDiffAreaVolumeNAme parameter is not NULL.

The server MUST locate the shadow copy storage association that is specified by the pwszVolumeName and pwszDiffAreaVolumeName parameters, modify the maximum size property to match the specified value, and persist this change on the server. If the server receives the value of zero for the llMaximumDiffSpace parameter, the server MUST interpret this as a request to delete the shadow copy storage association. If the shadow copy storage association is actively in use to store shadow copies, the server MUST fail the deletion request by using an implementation-specific nonzero error code or an error code from the previous table. If the shadow copy storage association cannot be found, the server MUST fail with an implementation-specific nonzero error code or an error code from the previous table.