forked from cosimo/perl5-win32-api
/
API_test.h
137 lines (118 loc) · 4.12 KB
/
API_test.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
//
// API_test.h
//
// $Id$
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the API_TEST_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// API_TEST_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
#ifdef API_TEST_EXPORTS
#define API_TEST_API __declspec(dllexport)
#else
#define API_TEST_API __declspec(dllimport)
#endif
typedef struct _simple_struct {
int a;
double b;
char * c;
DWORD_PTR d;
} simple_struct, LPsimple_struct;
typedef struct {
char a;
char b;
char c;
char d;
}
four_char_struct;
typedef struct {
int one;
int two;
int three;
int four;
int five; //should be some padding right here
double six;
}
SIX_MEMS; //MEMS=members, not memory
typedef enum _WLAN_CONNECTION_MODE {
wlan_connection_mode_profile = 0,
wlan_connection_mode_temporary_profile,
wlan_connection_mode_discovery_secure,
wlan_connection_mode_discovery_unsecure,
wlan_connection_mode_auto,
wlan_connection_mode_invalid
} WLAN_CONNECTION_MODE, *PWLAN_CONNECTION_MODE;
#define DOT11_SSID_MAX_LENGTH 32 // 32 bytes
typedef struct _DOT11_SSID {
ULONG uSSIDLength;
UCHAR ucSSID[DOT11_SSID_MAX_LENGTH];
} DOT11_SSID, * PDOT11_SSID;
typedef struct _NDIS_OBJECT_HEADER
{
UCHAR Type;
UCHAR Revision;
USHORT Size;
} NDIS_OBJECT_HEADER, *PNDIS_OBJECT_HEADER;
// These are needed for wlanapi.h for pre-vista targets
#ifdef __midl
typedef struct _DOT11_MAC_ADDRESS {
UCHAR ucDot11MacAddress[6];
} DOT11_MAC_ADDRESS, * PDOT11_MAC_ADDRESS;
#else
typedef UCHAR DOT11_MAC_ADDRESS[6];
typedef DOT11_MAC_ADDRESS * PDOT11_MAC_ADDRESS;
#endif
// A list of DOT11_MAC_ADDRESS
typedef struct DOT11_BSSID_LIST {
#define DOT11_BSSID_LIST_REVISION_1 1
NDIS_OBJECT_HEADER Header;
ULONG uNumOfEntries;
ULONG uTotalNumOfEntries;
#ifdef __midl
[unique, size_is(uTotalNumOfEntries)] DOT11_MAC_ADDRESS BSSIDs[*];
#else
DOT11_MAC_ADDRESS BSSIDs[1];
#endif
} DOT11_BSSID_LIST, * PDOT11_BSSID_LIST;
typedef enum _DOT11_BSS_TYPE {
dot11_BSS_type_infrastructure = 1,
dot11_BSS_type_independent = 2,
dot11_BSS_type_any = 3
} DOT11_BSS_TYPE, * PDOT11_BSS_TYPE;
typedef struct _WLAN_CONNECTION_PARAMETERS {
WLAN_CONNECTION_MODE wlanConnectionMode;
#ifdef __midl
[string] LPCWSTR strProfile;
#else
LPCWSTR strProfile;
#endif
PDOT11_SSID pDot11Ssid;
PDOT11_BSSID_LIST pDesiredBssidList;
DOT11_BSS_TYPE dot11BssType;
DWORD dwFlags;
} WLAN_CONNECTION_PARAMETERS, *PWLAN_CONNECTION_PARAMETERS;
#define WLAN_CONNECTION_HIDDEN_NETWORK 0x00000001
// typedef int callback_func(int);
typedef int (__stdcall * callback_func)(int);
typedef double (__stdcall * callback_func_void_d)();
typedef float (__stdcall * callback_func_void_f)();
typedef unsigned __int64 (__stdcall * callback_func_void_q)();
typedef int (__stdcall * callback_func_5_param)
(char, unsigned __int64, four_char_struct *, float, double);
typedef int (__cdecl * callback_func_5_param_cdec)
(char, unsigned __int64, four_char_struct *, float, double);
extern API_TEST_API int nAPI_test;
API_TEST_API ULONG __stdcall highbit_unsigned();
API_TEST_API int __stdcall sum_integers(int a, int b);
API_TEST_API short __stdcall sum_shorts(short a, short b);
API_TEST_API short __stdcall sum_shorts_ref(short a, short b, short *c);
API_TEST_API double __stdcall sum_doubles(double a, double b);
API_TEST_API float __stdcall sum_floats(float a, float b);
API_TEST_API int __stdcall has_char(char *string, char ch);
API_TEST_API char * __stdcall find_char(char *string, char ch);
API_TEST_API void __stdcall dump_struct(simple_struct *x);
API_TEST_API int __stdcall mangle_simple_struct(simple_struct *x);
API_TEST_API BOOL __stdcall GetHandle(LPHANDLE pHandle);
API_TEST_API BOOL __stdcall FreeHandle(HANDLE Handle);
API_TEST_API int __cdecl c_sum_integers(int a, int b);