OSDN Git Service

Correct mistyped __MINGW_NOTHROW macro.
[mingw/mingw-org-wsl.git] / include / nb30.h
1 /**
2  * @file nb30.h
3  * Copyright 2012, 2013 MinGW.org project
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  * 
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  * 
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 #ifndef _NB30_H
25 #define _NB30_H
26 #pragma GCC system_header
27 #include <_mingw.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 #define NCBNAMSZ 16
34 #define MAX_LANA 254
35 #define NAME_FLAGS_MASK 0x87
36 #define GROUP_NAME 0x80
37 #define UNIQUE_NAME 0x00
38 #define REGISTERING 0x00
39 #define REGISTERED 0x04
40 #define DEREGISTERED 0x05
41 #define DUPLICATE 0x06
42 #define DUPLICATE_DEREG 0x07
43 #define LISTEN_OUTSTANDING 0x01
44 #define CALL_PENDING 0x02
45 #define SESSION_ESTABLISHED 0x03
46 #define HANGUP_PENDING 0x04
47 #define HANGUP_COMPLETE 0x05
48 #define SESSION_ABORTED 0x06
49 #define ALL_TRANSPORTS "M\0\0\0"
50 #define MS_NBF "MNBF"
51 #define NCBCALL 0x10
52 #define NCBLISTEN 0x11
53 #define NCBHANGUP 0x12
54 #define NCBSEND 0x14
55 #define NCBRECV 0x15
56 #define NCBRECVANY 0x16
57 #define NCBCHAINSEND 0x17
58 #define NCBDGSEND 0x20
59 #define NCBDGRECV 0x21
60 #define NCBDGSENDBC 0x22
61 #define NCBDGRECVBC 0x23
62 #define NCBADDNAME 0x30
63 #define NCBDELNAME 0x31
64 #define NCBRESET 0x32
65 #define NCBASTAT 0x33
66 #define NCBSSTAT 0x34
67 #define NCBCANCEL 0x35
68 #define NCBADDGRNAME 0x36
69 #define NCBENUM 0x37
70 #define NCBUNLINK 0x70
71 #define NCBSENDNA 0x71
72 #define NCBCHAINSENDNA 0x72
73 #define NCBLANSTALERT 0x73
74 #define NCBACTION 0x77
75 #define NCBFINDNAME 0x78
76 #define NCBTRACE 0x79
77 #define ASYNCH 0x80
78 #define NRC_GOODRET 0x00
79 #define NRC_BUFLEN 0x01
80 #define NRC_ILLCMD 0x03
81 #define NRC_CMDTMO 0x05
82 #define NRC_INCOMP 0x06
83 #define NRC_BADDR 0x07
84 #define NRC_SNUMOUT 0x08
85 #define NRC_NORES 0x09
86 #define NRC_SCLOSED 0x0a
87 #define NRC_CMDCAN 0x0b
88 #define NRC_DUPNAME 0x0d
89 #define NRC_NAMTFUL 0x0e
90 #define NRC_ACTSES 0x0f
91 #define NRC_LOCTFUL 0x11
92 #define NRC_REMTFUL 0x12
93 #define NRC_ILLNN 0x13
94 #define NRC_NOCALL 0x14
95 #define NRC_NOWILD 0x15
96 #define NRC_INUSE 0x16
97 #define NRC_NAMERR 0x17
98 #define NRC_SABORT 0x18
99 #define NRC_NAMCONF 0x19
100 #define NRC_IFBUSY 0x21
101 #define NRC_TOOMANY 0x22
102 #define NRC_BRIDGE 0x23
103 #define NRC_CANOCCR 0x24
104 #define NRC_CANCEL 0x26
105 #define NRC_DUPENV 0x30
106 #define NRC_ENVNOTDEF 0x34
107 #define NRC_OSRESNOTAV 0x35
108 #define NRC_MAXAPPS 0x36
109 #define NRC_NOSAPS 0x37
110 #define NRC_NORESOURCES 0x38
111 #define NRC_INVADDRESS 0x39
112 #define NRC_INVDDID 0x3B
113 #define NRC_LOCKFAIL 0x3C
114 #define NRC_OPENERR 0x3f
115 #define NRC_SYSTEM 0x40
116 #define NRC_PENDING 0xff
117 #define NCB_POST void CALLBACK
118 typedef struct _ACTION_HEADER {
119         ULONG transport_id;
120         USHORT action_code;
121         USHORT reserved;
122 } ACTION_HEADER,*PACTION_HEADER;
123 typedef struct _ADAPTER_STATUS {
124         UCHAR adapter_address[6];
125         UCHAR rev_major;
126         UCHAR reserved0;
127         UCHAR adapter_type;
128         UCHAR rev_minor;
129         WORD duration;
130         WORD frmr_recv;
131         WORD frmr_xmit;
132         WORD iframe_recv_err;
133         WORD xmit_aborts;
134         DWORD xmit_success;
135         DWORD recv_success;
136         WORD iframe_xmit_err;
137         WORD recv_buff_unavail;
138         WORD t1_timeouts;
139         WORD ti_timeouts;
140         DWORD reserved1;
141         WORD free_ncbs;
142         WORD max_cfg_ncbs;
143         WORD max_ncbs;
144         WORD xmit_buf_unavail;
145         WORD max_dgram_size;
146         WORD pending_sess;
147         WORD max_cfg_sess;
148         WORD max_sess;
149         WORD max_sess_pkt_size;
150         WORD name_count;
151 } ADAPTER_STATUS,*PADAPTER_STATUS;
152 typedef struct _FIND_NAME_BUFFER {
153         UCHAR length;
154         UCHAR access_control;
155         UCHAR frame_control;
156         UCHAR destination_addr[6];
157         UCHAR source_addr[6];
158         UCHAR routing_info[18];
159 } FIND_NAME_BUFFER,*PFIND_NAME_BUFFER;
160 typedef struct _FIND_NAME_HEADER {
161         WORD node_count;
162         UCHAR reserved;
163         UCHAR unique_group;
164 } FIND_NAME_HEADER,*PFIND_NAME_HEADER;
165 typedef struct _LANA_ENUM {
166         UCHAR length;
167         UCHAR lana[MAX_LANA+1];
168 } LANA_ENUM,*PLANA_ENUM;
169 typedef struct _NAME_BUFFER {
170         UCHAR name[NCBNAMSZ];
171         UCHAR name_num;
172         UCHAR name_flags;
173 } NAME_BUFFER,*PNAME_BUFFER;
174 typedef struct _NCB {
175         UCHAR ncb_command;
176         UCHAR ncb_retcode;
177         UCHAR ncb_lsn;
178         UCHAR ncb_num;
179         PUCHAR ncb_buffer;
180         WORD ncb_length;
181         UCHAR ncb_callname[NCBNAMSZ];
182         UCHAR ncb_name[NCBNAMSZ];
183         UCHAR ncb_rto;
184         UCHAR ncb_sto;
185         void (CALLBACK *ncb_post)(struct _NCB*);
186         UCHAR ncb_lana_num;
187         UCHAR ncb_cmd_cplt;
188         UCHAR ncb_reserve[10];
189         HANDLE ncb_event;
190 } NCB,*PNCB;
191 typedef struct _SESSION_BUFFER {
192         UCHAR lsn;
193         UCHAR state;
194         UCHAR local_name[NCBNAMSZ];
195         UCHAR remote_name[NCBNAMSZ];
196         UCHAR rcvs_outstanding;
197         UCHAR sends_outstanding;
198 } SESSION_BUFFER,*PSESSION_BUFFER;
199 typedef struct _SESSION_HEADER {
200         UCHAR sess_name;
201         UCHAR num_sess;
202         UCHAR rcv_dg_outstanding;
203         UCHAR rcv_any_outstanding;
204 } SESSION_HEADER,*PSESSION_HEADER;
205 UCHAR WINAPI Netbios(PNCB);
206
207 #ifdef __cplusplus
208 }
209 #endif
210
211 #endif