Leaked source code of windows server 2003
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.

98 lines
2.4 KiB

  1. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Microsoft Windows
  3. Copyright (C) Microsoft Corporation, 1995 - 1999.
  4. File: Base64.h
  5. Content: Declaration of Base64 routines.
  6. History: 11-15-99 dsie created
  7. ------------------------------------------------------------------------------*/
  8. #ifndef __BASE64_H_
  9. #define __BASE64_H_
  10. #include "Debug.h"
  11. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  12. Function : Base64Encode
  13. Synopsis : Base64 encode the blob.
  14. Parameter: DATA_BLOB DataBlob - DATA_BLOB to be base64 encoded.
  15. BSTR * pbstrEncoded - Pointer to BSTR to receive the base64
  16. encoded blob.
  17. Remark :
  18. ------------------------------------------------------------------------------*/
  19. HRESULT Base64Encode (DATA_BLOB DataBlob,
  20. BSTR * pbstrEncoded);
  21. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  22. Function : Base64Decode
  23. Synopsis : Decode the base64 encoded blob.
  24. Parameter: BSTR bstrEncoded - BSTR of base64 encoded blob to decode.
  25. DATA_BLOB * pDataBlob - Pointer to DATA_BLOB to receive decoded
  26. data blob.
  27. Remark :
  28. ------------------------------------------------------------------------------*/
  29. HRESULT Base64Decode (BSTR bstrEncoded,
  30. DATA_BLOB * pDataBlob);
  31. #if (0)
  32. ///////////////////////////////////////////////////////////////////////////////
  33. //
  34. // Copied from \NT\ds\security\cryptoapi\common\pkifmt\pkifmt.h.
  35. //
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39. DWORD __stdcall // ERROR_*
  40. Base64DecodeA(
  41. IN CHAR const *pchIn,
  42. IN DWORD cchIn,
  43. OUT BYTE *pbOut,
  44. OUT DWORD *pcbOut);
  45. DWORD __stdcall // ERROR_*
  46. Base64DecodeW(
  47. IN WCHAR const *pchIn,
  48. IN DWORD cchIn,
  49. OUT BYTE *pbOut,
  50. OUT DWORD *pcbOut);
  51. DWORD __stdcall // ERROR_*
  52. Base64EncodeA(
  53. IN BYTE const *pbIn,
  54. IN DWORD cbIn,
  55. OUT CHAR *pchOut,
  56. OUT DWORD *pcchOut);
  57. DWORD __stdcall // ERROR_*
  58. Base64EncodeW(
  59. IN BYTE const *pbIn,
  60. IN DWORD cbIn,
  61. OUT WCHAR *pchOut,
  62. OUT DWORD *pcchOut);
  63. #ifdef __cplusplus
  64. } // Balance extern "C" above
  65. #endif
  66. #endif // #if (0)
  67. #endif //__BASE64_H_