网站首页  词典首页

请输入您要查询的函数:

 

术语 mountntmsmedia
释义 MountNtmsMedia
语法:
C++
DWORD MountNtmsMedia(
__in HANDLE hSession,
__in LPNTMS_GUID lpMediaId,
__inout LPNTMS_GUID lpDriveId,
__in DWORD dwCount,
__in DWORD dwOptions,
__in DWORD dwPriority,
__in DWORD dwTimeout,
LPNTMS_MOUNT_INFORMATION lpMountInformation
);
MountNtmsMedia功能
[移动存储管理不再作为Windows 7和Windows服务器2008 R2提供。]
同步函数的MountNtmsMedia坐骑一个或多个媒体件。
参数
hSession [in]
处理由OpenNtmsSession函数返回的会议。
lpMediaId [in]
阵列的逻辑媒体或双方唯一标识符。
lpDriveId [ in , out ]
阵列的驱动器标识符对应的媒体在lpMediaId参数列表。这个数组或者指定一个驱动器列表中装入的媒体或接收到的驱动器列表中,媒体分为上操作完成安装。见NTMS_MOUNT_SPECIFIC_DRIVE值如下。如果MountNtmsMedia功能超时之前的安装完成后,罗申不返回驱动器列表中。
dwCount [in]
数媒体标识符和lpMediaId和lpDriveId参数来传递驱动器标识符。请注意,lpMediaId和lpDriveId必须指向平等长数组的第一个元素。
dwOptions [in]
选项。此参数可以是一个或多个下列值。
ValueMeaning
NTMS_MOUNT_SPECIFIC_DRIVEMount媒体将在lpDriveId参数提供的特定驱动器。
NTMS_MOUNT_READMount媒体进行读访问。使用此值装入只读媒体。
NTMS_MOUNT_WRITEMount媒体进行写访问。使用此标志,以防止安装完成媒体丹参。此值可以为综合与NTMS_MOUNT_READ读/写访问。
RSM无法完成安装,如果此标志的媒体选择。
NTMS_MOUNT_ERROR_NOT_AVAILABLEThis值返回一个错误,如果媒体或驱动器不可用。
NTMS_MOUNT_ERROR_OFFLINEDo不会发出的操作员请求装入线下媒体。返回一个错误,如果指定的媒体目前没有一个库。
dwPriority [in]
优先的安装使用的罗申允许访问驱动器。优先事项范围从-15到15日,15最高优先级,0为默认。此参数还可以采取以下常量之一。应用程序应该通过NTMS_PRIORITY_NORMAL除非有特殊需要优先安装。
ValueMeaning
NTMS_PRIORITY_NORMALMounts是没有时间的关键。
NTMS_PRIORITY_LOWMounts作为背景演出活动。
NTMS_PRIORITY_HIGHMounts关键的是时间。
NTMS_PRIORITY_LOWESTLowest优先安装。
NTMS_PRIORITY_HIGHESTHighest优先安装。
dwTimeout [in]
时间允许的最大装入指定的媒体,以毫秒为单位。将此参数设置为无限等待,直到安装完成。
lpMountInformation
这个参数是保留,应该为NULL。
返回值
这个函数返回下列值之一。
ValueMeaning
ERROR_ACCESS_DENIEDNTMS_USE_ACCESS媒体池或库包含媒体被拒绝,其他的安全错误也是可能的,但他们都将意味着安全子系统的错误。
ERROR_BUSYThe媒体或驱动器忙。
ERROR_CANCELLEDThe的要求,取消了CloseNtmsSession功能。
ERROR_DATABASE_FAILUREThe数据库无法访问或已损坏。
ERROR_DATABASE_FULLThe数据库已满。
ERROR_DRIVE_MEDIA_MISMATCHThe媒体和指定的驱动器不能在同一库。
ERROR_INVALID_DRIVEAt至少指定的驱动器之一,是无效的。
ERROR_INVALID_LIBRARYThe库包含驱动器或媒体是无效的。
ERROR_INVALID_MEDIAOne或指定的媒体更是无效的,或者有重复媒体的媒体名单的ID。
ERROR_INVALID_STATEAn意想不到的媒体或设备的状态发生在安装。
ERROR_MEDIA_OFFLINEThe媒体离线,无法装入。
ERROR_NOT_ENOUGH_MEMORYA内存分配在处理过程中出现故障。
ERROR_REQUEST_REFUSEDThe用户取消通过用户界面的要求。
ERROR_RESOURCE_DISABLEDOne或需要执行装入更多的资源被禁用。
ERROR_SUCCESSThe媒体一直在安装并投入使用。
ERROR_TIMEOUTThe超时事件过期,同时试图获得一个或多个所需的资源。装入请求已被取消。
ERROR_WRITE_PROTECTThe媒体的状态设置为完成,NTMS_MOUNT_WRITE值指定。
备注
排队的MountNtmsMedia功能要求装入指定的媒体,然后等待在为安装完成或错误被检测到dwTimeout参数所指定的毫秒数。如果RSM无法完成安装操作之前,dwTimeout到期,非关税措施取消的请求,并返回一个错误。如果指定的媒体在脱机库,应用程序可能被阻塞的时间较长。您可以使用GetNtmsObjectInformation函数来确定指定媒介的当前位置。您还可以使用NTMS_MOUNT_ERROR_OFFLINE价值立即产生错误,而不是经营者的要求当媒体处于脱机状态。
如果指定的媒介正在使用或驱动器不可用,进程块到超时值,并返回ERROR_BUSY。如果NTMS_MOUNT_ERROR_NOT_AVAILABLE指定值,该函数返回错误时,立即资源(媒体或驱动器)不可用。
在出无限的价值,可用于制造不超时等待时间的功能。当一个非零超时值在dwTimeout参数中指定,罗申等待成为所有安装在lpMediaId指定媒体。如果在指定的时间之前所有的媒体装入经过的,是MountNtmsMedia函数返回一个错误,取消该请求。应用程序可以检查状态回来,重新提出请求,如果需要的。
当多个媒体要进行的单一调用中指定,所有指定的媒体必须在一个库。如果指定的媒体任何脱机时,媒体都将会继续,直至所有的媒体在互联网上。
在装入驱动器状态(例如完成,固定或可变模式)没有定义。应用程序必须设置驱动器。
该CloseNtmsSession功能可用于取消安装这是悬而未决。默认行为是:
如果指定的媒介脱机,罗申岗位的操作员请求装入媒体和MountNtmsMedia函数等待在dwTimeout参数中指定的时间段。
如果指定的媒介是网络,罗申要求安装。
如果一个驱动器或媒体不可用,罗申发送请求和MountNtmsMedia函数等待在dwTimeout参数中指定的时间段。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
客户端 支持 Windows Vista
服务器 支持 Windows Server 2008
HeaderNtmsapi.h
LibraryNtmsapi.lib
DLLNtmsapi.dll
参见
媒体服务函数
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==MountNtmsMedia Function
[ Removable Storage Manager is no longer available as of Windows 7 and Windows Server 2008 R2.]
The MountNtmsMedia function synchronously mounts one or more pieces of media.
Syntax
C++
DWORD MountNtmsMedia(
__in HANDLE hSession,
__in LPNTMS_GUID lpMediaId,
__inout LPNTMS_GUID lpDriveId,
__in DWORD dwCount,
__in DWORD dwOptions,
__in DWORD dwPriority,
__in DWORD dwTimeout,
LPNTMS_MOUNT_INFORMATION lpMountInformation
);
Parameters
hSession [in]
Handle to the session returned by the OpenNtmsSession function.
lpMediaId [in]
Array of unique identifiers of logical media or sides.
lpDriveId [in, out]
Array of drive identifiers that corresponds to the list of media in the lpMediaId parameter. This array either specifies a list of drives to mount media into or receives the list of drives that media is mounted into on operation completion. See the NTMS_MOUNT_SPECIFIC_DRIVE value below. If the MountNtmsMedia function times out prior to the completion of the mount, RSM does not return the list of drives.
dwCount [in]
Number of media identifiers and drive identifiers passed in the lpMediaId and lpDriveId parameters. Note that lpMediaId and lpDriveId must point to the first element of equal-length arrays.
dwOptions [in]
Options. This parameter can be one or more of the following values.
ValueMeaning
NTMS_MOUNT_SPECIFIC_DRIVEMount the media into the specific drives provided in the lpDriveId parameter.
NTMS_MOUNT_READMount the media for read access. Use this value to mount read-only media.
NTMS_MOUNT_WRITEMount the media for write access. Use this flag to prevent RSM from mounting Completed media. This value can be combined with NTMS_MOUNT_READ for read/write access.
RSM cannot mount Completed media if this flag is selected.
NTMS_MOUNT_ERROR_NOT_AVAILABLEThis value returns an error if the media or a drive is not available.
NTMS_MOUNT_ERROR_OFFLINEDo not issue an operator request to mount offline media. Return an error if the media specified is not currently in a library.

