QuerySecurityPackageInfo (secur32)
Last changed: mdegroux-81.252.131.1

.

Retrieves information about a specified security package. This information includes the bounds on sizes of authentication information, credentials, and contexts.

C# Signature:

[DllImport("secur32.dll", SetLastError=true)]
static extern long QuerySecurityPackageInfo(string pszPackageName, out IntPtr ppPackageInfo);

[StructLayout(LayoutKind.Sequential)]
public struct SecPkgInfo
{
   public UInt32 fCapabilities;
   public UInt16 wVersion;
   public UInt16 wRPCID;
   public UInt32 cbMaxToken;
   public string Name;
   public string Comment;
}

VB Signature:

Declare Function QuerySecurityPackageInfo Lib "secur32.dll" (TODO) As TODO

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

IntPtr packagePtr;

QuerySecurityPackageInfo("Kerberos", out packagePtr);

int error = Marshal.GetLastWin32Error();

if (error == 0 && packagePtr != IntPtr.Zero)

{

    SecPkgInfo secPkgInfo = (SecPkgInfo)Marshal.PtrToStructure(packagePtr, typeof(SecPkgInfo));

}

Documentation