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.

117 lines
4.8 KiB

  1. /*************************************************************************/
  2. /* Copyright (C) 1999 Microsoft Corporation */
  3. /* File: MSDVDAdm.h */
  4. /* Description: Declaration of the CMSDVDAdm */
  5. /* Author: Fang Wang */
  6. /*************************************************************************/
  7. #ifndef __MSDVDADM_H_
  8. #define __MSDVDADM_H_
  9. #include "resource.h" // main symbols
  10. #include <atlctl.h>
  11. #define MAX_PASSWD 256
  12. #define PRE_PASSWD 20
  13. #define MAX_SECTION 20
  14. #define MAX_RATE 10
  15. #define LEVEL_G 1
  16. #define LEVEL_PG 3
  17. #define LEVEL_PG13 4
  18. #define LEVEL_R 6
  19. #define LEVEL_NC17 7
  20. #define LEVEL_ADULT 8
  21. #define LEVEL_DISABLED -1
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CMSDVDAdm
  24. class ATL_NO_VTABLE CMSDVDAdm :
  25. public CComObjectRootEx<CComSingleThreadModel>,
  26. public IDispatchImpl<IMSDVDAdm, &IID_IMSDVDAdm, &LIBID_MSWEBDVDLib>,
  27. public IObjectWithSiteImplSec<CMSDVDAdm>,
  28. public CComCoClass<CMSDVDAdm, &CLSID_MSDVDAdm>,
  29. public ISupportErrorInfo
  30. {
  31. public:
  32. CMSDVDAdm();
  33. virtual ~CMSDVDAdm();
  34. DECLARE_REGISTRY_RESOURCEID(IDR_MSDVDADM)
  35. DECLARE_PROTECT_FINAL_CONSTRUCT()
  36. BEGIN_COM_MAP(CMSDVDAdm)
  37. COM_INTERFACE_ENTRY(IMSDVDAdm)
  38. COM_INTERFACE_ENTRY(IDispatch)
  39. COM_INTERFACE_ENTRY(IObjectWithSite)
  40. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  41. END_COM_MAP()
  42. BEGIN_PROP_MAP(CMSDVDAdm)
  43. END_PROP_MAP()
  44. // ISupportsErrorInfo
  45. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  46. // IMSDVDAdm
  47. public:
  48. STDMETHOD(get_DefaultMenuLCID)(/*[out, retval]*/ long *pVal);
  49. STDMETHOD(put_DefaultMenuLCID)(/*[in]*/ long newVal);
  50. STDMETHOD(get_DefaultSubpictureLCID)(/*[out, retval]*/ long *pVal);
  51. STDMETHOD(put_DefaultSubpictureLCID)(/*[in]*/ long newVal);
  52. STDMETHOD(get_DefaultAudioLCID)(/*[out, retval]*/ long *pVal);
  53. STDMETHOD(put_DefaultAudioLCID)(/*[in]*/ long newVal);
  54. STDMETHOD(GetParentalCountry)(long *lCountry);
  55. STDMETHOD(GetParentalLevel)(long *lLevel);
  56. STDMETHOD(_ConfirmPassword)(BSTR strUserName, BSTR szPassword, VARIANT_BOOL *fRight);
  57. STDMETHOD(get_DisableScreenSaver)(/*[out, retval]*/ VARIANT_BOOL *pVal);
  58. STDMETHOD(put_DisableScreenSaver)(/*[in]*/ VARIANT_BOOL newVal);
  59. STDMETHOD(ChangePassword)(BSTR strUserName, BSTR strOld, BSTR strNew);
  60. STDMETHOD(ConfirmPassword)(BSTR strUserName, BSTR szPassword, VARIANT_BOOL *fRight);
  61. STDMETHOD(SaveParentalLevel)(long lParentalLevel,BSTR strUserName, BSTR strPassword);
  62. STDMETHOD(SaveParentalCountry)(long lCountry,BSTR strUserName, BSTR strPassword);
  63. STDMETHOD(get_BookmarkOnStop)(/*[out, retval]*/ VARIANT_BOOL *pVal);
  64. STDMETHOD(put_BookmarkOnStop)(/*[in]*/ VARIANT_BOOL newVal);
  65. STDMETHOD(get_BookmarkOnClose)(/*[out, retval]*/ VARIANT_BOOL *pVal);
  66. STDMETHOD(put_BookmarkOnClose)(/*[in]*/ VARIANT_BOOL newVal);
  67. STDMETHOD(RestoreScreenSaver)();
  68. protected:
  69. long m_lParentctrlLevel;
  70. long m_lParentctrlCountry;
  71. VARIANT_BOOL m_fDisableScreenSaver;
  72. BOOL m_bScrnSvrOld;
  73. BOOL m_bPowerlowOld;
  74. BOOL m_bPowerOffOld;
  75. VARIANT_BOOL m_fBookmarkOnStop;
  76. VARIANT_BOOL m_fBookmarkOnClose;
  77. HRESULT EncryptPassword(LPTSTR lpPassword, BYTE **lpAssaultedHash, DWORD *dwCryptLen, DWORD *dwAssault, BOOL genAssault);
  78. HRESULT DisableScreenSaver();
  79. HRESULT SaveScreenSaver();
  80. HRESULT HandleError(HRESULT hr);
  81. };
  82. // Lame functions that default to hklm
  83. BOOL SetRegistryString(const TCHAR *pKey, TCHAR *szString, DWORD dwLen);
  84. BOOL GetRegistryString(const TCHAR *pKey, TCHAR *szRet, DWORD *dwLen, TCHAR *szDefault);
  85. BOOL SetRegistryDword(const TCHAR *pKey, DWORD dwRet);
  86. BOOL GetRegistryDword(const TCHAR *pKey, DWORD *dwRet, DWORD dwDefault);
  87. BOOL SetRegistryBytes(const TCHAR *pKey, BYTE *szString, DWORD dwLen);
  88. BOOL GetRegistryBytes(const TCHAR *pKey, BYTE *szRet, DWORD *dwLen);
  89. // Not so lame functions that use hkcu
  90. BOOL SetRegistryStringCU(const TCHAR *pKey, TCHAR *szString, DWORD dwLen);
  91. BOOL GetRegistryStringCU(const TCHAR *pKey, TCHAR *szRet, DWORD *dwLen, TCHAR *szDefault);
  92. BOOL SetRegistryDwordCU(const TCHAR *pKey, DWORD dwRet);
  93. BOOL GetRegistryDwordCU(const TCHAR *pKey, DWORD *dwRet, DWORD dwDefault);
  94. BOOL SetRegistryBytesCU(const TCHAR *pKey, BYTE *szString, DWORD dwLen);
  95. BOOL GetRegistryBytesCU(const TCHAR *pKey, BYTE *szRet, DWORD *dwLen);
  96. LPTSTR LoadStringFromRes(DWORD redId);
  97. #endif //__MSDVDADM_H_
  98. /*************************************************************************/
  99. /* End of file: MSDVDAdm.h */
  100. /*************************************************************************/