Directory Services |
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.
HRESULT GetObjectInformation( PADS_OBJECT_INFO* ppObjInfo );
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.
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.
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 );
Client: Included in Windows XP and
Windows 2000 Professional.
Server: Included in Windows Server 2003 and
Windows 2000 Server.
Redistributable: Requires Active Directory Client Extension
on Windows NT 4.0 SP6a and Windows 95/98/Me.
Header: Declared in Iads.h.
IDirectoryObject, ADS_OBJECT_INFO, IADs::GetInfo, ADSI Error Codes