Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than ole32, prefix the name with the module name and a period.
CoQueryClientBlanket (ole32)
.
C# Signature:
[DllImport("ole32.dll")]
static extern int CoQueryClientBlanket(out IntPtr pAuthnSvc, out IntPtr pAuthzSvc,
[MarshalAs(UnmanagedType.LPWStr)] out StringBuilder pServerPrincName, out IntPtr
pAuthnLevel, out IntPtr pImpLevel, out IntPtr pPrivs, out IntPtr pCapabilities);
User-Defined Types:
None.
Notes:
The original version of this errored with a message about memory corruption.
My modification works without error, if you use the code sample you'll need to plug in your own logging.
Tips & Tricks:
Please add some!
Sample Code:
{
System.IntPtr pAthnSvc = new IntPtr();
System.IntPtr pAthzSvc = new IntPtr();
StringBuilder pServerPrincName = new StringBuilder();
System.IntPtr pAuthnLevel = new IntPtr();
System.IntPtr pImpLevel = new IntPtr();
System.IntPtr pPrivs = new IntPtr();
System.IntPtr pCaps = new IntPtr(4);
try
{
trc.Log(LOG_DEBUG, "Retrieving Principle Name");
CoQueryClientBlanket(out pAthnSvc, out pAthzSvc, out pServerPrincName, out pAuthnLevel, out pImpLevel, out pPrivs, out pCaps);
trc.Log(LOG_DEBUG, "Called CoQueryClientBlanket without error");
}
catch(Exception ex)
{
// Something went wrong, report it and then check if
//we have a valid token attached instead
trc.LogError( ex.Message ) ;
}
finally
{
// Logging the values to aid any debugging that may be required
trc.Log( LOG_DEBUG, "Values");
trc.Log( LOG_DEBUG, "pAthnSvc = " + pAthnSvc);
trc.Log( LOG_DEBUG, "pAthzSvc = " + pAthzSvc);
trc.Log( LOG_DEBUG, "pAuthnLevel = " + pAuthnLevel);
trc.Log( LOG_DEBUG, "pImpLevel = " + pImpLevel);
trc.Log( LOG_DEBUG, "pPrivs = " + pPrivs);
trc.Log( LOG_DEBUG, "pCaps = " + pCaps);
trc.Log( LOG_DEBUG, "pServerPrincName = " + pServerPrincName);
}
}
Alternative Managed API:
Do you know one? Please contribute it!
The CoQueryClientBlanket API
9/6/2007 9:57:44 AM - anonymous
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).