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
a5a11b78
Commit
a5a11b78
authored
Feb 26, 2008
by
Andrew Talbot
Committed by
Alexandre Julliard
Feb 27, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dswave: Assign to structs instead of using memcpy.
parent
20c0c311
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
dswave.c
dlls/dswave/dswave.c
+13
-13
No files found.
dlls/dswave/dswave.c
View file @
a5a11b78
...
...
@@ -344,12 +344,12 @@ static HRESULT WINAPI IDirectMusicWaveImpl_IDirectMusicObject_GetDescriptor (LPD
static
HRESULT
WINAPI
IDirectMusicWaveImpl_IDirectMusicObject_SetDescriptor
(
LPDIRECTMUSICOBJECT
iface
,
LPDMUS_OBJECTDESC
pDesc
)
{
ICOM_THIS_MULTI
(
IDirectMusicWaveImpl
,
ObjectVtbl
,
iface
);
TRACE
(
"(%p, %p, %s): setting descriptor:
\n
"
,
This
,
pDesc
,
debugstr_DMUS_OBJECTDESC
(
pDesc
));
/* According to MSDN, we should copy only given values, not whole struct */
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_OBJECT
)
memcpy
(
&
This
->
pDesc
->
guidObject
,
&
pDesc
->
guidObject
,
sizeof
(
pDesc
->
guidObject
))
;
This
->
pDesc
->
guidObject
=
pDesc
->
guidObject
;
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CLASS
)
memcpy
(
&
This
->
pDesc
->
guidClass
,
&
pDesc
->
guidClass
,
sizeof
(
pDesc
->
guidClass
));
This
->
pDesc
->
guidClass
=
pDesc
->
guidClass
;
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_NAME
)
lstrcpynW
(
This
->
pDesc
->
wszName
,
pDesc
->
wszName
,
DMUS_MAX_NAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_CATEGORY
)
...
...
@@ -357,9 +357,9 @@ static HRESULT WINAPI IDirectMusicWaveImpl_IDirectMusicObject_SetDescriptor (LPD
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_FILENAME
)
lstrcpynW
(
This
->
pDesc
->
wszFileName
,
pDesc
->
wszFileName
,
DMUS_MAX_FILENAME
);
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_VERSION
)
memcpy
(
&
This
->
pDesc
->
vVersion
,
&
pDesc
->
vVersion
,
sizeof
(
pDesc
->
vVersion
));
This
->
pDesc
->
vVersion
=
pDesc
->
vVersion
;
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_DATE
)
memcpy
(
&
This
->
pDesc
->
ftDate
,
&
pDesc
->
ftDate
,
sizeof
(
pDesc
->
ftDate
));
This
->
pDesc
->
ftDate
=
pDesc
->
ftDate
;
if
(
pDesc
->
dwValidData
&
DMUS_OBJ_MEMORY
)
{
memcpy
(
&
This
->
pDesc
->
llMemLength
,
&
pDesc
->
llMemLength
,
sizeof
(
pDesc
->
llMemLength
));
memcpy
(
This
->
pDesc
->
pbMemData
,
pDesc
->
pbMemData
,
sizeof
(
pDesc
->
pbMemData
));
...
...
@@ -381,11 +381,11 @@ static HRESULT WINAPI IDirectMusicWaveImpl_IDirectMusicObject_ParseDescriptor (L
LARGE_INTEGER
liMove
;
/* used when skipping chunks */
TRACE
(
"(%p, %p)
\n
"
,
pStream
,
pDesc
);
/* FIXME: should this be determined from stream? */
pDesc
->
dwValidData
|=
DMUS_OBJ_CLASS
;
memcpy
(
&
pDesc
->
guidClass
,
&
CLSID_DirectMusicSegment
,
sizeof
(
CLSID
))
;
pDesc
->
guidClass
=
CLSID_DirectMusicSegment
;
IStream_Read
(
pStream
,
&
Chunk
,
sizeof
(
FOURCC
)
+
sizeof
(
DWORD
),
NULL
);
TRACE_
(
dmfile
)(
": %s chunk (size = 0x%04x)"
,
debugstr_fourcc
(
Chunk
.
fccID
),
Chunk
.
dwSize
);
switch
(
Chunk
.
fccID
)
{
...
...
@@ -563,11 +563,11 @@ static HRESULT WINAPI IDirectMusicWaveImpl_IPersistStream_Load (LPPERSISTSTREAM
LARGE_INTEGER
liMove
;
/* used when skipping chunks */
FIXME
(
"(%p, %p): loading not implemented yet (only descriptor is loaded)
\n
"
,
This
,
pStm
);
/* FIXME: should this be determined from stream? */
This
->
pDesc
->
dwValidData
|=
DMUS_OBJ_CLASS
;
memcpy
(
&
This
->
pDesc
->
guidClass
,
&
CLSID_DirectMusicSegment
,
sizeof
(
CLSID
))
;
This
->
pDesc
->
guidClass
=
CLSID_DirectMusicSegment
;
IStream_Read
(
pStm
,
&
Chunk
,
sizeof
(
FOURCC
)
+
sizeof
(
DWORD
),
NULL
);
TRACE_
(
dmfile
)(
": %s chunk (size = 0x%04x)"
,
debugstr_fourcc
(
Chunk
.
fccID
),
Chunk
.
dwSize
);
switch
(
Chunk
.
fccID
)
{
...
...
@@ -737,8 +737,8 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicWaveImpl (LPCGUID lpcGUID, LPVOID* ppobj,
obj
->
pDesc
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
DMUS_OBJECTDESC
));
DM_STRUCT_INIT
(
obj
->
pDesc
);
obj
->
pDesc
->
dwValidData
|=
DMUS_OBJ_CLASS
;
memcpy
(
&
obj
->
pDesc
->
guidClass
,
&
CLSID_DirectMusicSegment
,
sizeof
(
CLSID
))
;
/* shown by tests */
obj
->
pDesc
->
guidClass
=
CLSID_DirectMusicSegment
;
/* shown by tests */
obj
->
ref
=
0
;
/* will be inited by QueryInterface */
return
IDirectMusicWaveImpl_IUnknown_QueryInterface
((
LPUNKNOWN
)
&
obj
->
UnknownVtbl
,
lpcGUID
,
ppobj
);
}
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