Commit 4a6bd3d2 authored by Matt Robinson's avatar Matt Robinson Committed by Alexandre Julliard

ntdll: Catch page fault in RtlWow64EnableFsRedirectionEx.

parent 9bc7aea4
......@@ -106,6 +106,7 @@
#include "wine/list.h"
#include "wine/library.h"
#include "wine/debug.h"
#include "wine/exception.h"
WINE_DEFAULT_DEBUG_CHANNEL(file);
......@@ -2996,9 +2997,17 @@ NTSTATUS WINAPI RtlWow64EnableFsRedirection( BOOLEAN enable )
NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx( ULONG disable, ULONG *old_value )
{
if (!is_wow64) return STATUS_NOT_IMPLEMENTED;
if (((ULONG_PTR)old_value >> 16) == 0) return STATUS_ACCESS_VIOLATION;
*old_value = !ntdll_get_thread_data()->wow64_redir;
__TRY
{
*old_value = !ntdll_get_thread_data()->wow64_redir;
}
__EXCEPT_PAGE_FAULT
{
return STATUS_ACCESS_VIOLATION;
}
__ENDTRY
ntdll_get_thread_data()->wow64_redir = !disable;
return STATUS_SUCCESS;
}
......
......@@ -861,6 +861,8 @@ static void test_redirection(void)
ok( status == STATUS_ACCESS_VIOLATION, "RtlWow64EnableFsRedirectionEx failed with status %x\n", status );
status = pRtlWow64EnableFsRedirectionEx( TRUE, (void*)1 );
ok( status == STATUS_ACCESS_VIOLATION, "RtlWow64EnableFsRedirectionEx failed with status %x\n", status );
status = pRtlWow64EnableFsRedirectionEx( TRUE, (void*)0xDEADBEEF );
ok( status == STATUS_ACCESS_VIOLATION, "RtlWow64EnableFsRedirectionEx failed with status %x\n", status );
status = pRtlWow64EnableFsRedirection( FALSE );
ok( !status, "RtlWow64EnableFsRedirectionEx failed status %x\n", status );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment