Commit aac478f5 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

ntdll: Catch bad pointers in RtlWow64EnableFsRedirectionEx.

parent 53d73559
......@@ -3022,6 +3022,8 @@ 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;
ntdll_get_thread_data()->wow64_redir = !disable;
return STATUS_SUCCESS;
......
......@@ -287,6 +287,11 @@ static void test_redirection(void)
ok( !status, "RtlWow64EnableFsRedirectionEx failed status %x\n", status );
ok( !cur, "RtlWow64EnableFsRedirectionEx got %u\n", cur );
status = pRtlWow64EnableFsRedirectionEx( TRUE, NULL );
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 = pRtlWow64EnableFsRedirection( FALSE );
ok( !status, "RtlWow64EnableFsRedirectionEx failed status %x\n", status );
status = pRtlWow64EnableFsRedirectionEx( FALSE, &cur );
......
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