Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
becccaf1
Commit
becccaf1
authored
Aug 15, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trap exceptions in RtlImageNtHeader.
parent
1da29717
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
loader.c
dlls/ntdll/loader.c
+26
-6
No files found.
dlls/ntdll/loader.c
View file @
becccaf1
...
...
@@ -22,11 +22,21 @@
#include "ntddk.h"
#include "module.h"
#include "wine/exception.h"
#include "msvcrt/excpt.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ntdll
);
/* filter for page-fault exceptions */
static
WINE_EXCEPTION_FILTER
(
page_fault
)
{
if
(
GetExceptionCode
()
==
EXCEPTION_ACCESS_VIOLATION
)
return
EXCEPTION_EXECUTE_HANDLER
;
return
EXCEPTION_CONTINUE_SEARCH
;
}
NTSTATUS
WINAPI
LdrDisableThreadCalloutsForDll
(
HANDLE
hModule
)
{
if
(
DisableThreadLibraryCalls
(
hModule
))
...
...
@@ -75,14 +85,24 @@ NTSTATUS WINAPI LdrGetProcedureAddress(PVOID base, PANSI_STRING name, ULONG ord,
*/
PIMAGE_NT_HEADERS
WINAPI
RtlImageNtHeader
(
HMODULE
hModule
)
{
IMAGE_NT_HEADERS
*
ret
=
NULL
;
IMAGE_DOS_HEADER
*
dos
=
(
IMAGE_DOS_HEADER
*
)
hModule
;
IMAGE_NT_HEADERS
*
ret
;
if
(
dos
->
e_magic
==
IMAGE_DOS_SIGNATURE
)
__TRY
{
IMAGE_DOS_HEADER
*
dos
=
(
IMAGE_DOS_HEADER
*
)
hModule
;
ret
=
NULL
;
if
(
dos
->
e_magic
==
IMAGE_DOS_SIGNATURE
)
{
ret
=
(
IMAGE_NT_HEADERS
*
)((
char
*
)
dos
+
dos
->
e_lfanew
);
if
(
ret
->
Signature
!=
IMAGE_NT_SIGNATURE
)
ret
=
NULL
;
}
}
__EXCEPT
(
page_fault
)
{
ret
=
(
IMAGE_NT_HEADERS
*
)((
char
*
)
dos
+
dos
->
e_lfanew
);
if
(
ret
->
Signature
!=
IMAGE_NT_SIGNATURE
)
ret
=
NULL
;
return
NULL
;
}
__ENDTRY
return
ret
;
}
...
...
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