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.

111 lines
2.4 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows NT Security
  4. // Copyright (C) Microsoft Corporation, 1997 - 1999
  5. //
  6. // File: async.h
  7. //
  8. // Contents: Async Parameter Management definitions
  9. //
  10. // History: 05-Aug-97 kirtd Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #if !defined(__ASYNC_H__)
  14. #define __ASYNC_H__
  15. //
  16. // CCryptAsyncHandle. Async parameter handle class, a list of OID
  17. // specified parameters.
  18. //
  19. typedef struct _CRYPT_ASYNC_PARAM {
  20. LPSTR pszOid;
  21. LPVOID pvParam;
  22. PFN_CRYPT_ASYNC_PARAM_FREE_FUNC pfnFree;
  23. struct _CRYPT_ASYNC_PARAM* pPrev;
  24. struct _CRYPT_ASYNC_PARAM* pNext;
  25. } CRYPT_ASYNC_PARAM, *PCRYPT_ASYNC_PARAM;
  26. class CCryptAsyncHandle
  27. {
  28. public:
  29. //
  30. // Construction
  31. //
  32. CCryptAsyncHandle (DWORD dwFlags);
  33. ~CCryptAsyncHandle ();
  34. //
  35. // Management methods
  36. //
  37. BOOL SetAsyncParam (
  38. LPSTR pszParamOid,
  39. LPVOID pvParam,
  40. PFN_CRYPT_ASYNC_PARAM_FREE_FUNC pfnFree
  41. );
  42. BOOL GetAsyncParam (
  43. LPSTR pszParamOid,
  44. LPVOID* ppvParam,
  45. PFN_CRYPT_ASYNC_PARAM_FREE_FUNC* ppfnFree
  46. );
  47. private:
  48. //
  49. // Lock
  50. //
  51. CRITICAL_SECTION m_AsyncLock;
  52. //
  53. // Parameter lists
  54. //
  55. PCRYPT_ASYNC_PARAM m_pConstOidList;
  56. PCRYPT_ASYNC_PARAM m_pStrOidList;
  57. //
  58. // Private methods
  59. //
  60. BOOL AllocAsyncParam (
  61. LPSTR pszParamOid,
  62. BOOL fConstOid,
  63. LPVOID pvParam,
  64. PFN_CRYPT_ASYNC_PARAM_FREE_FUNC pfnFree,
  65. PCRYPT_ASYNC_PARAM* ppParam
  66. );
  67. VOID FreeAsyncParam (
  68. PCRYPT_ASYNC_PARAM pParam,
  69. BOOL fConstOid
  70. );
  71. VOID AddAsyncParam (
  72. PCRYPT_ASYNC_PARAM pParam,
  73. BOOL fConstOid
  74. );
  75. VOID RemoveAsyncParam (
  76. PCRYPT_ASYNC_PARAM pParam
  77. );
  78. PCRYPT_ASYNC_PARAM FindAsyncParam (
  79. LPSTR pszParamOid,
  80. BOOL fConstOid
  81. );
  82. VOID FreeOidList (
  83. PCRYPT_ASYNC_PARAM pOidList,
  84. BOOL fConstOidList
  85. );
  86. };
  87. #endif