Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

PathCchRemoveExtension function

Removes the file name extension from a path, if one is present.

This function differs from PathRemoveExtension in that it accepts paths with "\\", "\\?\" and "\\?\UNC\" prefixes.

Note  This function, should be used in place of PathRemoveExtension to prevent the possibility of a buffer overrun.

Syntax


HRESULT PathCchRemoveExtension(
  _Inout_  PWSTR pszPath,
  _In_     size_t cchPath
);

Parameters

pszPath [in, out]

A pointer to the path string. When this function returns successfully, the string contains the path with any extension removed. If no extension was found, the string is unchanged.

cchPath [in]

The size of the buffer pointed to by pszPath, in characters.

Return value

This function returns S_OK if the function was successful, S_FALSE if no extension was found, or an error code otherwise.

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

Pathcch.h

Library

Pathcch.lib

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.