GetRuntimeInterfaceAsIntPtr() public static method

public static GetRuntimeInterfaceAsIntPtr ( System.Guid clsid, System.Guid riid ) : IntPtr
clsid System.Guid
riid System.Guid
return System.IntPtr
Esempio n. 1
0
        public static void RuntimeEnvironmentNegTest()
        {
            Type     clsType = typeof(RuntimeEnvironmentTest);
            Assembly assem   = clsType.Assembly;

            Assert.True(!RuntimeEnvironment.FromGlobalAccessCache(assem));

            Assert.Throws <PlatformNotSupportedException>(() => RuntimeEnvironment.SystemConfigurationFile);

            Guid guid;

            Assert.Throws <PlatformNotSupportedException>(() => RuntimeEnvironment.GetRuntimeInterfaceAsObject(guid, guid));
            Assert.Throws <PlatformNotSupportedException>(() => RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr(guid, guid));
        }
 public void GetRuntimeInterfaceAsIntPtr_Invoke_ThrowsPlatformNotSupportedException()
 {
     Assert.Throws <PlatformNotSupportedException>(() => RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr(Guid.Empty, Guid.Empty));
 }
        public void GetRuntimeInterfaceAsIntPtr_Invoke_ThrowsPlatformNotSupportedException()
        {
#pragma warning disable 618 // GetRuntimeInterfaceAsIntPtr is marked as Obsolete
            Assert.Throws <PlatformNotSupportedException>(() => RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr(Guid.Empty, Guid.Empty));
#pragma warning restore 618
        }