Directory Services

ADsPropGetInitInfo

The ADsPropGetInitInfo function is used to obtain directory object data that an Active Directory property sheet extension applies to.

BOOL ADsPropGetInitInfo(
  HWND hNotifyObject,
  PADSPROPINITPARAMS pInitParams
);

Parameters

hNotifyObject
[in] The handle of the notification object. To obtain this handle, call ADsPropCreateNotifyObj.
pInitParams
[out] Pointer to an ADSPROPINITPARAMS structure that receives the directory object data. The dwSize member of this structure must be entered before calling this function.

Return Values

Returns non-zero if successful or zero otherwise.

Remarks

The memory for the pwzCN and pWrittableAttrs members is allocated by the ADsPropGetInitInfo function. This memory is freed by the system after all property sheet objects are destroyed. The reference count for the interface pointer in pDsObj is not incremented by calling ADsPropGetInitInfo, so the interface must not be released by the caller.

For multiple-selection property sheets, the system only binds to the first object in the DSOBJECT array. Because of this, ADsPropGetInitInfo only supplies the IDirectoryObject and writable attributes for the first object in the array. The other objects in the array are not bound to.

Example Code [C++]

The following code example shows how to use the ADsPropGetInitInfo function.

HRESULT GetADsPageInfo(HWND hwndNotifyObject, ADSPROPINITPARAMS *pip)
{
	if((NULL == pip) || (!IsWindow(hwndNotifyObject)))
	{
		return E_INVALIDARG;
}

	ADSPROPINITPARAMS   InitParams;

	InitParams.dwSize = sizeof(ADSPROPINITPARAMS);
	if(ADsPropGetInitInfo(hwndNotifyObject, &InitParams))
	{
		*pip = InitParams;

		return InitParams.hr;
}

	return E_FAIL;
}

Requirements

Client: Included in Windows XP and Windows 2000 Professional.
Server: Included in Windows Server 2003 and Windows 2000 Server.
Header: Declared in Adsprop.h.
Library: Use DsProp.lib.

See Also

ADsPropCreateNotifyObj, ADSPROPINITPARAMS