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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
|
/*++
Copyright (c) 1989 Microsoft Corporation
Module Name:
data.c
Abstract:
Definition of global data and tests for USRV.
Author:
David Treadwell (davidtr) 20-Nov-1989
Chuck Lenzmeier
Revision History:
--*/
#include "usrv.h"
//
// Global variables.
//
ULONG DebugParameter = 0xffffffff;
ULONG StopOnSmbError = 1;
BOOLEAN PromptForNextTest = FALSE;
USHORT RedirBufferSize = BUFFER_SIZE;
CHAR ServerName[1+COMPUTER_NAME_LENGTH+1+1] = DEF_SERVER_NAME;
PSZ Transport = REDIR_ADDRESS_PART2;
UCHAR TestPipeName[] = "\\Pipe\\PingPong.0";
#define ACCESS_CONTROLLER \
(SMB_MAKER)AccessController, NULL, 0xFF
#define ANDX_CHAIN \
MakeAndXChain, VerifyAndXChain
#define CLOSE_FILE \
MakeCloseSmb, VerifyClose, SMB_COM_CLOSE
#define CLOSE_AND_TREE_DISC \
MakeCloseAndTreeDiscSmb, VerifyCloseAndTreeDisc, SMB_COM_CLOSE_AND_TREE_DISC
#define CLOSE_CONTROLLER \
(SMB_MAKER)CloseController, NULL, 0xFF
#define COMPAT_CONTROLLER \
(SMB_MAKER)CompatibilityController, NULL, 0xFF
#define CREATE_DIRECTORY \
MakeCreateDirectorySmb, VerifyCreateDirectory, SMB_COM_CREATE_DIRECTORY
#define CREATE_DIRECTORY2 \
(SMB_MAKER)CreateDirectory2, NULL, TRANS2_CREATE_DIRECTORY
#define CREATE_FILE \
MakeCreateSmb, VerifyCreate, SMB_COM_CREATE
#define CREATE_TEMPORARY \
MakeCreateTemporarySmb, VerifyCreateTemporary, SMB_COM_CREATE_TEMPORARY
#define COPY \
MakeMoveSmb, VerifyMove, SMB_COM_COPY
#define DELETE_DIRECTORY \
MakeDeleteDirectorySmb, VerifyDeleteDirectory, SMB_COM_DELETE_DIRECTORY
#define DELETE_FILE \
MakeDeleteSmb, VerifyDelete, SMB_COM_DELETE
#define ECHO_CONTROLLER \
(SMB_MAKER)EchoController, NULL, 0xFF
#define FCB_CONTROLLER \
(SMB_MAKER)FcbController, NULL, 0xFF
#define FLUSH_CONTROLLER \
(SMB_MAKER)FlushController, NULL, 0xFF
#define NT_IOCTL \
(SMB_MAKER)NtIoctl, NULL, NT_TRANSACT_IOCTL
#define LOCK_CONTROLLER \
(SMB_MAKER)LockController, NULL, 0xFF
#define LOGOFF_ANDX \
MakeLogoffAndXSmb, VerifyLogoffAndX, SMB_COM_LOGOFF_ANDX
#define MOVE \
MakeMoveSmb, VerifyMove, SMB_COM_MOVE
#define NEGOTIATE \
MakeNegotiateSmb, VerifyNegotiate, SMB_COM_NEGOTIATE
#define NET_CONTROLLER \
(SMB_MAKER)NetController, NULL, 0xFF
#define NEW_SIZE_CONTROLLER \
(SMB_MAKER)NewSizeController, NULL
#define OPEN_FILE \
MakeOpenSmb, VerifyOpen, SMB_COM_OPEN
#define OPEN_FILE_ANDX \
MakeOpenAndXSmb, VerifyOpenAndX, SMB_COM_OPEN_ANDX
#define OPEN2 \
(SMB_MAKER)Open2, NULL, TRANS2_OPEN2
#define NT_CREATE_FILE_ANDX \
MakeNtCreateAndXSmb, VerifyNtCreateAndX, SMB_COM_NT_CREATE_ANDX
#define CREATE_WITH_ACL \
(SMB_MAKER)CreateWithAcl, NULL, NT_TRANSACT_CREATE
#define PROCESS_EXIT \
MakeProcessExitSmb, VerifyProcessExit, SMB_COM_PROCESS_EXIT
#define QFILE_CONTROLLER \
(SMB_MAKER)QueryFileInformationController, NULL
#define QPATH_CONTROLLER \
(SMB_MAKER)QueryPathInformationController, NULL
#define QUERY_FS_INFORMATION \
(SMB_MAKER)QueryFSInformation, NULL, 0xFF
#define QUERY_INFORMATION \
MakeQueryInformationSmb, VerifyQueryInformation, SMB_COM_QUERY_INFORMATION
#define QUERY_INFORMATION2 \
MakeQueryInformation2Smb, VerifyQueryInformation2, SMB_COM_QUERY_INFORMATION2
#define QUERY_INFORMATION_DISK \
MakeQueryInformationDiskSmb, VerifyQueryInformationDisk, SMB_COM_QUERY_INFORMATION_DISK
#define QSECURITY_CONTROLLER \
(SMB_MAKER)QuerySecurityController, NULL
#define RCP_CONTROLLER \
(SMB_MAKER)RcpController, NULL, 0xFF
#define RENAME_FILE \
MakeRenameSmb, VerifyRename, SMB_COM_RENAME
#define PIPE_CONTROLLER \
(SMB_MAKER)PipeController, NULL
#define RWC_CONTROLLER \
(SMB_MAKER)RwcController, NULL
#define RWC_OPEN_OUTPUT_FILE \
RwcOpenOutputFile, VerifyOpenAndX, SMB_COM_OPEN_ANDX
#define RWC_TREE_CONNECT \
(SMB_MAKER)RwcTreeConnect, NULL, 0
#define SEARCH_CONTROLLER \
(SMB_MAKER)SearchController, NULL, 0xFF
#define SEEK_CONTROLLER \
(SMB_MAKER)SeekController, NULL
#define SEND_SMB \
MakeSendSmb, VerifySend, 0
#define SESSION_SETUP_ANDX \
MakeSessionSetupAndXSmb, VerifySessionSetupAndX, SMB_COM_SESSION_SETUP_ANDX
#define SET_FS_INFORMATION \
(SMB_MAKER)SetFSInformation, NULL, 0xFF
#define SET_INFORMATION \
MakeSetInformationSmb, VerifySetInformation, SMB_COM_SET_INFORMATION
#define SET_INFORMATION2 \
MakeSetInformation2Smb, VerifySetInformation2, SMB_COM_SET_INFORMATION2
#define SFILE_CONTROLLER \
(SMB_MAKER)SetFileInformationController, NULL
#define SPATH_CONTROLLER \
(SMB_MAKER)SetPathInformationController, NULL
#define SSECURITY_CONTROLLER \
(SMB_MAKER)SetSecurityController, NULL
#define TRANSACTION_CONTROLLER \
(SMB_MAKER)TransactionController, NULL, 0xFF
#define TRANS_FIND_CONTROLLER \
(SMB_MAKER)TransFindController, NULL, 0xFF
#define TREE_CONNECT \
MakeTreeConnectSmb, VerifyTreeConnect, SMB_COM_TREE_CONNECT
#define TREE_CONNECT_ANDX \
MakeTreeConnectAndXSmb, VerifyTreeConnectAndX, SMB_COM_TREE_CONNECT_ANDX
#define TREE_DISCONNECT \
MakeTreeDisconnectSmb, VerifyTreeDisconnect, SMB_COM_TREE_DISCONNECT
#define TYPE_CONTROLLER \
(SMB_MAKER)TypeController, NULL
#define UPDATE_CONTROLLER \
(SMB_MAKER)UpdateController, NULL
#define THREAD_SLEEP \
(SMB_MAKER)ThreadSleep, NULL
#define WRITE_CONTROLLER \
(SMB_MAKER)WriteController, NULL, 0xFF
#define NULL_SMB \
NULL, NULL, 0xFF, 0, { 0, 0, 0 }, NULL
//
// The RedirTests[] array determines the tests that USRV is to perform.
// This array holds the SMBs to send to the server and the order in
// which they are to be sent, as well as information about the redirector
// that is to send the tests. The string listed at the beginning of each
// redirector's list of SMBs is the name with which the redirector is to
// connect to the server. The next field determines whether or not this
// redirector should be started--USE indicates that it is to be started;
// guess what DONTUSE means. This allows tests to be written and kept
// around for later use.
//
// After these fields, there are three columns listed below, with each line
// corresponding to a single SMB to be sent (a single SMB_TEST structure).
// The first determines the SMB to send (see the macros defined above).
// The second gives information about which UID, TID, and FID that SMB
// should be dealing with. For example, you could have the UID for a
// session setup be 0x1. If the SMB succeeds, then all SMBs after it
// that have UID = 0x1 will use the actual UID returned by the server
// in the session setup response. This feature is useful for stressing
// the server with multiple simultaneous sessions, tree connects, and
// open files. Each redirector stores ID information independantly, so,
// for example, a session setup done with UID = 0x1 in the first redirector
// will have no effect on the session setups done with UID = 0x1 in other
// redirectors. The third column is a debugging string.
//
// If the SMB specified in the first column is ANDX_CHAIN, USRV builds
// a chained SMB according to the SMBs defined in AndXChains (below).
// If, for example, "ANDX_CHAIN, 1" were specified, then array element
// 1 of AndXChains would be used in determining the chained SMB to
// build. The UID, TID, and FID information is ignored on the ANDX_CHAIN
// line, but the same values apply in AndXChain.
//
// The last SMB specified to each redirector must be NULL_SMB so that USRV
// knows when to stop.
//
//
// Test Name: Null
// Tests for: Nothing
// Requires:
// Notes: Just a NOP
//
SMB_TEST NullTests[] = {
// SMB EI UID TID FID Debug string
NULL_SMB
};
//
// Test Name: Lots
// Tests for: Simple operation of many Session Setups, Tree Connects,
// Disconnects, Opens, Closes, and Logoffs.
// Requires:
// Notes:
//
SMB_TEST LotsTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup 0",
SESSION_SETUP_ANDX, 0, { 0x1, -1, -1 }, "Session Setup 1",
SESSION_SETUP_ANDX, 0, { 0x2, -1, -1 }, "Session Setup 2",
SESSION_SETUP_ANDX, 0, { 0x3, -1, -1 }, "Session Setup 3",
SESSION_SETUP_ANDX, 6, { 0x3, -1, -1 }, "Session Setup 4",
TREE_CONNECT_ANDX, 0, { 0x0, 0x0, -1 }, "Tree Connect And X 0b",
TREE_CONNECT_ANDX, 0, { 0x1, 0x1, -1 }, "Tree Connect And X 1b",
TREE_CONNECT_ANDX, 0, { 0x1, 0x2, -1 }, "Tree Connect And X 2b",
TREE_CONNECT_ANDX, 0, { 0x1, 0x3, -1 }, "Tree Connect And X 3b",
OPEN_FILE_ANDX, 0, { 0x1, 0x3, 0x0 }, "Open And X 0",
OPEN_FILE_ANDX, 0, { 0x1, 0x3, 0x1 }, "Open And X 1",
OPEN_FILE_ANDX, 0, { 0x0, 0x0, 0x2 }, "Open And X 2",
PROCESS_EXIT, 0, { 0x0, 0x0, 0x2 }, "Process Exit",
CLOSE_FILE, 0, { 0x1, 0x3, 0x0 }, "Close 0",
CLOSE_AND_TREE_DISC, 0, { 0x1, 0x3, 0x1 }, "Close And Tree Disc 1",
//CLOSE_AND_TREE_DISC, 0, { 0x0, 0x0, 0x2 }, "Close And Tree Disc 2",
TREE_DISCONNECT, 0, { 0x1, 0x1, -1 }, "Tree Disconnect 1b",
TREE_DISCONNECT, 0, { 0x1, 0x2, -1 }, "Tree Disconnect 2b",
LOGOFF_ANDX, 0, { 0x0, -1, -1 }, "Logoff 0",
LOGOFF_ANDX, 0, { 0x1, -1, -1 }, "Logoff 1",
LOGOFF_ANDX, 0, { 0x2, -1, -1 }, "Logoff 2",
LOGOFF_ANDX, 0, { 0x3, -1, -1 }, "Logoff 3",
NULL_SMB
};
//
// Test Name: Session
// Tests for: Heavy use of Session Setup And X
// Requires:
// Notes:
//
SMB_TEST SessionTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, 0x0, 0x0 }, "Session Setup 0",
TREE_CONNECT_ANDX, 0, { 0x0, 0x0, 0x0 }, "Tree Connect and X 0",
LOGOFF_ANDX, 0, { 0x0, 0x0, 0x0 }, "Logoff",
SESSION_SETUP_ANDX, 0, { 0x1, 0x0, 0x0 }, "Session Setup 1",
SESSION_SETUP_ANDX, 0, { 0x2, 0x0, 0x0 }, "Session Setup 2",
TREE_CONNECT, 0, { 0x1, 0x0, 0x0 }, "Tree Connect 1",
TREE_CONNECT, 0, { 0x2, 0x0, 0x0 }, "Tree Connect 2",
LOGOFF_ANDX, 0, { 0x1, 0x0, 0x0 }, "Logoff 1",
LOGOFF_ANDX, 0, { 0x2, 0x0, 0x0 }, "Logoff 2",
SESSION_SETUP_ANDX, 0, { 0x0, 0x0, 0x0 }, "Session Setup 3",
SESSION_SETUP_ANDX, 0, { 0x0, 0x0, 0x0 }, "Session Setup 4",
SESSION_SETUP_ANDX, 0, { 0x0, 0x0, 0x0 }, "Session Setup 5",
SESSION_SETUP_ANDX, 0, { 0x0, 0x0, 0x0 }, "Session Setup 6",
SESSION_SETUP_ANDX, 0, { 0x0, 0x0, 0x0 }, "Session Setup 7",
NULL_SMB
};
//
// Test Name: AndX
// Tests for: Command Chaining
// Requires:
// Notes:
//
SMB_TEST AndXTests[] = {
// SMB EI UID TID FID Debug string
ANDX_CHAIN, 0, 0, { -1, -1, -1 }, "The Big Chain 0",
ANDX_CHAIN, 1, 0, { -1, -1, -1 }, "The Big Chain 1",
ANDX_CHAIN, 2, 0, { -1, -1, -1 }, "The Big Chain 2",
OPEN_FILE, 0, { 0x3, 0x3, 0x0 }, "Open",
CLOSE_AND_TREE_DISC, 0, { 0x3, 0x3, 0x0 }, "Close And Tree Disconnect",
LOGOFF_ANDX, 0, { 0x3, 0x0, 0x0 }, "Logoff",
NULL_SMB
};
//
// Test Name: Basic
// Tests for: using OpenX to create a file, rename.
// Requires: Directory nt!subdir
// Notes: leaves file nt!blah
//
SMB_TEST BasicTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x0, -1 }, "Tree Connect",
OPEN_FILE_ANDX, 0, { 0x0, 0x0, 0x7 }, "Open",
CLOSE_FILE, 0, { 0x0, 0x0, 0x7 }, "Close",
RENAME_FILE, 0, { 0x0, 0x0, 0x7 }, "Rename",
TREE_DISCONNECT, 0, { 0x0, 0x0, -1 }, "Tree Disconnect",
LOGOFF_ANDX, 0, { 0x0, -1, -1 }, "Logoff",
NULL_SMB
};
//
// Test Name: TempCreate
// Tests for: Operation of Create Temporary SMB
// Requires: Share nt
// Notes: Leaves file SRVxxxxx in nt!.
//
SMB_TEST TempCreateTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x0, -1 }, "Tree Connect",
CREATE_TEMPORARY, 0, { 0x0, 0x0, 0x0 }, "Create Temporary 1",
CREATE_TEMPORARY, 0, { 0x0, 0x0, 0x1 }, "Create Temporary 2",
CREATE_TEMPORARY, 0, { 0x0, 0x0, 0x2 }, "Create Temporary 3",
CREATE_TEMPORARY, 0, { 0x0, 0x0, 0x3 }, "Create Temporary 4",
CREATE_TEMPORARY, 0, { 0x0, 0x0, 0x4 }, "Create Temporary 5",
NULL_SMB
};
//
// Test Name: Compatibility
// Tests for: Operation of Compatibility mode opens
// Requires: Nothing -- creates and deletes its own files
// Notes: Uses share floppy
//
SMB_TEST CompatibilityTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup 1",
SESSION_SETUP_ANDX, 0, { 0x1, -1, -1 }, "Session Setup 2",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
COMPAT_CONTROLLER, 0, { 0x0, 0x6, -1 }, "Controller",
TREE_DISCONNECT, 0, { 0x0, 0x6, -1 }, "Tree Disconnect",
LOGOFF_ANDX, 0, { 0x0, -1, -1 }, "Logoff 1",
LOGOFF_ANDX, 0, { 0x1, -1, -1 }, "Logoff 2",
NULL_SMB
};
//
// Test Name: FCB
// Tests for: Operation of FCB mode opens
// Requires: Nothing -- creates and deletes its own files
// Notes: Uses share floppy
//
SMB_TEST FCBTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup 1",
SESSION_SETUP_ANDX, 0, { 0x1, -1, -1 }, "Session Setup 2",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
FCB_CONTROLLER, 0, { 0x0, 0x6, -1 }, "Controller",
TREE_DISCONNECT, 0, { 0x0, 0x6, -1 }, "Tree Disconnect",
LOGOFF_ANDX, 0, { 0x0, -1, -1 }, "Logoff 1",
LOGOFF_ANDX, 0, { 0x1, -1, -1 }, "Logoff 2",
NULL_SMB
};
//
// Test Name: Lock
// Tests for: Operation of byte range locking
// Requires: Nothing -- creates and deletes its own files
// Notes: Uses share floppy
//
SMB_TEST LockTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup 1",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
LOCK_CONTROLLER, 0, { 0x0, 0x6, -1 }, "Controller",
TREE_DISCONNECT, 0, { 0x0, 0x6, -1 }, "Tree Disconnect",
LOGOFF_ANDX, 0, { 0x0, -1, -1 }, "Logoff 1",
NULL_SMB
};
//
// Test Name: RwcPrep
// Tests for: Preparation step for Read, Write, Copy, and Update tests
// Requires: Share root or floppy (see argv[1])
// Notes: Issues Tree Connect SMBs. DO NET LOGON FIRST!
// Arguments: argv[1] => if doesn't contain "f", use root, else use floppy.
//
SMB_TEST RwcPrepTests[] = {
// SMB EI UID TID FID Debug string
RWC_TREE_CONNECT, 0, { 0x0, 0x5, -1 }, "Tree Connect",
NULL_SMB
};
//
// Test Name: RwcEnd
// Tests for: Termination step for Read, Write, Copy, and Update tests
// Requires:
// Notes: RwcPrep must be run first
//
SMB_TEST RwcEndTests[] = {
// SMB EI UID TID FID Debug string
TREE_DISCONNECT, 0, { 0x0, 0x5, -1 }, "Tree Disconnect",
NULL_SMB
};
//
// Test Name: Read, Write, Copy, Update, NewSize, Seek
// Tests for: Operation and performance of Read, ReadAndX, Write,
// WriteAndX, WriteAndClose, LockAndRead, WriteAndUnlock,
// and Seek SMBs
// Requires: root!source or floppy!source (see RwcPrep argv[1])
// RwcPrep test must be run first
// Notes: Read simply reads all of source file.
// Write opens source file to get its size, then writes that
// much garbage data to output file dest.
// Copy does real copy from source file to destination file.
// In Write and Copy cases, destination file remains.
// Update tests various methods for doing the sequence {lock,
// read, write, unlock}.
// NewSize sets the size of the source file to the length
// specified in argv[1].
// Seek tests the various modes of the Seek SMB
// Arguments: argv[1] => for Read, Write, and Copy: iterations; default 3
// for Update, first test phase
// for NewSize, new file size; default 0
// argv[2] => if blank, use core SMBs
// if "x", use AndX, writebehind
// if "xt", use AndX, writethrough
// if "r", use raw, writebehind
// if "rt", use raw, writethrough
// if "m", use multiplexed, writebehind
// if "mt", use multiplexed, writethrough
// if "b", use bulk mode
// argv[3] => read buffer size; default is maximum possible
//
SMB_TEST ReadTests[] = {
// SMB EI UID TID FID Debug string
OPEN_FILE_ANDX, 0, { 0x0, 0x5, 0x4 }, "Open Input File",
RWC_CONTROLLER, 0, 0, { 0x0, 0x5, 0x4 }, "Controller",
CLOSE_FILE, 0, { 0x0, 0x5, 0x4 }, "Close Input File",
NULL_SMB
};
SMB_TEST WriteTests[] = {
// SMB EI UID TID FID Debug string
OPEN_FILE_ANDX, 0, { 0x0, 0x5, 0x4 }, "Open Input File",
RWC_OPEN_OUTPUT_FILE, 0, { 0x0, 0x5, 0x5 }, "Open Output File",
RWC_CONTROLLER, 0, 0, { 0x0, 0x5, 0x4 }, "Controller",
CLOSE_FILE, 0, { 0x0, 0x5, 0x4 }, "Close Input File",
NULL_SMB
};
SMB_TEST CopyTests[] = {
// SMB EI UID TID FID Debug string
OPEN_FILE_ANDX, 0, { 0x0, 0x5, 0x4 }, "Open Input File",
RWC_OPEN_OUTPUT_FILE, 0, { 0x0, 0x5, 0x5 }, "Open Output File",
RWC_CONTROLLER, 0, 0, { 0x0, 0x5, 0x4 }, "Controller",
CLOSE_FILE, 0, { 0x0, 0x5, 0x4 }, "Close Input File",
NULL_SMB
};
SMB_TEST UpdateTests[] = {
// SMB EI UID TID FID Debug string
OPEN_FILE_ANDX, 0, { 0x0, 0x5, 0xC }, "Open Input File",
UPDATE_CONTROLLER, 0, 0, { 0x0, 0x5, 0xC }, "Controller",
CLOSE_FILE, 0, { 0x0, 0x5, 0xC }, "Close Input File",
NULL_SMB
};
SMB_TEST NewSizeTests[] = {
// SMB EI UID TID FID Debug string
OPEN_FILE_ANDX, 0, { 0x0, 0x5, 0xC }, "Open Input File",
NEW_SIZE_CONTROLLER, 0, 0, { 0x0, 0x5, 0xC }, "Controller",
CLOSE_FILE, 0, { 0x0, 0x5, 0xC }, "Close Input File",
NULL_SMB
};
SMB_TEST SeekTests[] = {
// SMB EI UID TID FID Debug string
OPEN_FILE_ANDX, 0, { 0x0, 0x5, 0xC }, "Open Input File",
SEEK_CONTROLLER, 0, 0, { 0x0, 0x5, 0xC }, "Controller",
CLOSE_FILE, 0, { 0x0, 0x5, 0xC }, "Close Input File",
NULL_SMB
};
SMB_TEST NtSmbTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
NT_CREATE_FILE_ANDX, 0, { 0x0, 0x6, 0xC }, "Open Input File",
CLOSE_FILE, 0, { 0x0, 0x6, 0xC }, "Close Input File",
NULL_SMB
};
//
// Test Name: Ntioctl
// Tests for: NT ioctl / fsctl
// Requires: Share IPC$, ppsrv.exe is running
//
SMB_TEST NtIoctlTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0xB, -1 }, "Tree Connect",
OPEN_FILE_ANDX, 0, { 0x0, 0xB, 0xE }, "Open Input File",
NT_IOCTL, 0, { 0x0, 0xB, 0xE }, "Open Input File",
CLOSE_FILE, 0, { 0x0, 0xB, 0xE }, "Close Input File",
NULL_SMB
};
//
// Test Name: NtDelete
// Tests for: NT Set information - delete a file
// Requires: Share Root; file subdir\newfile.new
//
SMB_TEST NtDeleteTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x5, -1 }, "Tree Connect",
NT_CREATE_FILE_ANDX, 0, { 0x0, 0x5, 0x7 }, "Open Input File",
SFILE_CONTROLLER, 0x83, 0, { 0x0, 0x5, 0x7 }, "SetFileInformation (0x103)",
CLOSE_FILE, 0, { 0x0, 0x5, 0x7 }, "Close Input File",
NULL_SMB
};
//
// Test Name: Information
// Tests for: Openation of Set and Query Information SMBs
// Requires: Share nt
// Notes: Dump the SMBs to see whether the information was set/queried
//
SMB_TEST InformationTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x0, -1 }, "Tree Connect",
OPEN_FILE_ANDX, 0, { 0x0, 0x0, 0x3 }, "Open And X",
CLOSE_FILE, 0, { 0x0, 0x0, 0x3 }, "Close",
QUERY_INFORMATION, 0, { 0x0, 0x0, 0x3 }, "Query Information",
SET_INFORMATION, 0, { 0x0, 0x0, 0x3 }, "Set Information",
QUERY_INFORMATION, 0, { 0x0, 0x0, 0x3 }, "Query Information",
ANDX_CHAIN, 3, 0, { -1, -1, -1 }, "AndX Chain",
NULL_SMB
};
//
// Test Name: Information2
// Tests for: Openation of Set and Query Information2 SMBs
// Requires: Share nt
// Notes: Dump the SMBs to see whether the information was set/queried
//
SMB_TEST Information2Tests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x0, -1 }, "Tree Connect",
OPEN_FILE_ANDX, 0, { 0x0, 0x0, 0x3 }, "Open",
QUERY_INFORMATION2, 0, { 0x0, 0x0, 0x3 }, "Query Information2",
SET_INFORMATION2, 0, { 0x0, 0x0, 0x3 }, "Set Information2",
QUERY_INFORMATION2, 0, { 0x0, 0x0, 0x3 }, "Query Information2",
NULL_SMB
};
//
// Test Name: dDelete
// Tests for: Delete SMB on share temp
// Requires: Deletable file temp!newfile.new
// Notes: temp!newfile.new is deleted if it exists
//
SMB_TEST dDeleteTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x8, -1 }, "Tree Connect",
DELETE_FILE, 0, { 0x0, 0x8, 0x6 }, "Delete",
NULL_SMB
};
//
// Test Name: dRename
// Tests for: Single file rename on share temp
// Requires: temp!newfile.new preexisting
// Notes: temp!newfile.new ==> temp!blah
//
SMB_TEST dRenameTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x8, -1 }, "Tree Connect",
RENAME_FILE, 0, { 0x0, 0x8, 0x7 }, "Rename",
NULL_SMB
};
//
// Test Name: d2Rename
// Tests for: Multiple file rename on share temp
// Requires: temp!subdir\*.*, temp!blah directory
// Notes: Files are moved from subdir to blah.
//
SMB_TEST d2RenameTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x8, -1 }, "Tree Connect",
RENAME_FILE, 0, { 0x0, 0x8, 0x6 }, "Rename",
NULL_SMB
};
//
// Test Name: f2Rename
// Tests for: Multiple file rename on share floppy
// Requires: floppy!subdir\newfile.*, optional directory floppy!blah
// Notes: floppy!subdir\newfile.* ==> floppy!blah
//
SMB_TEST f2RenameTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
RENAME_FILE, 0, { 0x0, 0x6, 0x6 }, "Rename",
NULL_SMB
};
//
// Test Name: fMove
// Tests for: Single file operation of Rename Extended on share floppy
// Requires: floppy!subdir\newfile.new
// Notes: floppy!subdir\newfile.new ==> floppy!blah
//
SMB_TEST fMoveTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
TREE_CONNECT, 0, { 0x0, 0x7, -1 }, "Tree Connect",
MOVE, 0, { 0x0, 0x6, 0xA }, "Rename Extended",
NULL_SMB
};
//
// Test Name: dMove
// Tests for: Single file operation of Rename Extended
// Requires: temp!newfile.new
// Notes: temp!newfile.new ==> temp!blah
//
SMB_TEST dMoveTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x8, -1 }, "Tree Connect",
TREE_CONNECT, 0, { 0x0, 0x3, -1 }, "Tree Connect",
MOVE, 0, { 0x0, 0x8, 0xA }, "Rename Extended",
NULL_SMB
};
//
// Test Name: fdMove
// Tests for: Moving single file between share floppy and share temp
// Requires: floppy!subdir\newfile.new
// Notes: floppy!subdir\newfile.new ==> temp; uses tree connect after
// specified as Tid2
//
SMB_TEST fdMoveTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x7, -1 }, "Tree Connect",
TREE_CONNECT, 0, { 0x0, 0x8, -1 }, "Tree Connect",
MOVE, 0, { 0x0, 0x7, 0xA }, "Rename Extended",
NULL_SMB
};
//
// Test Name: dDirectories
// Tests for: deleting and creating directories on share temp
// Requires: temp!subdirb NOT to exist
// Notes:
SMB_TEST dDirectoriesTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x8, -1 }, "Tree Connect",
CREATE_DIRECTORY, 0, { 0x0, 0x8, 0x9 }, "Create Directory",
DELETE_DIRECTORY, 0, { 0x0, 0x8, 0x9 }, "Delete Directory",
NULL_SMB
};
//
// Test Name: fDirectories
// Tests for: creating and deleting directories on share floppy
// Requires: floppy!subdirb NOT to exist
// Notes: To invoke: USRV fdir Directory [EA1 EAval1 [EA2 EAval2...]]
// where Directory is the name of the directory to create.
//
SMB_TEST fDirectoriesTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
CREATE_DIRECTORY2, 0, { 0x0, 0x6, 0x9 }, "Create Directory2",
DELETE_DIRECTORY, 0, { 0x0, 0x6, 0x9 }, "Delete Directory",
CREATE_DIRECTORY2, 0, { 0x0, 0x6, 0x9 }, "Create Directory2",
NULL_SMB
};
//
// Test Name: Find
// Tests for: FindFirst, FindNext, FindClose on share floppy
// Requires: floppy!subdir
// Notes: To run:
// USRV find files #times files/time resumefile#
// eg USRV find subdir\*.* 10 25 15
//
SMB_TEST FindTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
SEARCH_CONTROLLER, 0, { 0x0, 0x6, 0x82 }, "Search",
NULL_SMB
};
//
// Test Name: Flush
// Tests for: Flushing buffers
// Requires:
// Notes:
//
SMB_TEST FlushTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup 1",
TREE_CONNECT, 0, { 0x0, 0x5, -1 }, "Tree Connect",
FLUSH_CONTROLLER, 0, { 0x0, 0x5, -1 }, "Flush",
TREE_DISCONNECT, 0, { 0x0, 0x5, -1 }, "Tree Disconnect",
LOGOFF_ANDX, 0, { 0x0, -1, -1 }, "Logoff 1",
NULL_SMB
};
//
// Test Name: CoreSearch
// Tests for: Search SMB
// Requires: floppy!subdir
// Notes: To run:
// USRV coresearch files #times files/time resumefile#
// eg USRV coresearch subdir\*.* 10 25 15
//
SMB_TEST CoreSearchTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
SEARCH_CONTROLLER, 0, { 0x0, 0x6, 0x81 }, "Search",
NULL_SMB
};
//
// Test Name: UFind
// Tests for: FindUnique SMB
// Requires: floppy!subdir
// Notes: To run:
// USRV ufind files #times files/time resumefile#
// eg USRV ufind subdir\*.* 1 1 1
//
SMB_TEST UFindTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
SEARCH_CONTROLLER, 0, { 0x0, 0x6, 0x83 }, "Find Unique",
NULL_SMB
};
//
// Test Name: MSearch
// Tests for: running search multiple times
// Requires: floppy!subdir
// Notes: To run:
// USRV msearch files #times files/time resumefile#
// eg USRV msearch subdir\*.* 2 5 5
//
SMB_TEST MSearchTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
SEARCH_CONTROLLER, 0, { 0x0, 0x6, 0x1 }, "Search 0",
SEARCH_CONTROLLER, 0, { 0x0, 0x6, 0x1 }, "Search 1",
SEARCH_CONTROLLER, 0, { 0x0, 0x6, 0x1 }, "Search 2",
SEARCH_CONTROLLER, 0, { 0x0, 0x6, 0x1 }, "Search 3",
SEARCH_CONTROLLER, 0, { 0x0, 0x6, 0x1 }, "Search 4",
SEARCH_CONTROLLER, 0, { 0x0, 0x6, 0x1 }, "Search 5",
SEARCH_CONTROLLER, 0, { 0x0, 0x6, 0x1 }, "Search 6",
SEARCH_CONTROLLER, 0, { 0x0, 0x6, 0x1 }, "Search 7",
SEARCH_CONTROLLER, 0, { 0x0, 0x6, 0x1 }, "Search 8",
NULL_SMB
};
//
// Test Name: Echo
// Tests for: Operation and performance of Echo SMB
// Requires:
// Arguments: -In => iteration count; default is infinite
// -Rn => timing report interval; default is 10
// -Sn => amount of data to send with Echo SMB; default
// is 32 bytes
// -En => number of times server should echo each SMB;
// default is 1
//
SMB_TEST EchoTests[] = {
ECHO_CONTROLLER, 0, { -1, -1, -1 }, "Controller",
NULL_SMB
};
//
// Test Name: ProcessExit
// Tests for: ProcessExit SMB
// Requires: nothing
// Arguments: none
//
SMB_TEST ProcessExitTests[] = {
PROCESS_EXIT, 0, { 0x0, 0x0, 0x2 }, "Process Exit",
NULL_SMB
};
//
// Test Name: Trans
// Tests for: Basic operation of the Transaction SMB logic
// Requires: (nothing)
// Notes: Connects to share 'root'
// Syntax: trans [-tnnn] [-snnn] [-pnnn] [-dnnn]
// -t specifies number of transactions to perform
// -s specifies setup word count
// -p specifies parameter byte count
// -d specified data byte count
//
SMB_TEST TransTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x5, -1 }, "Tree Connect",
TRANSACTION_CONTROLLER, 0, { 0x0, 0x5, -1 }, "Transaction",
NULL_SMB
};
//
// Test Name: qPath
// Tests for: Query Path Information SMB
// Requires: root!source
// Notes: SubCommand specifies information level (1-4)
// to invoke: USRV qPath Filename
//
SMB_TEST qPathTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x5, -1 }, "Tree Connect",
QPATH_CONTROLLER, 1, 0, { 0x0, 0x5, -1 }, "QueryPathInformation (1)",
QPATH_CONTROLLER, 2, 0, { 0x0, 0x5, -1 }, "QueryPathInformation (2)",
QPATH_CONTROLLER, 3, 0, { 0x0, 0x5, -1 }, "QueryPathInformation (3)",
QPATH_CONTROLLER, 4, 0, { 0x0, 0x5, -1 }, "QueryPathInformation (4)",
NULL_SMB
};
//
// Test Name: sPath
// Tests for: Set Path Information SMB
// Requires: root!source
// Notes: SubCommand specifies information level (1-2)
// to invoke: USRV qPath Filename
//
SMB_TEST sPathTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x5, -1 }, "Tree Connect",
SPATH_CONTROLLER, 1, 0, { 0x0, 0x5, -1 }, "SetPathInformation (1)",
SPATH_CONTROLLER, 2, 0, { 0x0, 0x5, -1 }, "SetPathInformation (2)",
NULL_SMB
};
//
// Test Name: EaPath
// Tests for: Query and Set Path Information SMB EA support
// Requires: floppy!subdirea\noea.cmd
// Notes: to invoke: USRV EaPath Filename [Ea1 EaValue1 [Ea2 EaValue2...]]
// It will query the specified EA names, set new values, then
// query the entire EA list. If a value is specified as '~', then
// no value (value length == 0) is passed for that EA.
//
SMB_TEST EaPathTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
SPATH_CONTROLLER, 2, 0, { 0x0, 0x6, 0xD }, "SetPathInformation (2)",
NULL_SMB
};
//
// Test Name: qFile
// Tests for: Query File Information SMB
// Requires: root!source
// Notes: SubCommand specifies information level (1-4)
//
SMB_TEST qFileTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x5, -1 }, "Tree Connect",
OPEN_FILE_ANDX, 0, { 0x0, 0x5, 0x4 }, "Open File and X",
QFILE_CONTROLLER, 1, 0, { 0x0, 0x5, 0x4 }, "QueryFileInformation (1)",
QFILE_CONTROLLER, 2, 0, { 0x0, 0x5, 0x4 }, "QueryFileInformation (2)",
// QFILE_CONTROLLER, 3, 0, { 0x0, 0x5, 0x4 }, "QueryFileInformation (3)",
// QFILE_CONTROLLER, 4, 0, { 0x0, 0x5, 0x4 }, "QueryFileInformation (4)",
QFILE_CONTROLLER, 0x81, 0, { 0x0, 0x5, 0x4 }, "QueryFileInformation (0x101)",
QFILE_CONTROLLER, 0x82, 0, { 0x0, 0x5, 0x4 }, "QueryFileInformation (0x102)",
QFILE_CONTROLLER, 0x83, 0, { 0x0, 0x5, 0x4 }, "QueryFileInformation (0x103)",
QFILE_CONTROLLER, 0x84, 0, { 0x0, 0x5, 0x4 }, "QueryFileInformation (0x104)",
// QFILE_CONTROLLER, 0x85, 0, { 0x0, 0x5, 0x4 }, "QueryFileInformation (0x105)",
// QFILE_CONTROLLER, 0x86, 0, { 0x0, 0x5, 0x4 }, "QueryFileInformation (0x106)",
QFILE_CONTROLLER, 0x87, 0, { 0x0, 0x5, 0x4 }, "QueryFileInformation (0x107)",
NULL_SMB
};
//
// Test Name: sFile
// Tests for: Set File Information SMB
// Requires: root!source
// Notes: SubCommand specifies information level (1-2)
// SubCommands 0x81 is mapped to 0x101
//
SMB_TEST sFileTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x5, -1 }, "Tree Connect",
OPEN_FILE_ANDX, 0, { 0x0, 0x5, 0xC }, "Open File and X",
// SFILE_CONTROLLER, 1, 0, { 0x0, 0x5, 0xC }, "SetFileInformation (1)",
// SFILE_CONTROLLER, 2, 0, { 0x0, 0x5, 0xC }, "SetFileInformation (2)",
SFILE_CONTROLLER, 0x81, 0, { 0x0, 0x5, 0xC }, "SetFileInformation (0x101)",
CLOSE_FILE, 0, { 0x0, 0x5, 0xC }, "Close file",
NULL_SMB
};
//
// Test Name: EaFile
// Tests for: Query and Set File Information SMB EA support
// Requires: floppy!subdirea\noea.cmd
// Notes: to invoke: USRV EaFile [EaName1 EaValue1 [EaName2 EaValue2...]]
// It will query the specified EA names, set new values, then
// query the entire EA list. If a value is specified as '~', then
// no value (value length == 0) is passed for that EA.
//
SMB_TEST EaFileTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
OPEN_FILE_ANDX, 0, { 0x0, 0x6, 0xD }, "Open File and X",
SFILE_CONTROLLER, 2, 0, { 0x0, 0x6, 0xD }, "SetFileInformation (2)",
NULL_SMB
};
//
// Test Name: Open2
// Tests for: Open2 Transaction2 SMB
// Requires:
// Notes: Creates/overwrites floppy!argv[1]
// to invoke: USRV filename filename [EA1 EAVAL1 [EA1 EAVAL2...]]
//
SMB_TEST Open2Tests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
OPEN2, 0, { 0x0, 0x6, -1 }, "Open File and X",
NULL_SMB
};
//
// Test Name: CreateWithAcl
// Tests for: CreateWithAcl NT Transaction SMB
// Requires:
// Notes: Creates/overwrites floppy!argv[1]
// to invoke: CreateWithAcl filename
//
SMB_TEST CreateWithAclTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
CREATE_WITH_ACL, 0, { 0x0, 0x6, -1 }, "CreateWithAcl",
CLOSE_FILE, 0, { 0x0, 0x6, -1 }, "Close file",
NULL_SMB
};
//
// Test Name: Access
// Tests for: Access checking in the server
// Requires: Nothing -- creates and deletes its own files
// Notes: Uses share 'floppy'
//
SMB_TEST AccessTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x6, -1 }, "Tree Connect",
ACCESS_CONTROLLER, 0, { 0x0, 0x6, -1 }, "Controller",
TREE_DISCONNECT, 0, { 0x0, 0x6, -1 }, "Tree Disconnect",
LOGOFF_ANDX, 0, { 0x0, -1, -1 }, "Logoff",
NULL_SMB
};
//
// Test Name: com1
// Tests for: Open and close a comm device
// Requires:
// Notes: to invoke: com1
//
SMB_TEST Com1Tests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup 1",
TREE_CONNECT, 0, { 0x0, 0x9, -1 }, "Tree Connect",
OPEN_FILE_ANDX, 0, { 0x0, 0x9, 0x4 }, "Open and X",
CLOSE_FILE, 0, { 0x0, 0x9, 0x4 }, "Close",
TREE_DISCONNECT, 0, { 0x0, 0x9, -1 }, "Tree Disconnect",
LOGOFF_ANDX, 0, { 0x0, -1, -1 }, "Logoff 1",
NULL_SMB
};
//
// Test Name: com2
// Tests for: Open and close a comm device
// Requires:
// Notes: to invoke: com2
//
SMB_TEST Com2Tests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup 1",
TREE_CONNECT, 0, { 0x0, 0xA, -1 }, "Tree Connect",
OPEN_FILE_ANDX, 0, { 0x0, 0xA, 0x4 }, "Open and X",
THREAD_SLEEP, 50, 0, { -1, -1, -1 }, "Sleep",
CLOSE_FILE, 0, { 0x0, 0xA, 0x4 }, "Close",
TREE_DISCONNECT, 0, { 0x0, 0xA, -1 }, "Tree Disconnect",
LOGOFF_ANDX, 0, { 0x0, -1, -1 }, "Logoff 1",
NULL_SMB
};
//
// Test Name: SendSmb
// Tests for: Open and close a comm device
// Requires:
// Notes: to invoke: sendsmb
//
SMB_TEST SendSmbTests[] = {
// SMB EI UID TID FID Debug string
SEND_SMB, 0, { -1, -1, -1 }, "Send SMB",
NULL_SMB
};
//
// Network "utilities"
//
//
// Test Name: chmode
// Tests for: Set attributes
// Requires:
// Notes:
//
SMB_TEST chmodeTests[] = {
SET_INFORMATION, 2, { 0x0, 0xF, 0xF }, "Set Information",
NULL_SMB
};
//
// Test Name: cp
// Tests for: Copy SMB
// Requires:
// Notes: cp X:oldname X:newname
//
SMB_TEST cpTests[] = {
COPY, 2, { 0x0, 0xF, 0xF }, "Copy",
NULL_SMB
};
//
// Test Name: Delete
// Tests for: Single file delete
// Requires:
// Notes:
//
SMB_TEST DeleteTests[] = {
DELETE_FILE, 2, { 0x0, 0xF, 0xF }, "Delete",
NULL_SMB
};
//
// Test Name: ls
// Tests for: FindFirst, FindNext, FindClose
// Requires:
// Notes: To run:
// ls X:filespec
//
SMB_TEST lsTests[] = {
SEARCH_CONTROLLER, 2, { 0x0, 0xF, 0x82 }, "Search",
NULL_SMB
};
//
// Test Name: mkdir
// Tests for: creating a directory
// Requires: an existing tree connect
// Notes: To invoke: mkdir dirname [EA1 val1 [EA2 val2...]]
// where Directory is the name of the directory to create.
//
SMB_TEST mkdirTests[] = {
CREATE_DIRECTORY2, 2, { 0x0, 0xF, 0xF }, "Create Directory2",
NULL_SMB
};
//
// Test Name: mkfile
// Tests for: creating a file
// Requires: an existing tree connect
// Notes: To invoke: mkfile dirname [EA1 val1 [EA2 val2...]]
// where Directory is the name of the directory to create.
//
SMB_TEST mkfileTests[] = {
OPEN2, 2, { 0x0, 0xF, 0xF }, "Open File2",
CLOSE_FILE, 2, { 0x0, 0xF, 0xF }, "Close File2",
NULL_SMB
};
//
// Test Name: mv
// Tests for: Move SMB
// Requires:
// Notes: mv X:oldname X:newname
//
SMB_TEST mvTests[] = {
MOVE, 2, { 0x0, 0xF, 0xF }, "Move",
NULL_SMB
};
//
// Test Name: Negotiate
// Tests for: negotiate SMB with specifiable dialect
// Requires:
// Notes: negotiate -lN where N is the dialect to negotiate
//
SMB_TEST NegotiateTests[] = {
NEGOTIATE, 2, { 0xF, 0xF, 0xF }, "Negotiate",
NULL_SMB
};
//
// Test Name: Net
// Tests for: various server control functions
// Requires:
// Notes: net start server, net stop server
//
SMB_TEST NetTests[] = {
NET_CONTROLLER, 2, { 0x0, 0xF, 0xF }, "Net",
NULL_SMB
};
//
// Test Name: qdisk
// Tests for: Query Information Disk SMB EA support
// Requires:
// Notes: to invoke: qdisk X:
//
SMB_TEST qdiskTests[] = {
QUERY_INFORMATION_DISK, 2, { 0x0, 0xF, 0xF }, "QueryInformationDisk",
NULL_SMB
};
//
// Test Name: qea
// Tests for: Query Path Information SMB EA support
// Requires:
// Notes: to invoke: qea Filename [Ea1 EaValue1 [Ea2 EaValue2...]]
//
SMB_TEST qeaTests[] = {
QPATH_CONTROLLER, 4, 2, { 0x0, 0xF, 0xF }, "QueryPathInformation",
NULL_SMB
};
//
// Test Name: qfs
// Tests for: Query FS Information SMB
// Requires:
// Notes: to invoke: qfs X: infolevel
// 1 = size
// 2 = label
// 101 = Nt label
// 102 = Nt volume info
// 103 = Nt size
// 104 = Nt device info
// 105 = Nt attributes
//
SMB_TEST qfsTests[] = {
QUERY_FS_INFORMATION, 2, { 0x0, 0xF, 0xF }, "QueryFSInformation",
NULL_SMB
};
//
// Test Name: rcp
// Tests for: copying a file to/from a remote server
// Requires:
// Notes: rcp SourceFile DestFile
// Local files have the format \X:\filename
// Remote files have the format X:\filename
//
SMB_TEST rcpTests[] = {
RCP_CONTROLLER, 2, { 0x0, 0xF, 0xF }, "rcp",
NULL_SMB
};
//
// Test Name: Rename
// Tests for: Rename SMB
// Requires:
// Notes: rename X:oldname X:newname
//
SMB_TEST RenameTests[] = {
RENAME_FILE, 2, { 0x0, 0xF, 0xF }, "Rename",
NULL_SMB
};
//
// Test Name: rmdir
// Tests for: deleting a directory
// Requires: an existing tree connect
// Notes: To invoke: rmdir dirname
// where Directory is the name of the directory to delete.
//
SMB_TEST rmdirTests[] = {
DELETE_DIRECTORY, 2, { 0x0, 0xF, 0xF }, "Delete Directory",
NULL_SMB
};
//
// Test Name: type
// Tests for: Reading an entire file
// Requires: a file
// Notes: to invoke: type X:filename
//
SMB_TEST typeTests[] = {
TYPE_CONTROLLER, 2, 2, { 0x0, 0xF, 0xF }, "print out file",
NULL_SMB
};
//
// Test Name: sea
// Tests for: Set Path Information SMB EA support
// Requires:
// Notes: to invoke: sea Filename [Ea1 EaValue1 [Ea2 EaValue2...]]
//
SMB_TEST seaTests[] = {
SPATH_CONTROLLER, 2, 2, { 0x0, 0xF, 0xF }, "SetPathInformation",
NULL_SMB
};
//
// Test Name: sfs
// Tests for: Set FS Information SMB
// Requires:
// Notes: to invoke: sfs X: volumename
//
SMB_TEST sfsTests[] = {
SET_FS_INFORMATION, 2, { 0x0, 0xF, 0xF }, "SetFSInformation",
NULL_SMB
};
//
// Test Name: t2f
// Tests for: FindFirst2, FindNext2, FindClose2
// Requires:
// Notes: To run:
// t2f files
// eg t2f subdir\*.*
//
SMB_TEST t2fTests[] = {
TRANS_FIND_CONTROLLER, 2, { 0x0, 0xF, -1 }, "TransFind",
NULL_SMB
};
//
// Test Name: PipePrep
// Tests for: Setup to run named pipe tests
// Requires: pipesrv application is running
// Notes: To run:
// pipeprep
//
SMB_TEST pipePrepTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT_ANDX, 0, { 0x0, 0xB, -1 }, "Tree Connect And X IPC$",
OPEN_FILE_ANDX, 0, { 0x0, 0xB, 0xE }, "Open And X 0",
NULL_SMB
};
//
// Test Name: PipeSetup
// Tests for: Setup to run named pipe tests
// Requires:
// Notes: To run:
// pipesetup
//
SMB_TEST pipeSetupTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT_ANDX, 0, { 0x0, 0xB, -1 }, "Tree Connect And X IPC$",
NULL_SMB
};
//
// Test Name: PipeEnd
// Tests for: Shutdown and end of pipe tests
// Requires: Pipeprep was previously run
// Notes: To run:
// pipeend
//
SMB_TEST pipeEndTests[] = {
// SMB EI UID TID FID Debug string
CLOSE_FILE, 0, { 0x0, 0xB, 0xE }, "Close",
TREE_DISCONNECT, 0, { 0x0, 0xB, -1 }, "Tree Disconnect",
LOGOFF_ANDX, 0, { 0x0, -1, -1 }, "Logoff",
NULL_SMB
};
//
// Test Name: Pipe
// Tests for: Pipe I/O and other pipe functions
// Requires: Pipeprep or pipesetup (for call named pipe) was previously run
// Notes: To run:
// pipetest [cXX] [pXX] [rXX] [rxXX] [rrXX] [wXX] [wxXX]
// [wrXX] [qh] [qiX] [sXX] [t] [z]
//
// The subtests of pipetest are:
// cXX - Call named pipe. (transact XX bytes)
// pXX - Peek XX bytes
// rXX - Read XX bytes
// rxXX - ReadAndX XX bytes
// rrXX - ReadRaw XX bytes
// wXX - Write XX bytes
// wrXX - WriteAndX XX bytes
// wz - Raw write (transaction) 0 bytes
// qh - Query pipe handle state
// qiX - Query pipe information at level X
// sXX - Set pipe handle state to XX
// t - Transact named pipe
// z - Wait for named pipe
//
// The write data for all write SMBs including transact
// comes from the input data from the previous read. Write
// raw data comes from the raw buffer which is filled by
// performing a read raw on the pipe.
//
SMB_TEST pipeTests[] = {
// SMB EI UID TID FID Debug string
PIPE_CONTROLLER, 0, 0, { 0x0, 0xB, 0xE }, "Pipe Controller",
NULL_SMB
};
//
// Test Name: FunkyClose
// Tests for: Test closing of file while a blocked write is in progress
// Requires: pipesrv application is running
// Notes: To run: funkyclose
//
//
SMB_TEST FunkyCloseTests[] = {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT_ANDX, 0, { 0x0, 0xB, -1 }, "Tree Connect And X IPC$",
OPEN_FILE_ANDX, 0, { 0x0, 0xB, 0xE }, "Open And X",
WRITE_CONTROLLER, 0, { 0x0, 0xB, 0xE }, "Write raw",
CLOSE_CONTROLLER, 0, { 0x0, 0xB, 0xE }, "Close controller",
NULL_SMB
};
//
// Test Name: qsecurity
// Tests for: NT Query Security SMB
// Requires: root!source
//
SMB_TEST qsecurityTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x5, -1 }, "Tree Connect",
OPEN_FILE_ANDX, 0, { 0x0, 0x5, 0x4 }, "Open File and X",
QSECURITY_CONTROLLER, 6,0, { 0x0, 0x5, 0x4 }, "QuerySecurity",
CLOSE_FILE, 0, { 0x0, 0x5, 0x4 }, "Close file",
NULL_SMB
};
//
// Test Name: ssecurity
// Tests for: Set File Information SMB
// Requires: root!source
//
SMB_TEST ssecurityTests[] = {
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT, 0, { 0x0, 0x5, -1 }, "Tree Connect",
OPEN_FILE_ANDX, 0, { 0x0, 0x5, 0xC }, "Open File and X",
SSECURITY_CONTROLLER, 3,0, { 0x0, 0x5, 0xC }, "SetSecurity",
CLOSE_FILE, 0, { 0x0, 0x5, 0xC }, "Close file",
NULL_SMB
};
//
// Build the redir test array using above test descriptions.
//
REDIR_TEST RedirTests[] = {
"Null", NullTests,
"Lots", LotsTests,
"Session", SessionTests,
"AndX", AndXTests,
"Basic", BasicTests,
"TempCreate", TempCreateTests,
"Compatibility", CompatibilityTests,
"FCB", FCBTests,
"Lock", LockTests,
"RwcPrep", RwcPrepTests,
"RwcEnd", RwcEndTests,
"Read", ReadTests,
"Write", WriteTests,
"Copy", CopyTests,
"Update", UpdateTests,
"NewSize", NewSizeTests,
"Seek", SeekTests,
"Information", InformationTests,
"Information2", Information2Tests,
"dDelete", dDeleteTests,
"dRename", dRenameTests,
"d2Rename", d2RenameTests,
"f2Rename", f2RenameTests,
"fMove", fMoveTests,
"dMove", dMoveTests,
"fdMove", fdMoveTests,
"dDirectories", dDirectoriesTests,
"fDirectories", fDirectoriesTests,
"Find", FindTests,
"Flush", FlushTests,
"CoreSearch", CoreSearchTests,
"UFind", UFindTests,
"MSearch", MSearchTests,
"Echo", EchoTests,
"Trans", TransTests,
"qPath", qPathTests,
"sPath", sPathTests,
"EaPath", EaPathTests,
"qFile", qFileTests,
"sFile", sFileTests,
"EaFile", EaFileTests,
"Open2", Open2Tests,
"Access", AccessTests,
"Com1", Com1Tests,
"Com2", Com2Tests,
"SendSmb", SendSmbTests,
"PipePrep", pipePrepTests,
"PipeSetup", pipeSetupTests,
"PipeEnd", pipeEndTests,
"PipeTest", pipeTests,
"ProcessExit", ProcessExitTests,
"FunkyClose", FunkyCloseTests,
"NtSmb", NtSmbTests,
"NtIoctl", NtIoctlTests,
"NtDelete", NtDeleteTests,
"CreateWithAcl", CreateWithAclTests,
"QSecurity", qsecurityTests,
"SSecurity", ssecurityTests,
//
// Network "utilities"
//
"chmode", chmodeTests,
"cp", cpTests,
"Delete", DeleteTests,
"ls", lsTests,
"mkdir", mkdirTests,
"mkfile", mkfileTests,
"mv", mvTests,
"qdisk", qdiskTests,
"qea", qeaTests,
"qfs", qfsTests,
"negotiate", NegotiateTests,
"Net", NetTests,
"rcp", rcpTests,
"Rename", RenameTests,
"rmdir", rmdirTests,
"type", typeTests,
"sea", seaTests,
"sfs", sfsTests,
"t2f", t2fTests,
};
//
// We must somewhere define the number of redirectors in the RedirTests
// array--it might as well be a global defined here than a macro so that
// it is near the actual test definitions.
//
ULONG NumberOfRedirs = sizeof(RedirTests) / sizeof(REDIR_TEST);
//
// The AndXChains array defines chains of SMBs to be built. It is really
// a library of chains that may be chosen in the RedirTests array. The
// meanings of the ID fields are the same as if the fields had been specified
// directly in the RedirTests array, so if different redirectors call the
// same chain, there will be no interference of IDs (but be careful that the
// IDs are meaningful within the context of each redirector).
//
SMB_TEST AndXChains[][TESTS_PER_CHAIN] = { {
// SMB EI UID TID FID Debug string
SESSION_SETUP_ANDX, 0, { 0x0, -1, -1 }, "Session Setup",
TREE_CONNECT_ANDX, 0, { 0x0, 0x3, -1 }, "Tree Connect and X",
OPEN_FILE_ANDX, 0, { 0x0, 0x3, 0x3 }, "Open",
NULL_SMB
}, {
LOGOFF_ANDX, 0, { 0x0, 0x0, 0x0 }, "Logoff",
SESSION_SETUP_ANDX, 0, { 0x3, 0x0, 0x0 }, "Session Setup",
TREE_CONNECT_ANDX, 0, { 0x3, 0x3, 0x0 }, "Tree connect and X",
OPEN_FILE, 0, { 0x3, 0x3, 0x1 }, "Open",
NULL_SMB
}, {
TREE_CONNECT_ANDX, 0, { 0x3, 0x0, 0x0 }, "Tree Connect and X",
OPEN_FILE_ANDX, 0, { 0x3, 0x0, 0x2 }, "Open",
NULL_SMB
}, {
SESSION_SETUP_ANDX, 0, { 0x1, -1, -1 }, "Session Setup",
TREE_CONNECT_ANDX, 0, { 0x1, 0x3, -1 }, "Tree Connect And X",
QUERY_INFORMATION, 0, { 0x1, 0x3, 0x0 }, "Query Information",
NULL_SMB
}
};
//
// The SessionSetupStrings array defines information to be used when doing
// session setups. The string used in any particular session setup is
// determined by the UID specified in RedirTests or AndXChains--if UID = 1
// is chosen, then element 1 of this array is used.
//
STRING SessionSetupStrings[] = {
/*00*/ 17, 17, "chuckPass\0chuckl",
/*01*/ 18, 18, "davidPass\0davidtr",
/*02*/ 16, 16, "helenPass\0helenc",
/*03*/ 13, 13, "louPass\0loup"
};
//
// The TreeConnectStrings array defines information to be used when doing
// tree connects. The string used in any particular tree connect is
// determined by the TID specified in RedirTests or AndXChains--if TID = 1
// is chosen, then element 1 of the array is used.
//
// *** Be sure to check rdwrt.c before changing this table!
// *** Some tests depend on 6 and 7 both being 'floppy'
STRING TreeConnectStrings[] = {
/*00*/ 32, 32, "\004\\\\ntserver\\nt\0\004password\0\004A:\0\0\0",
/*01*/ 33, 33, "\004\\\\ntserver\\src\0\004password\0\004A:\0\0\0",
/*02*/ 33, 33, "\004\\\\ntserver\\srv\0\004password\0\004A:\0\0\0",
/*03*/ 33, 33, "\004\\\\ntserver\\inc\0\004password\0\004?????",
/*04*/ 37, 37, "\004\\\\ntserver\\illegal\0\004password\0\004A:\0\0\0",
/*05*/ 34, 34, "\004\\\\DBEAVER2\\ROOT\0\004password\0\004A:\0\0\0",
/*06*/ 34, 34, "\004\\\\ntserver\\floppy\0\004password\0\004A:\0\0\0",
/*07*/ 34, 34, "\004\\\\ntserver\\floppy\0\004password\0\004A:\0\0\0",
/*08*/ 32, 32, "\004\\\\ntserver\\temp\0\004password\0\004A:\0\0\0",
/*09*/ 36, 36, "\004\\\\ntserver\\comq1\0\004password\0\004COMM\0\0\0",
/*0A*/ 36, 36, "\004\\\\ntserver\\comq2\0\004password\0\004COMM\0\0\0",
/*0B*/ 34, 34, "\004\\\\ntserver\\IPC$\0\004password\0\004IPC\0\0\0",
};
// DO NOT USE TC NUMBER 0xF! THIS IS THE 'NULL' TC NUMBER.
//
// The FileDefs array contains information about files to open, create,
// or delete. Several SMBs use this array, such as OPEN_FILE, OPEN_FILE_ANDX,
// CREATE_FILE, DELETE_FILE, etc.
//
// The first four elements of each file definition are the DesiredAccess,
// SearchAttributes, FileAttributes, and OpenFunction, respectively, that
// will be put into the request SMB. Not all SMBs use every one of these
// fields.
//
// *** Note that the length fields of the file name INCLUDE the null
// terminator!
//
// *** Be sure to check rdwrt.c before changing this table! The file
// "dest" must immediately follow the file "source".
//
FILE_DEF FileDefs[] = {
/*00*/ 0x10, 0, 0, 0x01, { 39, 39, "\004\\\\.\\.\\geewhiz\\..\\smb.h....\\\\\\\\nope\\.." }, 0,
/*01*/ 0x10, 0, 0, 0x01, { 27, 27, "\004geewhiz\\.\\..\\.\\io.h. . . " }, 0,
/*02*/ 0x10, 0, 0, 0x01, { 33, 33, "\004private\\src\\ntos\\srv\\smbadmin.c" }, 0,
/*03*/ 0x12, 0, 0, 0x12, { 13, 13, "\004newfile.new" }, 0,
/*04*/ 0x40, 0, 0, 0x01, { 8, 8, "\004source" }, 0,
/*05*/ 0x12, 0, 0, 0x12, { 6, 6, "\004dest" }, 0,
/*06*/ 0x12, 0, 0, 0x12, { 18, 18, "\004subdir\\newfile.*" }, 0,
/*07*/ 0x12, 0, 0, 0x12, { 20, 20, "\004subdir\\newfile.new" }, 0,
/*08*/ 0x12, 0, 0, 0x12, { 9, 9, "\004subdir" }, 0,
/*09*/ 0x12, 0, 0, 0x12, { 9, 9, "\004subdirB" }, 0,
/*0a*/ 0x10, 0, 0, 0x12, { 20, 20, "\004subdir\\newfile.new" }, 0,
/*0b*/ 0x12, 0, 0, 0x12, { 13, 13, "\004subdir\\dest" }, 0,
/*0c*/ 0x42, 0, 0, 0x01, { 8, 8, "\004source" }, 0,
/*0d*/ 0x12, 0, 0, 0x01, { 19, 19, "\004subdirea\\noea.cmd" }, 0,
/*0e*/ 0x42, 0, 0, 0x01, { 18, 18, "\004\\Pipe\\PingPong.0" }, 0,
/*0f*/ 0x00, 0, 0, 0x00, { 1, 1, "" }, 0
};
// DO NOT USE FILE NUMBER 0xF! THIS IS THE 'NULL' FILE NUMBER.
//
// Error codes and corresponding strings.
//
#define SMB_ERR_SUCCESS (UCHAR)0x00
//
// DOS Error Class:
//
// "SMB_ERR_CLASS_DOS", 0x01
ERROR_VALUE ClassDos[] = {
"SMB_ERR_BAD_FUNCTION", 1, // Invalid function
"SMB_ERR_BAD_FILE", 2, // File not found
"SMB_ERR_BAD_PATH", 3, // Invalid directory
"SMB_ERR_NO_FIDS", 4, // Too many open files
"SMB_ERR_ACCESS_DENIED", 5, // Access not allowed for req. func.
"SMB_ERR_BAD_FID", 6, // Invalid file handle
"SMB_ERR_BAD_MCB", 7, // Memory control blocks destroyed
"SMB_ERR_INSUFFICIENT_MEMORY", 8, // For the desired function
"SMB_ERR_BAD_MEMORY", 9, // Invalid memory block address
"SMB_ERR_BAD_ENVIRONMENT", 10, // Invalid environment
"SMB_ERR_BAD_FORMAT", 11, // Invalid format
"SMB_ERR_BAD_ACCESS", 12, // Invalid open mode
"SMB_ERR_BAD_DATA", 13, // Invalid data (only from IOCTL)
"SMB_ERR_RESERVED", 14,
"SMB_ERR_BAD_DRIVE", 15, // Invalid drive specified
"SMB_ERR_CURRENT_DIRECTORY", 16, // Attempted to remove currect directory
"SMB_ERR_DIFFERENT_DEVICE", 17, // Not the same device
"SMB_ERR_NO_FILES", 18, // File search can't find more files
"SMB_ERR_BAD_SHARE", 32, // An open conflicts with FIDs on file
"SMB_ERR_LOCK", 33, // Conflict with existing lock
"SMB_ERR_FILE_EXISTS", 80, // Tried to overwrite existing file
"SMB_ERR_BAD_PIPE", 230, // Invalie pipe
"SMB_ERR_PIPE_BUSY", 231, // All instances of the pipe are busy
"SMB_ERR_PIPE_CLOSING", 232, // Pipe close in progress
"SMB_ERR_PIPE_NOT_CONNECTED", 233, // No process on other end of pipe
"SMB_ERR_MORE_DATA", 234, // There is more data to return
"", 0
};
//
// SERVER Error Class:
//
// "SMB_ERR_CLASS_SERVER" 0x02
ERROR_VALUE ClassServer[] = {
"SMB_ERR_ERROR", 1, // Non-specific error code
"SMB_ERR_BAD_PASSWORD", 2, // Bad name/password pair
"SMB_ERR_BAD_TYPE", 3, // Reserved
"SMB_ERR_ACCESS", 4, // Requester lacks necessary access
"SMB_ERR_BAD_TID", 5, // Invalid TID
"SMB_ERR_BAD_NET_NAME", 6, // Invalid network name in tree connect
"SMB_ERR_BAD_DEVICE", 7, // Invalid device request
"SMB_ERR_QUEUE_FULL", 49, // Print queue full--returned print file
"SMB_ERR_QUEUE_TOO_BIG", 50, // Print queue full--no space
"SMB_ERR_QUEUE_EOF", 51, // EOF on print queue dump
"SMB_ERR_BAD_PRINT_FID", 52, // Invalid print file FID
"SMB_ERR_BAD_SMB_COMMAND", 64, // SMB command not recognized
"SMB_ERR_SERVER_ERROR", 65, // Internal server error
"SMB_ERR_FILE_SPECS", 67, // FID and pathname were incompatible
"SMB_ERR_RESERVED2", 68,
"SMB_ERR_BAD_PERMITS", 69, // Access permissions invalid
"SMB_ERR_RESERVED3", 70,
"SMB_ERR_BAD_ATTRIBUTE_MODE", 71, // Invalid attribute mode specified
"SMB_ERR_SERVER_PAUSED", 81, // Server is paused
"SMB_ERR_MESSAGE_OFF", 82, // Server not receiving messages
"SMB_ERR_NO_ROOM", 83, // No room for buffer message
"SMB_ERR_TOO_MANY_NAMES", 87, // Too many remote user names
"SMB_ERR_TIMEOUT", 88, // Operation was timed out
"SMB_ERR_NO_RESOURCE", 89, // No resources available for request
"SMB_ERR_TOO_MANY_UIDS", 90, // Too many UIDs active in session
"SMB_ERR_BAD_UID", 91, // UID not known as a valid UID
"SMB_ERR_USE_MPX", 250, // Can't support Raw; use MPX
"SMB_ERR_USE_STANDARD", 251, // Can't support Raw, use standard r/w
"SMB_ERR_CONTINUE_MPX", 252, // Reserved
"SMB_ERR_RESERVED4", 253,
"SMB_ERR_RESERVED5", 254,
"SMB_ERR_NO_SUPPORT", 0xFFFF, // Function not supported
"", 0
};
//
// HARDWARE Error Class:
//
// "SMB_ERR_CLASS_HARDWARE" 0x03
ERROR_VALUE ClassHardware[] = {
"SMB_ERR_NO_WRITE", 19, // Write attempted to write-prot. disk
"SMB_ERR_BAD_UNIT", 20, // Unknown unit
"SMB_ERR_DRIVE_NOT_READY", 21, // Disk drive not ready
"SMB_ERR_BAD_COMMAND", 22, // Unknown command
"SMB_ERR_DATA", 23, // Data error (CRC)
"SMB_ERR_BAD_REQUEST", 24, // Bad request structure length
"SMB_ERR_SEEK", 25, // Seek error
"SMB_ERR_BAD_MEDIA", 26, // Unknown media type
"SMB_ERR_BAD_SECTOR", 27, // Sector not found
"SMB_ERR_NO_PAPER", 28, // Printer out of paper
"SMB_ERR_WRITE_FAULT", 29, // Write fault
"SMB_ERR_READ_FAULT", 30, // Read fault
"SMB_ERR_GENERAL", 31, // General failure
"SMB_ERR_BAD_SHARE", 32, // Open conflicts with existing open
"SMB_ERR_LOCK_CONFLICT", 33, // Lock conflicts with existing lock
"SMB_ERR_WRONG_DISK", 34, // Wrong disk was found in a drive
"SMB_ERR_FCB_UNAVAILABLE", 35, // No FCBs available to process request
"SMB_ERR_SHARE_BUFFER_EXCEEDED", 36,
"", 0
};
PERROR_VALUE Errors[] = {
NULL,
ClassDos,
ClassServer,
ClassHardware
};
UCHAR DefaultDialect = 0;
BOOLEAN DefaultNegotiate = TRUE;
BOOLEAN NoUsrvInit = FALSE;
|