Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Mayr
wine
Commits
ea6f3a4c
Commit
ea6f3a4c
authored
19 years ago
by
Robert Shearman
Committed by
Alexandre Julliard
19 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ntdll: Move the call to MODULE_DllThreadAttach from the kernel32
thread creation function to the NTDLL one.
parent
2d15c8fb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
dlls/kernel/thread.c
+0
-2
0 additions, 2 deletions
dlls/kernel/thread.c
dlls/ntdll/ntdll.spec
+0
-5
0 additions, 5 deletions
dlls/ntdll/ntdll.spec
dlls/ntdll/ntdll_misc.h
+1
-0
1 addition, 0 deletions
dlls/ntdll/ntdll_misc.h
dlls/ntdll/thread.c
+38
-0
38 additions, 0 deletions
dlls/ntdll/thread.c
with
39 additions
and
7 deletions
dlls/kernel/thread.c
+
0
−
2
View file @
ea6f3a4c
...
...
@@ -54,7 +54,6 @@ struct new_thread_info
void
*
arg
;
};
extern
NTSTATUS
MODULE_DllThreadAttach
(
LPVOID
lpReserved
);
/* FIXME */
/***********************************************************************
* THREAD_Start
...
...
@@ -74,7 +73,6 @@ static void CALLBACK THREAD_Start( void *ptr )
__TRY
{
MODULE_DllThreadAttach
(
NULL
);
ExitThread
(
func
(
arg
)
);
}
__EXCEPT
(
UnhandledExceptionFilter
)
...
...
This diff is collapsed.
Click to expand it.
dlls/ntdll/ntdll.spec
+
0
−
5
View file @
ea6f3a4c
...
...
@@ -1390,8 +1390,3 @@
@ cdecl wine_nt_to_unix_file_name(ptr ptr long long)
@ cdecl wine_unix_to_nt_file_name(ptr ptr)
@ cdecl __wine_init_windows_dir(wstr wstr)
################################################################
# Wine dll separation hacks, these will go away, don't use them
#
@ cdecl MODULE_DllThreadAttach(ptr)
This diff is collapsed.
Click to expand it.
dlls/ntdll/ntdll_misc.h
+
1
−
0
View file @
ea6f3a4c
...
...
@@ -60,6 +60,7 @@ extern void DECLSPEC_NORETURN server_exit_thread( int status );
extern
void
DECLSPEC_NORETURN
server_abort_thread
(
int
status
);
/* module handling */
extern
NTSTATUS
MODULE_DllThreadAttach
(
LPVOID
lpReserved
);
extern
FARPROC
RELAY_GetProcAddress
(
HMODULE
module
,
const
IMAGE_EXPORT_DIRECTORY
*
exports
,
DWORD
exp_size
,
FARPROC
proc
,
DWORD
ordinal
,
const
WCHAR
*
user
);
extern
FARPROC
SNOOP_GetProcAddress
(
HMODULE
hmod
,
const
IMAGE_EXPORT_DIRECTORY
*
exports
,
DWORD
exp_size
,
...
...
This diff is collapsed.
Click to expand it.
dlls/ntdll/thread.c
+
38
−
0
View file @
ea6f3a4c
...
...
@@ -39,6 +39,7 @@
#include
"wine/pthread.h"
#include
"wine/debug.h"
#include
"ntdll_misc.h"
#include
"wine/exception.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
thread
);
...
...
@@ -273,6 +274,26 @@ HANDLE thread_init(void)
return
exe_file
;
}
typedef
ULONG
(
WINAPI
*
PUNHANDLED_EXCEPTION_FILTER
)(
PEXCEPTION_POINTERS
);
static
PUNHANDLED_EXCEPTION_FILTER
get_unhandled_exception_filter
(
void
)
{
static
PUNHANDLED_EXCEPTION_FILTER
unhandled_exception_filter
;
static
const
WCHAR
kernel32W
[]
=
{
'k'
,
'e'
,
'r'
,
'n'
,
'e'
,
'l'
,
'3'
,
'2'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
UNICODE_STRING
module_name
;
ANSI_STRING
func_name
;
HMODULE
kernel32_handle
;
if
(
unhandled_exception_filter
)
return
unhandled_exception_filter
;
RtlInitUnicodeString
(
&
module_name
,
kernel32W
);
RtlInitAnsiString
(
&
func_name
,
"UnhandledExceptionFilter"
);
if
(
LdrGetDllHandle
(
0
,
0
,
&
module_name
,
&
kernel32_handle
)
==
STATUS_SUCCESS
)
LdrGetProcedureAddress
(
kernel32_handle
,
&
func_name
,
0
,
(
void
**
)
&
unhandled_exception_filter
);
return
unhandled_exception_filter
;
}
/***********************************************************************
* start_thread
...
...
@@ -316,6 +337,23 @@ static void start_thread( struct wine_pthread_thread_info *info )
InsertHeadList
(
&
tls_links
,
&
teb
->
TlsLinks
);
RtlReleasePebLock
();
/* NOTE: Windows does not have an exception handler around the call to
* the thread attach. We do for ease of debugging */
if
(
get_unhandled_exception_filter
())
{
__TRY
{
MODULE_DllThreadAttach
(
NULL
);
}
__EXCEPT
(
get_unhandled_exception_filter
())
{
NtTerminateThread
(
GetCurrentThread
(),
GetExceptionCode
()
);
}
__ENDTRY
}
else
MODULE_DllThreadAttach
(
NULL
);
func
(
arg
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment