Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ターゲットwindowsをwindows7に上げる #548

Merged
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
395c925
_WIN32_WINNTを_WIN32_WINNT_WIN7に更新
berryzplus Oct 13, 2018
6667aba
vista以降チェックの方法を他に合わせる
berryzplus Oct 13, 2018
ccb4911
実効性がないバージョンチェックを除去
berryzplus Oct 13, 2018
b0fd56c
バージョン確認関数のリファクタリング
berryzplus Oct 13, 2018
8409397
SDKの定数を独自定義するのをやめる
berryzplus Oct 13, 2018
abf3ab1
IsWin32NT除去
berryzplus Oct 13, 2018
3707b82
HasWinHelpContentsProblem除去
berryzplus Oct 13, 2018
9c013c8
OsSupportReconvertを除去
berryzplus Oct 13, 2018
1beb197
IsWinV5forOfnを除去
berryzplus Oct 13, 2018
53274ea
IsWinVista_or_laterを除去
berryzplus Oct 13, 2018
e14801a
IsWinXP_or_later除去
berryzplus Oct 13, 2018
0ba38d4
IsWin2000_or_laterを除去
berryzplus Oct 13, 2018
b726762
IsWinMeを除去
berryzplus Oct 13, 2018
17db5f6
IsWineを除去
berryzplus Oct 13, 2018
46a149a
COsVersionInfo.hのインクルードを除去
berryzplus Oct 13, 2018
66bffd0
不要となったファイルを除去
berryzplus Oct 13, 2018
1b81d46
要らなくなったGetProcAddressを除去
berryzplus Oct 13, 2018
24d519f
実効性のないコードを除去
berryzplus Oct 13, 2018
05f6df4
CHtmlHelpを他実装に合わせる
berryzplus Oct 13, 2018
1094464
古いOS向けのコメント除去
berryzplus Oct 14, 2018
185e68e
固定配列にstd::vectorを使っていたのをやめる
berryzplus Oct 14, 2018
3e54587
std::wstringをstd::unique_ptrに変える
berryzplus Oct 14, 2018
8ca7819
std::unique_ptrを固定配列に変える
berryzplus Oct 14, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed resource/cursor_hand.cur
Binary file not shown.
11 changes: 4 additions & 7 deletions sakura/sakura.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<Optimization>MinSpace</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\sakura_core;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN2K;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN7;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
Expand Down Expand Up @@ -136,7 +136,7 @@
<Optimization>MinSpace</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>..\sakura_core;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN2K;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN7;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
Expand Down Expand Up @@ -176,7 +176,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\sakura_core;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN2K;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN7;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
Expand Down Expand Up @@ -216,7 +216,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\sakura_core;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN2K;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_WIN32_WINNT=_WIN32_WINNT_WIN7;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
Expand Down Expand Up @@ -572,7 +572,6 @@
<ClInclude Include="..\sakura_core\_main\global.h" />
<ClInclude Include="..\sakura_core\_os\CClipboard.h" />
<ClInclude Include="..\sakura_core\_os\CDropTarget.h" />
<ClInclude Include="..\sakura_core\_os\COsVersionInfo.h" />
<ClInclude Include="..\sakura_core\_os\OleTypes.h" />
</ItemGroup>
<ItemGroup>
Expand All @@ -588,7 +587,6 @@
<None Include="..\resource\auto_scroll_up_right.cur" />
<None Include="..\resource\auto_scroll_vertical.cur" />
<None Include="..\resource\cursor_copy.cur" />
<None Include="..\resource\cursor_hand.cur" />
<None Include="..\resource\cursor_isb.cur" />
<None Include="..\resource\cursor_isf.cur" />
<None Include="..\resource\cursor_move.cur" />
Expand Down Expand Up @@ -976,7 +974,6 @@
<ClCompile Include="..\sakura_core\_main\WinMain.cpp" />
<ClCompile Include="..\sakura_core\_os\CClipboard.cpp" />
<ClCompile Include="..\sakura_core\_os\CDropTarget.cpp" />
<ClCompile Include="..\sakura_core\_os\COsVersionInfo.cpp" />
</ItemGroup>
<ItemGroup>
<Image Include="..\resource\auto_scroll_center.bmp" />
Expand Down
9 changes: 0 additions & 9 deletions sakura/sakura.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -970,9 +970,6 @@
<ClInclude Include="..\sakura_core\_os\CDropTarget.h">
<Filter>Cpp Source Files\_os</Filter>
</ClInclude>
<ClInclude Include="..\sakura_core\_os\COsVersionInfo.h">
<Filter>Cpp Source Files\_os</Filter>
</ClInclude>
<ClInclude Include="..\sakura_core\_os\OleTypes.h">
<Filter>Cpp Source Files\_os</Filter>
</ClInclude>
Expand Down Expand Up @@ -1126,9 +1123,6 @@
<None Include="..\resource\cursor_copy.cur">
<Filter>Resource Files</Filter>
</None>
<None Include="..\resource\cursor_hand.cur">
<Filter>Resource Files</Filter>
</None>
<None Include="..\resource\cursor_isb.cur">
<Filter>Resource Files</Filter>
</None>
Expand Down Expand Up @@ -2096,9 +2090,6 @@
<ClCompile Include="..\sakura_core\_os\CDropTarget.cpp">
<Filter>Cpp Source Files\_os</Filter>
</ClCompile>
<ClCompile Include="..\sakura_core\_os\COsVersionInfo.cpp">
<Filter>Cpp Source Files\_os</Filter>
</ClCompile>
<ClCompile Include="..\sakura_core\outline\CDlgFileTree.cpp">
<Filter>Cpp Source Files\outline</Filter>
</ClCompile>
Expand Down
17 changes: 1 addition & 16 deletions sakura_core/CSelectLang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "CSelectLang.h"
#include "util/os.h"
#include "util/module.h"
#include "_os/COsVersionInfo.h"

