网站首页  词典首页

请输入您要查询的函数:

 

术语 createntmsmedia
释义 CreateNtmsMedia
语法:
C++
DWORD CreateNtmsMedia(
__in HANDLE hSession,
__in LPNTMS_OBJECTINFORMATION lpMedia,
__in LPNTMS_OBJECTINFORMATION lpList,
__in DWORD dwOptions
);
CreateNtmsMedia功能
[移动存储管理不再作为Windows 7和Windows服务器2008 R2提供。]
该CreateNtmsMedia函数创建一个日期和侧面(或双方)为新的线下媒体一块。媒体是放置在媒体池lpPhysicalMedia指定。
参数
hSession [in]
处理由OpenNtmsSession函数返回的会议。
lpMedia [in]
指针的NTMS_OBJECTINFORMATION结构,其中包含有关媒体的信息来创建。对于适用的成员说明,请参见备注。
lpList [in]
一个指针,它指定NTMS_OBJECTINFORMATION结构与关联方的数组中。对于适用的成员说明,请参见备注。
dwOptions [in]
选项。此参数可以是下列值之一。
ValueMeaning
0Default价值。允许使用重复奥米德一个重复的媒介创作。
NTMS_ERROR_ON_DUPLICATEReturns错误,不创建中,如果用指定的奥米德中期已经在系统上存在。
返回值
这个函数返回下列值之一。
ValueMeaning
ERROR_ACCESS_DENIEDNTMS_MODIFY_ACCESS到计算机或媒体的媒体池被拒绝。其他安全错误是可能的,但表明安全子系统的错误。
Windows XP/2000操作系统:媒体池或NTMS_MODIFY_ACCESS到脱机库NTMS_CONTROL_ACCESS被拒绝。其他安全错误是可能的,但表明安全子系统的错误。
ERROR_DATABASE_FAILUREDatabase无法或损坏。
ERROR_DATABASE_FULLDatabase已满。
ERROR_DUPLICATE_OMIDThe选择NTMS_ERROR_ON_DUPLICATE提供了一个中型已与此奥米德存在。
ERROR_INVALID_HANDLEThe会话句柄丢失或无效。
ERROR_INVALID_MEDIAAn项目已经存在了这个条形码中。
ERROR_INVALID_MEDIA_POOLMedia池指定的或者不存在,或者不是有效的导入或应用程序池。
ERROR_INVALID_PARAMETERA缺少参数,或对象的信息或对象类型的大小是无效的。
双方ERROR_MEDIA_INCOMPATIBLENumber指定不匹配,与媒体池中的媒体类型相关联的边数。
ERROR_NOT_ENOUGH_MEMORYMemory在处理过程中分配失败。
ERROR_SUCCESSThe函数执行成功。
备注
该lpMedia参数必须指向一个NTMS_OBJECTINFORMATION结构,其却提示参数NTMS_PHYSICAL_MEDIA。以下是成员和描述为NTMS_OBJECTINFORMATION结构清单。
MemberDescription
dwSize [in] CreateNtmsMedia验证这种规模相当于一个NTMS_OBJECTINFORMATION结构长度包含NTMS_PMIDINFORMATION结构。它返回ERROR_INVALID_PARAMETER如果大小不正确。
dwType [in] CreateNtmsMedia验证该值NTMS_PHYSICAL_MEDIA提供了依据。它返回ERROR_INVALID_PARAMETER如果所提供的类型是不正确的。
创建[内]指示时对象的物理媒体的技术手段进入数据库。
修改[出]指示时对象的物理媒体的技术手段进入数据库。
的objectGUID的物理媒体[/出]对象唯一标识符(参考)。如果一个非NULL值提供,该值被用来作为物理介质的GUID,否则会生成一个GUID。
启用[in]指示是否物理介质应该启用。
dwOperationalState [内]必须NTMS_READY。
szName [/出] CreateNtmsMedia允许应用程序指定一个新的物理介质的名称。这使得应用程序后,继续使用从一罗申移动到另一个电脑的媒介名称。在RSM默认命名的选择是:为单面:条码,然后标签信息价值或序列号;。在多方面的多媒体条码然后序列号。
请注意,名称,在一个分区罗申用户界面中显示这名(该名称分配给物理媒体对象)。
szDescription [in]一个可选参数,可以设置使用CreateNtmsMedia。提供空字符串(“\\ 0”),以避免在一个价值传递的描述。
以下是成员和描述为NTMS_PMIDINFORMATION结构清单。
MemberDescription
CurrentLibrary [in]必须是在NULL_GUID,或脱机库的GUID。
MediaPool [中]必须是一个有效的导入或应用程序池的GUID。
CreateNtmsMedia验证,这是一个有效的导入或应用程序池的GUID。它也验证所提供的分区数量是与此相关的媒体池中的媒体类型正确。
地点[内]必须是NULL_GUID。
LocationType [内]必须NTMS_STORAGESLOT。
HomeSlot [内]必须是NULL_GUID。
介质类型[out] CreateNtmsMedia设置媒体类型的媒体类型的媒体池提供相关的。
szBarCode [/出]的条形码已被除去任何结束的空格。 CreateNtmsMedia不执行在核实条码的有效性任何其他企图。
BarCodeState [内]的BarCodeState设置为NTMS_BARCODESTATE_UNREADABLE如果传入的值szBarCode是一个空字符串,否则它设置为NTMS_BARCODESTATE_OK。
szSequenceNumber [out] CreateNtmsMedia分配新创建的中型一个序列号,这在该成员返回。
MediaState [out] CreateNtmsMedia设置MediaState的NTMS_MEDIASTATE_IDLE。
dwNumberOfPartitions [in]定义的NTMS_OBJECTINFORMATION代表双方在这一媒介结构数目。 CreateNtmsMedia检查,以确保指定的边数相匹配的媒体池它所要指派双方多次暗示。如果它们不匹配,ERROR_MEDIA_INCOMPATIBLE返回。
dwMediaTypeCode [in]的SCSI媒体类型的代码。
该成员不使用丹参,但可以通过书面有关媒体的其他信息,罗申应用。有关成员应该是怎样的应设置,请参阅硬件制造商可能设置的SCSI规格说明。
罗申更新时,该会员装入首次新import 的媒介。
dwDensityCode [in]的SCSI密度代码。
该成员不使用丹参,但可以通过书面有关媒体的其他信息,罗申应用。有关成员应该是怎样的应设置,请参阅硬件制造商可能设置的SCSI规格说明。
罗申更新时,该会员装入首次新import 介质
该lpList参数必须指向一个NTMS_OBJECTINFORMATION结构,其却提示是以下信息NTMS_PARTITION。
MemberDescription
dwSize [in] CreateNtmsMedia验证,所提供的规模相匹配的NTMS_OBJECTINFORMATION结构预期长度包含NTMS_PARTITIONINFORMATION结构。它返回ERROR_INVALID_PARAMETER如果大小不正确。
dwType [in] CreateNtmsMedia验证该值NTMS_PARTITION提供了依据。它返回ERROR_INVALID_PARAMETER如果所提供的类型是不正确的。
创建[内]指示的时间,分区目标是进入了RSM数据库。
修改[内]指示的时间,分区目标是进入了RSM数据库。
的objectGUID [/出]唯一标识符的一面。如果一个非NULL值提供,该值被用来作为一方的GUID,否则,会生成一个GUID。
启用[in]确定是否应启用方。
dwOperationalState [内]必须NTMS_READY。
szName [in]新方名称。
szDescription [in]可选参数,可以设置使用CreateNtmsMedia。提供空字符串(“\\ 0”),以避免在一个价值传递的描述。
PhysicalMedia [内]的GUID的新创建的端对象。
LogicalMedia [/出]可选的输入参数,以及一个输出参数。如果GUID是提供CreateNtmsMedia尝试创建一个新的逻辑媒体对象的预先指定的GUID。如果不是唯一的GUID,CreateNtmsMedia返回一个错误。
国[in]任何有效端的状态。
侧[out] CreateNtmsMedia设置方次数的抵消分区数组。
dwOmidLabelIdLength [in]必须是一个积极的价值。
CreateNtmsMedia使用dwOmidLabelIdLength确定重大字节数在OmidLabelId成员。如果该值不正确,记录OmidLabelId是不正确的。
OmidLabelId [in]必须是一个有效的媒体标签,可以通过安装的最低生活Level的承认。
szOmidLabelType [in]不能是空字符串。
szOmidLabelInfo [中]可能是空字符串。
dwMountCount [in]接受任何价值。
dwAllocateCount [in]接受任何价值。
容量[in]的SCSI身份代码。
该成员不使用丹参,但可以通过书面有关媒体的其他信息,罗申应用。有关成员应该是怎样的应设置,请参阅硬件制造商可能设置的SCSI规格说明。
罗申更新时,该会员装入首次新import 的媒介。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
客户端 支持 Windows Vista
服务器 支持 Windows Server 2008
HeaderNtmsapi.h
LibraryNtmsapi.lib
DLLNtmsapi.dll
Unicode和ANSI namesCreateNtmsMediaW(Unicode)和CreateNtmsMediaA(ANSI)的
参见
媒体服务函数
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月30日
==英文原文==CreateNtmsMedia Function
[ Removable Storage Manager is no longer available as of Windows 7 and Windows Server 2008 R2.]
The CreateNtmsMedia function creates a PMID and side (or sides) for a new piece of offline media. The media is placed in the media pool specified for lpPhysicalMedia.
Syntax
C++
DWORD CreateNtmsMedia(
__in HANDLE hSession,
__in LPNTMS_OBJECTINFORMATION lpMedia,
__in LPNTMS_OBJECTINFORMATION lpList,
__in DWORD dwOptions
);
Parameters
hSession [in]
Handle to the session returned by the OpenNtmsSession function.
lpMedia [in]
Pointer to an NTMS_OBJECTINFORMATION structure that contains information about the medium to create. For a description of the applicable members, see Remarks.
lpList [in]
Pointer to an NTMS_OBJECTINFORMATION structure that specifies array of sides associated with the medium. For a description of the applicable members, see Remarks.
dwOptions [in]
Options. This parameter can be one of the following values.
ValueMeaning
0Default value. Allows the creation of a duplicate medium with a duplicate OMID.
NTMS_ERROR_ON_DUPLICATEReturns an error and does not create the medium if a medium with the specified OMID already exists on the system.

