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.

931 lines
22 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1995
  5. //
  6. // File: dmoniker.cxx
  7. //
  8. // Contents: Interpret a moniker object
  9. //
  10. // Functions: monikersHelp
  11. // displayMonikers
  12. //
  13. //
  14. // History: 06-01-95 BruceMa Created
  15. //
  16. //
  17. //--------------------------------------------------------------------------
  18. #include <ole2int.h>
  19. #include <windows.h>
  20. #include "ole.h"
  21. #include "dmoniker.h"
  22. static void displayFileMoniker(HANDLE hProcess,
  23. PNTSD_EXTENSION_APIS lpExtensionApis,
  24. ULONG pMoniker);
  25. static void displayFileMonikerCk(HANDLE hProcess,
  26. PNTSD_EXTENSION_APIS lpExtensionApis,
  27. ULONG pMoniker);
  28. static void displayItemMoniker(HANDLE hProcess,
  29. PNTSD_EXTENSION_APIS lpExtensionApis,
  30. ULONG pMoniker);
  31. static void displayItemMonikerCk(HANDLE hProcess,
  32. PNTSD_EXTENSION_APIS lpExtensionApis,
  33. ULONG pMoniker);
  34. static void displayCompositeMoniker(HANDLE hProcess,
  35. PNTSD_EXTENSION_APIS lpExtensionApis,
  36. ULONG pMoniker);
  37. static void displayCompositeMonikerCk(HANDLE hProcess,
  38. PNTSD_EXTENSION_APIS lpExtensionApis,
  39. ULONG pMoniker);
  40. static void displayPointerMoniker(HANDLE hProcess,
  41. PNTSD_EXTENSION_APIS lpExtensionApis,
  42. ULONG pMoniker);
  43. static void displayPointerMonikerCk(HANDLE hProcess,
  44. PNTSD_EXTENSION_APIS lpExtensionApis,
  45. ULONG pMoniker);
  46. static void displayAntiMoniker(HANDLE hProcess,
  47. PNTSD_EXTENSION_APIS lpExtensionApis,
  48. ULONG pMoniker);
  49. static void displayAntiMonikerCk(HANDLE hProcess,
  50. PNTSD_EXTENSION_APIS lpExtensionApis,
  51. ULONG pMoniker);
  52. static enum mnkType findMnkType(HANDLE hProcess,
  53. PNTSD_EXTENSION_APIS lpExtensionApis,
  54. ULONG pMoniker);
  55. extern BOOL fInScm;
  56. static BOOL fRetail;
  57. //+-------------------------------------------------------------------------
  58. //
  59. // Function: monikerHelp
  60. //
  61. // Synopsis: Display a menu for the command 'mk'
  62. //
  63. // Arguments: -
  64. //
  65. // Returns: -
  66. //
  67. // History: 07-Mar-95 BruceMa Created
  68. //
  69. //--------------------------------------------------------------------------
  70. void monikerHelp(PNTSD_EXTENSION_APIS lpExtensionApis)
  71. {
  72. Printf("mk addr - Interpret addr as a moniker\n");
  73. }
  74. //+-------------------------------------------------------------------------
  75. //
  76. // Function: displayMoniker
  77. //
  78. // Synopsis: Display a moniker
  79. //
  80. // Arguments: [hProcess] - Handle of this process
  81. // [lpExtensionApis] - Table of extension functions
  82. //
  83. // Returns: -
  84. //
  85. // History: 07-Mar-95 BruceMa Created
  86. //
  87. //--------------------------------------------------------------------------
  88. BOOL displayMoniker(HANDLE hProcess,
  89. PNTSD_EXTENSION_APIS lpExtensionApis,
  90. ULONG pMoniker)
  91. {
  92. ULONG pAdr;
  93. enum mnkType mType;
  94. // Determine if this is checked or retail ole
  95. if (fInScm)
  96. {
  97. pAdr = GetExpression("scm!_CairoleInfoLevel");
  98. }
  99. else
  100. {
  101. pAdr = GetExpression("ole32!_CairoleInfoLevel");
  102. }
  103. fRetail = pAdr == NULL ? TRUE : FALSE;
  104. mType = findMnkType(hProcess, lpExtensionApis, pMoniker);
  105. switch (mType)
  106. {
  107. case NOMNK:
  108. return FALSE;
  109. case FILEMNK:
  110. if (fRetail)
  111. {
  112. displayFileMoniker(hProcess, lpExtensionApis, pMoniker);
  113. }
  114. else
  115. {
  116. displayFileMonikerCk(hProcess, lpExtensionApis, pMoniker);
  117. }
  118. return TRUE;
  119. case POINTERMNK:
  120. if (fRetail)
  121. {
  122. displayPointerMoniker(hProcess, lpExtensionApis, pMoniker);
  123. }
  124. else
  125. {
  126. displayPointerMonikerCk(hProcess, lpExtensionApis, pMoniker);
  127. }
  128. return TRUE;
  129. case ITEMMNK:
  130. if (fRetail)
  131. {
  132. displayItemMoniker(hProcess, lpExtensionApis, pMoniker);
  133. }
  134. else
  135. {
  136. displayItemMonikerCk(hProcess, lpExtensionApis, pMoniker);
  137. }
  138. return TRUE;
  139. case ANTIMNK:
  140. if (fRetail)
  141. {
  142. displayAntiMoniker(hProcess, lpExtensionApis, pMoniker);
  143. }
  144. else
  145. {
  146. displayAntiMonikerCk(hProcess, lpExtensionApis, pMoniker);
  147. }
  148. return TRUE;
  149. case COMPOSITEMNK:
  150. if (fRetail)
  151. {
  152. displayCompositeMoniker(hProcess, lpExtensionApis, pMoniker);
  153. }
  154. else
  155. {
  156. displayCompositeMonikerCk(hProcess, lpExtensionApis, pMoniker);
  157. }
  158. return TRUE;
  159. }
  160. return FALSE;
  161. }
  162. //+-------------------------------------------------------------------------
  163. //
  164. // Function: displayFileMoniker
  165. //
  166. // Synopsis: Display a retail file moniker
  167. //
  168. // Arguments: [ULONG] - The moniker
  169. //
  170. // Returns: -
  171. //
  172. // History: 07-Mar-95 BruceMa Created
  173. //
  174. //--------------------------------------------------------------------------
  175. static void displayFileMoniker(HANDLE hProcess,
  176. PNTSD_EXTENSION_APIS lpExtensionApis,
  177. ULONG pMoniker)
  178. {
  179. SFileMonikerCk file;
  180. WCHAR *pwszPath;
  181. // Fetch the moniker
  182. ReadMem(&file, pMoniker, sizeof(SFileMoniker));
  183. // It's a file moniker
  184. Printf("File Moniker\n");
  185. // The current references
  186. Printf("refs = %d\n", file.m_refs);
  187. // The path
  188. pwszPath = (WCHAR *) OleAlloc(2 * (file.m_ccPath + 1));
  189. ReadMem(pwszPath, file.m_szPath, 2 * (file.m_ccPath + 1));
  190. Printf("%ws", pwszPath);
  191. OleFree(pwszPath);
  192. if (file.m_fHashValueValid)
  193. {
  194. Printf(" (%d)\n", file.m_dwHashValue);
  195. }
  196. else
  197. {
  198. Printf("\n");
  199. }
  200. // The version
  201. if (file.m_ole1 == ole1)
  202. {
  203. Printf("ole1\n");
  204. }
  205. // The anti count (if any)
  206. if (file.m_cAnti)
  207. {
  208. Printf("CAnti count = %d\n", file.m_cAnti);
  209. }
  210. // The extents (if any)
  211. if (file.m_ExtentList.m_cbMonikerExtents)
  212. {
  213. BYTE *pExtent;
  214. BYTE *pEnd ;
  215. ULONG cbExtentBytes;
  216. // A header
  217. Printf("Extents:\n");
  218. // Read all the extents
  219. pExtent = (BYTE *) OleAlloc(file.m_ExtentList.m_cbMonikerExtents);
  220. ReadMem(pExtent, file.m_ExtentList.m_pchMonikerExtents,
  221. file.m_ExtentList.m_cbMonikerExtents);
  222. pEnd = pExtent;
  223. // Do over the extents
  224. while (pExtent < pEnd)
  225. {
  226. // Fetch length
  227. cbExtentBytes = (*pExtent++ << 16) | *pExtent++;
  228. // Fetch and display key
  229. switch (*pExtent++)
  230. {
  231. case mnk_MAC:
  232. Printf("mnk_MAC ");
  233. break;
  234. case mnk_DFS:
  235. Printf("mnk_DFS ");
  236. break;
  237. case mnk_UNICODE:
  238. Printf("mnk_UNICODE ");
  239. break;
  240. case mnk_MacPathName:
  241. Printf("mnk_MacPathName ");
  242. break;
  243. case mnk_ShellLink:
  244. Printf("mnk_ShellLink ");
  245. break;
  246. default:
  247. Printf("%15d ");
  248. }
  249. // Display the extent in hexadecimal
  250. UINT k = 0;
  251. while (cbExtentBytes--)
  252. {
  253. Printf("%2x ", *pExtent++);
  254. k++;
  255. if (k % 16 == 0)
  256. {
  257. Printf("\n ");
  258. k = 0;
  259. }
  260. }
  261. if (k % 8 != 0)
  262. {
  263. Printf("\n");
  264. }
  265. }
  266. // Release the allocated extent buffer
  267. OleFree(pExtent);
  268. }
  269. }
  270. //+-------------------------------------------------------------------------
  271. //
  272. // Function: displayFileMonikerCk
  273. //
  274. // Synopsis: Display a checked file moniker
  275. //
  276. // Arguments: [ULONG] - The moniker
  277. //
  278. // Returns: -
  279. //
  280. // History: 07-Mar-95 BruceMa Created
  281. //
  282. //--------------------------------------------------------------------------
  283. static void displayFileMonikerCk(HANDLE hProcess,
  284. PNTSD_EXTENSION_APIS lpExtensionApis,
  285. ULONG pMoniker)
  286. {
  287. SFileMonikerCk file;
  288. WCHAR *pwszPath;
  289. // Fetch the moniker
  290. ReadMem(&file, pMoniker, sizeof(SFileMonikerCk));
  291. // It's a file moniker
  292. Printf("File Moniker\n");
  293. // The current references
  294. Printf("refs = %d\n", file.m_refs);
  295. // The path
  296. pwszPath = (WCHAR *) OleAlloc(2 * (file.m_ccPath + 1));
  297. ReadMem(pwszPath, file.m_szPath, 2 * (file.m_ccPath + 1));
  298. Printf("%ws", pwszPath);
  299. OleFree(pwszPath);
  300. if (file.m_fHashValueValid)
  301. {
  302. Printf(" (%d)\n", file.m_dwHashValue);
  303. }
  304. else
  305. {
  306. Printf("\n");
  307. }
  308. // The version
  309. if (file.m_ole1 == ole1)
  310. {
  311. Printf("ole1\n");
  312. }
  313. // The anti count (if any)
  314. if (file.m_cAnti)
  315. {
  316. Printf("CAnti count = %d\n", file.m_cAnti);
  317. }
  318. // The extents (if any)
  319. if (file.m_ExtentList.m_cbMonikerExtents)
  320. {
  321. BYTE *pExtent;
  322. BYTE *pEnd ;
  323. ULONG cbExtentBytes;
  324. // A header
  325. Printf("Extents:\n");
  326. // Read all the extents
  327. pExtent = (BYTE *) OleAlloc(file.m_ExtentList.m_cbMonikerExtents);
  328. ReadMem(pExtent, file.m_ExtentList.m_pchMonikerExtents,
  329. file.m_ExtentList.m_cbMonikerExtents);
  330. pEnd = pExtent;
  331. // Do over the extents
  332. while (pExtent < pEnd)
  333. {
  334. // Fetch length
  335. cbExtentBytes = (*pExtent++ << 16) | *pExtent++;
  336. // Fetch and display key
  337. switch (*pExtent++)
  338. {
  339. case mnk_MAC:
  340. Printf("mnk_MAC ");
  341. break;
  342. case mnk_DFS:
  343. Printf("mnk_DFS ");
  344. break;
  345. case mnk_UNICODE:
  346. Printf("mnk_UNICODE ");
  347. break;
  348. case mnk_MacPathName:
  349. Printf("mnk_MacPathName ");
  350. break;
  351. case mnk_ShellLink:
  352. Printf("mnk_ShellLink ");
  353. break;
  354. default:
  355. Printf("%15d ");
  356. }
  357. // Display the extent in hexadecimal
  358. UINT k = 0;
  359. while (cbExtentBytes--)
  360. {
  361. Printf("%2x ", *pExtent++);
  362. k++;
  363. if (k % 16 == 0)
  364. {
  365. Printf("\n ");
  366. k = 0;
  367. }
  368. }
  369. if (k % 8 != 0)
  370. {
  371. Printf("\n");
  372. }
  373. }
  374. // Release the allocated extent buffer
  375. OleFree(pExtent);
  376. }
  377. }
  378. //+-------------------------------------------------------------------------
  379. //
  380. // Function: displayItemMoniker
  381. //
  382. // Synopsis: Display a retail item moniker
  383. //
  384. // Arguments: [ULONG] - The moniker
  385. //
  386. // Returns: -
  387. //
  388. // History: 07-Mar-95 BruceMa Created
  389. //
  390. //--------------------------------------------------------------------------
  391. static void displayItemMoniker(HANDLE hProcess,
  392. PNTSD_EXTENSION_APIS lpExtensionApis,
  393. ULONG pMoniker)
  394. {
  395. SItemMonikerCk item;
  396. WCHAR *pwszItem;
  397. WCHAR *pwszDelimiter;
  398. // Fetch the moniker
  399. ReadMem(&item, pMoniker, sizeof(SItemMoniker));
  400. // It's an item moniker
  401. Printf("Item Moniker\n");
  402. // The current references
  403. Printf("refs = %d\n", item.m_refs);
  404. // The delimiter plus item
  405. pwszDelimiter = (WCHAR *) OleAlloc(2 * (item.m_ccDelimiter + 1));
  406. ReadMem(pwszDelimiter, item.m_lpszDelimiter, 2 * (item.m_ccDelimiter + 1));
  407. pwszItem = (WCHAR *) OleAlloc(2 * (item.m_ccItem + 1));
  408. ReadMem(pwszItem, item.m_lpszItem, 2 * (item.m_ccItem + 1));
  409. Printf("item = %ws%ws\n", pwszDelimiter, pwszItem);
  410. OleFree(pwszItem);
  411. // The hash value
  412. if (item.m_fHashValueValid)
  413. {
  414. Printf("hash = %d\n", item.m_dwHashValue);
  415. }
  416. }
  417. //+-------------------------------------------------------------------------
  418. //
  419. // Function: displayItemMonikerCk
  420. //
  421. // Synopsis: Display a checked item moniker
  422. //
  423. // Arguments: [ULONG] - The moniker
  424. //
  425. // Returns: -
  426. //
  427. // History: 07-Mar-95 BruceMa Created
  428. //
  429. //--------------------------------------------------------------------------
  430. static void displayItemMonikerCk(HANDLE hProcess,
  431. PNTSD_EXTENSION_APIS lpExtensionApis,
  432. ULONG pMoniker)
  433. {
  434. SItemMonikerCk item;
  435. WCHAR *pwszItem;
  436. WCHAR *pwszDelimiter;
  437. // Fetch the moniker
  438. ReadMem(&item, pMoniker, sizeof(SItemMonikerCk));
  439. // It's an item moniker
  440. Printf("Item Moniker\n");
  441. // The current references
  442. Printf("refs = %d\n", item.m_refs);
  443. // The delimiter plus item
  444. pwszDelimiter = (WCHAR *) OleAlloc(2 * (item.m_ccDelimiter + 1));
  445. ReadMem(pwszDelimiter, item.m_lpszDelimiter, 2 * (item.m_ccDelimiter + 1));
  446. pwszItem = (WCHAR *) OleAlloc(2 * (item.m_ccItem + 1));
  447. ReadMem(pwszItem, item.m_lpszItem, 2 * (item.m_ccItem + 1));
  448. Printf("item = %ws%ws\n", pwszDelimiter, pwszItem);
  449. OleFree(pwszItem);
  450. // The hash value
  451. if (item.m_fHashValueValid)
  452. {
  453. Printf("hash = %d\n", item.m_dwHashValue);
  454. }
  455. }
  456. //+-------------------------------------------------------------------------
  457. //
  458. // Function: displayCompositeMoniker
  459. //
  460. // Synopsis: Display a retail composite moniker
  461. //
  462. // Arguments: [ULONG] - The moniker
  463. //
  464. // Returns: -
  465. //
  466. // History: 07-Mar-95 BruceMa Created
  467. //
  468. //--------------------------------------------------------------------------
  469. static void displayCompositeMoniker(HANDLE hProcess,
  470. PNTSD_EXTENSION_APIS lpExtensionApis,
  471. ULONG pMoniker)
  472. {
  473. SCompositeMonikerCk composite;
  474. // Fetch the moniker
  475. ReadMem(&composite, pMoniker, sizeof(SCompositeMoniker));
  476. // It's a composite moniker
  477. Printf("Composite Moniker\n");
  478. // The current references
  479. Printf("refs = %d\n", composite.m_refs);
  480. // Reduced?
  481. if (composite.m_fReduced)
  482. {
  483. Printf("reduced\n");
  484. }
  485. // The left component
  486. Printf("\nleft component\n");
  487. Printf("--------------\n");
  488. if (composite.m_pmkLeft)
  489. {
  490. displayMoniker(hProcess, lpExtensionApis,
  491. (ULONG) composite.m_pmkLeft);
  492. }
  493. else
  494. {
  495. Printf("NULL\n");
  496. }
  497. // The right component
  498. Printf("\nright component\n");
  499. Printf("---------------\n");
  500. if (composite.m_pmkRight)
  501. {
  502. displayMoniker(hProcess, lpExtensionApis,
  503. (ULONG) composite.m_pmkRight);
  504. }
  505. else
  506. {
  507. Printf("NULL\n");
  508. }
  509. }
  510. //+-------------------------------------------------------------------------
  511. //
  512. // Function: displayCompositeMonikerCk
  513. //
  514. // Synopsis: Display a checked composite moniker
  515. //
  516. // Arguments: [ULONG] - The moniker
  517. //
  518. // Returns: -
  519. //
  520. // History: 07-Mar-95 BruceMa Created
  521. //
  522. //--------------------------------------------------------------------------
  523. static void displayCompositeMonikerCk(HANDLE hProcess,
  524. PNTSD_EXTENSION_APIS lpExtensionApis,
  525. ULONG pMoniker)
  526. {
  527. SCompositeMonikerCk composite;
  528. // Fetch the moniker
  529. ReadMem(&composite, pMoniker, sizeof(SCompositeMonikerCk));
  530. // It's a composite moniker
  531. Printf("Composite Moniker\n");
  532. // The current references
  533. Printf("refs = %d\n", composite.m_refs);
  534. // Reduced?
  535. if (composite.m_fReduced)
  536. {
  537. Printf("reduced\n");
  538. }
  539. // The left component
  540. Printf("\nleft component\n");
  541. Printf("--------------\n");
  542. if (composite.m_pmkLeft)
  543. {
  544. displayMoniker(hProcess, lpExtensionApis,
  545. (ULONG) composite.m_pmkLeft);
  546. }
  547. else
  548. {
  549. Printf("NULL\n");
  550. }
  551. // The right component
  552. Printf("\nright component\n");
  553. Printf("---------------\n");
  554. if (composite.m_pmkRight)
  555. {
  556. displayMoniker(hProcess, lpExtensionApis,
  557. (ULONG) composite.m_pmkRight);
  558. }
  559. else
  560. {
  561. Printf("NULL\n");
  562. }
  563. }
  564. //+-------------------------------------------------------------------------
  565. //
  566. // Function: displayPointerMoniker
  567. //
  568. // Synopsis: Display a retail pointer moniker
  569. //
  570. // Arguments: [ULONG] - The moniker
  571. //
  572. // Returns: -
  573. //
  574. // History: 07-Mar-95 BruceMa Created
  575. //
  576. //--------------------------------------------------------------------------
  577. static void displayPointerMoniker(HANDLE hProcess,
  578. PNTSD_EXTENSION_APIS lpExtensionApis,
  579. ULONG pMoniker)
  580. {
  581. SPointerMoniker pointer;
  582. // Fetch the moniker
  583. ReadMem(&pointer, pMoniker, sizeof(SPointerMoniker));
  584. // It's a pointer moniker
  585. Printf("Pointer Moniker\n");
  586. // The current references
  587. Printf("refs = %d\n", pointer.m_refs);
  588. // The pointer
  589. Printf("IUnknown = %08x\n", pointer.m_pUnk);
  590. }
  591. //+-------------------------------------------------------------------------
  592. //
  593. // Function: displayPointerMonikerCk
  594. //
  595. // Synopsis: Display a checked pointer moniker
  596. //
  597. // Arguments: [ULONG] - The moniker
  598. //
  599. // Returns: -
  600. //
  601. // History: 07-Mar-95 BruceMa Created
  602. //
  603. //--------------------------------------------------------------------------
  604. static void displayPointerMonikerCk(HANDLE hProcess,
  605. PNTSD_EXTENSION_APIS lpExtensionApis,
  606. ULONG pMoniker)
  607. {
  608. SPointerMonikerCk pointer;
  609. // Fetch the moniker
  610. ReadMem(&pointer, pMoniker, sizeof(SPointerMonikerCk));
  611. // It's a pointer moniker
  612. Printf("Pointer Moniker\n");
  613. // The current references
  614. Printf("refs = %d\n", pointer.m_refs);
  615. // The pointer
  616. Printf("IUnknown = %08x\n", pointer.m_pUnk);
  617. }
  618. //+-------------------------------------------------------------------------
  619. //
  620. // Function: displayAntiMoniker
  621. //
  622. // Synopsis: Display a retail anti moniker
  623. //
  624. // Arguments: [ULONG] - The moniker
  625. //
  626. // Returns: -
  627. //
  628. // History: 07-Mar-95 BruceMa Created
  629. //
  630. //--------------------------------------------------------------------------
  631. static void displayAntiMoniker(HANDLE hProcess,
  632. PNTSD_EXTENSION_APIS lpExtensionApis,
  633. ULONG pMoniker)
  634. {
  635. SAntiMoniker anti;
  636. // Fetch the moniker
  637. ReadMem(&anti, pMoniker, sizeof(SAntiMoniker));
  638. // It's a pointer moniker
  639. Printf("Anti Moniker\n");
  640. // The current references
  641. Printf("refs = %d\n", anti.m_refs);
  642. // The count
  643. Printf("count = %d\n", anti.m_count);
  644. }
  645. //+-------------------------------------------------------------------------
  646. //
  647. // Function: displayAntiMonikerCk
  648. //
  649. // Synopsis: Display a checked anti moniker
  650. //
  651. // Arguments: [ULONG] - The moniker
  652. //
  653. // Returns: -
  654. //
  655. // History: 07-Mar-95 BruceMa Created
  656. //
  657. //--------------------------------------------------------------------------
  658. static void displayAntiMonikerCk(HANDLE hProcess,
  659. PNTSD_EXTENSION_APIS lpExtensionApis,
  660. ULONG pMoniker)
  661. {
  662. SAntiMonikerCk anti;
  663. // Fetch the moniker
  664. ReadMem(&anti, pMoniker, sizeof(SAntiMonikerCk));
  665. // It's a pointer moniker
  666. Printf("Anti Moniker\n");
  667. // The current references
  668. Printf("refs = %d\n", anti.m_refs);
  669. // The count
  670. Printf("count = %d\n", anti.m_count);
  671. }
  672. //+-------------------------------------------------------------------------
  673. //
  674. // Function: findMnkType
  675. //
  676. // Synopsis: Given a moniker, compute its type
  677. //
  678. // Arguments: [HANDLE] - process handle
  679. // [PNTSD_EXTENSION_APIS] Convenience routines
  680. // [ULONG] - The moniker
  681. //
  682. // Returns: -
  683. //
  684. // History: 07-Mar-95 BruceMa Created
  685. //
  686. //--------------------------------------------------------------------------
  687. static enum mnkType findMnkType(HANDLE hProcess,
  688. PNTSD_EXTENSION_APIS lpExtensionApis,
  689. ULONG pMoniker)
  690. {
  691. void *vtbl;
  692. char szSymbol[128];
  693. DWORD dwOffset;
  694. // Read the symbol for the first element in the first vtbl
  695. ReadMem(&vtbl, pMoniker, sizeof(ULONG));
  696. ReadMem(&vtbl, vtbl, sizeof(ULONG));
  697. szSymbol[0] = '\0';
  698. GetSymbol(vtbl, (UCHAR *) szSymbol, &dwOffset);
  699. // We better be looking at a QueryInterface on a moniker
  700. if (dwOffset != 0)
  701. {
  702. return NOMNK;
  703. }
  704. if (lstrcmp(szSymbol, "ole32!CFileMoniker__QueryInterface") == 0)
  705. {
  706. return FILEMNK;
  707. }
  708. else if (lstrcmp(szSymbol, "ole32!CItemMoniker__QueryInterface") == 0)
  709. {
  710. return ITEMMNK;
  711. }
  712. else if (lstrcmp(szSymbol, "ole32!CCompositeMoniker__QueryInterface") == 0)
  713. {
  714. return COMPOSITEMNK;
  715. }
  716. else if (lstrcmp(szSymbol, "ole32!CPointerMoniker__QueryInterface") == 0)
  717. {
  718. return POINTERMNK;
  719. }
  720. else if (lstrcmp(szSymbol, "ole32!CAntiMoniker__QueryInterface") == 0)
  721. {
  722. return ANTIMNK;
  723. }
  724. else
  725. {
  726. return NOMNK;
  727. }
  728. }