3.2.5.2.4.3 INtmsObjectManagement1::GetNtmsObjectAttributeA (Opnum 5)

 The GetNtmsObjectAttributeA method retrieves private data of an object, with strings encoded using ASCII.

 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
 );

lpObjectId: A pointer to the identifier of the object for which to retrieve private data.

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

lpAttributeName: 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 SetNtmsObjectAttributeA.

lpAttributeData: A buffer containing the attribute.

lpdwAttributeBufferSize: A pointer to the size, in bytes, of the client buffer for lpAttributeData.

lpAttributeSize: The size of lpAttributeData. If the specified client buffer was not large enough, lpAttributeSize MUST point to the required size of lpAttributeData; otherwise, it MUST point to the number of bytes that are returned by the server in the buffer lpAttributeData.

Return value/code

Description

0x00000000

S_OK

The call was successful.

0x80070005

ERROR_ACCESS_DENIED

Access to the object is denied; other security errors are possible but indicate a security subsystem error.

0x80070057

ERROR_INVALID_PARAMETER

The 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 NTMS_MAXATTR_LENGTH, defined in the Platform SDK file NTMSApi.h.

0x800706C6

ERROR_RPC_S_INVALID_BOUND

The array bounds are invalid.

0x800710D8

ERROR_OBJECT_NOT_FOUND

The specified attribute was not found.

0x800710D9

ERROR_DATABASE_FAILURE

The database query or update failed.

Upon receiving this message, the server MUST verify that lpObjectId, lpAttributeData, lpAttributeName, and lpAttributeSize are not NULL. 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. 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).

The server MUST retrieve the extended attribute (named private data) for the specified object.

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.<74>

The following objects require special access rights.

 Object

 Access

NTMS_CHANGER

Requires NTMS_USE_ACCESS to the library.

NTMS_CHANGER_TYPE

Requires NTMS_USE_ACCESS to the computer.

NTMS_COMPUTER

Requires NTMS_USE_ACCESS to the computer.

NTMS_DRIVE

Requires NTMS_USE_ACCESS to the library.

NTMS_DRIVE_TYPE

Requires NTMS_USE_ACCESS to the computer.

NTMS_IEDOOR

Requires NTMS_USE_ACCESS to the library.

NTMS_IEPORT

Requires NTMS_USE_ACCESS to the library.

NTMS_LIBRARY

Requires NTMS_USE_ACCESS to the library.

NTMS_LIBREQUEST

Requires NTMS_USE_ACCESS to the library.

NTMS_LOGICAL_MEDIA

Requires NTMS_USE_ACCESS to the media pool of the logical media.

NTMS_MEDIA_POOL

Requires NTMS_USE_ACCESS to the media pool.

NTMS_MEDIA_TYPE

Requires NTMS_USE_ACCESS to the computer.

NTMS_OPREQUEST

Requires NTMS_USE_ACCESS to the computer.

NTMS_PARTITION

Requires NTMS_USE_ACCESS to the media pool of the side.

NTMS_PHYSICAL_MEDIA

Requires NTMS_USE_ACCESS to the media pool.

NTMS_STORAGESLOT

Requires NTMS_USE_ACCESS to the library.

Strings sent to this method as parameters MUST be ASCII-encoded.