00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
#include "FsRtlP.h"
00042
00043
00044
00045
00046
00047 #define Dbg (0x10000000)
00048
00049
00050
00051
00052
00053
#if DBG
00054
00055 ULONG DaveDebug = 0;
00056
#define DavePrint if (DaveDebug) DbgPrint
00057
00058
#else
00059
00060 #define DavePrint NOTHING
00061
00062
#endif
00063
00064
00065
00066
00067
00068
#undef MODULE_POOL_TAG
00069 #define MODULE_POOL_TAG ('drSF')
00070
00071
#ifdef ALLOC_PRAGMA
00072
#pragma alloc_text(PAGE, FsRtlDissectDbcs)
00073
#pragma alloc_text(PAGE, FsRtlDoesDbcsContainWildCards)
00074
#pragma alloc_text(PAGE, FsRtlIsDbcsInExpression)
00075
#pragma alloc_text(PAGE, FsRtlIsFatDbcsLegal)
00076
#pragma alloc_text(PAGE, FsRtlIsHpfsDbcsLegal)
00077
#endif
00078
00079
00080 BOOLEAN
00081 FsRtlIsFatDbcsLegal (
00082 IN ANSI_STRING DbcsName,
00083 IN BOOLEAN WildCardsPermissible,
00084 IN BOOLEAN PathNamePermissible,
00085 IN BOOLEAN LeadingBackslashPermissible
00086 )
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134 {
00135 BOOLEAN ExtensionPresent =
FALSE;
00136
00137 ULONG
Index;
00138
00139 UCHAR Char;
00140
00141
PAGED_CODE();
00142
00143
00144
00145
00146
00147
if ( DbcsName.Length == 0 ) {
return FALSE; }
00148
00149
00150
00151
00152
00153
00154
if ( WildCardsPermissible &&
00155 ( ( (DbcsName.Length == 1) &&
00156 ((DbcsName.Buffer[0] ==
'.') ||
00157 (DbcsName.Buffer[0] == ANSI_DOS_DOT)) )
00158 ||
00159 ( (DbcsName.Length == 2) &&
00160 ( ((DbcsName.Buffer[0] ==
'.') &&
00161 (DbcsName.Buffer[1] ==
'.')) ||
00162 ((DbcsName.Buffer[0] == ANSI_DOS_DOT) &&
00163 (DbcsName.Buffer[1] == ANSI_DOS_DOT)) ) ) ) ) {
00164
00165
return TRUE;
00166 }
00167
00168
00169
00170
00171
00172
if ( DbcsName.Buffer[0] ==
'\\' ) {
00173
00174
if ( LeadingBackslashPermissible ) {
00175
00176
if ( (DbcsName.Length > 1) ) {
00177
00178 DbcsName.Buffer += 1;
00179 DbcsName.Length -= 1;
00180
00181 }
else {
return TRUE; }
00182
00183 }
else {
return FALSE; }
00184 }
00185
00186
00187
00188
00189
00190
if ( PathNamePermissible ) {
00191
00192 ANSI_STRING FirstName;
00193 ANSI_STRING RemainingName;
00194
00195 RemainingName = DbcsName;
00196
00197
while ( RemainingName.Length != 0 ) {
00198
00199
00200
00201
00202
00203
if ( RemainingName.Buffer[0] ==
'\\' ) {
return FALSE; }
00204
00205
FsRtlDissectDbcs(RemainingName, &FirstName, &RemainingName);
00206
00207
if ( !
FsRtlIsFatDbcsLegal( FirstName,
00208 WildCardsPermissible,
00209
FALSE,
00210
FALSE) ) {
00211
00212
return FALSE;
00213 }
00214 }
00215
00216
00217
00218
00219
00220
return TRUE;
00221 }
00222
00223
00224
00225
00226
00227
if ( WildCardsPermissible &&
FsRtlDoesDbcsContainWildCards(&DbcsName) ) {
00228
00229
for (
Index = 0;
Index < DbcsName.Length;
Index += 1 ) {
00230
00231 Char = DbcsName.Buffer[
Index ];
00232
00233
00234
00235
00236
00237
if (
FsRtlIsLeadDbcsCharacter( Char ) ) {
00238
00239
ASSERT(
Index != (ULONG)(DbcsName.Length - 1) );
00240
Index += 1;
00241
continue;
00242 }
00243
00244
00245
00246
00247
00248
00249
if ( !
FsRtlIsAnsiCharacterLegalFat(Char, WildCardsPermissible) ) {
00250
return FALSE;
00251 }
00252 }
00253
00254
return TRUE;
00255 }
00256
00257
00258
00259
00260
00261
00262
00263
if ( DbcsName.Length > 12 ) {
return FALSE; }
00264
00265
for (
Index = 0;
Index < DbcsName.Length;
Index += 1 ) {
00266
00267 Char = DbcsName.Buffer[
Index ];
00268
00269
00270
00271
00272
00273
if (
FsRtlIsLeadDbcsCharacter( Char ) ) {
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
if ( (!ExtensionPresent && (
Index >= 7)) ||
00287 (
Index == (ULONG)(DbcsName.Length - 1) ) ) {
00288
return FALSE;
00289 }
00290
00291
Index += 1;
00292
00293
continue;
00294 }
00295
00296
00297
00298
00299
00300
00301
if ( !
FsRtlIsAnsiCharacterLegalFat(Char, WildCardsPermissible) ) {
00302
00303
return FALSE;
00304 }
00305
00306
if ( (Char ==
'.') || (Char == ANSI_DOS_DOT) ) {
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
if ( (
Index == 0) ||
00318 ExtensionPresent ||
00319 (DbcsName.Length - (
Index + 1) > 3) ||
00320 (DbcsName.Buffer[
Index - 1] ==
' ') ) {
00321
00322
return FALSE;
00323 }
00324
00325 ExtensionPresent =
TRUE;
00326 }
00327
00328
00329
00330
00331
00332
if ( (
Index >= 8) && !ExtensionPresent ) {
return FALSE; }
00333 }
00334
00335
00336
00337
00338
00339
if ( (Char ==
' ') || (Char ==
'.') || (Char == ANSI_DOS_DOT)) {
return FALSE; }
00340
00341
return TRUE;
00342 }
00343
00344 BOOLEAN
00345 FsRtlIsHpfsDbcsLegal (
00346 IN ANSI_STRING DbcsName,
00347 IN BOOLEAN WildCardsPermissible,
00348 IN BOOLEAN PathNamePermissible,
00349 IN BOOLEAN LeadingBackslashPermissible
00350 )
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395 {
00396 BOOLEAN ExtensionPresent =
FALSE;
00397
00398 ULONG
Index;
00399
00400 UCHAR Char;
00401
00402
PAGED_CODE();
00403
00404
00405
00406
00407
00408
if ( DbcsName.Length == 0 ) {
return FALSE; }
00409
00410
00411
00412
00413
00414
00415
if ( WildCardsPermissible &&
00416 ( ( (DbcsName.Length == 1) &&
00417 ((DbcsName.Buffer[0] ==
'.') ||
00418 (DbcsName.Buffer[0] == ANSI_DOS_DOT)) )
00419 ||
00420 ( (DbcsName.Length == 2) &&
00421 ( ((DbcsName.Buffer[0] ==
'.') &&
00422 (DbcsName.Buffer[1] ==
'.')) ||
00423 ((DbcsName.Buffer[0] == ANSI_DOS_DOT) &&
00424 (DbcsName.Buffer[1] == ANSI_DOS_DOT)) ) ) ) ) {
00425
00426
return TRUE;
00427 }
00428
00429
00430
00431
00432
00433
if ( DbcsName.Buffer[0] ==
'\\' ) {
00434
00435
if ( LeadingBackslashPermissible ) {
00436
00437
if ( (DbcsName.Length > 1) ) {
00438
00439 DbcsName.Buffer += 1;
00440 DbcsName.Length -= 1;
00441
00442 }
else {
return TRUE; }
00443
00444 }
else {
return FALSE; }
00445 }
00446
00447
00448
00449
00450
00451
if ( PathNamePermissible ) {
00452
00453 ANSI_STRING FirstName;
00454 ANSI_STRING RemainingName;
00455
00456 RemainingName = DbcsName;
00457
00458
while ( RemainingName.Length != 0 ) {
00459
00460
00461
00462
00463
00464
if ( RemainingName.Buffer[0] ==
'\\' ) {
return FALSE; }
00465
00466
FsRtlDissectDbcs(RemainingName, &FirstName, &RemainingName);
00467
00468
if ( !
FsRtlIsHpfsDbcsLegal( FirstName,
00469 WildCardsPermissible,
00470
FALSE,
00471
FALSE) ) {
00472
00473
return FALSE;
00474 }
00475 }
00476
00477
00478
00479
00480
00481
return TRUE;
00482 }
00483
00484
00485
00486
00487
00488
00489
if ( DbcsName.Length > 255 ) {
return FALSE; }
00490
00491
for (
Index = 0;
Index < DbcsName.Length;
Index += 1 ) {
00492
00493 Char = DbcsName.Buffer[
Index ];
00494
00495
00496
00497
00498
00499
if (
FsRtlIsLeadDbcsCharacter( Char ) ) {
00500
00501
00502
00503
00504
00505
00506
00507
00508
if (
Index == (ULONG)(DbcsName.Length - 1) ) {
00509
00510
return FALSE;
00511 }
00512
00513
Index += 1;
00514
continue;
00515 }
00516
00517
00518
00519
00520
00521
00522
if ( !
FsRtlIsAnsiCharacterLegalHpfs(Char, WildCardsPermissible) ) {
00523
00524
return FALSE;
00525 }
00526 }
00527
00528
00529
00530
00531
00532
if ( (Char ==
' ') || (Char ==
'.') || (Char == ANSI_DOS_DOT) ) {
00533
00534
return FALSE;
00535 }
00536
00537
return TRUE;
00538 }
00539
00540
00541
VOID
00542 FsRtlDissectDbcs (
00543 IN ANSI_STRING Path,
00544 OUT PANSI_STRING FirstName,
00545 OUT PANSI_STRING RemainingName
00546 )
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603 {
00604 ULONG i = 0;
00605 ULONG PathLength;
00606 ULONG FirstNameStart;
00607
00608
PAGED_CODE();
00609
00610
00611
00612
00613
00614 FirstName->Length = 0;
00615 FirstName->MaximumLength = 0;
00616 FirstName->Buffer =
NULL;
00617
00618 RemainingName->Length = 0;
00619 RemainingName->MaximumLength = 0;
00620 RemainingName->Buffer =
NULL;
00621
00622 PathLength = Path.Length;
00623
00624
00625
00626
00627
00628
if (PathLength == 0) {
00629
00630
return;
00631 }
00632
00633
00634
00635
00636
00637
if ( Path.Buffer[0] ==
'\\' ) {
00638
00639 i = 1;
00640 }
00641
00642
00643
00644
00645
00646
00647
for ( FirstNameStart = i;
00648 (i < PathLength) && (Path.Buffer[i] !=
'\\');
00649 i += 1 ) {
00650
00651
00652
00653
00654
00655
00656
if (
FsRtlIsLeadDbcsCharacter( Path.Buffer[i] ) ) {
00657
00658 i += 1;
00659 }
00660 }
00661
00662
00663
00664
00665
00666
00667 FirstName->Length = (
USHORT)(i - FirstNameStart);
00668 FirstName->MaximumLength = FirstName->Length;
00669 FirstName->Buffer = &Path.Buffer[FirstNameStart];
00670
00671
00672
00673
00674
00675
00676
00677
00678
if (i < PathLength) {
00679
00680 RemainingName->Length = (
USHORT)(PathLength - (i + 1));
00681 RemainingName->MaximumLength = RemainingName->Length;
00682 RemainingName->Buffer = &Path.Buffer[i + 1];
00683 }
00684
00685
00686
00687
00688
00689
return;
00690 }
00691
00692
00693 BOOLEAN
00694 FsRtlDoesDbcsContainWildCards (
00695 IN PANSI_STRING Name
00696 )
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716 {
00717 CLONG i;
00718
00719
PAGED_CODE();
00720
00721
00722
00723
00724
00725
00726
for (i = 0; i <
Name->Length; i += 1) {
00727
00728
00729
00730
00731
00732
if (
FsRtlIsLeadDbcsCharacter(
Name->Buffer[i] )) {
00733
00734 i += 1;
00735
00736
00737
00738
00739
00740 }
else if (
FsRtlIsAnsiCharacterWild(
Name->Buffer[i] )) {
00741
00742
00743
00744
00745
00746
return TRUE;
00747 }
00748 }
00749
00750
00751
00752
00753
00754
return FALSE;
00755 }
00756
00757 #define GetDbcs(BUF,OFFSET,DBCS_CHAR,LENGTH) { \
00758
if (FsRtlIsLeadDbcsCharacter( (BUF)[(OFFSET)] )) { \
00759
*(DBCS_CHAR) = (WCHAR)((BUF)[(OFFSET)] + \
00760
0x100 * (BUF)[(OFFSET) + 1]); \
00761
*(LENGTH) = 2; \
00762
} else { \
00763
*(DBCS_CHAR) = (WCHAR)(BUF)[(OFFSET)]; \
00764
*(LENGTH) = 1; \
00765
} \
00766
}
00767
00768 #define MATCHES_ARRAY_SIZE 16
00769
00770 BOOLEAN
00771 FsRtlIsDbcsInExpression (
00772 IN PANSI_STRING Expression,
00773 IN PANSI_STRING Name
00774 )
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862 {
00863
USHORT NameOffset;
00864
USHORT ExprOffset;
00865
USHORT Length;
00866
00867 ULONG SrcCount;
00868 ULONG DestCount;
00869 ULONG PreviousDestCount;
00870 ULONG MatchesCount;
00871
00872 WCHAR NameChar, ExprChar;
00873
00874
USHORT LocalBuffer[
MATCHES_ARRAY_SIZE * 2];
00875
00876
USHORT *AuxBuffer =
NULL;
00877
USHORT *PreviousMatches;
00878
USHORT *CurrentMatches;
00879
00880
USHORT MaxState;
00881
USHORT CurrentState;
00882
00883 BOOLEAN NameFinished =
FALSE;
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
PAGED_CODE();
00894
00895
DebugTrace(+1,
Dbg,
"FsRtlIsDbcsInExpression\n", 0);
00896
DebugTrace( 0,
Dbg,
" Expression = %Z\n", Expression );
00897
DebugTrace( 0,
Dbg,
" Name = %Z\n",
Name );
00898
00899
ASSERT(
Name->Length != 0 );
00900
ASSERT( Expression->Length != 0 );
00901
00902
00903
00904
00905
00906
if ( (
Name->Length == 0) || (Expression->Length == 0) ) {
00907
00908
return (BOOLEAN)(!(
Name->Length + Expression->Length));
00909 }
00910
00911
00912
00913
00914
00915
if ((Expression->Length == 1) && (Expression->Buffer[0] ==
'*')) {
00916
00917
return TRUE;
00918 }
00919
00920
ASSERT(
FsRtlDoesDbcsContainWildCards( Expression ) );
00921
00922
00923
00924
00925
00926
00927
if (Expression->Buffer[0] ==
'*') {
00928
00929 ANSI_STRING LocalExpression;
00930
00931 LocalExpression = *Expression;
00932
00933 LocalExpression.Buffer += 1;
00934 LocalExpression.Length -= 1;
00935
00936
00937
00938
00939
00940
if ( !
FsRtlDoesDbcsContainWildCards( &LocalExpression ) ) {
00941
00942 ULONG StartingNameOffset;
00943
00944
if (
Name->Length < (
USHORT)(Expression->Length - 1)) {
00945
00946
return FALSE;
00947 }
00948
00949 StartingNameOffset =
Name->Length - LocalExpression.Length;
00950
00951
00952
00953
00954
00955
00956
00957
if (
NlsMbOemCodePageTag) {
00958
00959 ULONG i = 0;
00960
00961
while ( i < StartingNameOffset ) {
00962
00963 i +=
FsRtlIsLeadDbcsCharacter(
Name->Buffer[i] ) ? 2 : 1;
00964 }
00965
00966
if ( i > StartingNameOffset ) {
00967
00968
return FALSE;
00969 }
00970 }
00971
00972
00973
00974
00975
00976
00977
return (BOOLEAN) RtlEqualMemory( LocalExpression.Buffer,
00978
Name->Buffer + StartingNameOffset,
00979 LocalExpression.Length );
00980 }
00981 }
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007
01008
01009
01010
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023
01024
01025
01026
01027
01028
01029
01030
01031
01032 PreviousMatches = &LocalBuffer[0];
01033 CurrentMatches = &LocalBuffer[
MATCHES_ARRAY_SIZE];
01034
01035 PreviousMatches[0] = 0;
01036 MatchesCount = 1;
01037
01038 NameOffset = 0;
01039
01040 MaxState = (
USHORT)(Expression->Length * 2);
01041
01042
while ( !NameFinished ) {
01043
01044
if ( NameOffset <
Name->Length ) {
01045
01046
GetDbcs(
Name->Buffer, NameOffset, &NameChar, &Length );
01047 NameOffset += Length;
01048
01049 }
else {
01050
01051 NameFinished =
TRUE;
01052
01053
01054
01055
01056
01057
01058
if ( PreviousMatches[MatchesCount-1] == MaxState ) {
01059
01060
break;
01061 }
01062 }
01063
01064
01065
01066
01067
01068
01069
01070 SrcCount = 0;
01071 DestCount = 0;
01072 PreviousDestCount = 0;
01073
01074
while ( SrcCount < MatchesCount ) {
01075
01076
01077
01078
01079
01080
01081
01082
01083
01084
01085 ExprOffset = (
USHORT)((PreviousMatches[SrcCount++] + 1) / 2);
01086
01087 Length = 0;
01088
01089
01090
while (
TRUE ) {
01091
01092
if ( ExprOffset == Expression->Length ) {
01093
01094
break;
01095 }
01096
01097
01098
01099
01100
01101
01102 ExprOffset += Length;
01103
01104 CurrentState = (
USHORT)(ExprOffset * 2);
01105
01106
if ( ExprOffset == Expression->Length ) {
01107
01108 CurrentMatches[DestCount++] = MaxState;
01109
break;
01110 }
01111
01112
GetDbcs(Expression->Buffer, ExprOffset, &ExprChar, &Length);
01113
01114
ASSERT( !((ExprChar >=
'a') && (ExprChar <=
'z')) );
01115
01116
01117
01118
01119
01120
01121
01122
01123
if ( (DestCount >=
MATCHES_ARRAY_SIZE - 2) &&
01124 (AuxBuffer ==
NULL) ) {
01125
01126 AuxBuffer =
FsRtlpAllocatePool(
PagedPool,
01127 (Expression->Length+1) *
01128
sizeof(
USHORT)*2*2 );
01129
01130 RtlCopyMemory( AuxBuffer,
01131 CurrentMatches,
01132
MATCHES_ARRAY_SIZE *
sizeof(
USHORT) );
01133
01134 CurrentMatches = AuxBuffer;
01135
01136 RtlCopyMemory( AuxBuffer + (Expression->Length+1)*2,
01137 PreviousMatches,
01138
MATCHES_ARRAY_SIZE *
sizeof(
USHORT) );
01139
01140 PreviousMatches = AuxBuffer + (Expression->Length+1)*2;
01141
01142 }
01143
01144
01145
01146
01147
01148
if (ExprChar ==
'*') {
01149
01150 CurrentMatches[DestCount++] = CurrentState;
01151 CurrentMatches[DestCount++] = CurrentState + 1;
01152
continue;
01153 }
01154
01155
01156
01157
01158
01159
if (ExprChar == ANSI_DOS_STAR) {
01160
01161 BOOLEAN ICanEatADot =
FALSE;
01162
01163
01164
01165
01166
01167
01168
if ( !NameFinished && (NameChar ==
'.') ) {
01169
01170 WCHAR NameChar;
01171
USHORT Offset;
01172
USHORT Length;
01173
01174
for (
Offset = NameOffset;
01175
Offset <
Name->Length;
01176
Offset += Length ) {
01177
01178
GetDbcs(
Name->Buffer,
Offset, &NameChar, &Length );
01179
01180
if (NameChar ==
'.') {
01181
01182 ICanEatADot =
TRUE;
01183
break;
01184 }
01185 }
01186 }
01187
01188
if (NameFinished || (NameChar !=
'.') || ICanEatADot) {
01189
01190 CurrentMatches[DestCount++] = CurrentState;
01191 CurrentMatches[DestCount++] = CurrentState + 1;
01192
continue;
01193
01194 }
else {
01195
01196
01197
01198
01199
01200
01201 CurrentMatches[DestCount++] = CurrentState + 1;
01202
continue;
01203 }
01204 }
01205
01206
01207
01208
01209
01210
01211
01212 CurrentState += (
USHORT)(Length * 2);
01213
01214
01215
01216
01217
01218
01219
01220
01221
if ( ExprChar == ANSI_DOS_QM ) {
01222
01223
if ( NameFinished || (NameChar ==
'.') ) {
01224
01225
continue;
01226 }
01227
01228 CurrentMatches[DestCount++] = CurrentState;
01229
break;
01230 }
01231
01232
01233
01234
01235
01236
01237
if (ExprChar == DOS_DOT) {
01238
01239
if ( NameFinished ) {
01240
01241
continue;
01242 }
01243
01244
if (NameChar ==
'.') {
01245
01246 CurrentMatches[DestCount++] = CurrentState;
01247
break;
01248 }
01249 }
01250
01251
01252
01253
01254
01255
01256
if ( NameFinished ) {
01257
01258
break;
01259 }
01260
01261
01262
01263
01264
01265
if (ExprChar ==
'?') {
01266
01267 CurrentMatches[DestCount++] = CurrentState;
01268
break;
01269 }
01270
01271
01272
01273
01274
01275
if (ExprChar == NameChar) {
01276
01277 CurrentMatches[DestCount++] = CurrentState;
01278
break;
01279 }
01280
01281
01282
01283
01284
01285
01286
break;
01287 }
01288
01289
01290
01291
01292
01293
01294
01295
01296
01297
01298
01299
if ((SrcCount < MatchesCount) &&
01300 (PreviousDestCount < DestCount) ) {
01301
01302
while (PreviousDestCount < DestCount) {
01303
01304
while ( PreviousMatches[SrcCount] <
01305 CurrentMatches[PreviousDestCount] ) {
01306
01307
01308 SrcCount += 1;
01309 }
01310
01311 PreviousDestCount += 1;
01312 }
01313 }
01314 }
01315
01316
01317
01318
01319
01320
01321
if ( DestCount == 0 ) {
01322
01323
01324
if (AuxBuffer !=
NULL) {
ExFreePool( AuxBuffer ); }
01325
01326
return FALSE;
01327 }
01328
01329
01330
01331
01332
01333 {
01334
USHORT *Tmp;
01335
01336 Tmp = PreviousMatches;
01337
01338 PreviousMatches = CurrentMatches;
01339
01340 CurrentMatches = Tmp;
01341 }
01342
01343 MatchesCount = DestCount;
01344 }
01345
01346
01347 CurrentState = PreviousMatches[MatchesCount-1];
01348
01349
if (AuxBuffer !=
NULL) {
ExFreePool( AuxBuffer ); }
01350
01351
01352
return (BOOLEAN)(CurrentState == MaxState);
01353 }
01354