Revisión | f7ffbeb6b8f90a1cb17fbcc0f22718cf41cd827c (tree) |
---|---|
Tiempo | 2012-03-25 17:21:44 |
Autor | qwerty2501 <qwerty2501@user...> |
Commiter | qwerty2501 |
IEクッキー取得実装途中
@@ -15,7 +15,7 @@ typedef void Void; | ||
15 | 15 | |
16 | 16 | typedef char Char; |
17 | 17 | |
18 | -typedef char Byte; | |
18 | +typedef unsigned char Byte; | |
19 | 19 | |
20 | 20 | typedef unsigned char UChar; |
21 | 21 |
@@ -1,7 +1,7 @@ | ||
1 | 1 | #pragma once |
2 | 2 | |
3 | 3 | |
4 | -#include <stdexcept> | |
4 | + | |
5 | 5 | #include "define.h" |
6 | 6 | #include "windowsAPI.h" |
7 | 7 | #include "bugreport.h" |
@@ -1,7 +1,7 @@ | ||
1 | 1 | #pragma once |
2 | 2 | |
3 | -#include "nexception.h" | |
4 | -#include <boost\utility.hpp> | |
3 | + | |
4 | + | |
5 | 5 | #include "namespace_start.h" |
6 | 6 | template<typename T,typename H> |
7 | 7 | class RAIIT:public boost::noncopyable{ |
@@ -45,12 +45,6 @@ public: | ||
45 | 45 | |
46 | 46 | } |
47 | 47 | |
48 | - Void Dispose(){ | |
49 | - | |
50 | - THROW_EXCEPTION(Exception,_T("RAIIが実装されていません")); | |
51 | - | |
52 | - } | |
53 | - | |
54 | 48 | |
55 | 49 | |
56 | 50 | }; |
@@ -23,4 +23,6 @@ | ||
23 | 23 | #include <regex> |
24 | 24 | #include <array> |
25 | 25 | #include <boost\test\unit_test.hpp> |
26 | -#include <boost\lexical_cast.hpp> | |
\ No newline at end of file | ||
26 | +#include <boost\lexical_cast.hpp> | |
27 | +#include <boost\utility.hpp> | |
28 | +#include <stdexcept> | |
\ No newline at end of file |
@@ -256,6 +256,10 @@ const NString &GetWindowsVersion(){ | ||
256 | 256 | |
257 | 257 | |
258 | 258 | |
259 | + | |
260 | +// | |
261 | +//HRESULT 管理クラス | |
262 | +/////////////////////////////////////////////////////////////////// | |
259 | 263 | CHResult::CHResult(){} |
260 | 264 | |
261 | 265 | CHResult::CHResult(HRESULT hResult):m_hResult(hResult){} |
@@ -294,6 +298,83 @@ Bool operator==(const CHResult &result,HRESULT hResult){ | ||
294 | 298 | return hResult == result.m_hResult; |
295 | 299 | } |
296 | 300 | |
301 | + | |
302 | + // | |
303 | + //HKEY管理クラス | |
304 | + /////////////////////////////////////////////////// | |
305 | + | |
306 | + Void CRegistryKey::Dispose(){ | |
307 | + | |
308 | + RegCloseKey( m_handle); | |
309 | + m_handle = nullptr; | |
310 | + } | |
311 | + | |
312 | + CHResult CRegistryKey::OpenKey(HKEY hkey,const NString &subKeystr,DWORD options,REGSAM samDesired){ | |
313 | + | |
314 | + return RegOpenKeyEx(hkey,subKeystr.c_str(),options,samDesired,&m_handle); | |
315 | + } | |
316 | + | |
317 | + CHResult CRegistryKey::QueryValue(const NString &valueName,NString &val,LPDWORD lpType,LPDWORD lpReserved){ | |
318 | + | |
319 | + ValueList valList; | |
320 | + CHResult hresult = QueryValue(valueName,valList); | |
321 | + | |
322 | + val = reinterpret_cast<const NChar*>(*valList.data()); | |
323 | + | |
324 | + return hresult; | |
325 | + | |
326 | + | |
327 | + } | |
328 | + | |
329 | +CHResult CRegistryKey::QueryValue(const NString &valueName,Int &val,LPDWORD lpType,LPDWORD lpReserved){ | |
330 | + | |
331 | + ValueList valList; | |
332 | + CHResult hresult = QueryValue(valueName,valList); | |
333 | + | |
334 | + val = *reinterpret_cast<const Int*>(valList.data()); | |
335 | + | |
336 | + return hresult; | |
337 | +} | |
338 | + | |
339 | + CHResult CRegistryKey::QueryValue(const NString &valueName,ValueList &valueList,LPDWORD lpType,LPDWORD lpReserved){ | |
340 | + | |
341 | + DWORD data; | |
342 | + RegQueryValueEx(m_handle,valueName.c_str(),lpReserved,lpType,nullptr,&data); | |
343 | + | |
344 | + | |
345 | + | |
346 | + valueList.resize(data); | |
347 | + | |
348 | + | |
349 | + return RegQueryValueEx(m_handle,valueName.c_str(),lpReserved,lpType,&valueList[0],&data); | |
350 | + } | |
351 | + | |
352 | + CRegistryKey::operator HKEY(){ | |
353 | + | |
354 | + return m_handle; | |
355 | + | |
356 | + } | |
357 | + | |
358 | + | |
359 | + Void CFindFirstFile::Dispose(){ | |
360 | + | |
361 | + FindClose(m_handle); | |
362 | + m_handle = nullptr; | |
363 | + } | |
364 | + | |
365 | + Bool CFindFirstFile::NextFile(WIN32_FIND_DATA &findData){ | |
366 | + | |
367 | + return FindNextFile(m_handle,&findData); | |
368 | + } | |
369 | + | |
370 | +HANDLE CFindFirstFile::Find(const NString &fileName,WIN32_FIND_DATA &findData){ | |
371 | + | |
372 | + | |
373 | + m_handle = FindFirstFile(fileName.c_str(),&findData); | |
374 | + | |
375 | + return m_handle; | |
376 | +} | |
377 | + | |
297 | 378 | Void GetWindowsErrorMessage(NString &buf,DWORD lastErrorCode){ |
298 | 379 | |
299 | 380 | NChar *lpMsgBuf; |
@@ -321,7 +402,7 @@ Bool NDeleteFile(const NString &fileName){ | ||
321 | 402 | |
322 | 403 | |
323 | 404 | |
324 | -static Bool GetGetFolderPath(Int dil,NString &dir){ | |
405 | +static Bool GetFolderPath(Int dil,NString &dir){ | |
325 | 406 | |
326 | 407 | NChar buffer[_MAX_PATH]; |
327 | 408 | CHResult result = SHGetFolderPath(0,dil,0,SHGFP_TYPE_CURRENT,buffer); |
@@ -332,17 +413,22 @@ static Bool GetGetFolderPath(Int dil,NString &dir){ | ||
332 | 413 | |
333 | 414 | Bool GetAppLocalDataDirectry(NString &dir){ |
334 | 415 | |
335 | - return GetGetFolderPath(CSIDL_LOCAL_APPDATA,dir); | |
416 | + return GetFolderPath(CSIDL_LOCAL_APPDATA,dir); | |
336 | 417 | |
337 | 418 | } |
338 | 419 | Bool GetAppDataDirectry(NString &dir){ |
339 | 420 | |
340 | - return GetGetFolderPath(CSIDL_APPDATA,dir); | |
421 | + return GetFolderPath(CSIDL_APPDATA,dir); | |
422 | +} | |
423 | + | |
424 | +Bool GetCookieDirectry(NString &dir){ | |
425 | + | |
426 | + return GetFolderPath(CSIDL_COOKIES,dir); | |
341 | 427 | } |
342 | 428 | |
343 | 429 | Bool GetTempDirectry(NString &dir){ |
344 | 430 | |
345 | - return GetGetFolderPath(CSIDL_TEMPLATES,dir); | |
431 | + return GetFolderPath(CSIDL_TEMPLATES,dir); | |
346 | 432 | } |
347 | 433 | |
348 | 434 |
@@ -3,7 +3,7 @@ | ||
3 | 3 | #include <Windows.h> |
4 | 4 | #include "unit_test.h" |
5 | 5 | #include "define.h" |
6 | - | |
6 | +#include "raii.h" | |
7 | 7 | |
8 | 8 | #include "namespace_start.h" |
9 | 9 |
@@ -44,6 +44,47 @@ static_assert(sizeof(CHResult) <= 4,"CHResult size error"); | ||
44 | 44 | |
45 | 45 | |
46 | 46 | |
47 | +/// | |
48 | +///レジストリキークラス | |
49 | +/// | |
50 | +class CRegistryKey:public RAIIT<CRegistryKey,HKEY>{ | |
51 | + | |
52 | +public: | |
53 | + typedef std::vector<Byte> ValueList; | |
54 | + Void Dispose(); | |
55 | + | |
56 | + CHResult OpenKey(HKEY hkey,const NString &subKeystr,DWORD options = 0,REGSAM samDesired = KEY_READ); | |
57 | + | |
58 | + | |
59 | + CHResult QueryValue(const NString &valueName,NString &val,LPDWORD lpType = nullptr,LPDWORD lpReserved = nullptr); | |
60 | + | |
61 | + CHResult QueryValue(const NString &valueName,Int &val,LPDWORD lpType = nullptr,LPDWORD lpReserved = nullptr); | |
62 | +private: | |
63 | + | |
64 | + CHResult QueryValue(const NString &valueName,ValueList &valueList,LPDWORD lpType = nullptr,LPDWORD lpReserved = nullptr); | |
65 | + | |
66 | + | |
67 | + operator HKEY(); | |
68 | + | |
69 | +}; | |
70 | + | |
71 | + | |
72 | + | |
73 | +/// | |
74 | +///ファインドファーストファイル | |
75 | +/// | |
76 | +class CFindFirstFile:public RAIIT<CFindFirstFile,HANDLE>{ | |
77 | + | |
78 | + | |
79 | +public: | |
80 | + Void Dispose(); | |
81 | + | |
82 | + Bool NextFile(WIN32_FIND_DATA &findData); | |
83 | + | |
84 | + HANDLE Find(const NString &fileName,WIN32_FIND_DATA &findData); | |
85 | + | |
86 | + | |
87 | +}; | |
47 | 88 | |
48 | 89 | |
49 | 90 | /// |
@@ -65,6 +106,8 @@ extern Bool GetAppLocalDataDirectry(NString &dir); | ||
65 | 106 | |
66 | 107 | extern Bool GetAppDataDirectry(NString &dir); |
67 | 108 | |
109 | +extern Bool GetCookieDirectry(NString &dir); | |
110 | + | |
68 | 111 | extern Bool GetTempDirectry(NString &dir); |
69 | 112 | |
70 | 113 |
@@ -54,7 +54,7 @@ Bool CChromeCookieGetter::Fancta(const Byte * data,ULong dataSize,const NString | ||
54 | 54 | |
55 | 55 | MString searchString; |
56 | 56 | ToUTF8(searchString,domein+name); |
57 | - const Byte *startPointer = memmem(data,dataSize,searchString.c_str(),searchString.size()) +searchString.size() ; | |
57 | + const Char *startPointer = reinterpret_cast<const Char*>(memmem(data,dataSize,searchString.c_str(),searchString.size()) +searchString.size()) ; | |
58 | 58 | |
59 | 59 | U16String cookieValue; |
60 | 60 | UTF8ToUTF16(cookieValue,startPointer,strstr(startPointer,"/") - startPointer); |
@@ -91,4 +91,8 @@ Bool ForceSearch(const NString &fileName,const NString &domein,const NString &na | ||
91 | 91 | return result; |
92 | 92 | } |
93 | 93 | |
94 | + | |
95 | + | |
96 | + | |
97 | + | |
94 | 98 | #include "namespace_end.h" |
\ No newline at end of file |
@@ -22,6 +22,8 @@ namespace resultcode{ | ||
22 | 22 | enum ResultCode:Byte{ |
23 | 23 | OK = 0, |
24 | 24 | ERR_SQLITE = 1, |
25 | + ERR_IEAPI = 2, | |
26 | + ERR_IEAPI_SEC = 3, | |
25 | 27 | UNDEFINED = 127 |
26 | 28 | }; |
27 | 29 | } |
@@ -75,7 +75,7 @@ Bool CFireFoxCookieGetter::Fancta(const Byte * data,ULong dataSize,const NString | ||
75 | 75 | ToUTF8(mdomein,_T(".") + domein); |
76 | 76 | ToUTF8(startdomeinname,domein+name); |
77 | 77 | |
78 | - const Byte * startPointer = memmem(data,dataSize,startdomeinname.c_str(),startdomeinname.size())+ startdomeinname.size(); | |
78 | + const Char * startPointer = reinterpret_cast<const Char*>(memmem(data,dataSize,startdomeinname.c_str(),startdomeinname.size())+ startdomeinname.size()); | |
79 | 79 | |
80 | 80 | if(startPointer != nullptr){ |
81 | 81 | U16String cookieValue; |
@@ -0,0 +1,121 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +#include <nlite_common\define.h> | |
4 | +#include <nlite_common\windowsAPI.h> | |
5 | +#include <iepmapi.h> | |
6 | +#include <WinInet.h> | |
7 | +#include "cookieGetter.h" | |
8 | + | |
9 | + | |
10 | +#include "namespace_start.h" | |
11 | +template<typename T> | |
12 | +class CIEAPICookieGetterT:public CCookieGetterT<T>{ | |
13 | + | |
14 | +protected : | |
15 | + NString normalDirectry; | |
16 | + | |
17 | +public: | |
18 | + | |
19 | + CIEAPICookieGetterT(){ | |
20 | + | |
21 | + GetCookieDirectry(normalDirectry); | |
22 | + | |
23 | + } | |
24 | + | |
25 | +protected: | |
26 | + | |
27 | + | |
28 | + CCookieGetResult GetCookieIEAPI(const NString &domein,const NString &name,CCookie &cookie,Bool securytyFlag,DWORD flags = 0){ | |
29 | + | |
30 | + std::vector<NChar> buf; | |
31 | + buf.resize(4096); | |
32 | + CCookieGetResult result(BT); | |
33 | + DWORD dwCookieBufSize = buf.size(); | |
34 | + CHResult hresult; | |
35 | + NString url = _T("http://") + domein; | |
36 | + if(securytyFlag){ | |
37 | + | |
38 | + hresult = IEGetProtectedModeCookie(url.c_str(),name.c_str(),&buf[0],&dwCookieBufSize,flags); | |
39 | + | |
40 | + } else if(InternetGetCookie(url.c_str(),name.c_str(),&buf[0],&dwCookieBufSize)){ | |
41 | + | |
42 | + hresult = S_OK; | |
43 | + | |
44 | + } else { | |
45 | + | |
46 | + hresult = GetLastError(); | |
47 | + | |
48 | + } | |
49 | + | |
50 | + | |
51 | + if(hresult.IsSucceded()){ | |
52 | + | |
53 | + cookie.SetCookieValue(buf.data()); | |
54 | + result.SetFindFlag(true); | |
55 | + } else { | |
56 | + | |
57 | + | |
58 | + result.SetResultCode(securytyFlag ? resultcode::ERR_IEAPI_SEC : resultcode::ERR_IEAPI); | |
59 | + result.SetHResult(hresult); | |
60 | + | |
61 | + | |
62 | + } | |
63 | + | |
64 | + return result; | |
65 | + | |
66 | + } | |
67 | + | |
68 | +protected: | |
69 | + | |
70 | + static Bool Fancta(const Byte * data,ULong dataSize,const NString & domein,const NString &name,CCookie &cookie){ | |
71 | + | |
72 | + | |
73 | + return false; | |
74 | + } | |
75 | + | |
76 | + template<typename F> | |
77 | + CCookieGetResult ForceSearchFiles(const NString &cookieDir,const NString &domein,const NString &name,CCookie &cookie,F func){ | |
78 | + | |
79 | + CCookieGetResult result(BT); | |
80 | + CFindFirstFile findfirst; | |
81 | + NString searchFiles = cookieDir + _T("\\?*.txt"); | |
82 | + NString targetFileName; | |
83 | + WIN32_FIND_DATA findData; | |
84 | + | |
85 | + | |
86 | + | |
87 | + do{ | |
88 | + if(findfirst.Find(searchFiles,findData) != INVALID_HANDLE_VALUE)break; | |
89 | + | |
90 | + if((findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == false){ | |
91 | + | |
92 | + targetFileName = (cookieDir + _T("\\")) + findData.cFileName; | |
93 | + | |
94 | + if(ForceSearch(targetFileName,domein,name,cookie,func)){ | |
95 | + | |
96 | + result.SetFindFlag(true); | |
97 | + } | |
98 | + } | |
99 | + | |
100 | + }while(findfirst.NextFile(findData)); | |
101 | + | |
102 | + | |
103 | + | |
104 | + | |
105 | + return result; | |
106 | + } | |
107 | + | |
108 | + | |
109 | + | |
110 | + | |
111 | + | |
112 | + | |
113 | + | |
114 | + | |
115 | +}; | |
116 | + | |
117 | +#include "namespace_end.h" | |
118 | + | |
119 | + | |
120 | +#pragma comment(lib,"WinInet.lib") | |
121 | +#pragma comment(lib,"iepmapi.lib") | |
\ No newline at end of file |
@@ -0,0 +1,56 @@ | ||
1 | +#include "stdafx.h" | |
2 | +#include "iecookiegetter.h" | |
3 | + | |
4 | +#include "namespace_start.h" | |
5 | + | |
6 | +browsertype::BrowserType CIECookieGetter::BT = browsertype::IE; | |
7 | + | |
8 | + | |
9 | +CIECookieGetter::CIECookieGetter(){ | |
10 | + | |
11 | + securityCookiedir = this->normalDirectry + _T("\\Low"); | |
12 | +} | |
13 | + | |
14 | +Bool CIECookieGetter::GetCookieInternal(const NString &domein,const NString &name,CCookie &cookie){ | |
15 | + | |
16 | + NString url = _T("http://") + domein; | |
17 | + Bool secFlag = IEIsSecurityMode(); | |
18 | + CCookieGetResult result = this->GetCookieIEAPI(url,name,cookie,secFlag); | |
19 | + | |
20 | + if(result.GetResultCode() != resultcode::OK){ | |
21 | + | |
22 | + resultList.push_back(result); | |
23 | + | |
24 | + } | |
25 | + | |
26 | + | |
27 | + if(!result.IsFound()){ | |
28 | + | |
29 | + CIECookieGetter::ForceSearchFiles(secFlag ? this->securityCookiedir : this->normalDirectry,domein,name,cookie,CIECookieGetter::Fancta); | |
30 | + } | |
31 | + | |
32 | + return result.IsFound(); | |
33 | +} | |
34 | + | |
35 | +Bool CIECookieGetter::IEIsSecurityMode(){ | |
36 | + | |
37 | + CRegistryKey regkey; | |
38 | + if(!regkey.OpenKey(HKEY_CURRENT_USER,_T("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3")).IsS_OK()){ | |
39 | + | |
40 | + THROW_EXCEPTION(Exception,_T("レジストリキーが開けませんでした")); | |
41 | + } | |
42 | + | |
43 | + Int securityMode; | |
44 | + if(!regkey.QueryValue(_T("2500"),securityMode).IsS_OK()){ | |
45 | + | |
46 | + return false; | |
47 | + } | |
48 | + | |
49 | + | |
50 | + | |
51 | + return securityMode == 0; | |
52 | +} | |
53 | + | |
54 | + | |
55 | + | |
56 | +#include "namespace_end.h" | |
\ No newline at end of file |
@@ -0,0 +1,28 @@ | ||
1 | +#pragma once | |
2 | + | |
3 | +#include "ieapicookiegetter.h" | |
4 | + | |
5 | +#include "namespace_start.h" | |
6 | +class CIECookieGetter:public CIEAPICookieGetterT<CIECookieGetter>{ | |
7 | + friend Void UnitTest(); | |
8 | + | |
9 | +private: | |
10 | + NString securityCookiedir; | |
11 | + | |
12 | +public: | |
13 | + | |
14 | + CIECookieGetter(); | |
15 | + | |
16 | + | |
17 | + Bool GetCookieInternal(const NString &domein,const NString &name,CCookie &cookie); | |
18 | + | |
19 | + | |
20 | + | |
21 | + | |
22 | +private: | |
23 | + | |
24 | + static Bool IEIsSecurityMode(); | |
25 | + | |
26 | + | |
27 | +}; | |
28 | +#include "namespace_end.h" | |
\ No newline at end of file |
@@ -110,6 +110,8 @@ | ||
110 | 110 | <ClInclude Include="define.h" /> |
111 | 111 | <ClInclude Include="filecookiegetter.h" /> |
112 | 112 | <ClInclude Include="firefoxcookiegetter.h" /> |
113 | + <ClInclude Include="ieapicookiegetter.h" /> | |
114 | + <ClInclude Include="iecookiegetter.h" /> | |
113 | 115 | <ClInclude Include="namespace_end.h" /> |
114 | 116 | <ClInclude Include="namespace_start.h" /> |
115 | 117 | <ClInclude Include="sqlitecookiegetter.h" /> |
@@ -122,6 +124,7 @@ | ||
122 | 124 | <ClCompile Include="cookie.cpp" /> |
123 | 125 | <ClCompile Include="cookieGetResult.cpp" /> |
124 | 126 | <ClCompile Include="firefoxcookiegetter.cpp" /> |
127 | + <ClCompile Include="iecookiegetter.cpp" /> | |
125 | 128 | <ClCompile Include="stdafx.cpp"> |
126 | 129 | <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> |
127 | 130 | <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='UnitTest|Win32'">Create</PrecompiledHeader> |
@@ -60,6 +60,12 @@ | ||
60 | 60 | <ClInclude Include="firefoxcookiegetter.h"> |
61 | 61 | <Filter>ヘッダー ファイル</Filter> |
62 | 62 | </ClInclude> |
63 | + <ClInclude Include="ieapicookiegetter.h"> | |
64 | + <Filter>ヘッダー ファイル</Filter> | |
65 | + </ClInclude> | |
66 | + <ClInclude Include="iecookiegetter.h"> | |
67 | + <Filter>ヘッダー ファイル</Filter> | |
68 | + </ClInclude> | |
63 | 69 | </ItemGroup> |
64 | 70 | <ItemGroup> |
65 | 71 | <ClCompile Include="stdafx.cpp"> |
@@ -80,5 +86,8 @@ | ||
80 | 86 | <ClCompile Include="firefoxcookiegetter.cpp"> |
81 | 87 | <Filter>ソース ファイル</Filter> |
82 | 88 | </ClCompile> |
89 | + <ClCompile Include="iecookiegetter.cpp"> | |
90 | + <Filter>ソース ファイル</Filter> | |
91 | + </ClCompile> | |
83 | 92 | </ItemGroup> |
84 | 93 | </Project> |
\ No newline at end of file |
@@ -18,4 +18,4 @@ | ||
18 | 18 | #include <boost\test\unit_test.hpp> |
19 | 19 | #include <boost/format.hpp> |
20 | 20 | #include <boost\lexical_cast.hpp> |
21 | -#include <atlfile.h> | |
\ No newline at end of file | ||
21 | +#include <atlfile.h> |
@@ -5,6 +5,7 @@ | ||
5 | 5 | #include "cookie.h" |
6 | 6 | #include "chromecookiegetter.h" |
7 | 7 | #include "firefoxcookiegetter.h" |
8 | +#include "iecookiegetter.h" | |
8 | 9 | #include "cookieGetter.h" |
9 | 10 | #include "unit_test.h" |
10 | 11 |
@@ -146,6 +147,47 @@ Void UnitTest(){ | ||
146 | 147 | } |
147 | 148 | } |
148 | 149 | |
150 | + { | |
151 | + | |
152 | + CIECookieGetter::IEIsSecurityMode(); | |
153 | + | |
154 | + | |
155 | + CIECookieGetter cookieGetters; | |
156 | + Bool result; | |
157 | + exceptionflag = false; | |
158 | + NString domein = _T("nicovideo.jp"); | |
159 | + NString name = _T("user_session"); | |
160 | + try{ | |
161 | + | |
162 | + result = cookieGetters.GetCookie(domein,name,cookie); | |
163 | + | |
164 | + } catch(Exception &e3){ | |
165 | + e3; | |
166 | + exceptionflag = true; | |
167 | + } | |
168 | + | |
169 | + BOOST_CHECK_MESSAGE(exceptionflag == false,"クッキー検索中に例外が発生しました"); | |
170 | + BOOST_CHECK_MESSAGE(result == true,"クッキーが見つかりませんでした"); | |
171 | + | |
172 | + exceptionflag = true; | |
173 | + Bool result2 = false; | |
174 | + CCookie cookie2; | |
175 | + try{ | |
176 | + // result2 = ForceSearch(firefoxcookiegetter.cookieFilePath,domein,name,cookie2,CFireFoxCookieGetter::Fancta); | |
177 | + | |
178 | + | |
179 | + } catch(Exception &e3){ | |
180 | + e3; | |
181 | + exceptionflag = true; | |
182 | + } | |
183 | + | |
184 | + BOOST_CHECK_MESSAGE(result2 == true,"クッキーが見つかりませんでした"); | |
185 | + | |
186 | + if(result && result2){ | |
187 | + BOOST_CHECK_MESSAGE(cookie.GetCookieValue() == cookie2.GetCookieValue(),"正規の方法で取得したクッキーと強制検索で取得したクッキーが違います"); | |
188 | + } | |
189 | + | |
190 | + } | |
149 | 191 | return; |
150 | 192 | |
151 | 193 | } |
@@ -1,3 +1,5 @@ | ||
1 | +#include <Windows.h> | |
2 | +#include <boost\utility.hpp> | |
1 | 3 | #include "sqlitemanage.h" |
2 | 4 | #include <iostream> |
3 | 5 | #include <nlite_common\function.h> |