aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rt/rust_dom.cpp19
-rw-r--r--src/rt/rust_util.h6
2 files changed, 3 insertions, 22 deletions
diff --git a/src/rt/rust_dom.cpp b/src/rt/rust_dom.cpp
index 205084ff..81751a86 100644
--- a/src/rt/rust_dom.cpp
+++ b/src/rt/rust_dom.cpp
@@ -154,25 +154,6 @@ rust_dom::free(void *p) {
srv->free(p);
}
-#ifdef __WIN32__
-void
-rust_dom::win32_require(LPCTSTR fn, BOOL ok) {
- if (!ok) {
- LPTSTR buf;
- DWORD err = GetLastError();
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL, err,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPTSTR) &buf, 0, NULL );
- log(rust_log::ERR, "%s failed with error %ld: %s", fn, err, buf);
- LocalFree((HLOCAL)buf);
- I(this, ok);
- }
-}
-#endif
-
size_t
rust_dom::n_live_tasks()
{
diff --git a/src/rt/rust_util.h b/src/rt/rust_util.h
index 95010f17..42082119 100644
--- a/src/rt/rust_util.h
+++ b/src/rt/rust_util.h
@@ -127,15 +127,15 @@ isaac_init(rust_dom *dom, randctx *rctx)
#ifdef __WIN32__
{
HCRYPTPROV hProv;
- win32_require
+ dom->win32_require
(_T("CryptAcquireContext"),
CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT|CRYPT_SILENT));
- win32_require
+ dom->win32_require
(_T("CryptGenRandom"),
CryptGenRandom(hProv, sizeof(rctx->randrsl),
(BYTE*)(&rctx->randrsl)));
- win32_require
+ dom->win32_require
(_T("CryptReleaseContext"),
CryptReleaseContext(hProv, 0));
}