ADsPropGetInitInfo function (adsprop.h)

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

Syntax

BOOL ADsPropGetInitInfo(
  [in]  HWND               hNotifyObj,
  [out] PADSPROPINITPARAMS pInitParams
);

Parameters

[in] hNotifyObj

The handle of the notification object. To obtain this handle, call ADsPropCreateNotifyObj.

[out] pInitParams

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 value

Returns nonzero if successful or zero otherwise.

Remarks

The memory for the pwzCN and pWritableAttrs 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.

Examples

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

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header adsprop.h
Library Dsprop.lib
DLL Dsprop.dll

See also

ADSPROPINITPARAMS

ADsPropCreateNotifyObj