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.

303 lines
9.7 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1994-1995 **
  4. //*********************************************************************
  5. //
  6. // WIZARD.H - central header file for Internet setup/signup wizard
  7. //
  8. // HISTORY:
  9. //
  10. // 11/20/94 jeremys Created.
  11. // 96/02/24 markdu Added RNAPH.H
  12. // 96/02/27 markdu Replaced internal RNA header files with RAS.H
  13. // 96/03/07 markdu Added gpEnumModem
  14. // 96/03/09 markdu Moved all rnacall function prototypes to rnacall.h
  15. // 96/03/09 markdu Added gpRasEntry
  16. // 96/03/23 markdu Replaced CLIENTINFO references with CLIENTCONFIG.
  17. // 96/03/26 markdu Put #ifdef __cplusplus around extern "C"
  18. // 96/04/06 markdu NASH BUG 15653 Use exported autodial API.
  19. // 96/04/24 markdu NASH BUG 19289 Added /NOMSN command line flag
  20. // 96/05/14 markdu NASH BUG 21706 Removed BigFont functions.
  21. // 96/05/14 markdu NASH BUG 22681 Took out mail and news pages.
  22. //
  23. #ifndef _WIZARD_H_
  24. #define _WIZARD_H_
  25. #define STRICT // Use strict handle types
  26. #define _SHELL32_
  27. #ifdef DEBUG
  28. // component name for debug spew
  29. #define SZ_COMPNAME "INETWIZ: "
  30. #endif // DEBUG
  31. #include <windows.h>
  32. #include <windowsx.h>
  33. #include <commctrl.h>
  34. #include <prsht.h>
  35. #include <regstr.h>
  36. #include <inetreg.h>
  37. #include <oharestr.h>
  38. // various RNA header files
  39. #pragma pack(8)
  40. #include <ras.h>
  41. #include <ras2.h>
  42. #pragma pack()
  43. #include <raserror.h>
  44. // #include <rnaph.h>
  45. #include "rnacall.h"
  46. #include <wizglob.h>
  47. #include <wizdebug.h>
  48. #include <shlobj.h>
  49. // #include <shsemip.h>
  50. #undef DATASEG_READONLY
  51. #define DATASEG_READONLY ".rdata"
  52. #include <stdio.h>
  53. #include "icwunicd.h"
  54. #include "inetcfg.h"
  55. #include "cfgapi.h"
  56. #include "clsutil.h"
  57. #include "tcpcmn.h"
  58. #include "mapicall.h"
  59. #include "wizdef.h"
  60. #include "icfgcall.h"
  61. #include "ids.h"
  62. #include "strings.h"
  63. #include "icwcmn.h"
  64. // Terminology: ISP - Internet Service Provider
  65. // Globals
  66. extern LPRASENTRY gpRasEntry; // pointer to RASENTRY struct to hold all data
  67. extern DWORD gdwRasEntrySize;// bytes allocated for gpRasEntry
  68. extern ENUM_MODEM* gpEnumModem; // modem enumeration object
  69. extern HINSTANCE ghInstance; // global module instance handle
  70. extern USERINFO* gpUserInfo; // global user information
  71. extern WIZARDSTATE* gpWizardState; // global wizard state
  72. extern BOOL gfQuitWizard; // global flag used to signal that we
  73. // want to terminate the wizard ourselves
  74. extern BOOL gfFirstNewConnection; // first time the user selected new connection
  75. extern BOOL gfUserFinished; // user finished wizard
  76. extern BOOL gfUserBackedOut; // user click back on first page
  77. extern BOOL gfUserCancelled; // user cancalled wizard
  78. extern BOOL gfOleInitialized;
  79. extern BOOL g_fAcctMgrUILoaded;
  80. //extern BOOL g_MailUIAvailable, g_NewsUIAvailable, g_DirServUIAvailable;
  81. extern BOOL g_fIsExternalWizard97;
  82. extern BOOL g_fIsWizard97;
  83. extern BOOL g_fIsICW;
  84. extern BOOL g_bReboot; //used to signify that we should reboot - MKarki 5/2/97 - Fix for Bug #3111
  85. extern BOOL g_bRebootAtExit; //used to signify that we should reboot when exit
  86. extern BOOL g_bSkipMultiModem;
  87. extern BOOL g_bUseAutoProxyforConnectoid;
  88. // Defines
  89. // error class defines for DisplayErrorMessage
  90. #define ERRCLS_STANDARD 0x0001
  91. #define ERRCLS_SETUPX 0x0002
  92. #define ERRCLS_RNA 0x0003
  93. #define ERRCLS_MAPI 0x0004
  94. // flags for RunSignupWizard
  95. #define RSW_NOREBOOT 0x0001
  96. #define RSW_UNINSTALL 0x0002
  97. #define RSW_NOMSN 0x0004
  98. #define RSW_NOINIT 0x0008
  99. #define RSW_NOFREE 0x0010
  100. #define RSW_NOIMN 0x0020
  101. //#define RSW_MAILACCT 0x0100
  102. //#define RSW_NEWSACCT 0x0200
  103. //#define RSW_DIRSERVACCT 0x0400
  104. #define RSW_APPRENTICE 0x0100
  105. #define OK 0 // success code for SETUPX class errors
  106. // 11/25/96 jmazner Normandy #10586
  107. #define WM_MYINITDIALOG WM_USER
  108. // Modem specific info
  109. #define ISIGNUP_KEY TEXT("Software\\Microsoft\\ISIGNUP")
  110. #define DEVICENAMEKEY TEXT("DeviceName")
  111. #define DEVICETYPEKEY TEXT("DeviceType")
  112. // functions in PROPMGR.C
  113. BOOL InitWizard(DWORD dwFlags, HWND hwndParent = NULL);
  114. BOOL DeinitWizard(DWORD dwFlags);
  115. BOOL RunSignupWizard(DWORD dwFlags, HWND hwndParent = NULL);
  116. VOID GetDefaultUserName(TCHAR * pszUserName,DWORD cbUserName);
  117. void ProcessDBCS(HWND hDlg, int ctlID);
  118. #if !defined(WIN16)
  119. BOOL IsSBCSString( TCHAR *sz );
  120. #endif
  121. // functions in CALLOUT.C
  122. UINT InvokeModemWizard(HWND hwndToHide);
  123. // functions in UTIL.C
  124. int MsgBox(HWND hWnd,UINT nMsgID,UINT uIcon,UINT uButtons);
  125. int MsgBoxSz(HWND hWnd,LPTSTR szText,UINT uIcon,UINT uButtons);
  126. // jmazner 11/6/96 modified for RISC compatability
  127. //int _cdecl MsgBoxParam(HWND hWnd,UINT nMsgID,UINT uIcon,UINT uButtons,...);
  128. int _cdecl MsgBoxParam(HWND hWnd,UINT nMsgID,UINT uIcon,UINT uButtons, LPTSTR szParam = NULL);
  129. LPTSTR LoadSz(UINT idString,LPTSTR lpszBuf,UINT cbBuf);
  130. BOOL EnableDlgItem(HWND hDlg,UINT uID,BOOL fEnable);
  131. // modified for RISC compatability
  132. //VOID _cdecl DisplayErrorMessage(HWND hWnd,UINT uStrID,UINT uError,
  133. // UINT uErrorClass,UINT uIcon,...);
  134. VOID _cdecl DisplayErrorMessage(HWND hWnd,UINT uStrID,UINT uError,
  135. UINT uErrorClass,UINT uIcon,LPTSTR szArg = NULL);
  136. BOOL WarnFieldIsEmpty(HWND hDlg,UINT uCtrlID,UINT uStrID);
  137. BOOL TweakAutoRun(BOOL bEnable);
  138. VOID DisplayFieldErrorMsg(HWND hDlg,UINT uCtrlID,UINT uStrID);
  139. VOID GetErrorDescription(TCHAR * pszErrorDesc,UINT cbErrorDesc,
  140. UINT uError,UINT uErrorClass);
  141. VOID SetBackupInternetConnectoid(LPCTSTR pszEntryName);
  142. UINT myatoi (TCHAR * szVal);
  143. DWORD MsgWaitForMultipleObjectsLoop(HANDLE hEvent);
  144. BOOL GetDeviceSelectedByUser (LPTSTR szKey, LPTSTR szBuf, DWORD dwSize);
  145. // //10/24/96 jmazner Normandy 6968
  146. // //No longer neccessary thanks to Valdon's hooks for invoking ICW.
  147. // 11/21/96 jmazner Normandy 11812
  148. // oops, it _is_ neccessary, since if user downgrades from IE 4 to IE 3,
  149. // ICW 1.1 needs to morph the IE 3 icon.
  150. BOOL SetDesktopInternetIconToBrowser(VOID);
  151. // 11/11/96 jmazner Normandy 7623
  152. BOOL IsDialableString( LPTSTR szBuff );
  153. //
  154. // 6/6/97 jmazner Olympus #5413
  155. //
  156. #ifdef WIN32
  157. VOID Win95JMoveDlgItem( HWND hwndParent, HWND hwndItem, int iUp );
  158. #endif
  159. // functions in MAPICALL.C
  160. BOOL InitMAPI(HWND hWnd);
  161. VOID DeInitMAPI(VOID);
  162. HRESULT SetMailProfileInformation(MAILCONFIGINFO * pMailConfigInfo);
  163. BOOL FindInternetMailService(TCHAR * pszEmailAddress,DWORD cbEmailAddress,
  164. TCHAR * pszEmailServer, DWORD cbEmailServer);
  165. // functions in INETAPI.C
  166. BOOL DoDNSCheck(HWND hwndParent,BOOL * pfNeedRestart);
  167. // functions in UNINSTALL.C
  168. BOOL DoUninstall(VOID);
  169. // structure for getting proc addresses of api functions
  170. typedef struct APIFCN {
  171. PVOID * ppFcnPtr;
  172. LPCSTR pszName; // Proc name. Don't be wide char.
  173. } APIFCN;
  174. // user preference defines for registry
  175. #define USERPREF_MODEM 0x0001
  176. #define USERPREF_LAN 0x0002
  177. #define ACCESSTYPE_MSN 0x0001
  178. #define ACCESSTYPE_OTHER_ISP 0x0002
  179. #undef DATASEG_PERINSTANCE
  180. #define DATASEG_PERINSTANCE ".instance"
  181. #define DATASEG_SHARED ".data"
  182. #define DATASEG_DEFAULT DATASEG_SHARED
  183. inline BOOL IsNT(void)
  184. {
  185. OSVERSIONINFO OsVersionInfo;
  186. ZeroMemory(&OsVersionInfo, sizeof(OSVERSIONINFO));
  187. OsVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  188. GetVersionEx(&OsVersionInfo);
  189. return (VER_PLATFORM_WIN32_NT == OsVersionInfo.dwPlatformId);
  190. }
  191. inline BOOL IsNT5(void)
  192. {
  193. OSVERSIONINFO OsVersionInfo;
  194. ZeroMemory(&OsVersionInfo, sizeof(OSVERSIONINFO));
  195. OsVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  196. GetVersionEx(&OsVersionInfo);
  197. return ((VER_PLATFORM_WIN32_NT == OsVersionInfo.dwPlatformId) && (OsVersionInfo.dwMajorVersion >= 5));
  198. }
  199. inline BOOL IsWin95(void)
  200. {
  201. OSVERSIONINFO OsVersionInfo;
  202. ZeroMemory(&OsVersionInfo, sizeof(OSVERSIONINFO));
  203. OsVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  204. GetVersionEx(&OsVersionInfo);
  205. return ((VER_PLATFORM_WIN32_WINDOWS == OsVersionInfo.dwPlatformId) && (0 == OsVersionInfo.dwMinorVersion));
  206. }
  207. inline BOOL IsNT4SP3Lower(void)
  208. {
  209. OSVERSIONINFO os;
  210. os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
  211. GetVersionEx(&os);
  212. if(os.dwPlatformId != VER_PLATFORM_WIN32_NT)
  213. return FALSE;
  214. // Exclude NT5 or higher
  215. if(os.dwMajorVersion > 4)
  216. return FALSE;
  217. if(os.dwMajorVersion < 4)
  218. return TRUE;
  219. // version 4.0
  220. if ( os.dwMinorVersion > 0)
  221. return FALSE; // assume that sp3 is not needed for nt 4.1 or higher
  222. int nServicePack;
  223. if(_stscanf(os.szCSDVersion, TEXT("Service Pack %d"), &nServicePack) != 1)
  224. return TRUE;
  225. if(nServicePack < 4)
  226. return TRUE;
  227. return FALSE;
  228. }
  229. //
  230. // 7/21/97 jmazner Olympus #9903
  231. // we only want this version of inetcfg to work with the corresponding
  232. // version of other icwconn1 components. If an older icw component tries to
  233. // load this dll, we should fail -- gracefully
  234. #define ICW_MINIMUM_MAJOR_VERSION (UINT) 4
  235. #define ICW_MINIMUM_MINOR_VERSION (UINT) 71
  236. #define ICW_MINIMUM_VERSIONMS (DWORD) ((ICW_MINIMUM_MAJOR_VERSION << 16) | ICW_MINIMUM_MINOR_VERSION)
  237. //
  238. // in util.cpp
  239. //
  240. extern BOOL GetFileVersion(LPTSTR lpszFilePath, PDWORD pdwVerNumMS, PDWORD pdwVerNumLS);
  241. extern BOOL IsParentICW10( void );
  242. extern void SetICWRegKeysToPath( LPTSTR lpszICWPath );
  243. extern void GetICW11Path( TCHAR szPath[MAX_PATH + 1], BOOL *fPathSetTo11 );
  244. typedef BOOL (WINAPI *PFNInitCommonControlsEx)(LPINITCOMMONCONTROLSEX);
  245. #endif // _WIZARD_H_