Return Values If the function succeeds, the return value specifies the number of TCHARs copied to the buffer, not including the terminating null character.
If the function fails, the return value is zero. To get extended error information, call GetLastError.