[ros-diffs] [greatlrd] 25814: -- Rewrite how we should do syscall now we define the syscall number in a include files. if we getting syscall table for another windows version and sp we can simple adding it to a another include file and use that file to run other that windows. rember the syscall table is diffent in all version of windows and reactos. if u compile this version in vs u will only be avail run it in windows 2000 sp4 and not under any windows version. -- add one more testcase (NtGdiDdDeleteDirectDrawObject) -- start adding thrid testcase (NtGdiDdQueryDirectDrawObject), this one will take bit longer to completed but I add a stub for it for now.

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Fri Feb 16 17:27:47 CET 2007


Author: greatlrd
Date: Fri Feb 16 19:27:46 2007
New Revision: 25814

URL: http://svn.reactos.org/svn/reactos?rev=25814&view=rev
Log:
-- Rewrite how we should do syscall now we define the syscall number in a include files. if we getting syscall table for another windows version and sp we can simple adding it to a another include file and use that file to run other that windows. rember the syscall table is diffent in all version of windows and reactos. if u compile this version in vs u will only be avail run it in windows 2000 sp4 and not under any windows version. 
-- add one more testcase (NtGdiDdDeleteDirectDrawObject)
-- start adding thrid testcase (NtGdiDdQueryDirectDrawObject), this one will take bit longer to completed but I add a stub for it for now. 

Added:
    trunk/rosapps/dxtest/win32kdxtest/windowsos.h   (with props)
Modified:
    trunk/rosapps/dxtest/win32kdxtest/Windows2000Sp4.h
    trunk/rosapps/dxtest/win32kdxtest/main.c
    trunk/rosapps/dxtest/win32kdxtest/sysreactos.h
    trunk/rosapps/dxtest/win32kdxtest/test.h
    trunk/rosapps/dxtest/win32kdxtest/win32kdxtest_vc8_auto.vcproj

Modified: trunk/rosapps/dxtest/win32kdxtest/Windows2000Sp4.h
URL: http://svn.reactos.org/svn/reactos/trunk/rosapps/dxtest/win32kdxtest/Windows2000Sp4.h?rev=25814&r1=25813&r2=25814&view=diff
==============================================================================
--- trunk/rosapps/dxtest/win32kdxtest/Windows2000Sp4.h (original)
+++ trunk/rosapps/dxtest/win32kdxtest/Windows2000Sp4.h Fri Feb 16 19:27:46 2007
@@ -2,18 +2,9 @@
 
 #if !defined(__REACTOS__)
 
-    HANDLE sysNtGdiDdCreateDirectDrawObject(HDC hdc)
-    {
-       INT retValue;
-       _asm
-       {
-           mov     eax, 0x1039
-           lea     edx, [hdc]
-           int     0x2E
-           mov [retValue],eax
-       }
-       return retValue;
-    }
+    #define syscallid_NtGdiDdCreateDirectDrawObject  0x1039
+    #define syscallid_NtGdiDdDeleteDirectDrawObject  0x103E
+    #define syscallid_NtGdiDdQueryDirectDrawObject   0x1053
 
 #endif
 

Modified: trunk/rosapps/dxtest/win32kdxtest/main.c
URL: http://svn.reactos.org/svn/reactos/trunk/rosapps/dxtest/win32kdxtest/main.c?rev=25814&r1=25813&r2=25814&view=diff
==============================================================================
--- trunk/rosapps/dxtest/win32kdxtest/main.c (original)
+++ trunk/rosapps/dxtest/win32kdxtest/main.c Fri Feb 16 19:27:46 2007
@@ -1,51 +1,142 @@
 
 #include <stdio.h>
+/* SDK/DDK/NDK Headers. */
 #include <windows.h>
+#include <wingdi.h>
+#include <winddi.h>
+#include <d3dnthal.h>
+
+
 
 
 #include "test.h"
-#include "Windows2000Sp4.h"
+
+/* which syscall table shall we use WIndows or ReactOS */
+
+/* Windows 2000 sp4 syscall table for win32k */
+#include "Windows2000Sp4.h" 
+
+/* Windows syscall code */
+#include "Windowsos.h"
+
+/* ReactOS syscall code */
 #include "sysreactos.h"
 
