Actually this is a question about a huge number of winapi functions. Typical MS documentation says (from http://msdn.microsoft.com/en-us/library/bb762194(VS.85).aspx ):
BOOL SHGetPathFromIDList (
PCIDLIST_ABSOLUTE pidl,
LPTSTR pszPath
);
pidl [in] The address of an item identifier list that specifies a file
or directory location relative to the root of the namespace (the desktop).
pszPath [out] The address of a buffer to receive the file system path.
This buffer must be at least MAX_PATH characters in size.
Nowhere is it said whether completion 0 is written to pszPath. Moreover, he does not say if pszPath can fill the path without leaving any room there.
Interaction with users on the distribution of users 50/50 users who allocate a buffer with MAX_PATH + 1 character and users who deal only with MAX_PATH.
Although I can, of course, do something like char buf [MAX_PATH + 1] = {0} to be safe, I would really like to know if there is a place where this material is described? Perhaps some page for all the functions related to the contour, I do not know ...
source
share