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.

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

mercurial