-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsmbtransaction.h
221 lines (207 loc) · 5.91 KB
/
smbtransaction.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#pragma once
#include "smbmacros.h"
#pragma pack(push, 1)
typedef struct _REQ_TRANSACTION {
BYTE WordCount;
WORD TotalParameterCount;
WORD TotalDataCount;
WORD MaxParameterCount;
WORD MaxDataCount;
BYTE MaxSetupCount;
BYTE Reserved;
WORD Flags;
DWORD Timeout;
WORD Reserved2;
WORD ParameterCount;
WORD ParameterOffset;
WORD DataCount;
WORD DataOffset;
BYTE SetupCount;
BYTE Reserved3;
BYTE Buffer[1];
//USHORT Setup[]; // Setup words (# = SetupWordCount)
//USHORT ByteCount; // Count of data bytes
//UCHAR Name[]; // Name of transaction (NULL if Transact2)
//UCHAR Pad[]; // Pad to SHORT or LONG
//UCHAR Parameters[]; // Parameter bytes (# = ParameterCount)
//UCHAR Pad1[]; // Pad to SHORT or LONG
//UCHAR Data[]; // Data bytes (# = DataCount)
}REQ_TRANSACTION, * PREQ_TRANSACTION;
typedef struct _REQ_NT_TRANSACTION {
BYTE WordCount;
BYTE MaxSetupCount;
WORD Flags;
DWORD TotalParameterCount;
DWORD TotalDataCount;
DWORD MaxParameterCount;
DWORD MaxDataCount;
DWORD ParameterCount;
DWORD ParameterOffset;
DWORD DataCount;
DWORD DataOffset;
BYTE SetupCount;
WORD Function;
WORD ByteCount;
BYTE Buffer[1];
//USHORT Setup[]; // Setup words (# = SetupWordCount)
//USHORT ByteCount; // Count of data bytes
//UCHAR Pad1[]; // Pad to LONG
//UCHAR Parameters[]; // Parameter bytes (# = ParameterCount)
//UCHAR Pad2[]; // Pad to LONG
//UCHAR Data[]; // Data bytes (# = DataCount)
}REQ_NT_TRANSACTION, * PREQ_NT_TRANSACTION;
typedef struct _RESP_NT_TRANSACTION_INTERIM {
BYTE WordCount;
WORD ByteCount;
BYTE Buffer[1];
}RESP_NT_TRANSACTION_INTERIM, * PRESP_NT_TRANSACTION_INTERIM;
typedef struct _RESP_NT_TRANSACTION {
BYTE WordCount; // Count of data bytes; value = 18 + SetupCount
BYTE Reserved1;
WORD Reserved2;
DWORD TotalParameterCount;
DWORD TotalDataCount;
DWORD ParameterCount;
DWORD ParameterOffset;
DWORD ParameterDisplacement;
DWORD DataCount;
DWORD DataOffset;
DWORD DataDisplacement;
BYTE SetupCount;
BYTE Buffer[1];
//USHORT Setup[]; // Setup words (# = SetupWordCount)
//USHORT ByteCount; // Count of data bytes
//UCHAR Pad1[]; // Pad to LONG
//UCHAR Parameters[]; // Parameter bytes (# = ParameterCount)
//UCHAR Pad2[]; // Pad to SHORT or LONG
//UCHAR Data[]; // Data bytes (# = DataCount)
}RESP_NT_TRANSACTION, * PRESP_NT_TRANSACTION;
typedef struct _REQ_NT_TRANSACTION_SECONDARY {
BYTE WordCount;
BYTE Reserved1;
WORD Reserved2;
DWORD TotalParameterCount;
DWORD TotalDataCount;
DWORD ParameterCount;
DWORD ParameterOffset;
DWORD ParameterDisplacement;
DWORD DataCount;
DWORD DataOffset;
DWORD DataDisplacement;
BYTE Reserved3;
WORD ByteCount;
BYTE Buffer[1];
//UCHAR Pad1[]; // Pad to LONG
//UCHAR Parameters[]; // Parameter bytes (# = ParameterCount)
//UCHAR Pad2[]; // Pad to LONG
//UCHAR Data[]; // Data bytes (# = DataCount)
}REQ_NT_TRANSACTION_SECONDARY, * PREQ_NT_TRANSACTION_SECONDARY;
/*typedef struct REQ_TRANSACTION2{
BYTE WordCount;
//words:
WORD TotalParameterCount;
WORD TotalDataCount;
WORD MaxParameterCount;
WORD MaxDataCount;
BYTE MaxSetupCount;
BYTE Reserved1;
WORD Flags;
DWORD Timeout;
WORD Reserved2;
WORD ParameterCount;
WORD ParameterOffset;
WORD DataCount;
WORD DataOffset;
BYTE SetupCount;
BYTE Reserved3;
//USHORT Setup[SetupCount];
//smb Data:
BYTE Bytes[1];
}*PREQ_TRANSACTION2;
*/
typedef struct _RESP_TRANSACTION_INTERIM {
BYTE WordCount;
WORD ByteCount;
BYTE Buffer[1];
}RESP_TRANSACTION_INTERIM, * PRESP_TRANSACTION_INTERIM;
typedef struct _RESP_TRANSACTION {
BYTE WordCount;
WORD TotalParameterCount;
WORD TotalDataCount;
WORD Reserved;
WORD ParameterCount;
WORD ParameterOffset;
WORD ParameterDisplacement;
WORD DataCount;
WORD DataOffset;
WORD DataDisplacement;
BYTE SetupCount;
BYTE Reserved2;
BYTE Buffer[1];
}RESP_TRANSACTION, * PRESP_TRANSACTION;
typedef struct _REQ_TRANSACTION_SECONDARY {
BYTE WordCount;
WORD TotalParameterCount;
WORD TotalDataCount;
WORD ParameterCount;
WORD ParameterOffset;
WORD ParameterDisplacement;
WORD DataCount;
WORD DataOffset;
WORD DataDisplacement;
WORD ByteCount;
BYTE Buffer[1];
// UCHAR Pad1[];
// UCHAR Trans_Parameters[ParameterCount];
// UCHAR Pad2[];
// UCHAR Trans_Data[DataCount];
}REQ_TRANSACTION_SECONDARY, * PREQ_TRANSACTION_SECONDARY;
typedef struct _REQ_TRANSACTION2 {
BYTE WordCount;
WORD TotalParameterCount;
WORD TotalDataCount;
WORD MaxParameterCount;
WORD MaxDataCount;
BYTE MaxSetupCount;
BYTE Reserved1;
WORD Flags;
DWORD Timeout;
WORD Reserved2;
WORD ParameterCount;
WORD ParameterOffset;
WORD DataCount;
WORD DataOffset;
BYTE SetupCount;
BYTE Reserved3;
BYTE Buffer[1];
}REQ_TRANSACTION2, * PREQ_TRANSACTION2;
typedef struct _REQ_TRANSACTION2_SECONDARY {
BYTE WordCount;
USHORT TotalParameterCount;
USHORT TotalDataCount;
USHORT ParameterCount;
USHORT ParameterOffset;
USHORT ParameterDisplacement;
USHORT DataCount;
USHORT DataOffset;
USHORT DataDisplacement;
USHORT FID;
//SMB_DATA
USHORT ByteCount;
BYTE Buffer[1];
}REQ_TRANSACTION2_SECONDARY, * PREQ_TRANSACTION2_SECONDARY;
typedef struct _RESP_TRANSACTION2 {
BYTE WordCount;
WORD TotalParameterCount;
WORD TotalDataCount;
WORD Reserved1;
WORD ParameterCount;
WORD ParameterOffset;
WORD ParameterDisplacement;
WORD DataCount;
WORD DataDisplacement;
BYTE SetupCount;
BYTE Reserved2;
BYTE Buffer[1];
}RESP_TRANSACTION2, * PRESP_TRANSACTION2;
#pragma pack(pop)