novice2 Wrote:

> Kagamin Wrote:
> 
> > novice2 Wrote:
> > 
> > > but sometime wchar* is zero-terminated strings (LPWSTR)
> > 
> > when?
> 
> everytime, when you see function with LPWSTR without size passing
> 
> for example:
> 
> SHGetFolderPathW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR 
> pszPath);
> 
> GetShortPathNameW( IN LPCWSTR lpszLongPath, OUT LPWSTR  lpszShortPath, IN 
> DWORD cchBuffer);
> 
> GetLongPathNameW(IN LPCWSTR lpszShortPath, OUT LPWSTR lpszLongPath, IN DWORD 
> cchBuffer);
> 
> etc etc etc
> 

these functions don't require output buffer to be null-terminated, because it's 
an *out* buffer, not inout, see example in msdn.

Reply via email to