+
+/*
+#define DdQueryDirectDrawObject             GdiEntry2
+
+#define DdCreateSurfaceObject               GdiEntry4
+#define DdDeleteSurfaceObject               GdiEntry5
+#define DdResetVisrgn                       GdiEntry6
+#define DdGetDC                             GdiEntry7
+#define DdReleaseDC                         GdiEntry8
+#define DdCreateDIBSection                  GdiEntry9
+#define DdReenableDirectDrawObject          GdiEntry10
+#define DdAttachSurface                     GdiEntry11
+#define DdUnattachSurface                   GdiEntry12
+#define DdQueryDisplaySettingsUniqueness    GdiEntry13
+#define DdGetDxHandle                       GdiEntry14
+#define DdSetGammaRamp                      GdiEntry15
+#define DdSwapTextureHandles                GdiEntry16
+*/
 int main(int argc, char **argv)
 {
+    HANDLE hDirectDrawLocal;
 
-    test_NtGdiDdCreateDirectDrawObject();
+    hDirectDrawLocal = test_NtGdiDdCreateDirectDrawObject();
+
+    test_NtGdiDdQueryDirectDrawObject(hDirectDrawLocal);
+
+    test_NtGdiDdDeleteDirectDrawObject(hDirectDrawLocal);
     return 0;
 }
 
-
-void
+/*
+ * Test see if we getting a DirectDrawObject from win32k
+ *
+ */
+HANDLE
 test_NtGdiDdCreateDirectDrawObject()
 {
     HANDLE retValue=0;
     int fails=0;
     HDC hdc=CreateDCW(L"Display",NULL,NULL,NULL);
 
-    printf("Start testing of NtGdiDdCreateDirectDrawObject(NULL)\n");
+    printf("Start testing of NtGdiDdCreateDirectDrawObject\n");
     
     retValue = sysNtGdiDdCreateDirectDrawObject(NULL);
-
-    if (retValue != NULL) 
-    {
-        printf("FAIL NtGdiDdCreateDirectDrawObject(NULL) != 0\n");
-        fails++;
-    }
+    testing_noteq(retValue,NULL,fails,"NtGdiDdCreateDirectDrawObject(NULL);\0");
 
     retValue = sysNtGdiDdCreateDirectDrawObject(hdc);
-    if (retValue == NULL) 
-    {
-        printf("FAIL NtGdiDdCreateDirectDrawObject(NULL) == 0)\n");
-        fails++;
-    }
+    testing_eq(retValue,NULL,fails,"NtGdiDdCreateDirectDrawObject(hdc);\0");
 
-    if (fails == 0)
-    {
-        printf("End testing of NtGdiDdCreateDirectDrawObject Status : ok\n"); 
-    }
-    else
-    {
-       printf("End testing of NtGdiDdCreateDirectDrawObject Status : fail\n"); 
-    }
+    show_status(fails, "NtGdiDdCreateDirectDrawObject\0");
+
+    return retValue;
 }
 
+/*
+ * Test see if we can setup DirectDrawObject 
+ *
+ */
+void
+test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal)
+{
+    int fails=0;
+    BOOL retValue=FALSE;
+
+    DD_HALINFO *pHalInfo;
+    DWORD *pCallBackFlags;
+    LPD3DNTHAL_CALLBACKS puD3dCallbacks;
+    LPD3DNTHAL_GLOBALDRIVERDATA puD3dDriverData;
+    PDD_D3DBUFCALLBACKS puD3dBufferCallbacks;
+    LPDDSURFACEDESC puD3dTextureFormats;
+    DWORD *puNumHeaps;
+    VIDEOMEMORY *puvmList;
+    DWORD *puNumFourCC;
+    DWORD *puFourCC;
+
+    printf("Start testing of NtGdiDdQueryDirectDrawObject\n");
+    
+    retValue = sysNtGdiDdQueryDirectDrawObject( hDirectDrawLocal, pHalInfo, 
+                                                pCallBackFlags, puD3dCallbacks, 
+                                                puD3dDriverData, puD3dBufferCallbacks, 
+                                                puD3dTextureFormats, puNumHeaps, 
+                                                puvmList, puNumFourCC,
+                                                puFourCC);
+
+
+    show_status(fails, "NtGdiDdQueryDirectDrawObject\0");
+
+    return retValue;
+}
+
+/*
+ * Test see if we can delete a DirectDrawObject from win32k
+ *
+ */
+void
+test_NtGdiDdDeleteDirectDrawObject(HANDLE hDirectDrawLocal)
+{
+    int fails=0;
+    BOOL retValue=FALSE;
+    printf("Start testing of NtGdiDdDeleteDirectDrawObject\n");
+    
+    retValue = sysNtGdiDdDeleteDirectDrawObject(hDirectDrawLocal);
+    testing_eq(retValue,FALSE,fails,"NtGdiDdDeleteDirectDrawObject(hDirectDrawLocal);\0");
+
+    retValue = sysNtGdiDdDeleteDirectDrawObject(NULL);
+    testing_eq(retValue,TRUE,fails,"NtGdiDdDeleteDirectDrawObject(NULL);\0");
+
+    show_status(fails, "NtGdiDdDeleteDirectDrawObject\0");
+
+    return retValue;
+}
+
+
+
+
+
+
+

