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.

768 lines
12 KiB

  1. #include "shellpch.h"
  2. #pragma hdrstop
  3. #define _SHDOCVW_
  4. #include <shlobj.h>
  5. #include <shlobjp.h>
  6. #include <objidl.h>
  7. #include <comctrlp.h>
  8. #include <shellapi.h>
  9. #include <shdocvw.h>
  10. #undef SHDOCAPI
  11. #define SHDOCAPI HRESULT STDAPICALLTYPE
  12. #undef SHDOCAPI_
  13. #define SHDOCAPI_(type) type STDAPICALLTYPE
  14. #undef SHSTDDOCAPI_
  15. #define SHSTDDOCAPI_(type) type STDAPICALLTYPE
  16. static
  17. SHDOCAPI_(IStream *)
  18. OpenPidlOrderStream(
  19. LPCITEMIDLIST pidlRoot,
  20. LPCITEMIDLIST pidl,
  21. LPCSTR pszKey,
  22. DWORD grfMode
  23. )
  24. {
  25. return NULL;
  26. }
  27. static
  28. SHDOCAPI_(BOOL)
  29. IEIsLinkSafe(
  30. HWND hwnd,
  31. LPCITEMIDLIST pidl,
  32. ILS_ACTION ilsFlag
  33. )
  34. {
  35. return FALSE;
  36. }
  37. static
  38. SHDOCAPI
  39. DragDrop(
  40. HWND hwnd,
  41. IShellFolder * psfParent,
  42. LPCITEMIDLIST pidl,
  43. DWORD dwPrefEffect,
  44. DWORD *pdwEffect
  45. )
  46. {
  47. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  48. }
  49. static
  50. SHDOCAPI
  51. IECreateFromPathCPWithBCW(
  52. UINT uiCP,
  53. LPCWSTR pszPath,
  54. IBindCtx * pbc,
  55. LPITEMIDLIST *ppidlOut
  56. )
  57. {
  58. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  59. }
  60. static
  61. SHDOCAPI_(BOOL)
  62. ILIsWeb(
  63. LPCITEMIDLIST pidl
  64. )
  65. {
  66. return FALSE;
  67. }
  68. static
  69. SHDOCAPI
  70. IECreateFromPathCPWithBCA(
  71. UINT uiCP,
  72. LPCSTR pszPath,
  73. IBindCtx * pbc,
  74. LPITEMIDLIST *ppidlOut
  75. )
  76. {
  77. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  78. }
  79. static
  80. SHDOCAPI
  81. SHGetIDispatchForFolder(
  82. LPCITEMIDLIST pidl,
  83. IWebBrowserApp **ppauto
  84. )
  85. {
  86. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  87. }
  88. static
  89. SHDOCAPI_(BOOL)
  90. ParseURLFromOutsideSourceW(
  91. LPCWSTR psz,
  92. LPWSTR pszOut,
  93. LPDWORD pcchOut,
  94. LPBOOL pbWasSearchURL
  95. )
  96. {
  97. return FALSE;
  98. }
  99. static
  100. SHDOCAPI_(IShellWindows *)
  101. WinList_GetShellWindows(
  102. BOOL fForceMarshalled
  103. )
  104. {
  105. return NULL;
  106. }
  107. static
  108. SHDOCAPI_(IStream*)
  109. SHGetViewStream(
  110. LPCITEMIDLIST pidl,
  111. DWORD grfMode,
  112. LPCWSTR pszName,
  113. LPCWSTR pszStreamMRU,
  114. LPCWSTR pszStreams
  115. )
  116. {
  117. return NULL;
  118. }
  119. static
  120. SHDOCAPI_(void)
  121. IEOnFirstBrowserCreation(
  122. IUnknown* punkAuto
  123. )
  124. {
  125. }
  126. static
  127. SHDOCAPI_(DWORD)
  128. SHRestricted2W(
  129. BROWSER_RESTRICTIONS rest,
  130. LPCWSTR pwzUrl,
  131. DWORD dwReserved
  132. )
  133. {
  134. return 0;
  135. }
  136. static
  137. SHDOCAPI
  138. IEBindToObject(
  139. LPCITEMIDLIST pidl,
  140. IShellFolder **ppsfOut
  141. )
  142. {
  143. *ppsfOut = NULL;
  144. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  145. }
  146. static
  147. SHDOCAPI
  148. IEGetAttributesOf(
  149. LPCITEMIDLIST pidl,
  150. DWORD* pdwAttribs
  151. )
  152. {
  153. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  154. }
  155. static
  156. SHDOCAPI
  157. NavToUrlUsingIEW(
  158. LPCWSTR wszUrl,
  159. BOOL fNewWindow
  160. )
  161. {
  162. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  163. }
  164. static
  165. SHDOCAPI
  166. URLSubLoadString(
  167. HINSTANCE hInst,
  168. UINT idRes,
  169. LPWSTR pszUrlOut,
  170. DWORD cchSizeOut,
  171. DWORD dwSubstitutions
  172. )
  173. {
  174. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  175. }
  176. static
  177. SHDOCAPI
  178. IEParseDisplayNameWithBCW(
  179. UINT uiCP,
  180. LPCWSTR pwszPath,
  181. IBindCtx * pbc,
  182. LPITEMIDLIST * ppidlOut
  183. )
  184. {
  185. *ppidlOut = NULL;
  186. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  187. }
  188. static
  189. SHDOCAPI_(DWORD)
  190. SoftwareUpdateMessageBox(
  191. HWND hWnd,
  192. LPCWSTR szDistUnit,
  193. DWORD dwFlags,
  194. LPSOFTDISTINFO psdi
  195. )
  196. {
  197. return IDABORT;
  198. }
  199. static
  200. SHDOCAPI_(BOOL)
  201. IsURLChild(
  202. LPCITEMIDLIST pidl,
  203. BOOL fIncludeHome
  204. )
  205. {
  206. return FALSE;
  207. }
  208. static
  209. SHDOCAPI_(void)
  210. IEInvalidateImageList()
  211. {
  212. }
  213. static
  214. SHDOCAPI_(BOOL)
  215. DoOrganizeFavDlgW(
  216. HWND hwnd,
  217. LPWSTR pszInitDir
  218. )
  219. {
  220. return FALSE;
  221. }
  222. static
  223. SHDOCAPI
  224. URLSubstitution(
  225. LPCWSTR pszUrlIn,
  226. LPWSTR pszUrlOut,
  227. DWORD cchSize,
  228. DWORD dwSubstitutions
  229. )
  230. {
  231. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  232. }
  233. static
  234. SHDOCAPI
  235. SHDGetPageLocation(
  236. HWND hwndOwner,
  237. UINT idp,
  238. LPWSTR pszPath,
  239. UINT cchMax,
  240. LPITEMIDLIST *ppidlOut
  241. )
  242. {
  243. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  244. }
  245. static
  246. SHDOCAPI
  247. ResetWebSettings(
  248. HWND hwnd,
  249. BOOL *pfChangedHomePage
  250. )
  251. {
  252. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  253. }
  254. static
  255. SHDOCAPI_(BOOL)
  256. SHIsRestricted2W(
  257. HWND hwnd,
  258. BROWSER_RESTRICTIONS rest,
  259. LPCWSTR pwzUrl,
  260. DWORD dwReserved
  261. )
  262. {
  263. return FALSE;
  264. }
  265. static
  266. SHDOCAPI_(BOOL)
  267. SHIsRegisteredClient(
  268. LPCWSTR pszClient
  269. )
  270. {
  271. return FALSE;
  272. }
  273. static
  274. SHDOCAPI_(BOOL)
  275. IsResetWebSettingsRequired()
  276. {
  277. return FALSE;
  278. }
  279. static
  280. SHSTDDOCAPI_(LPNMVIEWFOLDER)
  281. DDECreatePostNotify(
  282. LPNMVIEWFOLDER lpnm
  283. )
  284. {
  285. return NULL;
  286. }
  287. static
  288. SHDOCAPI
  289. IEGetDisplayName(
  290. LPCITEMIDLIST pidl,
  291. LPWSTR pszName,
  292. UINT uFlags
  293. )
  294. {
  295. if (pszName)
  296. {
  297. *pszName = L'0';
  298. }
  299. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  300. }
  301. static
  302. SHDOCAPI
  303. WinList_FindFolderWindow(
  304. LPCITEMIDLIST pidl,
  305. LPCITEMIDLIST pidlRoot,
  306. HWND *phwnd,
  307. IWebBrowserApp **ppauto
  308. )
  309. {
  310. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  311. }
  312. static
  313. SHDOCAPI_(void)
  314. FireEvent_Quit(
  315. IExpDispSupport *peds
  316. )
  317. {
  318. }
  319. static
  320. SHSTDDOCAPI_(BOOL)
  321. DDEHandleViewFolderNotify(
  322. IShellBrowser* psb,
  323. HWND hwnd,
  324. LPNMVIEWFOLDER lpnm
  325. )
  326. {
  327. return FALSE;
  328. }
  329. static
  330. SHDOCAPI_(BOOL)
  331. IEDDE_WindowDestroyed(
  332. HWND hwnd
  333. )
  334. {
  335. return FALSE;
  336. }
  337. static
  338. SHDOCAPI_(BOOL)
  339. IEDDE_NewWindow(
  340. HWND hwnd
  341. )
  342. {
  343. return FALSE;
  344. }
  345. static
  346. SHDOCAPI_(void)
  347. EnsureWebViewRegSettings()
  348. {
  349. }
  350. static
  351. SHDOCAPI
  352. WinList_RegisterPending(
  353. DWORD dwThread,
  354. LPCITEMIDLIST pidl,
  355. LPCITEMIDLIST pidlRoot,
  356. long *pdwRegister
  357. )
  358. {
  359. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  360. }
  361. static
  362. SHDOCAPI
  363. WinList_NotifyNewLocation(
  364. IShellWindows* psw,
  365. long dwRegister,
  366. LPCITEMIDLIST pidl
  367. )
  368. {
  369. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  370. }
  371. static
  372. SHDOCAPI_(void)
  373. _DeletePidlDPA(
  374. HDPA hdpa
  375. )
  376. {
  377. }
  378. static
  379. SHDOCAPI_(BOOL)
  380. IsIEDefaultBrowser()
  381. {
  382. return TRUE;
  383. }
  384. static
  385. SHDOCAPI_(BOOL)
  386. PathIsFilePath(
  387. LPCWSTR lpszPath
  388. )
  389. {
  390. return TRUE;
  391. }
  392. static
  393. SHDOCAPI_(BOOL)
  394. SHUseClassicToolbarGlyphs()
  395. {
  396. return FALSE;
  397. }
  398. static
  399. HRESULT
  400. PrepareURLForDisplayUTF8W(
  401. LPCWSTR pwz,
  402. LPWSTR pwzOut,
  403. LPDWORD pcbOut,
  404. BOOL fUTF8Enabled
  405. )
  406. {
  407. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  408. }
  409. static
  410. SHDOCAPI_(BOOL)
  411. IsErrorUrl(
  412. LPCWSTR pwszDisplayName
  413. )
  414. {
  415. return FALSE;
  416. }
  417. static
  418. SHDOCAPI
  419. CShellUIHelper_CreateInstance2(
  420. IUnknown** ppunk,
  421. REFIID riid,
  422. IUnknown *pSite,
  423. IDispatch *pExternalDisp
  424. )
  425. {
  426. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  427. }
  428. static
  429. SHDOCAPI
  430. GetLinkInfo(
  431. IShellFolder* psf,
  432. LPCITEMIDLIST pidlItem,
  433. BOOL* pfAvailable,
  434. BOOL* pfSticky
  435. )
  436. {
  437. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  438. }
  439. static
  440. SHDOCAPI_(int)
  441. IEMapPIDLToSystemImageListIndex(
  442. IShellFolder *psfParent,
  443. LPCITEMIDLIST pidlChild,
  444. int *piSelectedImage
  445. )
  446. {
  447. return -1;
  448. }
  449. static
  450. SHDOCAPI
  451. CreateShortcutInDirW(
  452. IN LPCITEMIDLIST pidlTarget,
  453. IN LPWSTR pwzTitle,
  454. IN LPCWSTR pwzDir,
  455. OUT LPWSTR pwzOut,
  456. IN BOOL bUpdateProperties)
  457. {
  458. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  459. }
  460. static
  461. SHDOCAPI
  462. _GetStdLocation(
  463. LPWSTR pszPath,
  464. DWORD cchPathSize,
  465. UINT id
  466. )
  467. {
  468. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  469. }
  470. static
  471. long
  472. SetQueryNetSessionCount(
  473. enum SessionOp Op
  474. )
  475. {
  476. return 0;
  477. }
  478. static
  479. SHDOCAPI_(void)
  480. IECleanUpAutomationObject()
  481. {
  482. }
  483. static
  484. SHDOCAPI_(BOOL)
  485. IEILIsEqual(
  486. LPCITEMIDLIST pidl1,
  487. LPCITEMIDLIST pidl2,
  488. BOOL fIgnoreHidden
  489. )
  490. {
  491. return (pidl1 == pidl2);
  492. }
  493. static
  494. SHDOCAPI_(BOOL)
  495. GetDefaultInternetSearchUrlW(
  496. LPWSTR pwszUrl,
  497. int cchUrl,
  498. BOOL bSubstitute
  499. )
  500. {
  501. return FALSE;
  502. }
  503. static
  504. SHDOCAPI_(BOOL)
  505. GetSearchAssistantUrlW(
  506. LPWSTR pwszUrl,
  507. int cchUrl,
  508. BOOL bSubstitute,
  509. BOOL bCustomize
  510. )
  511. {
  512. return FALSE;
  513. }
  514. static
  515. SHDOCAPI_(BOOL)
  516. DllRegisterWindowClasses(
  517. const SHDRC * pshdrc
  518. )
  519. {
  520. return FALSE;
  521. }
  522. static
  523. SHDOCAPI_(BOOL)
  524. SHIsGlobalOffline()
  525. {
  526. return FALSE;
  527. }
  528. static
  529. SHDOCAPI
  530. WinList_Revoke(
  531. long dwRegister
  532. )
  533. {
  534. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  535. }
  536. static
  537. SHDOCAPI_(BOOL)
  538. UrlHitsNetW(
  539. LPCWSTR pszURL
  540. )
  541. {
  542. return TRUE;
  543. }
  544. static
  545. SHDOCAPI
  546. IURLQualify(
  547. LPCWSTR pcszURL,
  548. DWORD dwFlags,
  549. LPWSTR pszTranslatedURL,
  550. LPBOOL pbWasSearchURL,
  551. LPBOOL pbWasCorrected
  552. )
  553. {
  554. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  555. }
  556. static
  557. SHDOCAPI
  558. IEBindToObjectEx(
  559. LPCITEMIDLIST pidl,
  560. IBindCtx *pbc,
  561. REFIID riid,
  562. void **ppv
  563. )
  564. {
  565. *ppv = NULL;
  566. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  567. }
  568. static
  569. SHDOCAPI_(BOOL)
  570. IsFileUrl(
  571. LPCSTR psz
  572. )
  573. {
  574. return FALSE;
  575. }
  576. static
  577. SHDOCAPI
  578. IEGetNameAndFlags(
  579. LPCITEMIDLIST pidl,
  580. UINT uFlags,
  581. LPWSTR pszName,
  582. DWORD cchName,
  583. DWORD *prgfInOutAttrs
  584. )
  585. {
  586. if (pszName)
  587. {
  588. *pszName = 0;
  589. }
  590. return HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
  591. }
  592. static
  593. SHDOCAPI_(void)
  594. IEWriteErrorLog(
  595. const EXCEPTION_RECORD* pexr
  596. )
  597. {
  598. }
  599. static
  600. SHDOCAPI_(BOOL)
  601. SafeOpenPromptForShellExec(
  602. HWND hwnd,
  603. PCWSTR pszFile
  604. )
  605. {
  606. return FALSE;
  607. }
  608. static
  609. SHDOCAPI_(BOOL)
  610. SafeOpenPromptForPackager(
  611. HWND hwnd,
  612. PCWSTR pszFile,
  613. BOOL bFromCommandLine
  614. )
  615. {
  616. return FALSE;
  617. }
  618. //
  619. // !! WARNING !! The entries below must be in order by ORDINAL
  620. //
  621. DEFINE_ORDINAL_ENTRIES(shdocvw)
  622. {
  623. DLOENTRY(103, CreateShortcutInDirW)
  624. DLOENTRY(116, DDECreatePostNotify)
  625. DLOENTRY(117, DDEHandleViewFolderNotify)
  626. DLOENTRY(135, IsFileUrl)
  627. DLOENTRY(137, PathIsFilePath)
  628. DLOENTRY(138, URLSubLoadString)
  629. DLOENTRY(139, OpenPidlOrderStream)
  630. DLOENTRY(140, DragDrop)
  631. DLOENTRY(141, IEInvalidateImageList)
  632. DLOENTRY(142, IEMapPIDLToSystemImageListIndex)
  633. DLOENTRY(143, ILIsWeb)
  634. DLOENTRY(145, IEGetAttributesOf)
  635. DLOENTRY(146, IEBindToObject)
  636. DLOENTRY(147, IEGetNameAndFlags)
  637. DLOENTRY(148, IEGetDisplayName)
  638. DLOENTRY(149, IEBindToObjectEx)
  639. DLOENTRY(150, _GetStdLocation)
  640. DLOENTRY(152, CShellUIHelper_CreateInstance2)
  641. DLOENTRY(153, IsURLChild)
  642. DLOENTRY(159, SHRestricted2W)
  643. DLOENTRY(160, SHIsRestricted2W)
  644. DLOENTRY(165, URLSubstitution)
  645. DLOENTRY(167, IsIEDefaultBrowser)
  646. DLOENTRY(170, ParseURLFromOutsideSourceW)
  647. DLOENTRY(171, _DeletePidlDPA)
  648. DLOENTRY(172, IURLQualify)
  649. DLOENTRY(174, SHIsGlobalOffline)
  650. DLOENTRY(176, EnsureWebViewRegSettings)
  651. DLOENTRY(177, WinList_NotifyNewLocation)
  652. DLOENTRY(178, WinList_FindFolderWindow)
  653. DLOENTRY(179, WinList_GetShellWindows)
  654. DLOENTRY(180, WinList_RegisterPending)
  655. DLOENTRY(181, WinList_Revoke)
  656. DLOENTRY(185, FireEvent_Quit)
  657. DLOENTRY(187, SHDGetPageLocation)
  658. DLOENTRY(191, SHIsRegisteredClient)
  659. DLOENTRY(194, IECleanUpAutomationObject)
  660. DLOENTRY(195, IEOnFirstBrowserCreation)
  661. DLOENTRY(196, IEDDE_WindowDestroyed)
  662. DLOENTRY(197, IEDDE_NewWindow)
  663. DLOENTRY(198, IsErrorUrl)
  664. DLOENTRY(200, SHGetViewStream)
  665. DLOENTRY(204, NavToUrlUsingIEW)
  666. DLOENTRY(210, UrlHitsNetW)
  667. DLOENTRY(212, GetLinkInfo)
  668. DLOENTRY(214, GetSearchAssistantUrlW)
  669. DLOENTRY(216, GetDefaultInternetSearchUrlW)
  670. DLOENTRY(218, IEParseDisplayNameWithBCW)
  671. DLOENTRY(219, IEILIsEqual)
  672. DLOENTRY(221, IECreateFromPathCPWithBCA)
  673. DLOENTRY(222, IECreateFromPathCPWithBCW)
  674. DLOENTRY(223, ResetWebSettings)
  675. DLOENTRY(224, IsResetWebSettingsRequired)
  676. DLOENTRY(225, PrepareURLForDisplayUTF8W)
  677. DLOENTRY(226, IEIsLinkSafe)
  678. DLOENTRY(227, SHUseClassicToolbarGlyphs)
  679. DLOENTRY(228, SafeOpenPromptForShellExec)
  680. DLOENTRY(229, SafeOpenPromptForPackager)
  681. };
  682. DEFINE_ORDINAL_MAP(shdocvw)
  683. //
  684. // !! WARNING !! The entries below must be in alphabetical order, and are CASE SENSITIVE (eg lower case comes last!)
  685. //
  686. DEFINE_PROCNAME_ENTRIES(shdocvw)
  687. {
  688. DLPENTRY(DllRegisterWindowClasses)
  689. DLPENTRY(DoOrganizeFavDlgW)
  690. DLPENTRY(IEWriteErrorLog)
  691. DLPENTRY(SHGetIDispatchForFolder)
  692. DLPENTRY(SetQueryNetSessionCount)
  693. DLPENTRY(SoftwareUpdateMessageBox)
  694. };
  695. DEFINE_PROCNAME_MAP(shdocvw)