Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

197 lines
5.5 KiB

  1. /*
  2. * sadapi.h
  3. *
  4. * Copyright (c) Microsoft Corp. 1986-1996. All Rights Reserved.
  5. *
  6. * Definition of the public RPC APIs from the SAD Exchange service
  7. *
  8. */
  9. #ifndef _SADLIB_H_
  10. #define _SADLIB_H_
  11. #include "rpcpub.h"
  12. #ifdef __cplusplus
  13. extern "C"
  14. {
  15. #endif
  16. /*
  17. * Return codes for all functions except SAD_EcGetProxies() and SAD_EcGetProxiesBI().
  18. * In addition to this list are all normal NT error codes...
  19. */
  20. typedef enum _SC_RETURN_VALUES
  21. {
  22. SC_OK = 0, // no error
  23. SC_Error = 49001, // general error
  24. SC_BPActive, // bulk proxy generation is currently running
  25. SC_BPInactive, // bulk proxy generation is not currently running
  26. SC_BPShutdownPending, // a shutdown in bulk proxy generation is in progress
  27. SC_BPSiteAddressMismatch, // a Site Address Mismatch between rgszOldSiteAddress
  28. // and rgszNewSiteAddress lists in ScBulkUpdateMultiProxy
  29. } SC_RETURN_VALUES;
  30. #define cchMaxServer (MAX_COMPUTERNAME_LENGTH + 1)
  31. typedef struct _RPCBINDINFO
  32. {
  33. handle_t h;
  34. WCHAR wszServer[cchMaxServer];
  35. RPC_IF_HANDLE hClientIfHandle;
  36. } RPCBINDINFO, *PRPCBINDINFO;
  37. // Utility entry points
  38. RPC_SC WINAPI SAD_ScBindA(PRPCBINDINFO pBI, LPSTR szServer);
  39. RPC_SC WINAPI SAD_ScBindW(PRPCBINDINFO pBI, LPWSTR wszServer);
  40. void WINAPI SAD_Unbind(PRPCBINDINFO pBI);
  41. #ifdef UNICODE
  42. #define SAD_ScBind SAD_ScBindW
  43. #else
  44. #define SAD_ScBind SAD_ScBindA
  45. #endif
  46. // Message Tracking group
  47. RPC_SC WINAPI SAD_ScSaveGatewayTrackingData(PRPCBINDINFO pBI,
  48. RPC_GATEWAY_TRACK_INFORMATION * pgti,
  49. INT cszRecipients,
  50. LPWSTR rgwszRecipients[]);
  51. // for Microsoft Internal Use ONLY
  52. RPC_SC WINAPI SAD_ScSaveTrackingData(PRPCBINDINFO pBI, INT cb, BYTE pb[], DWORD dwFlags);
  53. // for Gateways - cause the routing table to be recalculated
  54. RPC_SC WINAPI SAD_ScRunRIDA(LPSTR szServer);
  55. RPC_SC WINAPI SAD_ScRunRIDW(LPWSTR wszServer);
  56. RPC_SC WINAPI SAD_ScRunRIDExA(LPSTR szServer, RPC_BOOL fProxySpace, RPC_BOOL fGwart);
  57. RPC_SC WINAPI SAD_ScRunRIDExW(LPWSTR wszServer, RPC_BOOL fProxySpace, RPC_BOOL fGwart);
  58. #ifdef UNICODE
  59. #define SAD_ScRunRID SAD_ScRunRIDW
  60. #define SAD_ScRunRIDEx SAD_ScRunRIDExW
  61. #else
  62. #define SAD_ScRunRID SAD_ScRunRIDA
  63. #define SAD_ScRunRIDEx SAD_ScRunRIDExA
  64. #endif
  65. // Proxy Entry points
  66. RPC_EC WINAPI SAD_EcGetProxies(LPWSTR wszServer, PPROXYINFO pProxyInfo, PPROXYLIST pProxyList);
  67. RPC_EC WINAPI SAD_EcGetProxiesBI(PRPCBINDINFO pBI, PPROXYINFO pProxyInfo, PPROXYLIST pProxyList);
  68. void WINAPI SAD_FreeProxyListNode(PPROXYNODE pnode);
  69. RPC_SC WINAPI SAD_ScIsProxyUniqueA(LPSTR szServer,
  70. LPSTR szProxy, RPC_BOOL * pfUnique, LPSTR * pszExisting);
  71. RPC_SC WINAPI SAD_ScIsProxyUniqueW(LPWSTR wszServer,
  72. LPWSTR szProxy, RPC_BOOL * pfUnique, LPWSTR * pszExisting);
  73. // dwOptions values for SAD_ScBulkCreateProxy() and SAD_ScBulkCreateMultiProxy()
  74. #define BPTAdd 1
  75. #define BPTRemove 2
  76. #define BPTUpdate 3
  77. RPC_SC WINAPI SAD_ScBulkCreateProxyA(LPSTR szServer, LPSTR szHeader, DWORD dwOptions);
  78. RPC_SC WINAPI SAD_ScBulkCreateProxyW(LPWSTR wszServer, LPWSTR wszHeader, DWORD dwOptions);
  79. RPC_SC WINAPI SAD_ScBulkCreateMultiProxyA(LPSTR szServer,
  80. INT cszHeader,
  81. LPSTR rgszHeader[],
  82. DWORD dwOptions);
  83. RPC_SC WINAPI SAD_ScBulkCreateMultiProxyW(LPWSTR wszServer,
  84. INT cwszHeader,
  85. LPWSTR rgwszHeader[],
  86. DWORD dwOptions);
  87. RPC_SC WINAPI SAD_ScBulkUpdateMultiProxy(LPWSTR wszServer,
  88. INT cwszSiteAddress,
  89. LPWSTR rgwszOldSiteAddress[],
  90. LPWSTR rgwszNewSiteAddress[],
  91. RPC_BOOL fSaveSiteAddress);
  92. RPC_SC WINAPI SAD_ScGetBulkProxyStatusA(LPSTR szServer,
  93. RPC_SYSTEMTIME * pstTimeStart,
  94. DWORD * pdwTimeStart,
  95. DWORD * pdwTimeCur,
  96. INT * piRecipients,
  97. INT * pcRecipients);
  98. RPC_SC WINAPI SAD_ScGetBulkProxyStatusW(LPWSTR wszServer,
  99. RPC_SYSTEMTIME * pstTimeStart,
  100. DWORD * pdwTimeStart,
  101. DWORD * pdwTimeCur,
  102. INT * piRecipients,
  103. INT * pcRecipients);
  104. RPC_SC WINAPI SAD_ScBulkProxyHaltA(LPSTR szServer, RPC_BOOL fWaitForShutdown);
  105. RPC_SC WINAPI SAD_ScBulkProxyHaltW(LPWSTR wszServer, RPC_BOOL fWaitForShutdown);
  106. #ifdef UNICODE
  107. #define SAD_ScIsProxyUnique SAD_ScIsProxyUniqueW
  108. #define SAD_ScBulkCreateProxy SAD_ScBulkCreateProxyW
  109. #define SAD_ScBulkCreateMultiProxy SAD_ScBulkCreateMultiProxyW
  110. #define SAD_ScGetBulkProxyStatus SAD_ScGetBulkProxyStatusW
  111. #define SAD_ScBulkProxyHalt SAD_ScBulkProxyHaltW
  112. #else
  113. #define SAD_ScIsProxyUnique SAD_ScIsProxyUniqueA
  114. #define SAD_ScBulkCreateProxy SAD_ScBulkCreateProxyA
  115. #define SAD_ScBulkCreateMultiProxy SAD_ScBulkCreateMultiProxyA
  116. #define SAD_ScGetBulkProxyStatus SAD_ScGetBulkProxyStatusA
  117. #define SAD_ScBulkProxyHalt SAD_ScBulkProxyHaltA
  118. #endif
  119. // Backup entry point (available only in UNICODE!)
  120. RPC_SC WINAPI SAD_ScGetBackupListNodeW(LPWSTR wszServer, BackupListNode ** ppnode);
  121. void WINAPI SAD_FreeBackupListNode(BackupListNode * pnode);
  122. // Run DRA Check calling parameters (dwCheck)
  123. #define INTRASITE_CHECK 0
  124. #define INTERSITE_CHECK 1
  125. RPC_SC WINAPI SAD_ScRunDRACheck(LPWSTR wszServer, RPC_DWORD dwCheck);
  126. // These few lines (or equivalent) need to be supplied by the application that links
  127. // with SADAPI.LIB.
  128. #ifdef _SAMPLE_CODE
  129. void __RPC_FAR * __RPC_API midl_user_allocate(size_t cb)
  130. {
  131. void * pv;
  132. pv = GlobalAlloc(GMEM_FIXED, cb);
  133. if (!pv)
  134. RpcRaiseException(RPC_S_OUT_OF_MEMORY);
  135. return pv;
  136. }
  137. void __RPC_API midl_user_free(void __RPC_FAR * pv)
  138. {
  139. GlobalFree(pv);
  140. }
  141. #endif
  142. #ifdef __cplusplus
  143. }
  144. #endif
  145. #endif // #ifndef _SADLIB_H_