ReactOS 0.4.15-dev-7842-g558ab78
FsRtlRemoveDotsFromPath.c File Reference
#include <kmt_test.h>
#include <debug.h>
Include dependency graph for FsRtlRemoveDotsFromPath.c:

Go to the source code of this file.

Macros

#define NDEBUG
 
#define InitConstString(s, c)
 

Functions

NTSTATUS NTAPI FsRtlRemoveDotsFromPath (PWSTR OriginalString, USHORT PathLength, USHORT *NewLength)
 
static NTSTATUS (NTAPI *pFsRtlRemoveDotsFromPath)(PWSTR OriginalString
 
 START_TEST (FsRtlRemoveDotsFromPath)
 

Variables

static USHORT PathLength
 
static USHORT USHORTNewLength
 

Macro Definition Documentation

◆ InitConstString

#define InitConstString (   s,
  c 
)
Value:
wcscpy(s.Buffer, c); \
s.Buffer[sizeof(c) / sizeof(WCHAR) - 1] = 0; \
s.Length = sizeof(c) - sizeof(UNICODE_NULL)
GLdouble s
Definition: gl.h:2039
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
#define UNICODE_NULL
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Definition at line 13 of file FsRtlRemoveDotsFromPath.c.

◆ NDEBUG

#define NDEBUG

Definition at line 10 of file FsRtlRemoveDotsFromPath.c.

Function Documentation

◆ FsRtlRemoveDotsFromPath()

NTSTATUS NTAPI FsRtlRemoveDotsFromPath ( PWSTR  OriginalString,
USHORT  PathLength,
USHORT NewLength 
)

Referenced by START_TEST().

◆ NTSTATUS()

static NTSTATUS ( NTAPI pFsRtlRemoveDotsFromPath)
static

◆ START_TEST()

START_TEST ( FsRtlRemoveDotsFromPath  )

Definition at line 26 of file FsRtlRemoveDotsFromPath.c.

27{
28 WCHAR Buf[255];
31
32 TestString.Buffer = Buf;
33 TestString.MaximumLength = sizeof(Buf);
35 ASSERT(pFsRtlRemoveDotsFromPath);
36
38 Status = pFsRtlRemoveDotsFromPath(TestString.Buffer, TestString.Length, &TestString.Length);
40
42 Status = pFsRtlRemoveDotsFromPath(TestString.Buffer, TestString.Length, &TestString.Length);
44
45 InitConstString(TestString, L"..\\anyOtherContent");
46 Status = pFsRtlRemoveDotsFromPath(TestString.Buffer, TestString.Length, &TestString.Length);
48
50 Status = pFsRtlRemoveDotsFromPath(TestString.Buffer, TestString.Length, &TestString.Length);
52 ok_eq_wstr(TestString.Buffer, L"\\");
53
54 InitConstString(TestString, L"\\dir1\\dir2\\..\\dir3\\.\\file.txt");
55 Status = pFsRtlRemoveDotsFromPath(TestString.Buffer, TestString.Length, &TestString.Length);
57 ok_eq_wstr(TestString.Buffer, L"\\dir1\\dir3\\file.txt");
58}
#define InitConstString(s, c)
NTSTATUS NTAPI FsRtlRemoveDotsFromPath(PWSTR OriginalString, USHORT PathLength, USHORT *NewLength)
#define ok_eq_hex(value, expected)
Definition: apitest.h:76
#define ok_eq_wstr(value, expected)
Definition: apitest.h:83
LONG NTSTATUS
Definition: precomp.h:26
Status
Definition: gdiplustypes.h:25
#define KmtGetSystemOrEmbeddedRoutineAddress(RoutineName)
Definition: kmt_test.h:298
#define ASSERT(a)
Definition: mode.c:44
#define STATUS_IO_REPARSE_DATA_INVALID
Definition: ntstatus.h:756
#define L(x)
Definition: ntvdm.h:50
#define STATUS_SUCCESS
Definition: shellext.h:65
EH_STD::basic_string< char, EH_STD::char_traits< char >, eh_allocator(char) > TestString
Definition: test_string.cpp:30

Variable Documentation

◆ NewLength

◆ PathLength