Modified: trunk/rosapps/dxtest/win32kdxtest/sysreactos.h
URL: http://svn.reactos.org/svn/reactos/trunk/rosapps/dxtest/win32kdxtest/sysreactos.h?rev=25814&r1=25813&r2=25814&view=diff
==============================================================================
--- trunk/rosapps/dxtest/win32kdxtest/sysreactos.h (original)
+++ trunk/rosapps/dxtest/win32kdxtest/sysreactos.h Fri Feb 16 19:27:46 2007
@@ -1,5 +1,7 @@
 
 
 #if defined(__REACTOS__)
-        #define sysNtGdiDdCreateDirectDrawObject NtGdiDdCreateDirectDrawObject;
+        #define sysNtGdiDdCreateDirectDrawObject NtGdiDdCreateDirectDrawObject
+        #define sysNtGdiDdDeleteDirectDrawObject NtGdiDdDeleteDirectDrawObject
+        #define sysNtGdiDdQueryDirectDrawObject NtGdiDdQueryDirectDrawObject
 #endif

Modified: trunk/rosapps/dxtest/win32kdxtest/test.h
URL: http://svn.reactos.org/svn/reactos/trunk/rosapps/dxtest/win32kdxtest/test.h?rev=25814&r1=25813&r2=25814&view=diff
==============================================================================
--- trunk/rosapps/dxtest/win32kdxtest/test.h (original)
+++ trunk/rosapps/dxtest/win32kdxtest/test.h Fri Feb 16 19:27:46 2007
@@ -1,5 +1,71 @@
+
+
+HANDLE test_NtGdiDdCreateDirectDrawObject();
+void test_NtGdiDdDeleteDirectDrawObject(HANDLE hDirectDrawLocal);
+void test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal);
+
+
 
 HANDLE sysNtGdiDdCreateDirectDrawObject(HDC hdc);
+BOOL sysNtGdiDdDeleteDirectDrawObject( HANDLE hDirectDrawLocal);
+BOOL sysNtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal, DD_HALINFO *pHalInfo, 
+                                   DWORD *pCallBackFlags, 
+                                   LPD3DNTHAL_CALLBACKS puD3dCallbacks, 
+                                   LPD3DNTHAL_GLOBALDRIVERDATA puD3dDriverData, 
+                                   PDD_D3DBUFCALLBACKS puD3dBufferCallbacks, 
+                                   LPDDSURFACEDESC puD3dTextureFormats, 
+                                   DWORD *puNumHeaps, VIDEOMEMORY *puvmList, 
+                                   DWORD *puNumFourCC, DWORD *puFourCC);
+
 HANDLE NtGdiDdCreateDirectDrawObject(HDC hdc);
-void test_NtGdiDdCreateDirectDrawObject();
+BOOL NtGdiDdDeleteDirectDrawObject( HANDLE hDirectDrawLocal);
 
