Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #ifdef _CERTBCLI_TYPECHECK
      7 #undef __CERTBCLI_H__
      8 #endif
      9 
     10 #ifndef __CERTBCLI_H__
     11 #define __CERTBCLI_H__
     12 
     13 #ifdef __cplusplus
     14 extern "C" {
     15 #endif
     16 
     17 #ifndef _NO_W32_PSEUDO_MODIFIERS
     18 #ifndef IN
     19 #define IN
     20 #endif
     21 #ifndef OUT
     22 #define OUT
     23 #endif
     24 #ifndef OPTIONAL
     25 #define OPTIONAL
     26 #endif
     27 #endif
     28 
     29 #ifndef RPC_STRING
     30 #define RPC_STRING
     31 #endif
     32 #ifndef VOID
     33 #define VOID void
     34 #endif
     35 
     36 #define CERTBCLI_CALL WINAPI
     37 #define CERTBCLI_API __declspec(dllimport) WINAPI
     38 
     39 #define szBACKUPANNOTATION "Cert Server Backup Interface"
     40 #define wszBACKUPANNOTATION TEXT(szBACKUPANNOTATION)
     41 
     42 #define szRESTOREANNOTATION "Cert Server Restore Interface"
     43 #define wszRESTOREANNOTATION TEXT(szRESTOREANNOTATION)
     44 
     45 #define CSBACKUP_TYPE_FULL 0x00000001
     46 #define CSBACKUP_TYPE_LOGS_ONLY 0x00000002
     47 
     48 #define CSBACKUP_TYPE_MASK 0x00000003
     49 
     50 #define CSRESTORE_TYPE_FULL 0x00000001
     51 #define CSRESTORE_TYPE_ONLINE 0x00000002
     52 #define CSRESTORE_TYPE_CATCHUP 0x00000004
     53 #define CSRESTORE_TYPE_MASK 0x00000005
     54 
     55 #define CSBACKUP_DISABLE_INCREMENTAL 0xffffffff
     56 
     57   typedef WCHAR CSBFT;
     58 
     59 #define CSBFT_DIRECTORY 0x80
     60 #define CSBFT_DATABASE_DIRECTORY 0x40
     61 #define CSBFT_LOG_DIRECTORY 0x20
     62 
     63 #define CSBFT_LOG ((CSBFT) (TEXT('\x01') | CSBFT_LOG_DIRECTORY))
     64 #define CSBFT_LOG_DIR ((CSBFT) (TEXT('\x02') | CSBFT_DIRECTORY))
     65 #define CSBFT_CHECKPOINT_DIR ((CSBFT) (TEXT('\x03') | CSBFT_DIRECTORY))
     66 #define CSBFT_CERTSERVER_DATABASE ((CSBFT) (TEXT('\x04') | CSBFT_DATABASE_DIRECTORY))
     67 #define CSBFT_PATCH_FILE ((CSBFT) (TEXT('\x05') | CSBFT_LOG_DIRECTORY))
     68 #define CSBFT_UNKNOWN ((CSBFT) (TEXT('\x0f')))
     69 
     70   typedef void *HCSBC;
     71 
     72 #ifndef CSEDB_RSTMAP
     73   typedef struct tagCSEDB_RSTMAPW {
     74     WCHAR *pwszDatabaseName;
     75     WCHAR *pwszNewDatabaseName;
     76   } CSEDB_RSTMAPW;
     77 
     78 #define CSEDB_RSTMAP CSEDB_RSTMAPW
     79 #endif
     80 
     81 #define CertSrvIsServerOnline CertSrvIsServerOnlineW
     82 #define CertSrvBackupGetDynamicFileList CertSrvBackupGetDynamicFileListW
     83 #define CertSrvBackupPrepare CertSrvBackupPrepareW
     84 #define CertSrvBackupGetDatabaseNames CertSrvBackupGetDatabaseNamesW
     85 #define CertSrvBackupOpenFile CertSrvBackupOpenFileW
     86 #define CertSrvBackupGetBackupLogs CertSrvBackupGetBackupLogsW
     87 
     88 #define CertSrvRestoreGetDatabaseLocations CertSrvRestoreGetDatabaseLocationsW
     89 #define CertSrvRestorePrepare CertSrvRestorePrepareW
     90 #define CertSrvRestoreRegister CertSrvRestoreRegisterW
     91 
     92 #define CertSrvServerControl CertSrvServerControlW
     93 
     94   typedef HRESULT (WINAPI FNCERTSRVISSERVERONLINEW)(WCHAR const *pwszServerName,WINBOOL *pfServerOnline);
     95 
     96   HRESULT CERTBCLI_API CertSrvIsServerOnlineW(WCHAR const *pwszServerName,WINBOOL *pfServerOnline);
     97 
     98 #ifdef _CERTBCLI_TYPECHECK
     99   FNCERTSRVISSERVERONLINEW *pfnCertSrvIsServerOnline = CertSrvIsServerOnline;
    100 #endif
    101 
    102   typedef HRESULT (WINAPI FNCERTSRVBACKUPGETDYNAMICFILELISTW)(HCSBC hbc,WCHAR **ppwszzFileList,DWORD *pcbSize);
    103 
    104   HRESULT CERTBCLI_API CertSrvBackupGetDynamicFileListW(HCSBC hbc,WCHAR **ppwszzFileList,DWORD *pcbSize);
    105 
    106 #ifdef _CERTBCLI_TYPECHECK
    107   FNCERTSRVBACKUPGETDYNAMICFILELISTW *pfnCertSrvBackupGetDynamicFileList = CertSrvBackupGetDynamicFileList;
    108 #endif
    109 
    110   typedef HRESULT (WINAPI FNCERTSRVBACKUPPREPAREW)(WCHAR const *pwszServerName,ULONG grbitJet,ULONG dwBackupFlags,HCSBC *phbc);
    111 
    112   HRESULT CERTBCLI_API CertSrvBackupPrepareW(WCHAR const *pwszServerName,ULONG grbitJet,ULONG dwBackupFlags,HCSBC *phbc);
    113 
    114 #ifdef _CERTBCLI_TYPECHECK
    115   FNCERTSRVBACKUPPREPAREW *pfnCertSrvBackupPrepare = CertSrvBackupPrepare;
    116 #endif
    117 
    118   typedef HRESULT (WINAPI FNCERTSRVBACKUPGETDATABASENAMESW)(HCSBC hbc,WCHAR **ppwszzAttachmentInformation,DWORD *pcbSize);
    119 
    120   HRESULT CERTBCLI_API CertSrvBackupGetDatabaseNamesW(HCSBC hbc,WCHAR **ppwszzAttachmentInformation,DWORD *pcbSize);
    121 
    122 #ifdef _CERTBCLI_TYPECHECK
    123   FNCERTSRVBACKUPGETDATABASENAMESW *pfnCertSrvBackupGetDatabaseNames = CertSrvBackupGetDatabaseNames;
    124 #endif
    125 
    126   typedef HRESULT (WINAPI FNCERTSRVBACKUPOPENFILEW)(HCSBC hbc,WCHAR const *pwszAttachmentName,DWORD cbReadHintSize,LARGE_INTEGER *pliFileSize);
    127 
    128   HRESULT CERTBCLI_API CertSrvBackupOpenFileW(HCSBC hbc,WCHAR const *pwszAttachmentName,DWORD cbReadHintSize,LARGE_INTEGER *pliFileSize);
    129 
    130 #ifdef _CERTBCLI_TYPECHECK
    131   FNCERTSRVBACKUPOPENFILEW *pfnCertSrvBackupOpenFile = CertSrvBackupOpenFile;
    132 #endif
    133 
    134   typedef HRESULT (WINAPI FNCERTSRVBACKUPREAD)(HCSBC hbc,VOID *pvBuffer,DWORD cbBuffer,DWORD *pcbRead);
    135 
    136   HRESULT CERTBCLI_API CertSrvBackupRead(HCSBC hbc,VOID *pvBuffer,DWORD cbBuffer,DWORD *pcbRead);
    137 
    138 #ifdef _CERTBCLI_TYPECHECK
    139   FNCERTSRVBACKUPREAD *pfnCertSrvBackupRead = CertSrvBackupRead;
    140 #endif
    141 
    142   typedef HRESULT (WINAPI FNCERTSRVBACKUPCLOSE)(HCSBC hbc);
    143 
    144   HRESULT CERTBCLI_API CertSrvBackupClose(HCSBC hbc);
    145 
    146 #ifdef _CERTBCLI_TYPECHECK
    147   FNCERTSRVBACKUPCLOSE *pfnCertSrvBackupClose = CertSrvBackupClose;
    148 #endif
    149 
    150   typedef HRESULT (WINAPI FNCERTSRVBACKUPGETBACKUPLOGSW)(HCSBC hbc,WCHAR **ppwszzBackupLogFiles,DWORD *pcbSize);
    151 
    152   HRESULT CERTBCLI_API CertSrvBackupGetBackupLogsW(HCSBC hbc,WCHAR **ppwszzBackupLogFiles,DWORD *pcbSize);
    153 
    154 #ifdef _CERTBCLI_TYPECHECK
    155   FNCERTSRVBACKUPGETBACKUPLOGSW *pfnCertSrvBackupGetBackupLogs = CertSrvBackupGetBackupLogs;
    156 #endif
    157 
    158   typedef HRESULT (WINAPI FNCERTSRVBACKUPTRUNCATELOGS)(HCSBC hbc);
    159 
    160   HRESULT CERTBCLI_API CertSrvBackupTruncateLogs(HCSBC hbc);
    161 
    162 #ifdef _CERTBCLI_TYPECHECK
    163   FNCERTSRVBACKUPTRUNCATELOGS *pfnCertSrvBackupTruncateLogs = CertSrvBackupTruncateLogs;
    164 #endif
    165 
    166   typedef HRESULT (WINAPI FNCERTSRVBACKUPEND)(HCSBC hbc);
    167 
    168   HRESULT CERTBCLI_API CertSrvBackupEnd(HCSBC hbc);
    169 
    170 #ifdef _CERTBCLI_TYPECHECK
    171   FNCERTSRVBACKUPEND *pfnCertSrvBackupEnd = CertSrvBackupEnd;
    172 #endif
    173 
    174   typedef VOID (WINAPI FNCERTSRVBACKUPFREE)(VOID *pv);
    175 
    176   VOID CERTBCLI_API CertSrvBackupFree(VOID *pv);
    177 
    178 #ifdef _CERTBCLI_TYPECHECK
    179   FNCERTSRVBACKUPFREE *pfnCertSrvBackupFree = CertSrvBackupFree;
    180 #endif
    181 
    182   typedef HRESULT (WINAPI FNCERTSRVRESTOREGETDATABASELOCATIONSW)(HCSBC hbc,WCHAR **ppwszzDatabaseLocationList,DWORD *pcbSize);
    183 
    184   HRESULT CERTBCLI_API CertSrvRestoreGetDatabaseLocationsW(HCSBC hbc,WCHAR **ppwszzDatabaseLocationList,DWORD *pcbSize);
    185 
    186 #ifdef _CERTBCLI_TYPECHECK
    187   FNCERTSRVRESTOREGETDATABASELOCATIONSW *pfnCertSrvRestoreGetDatabaseLocations = CertSrvRestoreGetDatabaseLocations;
    188 #endif
    189 
    190   typedef HRESULT (WINAPI FNCERTSRVRESTOREPREPAREW)(WCHAR const *pwszServerName,ULONG dwRestoreFlags,HCSBC *phbc);
    191 
    192   HRESULT CERTBCLI_API CertSrvRestorePrepareW(WCHAR const *pwszServerName,ULONG dwRestoreFlags,HCSBC *phbc);
    193 
    194 #ifdef _CERTBCLI_TYPECHECK
    195   FNCERTSRVRESTOREPREPAREW *pfnCertSrvRestorePrepare = CertSrvRestorePrepare;
    196 #endif
    197 
    198   typedef HRESULT (WINAPI FNCERTSRVRESTOREREGISTERW)(HCSBC hbc,WCHAR const *pwszCheckPointFilePath,WCHAR const *pwszLogPath,CSEDB_RSTMAPW rgrstmap[],LONG crstmap,WCHAR const *pwszBackupLogPath,ULONG genLow,ULONG genHigh);
    199 
    200   HRESULT CERTBCLI_API CertSrvRestoreRegisterW(HCSBC hbc,WCHAR const *pwszCheckPointFilePath,WCHAR const *pwszLogPath,CSEDB_RSTMAPW rgrstmap[],LONG crstmap,WCHAR const *pwszBackupLogPath,ULONG genLow,ULONG genHigh);
    201   HRESULT CERTBCLI_API CertSrvRestoreRegisterThroughFile(HCSBC hbc,WCHAR const *pwszCheckPointFilePath,WCHAR const *pwszLogPath,CSEDB_RSTMAPW rgrstmap[],LONG crstmap,WCHAR const *pwszBackupLogPath,ULONG genLow,ULONG genHigh);
    202 
    203 #ifdef _CERTBCLI_TYPECHECK
    204   FNCERTSRVRESTOREREGISTERW *pfnCertSrvRestoreRegister = CertSrvRestoreRegister;
    205 #endif
    206 
    207   typedef HRESULT (WINAPI FNCERTSRVRESTOREREGISTERCOMPLETE)(HCSBC hbc,HRESULT hrRestoreState);
    208 
    209   HRESULT CERTBCLI_API CertSrvRestoreRegisterComplete(HCSBC hbc,HRESULT hrRestoreState);
    210 
    211 #ifdef _CERTBCLI_TYPECHECK
    212   FNCERTSRVRESTOREREGISTERCOMPLETE *pfnCertSrvRestoreRegisterComplete = CertSrvRestoreRegisterComplete;
    213 #endif
    214 
    215   typedef HRESULT (WINAPI FNCERTSRVRESTOREEND)(HCSBC hbc);
    216 
    217   HRESULT CERTBCLI_API CertSrvRestoreEnd(HCSBC hbc);
    218 
    219 #ifdef _CERTBCLI_TYPECHECK
    220   FNCERTSRVRESTOREEND *pfnCertSrvRestoreEnd = CertSrvRestoreEnd;
    221 #endif
    222 
    223 #define CSCONTROL_SHUTDOWN 0x000000001
    224 #define CSCONTROL_SUSPEND 0x000000002
    225 #define CSCONTROL_RESTART 0x000000003
    226 
    227   typedef HRESULT (WINAPI FNCERTSRVSERVERCONTROLW)(WCHAR const *pwszServerName,DWORD dwControlFlags,DWORD *pcbOut,BYTE **ppbOut);
    228 
    229   HRESULT CERTBCLI_API CertSrvServerControlW(WCHAR const *pwszServerName,DWORD dwControlFlags,DWORD *pcbOut,BYTE **ppbOut);
    230 
    231 #ifdef _CERTBCLI_TYPECHECK
    232   FNCERTSRVSERVERCONTROLW *pfnCertSrvServerControl = CertSrvServerControl;
    233 #endif
    234 
    235 #ifdef __cplusplus
    236 }
    237 #endif
    238 #endif
    239