1 #![allow(unused_variables, non_upper_case_globals, non_snake_case, unused_unsafe, non_camel_case_types, dead_code, clippy::all)] 2 #[derive(:: std :: clone :: Clone, :: std :: marker :: Copy)] 3 #[repr(C)] 4 pub struct ACTION_HEADER { 5 pub transport_id: u32, 6 pub action_code: u16, 7 pub reserved: u16, 8 } 9 impl ACTION_HEADER {} 10 impl ::std::default::Default for ACTION_HEADER { 11 fn default() -> Self { 12 unsafe { ::std::mem::zeroed() } 13 } 14 } 15 impl ::std::fmt::Debug for ACTION_HEADER { 16 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 17 fmt.debug_struct("ACTION_HEADER").field("transport_id", &self.transport_id).field("action_code", &self.action_code).field("reserved", &self.reserved).finish() 18 } 19 } 20 impl ::std::cmp::PartialEq for ACTION_HEADER { 21 fn eq(&self, other: &Self) -> bool { 22 self.transport_id == other.transport_id && self.action_code == other.action_code && self.reserved == other.reserved 23 } 24 } 25 impl ::std::cmp::Eq for ACTION_HEADER {} 26 unsafe impl ::windows::runtime::Abi for ACTION_HEADER { 27 type Abi = Self; 28 type DefaultType = Self; 29 } 30 #[derive(:: std :: clone :: Clone, :: std :: marker :: Copy)] 31 #[repr(C)] 32 pub struct ADAPTER_STATUS { 33 pub adapter_address: [u8; 6], 34 pub rev_major: u8, 35 pub reserved0: u8, 36 pub adapter_type: u8, 37 pub rev_minor: u8, 38 pub duration: u16, 39 pub frmr_recv: u16, 40 pub frmr_xmit: u16, 41 pub iframe_recv_err: u16, 42 pub xmit_aborts: u16, 43 pub xmit_success: u32, 44 pub recv_success: u32, 45 pub iframe_xmit_err: u16, 46 pub recv_buff_unavail: u16, 47 pub t1_timeouts: u16, 48 pub ti_timeouts: u16, 49 pub reserved1: u32, 50 pub free_ncbs: u16, 51 pub max_cfg_ncbs: u16, 52 pub max_ncbs: u16, 53 pub xmit_buf_unavail: u16, 54 pub max_dgram_size: u16, 55 pub pending_sess: u16, 56 pub max_cfg_sess: u16, 57 pub max_sess: u16, 58 pub max_sess_pkt_size: u16, 59 pub name_count: u16, 60 } 61 impl ADAPTER_STATUS {} 62 impl ::std::default::Default for ADAPTER_STATUS { 63 fn default() -> Self { 64 unsafe { ::std::mem::zeroed() } 65 } 66 } 67 impl ::std::fmt::Debug for ADAPTER_STATUS { 68 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 69 fmt.debug_struct("ADAPTER_STATUS") 70 .field("adapter_address", &self.adapter_address) 71 .field("rev_major", &self.rev_major) 72 .field("reserved0", &self.reserved0) 73 .field("adapter_type", &self.adapter_type) 74 .field("rev_minor", &self.rev_minor) 75 .field("duration", &self.duration) 76 .field("frmr_recv", &self.frmr_recv) 77 .field("frmr_xmit", &self.frmr_xmit) 78 .field("iframe_recv_err", &self.iframe_recv_err) 79 .field("xmit_aborts", &self.xmit_aborts) 80 .field("xmit_success", &self.xmit_success) 81 .field("recv_success", &self.recv_success) 82 .field("iframe_xmit_err", &self.iframe_xmit_err) 83 .field("recv_buff_unavail", &self.recv_buff_unavail) 84 .field("t1_timeouts", &self.t1_timeouts) 85 .field("ti_timeouts", &self.ti_timeouts) 86 .field("reserved1", &self.reserved1) 87 .field("free_ncbs", &self.free_ncbs) 88 .field("max_cfg_ncbs", &self.max_cfg_ncbs) 89 .field("max_ncbs", &self.max_ncbs) 90 .field("xmit_buf_unavail", &self.xmit_buf_unavail) 91 .field("max_dgram_size", &self.max_dgram_size) 92 .field("pending_sess", &self.pending_sess) 93 .field("max_cfg_sess", &self.max_cfg_sess) 94 .field("max_sess", &self.max_sess) 95 .field("max_sess_pkt_size", &self.max_sess_pkt_size) 96 .field("name_count", &self.name_count) 97 .finish() 98 } 99 } 100 impl ::std::cmp::PartialEq for ADAPTER_STATUS { 101 fn eq(&self, other: &Self) -> bool { 102 self.adapter_address == other.adapter_address 103 && self.rev_major == other.rev_major 104 && self.reserved0 == other.reserved0 105 && self.adapter_type == other.adapter_type 106 && self.rev_minor == other.rev_minor 107 && self.duration == other.duration 108 && self.frmr_recv == other.frmr_recv 109 && self.frmr_xmit == other.frmr_xmit 110 && self.iframe_recv_err == other.iframe_recv_err 111 && self.xmit_aborts == other.xmit_aborts 112 && self.xmit_success == other.xmit_success 113 && self.recv_success == other.recv_success 114 && self.iframe_xmit_err == other.iframe_xmit_err 115 && self.recv_buff_unavail == other.recv_buff_unavail 116 && self.t1_timeouts == other.t1_timeouts 117 && self.ti_timeouts == other.ti_timeouts 118 && self.reserved1 == other.reserved1 119 && self.free_ncbs == other.free_ncbs 120 && self.max_cfg_ncbs == other.max_cfg_ncbs 121 && self.max_ncbs == other.max_ncbs 122 && self.xmit_buf_unavail == other.xmit_buf_unavail 123 && self.max_dgram_size == other.max_dgram_size 124 && self.pending_sess == other.pending_sess 125 && self.max_cfg_sess == other.max_cfg_sess 126 && self.max_sess == other.max_sess 127 && self.max_sess_pkt_size == other.max_sess_pkt_size 128 && self.name_count == other.name_count 129 } 130 } 131 impl ::std::cmp::Eq for ADAPTER_STATUS {} 132 unsafe impl ::windows::runtime::Abi for ADAPTER_STATUS { 133 type Abi = Self; 134 type DefaultType = Self; 135 } 136 pub const ASYNCH: u32 = 128u32; 137 pub const CALL_PENDING: u32 = 2u32; 138 pub const DEREGISTERED: u32 = 5u32; 139 pub const DUPLICATE: u32 = 6u32; 140 pub const DUPLICATE_DEREG: u32 = 7u32; 141 #[derive(:: std :: clone :: Clone, :: std :: marker :: Copy)] 142 #[repr(C)] 143 pub struct FIND_NAME_BUFFER { 144 pub length: u8, 145 pub access_control: u8, 146 pub frame_control: u8, 147 pub destination_addr: [u8; 6], 148 pub source_addr: [u8; 6], 149 pub routing_info: [u8; 18], 150 } 151 impl FIND_NAME_BUFFER {} 152 impl ::std::default::Default for FIND_NAME_BUFFER { 153 fn default() -> Self { 154 unsafe { ::std::mem::zeroed() } 155 } 156 } 157 impl ::std::fmt::Debug for FIND_NAME_BUFFER { 158 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 159 fmt.debug_struct("FIND_NAME_BUFFER").field("length", &self.length).field("access_control", &self.access_control).field("frame_control", &self.frame_control).field("destination_addr", &self.destination_addr).field("source_addr", &self.source_addr).field("routing_info", &self.routing_info).finish() 160 } 161 } 162 impl ::std::cmp::PartialEq for FIND_NAME_BUFFER { 163 fn eq(&self, other: &Self) -> bool { 164 self.length == other.length && self.access_control == other.access_control && self.frame_control == other.frame_control && self.destination_addr == other.destination_addr && self.source_addr == other.source_addr && self.routing_info == other.routing_info 165 } 166 } 167 impl ::std::cmp::Eq for FIND_NAME_BUFFER {} 168 unsafe impl ::windows::runtime::Abi for FIND_NAME_BUFFER { 169 type Abi = Self; 170 type DefaultType = Self; 171 } 172 #[derive(:: std :: clone :: Clone, :: std :: marker :: Copy)] 173 #[repr(C)] 174 pub struct FIND_NAME_HEADER { 175 pub node_count: u16, 176 pub reserved: u8, 177 pub unique_group: u8, 178 } 179 impl FIND_NAME_HEADER {} 180 impl ::std::default::Default for FIND_NAME_HEADER { 181 fn default() -> Self { 182 unsafe { ::std::mem::zeroed() } 183 } 184 } 185 impl ::std::fmt::Debug for FIND_NAME_HEADER { 186 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 187 fmt.debug_struct("FIND_NAME_HEADER").field("node_count", &self.node_count).field("reserved", &self.reserved).field("unique_group", &self.unique_group).finish() 188 } 189 } 190 impl ::std::cmp::PartialEq for FIND_NAME_HEADER { 191 fn eq(&self, other: &Self) -> bool { 192 self.node_count == other.node_count && self.reserved == other.reserved && self.unique_group == other.unique_group 193 } 194 } 195 impl ::std::cmp::Eq for FIND_NAME_HEADER {} 196 unsafe impl ::windows::runtime::Abi for FIND_NAME_HEADER { 197 type Abi = Self; 198 type DefaultType = Self; 199 } 200 pub const GROUP_NAME: u32 = 128u32; 201 pub const HANGUP_COMPLETE: u32 = 5u32; 202 pub const HANGUP_PENDING: u32 = 4u32; 203 #[derive(:: std :: clone :: Clone, :: std :: marker :: Copy)] 204 #[repr(C)] 205 pub struct LANA_ENUM { 206 pub length: u8, 207 pub lana: [u8; 255], 208 } 209 impl LANA_ENUM {} 210 impl ::std::default::Default for LANA_ENUM { 211 fn default() -> Self { 212 unsafe { ::std::mem::zeroed() } 213 } 214 } 215 impl ::std::fmt::Debug for LANA_ENUM { 216 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 217 fmt.debug_struct("LANA_ENUM").field("length", &self.length).field("lana", &self.lana).finish() 218 } 219 } 220 impl ::std::cmp::PartialEq for LANA_ENUM { 221 fn eq(&self, other: &Self) -> bool { 222 self.length == other.length && self.lana == other.lana 223 } 224 } 225 impl ::std::cmp::Eq for LANA_ENUM {} 226 unsafe impl ::windows::runtime::Abi for LANA_ENUM { 227 type Abi = Self; 228 type DefaultType = Self; 229 } 230 pub const LISTEN_OUTSTANDING: u32 = 1u32; 231 pub const MAX_LANA: u32 = 254u32; 232 #[derive(:: std :: clone :: Clone, :: std :: marker :: Copy)] 233 #[repr(C)] 234 pub struct NAME_BUFFER { 235 pub name: [u8; 16], 236 pub name_num: u8, 237 pub name_flags: u8, 238 } 239 impl NAME_BUFFER {} 240 impl ::std::default::Default for NAME_BUFFER { 241 fn default() -> Self { 242 unsafe { ::std::mem::zeroed() } 243 } 244 } 245 impl ::std::fmt::Debug for NAME_BUFFER { 246 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 247 fmt.debug_struct("NAME_BUFFER").field("name", &self.name).field("name_num", &self.name_num).field("name_flags", &self.name_flags).finish() 248 } 249 } 250 impl ::std::cmp::PartialEq for NAME_BUFFER { 251 fn eq(&self, other: &Self) -> bool { 252 self.name == other.name && self.name_num == other.name_num && self.name_flags == other.name_flags 253 } 254 } 255 impl ::std::cmp::Eq for NAME_BUFFER {} 256 unsafe impl ::windows::runtime::Abi for NAME_BUFFER { 257 type Abi = Self; 258 type DefaultType = Self; 259 } 260 pub const NAME_FLAGS_MASK: u32 = 135u32; 261 #[derive(:: std :: clone :: Clone, :: std :: marker :: Copy)] 262 #[repr(C)] 263 #[cfg(feature = "Win32_Foundation")] 264 pub struct NCB { 265 pub ncb_command: u8, 266 pub ncb_retcode: u8, 267 pub ncb_lsn: u8, 268 pub ncb_num: u8, 269 pub ncb_buffer: *mut u8, 270 pub ncb_length: u16, 271 pub ncb_callname: [u8; 16], 272 pub ncb_name: [u8; 16], 273 pub ncb_rto: u8, 274 pub ncb_sto: u8, 275 pub ncb_post: isize, 276 pub ncb_lana_num: u8, 277 pub ncb_cmd_cplt: u8, 278 pub ncb_reserve: [u8; 18], 279 pub ncb_event: super::super::Foundation::HANDLE, 280 } 281 #[cfg(feature = "Win32_Foundation")] 282 impl NCB {} 283 #[cfg(feature = "Win32_Foundation")] 284 impl ::std::default::Default for NCB { 285 fn default() -> Self { 286 unsafe { ::std::mem::zeroed() } 287 } 288 } 289 #[cfg(feature = "Win32_Foundation")] 290 impl ::std::fmt::Debug for NCB { 291 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 292 fmt.debug_struct("NCB") 293 .field("ncb_command", &self.ncb_command) 294 .field("ncb_retcode", &self.ncb_retcode) 295 .field("ncb_lsn", &self.ncb_lsn) 296 .field("ncb_num", &self.ncb_num) 297 .field("ncb_buffer", &self.ncb_buffer) 298 .field("ncb_length", &self.ncb_length) 299 .field("ncb_callname", &self.ncb_callname) 300 .field("ncb_name", &self.ncb_name) 301 .field("ncb_rto", &self.ncb_rto) 302 .field("ncb_sto", &self.ncb_sto) 303 .field("ncb_post", &self.ncb_post) 304 .field("ncb_lana_num", &self.ncb_lana_num) 305 .field("ncb_cmd_cplt", &self.ncb_cmd_cplt) 306 .field("ncb_reserve", &self.ncb_reserve) 307 .field("ncb_event", &self.ncb_event) 308 .finish() 309 } 310 } 311 #[cfg(feature = "Win32_Foundation")] 312 impl ::std::cmp::PartialEq for NCB { 313 fn eq(&self, other: &Self) -> bool { 314 self.ncb_command == other.ncb_command 315 && self.ncb_retcode == other.ncb_retcode 316 && self.ncb_lsn == other.ncb_lsn 317 && self.ncb_num == other.ncb_num 318 && self.ncb_buffer == other.ncb_buffer 319 && self.ncb_length == other.ncb_length 320 && self.ncb_callname == other.ncb_callname 321 && self.ncb_name == other.ncb_name 322 && self.ncb_rto == other.ncb_rto 323 && self.ncb_sto == other.ncb_sto 324 && self.ncb_post == other.ncb_post 325 && self.ncb_lana_num == other.ncb_lana_num 326 && self.ncb_cmd_cplt == other.ncb_cmd_cplt 327 && self.ncb_reserve == other.ncb_reserve 328 && self.ncb_event == other.ncb_event 329 } 330 } 331 #[cfg(feature = "Win32_Foundation")] 332 impl ::std::cmp::Eq for NCB {} 333 #[cfg(feature = "Win32_Foundation")] 334 unsafe impl ::windows::runtime::Abi for NCB { 335 type Abi = Self; 336 type DefaultType = Self; 337 } 338 pub const NCBACTION: u32 = 119u32; 339 pub const NCBADDGRNAME: u32 = 54u32; 340 pub const NCBADDNAME: u32 = 48u32; 341 pub const NCBASTAT: u32 = 51u32; 342 pub const NCBCALL: u32 = 16u32; 343 pub const NCBCANCEL: u32 = 53u32; 344 pub const NCBCHAINSEND: u32 = 23u32; 345 pub const NCBCHAINSENDNA: u32 = 114u32; 346 pub const NCBDELNAME: u32 = 49u32; 347 pub const NCBDGRECV: u32 = 33u32; 348 pub const NCBDGRECVBC: u32 = 35u32; 349 pub const NCBDGSEND: u32 = 32u32; 350 pub const NCBDGSENDBC: u32 = 34u32; 351 pub const NCBENUM: u32 = 55u32; 352 pub const NCBFINDNAME: u32 = 120u32; 353 pub const NCBHANGUP: u32 = 18u32; 354 pub const NCBLANSTALERT: u32 = 115u32; 355 pub const NCBLISTEN: u32 = 17u32; 356 pub const NCBNAMSZ: u32 = 16u32; 357 pub const NCBRECV: u32 = 21u32; 358 pub const NCBRECVANY: u32 = 22u32; 359 pub const NCBRESET: u32 = 50u32; 360 pub const NCBSEND: u32 = 20u32; 361 pub const NCBSENDNA: u32 = 113u32; 362 pub const NCBSSTAT: u32 = 52u32; 363 pub const NCBTRACE: u32 = 121u32; 364 pub const NCBUNLINK: u32 = 112u32; 365 pub const NRC_ACTSES: u32 = 15u32; 366 pub const NRC_BADDR: u32 = 7u32; 367 pub const NRC_BRIDGE: u32 = 35u32; 368 pub const NRC_BUFLEN: u32 = 1u32; 369 pub const NRC_CANCEL: u32 = 38u32; 370 pub const NRC_CANOCCR: u32 = 36u32; 371 pub const NRC_CMDCAN: u32 = 11u32; 372 pub const NRC_CMDTMO: u32 = 5u32; 373 pub const NRC_DUPENV: u32 = 48u32; 374 pub const NRC_DUPNAME: u32 = 13u32; 375 pub const NRC_ENVNOTDEF: u32 = 52u32; 376 pub const NRC_GOODRET: u32 = 0u32; 377 pub const NRC_IFBUSY: u32 = 33u32; 378 pub const NRC_ILLCMD: u32 = 3u32; 379 pub const NRC_ILLNN: u32 = 19u32; 380 pub const NRC_INCOMP: u32 = 6u32; 381 pub const NRC_INUSE: u32 = 22u32; 382 pub const NRC_INVADDRESS: u32 = 57u32; 383 pub const NRC_INVDDID: u32 = 59u32; 384 pub const NRC_LOCKFAIL: u32 = 60u32; 385 pub const NRC_LOCTFUL: u32 = 17u32; 386 pub const NRC_MAXAPPS: u32 = 54u32; 387 pub const NRC_NAMCONF: u32 = 25u32; 388 pub const NRC_NAMERR: u32 = 23u32; 389 pub const NRC_NAMTFUL: u32 = 14u32; 390 pub const NRC_NOCALL: u32 = 20u32; 391 pub const NRC_NORES: u32 = 9u32; 392 pub const NRC_NORESOURCES: u32 = 56u32; 393 pub const NRC_NOSAPS: u32 = 55u32; 394 pub const NRC_NOWILD: u32 = 21u32; 395 pub const NRC_OPENERR: u32 = 63u32; 396 pub const NRC_OSRESNOTAV: u32 = 53u32; 397 pub const NRC_PENDING: u32 = 255u32; 398 pub const NRC_REMTFUL: u32 = 18u32; 399 pub const NRC_SABORT: u32 = 24u32; 400 pub const NRC_SCLOSED: u32 = 10u32; 401 pub const NRC_SNUMOUT: u32 = 8u32; 402 pub const NRC_SYSTEM: u32 = 64u32; 403 pub const NRC_TOOMANY: u32 = 34u32; 404 #[cfg(feature = "Win32_Foundation")] 405 #[inline] 406 pub unsafe fn Netbios(pncb: *mut NCB) -> u8 { 407 #[cfg(windows)] 408 { 409 #[link(name = "windows")] 410 extern "system" { 411 fn Netbios(pncb: *mut NCB) -> u8; 412 } 413 ::std::mem::transmute(Netbios(::std::mem::transmute(pncb))) 414 } 415 #[cfg(not(windows))] 416 unimplemented!("Unsupported target OS"); 417 } 418 pub const REGISTERED: u32 = 4u32; 419 pub const REGISTERING: u32 = 0u32; 420 pub const SESSION_ABORTED: u32 = 6u32; 421 #[derive(:: std :: clone :: Clone, :: std :: marker :: Copy)] 422 #[repr(C)] 423 pub struct SESSION_BUFFER { 424 pub lsn: u8, 425 pub state: u8, 426 pub local_name: [u8; 16], 427 pub remote_name: [u8; 16], 428 pub rcvs_outstanding: u8, 429 pub sends_outstanding: u8, 430 } 431 impl SESSION_BUFFER {} 432 impl ::std::default::Default for SESSION_BUFFER { 433 fn default() -> Self { 434 unsafe { ::std::mem::zeroed() } 435 } 436 } 437 impl ::std::fmt::Debug for SESSION_BUFFER { 438 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 439 fmt.debug_struct("SESSION_BUFFER").field("lsn", &self.lsn).field("state", &self.state).field("local_name", &self.local_name).field("remote_name", &self.remote_name).field("rcvs_outstanding", &self.rcvs_outstanding).field("sends_outstanding", &self.sends_outstanding).finish() 440 } 441 } 442 impl ::std::cmp::PartialEq for SESSION_BUFFER { 443 fn eq(&self, other: &Self) -> bool { 444 self.lsn == other.lsn && self.state == other.state && self.local_name == other.local_name && self.remote_name == other.remote_name && self.rcvs_outstanding == other.rcvs_outstanding && self.sends_outstanding == other.sends_outstanding 445 } 446 } 447 impl ::std::cmp::Eq for SESSION_BUFFER {} 448 unsafe impl ::windows::runtime::Abi for SESSION_BUFFER { 449 type Abi = Self; 450 type DefaultType = Self; 451 } 452 pub const SESSION_ESTABLISHED: u32 = 3u32; 453 #[derive(:: std :: clone :: Clone, :: std :: marker :: Copy)] 454 #[repr(C)] 455 pub struct SESSION_HEADER { 456 pub sess_name: u8, 457 pub num_sess: u8, 458 pub rcv_dg_outstanding: u8, 459 pub rcv_any_outstanding: u8, 460 } 461 impl SESSION_HEADER {} 462 impl ::std::default::Default for SESSION_HEADER { 463 fn default() -> Self { 464 unsafe { ::std::mem::zeroed() } 465 } 466 } 467 impl ::std::fmt::Debug for SESSION_HEADER { 468 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 469 fmt.debug_struct("SESSION_HEADER").field("sess_name", &self.sess_name).field("num_sess", &self.num_sess).field("rcv_dg_outstanding", &self.rcv_dg_outstanding).field("rcv_any_outstanding", &self.rcv_any_outstanding).finish() 470 } 471 } 472 impl ::std::cmp::PartialEq for SESSION_HEADER { 473 fn eq(&self, other: &Self) -> bool { 474 self.sess_name == other.sess_name && self.num_sess == other.num_sess && self.rcv_dg_outstanding == other.rcv_dg_outstanding && self.rcv_any_outstanding == other.rcv_any_outstanding 475 } 476 } 477 impl ::std::cmp::Eq for SESSION_HEADER {} 478 unsafe impl ::windows::runtime::Abi for SESSION_HEADER { 479 type Abi = Self; 480 type DefaultType = Self; 481 } 482 pub const UNIQUE_NAME: u32 = 0u32; 483