<div class="content" name="GetNtmsObjectAttributeW" uuid="94de982f-33d5-42a8-b322-a231c3fb8d89"><p>The GetNtmsObjectAttributeW method retrieves private data
from an object, with strings encoded using Unicode.</p><dl>
<dd>
<div><pre> HRESULT GetNtmsObjectAttributeW(
   [in] LPNTMS_GUID lpObjectId,
   [in] DWORD dwType,
   [in, string] const wchar_t* 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
Unicode 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="c9b17545-7fa1-4ae6-ab80-42818365fffb" data-linktype="relative-path">SetNtmsObjectAttributeW</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>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 lpObjectId
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 GetNtmsObjectAttributeW 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.</p><p>The following is the list of objects that 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
Unicode-encoded.</p></div>