+BOOL NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal, DD_HALINFO *pHalInfo, 
+                                   DWORD *pCallBackFlags, 
+                                   LPD3DNTHAL_CALLBACKS puD3dCallbacks, 
+                                   LPD3DNTHAL_GLOBALDRIVERDATA puD3dDriverData, 
+                                   PDD_D3DBUFCALLBACKS puD3dBufferCallbacks, 
+                                   LPDDSURFACEDESC puD3dTextureFormats, 
+                                   DWORD *puNumHeaps, VIDEOMEMORY *puvmList, 
+                                   DWORD *puNumFourCC, DWORD *puFourCC);
+
+
+
+#define testing_eq(input,value,counter,text) \
+        if (input == value) \
+        { \
+            counter++; \
+            printf("FAIL ret=%s, %d != %d )\n",text,input,value); \
+        }
+
+
+#define testing_noteq(input,value,counter,text) \
+        if (input != value) \
+        { \
+            counter++; \
+            printf("FAIL ret=%s, %d == %d )\n",text,input,value); \
+        }
+
+
+#define show_status(counter, text) \
+        if (counter == 0) \
+        { \
+            printf("End testing of %s Status : ok\n\n",text); \
+        } \
+        else \
+        { \
+            printf("End testing of %s Status : fail\n\n",text); \
+        }
+
+
+#if !defined(__REACTOS__)
+
+#define win_syscall(inValue,outValue,syscallid) \
+                    __asm { mov     eax, syscallid }; \
+                    __asm { lea     edx, [inValue] }; \
+                    __asm { int     0x2E }; \
+                    __asm { mov outValue,eax};
+
+
+
+#endif

Modified: trunk/rosapps/dxtest/win32kdxtest/win32kdxtest_vc8_auto.vcproj
URL: http://svn.reactos.org/svn/reactos/trunk/rosapps/dxtest/win32kdxtest/win32kdxtest_vc8_auto.vcproj?rev=25814&r1=25813&r2=25814&view=diff
==============================================================================
--- trunk/rosapps/dxtest/win32kdxtest/win32kdxtest_vc8_auto.vcproj (original)
+++ trunk/rosapps/dxtest/win32kdxtest/win32kdxtest_vc8_auto.vcproj Fri Feb 16 19:27:46 2007
@@ -592,6 +592,10 @@
 				RelativePath=".\Windows2000Sp4.h"
 				>
 			</File>
+			<File
+				RelativePath=".\windowsos.h"
+				>
+			</File>
 		</Filter>
 		<Filter
 			Name="Header Files"

Added: trunk/rosapps/dxtest/win32kdxtest/windowsos.h
URL: http://svn.reactos.org/svn/reactos/trunk/rosapps/dxtest/win32kdxtest/windowsos.h?rev=25814&view=auto
==============================================================================
--- trunk/rosapps/dxtest/win32kdxtest/windowsos.h (added)
+++ trunk/rosapps/dxtest/win32kdxtest/windowsos.h Fri Feb 16 19:27:46 2007
@@ -1,0 +1,32 @@
+
+#if !defined(__REACTOS__)
+
+    HANDLE sysNtGdiDdCreateDirectDrawObject(HDC hdc)
+    {
+       INT retValue;
+       win_syscall(hdc,retValue, syscallid_NtGdiDdCreateDirectDrawObject);
+       return retValue;
+    }
+
+    BOOL sysNtGdiDdDeleteDirectDrawObject(HANDLE hDirectDrawLocal)
+    {
+       INT retValue;
+       win_syscall(hDirectDrawLocal,retValue, syscallid_NtGdiDdDeleteDirectDrawObject);
+       return retValue;
+    }
+
+    BOOL sysNtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal, DD_HALINFO *pHalInfo, 
+                                   DWORD *pCallBackFlags, 
+                                   LPD3DNTHAL_CALLBACKS puD3dCallbacks, 
+                                   LPD3DNTHAL_GLOBALDRIVERDATA puD3dDriverData, 
+                                   PDD_D3DBUFCALLBACKS puD3dBufferCallbacks, 
+                                   LPDDSURFACEDESC puD3dTextureFormats, 
+                                   DWORD *puNumHeaps, VIDEOMEMORY *puvmList, 
+                                   DWORD *puNumFourCC, DWORD *puFourCC)
+    {
+       INT retValue;
+       win_syscall(hDirectDrawLocal,retValue, syscallid_NtGdiDdQueryDirectDrawObject);
+       return retValue;
+       }
+
+#endif

Propchange: trunk/rosapps/dxtest/win32kdxtest/windowsos.h
------------------------------------------------------------------------------
    svn:eol-style = native




More information about the Ros-diffs mailing list