#include <new>

Expand Down Expand Up @@ -403,21 +402,7 @@ HINSTANCE CSelectLang::ChangeLang( UINT nIndex )
m_psLangInfo = psLangInfo;

// ロケールを設定
// SetThreadUILanguageの呼び出しを試みる
bool isSuccess = false;
if( COsVersionInfo()._IsWinVista_or_later() ) {
HMODULE hDll = LoadLibrary( _T("kernel32") );
if ( hDll ) {
typedef short (CALLBACK* SetThreadUILanguageType)(LANGID);
SetThreadUILanguageType _SetThreadUILanguage = (SetThreadUILanguageType)
GetProcAddress(hDll, "SetThreadUILanguage");
isSuccess = _SetThreadUILanguage && _SetThreadUILanguage( m_psLangInfo->wLangId );
FreeLibrary( hDll );
}
}
if ( !isSuccess ) {
SetThreadLocale(MAKELCID( m_psLangInfo->wLangId, SORT_DEFAULT ));
}
::SetThreadUILanguage( m_psLangInfo->wLangId );

return m_psLangInfo->hInstance;
}
Expand Down
3 changes: 1 addition & 2 deletions sakura_core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RM= cmd /c $(CURDIR)/../sakura/mingw32-del.bat

DEFINES= \
-DWIN32 \
-D_WIN32_WINNT=_WIN32_WINNT_WIN2K \
-D_WIN32_WINNT=_WIN32_WINNT_WIN7 \
-D_UNICODE \
-DUNICODE \
$(MYDEFINES)
Expand Down Expand Up @@ -417,7 +417,6 @@ _main/global.o \
_main/WinMain.o \
_os/CClipboard.o \
_os/CDropTarget.o \
_os/COsVersionInfo.o \
sakura_rc.o \

