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.

126 lines
4.3 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // File: sigtab.h
  4. //
  5. // General definition of OLE Entry points, CClassFactory and CPropSheetExt
  6. //
  7. // Common Code for all display property sheet extension
  8. //
  9. // Copyright (c) Microsoft Corp. 1992-1998 All Rights Reserved
  10. //
  11. //---------------------------------------------------------------------------
  12. #include <windows.h>
  13. #include <windowsx.h>
  14. #include <shlobj.h>
  15. #include <shellapi.h>
  16. #include <initguid.h>
  17. #include <ole2.h>
  18. #include <regstr.h>
  19. #include "resource.h"
  20. #define IDC_STATIC (-1)
  21. /*
  22. For driver signing, there are actually 3 sources of policy:
  23. 1. HKLM\Software\Microsoft\Driver Signing : Policy : REG_BINARY (REG_DWORD also supported)
  24. This is a Windows 98-compatible value that specifies the default
  25. behavior which applies to all users of the machine.
  26. 2. HKCU\Software\Microsoft\Driver Signing : Policy : REG_DWORD
  27. This specifies the user's preference for what behavior to employ
  28. upon verification failure.
  29. 3. HKCU\Software\Policies\Microsoft\Windows NT\Driver Signing : BehaviorOnFailedVerify : REG_DWORD
  30. This specifies the administrator-mandated policy on what behavior
  31. to employ upon verification failure. This policy, if specified,
  32. overrides the user's preference.
  33. The algorithm for deciding on the behavior to employ is as follows:
  34. if (3) is specified {
  35. policy = (3)
  36. } else {
  37. policy = (2)
  38. }
  39. policy = MAX(policy, (1))
  40. Value indicating the policy in effect. May be one of the following three values:
  41. DRIVERSIGN_NONE - silently succeed installation of unsigned/
  42. incorrectly-signed files. A PSS log entry will
  43. be generated, however (as it will for all 3 types)
  44. DRIVERSIGN_WARNING - warn the user, but let them choose whether or not
  45. they still want to install the problematic file
  46. DRIVERSIGN_BLOCKING - do not allow the file to be installed
  47. */
  48. #define SIGTAB_REG_KEY TEXT("Software\\Microsoft\\Driver Signing")
  49. #define SIGTAB_REG_VALUE TEXT("Policy")
  50. //
  51. // Context-Sensitive Help/Identifiers specific to SigVerif
  52. //
  53. #define SIGTAB_HELPFILE TEXT("SYSDM.HLP")
  54. #define IDH_CODESIGN_IGNORE 11020
  55. #define IDH_CODESIGN_WARN 11021
  56. #define IDH_CODESIGN_BLOCK 11022
  57. #define IDH_CODESIGN_APPLY 11023
  58. INT_PTR CALLBACK SigTab_DlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  59. INT_PTR CALLBACK SigTab_PS_DlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  60. extern "C" {
  61. VOID
  62. pSetupGetRealSystemTime(
  63. OUT LPSYSTEMTIME RealSystemTime
  64. );
  65. }
  66. //Type for an object-destroyed callback
  67. typedef void (FAR PASCAL *LPFNDESTROYED)(void);
  68. class CClassFactory : public IClassFactory
  69. {
  70. protected:
  71. ULONG m_cRef;
  72. public:
  73. CClassFactory();
  74. ~CClassFactory();
  75. //IUnknown members
  76. STDMETHODIMP QueryInterface( REFIID, LPVOID* );
  77. STDMETHODIMP_(ULONG) AddRef();
  78. STDMETHODIMP_(ULONG) Release();
  79. //IClassFactory members
  80. STDMETHODIMP CreateInstance( LPUNKNOWN, REFIID, LPVOID* );
  81. STDMETHODIMP LockServer( BOOL );
  82. };
  83. class CPropSheetExt : public IShellPropSheetExt, IShellExtInit
  84. {
  85. private:
  86. ULONG m_cRef;
  87. LPUNKNOWN m_pUnkOuter; //Controlling unknown
  88. LPFNDESTROYED m_pfnDestroy; //Function closure call
  89. public:
  90. CPropSheetExt( LPUNKNOWN pUnkOuter, LPFNDESTROYED pfnDestroy );
  91. ~CPropSheetExt(void);
  92. // IUnknown members
  93. STDMETHODIMP QueryInterface(REFIID, LPVOID*);
  94. STDMETHODIMP_(ULONG) AddRef(void);
  95. STDMETHODIMP_(ULONG) Release(void);
  96. // IShellExtInit methods
  97. STDMETHODIMP Initialize(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj,
  98. HKEY hKeyID);
  99. //IShellPropSheetExt methods ***
  100. STDMETHODIMP AddPages( LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam );
  101. STDMETHODIMP ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith,
  102. LPARAM lParam);
  103. };