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.

762 lines
23 KiB

  1. #ifndef _PRIV_H_
  2. #define _PRIV_H_
  3. // For use with VC6
  4. #pragma warning(4:4242) //'initializing' : conversion from 'unsigned int' to 'unsigned short', possible loss of data
  5. // Sundown
  6. #pragma warning(disable: 4800) // conversion to bool
  7. #define ASSERT_PRIV_H_INCLUDED
  8. // This stuff must run on Win95
  9. #define _WIN32_WINDOWS 0x0400
  10. #ifndef WINVER
  11. #define WINVER 0x0400
  12. #endif
  13. #define _OLEAUT32_ // get DECLSPEC_IMPORT stuff right, we are defing these
  14. #define _FSMENU_ // for DECLSPEC_IMPORT
  15. #define _WINMM_ // for DECLSPEC_IMPORT in mmsystem.h
  16. #define _SHDOCVW_ // for DECLSPEC_IMPORT in shlobj.h
  17. #define _WINX32_ // get DECLSPEC_IMPORT stuff right for WININET API
  18. #define _BROWSEUI_ // Make functions exported from browseui as stdapi (as they are delay loaded)
  19. #define _URLCACHEAPI_ // get DECLSPEC_IMPORT stuff right for wininet urlcache
  20. #ifndef STRICT
  21. #define STRICT
  22. #endif
  23. //
  24. // Channels are enabled for IE4 upgrades.
  25. //
  26. #define ENABLE_CHANNELS
  27. #ifdef __cplusplus
  28. extern "C" { /* Assume C declarations for C++. */
  29. #endif /* __cplusplus */
  30. #include <nt.h>
  31. // WARNING! NTDLL is manually delay-loaded! bcause it is crippled on Win95.
  32. // We used to use automatic delay-loading, but people who didn't realize that
  33. // Win95 doesn't have full support for NTDLL would accidentally call NTDLL
  34. // functions and cause us to crash on Win95.
  35. #undef NTSYSAPI
  36. #define NTSYSAPI
  37. #include <ntrtl.h>
  38. #include <nturtl.h>
  39. #undef NTSYSAPI
  40. #define NTSYSAPI DECLSPEC_IMPORT
  41. #ifdef __cplusplus
  42. } /* End of extern "C" {. */
  43. #endif /* __cplusplus */
  44. #define POST_IE5_BETA // turn on post-split iedev stuff
  45. #include <w95wraps.h>
  46. #include <windows.h>
  47. #include <windowsx.h>
  48. // VariantInit is a trivial function -- avoid using OleAut32, use intrinsic
  49. // version of memset for a good size win
  50. // (it's here so that atl (in stdafx.h) gets it too)
  51. #define VariantInit(p) memset(p, 0, sizeof(*(p)))
  52. // Smartly delay load OLEAUT32
  53. HRESULT VariantClearLazy(VARIANTARG *pvarg);
  54. #define VariantClear VariantClearLazy
  55. WINOLEAUTAPI VariantCopyLazy(VARIANTARG * pvargDest, VARIANTARG * pvargSrc);
  56. #define VariantCopy VariantCopyLazy
  57. // Must do this before including <exdisp.h> or the build will break.
  58. // See comments at declaration of FindWindowD much further below.
  59. #ifdef DEBUG
  60. #undef FindWindow
  61. #undef FindWindowEx
  62. #define FindWindow FindWindowD
  63. #define FindWindowEx FindWindowExD
  64. #endif
  65. #define _FIX_ENABLEMODELESS_CONFLICT // for shlobj.h
  66. //WinInet need to be included BEFORE ShlObjp.h
  67. #include <hlink.h>
  68. #include <wininet.h>
  69. #include <urlmon.h>
  70. #include <shlobj.h>
  71. #include <exdisp.h>
  72. #include <objidl.h>
  73. #include <shlwapi.h>
  74. #include <shlwapip.h>
  75. #undef SubclassWindow
  76. #if defined(__cplusplus) && !defined(DONT_USE_ATL)
  77. // (stdafx.h must come before windowsx.h)
  78. #include "stdafx.h" // ATL header file for this component
  79. // AtlMisc.h needs some defines from AtlApp.h
  80. #ifndef __ATLAPP_H__
  81. #include "AtlApp.h"
  82. #endif
  83. // include CString, CSize, CRect, CPoint, CFindFile from WTL10
  84. // see %_NTROOT%\public\sdk\inc\wtl10
  85. #include "AtlMisc.h"
  86. // Include LBSTR::CString
  87. #include <locbstr.h>
  88. #endif
  89. #include <shellapi.h>
  90. //===========================================================================
  91. // ITEMIDLIST
  92. //===========================================================================
  93. // unsafe macros
  94. #define _ILSkip(pidl, cb) ((LPITEMIDLIST)(((BYTE*)(pidl))+cb))
  95. #define _ILNext(pidl) _ILSkip(pidl, (pidl)->mkid.cb)
  96. #define SEN_FIRST (0U-550U) // ;Internal
  97. #include <ole2ver.h>
  98. #include <olectl.h>
  99. #include <shellp.h>
  100. #include <shdocvw.h>
  101. #include <ieguidp.h>
  102. #include <isguids.h>
  103. #include <mimeinfo.h>
  104. #include <hlguids.h>
  105. #include <mshtmdid.h>
  106. #include <dispex.h> // IDispatchEx
  107. #include <perhist.h>
  108. #include <iethread.h>
  109. #include <help.h>
  110. #include <multimon.h>
  111. #define DISALLOW_Assert // Force to use ASSERT instead of Assert
  112. #define DISALLOW_DebugMsg // Force to use TraceMsg instead of DebugMsg
  113. #include <debug.h>
  114. #include <urlhist.h>
  115. #include <regapix.h> // MAXIMUM_SUB_KEY_LENGTH, MAXIMUM_VALUE_NAME_LENGTH, MAXIMUM_DATA_LENGTH
  116. #include <regstr.h> // for REGSTR_PATH_EXPLORE
  117. #define USE_SYSTEM_URL_MONIKER
  118. #include <urlmon.h>
  119. #include <winineti.h> // Cache APIs & structures
  120. #include <inetreg.h>
  121. #define _INTSHCUT_ // get DECLSPEC_IMPORT stuff right for INTSHCUT.h
  122. #include <intshcut.h>
  123. #include <propset.h> // FEATURE (scotth): remove this once OLE adds an official header
  124. #define HLINK_NO_GUIDS
  125. #include <hlink.h>
  126. #include <hliface.h>
  127. #include <docobj.h>
  128. #define DLL_IS_ROOTABLE
  129. #include <ccstock.h>
  130. #include <ccstock2.h>
  131. #include <port32.h>
  132. #define STRSAFE_NO_CB_FUNCTIONS
  133. #define STRSAFE_NO_DEPRECATE
  134. #include <strsafe.h>
  135. #include <browseui.h>
  136. #ifdef OLD_HLIFACE
  137. #define HLNF_OPENINNEWWINDOW HLBF_OPENINNEWWINDOW
  138. #endif
  139. #define ISVISIBLE(hwnd) ((GetWindowStyle(hwnd) & WS_VISIBLE) == WS_VISIBLE)
  140. // shorthand
  141. #ifndef ATOMICRELEASE
  142. #ifdef __cplusplus
  143. #define ATOMICRELEASET(p, type) { if(p) { type* punkT=p; p=NULL; punkT->Release();} }
  144. #else
  145. #define ATOMICRELEASET(p, type) { if(p) { type* punkT=p; p=NULL; punkT->lpVtbl->Release(punkT);} }
  146. #endif
  147. // doing this as a function instead of inline seems to be a size win.
  148. //
  149. #ifdef NOATOMICRELESEFUNC
  150. #define ATOMICRELEASE(p) ATOMICRELEASET(p, IUnknown)
  151. #else
  152. # ifdef __cplusplus
  153. # define ATOMICRELEASE(p) IUnknown_SafeReleaseAndNullPtr(p)
  154. # else
  155. # define ATOMICRELEASE(p) IUnknown_AtomicRelease((LPVOID*)&p)
  156. # endif
  157. #endif
  158. #endif //ATOMICRELEASE
  159. #ifdef SAFERELEASE
  160. #undef SAFERELEASE
  161. #endif
  162. #define SAFERELEASE(p) ATOMICRELEASE(p)
  163. // Include the automation definitions...
  164. #include <exdisp.h>
  165. #include <exdispid.h>
  166. #include <ocmm.h>
  167. #include <htmlfilter.h>
  168. #include <mshtmhst.h>
  169. #include <simpdata.h>
  170. #include <htiface.h>
  171. #include <objsafe.h>
  172. #include "util.h"
  173. #include "iepriv.h"
  174. #include "brutil.h"
  175. #include "qistub.h"
  176. #ifdef DEBUG
  177. #include "dbutil.h"
  178. #endif
  179. #define DLL_IS_UNICODE (sizeof(TCHAR) == sizeof(WCHAR))
  180. //
  181. // Neutral ANSI/UNICODE types and macros... 'cus Chicago seems to lack them
  182. // IEUNIX - we do have them in MainWin
  183. //
  184. #ifndef MAINWIN
  185. #ifdef UNICODE
  186. typedef WCHAR TUCHAR, *PTUCHAR;
  187. #else /* UNICODE */
  188. typedef unsigned char TUCHAR, *PTUCHAR;
  189. #endif /* UNICODE */
  190. #endif /* !MAINWIN */
  191. #ifdef __cplusplus
  192. extern "C" { /* Assume C declarations for C++. */
  193. #endif /* __cplusplus */
  194. extern const ITEMIDLIST c_idlDesktop;
  195. typedef const BYTE *LPCBYTE;
  196. STDAPI MonikerFromURLPidl(LPCITEMIDLIST pidlURLItem, IMoniker** ppmk);
  197. STDAPI MonikerFromURL(LPCWSTR wszPath, IMoniker** ppmk);
  198. STDAPI MonikerFromString(LPCTSTR szPath, IMoniker** ppmk);
  199. #define RECTWIDTH(rc) ((rc).right-(rc).left)
  200. #define RECTHEIGHT(rc) ((rc).bottom-(rc).top)
  201. extern IShellFolder* g_psfInternet;
  202. HRESULT InitPSFInternet(void);
  203. //
  204. // Debug helper functions
  205. //
  206. #ifdef DEBUG
  207. LPCTSTR Dbg_GetCFName(UINT ucf);
  208. LPCTSTR Dbg_GetHRESULTName(HRESULT hr);
  209. LPCTSTR Dbg_GetREFIIDName(REFIID riid);
  210. LPCTSTR Dbg_GetVTName(VARTYPE vt);
  211. BOOL IsStringContained(LPCTSTR pcszBigger, LPCTSTR pcszSuffix);
  212. #endif // DEBUG
  213. //
  214. // we may not be part of the namespace on IE3/Win95
  215. //
  216. #define ILIsEqual(p1, p2) IEILIsEqual(p1, p2, FALSE)
  217. extern LPCITEMIDLIST c_pidlURLRoot;
  218. //
  219. // Trace/dump/break flags specific to shell32\.
  220. // (Standard flags defined in shellp.h)
  221. //
  222. // Break flags
  223. #define BF_ONDUMPMENU 0x10000000 // Stop after dumping menus
  224. #define BF_ONLOADED 0x00000010 // Stop when loaded
  225. // Trace flags
  226. #define TF_INTSHCUT 0x00000010 // Internet shortcuts
  227. #define TF_REGCHECK 0x00000100 // Registry check stuff
  228. #define TF_SHDLIFE 0x00000200
  229. #define TF_SHDREF 0x00000400
  230. #define TF_SHDPERF 0x00000800
  231. #define TF_SHDAUTO 0x00001000
  232. #define TF_MENUBAND 0x00002000 // Menu band messages
  233. #define TF_SITEMAP 0x00004000 // Sitemap messages
  234. #define TF_SHDTHREAD 0x00008000 // Thread management
  235. #define TF_SHDCONTROL 0x00010000 // ActiveX Control
  236. #define TF_SHDAPPHACK 0x00020000 // Hack for app-bug
  237. #define TF_SHDBINDING 0x00040000 // Moniker binding
  238. #define TF_SHDPROGRESS 0x00080000 // Download progress
  239. #define TF_SHDNAVIGATE 0x00100000 // Navigation
  240. #define TF_SHDUIACTIVATE 0x00200000 // UI-Activation/Deactivation
  241. #define TF_OCCONTROL 0x00400000 // OC Hosting Window Control
  242. #define TF_PIDLWRAP 0x00800000 // Pidl / Protocol wrapping
  243. #define TF_AUTOCOMPLETE 0x01000000 // AutoCompletion
  244. #define TF_COCREATE 0x02000000 // WinList/CoCreate(Browser only)
  245. #define TF_URLNAMESPACE 0x04000000 // URL Name Space
  246. #define TF_BAND 0x08000000 // Bands (ISF Band, etc)
  247. #define TF_TRAVELLOG 0x10000000 // TravelLog and Navigation stack
  248. #define TF_DDE 0x20000000 // PMDDE traces
  249. #define TF_CUSTOM1 0x40000000 // Custom messages #1
  250. #define TF_CUSTOM2 0x80000000 // Custom messages #2
  251. //FEATURE: REMOVE
  252. #define TF_OBJECTCACHE TF_TRAVELLOG
  253. // (Re-use TF_CUSTOM1 and TF_CUSTOM2 by defining a TF_ value in your
  254. // local file to one of these values while you have the file checked
  255. // out.)
  256. // Dump flags
  257. #define DF_SITEMAP 0x00000001 // Sitemap
  258. #define DF_MEMLEAK 0x00000002 // Dump leaked memory at the end
  259. #define DF_DEBUGQI 0x00000004 // Alloc stub object for each QI
  260. #define DF_DEBUGQINOREF 0x00000008 // No AddRef/Release QI stub
  261. #define DF_DEBUGMENU 0x00000010 // Dump menu handles
  262. #define DF_URL 0x00000020 // Display URLs
  263. #define DF_AUTOCOMPLETE 0x00000040 // AutoCompletion
  264. #define DF_DELAYLOADDLL 0x00000080 // Delay-loaded DLL
  265. #define DF_SHELLLIST 0x00000100 // CShellList contents
  266. #define DF_INTSHCUT 0x00000200 // Internet shortcut structs
  267. #define DF_URLPROP 0x00000400 // URL properties
  268. #define DF_MSGHOOK 0x00000800 // Menu MessageFilter
  269. #define DF_GETMSGHOOK 0x00001000 // GetMessageFilter
  270. #define DF_TRANSACCELIO 0x00002000 // GetMessageFilter
  271. // Prototype flags
  272. #define PF_USERMENUS 0x00000001 // Use traditional USER menu bar
  273. #define PF_NEWFAVMENU 0x00000002 // New favorites menu
  274. #define PF_FORCESHDOC401 0x00000004 // force shdoc401 even on NT5
  275. //efine PF_ 0x00000008 // Used by dochost.cpp
  276. //efine PF_ 0x00000010 // Unused
  277. //efine PF_ 0x00000020 // Used by urlhist.cpp
  278. //efine PF_ 0x00000040 // Unused
  279. //efine PF_ 0x00000100 // Unused
  280. //efine PF_ 0x00000200 // Used by shembed.cpp
  281. //efine PF_ 0x00000400 // Unused?
  282. //efine PF_ 0x00000800 // Unused?
  283. //
  284. // global object array - used for class factory, auto registration, type libraries, oc information
  285. //
  286. #include "cfdefs.h"
  287. #define OIF_ALLOWAGGREGATION 0x0001
  288. //
  289. // global variables
  290. //
  291. //
  292. // Function prototypes
  293. //
  294. HRESULT SHRegisterTypeLib(void);
  295. VOID SHCheckRegistry(void);
  296. // htregmng.cpp
  297. BOOL CenterWindow (HWND hwndChild, HWND hwndParent);
  298. #define OleAlloc(cb) CoTaskMemAlloc(cb)
  299. #define OleFree(pv) CoTaskMemFree(pv)
  300. STDAPI_(IBindCtx *) BCW_Create(IBindCtx* pibc);
  301. STDAPI_(void) DllAddRef(void);
  302. STDAPI_(void) DllRelease(void);
  303. #define MAX_URL_STRING INTERNET_MAX_URL_LENGTH
  304. #define MAX_NAME_STRING INTERNET_MAX_PATH_LENGTH
  305. #define MAX_BROWSER_WINDOW_TITLE 128
  306. // Stack allocated BSTR (to avoid calling SysAllocString)
  307. typedef struct _SA_BSTR {
  308. ULONG cb;
  309. WCHAR wsz[MAX_URL_STRING];
  310. } SA_BSTR;
  311. // A "fake" variants for use on the stack - usable for [in] parameters only!!!
  312. typedef struct _SA_BSTRGUID {
  313. UINT cb;
  314. WCHAR wsz[39];
  315. } SA_BSTRGUID;
  316. #define InitFakeBSTR(pSA_BSTR, guid) SHStringFromGUIDW((guid), (pSA_BSTR)->wsz, ARRAYSIZE((pSA_BSTR)->wsz)), (pSA_BSTR)->cb = (38*sizeof(WCHAR))
  317. STDAPI _SetStdLocation(LPTSTR szPath, UINT id);
  318. STDAPI CDocObjectHost_AddPages(LPARAM that, HWND hwnd, HINSTANCE hinst, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam);
  319. STDAPI_(void) CDocObjectHost_GetCurrentPage(LPARAM that, LPTSTR szBuf, UINT cchMax);
  320. extern BOOL DeleteUrlCacheEntryA(LPCSTR pszUrlName);
  321. void LaunchPrivacySettings(HWND);
  322. //
  323. // a couple bogus pidls
  324. //
  325. #define PIDL_LOCALHISTORY ((LPCITEMIDLIST)-1)
  326. #define PIDL_NOTHING ((LPCITEMIDLIST)-2)
  327. //
  328. // Globals (per-process)
  329. //
  330. extern UINT g_tidParking; // parking thread
  331. extern HPALETTE g_hpalHalftone;
  332. extern BOOL g_fBrowserOnlyProcess; // initialized in IEWinMain()
  333. //
  334. // In DEBUG, send all our class registrations through a wrapper that
  335. // checks that the class is on our unregister-at-unload list.
  336. //
  337. #ifdef DEBUG
  338. #undef SHRegisterClass
  339. #undef RegisterClass
  340. #define SHRegisterClass SHRegisterClassD
  341. #define RegisterClass RegisterClassD
  342. STDAPI_(BOOL) SHRegisterClassD(CONST WNDCLASS* pwc);
  343. STDAPI_(ATOM) RegisterClassD(CONST WNDCLASS* pwc);
  344. #ifdef UNICODE
  345. #define RealSHRegisterClass SHRegisterClassW
  346. #define RealRegisterClass RegisterClassWrapW
  347. #else
  348. #define RealSHRegisterClass SHRegisterClassA
  349. #define RealRegisterClass RegisterClassA
  350. #endif // UNICODE
  351. #endif // DEBUG
  352. //
  353. // In DEBUG, send FindWindow through a wrapper that ensures that the
  354. // critical section is not taken. FindWindow sends interthreadmessages,
  355. // which is not obvious.
  356. //
  357. // IShellWindows has a method called FindWindow, so we have to define
  358. // the debug wrapper macros before including <exdisp.h>. We should've
  359. // called it FindWindowSW. In fact, there should be some law against
  360. // giving a method the same name as a Windows API.
  361. //
  362. #ifdef DEBUG
  363. STDAPI_(HWND) FindWindowD (LPCTSTR lpClassName, LPCTSTR lpWindowName);
  364. STDAPI_(HWND) FindWindowExD(HWND hwndParent, HWND hwndChildAfter, LPCTSTR lpClassName, LPCTSTR lpWindowName);
  365. #ifdef UNICODE
  366. #define RealFindWindowEx FindWindowExWrapW
  367. #else
  368. #define RealFindWindowEx FindWindowExA
  369. #endif // UNICODE
  370. #endif // DEBUG
  371. #define CALLWNDPROC WNDPROC
  372. extern const GUID CGID_ShellBrowser;
  373. extern const GUID CGID_PrivCITCommands;
  374. // Map KERNEL32 unicode string functions to SHLWAPI
  375. //#define lstrcmpW StrCmpW
  376. //#define lstrcmpiW StrCmpIW
  377. //#define lstrcpyW StrCpyW
  378. //#define lstrcpynW StrCpyNW
  379. //#define lstrcatW StrCatW
  380. //
  381. // Prevent buffer overruns - don't use unsafe functions.
  382. //
  383. //lstrcpy
  384. #undef lstrcpyW
  385. #define lstrcpyW Do_not_use_lstrcpyW_use_StrCpyNW
  386. #define lstrcpyA Do_not_use_lstrcpyA_use_StrCpyNA
  387. #ifdef lstrcpy
  388. #undef lstrcpy
  389. #endif
  390. #define lstrcpy Do_not_use_lstrcpy_use_StrCpyN
  391. //StrCpy
  392. //#ifdef StrCpyW
  393. // #undef StrCpyW
  394. //#endif
  395. #define StrCpyW Do_not_use_StrCpyW_use_StrCpyNW
  396. #ifdef StrCpyA
  397. #undef StrCpyA
  398. #endif
  399. #define StrCpyA Do_not_use_StrCpyA_use_StrCpyNA
  400. #ifdef StrCpy
  401. #undef StrCpy
  402. #endif
  403. #define StrCpy Do_not_use_StrCpy_use_StrCpyN
  404. //ualstrcpyW
  405. #ifdef ualstrcpyW
  406. #undef ualstrcpyW
  407. #endif
  408. #define ualstrcpyW Do_not_use_ualstrcpyW_ualstrcpynW
  409. //lstrcatW
  410. #define lstrcatW Do_not_use_lstrcatW_use_StrCatBuffW
  411. #define lstrcatA Do_not_use_lstrcatA_use_StrCatBuffA
  412. #ifdef lstrcat
  413. #undef lstrcat
  414. #endif
  415. #define lstrcat Do_not_use_lstrcat_use_StrCatBuff
  416. //wsprintf
  417. #define wsprintfW Do_not_use_wsprintfW_use_wnsprintfW
  418. #define wsprintfA Do_not_use_wsprintfA_use_wnsprintfA
  419. #ifdef wsprintf
  420. #undef wsprintf
  421. #endif
  422. #define wsprintf Do_not_use_wsprintf_use_wnsprintf
  423. //wvsprintf
  424. #ifdef wvsprintfW
  425. #undef wvsprintfW
  426. #endif
  427. #define wvsprintfW Do_not_use_wvsprintfW_use_wvnsprintfW
  428. #define wvsprintfA Do_not_use_wvsprintfA_use_wvnsprintfA
  429. #ifdef wvsprintf
  430. #undef wvsprintf
  431. #endif
  432. #define wvsprintf Do_not_use_wvsprintf_use_wvnsprintf
  433. //
  434. // Don't use the kernel string functions. Use shlwapi equivalents.
  435. //
  436. #ifndef _WIN64
  437. // lstrcmp
  438. #undef lstrcmpW
  439. #define lstrcmpW Do_not_use_lstrcmpW_use_StrCmpW
  440. //#define lstrcmpA Do_not_use_lstrcmpA_use_StrCmpA
  441. #ifdef lstrcmp
  442. #undef lstrcmp
  443. #endif
  444. #define lstrcmp Do_not_use_lstrcmp_use_StrCmp
  445. // lstrcmpi
  446. #undef lstrcmpiW
  447. #define lstrcmpiW Do_not_use_lstrcmpiW_use_StrCmpIW
  448. //#define lstrcmpiA Do_not_use_lstrcmpiA_use_StrCmpIA
  449. #ifdef lstrcmpi
  450. #undef lstrcmpi
  451. #endif
  452. #define lstrcmpi Do_not_use_lstrcmpi_use_StrCmpI
  453. // lstrncmpi
  454. #define lstrncmpiW Do_not_use_lstrncmpiW_use_StrCmpNIW
  455. //#define lstrncmpiA Do_not_use_lstrncmpiA_use_StrCmpNIA
  456. #ifdef lstrncmpi
  457. #undef lstrncmpi
  458. #endif
  459. #define lstrncmpi Do_not_use_lstrncmpi_use_StrCmpNI
  460. //lstrcpyn
  461. #undef lstrcpynW
  462. #define lstrcpynW Do_not_use_lstrcpynW_use_StrCpyNW
  463. //#define lstrcpynA Do_not_use_lstrcpynA_use_StrCpyNA
  464. #ifdef lstrcpyn
  465. #undef lstrcpyn
  466. #endif
  467. #define lstrcpyn Do_not_use_lstrcpyn_use_StrCpyN
  468. #endif
  469. extern HINSTANCE g_hinst;
  470. #define HINST_THISDLL g_hinst
  471. extern BOOL g_fRunningOnNT;
  472. extern BOOL g_bNT5Upgrade;
  473. extern BOOL g_bRunOnNT5;
  474. extern BOOL g_bRunOnMemphis;
  475. extern BOOL g_fRunOnFE;
  476. extern UINT g_uiACP;
  477. //
  478. // Is Mirroring APIs enabled (BiDi Memphis and NT5 only)
  479. //
  480. extern BOOL g_bMirroredOS;
  481. #ifdef WINDOWS_ME
  482. //
  483. // This is needed for BiDi localized win95 RTL stuff
  484. //
  485. extern BOOL g_bBiDiW95Loc;
  486. #else // !WINDOWS_ME
  487. #define g_bBiDiW95Loc FALSE
  488. #endif // WINDOWS_ME
  489. extern const TCHAR c_szHelpFile[];
  490. extern const TCHAR c_szHtmlHelpFile[];
  491. extern const TCHAR c_szURLPrefixesKey[];
  492. extern const TCHAR c_szDefaultURLPrefixKey[];
  493. extern const TCHAR c_szShellEmbedding[];
  494. extern const TCHAR c_szViewClass[];
  495. #define c_szNULL TEXT("")
  496. // status bar pane numbers actually used to create the controls - in left-to-right order
  497. #define STATUS_PANES 6
  498. #define STATUS_PANE_NAVIGATION 0
  499. #define STATUS_PANE_PROGRESS 1
  500. #define STATUS_PANE_OFFLINE 2
  501. #define STATUS_PANE_PRINTER 2 // printer and offline share a spot
  502. #define STATUS_PANE_PRIVACY 3
  503. #define STATUS_PANE_SSL 4
  504. #define STATUS_PANE_ZONE 5
  505. #define ZONES_PANE_WIDTH 70
  506. extern HICON g_hiconSSL;
  507. extern HICON g_hiconFortezza;
  508. extern HICON g_hiconOffline;
  509. extern HICON g_hiconPrinter;
  510. extern HICON g_hiconPrivacyImpact;
  511. #define MAX_TOOLTIP_STRING 80
  512. #define SID_SOmWindow IID_IHTMLWindow2
  513. #define SID_SDropBlocker CLSID_SearchBand
  514. #define MIN_BROWSER_DISPID 1
  515. #define MAX_BROWSER_DISPID 1000
  516. // We may want to put "Thunks between us and some of the shell private entries as
  517. // some of them will take Ansi strings on Windows 95 and will take unicode strings
  518. // on NT.
  519. #include "runonnt.h"
  520. // Function in IEDISP.CPP
  521. HRESULT CreateBlankURL(BSTR *url, LPCTSTR pszErrorUrl, BSTR oldUrl);
  522. SAFEARRAY * MakeSafeArrayFromData(LPCBYTE pData, DWORD cbData);
  523. #include "idispids.h"
  524. #ifdef __cplusplus
  525. //
  526. // C++ modules only
  527. //
  528. #include <shstr.h>
  529. #include "shembed.h"
  530. extern "C" const ITEMIDLIST s_idlNULL;
  531. // helper routines for view state stuff
  532. IStream *GetDesktopRegStream(DWORD grfMode, LPCTSTR pszName, LPCTSTR pszStreams);
  533. //IStream *GetViewStream(LPCITEMIDLIST pidl, DWORD grfMode, LPCTSTR pszName, LPCTSTR pszStreamMRU, LPCTSTR pszStreams);
  534. // StreamHeader Signatures
  535. #define STREAMHEADER_SIG_CADDRESSBAND 0xF432E001
  536. #define STREAMHEADER_SIG_CADDRESSEDITBOX 0x24F92A92
  537. #define CoCreateInstance IECreateInstance
  538. HRESULT IECreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter,
  539. DWORD dwClsContext, REFIID riid, LPVOID FAR* ppv);
  540. #endif
  541. extern HRESULT LoadHistoryShellFolder(IUnknown *punkSFHistory, IHistSFPrivate **pphsfHistory); // from urlhist.cpp
  542. extern void CUrlHistory_CleanUp();
  543. #define c_szHelpFile TEXT("iexplore.hlp")
  544. /////// mappings...
  545. ////// these functions moved from being private utilities to being exported (mostly from shlwapi)
  546. ///// and thus need a new name to avoid name collisions
  547. #define IsRegisteredClient SHIsRegisteredClient
  548. #define IE_ErrorMsgBox SHIEErrorMsgBox
  549. #define SetDefaultDialogFont SHSetDefaultDialogFont
  550. #define RemoveDefaultDialogFont SHRemoveDefaultDialogFont
  551. #define IsGlobalOffline SHIsGlobalOffline
  552. #define SetWindowBits SHSetWindowBits
  553. #define IsSameObject SHIsSameObject
  554. #define SetParentHwnd SHSetParentHwnd
  555. #define IsEmptyStream SHIsEmptyStream
  556. #define PropagateMessage SHPropagateMessage
  557. #define MenuIndexFromID SHMenuIndexFromID
  558. #define Menu_RemoveAllSubMenus SHRemoveAllSubMenus
  559. #define _EnableMenuItem SHEnableMenuItem
  560. #define _CheckMenuItem SHCheckMenuItem
  561. #define SimulateDrop SHSimulateDrop
  562. #define GetMenuFromID SHGetMenuFromID
  563. #define GetCurColorRes SHGetCurColorRes
  564. #define VerbExists SHVerbExists
  565. #define IsExpandableFolder SHIsExpandableFolder
  566. #define WaitForSendMessageThread SHWaitForSendMessageThread
  567. #define FillRectClr SHFillRectClr
  568. #define SearchMapInt SHSearchMapInt
  569. #define IsChildOrSelf SHIsChildOrSelf
  570. #define StripMneumonic SHStripMneumonic
  571. #define MapNbspToSp SHMapNbspToSp
  572. #define GetViewStream SHGetViewStream
  573. #define HinstShdocvw() HINST_THISDLL
  574. #ifdef __cplusplus
  575. } /* End of extern "C" {. */
  576. #endif /* __cplusplus */
  577. #define QUAD_PART(a) ((a)##.QuadPart)
  578. // Sundown macros
  579. #define PtrDiff(x,y) ((LPBYTE)(x)-(LPBYTE)(y))
  580. // Dummy union macros for code compilation on platforms not
  581. // supporting nameless stuct/union
  582. #ifdef NONAMELESSUNION
  583. #define DUMMYUNION_MEMBER(member) DUMMYUNIONNAME.##member
  584. #define DUMMYUNION2_MEMBER(member) DUMMYUNIONNAME2.##member
  585. #define DUMMYUNION3_MEMBER(member) DUMMYUNIONNAME3.##member
  586. #define DUMMYUNION4_MEMBER(member) DUMMYUNIONNAME4.##member
  587. #define DUMMYUNION5_MEMBER(member) DUMMYUNIONNAME5.##member
  588. #else
  589. #define DUMMYUNION_MEMBER(member) member
  590. #define DUMMYUNION2_MEMBER(member) member
  591. #define DUMMYUNION3_MEMBER(member) member
  592. #define DUMMYUNION4_MEMBER(member) member
  593. #define DUMMYUNION5_MEMBER(member) member
  594. #endif
  595. #define REG_SUBKEY_FAVORITESA "\\MenuOrder\\Favorites"
  596. #define REG_SUBKEY_FAVORITES TEXT(REG_SUBKEY_FAVORITESA)
  597. #undef ExpandEnvironmentStrings
  598. #define ExpandEnvironmentStrings #error "Use SHExpandEnvironmentStrings instead"
  599. #include "shfusion.h"
  600. #endif // _PRIV_H_