jwantdsbcli.pas 38 KB

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