diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-17 17:00:04 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-17 17:00:04 +0000 |
commit | 3b95b86342778c3a18b70158280332c0601516c9 (patch) | |
tree | 3baeb2e90f6a0160cfe9c6763f13d5d339bb7229 /chrome/common/win_util.cc | |
parent | bc9147a10c7287f285ddc1c246cc9d38cd5987c4 (diff) | |
download | chromium_src-3b95b86342778c3a18b70158280332c0601516c9.zip chromium_src-3b95b86342778c3a18b70158280332c0601516c9.tar.gz chromium_src-3b95b86342778c3a18b70158280332c0601516c9.tar.bz2 |
Adds logging to file_util::WriteFile to figure out why writing
bookmarks is failing for some people. As a result of this I moved some
code from common/win_util to base/win_util so that file_util_win could
call it. The only changes to this code are formatting.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2931
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2312 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/win_util.cc')
-rw-r--r-- | chrome/common/win_util.cc | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/chrome/common/win_util.cc b/chrome/common/win_util.cc index f664cfb..b0ef230 100644 --- a/chrome/common/win_util.cc +++ b/chrome/common/win_util.cc @@ -155,30 +155,6 @@ bool ShouldUseVistaFrame() { return !!f; } -std::wstring FormatMessage(unsigned messageid) { - wchar_t * string_buffer = NULL; - unsigned string_length = ::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, NULL, - messageid, 0, - reinterpret_cast<wchar_t *>(&string_buffer), - 0, NULL); - - std::wstring formatted_string; - if (string_buffer) { - formatted_string = string_buffer; - LocalFree(reinterpret_cast<HLOCAL>(string_buffer)); - } else { - // The formating failed. simply convert the message value into a string. - SStringPrintf(&formatted_string, L"message number %d", messageid); - } - return formatted_string; -} - -std::wstring FormatLastWin32Error() { - return FormatMessage(GetLastError()); -} - void ShowItemInFolder(const std::wstring& full_path) { std::wstring dir = file_util::GetDirectoryFromPath(full_path); if (dir == L"" || !file_util::PathExists(full_path)) |