Support for file read&write of AL::TLS::CConfigData added.

This commit is contained in:
Simon Rozman
2015-04-05 20:01:36 +00:00
parent b51eb6d1bc
commit beaa51b49d

View File

@@ -101,7 +101,10 @@ inline int GetWindowTextA(__in HWND hWnd, __out ATL::CAtlStringA &sValue)
if (iResult > 0) {
// Prepare the buffer and read the string data into it.
LPSTR szBuffer = sValue.GetBuffer(iResult++);
if (!szBuffer) return 0;
if (!szBuffer) {
SetLastError(ERROR_OUTOFMEMORY);
return 0;
}
iResult = ::GetWindowTextA(hWnd, szBuffer, iResult);
sValue.ReleaseBuffer(iResult);
return iResult;
@@ -122,7 +125,10 @@ inline int GetWindowTextW(__in HWND hWnd, __out ATL::CAtlStringW &sValue)
if (iResult > 0) {
// Prepare the buffer and read the string data into it.
LPWSTR szBuffer = sValue.GetBuffer(iResult++);
if (!szBuffer) return 0;
if (!szBuffer) {
SetLastError(ERROR_OUTOFMEMORY);
return 0;
}
iResult = ::GetWindowTextW(hWnd, szBuffer, iResult);
sValue.ReleaseBuffer(iResult);
return iResult;