<div class="content" name="GetNtmsObjectAttributeA" uuid="095f5090-5319-4e2d-b4ff-04071c55e791"><p> The GetNtmsObjectAttributeA method retrieves private data
of an object, with strings encoded using ASCII.</p><dl>
<dd>
<div><pre> HRESULT GetNtmsObjectAttributeA(
   [in] LPNTMS_GUID lpObjectId,
   [in] DWORD dwType,
   [in] const  char* lpAttributeName,
   [out, size_is(*lpdwAttributeBufferSize), length_is(*lpAttributeSize)] 
     byte* lpAttributeData,
   [in] DWORD* lpdwAttributeBufferSize,
   [out] DWORD* lpAttributeSize
 );
</pre></div>
</dd></dl><p><b>lpObjectId: </b>A pointer to the identifier of the
object for which to retrieve private data.</p><p><b>dwType: </b>A value from the <a href="5b190198-a0cb-4e20-90a3-234009357051" data-linktype="relative-path">NtmsObjectsTypes (section 2.2.1.6)</a>
enumeration specifying the type of the object.</p><p><b>lpAttributeName: </b>A null-terminated sequence of
ASCII characters specifying the name of the extended attribute to retrieve. The
attribute name MUST be identical to that specified when creating this attribute
using <a href="f3becc6a-bb47-4543-9a14-769fcd4d6fc2" data-linktype="relative-path">SetNtmsObjectAttributeA</a>.</p><p><b>lpAttributeData: </b>A buffer containing the
attribute.</p><p><b>lpdwAttributeBufferSize: </b>A pointer to the
size, in bytes, of the client buffer for <i>lpAttributeData</i>.</p><p><b>lpAttributeSize: </b>The size of lpAttributeData.
If the specified client buffer was not large enough, lpAttributeSize MUST point
to the required size of <i>lpAttributeData</i>; otherwise, it MUST point to the
number of bytes that are returned by the server in the buffer <i>lpAttributeData</i>.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 S_OK</td>
  <td>The call was successful.</td>
 </tr><tr>
  <td>0x80070005 ERROR_ACCESS_DENIED</td>
  <td>Access to the object is denied; other security errors are possible but indicate a security subsystem error.</td>
 </tr><tr>
  <td>0x80070057 ERROR_INVALID_PARAMETER</td>
  <td>The parameter is not valid.</td>
 </tr><tr>
  <td>0x8007007A ERROR_INSUFFICIENT_BUFFER</td>
  <td>The specified buffer size is not large enough.</td>
 </tr><tr>
  <td>0x800700E8 ERROR_NO_DATA</td>
  <td>The specified attribute is greater than or equal to NTMS_MAXATTR_LENGTH, defined in the Platform SDK file NTMSApi.h.</td>
 </tr><tr>
  <td>0x800706C6 ERROR_RPC_S_INVALID_BOUND</td>
  <td>The array bounds are invalid.</td>
 </tr><tr>
  <td>0x800710D8 ERROR_OBJECT_NOT_FOUND</td>
  <td>The specified attribute was not found.</td>
 </tr><tr>
  <td>0x800710D9 ERROR_DATABASE_FAILURE</td>
  <td>The database query or update failed.</td>
 </tr></tbody></table>
</dd></dl><p>Upon receiving this message, the server MUST verify that <i>lpObjectId</i>,
<i>lpAttributeData</i>, <i>lpAttributeName</i>, and <i>lpAttributeSize</i> are
not NULL. 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 verify
that the user has the required access rights. If the client does not have the
required access rights, NTMS_USE_ACCESS to the object specified in <b>lpObjectId</b>
is denied and the server MUST return ERROR_ACCESS_DENIED (0x80070005).</p><p>The server MUST retrieve the extended attribute (named
private data) for the specified object.</p><p>The GetNtmsObjectAttributeA method MUST be executed on the
RSM server. Because the buffer of bytes is unmarshaled between systems of
different architectures, remote execution of this method can result in
unpredictable results.<a id="Appendix_A_Target_74"></a><a aria-label="Product behavior note 74" href="7184b376-4ee3-4482-b9c4-f87ff22b421f#Appendix_A_74" data-linktype="relative-path">&lt;74&gt;</a></p><p>The following objects require special access rights.</p><table><thead>
  <tr>
   <th>
   <p> Object </p>
   </th>
   <th>
   <p> Access </p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>NTMS_CHANGER</td>
  <td>Requires NTMS_USE_ACCESS to the library.</td>
 </tr><tr>
  <td>NTMS_CHANGER_TYPE</td>
  <td>Requires NTMS_USE_ACCESS to the computer.</td>
 </tr><tr>
  <td>NTMS_COMPUTER</td>
  <td>Requires NTMS_USE_ACCESS to the computer.</td>
 </tr><tr>
  <td>NTMS_DRIVE</td>
  <td>Requires NTMS_USE_ACCESS to the library.</td>
 </tr><tr>
  <td>NTMS_DRIVE_TYPE</td>
  <td>Requires NTMS_USE_ACCESS to the computer.</td>
 </tr><tr>
  <td>NTMS_IEDOOR</td>
  <td>Requires NTMS_USE_ACCESS to the library.</td>
 </tr><tr>
  <td>NTMS_IEPORT</td>
  <td>Requires NTMS_USE_ACCESS to the library.</td>
 </tr><tr>
  <td>NTMS_LIBRARY</td>
  <td>Requires NTMS_USE_ACCESS to the library.</td>
 </tr><tr>
  <td>NTMS_LIBREQUEST</td>
  <td>Requires NTMS_USE_ACCESS to the library.</td>
 </tr><tr>
  <td>NTMS_LOGICAL_MEDIA</td>
  <td>Requires NTMS_USE_ACCESS to the media pool of the logical media.</td>
 </tr><tr>
  <td>NTMS_MEDIA_POOL</td>
  <td>Requires NTMS_USE_ACCESS to the media pool.</td>
 </tr><tr>
  <td>NTMS_MEDIA_TYPE</td>
  <td>Requires NTMS_USE_ACCESS to the computer.</td>
 </tr><tr>
  <td>NTMS_OPREQUEST</td>
  <td>Requires NTMS_USE_ACCESS to the computer.</td>
 </tr><tr>
  <td>NTMS_PARTITION</td>
  <td>Requires NTMS_USE_ACCESS to the media pool of the side.</td>
 </tr><tr>
  <td>NTMS_PHYSICAL_MEDIA</td>
  <td>Requires NTMS_USE_ACCESS to the media pool.</td>
 </tr><tr>
  <td>NTMS_STORAGESLOT</td>
  <td>Requires NTMS_USE_ACCESS to the library.</td>
 </tr></tbody></table><p>Strings sent to this method as parameters MUST be
ASCII-encoded.</p></div>