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.

100 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. comgoop.cpp
  5. Abstract:
  6. Wrapper to create the XML parser that emulates COM activation of the inproc server.
  7. Author:
  8. Michael J. Grier (MGrier) 23-Feb-2000
  9. Revision History:
  10. --*/
  11. #include "stdinc.h"
  12. #include <windows.h>
  13. #include <sxsp.h>
  14. #include <ole2.h>
  15. #include "xmlparser.hxx"
  16. BOOL
  17. SxspGetXMLParser(
  18. REFIID riid,
  19. PVOID *ppvObj
  20. )
  21. {
  22. BOOL fSuccess = FALSE;
  23. FN_TRACE_WIN32(fSuccess);
  24. XMLParser * pXMLParser = NULL;
  25. if (ppvObj != NULL)
  26. *ppvObj = NULL;
  27. PARAMETER_CHECK(ppvObj != NULL);
  28. IFALLOCFAILED_EXIT(pXMLParser = new XMLParser);
  29. IFCOMFAILED_EXIT(pXMLParser->QueryInterface(riid, ppvObj));
  30. pXMLParser = NULL;
  31. fSuccess = TRUE;
  32. Exit:
  33. FUSION_DELETE_SINGLETON(pXMLParser);
  34. return fSuccess;
  35. /*
  36. BOOL fSuccess = TRUE;
  37. HINSTANCE hMSXML = NULL;
  38. typedef HRESULT (__stdcall *PFNGETCLASSOBJECT)(const CLSID &rclsid, const IID &riid, void **ppv);
  39. PFNGETCLASSOBJECT pfnGetClassObject = NULL;
  40. IClassFactory *pIClassFactory = NULL;
  41. HRESULT hr;
  42. *ppvObj = NULL;
  43. hMSXML = LoadLibraryExW(L"MSXML.DLL", NULL, 0);
  44. if (hMSXML == NULL)
  45. {
  46. fSuccess = FALSE;
  47. goto Exit;
  48. }
  49. pfnGetClassObject = reinterpret_cast<PFNGETCLASSOBJECT>(::GetProcAddress(hMSXML, "DllGetClassObject"));
  50. if (pfnGetClassObject == NULL)
  51. {
  52. fSuccess = FALSE;
  53. goto Exit;
  54. }
  55. hr = (*pfnGetClassObject)(CLSID_XMLParser, IID_IClassFactory, (LPVOID *) &pIClassFactory);
  56. if (FAILED(hr))
  57. {
  58. ::FusionpSetLastErrorFromHRESULT(hr);
  59. fSuccess = FALSE;
  60. goto Exit;
  61. }
  62. hr = pIClassFactory->CreateInstance(NULL, riid, ppvObj);
  63. if (FAILED(hr))
  64. goto Exit;
  65. fSuccess = TRUE;
  66. Exit:
  67. if (pIClassFactory != NULL)
  68. pIClassFactory->Release();
  69. return fSuccess;
  70. */
  71. }