Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What does 'has a SUC' mean?

I was reading some .NET Code and I found the following in DispatcherSynchronizationContext

/// 
///     Wait for a set of handles.
/// 
///  
///     Critical - Calls WaitForMultipleObjectsEx which has a SUC.
///  
[SecurityCritical] 
[SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.ControlPolicy|SecurityPermissionFlag.ControlEvidence)]
public override int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) 
{
    if(_dispatcher._disableProcessingCount > 0)
    {
        // Call into native code directly in order to avoid the default 
        // CLR locking behavior which pumps messages under contention.
        // Even though they try to pump only the COM messages, any 
        // messages that have been SENT to the window are also 
        // dispatched.  This can lead to unpredictable reentrancy.
        return MS.Win32.UnsafeNativeMethods.WaitForMultipleObjectsEx(waitHandles.Length, waitHandles, waitAll, millisecondsTimeout, false); 
    }
    else
    {
        return SynchronizationContext.WaitHelper(waitHandles, waitAll, millisecondsTimeout); 
    }
} 

What does "has a SUC" mean?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

It appears to stand for the SuppressUnmanagedCodeSecurity attribute. See the source code for WaitForMultipleObjectsEx

///<SecurityNote>
/// Critical as this code performs an elevation.
///</SecurityNote>
[SecurityCritical]
[SuppressUnmanagedCodeSecurity]
[DllImport(ExternDll.Kernel32, EntryPoint="WaitForMultipleObjectsEx", SetLastError = true, CharSet = CharSet.Auto)]
private static extern int IntWaitForMultipleObjectsEx(int nCount, IntPtr[] pHandles, bool bWaitAll, int dwMilliseconds, bool bAlertable);
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading