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.

92 lines
2.8 KiB

  1. //+-------------------------------------------------------------------------
  2. // Microsoft Windows
  3. //
  4. // Copyright (C) Microsoft Corporation, 2002 - 2002
  5. //
  6. // File: i_cryptasn1tls.h
  7. //
  8. // Contents: Crypt ASN.1 Thread Local Storage (TLS) functions
  9. //--------------------------------------------------------------------------
  10. #ifndef __I_CRYPTASN1TLS_H__
  11. #define __I_CRYPTASN1TLS_H__
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. // Handle to an installed Asn1 module
  16. typedef DWORD HCRYPTASN1MODULE;
  17. // Pointers to ASN1 data structures
  18. typedef void *ASN1module_t;
  19. typedef void *ASN1encoding_t;
  20. typedef void *ASN1decoding_t;
  21. //+-------------------------------------------------------------------------
  22. // Install an Asn1 module entry and return a handle for future access.
  23. //
  24. // Each thread has its own copy of the decoder and encoder associated
  25. // with the Asn1 module. Creation is deferred until first referenced by
  26. // the thread.
  27. //
  28. // I_CryptGetAsn1Encoder or I_CryptGetAsn1Decoder must be called with the
  29. // handle returned by I_CryptInstallAsn1Module to get the thread specific
  30. // Asn1 encoder or decoder.
  31. //
  32. // Currently, dwFlags and pvReserved aren't used and must be set to 0.
  33. //--------------------------------------------------------------------------
  34. HCRYPTASN1MODULE
  35. WINAPI
  36. I_CryptInstallAsn1Module(
  37. IN ASN1module_t pMod,
  38. IN DWORD dwFlags,
  39. IN void *pvReserved
  40. );
  41. //+-------------------------------------------------------------------------
  42. // Called at DLL_PROCESS_DETACH to uninstall an hAsn1Module entry. Iterates
  43. // through the threads and frees their created Asn1 encoders and decoders.
  44. //--------------------------------------------------------------------------
  45. BOOL
  46. WINAPI
  47. I_CryptUninstallAsn1Module(
  48. IN HCRYPTASN1MODULE hAsn1Module
  49. );
  50. //+-------------------------------------------------------------------------
  51. // Get the thread specific pointer to the Asn1 encoder specified by the
  52. // hAsn1Module returned by CryptInstallAsn1Module. If the
  53. // encoder doesn't exist, then, its created using the Asn1 module
  54. // associated with hAsn1Module.
  55. //--------------------------------------------------------------------------
  56. ASN1encoding_t
  57. WINAPI
  58. I_CryptGetAsn1Encoder(
  59. IN HCRYPTASN1MODULE hAsn1Module
  60. );
  61. //+-------------------------------------------------------------------------
  62. // Get the thread specific pointer to the Asn1 decoder specified by the
  63. // hAsn1Module returned by CryptInstallAsn1Module. If the
  64. // decoder doesn't exist, then, its created using the Asn1 module
  65. // associated with hAsn1Module.
  66. //--------------------------------------------------------------------------
  67. ASN1decoding_t
  68. WINAPI
  69. I_CryptGetAsn1Decoder(
  70. IN HCRYPTASN1MODULE hAsn1Module
  71. );
  72. #ifdef __cplusplus
  73. } // Balance extern "C" above
  74. #endif
  75. #endif