nsiproxy: Introduce IOCTL_NSIPROXY_WINE_GET_PARAMETER.
[wine.git] / include / wine / nsi.h
blob3327b1f7403b69fc1b307a3b04a6d89fa7a1ddec
1 /*
2 * Copyright 2021 Huw Davies
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_NSI_H
20 #define __WINE_NSI_H
22 #include "winioctl.h"
24 /* Undocumented NSI NDIS tables */
25 #define NSI_NDIS_IFINFO_TABLE 0
26 #define NSI_NDIS_INDEX_LUID_TABLE 2
28 struct nsi_ndis_ifinfo_rw
30 GUID network_guid;
31 DWORD admin_status;
32 IF_COUNTED_STRING alias; /* .Length in bytes not including '\0' */
33 IF_PHYSICAL_ADDRESS phys_addr;
34 USHORT pad;
35 IF_COUNTED_STRING name2;
36 DWORD unk;
39 struct nsi_ndis_ifinfo_dynamic
41 DWORD oper_status;
42 struct
44 DWORD unk : 1;
45 DWORD not_media_conn : 1;
46 DWORD unk2 : 30;
47 } flags;
48 DWORD media_conn_state;
49 DWORD unk;
50 DWORD mtu;
51 ULONG64 xmit_speed;
52 ULONG64 rcv_speed;
53 ULONG64 in_errors;
54 ULONG64 in_discards;
55 ULONG64 out_errors;
56 ULONG64 out_discards;
57 ULONG64 unk2;
58 ULONG64 in_octets;
59 ULONG64 in_ucast_pkts;
60 ULONG64 in_mcast_pkts;
61 ULONG64 in_bcast_pkts;
62 ULONG64 out_octets;
63 ULONG64 out_ucast_pkts;
64 ULONG64 out_mcast_pkts;
65 ULONG64 out_bcast_pkts;
66 ULONG64 unk3[2];
67 ULONG64 in_ucast_octs;
68 ULONG64 in_mcast_octs;
69 ULONG64 in_bcast_octs;
70 ULONG64 out_ucast_octs;
71 ULONG64 out_mcast_octs;
72 ULONG64 out_bcast_octs;
73 ULONG64 unk4;
76 struct nsi_ndis_ifinfo_static
78 DWORD if_index;
79 IF_COUNTED_STRING descr;
80 DWORD type;
81 DWORD access_type;
82 DWORD unk;
83 DWORD conn_type;
84 GUID if_guid;
85 USHORT conn_present;
86 IF_PHYSICAL_ADDRESS perm_phys_addr;
87 struct
89 DWORD hw : 1;
90 DWORD filter : 1;
91 DWORD unk : 30;
92 } flags;
93 DWORD media_type;
94 DWORD phys_medium_type;
97 /* Wine specific ioctl interface */
99 #define IOCTL_NSIPROXY_WINE_ENUMERATE_ALL CTL_CODE(FILE_DEVICE_NETWORK, 0x400, METHOD_BUFFERED, 0)
100 #define IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS CTL_CODE(FILE_DEVICE_NETWORK, 0x401, METHOD_BUFFERED, 0)
101 #define IOCTL_NSIPROXY_WINE_GET_PARAMETER CTL_CODE(FILE_DEVICE_NETWORK, 0x402, METHOD_BUFFERED, 0)
103 /* input for IOCTL_NSIPROXY_WINE_ENUMERATE_ALL */
104 struct nsiproxy_enumerate_all
106 NPI_MODULEID module;
107 DWORD first_arg;
108 DWORD second_arg;
109 DWORD table;
110 DWORD key_size;
111 DWORD rw_size;
112 DWORD dynamic_size;
113 DWORD static_size;
114 DWORD count;
117 /* input for IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS */
118 struct nsiproxy_get_all_parameters
120 NPI_MODULEID module;
121 DWORD first_arg;
122 DWORD table;
123 DWORD key_size;
124 DWORD rw_size;
125 DWORD dynamic_size;
126 DWORD static_size;
127 BYTE key[1]; /* key_size */
130 /* input for IOCTL_NSIPROXY_WINE_GET_PARAMETER */
131 struct nsiproxy_get_parameter
133 NPI_MODULEID module;
134 DWORD first_arg;
135 DWORD table;
136 DWORD key_size;
137 DWORD param_type;
138 DWORD data_offset;
139 BYTE key[1]; /* key_size */
142 /* Undocumented Nsi api */
144 #define NSI_PARAM_TYPE_RW 0
145 #define NSI_PARAM_TYPE_DYNAMIC 1
146 #define NSI_PARAM_TYPE_STATIC 2
148 struct nsi_enumerate_all_ex
150 void *unknown[2];
151 const NPI_MODULEID *module;
152 DWORD_PTR table;
153 DWORD first_arg;
154 DWORD second_arg;
155 void *key_data;
156 DWORD key_size;
157 void *rw_data;
158 DWORD rw_size;
159 void *dynamic_data;
160 DWORD dynamic_size;
161 void *static_data;
162 DWORD static_size;
163 DWORD_PTR count;
166 struct nsi_get_all_parameters_ex
168 void *unknown[2];
169 const NPI_MODULEID *module;
170 DWORD_PTR table;
171 DWORD first_arg;
172 DWORD unknown2;
173 const void *key;
174 DWORD key_size;
175 void *rw_data;
176 DWORD rw_size;
177 void *dynamic_data;
178 DWORD dynamic_size;
179 void *static_data;
180 DWORD static_size;
183 struct nsi_get_parameter_ex
185 void *unknown[2];
186 const NPI_MODULEID *module;
187 DWORD_PTR table;
188 DWORD first_arg;
189 DWORD unknown2;
190 const void *key;
191 DWORD key_size;
192 DWORD_PTR param_type;
193 void *data;
194 DWORD data_size;
195 DWORD data_offset;
198 DWORD WINAPI NsiAllocateAndGetTable( DWORD unk, const NPI_MODULEID *module, DWORD table, void **key_data, DWORD key_size,
199 void **rw_data, DWORD rw_size, void **dynamic_data, DWORD dynamic_size,
200 void **static_data, DWORD static_size, DWORD *count, DWORD unk2 );
201 DWORD WINAPI NsiEnumerateObjectsAllParameters( DWORD unk, DWORD unk2, const NPI_MODULEID *module, DWORD table,
202 void *key_data, DWORD key_size, void *rw_data, DWORD rw_size,
203 void *dynamic_data, DWORD dynamic_size, void *static_data, DWORD static_size,
204 DWORD *count );
205 DWORD WINAPI NsiEnumerateObjectsAllParametersEx( struct nsi_enumerate_all_ex *params );
206 void WINAPI NsiFreeTable( void *key_data, void *rw_data, void *dynamic_data, void *static_data );
207 DWORD WINAPI NsiGetAllParameters( DWORD unk, const NPI_MODULEID *module, DWORD table, const void *key, DWORD key_size,
208 void *rw_data, DWORD rw_size, void *dynamic_data, DWORD dynamic_size,
209 void *static_data, DWORD static_size );
210 DWORD WINAPI NsiGetAllParametersEx( struct nsi_get_all_parameters_ex *params );
211 DWORD WINAPI NsiGetParameter( DWORD unk, const NPI_MODULEID *module, DWORD table, const void *key, DWORD key_size,
212 DWORD param_type, void *data, DWORD data_size, DWORD data_offset );
213 DWORD WINAPI NsiGetParameterEx( struct nsi_get_parameter_ex *params );
215 #endif /* __WINE_NSI_H */