svnno****@sourc*****
svnno****@sourc*****
2011年 6月 15日 (水) 23:14:18 JST
Revision: 4502 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4502 Author: maya Date: 2011-06-15 23:14:18 +0900 (Wed, 15 Jun 2011) Log Message: ----------- MS11-025 ãæ´æ°ãããã®ã§ r4497 ã revert Modified Paths: -------------- trunk/teraterm/common/stdafx.cpp -------------- next part -------------- Modified: trunk/teraterm/common/stdafx.cpp =================================================================== --- trunk/teraterm/common/stdafx.cpp 2011-06-15 12:42:24 UTC (rev 4501) +++ trunk/teraterm/common/stdafx.cpp 2011-06-15 14:14:18 UTC (rev 4502) @@ -1,47 +1,2 @@ #include "stdafx.h" - -// Visual Studio ª MS11-025 KpÏÝÅ MFC ªX^eBbNNÌê -// http://club.pep.ne.jp/~hiroki.o/visualcpp/ms11-025_problem.htm -// http://tedwvc.wordpress.com/2011/04/16/fixing-problems-with-findactctxsectionstring-in-mfc-security-updates/ - -#undef FindActCtxSectionString -#define FindActCtxSectionString MyFindActCtxSectionString - -#ifdef _UNICODE -#define _FINDACTCTXSECTIONSTRING "FindActCtxSectionStringW" -#else -#define _FINDACTCTXSECTIONSTRING "FindActCtxSectionStringA" -#endif - -typedef BOOL (WINAPI * PFN_FINDAC)(DWORD dwFlags, const GUID *lpExtensionGuid,ULONG ulSectionId,LPCTSTR lpStringToFind,PACTCTX_SECTION_KEYED_DATA ReturnedData); - -BOOL WINAPI MyFindActCtxSectionString( - DWORD dwFlags, - const GUID *lpExtensionGuid, - ULONG ulSectionId, - LPCTSTR lpStringToFind, - PACTCTX_SECTION_KEYED_DATA ReturnedData) -{ - // Bug #1 - Windows 2000 - PFN_FINDAC pfnFindActCtxSectionString =NULL; - { - HINSTANCE hKernel32 = GetModuleHandle(_T("kernel32.dll")); - if (hKernel32 == NULL) - { - return FALSE; - } - - pfnFindActCtxSectionString = (PFN_FINDAC) GetProcAddress(hKernel32, _FINDACTCTXSECTIONSTRING); - - if (pfnFindActCtxSectionString == NULL) - { - /* pre-fusion OS, so no more checking.*/ - return FALSE; - } - } - - ReturnedData->cbSize = sizeof(ACTCTX_SECTION_KEYED_DATA); // Bug #2 - missing cbSize initializer - return pfnFindActCtxSectionString(/* dwFlags */ 0, // Bug #3 memory leak - pass in zero as return handle not freed - lpExtensionGuid, ulSectionId, lpStringToFind, ReturnedData); -}