jwantdsbcli.pas 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159
  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. // $Id: JwaNtDsbCli.pas,v 1.10 2005/09/06 16:36:50 marquardt Exp $
  43. unit JwaNtDsbCli;
  44. {$WEAKPACKAGEUNIT}
  45. {$HPPEMIT ''}
  46. {$HPPEMIT '#include ":ntdsbcli.h"'}
  47. {$HPPEMIT ''}
  48. {$I jediapilib.inc}
  49. interface
  50. uses
  51. JwaWindows;
  52. const
  53. g_wszBackupAnnotation = 'NTDS Backup Interface';
  54. {$EXTERNALSYM g_wszBackupAnnotation}
  55. g_aszBackupAnnotation = 'NTDS Backup Interface';
  56. {$EXTERNALSYM g_aszBackupAnnotation}
  57. g_wszRestoreAnnotation = 'NTDS Restore Interface';
  58. {$EXTERNALSYM g_wszRestoreAnnotation}
  59. g_aszRestoreAnnotation = 'NTDS Restore Interface';
  60. {$EXTERNALSYM g_aszRestoreAnnotation}
  61. {$IFDEF UNICODE}
  62. g_szBackupAnnotation = g_wszBackupAnnotation;
  63. {$EXTERNALSYM g_szBackupAnnotation}
  64. g_szRestoreAnnotation = g_wszRestoreAnnotation;
  65. {$EXTERNALSYM g_szRestoreAnnotation}
  66. {$ELSE}
  67. g_szBackupAnnotation = g_aszBackupAnnotation;
  68. {$EXTERNALSYM g_szBackupAnnotation}
  69. g_szRestoreAnnotation = g_aszRestoreAnnotation;
  70. {$EXTERNALSYM g_szRestoreAnnotation}
  71. {$ENDIF UNICODE}
  72. // Type of Backup passed to DsBackupPrepare()
  73. // BACKUP_TYPE_FULL: Requesting backup of the complete DS (DIT, Log files, and Patch files)
  74. // BACKUP_TYPE_LOGS_ONLY: Requesting backup of only the log files
  75. // BACKUP_TYPE_INCREMENTAL: Requesting incremental backup i.e. backing up only changes that happened since last backup
  76. BACKUP_TYPE_FULL = $01;
  77. {$EXTERNALSYM BACKUP_TYPE_FULL}
  78. BACKUP_TYPE_LOGS_ONLY = $02;
  79. {$EXTERNALSYM BACKUP_TYPE_LOGS_ONLY}
  80. BACKUP_TYPE_INCREMENTAL = $04; // not supported in product1
  81. {$EXTERNALSYM BACKUP_TYPE_INCREMENTAL}
  82. // Type of Restore passed to DsRestorePrepare()
  83. // RESTORE_TYPE_AUTHORATATIVE: The restored version wins throughout the enterprise
  84. // RESTORE_TYPE_ONLINE: Restoration is done when NTDS is online.
  85. // RESTORE_TYPE_CATCHUP: The restored version is reconciled through the standard reconciliation logic so that the
  86. // restored DIT can catchup with the rest of the enterprise.
  87. RESTORE_TYPE_AUTHORATATIVE = $01;
  88. {$EXTERNALSYM RESTORE_TYPE_AUTHORATATIVE}
  89. RESTORE_TYPE_ONLINE = $02; // not supported in product1
  90. {$EXTERNALSYM RESTORE_TYPE_ONLINE}
  91. RESTORE_TYPE_CATCHUP = $04; // this is the default restore mode
  92. {$EXTERNALSYM RESTORE_TYPE_CATCHUP}
  93. // Setting the current log # to this value would disable incremental/differential backup
  94. BACKUP_DISABLE_INCREMENTAL = DWORD($ffffffff);
  95. {$EXTERNALSYM BACKUP_DISABLE_INCREMENTAL}
  96. // BFT is the bit flag used to represent file types (directory/dit/logfile/etc.)
  97. // We keep them as a character so that we can append/prepend them to the actual file
  98. // path. The code in the Backup API's rely on the fact that values 0-256 in 8 bit ascii
  99. // map to the values 0-256 in unicode.
  100. type
  101. {$IFDEF UNICODE}
  102. BFT = WCHAR;
  103. {$EXTERNALSYM BFT}
  104. {$ELSE}
  105. BFT = Char;
  106. {$EXTERNALSYM BFT}
  107. {$ENDIF UNICODE}
  108. // Bit flags:
  109. // BFT_DIRECTORY - indicates path specified is a directory
  110. // BFT_DATABASE_DIRECTORY - indicates that file goes into database directory
  111. // BFT_LOG_DIRECTORY - indicates that the file goes into log directory
  112. const
  113. BFT_DIRECTORY = $80;
  114. {$EXTERNALSYM BFT_DIRECTORY}
  115. BFT_DATABASE_DIRECTORY = $40;
  116. {$EXTERNALSYM BFT_DATABASE_DIRECTORY}
  117. BFT_LOG_DIRECTORY = $20;
  118. {$EXTERNALSYM BFT_LOG_DIRECTORY}
  119. // Following combinations are defined for easy use of the filetype and the directory into
  120. // into which it goes
  121. BFT_LOG = BFT($01 or BFT_LOG_DIRECTORY);
  122. BFT_LOG_DIR = BFT($02 or BFT_DIRECTORY);
  123. BFT_CHECKPOINT_DIR = BFT($03 or BFT_DIRECTORY);
  124. BFT_NTDS_DATABASE = BFT($04 or BFT_DATABASE_DIRECTORY);
  125. BFT_PATCH_FILE = BFT($05 or BFT_LOG_DIRECTORY);
  126. BFT_UNKNOWN = BFT($0F);
  127. // #include <ntdsbmsg.h>
  128. // Backup Context Handle
  129. type
  130. HBC = Pointer;
  131. {$EXTERNALSYM HBC}
  132. PEDB_RSTMAPA = ^EDB_RSTMAPA;
  133. {$EXTERNALSYM PEDB_RSTMAPA}
  134. tagEDB_RSTMAPA = record
  135. szDatabaseName: PChar;
  136. szNewDtabaseName: PChar;
  137. end;
  138. {$EXTERNALSYM tagEDB_RSTMAPA}
  139. EDB_RSTMAPA = tagEDB_RSTMAPA;
  140. {$EXTERNALSYM EDB_RSTMAPA}
  141. TEdbRstMapA = EDB_RSTMAPA;
  142. PEdbRstMapA = PEDB_RSTMAPA;
  143. // required for NTDS unicode support.
  144. // UNDONE: NYI
  145. PEDB_RSTMAPW = ^EDB_RSTMAPW;
  146. {$EXTERNALSYM PEDB_RSTMAPW}
  147. tagEDB_RSTMAPW = record
  148. wszDatabaseName: PWCHAR;
  149. wszNewDatabaseName: PWCHAR;
  150. end;
  151. {$EXTERNALSYM tagEDB_RSTMAPW}
  152. EDB_RSTMAPW = tagEDB_RSTMAPW;
  153. {$EXTERNALSYM EDB_RSTMAPW}
  154. TEdbRstMapW = EDB_RSTMAPW;
  155. PEdbRstMapW = PEDB_RSTMAPW;
  156. {$IFDEF UNICODE}
  157. EDB_RSTMAP = EDB_RSTMAPW;
  158. {$EXTERNALSYM EDB_RSTMAP}
  159. PEDB_RSTMAP = PEDB_RSTMAPW;
  160. {$EXTERNALSYM PEDB_RSTMAP}
  161. TEdbRstMap = TEdbRstMapW;
  162. PEdbRstMap = PEdbRstMapW;
  163. {$ELSE}
  164. EDB_RSTMAP = EDB_RSTMAPA;
  165. {$EXTERNALSYM EDB_RSTMAP}
  166. PEDB_RSTMAP = PEDB_RSTMAPA;
  167. {$EXTERNALSYM PEDB_RSTMAP}
  168. TEdbRstMap = TEdbRstMapA;
  169. PEdbRstMap = PEdbRstMapA;
  170. {$ENDIF UNICODE}
  171. {*************************************************************************************
  172. Routine Description:
  173. DsIsNTDSOnline
  174. Checks to see if the NTDS is Online on the given server. This call is
  175. guaranteed to return quickly.
  176. Arguments:
  177. [in] szServerName - UNC name of the server to check
  178. [out] pfNTDSOnline - pointer to receive the bool result (TRUE if NTDS is
  179. online; FALSE, otherwise)
  180. Return Value:
  181. ERROR_SUCCESS if the call executed successfully;
  182. Failure code otherwise.
  183. **************************************************************************************}
  184. function DsIsNTDSOnlineA(szServerName: LPCSTR; var pfNTDSOnline: BOOL): HRESULT; stdcall;
  185. {$EXTERNALSYM DsIsNTDSOnlineA}
  186. function DsIsNTDSOnlineW(szServerName: LPCWSTR; var pfNTDSOnline: BOOL): HRESULT; stdcall;
  187. {$EXTERNALSYM DsIsNTDSOnlineW}
  188. function DsIsNTDSOnline(szServerName: LPCTSTR; var pfNTDSOnline: BOOL): HRESULT; stdcall;
  189. {$EXTERNALSYM DsIsNTDSOnline}
  190. {*************************************************************************************
  191. Routine Description:
  192. DsBackupPrepare
  193. Prepares the DS for the online backup and returns a Backup Context Handle
  194. which should be used in the subsequent calls to other backup functions.
  195. Arguments:
  196. [in] szBackupServer - UNC name of the server to be prepared for online backup
  197. [in] grbit - flag to be passed to jet while backing up dbs
  198. [in] btFlag - BACKUP_TYPE_FULL or BACKUP_TYPE_LOGS_ONLY
  199. [out] ppvExpiryToken - pointer that will receive the pointer to the
  200. Expiry Token associated with this backup; Client should save
  201. this token and send it back through DsRestorePrepare() when
  202. attempting a restore; allocated memory should be freed using
  203. DsBackupFree() API by the caller when it is no longer needed.
  204. [out] pcbExpiryTokenSize - pointer to receive the size of the expiry token
  205. returned.
  206. [out] phbc - pointer that will receive the backup context handle
  207. Return Value:
  208. One of the standard HRESULT success codes;
  209. Failure code otherwise.
  210. **************************************************************************************}
  211. function DsBackupPrepareA(szBackupServer: LPCSTR; grbit: ULONG; btFlag: ULONG;
  212. var ppvExpiryToken: PVOID; var pcbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
  213. {$EXTERNALSYM DsBackupPrepareA}
  214. function DsBackupPrepareW(szBackupServer: LPCWSTR; grbit: ULONG; btFlag: ULONG;
  215. var ppvExpiryToken: PVOID; var pcbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
  216. {$EXTERNALSYM DsBackupPrepareW}
  217. function DsBackupPrepare(szBackupServer: LPCTSTR; grbit: ULONG; btFlag: ULONG;
  218. var ppvExpiryToken: PVOID; var pcbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
  219. {$EXTERNALSYM DsBackupPrepare}
  220. {*************************************************************************************
  221. Routine Description:
  222. DsBackupGetDatabaseNames
  223. Gives the list of data bases that need to be backed up for the given
  224. backup context
  225. Arguments:
  226. [in] hbc - backup context handle
  227. [out] pszAttachmentInfo - pointer that will receive the pointer to the attachment
  228. info; allocated memory should be freed using DsBackupFree() API by the
  229. caller when it is no longer needed; Attachment info is an array of
  230. null-terminated filenames and and the list is terminated by two-nulls.
  231. [out] pcbSize - will receive the number of bytes returned
  232. Return Value:
  233. One of the standard HRESULT success codes;
  234. Failure code otherwise.
  235. **************************************************************************************}
  236. function DsBackupGetDatabaseNamesA(hbc: HBC; var pszAttachmentInfo: LPSTR;
  237. var pcbSize: DWORD): HRESULT; stdcall;
  238. {$EXTERNALSYM DsBackupGetDatabaseNamesA}
  239. function DsBackupGetDatabaseNamesW(hbc: HBC; var pszAttachmentInfo: LPWSTR;
  240. var pcbSize: DWORD): HRESULT; stdcall;
  241. {$EXTERNALSYM DsBackupGetDatabaseNamesW}
  242. function DsBackupGetDatabaseNames(hbc: HBC; var pszAttachmentInfo: LPTSTR;
  243. var pcbSize: DWORD): HRESULT; stdcall;
  244. {$EXTERNALSYM DsBackupGetDatabaseNames}
  245. {*************************************************************************************
  246. Routine Description:
  247. DsBackupOpenFile
  248. Opens the given attachment for read.
  249. Arguments:
  250. [in] hbc - backup context handle
  251. [in] szAttachmentName - name of the attachment to be opened for read
  252. [in] cbReadHintSize - suggested size in bytes that might be used during the
  253. subsequent reads on this attachement
  254. [out] pliFileSize - pointer to a large integer that would receive the size in
  255. bytes of the given attachment
  256. Return Value:
  257. One of the standard HRESULT success codes;
  258. Failure code otherwise.
  259. **************************************************************************************}
  260. function DsBackupOpenFileA(hbc: HBC; szAttachmentName: LPCSTR; cbReadHintSize: DWORD;
  261. var pliFileSize: LARGE_INTEGER): HRESULT; stdcall;
  262. {$EXTERNALSYM DsBackupOpenFileA}
  263. function DsBackupOpenFileW(hbc: HBC; szAttachmentName: LPCWSTR; cbReadHintSize: DWORD;
  264. var pliFileSize: LARGE_INTEGER): HRESULT; stdcall;
  265. {$EXTERNALSYM DsBackupOpenFileW}
  266. function DsBackupOpenFile(hbc: HBC; szAttachmentName: LPCTSTR; cbReadHintSize: DWORD;
  267. var pliFileSize: LARGE_INTEGER): HRESULT; stdcall;
  268. {$EXTERNALSYM DsBackupOpenFile}
  269. {*************************************************************************************
  270. Routine Description:
  271. DsBackupRead
  272. Reads the currently open attachment bytes into the given buffer. The client
  273. application is expected to call this function repeatedly until it gets the
  274. entire file (the application would have received the file size through the
  275. DsBackupOpenFile() call before.
  276. Arguments:
  277. [in] hbc - backup context handle
  278. [in] pvBuffer - pointer to the buffer that would receive the read data.
  279. [in] cbBuffer - specifies the size of the above buffer
  280. [out] pcbRead - pointer to receive the actual number of bytes read.
  281. Return Value:
  282. One of the standard HRESULT success codes;
  283. Failure code otherwise.
  284. **************************************************************************************}
  285. function DsBackupRead(hbc: HBC; pvBuffer: PVOID; cbBuffer: DWORD; var pcbRead: DWORD): HRESULT; stdcall;
  286. {$EXTERNALSYM DsBackupRead}
  287. {*************************************************************************************
  288. Routine Description:
  289. DsBackupClose
  290. To be called by the application after it completes reading all the data in
  291. the currently opened attachement.
  292. Arguments:
  293. [in] hbc - backup context handle
  294. Return Value:
  295. One of the standard HRESULT success codes;
  296. Failure code otherwise.
  297. **************************************************************************************}
  298. function DsBackupClose(hbc: HBC): HRESULT; stdcall;
  299. {$EXTERNALSYM DsBackupClose}
  300. {*************************************************************************************
  301. Routine Description:
  302. DsBackupGetBackupLogs
  303. Gives the list of log files that need to be backed up for the given
  304. backup context
  305. Arguments:
  306. [in] hbc - backup context handle
  307. [out] pszBackupLogFiles - pointer that will receive the pointer to the list of
  308. log files; allocated memory should be freed using DsBackupFree() API by the
  309. caller when it is no longer needed; Log files are returned in an array of
  310. null-terminated filenames and and the list is terminated by two-nulls.
  311. [out] pcbSize - will receive the number of bytes returned
  312. Return Value:
  313. One of the standard HRESULT success codes;
  314. Failure code otherwise.
  315. **************************************************************************************}
  316. function DsBackupGetBackupLogsA(hbc: HBC; var pszBackupLogFiles: LPSTR;
  317. var pcbSize: DWORD): HRESULT; stdcall;
  318. {$EXTERNALSYM DsBackupGetBackupLogsA}
  319. function DsBackupGetBackupLogsW(hbc: HBC; var pszBackupLogFiles: LPWSTR;
  320. var pcbSize: DWORD): HRESULT; stdcall;
  321. {$EXTERNALSYM DsBackupGetBackupLogsW}
  322. function DsBackupGetBackupLogs(hbc: HBC; var pszBackupLogFiles: LPTSTR;
  323. var pcbSize: DWORD): HRESULT; stdcall;
  324. {$EXTERNALSYM DsBackupGetBackupLogs}
  325. {*************************************************************************************
  326. Routine Description:
  327. DsBackupTruncateLogs
  328. Called to truncate the already read backup logs.
  329. Arguments:
  330. [in] hbc - backup context handle
  331. Return Value:
  332. One of the standard HRESULT success codes;
  333. Failure code otherwise.
  334. **************************************************************************************}
  335. function DsBackupTruncateLogs(hbc: HBC): HRESULT; stdcall;
  336. {$EXTERNALSYM DsBackupTruncateLogs}
  337. {*************************************************************************************
  338. Routine Description:
  339. DsBackupEnd
  340. Called to end the current backup session.
  341. Arguments:
  342. [in] hbc - backup context handle of the backup session
  343. Return Value:
  344. One of the standard HRESULT success codes;
  345. Failure code otherwise.
  346. **************************************************************************************}
  347. function DsBackupEnd(hbc: HBC): HRESULT; stdcall;
  348. {$EXTERNALSYM DsBackupEnd}
  349. {*************************************************************************************
  350. Routine Description:
  351. DsBackupFree
  352. Should be used by the application to free any buffer allocated by the
  353. NTDSBCLI dll.
  354. Arguments:
  355. [in] pvBuffer - pointer to the buffer that is to be freed.
  356. Return Value:
  357. None.
  358. **************************************************************************************}
  359. procedure DsBackupFree(pvBuffer: PVOID); stdcall;
  360. {$EXTERNALSYM DsBackupFree}
  361. {*************************************************************************************
  362. Routine Description:
  363. DsRestoreGetDatabaseLocations
  364. Called both at backup time as well at restoration time to get the data base
  365. locations for different types of files.
  366. Arguments:
  367. [in] hbc - backup context handle which would have been obtained through
  368. DsBackupPrepare() in the backup case and through DsRestorePrepare()
  369. in the restore case.
  370. [out] pszDatabaseLocationList - pointer that will receive the pointer to the list of
  371. database locations; allocated memory should be freed using DsBackupFree() API by the
  372. caller when it is no longer needed; locations are returned in an array of
  373. null-terminated names and and the list is terminated by two-nulls.
  374. The first character of each name is the BFT character that indicates the type
  375. of the file and the rest of the name tells gives the path into which that
  376. particular type of file should be restored.
  377. [out] pcbSize - will receive the number of bytes returned
  378. Return Value:
  379. One of the standard HRESULT success codes;
  380. Failure code otherwise.
  381. **************************************************************************************}
  382. function DsRestoreGetDatabaseLocationsA(hbc: HBC; var pszDatabaseLocationList: LPSTR;
  383. var pcbSize: DWORD): HRESULT; stdcall;
  384. {$EXTERNALSYM DsRestoreGetDatabaseLocationsA}
  385. function DsRestoreGetDatabaseLocationsW(hbc: HBC; var pszDatabaseLocationList: LPWSTR;
  386. var pcbSize: DWORD): HRESULT; stdcall;
  387. {$EXTERNALSYM DsRestoreGetDatabaseLocationsW}
  388. function DsRestoreGetDatabaseLocations(hbc: HBC; var pszDatabaseLocationList: LPTSTR;
  389. var pcbSize: DWORD): HRESULT; stdcall;
  390. {$EXTERNALSYM DsRestoreGetDatabaseLocations}
  391. {*************************************************************************************
  392. Routine Description:
  393. DsRestorePrepare
  394. Called to indicate beginning of a restore session.
  395. Arguments:
  396. [in] szServerName - UNC name of the server into which the restore operation is
  397. going to be performed.
  398. [in] rtFlag - Or'ed combination of RESTORE_TYPE_* flags; 0 if no special flags
  399. are to be specified
  400. [in] pvExpiryToken - pointer to the expiry token associated with this
  401. backup. The client would have received this when they backed up the DS.
  402. [in] cbExpiryTokenSize - size of the expiry token.
  403. [out] phbc - pointer to receive the backup context handle which is to be passed
  404. to the subsequent restore APIs
  405. Return Value:
  406. One of the standard HRESULT success codes;
  407. Failure code otherwise.
  408. **************************************************************************************}
  409. function DsRestorePrepareA(szServerName: LPCSTR; rtFlag: ULONG; pvExpiryToken: PVOID;
  410. cbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
  411. {$EXTERNALSYM DsRestorePrepareA}
  412. function DsRestorePrepareW(szServerName: LPCWSTR; rtFlag: ULONG; pvExpiryToken: PVOID;
  413. cbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
  414. {$EXTERNALSYM DsRestorePrepareW}
  415. function DsRestorePrepare(szServerName: LPCTSTR; rtFlag: ULONG; pvExpiryToken: PVOID;
  416. cbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
  417. {$EXTERNALSYM DsRestorePrepare}
  418. {*************************************************************************************
  419. Routine Description:
  420. DsRestoreRegister
  421. This will register a restore operation. It will interlock all sbsequent restore
  422. operations, and will prevent the restore target from starting until the call
  423. to DsRestoreRegisterComplete() is made.
  424. Arguments:
  425. [in] hbc - backup context handle for the restore session.
  426. [in] szCheckPointFilePath - path where the check point files are restored
  427. [in] szLogPath - path where the log files are restored
  428. [in] rgrstmap - restore map
  429. [in] crstmap - tells if ther is a new restore map
  430. [in] szBackupLogPath - path where the backup logs are located
  431. [in] genLow - Lowest log# that was restored in this restore session
  432. [in] genHigh - Highest log# that was restored in this restore session
  433. Return Value:
  434. One of the standard HRESULT success codes;
  435. Failure code otherwise.
  436. **************************************************************************************}
  437. function DsRestoreRegisterA(hbc: HBC; szCheckPointFilePath, szLogPath: LPCSTR;
  438. rgrstmap: PEDB_RSTMAPA; crstmap: LONG; szBackupLogPath: LPCSTR; genLow, genHigh: ULONG): HRESULT; stdcall;
  439. {$EXTERNALSYM DsRestoreRegisterA}
  440. function DsRestoreRegisterW(hbc: HBC; szCheckPointFilePath, szLogPath: LPCWSTR;
  441. rgrstmap: PEDB_RSTMAPW; crstmap: LONG; szBackupLogPath: LPCWSTR; genLow, genHigh: ULONG): HRESULT; stdcall;
  442. {$EXTERNALSYM DsRestoreRegisterW}
  443. function DsRestoreRegister(hbc: HBC; szCheckPointFilePath, szLogPath: LPCTSTR;
  444. rgrstmap: PEDB_RSTMAP; crstmap: LONG; szBackupLogPath: LPCTSTR; genLow, genHigh: ULONG): HRESULT; stdcall;
  445. {$EXTERNALSYM DsRestoreRegister}
  446. {*************************************************************************************
  447. Routine Description:
  448. DsRestoreRegisterComplete
  449. Called to indicate that a previously registered restore is complete.
  450. Arguments:
  451. [in] hbc - backup context handle
  452. [in] hrRestoreState - success code if the restore was successful
  453. Return Value:
  454. One of the standard HRESULT success codes;
  455. Failure code otherwise.
  456. **************************************************************************************}
  457. function DsRestoreRegisterComplete(hbc: HBC; hrRestoreState: HRESULT): HRESULT; stdcall;
  458. {$EXTERNALSYM DsRestoreRegisterComplete}
  459. {*************************************************************************************
  460. Routine Description:
  461. DsRestoreEnd
  462. Called to end a restore session
  463. Arguments:
  464. [in] hbc - backup context handle
  465. Return Value:
  466. One of the standard HRESULT success codes;
  467. Failure code otherwise.
  468. **************************************************************************************}
  469. function DsRestoreEnd(hbc: HBC): HRESULT; stdcall;
  470. {$EXTERNALSYM DsRestoreEnd}
  471. {*************************************************************************************
  472. Routine Description:
  473. DsSetCurrentBackupLog
  474. Called to set the current backup log number after a successful restore
  475. Arguments:
  476. [in] szServerName - UNC name of the server for which the current backup log has
  477. to be set
  478. [in] dwCurrentLog - current log number
  479. Return Value:
  480. One of the standard HRESULT success codes;
  481. Failure code otherwise.
  482. **************************************************************************************}
  483. function DsSetCurrentBackupLogA(szServerName: LPCSTR; dwCurrentLog: DWORD): HRESULT; stdcall;
  484. {$EXTERNALSYM DsSetCurrentBackupLogA}
  485. function DsSetCurrentBackupLogW(szServerName: LPCWSTR; dwCurrentLog: DWORD): HRESULT; stdcall;
  486. {$EXTERNALSYM DsSetCurrentBackupLogW}
  487. function DsSetCurrentBackupLog(szServerName: LPCTSTR; dwCurrentLog: DWORD): HRESULT; stdcall;
  488. {$EXTERNALSYM DsSetCurrentBackupLog}
  489. {*************************************************************************************
  490. Routine Description:
  491. DsSetAuthIdentity
  492. Used to set the security context under which the client APIs are to be
  493. called. If this function is not called, security context of the current
  494. process is assumed.
  495. Arguments:
  496. [in] szUserName - name of the user
  497. [in] szDomainName - name of the domain the user belongs to
  498. [in] szPassword - password of the user in the specified domain
  499. Return Value:
  500. One of the standard HRESULT success codes;
  501. Failure code otherwise.
  502. **************************************************************************************}
  503. function DsSetAuthIdentityA(szUserName, szDomainName, szPassword: LPCSTR): HRESULT; stdcall;
  504. {$EXTERNALSYM DsSetAuthIdentityA}
  505. function DsSetAuthIdentityW(szUserName, szDomainName, szPassword: LPCWSTR): HRESULT; stdcall;
  506. {$EXTERNALSYM DsSetAuthIdentityW}
  507. function DsSetAuthIdentity(szUserName, szDomainName, szPassword: LPCTSTR): HRESULT; stdcall;
  508. {$EXTERNALSYM DsSetAuthIdentity}
  509. implementation
  510. uses
  511. JwaWinDLLNames;
  512. {$IFDEF DYNAMIC_LINK}
  513. var
  514. _DsIsNTDSOnlineA: Pointer;
  515. function DsIsNTDSOnlineA;
  516. begin
  517. GetProcedureAddress(_DsIsNTDSOnlineA, ntdsbclilib, 'DsIsNTDSOnlineA');
  518. asm
  519. MOV ESP, EBP
  520. POP EBP
  521. JMP [_DsIsNTDSOnlineA]
  522. end;
  523. end;
  524. var
  525. _DsIsNTDSOnlineW: Pointer;
  526. function DsIsNTDSOnlineW;
  527. begin
  528. GetProcedureAddress(_DsIsNTDSOnlineW, ntdsbclilib, 'DsIsNTDSOnlineW');
  529. asm
  530. MOV ESP, EBP
  531. POP EBP
  532. JMP [_DsIsNTDSOnlineW]
  533. end;
  534. end;
  535. var
  536. _DsIsNTDSOnline: Pointer;
  537. function DsIsNTDSOnline;
  538. begin
  539. GetProcedureAddress(_DsIsNTDSOnline, ntdsbclilib, 'DsIsNTDSOnline' + AWSuffix);
  540. asm
  541. MOV ESP, EBP
  542. POP EBP
  543. JMP [_DsIsNTDSOnline]
  544. end;
  545. end;
  546. var
  547. _DsBackupPrepareA: Pointer;
  548. function DsBackupPrepareA;
  549. begin
  550. GetProcedureAddress(_DsBackupPrepareA, ntdsbclilib, 'DsBackupPrepareA');
  551. asm
  552. MOV ESP, EBP
  553. POP EBP
  554. JMP [_DsBackupPrepareA]
  555. end;
  556. end;
  557. var
  558. _DsBackupPrepareW: Pointer;
  559. function DsBackupPrepareW;
  560. begin
  561. GetProcedureAddress(_DsBackupPrepareW, ntdsbclilib, 'DsBackupPrepareW');
  562. asm
  563. MOV ESP, EBP
  564. POP EBP
  565. JMP [_DsBackupPrepareW]
  566. end;
  567. end;
  568. var
  569. _DsBackupPrepare: Pointer;
  570. function DsBackupPrepare;
  571. begin
  572. GetProcedureAddress(_DsBackupPrepare, ntdsbclilib, 'DsBackupPrepare' + AWSuffix);
  573. asm
  574. MOV ESP, EBP
  575. POP EBP
  576. JMP [_DsBackupPrepare]
  577. end;
  578. end;
  579. var
  580. _DsBackupGetDatabaseNamesA: Pointer;
  581. function DsBackupGetDatabaseNamesA;
  582. begin
  583. GetProcedureAddress(_DsBackupGetDatabaseNamesA, ntdsbclilib, 'DsBackupGetDatabaseNamesA');
  584. asm
  585. MOV ESP, EBP
  586. POP EBP
  587. JMP [_DsBackupGetDatabaseNamesA]
  588. end;
  589. end;
  590. var
  591. _DsBackupGetDatabaseNamesW: Pointer;
  592. function DsBackupGetDatabaseNamesW;
  593. begin
  594. GetProcedureAddress(_DsBackupGetDatabaseNamesW, ntdsbclilib, 'DsBackupGetDatabaseNamesW');
  595. asm
  596. MOV ESP, EBP
  597. POP EBP
  598. JMP [_DsBackupGetDatabaseNamesW]
  599. end;
  600. end;
  601. var
  602. _DsBackupGetDatabaseNames: Pointer;
  603. function DsBackupGetDatabaseNames;
  604. begin
  605. GetProcedureAddress(_DsBackupGetDatabaseNames, ntdsbclilib, 'DsBackupGetDatabaseNames' + AWSuffix);
  606. asm
  607. MOV ESP, EBP
  608. POP EBP
  609. JMP [_DsBackupGetDatabaseNames]
  610. end;
  611. end;
  612. var
  613. _DsBackupOpenFileA: Pointer;
  614. function DsBackupOpenFileA;
  615. begin
  616. GetProcedureAddress(_DsBackupOpenFileA, ntdsbclilib, 'DsBackupOpenFileA');
  617. asm
  618. MOV ESP, EBP
  619. POP EBP
  620. JMP [_DsBackupOpenFileA]
  621. end;
  622. end;
  623. var
  624. _DsBackupOpenFileW: Pointer;
  625. function DsBackupOpenFileW;
  626. begin
  627. GetProcedureAddress(_DsBackupOpenFileW, ntdsbclilib, 'DsBackupOpenFileW');
  628. asm
  629. MOV ESP, EBP
  630. POP EBP
  631. JMP [_DsBackupOpenFileW]
  632. end;
  633. end;
  634. var
  635. _DsBackupOpenFile: Pointer;
  636. function DsBackupOpenFile;
  637. begin
  638. GetProcedureAddress(_DsBackupOpenFile, ntdsbclilib, 'DsBackupOpenFile' + AWSuffix);
  639. asm
  640. MOV ESP, EBP
  641. POP EBP
  642. JMP [_DsBackupOpenFile]
  643. end;
  644. end;
  645. var
  646. _DsBackupRead: Pointer;
  647. function DsBackupRead;
  648. begin
  649. GetProcedureAddress(_DsBackupRead, ntdsbclilib, 'DsBackupRead');
  650. asm
  651. MOV ESP, EBP
  652. POP EBP
  653. JMP [_DsBackupRead]
  654. end;
  655. end;
  656. var
  657. _DsBackupClose: Pointer;
  658. function DsBackupClose;
  659. begin
  660. GetProcedureAddress(_DsBackupClose, ntdsbclilib, 'DsBackupClose');
  661. asm
  662. MOV ESP, EBP
  663. POP EBP
  664. JMP [_DsBackupClose]
  665. end;
  666. end;
  667. var
  668. _DsBackupGetBackupLogsA: Pointer;
  669. function DsBackupGetBackupLogsA;
  670. begin
  671. GetProcedureAddress(_DsBackupGetBackupLogsA, ntdsbclilib, 'DsBackupGetBackupLogsA');
  672. asm
  673. MOV ESP, EBP
  674. POP EBP
  675. JMP [_DsBackupGetBackupLogsA]
  676. end;
  677. end;
  678. var
  679. _DsBackupGetBackupLogsW: Pointer;
  680. function DsBackupGetBackupLogsW;
  681. begin
  682. GetProcedureAddress(_DsBackupGetBackupLogsW, ntdsbclilib, 'DsBackupGetBackupLogsW');
  683. asm
  684. MOV ESP, EBP
  685. POP EBP
  686. JMP [_DsBackupGetBackupLogsW]
  687. end;
  688. end;
  689. var
  690. _DsBackupGetBackupLogs: Pointer;
  691. function DsBackupGetBackupLogs;
  692. begin
  693. GetProcedureAddress(_DsBackupGetBackupLogs, ntdsbclilib, 'DsBackupGetBackupLogs' + AWSuffix);
  694. asm
  695. MOV ESP, EBP
  696. POP EBP
  697. JMP [_DsBackupGetBackupLogs]
  698. end;
  699. end;
  700. var
  701. _DsBackupTruncateLogs: Pointer;
  702. function DsBackupTruncateLogs;
  703. begin
  704. GetProcedureAddress(_DsBackupTruncateLogs, ntdsbclilib, 'DsBackupTruncateLogs');
  705. asm
  706. MOV ESP, EBP
  707. POP EBP
  708. JMP [_DsBackupTruncateLogs]
  709. end;
  710. end;
  711. var
  712. _DsBackupEnd: Pointer;
  713. function DsBackupEnd;
  714. begin
  715. GetProcedureAddress(_DsBackupEnd, ntdsbclilib, 'DsBackupEnd');
  716. asm
  717. MOV ESP, EBP
  718. POP EBP
  719. JMP [_DsBackupEnd]
  720. end;
  721. end;
  722. var
  723. _DsBackupFree: Pointer;
  724. procedure DsBackupFree;
  725. begin
  726. GetProcedureAddress(_DsBackupFree, ntdsbclilib, 'DsBackupFree');
  727. asm
  728. MOV ESP, EBP
  729. POP EBP
  730. JMP [_DsBackupFree]
  731. end;
  732. end;
  733. var
  734. _DsRestoreGetDatabaseLocationsA: Pointer;
  735. function DsRestoreGetDatabaseLocationsA;
  736. begin
  737. GetProcedureAddress(_DsRestoreGetDatabaseLocationsA, ntdsbclilib, 'DsRestoreGetDatabaseLocationsA');
  738. asm
  739. MOV ESP, EBP
  740. POP EBP
  741. JMP [_DsRestoreGetDatabaseLocationsA]
  742. end;
  743. end;
  744. var
  745. _DsRestoreGetDatabaseLocationsW: Pointer;
  746. function DsRestoreGetDatabaseLocationsW;
  747. begin
  748. GetProcedureAddress(_DsRestoreGetDatabaseLocationsW, ntdsbclilib, 'DsRestoreGetDatabaseLocationsW');
  749. asm
  750. MOV ESP, EBP
  751. POP EBP
  752. JMP [_DsRestoreGetDatabaseLocationsW]
  753. end;
  754. end;
  755. var
  756. _DsRestoreGetDatabaseLocations: Pointer;
  757. function DsRestoreGetDatabaseLocations;
  758. begin
  759. GetProcedureAddress(_DsRestoreGetDatabaseLocations, ntdsbclilib, 'DsRestoreGetDatabaseLocations' + AWSuffix);
  760. asm
  761. MOV ESP, EBP
  762. POP EBP
  763. JMP [_DsRestoreGetDatabaseLocations]
  764. end;
  765. end;
  766. var
  767. _DsRestorePrepareA: Pointer;
  768. function DsRestorePrepareA;
  769. begin
  770. GetProcedureAddress(_DsRestorePrepareA, ntdsbclilib, 'DsRestorePrepareA');
  771. asm
  772. MOV ESP, EBP
  773. POP EBP
  774. JMP [_DsRestorePrepareA]
  775. end;
  776. end;
  777. var
  778. _DsRestorePrepareW: Pointer;
  779. function DsRestorePrepareW;
  780. begin
  781. GetProcedureAddress(_DsRestorePrepareW, ntdsbclilib, 'DsRestorePrepareW');
  782. asm
  783. MOV ESP, EBP
  784. POP EBP
  785. JMP [_DsRestorePrepareW]
  786. end;
  787. end;
  788. var
  789. _DsRestorePrepare: Pointer;
  790. function DsRestorePrepare;
  791. begin
  792. GetProcedureAddress(_DsRestorePrepare, ntdsbclilib, 'DsRestorePrepare' + AWSuffix);
  793. asm
  794. MOV ESP, EBP
  795. POP EBP
  796. JMP [_DsRestorePrepare]
  797. end;
  798. end;
  799. var
  800. _DsRestoreRegisterA: Pointer;
  801. function DsRestoreRegisterA;
  802. begin
  803. GetProcedureAddress(_DsRestoreRegisterA, ntdsbclilib, 'DsRestoreRegisterA');
  804. asm
  805. MOV ESP, EBP
  806. POP EBP
  807. JMP [_DsRestoreRegisterA]
  808. end;
  809. end;
  810. var
  811. _DsRestoreRegisterW: Pointer;
  812. function DsRestoreRegisterW;
  813. begin
  814. GetProcedureAddress(_DsRestoreRegisterW, ntdsbclilib, 'DsRestoreRegisterW');
  815. asm
  816. MOV ESP, EBP
  817. POP EBP
  818. JMP [_DsRestoreRegisterW]
  819. end;
  820. end;
  821. var
  822. _DsRestoreRegister: Pointer;
  823. function DsRestoreRegister;
  824. begin
  825. GetProcedureAddress(_DsRestoreRegister, ntdsbclilib, 'DsRestoreRegister' + AWSuffix);
  826. asm
  827. MOV ESP, EBP
  828. POP EBP
  829. JMP [_DsRestoreRegister]
  830. end;
  831. end;
  832. var
  833. _DsRestoreRegisterComplete: Pointer;
  834. function DsRestoreRegisterComplete;
  835. begin
  836. GetProcedureAddress(_DsRestoreRegisterComplete, ntdsbclilib, 'DsRestoreRegisterComplete');
  837. asm
  838. MOV ESP, EBP
  839. POP EBP
  840. JMP [_DsRestoreRegisterComplete]
  841. end;
  842. end;
  843. var
  844. _DsRestoreEnd: Pointer;
  845. function DsRestoreEnd;
  846. begin
  847. GetProcedureAddress(_DsRestoreEnd, ntdsbclilib, 'DsRestoreEnd');
  848. asm
  849. MOV ESP, EBP
  850. POP EBP
  851. JMP [_DsRestoreEnd]
  852. end;
  853. end;
  854. var
  855. _DsSetCurrentBackupLogA: Pointer;
  856. function DsSetCurrentBackupLogA;
  857. begin
  858. GetProcedureAddress(_DsSetCurrentBackupLogA, ntdsbclilib, 'DsSetCurrentBackupLogA');
  859. asm
  860. MOV ESP, EBP
  861. POP EBP
  862. JMP [_DsSetCurrentBackupLogA]
  863. end;
  864. end;
  865. var
  866. _DsSetCurrentBackupLogW: Pointer;
  867. function DsSetCurrentBackupLogW;
  868. begin
  869. GetProcedureAddress(_DsSetCurrentBackupLogW, ntdsbclilib, 'DsSetCurrentBackupLogW');
  870. asm
  871. MOV ESP, EBP
  872. POP EBP
  873. JMP [_DsSetCurrentBackupLogW]
  874. end;
  875. end;
  876. var
  877. _DsSetCurrentBackupLog: Pointer;
  878. function DsSetCurrentBackupLog;
  879. begin
  880. GetProcedureAddress(_DsSetCurrentBackupLog, ntdsbclilib, 'DsSetCurrentBackupLog' + AWSuffix);
  881. asm
  882. MOV ESP, EBP
  883. POP EBP
  884. JMP [_DsSetCurrentBackupLog]
  885. end;
  886. end;
  887. var
  888. _DsSetAuthIdentityA: Pointer;
  889. function DsSetAuthIdentityA;
  890. begin
  891. GetProcedureAddress(_DsSetAuthIdentityA, ntdsbclilib, 'DsSetAuthIdentityA');
  892. asm
  893. MOV ESP, EBP
  894. POP EBP
  895. JMP [_DsSetAuthIdentityA]
  896. end;
  897. end;
  898. var
  899. _DsSetAuthIdentityW: Pointer;
  900. function DsSetAuthIdentityW;
  901. begin
  902. GetProcedureAddress(_DsSetAuthIdentityW, ntdsbclilib, 'DsSetAuthIdentityW');
  903. asm
  904. MOV ESP, EBP
  905. POP EBP
  906. JMP [_DsSetAuthIdentityW]
  907. end;
  908. end;
  909. var
  910. _DsSetAuthIdentity: Pointer;
  911. function DsSetAuthIdentity;
  912. begin
  913. GetProcedureAddress(_DsSetAuthIdentity, ntdsbclilib, 'DsSetAuthIdentity' + AWSuffix);
  914. asm
  915. MOV ESP, EBP
  916. POP EBP
  917. JMP [_DsSetAuthIdentity]
  918. end;
  919. end;
  920. {$ELSE}
  921. function DsIsNTDSOnlineA; external ntdsbclilib name 'DsIsNTDSOnlineA';
  922. function DsIsNTDSOnlineW; external ntdsbclilib name 'DsIsNTDSOnlineW';
  923. function DsIsNTDSOnline; external ntdsbclilib name 'DsIsNTDSOnline' + AWSuffix;
  924. function DsBackupPrepareA; external ntdsbclilib name 'DsBackupPrepareA';
  925. function DsBackupPrepareW; external ntdsbclilib name 'DsBackupPrepareW';
  926. function DsBackupPrepare; external ntdsbclilib name 'DsBackupPrepare' + AWSuffix;
  927. function DsBackupGetDatabaseNamesA; external ntdsbclilib name 'DsBackupGetDatabaseNamesA';
  928. function DsBackupGetDatabaseNamesW; external ntdsbclilib name 'DsBackupGetDatabaseNamesW';
  929. function DsBackupGetDatabaseNames; external ntdsbclilib name 'DsBackupGetDatabaseNames' + AWSuffix;
  930. function DsBackupOpenFileA; external ntdsbclilib name 'DsBackupOpenFileA';
  931. function DsBackupOpenFileW; external ntdsbclilib name 'DsBackupOpenFileW';
  932. function DsBackupOpenFile; external ntdsbclilib name 'DsBackupOpenFile' + AWSuffix;
  933. function DsBackupRead; external ntdsbclilib name 'DsBackupRead';
  934. function DsBackupClose; external ntdsbclilib name 'DsBackupClose';
  935. function DsBackupGetBackupLogsA; external ntdsbclilib name 'DsBackupGetBackupLogsA';
  936. function DsBackupGetBackupLogsW; external ntdsbclilib name 'DsBackupGetBackupLogsW';
  937. function DsBackupGetBackupLogs; external ntdsbclilib name 'DsBackupGetBackupLogs' + AWSuffix;
  938. function DsBackupTruncateLogs; external ntdsbclilib name 'DsBackupTruncateLogs';
  939. function DsBackupEnd; external ntdsbclilib name 'DsBackupEnd';
  940. procedure DsBackupFree; external ntdsbclilib name 'DsBackupFree';
  941. function DsRestoreGetDatabaseLocationsA; external ntdsbclilib name 'DsRestoreGetDatabaseLocationsA';
  942. function DsRestoreGetDatabaseLocationsW; external ntdsbclilib name 'DsRestoreGetDatabaseLocationsW';
  943. function DsRestoreGetDatabaseLocations; external ntdsbclilib name 'DsRestoreGetDatabaseLocations' + AWSuffix;
  944. function DsRestorePrepareA; external ntdsbclilib name 'DsRestorePrepareA';
  945. function DsRestorePrepareW; external ntdsbclilib name 'DsRestorePrepareW';
  946. function DsRestorePrepare; external ntdsbclilib name 'DsRestorePrepare' + AWSuffix;
  947. function DsRestoreRegisterA; external ntdsbclilib name 'DsRestoreRegisterA';
  948. function DsRestoreRegisterW; external ntdsbclilib name 'DsRestoreRegisterW';
  949. function DsRestoreRegister; external ntdsbclilib name 'DsRestoreRegister' + AWSuffix;
  950. function DsRestoreRegisterComplete; external ntdsbclilib name 'DsRestoreRegisterComplete';
  951. function DsRestoreEnd; external ntdsbclilib name 'DsRestoreEnd';
  952. function DsSetCurrentBackupLogA; external ntdsbclilib name 'DsSetCurrentBackupLogA';
  953. function DsSetCurrentBackupLogW; external ntdsbclilib name 'DsSetCurrentBackupLogW';
  954. function DsSetCurrentBackupLog; external ntdsbclilib name 'DsSetCurrentBackupLog' + AWSuffix;
  955. function DsSetAuthIdentityA; external ntdsbclilib name 'DsSetAuthIdentityA';
  956. function DsSetAuthIdentityW; external ntdsbclilib name 'DsSetAuthIdentityW';
  957. function DsSetAuthIdentity; external ntdsbclilib name 'DsSetAuthIdentity' + AWSuffix;
  958. {$ENDIF DYNAMIC_LINK}
  959. end.