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
f7002c66
Commit
f7002c66
authored
May 23, 2011
by
Dylan Smith
Committed by
Alexandre Julliard
May 24, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Don't interpret end padding as dwCaps2 for x64.
parent
38713298
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
7 deletions
+18
-7
ddraw.c
dlls/ddraw/ddraw.c
+1
-2
ddraw_private.h
dlls/ddraw/ddraw_private.h
+16
-2
surface.c
dlls/ddraw/surface.c
+1
-3
No files found.
dlls/ddraw/ddraw.c
View file @
f7002c66
...
...
@@ -3125,8 +3125,7 @@ static HRESULT CreateSurface(IDirectDrawImpl *ddraw, DDSURFACEDESC2 *DDSD,
DDSD
->
ddsCaps
.
dwCaps2
&=
~
DDSCAPS2_MIPMAPSUBLEVEL
;
/* Modify some flags */
desc2
.
dwSize
=
sizeof
(
desc2
);
/* For the struct copy */
DD_STRUCT_COPY_BYSIZE
(
&
desc2
,
DDSD
);
copy_to_surfacedesc2
(
&
desc2
,
DDSD
);
desc2
.
u4
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
DDPIXELFORMAT
);
/* Just to be sure */
/* Get the video mode from WineD3D - we will need it */
...
...
dlls/ddraw/ddraw_private.h
View file @
f7002c66
...
...
@@ -588,16 +588,30 @@ typedef struct
/* Structure copy */
#define ME(x,f,e) { x, #x, (void (*)(const void *))(f), offsetof(STRUCT, e) }
#define DD_STRUCT_COPY_BYSIZE
(to,from)
\
#define DD_STRUCT_COPY_BYSIZE
_(to,from,from_size)
\
do { \
DWORD __size = (to)->dwSize; \
DWORD __copysize = min(__size,
(from)->dwSize);
\
DWORD __copysize = min(__size,
from_size);
\
assert(to != from); \
memcpy(to, from, __copysize); \
memset((char*)(to) + __copysize, 0, __size - __copysize); \
(to)->dwSize = __size;
/* restore size */
\
} while (0)
#define DD_STRUCT_COPY_BYSIZE(to,from) DD_STRUCT_COPY_BYSIZE_(to,from,(from)->dwSize)
#define SIZEOF_END_PADDING(type, last_field) \
(sizeof(type) - offsetof(type, last_field) - sizeof(((type *)0)->last_field))
static
inline
void
copy_to_surfacedesc2
(
DDSURFACEDESC2
*
to
,
DDSURFACEDESC2
*
from
)
{
DWORD
from_size
=
from
->
dwSize
;
if
(
from_size
==
sizeof
(
DDSURFACEDESC
))
from_size
-=
SIZEOF_END_PADDING
(
DDSURFACEDESC
,
ddsCaps
);
to
->
dwSize
=
sizeof
(
DDSURFACEDESC2
);
/* for struct copy */
DD_STRUCT_COPY_BYSIZE_
(
to
,
from
,
from_size
);
}
#endif
...
...
dlls/ddraw/surface.c
View file @
f7002c66
...
...
@@ -3565,9 +3565,7 @@ HRESULT ddraw_surface_init(IDirectDrawSurfaceImpl *surface, IDirectDrawImpl *ddr
surface
->
version
=
7
;
surface
->
ddraw
=
ddraw
;
surface
->
surface_desc
.
dwSize
=
sizeof
(
DDSURFACEDESC2
);
surface
->
surface_desc
.
u4
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
DDPIXELFORMAT
);
DD_STRUCT_COPY_BYSIZE
(
&
surface
->
surface_desc
,
desc
);
copy_to_surfacedesc2
(
&
surface
->
surface_desc
,
desc
);
surface
->
first_attached
=
surface
;
surface
->
ImplType
=
surface_type
;
...
...
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