~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to packages/extra/winunits/jwantdsbcli.pas

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2005-05-30 11:59:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050530115910-x5pbzm4qqta4i94h
Tags: 2.0.0-2
debian/fp-compiler.postinst.in: forgot to reapply the patch that
correctly creates the slave link to pc(1).  (Closes: #310907)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{******************************************************************************}
 
2
{                                                                              }
 
3
{ Directory Backup and Restore API interface Unit for Object Pascal            }
 
4
{                                                                              }
 
5
{ Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft          }
 
6
{ Corporation. All Rights Reserved.                                            }
 
7
{                                                                              }
 
8
{ The original file is: ntdsbcli.h, released June 2000. The original Pascal    }
 
9
{ code is: NtDsbCli.pas, released December 2000. The initial developer of the  }
 
10
{ Pascal code is Marcel van Brakel (brakelm att chello dott nl).               }
 
11
{                                                                              }
 
12
{ Portions created by Marcel van Brakel are Copyright (C) 1999-2001            }
 
13
{ Marcel van Brakel. All Rights Reserved.                                      }
 
14
{                                                                              }
 
15
{ Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
 
16
{                                                                              }
 
17
{ You may retrieve the latest version of this file at the Project JEDI         }
 
18
{ APILIB home page, located at http://jedi-apilib.sourceforge.net              }
 
19
{                                                                              }
 
20
{ The contents of this file are used with permission, subject to the Mozilla   }
 
21
{ Public License Version 1.1 (the "License"); you may not use this file except }
 
22
{ in compliance with the License. You may obtain a copy of the License at      }
 
23
{ http://www.mozilla.org/MPL/MPL-1.1.html                                      }
 
24
{                                                                              }
 
25
{ Software distributed under the License is distributed on an "AS IS" basis,   }
 
26
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
 
27
{ the specific language governing rights and limitations under the License.    }
 
28
{                                                                              }
 
29
{ Alternatively, the contents of this file may be used under the terms of the  }
 
30
{ GNU Lesser General Public License (the  "LGPL License"), in which case the   }
 
31
{ provisions of the LGPL License are applicable instead of those above.        }
 
32
{ If you wish to allow use of your version of this file only under the terms   }
 
33
{ of the LGPL License and not to allow others to use your version of this file }
 
34
{ under the MPL, indicate your decision by deleting  the provisions above and  }
 
35
{ replace  them with the notice and other provisions required by the LGPL      }
 
36
{ License.  If you do not delete the provisions above, a recipient may use     }
 
37
{ your version of this file under either the MPL or the LGPL License.          }
 
38
{                                                                              }
 
39
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
 
40
{                                                                              }
 
41
{******************************************************************************}
 
42
 
 
43
// $Id: jwantdsbcli.pas,v 1.1 2005/04/04 07:56:10 marco Exp $
 
44
 
 
45
unit JwaNtDsbCli;
 
46
 
 
47
{$WEAKPACKAGEUNIT}
 
48
 
 
49
{$HPPEMIT ''}
 
50
{$HPPEMIT '#include ":ntdsbcli.h"'}
 
51
{$HPPEMIT ''}
 
52
 
 
53
{$I jediapilib.inc}
 
54
 
 
55
interface
 
56
 
 
57
uses
 
58
  JwaWinType;
 
59
 
 
60
const
 
61
  g_wszBackupAnnotation = 'NTDS Backup Interface';
 
62
  {$EXTERNALSYM g_wszBackupAnnotation}
 
63
  g_aszBackupAnnotation = 'NTDS Backup Interface';
 
64
  {$EXTERNALSYM g_aszBackupAnnotation}
 
65
 
 
66
  g_wszRestoreAnnotation = 'NTDS Restore Interface';
 
67
  {$EXTERNALSYM g_wszRestoreAnnotation}
 
68
  g_aszRestoreAnnotation = 'NTDS Restore Interface';
 
69
  {$EXTERNALSYM g_aszRestoreAnnotation}
 
70
 
 
71
  {$IFDEF UNICODE}
 
72
  g_szBackupAnnotation  = g_wszBackupAnnotation;
 
73
  {$EXTERNALSYM g_szBackupAnnotation}
 
74
  g_szRestoreAnnotation = g_wszRestoreAnnotation;
 
75
  {$EXTERNALSYM g_szRestoreAnnotation}
 
76
  {$ELSE}
 
77
  g_szBackupAnnotation  = g_aszBackupAnnotation;
 
78
  {$EXTERNALSYM g_szBackupAnnotation}
 
79
  g_szRestoreAnnotation = g_aszRestoreAnnotation;
 
80
  {$EXTERNALSYM g_szRestoreAnnotation}
 
81
  {$ENDIF UNICODE}
 
82
 
 
83
// Type of Backup passed to DsBackupPrepare()
 
84
// BACKUP_TYPE_FULL: Requesting backup of the complete DS (DIT, Log files, and Patch files)
 
85
// BACKUP_TYPE_LOGS_ONLY: Requesting backup of only the log files
 
86
// BACKUP_TYPE_INCREMENTAL: Requesting incremental backup i.e. backing up only changes that happened since last backup
 
87
 
 
88
  BACKUP_TYPE_FULL        = $01;
 
89
  {$EXTERNALSYM BACKUP_TYPE_FULL}
 
90
  BACKUP_TYPE_LOGS_ONLY   = $02;
 
91
  {$EXTERNALSYM BACKUP_TYPE_LOGS_ONLY}
 
92
  BACKUP_TYPE_INCREMENTAL = $04; // not supported in product1
 
93
  {$EXTERNALSYM BACKUP_TYPE_INCREMENTAL}
 
94
 
 
95
// Type of Restore passed to DsRestorePrepare()
 
96
// RESTORE_TYPE_AUTHORATATIVE: The restored version wins throughout the enterprise
 
97
// RESTORE_TYPE_ONLINE: Restoration is done when NTDS is online.
 
98
// RESTORE_TYPE_CATCHUP: The restored version is reconciled through the standard reconciliation logic so that the
 
99
//                          restored DIT can catchup with the rest of the enterprise.
 
100
 
 
101
  RESTORE_TYPE_AUTHORATATIVE = $01;
 
102
  {$EXTERNALSYM RESTORE_TYPE_AUTHORATATIVE}
 
103
  RESTORE_TYPE_ONLINE        = $02; // not supported in product1
 
104
  {$EXTERNALSYM RESTORE_TYPE_ONLINE}
 
105
  RESTORE_TYPE_CATCHUP       = $04; // this is the default restore mode
 
106
  {$EXTERNALSYM RESTORE_TYPE_CATCHUP}
 
107
 
 
108
// Setting the current log # to this value would disable incremental/differential backup
 
109
 
 
110
  BACKUP_DISABLE_INCREMENTAL = DWORD($ffffffff);
 
111
  {$EXTERNALSYM BACKUP_DISABLE_INCREMENTAL}
 
112
 
 
113
// BFT is the bit flag used to represent file types (directory/dit/logfile/etc.)
 
114
// We keep them as a character so that we can append/prepend them to the actual file
 
115
// path. The code in the Backup API's rely on the fact that values 0-256 in 8 bit ascii
 
116
// map to the values 0-256 in unicode.
 
117
 
 
118
type
 
119
  {$IFDEF UNICODE}
 
120
  BFT = WCHAR;
 
121
  {$EXTERNALSYM BFT}
 
122
  {$ELSE}
 
123
  BFT = Char;
 
124
  {$EXTERNALSYM BFT}
 
125
  {$ENDIF UNICODE}
 
126
 
 
127
// Bit flags:
 
128
//  BFT_DIRECTORY               - indicates path specified is a directory
 
129
//  BFT_DATABASE_DIRECTORY      - indicates that file goes into database directory
 
130
//  BFT_LOG_DIRECTORY           - indicates that the file goes into log directory
 
131
 
 
132
const
 
133
  BFT_DIRECTORY          = $80;
 
134
  {$EXTERNALSYM BFT_DIRECTORY}
 
135
  BFT_DATABASE_DIRECTORY = $40;
 
136
  {$EXTERNALSYM BFT_DATABASE_DIRECTORY}
 
137
  BFT_LOG_DIRECTORY      = $20;
 
138
  {$EXTERNALSYM BFT_LOG_DIRECTORY}
 
139
 
 
140
// Following combinations are defined for easy use of the filetype and the directory into
 
141
// into which it goes
 
142
 
 
143
  BFT_LOG            = BFT($01 or BFT_LOG_DIRECTORY);
 
144
  BFT_LOG_DIR        = BFT($02 or BFT_DIRECTORY);
 
145
  BFT_CHECKPOINT_DIR = BFT($03 or BFT_DIRECTORY);
 
146
  BFT_NTDS_DATABASE  = BFT($04 or BFT_DATABASE_DIRECTORY);
 
147
  BFT_PATCH_FILE     = BFT($05 or BFT_LOG_DIRECTORY);
 
148
  BFT_UNKNOWN        = BFT($0F);
 
149
 
 
150
// #include <ntdsbmsg.h>
 
151
 
 
152
// Backup Context Handle
 
153
 
 
154
type
 
155
  HBC = Pointer;
 
156
  {$EXTERNALSYM HBC}
 
157
 
 
158
  PEDB_RSTMAPA = ^EDB_RSTMAPA;
 
159
  {$EXTERNALSYM PEDB_RSTMAPA}
 
160
  tagEDB_RSTMAPA = record
 
161
    szDatabaseName: PChar;
 
162
    szNewDtabaseName: PChar;
 
163
  end;
 
164
  {$EXTERNALSYM tagEDB_RSTMAPA}
 
165
  EDB_RSTMAPA = tagEDB_RSTMAPA;
 
166
  {$EXTERNALSYM EDB_RSTMAPA}
 
167
  TEdbRstMapA = EDB_RSTMAPA;
 
168
  PEdbRstMapA = PEDB_RSTMAPA;
 
169
 
 
170
// required for NTDS unicode support.
 
171
// UNDONE: NYI
 
172
 
 
173
  PEDB_RSTMAPW = ^EDB_RSTMAPW;
 
174
  {$EXTERNALSYM PEDB_RSTMAPW}
 
175
  tagEDB_RSTMAPW = record
 
176
    wszDatabaseName: PWCHAR;
 
177
    wszNewDatabaseName: PWCHAR;
 
178
  end;
 
179
  {$EXTERNALSYM tagEDB_RSTMAPW}
 
180
  EDB_RSTMAPW = tagEDB_RSTMAPW;
 
181
  {$EXTERNALSYM EDB_RSTMAPW}
 
182
  TEdbRstMapW = EDB_RSTMAPW;
 
183
  PEdbRstMapW = PEDB_RSTMAPW;
 
184
 
 
185
  {$IFDEF UNICODE}
 
186
  EDB_RSTMAP = EDB_RSTMAPW;
 
187
  {$EXTERNALSYM EDB_RSTMAP}
 
188
  PEDB_RSTMAP = PEDB_RSTMAPW;
 
189
  {$EXTERNALSYM PEDB_RSTMAP}
 
190
  TEdbRstMap = TEdbRstMapW;
 
191
  PEdbRstMap = PEdbRstMapW;
 
192
  {$ELSE}
 
193
  EDB_RSTMAP = EDB_RSTMAPA;
 
194
  {$EXTERNALSYM EDB_RSTMAP}
 
195
  PEDB_RSTMAP = PEDB_RSTMAPA;
 
196
  {$EXTERNALSYM PEDB_RSTMAP}
 
197
  TEdbRstMap = TEdbRstMapA;
 
198
  PEdbRstMap = PEdbRstMapA;
 
199
  {$ENDIF UNICODE}
 
200
 
 
201
{*************************************************************************************
 
202
Routine Description:
 
203
 
 
204
      DsIsNTDSOnline
 
205
        Checks to see if the NTDS is Online on the given server. This call is
 
206
        guaranteed to return quickly.
 
207
 
 
208
  Arguments:
 
209
    [in] szServerName - UNC name of the server to check
 
210
    [out] pfNTDSOnline - pointer to receive the bool result (TRUE if NTDS is
 
211
                            online; FALSE, otherwise)
 
212
 
 
213
Return Value:
 
214
 
 
215
    ERROR_SUCCESS if the call executed successfully;
 
216
    Failure code otherwise.
 
217
**************************************************************************************}
 
218
 
 
219
function DsIsNTDSOnlineA(szServerName: LPCSTR; var pfNTDSOnline: BOOL): HRESULT; stdcall;
 
220
{$EXTERNALSYM DsIsNTDSOnlineA}
 
221
function DsIsNTDSOnlineW(szServerName: LPCWSTR; var pfNTDSOnline: BOOL): HRESULT; stdcall;
 
222
{$EXTERNALSYM DsIsNTDSOnlineW}
 
223
function DsIsNTDSOnline(szServerName: LPCTSTR; var pfNTDSOnline: BOOL): HRESULT; stdcall;
 
224
{$EXTERNALSYM DsIsNTDSOnline}
 
225
 
 
226
{*************************************************************************************
 
227
Routine Description:
 
228
 
 
229
      DsBackupPrepare
 
230
        Prepares the DS for the online backup and returns a Backup Context Handle
 
231
        which should be used in the subsequent calls to other backup functions.
 
232
 
 
233
  Arguments:
 
234
    [in]    szBackupServer - UNC name of the server to be prepared for online backup
 
235
    [in]    grbit - flag to be passed to jet while backing up dbs
 
236
    [in]    btFlag - BACKUP_TYPE_FULL or BACKUP_TYPE_LOGS_ONLY
 
237
    [out]   ppvExpiryToken - pointer that will receive the pointer to the
 
238
                Expiry Token associated with this backup; Client should save
 
239
                this token and send it back through DsRestorePrepare() when
 
240
                attempting a restore; allocated memory should be freed using
 
241
                DsBackupFree() API by the caller when it is no longer needed.
 
242
    [out]   pcbExpiryTokenSize - pointer to receive the size of the expiry token
 
243
                returned.
 
244
    [out]   phbc - pointer that will receive the backup context handle
 
245
 
 
246
Return Value:
 
247
 
 
248
    One of the standard HRESULT success codes;
 
249
    Failure code otherwise.
 
250
**************************************************************************************}
 
251
 
 
252
function DsBackupPrepareA(szBackupServer: LPCSTR; grbit: ULONG; btFlag: ULONG;
 
253
  var ppvExpiryToken: PVOID; var pcbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
 
254
{$EXTERNALSYM DsBackupPrepareA}
 
255
function DsBackupPrepareW(szBackupServer: LPCWSTR; grbit: ULONG; btFlag: ULONG;
 
256
  var ppvExpiryToken: PVOID; var pcbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
 
257
{$EXTERNALSYM DsBackupPrepareW}
 
258
function DsBackupPrepare(szBackupServer: LPCTSTR; grbit: ULONG; btFlag: ULONG;
 
259
  var ppvExpiryToken: PVOID; var pcbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
 
260
{$EXTERNALSYM DsBackupPrepare}
 
261
 
 
262
{*************************************************************************************
 
263
Routine Description:
 
264
 
 
265
      DsBackupGetDatabaseNames
 
266
        Gives the list of data bases that need to be backed up for the given
 
267
        backup context
 
268
 
 
269
  Arguments:
 
270
    [in]    hbc - backup context handle
 
271
    [out]   pszAttachmentInfo - pointer that will receive the pointer to the attachment
 
272
                info; allocated memory should be freed using DsBackupFree() API by the
 
273
                caller when it is no longer needed; Attachment info is an array of
 
274
                null-terminated filenames and and the list is terminated by two-nulls.
 
275
    [out]   pcbSize - will receive the number of bytes returned
 
276
Return Value:
 
277
 
 
278
    One of the standard HRESULT success codes;
 
279
    Failure code otherwise.
 
280
**************************************************************************************}
 
281
 
 
282
function DsBackupGetDatabaseNamesA(hbc: HBC; var pszAttachmentInfo: LPSTR;
 
283
  var pcbSize: DWORD): HRESULT; stdcall;
 
284
{$EXTERNALSYM DsBackupGetDatabaseNamesA}
 
285
function DsBackupGetDatabaseNamesW(hbc: HBC; var pszAttachmentInfo: LPWSTR;
 
286
  var pcbSize: DWORD): HRESULT; stdcall;
 
287
{$EXTERNALSYM DsBackupGetDatabaseNamesW}
 
288
function DsBackupGetDatabaseNames(hbc: HBC; var pszAttachmentInfo: LPTSTR;
 
289
  var pcbSize: DWORD): HRESULT; stdcall;
 
290
{$EXTERNALSYM DsBackupGetDatabaseNames}
 
291
 
 
292
{*************************************************************************************
 
293
Routine Description:
 
294
 
 
295
      DsBackupOpenFile
 
296
        Opens the given attachment for read.
 
297
 
 
298
  Arguments:
 
299
    [in]    hbc - backup context handle
 
300
    [in]    szAttachmentName - name of the attachment to be opened for read
 
301
    [in]    cbReadHintSize - suggested size in bytes that might be used during the
 
302
                subsequent reads on this attachement
 
303
    [out]   pliFileSize - pointer to a large integer that would receive the size in
 
304
                bytes of the given attachment
 
305
Return Value:
 
306
 
 
307
    One of the standard HRESULT success codes;
 
308
    Failure code otherwise.
 
309
**************************************************************************************}
 
310
 
 
311
function DsBackupOpenFileA(hbc: HBC; szAttachmentName: LPCSTR; cbReadHintSize: DWORD;
 
312
  var pliFileSize: LARGE_INTEGER): HRESULT; stdcall;
 
313
{$EXTERNALSYM DsBackupOpenFileA}
 
314
function DsBackupOpenFileW(hbc: HBC; szAttachmentName: LPCWSTR; cbReadHintSize: DWORD;
 
315
  var pliFileSize: LARGE_INTEGER): HRESULT; stdcall;
 
316
{$EXTERNALSYM DsBackupOpenFileW}
 
317
function DsBackupOpenFile(hbc: HBC; szAttachmentName: LPCTSTR; cbReadHintSize: DWORD;
 
318
  var pliFileSize: LARGE_INTEGER): HRESULT; stdcall;
 
319
{$EXTERNALSYM DsBackupOpenFile}
 
320
 
 
321
{*************************************************************************************
 
322
Routine Description:
 
323
 
 
324
      DsBackupRead
 
325
        Reads the currently open attachment bytes into the given buffer. The client
 
326
        application is expected to call this function repeatedly until it gets the
 
327
        entire file (the application would have received the file size through the
 
328
        DsBackupOpenFile() call before.
 
329
 
 
330
  Arguments:
 
331
    [in]    hbc - backup context handle
 
332
    [in]    pvBuffer - pointer to the buffer that would receive the read data.
 
333
    [in]    cbBuffer - specifies the size of the above buffer
 
334
    [out]   pcbRead - pointer to receive the actual number of bytes read.
 
335
Return Value:
 
336
 
 
337
    One of the standard HRESULT success codes;
 
338
    Failure code otherwise.
 
339
**************************************************************************************}
 
340
 
 
341
function DsBackupRead(hbc: HBC; pvBuffer: PVOID; cbBuffer: DWORD; var pcbRead: DWORD): HRESULT; stdcall;
 
342
{$EXTERNALSYM DsBackupRead}
 
343
 
 
344
{*************************************************************************************
 
345
Routine Description:
 
346
 
 
347
      DsBackupClose
 
348
        To be called by the application after it completes reading all the data in
 
349
        the currently opened attachement.
 
350
 
 
351
  Arguments:
 
352
    [in]    hbc - backup context handle
 
353
Return Value:
 
354
 
 
355
    One of the standard HRESULT success codes;
 
356
    Failure code otherwise.
 
357
**************************************************************************************}
 
358
 
 
359
function DsBackupClose(hbc: HBC): HRESULT; stdcall;
 
360
{$EXTERNALSYM DsBackupClose}
 
361
 
 
362
{*************************************************************************************
 
363
Routine Description:
 
364
 
 
365
      DsBackupGetBackupLogs
 
366
        Gives the list of log files that need to be backed up for the given
 
367
        backup context
 
368
 
 
369
  Arguments:
 
370
    [in]    hbc - backup context handle
 
371
    [out]   pszBackupLogFiles - pointer that will receive the pointer to the list of
 
372
                log files; allocated memory should be freed using DsBackupFree() API by the
 
373
                caller when it is no longer needed; Log files are returned in an array of
 
374
                null-terminated filenames and and the list is terminated by two-nulls.
 
375
    [out]   pcbSize - will receive the number of bytes returned
 
376
Return Value:
 
377
 
 
378
    One of the standard HRESULT success codes;
 
379
    Failure code otherwise.
 
380
**************************************************************************************}
 
381
 
 
382
function DsBackupGetBackupLogsA(hbc: HBC; var pszBackupLogFiles: LPSTR;
 
383
  var pcbSize: DWORD): HRESULT; stdcall;
 
384
{$EXTERNALSYM DsBackupGetBackupLogsA}
 
385
function DsBackupGetBackupLogsW(hbc: HBC; var pszBackupLogFiles: LPWSTR;
 
386
  var pcbSize: DWORD): HRESULT; stdcall;
 
387
{$EXTERNALSYM DsBackupGetBackupLogsW}
 
388
function DsBackupGetBackupLogs(hbc: HBC; var pszBackupLogFiles: LPTSTR;
 
389
  var pcbSize: DWORD): HRESULT; stdcall;
 
390
{$EXTERNALSYM DsBackupGetBackupLogs}
 
391
 
 
392
{*************************************************************************************
 
393
Routine Description:
 
394
 
 
395
      DsBackupTruncateLogs
 
396
        Called to truncate the already read backup logs.
 
397
 
 
398
  Arguments:
 
399
    [in]    hbc - backup context handle
 
400
Return Value:
 
401
 
 
402
    One of the standard HRESULT success codes;
 
403
    Failure code otherwise.
 
404
**************************************************************************************}
 
405
 
 
406
function DsBackupTruncateLogs(hbc: HBC): HRESULT; stdcall;
 
407
{$EXTERNALSYM DsBackupTruncateLogs}
 
408
 
 
409
{*************************************************************************************
 
410
Routine Description:
 
411
 
 
412
      DsBackupEnd
 
413
        Called to end the current backup session.
 
414
 
 
415
  Arguments:
 
416
    [in]    hbc - backup context handle of the backup session
 
417
Return Value:
 
418
 
 
419
    One of the standard HRESULT success codes;
 
420
    Failure code otherwise.
 
421
**************************************************************************************}
 
422
 
 
423
function DsBackupEnd(hbc: HBC): HRESULT; stdcall;
 
424
{$EXTERNALSYM DsBackupEnd}
 
425
 
 
426
{*************************************************************************************
 
427
Routine Description:
 
428
 
 
429
      DsBackupFree
 
430
        Should be used by the application to free any buffer allocated by the
 
431
        NTDSBCLI dll.
 
432
 
 
433
  Arguments:
 
434
    [in]    pvBuffer - pointer to the buffer that is to be freed.
 
435
 
 
436
  Return Value:
 
437
    None.
 
438
**************************************************************************************}
 
439
 
 
440
procedure DsBackupFree(pvBuffer: PVOID); stdcall;
 
441
{$EXTERNALSYM DsBackupFree}
 
442
 
 
443
{*************************************************************************************
 
444
Routine Description:
 
445
 
 
446
      DsRestoreGetDatabaseLocations
 
447
        Called both at backup time as well at restoration time to get the data base
 
448
        locations for different types of files.
 
449
 
 
450
  Arguments:
 
451
    [in]    hbc - backup context handle which would have been obtained through
 
452
                    DsBackupPrepare() in the backup case and through DsRestorePrepare()
 
453
                    in the restore case.
 
454
    [out]   pszDatabaseLocationList - pointer that will receive the pointer to the list of
 
455
                database locations; allocated memory should be freed using DsBackupFree() API by the
 
456
                caller when it is no longer needed; locations are returned in an array of
 
457
                null-terminated names and and the list is terminated by two-nulls.
 
458
                The first character of each name is the BFT character that indicates the type
 
459
                of the file and the rest of the name tells gives the path into which that
 
460
                particular type of file should be restored.
 
461
    [out]   pcbSize - will receive the number of bytes returned
 
462
Return Value:
 
463
 
 
464
    One of the standard HRESULT success codes;
 
465
    Failure code otherwise.
 
466
**************************************************************************************}
 
467
 
 
468
function DsRestoreGetDatabaseLocationsA(hbc: HBC; var pszDatabaseLocationList: LPSTR;
 
469
  var pcbSize: DWORD): HRESULT; stdcall;
 
470
{$EXTERNALSYM DsRestoreGetDatabaseLocationsA}
 
471
function DsRestoreGetDatabaseLocationsW(hbc: HBC; var pszDatabaseLocationList: LPWSTR;
 
472
  var pcbSize: DWORD): HRESULT; stdcall;
 
473
{$EXTERNALSYM DsRestoreGetDatabaseLocationsW}
 
474
function DsRestoreGetDatabaseLocations(hbc: HBC; var pszDatabaseLocationList: LPTSTR;
 
475
  var pcbSize: DWORD): HRESULT; stdcall;
 
476
{$EXTERNALSYM DsRestoreGetDatabaseLocations}
 
477
 
 
478
{*************************************************************************************
 
479
Routine Description:
 
480
 
 
481
      DsRestorePrepare
 
482
        Called to indicate beginning of a restore session.
 
483
 
 
484
  Arguments:
 
485
    [in]    szServerName - UNC name of the server into which the restore operation is
 
486
                            going to be performed.
 
487
    [in]    rtFlag -  Or'ed combination of RESTORE_TYPE_* flags; 0 if no special flags
 
488
                            are to be specified
 
489
    [in]    pvExpiryToken - pointer to the expiry token associated with this
 
490
                            backup. The client would have received this when they backed up the DS.
 
491
    [in]    cbExpiryTokenSize - size of the expiry token.
 
492
    [out]   phbc - pointer to receive the backup context handle which is to be passed
 
493
                            to the subsequent restore APIs
 
494
 
 
495
Return Value:
 
496
 
 
497
    One of the standard HRESULT success codes;
 
498
    Failure code otherwise.
 
499
**************************************************************************************}
 
500
 
 
501
function DsRestorePrepareA(szServerName: LPCSTR; rtFlag: ULONG; pvExpiryToken: PVOID;
 
502
  cbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
 
503
{$EXTERNALSYM DsRestorePrepareA}
 
504
function DsRestorePrepareW(szServerName: LPCWSTR; rtFlag: ULONG; pvExpiryToken: PVOID;
 
505
  cbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
 
506
{$EXTERNALSYM DsRestorePrepareW}
 
507
function DsRestorePrepare(szServerName: LPCTSTR; rtFlag: ULONG; pvExpiryToken: PVOID;
 
508
  cbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
 
509
{$EXTERNALSYM DsRestorePrepare}
 
510
 
 
511
{*************************************************************************************
 
512
Routine Description:
 
513
 
 
514
      DsRestoreRegister
 
515
        This will register a restore operation. It will interlock all sbsequent restore
 
516
        operations, and will prevent the restore target from starting until the call
 
517
        to DsRestoreRegisterComplete() is made.
 
518
 
 
519
  Arguments:
 
520
    [in]    hbc - backup context handle for the restore session.
 
521
    [in]    szCheckPointFilePath - path where the check point files are restored
 
522
    [in]    szLogPath - path where the log files are restored
 
523
    [in]    rgrstmap - restore map
 
524
    [in]    crstmap - tells if ther is a new restore map
 
525
    [in]    szBackupLogPath - path where the backup logs are located
 
526
    [in]    genLow - Lowest log# that was restored in this restore session
 
527
    [in]    genHigh - Highest log# that was restored in this restore session
 
528
 
 
529
  Return Value:
 
530
 
 
531
    One of the standard HRESULT success codes;
 
532
    Failure code otherwise.
 
533
**************************************************************************************}
 
534
 
 
535
function DsRestoreRegisterA(hbc: HBC; szCheckPointFilePath, szLogPath: LPCSTR;
 
536
  rgrstmap: PEDB_RSTMAPA; crstmap: LONG; szBackupLogPath: LPCSTR; genLow, genHigh: ULONG): HRESULT; stdcall;
 
537
{$EXTERNALSYM DsRestoreRegisterA}
 
538
function DsRestoreRegisterW(hbc: HBC; szCheckPointFilePath, szLogPath: LPCWSTR;
 
539
  rgrstmap: PEDB_RSTMAPW; crstmap: LONG; szBackupLogPath: LPCWSTR; genLow, genHigh: ULONG): HRESULT; stdcall;
 
540
{$EXTERNALSYM DsRestoreRegisterW}
 
541
function DsRestoreRegister(hbc: HBC; szCheckPointFilePath, szLogPath: LPCTSTR;
 
542
  rgrstmap: PEDB_RSTMAP; crstmap: LONG; szBackupLogPath: LPCTSTR; genLow, genHigh: ULONG): HRESULT; stdcall;
 
543
{$EXTERNALSYM DsRestoreRegister}
 
544
 
 
545
{*************************************************************************************
 
546
Routine Description:
 
547
 
 
548
      DsRestoreRegisterComplete
 
549
        Called to indicate that a previously registered restore is complete.
 
550
 
 
551
  Arguments:
 
552
    [in]    hbc - backup context handle
 
553
    [in]    hrRestoreState - success code if the restore was successful
 
554
Return Value:
 
555
 
 
556
    One of the standard HRESULT success codes;
 
557
    Failure code otherwise.
 
558
**************************************************************************************}
 
559
 
 
560
function DsRestoreRegisterComplete(hbc: HBC; hrRestoreState: HRESULT): HRESULT; stdcall;
 
561
{$EXTERNALSYM DsRestoreRegisterComplete}
 
562
 
 
563
{*************************************************************************************
 
564
Routine Description:
 
565
 
 
566
      DsRestoreEnd
 
567
        Called to end a restore session
 
568
 
 
569
  Arguments:
 
570
    [in]    hbc - backup context handle
 
571
Return Value:
 
572
 
 
573
    One of the standard HRESULT success codes;
 
574
    Failure code otherwise.
 
575
**************************************************************************************}
 
576
 
 
577
function DsRestoreEnd(hbc: HBC): HRESULT; stdcall;
 
578
{$EXTERNALSYM DsRestoreEnd}
 
579
 
 
580
{*************************************************************************************
 
581
Routine Description:
 
582
 
 
583
      DsSetCurrentBackupLog
 
584
        Called to set the current backup log number after a successful restore
 
585
 
 
586
  Arguments:
 
587
    [in]    szServerName - UNC name of the server for which the current backup log has
 
588
                                to be set
 
589
    [in]    dwCurrentLog -  current log number
 
590
Return Value:
 
591
 
 
592
    One of the standard HRESULT success codes;
 
593
    Failure code otherwise.
 
594
**************************************************************************************}
 
595
 
 
596
function DsSetCurrentBackupLogA(szServerName: LPCSTR; dwCurrentLog: DWORD): HRESULT; stdcall;
 
597
{$EXTERNALSYM DsSetCurrentBackupLogA}
 
598
function DsSetCurrentBackupLogW(szServerName: LPCWSTR; dwCurrentLog: DWORD): HRESULT; stdcall;
 
599
{$EXTERNALSYM DsSetCurrentBackupLogW}
 
600
function DsSetCurrentBackupLog(szServerName: LPCTSTR; dwCurrentLog: DWORD): HRESULT; stdcall;
 
601
{$EXTERNALSYM DsSetCurrentBackupLog}
 
602
 
 
603
{*************************************************************************************
 
604
Routine Description:
 
605
 
 
606
      DsSetAuthIdentity
 
607
        Used to set the security context under which the client APIs are to be
 
608
        called. If this function is not called, security context of the current
 
609
        process is assumed.
 
610
 
 
611
  Arguments:
 
612
    [in]    szUserName - name of the user
 
613
    [in]    szDomainName -  name of the domain the user belongs to
 
614
    [in]    szPassword - password of the user in the specified domain
 
615
 
 
616
Return Value:
 
617
 
 
618
    One of the standard HRESULT success codes;
 
619
    Failure code otherwise.
 
620
**************************************************************************************}
 
621
 
 
622
function DsSetAuthIdentityA(szUserName, szDomainName, szPassword: LPCSTR): HRESULT; stdcall;
 
623
{$EXTERNALSYM DsSetAuthIdentityA}
 
624
function DsSetAuthIdentityW(szUserName, szDomainName, szPassword: LPCWSTR): HRESULT; stdcall;
 
625
{$EXTERNALSYM DsSetAuthIdentityW}
 
626
function DsSetAuthIdentity(szUserName, szDomainName, szPassword: LPCTSTR): HRESULT; stdcall;
 
627
{$EXTERNALSYM DsSetAuthIdentity}
 
628
 
 
629
implementation
 
630
 
 
631
const
 
632
  ntdsbclilib = 'ntdsbclilib.dll';
 
633
  {$IFDEF UNICODE}
 
634
  AWSuffix = 'W';
 
635
  {$ELSE}
 
636
  AWSuffix = 'A';
 
637
  {$ENDIF UNICODE}
 
638
 
 
639
{$IFDEF DYNAMIC_LINK}
 
640
 
 
641
var
 
642
  _DsIsNTDSOnlineA: Pointer;
 
643
 
 
644
function DsIsNTDSOnlineA;
 
645
begin
 
646
  GetProcedureAddress(_DsIsNTDSOnlineA, ntdsbclilib, 'DsIsNTDSOnlineA');
 
647
  asm
 
648
        MOV     ESP, EBP
 
649
        POP     EBP
 
650
        JMP     [_DsIsNTDSOnlineA]
 
651
  end;
 
652
end;
 
653
 
 
654
var
 
655
  _DsIsNTDSOnlineW: Pointer;
 
656
 
 
657
function DsIsNTDSOnlineW;
 
658
begin
 
659
  GetProcedureAddress(_DsIsNTDSOnlineW, ntdsbclilib, 'DsIsNTDSOnlineW');
 
660
  asm
 
661
        MOV     ESP, EBP
 
662
        POP     EBP
 
663
        JMP     [_DsIsNTDSOnlineW]
 
664
  end;
 
665
end;
 
666
 
 
667
var
 
668
  _DsIsNTDSOnline: Pointer;
 
669
 
 
670
function DsIsNTDSOnline;
 
671
begin
 
672
  GetProcedureAddress(_DsIsNTDSOnline, ntdsbclilib, 'DsIsNTDSOnline' + AWSuffix);
 
673
  asm
 
674
        MOV     ESP, EBP
 
675
        POP     EBP
 
676
        JMP     [_DsIsNTDSOnline]
 
677
  end;
 
678
end;
 
679
 
 
680
var
 
681
  _DsBackupPrepareA: Pointer;
 
682
 
 
683
function DsBackupPrepareA;
 
684
begin
 
685
  GetProcedureAddress(_DsBackupPrepareA, ntdsbclilib, 'DsBackupPrepareA');
 
686
  asm
 
687
        MOV     ESP, EBP
 
688
        POP     EBP
 
689
        JMP     [_DsBackupPrepareA]
 
690
  end;
 
691
end;
 
692
 
 
693
var
 
694
  _DsBackupPrepareW: Pointer;
 
695
 
 
696
function DsBackupPrepareW;
 
697
begin
 
698
  GetProcedureAddress(_DsBackupPrepareW, ntdsbclilib, 'DsBackupPrepareW');
 
699
  asm
 
700
        MOV     ESP, EBP
 
701
        POP     EBP
 
702
        JMP     [_DsBackupPrepareW]
 
703
  end;
 
704
end;
 
705
 
 
706
var
 
707
  _DsBackupPrepare: Pointer;
 
708
 
 
709
function DsBackupPrepare;
 
710
begin
 
711
  GetProcedureAddress(_DsBackupPrepare, ntdsbclilib, 'DsBackupPrepare' + AWSuffix);
 
712
  asm
 
713
        MOV     ESP, EBP
 
714
        POP     EBP
 
715
        JMP     [_DsBackupPrepare]
 
716
  end;
 
717
end;
 
718
 
 
719
var
 
720
  _DsBackupGetDatabaseNamesA: Pointer;
 
721
 
 
722
function DsBackupGetDatabaseNamesA;
 
723
begin
 
724
  GetProcedureAddress(_DsBackupGetDatabaseNamesA, ntdsbclilib, 'DsBackupGetDatabaseNamesA');
 
725
  asm
 
726
        MOV     ESP, EBP
 
727
        POP     EBP
 
728
        JMP     [_DsBackupGetDatabaseNamesA]
 
729
  end;
 
730
end;
 
731
 
 
732
var
 
733
  _DsBackupGetDatabaseNamesW: Pointer;
 
734
 
 
735
function DsBackupGetDatabaseNamesW;
 
736
begin
 
737
  GetProcedureAddress(_DsBackupGetDatabaseNamesW, ntdsbclilib, 'DsBackupGetDatabaseNamesW');
 
738
  asm
 
739
        MOV     ESP, EBP
 
740
        POP     EBP
 
741
        JMP     [_DsBackupGetDatabaseNamesW]
 
742
  end;
 
743
end;
 
744
 
 
745
var
 
746
  _DsBackupGetDatabaseNames: Pointer;
 
747
 
 
748
function DsBackupGetDatabaseNames;
 
749
begin
 
750
  GetProcedureAddress(_DsBackupGetDatabaseNames, ntdsbclilib, 'DsBackupGetDatabaseNames' + AWSuffix);
 
751
  asm
 
752
        MOV     ESP, EBP
 
753
        POP     EBP
 
754
        JMP     [_DsBackupGetDatabaseNames]
 
755
  end;
 
756
end;
 
757
 
 
758
var
 
759
  _DsBackupOpenFileA: Pointer;
 
760
 
 
761
function DsBackupOpenFileA;
 
762
begin
 
763
  GetProcedureAddress(_DsBackupOpenFileA, ntdsbclilib, 'DsBackupOpenFileA');
 
764
  asm
 
765
        MOV     ESP, EBP
 
766
        POP     EBP
 
767
        JMP     [_DsBackupOpenFileA]
 
768
  end;
 
769
end;
 
770
 
 
771
var
 
772
  _DsBackupOpenFileW: Pointer;
 
773
 
 
774
function DsBackupOpenFileW;
 
775
begin
 
776
  GetProcedureAddress(_DsBackupOpenFileW, ntdsbclilib, 'DsBackupOpenFileW');
 
777
  asm
 
778
        MOV     ESP, EBP
 
779
        POP     EBP
 
780
        JMP     [_DsBackupOpenFileW]
 
781
  end;
 
782
end;
 
783
 
 
784
var
 
785
  _DsBackupOpenFile: Pointer;
 
786
 
 
787
function DsBackupOpenFile;
 
788
begin
 
789
  GetProcedureAddress(_DsBackupOpenFile, ntdsbclilib, 'DsBackupOpenFile' + AWSuffix);
 
790
  asm
 
791
        MOV     ESP, EBP
 
792
        POP     EBP
 
793
        JMP     [_DsBackupOpenFile]
 
794
  end;
 
795
end;
 
796
 
 
797
var
 
798
  _DsBackupRead: Pointer;
 
799
 
 
800
function DsBackupRead;
 
801
begin
 
802
  GetProcedureAddress(_DsBackupRead, ntdsbclilib, 'DsBackupRead');
 
803
  asm
 
804
        MOV     ESP, EBP
 
805
        POP     EBP
 
806
        JMP     [_DsBackupRead]
 
807
  end;
 
808
end;
 
809
 
 
810
var
 
811
  _DsBackupClose: Pointer;
 
812
 
 
813
function DsBackupClose;
 
814
begin
 
815
  GetProcedureAddress(_DsBackupClose, ntdsbclilib, 'DsBackupClose');
 
816
  asm
 
817
        MOV     ESP, EBP
 
818
        POP     EBP
 
819
        JMP     [_DsBackupClose]
 
820
  end;
 
821
end;
 
822
 
 
823
var
 
824
  _DsBackupGetBackupLogsA: Pointer;
 
825
 
 
826
function DsBackupGetBackupLogsA;
 
827
begin
 
828
  GetProcedureAddress(_DsBackupGetBackupLogsA, ntdsbclilib, 'DsBackupGetBackupLogsA');
 
829
  asm
 
830
        MOV     ESP, EBP
 
831
        POP     EBP
 
832
        JMP     [_DsBackupGetBackupLogsA]
 
833
  end;
 
834
end;
 
835
 
 
836
var
 
837
  _DsBackupGetBackupLogsW: Pointer;
 
838
 
 
839
function DsBackupGetBackupLogsW;
 
840
begin
 
841
  GetProcedureAddress(_DsBackupGetBackupLogsW, ntdsbclilib, 'DsBackupGetBackupLogsW');
 
842
  asm
 
843
        MOV     ESP, EBP
 
844
        POP     EBP
 
845
        JMP     [_DsBackupGetBackupLogsW]
 
846
  end;
 
847
end;
 
848
 
 
849
var
 
850
  _DsBackupGetBackupLogs: Pointer;
 
851
 
 
852
function DsBackupGetBackupLogs;
 
853
begin
 
854
  GetProcedureAddress(_DsBackupGetBackupLogs, ntdsbclilib, 'DsBackupGetBackupLogs' + AWSuffix);
 
855
  asm
 
856
        MOV     ESP, EBP
 
857
        POP     EBP
 
858
        JMP     [_DsBackupGetBackupLogs]
 
859
  end;
 
860
end;
 
861
 
 
862
var
 
863
  _DsBackupTruncateLogs: Pointer;
 
864
 
 
865
function DsBackupTruncateLogs;
 
866
begin
 
867
  GetProcedureAddress(_DsBackupTruncateLogs, ntdsbclilib, 'DsBackupTruncateLogs');
 
868
  asm
 
869
        MOV     ESP, EBP
 
870
        POP     EBP
 
871
        JMP     [_DsBackupTruncateLogs]
 
872
  end;
 
873
end;
 
874
 
 
875
var
 
876
  _DsBackupEnd: Pointer;
 
877
 
 
878
function DsBackupEnd;
 
879
begin
 
880
  GetProcedureAddress(_DsBackupEnd, ntdsbclilib, 'DsBackupEnd');
 
881
  asm
 
882
        MOV     ESP, EBP
 
883
        POP     EBP
 
884
        JMP     [_DsBackupEnd]
 
885
  end;
 
886
end;
 
887
 
 
888
var
 
889
  _DsBackupFree: Pointer;
 
890
 
 
891
procedure DsBackupFree;
 
892
begin
 
893
  GetProcedureAddress(_DsBackupFree, ntdsbclilib, 'DsBackupFree');
 
894
  asm
 
895
        MOV     ESP, EBP
 
896
        POP     EBP
 
897
        JMP     [_DsBackupFree]
 
898
  end;
 
899
end;
 
900
 
 
901
var
 
902
  _DsRestoreGetDatabaseLocationsA: Pointer;
 
903
 
 
904
function DsRestoreGetDatabaseLocationsA;
 
905
begin
 
906
  GetProcedureAddress(_DsRestoreGetDatabaseLocationsA, ntdsbclilib, 'DsRestoreGetDatabaseLocationsA');
 
907
  asm
 
908
        MOV     ESP, EBP
 
909
        POP     EBP
 
910
        JMP     [_DsRestoreGetDatabaseLocationsA]
 
911
  end;
 
912
end;
 
913
 
 
914
var
 
915
  _DsRestoreGetDatabaseLocationsW: Pointer;
 
916
 
 
917
function DsRestoreGetDatabaseLocationsW;
 
918
begin
 
919
  GetProcedureAddress(_DsRestoreGetDatabaseLocationsW, ntdsbclilib, 'DsRestoreGetDatabaseLocationsW');
 
920
  asm
 
921
        MOV     ESP, EBP
 
922
        POP     EBP
 
923
        JMP     [_DsRestoreGetDatabaseLocationsW]
 
924
  end;
 
925
end;
 
926
 
 
927
var
 
928
  _DsRestoreGetDatabaseLocations: Pointer;
 
929
 
 
930
function DsRestoreGetDatabaseLocations;
 
931
begin
 
932
  GetProcedureAddress(_DsRestoreGetDatabaseLocations, ntdsbclilib, 'DsRestoreGetDatabaseLocations' + AWSuffix);
 
933
  asm
 
934
        MOV     ESP, EBP
 
935
        POP     EBP
 
936
        JMP     [_DsRestoreGetDatabaseLocations]
 
937
  end;
 
938
end;
 
939
 
 
940
var
 
941
  _DsRestorePrepareA: Pointer;
 
942
 
 
943
function DsRestorePrepareA;
 
944
begin
 
945
  GetProcedureAddress(_DsRestorePrepareA, ntdsbclilib, 'DsRestorePrepareA');
 
946
  asm
 
947
        MOV     ESP, EBP
 
948
        POP     EBP
 
949
        JMP     [_DsRestorePrepareA]
 
950
  end;
 
951
end;
 
952
 
 
953
var
 
954
  _DsRestorePrepareW: Pointer;
 
955
 
 
956
function DsRestorePrepareW;
 
957
begin
 
958
  GetProcedureAddress(_DsRestorePrepareW, ntdsbclilib, 'DsRestorePrepareW');
 
959
  asm
 
960
        MOV     ESP, EBP
 
961
        POP     EBP
 
962
        JMP     [_DsRestorePrepareW]
 
963
  end;
 
964
end;
 
965
 
 
966
var
 
967
  _DsRestorePrepare: Pointer;
 
968
 
 
969
function DsRestorePrepare;
 
970
begin
 
971
  GetProcedureAddress(_DsRestorePrepare, ntdsbclilib, 'DsRestorePrepare' + AWSuffix);
 
972
  asm
 
973
        MOV     ESP, EBP
 
974
        POP     EBP
 
975
        JMP     [_DsRestorePrepare]
 
976
  end;
 
977
end;
 
978
 
 
979
var
 
980
  _DsRestoreRegisterA: Pointer;
 
981
 
 
982
function DsRestoreRegisterA;
 
983
begin
 
984
  GetProcedureAddress(_DsRestoreRegisterA, ntdsbclilib, 'DsRestoreRegisterA');
 
985
  asm
 
986
        MOV     ESP, EBP
 
987
        POP     EBP
 
988
        JMP     [_DsRestoreRegisterA]
 
989
  end;
 
990
end;
 
991
 
 
992
var
 
993
  _DsRestoreRegisterW: Pointer;
 
994
 
 
995
function DsRestoreRegisterW;
 
996
begin
 
997
  GetProcedureAddress(_DsRestoreRegisterW, ntdsbclilib, 'DsRestoreRegisterW');
 
998
  asm
 
999
        MOV     ESP, EBP
 
1000
        POP     EBP
 
1001
        JMP     [_DsRestoreRegisterW]
 
1002
  end;
 
1003
end;
 
1004
 
 
1005
var
 
1006
  _DsRestoreRegister: Pointer;
 
1007
 
 
1008
function DsRestoreRegister;
 
1009
begin
 
1010
  GetProcedureAddress(_DsRestoreRegister, ntdsbclilib, 'DsRestoreRegister' + AWSuffix);
 
1011
  asm
 
1012
        MOV     ESP, EBP
 
1013
        POP     EBP
 
1014
        JMP     [_DsRestoreRegister]
 
1015
  end;
 
1016
end;
 
1017
 
 
1018
var
 
1019
  _DsRestoreRegisterComplete: Pointer;
 
1020
 
 
1021
function DsRestoreRegisterComplete;
 
1022
begin
 
1023
  GetProcedureAddress(_DsRestoreRegisterComplete, ntdsbclilib, 'DsRestoreRegisterComplete');
 
1024
  asm
 
1025
        MOV     ESP, EBP
 
1026
        POP     EBP
 
1027
        JMP     [_DsRestoreRegisterComplete]
 
1028
  end;
 
1029
end;
 
1030
 
 
1031
var
 
1032
  _DsRestoreEnd: Pointer;
 
1033
 
 
1034
function DsRestoreEnd;
 
1035
begin
 
1036
  GetProcedureAddress(_DsRestoreEnd, ntdsbclilib, 'DsRestoreEnd');
 
1037
  asm
 
1038
        MOV     ESP, EBP
 
1039
        POP     EBP
 
1040
        JMP     [_DsRestoreEnd]
 
1041
  end;
 
1042
end;
 
1043
 
 
1044
var
 
1045
  _DsSetCurrentBackupLogA: Pointer;
 
1046
 
 
1047
function DsSetCurrentBackupLogA;
 
1048
begin
 
1049
  GetProcedureAddress(_DsSetCurrentBackupLogA, ntdsbclilib, 'DsSetCurrentBackupLogA');
 
1050
  asm
 
1051
        MOV     ESP, EBP
 
1052
        POP     EBP
 
1053
        JMP     [_DsSetCurrentBackupLogA]
 
1054
  end;
 
1055
end;
 
1056
 
 
1057
var
 
1058
  _DsSetCurrentBackupLogW: Pointer;
 
1059
 
 
1060
function DsSetCurrentBackupLogW;
 
1061
begin
 
1062
  GetProcedureAddress(_DsSetCurrentBackupLogW, ntdsbclilib, 'DsSetCurrentBackupLogW');
 
1063
  asm
 
1064
        MOV     ESP, EBP
 
1065
        POP     EBP
 
1066
        JMP     [_DsSetCurrentBackupLogW]
 
1067
  end;
 
1068
end;
 
1069
 
 
1070
var
 
1071
  _DsSetCurrentBackupLog: Pointer;
 
1072
 
 
1073
function DsSetCurrentBackupLog;
 
1074
begin
 
1075
  GetProcedureAddress(_DsSetCurrentBackupLog, ntdsbclilib, 'DsSetCurrentBackupLog' + AWSuffix);
 
1076
  asm
 
1077
        MOV     ESP, EBP
 
1078
        POP     EBP
 
1079
        JMP     [_DsSetCurrentBackupLog]
 
1080
  end;
 
1081
end;
 
1082
 
 
1083
var
 
1084
  _DsSetAuthIdentityA: Pointer;
 
1085
 
 
1086
function DsSetAuthIdentityA;
 
1087
begin
 
1088
  GetProcedureAddress(_DsSetAuthIdentityA, ntdsbclilib, 'DsSetAuthIdentityA');
 
1089
  asm
 
1090
        MOV     ESP, EBP
 
1091
        POP     EBP
 
1092
        JMP     [_DsSetAuthIdentityA]
 
1093
  end;
 
1094
end;
 
1095
 
 
1096
var
 
1097
  _DsSetAuthIdentityW: Pointer;
 
1098
 
 
1099
function DsSetAuthIdentityW;
 
1100
begin
 
1101
  GetProcedureAddress(_DsSetAuthIdentityW, ntdsbclilib, 'DsSetAuthIdentityW');
 
1102
  asm
 
1103
        MOV     ESP, EBP
 
1104
        POP     EBP
 
1105
        JMP     [_DsSetAuthIdentityW]
 
1106
  end;
 
1107
end;
 
1108
 
 
1109
var
 
1110
  _DsSetAuthIdentity: Pointer;
 
1111
 
 
1112
function DsSetAuthIdentity;
 
1113
begin
 
1114
  GetProcedureAddress(_DsSetAuthIdentity, ntdsbclilib, 'DsSetAuthIdentity' + AWSuffix);
 
1115
  asm
 
1116
        MOV     ESP, EBP
 
1117
        POP     EBP
 
1118
        JMP     [_DsSetAuthIdentity]
 
1119
  end;
 
1120
end;
 
1121
 
 
1122
{$ELSE}
 
1123
 
 
1124
function DsIsNTDSOnlineA; external ntdsbclilib name 'DsIsNTDSOnlineA';
 
1125
function DsIsNTDSOnlineW; external ntdsbclilib name 'DsIsNTDSOnlineW';
 
1126
function DsIsNTDSOnline; external ntdsbclilib name 'DsIsNTDSOnline' + AWSuffix;
 
1127
function DsBackupPrepareA; external ntdsbclilib name 'DsBackupPrepareA';
 
1128
function DsBackupPrepareW; external ntdsbclilib name 'DsBackupPrepareW';
 
1129
function DsBackupPrepare; external ntdsbclilib name 'DsBackupPrepare' + AWSuffix;
 
1130
function DsBackupGetDatabaseNamesA; external ntdsbclilib name 'DsBackupGetDatabaseNamesA';
 
1131
function DsBackupGetDatabaseNamesW; external ntdsbclilib name 'DsBackupGetDatabaseNamesW';
 
1132
function DsBackupGetDatabaseNames; external ntdsbclilib name 'DsBackupGetDatabaseNames' + AWSuffix;
 
1133
function DsBackupOpenFileA; external ntdsbclilib name 'DsBackupOpenFileA';
 
1134
function DsBackupOpenFileW; external ntdsbclilib name 'DsBackupOpenFileW';
 
1135
function DsBackupOpenFile; external ntdsbclilib name 'DsBackupOpenFile' + AWSuffix;
 
1136
function DsBackupRead; external ntdsbclilib name 'DsBackupRead';
 
1137
function DsBackupClose; external ntdsbclilib name 'DsBackupClose';
 
1138
function DsBackupGetBackupLogsA; external ntdsbclilib name 'DsBackupGetBackupLogsA';
 
1139
function DsBackupGetBackupLogsW; external ntdsbclilib name 'DsBackupGetBackupLogsW';
 
1140
function DsBackupGetBackupLogs; external ntdsbclilib name 'DsBackupGetBackupLogs' + AWSuffix;
 
1141
function DsBackupTruncateLogs; external ntdsbclilib name 'DsBackupTruncateLogs';
 
1142
function DsBackupEnd; external ntdsbclilib name 'DsBackupEnd';
 
1143
procedure DsBackupFree; external ntdsbclilib name 'DsBackupFree';
 
1144
function DsRestoreGetDatabaseLocationsA; external ntdsbclilib name 'DsRestoreGetDatabaseLocationsA';
 
1145
function DsRestoreGetDatabaseLocationsW; external ntdsbclilib name 'DsRestoreGetDatabaseLocationsW';
 
1146
function DsRestoreGetDatabaseLocations; external ntdsbclilib name 'DsRestoreGetDatabaseLocations' + AWSuffix;
 
1147
function DsRestorePrepareA; external ntdsbclilib name 'DsRestorePrepareA';
 
1148
function DsRestorePrepareW; external ntdsbclilib name 'DsRestorePrepareW';
 
1149
function DsRestorePrepare; external ntdsbclilib name 'DsRestorePrepare' + AWSuffix;
 
1150
function DsRestoreRegisterA; external ntdsbclilib name 'DsRestoreRegisterA';
 
1151
function DsRestoreRegisterW; external ntdsbclilib name 'DsRestoreRegisterW';
 
1152
function DsRestoreRegister; external ntdsbclilib name 'DsRestoreRegister' + AWSuffix;
 
1153
function DsRestoreRegisterComplete; external ntdsbclilib name 'DsRestoreRegisterComplete';
 
1154
function DsRestoreEnd; external ntdsbclilib name 'DsRestoreEnd';
 
1155
function DsSetCurrentBackupLogA; external ntdsbclilib name 'DsSetCurrentBackupLogA';
 
1156
function DsSetCurrentBackupLogW; external ntdsbclilib name 'DsSetCurrentBackupLogW';
 
1157
function DsSetCurrentBackupLog; external ntdsbclilib name 'DsSetCurrentBackupLog' + AWSuffix;
 
1158
function DsSetAuthIdentityA; external ntdsbclilib name 'DsSetAuthIdentityA';
 
1159
function DsSetAuthIdentityW; external ntdsbclilib name 'DsSetAuthIdentityW';
 
1160
function DsSetAuthIdentity; external ntdsbclilib name 'DsSetAuthIdentity' + AWSuffix;
 
1161
 
 
1162
{$ENDIF DYNAMIC_LINK}
 
1163
 
 
1164
end.