winapi_ui_automation/um/
nb30.rs

1// Licensed under the Apache License, Version 2.0
2// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4// All files in the project carrying such notice may not be copied, modified, or distributed
5// except according to those terms.
6//! This module contains the definitions for portable NetBIOS 3.0 support.
7use shared::minwindef::{DWORD, PUCHAR, UCHAR, ULONG, USHORT, WORD};
8use um::winnt::HANDLE;
9pub const NCBNAMSZ: usize = 16;
10pub const MAX_LANA: usize = 254;
11FN!{stdcall PFPOST(
12    *mut NCB,
13) -> ()}
14#[cfg(target_pointer_width = "64")]
15STRUCT!{struct NCB {
16    ncb_command: UCHAR,
17    ncb_retcode: UCHAR,
18    ncb_lsn: UCHAR,
19    ncb_num: UCHAR,
20    ncb_buffer: PUCHAR,
21    ncb_length: WORD,
22    ncb_callname: [UCHAR; NCBNAMSZ],
23    ncb_name: [UCHAR; NCBNAMSZ],
24    ncb_rto: UCHAR,
25    ncb_sto: UCHAR,
26    ncb_post: PFPOST,
27    ncb_lana_num: UCHAR,
28    ncb_cmd_cplt: UCHAR,
29    ncb_reserve: [UCHAR; 18],
30    ncb_event: HANDLE,
31}}
32#[cfg(target_pointer_width = "32")]
33STRUCT!{struct NCB {
34    ncb_command: UCHAR,
35    ncb_retcode: UCHAR,
36    ncb_lsn: UCHAR,
37    ncb_num: UCHAR,
38    ncb_buffer: PUCHAR,
39    ncb_length: WORD,
40    ncb_callname: [UCHAR; NCBNAMSZ],
41    ncb_name: [UCHAR; NCBNAMSZ],
42    ncb_rto: UCHAR,
43    ncb_sto: UCHAR,
44    ncb_post: PFPOST,
45    ncb_lana_num: UCHAR,
46    ncb_cmd_cplt: UCHAR,
47    ncb_reserve: [UCHAR; 10],
48    ncb_event: HANDLE,
49}}
50pub type PNCB = *mut NCB;
51STRUCT!{struct ADAPTER_STATUS {
52    adapter_address: [UCHAR; 6],
53    rev_major: UCHAR,
54    reserved0: UCHAR,
55    adapter_type: UCHAR,
56    rev_minor: UCHAR,
57    duration: WORD,
58    frmr_recv: WORD,
59    frmr_xmit: WORD,
60    iframe_recv_err: WORD,
61    xmit_aborts: WORD,
62    xmit_success: DWORD,
63    recv_success: DWORD,
64    iframe_xmit_err: WORD,
65    recv_buff_unavail: WORD,
66    t1_timeouts: WORD,
67    ti_timeouts: WORD,
68    reserved1: DWORD,
69    free_ncbs: WORD,
70    max_cfg_ncbs: WORD,
71    max_ncbs: WORD,
72    xmit_buf_unavail: WORD,
73    max_dgram_size: WORD,
74    pending_sess: WORD,
75    max_cfg_sess: WORD,
76    max_sess: WORD,
77    max_sess_pkt_size: WORD,
78    name_count: WORD,
79}}
80pub type PADAPTER_STATUS = *mut ADAPTER_STATUS;
81STRUCT!{struct NAME_BUFFER {
82    name: [UCHAR; NCBNAMSZ],
83    name_num: UCHAR,
84    name_flags: UCHAR,
85}}
86pub type PNAME_BUFFER = *mut NAME_BUFFER;
87pub const NAME_FLAGS_MASK: UCHAR = 0x87;
88pub const GROUP_NAME: UCHAR = 0x80;
89pub const UNIQUE_NAME: UCHAR = 0x00;
90pub const REGISTERING: UCHAR = 0x00;
91pub const REGISTERED: UCHAR = 0x04;
92pub const DEREGISTERED: UCHAR = 0x05;
93pub const DUPLICATE: UCHAR = 0x06;
94pub const DUPLICATE_DEREG: UCHAR = 0x07;
95STRUCT!{struct SESSION_HEADER {
96    sess_name: UCHAR,
97    num_sess: UCHAR,
98    rcv_dg_outstanding: UCHAR,
99    rcv_any_outstanding: UCHAR,
100}}
101pub type PSESSION_HEADER = *mut SESSION_HEADER;
102STRUCT!{struct SESSION_BUFFER {
103    lsn: UCHAR,
104    state: UCHAR,
105    local_name: [UCHAR; NCBNAMSZ],
106    remote_name: [UCHAR; NCBNAMSZ],
107    rcvs_outstanding: UCHAR,
108    sends_outstanding: UCHAR,
109}}
110pub type PSESSION_BUFFER = *mut SESSION_BUFFER;
111pub const LISTEN_OUTSTANDING: UCHAR = 0x01;
112pub const CALL_PENDING: UCHAR = 0x02;
113pub const SESSION_ESTABLISHED: UCHAR = 0x03;
114pub const HANGUP_PENDING: UCHAR = 0x04;
115pub const HANGUP_COMPLETE: UCHAR = 0x05;
116pub const SESSION_ABORTED: UCHAR = 0x06;
117STRUCT!{struct LANA_ENUM {
118    length: UCHAR,
119    lana: [UCHAR; MAX_LANA + 1],
120}}
121pub type PLANA_ENUM = *mut LANA_ENUM;
122STRUCT!{struct FIND_NAME_HEADER {
123    node_count: WORD,
124    reserved: UCHAR,
125    unique_group: UCHAR,
126}}
127pub type PFIND_NAME_HEADER = *mut FIND_NAME_HEADER;
128STRUCT!{struct FIND_NAME_BUFFER {
129    length: UCHAR,
130    access_control: UCHAR,
131    frame_control: UCHAR,
132    destination_addr: [UCHAR; 6],
133    source_addr: [UCHAR; 6],
134    routing_info: [UCHAR; 18],
135}}
136pub type PFIND_NAME_BUFFER = *mut FIND_NAME_BUFFER;
137STRUCT!{struct ACTION_HEADER {
138    transport_id: ULONG,
139    action_code: USHORT,
140    reserved: USHORT,
141}}
142pub type PACTION_HEADER = *mut ACTION_HEADER;
143pub const ALL_TRANSPORTS: ULONG = 0x0000004d;
144pub const MS_NBF: ULONG = 0x46424e4d;
145pub const NCBCALL: UCHAR = 0x10;
146pub const NCBLISTEN: UCHAR = 0x11;
147pub const NCBHANGUP: UCHAR = 0x12;
148pub const NCBSEND: UCHAR = 0x14;
149pub const NCBRECV: UCHAR = 0x15;
150pub const NCBRECVANY: UCHAR = 0x16;
151pub const NCBCHAINSEND: UCHAR = 0x17;
152pub const NCBDGSEND: UCHAR = 0x20;
153pub const NCBDGRECV: UCHAR = 0x21;
154pub const NCBDGSENDBC: UCHAR = 0x22;
155pub const NCBADDNAME: UCHAR = 0x30;
156pub const NCBDELNAME: UCHAR = 0x31;
157pub const NCBRESET: UCHAR = 0x32;
158pub const NCBASTAT: UCHAR = 0x33;
159pub const NCBSSTAT: UCHAR = 0x34;
160pub const NCBCANCEL: UCHAR = 0x35;
161pub const NCBADDGRNAME: UCHAR = 0x36;
162pub const NCBENUM: UCHAR = 0x37;
163pub const NCBUNLINK: UCHAR = 0x70;
164pub const NCBSENDNA: UCHAR = 0x71;
165pub const NCBCHAINSENDNA: UCHAR = 0x72;
166pub const NCBLANSTALERT: UCHAR = 0x73;
167pub const NCBACTION: UCHAR = 0x77;
168pub const NCBFINDNAME: UCHAR = 0x78;
169pub const NCBTRACE: UCHAR = 0x79;
170pub const ASYNCH: UCHAR = 0x80;
171pub const NRC_GOODRET: UCHAR = 0x00;
172pub const NRC_BUFLEN: UCHAR = 0x01;
173pub const NRC_ILLCMD: UCHAR = 0x03;
174pub const NRC_CMDTMO: UCHAR = 0x05;
175pub const NRC_INCOMP: UCHAR = 0x06;
176pub const NRC_BADDR: UCHAR = 0x07;
177pub const NRC_SNUMOUT: UCHAR = 0x08;
178pub const NRC_NORES: UCHAR = 0x09;
179pub const NRC_SCLOSED: UCHAR = 0x0a;
180pub const NRC_CMDCAN: UCHAR = 0x0b;
181pub const NRC_DUPNAME: UCHAR = 0x0d;
182pub const NRC_NAMTFUL: UCHAR = 0x0e;
183pub const NRC_ACTSES: UCHAR = 0x0f;
184pub const NRC_LOCTFUL: UCHAR = 0x11;
185pub const NRC_REMTFUL: UCHAR = 0x12;
186pub const NRC_ILLNN: UCHAR = 0x13;
187pub const NRC_NOCALL: UCHAR = 0x14;
188pub const NRC_NOWILD: UCHAR = 0x15;
189pub const NRC_INUSE: UCHAR = 0x16;
190pub const NRC_NAMERR: UCHAR = 0x17;
191pub const NRC_SABORT: UCHAR = 0x18;
192pub const NRC_NAMCONF: UCHAR = 0x19;
193pub const NRC_IFBUSY: UCHAR = 0x21;
194pub const NRC_TOOMANY: UCHAR = 0x22;
195pub const NRC_BRIDGE: UCHAR = 0x23;
196pub const NRC_CANOCCR: UCHAR = 0x24;
197pub const NRC_CANCEL: UCHAR = 0x26;
198pub const NRC_DUPENV: UCHAR = 0x30;
199pub const NRC_ENVNOTDEF: UCHAR = 0x34;
200pub const NRC_OSRESNOTAV: UCHAR = 0x35;
201pub const NRC_MAXAPPS: UCHAR = 0x36;
202pub const NRC_NOSAPS: UCHAR = 0x37;
203pub const NRC_NORESOURCES: UCHAR = 0x38;
204pub const NRC_INVADDRESS: UCHAR = 0x39;
205pub const NRC_INVDDID: UCHAR = 0x3B;
206pub const NRC_LOCKFAIL: UCHAR = 0x3C;
207pub const NRC_OPENERR: UCHAR = 0x3f;
208pub const NRC_SYSTEM: UCHAR = 0x40;
209pub const NRC_PENDING: UCHAR = 0xff;
210extern "system" {
211    pub fn Netbios(
212        pncb: PNCB,
213    ) -> UCHAR;
214}