{
internal static partial class GlobalizationInterop
{
- [SecurityCritical]
[DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ChangeCase")]
internal unsafe static extern void ChangeCase(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper);
- [SecurityCritical]
[DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ChangeCaseInvariant")]
internal unsafe static extern void ChangeCaseInvariant(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper);
- [SecurityCritical]
[DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ChangeCaseTurkish")]
internal unsafe static extern void ChangeCaseTurkish(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper);
}
{
internal static partial class GlobalizationInterop
{
- [SecurityCritical]
[DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetSortHandle")]
internal unsafe static extern ResultCode GetSortHandle(byte[] localeName, out SafeSortHandle sortHandle);
- [SecurityCritical]
[DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CloseSortHandle")]
internal unsafe static extern void CloseSortHandle(IntPtr handle);
- [SecurityCritical]
[DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CompareString")]
internal unsafe static extern int CompareString(SafeSortHandle sortHandle, char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len, CompareOptions options);
- [SecurityCritical]
[DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IndexOf")]
internal unsafe static extern int IndexOf(SafeSortHandle sortHandle, string target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options);
- [SecurityCritical]
[DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_LastIndexOf")]
internal unsafe static extern int LastIndexOf(SafeSortHandle sortHandle, string target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options);
- [SecurityCritical]
[DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IndexOfOrdinalIgnoreCase")]
internal unsafe static extern int IndexOfOrdinalIgnoreCase(string target, int cwTargetLength, char* pSource, int cwSourceLength, bool findLast);
- [SecurityCritical]
[DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_StartsWith")]
[return: MarshalAs(UnmanagedType.Bool)]
internal unsafe static extern bool StartsWith(SafeSortHandle sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options);
- [SecurityCritical]
[DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_EndsWith")]
[return: MarshalAs(UnmanagedType.Bool)]
internal unsafe static extern bool EndsWith(SafeSortHandle sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options);
- [SecurityCritical]
[DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetSortKey")]
internal unsafe static extern int GetSortKey(SafeSortHandle sortHandle, string str, int strLength, byte* sortKey, int sortKeyLength, CompareOptions options);
- [SecurityCritical]
[DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CompareStringOrdinalIgnoreCase")]
internal unsafe static extern int CompareStringOrdinalIgnoreCase(char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len);
[DllImport(Libraries.GlobalizationInterop, EntryPoint = "GlobalizationNative_GetSortVersion")]
internal static extern int GetSortVersion();
- [SecurityCritical]
internal class SafeSortHandle : SafeHandle
{
private SafeSortHandle() :
public override bool IsInvalid
{
- [SecurityCritical]
get { return handle == IntPtr.Zero; }
}
- [SecurityCritical]
protected override bool ReleaseHandle()
{
CloseSortHandle(handle);
namespace Microsoft.Win32.SafeHandles
{
- [System.Security.SecurityCritical]
public sealed class SafeFileHandle : SafeHandleZeroOrMinusOneIsInvalid
{
/// <summary>A handle value of -1.</summary>
return handle;
}
- [System.Security.SecurityCritical]
protected override bool ReleaseHandle()
{
// When the SafeFileHandle was opened, we likely issued an flock on the created descriptor in order to add
public override bool IsInvalid
{
- [System.Security.SecurityCritical]
get
{
long h = (long)handle;
}
// Call native side to figure out which calendars are allowed
- [SecuritySafeCritical]
internal static int GetCalendars(string localeName, bool useUserOverride, CalendarId[] calendars)
{
// NOTE: there are no 'user overrides' on Linux
// PAL Layer ends here
- [SecuritySafeCritical]
private static bool GetCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType dataType, out string calendarString)
{
return Interop.CallStringMethod(
return index - startIndex;
}
- [SecuritySafeCritical]
private static bool EnumMonthNames(string localeName, CalendarId calendarId, CalendarDataType dataType, out string[] monthNames)
{
monthNames = null;
return result;
}
- [SecuritySafeCritical]
private static bool EnumEraNames(string localeName, CalendarId calendarId, CalendarDataType dataType, out string[] eraNames)
{
bool result = EnumCalendarInfo(localeName, calendarId, dataType, out eraNames);
return result;
}
- [SecuritySafeCritical]
internal static bool EnumCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType dataType, out string[] calendarData)
{
calendarData = null;
return result;
}
- [SecuritySafeCritical]
private static bool EnumCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType dataType, CallbackContext callbackContext)
{
GCHandle context = GCHandle.Alloc(callbackContext);
}
}
- [SecuritySafeCritical]
private static void EnumCalendarInfoCallback(string calendarString, IntPtr context)
{
CallbackContext callbackContext = (CallbackContext)((GCHandle)context).Target;
/// This method uses the sRealName field (which is initialized by the constructor before this is called) to
/// initialize the rest of the state of CultureData based on the underlying OS globalization library.
/// </summary>
- [SecuritySafeCritical]
private unsafe bool InitCultureData()
{
Debug.Assert(_sRealName != null);
return true;
}
- [SecuritySafeCritical]
internal static bool GetLocaleName(string localeName, out string windowsName)
{
// Get the locale name from ICU
return true;
}
- [SecuritySafeCritical]
internal static bool GetDefaultLocaleName(out string windowsName)
{
// Get the default (system) locale name from ICU
// For LOCALE_SPARENT we need the option of using the "real" name (forcing neutral names) instead of the
// "windows" name, which can be specific for downlevel (< windows 7) os's.
- [SecuritySafeCritical]
private string GetLocaleInfo(string localeName, LocaleStringData type)
{
Debug.Assert(localeName != null, "[CultureData.GetLocaleInfo] Expected localeName to be not be null");
return StringBuilderCache.GetStringAndRelease(sb);
}
- [SecuritySafeCritical]
private int GetLocaleInfo(LocaleNumberData type)
{
Debug.Assert(_sWindowsName != null, "[CultureData.GetLocaleInfo(LocaleNumberData)] Expected _sWindowsName to be populated already");
return value;
}
- [SecuritySafeCritical]
private int[] GetLocaleInfo(LocaleGroupingData type)
{
Debug.Assert(_sWindowsName != null, "[CultureData.GetLocaleInfo(LocaleGroupingData)] Expected _sWindowsName to be populated already");
return GetTimeFormatString(false);
}
- [SecuritySafeCritical]
private string GetTimeFormatString(bool shortFormat)
{
Debug.Assert(_sWindowsName != null, "[CultureData.GetTimeFormatString(bool shortFormat)] Expected _sWindowsName to be populated already");
public String AMDesignator
{
- // auto-generated
get
{
if (this.amDesignator == null)
public String PMDesignator
{
- // auto-generated
get
{
if (this.pmDesignator == null)
SetName(name);
}
- [System.Security.SecuritySafeCritical] // auto-generated
public RegionInfo(int culture)
{
if (culture == CultureInfo.LOCALE_INVARIANT) //The InvariantCulture has no matching region
[OnSerializing]
private void OnSerializing(StreamingContext ctx) { }
- [System.Security.SecurityCritical] // auto-generated
[OnDeserialized]
private void OnDeserialized(StreamingContext ctx)
{
{
}
- [SecuritySafeCritical]
private unsafe string ChangeCase(string s, bool toUpper)
{
Debug.Assert(s != null);
return result;
}
- [SecuritySafeCritical]
private unsafe char ChangeCase(char c, bool toUpper)
{
char dst = default(char);
#pragma warning disable 169
private Object[] _Policies; // Called from the VM.
#pragma warning restore 169
- [method: System.Security.SecurityCritical]
public event AssemblyLoadEventHandler AssemblyLoad;
private ResolveEventHandler _TypeResolve;
}
#if FEATURE_REFLECTION_ONLY_LOAD
- [method: System.Security.SecurityCritical]
public event ResolveEventHandler ReflectionOnlyAssemblyResolve;
#endif // FEATURE_REFLECTION_ONLY
return new DateTime(DoubleDateToTicks(d), DateTimeKind.Unspecified);
}
- [System.Security.SecurityCritical /*auto-generated_required*/]
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) {
if (info==null) {
throw new ArgumentNullException(nameof(info));
// WriteEvent overloads (to avoid the "params" EventSource.WriteEvent
// optimized for common signatures (used by the ThreadTransferSend/Receive events)
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")]
private unsafe void WriteEvent(int eventId, long arg1, int arg2, string arg3, bool arg4)
{
}
// optimized for common signatures (used by the ThreadTransferSend/Receive events)
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")]
private unsafe void WriteEvent(int eventId, long arg1, int arg2, string arg3)
{
}
// optimized for common signatures (used by the BeginGetResponse/BeginGetRequestStream events)
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")]
private unsafe void WriteEvent(int eventId, long arg1, string arg2, bool arg3, bool arg4)
{
}
// optimized for common signatures (used by the EndGetRequestStream event)
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")]
private unsafe void WriteEvent(int eventId, long arg1, bool arg2, bool arg3)
{
}
// optimized for common signatures (used by the EndGetResponse event)
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")]
private unsafe void WriteEvent(int eventId, long arg1, bool arg2, bool arg3, int arg4)
{
public void ThreadPoolEnqueueWork(long workID) {
WriteEvent(30, workID);
}
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
public unsafe void ThreadPoolEnqueueWorkObject(object workID) {
// convert the Object Id to a long
ThreadPoolEnqueueWork((long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref workID)));
WriteEvent(31, workID);
}
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
public unsafe void ThreadPoolDequeueWorkObject(object workID) {
// convert the Object Id to a long
ThreadPoolDequeueWork((long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref workID)));
WriteEvent(143, id, success, synchronous);
}
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
public unsafe void BeginGetResponse(object id, string uri, bool success, bool synchronous) {
if (IsEnabled())
GetResponseStart(IdForObject(id), uri, success, synchronous);
}
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
public unsafe void EndGetResponse(object id, bool success, bool synchronous, int statusCode) {
if (IsEnabled())
GetResponseStop(IdForObject(id), success, synchronous, statusCode);
}
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
public unsafe void BeginGetRequestStream(object id, string uri, bool success, bool synchronous) {
if (IsEnabled())
GetRequestStreamStart(IdForObject(id), uri, success, synchronous);
}
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
public unsafe void EndGetRequestStream(object id, bool success, bool synchronous) {
if (IsEnabled())
GetRequestStreamStop(IdForObject(id), success, synchronous);
// id - is a managed object. it gets translated to the object's address. ETW listeners must
// keep track of GC movements in order to correlate the value passed to XyzSend with the
// (possibly changed) value passed to XyzReceive
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
public unsafe void ThreadTransferSendObj(object id, int kind, string info, bool multiDequeues) {
ThreadTransferSend((long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref id)), kind, info, multiDequeues);
}
// id - is a managed object. it gets translated to the object's address. ETW listeners must
// keep track of GC movements in order to correlate the value passed to XyzSend with the
// (possibly changed) value passed to XyzReceive
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
public unsafe void ThreadTransferReceiveObj(object id, int kind, string info) {
ThreadTransferReceive((long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref id)), kind, info);
}
// id - is a managed object. it gets translated to the object's address. ETW listeners must
// keep track of GC movements in order to correlate the value passed to XyzSend with the
// (possibly changed) value passed to XyzReceive
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
public unsafe void ThreadTransferReceiveHandledObj(object id, int kind, string info) {
ThreadTransferReceive((long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref id)), kind, info);
}
private static bool initializedPersistentListener = false;
- [System.Security.SecuritySafeCritical]
public static EventListener InitializePersistentListener()
{
try{
}
}
- [System.Security.SecuritySafeCritical]
private void LogOnEventWritten(EventWrittenEventArgs eventData)
{
string payload = "";
internal RuntimeAssembly() { throw new NotSupportedException(); }
#region private data members
- [method: System.Security.SecurityCritical]
private event ModuleResolveEventHandler _ModuleResolve;
private string m_fullname;
private object m_syncRoot; // Used to keep collectible types alive and as the syncroot for reflection.emit
{
public static partial class Marshal
{
- [System.Security.SecurityCritical]
public static int GetHRForException(Exception e)
{
return (e != null) ? e.HResult : 0;
}
- [System.Security.SecurityCriticalAttribute]
public static int AddRef(System.IntPtr pUnk)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static bool AreComObjectsAvailableForCleanup()
{
return false;
}
- [System.Security.SecurityCriticalAttribute]
public static System.IntPtr CreateAggregatedObject(System.IntPtr pOuter, object o)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static Object BindToMoniker(String monikerName)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static void CleanupUnusedObjectsInCurrentContext()
{
return;
}
- [System.Security.SecurityCriticalAttribute]
public static System.IntPtr CreateAggregatedObject<T>(System.IntPtr pOuter, T o)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static object CreateWrapperOfType(object o, System.Type t)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static TWrapper CreateWrapperOfType<T, TWrapper>(T o)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static void ChangeWrapperHandleStrength(Object otp, bool fIsWeak)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static int FinalReleaseComObject(object o)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static System.IntPtr GetComInterfaceForObject(object o, System.Type T)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static System.IntPtr GetComInterfaceForObject(object o, System.Type T, System.Runtime.InteropServices.CustomQueryInterfaceMode mode)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static System.IntPtr GetComInterfaceForObject<T, TInterface>(T o)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static System.IntPtr GetHINSTANCE(System.Reflection.Module m)
{
if (m == null)
return (System.IntPtr) (-1);
}
- [System.Security.SecurityCriticalAttribute]
public static System.IntPtr GetIUnknownForObject(object o)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static void GetNativeVariantForObject(object obj, System.IntPtr pDstNativeVariant)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static void GetNativeVariantForObject<T>(T obj, System.IntPtr pDstNativeVariant)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static Object GetTypedObjectForIUnknown(System.IntPtr pUnk, System.Type t)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static object GetObjectForIUnknown(System.IntPtr pUnk)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static object GetObjectForNativeVariant(System.IntPtr pSrcNativeVariant)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static T GetObjectForNativeVariant<T>(System.IntPtr pSrcNativeVariant)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static object[] GetObjectsForNativeVariants(System.IntPtr aSrcNativeVariant, int cVars)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static T[] GetObjectsForNativeVariants<T>(System.IntPtr aSrcNativeVariant, int cVars)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static int GetStartComSlot(System.Type t)
{
throw new PlatformNotSupportedException();
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static string GetTypeInfoName(System.Runtime.InteropServices.ComTypes.ITypeInfo typeInfo)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static object GetUniqueObjectForIUnknown(System.IntPtr unknown)
{
throw new PlatformNotSupportedException();
return false;
}
- [System.Security.SecurityCriticalAttribute]
public static int QueryInterface(System.IntPtr pUnk, ref System.Guid iid, out System.IntPtr ppv)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static int Release(System.IntPtr pUnk)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static int ReleaseComObject(object o)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static void ZeroFreeBSTR(System.IntPtr s)
{
throw new PlatformNotSupportedException();
public static class ComEventsHelper
{
- [System.Security.SecurityCriticalAttribute]
public static void Combine(object rcw, System.Guid iid, int dispid, System.Delegate d)
{
throw new PlatformNotSupportedException();
}
- [System.Security.SecurityCriticalAttribute]
public static System.Delegate Remove(object rcw, System.Guid iid, int dispid, System.Delegate d)
{
throw new PlatformNotSupportedException();
}
}
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
unsafe public void RunningContinuation(int TaskID, object Object) { RunningContinuation(TaskID, (long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref Object))); }
[Event(20, Keywords = Keywords.Debug)]
private void RunningContinuation(int TaskID, long Object)
WriteEvent(20, TaskID, Object);
}
- [NonEvent, System.Security.SecuritySafeCritical]
+ [NonEvent]
unsafe public void RunningContinuationList(int TaskID, int Index, object Object) { RunningContinuationList(TaskID, Index, (long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref Object))); }
[Event(21, Keywords = Keywords.Debug)]