Export (0) Print
Expand All

IDirectoryObject::GetObjectInformation method

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

ppObjInfo [out]

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

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Iads.h

DLL

Activeds.dll

IID

IID_IDirectoryObject is defined as E798DE2C-22E4-11D0-84FE-00C04FD8D503

See also

IDirectoryObject
ADS_OBJECT_INFO
IADs::GetInfo
ADSI Error Codes

 

 

Show:
© 2014 Microsoft