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.

74 lines
2.4 KiB

  1. #pragma once
  2. #include <ncxbase.h>
  3. #include <nceh.h>
  4. #include <notifval.h>
  5. #include "resource.h"
  6. /////////////////////////////////////////////////////////////////////////////
  7. // Netnbf
  8. class ATL_NO_VTABLE CNbfObj :
  9. public CComObjectRoot,
  10. public CComCoClass<CNbfObj, &CLSID_CNbfObj>,
  11. public INetCfgComponentControl,
  12. public INetCfgComponentSetup,
  13. public INetCfgComponentNotifyGlobal
  14. {
  15. public:
  16. CNbfObj();
  17. ~CNbfObj();
  18. BEGIN_COM_MAP(CNbfObj)
  19. COM_INTERFACE_ENTRY(INetCfgComponentSetup)
  20. COM_INTERFACE_ENTRY(INetCfgComponentControl)
  21. COM_INTERFACE_ENTRY(INetCfgComponentNotifyGlobal)
  22. END_COM_MAP()
  23. // DECLARE_NOT_AGGREGATABLE(CNbfObj)
  24. // Remove the comment from the line above if you don't want your object to
  25. // support aggregation. The default is to support it
  26. DECLARE_REGISTRY_RESOURCEID(IDR_REG_NBFCFG)
  27. // Install Action (Unknown, Install, Remove)
  28. enum INSTALLACTION {eActConfig, eActInstall, eActRemove};
  29. enum NBFSTATE {eStateNoChange, eStateDisable, eStateEnable};
  30. // INetCfgComponentControl
  31. STDMETHOD (Initialize) (
  32. IN INetCfgComponent* pIComp,
  33. IN INetCfg* pINetCfg,
  34. IN BOOL fInstalling);
  35. STDMETHOD (ApplyRegistryChanges) ();
  36. STDMETHOD (ApplyPnpChanges) (
  37. IN INetCfgPnpReconfigCallback* pICallback);
  38. STDMETHOD (CancelChanges) ();
  39. STDMETHOD (Validate) ();
  40. // INetCfgComponentSetup
  41. STDMETHOD (ReadAnswerFile) (PCWSTR pszAnswerFile,
  42. PCWSTR pszAnswerSection);
  43. STDMETHOD (Install) (DWORD);
  44. STDMETHOD (Upgrade) (DWORD, DWORD) {return S_OK;}
  45. STDMETHOD (Removing) ();
  46. // INetCfgNotifyGlobal
  47. STDMETHOD (GetSupportedNotifications) (DWORD* pdwNotificationFlag );
  48. STDMETHOD (SysQueryBindingPath) (DWORD dwChangeFlag, INetCfgBindingPath* pncbp);
  49. STDMETHOD (SysQueryComponent) (DWORD dwChangeFlag, INetCfgComponent* pncc);
  50. STDMETHOD (SysNotifyBindingPath) (DWORD dwChangeFlag, INetCfgBindingPath* pncbp);
  51. STDMETHOD (SysNotifyComponent) (DWORD dwChangeFlag, INetCfgComponent* pncc);
  52. private:
  53. HRESULT HrEnableNetBEUI();
  54. HRESULT HrDisableNetBEUI();
  55. HRESULT HrUpdateNetBEUI();
  56. private:
  57. INetCfgComponent* m_pNCC;
  58. INetCfg* m_pNetCfg;
  59. BOOL m_fFirstTimeInstall;
  60. BOOL m_fRebootNeeded;
  61. NBFSTATE m_eNBFState;
  62. INSTALLACTION m_eInstallAction;
  63. };