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>
11 * MSXML Version Header File Name Library File Name DLL File Name
12 * =======================================================================
13 * 2.x msxml.h msxml.lib msxml2.dll
14 * 3.0 msxml2.h msxml2.lib msxml3.dll
15 * 4.0 msxml2.h msxml2.lib msxml4.dll
16 * 6.0 msxml6.h msxml6.lib msxml6.dll
18 // #pragma comment(lib, "msxml2.lib")
20 #define _COM_NO_STANDARD_GUIDS_
22 // #include <comutil.h> // comdef.h includes comutil.h
27 // About macro while(0) trick : see http://cnicholson.net/2009/03/stupid-c-tricks-dowhile0-and-c4127/
29 // Macro that releases a COM object if not NULL.
30 #define SAFE_RELEASE(p) \
31 do { if ((p)) { (p)->Release(); (p) = NULL; } } while (0)
34 // IID_PPV_ARGS(ppType)
35 // ppType is the variable of type IType that will be filled
37 // RESULTS in: IID_IType, ppvType
38 // will create a compiler error if wrong level of indirection is used.
40 // See ObjBase.h - Only in Windows 7 SDK.
44 template<typename T> void** IID_PPV_ARGS_Helper(T** pp)
46 static_cast<IUnknown*>(*pp); // make sure everyone derives from IUnknown
47 return reinterpret_cast<void**>(pp);
51 #define IID_PPV_ARGS(ppType) __uuidof(**(ppType)), IID_PPV_ARGS_Helper(ppType)
54 // See include/reactos/shellutils.h
56 # define IID_PPV_ARG(Itype, ppType) IID_##Itype, reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
57 # define IID_NULL_PPV_ARG(Itype, ppType) IID_##Itype, NULL, reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
59 # define IID_PPV_ARG(Itype, ppType) IID_##Itype, (void**)(ppType)
60 # define IID_NULL_PPV_ARG(Itype, ppType) IID_##Itype, NULL, (void**)(ppType)
64 HRESULT InitXMLDOMParser(void);
65 void UninitXMLDOMParser(void);
67 HRESULT CreateAndInitXMLDOMDocument(IXMLDOMDocument** ppDoc);
68 BOOL LoadXMLDocumentFromResource(IXMLDOMDocument* pXMLDom, LPCWSTR lpszXMLResName);
69 BOOL LoadXMLDocumentFromFile(IXMLDOMDocument* pXMLDom, LPCWSTR lpszFilename, BOOL bIgnoreErrorsIfNonExistingFile = FALSE);