Source code of Windows XP (NT5)
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.

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