Long path cannot be handle with GetFullPathName

Sundeep KOKKONDA 1 Reputation point

I am trying to get an absolute path from the GetFullPathName API by passing the relative path as argument to the function. But, the GetFullPathName API is not working for long paths (may be not working if length >260 characters). How to get this API work for long paths? Or any other API is available to deal with long paths?

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,230 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RLWA32 35,051 Reputation points

    According to maximum-file-path-limitation GetFullPathNameW will not have the MAX_PATH restriction if you have opted into long path behavior. If you have not opted in you can prepend the path with "\?\"

    By the way, you must call GetFullPathNameW for long path support. GetFullPathNameA is limited to MAX_PATH.

    0 comments No comments