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.

112 lines
3.9 KiB

  1. //
  2. // N W C L I O B J . H
  3. //
  4. // Declaration of CNWClient and helper functions
  5. //
  6. #pragma once
  7. #include <ncxbase.h>
  8. #include <nceh.h>
  9. #include <notifval.h>
  10. #include "ncmisc.h"
  11. #include "resource.h"
  12. // Typedefs for the functions that we'll GetProcAddress from the
  13. // NetWare config DLL
  14. typedef BOOL (PASCAL *NWCFG_PROC)(DWORD, PWSTR [], PWSTR *);
  15. /////////////////////////////////////////////////////////////////////////////
  16. // NWClient
  17. class ATL_NO_VTABLE CNWClient :
  18. public CComObjectRoot,
  19. public CComCoClass<CNWClient, &CLSID_CNWClient>,
  20. public INetCfgComponentControl,
  21. public INetCfgComponentSetup
  22. {
  23. public:
  24. CNWClient();
  25. ~CNWClient();
  26. BEGIN_COM_MAP(CNWClient)
  27. COM_INTERFACE_ENTRY(INetCfgComponentControl)
  28. COM_INTERFACE_ENTRY(INetCfgComponentSetup)
  29. END_COM_MAP()
  30. // DECLARE_NOT_AGGREGATABLE(CNWClient)
  31. // Remove the comment from the line above if you don't want your object to
  32. // support aggregation. The default is to support it
  33. DECLARE_REGISTRY_RESOURCEID(IDR_REG_NWCLICFG)
  34. // INetCfgComponentControl
  35. STDMETHOD (Initialize) (
  36. IN INetCfgComponent* pIComp,
  37. IN INetCfg* pINetCfg,
  38. IN BOOL fInstalling);
  39. STDMETHOD (ApplyRegistryChanges) ();
  40. STDMETHOD (ApplyPnpChanges) (
  41. IN INetCfgPnpReconfigCallback* pICallback);
  42. STDMETHOD (CancelChanges) ();
  43. STDMETHOD (Validate) ();
  44. // INetCfgComponentSetup
  45. STDMETHOD (ReadAnswerFile) (PCWSTR pszAnswerFile,
  46. PCWSTR pszAnswerSection);
  47. STDMETHOD (Upgrade) (DWORD dwSetupFlags, DWORD dwUpgradeFromBuildNo);
  48. STDMETHOD (Install) (DWORD);
  49. STDMETHOD (Removing) ();
  50. public:
  51. // Helper functions.
  52. HRESULT HrInstallCodeFromOldINF();
  53. HRESULT HrRemoveCodeFromOldINF();
  54. // Load and free the config DLL
  55. HRESULT HrLoadConfigDLL();
  56. VOID FreeConfigDLL();
  57. // Private state info
  58. private:
  59. // Install Action (Unknown, Install, Remove)
  60. enum INSTALLACTION {eActUnknown, eActInstall, eActRemove};
  61. INSTALLACTION m_eInstallAction;
  62. INetCfgComponent * m_pncc; // Place to keep my component
  63. INetCfg * m_pnc; // Place to keep my component
  64. HINSTANCE m_hlibConfig; // From LoadLibrary call.
  65. PRODUCT_FLAVOR m_pf; // Server/Workstation
  66. BOOL m_fUpgrade; // TRUE if we are upgrading with
  67. // an answer file
  68. tstring m_strParamsRestoreFile;
  69. tstring m_strSharesRestoreFile;
  70. tstring m_strDrivesRestoreFile;
  71. DWORD m_dwLogonScript;
  72. tstring m_strDefaultLocation;
  73. // These functions below are initialized in the HrLoadConfigDLL() call,
  74. // which does a GetProcAddress on the appropriate function in nwcfg.dll
  75. // Note: "Provider" is spelled incorrectly, since it's spelled that way
  76. // in the config DLL itself, and that's the name that we're using in
  77. // the GetProcAddress call.
  78. NWCFG_PROC m_pfnAddNetwarePrinterProvider;
  79. NWCFG_PROC m_pfnDeleteNetwarePrinterProvider;
  80. NWCFG_PROC m_pfnAppendSzToFile;
  81. NWCFG_PROC m_pfnRemoveSzFromFile;
  82. NWCFG_PROC m_pfnGetKernelVersion;
  83. NWCFG_PROC m_pfnSetEverybodyPermission;
  84. NWCFG_PROC m_pfnlodctr;
  85. NWCFG_PROC m_pfnunlodctr;
  86. NWCFG_PROC m_pfnDeleteGatewayPassword;
  87. NWCFG_PROC m_pfnSetFileSysChangeValue;
  88. NWCFG_PROC m_pfnCleanupRegistryForNWCS;
  89. NWCFG_PROC m_pfnSetupRegistryForNWCS;
  90. HRESULT HrProcessAnswerFile(PCWSTR pszAnswerFile, PCWSTR pszAnswerSection);
  91. HRESULT HrRestoreRegistry(VOID);
  92. HRESULT HrWriteAnswerFileParams(VOID);
  93. HRESULT HrEnableGatewayIfNeeded(VOID);
  94. };