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
02ad6e72
Commit
02ad6e72
authored
Aug 08, 2005
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Aug 08, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test showing that Windows doesn't tie GDI objects to a
particular thread.
parent
934c6fa9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
+72
-0
gdiobj.c
dlls/gdi/tests/gdiobj.c
+72
-0
No files found.
dlls/gdi/tests/gdiobj.c
View file @
02ad6e72
...
@@ -325,6 +325,77 @@ static void test_text_extents(void)
...
@@ -325,6 +325,77 @@ static void test_text_extents(void)
ReleaseDC
(
NULL
,
hdc
);
ReleaseDC
(
NULL
,
hdc
);
}
}
struct
hgdiobj_event
{
HDC
hdc
;
HGDIOBJ
hgdiobj
;
HANDLE
stop_event
;
HANDLE
ready_event
;
};
static
DWORD
WINAPI
thread_proc
(
void
*
param
)
{
LOGPEN
lp
;
struct
hgdiobj_event
*
hgdiobj_event
=
(
struct
hgdiobj_event
*
)
param
;
hgdiobj_event
->
hdc
=
CreateDC
(
"display"
,
NULL
,
NULL
,
NULL
);
ok
(
hgdiobj_event
->
hdc
!=
NULL
,
"CreateDC error %ld
\n
"
,
GetLastError
());
hgdiobj_event
->
hgdiobj
=
CreatePen
(
PS_DASHDOTDOT
,
17
,
RGB
(
1
,
2
,
3
));
ok
(
hgdiobj_event
->
hgdiobj
!=
0
,
"Failed to create pen
\n
"
);
SetEvent
(
hgdiobj_event
->
ready_event
);
ok
(
WaitForSingleObject
(
hgdiobj_event
->
stop_event
,
INFINITE
)
==
WAIT_OBJECT_0
,
"WaitForSingleObject error %ld
\n
"
,
GetLastError
());
ok
(
!
GetObject
(
hgdiobj_event
->
hgdiobj
,
sizeof
(
lp
),
&
lp
),
"GetObject should fail
\n
"
);
ok
(
!
GetDeviceCaps
(
hgdiobj_event
->
hdc
,
TECHNOLOGY
),
"GetDeviceCaps(TECHNOLOGY) should fail
\n
"
);
return
0
;
}
static
void
test_thread_objects
(
void
)
{
LOGPEN
lp
;
DWORD
tid
;
HANDLE
hthread
;
struct
hgdiobj_event
hgdiobj_event
;
INT
ret
;
hgdiobj_event
.
stop_event
=
CreateEvent
(
NULL
,
0
,
0
,
NULL
);
ok
(
hgdiobj_event
.
stop_event
!=
NULL
,
"CreateEvent error %ld
\n
"
,
GetLastError
());
hgdiobj_event
.
ready_event
=
CreateEvent
(
NULL
,
0
,
0
,
NULL
);
ok
(
hgdiobj_event
.
ready_event
!=
NULL
,
"CreateEvent error %ld
\n
"
,
GetLastError
());
hthread
=
CreateThread
(
NULL
,
0
,
thread_proc
,
&
hgdiobj_event
,
0
,
&
tid
);
ok
(
hthread
!=
NULL
,
"CreateThread error %ld
\n
"
,
GetLastError
());
ok
(
WaitForSingleObject
(
hgdiobj_event
.
ready_event
,
INFINITE
)
==
WAIT_OBJECT_0
,
"WaitForSingleObject error %ld
\n
"
,
GetLastError
());
ok
(
GetObject
(
hgdiobj_event
.
hgdiobj
,
sizeof
(
lp
),
&
lp
)
==
sizeof
(
lp
),
"GetObject error %ld
\n
"
,
GetLastError
());
ok
(
lp
.
lopnStyle
==
PS_DASHDOTDOT
,
"wrong pen style %d
\n
"
,
lp
.
lopnStyle
);
ok
(
lp
.
lopnWidth
.
x
==
17
,
"wrong pen width.y %ld
\n
"
,
lp
.
lopnWidth
.
x
);
ok
(
lp
.
lopnWidth
.
y
==
0
,
"wrong pen width.y %ld
\n
"
,
lp
.
lopnWidth
.
y
);
ok
(
lp
.
lopnColor
==
RGB
(
1
,
2
,
3
),
"wrong pen width.y %08lx
\n
"
,
lp
.
lopnColor
);
ret
=
GetDeviceCaps
(
hgdiobj_event
.
hdc
,
TECHNOLOGY
);
ok
(
ret
==
DT_RASDISPLAY
,
"GetDeviceCaps(TECHNOLOGY) should return DT_RASDISPLAY not %d
\n
"
,
ret
);
ok
(
DeleteObject
(
hgdiobj_event
.
hgdiobj
),
"DeleteObject error %ld
\n
"
,
GetLastError
());
ok
(
DeleteDC
(
hgdiobj_event
.
hdc
),
"DeleteDC error %ld
\n
"
,
GetLastError
());
SetEvent
(
hgdiobj_event
.
stop_event
);
ok
(
WaitForSingleObject
(
hthread
,
INFINITE
)
==
WAIT_OBJECT_0
,
"WaitForSingleObject error %ld
\n
"
,
GetLastError
());
CloseHandle
(
hthread
);
CloseHandle
(
hgdiobj_event
.
stop_event
);
CloseHandle
(
hgdiobj_event
.
ready_event
);
}
START_TEST
(
gdiobj
)
START_TEST
(
gdiobj
)
{
{
test_logfont
();
test_logfont
();
...
@@ -332,4 +403,5 @@ START_TEST(gdiobj)
...
@@ -332,4 +403,5 @@ START_TEST(gdiobj)
test_gdi_objects
();
test_gdi_objects
();
test_GdiGetCharDimensions
();
test_GdiGetCharDimensions
();
test_text_extents
();
test_text_extents
();
test_thread_objects
();
}
}
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