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.

106 lines
3.0 KiB

  1. //
  2. // TheApp.h
  3. //
  4. #ifndef __HOMENETWIZAPP_H__
  5. #define __HOMENETWIZAPP_H__
  6. #include "resource.h"
  7. #include "ICSInst.h"
  8. #include "StrArray.h"
  9. #include "Util.h"
  10. #include "unicwrap.h"
  11. #include "Sharing.h"
  12. #include "netconn.h"
  13. #include <netconp.h>
  14. extern HINSTANCE g_hinst;
  15. EXTERN_C BOOL g_fRunningOnNT;
  16. extern UINT g_uWindowsBuild;
  17. // Registry keys
  18. //
  19. #define c_szAppRegKey _T("Software\\Microsoft\\Windows\\CurrentVersion\\HomeNetWizard")
  20. // Debug-only values
  21. #define c_szRegVal_WindowsBuild _T("WindowsBuild")
  22. #define c_szRegVal_NoInstall _T("NoInstall")
  23. // Windows build numbers
  24. //
  25. #define W9X_BUILD_WIN95 950
  26. #define W9X_BUILD_WIN95_OSR2 1111
  27. #define W9X_BUILD_WIN98 1998
  28. #define W9X_BUILD_WIN98_SE 2222
  29. #define MAX_KEY_SIZE 35
  30. // Forward declarations
  31. //
  32. class CWizPageDlg;
  33. // Public functions
  34. //
  35. // Shortcuts the user can take through the wizard (theApp.m_iShortcut)
  36. #define SHORTCUT_NONE 0
  37. #define SHORTCUT_COMPUTERNAME 1
  38. #define SHORTCUT_SHARING 2
  39. #define SHORTCUT_ICS 3 // note: m_bIcsOnly is a superset of this
  40. #define SHORTCUT_FLOPPY 4
  41. // Possible values for theApp.m_iNoIcsSetting
  42. #define NOICS_WANT 0
  43. #define NOICS_DONTWANT 1
  44. #define NOICS_MISSING 2
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CHomeNetWizardApp
  47. class CHomeNetWizardApp
  48. {
  49. public:
  50. // OS Version info helpers
  51. inline UINT GetWin9xBuild()
  52. { return g_uWindowsBuild; }
  53. inline BOOL IsMillenniumOrLater()
  54. { return (GetWin9xBuild() > W9X_BUILD_WIN98_SE); }
  55. inline BOOL IsPreWin98SE()
  56. { return (GetWin9xBuild() < W9X_BUILD_WIN98_SE); }
  57. inline BOOL IsWin98SEOrLater()
  58. { return (GetWin9xBuild() >= W9X_BUILD_WIN98_SE); }
  59. inline BOOL IsWin95()
  60. { return (GetWin9xBuild() < W9X_BUILD_WIN98); }
  61. inline BOOL IsPreOSR2()
  62. { return (GetWin9xBuild() < W9X_BUILD_WIN95_OSR2); }
  63. inline BOOL IsWin98SE()
  64. { return (GetWin9xBuild() == W9X_BUILD_WIN98_SE); }
  65. inline BOOL IsWindows9x()
  66. { return !g_fRunningOnNT; }
  67. BOOL IsBiDiLocalized(void); // BiDi Localization support
  68. int MessageBox(UINT nStringID, UINT uType = MB_OK | MB_ICONEXCLAMATION);
  69. LPTSTR __cdecl FormatStringAlloc(UINT nStringID, ...);
  70. static LPTSTR __cdecl FormatStringAlloc(LPCTSTR pszFormat, ...);
  71. int __cdecl MessageBoxFormat(UINT uType, UINT nStringID, ...);
  72. void AllocInternalAdapters(UINT cAdapters);
  73. void FreeInternalAdapters();
  74. inline int LoadString(UINT uID, LPTSTR pszBuffer, int cchBuffer)
  75. { return ::LoadString(g_hinst, uID, pszBuffer, cchBuffer); }
  76. inline LPTSTR LoadStringAlloc(UINT uID)
  77. { return ::LoadStringAlloc(g_hinst, uID); }
  78. public:
  79. BOOL m_bBiDiLocalizedApp;
  80. };
  81. extern CHomeNetWizardApp theApp;
  82. HRESULT HomeNetworkWizard_ShowWizard(HWND hwnd, BOOL* pfRebootRequired);
  83. #endif // !__HOMENETWIZAPP_H__