//===----------------------------------------------------------------------===//
#include "llvm/Support/Allocator.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/WindowsError.h"
#include <malloc.h>
// The Windows.h header must be after LLVM and standard headers.
return std::string(Res.data());
}
+static error_code windows_error(DWORD E) {
+ return mapWindowsError(E);
+}
+
error_code
Process::GetArgumentVector(SmallVectorImpl<const char *> &Args,
ArrayRef<const char *>,
HCRYPTPROV HCPC;
if (!::CryptAcquireContextW(&HCPC, NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT))
- assert(false && "Could not acquire a cryptographic context");
+ report_fatal_error("Could not acquire a cryptographic context");
ScopedCryptContext CryptoProvider(HCPC);
unsigned Ret;
if (!::CryptGenRandom(CryptoProvider, sizeof(Ret),
reinterpret_cast<BYTE *>(&Ret)))
- assert(false && "Could not generate a random number");
+ report_fatal_error("Could not generate a random number");
return Ret;
}