The buffer should really be bigger than MAX_PATH (260) -- This function will return the cannon name which could be up to 32,767 characters long.

I believe this function will also cannon files on subst drives and mapped volumes to their physical location.  F:\ ==> \\someserver\someshare\folder\folder\folder\folder ... could get expanded to a big path.  same with subst drives.  I'm not 100% certain on either of those cases but the MAX_PATH size has never sit right with me. 

Regarding pathnames -- the documentation for CreateFile states: "The ANSI version of this function, the name is limited to MAX_PATH".  To expand the size to 32,727 prepend \\?\ to the path name."  It doesn't say how the UNICODE version behaves or if the unicode version is different.  

Normally this wouldn't be a problem but since we're cannonacalizing the full path the target, then I'm not sure what this does.  I will do some tests to see but we should, at the very least make the buffer larger and check the result.