kernel32: Implement GetProcessDEPPolicy.
This commit is contained in:
parent
19927ee517
commit
d74c9e3ec2
|
@ -3942,9 +3942,31 @@ BOOL WINAPI GetNumaAvailableMemoryNode(UCHAR node, PULONGLONG available_bytes)
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI GetProcessDEPPolicy(HANDLE process, LPDWORD flags, PBOOL permanent)
|
BOOL WINAPI GetProcessDEPPolicy(HANDLE process, LPDWORD flags, PBOOL permanent)
|
||||||
{
|
{
|
||||||
FIXME("(%p %p %p): stub\n", process, flags, permanent);
|
NTSTATUS status;
|
||||||
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
ULONG dep_flags;
|
||||||
return FALSE;
|
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
|
|
|
@ -1995,7 +1995,6 @@ static void test_atl_thunk_emulation( ULONG dep_flags )
|
||||||
ok( success, "VirtualProtect failed %u\n", GetLastError() );
|
ok( success, "VirtualProtect failed %u\n", GetLastError() );
|
||||||
|
|
||||||
success = get_dep_policy( GetCurrentProcess(), &policy_flags, &policy_permanent );
|
success = get_dep_policy( GetCurrentProcess(), &policy_flags, &policy_permanent );
|
||||||
todo_wine
|
|
||||||
ok( success, "GetProcessDEPPolicy failed %u\n", GetLastError() );
|
ok( success, "GetProcessDEPPolicy failed %u\n", GetLastError() );
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
@ -2004,9 +2003,7 @@ static void test_atl_thunk_emulation( ULONG dep_flags )
|
||||||
if (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)
|
if (dep_flags & MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION)
|
||||||
ret |= PROCESS_DEP_DISABLE_ATL_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 );
|
ok( policy_flags == ret, "expected policy flags %d, got %d\n", ret, policy_flags );
|
||||||
todo_wine
|
|
||||||
ok( !policy_permanent || broken(policy_permanent == 0x44),
|
ok( !policy_permanent || broken(policy_permanent == 0x44),
|
||||||
"expected policy permanent FALSE, got %d\n", policy_permanent );
|
"expected policy permanent FALSE, got %d\n", policy_permanent );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue