ntdll: Catch bad pointers in RtlWow64EnableFsRedirectionEx.
This commit is contained in:
parent
53d7355949
commit
aac478f51b
|
@ -3022,6 +3022,8 @@ NTSTATUS WINAPI RtlWow64EnableFsRedirection( BOOLEAN enable )
|
||||||
NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx( ULONG disable, ULONG *old_value )
|
NTSTATUS WINAPI RtlWow64EnableFsRedirectionEx( ULONG disable, ULONG *old_value )
|
||||||
{
|
{
|
||||||
if (!is_wow64) return STATUS_NOT_IMPLEMENTED;
|
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;
|
*old_value = !ntdll_get_thread_data()->wow64_redir;
|
||||||
ntdll_get_thread_data()->wow64_redir = !disable;
|
ntdll_get_thread_data()->wow64_redir = !disable;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
|
@ -287,6 +287,11 @@ static void test_redirection(void)
|
||||||
ok( !status, "RtlWow64EnableFsRedirectionEx failed status %x\n", status );
|
ok( !status, "RtlWow64EnableFsRedirectionEx failed status %x\n", status );
|
||||||
ok( !cur, "RtlWow64EnableFsRedirectionEx got %u\n", cur );
|
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 );
|
status = pRtlWow64EnableFsRedirection( FALSE );
|
||||||
ok( !status, "RtlWow64EnableFsRedirectionEx failed status %x\n", status );
|
ok( !status, "RtlWow64EnableFsRedirectionEx failed status %x\n", status );
|
||||||
status = pRtlWow64EnableFsRedirectionEx( FALSE, &cur );
|
status = pRtlWow64EnableFsRedirectionEx( FALSE, &cur );
|
||||||
|
|
Loading…
Reference in New Issue