⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jwantdsbcli.pas

📁 比较全面的win32api开发包
💻 PAS
📖 第 1 页 / 共 4 页
字号:

function DsBackupClose(hbc: HBC): HRESULT; stdcall;
{$EXTERNALSYM DsBackupClose}

{*************************************************************************************
Routine Description:

      DsBackupGetBackupLogs
        Gives the list of log files that need to be backed up for the given
        backup context

  Arguments:
    [in]    hbc - backup context handle
    [out]   pszBackupLogFiles - pointer that will receive the pointer to the list of
                log files; allocated memory should be freed using DsBackupFree() API by the
                caller when it is no longer needed; Log files are returned in an array of
                null-terminated filenames and and the list is terminated by two-nulls.
    [out]   pcbSize - will receive the number of bytes returned
Return Value:

    One of the standard HRESULT success codes;
    Failure code otherwise.
**************************************************************************************}

function DsBackupGetBackupLogsA(hbc: HBC; var pszBackupLogFiles: LPSTR;
  var pcbSize: DWORD): HRESULT; stdcall;
{$EXTERNALSYM DsBackupGetBackupLogsA}
function DsBackupGetBackupLogsW(hbc: HBC; var pszBackupLogFiles: LPWSTR;
  var pcbSize: DWORD): HRESULT; stdcall;
{$EXTERNALSYM DsBackupGetBackupLogsW}

{$IFDEF UNICODE}
function DsBackupGetBackupLogs(hbc: HBC; var pszBackupLogFiles: LPWSTR;
  var pcbSize: DWORD): HRESULT; stdcall;
{$EXTERNALSYM DsBackupGetBackupLogs}
{$ELSE}
function DsBackupGetBackupLogs(hbc: HBC; var pszBackupLogFiles: LPSTR;
  var pcbSize: DWORD): HRESULT; stdcall;
{$EXTERNALSYM DsBackupGetBackupLogs}
{$ENDIF}

{*************************************************************************************
Routine Description:

      DsBackupTruncateLogs
        Called to truncate the already read backup logs.

  Arguments:
    [in]    hbc - backup context handle
Return Value:

    One of the standard HRESULT success codes;
    Failure code otherwise.
**************************************************************************************}

function DsBackupTruncateLogs(hbc: HBC): HRESULT; stdcall;
{$EXTERNALSYM DsBackupTruncateLogs}

{*************************************************************************************
Routine Description:

      DsBackupEnd
        Called to end the current backup session.

  Arguments:
    [in]    hbc - backup context handle of the backup session
Return Value:

    One of the standard HRESULT success codes;
    Failure code otherwise.
**************************************************************************************}

function DsBackupEnd(hbc: HBC): HRESULT; stdcall;
{$EXTERNALSYM DsBackupEnd}

{*************************************************************************************
Routine Description:

      DsBackupFree
        Should be used by the application to free any buffer allocated by the
        NTDSBCLI dll.

  Arguments:
    [in]    pvBuffer - pointer to the buffer that is to be freed.

  Return Value:
    None.
**************************************************************************************}

procedure DsBackupFree(pvBuffer: PVOID); stdcall;
{$EXTERNALSYM DsBackupFree}

{*************************************************************************************
Routine Description:

      DsRestoreGetDatabaseLocations
        Called both at backup time as well at restoration time to get the data base
        locations for different types of files.

  Arguments:
    [in]    hbc - backup context handle which would have been obtained through
                    DsBackupPrepare() in the backup case and through DsRestorePrepare()
                    in the restore case.
    [out]   pszDatabaseLocationList - pointer that will receive the pointer to the list of
                database locations; allocated memory should be freed using DsBackupFree() API by the
                caller when it is no longer needed; locations are returned in an array of
                null-terminated names and and the list is terminated by two-nulls.
                The first character of each name is the BFT character that indicates the type
                of the file and the rest of the name tells gives the path into which that
                particular type of file should be restored.
    [out]   pcbSize - will receive the number of bytes returned
Return Value:

    One of the standard HRESULT success codes;
    Failure code otherwise.
**************************************************************************************}

function DsRestoreGetDatabaseLocationsA(hbc: HBC; var pszDatabaseLocationList: LPSTR;
  var pcbSize: DWORD): HRESULT; stdcall;
{$EXTERNALSYM DsRestoreGetDatabaseLocationsA}
function DsRestoreGetDatabaseLocationsW(hbc: HBC; var pszDatabaseLocationList: LPWSTR;
  var pcbSize: DWORD): HRESULT; stdcall;
{$EXTERNALSYM DsRestoreGetDatabaseLocationsW}

{$IFDEF UNICODE}
function DsRestoreGetDatabaseLocations(hbc: HBC; var pszDatabaseLocationList: LPWSTR;
  var pcbSize: DWORD): HRESULT; stdcall;
{$EXTERNALSYM DsRestoreGetDatabaseLocations}
{$ELSE}
function DsRestoreGetDatabaseLocations(hbc: HBC; var pszDatabaseLocationList: LPSTR;
  var pcbSize: DWORD): HRESULT; stdcall;
{$EXTERNALSYM DsRestoreGetDatabaseLocations}
{$ENDIF}

