3.2.5.2.2.5 INtmsMediaServices1::SwapNtmsMedia (Opnum 8)
The SwapNtmsMedia method swaps the position of two media sides.
-
HRESULT SwapNtmsMedia( [in] LPNTMS_GUID lpMediaId1, [in] LPNTMS_GUID lpMediaId2 );
lpMediaId1: A pointer to the identifier of a logical medium.
lpMediaId2: A pointer to the identifier of a logical medium.
-
Return value/code
Description
0x00000000
S_OK
The call was successful.
0x80070005
ERROR_ACCESS_DENIED
NTMS_MODIFY_ACCESS to the library is denied; other security errors are possible, but indicate a security subsystem error.
0x80070008
ERROR_NOT_ENOUGH_MEMORY
An allocation error occurred during processing.
0x8007000B
ERROR_BAD_FORMAT
No media label library recognizes the media label.
0x80070057
ERROR_INVALID_PARAMETER
At least one media identifier is missing.
0x800710CC
ERROR_INVALID_MEDIA
A media identifier is invalid.
0x800710CE
ERROR_INVALID_MEDIA_POOL
A media pool of the logical media is invalid.
0x800710D9
ERROR_DATABASE_FAILURE
The database is inaccessible or damaged.
0x800710DA
ERROR_DATABASE_FULL
The database is full.
Upon receiving this message, the server MUST verify that both lpMediaId1 and lpMediaId2 are not NULL. If parameter validation fails, 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, the server MUST return ERROR_ACCESS_DENIED (0x80070005).
The SwapNtmsMedia method swaps the sides that are associated with the two specified LMIDs.
If the media are not in the NTMS_PARTSTATE_ALLOCATED state of the NtmsPartitionState enumeration, the server MUST return ERROR_INVALID_STATE (0x8007139F).
The SwapNtmsMedia method MUST be implemented in such a way that it updates physical media without affecting the application. For this method to succeed, the media for both LMIDs MUST NOT be in use. If any of the media is in use, the server MUST return ERROR_INVALID_MEDIA (0x800710CC).