other-licenses/7zstub/src/7zip/UI/Explorer/MyMessages.cpp

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 // MyMessages.cpp
michael@0 2
michael@0 3 #include "StdAfx.h"
michael@0 4
michael@0 5 #include "MyMessages.h"
michael@0 6 #include "Common/String.h"
michael@0 7 #include "Common/StringConvert.h"
michael@0 8
michael@0 9 #include "Windows/Error.h"
michael@0 10 #include "Windows/ResourceString.h"
michael@0 11
michael@0 12 #ifdef LANG
michael@0 13 #include "../../FileManager/LangUtils.h"
michael@0 14 #endif
michael@0 15
michael@0 16 using namespace NWindows;
michael@0 17
michael@0 18 void MyMessageBox(HWND window, LPCWSTR message)
michael@0 19 {
michael@0 20 ::MessageBoxW(window, message, L"7-Zip", 0);
michael@0 21 }
michael@0 22
michael@0 23 void MyMessageBox(UINT32 id
michael@0 24 #ifdef LANG
michael@0 25 ,UINT32 langID
michael@0 26 #endif
michael@0 27 )
michael@0 28 {
michael@0 29 #ifdef LANG
michael@0 30 MyMessageBox(LangString(id, langID));
michael@0 31 #else
michael@0 32 MyMessageBox(MyLoadStringW(id));
michael@0 33 #endif
michael@0 34 }
michael@0 35
michael@0 36 void ShowErrorMessage(HWND window, DWORD message)
michael@0 37 {
michael@0 38 MyMessageBox(window, NError::MyFormatMessageW(message));
michael@0 39 }
michael@0 40
michael@0 41 void ShowLastErrorMessage(HWND window)
michael@0 42 {
michael@0 43 ShowErrorMessage(window, ::GetLastError());
michael@0 44 }
michael@0 45

mercurial