ReactOS 0.4.16-dev-297-gc569aee
FsRtlLegal.c File Reference
#include <kmt_test.h>
Include dependency graph for FsRtlLegal.c:

Go to the source code of this file.

Functions

 START_TEST (FsRtlLegal)
 

Variables

struct {
   PCSTR   Dbcs
 
   BOOLEAN   LegalFat
 
   BOOLEAN   LegalHpfs
 
   BOOLEAN   HasWildCards
 
   BOOLEAN   IsPath
 
   BOOLEAN   LeadingBackslash
 
NamesTests []
 
static const UCHAR LegalAnsiCharacterArray []
 

Function Documentation

◆ START_TEST()

START_TEST ( FsRtlLegal  )

Definition at line 236 of file FsRtlLegal.c.

237{
238 ULONG i;
240 ANSI_STRING DbcsName;
241 ULONG Flags;
242
243 for (i = 0; i < RTL_NUMBER_OF(NamesTests); i++)
244 {
245 RtlInitAnsiString(&DbcsName, NamesTests[i].Dbcs);
246 for (Flags = 0; Flags < 8; Flags++)
247 {
248 Result = FsRtlIsFatDbcsLegal(DbcsName,
251 BooleanFlagOn(Flags, 4));
252 if (NamesTests[i].HasWildCards && !FlagOn(Flags, 1))
253 ok(Result == FALSE, "[%s] Result = %u but has wildcards\n", NamesTests[i].Dbcs, Result);
254 else if (NamesTests[i].IsPath && !FlagOn(Flags, 2))
255 ok(Result == FALSE, "[%s] Result = %u but is path\n", NamesTests[i].Dbcs, Result);
256 else if (NamesTests[i].LeadingBackslash && !FlagOn(Flags, 4))
257 ok(Result == FALSE, "[%s] Result = %u but has leading backslash\n", NamesTests[i].Dbcs, Result);
258 else if (!NamesTests[i].LegalFat)
259 ok(Result == FALSE, "[%s] Result = %u but is NOT legal FAT\n", NamesTests[i].Dbcs, Result);
260 else
261 ok(Result == TRUE, "[%s] Result = %u but IS legal FAT\n", NamesTests[i].Dbcs, Result);
262
263 Result = FsRtlIsHpfsDbcsLegal(DbcsName,
266 BooleanFlagOn(Flags, 4));
267 if (NamesTests[i].HasWildCards && !FlagOn(Flags, 1))
268 ok(Result == FALSE, "[%s] Result = %u but has wildcards\n", NamesTests[i].Dbcs, Result);
269 else if (NamesTests[i].IsPath && !FlagOn(Flags, 2))
270 ok(Result == FALSE, "[%s] Result = %u but is path\n", NamesTests[i].Dbcs, Result);
271 else if (NamesTests[i].LeadingBackslash && !FlagOn(Flags, 4))
272 ok(Result == FALSE, "[%s] Result = %u but has leading backslash\n", NamesTests[i].Dbcs, Result);
273 else if (!NamesTests[i].LegalHpfs)
274 ok(Result == FALSE, "[%s] Result = %u but is NOT legal HPFS\n", NamesTests[i].Dbcs, Result);
275 else
276 ok(Result == TRUE, "[%s] Result = %u but IS legal HPFS\n", NamesTests[i].Dbcs, Result);
277 }
278 }
279
280 for (i = 0; i <= 0x7f; ++i)
281 {
283 "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i, LegalAnsiCharacterArray[i], (*FsRtlLegalAnsiCharacterArray)[i]);
284
286 "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i, FsRtlIsAnsiCharacterWild(i), BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_WILD_CHARACTER));
287
289 "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i, FsRtlIsAnsiCharacterLegalFat(i, FALSE), BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_FAT_LEGAL));
291 "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i, FsRtlIsAnsiCharacterLegalFat(i, TRUE),
293
295 "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i, FsRtlIsAnsiCharacterLegalHpfs(i, FALSE), BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_HPFS_LEGAL));
297 "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i, FsRtlIsAnsiCharacterLegalHpfs(i, TRUE),
299
301 "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i, FsRtlIsAnsiCharacterLegalNtfs(i, FALSE), BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_NTFS_LEGAL));
303 "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i, FsRtlIsAnsiCharacterLegalNtfs(i, TRUE),
305
307 "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i, FsRtlIsAnsiCharacterLegalNtfsStream(i, FALSE), BooleanFlagOn(LegalAnsiCharacterArray[i], FSRTL_NTFS_STREAM_LEGAL));
309 "Mismatching value for 0x%x: 0x%x (exp) - 0x%x (got)\n", i, FsRtlIsAnsiCharacterLegalNtfsStream(i, TRUE),
311 }
312}
static const UCHAR LegalAnsiCharacterArray[]
Definition: FsRtlLegal.c:104
static struct @1630 NamesTests[]
BOOLEAN HasWildCards
Definition: FsRtlLegal.c:16
PCSTR Dbcs
Definition: FsRtlLegal.c:13
BOOLEAN IsPath
Definition: FsRtlLegal.c:17
BOOLEAN LeadingBackslash
Definition: FsRtlLegal.c:18
BOOLEAN LegalHpfs
Definition: FsRtlLegal.c:15
BOOLEAN LegalFat
Definition: FsRtlLegal.c:14
unsigned char BOOLEAN
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define ok(value,...)
Definition: atltest.h:57
BOOLEAN NTAPI FsRtlIsFatDbcsLegal(IN ANSI_STRING DbcsName, IN BOOLEAN WildCardsPermissible, IN BOOLEAN PathNamePermissible, IN BOOLEAN LeadingBackslashPermissible)
Definition: dbcsname.c:466
BOOLEAN NTAPI FsRtlIsHpfsDbcsLegal(IN ANSI_STRING DbcsName, IN BOOLEAN WildCardsPermissible, IN BOOLEAN PathNamePermissible, IN BOOLEAN LeadingBackslashPermissible)
Definition: dbcsname.c:638
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
#define FsRtlIsAnsiCharacterLegalHpfs(C, WILD)
Definition: fsrtlfuncs.h:1614
#define FsRtlIsAnsiCharacterLegalNtfs(C, WILD)
Definition: fsrtlfuncs.h:1617
#define FsRtlIsAnsiCharacterWild(C)
Definition: fsrtlfuncs.h:1608
#define FsRtlIsAnsiCharacterLegalFat(C, WILD)
Definition: fsrtlfuncs.h:1611
#define FsRtlIsAnsiCharacterLegalNtfsStream(C, WILD_OK)
Definition: fsrtlfuncs.h:1620
const UCHAR *const FsRtlLegalAnsiCharacterArray
Definition: fsrtlpc.c:154
#define FSRTL_HPFS_LEGAL
Definition: fsrtltypes.h:83
#define FSRTL_WILD_CHARACTER
Definition: fsrtltypes.h:85
#define FSRTL_NTFS_STREAM_LEGAL
Definition: fsrtltypes.h:87
#define FSRTL_NTFS_LEGAL
Definition: fsrtltypes.h:84
#define FSRTL_FAT_LEGAL
Definition: fsrtltypes.h:82
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
uint32_t ULONG
Definition: typedefs.h:59
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Variable Documentation

◆ Dbcs

PCSTR Dbcs

Definition at line 13 of file FsRtlLegal.c.

Referenced by START_TEST().

◆ HasWildCards

BOOLEAN HasWildCards

Definition at line 16 of file FsRtlLegal.c.

Referenced by START_TEST().

◆ IsPath

BOOLEAN IsPath

Definition at line 17 of file FsRtlLegal.c.

Referenced by START_TEST().

◆ LeadingBackslash

BOOLEAN LeadingBackslash

Definition at line 18 of file FsRtlLegal.c.

Referenced by START_TEST().

◆ LegalAnsiCharacterArray

const UCHAR LegalAnsiCharacterArray[]
static

Definition at line 104 of file FsRtlLegal.c.

Referenced by START_TEST().

◆ LegalFat

BOOLEAN LegalFat

Definition at line 14 of file FsRtlLegal.c.

Referenced by START_TEST().

◆ LegalHpfs

BOOLEAN LegalHpfs

Definition at line 15 of file FsRtlLegal.c.

Referenced by START_TEST().

◆ 

struct { ... } NamesTests[]

Referenced by START_TEST().