From 58272e652f95792a96bfdc5044fc778f7e63ac64 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sat, 11 Aug 2007 08:52:38 +0000 Subject: [PATCH] Adding dx test from my win32kdxtest to win32knapi test. win32kdxtest are more like a analysis tools to examine some struct and dumping it, win32knapi is true test tools svn path=/trunk/; revision=28279 --- .../w32knapi/ntdd/NtGdiDdCreateDirectDrawObject.c | 10 +++++++--- .../w32knapi/ntdd/NtGdiDdDeleteDirectDrawObject.c | 14 +++++++++++++- rostests/apitests/w32knapi/testlist.c | 3 ++- rostests/apitests/w32knapi/w32knapi.c | 2 +- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/rostests/apitests/w32knapi/ntdd/NtGdiDdCreateDirectDrawObject.c b/rostests/apitests/w32knapi/ntdd/NtGdiDdCreateDirectDrawObject.c index 8ed753836c3..80b94d4e249 100644 --- a/rostests/apitests/w32knapi/ntdd/NtGdiDdCreateDirectDrawObject.c +++ b/rostests/apitests/w32knapi/ntdd/NtGdiDdCreateDirectDrawObject.c @@ -1,5 +1,6 @@ #include "../w32knapi.h" + W32KAPI HANDLE APIENTRY @@ -13,14 +14,17 @@ NtGdiDdCreateDirectDrawObject( INT Test_NtGdiDdCreateDirectDrawObject(PTESTINFO pti) { - HDC hdc = CreateDCW(L"Display",NULL,NULL,NULL); + HANDLE hDirectDraw; + HDC hdc = CreateDCW(L"DISPLAY",NULL,NULL,NULL); ASSERT1(hdc != NULL); + /* Test ReactX */ RTEST(NtGdiDdCreateDirectDrawObject(NULL) == NULL); + RTEST((hDirectDraw=NtGdiDdCreateDirectDrawObject(hdc)) != NULL); - TEST(NtGdiDdCreateDirectDrawObject(hdc) != NULL); - + /* Cleanup ReactX setup */ DeleteDC(hdc); + Syscall(L"NtGdiDdDeleteDirectDrawObject", 1, &hDirectDraw); return APISTATUS_NORMAL; } diff --git a/rostests/apitests/w32knapi/ntdd/NtGdiDdDeleteDirectDrawObject.c b/rostests/apitests/w32knapi/ntdd/NtGdiDdDeleteDirectDrawObject.c index 50429dbf24a..ee74591d372 100644 --- a/rostests/apitests/w32knapi/ntdd/NtGdiDdDeleteDirectDrawObject.c +++ b/rostests/apitests/w32knapi/ntdd/NtGdiDdDeleteDirectDrawObject.c @@ -13,7 +13,19 @@ NtGdiDdDeleteDirectDrawObject( INT Test_NtGdiDdDeleteDirectDrawObject(PTESTINFO pti) { - TEST(NtGdiDdDeleteDirectDrawObject(NULL) == 0); + HANDLE hDirectDraw; + HDC hdc = CreateDCW(L"DISPLAY",NULL,NULL,NULL); + ASSERT1(hdc != NULL); + + /* Test ReactX */ + RTEST(NtGdiDdDeleteDirectDrawObject(NULL) == FALSE); + RTEST((hDirectDraw=NtGdiDdCreateDirectDrawObject(hdc)) != NULL); + ASSERT1(hDirectDraw != NULL); + RTEST(NtGdiDdDeleteDirectDrawObject(hDirectDraw) == TRUE); + + /* Cleanup ReactX setup */ + DeleteDC(hdc); + Syscall(L"NtGdiDdDeleteDirectDrawObject", 1, &hDirectDraw); return APISTATUS_NORMAL; } diff --git a/rostests/apitests/w32knapi/testlist.c b/rostests/apitests/w32knapi/testlist.c index f68d945ecf3..998fff220c2 100644 --- a/rostests/apitests/w32knapi/testlist.c +++ b/rostests/apitests/w32knapi/testlist.c @@ -20,8 +20,9 @@ TESTENTRY TestList[] = { /* DirectDraw */ { L"NtGdiDdCreateDirectDrawObject", Test_NtGdiDdCreateDirectDrawObject }, - { L"NtGdiDdDeleteDirectDrawObject", Test_NtGdiDdDeleteDirectDrawObject }, { L"NtGdiDdQueryDirectDrawObject", Test_NtGdiDdQueryDirectDrawObject }, + { L"NtGdiDdDeleteDirectDrawObject", Test_NtGdiDdDeleteDirectDrawObject }, + /* ntgdi */ { L"NtGdiArcInternal", Test_NtGdiArcInternal }, diff --git a/rostests/apitests/w32knapi/w32knapi.c b/rostests/apitests/w32knapi/w32knapi.c index be98d5ced9a..cc5c8503922 100644 --- a/rostests/apitests/w32knapi/w32knapi.c +++ b/rostests/apitests/w32knapi/w32knapi.c @@ -153,7 +153,7 @@ WinMain(HINSTANCE hInstance, printf("Win32k native API test\n"); /* Convert to gui thread */ - IsGUIThread(TRUE); + // IsGUIThread(TRUE); <- does not exists on win2k if (!InitOsVersion()) {