📄 dapi.h
字号:
// Will return error
// if file exists and is Unicode
// Will return error if code page is not
// supported by the system
LPWSTR pszDSAName; // Computer name of DSA from which to export
// Default: local DSA (if operating)
// if no local DSA, first DSA found
// on network is used
LPWSTR pszBasePoint; // DN of base-point in DIT for bulk operations
// Default values:
// if NULL, Messaging Site containing bound server
// if empty string, enterprise containing bound server
LPWSTR pszContainer; // RDN of container from which to export objects
// NOTE: This container is assumed to be
// at the level below that indicated by
// the pszBasePoint. If NULL,
// the contents of all containers below
// the BaseImportPoint will be exported.
WCHAR chColSep; // Column Separator --
// DEFAULT_DELIM is used if this value is zero
WCHAR chQuote; // String enclosing character --
// DEFAULT_QUOTE is used if this value is zero
WCHAR chMVSep; // Multi-value Property Separator --
// DEFAULT_MV_SEP is used if this value is zero
WCHAR cReserved; // alignment
CALLBACKPROGRESS ProgressCallBacks; // Progress call-back entry points
ERROR_CALLBACK ErrorCallback;
EXPORT_CALLBACK ExportCallback; // Structure filled in by calling app to
// receive callback on each exported item
// NOTE: Callback functions are optional
// The default export function (write to file)
// will be called if these pointers are NULL
PDAPI_ENTRY pAttributes; // DAPI_ENTRY filled with names of attributes to export
// Optional if pszExportFile specified
// Required if ExportCallback specified
LPWSTR pszHomeServer; // Name of server for server-associated export
LPWSTR * rgpszClasses; // array of pointers to zero-terminated object classes to export
// The last entry must be NULL
// NOTE: The Directory will be queried for objects
// of the classes in the specified order.
ULONG ulUSNBase; // Base USN to use for export restriction.
// If non-zero, only items having USN-Changed >= ulUSNBase will be exported
LPVOID pReserved; // Reserved -- Must be zero
} BEXPORT_PARMSW, *PBEXPORT_PARMSW, *LPBEXPORT_PARMSW;
typedef struct _BEXPORT_PARMSA
{
DWORD dwDAPISignature;
DWORD dwFlags; // Bitmapped flags that control export action
HWND hwndParent; // Windows handle to use when displaying message boxes
LPSTR pszExportFile; // Fully qualified pathname of file to export into
// Ignored if ExportCallback is specified
UINT uCodePage; // Code page specification for export file.
// The following values are interpreted:
// DAPI_UNICODE_FILE Export file is Unicode.
// Will return error
// if file exists and is ANSI
// 0 Auto-detect file type
// If file does not exist,
// export file will contain CP_ACP text.
// If file exists and is ANSI
// export file will contain CP_ACP text.
// If file exists and is Unicode,
// export file will contain Unicode
// other Export text to file in the
// specified code page
// Will return error
// if file exists and is Unicode
// Will return error if code page is not
// supported by the system
LPSTR pszDSAName; // Computer name of DSA from which to export
// Default: local DSA (if operating)
// if no local DSA, first DSA found
// on network is used
LPSTR pszBasePoint; // DN of base-point in DIT for bulk operations
// Default values:
// if NULL, Messaging Site containing bound server
// if empty string, enterprise containing bound server
LPSTR pszContainer; // RDN of container from which to export objects
// NOTE: This container is assumed to be
// at the level below that indicated by
// the pszBasePoint. If NULL,
// the contents of all containers below
// the BaseImportPoint will be exported.
CHAR chColSep; // Column Separator --
// DEFAULT_DELIM is used if this value is zero
CHAR chQuote; // String enclosing character --
// DEFAULT_QUOTE is used if this value is zero
CHAR chMVSep; // Multi-value Property Separator --
// DEFAULT_MV_SEP is used if this value is zero
CHAR cReserved; // alignment
CALLBACKPROGRESS ProgressCallBacks; // Progress call-back entry points
ERROR_CALLBACK ErrorCallback;
EXPORT_CALLBACK ExportCallback; // Structure filled in by calling app to
// receive callback on each exported item
// NOTE: Callback functions are optional
// The default export function (write to file)
// will be called if these pointers are NULL
PDAPI_ENTRY pAttributes; // DAPI_ENTRY filled with names of attributes to export
// Optional if pszExportFile specified
// Required if ExportCallback specified
LPSTR pszHomeServer; // Name of server for server-associated export
LPSTR * rgpszClasses; // array of pointers to zero-terminated object classes to export
// The last entry must be NULL
// NOTE: The Directory will be queried for objects
// of the classes in the specified order.
ULONG ulUSNBase; // Base USN to use for export restriction.
// If non-zero, only items having USN-Changed >= ulUSNBase will be exported
LPVOID pReserved; // Reserved -- Must be zero
} BEXPORT_PARMSA, *PBEXPORT_PARMSA, *LPBEXPORT_PARMSA;
#ifdef UNICODE
typedef BEXPORT_PARMSW BEXPORT_PARMS;
typedef PBEXPORT_PARMSW PBEXPORT_PARMS;
typedef LPBEXPORT_PARMSW LPBEXPORT_PARMS;
#else
typedef BEXPORT_PARMSA BEXPORT_PARMS;
typedef PBEXPORT_PARMSA PBEXPORT_PARMS;
typedef LPBEXPORT_PARMSA LPBEXPORT_PARMS;
#endif
// Batch Export entry points
// The BatchExport function provides single-call BatchExport from the
// specified import file. All import parameters are specified in the
// BEXPORT_PARMS structure pointed to by lpBexportParms.
// The return value indicates the number of errors logged in the
// NT Application log. Please note that this does not indicate
// success or failure of the Batch Export.
// UI and Logging of errors and warnings into the Application log
// are controlled through import parameters.
extern DWORD APIENTRY BatchExportW (LPBEXPORT_PARMSW lpBexportParms);
extern DWORD APIENTRY BatchExportA (LPBEXPORT_PARMSA lpBexportParms);
#ifdef UNICODE
#define BatchExport BatchExportW
#else
#define BatchExport BatchExportA
#endif
/*******************************************************************************
*
* Single-Object Interface definitions
*
********************************************************************************/
typedef struct _DAPI_PARMSW
{
DWORD dwDAPISignature;
DWORD dwFlags; // Bitmapped flags that control import action
// See Import Control flags defined above.
LPWSTR pszDSAName; // Computer name of DSA to update
// Default: local DSA (if operating)
// if no local DSA, first DSA found
// on network is used
LPWSTR pszBasePoint; // DN of base-point in DIT for bulk operations
// Default values:
// if NULL, Messaging Site containing bound server
// if empty string, enterprise containing bound server
LPWSTR pszContainer; // RDN of default container under which
// to perform bulk import operations
// NOTE: This container is assumed to be
// at the level below that indicated by
// the pszBasePoint. If NULL,
// bulk operations will be performed at
// the level below BaseImportPoint.
// Container names specified in the
// import file will override this value.
LPWSTR pszNTDomain; // Name of NT Domain in which to lookup accounts
// and to create NT accounts.
// Current logon domain is used if NULL or empty string.
LPWSTR pszCreateTemplate;// DN of the template object used for default values
PDAPI_ENTRY pAttributes; // DAPI_ENTRY filled with default attribute list
} DAPI_PARMSW, *PDAPI_PARMSW, FAR *LPDAPI_PARMSW;
typedef struct _DAPI_PARMSA
{
DWORD dwDAPISignature;
DWORD dwFlags; // Bitmapped flags that control import action
// See Import Control flags defined above.
LPSTR pszDSAName; // Computer name of DSA to update
// Default: local DSA (if operating)
// if no local DSA, first DSA found
// on network is used
LPSTR pszBasePoint; // DN of base-point in DIT for bulk operations
// Default values:
// if NULL, Messaging Site containing bound server
// if empty string, enterprise containing bound server
LPSTR pszContainer; // RDN of default container under which
// to perform bulk import operations
// NOTE: This container is assumed to be
// at the level below that indicated by
// the pszBasePoint. If NULL,
// bulk operations will be performed at
// the level below BaseImportPoint.
// Container names specified in the
// import file will override this value.
LPSTR pszNTDomain; // Name of NT Domain in which to lookup accounts
// and to create NT accounts.
// Current logon domain is used if NULL or empty string.
LPSTR pszCreateTemplate; // DN of the template object used for default values
PDAPI_ENTRY pAttributes; // DAPI_ENTRY filled with default attribute list
} DAPI_PARMSA, *PDAPI_PARMSA, FAR *LPDAPI_PARMSA;
#ifdef UNICODE
typedef DAPI_PARMSW DAPI_PARMS;
typedef PDAPI_PARMSW PDAPI_PARMS;
typedef LPDAPI_PARMSW LPDAPI_PARMS;
#else
typedef DAPI_PARMSA DAPI_PARMS;
typedef PDAPI_PARMSA PDAPI_PARMS;
typedef LPDAPI_PARMSA LPDAPI_PARMS;
#endif
typedef LPVOID DAPI_HANDLE;
typedef LPVOID * PDAPI_HANDLE;
typedef LPVOID FAR * LPDAPI_HANDLE;
#define DAPI_INVALID_HANDLE ((DAPI_HANDLE) -1)
// DAPIStart initializes a DAPI session.
// for use by DAPIRead and DAPIWrite. The return value is 0 if no errors
// are encountered. A pointer to a DAPI_EVENT structure is returned if an
// error is encountered.
// NOTE: The DAPI_HANDLE must be returned via a call to DAPIEnd.
// If a non-NULL value is returned, its memory must be freed by
// a call to DAPIFreeMemory
extern PDAPI_EVENTW APIENTRY DAPIStartW (LPDAPI_HANDLE lphDAPISession,
LPDAPI_PARMSW lpDAPIParms);
extern PDAPI_EVENTA APIENTRY DAPIStartA (LPDAPI_HANDLE lphDAPISession,
LPDAPI_PARMSA lpDAPIParms);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -