Source code of Windows XP (NT5)
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
3.2 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998, 1999, 2000 Microsoft Corporation. All Rights Reserved.
  4. //
  5. // SYSTEM: Windows Update Critical Fix Notification
  6. //
  7. // CLASS: N/A
  8. // MODULE: MS Cab Trusting Function Header
  9. // FILE: NewTrust.h
  10. //
  11. /////////////////////////////////////////////////////////////////////
  12. //
  13. // DESC: this header file declares functions used to make Microsoft
  14. // signed cab trusted.
  15. //
  16. // AUTHOR: Alessandro Muti, Windows Update Team
  17. // DATE: 3/11/1999
  18. //
  19. /////////////////////////////////////////////////////////////////////
  20. //
  21. // Revision History:
  22. //
  23. // Date Author Description
  24. // ~~~~ ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  25. // 10/17/2000 Nick Dallett Porting Charlma's new cert-checking code from SLM tree:
  26. // (8/31/2000 charlma Changed to only publish VerifyFile())
  27. //
  28. //
  29. /////////////////////////////////////////////////////////////////////
  30. //
  31. // (c) Copyrights: 1998, 1999, 2000 Microsoft Corporation
  32. //
  33. // All rights reserved.
  34. //
  35. // No portion of this source code may be reproduced
  36. // without express written permission of Microsoft Corporation.
  37. //
  38. // This source code is proprietary and confidential.
  39. /////////////////////////////////////////////////////////////////////
  40. //
  41. #ifndef __NEWTRUST_HEADER
  42. #define __NEWTRUST_HEADER
  43. //HRESULT CheckWinTrust(LPCTSTR pszFileName, DWORD dwUIChoice);
  44. //HRESULT CheckMSCert(LPCTSTR pszFileName);
  45. #include <wintrust.h>
  46. /////////////////////////////////////////////////////////////////////////////
  47. //
  48. // Public Function VerifyFile()
  49. //
  50. // This is a wrapper function for CheckWinTrust that both Whistler
  51. // and WU classic code should use.
  52. //
  53. // Input: szFileName - the file with complete path
  54. // fShowBadUI - whether pop up UI in cases
  55. // (1) inproperly signed signature, or
  56. // (2) properly signed with a non-MS cert
  57. //
  58. // Return: HRESULT - S_OK the file is signed with a valid MS cert
  59. // or error code.
  60. // If the file is signed correctly but cert is not
  61. // a known Microsoft cert included in this feature, then
  62. // CERT_UNTRUSTED_ROOT is returned.
  63. //
  64. // Good Cert: Here is the deifnition of a good cert, in addition to the fact
  65. // that the signature must be valid and not expired.
  66. // (1) The signature was signed with a cert that has
  67. // "Microsoft Root Authority" as root, or
  68. // (2) The signature was signed with one of the following known
  69. // Microsoft cert's (they are not rooted to MS)
  70. // * Microsoft Corporation
  71. // * Microsoft Corporation MSN
  72. // * MSNBC Interactive News LLC
  73. // * Microsoft Corporation MSN (Europe)
  74. // * Microsoft Corporation (Europe)
  75. //
  76. // Note: If _WUV3TEST flag is set (for test build), then fShowBadUI is
  77. // ignored:
  78. // if reg key SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\wuv3test\WinTrustUI
  79. // is set to 1, then no UI is shown, and this function always return S_OK;
  80. // otherwise, UI always show no matter what cert, and return value is same
  81. // as the live build.
  82. //
  83. /////////////////////////////////////////////////////////////////////////////
  84. HRESULT VerifyFile(IN LPCTSTR szFileName, BOOL fShowBadUI = TRUE);
  85. #endif //__NEWTRUST_HEADER