2 * PROJECT: ReactOS Applications
3 * LICENSE: LGPL - See COPYING in the top level directory
4 * FILE: base/applications/msconfig_new/xmldomparser.cpp
5 * PURPOSE: XML DOM Parser
6 * COPYRIGHT: Copyright 2011-2012 Hermes BELUSCA - MAITO <hermes.belusca@sfr.fr>
13 * MSXML Version Header File Name Library File Name DLL File Name
14 * =======================================================================
15 * 2.x msxml.h msxml.lib msxml2.dll
16 * 3.0 msxml2.h msxml2.lib msxml3.dll
17 * 4.0 msxml2.h msxml2.lib msxml4.dll
18 * 6.0 msxml6.h msxml6.lib msxml6.dll
20 // #pragma comment(lib, "msxml2.lib")
22 #define _COM_NO_STANDARD_GUIDS_
24 // #include <comutil.h> // comdef.h includes comutil.h
29 // About macro while(0) trick : see http://cnicholson.net/2009/03/stupid-c-tricks-dowhile0-and-c4127/
31 // Macro that releases a COM object if not NULL.
32 #define SAFE_RELEASE(p) \
33 do { if ((p)) { (p)->Release(); (p) = NULL; } } while (0)
36 // IID_PPV_ARGS(ppType)
37 // ppType is the variable of type IType that will be filled
39 // RESULTS in: IID_IType, ppvType
40 // will create a compiler error if wrong level of indirection is used.
42 // See ObjBase.h - Only in Windows 7 SDK.
46 template<typename T> void** IID_PPV_ARGS_Helper(T** pp)
48 static_cast<IUnknown*>(*pp); // make sure everyone derives from IUnknown
49 return reinterpret_cast<void**>(pp);
53 #define IID_PPV_ARGS(ppType) __uuidof(**(ppType)), IID_PPV_ARGS_Helper(ppType)
56 // See include/reactos/shellutils.h
58 # define IID_PPV_ARG(Itype, ppType) IID_##Itype, reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
59 # define IID_NULL_PPV_ARG(Itype, ppType) IID_##Itype, NULL, reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
61 # define IID_PPV_ARG(Itype, ppType) IID_##Itype, (void**)(ppType)
62 # define IID_NULL_PPV_ARG(Itype, ppType) IID_##Itype, NULL, (void**)(ppType)
66 HRESULT InitXMLDOMParser(void);
67 void UninitXMLDOMParser(void);
69 HRESULT CreateAndInitXMLDOMDocument(IXMLDOMDocument** ppDoc);
70 BOOL LoadXMLDocumentFromResource(IXMLDOMDocument* pXMLDom, LPCWSTR lpszXMLResName);
71 BOOL LoadXMLDocumentFromFile(IXMLDOMDocument* pXMLDom, LPCWSTR lpszFilename, BOOL bIgnoreErrorsIfNonExistingFile = FALSE);