summaryrefslogtreecommitdiff
path: root/dll.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-11 19:46:28 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-07-11 19:46:28 +0000
commit016d97e9eca4a17fd96d575f7b570029848423f7 (patch)
treead2be593c944d2acdd84b110074c0f9401b82aa1 /dll.cpp
parentb4a86556710cc5933a2b67458f957eee2056fe18 (diff)
downloadcryptopp-016d97e9eca4a17fd96d575f7b570029848423f7.tar.gz
fix for Unix
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@93 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'dll.cpp')
-rw-r--r--dll.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/dll.cpp b/dll.cpp
index d8638a9..63d5427 100644
--- a/dll.cpp
+++ b/dll.cpp
@@ -6,7 +6,9 @@
#include "dll.h"
#pragma warning(default: 4660)
+#ifdef CRYPTOPP_WIN32_AVAILABLE
#include <windows.h>
+#endif
#include "iterhash.cpp"
#include "strciphr.cpp"
@@ -23,13 +25,19 @@ template<> const byte PKCS_DigestDecoration<SHA>::decoration[] = {0x30,0x21,0x30
template<> const unsigned int PKCS_DigestDecoration<SHA>::length = sizeof(PKCS_DigestDecoration<SHA>::decoration);
static const byte s_moduleMac[CryptoPP::HMAC<CryptoPP::SHA1>::DIGESTSIZE] = "reserved for mac";
+#ifdef CRYPTOPP_WIN32_AVAILABLE
static HMODULE s_hModule = NULL;
+#endif
void DoDllPowerUpSelfTest()
{
+#ifdef CRYPTOPP_WIN32_AVAILABLE
char moduleFileName[MAX_PATH];
GetModuleFileNameA(s_hModule, moduleFileName, sizeof(moduleFileName));
CryptoPP::DoPowerUpSelfTest(moduleFileName, s_moduleMac);
+#else
+ throw NotImplemented("DoDllPowerUpSelfTest() only available on Windows");
+#endif
}
NAMESPACE_END