{*************************************************************************************
Routine Description:

      DsRestorePrepare
        Called to indicate beginning of a restore session.

  Arguments:
    [in]    szServerName - UNC name of the server into which the restore operation is
                            going to be performed.
    [in]    rtFlag -  Or'ed combination of RESTORE_TYPE_* flags; 0 if no special flags
                            are to be specified
    [in]    pvExpiryToken - pointer to the expiry token associated with this
                            backup. The client would have received this when they backed up the DS.
    [in]    cbExpiryTokenSize - size of the expiry token.
    [out]   phbc - pointer to receive the backup context handle which is to be passed
                            to the subsequent restore APIs

Return Value:

    One of the standard HRESULT success codes;
    Failure code otherwise.
**************************************************************************************}

function DsRestorePrepareA(szServerName: LPCSTR; rtFlag: ULONG; pvExpiryToken: PVOID;
  cbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
{$EXTERNALSYM DsRestorePrepareA}
function DsRestorePrepareW(szServerName: LPCWSTR; rtFlag: ULONG; pvExpiryToken: PVOID;
  cbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
{$EXTERNALSYM DsRestorePrepareW}

{$IFDEF UNICODE}
function DsRestorePrepare(szServerName: LPCWSTR; rtFlag: ULONG; pvExpiryToken: PVOID;
  cbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
{$EXTERNALSYM DsRestorePrepare}
{$ELSE}
function DsRestorePrepare(szServerName: LPCSTR; rtFlag: ULONG; pvExpiryToken: PVOID;
  cbExpiryTokenSize: DWORD; var phbc: HBC): HRESULT; stdcall;
{$EXTERNALSYM DsRestorePrepare}
{$ENDIF}

{*************************************************************************************
Routine Description:

      DsRestoreRegister
        This will register a restore operation. It will interlock all sbsequent restore
        operations, and will prevent the restore target from starting until the call
        to DsRestoreRegisterComplete() is made.

  Arguments:
    [in]    hbc - backup context handle for the restore session.
    [in]    szCheckPointFilePath - path where the check point files are restored
    [in]    szLogPath - path where the log files are restored
    [in]    rgrstmap - restore map
    [in]    crstmap - tells if ther is a new restore map
    [in]    szBackupLogPath - path where the backup logs are located
    [in]    genLow - Lowest log# that was restored in this restore session
    [in]    genHigh - Highest log# that was restored in this restore session

  Return Value:

    One of the standard HRESULT success codes;
    Failure code otherwise.
**************************************************************************************}

function DsRestoreRegisterA(hbc: HBC; szCheckPointFilePath, szLogPath: LPCSTR;
  rgrstmap: PEDB_RSTMAPA; crstmap: LONG; szBackupLogPath: LPCSTR; genLow, genHigh: ULONG): HRESULT; stdcall;
{$EXTERNALSYM DsRestoreRegisterA}
function DsRestoreRegisterW(hbc: HBC; szCheckPointFilePath, szLogPath: LPCWSTR;
  rgrstmap: PEDB_RSTMAPW; crstmap: LONG; szBackupLogPath: LPCWSTR; genLow, genHigh: ULONG): HRESULT; stdcall;
{$EXTERNALSYM DsRestoreRegisterW}

{$IFDEF UNICODE}
function DsRestoreRegister(hbc: HBC; szCheckPointFilePath, szLogPath: LPCWSTR;
  rgrstmap: PEDB_RSTMAPW; crstmap: LONG; szBackupLogPath: LPCWSTR; genLow, genHigh: ULONG): HRESULT; stdcall;
{$EXTERNALSYM DsRestoreRegister}
{$ELSE}
function DsRestoreRegister(hbc: HBC; szCheckPointFilePath, szLogPath: LPCSTR;
  rgrstmap: PEDB_RSTMAPA; crstmap: LONG; szBackupLogPath: LPCSTR; genLow, genHigh: ULONG): HRESULT; stdcall;
{$EXTERNALSYM DsRestoreRegister}
{$ENDIF}

{*************************************************************************************
Routine Description:

      DsRestoreRegisterComplete
        Called to indicate that a previously registered restore is complete.

  Arguments:
    [in]    hbc - backup context handle
    [in]    hrRestoreState - success code if the restore was successful
Return Value:

    One of the standard HRESULT success codes;
    Failure code otherwise.
**************************************************************************************}

function DsRestoreRegisterComplete(hbc: HBC; hrRestoreState: HRESULT): HRESULT; stdcall;
{$EXTERNALSYM DsRestoreRegisterComplete}

{*************************************************************************************
Routine Description:

      DsRestoreEnd
        Called to end a restore session

  Arguments:
    [in]    hbc - backup context handle
Return Value:

    One of the standard HRESULT success codes;
    Failure code otherwise.
**************************************************************************************}

function DsRestoreEnd(hbc: HBC): HRESULT; stdcall;
{$EXTERNALSYM DsRestoreEnd}

{*************************************************************************************
Routine Description:

      DsSetCurrentBackupLog
        Called to set the current backup log number after a successful restore

  Arguments:
    [in]    szServerName - UNC name of the server for which the current backup log has
                                to be set
    [in]    dwCurrentLog -  current log number
Return Value:

    One of the standard HRESULT success codes;
    Failure code otherwise.
**************************************************************************************}

function DsSetCurrentBackupLogA(szServerName: LPCSTR; dwCurrentLog: DWORD): HRESULT; stdcall;
{$EXTERNALSYM DsSetCurrentBackupLogA}
function DsSetCurrentBackupLogW(szServerName: LPCWSTR; dwCurrentLog: DWORD): HRESULT; stdcall;
{$EXTERNALSYM DsSetCurrentBackupLogW}

{$IFDEF UNICODE}
function DsSetCurrentBackupLog(szServerName: LPCWSTR; dwCurrentLog: DWORD): HRESULT; stdcall;
{$EXTERNALSYM DsSetCurrentBackupLog}
{$ELSE}
function DsSetCurrentBackupLog(szServerName: LPCSTR; dwCurrentLog: DWORD): HRESULT; stdcall;
{$EXTERNALSYM DsSetCurrentBackupLog}
{$ENDIF}

{*************************************************************************************
Routine Description:

      DsSetAuthIdentity
        Used to set the security context under which the client APIs are to be
        called. If this function is not called, security context of the current
        process is assumed.

  Arguments:
    [in]    szUserName - name of the user
    [in]    szDomainName -  name of the domain the user belongs to
    [in]    szPassword - password of the user in the specified domain

Return Value:

    One of the standard HRESULT success codes;
    Failure code otherwise.
**************************************************************************************}

function DsSetAuthIdentityA(szUserName, szDomainName, szPassword: LPCSTR): HRESULT; stdcall;
{$EXTERNALSYM DsSetAuthIdentityA}
function DsSetAuthIdentityW(szUserName, szDomainName, szPassword: LPCWSTR): HRESULT; stdcall;
{$EXTERNALSYM DsSetAuthIdentityW}

{$IFDEF UNICODE}
function DsSetAuthIdentity(szUserName, szDomainName, szPassword: LPCWSTR): HRESULT; stdcall;
{$EXTERNALSYM DsSetAuthIdentity}
{$ELSE}
function DsSetAuthIdentity(szUserName, szDomainName, szPassword: LPCSTR): HRESULT; stdcall;
{$EXTERNALSYM DsSetAuthIdentity}
{$ENDIF}

implementation

const
  ntdsbclilib = 'ntdsbclilib.dll';


{$IFDEF DYNAMIC_LINK}
var
  _DsIsNTDSOnlineA: Pointer;

function DsIsNTDSOnlineA;
begin
  GetProcedureAddress(_DsIsNTDSOnlineA, ntdsbclilib, 'DsIsNTDSOnlineA');
  asm
    mov esp, ebp
    pop ebp
    jmp [_DsIsNTDSOnlineA]
  end;
end;
{$ELSE}
function DsIsNTDSOnlineA; external ntdsbclilib name 'DsIsNTDSOnlineA';
{$ENDIF DYNAMIC_LINK}

{$IFDEF DYNAMIC_LINK}
var
  _DsIsNTDSOnlineW: Pointer;

function DsIsNTDSOnlineW;
begin
  GetProcedureAddress(_DsIsNTDSOnlineW, ntdsbclilib, 'DsIsNTDSOnlineW');
  asm
    mov esp, ebp
    pop ebp
    jmp [_DsIsNTDSOnlineW]
  end;
end;
{$ELSE}
function DsIsNTDSOnlineW; external ntdsbclilib name 'DsIsNTDSOnlineW';
{$ENDIF DYNAMIC_LINK}
{$IFDEF UNICODE}

{$IFDEF DYNAMIC_LINK}
var
  _DsIsNTDSOnline: Pointer;

function DsIsNTDSOnline;
begin
  GetProcedureAddress(_DsIsNTDSOnline, ntdsbclilib, 'DsIsNTDSOnlineW');
  asm
    mov esp, ebp
    pop ebp
    jmp [_DsIsNTDSOnline]
  end;
end;
{$ELSE}
function DsIsNTDSOnline; external ntdsbclilib name 'DsIsNTDSOnlineW';
{$ENDIF DYNAMIC_LINK}
{$ELSE}

{$IFDEF DYNAMIC_LINK}
var
  _DsIsNTDSOnline: Pointer;

function DsIsNTDSOnline;
begin
  GetProcedureAddress(_DsIsNTDSOnline, ntdsbclilib, 'DsIsNTDSOnlineA');
  asm
    mov esp, ebp
    pop ebp
    jmp [_DsIsNTDSOnline]
  end;
end;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -