curl_sspi.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef HEADER_CURL_SSPI_H
  2. #define HEADER_CURL_SSPI_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
  11. *
  12. * This software is licensed as described in the file COPYING, which
  13. * you should have received as part of this distribution. The terms
  14. * are also available at http://curl.haxx.se/docs/copyright.html.
  15. *
  16. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  17. * copies of the Software, and permit persons to whom the Software is
  18. * furnished to do so, under the terms of the COPYING file.
  19. *
  20. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  21. * KIND, either express or implied.
  22. *
  23. ***************************************************************************/
  24. #include "setup.h"
  25. #ifdef USE_WINDOWS_SSPI
  26. #include <curl/curl.h>
  27. /*
  28. * When including the following three headers, it is mandatory to define either
  29. * SECURITY_WIN32 or SECURITY_KERNEL, indicating who is compiling the code.
  30. */
  31. #undef SECURITY_WIN32
  32. #undef SECURITY_KERNEL
  33. #define SECURITY_WIN32 1
  34. #include <security.h>
  35. #include <sspi.h>
  36. #include <rpc.h>
  37. /* Provide some definitions missing in MinGW's headers */
  38. #ifndef SEC_I_CONTEXT_EXPIRED
  39. # define SEC_I_CONTEXT_EXPIRED ((HRESULT)0x00090317L)
  40. #endif
  41. #ifndef SEC_E_BUFFER_TOO_SMALL
  42. # define SEC_E_BUFFER_TOO_SMALL ((HRESULT)0x80090321L)
  43. #endif
  44. #ifndef SEC_E_CONTEXT_EXPIRED
  45. # define SEC_E_CONTEXT_EXPIRED ((HRESULT)0x80090317L)
  46. #endif
  47. #ifndef SEC_E_CRYPTO_SYSTEM_INVALID
  48. # define SEC_E_CRYPTO_SYSTEM_INVALID ((HRESULT)0x80090337L)
  49. #endif
  50. #ifndef SEC_E_MESSAGE_ALTERED
  51. # define SEC_E_MESSAGE_ALTERED ((HRESULT)0x8009030FL)
  52. #endif
  53. #ifndef SEC_E_OUT_OF_SEQUENCE
  54. # define SEC_E_OUT_OF_SEQUENCE ((HRESULT)0x80090310L)
  55. #endif
  56. CURLcode Curl_sspi_global_init(void);
  57. void Curl_sspi_global_cleanup(void);
  58. /* Forward-declaration of global variables defined in curl_sspi.c */
  59. extern HMODULE s_hSecDll;
  60. extern PSecurityFunctionTableA s_pSecFn;
  61. #endif /* USE_WINDOWS_SSPI */
  62. #endif /* HEADER_CURL_SSPI_H */