DAPIStart

The DAPIStart function initializes a directory operation session.

Quick Info

Header file: DAPI.H
Library: DAPI.LIB
Unicode: Yes

PDAPI_EVENT DAPIStart (
  LPDAPI_HANDLE lphDAPISession,  
  LPDAPI_PARMS lpDAPIParms       
);
 

Parameters

lphDAPISession
Output parameter. Points to the handle of the directory operation session.
lpDAPIParms
Input parameter. Points to a DAPI_PARMS structure containing the directory interface object.

Note The value of the lpDAPIParms->pAttributes parameter member takes precedence over any conflicting lpDAPIParms->dwFlags parameter member values.

Return Values

NULL
No errors were encountered.
A pointer to a DAPI_EVENT structure
An error was encountered.

Note If you set the DAPI_EVENT_MIN bit in the lpDAPIParms->dwFlags parameter member, DAPIStart does not return a pointer to a DAPI_EVENT structure if it encounters an error. If an error occurs when you set the DAPI_EVENT_MIN bit in lpDAPIParms->dwFlags, the pointer to the directory operation session handle, lphDAPISession, is 0xFFFFFFFF.

Remarks

You can have no more than ten directory operation sessions open simultaneously.

The DAPI_HANDLE returned in lphDAPISession must be released through a call to DAPIEnd.

If the return value is non-NULL, you must release the DAPI_EVENT structure with a call to DAPIFreeMemory before your program exits.

For more information on this function, see Using Directory Access Functions.

See Also

DAPIRead, DAPIWrite