From 52dd06a9fea189b15e3dfe2a1085c64c9945fa43 Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Fri, 16 Feb 2018 18:20:09 -0800 Subject: [PATCH] Upgrade to winapi-0.3 --- Cargo.toml | 3 +-- src/imp/cryptoapi.rs | 9 +++++---- src/lib.rs | 2 -- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7315c3c5f..b268eccf9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,8 +24,7 @@ hex = "0.3" commoncrypto = "0.2" [target.'cfg(target_os = "windows")'.dependencies] -advapi32-sys = "0.2" -winapi = "0.2" +winapi = { version = "0.3", features = ["minwindef", "wincrypt"] } [target.'cfg(not(any(target_os = "windows", target_os = "macos")))'.dependencies] openssl = "0.10" diff --git a/src/imp/cryptoapi.rs b/src/imp/cryptoapi.rs index e595aa4d9..47d95095a 100644 --- a/src/imp/cryptoapi.rs +++ b/src/imp/cryptoapi.rs @@ -24,13 +24,14 @@ //! https://github.com/rust-lang/cargo/blob/0.10.0/src/cargo/util/sha256.rs //! which is copyright (c) 2014 The Rust Project Developers under the MIT license. -use advapi32::{CryptAcquireContextW, CryptCreateHash, CryptDestroyHash, CryptGetHashParam, - CryptHashData, CryptReleaseContext}; use std::io; use std::ptr; use super::Algorithm; -use winapi::{CALG_MD5, CALG_SHA1, CALG_SHA_256, CALG_SHA_512, CRYPT_SILENT, CRYPT_VERIFYCONTEXT, - DWORD, HCRYPTHASH, HCRYPTPROV, HP_HASHVAL, PROV_RSA_AES}; +use winapi::shared::minwindef::DWORD; +use winapi::um::wincrypt::{CALG_MD5, CALG_SHA1, CALG_SHA_256, CALG_SHA_512, CryptAcquireContextW, + CryptCreateHash, CryptDestroyHash, CryptGetHashParam, CryptHashData, + CryptReleaseContext, CRYPT_SILENT, CRYPT_VERIFYCONTEXT, HCRYPTHASH, + HCRYPTPROV, HP_HASHVAL, PROV_RSA_AES}; macro_rules! call { ($e: expr) => ({ diff --git a/src/lib.rs b/src/lib.rs index 7bc8e301c..e01f7e786 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,8 +43,6 @@ #![warn(missing_docs)] -#[cfg(target_os = "windows")] -extern crate advapi32; #[cfg(target_os = "macos")] extern crate commoncrypto; extern crate hex;