Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
e18ef3cf
Commit
e18ef3cf
authored
Jul 24, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 24, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wine/debug.h: Added wine_dbgstr_variant and wine_dbgstr_vt implementations.
parent
1de7771a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
120 additions
and
73 deletions
+120
-73
variant.c
dlls/oleaut32/variant.c
+2
-73
debug.h
include/wine/debug.h
+118
-0
No files found.
dlls/oleaut32/variant.c
View file @
e18ef3cf
...
...
@@ -44,7 +44,6 @@
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
variant
);
static
const
char
*
const
variant_types
[]
=
{
"VT_EMPTY"
,
"VT_NULL"
,
"VT_I2"
,
"VT_I4"
,
"VT_R4"
,
"VT_R8"
,
"VT_CY"
,
"VT_DATE"
,
...
...
@@ -81,82 +80,12 @@ static const char * const variant_flags[16] =
const
char
*
debugstr_vt
(
VARTYPE
vt
)
{
if
(
vt
&
~
VT_TYPEMASK
)
return
wine_dbg_sprintf
(
"%s%s"
,
debugstr_vt
(
vt
&
VT_TYPEMASK
),
variant_flags
[
vt
>>
12
]);
if
(
vt
<
sizeof
(
variant_types
)
/
sizeof
(
*
variant_types
))
return
variant_types
[
vt
];
if
(
vt
==
VT_BSTR_BLOB
)
return
"VT_BSTR_BLOB"
;
return
wine_dbg_sprintf
(
"vt(invalid %x)"
,
vt
);
return
wine_dbgstr_vt
(
vt
);
}
const
char
*
debugstr_variant
(
const
VARIANT
*
v
)
{
if
(
!
v
)
return
"(null)"
;
if
(
V_VT
(
v
)
&
VT_BYREF
)
{
if
(
V_VT
(
v
)
==
(
VT_VARIANT
|
VT_BYREF
))
return
wine_dbg_sprintf
(
"%p {VT_VARIANT|VT_BYREF: %s}"
,
v
,
debugstr_variant
(
V_VARIANTREF
(
v
)));
return
wine_dbg_sprintf
(
"%p {%s %p}"
,
v
,
debugstr_vt
(
V_VT
(
v
)),
V_BYREF
(
v
));
}
if
(
V_ISARRAY
(
v
)
||
V_ISVECTOR
(
v
))
return
wine_dbg_sprintf
(
"%p {%s %p}"
,
v
,
debugstr_vt
(
V_VT
(
v
)),
V_ARRAY
(
v
));
switch
(
V_VT
(
v
))
{
case
VT_EMPTY
:
return
wine_dbg_sprintf
(
"%p {VT_EMPTY}"
,
v
);
case
VT_NULL
:
return
wine_dbg_sprintf
(
"%p {VT_NULL}"
,
v
);
case
VT_I2
:
return
wine_dbg_sprintf
(
"%p {VT_I2: %d}"
,
v
,
V_I2
(
v
));
case
VT_I4
:
return
wine_dbg_sprintf
(
"%p {VT_I4: %d}"
,
v
,
V_I4
(
v
));
case
VT_R4
:
return
wine_dbg_sprintf
(
"%p {VT_R4: %f}"
,
v
,
V_R4
(
v
));
case
VT_R8
:
return
wine_dbg_sprintf
(
"%p {VT_R8: %lf}"
,
v
,
V_R8
(
v
));
case
VT_CY
:
return
wine_dbg_sprintf
(
"%p {VT_CY: %s}"
,
v
,
wine_dbgstr_longlong
(
V_CY
(
v
).
int64
));
case
VT_DATE
:
return
wine_dbg_sprintf
(
"%p {VT_DATE: %lf}"
,
v
,
V_DATE
(
v
));
case
VT_BSTR
:
return
wine_dbg_sprintf
(
"%p {VT_BSTR: %s}"
,
v
,
debugstr_w
(
V_BSTR
(
v
)));
case
VT_DISPATCH
:
return
wine_dbg_sprintf
(
"%p {VT_DISPATCH: %p}"
,
v
,
V_DISPATCH
(
v
));
case
VT_ERROR
:
return
wine_dbg_sprintf
(
"%p {VT_ERROR: %08x}"
,
v
,
V_ERROR
(
v
));
case
VT_BOOL
:
return
wine_dbg_sprintf
(
"%p {VT_BOOL: %x}"
,
v
,
V_BOOL
(
v
));
case
VT_UNKNOWN
:
return
wine_dbg_sprintf
(
"%p {VT_UNKNOWN: %p}"
,
v
,
V_UNKNOWN
(
v
));
case
VT_I1
:
return
wine_dbg_sprintf
(
"%p {VT_I1: %d}"
,
v
,
V_I1
(
v
));
case
VT_UI1
:
return
wine_dbg_sprintf
(
"%p {VT_UI1: %u}"
,
v
,
V_UI1
(
v
));
case
VT_UI2
:
return
wine_dbg_sprintf
(
"%p {VT_UI2: %d}"
,
v
,
V_UI2
(
v
));
case
VT_UI4
:
return
wine_dbg_sprintf
(
"%p {VT_UI4: %d}"
,
v
,
V_UI4
(
v
));
case
VT_I8
:
return
wine_dbg_sprintf
(
"%p {VT_I8: %s}"
,
v
,
wine_dbgstr_longlong
(
V_I8
(
v
)));
case
VT_UI8
:
return
wine_dbg_sprintf
(
"%p {VT_UI8: %s}"
,
v
,
wine_dbgstr_longlong
(
V_UI8
(
v
)));
case
VT_INT
:
return
wine_dbg_sprintf
(
"%p {VT_INT: %d}"
,
v
,
V_INT
(
v
));
case
VT_UINT
:
return
wine_dbg_sprintf
(
"%p {VT_UINT: %u}"
,
v
,
V_UINT
(
v
));
case
VT_VOID
:
return
wine_dbg_sprintf
(
"%p {VT_VOID}"
,
v
);
case
VT_RECORD
:
return
wine_dbg_sprintf
(
"%p {VT_RECORD: %p %p}"
,
v
,
V_UNION
(
v
,
brecVal
).
pvRecord
,
V_UNION
(
v
,
brecVal
).
pRecInfo
);
default:
return
wine_dbg_sprintf
(
"%p {vt %s}"
,
v
,
debugstr_vt
(
V_VT
(
v
)));
}
return
wine_dbgstr_variant
(
v
);
}
/* Convert a variant from one type to another */
...
...
include/wine/debug.h
View file @
e18ef3cf
...
...
@@ -219,6 +219,124 @@ static inline const char *wine_dbgstr_longlong( ULONGLONG ll )
else
return
wine_dbg_sprintf
(
"%lx"
,
(
unsigned
long
)
ll
);
}
#if defined(__oaidl_h__) && defined(V_VT)
static
inline
const
char
*
wine_dbgstr_vt
(
VARTYPE
vt
)
{
static
const
char
*
const
variant_types
[]
=
{
"VT_EMPTY"
,
"VT_NULL"
,
"VT_I2"
,
"VT_I4"
,
"VT_R4"
,
"VT_R8"
,
"VT_CY"
,
"VT_DATE"
,
"VT_BSTR"
,
"VT_DISPATCH"
,
"VT_ERROR"
,
"VT_BOOL"
,
"VT_VARIANT"
,
"VT_UNKNOWN"
,
"VT_DECIMAL"
,
"15"
,
"VT_I1"
,
"VT_UI1"
,
"VT_UI2"
,
"VT_UI4"
,
"VT_I8"
,
"VT_UI8"
,
"VT_INT"
,
"VT_UINT"
,
"VT_VOID"
,
"VT_HRESULT"
,
"VT_PTR"
,
"VT_SAFEARRAY"
,
"VT_CARRAY"
,
"VT_USERDEFINED"
,
"VT_LPSTR"
,
"VT_LPWSTR"
,
"32"
,
"33"
,
"34"
,
"35"
,
"VT_RECORD"
,
"VT_INT_PTR"
,
"VT_UINT_PTR"
,
"39"
,
"40"
,
"41"
,
"42"
,
"43"
,
"44"
,
"45"
,
"46"
,
"47"
,
"48"
,
"49"
,
"50"
,
"51"
,
"52"
,
"53"
,
"54"
,
"55"
,
"56"
,
"57"
,
"58"
,
"59"
,
"60"
,
"61"
,
"62"
,
"63"
,
"VT_FILETIME"
,
"VT_BLOB"
,
"VT_STREAM"
,
"VT_STORAGE"
,
"VT_STREAMED_OBJECT"
,
"VT_STORED_OBJECT"
,
"VT_BLOB_OBJECT"
,
"VT_CF"
,
"VT_CLSID"
,
"VT_VERSIONED_STREAM"
};
static
const
char
*
const
variant_flags
[
16
]
=
{
""
,
"|VT_VECTOR"
,
"|VT_ARRAY"
,
"|VT_VECTOR|VT_ARRAY"
,
"|VT_BYREF"
,
"|VT_VECTOR|VT_ARRAY"
,
"|VT_ARRAY|VT_BYREF"
,
"|VT_VECTOR|VT_ARRAY|VT_BYREF"
,
"|VT_RESERVED"
,
"|VT_VECTOR|VT_RESERVED"
,
"|VT_ARRAY|VT_RESERVED"
,
"|VT_VECTOR|VT_ARRAY|VT_RESERVED"
,
"|VT_BYREF|VT_RESERVED"
,
"|VT_VECTOR|VT_ARRAY|VT_RESERVED"
,
"|VT_ARRAY|VT_BYREF|VT_RESERVED"
,
"|VT_VECTOR|VT_ARRAY|VT_BYREF|VT_RESERVED"
,
};
if
(
vt
&
~
VT_TYPEMASK
)
return
wine_dbg_sprintf
(
"%s%s"
,
wine_dbgstr_vt
(
vt
&
VT_TYPEMASK
),
variant_flags
[
vt
>>
12
]
);
if
(
vt
<
sizeof
(
variant_types
)
/
sizeof
(
*
variant_types
))
return
variant_types
[
vt
];
if
(
vt
==
VT_BSTR_BLOB
)
return
"VT_BSTR_BLOB"
;
return
wine_dbg_sprintf
(
"vt(invalid %x)"
,
vt
);
}
static
inline
const
char
*
wine_dbgstr_variant
(
const
VARIANT
*
v
)
{
if
(
!
v
)
return
"(null)"
;
if
(
V_VT
(
v
)
&
VT_BYREF
)
{
if
(
V_VT
(
v
)
==
(
VT_VARIANT
|
VT_BYREF
))
return
wine_dbg_sprintf
(
"%p {VT_VARIANT|VT_BYREF: %s}"
,
v
,
wine_dbgstr_variant
(
V_VARIANTREF
(
v
))
);
return
wine_dbg_sprintf
(
"%p {%s %p}"
,
v
,
wine_dbgstr_vt
(
V_VT
(
v
)),
V_BYREF
(
v
)
);
}
if
(
V_ISARRAY
(
v
)
||
V_ISVECTOR
(
v
))
return
wine_dbg_sprintf
(
"%p {%s %p}"
,
v
,
wine_dbgstr_vt
(
V_VT
(
v
)),
V_ARRAY
(
v
)
);
switch
(
V_VT
(
v
))
{
case
VT_EMPTY
:
return
wine_dbg_sprintf
(
"%p {VT_EMPTY}"
,
v
);
case
VT_NULL
:
return
wine_dbg_sprintf
(
"%p {VT_NULL}"
,
v
);
case
VT_I2
:
return
wine_dbg_sprintf
(
"%p {VT_I2: %d}"
,
v
,
V_I2
(
v
)
);
case
VT_I4
:
return
wine_dbg_sprintf
(
"%p {VT_I4: %d}"
,
v
,
V_I4
(
v
)
);
case
VT_R4
:
return
wine_dbg_sprintf
(
"%p {VT_R4: %f}"
,
v
,
V_R4
(
v
)
);
case
VT_R8
:
return
wine_dbg_sprintf
(
"%p {VT_R8: %lf}"
,
v
,
V_R8
(
v
)
);
case
VT_CY
:
return
wine_dbg_sprintf
(
"%p {VT_CY: %s}"
,
v
,
wine_dbgstr_longlong
(
V_CY
(
v
).
int64
)
);
case
VT_DATE
:
return
wine_dbg_sprintf
(
"%p {VT_DATE: %lf}"
,
v
,
V_DATE
(
v
)
);
case
VT_BSTR
:
return
wine_dbg_sprintf
(
"%p {VT_BSTR: %s}"
,
v
,
wine_dbgstr_w
(
V_BSTR
(
v
))
);
case
VT_DISPATCH
:
return
wine_dbg_sprintf
(
"%p {VT_DISPATCH: %p}"
,
v
,
V_DISPATCH
(
v
)
);
case
VT_ERROR
:
return
wine_dbg_sprintf
(
"%p {VT_ERROR: %08x}"
,
v
,
V_ERROR
(
v
)
);
case
VT_BOOL
:
return
wine_dbg_sprintf
(
"%p {VT_BOOL: %x}"
,
v
,
V_BOOL
(
v
)
);
case
VT_UNKNOWN
:
return
wine_dbg_sprintf
(
"%p {VT_UNKNOWN: %p}"
,
v
,
V_UNKNOWN
(
v
)
);
case
VT_I1
:
return
wine_dbg_sprintf
(
"%p {VT_I1: %d}"
,
v
,
V_I1
(
v
)
);
case
VT_UI1
:
return
wine_dbg_sprintf
(
"%p {VT_UI1: %u}"
,
v
,
V_UI1
(
v
)
);
case
VT_UI2
:
return
wine_dbg_sprintf
(
"%p {VT_UI2: %d}"
,
v
,
V_UI2
(
v
)
);
case
VT_UI4
:
return
wine_dbg_sprintf
(
"%p {VT_UI4: %d}"
,
v
,
V_UI4
(
v
)
);
case
VT_I8
:
return
wine_dbg_sprintf
(
"%p {VT_I8: %s}"
,
v
,
wine_dbgstr_longlong
(
V_I8
(
v
))
);
case
VT_UI8
:
return
wine_dbg_sprintf
(
"%p {VT_UI8: %s}"
,
v
,
wine_dbgstr_longlong
(
V_UI8
(
v
))
);
case
VT_INT
:
return
wine_dbg_sprintf
(
"%p {VT_INT: %d}"
,
v
,
V_INT
(
v
)
);
case
VT_UINT
:
return
wine_dbg_sprintf
(
"%p {VT_UINT: %u}"
,
v
,
V_UINT
(
v
)
);
case
VT_VOID
:
return
wine_dbg_sprintf
(
"%p {VT_VOID}"
,
v
);
case
VT_RECORD
:
return
wine_dbg_sprintf
(
"%p {VT_RECORD: %p %p}"
,
v
,
V_UNION
(
v
,
brecVal
).
pvRecord
,
V_UNION
(
v
,
brecVal
).
pRecInfo
);
default:
return
wine_dbg_sprintf
(
"%p {vt %s}"
,
v
,
wine_dbgstr_vt
(
V_VT
(
v
))
);
}
}
#endif
/* defined(__oaidl_h__) && defined(V_VT) */
#ifndef WINE_TRACE
#define WINE_TRACE __WINE_DPRINTF(_TRACE,__wine_dbch___default)
#define WINE_TRACE_(ch) __WINE_DPRINTF(_TRACE,&__wine_dbch_##ch)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment