mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:02:58 +00:00
-- 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. svn path=/trunk/; revision=25814
This commit is contained in:
parent
eab0f7c139
commit
9e44309042
6 changed files with 225 additions and 39 deletions
|
@ -2,18 +2,9 @@
|
||||||
|
|
||||||
#if !defined(__REACTOS__)
|
#if !defined(__REACTOS__)
|
||||||
|
|
||||||
HANDLE sysNtGdiDdCreateDirectDrawObject(HDC hdc)
|
#define syscallid_NtGdiDdCreateDirectDrawObject 0x1039
|
||||||
{
|
#define syscallid_NtGdiDdDeleteDirectDrawObject 0x103E
|
||||||
INT retValue;
|
#define syscallid_NtGdiDdQueryDirectDrawObject 0x1053
|
||||||
_asm
|
|
||||||
{
|
|
||||||
mov eax, 0x1039
|
|
||||||
lea edx, [hdc]
|
|
||||||
int 0x2E
|
|
||||||
mov [retValue],eax
|
|
||||||
}
|
|
||||||
return retValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1,51 +1,142 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
/* SDK/DDK/NDK Headers. */
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <wingdi.h>
|
||||||
|
#include <winddi.h>
|
||||||
|
#include <d3dnthal.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
|
/* which syscall table shall we use WIndows or ReactOS */
|
||||||
|
|
||||||
|
/* Windows 2000 sp4 syscall table for win32k */
|
||||||
#include "Windows2000Sp4.h"
|
#include "Windows2000Sp4.h"
|
||||||
|
|
||||||
|
/* Windows syscall code */
|
||||||
|
#include "Windowsos.h"
|
||||||
|
|
||||||
|
/* ReactOS syscall code */
|
||||||
#include "sysreactos.h"
|
#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)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
HANDLE hDirectDrawLocal;
|
||||||
|
|
||||||
test_NtGdiDdCreateDirectDrawObject();
|
hDirectDrawLocal = test_NtGdiDdCreateDirectDrawObject();
|
||||||
|
|
||||||
|
test_NtGdiDdQueryDirectDrawObject(hDirectDrawLocal);
|
||||||
|
|
||||||
|
test_NtGdiDdDeleteDirectDrawObject(hDirectDrawLocal);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
void
|
* Test see if we getting a DirectDrawObject from win32k
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
HANDLE
|
||||||
test_NtGdiDdCreateDirectDrawObject()
|
test_NtGdiDdCreateDirectDrawObject()
|
||||||
{
|
{
|
||||||
HANDLE retValue=0;
|
HANDLE retValue=0;
|
||||||
int fails=0;
|
int fails=0;
|
||||||
HDC hdc=CreateDCW(L"Display",NULL,NULL,NULL);
|
HDC hdc=CreateDCW(L"Display",NULL,NULL,NULL);
|
||||||
|
|
||||||
printf("Start testing of NtGdiDdCreateDirectDrawObject(NULL)\n");
|
printf("Start testing of NtGdiDdCreateDirectDrawObject\n");
|
||||||
|
|
||||||
retValue = sysNtGdiDdCreateDirectDrawObject(NULL);
|
retValue = sysNtGdiDdCreateDirectDrawObject(NULL);
|
||||||
|
testing_noteq(retValue,NULL,fails,"NtGdiDdCreateDirectDrawObject(NULL);\0");
|
||||||
if (retValue != NULL)
|
|
||||||
{
|
|
||||||
printf("FAIL NtGdiDdCreateDirectDrawObject(NULL) != 0\n");
|
|
||||||
fails++;
|
|
||||||
}
|
|
||||||
|
|
||||||
retValue = sysNtGdiDdCreateDirectDrawObject(hdc);
|
retValue = sysNtGdiDdCreateDirectDrawObject(hdc);
|
||||||
if (retValue == NULL)
|
testing_eq(retValue,NULL,fails,"NtGdiDdCreateDirectDrawObject(hdc);\0");
|
||||||
{
|
|
||||||
printf("FAIL NtGdiDdCreateDirectDrawObject(NULL) == 0)\n");
|
show_status(fails, "NtGdiDdCreateDirectDrawObject\0");
|
||||||
fails++;
|
|
||||||
|
return retValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fails == 0)
|
/*
|
||||||
|
* Test see if we can setup DirectDrawObject
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal)
|
||||||
{
|
{
|
||||||
printf("End testing of NtGdiDdCreateDirectDrawObject Status : ok\n");
|
int fails=0;
|
||||||
}
|
BOOL retValue=FALSE;
|
||||||
else
|
|
||||||
{
|
DD_HALINFO *pHalInfo;
|
||||||
printf("End testing of NtGdiDdCreateDirectDrawObject Status : fail\n");
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
|
||||||
|
|
||||||
#if defined(__REACTOS__)
|
#if defined(__REACTOS__)
|
||||||
#define sysNtGdiDdCreateDirectDrawObject NtGdiDdCreateDirectDrawObject;
|
#define sysNtGdiDdCreateDirectDrawObject NtGdiDdCreateDirectDrawObject
|
||||||
|
#define sysNtGdiDdDeleteDirectDrawObject NtGdiDdDeleteDirectDrawObject
|
||||||
|
#define sysNtGdiDdQueryDirectDrawObject NtGdiDdQueryDirectDrawObject
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,5 +1,71 @@
|
||||||
|
|
||||||
|
|
||||||
|
HANDLE test_NtGdiDdCreateDirectDrawObject();
|
||||||
|
void test_NtGdiDdDeleteDirectDrawObject(HANDLE hDirectDrawLocal);
|
||||||
|
void test_NtGdiDdQueryDirectDrawObject( HANDLE hDirectDrawLocal);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HANDLE sysNtGdiDdCreateDirectDrawObject(HDC hdc);
|
HANDLE sysNtGdiDdCreateDirectDrawObject(HDC hdc);
|
||||||
HANDLE NtGdiDdCreateDirectDrawObject(HDC hdc);
|
BOOL sysNtGdiDdDeleteDirectDrawObject( HANDLE hDirectDrawLocal);
|
||||||
void test_NtGdiDdCreateDirectDrawObject();
|
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);
|
||||||
|
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
|
||||||
|
|
|
@ -592,6 +592,10 @@
|
||||||
RelativePath=".\Windows2000Sp4.h"
|
RelativePath=".\Windows2000Sp4.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\windowsos.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter
|
<Filter
|
||||||
Name="Header Files"
|
Name="Header Files"
|
||||||
|
|
32
rosapps/dxtest/win32kdxtest/windowsos.h
Normal file
32
rosapps/dxtest/win32kdxtest/windowsos.h
Normal file
|
@ -0,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
|
Loading…
Add table
Add a link
Reference in a new issue