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
c3fe9ec2
Commit
c3fe9ec2
authored
Dec 20, 2007
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Dec 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Add a test for minimal acceptable DEVMODEA size, make it pass under Wine.
parent
18407eaf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
driver.c
dlls/gdi32/driver.c
+5
-0
dc.c
dlls/gdi32/tests/dc.c
+13
-0
No files found.
dlls/gdi32/driver.c
View file @
c3fe9ec2
...
...
@@ -414,6 +414,11 @@ DEVMODEW * WINAPI GdiConvertToDevmodeW(const DEVMODEA *dmA)
WORD
dmW_size
,
dmA_size
;
dmA_size
=
dmA
->
dmSize
;
/* this is the minimal dmSize that XP accepts */
if
(
dmA_size
<
FIELD_OFFSET
(
DEVMODEA
,
dmFields
))
return
NULL
;
if
(
dmA_size
>
sizeof
(
DEVMODEA
))
dmA_size
=
sizeof
(
DEVMODEA
);
...
...
dlls/gdi32/tests/dc.c
View file @
c3fe9ec2
...
...
@@ -222,6 +222,19 @@ static void test_GdiConvertToDevmodeW(void)
"expected %04x, got %04x
\n
"
,
FIELD_OFFSET
(
DEVMODEW
,
dmPanningHeight
)
+
sizeof
(
dmW
->
dmPanningHeight
),
dmW
->
dmSize
);
HeapFree
(
GetProcessHeap
(),
0
,
dmW
);
SetLastError
(
0xdeadbeef
);
dmA
.
dmSize
=
0
;
dmW
=
pGdiConvertToDevmodeW
(
&
dmA
);
ok
(
!
dmW
,
"GdiConvertToDevmodeW should fail
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"expected 0xdeadbeef, got %u
\n
"
,
GetLastError
());
/* this is the minimal dmSize that XP accepts */
dmA
.
dmSize
=
FIELD_OFFSET
(
DEVMODEA
,
dmFields
);
dmW
=
pGdiConvertToDevmodeW
(
&
dmA
);
ok
(
dmW
->
dmSize
==
FIELD_OFFSET
(
DEVMODEW
,
dmFields
),
"expected %04x, got %04x
\n
"
,
FIELD_OFFSET
(
DEVMODEW
,
dmFields
),
dmW
->
dmSize
);
HeapFree
(
GetProcessHeap
(),
0
,
dmW
);
}
START_TEST
(
dc
)
...
...
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