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.

466 lines
11 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. globals.h
  5. Abstract:
  6. External definitions for data in dll\globals.c
  7. Author:
  8. Richard L Firth (rfirth) 15-Jul-1995
  9. Revision History:
  10. 15-Jul-1995 rfirth
  11. Created
  12. --*/
  13. #if defined(__cplusplus)
  14. extern "C" {
  15. #endif
  16. // Side-By-Side (loading different urlmon )
  17. #ifdef _SBS_
  18. #define URLMON_DLL "sbsurlmk.dll"
  19. #else
  20. #define URLMON_DLL "urlmon.dll"
  21. #endif // _SBS_
  22. //
  23. // macros
  24. //
  25. #define IsGlobalStateOnline() \
  26. (((GlobalDllState & INTERNET_LINE_STATE_MASK) == INTERNET_STATE_ONLINE) \
  27. ? TRUE : FALSE)
  28. #define IsGlobalStateOffline() \
  29. (((GlobalDllState & INTERNET_LINE_STATE_MASK) == INTERNET_STATE_OFFLINE) \
  30. ? TRUE : FALSE)
  31. #define IsGlobalStateOfflineUser() \
  32. (((GlobalDllState \
  33. & (INTERNET_LINE_STATE_MASK | INTERNET_STATE_OFFLINE_USER)) \
  34. == (INTERNET_STATE_OFFLINE | INTERNET_STATE_OFFLINE_USER)) \
  35. ? TRUE : FALSE)
  36. #define UPDATE_GLOBAL_PROXY_VERSION() \
  37. InterlockedIncrement((LPLONG)&GlobalProxyVersionCount)
  38. #define COOKIES_WARN 0 // warn with a dlg if using cookies
  39. #define COOKIES_ALLOW 1 // allow cookies without any warning
  40. #define COOKIES_DENY 2 // disable cookies completely
  41. #define INTERNET_MAX_WELL_KNOWN_PORT 1023
  42. #define INTERNET_DEFAULT_FTP_PORT 21
  43. #define INTERNET_DEFAULT_SMTP_PORT 25
  44. #define INTERNET_DEFAULT_POP3_PORT 110
  45. #define INTERNET_DEFAULT_NNTP_PORT 119
  46. #define INTERNET_DEFAULT_IMAP_PORT 143
  47. //
  48. // external variables
  49. //
  50. extern HINSTANCE GlobalDllHandle;
  51. #define GlobalResHandle GlobalDllHandle // change for plugable ui
  52. extern DWORD GlobalPlatformType;
  53. extern DWORD GlobalPlatformVersion5;
  54. extern DWORD GlobalPlatformMillennium;
  55. extern DWORD GlobalPlatformWhistler;
  56. extern DWORD GlobalDllState;
  57. extern BOOL GlobalDataInitialized;
  58. extern BOOL GlobalTruncateFileName;
  59. extern DWORD InternetMajorVersion;
  60. extern DWORD InternetMinorVersion;
  61. extern DWORD InternetBuildNumber;
  62. extern DWORD GlobalConnectTimeout;
  63. extern DWORD GlobalConnectRetries;
  64. extern DWORD GlobalSendTimeout;
  65. extern DWORD GlobalReceiveTimeout;
  66. extern DWORD GlobalDataSendTimeout;
  67. extern DWORD GlobalDataReceiveTimeout;
  68. extern DWORD GlobalFromCacheTimeout;
  69. extern DWORD GlobalFtpAcceptTimeout;
  70. extern DWORD GlobalTransportPacketLength;
  71. extern DWORD GlobalKeepAliveSocketTimeout;
  72. extern DWORD GlobalSocketSendBufferLength;
  73. extern DWORD GlobalSocketReceiveBufferLength;
  74. extern DWORD GlobalMaxHttpRedirects;
  75. extern DWORD GlobalMaxConnectionsPerServer;
  76. extern DWORD GlobalMaxConnectionsPer1_0Server;
  77. extern DWORD GlobalConnectionInactiveTimeout;
  78. extern DWORD GlobalServerInfoTimeout;
  79. extern const DWORD GlobalMaxSizeStatusLineResultText;
  80. extern BOOL GlobalHaveInternetOpened;
  81. extern DWORD GlobalCacheMode;
  82. #define CACHEMODE_NORMAL 0
  83. #define CACHEMODE_REFRESH 1
  84. #define CACHEMODE_BYPASS 2
  85. extern BOOL InDllCleanup;
  86. extern BOOL GlobalPleaseQuitWhatYouAreDoing;
  87. extern BOOL GlobalDynaUnload;
  88. extern BOOL GlobalUseSchannelDirectly;
  89. extern BOOL GlobalDisableKeepAlive;
  90. extern BOOL GlobalDisablePassport;
  91. extern DWORD GlobalSecureProtocols;
  92. extern BOOL GlobalEnableHttp1_1;
  93. extern BOOL GlobalEnableProxyHttp1_1;
  94. extern BOOL GlobalDisableReadRange;
  95. extern BOOL GlobalIsProcessExplorer;
  96. extern BOOL GlobalEnableFortezza;
  97. extern BOOL GlobalEnableRevocation;
  98. extern BOOL GlobalIsProcessNtService;
  99. extern DWORD GlobalSslStateCount;
  100. extern BOOL GlobalEnableGopher;
  101. #if defined(SITARA)
  102. extern BOOL GlobalEnableSitara;
  103. extern BOOL GlobalHasSitaraModemConn;
  104. #endif // SITARA
  105. extern BOOL GlobalEnableUtf8Encoding;
  106. extern BOOL GlobalBypassEditedEntry;
  107. extern BOOL fDontUseDNSLoadBalancing;
  108. extern BOOL GlobalDisableNT4RasCheck;
  109. extern BOOL GlobalWarnOnPost;
  110. extern BOOL GlobalWarnAlways;
  111. extern BOOL GlobalWarnOnZoneCrossing;
  112. extern BOOL GlobalWarnOnBadCertSending;
  113. extern BOOL GlobalWarnOnBadCertRecving;
  114. extern BOOL GlobalWarnOnPostRedirect;
  115. extern BOOL GlobalAlwaysDrainOnRedirect;
  116. extern BOOL GlobalBypassSSLNoCacheCheck;
  117. extern BOOL GlobalWarnOnHTTPSToHTTPRedirect;
  118. extern LONG GlobalInternetOpenHandleCount;
  119. extern DWORD GlobalProxyVersionCount;
  120. extern BOOL GlobalAutoProxyNeedsInit;
  121. extern BOOL GlobalAutoProxyInInit;
  122. extern BOOL GlobalAutoProxyCacheEnable;
  123. extern BOOL GlobalDisplayScriptDownloadFailureUI;
  124. extern BOOL GlobalUseLanSettings;
  125. extern BOOL GlobalSendExtraCRLF;
  126. extern BOOL GlobalBypassFtpTimeCheck;
  127. extern BOOL GlobalSendUTF8ServerToProxy;
  128. extern BOOL GlobalMBCSAPIforCrack;
  129. extern BOOL GlobalUseUTF8ServerForNameRes;
  130. extern BOOL g_bHibernating;
  131. extern BOOL g_bDisableHibernation;
  132. //extern BOOL GlobalAutoProxyInDeInit;
  133. //extern DWORD GlobalServerInfoAllocCount;
  134. //extern DWORD GlobalServerInfoDeAllocCount;
  135. extern SERIALIZED_LIST GlobalObjectList;
  136. extern SERIALIZED_LIST GlobalServerInfoList;
  137. extern LONGLONG dwdwHttpDefaultExpiryDelta;
  138. extern LONGLONG dwdwFtpDefaultExpiryDelta;
  139. extern LONGLONG dwdwGopherDefaultExpiryDelta;
  140. extern LONGLONG dwdwSessionStartTime;
  141. extern LONGLONG dwdwSessionStartTimeDefaultDelta;
  142. extern DWORD GlobalUrlCacheSyncMode;
  143. extern DWORD GlobalDiskUsageLowerBound;
  144. extern DWORD GlobalScavengeFileLifeTime;
  145. extern BOOL GlobalLeashLegacyCookies;
  146. extern LPSTR vszMimeExclusionList, vszHeaderExclusionList;
  147. extern LPSTR *lpvrgszMimeExclusionTable, *lpvrgszHeaderExclusionTable;
  148. extern DWORD *lpvrgdwMimeExclusionTableOfSizes;
  149. extern DWORD vdwMimeExclusionTableCount, vdwHeaderExclusionTableCount;
  150. extern SECURITY_CACHE_LIST GlobalCertCache;
  151. extern BOOL GlobalDisableSslCaching;
  152. extern BOOL GlobalDisableNTLMPreAuth;
  153. extern CRITICAL_SECTION AuthenticationCritSec;
  154. extern CRITICAL_SECTION GeneralInitCritSec;
  155. extern CRITICAL_SECTION LockRequestFileCritSec;
  156. extern CRITICAL_SECTION AutoProxyDllCritSec;
  157. extern CRITICAL_SECTION ZoneMgrCritSec;
  158. extern CRITICAL_SECTION MlangCritSec;
  159. extern const char vszSyncMode[];
  160. extern const char vszDisableSslCaching[];
  161. // Default user agent string
  162. // This will be used when no other information is available
  163. extern const char gszDefaultUserAgent[];
  164. // moved to proxysup.hxx
  165. //extern PROXY_INFO GlobalProxyInfo;
  166. extern BOOL vfPerUserCookies;
  167. BOOL GetWininetUserName(VOID);
  168. // BUGBUG: GetWininetUserName must be called before accessing vszCurrentUser.
  169. // Instead, it should return the username ptr and the global not accessed.
  170. extern char vszCurrentUser[];
  171. extern DWORD vdwCurrentUserLen;
  172. extern const char vszAllowCookies[];
  173. extern const char vszPerUserCookies[];
  174. extern INTERNET_VERSION_INFO InternetVersionInfo;
  175. extern HTTP_VERSION_INFO HttpVersionInfo;
  176. extern BOOL fCdromDialogActive;
  177. extern DWORD g_dwCredPersistAvail;
  178. extern CUserName GlobalUserName;
  179. //
  180. // The following globals are literal strings passed to winsock.
  181. // Do NOT make them const, otherwise they end up in .text section,
  182. // and web release of winsock2 has a bug where it locks and dirties
  183. // send buffers, confusing the win95 vmm and resulting in code
  184. // getting corrupted when it is paged back in. -RajeevD
  185. //
  186. extern char gszAt[];
  187. extern char gszBang[];
  188. extern char gszCRLF[3];
  189. //
  190. // novell client32 (hack) "support"
  191. //
  192. extern BOOL GlobalRunningNovellClient32;
  193. extern BOOL GlobalNonBlockingClient32;
  194. // shfolder.dll hmod handle
  195. extern HMODULE g_HMODSHFolder;
  196. // shell32.dll hmod handle
  197. extern HMODULE g_HMODShell32;
  198. extern DWORD GlobalIdentity;
  199. extern GUID GlobalIdentityGuid;
  200. #ifdef WININET6
  201. extern HKEY GlobalCacheHKey;
  202. #endif
  203. extern BOOL GlobalSuppressCookiesPolicy;
  204. //
  205. // Localization Structures
  206. //
  207. //
  208. // This definition must be big enough to hold the largest set of localized
  209. // strings.
  210. //
  211. #define LOCAL_STRINGS_MAX_BUFFER 4096
  212. //
  213. // *WARNING* - The order of elements in the following structure must match the
  214. // order of elements in the uStringId array in the FetchLocalStrings routine in
  215. // dll/Globals.cxx.
  216. //
  217. typedef struct {
  218. LPWSTR
  219. szEnterAuthInfo,
  220. szCertInfo,
  221. szStrengthHigh,
  222. szStrengthMedium,
  223. szStrengthLow,
  224. szCertSubject,
  225. szCertIssuer,
  226. szCertEffectiveDate,
  227. szCertExpirationDate,
  228. szCertProtocol,
  229. szCertUsage,
  230. szHttpsEncryptAlg,
  231. szHttpsHashAlg,
  232. szHttpsExchAlg,
  233. szCertComment,
  234. szCommentExpires,
  235. szCommentNotValid,
  236. szCommentBadCN,
  237. szCommentBadCA,
  238. szCommentBadSignature,
  239. szCommentRevoked,
  240. szCiphMsg,
  241. szHashMsg,
  242. szExchMsg,
  243. szFingerprint,
  244. szDomain,
  245. szRealm,
  246. szSite,
  247. szFirewall;
  248. WCHAR
  249. rgchBuffer[LOCAL_STRINGS_MAX_BUFFER];
  250. } LOCAL_STRINGS, *PLOCAL_STRINGS;
  251. typedef struct {
  252. LPSTR
  253. szEnterAuthInfo,
  254. szCertInfo,
  255. szStrengthHigh,
  256. szStrengthMedium,
  257. szStrengthLow,
  258. szCertSubject,
  259. szCertIssuer,
  260. szCertEffectiveDate,
  261. szCertExpirationDate,
  262. szCertProtocol,
  263. szCertUsage,
  264. szHttpsEncryptAlg,
  265. szHttpsHashAlg,
  266. szHttpsExchAlg,
  267. szCertComment,
  268. szCommentExpires,
  269. szCommentNotValid,
  270. szCommentBadCN,
  271. szCommentBadCA,
  272. szCommentBadSignature,
  273. szCommentRevoked,
  274. szCiphMsg,
  275. szHashMsg,
  276. szExchMsg,
  277. szFingerprint,
  278. szDomain,
  279. szRealm,
  280. szSite,
  281. szFirewall;
  282. CHAR
  283. rgchBuffer[LOCAL_STRINGS_MAX_BUFFER];
  284. } LOCAL_STRINGSA, *PLOCAL_STRINGSA;
  285. //
  286. // prototypes
  287. //
  288. void SetUserOrPass (LPSTR lpszIn, BOOL fUser);
  289. void TimeStampCreds(void);
  290. PSYSTEMTIME GetCredTimeStamp(void);
  291. BOOL GetUserAndPass (LPSTR *pszUser, LPSTR *pszPass);
  292. VOID
  293. GlobalDllInitialize(
  294. VOID
  295. );
  296. VOID
  297. GlobalDllTerminate(
  298. VOID
  299. );
  300. DWORD
  301. GlobalDataInitialize(
  302. VOID
  303. );
  304. VOID
  305. GlobalDataTerminate(
  306. VOID
  307. );
  308. BOOL
  309. IsHttp1_1(
  310. VOID
  311. );
  312. BOOL
  313. IsOffline(
  314. VOID
  315. );
  316. DWORD
  317. SetOfflineUserState(
  318. IN DWORD dwState,
  319. IN BOOL bForce
  320. );
  321. VOID
  322. GlobalDataReadWarningUIFlags(
  323. VOID
  324. );
  325. PLOCAL_STRINGS
  326. FetchLocalStrings(
  327. VOID
  328. );
  329. PLOCAL_STRINGSA
  330. FetchLocalStringsA(
  331. VOID
  332. );
  333. VOID
  334. ChangeGlobalSettings(
  335. VOID
  336. );
  337. VOID
  338. RefreshOfflineFromRegistry(
  339. VOID
  340. );
  341. VOID
  342. PerformStartupProcessing(
  343. VOID
  344. );
  345. DWORD
  346. GetSitaraProtocol(
  347. VOID
  348. );
  349. typedef HRESULT
  350. (STDAPICALLTYPE * PFNINETMULTIBYTETOUNICODE)
  351. (
  352. LPDWORD lpdword,
  353. DWORD dwSrcEncoding,
  354. LPCSTR lpSrcStr,
  355. LPINT lpnSrcSize,
  356. LPWSTR lpDstStr,
  357. LPINT lpDstStrSize
  358. );
  359. // Loads Mlang and returns a pointer to the MultiByte to Unicode converter.
  360. // Could return NULL if mlang.dll couldn't be loaded for some reason.
  361. PFNINETMULTIBYTETOUNICODE GetInetMultiByteToUnicode( );
  362. #if defined(__cplusplus)
  363. }
  364. #endif