mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 03:20:11 +01:00
GH 30:Poco::Path::home() throws
GH #30: Poco::Path::home() throws when called from Windows Service done for Win32 and Win32U, return root for WinCE
This commit is contained in:
@@ -58,19 +58,9 @@ std::string PathImpl::homeImpl()
|
||||
}
|
||||
|
||||
|
||||
std::string PathImpl::tempImpl()
|
||||
std::string PathImpl::systemImpl()
|
||||
{
|
||||
Buffer<wchar_t> buffer(MAX_PATH_LEN);
|
||||
DWORD n = GetTempPathW(static_cast<DWORD>(buffer.size()), buffer.begin());
|
||||
if (n > 0)
|
||||
{
|
||||
std::string result;
|
||||
UnicodeConverter::toUTF8(buffer.begin(), result);
|
||||
if (result[n - 1] != '\\')
|
||||
result.append("\\");
|
||||
return result;
|
||||
}
|
||||
throw SystemException("Cannot get current directory");
|
||||
return("\\");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user