3.2.5.2.2.6 INtmsMediaServices1::DecommissionNtmsMedia (Opnum 9)

The DecommissionNtmsMedia method moves media from available state to decommissioned state. Media that are decommissioned by the DecommissionNtmsMedia method are recognized by the server, but decommissioned media does not contain any data and is never again used. Only media that are in an available state can be decommissioned.

 HRESULT DecommissionNtmsMedia(
   [in] LPNTMS_GUID lpMediaId
 );

lpMediaId: A pointer to the medium identifier of the partition to be decommissioned.

Return value/code

Description

0x00000000

S_OK

The call was successful.

0x80070005

ERROR_ACCESS_DENIED

Access to the object is denied; other security errors are possible, but indicate a security subsystem error.

0x80070008

ERROR_NOT_ENOUGH_MEMORY

An allocation error occurred during processing.

0x80070057

ERROR_INVALID_PARAMETER

The parameter is not valid.

0x800710CC

ERROR_INVALID_MEDIA

The media identifier is not valid.

0x800710CE

ERROR_INVALID_MEDIA_POOL

The media pool identifier is not valid.

0x800710D9

ERROR_DATABASE_FAILURE

The database query or update failed.

0x8007139F

ERROR_INVALID_STATE

An unexpected state was encountered; might be disabled or offline.

Upon receiving this message, the server MUST verify that lpMediaId is not NULL. If it is NULL, the server MUST immediately fail the operation and return ERROR_INVALID_PARAMETER (0x80070057).

If parameter validation succeeds, the server MUST verify that the user has the required access rights. If the client does not have the required access rights, NTMS_MODIFY_ACCESS to the media is denied and the server MUST return ERROR_ACCESS_DENIED (0x80070005).

If the client has the required access rights, the server MUST verify that the media is in the NTMS_PARTSTATE_AVAILABLE state as defined in NtmsPartitionState (section 2.2.4.7). If the media is not in an available state, the server MUST return ERROR_INVALID_STATE (0x8007139F).