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.

739 lines
17 KiB

  1. /*
  2. File: PlgProt.cpp
  3. Copyright (c) 1997-1999 Microsoft Corporation. All Rights Reserved.
  4. Abstract:
  5. History:
  6. 06/26/97 Cgomes - ported from Trident
  7. 03/20/98 Vank - ported from VID/htmed
  8. This pluggable protocol handler allows the control to override
  9. URL combining, parsing the security URL, and loading data.
  10. The control implements a property for the BaseURL which is set
  11. properly by default, but can be overridden by the user. To make
  12. this work we override CombineURL.
  13. To assure that the control is safe when hosted by IE but powerful
  14. when hosted by VB, we override ParseURL(PARSE_SECURITY_URL) and
  15. return a URL representing the zone of the outermost hosting Trident,
  16. or the path to the drive where the DLL is installed if Trident is
  17. not our host. This correctly handles cases where we're hosted on
  18. an intranet page, which is hosted in an internet page, which is
  19. hosted in an intranet page, etc. The topmost container's security
  20. zone is the one returned to IE.
  21. Finally, the control is in charge of saying what data is to be loaded.
  22. This can be set from a file, a URL, or a BSTR.
  23. NOTE:
  24. TSDK had the unusual requirement of having to be able to register
  25. even when it could not run. WinINet and UrlMon were dynamically
  26. loaded when the control was instantiated. This is clearly not
  27. necessary when we're a part of IE5, so this code has been disabled
  28. using the define LATE_BIND_URLMON_WININET.
  29. */
  30. #include "stdafx.h"
  31. #include <wininet.h>
  32. #include "plgprot.h"
  33. #include "dhtmledit.h"
  34. //////////////////////////////////////////////////////////////////////////////
  35. //
  36. // DHTMLEd Protocol Implementaion
  37. //
  38. CDHTMLEdProtocolInfo::CDHTMLEdProtocolInfo()
  39. {
  40. ATLTRACE(_T("CDHTMLEdProtocolInfo::CDHTMLEdProtocolInfo\n"));
  41. m_fZombied = FALSE;
  42. m_pProxyFrame = NULL;
  43. m_piProtocolConIntf = NULL;
  44. }
  45. CDHTMLEdProtocolInfo::~CDHTMLEdProtocolInfo()
  46. {
  47. ATLTRACE(_T("CDHTMLEdProtocolInfo::~CDHTMLEdProtocolInfo\n"));
  48. Zombie();
  49. }
  50. void CDHTMLEdProtocolInfo::Zombie()
  51. {
  52. m_fZombied = TRUE;
  53. if ( NULL != m_piProtocolConIntf )
  54. {
  55. m_piProtocolConIntf->Release ();
  56. m_piProtocolConIntf = NULL;
  57. }
  58. }
  59. //////////////////////////////////////////////////////////////////////////////
  60. //
  61. // IClassFactory Implementation
  62. //
  63. STDMETHODIMP CDHTMLEdProtocolInfo::CreateInstance
  64. (
  65. IUnknown* /*pUnkOuter*/,
  66. REFIID riid,
  67. void** ppvObject
  68. )
  69. {
  70. ExpectedExpr((!m_fZombied));
  71. InitParam(ppvObject);
  72. IfNullRet(ppvObject);
  73. HRESULT hr;
  74. // Only support creating the DHTMLEdProtocol object
  75. AtlCreateInstance(CDHTMLEdProtocol, riid, ppvObject);
  76. _ASSERTE(*ppvObject != NULL);
  77. if(*ppvObject == NULL)
  78. return E_NOINTERFACE;
  79. else
  80. {
  81. hr = (reinterpret_cast<IUnknown*>(*ppvObject)->QueryInterface) ( IID_IProtocolInfoConnector, (LPVOID*) &m_piProtocolConIntf );
  82. _ASSERTE ( SUCCEEDED ( hr ) && m_piProtocolConIntf );
  83. if ( SUCCEEDED ( hr ) && m_piProtocolConIntf )
  84. {
  85. if ( NULL != m_pProxyFrame )
  86. {
  87. m_piProtocolConIntf->SetProxyFrame ( (SIZE_T*)m_pProxyFrame );
  88. }
  89. }
  90. return NOERROR;
  91. }
  92. }
  93. STDMETHODIMP CDHTMLEdProtocolInfo::RemoteCreateInstance
  94. (
  95. REFIID /*riid*/,
  96. IUnknown** /*ppvObject*/
  97. )
  98. {
  99. ExpectedExpr((!m_fZombied));
  100. ATLTRACENOTIMPL(_T("RemoteCreateInstance"));
  101. }
  102. STDMETHODIMP CDHTMLEdProtocolInfo::LockServer(BOOL /*fLock*/)
  103. {
  104. ExpectedExpr((!m_fZombied));
  105. ATLTRACE(_T("CDHTMLEdProtocolInfo::LockServer\n"));
  106. return NOERROR;
  107. }
  108. STDMETHODIMP CDHTMLEdProtocolInfo::RemoteLockServer(BOOL /*fLock*/)
  109. {
  110. ExpectedExpr((!m_fZombied));
  111. ATLTRACENOTIMPL(_T("RemoteLockServer"));
  112. }
  113. //////////////////////////////////////////////////////////////////////////////
  114. //
  115. // IInternetProtocolInfo Implementation
  116. //
  117. // Override the BaseURL
  118. //
  119. STDMETHODIMP CDHTMLEdProtocolInfo::CombineUrl
  120. (
  121. LPCWSTR pwzBaseURL,
  122. LPCWSTR pwzRelativeURL,
  123. DWORD /*dwFlags*/,
  124. LPWSTR pwzResult,
  125. DWORD cchResult,
  126. DWORD * pcchResult,
  127. DWORD /*dwReserved*/
  128. )
  129. {
  130. _ASSERTE ( m_pProxyFrame );
  131. CComBSTR bstrBaseURL;
  132. #ifdef LATE_BIND_URLMON_WININET
  133. PFNCoInternetCombineUrl pfnCoInternetCombineUrl = m_pProxyFrame->m_pfnCoInternetCombineUrl;
  134. #endif // LATE_BIND_URLMON_WININET
  135. ExpectedExpr((!m_fZombied));
  136. InitParam(pcchResult);
  137. IfNullGo(pwzBaseURL);
  138. IfNullGo(pwzRelativeURL);
  139. IfNullGo(pwzResult);
  140. IfNullGo(pcchResult);
  141. ATLTRACE(_T("CDHTMLEdProtocolInfo::CombineUrl(%ls,%ls)\n"), pwzBaseURL, pwzRelativeURL);
  142. HRESULT hr;
  143. _ASSERTE ( m_pProxyFrame );
  144. IfNullGo(m_pProxyFrame);
  145. // GetBaseURL returns the value of the control's BaseURL property. The pwzBaseURL parameter is ignored.
  146. hr = m_pProxyFrame->GetBaseURL(bstrBaseURL);
  147. _IfFailGo(hr);
  148. // Handle case where return buffer is too small
  149. *pcchResult = bstrBaseURL.Length () + 1;
  150. if(*pcchResult > cchResult)
  151. {
  152. return S_FALSE;
  153. }
  154. // combine with our base url
  155. #ifdef LATE_BIND_URLMON_WININET
  156. _ASSERTE ( pfnCoInternetCombineUrl );
  157. hr = (*pfnCoInternetCombineUrl) ( bstrBaseURL, pwzRelativeURL, ICU_ESCAPE, pwzResult, cchResult, pcchResult, 0 );
  158. #else
  159. hr = CoInternetCombineUrl ( bstrBaseURL, pwzRelativeURL, ICU_ESCAPE, pwzResult, cchResult, pcchResult, 0 );
  160. #endif // LATE_BIND_URLMON_WININET
  161. IfFailGo(hr);
  162. if ( S_OK == hr )
  163. ATLTRACE(_T("CDHTMLEdProtocolInfo::CombinUrl to %ls\n"), pwzResult);
  164. return hr;
  165. ONERROR:
  166. return INET_E_DEFAULT_ACTION;
  167. }
  168. STDMETHODIMP CDHTMLEdProtocolInfo::CompareUrl
  169. (
  170. LPCWSTR /*pwzUrl1*/,
  171. LPCWSTR /*pwzUrl2*/,
  172. DWORD /*dwFlags*/
  173. )
  174. {
  175. ExpectedExpr((!m_fZombied));
  176. return E_NOTIMPL;
  177. }
  178. // Override the security URL. See comments at top of file.
  179. //
  180. STDMETHODIMP CDHTMLEdProtocolInfo::ParseUrl
  181. (
  182. LPCWSTR pwzURL,
  183. PARSEACTION ParseAction,
  184. DWORD /*dwFlags*/,
  185. LPWSTR pwzResult,
  186. DWORD cchResult,
  187. DWORD * pcchResult,
  188. DWORD /*dwReserved*/
  189. )
  190. {
  191. ExpectedExpr((!m_fZombied));
  192. IfNullRet(pwzURL);
  193. InitParam(pcchResult);
  194. ATLTRACE(_T("CDHTMLEdProtocolInfo::ParseUrl(%d, %ls)\n"), (int)ParseAction, pwzURL);
  195. HRESULT hr;
  196. switch(ParseAction)
  197. {
  198. case PARSE_SECURITY_URL:
  199. {
  200. _ASSERTE(m_pProxyFrame != NULL);
  201. if(m_pProxyFrame != NULL)
  202. {
  203. CComBSTR bstrSecurityURL;
  204. hr = m_pProxyFrame->GetSecurityURL(bstrSecurityURL);
  205. if(SUCCEEDED(hr))
  206. {
  207. // set out param
  208. *pcchResult = bstrSecurityURL.Length () + 1;
  209. if(*pcchResult <= cchResult)
  210. {
  211. // copy result
  212. wcscpy(pwzResult, bstrSecurityURL);
  213. ATLTRACE(_T("CDHTMLEdProtocolInfo::ParseUrl(%ls)\n"), pwzResult);
  214. return NOERROR;
  215. }
  216. else
  217. return S_FALSE; // buffer too small
  218. }
  219. }
  220. }
  221. break;
  222. case PARSE_CANONICALIZE:
  223. case PARSE_FRIENDLY:
  224. case PARSE_DOCUMENT:
  225. case PARSE_PATH_FROM_URL:
  226. case PARSE_URL_FROM_PATH:
  227. case PARSE_ROOTDOCUMENT:
  228. case PARSE_ANCHOR:
  229. case PARSE_ENCODE:
  230. case PARSE_DECODE:
  231. case PARSE_MIME:
  232. case PARSE_SERVER:
  233. case PARSE_SCHEMA:
  234. case PARSE_SITE:
  235. case PARSE_DOMAIN:
  236. case PARSE_LOCATION:
  237. case PARSE_SECURITY_DOMAIN:
  238. default:
  239. return INET_E_DEFAULT_ACTION;
  240. }
  241. return INET_E_DEFAULT_ACTION;
  242. }
  243. STDMETHODIMP CDHTMLEdProtocolInfo::QueryInfo
  244. (
  245. LPCWSTR /*pwzURL*/,
  246. QUERYOPTION QueryOption,
  247. DWORD /*dwQueryFlags*/,
  248. LPVOID pBuffer,
  249. DWORD /*cbBuffer*/,
  250. DWORD * pcbBuf,
  251. DWORD /*dwReserved*/
  252. )
  253. {
  254. ExpectedExpr((!m_fZombied));
  255. InitParam(pcbBuf);
  256. IfNullRet(pBuffer);
  257. IfNullRet(pcbBuf);
  258. switch(QueryOption)
  259. {
  260. case QUERY_CONTENT_TYPE:
  261. case QUERY_EXPIRATION_DATE:
  262. case QUERY_TIME_OF_LAST_CHANGE:
  263. case QUERY_CONTENT_ENCODING:
  264. case QUERY_REFRESH:
  265. case QUERY_RECOMBINE:
  266. case QUERY_CAN_NAVIGATE:
  267. default:
  268. break;
  269. }
  270. return INET_E_DEFAULT_ACTION;
  271. }
  272. // This type of strong coupling should normally be avoided, but it was
  273. // fast, simple, and safe in this case.
  274. //
  275. STDMETHODIMP CDHTMLEdProtocolInfo::SetProxyFrame ( SIZE_T* vpProxyFrame )
  276. {
  277. m_pProxyFrame = (CProxyFrame*)vpProxyFrame;
  278. if ( NULL != m_piProtocolConIntf )
  279. {
  280. m_piProtocolConIntf->SetProxyFrame ( vpProxyFrame );
  281. }
  282. return S_OK;
  283. }
  284. STDMETHODIMP CDHTMLEdProtocol::SetProxyFrame ( SIZE_T* vpProxyFrame )
  285. {
  286. m_pProxyFrame = (CProxyFrame*)vpProxyFrame;
  287. return S_OK;
  288. }
  289. //////////////////////////////////////////////////////////////////////////////
  290. //
  291. // DHTMLEd Protocol Implementaion
  292. //
  293. CDHTMLEdProtocol::CDHTMLEdProtocol()
  294. {
  295. ATLTRACE(_T("CDHTMLEdProtocol::CDHTMLEdProtocol\n"));
  296. m_fZombied = FALSE;
  297. m_fAborted = FALSE;
  298. m_bscf = BSCF_FIRSTDATANOTIFICATION;
  299. m_pProxyFrame = NULL;
  300. }
  301. CDHTMLEdProtocol::~CDHTMLEdProtocol()
  302. {
  303. ATLTRACE(_T("CDHTMLEdProtocol::~CDHTMLEdProtocol\n"));
  304. Zombie();
  305. }
  306. void CDHTMLEdProtocol::Zombie()
  307. {
  308. m_fZombied = TRUE;
  309. m_srpSink.Release();
  310. m_srpBindInfo.Release();
  311. m_srpStream.Release();
  312. m_bstrBaseURL.Empty();
  313. }
  314. /*
  315. HRESULT ParseAndBind
  316. Description:
  317. Gets the stream from the control and begins returning data to IE.
  318. */
  319. HRESULT CDHTMLEdProtocol::ParseAndBind()
  320. {
  321. HRESULT hr;
  322. STATSTG sstg = {0};
  323. _ASSERTE(m_bstrBaseURL != NULL);
  324. _ASSERTE(m_srpStream == NULL);
  325. hr = m_pProxyFrame->GetFilteredStream(&m_srpStream);
  326. IfFailGo(hr);
  327. IfNullPtrGo(m_srpStream);
  328. // Read in size of the stream
  329. hr = m_srpStream->Stat(&sstg, STATFLAG_NONAME);
  330. IfFailGo(hr);
  331. // fall through
  332. ONERROR:
  333. if(!m_fAborted)
  334. {
  335. // Report Data to sink
  336. if(m_srpSink != NULL)
  337. {
  338. DWORD bscf = m_bscf | BSCF_DATAFULLYAVAILABLE | BSCF_LASTDATANOTIFICATION;
  339. // Specify mime / type as HTML
  340. m_srpSink->ReportProgress(BINDSTATUS_MIMETYPEAVAILABLE, L"text/html");
  341. // Report size of data
  342. ATLTRACE(_T("CDHTMLEdProtocol::ParseAndBind(%d bytes)\n"), sstg.cbSize.LowPart);
  343. m_srpSink->ReportData(bscf, sstg.cbSize.LowPart, sstg.cbSize.LowPart);
  344. // Report result should be called only when all data have been read by consumer
  345. // IE4 accepts ReportResult() here while IE5 does not. This is because IE4 queues
  346. // the report while IE5 executes it immediatetely, terminating the VID protocol.
  347. // See VID bug #18128 for additional details.
  348. //if(m_srpSink != NULL)
  349. //{
  350. // m_srpSink->ReportResult(hr, 0, 0); DO NOT DO THIS!
  351. //}
  352. }
  353. }
  354. return hr;
  355. }
  356. /*
  357. void ReportData
  358. Description:
  359. Report to sink data is fully available
  360. */
  361. void CDHTMLEdProtocol::ReportData(ULONG cb)
  362. {
  363. m_bscf |= BSCF_LASTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE;
  364. if(m_srpSink != NULL)
  365. {
  366. m_srpSink->ReportData(m_bscf, cb, cb);
  367. }
  368. }
  369. //////////////////////////////////////////////////////////////////////////////
  370. //
  371. // IInternetProtocol Implementation
  372. //
  373. STDMETHODIMP CDHTMLEdProtocol::LockRequest(DWORD /*dwOptions*/)
  374. {
  375. ExpectedExpr((!m_fZombied));
  376. return S_OK;
  377. }
  378. STDMETHODIMP CDHTMLEdProtocol::Read(void *pv, ULONG cb, ULONG *pcbRead)
  379. {
  380. ATLTRACE(_T("CDHTMLEdProtocol::Read(%ls) %d bytes\n"), m_bstrBaseURL ? m_bstrBaseURL : L"(null)", cb);
  381. if(m_fZombied)
  382. return S_FALSE;
  383. _ASSERTE(m_srpStream != NULL);
  384. if(m_srpStream == NULL)
  385. return INET_E_DOWNLOAD_FAILURE;
  386. HRESULT hr;
  387. hr = m_srpStream->Read(pv, cb, pcbRead);
  388. _ASSERTE(SUCCEEDED(hr));
  389. if(FAILED(hr))
  390. return INET_E_DOWNLOAD_FAILURE;
  391. ATLTRACE(_T("CDHTMLEdProtocol::Read returning hr=%08X %d bytes read\n"), ((*pcbRead) ? hr : S_FALSE), *pcbRead);
  392. if(*pcbRead)
  393. return hr;
  394. else
  395. {
  396. // Tell the sink that I am done reading.
  397. m_srpSink->ReportResult(S_FALSE, 0, 0);
  398. return S_FALSE;
  399. }
  400. }
  401. STDMETHODIMP CDHTMLEdProtocol::Seek
  402. (
  403. LARGE_INTEGER dlibMove,
  404. DWORD dwOrigin,
  405. ULARGE_INTEGER *plibNewPosition
  406. )
  407. {
  408. ATLTRACE(_T("CDHTMLEdProtocol::Seek(%ls)\n"), m_bstrBaseURL);
  409. ExpectedExpr((!m_fZombied));
  410. ExpectedPtr(m_srpStream);
  411. HRESULT hr;
  412. // Do the seek
  413. hr = m_srpStream->Seek(dlibMove, dwOrigin, plibNewPosition);
  414. IfFailRet(hr);
  415. return hr;
  416. }
  417. STDMETHODIMP CDHTMLEdProtocol::UnlockRequest()
  418. {
  419. return S_OK;
  420. }
  421. //////////////////////////////////////////////////////////////////////////////
  422. //
  423. // IInternetProtocolRoot Implementation
  424. //
  425. STDMETHODIMP CDHTMLEdProtocol::Start
  426. (
  427. LPCWSTR pwzURL,
  428. IInternetProtocolSink *pSink,
  429. IInternetBindInfo *pBindInfo,
  430. DWORD grfSTI,
  431. HANDLE_PTR /*dwReserved*/
  432. )
  433. {
  434. ATLTRACE(_T("CDHTMLEdProtocol::Start(%ls)\n"), pwzURL);
  435. _ASSERTE ( m_pProxyFrame );
  436. #ifdef LATE_BIND_URLMON_WININET
  437. PFNCoInternetParseUrl pfnCoInternetParseUrl = m_pProxyFrame->m_pfnCoInternetParseUrl;
  438. #endif // LATE_BIND_URLMON_WININET
  439. ExpectedExpr((!m_fZombied));
  440. IfNullRet(pwzURL);
  441. IfNullRet(pBindInfo);
  442. IfNullRet(pSink);
  443. HRESULT hr;
  444. WCHAR wch[INTERNET_MAX_URL_LENGTH];
  445. DWORD dwSize;
  446. _ASSERTE(m_srpSink == NULL);
  447. _ASSERTE(m_bstrBaseURL == NULL);
  448. if( !(grfSTI & PI_PARSE_URL))
  449. {
  450. m_srpSink.Release();
  451. m_srpSink = pSink;
  452. m_srpBindInfo.Release();
  453. m_srpBindInfo = pBindInfo;
  454. }
  455. m_bindinfo.cbSize = sizeof(BINDINFO);
  456. hr = pBindInfo->GetBindInfo(&m_grfBindF, &m_bindinfo);
  457. IfFailGo(hr);
  458. ATLTRACE(_T("CDHTMLEdProtocol::BINDF =%08X\n"), m_grfBindF);
  459. ATLTRACE(_T("CDHTMLEdProtocol::BindInfo.szExtraInfo =%ls\n"), m_bindinfo.szExtraInfo ? m_bindinfo.szExtraInfo : L"(null)");
  460. ATLTRACE(_T("CDHTMLEdProtocol::BindInfo.grfBindInfoF =%08X\n"), m_bindinfo.grfBindInfoF);
  461. ATLTRACE(_T("CDHTMLEdProtocol::BindInfo.dwBindVerb =%08X\n"), m_bindinfo.dwBindVerb);
  462. ATLTRACE(_T("CDHTMLEdProtocol::BindInfo.szCustomVerb =%ls\n"), m_bindinfo.szCustomVerb ? m_bindinfo.szCustomVerb : L"(null)");
  463. ATLTRACE(_T("CDHTMLEdProtocol::BindInfo.cbstgmedData =%08X\n"), m_bindinfo.cbstgmedData);
  464. ATLTRACE(_T("CDHTMLEdProtocol::BindInfo.dwOptions =%08X\n"), m_bindinfo.dwOptions);
  465. ATLTRACE(_T("CDHTMLEdProtocol::BindInfo.dwOptionsFlags =%08X\n"), m_bindinfo.dwOptionsFlags);
  466. ATLTRACE(_T("CDHTMLEdProtocol::BindInfo.dwCodePage =%08X\n"), m_bindinfo.dwCodePage);
  467. ATLTRACE(_T("CDHTMLEdProtocol::BindInfo.dwReserved =%08X\n"), m_bindinfo.dwReserved);
  468. //
  469. // First get the basic url. Unescape it first.
  470. //
  471. #ifdef LATE_BIND_URLMON_WININET
  472. _ASSERTE ( pfnCoInternetParseUrl );
  473. hr = (*pfnCoInternetParseUrl)( pwzURL, PARSE_ENCODE, 0, wch, dimensionof(wch), &dwSize, 0 );
  474. #else
  475. hr = CoInternetParseUrl ( pwzURL, PARSE_ENCODE, 0, wch, dimensionof(wch), &dwSize, 0 );
  476. #endif // LATE_BIND_URLMON_WININET
  477. IfFailGo(hr);
  478. m_bstrBaseURL = wch;
  479. IfNullPtrGo(m_bstrBaseURL.m_str);
  480. //
  481. // Now append any extra data if needed.
  482. //
  483. if (m_bindinfo.szExtraInfo)
  484. {
  485. m_bstrBaseURL.Append(m_bindinfo.szExtraInfo);
  486. IfNullPtrGo(m_bstrBaseURL.m_str);
  487. }
  488. m_grfSTI = grfSTI;
  489. //
  490. // If forced to go async, return E_PENDING now, and
  491. // perform binding when we get the Continue.
  492. //
  493. if (grfSTI & PI_FORCE_ASYNC)
  494. {
  495. PROTOCOLDATA protdata;
  496. hr = E_PENDING;
  497. protdata.grfFlags = PI_FORCE_ASYNC;
  498. protdata.dwState = BIND_ASYNC;
  499. protdata.pData = NULL;
  500. protdata.cbData = 0;
  501. m_srpSink->Switch(&protdata);
  502. }
  503. else
  504. {
  505. hr = ParseAndBind();
  506. IfFailGo(hr);
  507. }
  508. return hr;
  509. ONERROR:
  510. return hr;
  511. }
  512. STDMETHODIMP CDHTMLEdProtocol::Continue(PROTOCOLDATA *pStateInfoIn)
  513. {
  514. ATLTRACE(_T("CDHTMLEdProtocol::Continue(%ls)\n"), m_bstrBaseURL);
  515. ExpectedExpr((!m_fZombied));
  516. IfNullRet(pStateInfoIn);
  517. HRESULT hr = E_FAIL;
  518. _ASSERTE(pStateInfoIn->pData != NULL);
  519. _ASSERTE(pStateInfoIn->cbData != 0);
  520. _ASSERTE(pStateInfoIn->dwState == (DWORD) BIND_ASYNC);
  521. if(pStateInfoIn->dwState == BIND_ASYNC)
  522. {
  523. hr = ParseAndBind();
  524. }
  525. return hr;
  526. }
  527. STDMETHODIMP CDHTMLEdProtocol::Abort(HRESULT /*hrReason*/, DWORD /*dwOptions*/)
  528. {
  529. ATLTRACE(_T("CDHTMLEdProtocol::Abort(%ls)\n"), m_bstrBaseURL);
  530. ExpectedExpr((!m_fZombied));
  531. m_fAborted = TRUE;
  532. ExpectedPtr(m_srpSink);
  533. return m_srpSink->ReportResult(E_ABORT, 0, 0);
  534. }
  535. STDMETHODIMP CDHTMLEdProtocol::Terminate(DWORD dwOptions)
  536. {
  537. ATLTRACE(_T("CDHTMLEdProtocol::Terminate(%08X, %ls)\n"), dwOptions, m_bstrBaseURL);
  538. ExpectedExpr((!m_fZombied));
  539. if (m_bindinfo.stgmedData.tymed != TYMED_NULL)
  540. {
  541. ::ReleaseStgMedium(&(m_bindinfo.stgmedData));
  542. m_bindinfo.stgmedData.tymed = TYMED_NULL;
  543. }
  544. if (m_bindinfo.szExtraInfo)
  545. {
  546. ::CoTaskMemFree(m_bindinfo.szExtraInfo);
  547. m_bindinfo.szExtraInfo = NULL;
  548. }
  549. Zombie();
  550. return NOERROR;
  551. }
  552. STDMETHODIMP CDHTMLEdProtocol::Suspend()
  553. {
  554. ATLTRACE(_T("CDHTMLEdProtocol::Suspend(%ls)\n"), m_bstrBaseURL);
  555. ExpectedExpr((!m_fZombied));
  556. return E_NOTIMPL;
  557. }
  558. STDMETHODIMP CDHTMLEdProtocol::Resume()
  559. {
  560. ATLTRACE(_T("CDHTMLEdProtocol::Resume(%ls)\n"), m_bstrBaseURL);
  561. ExpectedExpr((!m_fZombied));
  562. return E_NOTIMPL;
  563. }
  564. /* end of file */