Return Value
This function returns one of the following values.
ValueMeaning
ERROR_ACCESS_DENIEDNTMS_MODIFY_ACCESS to the computer or the media's media pool is denied. Other security errors are possible, but indicate a security subsystem error.
Windows XP/2000: NTMS_CONTROL_ACCESS to the media pool or NTMS_MODIFY_ACCESS to the offline library is denied. Other security errors are possible, but indicate a security subsystem error.
ERROR_DATABASE_FAILUREDatabase inaccessible or damaged.
ERROR_DATABASE_FULLDatabase is full.
ERROR_DUPLICATE_OMIDThe option NTMS_ERROR_ON_DUPLICATE was provided and a medium already exists with this OMID.
ERROR_INVALID_HANDLEThe session handle is missing or is not valid.
ERROR_INVALID_MEDIAAn entry already exists for a medium with this barcode.
ERROR_INVALID_MEDIA_POOLMedia pool specified either does not exist, or is not a valid Import or Application pool.
ERROR_INVALID_PARAMETERA parameter is missing, or the object information size or object type is not valid.
ERROR_MEDIA_INCOMPATIBLENumber of specified sides does not match the number of sides associated with the media pool's media type.
ERROR_NOT_ENOUGH_MEMORYMemory allocation failure during processing.
ERROR_SUCCESSThe function executed successfully.

