Skip to content

Commit

Permalink
Add NCryptFreeObject
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Oct 29, 2016
1 parent 097e357 commit f4b86ec
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ headers = ["headers-shared", "headers-um", "headers-vc"]
"shared-ntdef",
"shared-ntstatus",
"shared-rpcndr",
"shared-sspi",
"shared-windef",
"shared-wtypesbase"
]
Expand All @@ -39,13 +40,15 @@ 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" = [
"um-cguid",
"um-combaseapi",
"um-consoleapi",
"um-minwinbase",
"um-ncrypt",
"um-objidlbase",
"um-unknwnbase",
"um-wincon",
Expand All @@ -56,6 +59,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"]
"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"]
Expand All @@ -69,7 +73,9 @@ headers = ["headers-shared", "headers-um", "headers-vc"]
"vc-vcruntime" = []
libraries = [
"kernel32",
"ole32"
"ole32",
"ncrypt"
]
"kernel32" = []
"ole32" = []
"ncrypt" = []
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
use std::env::var;
const LIBS: &'static [&'static str] = &[
"kernel32",
"ole32"
"ole32",
"ncrypt"
];
fn main() {
let target = var("TARGET").unwrap();
Expand Down
1 change: 1 addition & 0 deletions src/shared/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
9 changes: 9 additions & 0 deletions src/shared/sspi.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright © 2016 winapi-rs developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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;
1 change: 1 addition & 0 deletions src/um/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
#[cfg(feature = "um-wincon")] pub mod wincon;
#[cfg(feature = "um-wingdi")] pub mod wingdi;
#[cfg(feature = "um-winnt")] pub mod winnt;
#[cfg(feature = "um-ncrypt")] pub mod ncrypt;
13 changes: 13 additions & 0 deletions src/um/ncrypt.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright © 2016 winapi-rs developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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}

0 comments on commit f4b86ec

Please sign in to comment.