@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The CoQueryClientBlanket API !!!!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! Documentation: CoQueryClientBlanket@msdn on MSDN
Edit ole32.CoQueryClie...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.