📄 dapi.h
字号:
#ifdef UNICODE
#define DAPIStart DAPIStartW
#else
#define DAPIStart DAPIStartA
#endif
// DAPIEnd invalidates the DAPI_HANDLE obtained by the call to DAPIStart.
// NOTE: There are no separate Unicode / Ansi entry points defined
extern void APIENTRY DAPIEnd (LPDAPI_HANDLE lphDAPISession);
// DAPIRead() Reads indicated attributes from the named Directory Object
// Parameters:
// Returned value: NULL indicates no difficulties encountered.
// Else, pointer to structure containing description of
// error(s) or warning(s) encountered.
// Must be freed by call to DAPIFreeMemory.
// hDAPISession DAPI Session handle obtained via InitDAPISession
// dwFlags control operation
// pszObjectName String containing name of object to read.
// If specified as RDN, combined w/ session's
// pszBasePoint and pszParentContainer.
// If specified w/ prefix of "/cn=", the string
// is concatenated to the session pszBasePoint.
// If specified w/ prefix of "/o=", the string
// is taken to be a fully-qualified DN.
// pAttList Pointer to DAPI_ENTRY structure containing names of
// attributes to read. The session default list is
// overridden for the present call only.
// ppValues Address of variable receiving pointer to DAPI_ENTRY
// structure containing the values read from the DIT entry.
// The pointer returned must be freed by call to
// DAPIFreeMemory.
// ppAttributes Address of variable receiving pointer to DAPI_ENTRY
// structure containing the names of attributes read
// from the DIT IFF DAPI_ALL_ATTRIBUTES or DAPI_LEGAL_ATTRIBUTES
// were set in dwFlags.
// The pointer returned must be freed by call to
// DAPIFreeMemory.
extern PDAPI_EVENTW APIENTRY DAPIReadW (DAPI_HANDLE hDAPISession,
DWORD dwFlags,
LPWSTR pszObjectName,
PDAPI_ENTRY pAttList,
PDAPI_ENTRY * ppValues,
PDAPI_ENTRY * ppAttributes);
extern PDAPI_EVENTA APIENTRY DAPIReadA (DAPI_HANDLE hDAPISession,
DWORD dwFlags,
LPSTR pszObjectName,
PDAPI_ENTRY pAttList,
PDAPI_ENTRY * ppValues,
PDAPI_ENTRY * ppAttributes);
#ifdef UNICODE
#define DAPIRead DAPIReadW
#else
#define DAPIRead DAPIReadA
#endif
// DAPIWrite()
// Perform the indicated write operation on the named object
// Returned value: NULL indicates no difficulties encountered.
// Else, pointer to structure containing description of
// error(s) or warning(s) encountered.
// Must be freed by call to DAPIFreeMemory.
// Parameters:
// hDAPISession DAPI Session handle obtained via InitDAPISession
// dwFlags Operational control
// pAttributes Pointer to DAPI_ENTRY structure containing names of
// attributes to write. The session default list is
// used if this parameter is NULL
// pValues Pointer to DAPI_ENTRY structure containing the values
// to set on the DIT entry.
// lpulUSN Optional: Address of variable receiving USN of updated
// DIT entry. May be specified as NULL to suppress this
// return value.
// lppszCreatedAccount Address receiving pointer to name of created NT account
// lppszPassword Address receiving pointer to password generated if
// NT Account is created.
extern PDAPI_EVENTW APIENTRY DAPIWriteW (DAPI_HANDLE hDAPISession,
DWORD dwFlags,
PDAPI_ENTRY pAttributes,
PDAPI_ENTRY pValues,
PULONG lpulUSN,
LPWSTR * lppszCreatedAccount,
LPWSTR * lppszPassword);
extern PDAPI_EVENTA APIENTRY DAPIWriteA (DAPI_HANDLE hDAPISession,
DWORD dwFlags,
PDAPI_ENTRY pAttributes,
PDAPI_ENTRY pValues,
PULONG lpulUSN,
LPSTR * lppszCreatedAccount,
LPSTR * lppszPassword);
#ifdef UNICODE
#define DAPIWrite DAPIWriteW
#else
#define DAPIWrite DAPIWriteA
#endif
/*******************************************************************************
* procedure : DAPIAllocBuffer
*
* purpose : Allocate buffer, logically linking it to the pvAllocBase
* The first buffer in logically linked set of allocations must be
* freed by call to DAPIFreeMemory
*
* parameters : cbSize dword containing size of allocation request (in bytes)
* pvAllocBase base for logical linking of allocated block
* May be NULL
* If non-NULL, must be a block previously allocated
* by DAPIAllocBuffer or returned by DAPI function
*
* returns : ptr to allocated block
*
* history :
*
********************************************************************************/
extern LPVOID APIENTRY DAPIAllocBuffer (DWORD cbSize, LPVOID pvAllocBase);
/*******************************************************************************
* procedure : DAPIFreeMemory
*
* purpose : Release memory allocated for structures returned by DAPI calls.
*
* parameters : lpVoid pointer to block to free
*
* returns : nothing
*
* history :
*
********************************************************************************/
extern void APIENTRY DAPIFreeMemory (LPVOID lpVoid);
/*
* NetUserList interface definitions
*/
// When getting callbacks from NTExport / NWExport, these indices
// can be used to interpret the value array returned in the callback
// >>>> NOTE: These indices are NOT valid for Bexport callback! <<<<
#define NET_CLASS 0
#define NET_COMMON_NAME 1
#define NET_DISPLAY_NAME 2
#define NET_HOME_SERVER 3
#define NET_COMMENT 4 /* NTExport only */
#define NTEXP_ENTRY_COUNT 5 /* number of parts in NT User export */
#define NWEXP_ENTRY_COUNT 4 /* number of parts in NetWare user export */
/*******************************************************************************
*
* NTIMPORT Interface definitions
*
********************************************************************************/
typedef struct _NTEXPORT_PARMSW
{
DWORD dwDAPISignature;
DWORD dwFlags; // Bitmapped flags that control the user export
HWND hwndParent; // Windows handle to use when displaying message boxes
LPWSTR pszExportFile; // Name of file to create
// Ignored if using callbacks
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
LPWSTR pszDCName; // Name of Domain Controller from which to get users
// NOTE: Specification of Domain Controller overrides
// the NTDomain
LPWSTR pszNTDomain; // Name of Domain from which to read users
// If neither pszNTDomain and pszDCName are specified,
// users are extracted from the current login domain
} NTEXPORT_PARMSW, *PNTEXPORT_PARMSW, FAR *LPNTEXPORT_PARMSW;
typedef struct _NTEXPORT_PARMSA
{
DWORD dwDAPISignature;
DWORD dwFlags; // Bitmapped flags that control the user export
HWND hwndParent; // Windows handle to use when displaying message boxes
LPSTR pszExportFile; // Name of file to create
// Ignored if using callbacks
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
LPSTR pszDCName; // NOTE: Specification of Domain Controller overrides
// the NTDomain
// Name of Domain from which to read users
LPSTR pszNTDomain; // If neither pszNTDomain and pszDCName are specified,
// users are extracted from the current login domain
} NTEXPORT_PARMSA, *PNTEXPORT_PARMSA, FAR *LPNTEXPORT_PARMSA;
#ifdef UNICODE
typedef NTEXPORT_PARMSW NTEXPORT_PARMS;
typedef PNTEXPORT_PARMSW PNTEXPORT_PARMS;
typedef LPNTEXPORT_PARMSW LPNTEXPORT_PARMS;
#else
typedef NTEXPORT_PARMSA NTEXPORT_PARMS;
typedef PNTEXPORT_PARMSA PNTEXPORT_PARMS;
typedef LPNTEXPORT_PARMSA LPNTEXPORT_PARMS;
#endif
extern DWORD APIENTRY NTExportW (LPNTEXPORT_PARMSW pNTExportParms);
extern DWORD APIENTRY NTExportA (LPNTEXPORT_PARMSA pNTExportParms);
#ifdef UNICODE
#define NTExport NTExportW
#else
#define NTExport NTExportA
#endif
/*******************************************************************************
*
* NWIMPORT Interface definitions
*
********************************************************************************/
typedef struct _NWEXPORT_PARMSW
{
DWORD dwDAPISignature;
DWORD dwFlags; // Bitmapped flags that control the user export
HWND hwndParent; // Windows handle to use when displaying message boxes
LPWSTR pszExportFile; // Name of file to create
// Ignored if using callbacks
CALLBACKPROGRESS ProgressCallBacks;// Progress call-back entry points
E
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -