winhttp/tests: Make sure proxy settings are restored.
[wine] / dlls / dmime / dmutils.h
1 /* Debug and Helper Functions
2  *
3  * Copyright (C) 2003-2004 Rok Mandeljc
4  * Copyright (C) 2003-2004 Raphael Junqueira
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #ifndef __WINE_DMUTILS_H
22 #define __WINE_DMUTILS_H
23  
24 /* for simpler reading */
25 typedef struct _DMUS_PRIVATE_CHUNK {
26         FOURCC fccID; /* FOURCC ID of the chunk */
27         DWORD dwSize; /* size of the chunk */
28 } DMUS_PRIVATE_CHUNK, *LPDMUS_PRIVATE_CHUNK;
29
30 #define ICOM_THIS_MULTI(impl,field,iface)  impl* const This=(impl*)((char*)(iface) - offsetof(impl,field))
31
32 /**
33  * Parsing utilities
34  */
35 extern HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
36 extern HRESULT IDirectMusicUtils_IPersistStream_ParseUNFOGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
37 extern HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, IDirectMusicObject** ppObject) DECLSPEC_HIDDEN;
38
39 /**
40  * Debug utilities
41  */
42 /* used for generic dumping (copied from ddraw) */
43 typedef struct {
44     DWORD val;
45     const char* name;
46 } flag_info;
47
48 typedef struct {
49     const GUID *guid;
50     const char* name;
51 } guid_info;
52
53 /* used for initialising structs */
54 #define DM_STRUCT_INIT(x)                       \
55         do {                                    \
56                 memset((x), 0, sizeof(*(x)));   \
57                 (x)->dwSize = sizeof(*x);       \
58         } while (0)
59
60 #define FE(x) { x, #x } 
61 #define GE(x) { &x, #x }
62
63 /* FOURCC to string conversion for debug messages */
64 extern const char *debugstr_fourcc (DWORD fourcc) DECLSPEC_HIDDEN;
65 /* returns name of given GUID */
66 extern const char *debugstr_dmguid (const GUID *id) DECLSPEC_HIDDEN;
67
68 /* dump whole DMUS_OBJECTDESC struct */
69 extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) DECLSPEC_HIDDEN;
70
71 #endif /* __WINE_DMUTILS_H */