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.

95 lines
1.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows NT Security
  4. // Copyright (C) Microsoft Corporation, 1997 - 1999
  5. //
  6. // File: cua.h
  7. //
  8. // Contents: CCryptUrlArray class definition
  9. //
  10. // History: 16-Sep-97 kirtd Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #if !defined(__CUA_H__)
  14. #define __CUA_H__
  15. #include <windows.h>
  16. #include <wincrypt.h>
  17. //
  18. // CCryptUrlArray. This class manages a CRYPT_URL_ARRAY structure. Note that
  19. // the freeing of the internal array structure must be done explicitly
  20. //
  21. class CCryptUrlArray
  22. {
  23. public:
  24. //
  25. // Construction
  26. //
  27. CCryptUrlArray (ULONG cMinUrls, ULONG cGrowUrls, BOOL& rfResult);
  28. // NOTE: Only accepts native form URL arrays or read-only single buffer
  29. // encoded arrays
  30. CCryptUrlArray (PCRYPT_URL_ARRAY pcua, ULONG cGrowUrls);
  31. ~CCryptUrlArray () {};
  32. //
  33. // URL management methods
  34. //
  35. static LPWSTR AllocUrl (ULONG cw);
  36. static LPWSTR ReallocUrl (LPWSTR pwszUrl, ULONG cw);
  37. static VOID FreeUrl (LPWSTR pwszUrl);
  38. BOOL AddUrl (LPWSTR pwszUrl, BOOL fCopyUrl);
  39. LPWSTR GetUrl (ULONG Index);
  40. //
  41. // Array management methods
  42. //
  43. DWORD GetUrlCount ();
  44. VOID GetArrayInNativeForm (PCRYPT_URL_ARRAY pcua);
  45. BOOL GetArrayInSingleBufferEncodedForm (
  46. PCRYPT_URL_ARRAY* ppcua,
  47. ULONG* pcb = NULL
  48. );
  49. VOID FreeArray (BOOL fFreeUrls);
  50. private:
  51. //
  52. // Internal URL array
  53. //
  54. CRYPT_URL_ARRAY m_cua;
  55. //
  56. // Current URL array size
  57. //
  58. ULONG m_cArray;
  59. //
  60. // Grow URLs by
  61. //
  62. ULONG m_cGrowUrls;
  63. //
  64. // Private methods
  65. //
  66. BOOL GrowArray ();
  67. };
  68. #endif