<div class="content"><p>The CreateNtmsMediaA method creates a new offline medium for
a media pool, with strings encoded using ASCII.</p><dl>
<dd>
<div><pre> HRESULT CreateNtmsMediaA(
   [in, out] LPNTMS_OBJECTINFORMATIONA lpMedia,
   [in, out, size_is(*lpdwListBufferSize), length_is(dwListCount)] 
     LPNTMS_OBJECTINFORMATIONA lpList,
   [in] DWORD* lpdwListBufferSize,
   [in] DWORD dwListCount,
   [in] DWORD dwOptions
 );
</pre></div>
</dd></dl><p><b>lpMedia: </b>A pointer to an <a href="9252e471-a237-453a-9727-dbff3c125510" data-linktype="relative-path">NTMS_OBJECTINFORMATIONA (section 2.2.4.20)</a>
structure describing the properties of the medium to create. </p><p><b>lpList: </b>An array of
NTMS_OBJECTINFORMATIONA (section 2.2.4.20) structures specifying the <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_55db62c5-a84f-43b7-a037-b44ecd8fb92f" data-linktype="relative-path">sides</a> of the new medium.</p><p><b>lpdwListBufferSize: </b>A pointer to the size of
lpList, in bytes.</p><p><b>dwListCount:</b> The number of elements in the
lpList array.</p><p><b>dwOptions:</b> A bitmap of creation options.</p><dl>
<dd>
<p>If a medium with the specified <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_e88a9ca7-9b8d-4dca-9338-59c98e1a5f13" data-linktype="relative-path">on-media identifier</a> already
exists in the system<a id="Appendix_A_Target_65"></a><a aria-label="Product behavior note 65" href="7184b376-4ee3-4482-b9c4-f87ff22b421f#Appendix_A_65" data-linktype="relative-path">&lt;65&gt;</a> and the client does not want to
duplicate the identifier, the client MUST set <i>dwOptions</i> to
NTMS_ERROR_ON_DUPLICATION (0x00000001) and the server MUST NOT create a medium
with the specified identifier.</p>
</dd>
<dd>
<p>If a medium with the specified on-media identifier
already exists in the system<a id="Appendix_A_Target_66"></a><a aria-label="Product behavior note 66" href="7184b376-4ee3-4482-b9c4-f87ff22b421f#Appendix_A_66" data-linktype="relative-path">&lt;66&gt;</a> and the
client wants to duplicate the identifier, the client MUST set <i>dwOptions</i>
to 0x00000000 and the server MUST create a medium with the specified
identifier.</p>
</dd>
<dd>
<p>If a medium with the specified on-media identifier
does not exist in the system,<a id="Appendix_A_Target_67"></a><a aria-label="Product behavior note 67" href="7184b376-4ee3-4482-b9c4-f87ff22b421f#Appendix_A_67" data-linktype="relative-path">&lt;67&gt;</a> there is
no change in the server behavior due to this option.</p>
</dd>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0x00000000</p>
  <p>S_OK</p>
  </td>
  <td>
  <p>The call was successful.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x80070005</p>
  <p>ERROR_ACCESS_DENIED</p>
  </td>
  <td>
  <p>NTMS_USE_ACCESS to the media pool or offline media
  library is denied; other security errors are possible but indicate a security
  subsystem error.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x80070008</p>
  <p>ERROR_NOT_ENOUGH_MEMORY</p>
  </td>
  <td>
  <p>An allocation failure occurred during processing.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x80070057</p>
  <p>ERROR_INVALID_PARAMETER</p>
  </td>
  <td>
  <p>Invalid input parameter.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x800710CC</p>
  <p>ERROR_INVALID_MEDIA</p>
  </td>
  <td>
  <p>The option NTMS_ERROR_ON_DUPLICATION was provided, and
  a medium with this on-media identifier already exists.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x800710CE</p>
  <p>ERROR_INVALID_MEDIA_POOL</p>
  </td>
  <td>
  <p>The specified media pool either does not exist, or is
  not a valid import or application pool.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x800710D9</p>
  <p>ERROR_DATABASE_FAILURE</p>
  </td>
  <td>
  <p>The database is inaccessible or damaged.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x800710DA</p>
  <p>ERROR_DATABASE_FULL</p>
  </td>
  <td>
  <p>The database is full.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x800710DB</p>
  <p>ERROR_MEDIA_INCOMPATIBLE</p>
  </td>
  <td>
  <p>The number of specified sides does not match the number
  of sides associated with the media type of the media pool.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>Upon receiving this message, the server MUST verify that
