3.2.5.2.4.6 INtmsObjectManagement1::SetNtmsObjectAttributeW (Opnum 8)
The SetNtmsObjectAttributeW method changes the private data of an object, with strings encoded using Unicode.
-
HRESULT SetNtmsObjectAttributeW( [in] LPNTMS_GUID lpObjectId, [in] DWORD dwType, [in, string] const wchar_t* lpAttributeName, [in, size_is(AttributeSize)] byte* lpAttributeData, [in] DWORD AttributeSize );
lpObjectId: A pointer to the identifier of the object for which to set 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 Unicode characters specifying the name of the extended attribute to set. The client can give any name to the extended attribute and MUST use the same name in the GetNtmsObjectAttributeW method.
lpAttributeData: The buffer containing the attribute.
AttributeSize: The size of 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.
0x80070008
ERROR_NOT_ENOUGH_MEMORY
An allocation failure occurred during processing.
0x80070057
ERROR_INVALID_PARAMETER
The parameter is not valid.
0x8007007B
ERROR_INVALID_NAME
The attribute name is invalid or too long. The NTMS_MAXATTR_NAMELEN value, defined in the Platform SDK file NTMSApi.h, specifies the maximum null-terminated attribute name length.
0x800710D8
ERROR_OBJECT_NOT_FOUND
The object was not found.
0x800708CA
ERROR_NOT_CONNECTED
Unable to connect to the RSM service.
Upon receiving this message, the server MUST verify that lpObjectId, lpAttributeData, and lpAttributeName are not NULL.
If parameter validation succeeds, the server MUST verify that the user has the required access rights, and determine the validity of the object. If the client does not have the required access rights, NTMS_MODIFY_ACCESS to the object specified in lpOjbectID is denied and the server MUST return ERROR_ACCESS_DENIED (0x80070005). If the object is valid, the server MUST update the object attribute depending on the type of object specified. If the object is not valid, the server MUST return ERROR_INVALID_PARAMETER (0x80070057). If the object is valid and dwType is invalid, the server MUST ignore the invalid dwType.
Strings sent to this method as parameters MUST be Unicode-encoded.