Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
7a772ed8
Commit
7a772ed8
authored
Apr 10, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Apr 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmusic: Replace debugstr_DMUS_OBJECTDESC by a specific dump function to avoid…
dmusic: Replace debugstr_DMUS_OBJECTDESC by a specific dump function to avoid debug buffer overflow.
parent
d8822cf3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
33 deletions
+42
-33
collection.c
dlls/dmusic/collection.c
+23
-7
dmusic_main.c
dlls/dmusic/dmusic_main.c
+16
-23
dmusic_private.h
dlls/dmusic/dmusic_private.h
+3
-3
No files found.
dlls/dmusic/collection.c
View file @
7a772ed8
...
@@ -189,9 +189,20 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_GetDescripto
...
@@ -189,9 +189,20 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_GetDescripto
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
IDirectMusicCollectionImpl_IDirectMusicObject_SetDescriptor
(
LPDIRECTMUSICOBJECT
iface
,
LPDMUS_OBJECTDESC
pDesc
)
{
static
HRESULT
WINAPI
IDirectMusicCollectionImpl_IDirectMusicObject_SetDescriptor
(
LPDIRECTMUSICOBJECT
iface
,
LPDMUS_OBJECTDESC
pDesc
)
{
ICOM_THIS_MULTI
(
IDirectMusicCollectionImpl
,
ObjectVtbl
,
iface
);
ICOM_THIS_MULTI
(
IDirectMusicCollectionImpl
,
ObjectVtbl
,
iface
);
TRACE
(
"(%p, %p): setting descriptor:
\n
%s
\n
"
,
This
,
pDesc
,
debugstr_DMUS_OBJECTDESC
(
pDesc
));
TRACE
(
"(%p, %p)
\n
"
,
iface
,
pDesc
);
if
(
!
pDesc
)
return
E_POINTER
;
if
(
TRACE_ON
(
dmusic
))
{
TRACE
(
"Setting descriptor:
\n
"
);
dump_DMUS_OBJECTDESC
(
pDesc
);
}
/* According to MSDN, we should copy only given values, not whole struct */
/* According to MSDN, we should copy only given values, not whole struct */
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_OBJECT
)
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_OBJECT
)
...
@@ -223,7 +234,8 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_SetDescripto
...
@@ -223,7 +234,8 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_SetDescripto
return
S_OK
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
IDirectMusicCollectionImpl_IDirectMusicObject_ParseDescriptor
(
LPDIRECTMUSICOBJECT
iface
,
LPSTREAM
pStream
,
LPDMUS_OBJECTDESC
pDesc
)
{
static
HRESULT
WINAPI
IDirectMusicCollectionImpl_IDirectMusicObject_ParseDescriptor
(
LPDIRECTMUSICOBJECT
iface
,
LPSTREAM
pStream
,
LPDMUS_OBJECTDESC
pDesc
)
{
ICOM_THIS_MULTI
(
IDirectMusicCollectionImpl
,
ObjectVtbl
,
iface
);
ICOM_THIS_MULTI
(
IDirectMusicCollectionImpl
,
ObjectVtbl
,
iface
);
DMUS_PRIVATE_CHUNK
Chunk
;
DMUS_PRIVATE_CHUNK
Chunk
;
DWORD
StreamSize
,
StreamCount
,
ListSize
[
1
],
ListCount
[
1
];
DWORD
StreamSize
,
StreamCount
,
ListSize
[
1
],
ListCount
[
1
];
...
@@ -384,10 +396,14 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_ParseDescrip
...
@@ -384,10 +396,14 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_ParseDescrip
IStream_Seek
(
pStream
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
/* skip the rest of the chunk */
IStream_Seek
(
pStream
,
liMove
,
STREAM_SEEK_CUR
,
NULL
);
/* skip the rest of the chunk */
return
DMUS_E_INVALIDFILE
;
return
DMUS_E_INVALIDFILE
;
}
}
}
}
TRACE
(
": returning descriptor:
\n
%s
\n
"
,
debugstr_DMUS_OBJECTDESC
(
pDesc
));
if
(
TRACE_ON
(
dmusic
))
{
TRACE
(
"Returning descriptor:
\n
"
);
dump_DMUS_OBJECTDESC
(
pDesc
);
}
return
S_OK
;
return
S_OK
;
}
}
...
...
dlls/dmusic/dmusic_main.c
View file @
7a772ed8
...
@@ -446,27 +446,20 @@ static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
...
@@ -446,27 +446,20 @@ static const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
return
debugstr_flags
(
flagmask
,
flags
,
sizeof
(
flags
)
/
sizeof
(
flags
[
0
]));
return
debugstr_flags
(
flagmask
,
flags
,
sizeof
(
flags
)
/
sizeof
(
flags
[
0
]));
}
}
/* dump whole DMUS_OBJECTDESC struct */
/* Dump whole DMUS_OBJECTDESC struct */
const
char
*
debugstr_DMUS_OBJECTDESC
(
LPDMUS_OBJECTDESC
pDesc
)
{
void
dump_DMUS_OBJECTDESC
(
LPDMUS_OBJECTDESC
desc
)
if
(
pDesc
)
{
{
char
buffer
[
1024
]
=
""
,
*
ptr
=
&
buffer
[
0
];
TRACE
(
"DMUS_OBJECTDESC (%p):
\n
"
,
desc
);
TRACE
(
" - dwSize = %d
\n
"
,
desc
->
dwSize
);
ptr
+=
sprintf
(
ptr
,
"DMUS_OBJECTDESC (%p):
\n
"
,
pDesc
);
TRACE
(
" - dwValidData = %s
\n
"
,
debugstr_DMUS_OBJ_FLAGS
(
desc
->
dwValidData
));
ptr
+=
sprintf
(
ptr
,
" - dwSize = %d
\n
"
,
pDesc
->
dwSize
);
if
(
desc
->
dwValidData
&
DMUS_OBJ_CLASS
)
TRACE
(
" - guidClass = %s
\n
"
,
debugstr_dmguid
(
&
desc
->
guidClass
));
ptr
+=
sprintf
(
ptr
,
" - dwValidData = %s
\n
"
,
debugstr_DMUS_OBJ_FLAGS
(
pDesc
->
dwValidData
));
if
(
desc
->
dwValidData
&
DMUS_OBJ_OBJECT
)
TRACE
(
" - guidObject = %s
\n
"
,
debugstr_guid
(
&
desc
->
guidObject
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CLASS
)
ptr
+=
sprintf
(
ptr
,
" - guidClass = %s
\n
"
,
debugstr_dmguid
(
&
pDesc
->
guidClass
));
if
(
desc
->
dwValidData
&
DMUS_OBJ_DATE
)
TRACE
(
" - ftDate = FIXME
\n
"
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_OBJECT
)
ptr
+=
sprintf
(
ptr
,
" - guidObject = %s
\n
"
,
debugstr_guid
(
&
pDesc
->
guidObject
));
if
(
desc
->
dwValidData
&
DMUS_OBJ_VERSION
)
TRACE
(
" - vVersion = %s
\n
"
,
debugstr_dmversion
(
&
desc
->
vVersion
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_DATE
)
ptr
+=
sprintf
(
ptr
,
" - ftDate = FIXME
\n
"
);
if
(
desc
->
dwValidData
&
DMUS_OBJ_NAME
)
TRACE
(
" - wszName = %s
\n
"
,
debugstr_w
(
desc
->
wszName
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_VERSION
)
ptr
+=
sprintf
(
ptr
,
" - vVersion = %s
\n
"
,
debugstr_dmversion
(
&
pDesc
->
vVersion
));
if
(
desc
->
dwValidData
&
DMUS_OBJ_CATEGORY
)
TRACE
(
" - wszCategory = %s
\n
"
,
debugstr_w
(
desc
->
wszCategory
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_NAME
)
ptr
+=
sprintf
(
ptr
,
" - wszName = %s
\n
"
,
debugstr_w
(
pDesc
->
wszName
));
if
(
desc
->
dwValidData
&
DMUS_OBJ_FILENAME
)
TRACE
(
" - wszFileName = %s
\n
"
,
debugstr_w
(
desc
->
wszFileName
));
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CATEGORY
)
ptr
+=
sprintf
(
ptr
,
" - wszCategory = %s
\n
"
,
debugstr_w
(
pDesc
->
wszCategory
));
if
(
desc
->
dwValidData
&
DMUS_OBJ_MEMORY
)
TRACE
(
" - llMemLength = 0x%s
\n
- pbMemData = %p
\n
"
,
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_FILENAME
)
ptr
+=
sprintf
(
ptr
,
" - wszFileName = %s
\n
"
,
debugstr_w
(
pDesc
->
wszFileName
));
wine_dbgstr_longlong
(
desc
->
llMemLength
),
desc
->
pbMemData
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_MEMORY
)
ptr
+=
sprintf
(
ptr
,
" - llMemLength = 0x%s
\n
- pbMemData = %p
\n
"
,
if
(
desc
->
dwValidData
&
DMUS_OBJ_STREAM
)
TRACE
(
" - pStream = %p
\n
"
,
desc
->
pStream
);
wine_dbgstr_longlong
(
pDesc
->
llMemLength
),
pDesc
->
pbMemData
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_STREAM
)
ptr
+=
sprintf
(
ptr
,
" - pStream = %p"
,
pDesc
->
pStream
);
return
wine_dbg_sprintf
(
"%s"
,
buffer
);
}
else
{
return
wine_dbg_sprintf
(
"(NULL)"
);
}
}
}
dlls/dmusic/dmusic_private.h
View file @
7a772ed8
...
@@ -274,7 +274,7 @@ extern int even_or_odd (DWORD number) DECLSPEC_HIDDEN;
...
@@ -274,7 +274,7 @@ extern int even_or_odd (DWORD number) DECLSPEC_HIDDEN;
extern
const
char
*
debugstr_fourcc
(
DWORD
fourcc
)
DECLSPEC_HIDDEN
;
extern
const
char
*
debugstr_fourcc
(
DWORD
fourcc
)
DECLSPEC_HIDDEN
;
/* returns name of given GUID */
/* returns name of given GUID */
extern
const
char
*
debugstr_dmguid
(
const
GUID
*
id
)
DECLSPEC_HIDDEN
;
extern
const
char
*
debugstr_dmguid
(
const
GUID
*
id
)
DECLSPEC_HIDDEN
;
/*
d
ump whole DMUS_OBJECTDESC struct */
/*
D
ump whole DMUS_OBJECTDESC struct */
extern
const
char
*
debugstr_DMUS_OBJECTDESC
(
LPDMUS_OBJECTDESC
pD
esc
)
DECLSPEC_HIDDEN
;
extern
void
dump_DMUS_OBJECTDESC
(
LPDMUS_OBJECTDESC
d
esc
)
DECLSPEC_HIDDEN
;
#endif
/* __WINE_DMUSIC_PRIVATE_H */
#endif
/* __WINE_DMUSIC_PRIVATE_H */
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