diff options
Diffstat (limited to 'src/System.Private.Interop/src/Interop/Interop.COM.Windows.cs')
-rw-r--r-- | src/System.Private.Interop/src/Interop/Interop.COM.Windows.cs | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/src/System.Private.Interop/src/Interop/Interop.COM.Windows.cs b/src/System.Private.Interop/src/Interop/Interop.COM.Windows.cs index df0b5d675..8aaa8930d 100644 --- a/src/System.Private.Interop/src/Interop/Interop.COM.Windows.cs +++ b/src/System.Private.Interop/src/Interop/Interop.COM.Windows.cs @@ -37,36 +37,6 @@ namespace System.Runtime.InteropServices internal const string CORE_COM_AUT = "OleAut32.dll"; } -#if CORECLR - public static unsafe void SafeCoTaskMemFree(void* pv) - { - // Even though CoTaskMemFree is a no-op for NULLs, skipping the interop call entirely is faster - if (pv != null) - Marshal.FreeCoTaskMem(new IntPtr(pv)); - } - - public static unsafe IntPtr SysAllocStringLen(char* pStrIn, UInt32 dwSize) - { - string srcString = new string(pStrIn, 0, checked((int)dwSize)); - return Marshal.StringToBSTR(srcString); - } - - public static unsafe void SysFreeString(void* pBSTR) - { - SysFreeString(new IntPtr(pBSTR)); - } - - public static unsafe void SysFreeString(IntPtr pBSTR) - { - Marshal.FreeBSTR(pBSTR); - } - - internal static void VariantClear(IntPtr pObject) - { - //Nop - } - -#else [DllImport(Libraries.CORE_COM)] [McgGeneratedNativeCallCodeAttribute] internal static extern unsafe int CoCreateInstanceFromApp( @@ -79,60 +49,26 @@ namespace System.Runtime.InteropServices ); [DllImport(Libraries.CORE_COM, PreserveSig = false)] - [SuppressUnmanagedCodeSecurity] internal static extern void CreateBindCtx(UInt32 reserved, out IBindCtx ppbc); [DllImport(Libraries.CORE_COM, PreserveSig = false)] - [SuppressUnmanagedCodeSecurity] internal static extern void MkParseDisplayName(IBindCtx pbc, [MarshalAs(UnmanagedType.LPWStr)] String szUserName, out UInt32 pchEaten, out IMoniker ppmk); #if !TARGET_CORE_API_SET // BindMoniker not available in core API set [DllImport(Libraries.CORE_COM, PreserveSig = false)] - [SuppressUnmanagedCodeSecurity] internal static extern void BindMoniker(IMoniker pmk, UInt32 grfOpt, ref Guid iidResult, [MarshalAs(UnmanagedType.Interface)] out Object ppvResult); #endif [DllImport(Libraries.CORE_COM_AUT)] [McgGeneratedNativeCallCodeAttribute] - [MethodImplAttribute(MethodImplOptions.NoInlining)] - public static extern unsafe void SysFreeString(void* pBSTR); - - public static unsafe void SysFreeString(IntPtr pBstr) - { - SysFreeString((void*)pBstr); - } - - [DllImport(Libraries.CORE_COM_AUT)] - [McgGeneratedNativeCallCodeAttribute] - [MethodImplAttribute(MethodImplOptions.NoInlining)] - public static extern unsafe uint SysStringLen(void* pBSTR); - public static unsafe uint SysStringLen(IntPtr pBSTR) - { - return SysStringLen((void*)pBSTR); - } - - [DllImport(Libraries.CORE_COM_AUT)] - [McgGeneratedNativeCallCodeAttribute] - [MethodImplAttribute(MethodImplOptions.NoInlining)] - public static extern unsafe IntPtr SysAllocString(IntPtr pStrIn); - - [DllImport(Libraries.CORE_COM_AUT)] - [McgGeneratedNativeCallCodeAttribute] - [MethodImplAttribute(MethodImplOptions.NoInlining)] - public static extern unsafe char* SysAllocStringLen(char* pStrIn, uint len); - - [DllImport(Libraries.CORE_COM_AUT)] - [McgGeneratedNativeCallCodeAttribute] internal static extern void VariantClear(IntPtr pObject); - public static unsafe void SafeCoTaskMemFree(void* pv) { // Even though CoTaskMemFree is a no-op for NULLs, skipping the interop call entirely is faster if (pv != null) PInvokeMarshal.CoTaskMemFree(new IntPtr(pv)); } -#endif //CORECLR } } |