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.

707 lines
18 KiB

  1. //+--------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1992.
  5. //
  6. // File: wrap.cxx
  7. //
  8. // Contents: Wrapper implementations
  9. //
  10. // History: 22-Sep-92 DrewB Created
  11. //
  12. //---------------------------------------------------------------
  13. #include "headers.cxx"
  14. #pragma hdrstop
  15. #include <dfentry.hxx>
  16. // Retrieve interface pointer for possibly NULL objects
  17. #define SAFEI(obj) ((obj) ? (obj)->GetI() : NULL)
  18. //+--------------------------------------------------------------
  19. //
  20. // IStorage wrappers
  21. //
  22. // History: 23-Sep-92 DrewB Created
  23. //
  24. //---------------------------------------------------------------
  25. WStorage *WStorage::Wrap(IStorage *pistg)
  26. {
  27. WStorage *wstg;
  28. wstg = new WStorage(pistg);
  29. if (wstg == NULL)
  30. error(EXIT_OOM, "Unable to wrap IStorage\n");
  31. return wstg;
  32. }
  33. WStorage::WStorage(IStorage *pstg)
  34. {
  35. // Note: takes ownership of pstg
  36. _pstg = pstg;
  37. }
  38. WStorage::~WStorage(void)
  39. {
  40. if (_pstg)
  41. Release();
  42. }
  43. void WStorage::Unwrap(void)
  44. {
  45. delete this;
  46. }
  47. HRESULT WStorage::QueryInterface(REFIID riid, void **ppvObj)
  48. {
  49. out("IStorage %p::QueryInterface(riid, %p)", _pstg, ppvObj);
  50. return Result(_pstg->QueryInterface(riid, ppvObj));
  51. }
  52. ULONG WStorage::AddRef(void)
  53. {
  54. ULONG ul;
  55. ul = _pstg->AddRef();
  56. out("IStorage %p::AddRef() - %lu\n", _pstg, ul);
  57. return ul;
  58. }
  59. ULONG WStorage::Release(void)
  60. {
  61. ULONG ul;
  62. ul = _pstg->Release();
  63. out("IStorage %p::Release() - %lu\n", _pstg, ul);
  64. if (ul == 0)
  65. _pstg = NULL;
  66. return ul;
  67. }
  68. HRESULT WStorage::CreateStream(const OLECHAR * pwcsName,
  69. const DWORD grfMode,
  70. DWORD reserved1,
  71. DWORD reserved2,
  72. WStream **ppstm)
  73. {
  74. HRESULT hr;
  75. IStream *pistm;
  76. out("IStorage %p::CreateStream(%s, 0x%lX, %lu, %lu, %p)", _pstg,
  77. OlecsOut(pwcsName), grfMode, reserved1, reserved2, ppstm);
  78. hr = Result(_pstg->CreateStream(pwcsName, grfMode, reserved1,
  79. reserved2, &pistm));
  80. *ppstm = WStream::Wrap(pistm);
  81. return hr;
  82. }
  83. HRESULT WStorage::OpenStream(const OLECHAR * pwcsName,
  84. void *reserved1,
  85. const DWORD grfMode,
  86. DWORD reserved2,
  87. WStream **ppstm)
  88. {
  89. HRESULT hr;
  90. IStream *pistm;
  91. out("IStorage %p::OpenStream(%s, %p, 0x%lX, %lu, %p)", _pstg,
  92. OlecsOut(pwcsName), reserved1, grfMode, reserved2, ppstm);
  93. hr = Result(_pstg->OpenStream(pwcsName, reserved1, grfMode,
  94. reserved2, &pistm));
  95. *ppstm = WStream::Wrap(pistm);
  96. return hr;
  97. }
  98. HRESULT WStorage::CreateStorage(const OLECHAR * pwcsName,
  99. const DWORD grfMode,
  100. DWORD reserved1,
  101. DWORD reserved2,
  102. WStorage **ppstg)
  103. {
  104. HRESULT hr;
  105. IStorage *pistg;
  106. out("IStorage %p::CreateStorage(%s, 0x%lX, %lu, %lu, %p)", _pstg,
  107. OlecsOut(pwcsName), grfMode, reserved1, reserved2, ppstg);
  108. hr = Result(_pstg->CreateStorage(pwcsName, grfMode, reserved1,
  109. reserved2, &pistg));
  110. *ppstg = WStorage::Wrap(pistg);
  111. return hr;
  112. }
  113. HRESULT WStorage::OpenStorage(const OLECHAR * pwcsName,
  114. WStorage *pstgPriority,
  115. const DWORD grfMode,
  116. SNB snbExclude,
  117. DWORD reserved,
  118. WStorage **ppstg)
  119. {
  120. HRESULT hr;
  121. IStorage *pistg;
  122. out("IStorage %p::OpenStorage(%s, %p, 0x%lX, %p, %lu, %p)", _pstg,
  123. OlecsOut(pwcsName), SAFEI(pstgPriority), grfMode,
  124. snbExclude, reserved, ppstg);
  125. hr = Result(_pstg->OpenStorage(pwcsName, SAFEI(pstgPriority),
  126. grfMode, snbExclude,
  127. reserved, &pistg));
  128. *ppstg = WStorage::Wrap(pistg);
  129. return hr;
  130. }
  131. HRESULT WStorage::CopyTo(DWORD ciidExclude,
  132. IID *rgiidExclude,
  133. SNB snbExclude,
  134. WStorage *pstgDest)
  135. {
  136. out("IStorage %p::CopyTo(%lu, %p, %p, %p)", _pstg, ciidExclude,
  137. rgiidExclude, snbExclude, pstgDest->GetI());
  138. return Result(_pstg->CopyTo(ciidExclude, rgiidExclude, snbExclude,
  139. pstgDest->GetI()));
  140. }
  141. HRESULT WStorage::MoveElementTo(OLECHAR const FAR* lpszName,
  142. WStorage FAR *pstgDest,
  143. OLECHAR const FAR* lpszNewName,
  144. DWORD grfFlags)
  145. {
  146. out("IStorage %p::MoveElementTo(%p, %p, %p, %lu)", _pstg, lpszName,
  147. pstgDest->GetI(), lpszNewName, grfFlags);
  148. return Result(_pstg->MoveElementTo(lpszName, pstgDest->GetI(),
  149. lpszNewName, grfFlags));
  150. }
  151. HRESULT WStorage::Commit(const DWORD grfCommitFlags)
  152. {
  153. out("IStorage %p::Commit(0x%lX)", _pstg, grfCommitFlags);
  154. return Result(_pstg->Commit(grfCommitFlags));
  155. }
  156. HRESULT WStorage::Revert(void)
  157. {
  158. out("IStorage %p::Revert()", _pstg);
  159. return Result(_pstg->Revert());
  160. }
  161. HRESULT WStorage::EnumElements(DWORD reserved1,
  162. void *reserved2,
  163. DWORD reserved3,
  164. WEnumSTATSTG **ppenm)
  165. {
  166. HRESULT hr;
  167. IEnumSTATSTG *pienm;
  168. out("IStorage %p::EnumElements(%lu, %p, %lu, %p)", _pstg,
  169. reserved1, reserved2, reserved3, ppenm);
  170. hr = Result(_pstg->EnumElements(reserved1, reserved2, reserved3, &pienm));
  171. *ppenm = WEnumSTATSTG::Wrap(pienm);
  172. return hr;
  173. }
  174. HRESULT WStorage::DestroyElement(const OLECHAR * pwcsName)
  175. {
  176. out("IStorage %p::DestroyElement(%s)", _pstg, OlecsOut(pwcsName));
  177. return Result(_pstg->DestroyElement(pwcsName));
  178. }
  179. HRESULT WStorage::RenameElement(const OLECHAR * pwcsOldName,
  180. const OLECHAR * pwcsNewName)
  181. {
  182. out("IStorage %p::RenameElement(%s, %s)", _pstg, OlecsOut(pwcsOldName),
  183. OlecsOut(pwcsNewName));
  184. return Result(_pstg->RenameElement(pwcsOldName, pwcsNewName));
  185. }
  186. HRESULT WStorage::SetElementTimes(const OLECHAR *lpszName,
  187. FILETIME const *pctime,
  188. FILETIME const *patime,
  189. FILETIME const *pmtime)
  190. {
  191. out("IStorage %p::SetElementTimes(%s, %p, %p, %p)", _pstg,
  192. OlecsOut(lpszName), pctime, patime, pmtime);
  193. return Result(_pstg->SetElementTimes(lpszName, pctime, patime, pmtime));
  194. }
  195. HRESULT WStorage::SetClass(REFCLSID clsid)
  196. {
  197. out("IStorage %p::SetClass(%s)", _pstg, GuidText(&clsid));
  198. return Result(_pstg->SetClass(clsid));
  199. }
  200. HRESULT WStorage::SetStateBits(DWORD grfStateBits, DWORD grfMask)
  201. {
  202. out("IStorage %p::SetStateBits(0x%lX, 0x%lX)", _pstg, grfStateBits,
  203. grfMask);
  204. return Result(_pstg->SetStateBits(grfStateBits, grfMask));
  205. }
  206. HRESULT WStorage::Stat(STATSTG *pstatstg, DWORD grfStatFlag)
  207. {
  208. out("IStorage %p::Stat(%p, %lu)", _pstg, pstatstg, grfStatFlag);
  209. return Result(_pstg->Stat(pstatstg, grfStatFlag));
  210. }
  211. //+--------------------------------------------------------------
  212. //
  213. // IStream wrappers
  214. //
  215. // History: 23-Sep-92 DrewB Created
  216. //
  217. //---------------------------------------------------------------
  218. WStream *WStream::Wrap(IStream *pistm)
  219. {
  220. WStream *wstm;
  221. wstm = new WStream(pistm);
  222. if (wstm == NULL)
  223. error(EXIT_OOM, "Unable to wrap IStream\n");
  224. return wstm;
  225. }
  226. WStream::WStream(IStream *pstm)
  227. {
  228. // Note: takes ownership of pstm
  229. _pstm = pstm;
  230. }
  231. WStream::~WStream(void)
  232. {
  233. if (_pstm)
  234. Release();
  235. }
  236. void WStream::Unwrap(void)
  237. {
  238. delete this;
  239. }
  240. HRESULT WStream::QueryInterface(REFIID riid, void **ppvObj)
  241. {
  242. out("IStream %p::QueryInterface(riid, %p)", _pstm, ppvObj);
  243. return Result(_pstm->QueryInterface(riid, ppvObj));
  244. }
  245. ULONG WStream::AddRef(void)
  246. {
  247. ULONG ul;
  248. ul = _pstm->AddRef();
  249. out("IStream %p::AddRef() - %lu\n", _pstm, ul);
  250. return ul;
  251. }
  252. ULONG WStream::Release(void)
  253. {
  254. ULONG ul;
  255. ul = _pstm->Release();
  256. out("IStream %p::Release() - %lu\n", _pstm, ul);
  257. if (ul == 0)
  258. _pstm = NULL;
  259. return ul;
  260. }
  261. HRESULT WStream::Read(VOID *pv, ULONG cb, ULONG *pcbRead)
  262. {
  263. HRESULT hr;
  264. out("IStream %p::Read(%p, %lu, %p)", _pstm, pv, cb, pcbRead);
  265. hr = _pstm->Read(pv, cb, pcbRead);
  266. if (pcbRead)
  267. out(" - %lu bytes", *pcbRead);
  268. Result(hr);
  269. if (pcbRead && *pcbRead != cb && fExitOnFail)
  270. error(EXIT_BADSC, "Couldn't read data\n");
  271. return hr;
  272. }
  273. HRESULT WStream::Write(VOID *pv, ULONG cb, ULONG *pcbWritten)
  274. {
  275. HRESULT hr;
  276. out("IStream %p::Write(%p, %lu, %p)", _pstm, pv, cb, pcbWritten);
  277. hr = _pstm->Write(pv, cb, pcbWritten);
  278. if (pcbWritten)
  279. out(" - %lu bytes", *pcbWritten);
  280. Result(hr);
  281. if (pcbWritten && *pcbWritten != cb && fExitOnFail)
  282. error(EXIT_BADSC, "Couldn't write data\n");
  283. return hr;
  284. }
  285. HRESULT WStream::Seek(LONG dlibMove,
  286. DWORD dwOrigin,
  287. ULONG *plibNewPosition)
  288. {
  289. HRESULT hr;
  290. LARGE_INTEGER dlib;
  291. ULARGE_INTEGER plib;
  292. out("IStream %p::Seek(%ld, %lu, %p)", _pstm, dlibMove, dwOrigin,
  293. plibNewPosition);
  294. LISet32(dlib, dlibMove);
  295. hr = _pstm->Seek(dlib, dwOrigin, &plib);
  296. if (plibNewPosition)
  297. {
  298. *plibNewPosition = ULIGetLow(plib);
  299. out(" - ptr %lu", *plibNewPosition);
  300. }
  301. return Result(hr);
  302. }
  303. HRESULT WStream::SetSize(ULONG libNewSize)
  304. {
  305. ULARGE_INTEGER lib;
  306. out("IStream %p::SetSize(%lu)", _pstm, libNewSize);
  307. ULISet32(lib, libNewSize);
  308. return Result(_pstm->SetSize(lib));
  309. }
  310. HRESULT WStream::Commit(const DWORD dwFlags)
  311. {
  312. out("IStream %p:Commit(%lu)", _pstm, dwFlags);
  313. return Result(_pstm->Commit(dwFlags));
  314. }
  315. HRESULT WStream::CopyTo(WStream *pstm,
  316. ULONG cb,
  317. ULONG *pcbRead,
  318. ULONG *pcbWritten)
  319. {
  320. ULARGE_INTEGER lcb, pcbr, pcbw;
  321. HRESULT hr;
  322. out("IStream %p::CopyTo(%p, %lu, %p, %p)", _pstm, pstm->GetI(), cb,
  323. pcbRead, pcbWritten);
  324. ULISet32(lcb, cb);
  325. hr = Result(_pstm->CopyTo(pstm->GetI(), lcb, &pcbr, &pcbw));
  326. if (pcbRead)
  327. *pcbRead = ULIGetLow(pcbr);
  328. if (pcbWritten)
  329. *pcbWritten = ULIGetLow(pcbw);
  330. return hr;
  331. }
  332. HRESULT WStream::Stat(STATSTG *pstatstg, DWORD grfStatFlag)
  333. {
  334. out("IStream %p::Stat(%p, %lu)", _pstm, pstatstg, grfStatFlag);
  335. return Result(_pstm->Stat(pstatstg, grfStatFlag));
  336. }
  337. HRESULT WStream::Clone(WStream * *ppstm)
  338. {
  339. HRESULT hr;
  340. IStream *pistm;
  341. out("IStream %p::Clone(%p)", _pstm, ppstm);
  342. hr = Result(_pstm->Clone(&pistm));
  343. *ppstm = WStream::Wrap(pistm);
  344. return hr;
  345. }
  346. //+--------------------------------------------------------------
  347. //
  348. // IEnumSTATSTG wrappers
  349. //
  350. // History: 24-Sep-92 DrewB Created
  351. //
  352. //---------------------------------------------------------------
  353. WEnumSTATSTG *WEnumSTATSTG::Wrap(IEnumSTATSTG *pienm)
  354. {
  355. WEnumSTATSTG *wenm;
  356. wenm = new WEnumSTATSTG(pienm);
  357. if (wenm == NULL)
  358. error(EXIT_OOM, "Unable to wrap IEnumSTATSTG\n");
  359. return wenm;
  360. }
  361. WEnumSTATSTG::WEnumSTATSTG(IEnumSTATSTG *penm)
  362. {
  363. // Note: takes ownership of penm
  364. _penm = penm;
  365. }
  366. WEnumSTATSTG::~WEnumSTATSTG(void)
  367. {
  368. if (_penm)
  369. Release();
  370. }
  371. void WEnumSTATSTG::Unwrap(void)
  372. {
  373. delete this;
  374. }
  375. HRESULT WEnumSTATSTG::QueryInterface(REFIID riid, void **ppvObj)
  376. {
  377. out("IEnumSTATSTG %p::QueryInterface(riid, %p)", _penm, ppvObj);
  378. return Result(_penm->QueryInterface(riid, ppvObj));
  379. }
  380. ULONG WEnumSTATSTG::AddRef(void)
  381. {
  382. ULONG ul;
  383. ul = _penm->AddRef();
  384. out("IEnumSTATSTG %p::AddRef() - %lu\n", _penm, ul);
  385. return ul;
  386. }
  387. ULONG WEnumSTATSTG::Release(void)
  388. {
  389. ULONG ul;
  390. ul = _penm->Release();
  391. out("IEnumSTATSTG %p::Release() - %lu\n", _penm, ul);
  392. if (ul == 0)
  393. _penm = NULL;
  394. return ul;
  395. }
  396. HRESULT WEnumSTATSTG::Next(ULONG celt, STATSTG rgelt[], ULONG *pceltFetched)
  397. {
  398. out("IEnumSTATSTG %p::Next(%lu, rgelt, %p)", _penm, celt, pceltFetched);
  399. return Result(_penm->Next(celt, rgelt, pceltFetched));
  400. }
  401. HRESULT WEnumSTATSTG::Skip(ULONG celt)
  402. {
  403. out("IEnumSTATSTG %p::Skip(%lu)", _penm, celt);
  404. return Result(_penm->Skip(celt));
  405. }
  406. HRESULT WEnumSTATSTG::Reset(void)
  407. {
  408. out("IEnumSTATSTG %p::Reset()", _penm);
  409. return Result(_penm->Reset());
  410. }
  411. HRESULT WEnumSTATSTG::Clone(WEnumSTATSTG **ppenm)
  412. {
  413. HRESULT hr;
  414. IEnumSTATSTG *pienm;
  415. out("IEnumSTATSTG %p::Clone(%p)", _penm, ppenm);
  416. hr = Result(_penm->Clone(&pienm));
  417. *ppenm = WEnumSTATSTG::Wrap(pienm);
  418. return hr;
  419. }
  420. //+--------------------------------------------------------------
  421. //
  422. // IMarshal wrappers
  423. //
  424. // History: 23-Sep-92 DrewB Created
  425. //
  426. //---------------------------------------------------------------
  427. WMarshal *WMarshal::Wrap(IMarshal *pimsh)
  428. {
  429. WMarshal *wmsh;
  430. wmsh = new WMarshal(pimsh);
  431. if (wmsh == NULL)
  432. error(EXIT_OOM, "Unable to wrap IMarshal\n");
  433. return wmsh;
  434. }
  435. WMarshal::WMarshal(IMarshal *pmsh)
  436. {
  437. // Note: takes ownership of pmsh
  438. _pmsh = pmsh;
  439. }
  440. WMarshal::~WMarshal(void)
  441. {
  442. if (_pmsh)
  443. Release();
  444. }
  445. void WMarshal::Unwrap(void)
  446. {
  447. delete this;
  448. }
  449. HRESULT WMarshal::QueryInterface(REFIID riid, void **ppvObj)
  450. {
  451. out("IMarshal %p::QueryInterface(riid, %p)", _pmsh, ppvObj);
  452. return Result(_pmsh->QueryInterface(riid, ppvObj));
  453. }
  454. ULONG WMarshal::AddRef(void)
  455. {
  456. ULONG ul;
  457. ul = _pmsh->AddRef();
  458. out("IMarshal %p::AddRef() - %lu\n", _pmsh, ul);
  459. return ul;
  460. }
  461. ULONG WMarshal::Release(void)
  462. {
  463. ULONG ul;
  464. ul = _pmsh->Release();
  465. out("IMarshal %p::Release() - %lu\n", _pmsh, ul);
  466. if (ul == 0)
  467. _pmsh = NULL;
  468. return ul;
  469. }
  470. HRESULT WMarshal::MarshalInterface(WStream * pStm,
  471. REFIID riid,
  472. LPVOID pv,
  473. DWORD dwDestContext,
  474. LPVOID pvDestContext,
  475. DWORD mshlflags)
  476. {
  477. out("IMarshal %p::MarshalInterface(%p, riid, %p, %lu, %lu, %lu)",
  478. _pmsh, pStm->GetI(), pv, dwDestContext, pvDestContext, mshlflags);
  479. return Result(_pmsh->MarshalInterface(pStm->GetI(), riid, pv,
  480. #ifdef OLDMARSHAL
  481. dwDestContext
  482. #ifdef NEWMARSHAL
  483. , mshlflags
  484. #endif
  485. ));
  486. #else
  487. dwDestContext,
  488. pvDestContext,
  489. mshlflags));
  490. #endif
  491. }
  492. //+--------------------------------------------------------------
  493. //
  494. // Root level wrappers
  495. //
  496. // History: 23-Sep-92 DrewB Created
  497. //
  498. //---------------------------------------------------------------
  499. HRESULT WStgCreateDocfile(const OLECHAR * pwcsName,
  500. const DWORD grfMode,
  501. DWORD reserved,
  502. WStorage * *ppstgOpen)
  503. {
  504. HRESULT hr;
  505. IStorage *pistg;
  506. #ifndef _CAIRO_
  507. out("StgCreateDocfile(%s, 0x%lX, %lu, %p)", OlecsOut(pwcsName), grfMode,
  508. reserved, ppstgOpen);
  509. hr = Result(StgCreateDocfile(pwcsName, grfMode,
  510. reserved, &pistg));
  511. #else ELSE == 300
  512. out("StgCreateStorage(%s, 0x%lX, %lu, %p)", OlecsOut(pwcsName), grfMode,
  513. reserved, ppstgOpen);
  514. hr = Result(StgCreateStorage(pwcsName, grfMode,
  515. STGFMT_DOCUMENT,
  516. (LPSECURITY_ATTRIBUTES)reserved, &pistg));
  517. #endif
  518. *ppstgOpen = WStorage::Wrap(pistg);
  519. return hr;
  520. }
  521. HRESULT WStgCreateDocfileOnILockBytes(ILockBytes *plkbyt,
  522. const DWORD grfMode,
  523. DWORD reserved,
  524. WStorage * *ppstgOpen)
  525. {
  526. HRESULT hr;
  527. IStorage *pistg;
  528. out("StgCreateDocfileOnILockBytes(%p, 0x%lX, %lu, %p)",
  529. plkbyt, grfMode, reserved, ppstgOpen);
  530. hr = Result(StgCreateDocfileOnILockBytes(plkbyt, grfMode,
  531. reserved, &pistg));
  532. *ppstgOpen = WStorage::Wrap(pistg);
  533. return hr;
  534. }
  535. HRESULT WStgOpenStorage(const OLECHAR * pwcsName,
  536. WStorage *pstgPriority,
  537. const DWORD grfMode,
  538. SNB snbExclude,
  539. DWORD reserved,
  540. WStorage * *ppstgOpen)
  541. {
  542. HRESULT hr;
  543. IStorage *pistg;
  544. out("StgOpenStorage(%s, %p, 0x%lX, %p, %lu, %p)", OlecsOut(pwcsName),
  545. SAFEI(pstgPriority), grfMode, snbExclude, reserved, ppstgOpen);
  546. hr = Result(StgOpenStorage(pwcsName, SAFEI(pstgPriority), grfMode,
  547. snbExclude,
  548. reserved, &pistg));
  549. *ppstgOpen = WStorage::Wrap(pistg);
  550. return hr;
  551. }
  552. HRESULT WStgOpenStorageOnILockBytes(ILockBytes *plkbyt,
  553. WStorage *pstgPriority,
  554. const DWORD grfMode,
  555. SNB snbExclude,
  556. DWORD reserved,
  557. WStorage * *ppstgOpen)
  558. {
  559. HRESULT hr;
  560. IStorage *pistg;
  561. out("StgOpenStorageOnILockBytes(%p, %p, 0x%lX, %p, %lu, %p)",
  562. plkbyt, SAFEI(pstgPriority), grfMode, snbExclude, reserved,
  563. ppstgOpen);
  564. hr = Result(StgOpenStorageOnILockBytes(plkbyt, SAFEI(pstgPriority),
  565. grfMode, snbExclude, reserved,
  566. &pistg));
  567. *ppstgOpen = WStorage::Wrap(pistg);
  568. return hr;
  569. }
  570. HRESULT WStgIsStorageFile(const OLECHAR * pwcsName)
  571. {
  572. out("StgIsStorageFile(%s)", OlecsOut(pwcsName));
  573. return Result(StgIsStorageFile(pwcsName));
  574. }
  575. HRESULT WStgIsStorageILockBytes(ILockBytes * plkbyt)
  576. {
  577. out("StgIsStorageILockBytes(%p)", plkbyt);
  578. return Result(StgIsStorageILockBytes(plkbyt));
  579. }
  580. HRESULT WCoMarshalInterface(WStream *pStm,
  581. REFIID iid,
  582. IUnknown *pUnk,
  583. DWORD dwDestContext,
  584. LPVOID pvDestContext,
  585. DWORD mshlflags)
  586. {
  587. out("CoMarshalInterface(%p, iid, %p, %lu, %p, %lX)", pStm->GetI(),
  588. pUnk, dwDestContext, pvDestContext, mshlflags);
  589. #ifdef OLDMARSHAL
  590. return Result(CoMarshalInterface(pStm->GetI(), iid, pUnk, dwDestContext,
  591. mshlflags));
  592. #else
  593. return Result(CoMarshalInterface(pStm->GetI(), iid, pUnk, dwDestContext,
  594. pvDestContext, mshlflags));
  595. #endif
  596. }
  597. HRESULT WCoUnmarshalInterface(WStream *pStm,
  598. REFIID riid,
  599. LPVOID *ppv)
  600. {
  601. out("CoUnmarshalInterface(%p, iid, %p)", pStm->GetI(), ppv);
  602. return Result(CoUnmarshalInterface(pStm->GetI(), riid, ppv));
  603. }