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.

102 lines
2.7 KiB

  1. #ifndef __TSWIZARD_H__
  2. #define __TSWIZARD_H__
  3. /*++
  4. Copyright (C) Microsoft Corporation
  5. Module Name:
  6. tswizard.h
  7. Abstract:
  8. header file for tswizard.cpp
  9. Author:
  10. William Hsieh (williamh) created
  11. Revision History:
  12. --*/
  13. typedef enum tagFixCommand
  14. {
  15. FIX_COMMAND_DONOTHING = 0,
  16. FIX_COMMAND_UPGRADEDRIVERS,
  17. FIX_COMMAND_REINSTALL,
  18. FIX_COMMAND_ENABLEDEVICE,
  19. FIX_COMMAND_STARTDEVICE,
  20. FIX_COMMAND_RESTARTCOMPUTER,
  21. FIX_COMMAND_DRIVERBLOCKED,
  22. FIX_COMMAND_TROUBLESHOOTER
  23. } FIX_COMMAND, *PFIX_COMMAND;
  24. typedef struct tagCMProblemInfo
  25. {
  26. BOOL Query; // true if we have something to fix the problem
  27. FIX_COMMAND FixCommand; // command to fix the problem
  28. int idInstFirst; // instruction text string id
  29. int idInstCount; // how many instruction string id
  30. int idFixit; // fix it string id
  31. }CMPROBLEM_INFO, *PCMPROBLEM_INFO;
  32. class CProblemAgent
  33. {
  34. public:
  35. CProblemAgent(CDevice* pDevice, ULONG Problem, BOOL SeparateProcess);
  36. ~CProblemAgent()
  37. {}
  38. DWORD InstructionText(LPTSTR Buffer, DWORD BufferSize);
  39. DWORD FixitText(LPTSTR Buffer, DWORD BufferSize);
  40. BOOL FixIt(HWND hwndOwner);
  41. BOOL UpgradeDriver(HWND hwndOwner, CDevice* pDevice);
  42. BOOL Reinstall(HWND hwndOwner, CDevice* pDevice);
  43. BOOL RestartComputer(HWND hwndOwner, CDevice* pDevice);
  44. BOOL EnableDevice(HWND hwndOwner, CDevice* pDevice);
  45. BOOL FixDriverBlocked(HWND hwndOwner, CDevice* pDevice, LPTSTR ChmFile, ULONG ChmFileSize, LPTSTR HtmlTroubleShooter, ULONG HtmlTroubleShooterSize);
  46. BOOL StartTroubleShooter(HWND hwndOwner, CDevice *pDevice, LPTSTR ChmFile, LPTSTR HtmlTroubleShooter);
  47. BOOL GetTroubleShooter(CDevice* pDevice, LPTSTR ChmFile, ULONG ChmFileSize, LPTSTR HtmlTroubleShooter, ULONG HtmlTroubleShooterSize);
  48. void LaunchHtlmTroubleShooter(HWND hwndOwner, LPTSTR ChmFile, LPTSTR HtmlTroubleShooter);
  49. protected:
  50. CDevice* m_pDevice;
  51. ULONG m_Problem;
  52. int m_idInstFirst;
  53. int m_idInstCount;
  54. int m_idFixit;
  55. BOOL m_SeparateProcess;
  56. FIX_COMMAND m_FixCommand;
  57. };
  58. class CWizard98
  59. {
  60. public:
  61. CWizard98(HWND hwndParent, UINT MaxPages = 32);
  62. ~CWizard98()
  63. {}
  64. INT_PTR DoSheet() {
  65. return ::PropertySheet(&m_psh);
  66. }
  67. void InsertPage(HPROPSHEETPAGE hPage) {
  68. if (hPage && (m_psh.nPages < m_MaxPages)) {
  69. m_psh.phpage[m_psh.nPages++] = hPage;
  70. }
  71. }
  72. static INT CALLBACK WizardCallback(HWND hwndDlg, UINT uMsg, LPARAM lParam);
  73. PROPSHEETHEADER m_psh;
  74. private:
  75. UINT m_MaxPages;
  76. };
  77. #endif // #ifndef __TSWIZARD_H__