<div class="content"><p>The AccessNtmsLibraryDoor method unlocks the <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_52b64896-966d-41bd-849a-36602125506b" data-linktype="relative-path">door</a> of an online library.</p><dl>
<dd>
<div><pre> HRESULT AccessNtmsLibraryDoor(
   [in] LPNTMS_GUID lpLibraryId,
   [in] DWORD dwAction
 );
</pre></div>
</dd></dl><p><b>lpLibraryId: </b>A pointer to the identifier of a
media library.</p><p><b>dwAction: </b>One of the NTMS_INVENTORY_NONE,
NTMS_INVENTORY_OMID, NTMS_INVENTORY_FAST, or NTMS_INVENTORY_DEFAULT values from
the <a href="7d94093c-93d1-47a7-b754-b213b0034ba6" data-linktype="relative-path">NtmsInventoryMethod</a>
enumeration, specifying the action to perform when the door is closed.</p><dl>
<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_CONTROL_ACCESS to the library is denied; other
  security errors are possible but indicate a security subsystem error.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x80070057</p>
  <p>ERROR_INVALID_PARAMETER</p>
  </td>
  <td>
  <p>A parameter is not valid.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x800700D1</p>
  <p>ERROR_LIBRARY_OFFLINE</p>
  </td>
  <td>
  <p>A library identifier refers to an <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_f248d7b8-b3e9-421e-96c4-78551324fd86" data-linktype="relative-path">offline library</a>.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x800710D5</p>
  <p>ERROR_RESOURCE_DISABLED</p>
  </td>
  <td>
  <p>The resource required for this operation is disabled.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x800710DC</p>
  <p>ERROR_RESOURCE_NOT_PRESENT</p>
  </td>
  <td>
  <p>The resource that is required for this operation does
  not exist.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x800710D9</p>
  <p>ERROR_DATABASE_FAILURE</p>
  </td>
  <td>
  <p>The database query or update failed.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>Upon receiving this message, the server MUST:</p><ul><li><p><span><span> 
</span></span>Verify that <i>lpLibraryId</i> is not NULL.</p>
</li><li><p><span><span> 
</span></span>Verify that <i>dwAction</i> is less than NTMS_INVENTORY_MAX.</p>
</li></ul><p>If parameter validation fails, the server MUST immediately
fail the operation and return ERROR_INVALID_PARAMETER (0x80070057).</p><p>If parameter validation succeeds, the server MUST check the
access to the library and verify that the library is enabled and online before
making the call. If the library is disabled, the server MUST return
ERROR_RESOUCE_DISABLED (0x800710D5). If the library is offline, the server MUST
return ERROR_LIBRARY_OFFLINE (0x800710D1).</p><p>If the library does not have a door, the server MUST return
ERROR_RESOURCE_NOT_PRESENT (0x800710DC).</p><p>The action taken by the server depends on the value of <i>dwAction</i>.
The following table lists all possible values for <i>dwAction</i>.</p><table><thead>
  <tr>
   <th>
   <p> Value </p>
   </th>
   <th>
   <p> Meaning </p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>NTMS_INVENTORY_NONE</p>
  </td>
  <td>
  <p>After the user closes the door, no <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_38cb8216-53ff-4936-a5c4-4d8d7672950a" data-linktype="relative-path">inventory</a> is performed.
  However, if a mount-label check fails, an inventory is performed.</p>
  </td>
 </tr><tr>
  <td>
  <p>NTMS_INVENTORY_OMID</p>
  </td>
  <td>
  <p>After the user closes the door, a full on-media
  inventory is performed.</p>
  </td>
 </tr><tr>
  <td>
  <p>NTMS_INVENTORY_FAST</p>
  </td>
  <td>
  <p>If the library has a <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_d4650c0f-44cb-4988-8aa6-ca8c3ffdf1a0" data-linktype="relative-path">bar code reader</a>
  installed, this flag causes a <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_0c1aa461-4c32-4e8b-bb45-577085c32afb" data-linktype="relative-path">bar code</a> inventory to be
  performed. If the library does not have a bar code reader, this flag causes a
  differential inventory to be performed. The <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_e88a9ca7-9b8d-4dca-9338-59c98e1a5f13" data-linktype="relative-path">OMIDs</a> are checked on each
  medium placed in an empty <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_a1f0ab90-f3c0-46b8-9c77-d0d7508ede94" data-linktype="relative-path">slot</a>
  while the door is open.</p>
  </td>
 </tr><tr>
  <td>
  <p>NTMS_INVENTORY_DEFAULT</p>
  </td>
  <td>
  <p>Use the inventory method specified in the library
  object (for more information, see the description of the <a href="9117449f-2f75-4459-8a80-ad1f59f62ddb" data-linktype="relative-path">NTMS_LIBRARYINFORMATION</a>
  structure).</p>
  </td>
 </tr></tbody></table><p>The server programmatically unlocks the door of the specified
library. If the library is busy, the server MUST queue the request and return
success.</p><p>The failure or success of this method MUST NOT depend on the
type of library. Some libraries provide no means for the server to
programmatically lock and unlock their doors. The behavior of this method with
these libraries is identical to its behavior with libraries that the server can
unlock and lock.</p><p>On completion of an asynchronous operation, notification
will be sent with the identifier lpLibraryId.</p></div>