PathSkipRoot function

Retrieves a pointer to the first character in a path following the drive letter or Universal Naming Convention (UNC) server/share path elements.

Syntax


PTSTR PathSkipRoot(
  _In_  PTSTR pszPath
);

Parameters

pszPath [in]

Type: PTSTR

A pointer to a null-terminated string of maximum length MAX_PATH that contains the path to parse.

Return value

Type: PTSTR

A pointer that, when this function returns successfully, points to the beginning of the subpath that follows the root (drive letter or UNC server/share). If the function encounters an error, this value will be NULL.

Examples



#include <windows.h>
#include <iostream.h>
#include "Shlwapi.h"

void main( void )
{
    // Path to convert.
    char buffer_1[ ] = "C:\\path1\\path2";
    char *lpStr1;
    lpStr1 = buffer_1;

    cout << "The path before is : " << lpStr1 << endl;
    cout << "The path after is :  " << PathSkipRoot(lpStr1) << endl;
}

OUTPUT:
==================
The path before is : C:\path1\path2
The path after is : path1\path2

Requirements

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Shlwapi.h

Library

Shlwapi.lib

DLL

Shlwapi.dll (version 4.71 or later)

Unicode and ANSI names

PathSkipRootW (Unicode) and PathSkipRootA (ANSI)

See also

PathCchSkipRoot

 

 

Community Additions

ADD
Show:
© 2014 Microsoft