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
eca194da
Commit
eca194da
authored
Jul 30, 2007
by
Evan Stade
Committed by
Alexandre Julliard
Jul 31, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Handle PS_USERSTYLE in ExtCreatePen.
parent
ff5076c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
22 deletions
+34
-22
pen.c
dlls/gdi32/pen.c
+28
-4
pen.c
dlls/gdi32/tests/pen.c
+6
-18
No files found.
dlls/gdi32/pen.c
View file @
eca194da
...
...
@@ -123,14 +123,38 @@ HPEN WINAPI ExtCreatePen( DWORD style, DWORD width,
if
((
style
&
PS_STYLE_MASK
)
==
PS_USERSTYLE
)
{
if
(
!
style_count
||
(
style_count
>
16
)
||
!
style_bits
)
if
(((
INT
)
style_count
)
<=
0
)
return
0
;
if
((
style_count
>
16
)
||
!
style_bits
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
/* FIXME: PS_USERSTYLE workaround */
FIXME
(
"PS_USERSTYLE not handled
\n
"
);
style
=
(
style
&
~
PS_STYLE_MASK
)
|
PS_SOLID
;
if
((
style
&
PS_TYPE_MASK
)
==
PS_COSMETIC
)
{
/* FIXME: PS_USERSTYLE workaround */
FIXME
(
"PS_COSMETIC | PS_USERSTYLE not handled
\n
"
);
style
=
(
style
&
~
PS_STYLE_MASK
)
|
PS_SOLID
;
}
else
{
UINT
i
;
BOOL
has_neg
=
FALSE
,
all_zero
=
TRUE
;
for
(
i
=
0
;
(
i
<
style_count
)
&&
!
has_neg
;
i
++
)
{
has_neg
=
has_neg
||
(((
INT
)(
style_bits
[
i
]))
<
0
);
all_zero
=
all_zero
&&
(
style_bits
[
i
]
==
0
);
}
if
(
all_zero
||
has_neg
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
}
}
else
{
...
...
dlls/gdi32/tests/pen.c
View file @
eca194da
...
...
@@ -409,12 +409,6 @@ test_geometric_pens:
ok
(
ext_pen
.
elp
.
elpPenStyle
==
pen
[
i
].
ret_style
,
"expected %x, got %x
\n
"
,
pen
[
i
].
ret_style
,
ext_pen
.
elp
.
elpPenStyle
);
else
{
if
(
pen
[
i
].
style
==
PS_USERSTYLE
)
{
todo_wine
ok
(
ext_pen
.
elp
.
elpPenStyle
==
(
PS_GEOMETRIC
|
pen
[
i
].
style
),
"expected %x, got %x
\n
"
,
PS_GEOMETRIC
|
pen
[
i
].
style
,
ext_pen
.
elp
.
elpPenStyle
);
}
else
ok
(
ext_pen
.
elp
.
elpPenStyle
==
(
PS_GEOMETRIC
|
pen
[
i
].
style
),
"expected %x, got %x
\n
"
,
PS_GEOMETRIC
|
pen
[
i
].
style
,
ext_pen
.
elp
.
elpPenStyle
);
}
...
...
@@ -510,8 +504,7 @@ static void test_ps_userstyle(void)
pen
=
ExtCreatePen
(
PS_GEOMETRIC
|
PS_USERSTYLE
,
50
,
&
lb
,
0
,
style
);
ok
(
pen
==
0
,
"ExtCreatePen should fail
\n
"
);
todo_wine
expect
(
0xdeadbeef
,
GetLastError
());
expect
(
0xdeadbeef
,
GetLastError
());
DeleteObject
(
pen
);
SetLastError
(
0xdeadbeef
);
...
...
@@ -523,24 +516,19 @@ static void test_ps_userstyle(void)
pen
=
ExtCreatePen
(
PS_GEOMETRIC
|
PS_USERSTYLE
,
50
,
&
lb
,
-
1
,
style
);
ok
(
pen
==
0
,
"ExtCreatePen should fail
\n
"
);
todo_wine
expect
(
0xdeadbeef
,
GetLastError
());
expect
(
0xdeadbeef
,
GetLastError
());
DeleteObject
(
pen
);
SetLastError
(
0xdeadbeef
);
pen
=
ExtCreatePen
(
PS_GEOMETRIC
|
PS_USERSTYLE
,
50
,
&
lb
,
5
,
bad_style
);
todo_wine
ok
(
pen
==
0
,
"ExtCreatePen should fail
\n
"
);
todo_wine
expect
(
ERROR_INVALID_PARAMETER
,
GetLastError
());
ok
(
pen
==
0
,
"ExtCreatePen should fail
\n
"
);
expect
(
ERROR_INVALID_PARAMETER
,
GetLastError
());
DeleteObject
(
pen
);
SetLastError
(
0xdeadbeef
);
pen
=
ExtCreatePen
(
PS_GEOMETRIC
|
PS_USERSTYLE
,
50
,
&
lb
,
5
,
bad_style2
);
todo_wine
ok
(
pen
==
0
,
"ExtCreatePen should fail
\n
"
);
todo_wine
expect
(
ERROR_INVALID_PARAMETER
,
GetLastError
());
ok
(
pen
==
0
,
"ExtCreatePen should fail
\n
"
);
expect
(
ERROR_INVALID_PARAMETER
,
GetLastError
());
DeleteObject
(
pen
);
SetLastError
(
0xdeadbeef
);
...
...
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