3.2.5.2.4.1 INtmsObjectManagement1::GetNtmsObjectSecurity (Opnum 3)

The GetNtmsObjectSecurity method retrieves the security descriptor of an object.

 HRESULT GetNtmsObjectSecurity(
   [in] LPNTMS_GUID lpObjectId,
   [in] DWORD dwType,
   [in] DWORD SecurityInformation,
   [out, size_is(nLength)] PSECURITY_DESCRIPTOR_NTMS lpSecurityDescriptor,
   [in] DWORD nLength,
   [out] DWORD* lpnLengthNeeded
 );

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

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

SecurityInformation: A SECURITY_INFORMATION structure specifying the security data to retrieve.

lpSecurityDescriptor: A pointer to a SECURITY_DESCRIPTOR structure that describes the security of the object.

nLength: The size, in bytes, of the client buffer for lpSecurityDescriptor.

lpnLengthNeeded: A pointer to the required size of lpSecurityDescriptor if the specified client buffer was not large enough.

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.

0x80070546

ERROR_NO_SECURITY_ON_OBJECT

The object has no security information.

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 lpObjectId, lpSecurityDescriptor, and lpnLengthNeeded 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, and return security information for the database object. 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 nLength is too small, the server MUST return ERROR_INSUFFICIENT_BUFFER (0x8007007A).

Server security uses the standard security descriptors and information members. This allows the standard security dialog boxes to be used to select server security.