📄 dapi.h
字号:
#pragma option push -b -a8 -pc -A- /*P_O_Push*/
/*******************************************************************
*
* Copyright (c) Microsoft Corp. 1986-1996. All Rights Reserved.
*
*
* DESCRIPTION: This header file defines the functions, structures,
* and macros used to access the Microsoft Exchange
* APIs for modifying entries in the Exchange 4.0 DIT.
* These APIs permit a calling process to create,
* modify, or delete DIT objects by specifying the
* name of a CSV text file containing attributes
* for objects to import into ( or to modify)
* the DIT. See the Directory Access Functions
* section of the Exchange Developer's Kit for
* more detailed description of this interface.
*
* Calling programs must link with DAPI.LIB.
*
* Error and warning codes are defined in DAPIMSG.H
*
*
*******************************************************************/
/** include files **/
#ifndef _WINDOWS_
#include <windows.h>
#endif
/** local definitions **/
#ifndef _DAPI_INCLUDED_
#define _DAPI_INCLUDED_
#ifdef __cplusplus
extern "C"
{
#endif
// Import / Export APIs check for the presence of this signature in
// the dwDAPISignature field in the import parameter blocks.
// This signature will be incremented each time one of the parameter
// blocks is changed so that header synchronization problems can be
// detected.
#define DAPI_SIGNATURE 0x46414400
// Combinable flags used to control the API functions.
// The following flags control filtering of DAPI events
// The default action is DAPI_EVENT_ALL
#define DAPI_EVENT_MASK 0x00000007 /* bit-field containing event-filtering requested
if none of these bits are set, DAPI_EVENT_ALL is assumed */
#define DAPI_EVENT_MIN 0x00000001 /* No warning or error logging.
Log start and stop messages */
#define DAPI_EVENT_SOME 0x00000002 /* Start, Stop, and Error messages will be logged. */
#define DAPI_EVENT_ALL 0x00000004 /* Start, Stop, Error, and Warning messages
will be logged. */
// The following flags control schema read and use of the schema
#define DAPI_FORCE_SCHEMA_LOAD 0x00000010 /* Unload previously loaded schema
and read schema again.
Default action is to re-use
previously loaded schema if read
from the same messaging domain */
#define DAPI_RAW_MODE 0x00000020 /* Import / Export in "Raw" mode. Import
lines are taken literally. No
attributes will be inherited,
constructed, etc. Aliases for
attribute and class names will
not be recognized. */
#define DAPI_OVERRIDE_CONTAINER 0x00000040 /* Container specified in the parameter block
overrides the contents of the container column.
Default behaviour is for the value specified
in the Obj-Container column to override
that specified in the parameter block */
#define DAPI_IMPORT_NO_ERR_FILE 0x00000080 /* Do not create Error File -- BatchImport only */
#define DAPI_IMPORT_WRITE_THROUGH 0x00400000 /* Commit write operations immediately */
// Flags defined for "Batch" operations only -- ignored by DAPIRead, DAPIWrite
#define DAPI_YES_TO_ALL 0x00000100 /* Force "yes" response on any
user-prompt UI
(i.e., continue w/o proxy addresses, etc.) */
#define DAPI_SUPPRESS_PROGRESS 0x00000200 /* Suppress progress thermometer on batch operations.
Default is to display progress */
#define DAPI_SUPPRESS_COMPLETION 0x00000400 /* Suppress completion notification message box on batch operations */
#define DAPI_SUPPRESS_ARCHIVES 0x00000800 /* Suppress creation of "archive" copies
of output files -- BatchImport and BatchExport only*/
// Flags defined for BatchExport
#define DAPI_EXPORT_MAILBOX 0x00001000 /* Export Mailbox recipients */
#define DAPI_EXPORT_CUSTOM 0x00002000 /* Export remote address recipients */
#define DAPI_EXPORT_DIST_LIST 0x00004000 /* Export Distribution Lists */
#define DAPI_EXPORT_RECIPIENTS (DAPI_EXPORT_MAILBOX | DAPI_EXPORT_CUSTOM | DAPI_EXPORT_DIST_LIST)
/* Export all recipient objects */
#define DAPI_EXPORT_ALL_CLASSES 0x00008000 /* If this flag is set, all objects meeting other restrictions
(i.e., USN level, container scope, etc.) will be exported,
regardless of class */
#define DAPI_EXPORT_HIDDEN 0x00010000 /* Include Hidden objects in export.
Default is no export if Hide-From-Address-Book */
#define DAPI_EXPORT_SUBTREE 0x00020000 /* Traverse the Directory Information Tree hierarchy,
exporting objects that meet the export restrictions */
#define DAPI_EXPORT_BASEPOINT_ONLY 0x00040000 /* Export only the requested attributes from
the named BasePoint object. All other
export restrictions are ignored (class flags,
rgpszClasses, pszServerName).
This flag implies DAPI_SUPPRESS_PROGRESS
and DAPI_SUPPRESS_COMPLETION */
// Flags defined only for BatchImport
#define DAPI_OVERRIDE_SYNCH_STATE 0x00080000 /* Override server's synchronization status,
normally checked on BatchImport.
NOTE: This flag should normally NOT be set.
The normal behaviour is to prevent BatchImport
operations from possible conflict with directory
synchronization */
// Flags defined only for DAPIRead
#define DAPI_READ_DEFINED_ATTRIBUTES 0x00100000 /* return all attributes that are set
for the current object.
This flag is ignored if pAttributes is specified. */
#define DAPI_READ_ALL_ATTRIBUTES 0x00200000 /* return all attributes that are defined
for the class of the current object.
This flag is ignored if pAttributes is specified. */
// The following flags control NT Security management
#define DAPI_RESTRICT_ACCESS 0x01000000 /* Apply NT Security Descriptor to
created objects */
#define DAPI_CREATE_NT_ACCOUNT 0x02000000 /* Create NT accounts
(valid only in Create/Modify mode) */
#define DAPI_CREATE_RANDOM_PASSWORD 0x04000000 /* Generate random passwords for
created NT accounts. Ignored if DAPI_CREATE_NT_ACCOUNT
is not set */
#define DAPI_DELETE_NT_ACCOUNT 0x08000000 /* Delete ASSOC-NT-ACCOUNT when
deleting mailbox */
// Flags defined only for DAPIWrite
#define DAPI_MODIFY_REPLACE_PROPERTIES 0x00800000 /* Append values to multi-value attributes when modifying */
#define DAPI_WRITE_UPDATE 0x10000000 /* Modify if object exists, create if it doesn't.
NOTE: This is the default mode */
#define DAPI_WRITE_CREATE 0x20000000 /* Create object -- fail if object exists */
#define DAPI_WRITE_MODIFY 0x30000000 /* Modify object -- fail if object does not exist */
#define DAPI_WRITE_DELETE 0x40000000 /* Delete object */
#define DAPI_WRITE_MODE_MASK 0x70000000
// Callback flags
#define DAPI_CALLBACK_CHAIN 0x00000001 /* If set in dwFlags field of the ERROR_CALLBACK
and the CALLBACKPROGRESS structures, the default
handler will be invoked after calling out to the
caller-supplied handler function, unless the user
function returns FALSE, indicating cancel.
NOTE: This flag is not defined for the EXPORT_CALLBACK
structure.
NOTE: This flag should not be set in the dwFlags
field of the main parameter block */
// default delimiter values used when parsing the import file
#define DAPI_DEFAULT_DELIMA ','
#define DAPI_DEFAULT_QUOTEA '"'
#define DAPI_DEFAULT_MV_SEPA '%'
#define DAPI_DEFAULT_DELIMW L','
#define DAPI_DEFAULT_QUOTEW L'"'
#define DAPI_DEFAULT_MV_SEPW L'%'
#define DAPI_CTRL_FILE_PTRA '='
#define DAPI_CTRL_FILE_PTRW L'='
#define DAPI_CTRL_ANR_PREFIXA '='
#define DAPI_CTRL_ANR_PREFIXW L'='
#define DAPI_CTRL_META_CHARA '~'
#define DAPI_CTRL_META_CHARW L'~'
#define pszSubstServerA "~SERVER"
#define pszSubstServerW L"~SERVER"
#define cchSubstServer ((sizeof (pszSubstServerA) / sizeof(CHAR)) - 1)
#define pszDeleteKeyA "~DEL"
#define pszDeleteKeyW L"~DEL"
#define cchDeleteKey ((sizeof (pszDeleteKeyA) / sizeof(CHAR)) - 1)
#define DAPI_UNICODE_FILE ((UINT)-1)
#ifdef UNICODE
#define DAPI_DEFAULT_DELIM DAPI_DEFAULT_DELIMW
#define DAPI_DEFAULT_QUOTE DAPI_DEFAULT_QUOTEW
#define DAPI_DEFAULT_MV_SEP DAPI_DEFAULT_MV_SEPW
#define DAPI_CTRL_FILE_PTR DAPI_CTRL_FILE_PTRW
#define DAPI_CTRL_ANR_PREFIX DAPI_CTRL_ANR_PREFIXW
#define DAPI_CTRL_META_CHAR DAPI_CTRL_META_CHARW
#define pszSubstServer pszSubstServerW
#define pszDeleteKey pszDeleteKeyW
#else
#define DAPI_DEFAULT_DELIM DAPI_DEFAULT_DELIMA
#define DAPI_DEFAULT_QUOTE DAPI_DEFAULT_QUOTEA
#define DAPI_DEFAULT_MV_SEP DAPI_DEFAULT_MV_SEPA
#define DAPI_CTRL_FILE_PTR DAPI_CTRL_FILE_PTRA
#define DAPI_CTRL_ANR_PREFIX DAPI_CTRL_ANR_PREFIXA
#define DAPI_CTRL_META_CHAR DAPI_CTRL_META_CHARA
#define pszSubstServer pszSubstServerA
#define pszDeleteKey pszDeleteKeyA
#endif
/*******************************************************************************
* Batch Operation Progress Callback Function Definitions
* Pointers to functions of these types are provided by the caller via the
* CALLBACKPROGRESS structure in the Batch function parameter block
*
********************************************************************************
*
* procedure : PDAPI_FInitProgress
*
* purpose : Initialize progress handler (possibly progress display dialog)
*
* parameters : lpvAppDefined value provided in the progress callback structure
* nMac Maximum Anticipated Calls. If non-zero, this indicates
* the number of progress events anticipated.
* If zero, the number of items to process is unknown,
* so the number of calls to UpdateProgress is indeterminate.
*
* returns : TRUE Indicates that all is well
* FALSE Could not initialize progress handler, cancel session.
*
********************************************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -