diff --git a/Cargo.toml b/Cargo.toml index a54d794e1..34366146c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,7 @@ headers = ["headers-shared", "headers-um", "headers-vc"] "shared-ntdef", "shared-ntstatus", "shared-rpcndr", + "shared-sspi", "shared-windef", "shared-wtypesbase" ] @@ -44,6 +45,7 @@ headers = ["headers-shared", "headers-um", "headers-vc"] "shared-ntdef" = ["shared-basetsd"] "shared-ntstatus" = ["shared-ntdef"] "shared-rpcndr" = [] +"shared-sspi" = ["shared-ntdef"] "shared-windef" = ["shared-minwindef", "um-winnt"] "shared-wtypesbase" = ["shared-minwindef", "shared-rpcndr", "um-winnt"] "headers-um" = [ @@ -51,6 +53,7 @@ headers = ["headers-shared", "headers-um", "headers-vc"] "um-combaseapi", "um-consoleapi", "um-minwinbase", + "um-ncrypt", "um-objidlbase", "um-unknwnbase", "um-wincon", @@ -61,6 +64,7 @@ headers = ["headers-shared", "headers-um", "headers-vc"] "um-combaseapi" = ["shared-basetsd", "shared-minwindef", "shared-wtypesbase", "um-objidlbase", "ole32"] "um-consoleapi" = ["shared-minwindef", "um-wincon", "um-winnt", "kernel32"] "um-minwinbase" = ["shared-ntstatus"] +"um-ncrypt" = ["shared-basetsd", "shared-sspi", "ncrypt"] "um-objidlbase" = ["shared-guiddef", "shared-minwindef", "shared-wtypesbase", "um-unknwnbase", "um-winnt"] "um-unknwnbase" = ["shared-guiddef", "shared-minwindef", "um-winnt"] "um-wincon" = ["shared-minwindef", "shared-windef", "um-minwinbase", "um-wingdi", "um-winnt", "kernel32"] @@ -74,7 +78,9 @@ headers = ["headers-shared", "headers-um", "headers-vc"] "vc-vcruntime" = [] libraries = [ "kernel32", + "ncrypt", "ole32" ] "kernel32" = [] "ole32" = [] +"ncrypt" = [] diff --git a/build.rs b/build.rs index 5a3d82be2..10b79d944 100644 --- a/build.rs +++ b/build.rs @@ -7,7 +7,8 @@ use std::env::var; const LIBS: &'static [&'static str] = &[ "kernel32", - "ole32" + "ncrypt", + "ole32", ]; fn main() { let target = var("TARGET").unwrap(); diff --git a/i686/lib/libncrypt.a b/i686/lib/libncrypt.a new file mode 100644 index 000000000..38becdd19 Binary files /dev/null and b/i686/lib/libncrypt.a differ diff --git a/src/shared/mod.rs b/src/shared/mod.rs index 1f529a354..566f06471 100644 --- a/src/shared/mod.rs +++ b/src/shared/mod.rs @@ -15,5 +15,6 @@ #[cfg(feature = "shared-ntstatus")] pub mod ntstatus; #[cfg(feature = "shared-ntdef")] pub mod ntdef; #[cfg(feature = "shared-rpcndr")] pub mod rpcndr; +#[cfg(feature = "shared-sspi")] pub mod sspi; #[cfg(feature = "shared-windef")] pub mod windef; #[cfg(feature = "shared-wtypesbase")] pub mod wtypesbase; diff --git a/src/shared/sspi.rs b/src/shared/sspi.rs new file mode 100644 index 000000000..5561429b2 --- /dev/null +++ b/src/shared/sspi.rs @@ -0,0 +1,9 @@ +// Copyright © 2016 winapi-rs developers +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::ntdef::LONG; + +pub type SECURITY_STATUS = LONG; diff --git a/src/um/mod.rs b/src/um/mod.rs index 279d089eb..0a786de01 100644 --- a/src/um/mod.rs +++ b/src/um/mod.rs @@ -9,6 +9,7 @@ #[cfg(feature = "um-combaseapi")] pub mod combaseapi; #[cfg(feature = "um-consoleapi")] pub mod consoleapi; #[cfg(feature = "um-minwinbase")] pub mod minwinbase; +#[cfg(feature = "um-ncrypt")] pub mod ncrypt; #[cfg(feature = "um-objidlbase")] pub mod objidlbase; #[cfg(feature = "um-unknwnbase")] pub mod unknwnbase; #[cfg(feature = "um-wincon")] pub mod wincon; diff --git a/src/um/ncrypt.rs b/src/um/ncrypt.rs new file mode 100644 index 000000000..78bbeed82 --- /dev/null +++ b/src/um/ncrypt.rs @@ -0,0 +1,13 @@ +// Copyright © 2016 winapi-rs developers +// Licensed under the Apache License, Version 2.0 +// or the MIT license +// , at your option. +// All files in the project carrying such notice may not be copied, modified, or distributed +// except according to those terms. +use shared::basetsd::ULONG_PTR; +use shared::sspi::SECURITY_STATUS; + +pub type NCRYPT_HANDLE = ULONG_PTR; +EXTERN!{stdcall fn NCryptFreeObject( + hObject: NCRYPT_HANDLE +) -> SECURITY_STATUS} diff --git a/x86_64/lib/libncrypt.a b/x86_64/lib/libncrypt.a new file mode 100644 index 000000000..df47475f0 Binary files /dev/null and b/x86_64/lib/libncrypt.a differ