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
90d3b9a3
Commit
90d3b9a3
authored
Jul 29, 2021
by
Paul Gofman
Committed by
Alexandre Julliard
Jul 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Don't allow converting thread to fiber more than once.
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
15bc6052
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
fiber.c
dlls/kernel32/tests/fiber.c
+14
-0
thread.c
dlls/kernelbase/thread.c
+6
-0
No files found.
dlls/kernel32/tests/fiber.c
View file @
90d3b9a3
...
...
@@ -128,10 +128,17 @@ static VOID WINAPI FiberMainProc(LPVOID lpFiberParameter)
static
void
test_ConvertThreadToFiber
(
void
)
{
void
*
ret
;
if
(
pConvertThreadToFiber
)
{
fibers
[
0
]
=
pConvertThreadToFiber
(
&
testparam
);
ok
(
fibers
[
0
]
!=
NULL
,
"ConvertThreadToFiber failed with error %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pConvertThreadToFiber
(
&
testparam
);
ok
(
!
ret
,
"Got non NULL ret.
\n
"
);
ok
(
GetLastError
()
==
ERROR_ALREADY_FIBER
,
"Got unexpected error %u.
\n
"
,
GetLastError
());
}
else
{
...
...
@@ -141,10 +148,17 @@ static void test_ConvertThreadToFiber(void)
static
void
test_ConvertThreadToFiberEx
(
void
)
{
void
*
ret
;
if
(
pConvertThreadToFiberEx
)
{
fibers
[
0
]
=
pConvertThreadToFiberEx
(
&
testparam
,
0
);
ok
(
fibers
[
0
]
!=
NULL
,
"ConvertThreadToFiberEx failed with error %u
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pConvertThreadToFiberEx
(
&
testparam
,
0
);
ok
(
!
ret
,
"Got non NULL ret.
\n
"
);
ok
(
GetLastError
()
==
ERROR_ALREADY_FIBER
,
"Got unexpected error %u.
\n
"
,
GetLastError
());
}
else
{
...
...
dlls/kernelbase/thread.c
View file @
90d3b9a3
...
...
@@ -990,6 +990,12 @@ LPVOID WINAPI DECLSPEC_HOTPATCH ConvertThreadToFiberEx( LPVOID param, DWORD flag
{
struct
fiber_data
*
fiber
;
if
(
NtCurrentTeb
()
->
Tib
.
u
.
FiberData
)
{
SetLastError
(
ERROR_ALREADY_FIBER
);
return
NULL
;
}
if
(
!
(
fiber
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
fiber
)
)))
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
...
...
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