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.

119 lines
3.8 KiB

  1. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Microsoft Windows, Copyright (C) Microsoft Corporation, 2000 - 2001.
  3. File: stdafx.h
  4. Content: Include file, generated by ATL, for standard system include files,
  5. or project specific include files that are used frequently,
  6. but are changed infrequently
  7. History: 11-15-99 dsie created
  8. ------------------------------------------------------------------------------*/
  9. #if !defined(AFX_STDAFX_H__DC6F3774_66B7_4578_91AD_7950EF7CAF8A__INCLUDED_)
  10. #define AFX_STDAFX_H__DC6F3774_66B7_4578_91AD_7950EF7CAF8A__INCLUDED_
  11. //
  12. // Turn off:
  13. //
  14. // - Unreferenced formal parameter warning.
  15. // - Assignment within conditional expression warning.
  16. //
  17. #pragma warning (disable: 4100)
  18. #pragma warning (disable: 4706)
  19. #if _MSC_VER > 1000
  20. #pragma once
  21. #endif // _MSC_VER > 1000
  22. #define STRICT
  23. #ifndef _WIN32_WINNT
  24. #define _WIN32_WINNT 0x0400
  25. #endif
  26. #define _ATL_APARTMENT_THREADED
  27. // Extra fields in CERT_CHAIN_PARA.
  28. #define CERT_CHAIN_PARA_HAS_EXTRA_FIELDS 1
  29. #include <atlbase.h>
  30. //You may derive a class from CComModule and use it if you want to override
  31. //something, but do not change the name of _Module
  32. extern CComModule _Module;
  33. #include <atlcom.h>
  34. #include <atlwin.h>
  35. #include <atlctl.h>
  36. //
  37. // Global includes.
  38. //
  39. // Set warning level to 3 for MSVC vector class.
  40. #pragma warning(push,3)
  41. #include <vector>
  42. #pragma warning(pop)
  43. #include <map>
  44. #include <activeds.h>
  45. #include <cryptui.h>
  46. #include <exdisp.h>
  47. #include <mssip.h>
  48. #include <servprov.h>
  49. #include <shlguid.h>
  50. #include <signer.h>
  51. #include <softpub.h>
  52. #include <unicode.h>
  53. #include <wintrust.h>
  54. #include <wincrypt.h>
  55. #include <winscard.h>
  56. #include <wininet.h>
  57. //
  58. // Global defines.
  59. //
  60. #define CAPICOM_VERSION ((DWORD) ((CAPICOM_MAJOR_VERSION << 16) | CAPICOM_MINOR_VERSION))
  61. #define CAPICOM_ASN_ENCODING (X509_ASN_ENCODING | PKCS_7_ASN_ENCODING)
  62. #define ARRAYSIZE(x) (sizeof(x) / sizeof(x[0]))
  63. #define szOID_CAPICOM "1.3.6.1.4.1.311.88" // Reserved for CAPICOM.
  64. #define szOID_CAPICOM_VERSION "1.3.6.1.4.1.311.88.1" // CAPICOM version
  65. #define szOID_CAPICOM_ATTRIBUTE "1.3.6.1.4.1.311.88.2" // CAPICOM attribute
  66. #define szOID_CAPICOM_DOCUMENT_NAME "1.3.6.1.4.1.311.88.2.1" // Document type attribute
  67. #define szOID_CAPICOM_DOCUMENT_DESCRIPTION "1.3.6.1.4.1.311.88.2.2" // Document description attribute
  68. #define szOID_CAPICOM_ENCRYPTED_DATA "1.3.6.1.4.1.311.88.3" // CAPICOM encrypted data message.
  69. #define szOID_CAPICOM_ENCRYPTED_CONTENT "1.3.6.1.4.1.311.88.3.1" // CAPICOM content of encrypted data.
  70. #define CAPICOM_NO_PERSIST_CONTAINER_NAME L"//Temporary Container Indicator//"
  71. #ifndef SAFE_SUBTRACT_POINTERS
  72. #define SAFE_SUBTRACT_POINTERS(__x__, __y__) ( DW_PtrDiffc(__x__, sizeof(*(__x__)), __y__, sizeof(*(__y__))) )
  73. __inline DWORD
  74. DW_PtrDiffc(
  75. IN void const *pb1,
  76. IN DWORD dwPtrEltSize1,
  77. IN void const *pb2,
  78. IN DWORD dwPtrEltSize2)
  79. {
  80. // pb1 should be greater
  81. ATLASSERT((ULONG_PTR)pb1 >= (ULONG_PTR)pb2);
  82. // both should have same elt size
  83. ATLASSERT(dwPtrEltSize1 == dwPtrEltSize2);
  84. // assert that the result doesn't overflow 32-bits
  85. ATLASSERT((DWORD)((ULONG_PTR)pb1 - (ULONG_PTR)pb2) == (ULONG_PTR)((ULONG_PTR)pb1 - (ULONG_PTR)pb2));
  86. // return number of objects between these pointers
  87. return (DWORD) ( ((ULONG_PTR)pb1 - (ULONG_PTR)pb2) / dwPtrEltSize1 );
  88. }
  89. #endif SAFE_SUBTRACT_POINTERS
  90. #pragma hdrstop
  91. //{{AFX_INSERT_LOCATION}}
  92. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  93. #endif // !defined(AFX_STDAFX_H__DC6F3774_66B7_4578_91AD_7950EF7CAF8A__INCLUDED)