Expand Minimize

FsRtlRemoveDotsFromPath routine

The FsRtlRemoveDotsFromPath routine removes unnecessary occurrences of '.' and '..' from the specified path.

Syntax


NTSTATUS FsRtlRemoveDotsFromPath(
  _Inout_ PWSTR  OriginalString,
  _In_    USHORT PathLength,
  _Out_   USHORT *NewLength
);

Parameters

OriginalString [in, out]

A pointer to the buffer to be processed.

PathLength [in]

The length of buffer (in bytes).

NewLength [out]

A pointer to the new length of the buffer, after processing.

Return value

The FsRtlRemoveDotsFromPath routine returns either STATUS_SUCCESS value for success or STATUS_IO_REPARSE_DATA_INVALID if the operation could not be completed.

Remarks

This routine would take a path as OriginalString like the following example:


\dir1\dir2\..\dir3\.\file.txt

The routine would modify OriginalString as follows:


\dir1\dir3\file.txt

The routine will fail with STATUS_IO_REPARSE_DATA_INVALID if any of the following strings are passed as OriginalString:


\..
..
..\anyOtherContent

Requirements

Target platform

Universal

Version

Available in Windows Vista and later versions of the Windows operating system.

Header

Ntifs.h (include FltKernel.h or Ntifs.h)

Library

NtosKrnl.lib

DLL

NtosKrnl.exe

IRQL

PASSIVE_LEVEL

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft