ReactOS  0.4.13-dev-443-g10f00f8
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)
#define UNICODE_NULL
__wchar_t WCHAR
Definition: xmlstorage.h:180
const GLubyte * c
Definition: glext.h:8905
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
GLdouble s
Definition: gl.h:2039
#define c
Definition: ke_i.h:80

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 
49  InitConstString(TestString, L"\\\\..");
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 }
EH_STD::basic_string< char, EH_STD::char_traits< char >, eh_allocator(char) > TestString
Definition: test_string.cpp:30
#define ok_eq_wstr(value, expected)
Definition: kmt_test.h:262
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_IO_REPARSE_DATA_INVALID
Definition: ntstatus.h:742
#define InitConstString(s, c)
__wchar_t WCHAR
Definition: xmlstorage.h:180
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static const WCHAR L[]
Definition: oid.c:1250
#define KmtGetSystemOrEmbeddedRoutineAddress(RoutineName)
Definition: kmt_test.h:293
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI FsRtlRemoveDotsFromPath(PWSTR OriginalString, USHORT PathLength, USHORT *NewLength)
#define ok_eq_hex(value, expected)
return STATUS_SUCCESS
Definition: btrfs.c:2777

Variable Documentation

◆ NewLength

◆ PathLength