作为最流行的C++密钥库,crypto++的文档并不友善
至少我找了一圈,发现最好用的还是其自带的测试
但是在我的环境,测试并不能正常运行,报异常“无法定位GetOverlappedResultEx于动态链接库kernel32.dll上”。
查看kernel32.dll,确实不存在GetOverlappedResultEx,而是有GetOverlappedResult——版本问题
在源代码中查找GetOverlappedResultEx,发现只存在于winpipes.cpp
#if defined(USE_WINDOWS8_API) BOOL result = GetOverlappedResultEx(h, &m_overlapped, &m_lastResult, INFINITE, FALSE); CheckAndHandleError("GetOverlappedResultEx", result); #else BOOL result = GetOverlappedResult(h, &m_overlapped, &m_lastResult, FALSE); CheckAndHandleError("GetOverlappedResult", result); #endif
USE_WINDOWS8_API宏也在这个文件
// Windows 8, Windows Server 2012, and Windows Phone 8.1 need <synchapi.h> and <ioapiset.h> #if defined(CRYPTOPP_WIN32_AVAILABLE) # if ((WINVER >= 0x0602 /*_WIN32_WINNT_WIN8*/) || (_WIN32_WINNT >= 0x0602 /*_WIN32_WINNT_WIN8*/)) # include <synchapi.h> # include <ioapiset.h> # define USE_WINDOWS8_API # endif #endif
呵呵