MDAC Technical Articles

IObjectAccessControl::GetObjectOwner

Returns the owner of a database object.

HRESULT GetObjectOwner ( 
   SEC_OBJECT *   pObject,
   TRUSTEE **     ppOwner
);

Parameters

pObject
[in]
Address of an initialized SEC_OBJECT structure that indicates the database object whose owner is to be retrieved.
ppOwner
[out]
Address of a TRUSTEE pointer variable that receives the trustee information of the owner of the database object.

Return Code

S_OK
The owner was successfully retrieved.
SEC_E_NOOWNER
No owner exists for the object.
SEC_E_INVALIDOBJECT
The object that was supplied is invalid or unknown to the provider.
SEC_E_PERMISSIONDENIED
Caller does not have enough permission to complete the operation.
E_INVALIDARG
pObject or ppOwner was a null pointer.
E_FAIL
A provider-specific error occurred.

Comments

The caller initializes pObject to specify the database object whose owner is being retrieved. See SEC_OBJECT for an explanation on initializing this structure.

The provider calls CoTaskMemAlloc to allocate a TRUSTEE structure, into which it places the identity of the owner of the database object. It places the address of this structure into the address indicated by *ppOwner.

When the caller is finished with the TRUSTEE structure, it calls CoTaskMemFree to release the ptstrName element and then the TRUSTEE structure itself.

See Also

IObjectAccessControl, IObjectAccessControl::SetObjectOwner, SEC_OBJECT, TRUSTEE