dwPriority [in]
Priority of the mount used by RSM to allow access to drives. Priorities range from -15 to 15, with 15 the highest priority and 0 is the default. This parameter can also take one of the following constants. An application should pass NTMS_PRIORITY_NORMAL unless a special mount priority is required.
ValueMeaning
NTMS_PRIORITY_NORMALMounts that are not time critical.
NTMS_PRIORITY_LOWMounts performed as a background activity.
NTMS_PRIORITY_HIGHMounts that are time critical.
NTMS_PRIORITY_LOWESTLowest priority mount.
NTMS_PRIORITY_HIGHESTHighest priority mount.

dwTimeout [in]
Maximum time allowed to mount the specified media, in milliseconds. Set this parameter to INFINITE to wait until the mount is completed.
lpMountInformation
This parameter is reserved and should be NULL.
Return Value
This function returns one of the following values.
ValueMeaning
ERROR_ACCESS_DENIEDNTMS_USE_ACCESS to the media pool or library that contains the media is denied; other security errors are also possible but they would indicate a security subsystem error.
ERROR_BUSYThe media or drives are busy.
ERROR_CANCELLEDThe request was canceled by the CloseNtmsSession function.
ERROR_DATABASE_FAILUREThe database is inaccessible or damaged.
ERROR_DATABASE_FULLThe database is full.
ERROR_DRIVE_MEDIA_MISMATCHThe media and drive specified are not in the same library.
ERROR_INVALID_DRIVEAt least one of the specified drives is not valid.
ERROR_INVALID_LIBRARYThe library that contains the drives or media is not valid.
ERROR_INVALID_MEDIAOne or more of the media specified is not valid, or there are duplicate media IDs in list of media.
ERROR_INVALID_STATEAn unexpected media or device state occurred during mount.
ERROR_MEDIA_OFFLINEThe media is offline and cannot be mounted.
ERROR_NOT_ENOUGH_MEMORYA memory allocation failure occurred during processing.
ERROR_REQUEST_REFUSEDThe user canceled the request through the user interface.
ERROR_RESOURCE_DISABLEDOne or more resources required to perform the mount are disabled.
ERROR_SUCCESSThe media has been mounted and is ready for use.
ERROR_TIMEOUTThe time-out event expired while attempting to acquire one or more required resources. The mount request has been canceled.
ERROR_WRITE_PROTECTThe media state is set to Completed and the NTMS_MOUNT_WRITE value was specified.

