kernel32: Implement GetProcessDEPPolicy.

oldstable
Sebastian Lackner 2014-10-21 07:46:10 +02:00 committed by Alexandre Julliard
parent 19927ee517
commit d74c9e3ec2
2 changed files with 25 additions and 6 deletions

View File

@ -3942,9 +3942,31 @@ BOOL WINAPI GetNumaAvailableMemoryNode(UCHAR node, PULONGLONG available_bytes)
*/
BOOL WINAPI GetProcessDEPPolicy(HANDLE process, LPDWORD flags, PBOOL permanent)
{
FIXME("(%p %p %p): stub\n", process, flags, permanent);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
NTSTATUS status;
ULONG dep_flags;
TRACE("(%p %p %p)\n", process, flags, permanent);
status = NtQueryInformationProcess( GetCurrentProcess(), ProcessExecuteFlags,
&dep_flags, sizeof(dep_flags), NULL );
if (!status)
{
if (flags)
{
*flags = 0;
if (dep_flags & MEM_EXECUTE_OPTION_DISABLE)
*flags |= PROCESS_DEP_ENABLE;
if (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)
*flags |= PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION;
}
if (permanent)
*permanent = (dep_flags & MEM_EXECUTE_OPTION_PERMANENT) != 0;
}
if (status) SetLastError( RtlNtStatusToDosError(status) );
return !status;
}
/**********************************************************************

View File

@ -1995,7 +1995,6 @@ static void test_atl_thunk_emulation( ULONG dep_flags )
ok( success, "VirtualProtect failed %u\n", GetLastError() );
success = get_dep_policy( GetCurrentProcess(), &policy_flags, &policy_permanent );
todo_wine
ok( success, "GetProcessDEPPolicy failed %u\n", GetLastError() );
ret = 0;
@ -2004,9 +2003,7 @@ static void test_atl_thunk_emulation( ULONG dep_flags )
if (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)
ret |= PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION;
todo_wine
ok( policy_flags == ret, "expected policy flags %d, got %d\n", ret, policy_flags );
todo_wine
ok( !policy_permanent || broken(policy_permanent == 0x44),
"expected policy permanent FALSE, got %d\n", policy_permanent );
}