Commit 4fdb45f2 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

ntdll/tests: Load NtMakeTemporaryObject() dynamically.

parent b4a5775f
......@@ -72,6 +72,7 @@ static NTSTATUS (WINAPI *pNtOpenThreadToken)(HANDLE,DWORD,BOOLEAN,HANDLE*);
static NTSTATUS (WINAPI *pNtDuplicateToken)(HANDLE,ACCESS_MASK,OBJECT_ATTRIBUTES*,BOOLEAN,TOKEN_TYPE,HANDLE*);
static NTSTATUS (WINAPI *pNtDuplicateObject)(HANDLE,HANDLE,HANDLE,HANDLE*,ACCESS_MASK,ULONG,ULONG);
static NTSTATUS (WINAPI *pNtCompareObjects)(HANDLE,HANDLE);
static NTSTATUS (WINAPI *pNtMakeTemporaryObject)(HANDLE);
#define KEYEDEVENT_WAIT 0x0001
#define KEYEDEVENT_WAKE 0x0002
......@@ -3258,6 +3259,12 @@ static void test_object_permanence(void)
NTSTATUS status;
BOOL creatpermapriv = FALSE;
if (!pNtMakeTemporaryObject)
{
win_skip( "NtMakeTemporaryObject is not available.\n" );
return;
}
status = NtOpenProcessToken( GetCurrentProcess(), TOKEN_DUPLICATE, &process_token );
ok( status == STATUS_SUCCESS, "NtOpenProcessToken returned %08lx\n", status );
......@@ -3320,7 +3327,7 @@ static void test_object_permanence(void)
if (test->make_temp_status == STATUS_SUCCESS)
ok( !!(obi.GrantedAccess & DELETE), "expected DELETE access in %08lx\n", obi.GrantedAccess );
status = NtMakeTemporaryObject( handle );
status = pNtMakeTemporaryObject( handle );
todo_wine_if(test->make_temp_status == STATUS_ACCESS_DENIED)
ok( status == test->make_temp_status, "NtMakeTemporaryObject returned %08lx\n", status );
if (!NT_ERROR(status)) is_permanent = FALSE;
......@@ -3372,7 +3379,7 @@ static void test_object_permanence(void)
ok( obi_new.Attributes == expect_attr, "expected attr %08lx, got %08lx\n", expect_attr, obi_new.Attributes );
/* ensure object is deleted */
NtMakeTemporaryObject( handle );
pNtMakeTemporaryObject( handle );
NtClose( handle );
}
winetest_pop_context();
......@@ -3429,6 +3436,7 @@ START_TEST(om)
pNtDuplicateToken = (void *)GetProcAddress(hntdll, "NtDuplicateToken");
pNtDuplicateObject = (void *)GetProcAddress(hntdll, "NtDuplicateObject");
pNtCompareObjects = (void *)GetProcAddress(hntdll, "NtCompareObjects");
pNtMakeTemporaryObject = (void *)GetProcAddress(hntdll, "NtMakeTemporaryObject");
test_null_in_object_name();
test_case_sensitive();
......
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