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.

265 lines
5.9 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1997, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // iasapi.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // This file describes all "C"-style API functions in the Everest core.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 08/29/1997 Original version.
  16. // 11/12/1997 Added IASUpdateRegistry.
  17. // 11/26/1997 Revised timer API.
  18. // 01/08/1998 Made changes so that header could stand alone.
  19. // 01/30/1998 Added IASAdler32.
  20. // 04/17/1998 Added IASLookupAttributeIDs.
  21. // 06/16/1998 Added IASVariantChangeType.
  22. // 08/13/1998 Removed obsolete API's.
  23. // 04/19/1999 Added IASRadiusCrypt.
  24. // 01/25/2000 Added IASGetHostByName.
  25. // 04/14/2000 Added dictionary API.
  26. //
  27. ///////////////////////////////////////////////////////////////////////////////
  28. #ifndef _IASAPI_H_
  29. #define _IASAPI_H_
  30. #ifndef IASCOREAPI
  31. #define IASCOREAPI DECLSPEC_IMPORT
  32. #endif
  33. #include <wtypes.h>
  34. #include <oaidl.h>
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38. ///////////////////////////////////////////////////////////////////////////////
  39. //
  40. // Functions to initialize and shutdown the core services.
  41. //
  42. ///////////////////////////////////////////////////////////////////////////////
  43. IASCOREAPI
  44. BOOL
  45. WINAPI
  46. IASInitialize ( VOID );
  47. IASCOREAPI
  48. VOID
  49. WINAPI
  50. IASUninitialize ( VOID );
  51. ///////////////////////////////////////////////////////////////////////////////
  52. //
  53. // Function for computing the Adler-32 checksum of a buffer.
  54. //
  55. ///////////////////////////////////////////////////////////////////////////////
  56. IASCOREAPI
  57. DWORD
  58. WINAPI
  59. IASAdler32(
  60. CONST BYTE *pBuffer,
  61. DWORD nBufferLength
  62. );
  63. // The Adler-32 checksum is also a decent hash algorithm.
  64. #define IASHashBytes IASAdler32
  65. ///////////////////////////////////////////////////////////////////////////////
  66. //
  67. // Allocate a 32-bit integer that's guaranteed to be unique process wide.
  68. //
  69. ///////////////////////////////////////////////////////////////////////////////
  70. IASCOREAPI
  71. DWORD
  72. WINAPI
  73. IASAllocateUniqueID( VOID );
  74. ///////////////////////////////////////////////////////////////////////////////
  75. //
  76. // Functions for updating the registry.
  77. //
  78. ///////////////////////////////////////////////////////////////////////////////
  79. #define IAS_REGISTRY_INPROC 0x00000000
  80. #define IAS_REGISTRY_LOCAL 0x00000001
  81. #define IAS_REGISTRY_FREE 0x00000000
  82. #define IAS_REGISTRY_APT 0x00000002
  83. #define IAS_REGISTRY_BOTH 0x00000004
  84. #define IAS_REGISTRY_AUTO 0x00000008
  85. IASCOREAPI
  86. HRESULT
  87. WINAPI
  88. IASRegisterComponent(
  89. HINSTANCE hInstance,
  90. REFCLSID clsid,
  91. LPCWSTR szProgramName,
  92. LPCWSTR szComponentName,
  93. DWORD dwRegFlags,
  94. REFGUID tlid,
  95. WORD wVerMajor,
  96. WORD wVerMinor,
  97. BOOL bRegister
  98. );
  99. ///////////////////////////////////////////////////////////////////////////////
  100. //
  101. // IASReportEvent is used to report events within the Everest server.
  102. //
  103. ///////////////////////////////////////////////////////////////////////////////
  104. IASCOREAPI
  105. HRESULT
  106. WINAPI
  107. IASReportEvent(
  108. DWORD dwEventID,
  109. DWORD dwNumStrings,
  110. DWORD dwDataSize,
  111. LPCWSTR *lpStrings,
  112. LPVOID lpRawData
  113. );
  114. ///////////////////////////////////////////////////////////////////////////////
  115. //
  116. // Generic callback struct.
  117. //
  118. ///////////////////////////////////////////////////////////////////////////////
  119. typedef struct IAS_CALLBACK IAS_CALLBACK, *PIAS_CALLBACK;
  120. typedef VOID (WINAPI *IAS_CALLBACK_ROUTINE)(
  121. PIAS_CALLBACK This
  122. );
  123. struct IAS_CALLBACK {
  124. IAS_CALLBACK_ROUTINE CallbackRoutine;
  125. };
  126. ///////////////////////////////////////////////////////////////////////////////
  127. //
  128. // This is the native "C"-style interface into the threading engine.
  129. //
  130. ///////////////////////////////////////////////////////////////////////////////
  131. IASCOREAPI
  132. BOOL
  133. WINAPI
  134. IASRequestThread(
  135. PIAS_CALLBACK pOnStart
  136. );
  137. IASCOREAPI
  138. DWORD
  139. WINAPI
  140. IASSetMaxNumberOfThreads(
  141. DWORD dwMaxNumberOfThreads
  142. );
  143. IASCOREAPI
  144. DWORD
  145. WINAPI
  146. IASSetMaxThreadIdle(
  147. DWORD dwMilliseconds
  148. );
  149. ///////////////////////////////////////////////////////////////////////////////
  150. //
  151. // Replacement for VariantChangeType to prevent hidden window.
  152. //
  153. ///////////////////////////////////////////////////////////////////////////////
  154. IASCOREAPI
  155. HRESULT
  156. WINAPI
  157. IASVariantChangeType(
  158. VARIANT * pvargDest,
  159. VARIANT * pvarSrc,
  160. USHORT wFlags,
  161. VARTYPE vt
  162. );
  163. // Map any oleaut32 calls to our implementation.
  164. #define VariantChangeType IASVariantChangeType
  165. ///////////////////////////////////////////////////////////////////////////////
  166. //
  167. // RADIUS Encryption/Decryption.
  168. //
  169. ///////////////////////////////////////////////////////////////////////////////
  170. IASCOREAPI
  171. VOID
  172. WINAPI
  173. IASRadiusCrypt(
  174. BOOL encrypt,
  175. BOOL salted,
  176. const BYTE* secret,
  177. ULONG secretLen,
  178. const BYTE* reqAuth,
  179. PBYTE buf,
  180. ULONG buflen
  181. );
  182. ///////////////////////////////////////////////////////////////////////////////
  183. //
  184. // Unicode version of gethostbyname.
  185. // The caller must free the returned hostent struct by calling LocalFree.
  186. //
  187. // Note: Since this is a Unicode API, the returned hostent struct will always
  188. // have h_name and h_aliases set to NULL.
  189. //
  190. ///////////////////////////////////////////////////////////////////////////////
  191. typedef struct hostent *PHOSTENT;
  192. IASCOREAPI
  193. PHOSTENT
  194. WINAPI
  195. IASGetHostByName(
  196. IN PCWSTR name
  197. );
  198. ///////////////////////////////////////////////////////////////////////////////
  199. //
  200. // Methods for accessing the attribute dictionary.
  201. //
  202. ///////////////////////////////////////////////////////////////////////////////
  203. typedef struct _IASTable {
  204. ULONG numColumns;
  205. ULONG numRows;
  206. BSTR* columnNames;
  207. VARTYPE* columnTypes;
  208. VARIANT* table;
  209. } IASTable;
  210. HRESULT
  211. WINAPI
  212. IASGetDictionary(
  213. IN PCWSTR path,
  214. OUT IASTable* dnary,
  215. OUT VARIANT* storage
  216. );
  217. const IASTable*
  218. WINAPI
  219. IASGetLocalDictionary( VOID );
  220. #ifdef __cplusplus
  221. }
  222. #endif
  223. #endif // _IASAPI_H_