diff options
Diffstat (limited to 'CPP/7zip/Bundles/SFXWin/SfxWin.cpp')
-rw-r--r-- | CPP/7zip/Bundles/SFXWin/SfxWin.cpp | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/CPP/7zip/Bundles/SFXWin/SfxWin.cpp b/CPP/7zip/Bundles/SFXWin/SfxWin.cpp index 23beade..3e1880e 100644 --- a/CPP/7zip/Bundles/SFXWin/SfxWin.cpp +++ b/CPP/7zip/Bundles/SFXWin/SfxWin.cpp | |||
@@ -4,7 +4,13 @@ | |||
4 | 4 | ||
5 | #include "../../../Common/MyWindows.h" | 5 | #include "../../../Common/MyWindows.h" |
6 | 6 | ||
7 | #if defined(__MINGW32__) || defined(__MINGW64__) | ||
8 | #include <shlwapi.h> | ||
9 | #else | ||
7 | #include <Shlwapi.h> | 10 | #include <Shlwapi.h> |
11 | #endif | ||
12 | |||
13 | #include "../../../../C/DllSecur.h" | ||
8 | 14 | ||
9 | #include "../../../Common/MyInitGuid.h" | 15 | #include "../../../Common/MyInitGuid.h" |
10 | 16 | ||
@@ -28,33 +34,36 @@ | |||
28 | #include "../../UI/GUI/ExtractGUI.h" | 34 | #include "../../UI/GUI/ExtractGUI.h" |
29 | #include "../../UI/GUI/ExtractRes.h" | 35 | #include "../../UI/GUI/ExtractRes.h" |
30 | 36 | ||
31 | #include "../../../../C/DllSecur.h" | ||
32 | |||
33 | using namespace NWindows; | 37 | using namespace NWindows; |
34 | using namespace NFile; | 38 | using namespace NFile; |
35 | using namespace NDir; | 39 | using namespace NDir; |
36 | 40 | ||
41 | extern | ||
42 | HINSTANCE g_hInstance; | ||
37 | HINSTANCE g_hInstance; | 43 | HINSTANCE g_hInstance; |
38 | 44 | ||
39 | #ifndef UNDER_CE | 45 | #ifndef UNDER_CE |
40 | 46 | ||
47 | static | ||
41 | DWORD g_ComCtl32Version; | 48 | DWORD g_ComCtl32Version; |
42 | 49 | ||
43 | static DWORD GetDllVersion(LPCTSTR dllName) | 50 | static DWORD GetDllVersion(LPCTSTR dllName) |
44 | { | 51 | { |
45 | DWORD dwVersion = 0; | 52 | DWORD dwVersion = 0; |
46 | HINSTANCE hinstDll = LoadLibrary(dllName); | 53 | const HINSTANCE hinstDll = LoadLibrary(dllName); |
47 | if (hinstDll) | 54 | if (hinstDll) |
48 | { | 55 | { |
49 | DLLGETVERSIONPROC pDllGetVersion = (DLLGETVERSIONPROC)GetProcAddress(hinstDll, "DllGetVersion"); | 56 | const |
50 | if (pDllGetVersion) | 57 | DLLGETVERSIONPROC func_DllGetVersion = Z7_GET_PROC_ADDRESS( |
58 | DLLGETVERSIONPROC, hinstDll, "DllGetVersion"); | ||
59 | if (func_DllGetVersion) | ||
51 | { | 60 | { |
52 | DLLVERSIONINFO dvi; | 61 | DLLVERSIONINFO dvi; |
53 | ZeroMemory(&dvi, sizeof(dvi)); | 62 | ZeroMemory(&dvi, sizeof(dvi)); |
54 | dvi.cbSize = sizeof(dvi); | 63 | dvi.cbSize = sizeof(dvi); |
55 | HRESULT hr = (*pDllGetVersion)(&dvi); | 64 | const HRESULT hr = func_DllGetVersion(&dvi); |
56 | if (SUCCEEDED(hr)) | 65 | if (SUCCEEDED(hr)) |
57 | dwVersion = MAKELONG(dvi.dwMinorVersion, dvi.dwMajorVersion); | 66 | dwVersion = (DWORD)MAKELONG(dvi.dwMinorVersion, dvi.dwMajorVersion); |
58 | } | 67 | } |
59 | FreeLibrary(hinstDll); | 68 | FreeLibrary(hinstDll); |
60 | } | 69 | } |
@@ -63,6 +72,8 @@ static DWORD GetDllVersion(LPCTSTR dllName) | |||
63 | 72 | ||
64 | #endif | 73 | #endif |
65 | 74 | ||
75 | extern | ||
76 | bool g_LVN_ITEMACTIVATE_Support; | ||
66 | bool g_LVN_ITEMACTIVATE_Support = true; | 77 | bool g_LVN_ITEMACTIVATE_Support = true; |
67 | 78 | ||
68 | static const wchar_t * const kUnknownExceptionMessage = L"ERROR: Unknown Error!"; | 79 | static const wchar_t * const kUnknownExceptionMessage = L"ERROR: Unknown Error!"; |
@@ -101,7 +112,7 @@ static int APIENTRY WinMain2() | |||
101 | const UString &s = commandStrings[i]; | 112 | const UString &s = commandStrings[i]; |
102 | if (s.Len() > 1 && s[0] == '-') | 113 | if (s.Len() > 1 && s[0] == '-') |
103 | { | 114 | { |
104 | wchar_t c = MyCharLower_Ascii(s[1]); | 115 | const wchar_t c = MyCharLower_Ascii(s[1]); |
105 | if (c == 'y') | 116 | if (c == 'y') |
106 | { | 117 | { |
107 | assumeYes = true; | 118 | assumeYes = true; |
@@ -152,7 +163,7 @@ static int APIENTRY WinMain2() | |||
152 | CMyComPtr<IFolderArchiveExtractCallback> extractCallback = ecs; | 163 | CMyComPtr<IFolderArchiveExtractCallback> extractCallback = ecs; |
153 | ecs->Init(); | 164 | ecs->Init(); |
154 | 165 | ||
155 | #ifndef _NO_CRYPTO | 166 | #ifndef Z7_NO_CRYPTO |
156 | ecs->PasswordIsDefined = !password.IsEmpty(); | 167 | ecs->PasswordIsDefined = !password.IsEmpty(); |
157 | ecs->Password = password; | 168 | ecs->Password = password; |
158 | #endif | 169 | #endif |