https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a2f97620203a0a7bb608565943884d719cbfc5ef

commit a2f97620203a0a7bb608565943884d719cbfc5ef
Author:     Pierre Schweitzer <[email protected]>
AuthorDate: Wed Aug 29 08:30:18 2018 +0200
Commit:     Pierre Schweitzer <[email protected]>
CommitDate: Wed Aug 29 08:34:30 2018 +0200

    [SDK] Fix the implementation of the FsRtlIsAnsiCharacter* macros.
    
    These macros should be implemented using the FsRtlTestAnsiCharacter() macro
    that performs extended tests, especially for buffer overruns.
    This fixes FsRtlIsAnsiCharacterWild(), FsRtlIsAnsiCharacterLegalFat(),
    FsRtlIsAnsiCharacterLegalHpfs(), FsRtlIsAnsiCharacterLegalNtfs().
    
    CORE-14067
---
 sdk/include/xdk/fsrtlfuncs.h | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/sdk/include/xdk/fsrtlfuncs.h b/sdk/include/xdk/fsrtlfuncs.h
index 9de4ed145e..b795f4126d 100644
--- a/sdk/include/xdk/fsrtlfuncs.h
+++ b/sdk/include/xdk/fsrtlfuncs.h
@@ -1606,19 +1606,16 @@ extern const UCHAR * const 
*FsRtlLegalAnsiCharacterArray;
 #endif
 
 #define FsRtlIsAnsiCharacterWild(C)                                            
\
-    FlagOn(LEGAL_ANSI_CHARACTER_ARRAY[(UCHAR)(C)], FSRTL_WILD_CHARACTER)
+    FsRtlTestAnsiCharacter((C), FALSE, FALSE, FSRTL_WILD_CHARACTER)
 
 #define FsRtlIsAnsiCharacterLegalFat(C, WILD)                                  
\
-    FlagOn(LEGAL_ANSI_CHARACTER_ARRAY[(UCHAR)(C)], (FSRTL_FAT_LEGAL) |         
\
-                                        ((WILD) ? FSRTL_WILD_CHARACTER : 0 ))
+    FsRtlTestAnsiCharacter((C), TRUE, (WILD), FSRTL_FAT_LEGAL)
 
 #define FsRtlIsAnsiCharacterLegalHpfs(C, WILD)                                 
\
-    FlagOn(LEGAL_ANSI_CHARACTER_ARRAY[(UCHAR)(C)], (FSRTL_HPFS_LEGAL) |        
\
-                                        ((WILD) ? FSRTL_WILD_CHARACTER : 0 ))
+    FsRtlTestAnsiCharacter((C), TRUE, (WILD), FSRTL_HPFS_LEGAL)
 
 #define FsRtlIsAnsiCharacterLegalNtfs(C, WILD)                                 
\
-    FlagOn(LEGAL_ANSI_CHARACTER_ARRAY[(UCHAR)(C)], (FSRTL_NTFS_LEGAL) |        
\
-                                        ((WILD) ? FSRTL_WILD_CHARACTER : 0 ))
+    FsRtlTestAnsiCharacter((C), TRUE, (WILD), FSRTL_NTFS_LEGAL)
 
 #define FsRtlIsAnsiCharacterLegalNtfsStream(C,WILD_OK)                         
\
     FsRtlTestAnsiCharacter((C), TRUE, (WILD_OK), FSRTL_NTFS_STREAM_LEGAL)

Reply via email to