ReactOS 0.4.15-dev-7842-g558ab78
dllexport_test.c File Reference
#include <stdio.h>
Include dependency graph for dllexport_test.c:

Go to the source code of this file.

Macros

#define ok_int(a, b)    if ((a) != (b)) { printf("wrong result in line %d, expected 0x%x, got 0x%x\n", __LINE__, (b), (a)); }
 

Functions

 __declspec (dllimport)
 

Macro Definition Documentation

◆ ok_int

#define ok_int (   a,
  b 
)     if ((a) != (b)) { printf("wrong result in line %d, expected 0x%x, got 0x%x\n", __LINE__, (b), (a)); }

Function Documentation

◆ __declspec()

__declspec ( dllimport  )

Definition at line 7 of file dllexport_test.c.

43 { printf("wrong result in line %d, expected 0x%x, got 0x%x\n", __LINE__, (b), (a)); }
44
45int main(int argc, char *argv[])
46{
47 char* str = "defaultstring";
48
49 if (argc > 2)
50 str = argv[1];
51
52 ok_int(CdeclFunc0(), 0);
54 ok_int(CdeclFunc2(str), 1);
55 ok_int(CdeclFunc3(str), 0x10001);
56
57 ok_int(StdcallFunc0(), 0x10);
58 ok_int(StdcallFunc1(str), 0x11);
59 ok_int(StdcallFunc2(str), 0x11);
60 ok_int(StdcallFunc3(str), 0x10011);
61#ifdef _M_IX86
62 ok_int(StdcallFunc4(str), 0x21);
63#endif
64 ok_int(StdcallFunc5(str), 0x10021);
65
66#ifdef _M_IX86
68 ok_int(DecoratedStdcallFunc2(str), 0x11);
69 //ok_int(DecoratedStdcallFunc3(str), 11);
70 ok_int(DecoratedStdcallFunc4(str), 0x21);
71 ok_int(DecoratedStdcallFunc5(str), 0x10021);
72#endif
73 ok_int(FastcallFunc0(), 0x30);
74 ok_int(FastcallFunc1(str), 0x31);
75 ok_int(FastcallFunc2(str), 0x31);
76 ok_int(FastcallFunc3(str), 0x10031);
77#ifdef _M_IX86
78 ok_int(FastcallFunc4(str), 0x42);
79 ok_int(FastcallFunc5(str), 0x10041);
80#endif
81#ifdef _M_IX86
83 ok_int(DecoratedFastcallFunc2(str), 0x31);
84 //ok_int(DecoratedFastcallFunc3(str), 11);
85 ok_int(DecoratedFastcallFunc4(str), 0x42);
86 ok_int(DecoratedFastcallFunc5(str), 0x10041);
87#endif
88 ok_int(DataItem1, 0x51);
89 ok_int(DataItem2, 0x51);
90 ok_int(DataItem3, 0x10051);
91
92 printf("done.\n");
93
94 return 0;
95}
static int argc
Definition: ServiceArgs.c:12
#define ok_int(a, b)
int __fastcall FastcallFunc1(char *p1)
int __stdcall StdcallFunc0(void)
int __fastcall DecoratedFastcallFunc1(char *p1)
int __cdecl CdeclFunc1(char *p1)
int __stdcall StdcallFunc1(char *p1)
int __cdecl CdeclFunc0(void)
int DataItem2
int DataItem1
int __fastcall FastcallFunc0(void)
int __stdcall DecoratedStdcallFunc1(char *p1)
int main()
Definition: test.c:6
#define printf
Definition: freeldr.h:93
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define argv
Definition: mplay32.c:18
const WCHAR * str