wined3d: Mark the context valid if making it current on the "backup" window worked.
[wine.git] / include / fltdefs.h
blob393dd58615f7a2b07898d9be76c7c81d3e0cc8c3
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6 #ifndef _FLTDEFS_H
7 #define _FLTDEFS_H
9 typedef PVOID FILTER_HANDLE,*PFILTER_HANDLE;
10 typedef PVOID INTERFACE_HANDLE,*PINTERFACE_HANDLE;
12 #ifdef __cplusplus
13 #define EXTERNCDECL EXTERN_C
14 #else
15 #define EXTERNCDECL
16 #endif
18 #define PFAPIENTRY EXTERNCDECL DWORD WINAPI
20 typedef enum _GlobalFilter {
21 GF_FRAGMENTS = 2,GF_STRONGHOST = 8,GF_FRAGCACHE = 9
22 } GLOBAL_FILTER,*PGLOBAL_FILTER;
24 typedef enum _PfForwardAction {
25 PF_ACTION_FORWARD = 0,PF_ACTION_DROP
26 } PFFORWARD_ACTION,*PPFFORWARD_ACTION;
28 typedef enum _PfAddresType {
29 PF_IPV4,PF_IPV6
30 } PFADDRESSTYPE,*PPFADDRESSTYPE;
32 #define FILTER_PROTO(ProtoId) MAKELONG(MAKEWORD((ProtoId),0x00),0x00000)
34 #define FILTER_PROTO_ANY FILTER_PROTO(0x00)
35 #define FILTER_PROTO_ICMP FILTER_PROTO(0x01)
36 #define FILTER_PROTO_TCP FILTER_PROTO(0x06)
37 #define FILTER_PROTO_UDP FILTER_PROTO(0x11)
39 #define FILTER_TCPUDP_PORT_ANY (WORD)0x0000
41 #define FILTER_ICMP_TYPE_ANY (BYTE)0xff
42 #define FILTER_ICMP_CODE_ANY (BYTE)0xff
44 typedef struct _PF_FILTER_DESCRIPTOR {
45 DWORD dwFilterFlags;
46 DWORD dwRule;
47 PFADDRESSTYPE pfatType;
48 PBYTE SrcAddr;
49 PBYTE SrcMask;
50 PBYTE DstAddr;
51 PBYTE DstMask;
52 DWORD dwProtocol;
53 DWORD fLateBound;
54 WORD wSrcPort;
55 WORD wDstPort;
56 WORD wSrcPortHighRange;
57 WORD wDstPortHighRange;
58 } PF_FILTER_DESCRIPTOR,*PPF_FILTER_DESCRIPTOR;
60 typedef struct _PF_FILTER_STATS {
61 DWORD dwNumPacketsFiltered;
62 PF_FILTER_DESCRIPTOR info;
63 } PF_FILTER_STATS,*PPF_FILTER_STATS;
65 typedef struct _PF_INTERFACE_STATS {
66 PVOID pvDriverContext;
67 DWORD dwFlags;
68 DWORD dwInDrops;
69 DWORD dwOutDrops;
70 PFFORWARD_ACTION eaInAction;
71 PFFORWARD_ACTION eaOutAction;
72 DWORD dwNumInFilters;
73 DWORD dwNumOutFilters;
74 DWORD dwFrag;
75 DWORD dwSpoof;
76 DWORD dwReserved1;
77 DWORD dwReserved2;
78 LARGE_INTEGER liSYN;
79 LARGE_INTEGER liTotalLogged;
80 DWORD dwLostLogEntries;
81 PF_FILTER_STATS FilterInfo[1];
82 } PF_INTERFACE_STATS,*PPF_INTERFACE_STATS;
84 #define FILTERSIZE (sizeof(PF_FILTER_DESCRIPTOR) - (DWORD)(&((PPF_FILTER_DESCRIPTOR)0)->SrcAddr))
86 #define FD_FLAGS_NOSYN 0x1
88 #define FD_FLAGS_ALLFLAGS FD_FLAGS_NOSYN
90 #define LB_SRC_ADDR_USE_SRCADDR_FLAG 0x00000001
91 #define LB_SRC_ADDR_USE_DSTADDR_FLAG 0x00000002
92 #define LB_DST_ADDR_USE_SRCADDR_FLAG 0x00000004
93 #define LB_DST_ADDR_USE_DSTADDR_FLAG 0x00000008
94 #define LB_SRC_MASK_LATE_FLAG 0x00000010
95 #define LB_DST_MASK_LATE_FLAG 0x00000020
97 typedef struct _PF_LATEBIND_INFO {
98 PBYTE SrcAddr;
99 PBYTE DstAddr;
100 PBYTE Mask;
101 } PF_LATEBIND_INFO,*PPF_LATEBIND_INFO;
103 typedef enum _PfFrameType {
104 PFFT_FILTER = 1,PFFT_FRAG = 2,PFFT_SPOOF = 3
105 } PFFRAMETYPE,*PPFFRAMETYPE;
107 typedef struct _pfLogFrame {
108 LARGE_INTEGER Timestamp;
109 PFFRAMETYPE pfeTypeOfFrame;
110 DWORD dwTotalSizeUsed;
111 DWORD dwFilterRule;
112 WORD wSizeOfAdditionalData;
113 WORD wSizeOfIpHeader;
114 DWORD dwInterfaceName;
115 DWORD dwIPIndex;
116 BYTE bPacketData[1];
117 } PFLOGFRAME,*PPFLOGFRAME;
119 #define ERROR_BASE 23000
121 #define PFERROR_NO_PF_INTERFACE (ERROR_BASE + 0)
122 #define PFERROR_NO_FILTERS_GIVEN (ERROR_BASE + 1)
123 #define PFERROR_BUFFER_TOO_SMALL (ERROR_BASE + 2)
124 #define ERROR_IPV6_NOT_IMPLEMENTED (ERROR_BASE + 3)
126 PFAPIENTRY PfCreateInterface(DWORD dwName,PFFORWARD_ACTION inAction,PFFORWARD_ACTION outAction,BOOL bUseLog,BOOL bMustBeUnique,INTERFACE_HANDLE *ppInterface);
127 PFAPIENTRY PfDeleteInterface(INTERFACE_HANDLE pInterface);
128 PFAPIENTRY PfAddFiltersToInterface(INTERFACE_HANDLE ih,DWORD cInFilters,PPF_FILTER_DESCRIPTOR pfiltIn,DWORD cOutFilters,PPF_FILTER_DESCRIPTOR pfiltOut,PFILTER_HANDLE pfHandle);
129 PFAPIENTRY PfRemoveFiltersFromInterface(INTERFACE_HANDLE ih,DWORD cInFilters,PPF_FILTER_DESCRIPTOR pfiltIn,DWORD cOutFilters,PPF_FILTER_DESCRIPTOR pfiltOut);
130 PFAPIENTRY PfRemoveFilterHandles(INTERFACE_HANDLE pInterface,DWORD cFilters,PFILTER_HANDLE pvHandles);
131 PFAPIENTRY PfUnBindInterface(INTERFACE_HANDLE pInterface);
132 PFAPIENTRY PfBindInterfaceToIndex(INTERFACE_HANDLE pInterface,DWORD dwIndex,PFADDRESSTYPE pfatLinkType,PBYTE LinkIPAddress);
133 PFAPIENTRY PfBindInterfaceToIPAddress(INTERFACE_HANDLE pInterface,PFADDRESSTYPE pfatType,PBYTE IPAddress);
134 PFAPIENTRY PfRebindFilters(INTERFACE_HANDLE pInterface,PPF_LATEBIND_INFO pLateBindInfo);
135 PFAPIENTRY PfAddGlobalFilterToInterface(INTERFACE_HANDLE pInterface,GLOBAL_FILTER gfFilter);
136 PFAPIENTRY PfRemoveGlobalFilterFromInterface(INTERFACE_HANDLE pInterface,GLOBAL_FILTER gfFilter);
137 PFAPIENTRY PfMakeLog(HANDLE hEvent);
138 PFAPIENTRY PfSetLogBuffer(PBYTE pbBuffer,DWORD dwSize,DWORD dwThreshold,DWORD dwEntries,PDWORD pdwLoggedEntries,PDWORD pdwLostEntries,PDWORD pdwSizeUsed);
139 PFAPIENTRY PfDeleteLog(VOID);
140 PFAPIENTRY PfGetInterfaceStatistics(INTERFACE_HANDLE pInterface,PPF_INTERFACE_STATS ppfStats,PDWORD pdwBufferSize,BOOL fResetCounters);
141 PFAPIENTRY PfTestPacket(INTERFACE_HANDLE pInInterface,INTERFACE_HANDLE pOutInterface,DWORD cBytes,PBYTE pbPacket,PPFFORWARD_ACTION ppAction);
142 #endif