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.

80 lines
2.8 KiB

  1. //
  2. // D H C P S O B J . H
  3. //
  4. // Declaration of CDHCPServer and helper functions
  5. //
  6. #pragma once
  7. #include <ncxbase.h>
  8. #include <nceh.h>
  9. #include <notifval.h>
  10. #include <ncsetup.h>
  11. #include "resource.h"
  12. /////////////////////////////////////////////////////////////////////////////
  13. // DHCPServer
  14. class ATL_NO_VTABLE CDHCPServer :
  15. public CComObjectRoot,
  16. public CComCoClass<CDHCPServer, &CLSID_CDHCPServer>,
  17. public INetCfgComponentControl,
  18. public INetCfgComponentSetup
  19. {
  20. public:
  21. CDHCPServer();
  22. ~CDHCPServer();
  23. BEGIN_COM_MAP(CDHCPServer)
  24. COM_INTERFACE_ENTRY(INetCfgComponentControl)
  25. COM_INTERFACE_ENTRY(INetCfgComponentSetup)
  26. END_COM_MAP()
  27. // DECLARE_NOT_AGGREGATABLE(CDHCPServer)
  28. // Remove the comment from the line above if you don't want your object to
  29. // support aggregation. The default is to support it
  30. DECLARE_REGISTRY_RESOURCEID(IDR_REG_DHCPSCFG)
  31. // INetCfgComponentControl
  32. STDMETHOD (Initialize) (
  33. IN INetCfgComponent* pIComp,
  34. IN INetCfg* pINetCfg,
  35. IN BOOL fInstalling);
  36. STDMETHOD (ApplyRegistryChanges) ();
  37. STDMETHOD (ApplyPnpChanges) (
  38. IN INetCfgPnpReconfigCallback* pICallback) { return S_OK; }
  39. STDMETHOD (CancelChanges) ();
  40. STDMETHOD (Validate) ();
  41. // INetCfgComponentSetup
  42. STDMETHOD (ReadAnswerFile) (PCWSTR pszAnswerFile,
  43. PCWSTR pszAnswerSection);
  44. STDMETHOD (Install) (DWORD);
  45. STDMETHOD (Upgrade) (DWORD, DWORD) {return S_OK;}
  46. STDMETHOD (Removing) ();
  47. // Install Action (Unknown, Install, Remove)
  48. enum INSTALLACTION {eActUnknown, eActInstall, eActRemove};
  49. // Private state info
  50. private:
  51. INSTALLACTION m_eInstallAction;
  52. BOOL m_fUnattend; // Are we installed unattended?
  53. INetCfgComponent * m_pncc; // Place to keep my component
  54. INetCfg * m_pnc; // Place to keep my component
  55. BOOL m_fUpgrade; // TRUE if we are upgrading with
  56. // an answer file
  57. tstring m_strParamsRestoreFile;
  58. tstring m_strConfigRestoreFile;
  59. HRESULT HrProcessAnswerFile(PCWSTR pszAnswerFile, PCWSTR pszAnswerSection);
  60. HRESULT HrProcessDhcpServerSolutionsParams(CSetupInfFile * pcsif, PCWSTR pszAnswerSection);
  61. HRESULT HrWriteDhcpOptionInfo(HKEY hkeyDhcpCfg);
  62. HRESULT HrWriteDhcpSubnets(HKEY hkeyDhcpCfg, PCWSTR szSubnet, PCWSTR szStartIp,
  63. DWORD dwEndIp, DWORD dwSubnetMask, DWORD dwLeaseDuration,
  64. DWORD dwDnsServer, PCWSTR szDomainName);
  65. HRESULT HrRestoreRegistry(VOID);
  66. HRESULT HrWriteUnattendedKeys();
  67. };