Remarks
The MountNtmsMedia function queues a request to mount the specified media, then waits for the number of milliseconds specified in the dwTimeout parameter for the mount to complete or for an error to be detected. If RSM cannot complete the mount operation before dwTimeout expires, NTMS cancels the request and returns an error. If the specified media is in an offline library, the application might be blocked for an extended period of time. You can use the GetNtmsObjectInformation function to determine the current location of the specified medium. You can also use the NTMS_MOUNT_ERROR_OFFLINE value to generate an immediate error instead of an operator request when the media is offline.
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. If the NTMS_MOUNT_ERROR_NOT_AVAILABLE value is specified, the function returns an immediate error when a resource (media or drive) is not available.
The time-out value of INFINITE can be used to make the function wait without timing out. When a non-zero time-out value is specified in the dwTimeout parameter, RSM waits for all the media specified in lpMediaId to become mounted. If the specified time elapses before all the media is mounted, the MountNtmsMedia function returns an error and cancels the request. The application can examine the status 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.
At the completion of the mount the drive state (for example, fix or variable mode) is not defined. The application must set up the drive.
The CloseNtmsSession function can be used to cancel a mount that is pending. The default behavior is:
If the specified medium is offline, RSM posts an operator request to mount the media and the MountNtmsMedia function waits for the period of time specified in the dwTimeout parameter.
If the specified medium is online, RSM requests the mount.
If a drive or media is not available, RSM sends the request and the MountNtmsMedia function waits for the period of time specified in the dwTimeout parameter.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
End of client supportWindows Vista
End of server supportWindows Server 2008
HeaderNtmsapi.h
LibraryNtmsapi.lib
DLLNtmsapi.dll
See Also
Media Services Functions
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/bb540697(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 9:21:50