GENERATED_FILES= \
Expand Down
49 changes: 2 additions & 47 deletions sakura_core/_main/CProcessFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "CNormalProcess.h"
#include "CCommandLine.h"
#include "CControlTray.h"
#include "_os/COsVersionInfo.h"
#include "dlg/CDlgProfileMgr.h"
#include "debug/CRunningTimer.h"
#include "util/os.h"
Expand Down Expand Up @@ -134,52 +133,8 @@ bool CProcessFactory::ProfileSelect( HINSTANCE hInstance, LPCTSTR lpCmdLine )
*/
bool CProcessFactory::IsValidVersion()
{
/* Windowsバージョンのチェック */
COsVersionInfo cOsVer(true); // 初期化を行う
if( cOsVer.GetVersion() ){
if( !cOsVer.OsIsEnableVersion() ){
InfoMessage( NULL,
_T("このアプリケーションを実行するには、\n")
#if (WINVER >= _WIN32_WINNT_WIN7)
_T("Windows7以降のOSが必要です。\n")
#elif (WINVER >= _WIN32_WINNT_VISTA)
_T("WindowsVista以降 または WindowsServer2008以降のOSが必要です。\n")
#elif (WINVER >= _WIN32_WINNT_WIN2K)
_T("Windows2000以降のOSが必要です。\n")
#else
_T("Windows95以上 または WindowsNT4.0以上のOSが必要です。\n")
#endif
_T("アプリケーションを終了します。")
);
return false;
}
}else{
InfoMessage( NULL, _T("OSのバージョンが取得できません。\nアプリケーションを終了します。") );
return false;
}

/* 拡張命令セットのチェック */
#ifdef USE_SSE2
if ( cOsVer._SupportSSE2() ) {
} else {
InfoMessage( NULL,
_T("このアプリケーションを実行するには、\n")
_T("SSE2命令セットをサポートしたCPUが必要です。\n")
_T("アプリケーションを終了します。")
);
return false;
}
#endif

#if (WINVER < _WIN32_WINNT_WIN2K)
/* システムリソースのチェック */
// Jul. 5, 2001 shoji masami NTではリソースチェックを行わない
if( !IsWin32NT() ){
if( !CheckSystemResources( GSTR_APPNAME ) ){
return false;
}
}
#endif
// Windowsバージョンは廃止。
// 動作可能バージョン(=windows7以降)でなければ起動できない。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

黒翼猫さんが Windows 2000 で無理やり動作させた時は無力感を味わいながら諦めましょう…。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大変お世話になってた気がするので、もし必要なら対応版ブランチを作る感じです。

きっと彼らは最新版追わないので影響ないんじゃないかと思ってます。

return true;
}

Expand Down
20 changes: 2 additions & 18 deletions sakura_core/_main/WinMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,8 @@ int WINAPI _tWinMain(
MY_RUNNINGTIMER(cRunningTimer, "WinMain" );
{
// 2014.04.24 DLLの検索パスからカレントディレクトリを削除する
HMODULE kernel32 = GetModuleHandleA( "KERNEL32" );
if( kernel32 ){
typedef BOOL (WINAPI* Proc_pfnSetDllDirectoryW)(LPCWSTR);
Proc_pfnSetDllDirectoryW pfnSetDllDirectoryW = (Proc_pfnSetDllDirectoryW)GetProcAddress( kernel32, "SetDllDirectoryW" );
if( pfnSetDllDirectoryW ){
pfnSetDllDirectoryW( L"" );
}
typedef BOOL (WINAPI* Proc_pfnSetSearchPathMode)(DWORD);
Proc_pfnSetSearchPathMode pfnSetSearchPathMode = (Proc_pfnSetSearchPathMode)GetProcAddress( kernel32, "SetSearchPathMode" );
if( pfnSetSearchPathMode ){
const DWORD dwBASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE = 1;
const DWORD dwBASE_SEARCH_PATH_PERMANENT = 0x8000;
pfnSetSearchPathMode( dwBASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | dwBASE_SEARCH_PATH_PERMANENT );
}
}
// 2010.08.28 Moca DLLインジェクション対策
CCurrentDirectoryBackupPoint dirBack;
ChangeCurrentDirectoryToExeDir();
::SetDllDirectory( _T("") );
::SetSearchPathMode( BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE | BASE_SEARCH_PATH_PERMANENT );

setlocale( LC_ALL, "Japanese" ); //2007.08.16 kobake 追加
::OleInitialize( NULL ); // 2009.01.07 ryoji 追加
Expand Down
69 changes: 0 additions & 69 deletions sakura_core/_os/COsVersionInfo.cpp

This file was deleted.

Loading