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
54b1d87d
Commit
54b1d87d
authored
Oct 28, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented Add/RemoveVectoredExceptionHandler.
parent
1dd53254
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
2 deletions
+97
-2
kernel32.spec
dlls/kernel/kernel32.spec
+2
-0
exception.c
dlls/ntdll/exception.c
+88
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+2
-0
winbase.h
include/winbase.h
+2
-2
winnt.h
include/winnt.h
+1
-0
winternl.h
include/winternl.h
+2
-0
No files found.
dlls/kernel/kernel32.spec
View file @
54b1d87d
...
...
@@ -135,6 +135,7 @@
@ stdcall AddAtomA(str)
@ stdcall AddAtomW(wstr)
@ stdcall AddVectoredExceptionHandler(long ptr) ntdll.RtlAddVectoredExceptionHandler
@ stdcall AllocConsole()
@ stub AllocLSCallback
@ stdcall AllocSLCallback(ptr ptr)
...
...
@@ -690,6 +691,7 @@
@ stdcall ReplaceFileW(wstr wstr wstr long ptr ptr)
@ stdcall RemoveDirectoryA(str)
@ stdcall RemoveDirectoryW(wstr)
@ stdcall RemoveVectoredExceptionHandler(ptr) ntdll.RtlRemoveVectoredExceptionHandler
@ stub RequestDeviceWakeup
@ stdcall RequestWakeupLatency(long)
@ stdcall ResetEvent(long)
...
...
dlls/ntdll/exception.c
View file @
54b1d87d
...
...
@@ -33,6 +33,7 @@
#include "winternl.h"
#include "wine/exception.h"
#include "wine/server.h"
#include "wine/list.h"
#include "wine/debug.h"
#include "excpt.h"
...
...
@@ -45,6 +46,23 @@ typedef struct
EXCEPTION_REGISTRATION_RECORD
*
prevFrame
;
}
EXC_NESTED_FRAME
;
typedef
struct
{
struct
list
entry
;
PVECTORED_EXCEPTION_HANDLER
func
;
}
VECTORED_HANDLER
;
static
struct
list
vectored_handlers
=
LIST_INIT
(
vectored_handlers
);
static
CRITICAL_SECTION
vectored_handlers_section
;
static
CRITICAL_SECTION_DEBUG
critsect_debug
=
{
0
,
0
,
&
vectored_handlers_section
,
{
&
critsect_debug
.
ProcessLocksList
,
&
critsect_debug
.
ProcessLocksList
},
0
,
0
,
{
0
,
(
DWORD
)(
__FILE__
": vectored_handlers_section"
)
}
};
static
CRITICAL_SECTION
vectored_handlers_section
=
{
&
critsect_debug
,
-
1
,
0
,
0
,
0
,
0
};
#ifdef __i386__
# define GET_IP(context) ((LPVOID)(context)->Eip)
#elif defined(__sparc__)
...
...
@@ -159,6 +177,32 @@ static int send_debug_event( EXCEPTION_RECORD *rec, int first_chance, CONTEXT *c
}
/**********************************************************************
* call_vectored_handlers
*
* Call the vectored handlers chain.
*/
static
LONG
call_vectored_handlers
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
context
)
{
struct
list
*
ptr
;
LONG
ret
=
EXCEPTION_CONTINUE_SEARCH
;
EXCEPTION_POINTERS
except_ptrs
;
except_ptrs
.
ExceptionRecord
=
rec
;
except_ptrs
.
ContextRecord
=
context
;
RtlEnterCriticalSection
(
&
vectored_handlers_section
);
LIST_FOR_EACH
(
ptr
,
&
vectored_handlers
)
{
VECTORED_HANDLER
*
handler
=
LIST_ENTRY
(
ptr
,
VECTORED_HANDLER
,
entry
);
ret
=
handler
->
func
(
&
except_ptrs
);
if
(
ret
==
EXCEPTION_CONTINUE_EXECUTION
)
break
;
}
RtlLeaveCriticalSection
(
&
vectored_handlers_section
);
return
ret
;
}
/*******************************************************************
* EXC_DefaultHandling
*
...
...
@@ -199,6 +243,8 @@ void WINAPI EXC_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context )
SIGNAL_Unblock
();
/* we may be in a signal handler, and exception handlers may jump out */
if
(
call_vectored_handlers
(
rec
,
context
)
==
EXCEPTION_CONTINUE_EXECUTION
)
return
;
frame
=
NtCurrentTeb
()
->
Tib
.
ExceptionList
;
nested_frame
=
NULL
;
while
(
frame
!=
(
PEXCEPTION_REGISTRATION_RECORD
)
~
0UL
)
...
...
@@ -358,6 +404,48 @@ void WINAPI RtlRaiseStatus( NTSTATUS status )
}
/*******************************************************************
* RtlAddVectoredExceptionHandler (NTDLL.@)
*/
PVOID
WINAPI
RtlAddVectoredExceptionHandler
(
ULONG
first
,
PVECTORED_EXCEPTION_HANDLER
func
)
{
VECTORED_HANDLER
*
handler
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
sizeof
(
*
handler
)
);
if
(
handler
)
{
handler
->
func
=
func
;
RtlEnterCriticalSection
(
&
vectored_handlers_section
);
if
(
first
)
list_add_head
(
&
vectored_handlers
,
&
handler
->
entry
);
else
list_add_tail
(
&
vectored_handlers
,
&
handler
->
entry
);
RtlLeaveCriticalSection
(
&
vectored_handlers_section
);
}
return
handler
;
}
/*******************************************************************
* RtlRemoveVectoredExceptionHandler (NTDLL.@)
*/
ULONG
WINAPI
RtlRemoveVectoredExceptionHandler
(
PVOID
handler
)
{
struct
list
*
ptr
;
ULONG
ret
=
FALSE
;
RtlEnterCriticalSection
(
&
vectored_handlers_section
);
LIST_FOR_EACH
(
ptr
,
&
vectored_handlers
)
{
if
(
ptr
==
&
((
VECTORED_HANDLER
*
)
handler
)
->
entry
)
{
list_remove
(
ptr
);
ret
=
TRUE
;
break
;
}
}
RtlLeaveCriticalSection
(
&
vectored_handlers_section
);
if
(
ret
)
RtlFreeHeap
(
GetProcessHeap
(),
0
,
handler
);
return
ret
;
}
/*************************************************************
* __wine_exception_handler (NTDLL.@)
*
...
...
dlls/ntdll/ntdll.spec
View file @
54b1d87d
...
...
@@ -276,6 +276,7 @@
@ stub RtlAddActionToRXact
@ stub RtlAddAttributeActionToRXact
@ stub RtlAddAuditAccessAce
@ stdcall RtlAddVectoredExceptionHandler(long ptr)
@ stdcall RtlAdjustPrivilege(long long long long)
@ stdcall RtlAllocateAndInitializeSid (ptr long long long long long long long long long ptr)
@ stdcall RtlAllocateHeap(long long long)
...
...
@@ -505,6 +506,7 @@
@ stdcall RtlReleasePebLock()
@ stdcall RtlReleaseResource(ptr)
@ stub RtlRemoteCall
@ stdcall RtlRemoveVectoredExceptionHandler(ptr)
@ stub RtlResetRtlTranslations
@ stub RtlRunDecodeUnicodeString
@ stub RtlRunEncodeUnicodeString
...
...
include/winbase.h
View file @
54b1d87d
...
...
@@ -1089,9 +1089,8 @@ BOOL WINAPI GetBinaryTypeA( LPCSTR lpApplicationName, LPDWORD lpBinaryType );
BOOL
WINAPI
GetBinaryTypeW
(
LPCWSTR
lpApplicationName
,
LPDWORD
lpBinaryType
);
#define GetBinaryType WINELIB_NAME_AW(GetBinaryType)
/* Declarations for functions that exist only in Win32 */
BOOL
WINAPI
AddAccessAllowedAce
(
PACL
,
DWORD
,
DWORD
,
PSID
);
PVOID
WINAPI
AddVectoredExceptionHandler
(
ULONG
,
PVECTORED_EXCEPTION_HANDLER
);
BOOL
WINAPI
AttachThreadInput
(
DWORD
,
DWORD
,
BOOL
);
BOOL
WINAPI
AccessCheck
(
PSECURITY_DESCRIPTOR
,
HANDLE
,
DWORD
,
PGENERIC_MAPPING
,
PPRIVILEGE_SET
,
LPDWORD
,
LPDWORD
,
LPBOOL
);
BOOL
WINAPI
AdjustTokenPrivileges
(
HANDLE
,
BOOL
,
LPVOID
,
DWORD
,
LPVOID
,
LPDWORD
);
...
...
@@ -1409,6 +1408,7 @@ HANDLE WINAPI RegisterEventSourceW(LPCWSTR,LPCWSTR);
#define RegisterEventSource WINELIB_NAME_AW(RegisterEventSource)
BOOL
WINAPI
ReleaseMutex
(
HANDLE
);
BOOL
WINAPI
ReleaseSemaphore
(
HANDLE
,
LONG
,
LPLONG
);
ULONG
WINAPI
RemoveVectoredExceptionHandler
(
PVOID
);
BOOL
WINAPI
ReportEventA
(
HANDLE
,
WORD
,
WORD
,
DWORD
,
PSID
,
WORD
,
DWORD
,
LPCSTR
*
,
LPVOID
);
BOOL
WINAPI
ReportEventW
(
HANDLE
,
WORD
,
WORD
,
DWORD
,
PSID
,
WORD
,
DWORD
,
LPCWSTR
*
,
LPVOID
);
BOOL
WINAPI
RequestWakeupLatency
(
LATENCY_TIME
latency
);
...
...
include/winnt.h
View file @
54b1d87d
...
...
@@ -1633,6 +1633,7 @@ typedef struct _EXCEPTION_REGISTRATION_RECORD
* function pointer to a exception filter
*/
typedef
LONG
(
CALLBACK
*
PVECTORED_EXCEPTION_HANDLER
)(
PEXCEPTION_POINTERS
ExceptionInfo
);
typedef
LONG
(
CALLBACK
*
PTOP_LEVEL_EXCEPTION_FILTER
)(
PEXCEPTION_POINTERS
ExceptionInfo
);
typedef
PTOP_LEVEL_EXCEPTION_FILTER
LPTOP_LEVEL_EXCEPTION_FILTER
;
...
...
include/winternl.h
View file @
54b1d87d
...
...
@@ -1054,6 +1054,7 @@ NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL,DWORD,DWORD,PSID);
NTSTATUS
WINAPI
RtlAddAccessAllowedAceEx
(
PACL
,
DWORD
,
DWORD
,
DWORD
,
PSID
);
NTSTATUS
WINAPI
RtlAddAccessDeniedAce
(
PACL
,
DWORD
,
DWORD
,
PSID
);
NTSTATUS
WINAPI
RtlAddAccessDeniedAceEx
(
PACL
,
DWORD
,
DWORD
,
DWORD
,
PSID
);
PVOID
WINAPI
RtlAddVectoredExceptionHandler
(
ULONG
,
PVECTORED_EXCEPTION_HANDLER
);
DWORD
WINAPI
RtlAdjustPrivilege
(
DWORD
,
DWORD
,
DWORD
,
DWORD
);
BOOLEAN
WINAPI
RtlAllocateAndInitializeSid
(
PSID_IDENTIFIER_AUTHORITY
,
BYTE
,
DWORD
,
DWORD
,
DWORD
,
DWORD
,
DWORD
,
DWORD
,
DWORD
,
DWORD
,
PSID
*
);
PVOID
WINAPI
RtlAllocateHeap
(
HANDLE
,
ULONG
,
ULONG
);
...
...
@@ -1231,6 +1232,7 @@ ULONG WINAPI RtlRandom(PULONG);
PVOID
WINAPI
RtlReAllocateHeap
(
HANDLE
,
ULONG
,
PVOID
,
ULONG
);
void
WINAPI
RtlReleasePebLock
(
void
);
void
WINAPI
RtlReleaseResource
(
LPRTL_RWLOCK
);
ULONG
WINAPI
RtlRemoveVectoredExceptionHandler
(
PVOID
);
void
WINAPI
RtlSecondsSince1970ToTime
(
DWORD
,
LARGE_INTEGER
*
);
void
WINAPI
RtlSecondsSince1980ToTime
(
DWORD
,
LARGE_INTEGER
*
);
...
...
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