diff --git a/Main.cpp b/Main.cpp new file mode 100644 index 0000000..e1dca8d --- /dev/null +++ b/Main.cpp @@ -0,0 +1,104 @@ +#include "stdafx.h" +#include "Sazabi.h" + +#include "MainFrm.h" +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +int MY_WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) +{ + int nReturnCode = -1; + CWinThread* pThread = AfxGetThread(); + CWinApp* pApp = AfxGetApp(); + if (!AfxWinInit(hInstance, hPrevInstance, lpCmdLine, nCmdShow)) + { + AfxWinTerm(); + return -1; + } + + if (pApp != NULL) + { + if (!pApp->InitApplication()) + { + AfxWinTerm(); + return -1; + } + } + + if (!pThread->InitInstance()) + { + if (pThread->m_pMainWnd) + { + pThread->m_pMainWnd->DestroyWindow(); + } + nReturnCode = pThread->ExitInstance(); + AfxWinTerm(); + return nReturnCode; + } + + nReturnCode = pThread->Run(); + AfxWinTerm(); + return nReturnCode; +} + + +int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) +{ + +#ifdef _DEBUG + ::_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF); +#endif + 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); + } + } + setlocale(LC_ALL, "Japanese"); + + int nRet = 0; + CString strCommandLineData; + strCommandLineData = ::GetCommandLine(); + if (strCommandLineData.Find(_T("--type=")) > 0) + { +#if CHROME_VERSION_MAJOR < 112 + CefEnableHighDPISupport(); +#endif + CefMainArgs mainargs(hInstance); + void* sandbox_info = NULL; + if (strCommandLineData.Find(_T("--type=renderer")) > 0) + { + CefRefPtr app; + app = new AppRenderer(); + int exitCode = CefExecuteProcess(mainargs, app.get(), sandbox_info); + if (exitCode >= 0) + { + return exitCode; + } + } + int exit_code = CefExecuteProcess(mainargs, nullptr, sandbox_info); + if (exit_code >= 0) + { + return exit_code; + } + } + nRet = MY_WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow); + return nRet; +} +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Sazabi.cpp b/Sazabi.cpp index b39ba50..bc00842 100644 --- a/Sazabi.cpp +++ b/Sazabi.cpp @@ -5065,97 +5065,3 @@ void CAboutDlg::OnBnClickedCefVersion() ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -int MY_WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) -{ - int nReturnCode = -1; - CWinThread* pThread = AfxGetThread(); - CWinApp* pApp = AfxGetApp(); - if (!AfxWinInit(hInstance, hPrevInstance, lpCmdLine, nCmdShow)) - { - AfxWinTerm(); - return -1; - } - - if (pApp != NULL) - { - if (!pApp->InitApplication()) - { - AfxWinTerm(); - return -1; - } - } - - if (!pThread->InitInstance()) - { - if (pThread->m_pMainWnd) - { - pThread->m_pMainWnd->DestroyWindow(); - } - nReturnCode = pThread->ExitInstance(); - AfxWinTerm(); - return nReturnCode; - } - - nReturnCode = pThread->Run(); - AfxWinTerm(); - return nReturnCode; -} - -int AFXAPI AfxWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) -{ - -#ifdef _DEBUG - ::_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF | _CRTDBG_ALLOC_MEM_DF); -#endif - 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); - } - } - setlocale(LC_ALL, "Japanese"); - - int nRet = 0; - CString strCommandLineData; - strCommandLineData = ::GetCommandLine(); - if (strCommandLineData.Find(_T("--type=")) > 0) - { -#if CHROME_VERSION_MAJOR < 112 - CefEnableHighDPISupport(); -#endif - CefMainArgs mainargs(hInstance); - void* sandbox_info = NULL; - if (strCommandLineData.Find(_T("--type=renderer")) > 0) - { - CefRefPtr app; - app = new AppRenderer(); - int exitCode = CefExecuteProcess(mainargs, app.get(), sandbox_info); - if (exitCode >= 0) - { - return exitCode; - } - } - int exit_code = CefExecuteProcess(mainargs, nullptr, sandbox_info); - if (exit_code >= 0) - { - return exit_code; - } - } - nRet = MY_WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow); - return nRet; -} -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Sazabi.rc b/Sazabi.rc index b5a98c0..30bb3a4 100644 --- a/Sazabi.rc +++ b/Sazabi.rc @@ -2322,7 +2322,7 @@ BEGIN IDS_STRING_CEF_LOCALE "en" IDS_STRING_CEF_ACCEPT_LANGUAGE_LIST "en-US" IDS_STRING_PROPRIETARY_CODEC_LICENSES - "\n\nAVC\nTHIS PRODUCT IS LICENSED UNDER THE\nAVC PATENT PORTFOLIO LICENSE FOR THE PERSONAL USE OF A\nCONSUMER OR OTHER USES IN WHICH IT DOES NOT RECEIVE\nREMUNERATION TO (i) ENCODE VIDEO IN COMPLIANCE WITH THE\nAVC STANDARD (“AVC VIDEO”) AND/OR (ii) DECODE AVC VIDEO\nTHAT WAS ENCODED BY A CONSUMER ENGAGED IN A PERSONAL\nACTIVITY AND/OR WAS OBTAINED FROM A VIDEO PROVIDER\nLICENSED TO PROVIDE AVC VIDEO. NO LICENSE IS GRANTED OR\nSHALL BE IMPLIED FOR ANY OTHER USE. ADDITIONAL\nINFORMATION MAY BE OBTAINED FROM MPEG LA, L.L.C. SEE\nHTTP://WWW.MPEGLA.COM" + "\n\nAVC\nTHIS PRODUCT IS LICENSED UNDER THE\nAVC PATENT PORTFOLIO LICENSE FOR THE PERSONAL USE OF A\nCONSUMER OR OTHER USES IN WHICH IT DOES NOT RECEIVE\nREMUNERATION TO (i) ENCODE VIDEO IN COMPLIANCE WITH THE\nAVC STANDARD (“AVC VIDEOE AND/OR (ii) DECODE AVC VIDEO\nTHAT WAS ENCODED BY A CONSUMER ENGAGED IN A PERSONAL\nACTIVITY AND/OR WAS OBTAINED FROM A VIDEO PROVIDER\nLICENSED TO PROVIDE AVC VIDEO. NO LICENSE IS GRANTED OR\nSHALL BE IMPLIED FOR ANY OTHER USE. ADDITIONAL\nINFORMATION MAY BE OBTAINED FROM MPEG LA, L.L.C. SEE\nHTTP://WWW.MPEGLA.COM" END STRINGTABLE diff --git a/Sazabi.sln b/Sazabi.sln index efd684f..aef9ed6 100644 --- a/Sazabi.sln +++ b/Sazabi.sln @@ -5,20 +5,50 @@ VisualStudioVersion = 16.0.31605.320 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sazabi", "Sazabi.vcxproj", "{83410426-0B15-352C-4BC5-CCD2A7EF1930}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SazabiSpec", "test\SazabiSpec\SazabiSpec.vcxproj", "{80871372-2D7E-43AF-9EBB-B6A77ED3BE21}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution D64_CSG|Win32 = D64_CSG|Win32 D64_CSG|x64 = D64_CSG|x64 + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 R64_CSG|Win32 = R64_CSG|Win32 R64_CSG|x64 = R64_CSG|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {83410426-0B15-352C-4BC5-CCD2A7EF1930}.D64_CSG|Win32.ActiveCfg = D64_CSG|Win32 {83410426-0B15-352C-4BC5-CCD2A7EF1930}.D64_CSG|Win32.Build.0 = D64_CSG|Win32 {83410426-0B15-352C-4BC5-CCD2A7EF1930}.D64_CSG|x64.ActiveCfg = D64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Debug|Win32.ActiveCfg = D64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Debug|Win32.Build.0 = D64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Debug|x64.ActiveCfg = R64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Debug|x64.Build.0 = R64_CSG|Win32 {83410426-0B15-352C-4BC5-CCD2A7EF1930}.R64_CSG|Win32.ActiveCfg = R64_CSG|Win32 {83410426-0B15-352C-4BC5-CCD2A7EF1930}.R64_CSG|Win32.Build.0 = R64_CSG|Win32 {83410426-0B15-352C-4BC5-CCD2A7EF1930}.R64_CSG|x64.ActiveCfg = R64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|Win32.ActiveCfg = R64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|Win32.Build.0 = R64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|x64.ActiveCfg = R64_CSG|Win32 + {83410426-0B15-352C-4BC5-CCD2A7EF1930}.Release|x64.Build.0 = R64_CSG|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|Win32.ActiveCfg = Debug|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|Win32.Build.0 = Debug|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|x64.ActiveCfg = Debug|x64 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.D64_CSG|x64.Build.0 = Debug|x64 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|Win32.ActiveCfg = Debug|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|Win32.Build.0 = Debug|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|x64.ActiveCfg = Release|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Debug|x64.Build.0 = Release|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.R64_CSG|Win32.ActiveCfg = Release|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.R64_CSG|Win32.Build.0 = Release|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.R64_CSG|x64.ActiveCfg = Release|x64 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.R64_CSG|x64.Build.0 = Release|x64 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Release|Win32.ActiveCfg = Release|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Release|Win32.Build.0 = Release|Win32 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Release|x64.ActiveCfg = Release|x64 + {80871372-2D7E-43AF-9EBB-B6A77ED3BE21}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Sazabi.vcxproj b/Sazabi.vcxproj index 482f3f8..acc6ad8 100644 --- a/Sazabi.vcxproj +++ b/Sazabi.vcxproj @@ -188,6 +188,7 @@ + diff --git a/Sazabi.vcxproj.filters b/Sazabi.vcxproj.filters index 93eb447..6d816b6 100644 --- a/Sazabi.vcxproj.filters +++ b/Sazabi.vcxproj.filters @@ -56,6 +56,9 @@ DLG + + SB + diff --git a/test/SazabiSpec/SazabiSpec.vcxproj b/test/SazabiSpec/SazabiSpec.vcxproj new file mode 100644 index 0000000..8806288 --- /dev/null +++ b/test/SazabiSpec/SazabiSpec.vcxproj @@ -0,0 +1,150 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {80871372-2d7e-43af-9ebb-b6a77ed3be21} + Win32Proj + 10.0.22000.0 + DynamicLibrary + v142 + Unicode + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + {83410426-0b15-352c-4bc5-ccd2a7ef1930} + + + + + + + + + + Use + pch.h + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + Level3 + + + true + Console + C:\gitdir\Chronos\ChronosDebug\*.obj;%(AdditionalDependencies) + + + xcopy /Y $(SolutionDir)lib $(ProjectDir)lib\ + + + + + move $(SolutionDir)ChronosDebug\Main.obj.backup $(SolutionDir)ChronosDebug\Main.obj + + + move $(SolutionDir)ChronosDebug\Main.obj $(SolutionDir)ChronosDebug\Main.obj.backup + + + + + Use + pch.h + Disabled + X64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + Level3 + + + true + Console + + + + + Use + pch.h + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Level3 + ProgramDatabase + + + true + Console + true + true + C:\gitdir\Chronos\ChronosRelease\*.obj;$(MSBuildThisFileDirectory)..\..\lib\native\v140\windesktop\msvcstl\static\rt-static\x86\Release\gtest_main.lib;%(AdditionalDependencies) + + + xcopy /Y $(SolutionDir)rlib $(ProjectDir)rlib\ + + + move $(SolutionDir)ChronosRelease\Main.obj.backup $(SolutionDir)ChronosRelease\Main.obj + + + move $(SolutionDir)ChronosRelease\Main.obj $(SolutionDir)ChronosRelease\Main.obj.backup + + + + + Use + pch.h + X64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + MultiThreaded + Level3 + ProgramDatabase + + + true + Console + true + true + + + + + ã“ã®ãƒ—ロジェクトã¯ã€ã“ã®ã‚³ãƒ³ãƒ”ューター上ã«ãªã„ NuGet パッケージをå‚ç…§ã—ã¦ã„ã¾ã™ã€‚ãれらã®ãƒ‘ッケージをダウンロードã™ã‚‹ã«ã¯ã€[NuGet パッケージã®å¾©å…ƒ] を使用ã—ã¾ã™ã€‚詳細ã«ã¤ã„ã¦ã¯ã€http://go.microsoft.com/fwlink/?LinkID=322105 ã‚’å‚ç…§ã—ã¦ãã ã•ã„。見ã¤ã‹ã‚‰ãªã„ファイル㯠{0} ã§ã™ã€‚ + + + + \ No newline at end of file diff --git a/test/SazabiSpec/SazabiSpec.vcxproj.filters b/test/SazabiSpec/SazabiSpec.vcxproj.filters new file mode 100644 index 0000000..b3891a6 --- /dev/null +++ b/test/SazabiSpec/SazabiSpec.vcxproj.filters @@ -0,0 +1,20 @@ + + + + + + SB + + + + + + + + + + + {c5c91dca-edee-4831-ad5d-3dc17466180b} + + + \ No newline at end of file diff --git a/test/SazabiSpec/packages.config b/test/SazabiSpec/packages.config new file mode 100644 index 0000000..2d66f74 --- /dev/null +++ b/test/SazabiSpec/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/test/SazabiSpec/pch.cpp b/test/SazabiSpec/pch.cpp new file mode 100644 index 0000000..bc31a45 --- /dev/null +++ b/test/SazabiSpec/pch.cpp @@ -0,0 +1,5 @@ +// +// pch.cpp +// + +#include "pch.h" diff --git a/test/SazabiSpec/pch.h b/test/SazabiSpec/pch.h new file mode 100644 index 0000000..17f8dfa --- /dev/null +++ b/test/SazabiSpec/pch.h @@ -0,0 +1,7 @@ +// +// pch.h +// + +#pragma once + +#include "gtest/gtest.h" diff --git a/test/SazabiSpec/test_sbcommon.cpp b/test/SazabiSpec/test_sbcommon.cpp new file mode 100644 index 0000000..8c213a9 --- /dev/null +++ b/test/SazabiSpec/test_sbcommon.cpp @@ -0,0 +1,14 @@ +#include "pch.h" +#include "..\..\StdAfx.h" +#include "..\..\sbcommon.h" + +TEST(Test_Sbcommon, CLogDispatcher_GetOpStr) +{ + CLogDispatcher clogDispatcher; + EXPECT_EQ(clogDispatcher.GetOpStr(LOG_UPLOAD), _T("upload")); + EXPECT_EQ(clogDispatcher.GetOpStr(LOG_DOWNLOAD), _T("download")); + EXPECT_EQ(clogDispatcher.GetOpStr(LOG_BROWSING), _T("browsing")); + EXPECT_EQ(clogDispatcher.GetOpStr(LOG_M_GET), _T("upload")); + EXPECT_EQ(clogDispatcher.GetOpStr(LOG_M_POST), _T("download")); + EXPECT_EQ(clogDispatcher.GetOpStr(-1), _T("download")); +} \ No newline at end of file