Implemented Credential acquisition and release.

This commit is contained in:
antiduh
2014-06-19 02:26:30 +00:00
parent 22c6a5d3f9
commit f96ef74e9b
8 changed files with 168 additions and 21 deletions

View File

@@ -38,8 +38,14 @@ namespace NSspi
);
*/
[DllImport( "Secur32.dll", CallingConvention = CallingConvention.Winapi, SetLastError=true)]
public extern int AcquireCredentialHandle(
[DllImport(
"Secur32.dll",
EntryPoint = "AcquireCredentialsHandle",
CallingConvention = CallingConvention.Winapi,
CharSet = CharSet.Unicode,
SetLastError = true
)]
public static extern SecurityStatus AcquireCredentialsHandle(
string principleName,
string packageName,
CredentialUse credentialUse,
@@ -47,8 +53,25 @@ namespace NSspi
IntPtr packageData,
IntPtr getKeyFunc,
IntPtr getKeyData,
IntPtr credentialHandle,
ref long credentialHandle,
ref long expiry
);
/*
SECURITY_STATUS SEC_Entry FreeCredentialsHandle(
_In_ PCredHandle phCredential
);
*/
[DllImport(
"Secur32.dll",
EntryPoint = "FreeCredentialsHandle",
CallingConvention = CallingConvention.Winapi,
CharSet = CharSet.Unicode,
SetLastError = true
)]
public static extern SecurityStatus FreeCredentialsHandle(
ref long credentialHandle
);
}
}