IDirectoryObject::GetObjectInformation method (iads.h)
The IDirectoryObject::GetObjectInformation method retrieves a pointer to an ADS_OBJECT_INFO structure that contains data regarding the identity and location of a directory service object.
Syntax
HRESULT GetObjectInformation(
[out] PADS_OBJECT_INFO *ppObjInfo
);
Parameters
[out] ppObjInfo
Provides the address of a pointer to an ADS_OBJECT_INFO structure that contains data regarding the requested directory service object. If ppObjInfo is NULL on return, GetObjectInformation cannot obtain the requested data.
Return value
This method returns the standard return values, including S_OK when the data is obtained successfully. For more information and other return values, see ADSI Error Codes.
Remarks
The caller should call the FreeADsMem helper function to release the ADS_OBJECT_INFO structure created by the GetObjectInformation function.
Automation clients must call IADs::GetInfo.
Examples
The following C++ code example shows how to retrieve the object data (ADS_OBJECT_INFO) using the GetObjectInformation method of an object (m_pDirObject) that implements the IDirectoryObject interface.
ADS_OBJECT_INFO *pInfo;
HRESULT hr;
hr = m_pDirObject->GetObjectInformation(&pInfo);
if (!SUCCEEDED(hr) )
{
return;
}
//////////////////////////
// Show the attributes
/////////////////////////
printf("RDN: %S\n", pInfo->pszRDN);
printf("ObjectDN: %S\n", pInfo->pszObjectDN);
printf("Parent DN: %S\n", pInfo->pszParentDN);
printf("Class Name: %S\n", pInfo->pszClassName);
printf("Schema DN: %S\n", pInfo->pszSchemaDN);
///////////////////////////////////////////////////////////
// Remember to clean up the memory using FreeADsMem.
//////////////////////////////////////////////////////////
FreeADsMem( pInfo );
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista |
Minimum supported server | Windows Server 2008 |
Target Platform | Windows |
Header | iads.h |
DLL | Activeds.dll |