188.8.131.52.2.1 INtmsMediaServices1::MountNtmsMedia (Opnum 3)
The MountNtmsMedia method mounts one or more pieces of media.
HRESULT MountNtmsMedia( [in, size_is(dwCount)] LPNTMS_GUID lpMediaId, [in, out, size_is(dwCount)] LPNTMS_GUID lpDriveId, [in] DWORD dwCount, [in] DWORD dwOptions, [in] int dwPriority, [in] DWORD dwTimeout, [in, out] LPNTMS_MOUNT_INFORMATION lpMountInformation );
lpDriveId: An array of drive identifiers that correspond to the media listed in the lpMediaId parameter. This array MUST either specify a list of drives into which media will be mounted or receive the list of drives into which media will be mounted when the operation completes.
dwCount: The number of elements in the lpMediaId and lpDriveId arrays.
dwOptions: A bitmap of mount options from the NtmsMountOptions (section 184.108.40.206) enumeration.
dwPriority: A value from the NtmsMountPriority (section 220.127.116.11) enumeration specifying the priority of the mount request.
dwTimeout: The maximum time, in milliseconds, allowed for mounting of the specified media. To wait as long as the mount takes, this parameter MUST be set to 0xFFFFFFFF. If dwOptions is specified as NTMS_MOUNT_NOWAIT, ignore this value.
Use this value to wait as long as required for the mount to occur.
lpMountInformation: This parameter is currently unused. It MUST be sent as NULL and ignored on receipt.
The call was successful.
Access to an object was denied.
A allocation failure occurred during processing.
The drive identifier is not valid.
The media state is set to NTMS_PARTSTATE_COMPLETE, from the NtmsPartitionState enumeration, and the NTMS_MOUNT_WRITE value was specified.
A parameter is not valid.
The media or drives are busy.
The time-out event expired before the medium was available.
The media identifier is not valid.
The library identifier is not valid.
The specified media and drive are not in the same library.
The specified media is offline and cannot be allocated.
A resource required for this operation is disabled.
The database query or update failed.
The database is full.
The request is refused as a user canceled the request through the user interface.
The specified resource is not available.
An unexpected state was encountered.
The request was cancelled.
Upon receiving this message, the server MUST verify that dwCount is not 0, verify that lpMediaId is not NULL, and verify that lpDriveId is not NULL. If parameter validation fails, the server MUST immediately fail the operation and return ERROR_INVALID_PARAMETER (0x80070057).
The server MUST check the physical media that are specified to verify that the mount request can be fulfilled. It MUST also check the validity of the physical media to ensure that they are in valid libraries, and verify that the drive IDs passed in are valid.
If the media state is set to NTMS_PARTSTATE_COMPLETE from the NtmsPartitionState enumeration, and the NTMS_MOUNT_WRITE value was specified, the server MUST return ERROR_WRITE_PROTECT (0x80070013).
The MountNtmsMedia method queues a request to mount the specified media, then waits the number of milliseconds specified in the dwTimeout parameter for the mount to complete or for an error to be detected. If the server cannot complete the mount operation before dwTimeout expires, the server MUST cancel the request and return an error. If the specified media are in an offline library, the server MUST return ERROR_MEDIA_OFFLINE (0x800710D0). If the specified medium is in use or a drive is not available, the process blocks up to the time-out value and returns ERROR_BUSY (0x800700AA). If the NTMS_MOUNT_ERROR_NOT_AVAILABLE value is specified, the method MUST return an immediate error when a resource (medium or drive) is unavailable.
The time-out value of 0xFFFFFFFF can be used to make the method wait without timing out. When a nonzero time-out value is specified in the dwTimeout parameter, the server MUST wait for all the media that are specified in lpMediaId to become mounted. If the specified time elapses before all the media are mounted, the MountNtmsMedia method MUST return an error and cancels the request. The application can examine the status that is returned and resubmit the request, if desired.
When multiple media to be mounted are specified with a single call, all the specified media MUST be in a single library. If any of the specified media are offline, none of the media will be mounted until all the media are online.
If the specified medium is offline, the server MUST post an operator request to mount the media and the MountNtmsMedia method waits for the period of time that is specified in the dwTimeout parameter. If the wait period exceeds the parameter, the mount request is canceled, and the server MUST return ERROR_TIMEOUT (0x800705B4).
If the media cannot be mounted because either the library or media is offline and the client has specified NTMS_MOUNT_ERROR_OFFLINE in dwOptions, then the server MUST return ERROR_MEDIA_OFFLINE (0x800710D0).
If the specified medium is offline and the client has not specified NTMS_MOUNT_ERROR_OFFLINE in dwOptions, the server MUST post an operator request to mount the media and then wait for the period of time specified by the dwTimeout parameter.
If the specified medium is online, the server requests the mount.
If a drive or medium is unavailable, the server MUST send the request, and the MountNtmsMedia method waits for the period of time that is specified in the dwTimeout parameter. If the wait period exceeds the parameter, the mount request is canceled, and the server MUST return ERROR_TIMEOUT (0x800705B4).