<div class="content" name="GetNtmsObjectAttributeAR" uuid="a952a27b-64ae-42fa-baa1-57389f8b4c9b"><p>The GetNtmsObjectAttributeAR method retrieves private data
from an object, with strings encoded using ASCII.</p><dl>
<dd>
<div><pre> HRESULT GetNtmsObjectAttributeAR(
   [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,
   [out] DWORD* lpActualAttributeSize
 );
</pre></div>
</dd></dl><p><b>ObjectId: </b>A pointer to the identifier of the object
for which to retrieve the attribute.</p><p><b>dwType: </b>The 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.</p><p><b>lpAttributeData: </b>A buffer containing the
attribute.</p><p><b>lpdwAttributeBufferSize: </b>A pointer to the size
of the <i>lpAttributeData</i> buffer.</p><p><b>lpAttributeSize: </b>A pointer to the size of the attribute
returned in the <i>lpAttributeData</i> buffer. This will point to 0 when the
function returns with an insufficient input buffer error.</p><p><b>lpActualAttributeSize: </b>A pointer to the actual
size of the attribute.</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 an object was denied.</td>
 </tr><tr>
  <td>0x80070057 ERROR_INVALID_PARAMETER</td>
  <td>A 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 the NTMS_MAXATTR_LENGTH value, specified in the Platform SDK file NTMSApi.h.</td>
 </tr><tr>
  <td>0x800708CA ERROR_NOT_CONNECTED</td>
  <td>Unable to connect to the server.</td>
 </tr><tr>
  <td>0x800710D8 ERROR_OBJECT_NOT_FOUND</td>
  <td>The object 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>After the server receives this message, it MUST:</p><ul><li><p><span><span> 
</span></span>Verify that <i>ObjectId</i> is not NULL.</p>
</li><li><p><span><span> 
</span></span>Verify that <i>lpAttributeData</i> is not NULL.</p>
</li><li><p><span><span> 
</span></span>Verify that <i>lpAttributeName</i> is not NULL.</p>
</li><li><p><span><span> 
</span></span>Verify that <i>lpAttributeSize</i> is not NULL.</p>
</li><li><p><span><span> 
</span></span>Verify that <i>dwType</i> is a valid object type.</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 verify
that the user has the required access rights, get the value of the extended
attribute that is specified by <i>lpAttributeName</i>, return it to the user in
the buffer that is pointed to by <i>lpAttributeData</i>, and set the size of
the data that is copied in the <i>lpAttributeData</i> in <i>lpAttributeSize</i>.
If the client does not have the required access rights, the server MUST return
ERROR_ACCESS_DENIED (0x80070005).</p><p>If the buffer size that is specified by <i>lpdwAttributeBufferSize</i>
is too small, the server MUST return ERROR_INSUFFICIENT_BUFFER (0x8007007A)
with <i>lpActualAttributeSize</i> set to the required size and <i>lpAttributeSize</i>
set to zero.</p><p>Strings that are sent to this method as parameters MUST be
ASCII-encoded.</p></div>