3.2.5.2.8.2 INtmsObjectManagement3::GetNtmsObjectAttributeWR (Opnum 18)

The GetNtmsObjectAttributeWR method retrieves private data from an object, with strings encoded using Unicode.

 HRESULT GetNtmsObjectAttributeWR(
   [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,
   [out] DWORD* lpActualAttributeSize
 );

ObjectId: A pointer to the identifier of the object for which to retrieve the attribute.

dwType: The value from the NtmsObjectsTypes (section 2.2.1.6) enumeration specifying the type of the object.

lpAttributeName: A null-terminated sequence of Unicode characters specifying the name of the extended attribute to retrieve.

lpAttributeData: A buffer containing the attribute.

lpdwAttributeBufferSize: A pointer to the size of the lpAttributeData buffer.

lpAttributeSize: A pointer to the size of the attribute returned in the lpAttributeData buffer. This will point to zero when the function returns with an insufficient input buffer error.

lpActualAttributeSize: A pointer to the size of the attribute in the lpAttributeData buffer.

Return value/code

Description

0x00000000

S_OK

The call was successful.

0x80070005

ERROR_ACCESS_DENIED

Access to an object was denied.

0x80070057

ERROR_INVALID_PARAMETER

A parameter is not valid.

0x8007007A

ERROR_INSUFFICIENT_BUFFER

The specified buffer size is not large enough.

0x800700E8

ERROR_NO_DATA

The specified attribute is greater than or equal to the NTMS_MAXATTR_LENGTH value, specified in the Platform SDK file NTMSApi.h.

0x800708CA

ERROR_NOT_CONNECTED

Unable to connect to the server.

0x800710D8

ERROR_OBJECT_NOT_FOUND

The object was not found.

0x800710D9

ERROR_DATABASE_FAILURE

The database query or update failed.

Upon receiving this message, the server MUST:

  • Verify that ObjectId is not NULL.

  • Verify that lpAttributeData is not NULL.

  • Verify that lpAttributeName is not NULL.

  • Verify that lpAttributeSize is not NULL.

  • Verify that dwType is a valid object type.

If parameter validation fails, the server MUST immediately fail the operation and return ERROR_INVALID_PARAMETER (0x80070057).

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 lpAttributeName, return it to the user in the buffer that is pointed to by lpAttributeData, and set the size of the data that is copied in the lpAttributeData in lpAttributeSize. If the client does not have the required access rights, the server MUST return ERROR_ACCESS_DENIED (0x80070005).

If the buffer size that is specified by lpdwAttributeBufferSize is too small, the server MUST return ERROR_INSUFFICIENT_BUFFER (0x8007007A) with lpActualAttributeSize set to the required size and lpAttributeSize set to zero.

Strings sent to this method as parameters MUST be Unicode encoded.