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
93c59714
Commit
93c59714
authored
Sep 05, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Inherit default activation context from creation thread.
parent
ab08d2a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
thread.c
dlls/kernel32/tests/thread.c
+11
-3
thread.c
dlls/ntdll/thread.c
+16
-1
No files found.
dlls/kernel32/tests/thread.c
View file @
93c59714
...
...
@@ -287,7 +287,6 @@ static DWORD WINAPI thread_actctx_func(void *p)
cur
=
(
void
*
)
0xdeadbeef
;
ret
=
pGetCurrentActCtx
(
&
cur
);
ok
(
ret
,
"thread GetCurrentActCtx failed, %u
\n
"
,
GetLastError
());
todo_wine
ok
(
cur
==
param
->
handle
,
"got %p, expected %p
\n
"
,
cur
,
param
->
handle
);
param
->
thread_context
=
cur
;
...
...
@@ -1550,6 +1549,17 @@ static void test_thread_actctx(void)
ok
(
b
,
"GetCurentActCtx failed: %u
\n
"
,
GetLastError
());
ok
(
handle
==
0
,
"active context %p
\n
"
,
handle
);
/* without active context */
param
.
thread_context
=
(
void
*
)
0xdeadbeef
;
param
.
handle
=
NULL
;
thread
=
CreateThread
(
NULL
,
0
,
thread_actctx_func
,
&
param
,
0
,
&
tid
);
ok
(
thread
!=
NULL
,
"failed, got %u
\n
"
,
GetLastError
());
ret
=
WaitForSingleObject
(
thread
,
1000
);
ok
(
ret
==
WAIT_OBJECT_0
,
"wait timeout
\n
"
);
ok
(
param
.
thread_context
==
NULL
,
"got wrong thread context %p
\n
"
,
param
.
thread_context
);
CloseHandle
(
thread
);
b
=
pActivateActCtx
(
context
,
&
cookie
);
ok
(
b
,
"activation failed: %u
\n
"
,
GetLastError
());
...
...
@@ -1568,7 +1578,6 @@ static void test_thread_actctx(void)
ret
=
WaitForSingleObject
(
thread
,
1000
);
ok
(
ret
==
WAIT_OBJECT_0
,
"wait timeout
\n
"
);
todo_wine
ok
(
param
.
thread_context
==
context
,
"got wrong thread context %p, %p
\n
"
,
param
.
thread_context
,
context
);
CloseHandle
(
thread
);
...
...
@@ -1579,7 +1588,6 @@ todo_wine
ret
=
WaitForSingleObject
(
thread
,
1000
);
ok
(
ret
==
WAIT_OBJECT_0
,
"wait timeout
\n
"
);
todo_wine
ok
(
param
.
thread_context
==
context
,
"got wrong thread context %p, %p
\n
"
,
param
.
thread_context
,
context
);
CloseHandle
(
thread
);
...
...
dlls/ntdll/thread.c
View file @
93c59714
...
...
@@ -432,7 +432,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
pthread_attr_t
attr
;
struct
ntdll_thread_data
*
thread_data
;
struct
startup_info
*
info
=
NULL
;
HANDLE
handle
=
0
;
HANDLE
handle
=
0
,
actctx
=
0
;
TEB
*
teb
=
NULL
;
DWORD
tid
=
0
;
int
request_pipe
[
2
];
...
...
@@ -497,6 +497,21 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
teb
->
StaticUnicodeString
.
Buffer
=
teb
->
StaticUnicodeBuffer
;
teb
->
StaticUnicodeString
.
MaximumLength
=
sizeof
(
teb
->
StaticUnicodeBuffer
);
/* create default activation context frame for new thread */
RtlGetActiveActivationContext
(
&
actctx
);
if
(
actctx
)
{
RTL_ACTIVATION_CONTEXT_STACK_FRAME
*
frame
;
frame
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
sizeof
(
*
frame
));
frame
->
Previous
=
NULL
;
frame
->
ActivationContext
=
actctx
;
frame
->
Flags
=
0
;
teb
->
ActivationContextStack
.
ActiveFrame
=
frame
;
RtlAddRefActivationContext
(
actctx
);
}
info
=
(
struct
startup_info
*
)(
teb
+
1
);
info
->
teb
=
teb
;
info
->
entry_point
=
start
;
...
...
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