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
59a23fb4
Commit
59a23fb4
authored
Apr 22, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Apr 22, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Refuse to create new thread if the target process is being terminated.
parent
54df9c91
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
loader.c
dlls/kernel32/tests/loader.c
+7
-10
thread.c
dlls/ntdll/thread.c
+2
-0
No files found.
dlls/kernel32/tests/loader.c
View file @
59a23fb4
...
@@ -1183,7 +1183,6 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param)
...
@@ -1183,7 +1183,6 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param)
/* manual call to LdrShutdownProcess doesn't prevent thread creation */
/* manual call to LdrShutdownProcess doesn't prevent thread creation */
if
(
param
&&
test_dll_phase
!=
4
)
if
(
param
&&
test_dll_phase
!=
4
)
{
{
todo_wine
ok
(
!
handle
||
broken
(
handle
!=
0
)
/* before win7 */
,
"CreateThread should fail
\n
"
);
ok
(
!
handle
||
broken
(
handle
!=
0
)
/* before win7 */
,
"CreateThread should fail
\n
"
);
if
(
!
handle
)
if
(
!
handle
)
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected ERROR_ACCESS_DENIED, got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected ERROR_ACCESS_DENIED, got %d
\n
"
,
GetLastError
());
...
@@ -1192,16 +1191,15 @@ todo_wine
...
@@ -1192,16 +1191,15 @@ todo_wine
}
}
else
else
{
{
ok
(
handle
!=
0
,
"CreateThread error %d
\n
"
,
GetLastError
());
ret
=
WaitForSingleObject
(
handle
,
1000
);
/* FIXME: remove once Wine is fixed */
/* FIXME: remove once Wine is fixed */
if
(
test_dll_phase
==
4
)
todo_wine
if
(
test_dll_phase
==
4
)
todo_wine
{
{
ok
(
ret
==
WAIT_TIMEOUT
,
"expected WAIT_TIMEOUT, got %#x
\n
"
,
ret
);
ok
(
handle
!=
0
,
"CreateThread error %d
\n
"
,
GetLastError
());
ok
(
!
noop_thread_started
||
broken
(
noop_thread_started
)
/* XP64 */
,
"thread shouldn't start yet
\n
"
);
}
}
else
else
{
{
ok
(
handle
!=
0
,
"CreateThread error %d
\n
"
,
GetLastError
());
ret
=
WaitForSingleObject
(
handle
,
1000
);
ok
(
ret
==
WAIT_TIMEOUT
,
"expected WAIT_TIMEOUT, got %#x
\n
"
,
ret
);
ok
(
ret
==
WAIT_TIMEOUT
,
"expected WAIT_TIMEOUT, got %#x
\n
"
,
ret
);
ok
(
!
noop_thread_started
||
broken
(
noop_thread_started
)
/* XP64 */
,
"thread shouldn't start yet
\n
"
);
ok
(
!
noop_thread_started
||
broken
(
noop_thread_started
)
/* XP64 */
,
"thread shouldn't start yet
\n
"
);
}
}
...
@@ -1218,7 +1216,6 @@ todo_wine
...
@@ -1218,7 +1216,6 @@ todo_wine
/* manual call to LdrShutdownProcess doesn't prevent thread creation */
/* manual call to LdrShutdownProcess doesn't prevent thread creation */
if
(
param
&&
test_dll_phase
!=
4
)
if
(
param
&&
test_dll_phase
!=
4
)
{
{
todo_wine
ok
(
!
handle
||
broken
(
handle
!=
0
)
/* before win7 */
,
"CreateRemoteThread should fail
\n
"
);
ok
(
!
handle
||
broken
(
handle
!=
0
)
/* before win7 */
,
"CreateRemoteThread should fail
\n
"
);
if
(
!
handle
)
if
(
!
handle
)
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected ERROR_ACCESS_DENIED, got %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected ERROR_ACCESS_DENIED, got %d
\n
"
,
GetLastError
());
...
@@ -1227,19 +1224,19 @@ todo_wine
...
@@ -1227,19 +1224,19 @@ todo_wine
}
}
else
else
{
{
ok
(
handle
!=
0
,
"CreateRemoteThread error %d
\n
"
,
GetLastError
());
ret
=
WaitForSingleObject
(
handle
,
1000
);
/* FIXME: remove once Wine is fixed */
/* FIXME: remove once Wine is fixed */
if
(
test_dll_phase
==
4
)
todo_wine
if
(
test_dll_phase
==
4
)
todo_wine
{
{
ok
(
ret
==
WAIT_TIMEOUT
,
"expected WAIT_TIMEOUT, got %#x
\n
"
,
ret
);
ok
(
handle
!=
0
,
"CreateRemoteThread error %d
\n
"
,
GetLastError
());
ok
(
!
noop_thread_started
||
broken
(
noop_thread_started
)
/* XP64 */
,
"thread shouldn't start yet
\n
"
);
}
}
else
else
{
{
ok
(
handle
!=
0
,
"CreateRemoteThread error %d
\n
"
,
GetLastError
());
ret
=
WaitForSingleObject
(
handle
,
1000
);
ok
(
ret
==
WAIT_TIMEOUT
,
"expected WAIT_TIMEOUT, got %#x
\n
"
,
ret
);
ok
(
ret
==
WAIT_TIMEOUT
,
"expected WAIT_TIMEOUT, got %#x
\n
"
,
ret
);
ok
(
!
noop_thread_started
||
broken
(
noop_thread_started
)
/* XP64 */
,
"thread shouldn't start yet
\n
"
);
ok
(
!
noop_thread_started
||
broken
(
noop_thread_started
)
/* XP64 */
,
"thread shouldn't start yet
\n
"
);
}
}
CloseHandle
(
handle
);
}
}
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
...
...
dlls/ntdll/thread.c
View file @
59a23fb4
...
@@ -461,6 +461,8 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
...
@@ -461,6 +461,8 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
return
result
.
create_thread
.
status
;
return
result
.
create_thread
.
status
;
}
}
if
(
RtlDllShutdownInProgress
())
return
STATUS_ACCESS_DENIED
;
if
(
server_pipe
(
request_pipe
)
==
-
1
)
return
STATUS_TOO_MANY_OPENED_FILES
;
if
(
server_pipe
(
request_pipe
)
==
-
1
)
return
STATUS_TOO_MANY_OPENED_FILES
;
wine_server_send_fd
(
request_pipe
[
0
]
);
wine_server_send_fd
(
request_pipe
[
0
]
);
...
...
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