ReactOS
0.4.15-dev-2087-g6bfb76b
main.c
Go to the documentation of this file.
1
2
3
/* All testcase are base how windows 2000 sp4 acting */
4
5
6
#include <stdio.h>
7
/* SDK/DDK/NDK Headers. */
8
#include <windows.h>
9
#include <
wingdi.h
>
10
#include <
winddi.h
>
11
#include <
d3dnthal.h
>
12
#include <
dll/directx/d3d8thk.h
>
13
#include "
test.h
"
14
15
BOOL
dumping_on
=
FALSE
;
16
FILE
*
fs_file
;
17
18
/* we using d3d8thk.dll it is doing the real syscall in windows 2000
19
* in ReactOS and Windows XP and higher d3d8thk.dll it linking to
20
* gdi32.dll instead doing syscall, gdi32.dll export DdEntry1-56
21
* and doing the syscall direcly. I did forget about it, This
22
* test program are now working on any Windows and ReactOS
23
* that got d3d8thk.dll
24
*/
25
26
int
main
(
int
argc
,
char
**
argv
)
27
{
28
HANDLE
hDirectDrawLocal;
29
30
if
(
argc
== 2)
31
{
32
if
(
stricmp
(
argv
[1],
"-dump"
)==0)
33
{
34
dumping_on
=
TRUE
;
35
}
36
37
if
( (
stricmp
(
argv
[1],
"-help"
)==0) ||
38
(
stricmp
(
argv
[1],
"-?"
)==0) ||
39
(
stricmp
(
argv
[1],
"/help"
)==0) ||
40
(
stricmp
(
argv
[1],
"/?"
)==0) )
41
{
42
printf
(
"the %s support follow param \n"
,
argv
[0]);
43
printf
(
"-dump : It dump all data it resvie to screen \n"
);
44
printf
(
"-dumpfile filename : It dump all data it resvie to file \n"
);
45
printf
(
"\nrember u can only use one of them at time \n"
);
46
exit
(1);
47
}
48
}
49
50
if
(
argc
== 3)
51
{
52
if
(
stricmp
(
argv
[1],
"-dumpfile"
)==0)
53
{
54
/* create or over write a file in binary mode, and redirect printf to the file */
55
if
( (
fs_file
=
freopen
(
argv
[2],
"wb"
,
stdout
)) !=
NULL
)
56
{
57
dumping_on
=
TRUE
;
58
}
59
}
60
}
61
62
hDirectDrawLocal =
test_NtGdiDdCreateDirectDrawObject
();
63
64
test_NtGdiDdQueryDirectDrawObject
(hDirectDrawLocal);
65
66
test_NtGdiDdGetScanLine
(hDirectDrawLocal);
67
68
test_NtGdiDdWaitForVerticalBlank
(hDirectDrawLocal);
69
70
test_NtGdiDdCanCreateSurface
(hDirectDrawLocal);
71
72
test_NtGdiDdDeleteDirectDrawObject
(hDirectDrawLocal);
73
74
if
(
fs_file
!=
NULL
)
75
{
76
fclose
(
fs_file
);
77
}
78
return
0;
79
}
80
81
82
83
84
85
86
87
88
89
90
91
wingdi.h
test_NtGdiDdCreateDirectDrawObject
HANDLE test_NtGdiDdCreateDirectDrawObject()
Definition:
NtGdiDdCreateDirectDrawObject.c:16
argc
static int argc
Definition:
ServiceArgs.c:12
test_NtGdiDdGetScanLine
void test_NtGdiDdGetScanLine(HANDLE hDirectDrawLocal)
Definition:
NtGdiDdGetScanLine.c:15
d3d8thk.h
TRUE
#define TRUE
Definition:
types.h:120
argv
#define argv
Definition:
mplay32.c:18
stdout
FILE * stdout
d3dnthal.h
FALSE
#define FALSE
Definition:
types.h:117
BOOL
unsigned int BOOL
Definition:
ntddk_ex.h:94
test_NtGdiDdDeleteDirectDrawObject
void test_NtGdiDdDeleteDirectDrawObject(HANDLE hDirectDrawLocal)
Definition:
NtGdiDdDeleteDirectDrawObject.c:15
stricmp
_Check_return_ _CRTIMP int __cdecl stricmp(_In_z_ const char *_Str1, _In_z_ const char *_Str2)
test.h
_iobuf
Definition:
mbstring.h:19
main
int main(int argc, const char *argv[])
Definition:
main.c:122
fs_file
FILE * fs_file
Definition:
main.c:16
test_NtGdiDdQueryDirectDrawObject
void test_NtGdiDdQueryDirectDrawObject(HANDLE hDirectDrawLocal)
Definition:
NtGdiDdQueryDirectDrawObject.c:35
fclose
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
test_NtGdiDdWaitForVerticalBlank
void test_NtGdiDdWaitForVerticalBlank(HANDLE hDirectDrawLocal)
Definition:
NtGdiDdWaitForVerticalBlank.c:17
test_NtGdiDdCanCreateSurface
void test_NtGdiDdCanCreateSurface(HANDLE hDirectDrawLocal)
Definition:
NtGdiDdCanCreateSurface.c:17
NULL
#define NULL
Definition:
types.h:112
winddi.h
freopen
_Check_return_ _CRTIMP FILE *__cdecl freopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode, _Inout_ FILE *_File)
dumping_on
BOOL dumping_on
Definition:
main.c:15
exit
void exit(int exitcode)
Definition:
_exit.c:33
void
Definition:
nsiface.idl:2306
printf
#define printf
Definition:
config.h:203
modules
rostests
dxtest
win32kdxtest
main.c
Generated on Wed Feb 24 2021 06:03:26 for ReactOS by
1.8.15