Remarks
The lpMedia parameter must point to an NTMS_OBJECTINFORMATION structure, whose dwType parameter is NTMS_PHYSICAL_MEDIA. The following is a list of members and descriptions for the NTMS_OBJECTINFORMATION structure.
MemberDescription
dwSize[in] CreateNtmsMedia verifies that this size equals the length of an NTMS_OBJECTINFORMATION structure containing an NTMS_PMIDINFORMATION structure. It returns ERROR_INVALID_PARAMETER if the size is incorrect.
dwType[in] CreateNtmsMedia verifies that the value NTMS_PHYSICAL_MEDIA was provided. It returns ERROR_INVALID_PARAMETER if the provided type is incorrect.
Created[out] Indicates time the physical media object was entered into the NTMS database.
Modified[out] Indicates time the physical media object was entered into the NTMS database.
ObjectGuid[in/out] Unique identifier for the physical media object (PMID). If a non-NULL value is provided, the value is used as the GUID of the Physical Medium, otherwise a GUID is generated.
Enabled[in] Indicates whether or not the physical medium should be enabled.
dwOperationalState[out] Must be NTMS_READY.
szName[in/out] CreateNtmsMedia allows an application to specify the name of a new physical medium. This enables the application to continue to use the name of a medium after moving it from one RSM computer to another. The RSM default naming selection is: for single sided: Barcode, then Label Info value or Sequence Number;. for multi-sided media Barcode then Sequence Number.
Note that the name that appears in the RSM user interface for a partition is this name (the name assigned to the physical media object).
szDescription[in] An optional parameter that may be set using CreateNtmsMedia. Provide the empty string ("\\0") to avoid passing in a value for the description.