both <i>lpMedia</i> and <i>lpList</i> are not NULL. If parameter validation
fails, the server MUST immediately fail the operation and return ERROR_INVALID_PARAMETER
(0x80070057).</p><p>If dwOptions is NTMS_ERROR_ON_DUPLICATION (0x00000001), the
server MUST verify that the medium with the specified on-media identifier does
not exist.<a id="Appendix_A_Target_68"></a><a aria-label="Product behavior note 68" href="7184b376-4ee3-4482-b9c4-f87ff22b421f#Appendix_A_68" data-linktype="relative-path">&lt;68&gt;</a> If the medium with the
specified on-media identifier does exist, the server MUST return
ERROR_INVALID_MEDIA (0x800710CC) and take no further action.</p><p>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).</p><p>The server MUST create a physical media object (PMID) and
side (or sides) for a new piece of offline media. For a list of <a href="5ce300f7-e1ec-4b7d-a9f1-2570e5eb9dbf" data-linktype="relative-path">NTMS_PMIDINFORMATIONA</a>
members and their descriptions, see section 2.2.4.31. The media MUST be placed
in the media pool specified for <b>MediaPool</b>.</p><p>The <i>lpMedia</i> parameter MUST point to an
NTMS_OBJECTINFORMATIONA structure. A full list of NTMS_OBJECTINFORMATIONA
members and their descriptions can be found at 2.2.4.20.</p><p>The member that NTMS_OBJECTINFORMATIONA MUST contain is
specified in the left column of the following table; the criteria that the
respective member MUST adhere to are specified in the right column.</p><table><thead>
  <tr>
   <th>
   <p> Member </p>
   </th>
   <th>
   <p> Description </p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p><b>dwSize</b></p>
  </td>
  <td>
  <p>[in] CreateNtmsMedia MUST verify that this size equals
  the length of an NTMS_OBJECTINFORMATION structure containing an
  NTMS_PMIDINFORMATION structure. It MUST return ERROR_INVALID_PARAMETER if the
  size is incorrect.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>dwType</b></p>
  </td>
  <td>
  <p>[in] CreateNtmsMedia MUST verify that the value
  NTMS_PHYSICAL_MEDIA was provided. It MUST return ERROR_INVALID_PARAMETER if
  the provided type is incorrect.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>Created</b></p>
  </td>
  <td>
  <p>[out] Indicates the time the <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_9036b269-4f3b-4353-a1d0-54f5c686ec2c" data-linktype="relative-path">physical media</a> object was
  entered into the NTMS database.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>Modified</b></p>
  </td>
  <td>
  <p>[out] Indicates the time the PMID was last modified in
  the NTMS database.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>ObjectGuid</b></p>
  </td>
  <td>
  <p>[in/out] A unique identifier for the physical media
  object (PMID). If a non-NULL value is provided, the value MUST be used as the
  <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_f49694cc-c350-462d-ab8e-816f0103c6c1" data-linktype="relative-path">GUID</a> of the physical
  media; otherwise a GUID MUST be generated.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>Enabled</b></p>
  </td>
  <td>
  <p>[in] Indicates whether to enable the physical media.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>dwOperationalState</b></p>
  </td>
  <td>
  <p>[out] MUST be NTMS_READY.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>szName</b></p>
  </td>
  <td>
  <p>[in/out] CreateNtmsMedia allows an application to
  specify the name of a new physical medium. This functionality enables the
  application to continue to use the name of a medium after moving the medium
  from one RSM computer to another. The RSM default naming selection is: for
  single-sided media, <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_0c1aa461-4c32-4e8b-bb45-577085c32afb" data-linktype="relative-path">bar
  code</a> and then label information value or sequence number; for multisided
  media, bar code and then sequence number. </p>
  <p>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).</p>
  </td>
 </tr><tr>
  <td>
  <p><b>szDescription</b></p>
  </td>
  <td>
  <p>[in] An optional parameter that MAY be set using
  CreateNtmsMedia. Provide the empty string (&#34;\0&#34;) to avoid passing
  in a value for the description.</p>
  </td>
 </tr></tbody></table><p>The <i>lpList</i> parameter MUST point to an
NTMS_OBJECTINFORMATIONA structure. A full list of NTMS_OBJECTINFORMATIONA
members and their descriptions can be found at 2.2.4.20.</p><p>The NTMS_OBJECTINFORMATIONA structure MUST meet the
following criteria. </p><table><thead>
  <tr>
   <th>
   <p> Member </p>
   </th>
   <th>
   <p> Description </p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p><b>dwSize</b></p>
  </td>
  <td>
  <p>[in] CreateNtmsMedia MUST verify that the provided
  size matches the expected length of an NTMS_OBJECTINFORMATION structure
  containing an <a href="486e29b2-4de3-4d95-a249-896875048267" data-linktype="relative-path">NTMS_PARTITIONINFORMATION</a>
  structure. It MUST return ERROR_INVALID_PARAMETER if the size is incorrect.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>dwType</b></p>
  </td>
  <td>
  <p>[in] CreateNtmsMedia MUST verify that the value
  NTMS_PARTITION was provided. It MUST return ERROR_INVALID_PARAMETER if the
  provided type is incorrect.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>Created</b></p>
  </td>
  <td>
  <p>[out] Indicates the time that the partition object was
  entered into the RSM database.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>Modified</b></p>
  </td>
  <td>
  <p>[out] Indicates the time that the partition object was
  last modified in the RSM database.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>ObjectGuid</b></p>
  </td>
  <td>
  <p>[in/out] A unique identifier for the side. If a
  non-NULL value is provided, the value MUST be used as the GUID of the side;
  otherwise, a GUID MUST be generated.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>Enabled</b></p>
  </td>
  <td>
  <p>[in] Determines whether to enable the side.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>dwOperationalState</b></p>
  </td>
  <td>
  <p>[out] MUST be NTMS_READY.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>szName</b></p>
  </td>
  <td>
  <p>[in] The name of a new side.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>szDescription</b></p>
  </td>
  <td>
  <p>[in] An optional parameter that MAY be set using
  CreateNtmsMedia. Provide the empty string (&#34;\0&#34;) to avoid passing
  in a value for the description.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>PhysicalMedia</b></p>
  </td>
  <td>
  <p>[out] The GUID of the newly created side object.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>LogicalMedia</b></p>
  </td>
  <td>
  <p>[in/out] An optional input parameter, as well as an
  output parameter. If the GUID is provided, CreateNtmsMedia MUST attempt to
  create a new <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_05349689-4cd0-4643-a13e-9f552ecf3346" data-linktype="relative-path">logical media</a>
  object with the pre-assigned GUID. If the GUID is not unique, CreateNtmsMedia
  MUST return an error.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>State</b></p>
  </td>
  <td>
  <p>[in] Any valid side state.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>Side</b></p>
  </td>
  <td>
  <p>[out] CreateNtmsMedia sets the side number to its
  offset in the Partitions array.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>dwOmidLabelIdLength</b></p>
  </td>
  <td>
  <p>[in] MUST be a positive value. </p>
  <p>CreateNtmsMedia uses the <b>dwOmidLabelIdLength</b> to
  determine the number of significant bytes in the <b>OmidLabelId</b> member.
  If the value is not correct, the recorded <b>OmidLabelId</b> is incorrect.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>OmidLabelId</b></p>
  </td>
  <td>
  <p>[in] MUST be a valid media label that can be
  recognized by server.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>szOmidLabelType</b></p>
  </td>
  <td>
  <p>[in] MUST not be an empty string.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>szOmidLabelInfo</b></p>
  </td>
  <td>
  <p>[in] MAY be the empty string.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>dwMountCount</b></p>
  </td>
  <td>
  <p>[in] Any value is accepted.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>dwAllocateCount</b></p>
  </td>
  <td>
  <p>[in] Any value is accepted.</p>
  </td>
 </tr><tr>
  <td>
  <p><b>Capacity</b></p>
  </td>
  <td>
  <p>[in] SCSI <a href="https://go.microsoft.com/fwlink/?LinkId=90512" data-linktype="external">[ANSI-131-1994]</a>
  capacity code. </p>
  <p>This member MUST not be used by the RSM client, but
  MAY be used by applications written to RSM for additional information about
  the media. For a description of what this member MUST be set to, see the
  Hardware Manufacturer&#39;s SCSI specification for possible settings.</p>
  <p>The RSM server updates this member when it mounts the
  newly imported medium for the first time.<a id="Appendix_A_Target_69"></a><a aria-label="Product behavior note 69" href="7184b376-4ee3-4482-b9c4-f87ff22b421f#Appendix_A_69" data-linktype="relative-path">&lt;69&gt;</a></p>
  </td>
 </tr></tbody></table><p>Strings sent to this method as parameters MUST be
ASCII-encoded.</p></div>