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
f097da9f
Commit
f097da9f
authored
Jan 11, 2007
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 11, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add a simple DrawState test, make it pass under Wine.
parent
d06ff0ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
text.c
dlls/user32/tests/text.c
+43
-0
uitools.c
dlls/user32/uitools.c
+2
-0
No files found.
dlls/user32/tests/text.c
View file @
f097da9f
...
...
@@ -2,6 +2,7 @@
* DrawText tests
*
* Copyright (c) 2004 Zach Gorman
* Copyright 2007 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -243,11 +244,53 @@ static void test_TabbedText(void)
}
}
ReleaseDC
(
hwnd
,
hdc
);
DestroyWindow
(
hwnd
);
}
static
void
test_DrawState
(
void
)
{
static
const
char
text
[]
=
"Sample text string"
;
HWND
hwnd
;
HDC
hdc
;
BOOL
ret
;
hwnd
=
CreateWindowExA
(
0
,
"static"
,
NULL
,
WS_POPUP
,
0
,
0
,
200
,
200
,
0
,
0
,
0
,
NULL
);
assert
(
hwnd
);
hdc
=
GetDC
(
hwnd
);
assert
(
hdc
);
SetLastError
(
0xdeadbeef
);
ret
=
DrawState
(
hdc
,
GetStockObject
(
DKGRAY_BRUSH
),
NULL
,
(
LPARAM
)
text
,
strlen
(
text
),
0
,
0
,
10
,
10
,
DST_TEXT
);
ok
(
ret
,
"DrawState error %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
DrawState
(
hdc
,
GetStockObject
(
DKGRAY_BRUSH
),
NULL
,
(
LPARAM
)
text
,
0
,
0
,
0
,
10
,
10
,
DST_TEXT
);
ok
(
ret
,
"DrawState error %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
DrawState
(
hdc
,
GetStockObject
(
DKGRAY_BRUSH
),
NULL
,
0
,
strlen
(
text
),
0
,
0
,
10
,
10
,
DST_TEXT
);
ok
(
!
ret
,
"DrawState succeeded
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"not expected error %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
DrawState
(
hdc
,
GetStockObject
(
DKGRAY_BRUSH
),
NULL
,
0
,
0
,
0
,
0
,
10
,
10
,
DST_TEXT
);
ok
(
!
ret
,
"DrawState succeeded
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"not expected error %u
\n
"
,
GetLastError
());
ReleaseDC
(
hwnd
,
hdc
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
text
)
{
test_TabbedText
();
test_DrawTextCalcRect
();
test_DrawState
();
}
dlls/user32/uitools.c
View file @
f097da9f
...
...
@@ -1587,6 +1587,8 @@ static BOOL UITOOLS_DrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC func, LPARAM lp
if
((
opcode
==
DST_TEXT
||
opcode
==
DST_PREFIXTEXT
)
&&
!
len
)
/* The string is '\0' terminated */
{
if
(
!
lp
)
return
FALSE
;
if
(
unicode
)
len
=
strlenW
((
LPWSTR
)
lp
);
else
...
...
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