The following is a list of members and descriptions for the NTMS_PMIDINFORMATION structure.
MemberDescription
CurrentLibrary[in] Must be either the NULL_GUID, or the GUID of the Offline library.
MediaPool[in] Must be the GUID of a valid Import or Application pool.
CreateNtmsMedia verifies that this is the GUID of a valid Import or Application Pool. It also verifies that the number of partitions provided are correct for the media type associated with this media pool.
Location[out] Must be the NULL_GUID.
LocationType[out] Must be NTMS_STORAGESLOT.
HomeSlot[out] Must be the NULL_GUID.
MediaType[out] CreateNtmsMedia sets the media type to the media type associated with the media pool provided.
szBarCode[in/out] The barcode is stripped of any ending spaces. CreateNtmsMedia does not perform any additional attempts at verifying the validity of the barcode.
BarCodeState[out] The BarCodeState is set to NTMS_BARCODESTATE_UNREADABLE if the value passed in for szBarCode is an empty string, otherwise it is set to NTMS_BARCODESTATE_OK.
szSequenceNumber[out] CreateNtmsMedia assigns the newly-created medium a sequence number, which is returned in this member.
MediaState[out] CreateNtmsMedia sets the MediaState to NTMS_MEDIASTATE_IDLE.
dwNumberOfPartitions[in] Defines the number of NTMS_OBJECTINFORMATION structures representing sides for this medium. CreateNtmsMedia checks to ensure that the number of sides specified matches the number of sides implied by the media pool to which it is to be assigned. If they do not match, ERROR_MEDIA_INCOMPATIBLE is returned.
dwMediaTypeCode[in] SCSI media type code.
This member is not used by RSM, but may be used by applications written to RSM for additional information about the media. For a description of what this member should be set to, see the Hardware Manufacturer's SCSI spec for possible settings.
RSM updates this member when it mounts the newly-imported medium for the first time.
dwDensityCode[in] SCSI density code.
This member is not used by RSM, but may be used by applications written to RSM for additional information about the media. For a description of what this member should be set to, see the Hardware Manufacturer's SCSI spec for possible settings.
RSM updates this member when it mounts the newly-imported medium for the first time

The lpList parameter must point to an NTMS_OBJECTINFORMATION structure whose dwType is NTMS_PARTITION with the following information.
MemberDescription
dwSize[in] CreateNtmsMedia verifies that the provided size matches the expected length of an NTMS_OBJECTINFORMATION structure containing an NTMS_PARTITIONINFORMATION structure. It returns ERROR_INVALID_PARAMETER if the size is incorrect.
dwType[in] CreateNtmsMedia verifies that the value NTMS_PARTITION was provided. It returns ERROR_INVALID_PARAMETER if the provided type is incorrect.
Created[out] Indicates the time that the partition object was entered into the RSM database.
Modified[out] Indicates the time that the partition object was entered into the RSM database.
ObjectGuid[in/out] Unique identifier for the side. If a non-NULL value is provided, the value is used as the GUID of the side; otherwise, a GUID is generated.
Enabled[in] Determines whether or not the side should be enabled.
dwOperationalState[out] Must be NTMS_READY.
szName[in] Name of a new side.
szDescription[in] Optional parameter that may be set using CreateNtmsMedia. Provide the empty string ("\\0") to avoid passing in a value for the description.
PhysicalMedia[out] GUID of the newly-created side object.
LogicalMedia[in/out] Optional input parameter, as well as an output parameter. If the GUID is provided, CreateNtmsMedia attempts to create a new logical media object with the preassigned GUID. If the GUID is not unique, CreateNtmsMedia returns an error.
State[in] Any valid side state.
Side[out] CreateNtmsMedia sets the side number to its offset in the Partitions array.
dwOmidLabelIdLength[in] Must be a positive value.
CreateNtmsMedia uses the dwOmidLabelIdLength to determine the number of significant bytes in the OmidLabelId member. If the value is not correct, the recorded OmidLabelId is incorrect.
OmidLabelId[in] Must be a valid media label that can be recognized by an installed MLL.
szOmidLabelType[in] Must not be an empty string.
szOmidLabelInfo[in] May be the empty string.
dwMountCount[in] Any value is accepted.
dwAllocateCount[in] Any value is accepted.
Capacity[in] SCSI capacity code.
This member is not used by RSM, but may be used by applications written to RSM for additional information about the media. For a description of what this member should be set to, see the Hardware Manufacturer's SCSI spec for possible settings.
RSM updates this member when it mounts the newly-imported medium for the first time.

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
Unicode and ANSI namesCreateNtmsMediaW (Unicode) and CreateNtmsMediaA (ANSI)
See Also
Media Services Functions
Send comments about this topic to Microsoft
Build date: 7/30/2009
==原始网址==http://msdn.microsoft.com/en-us/library/bb525485(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 13:19:39