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.

98 lines
3.5 KiB

  1. //
  2. // MODULE: Launch.cpp
  3. //
  4. // PURPOSE: Starts the container that will query the LaunchServ for
  5. // troubleshooter network and nodes.
  6. //
  7. // PROJECT: Local Troubleshooter Launcher for the Device Manager
  8. //
  9. // COMPANY: Saltmine Creative, Inc. (206)-633-4743 [email protected]
  10. //
  11. // AUTHOR: Richard Meadows
  12. //
  13. // ORIGINAL DATE: 2-26-98
  14. //
  15. //
  16. // Version Date By Comments
  17. //--------------------------------------------------------------------
  18. // V0.1 - RM Original
  19. ///////////////////////
  20. class TSMapClient;
  21. class CLaunch
  22. {
  23. public:
  24. enum { SYM_LEN = CItem::SYM_LEN };
  25. public:
  26. CLaunch();
  27. ~CLaunch();
  28. void ReInit(); //
  29. void Clear(); // Clears properties that are set by the launch functions.
  30. bool SetNode(LPCTSTR szNode, LPCTSTR szState);
  31. bool SpecifyProblem(LPCTSTR szNetwork, LPCTSTR szProblem);
  32. // Properties that are reset when ReInit is used.
  33. HRESULT MachineID(BSTR &bstrMachineID, DWORD *pdwResult);
  34. HRESULT DeviceInstanceID(BSTR &bstrDeviceInstanceID, DWORD *pdwResult);
  35. void SetPreferOnline(short bPreferOnline);
  36. // Launch functions.
  37. HRESULT LaunchKnown(DWORD * pdwResult);
  38. HRESULT Launch(BSTR bstrCallerName, BSTR bstrCallerVersion, BSTR bstrAppProblem, short bLaunch, DWORD * pdwResult);
  39. HRESULT LaunchDevice(BSTR bstrCallerName, BSTR bstrCallerVersion, BSTR bstrPNPDeviceID, BSTR bstrDeviceClassGUID, BSTR bstrAppProblem, short bLaunch, DWORD * pdwResult);
  40. DWORD GetStatus(); // Used to get the stats information that is saved durring a launch or query.
  41. // Testing function.
  42. bool TestPut(); // Uses the mapping classes to map Caller() and DeviceID() information, then copies the CItem to global memory.
  43. // These two properties are not reset by ReInit or Clear.
  44. long m_lLaunchWaitTimeOut;
  45. bool m_bPreferOnline; // Keeps track of an application-program-indicated
  46. // preference for online troubleshooter. As of
  47. // 1/98, this preference is ignored.
  48. protected:
  49. void InitFiles();
  50. void InitRequest();
  51. bool VerifyNetworkExists(LPCTSTR szNetwork);
  52. int GetContainerPathName(TCHAR szPathName[MAX_PATH]);
  53. int GetWebPage(TCHAR szWebPage[MAX_PATH]);
  54. int GetDefaultURL(TCHAR szURL[MAX_PATH]);
  55. int GetDefaultNetwork(TCHAR szDefaultNetwork[SYM_LEN]);
  56. int GetSniffScriptFile(TCHAR szSniffScriptFile[MAX_PATH], TCHAR* szNetwork);
  57. int GetSniffStandardFile(TCHAR szSniffStandardFile[MAX_PATH]);
  58. protected:
  59. // Use szAppName to check the registry for an application specific map file.
  60. bool CheckMapFile(TCHAR * szAppName, TCHAR szMapFile[MAX_PATH], DWORD *pdwResult);
  61. bool Go(DWORD dwTimeOut, DWORD *pdwResult);
  62. bool Map(DWORD *pdwResult);
  63. bool m_bHaveMapPath; // Set when the path and file name for the default mapping file is read from the registry.
  64. bool m_bHaveDefMapFile; // Set when the path name for the default mapping file is verified.
  65. bool m_bHaveDszPath; // Set when the path name for the network resources is found.
  66. CItem m_Item;
  67. TCHAR m_szAppName[SYM_LEN];
  68. TCHAR m_szAppVersion[SYM_LEN];
  69. TCHAR m_szAppProblem[SYM_LEN];
  70. TCHAR m_szLauncherResources[MAX_PATH]; // The folder where the map file is kept.
  71. TCHAR m_szDefMapFile[MAX_PATH]; // The file name without the path.
  72. TCHAR m_szLaunchMapFile[MAX_PATH]; // m_szLauncherResources + m_szDefMapFile.
  73. TCHAR m_szDszResPath[MAX_PATH]; // The folder where the network resource files are located. (Need to check for the existance of dsz/dsc files).
  74. TCHAR m_szMapFile[MAX_PATH]; // map file.
  75. TSMapClient *m_pMap; // pointer to a (client-machine-style) mapping object
  76. RSStack<DWORD> m_stkStatus; // Status and Error codes that happened durring a launch or mapping.
  77. };