Selected system functions are called with fixed size stack buffers first to eliminate the need to retry again when the stack buffer proved sufficient now.

This commit is contained in:
2015-11-12 19:35:26 +01:00
parent e20ab835ed
commit 7fef07d0fd
6 changed files with 255 additions and 126 deletions

View File

@@ -35,7 +35,7 @@
///
inline BOOL PathCanonicalizeA(__out ATL::CAtlStringA &sValue, __in LPCSTR pszPath)
{
// Prepare the buffer data and read into it.
// Allocate buffer on heap and read into it.
LPSTR szBuffer = sValue.GetBuffer(MAX_PATH);
if (!szBuffer) {
::SetLastError(ERROR_OUTOFMEMORY);
@@ -55,7 +55,7 @@ inline BOOL PathCanonicalizeA(__out ATL::CAtlStringA &sValue, __in LPCSTR pszPat
///
inline BOOL PathCanonicalizeW(__out ATL::CAtlStringW &sValue, __in LPCWSTR pszPath)
{
// Prepare the buffer data and read into it.
// Allocate buffer on heap and read into it.
LPWSTR szBuffer = sValue.GetBuffer(MAX_PATH);
if (!szBuffer) {
::SetLastError(ERROR_OUTOFMEMORY);