Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Runtime / Remoting / EnterpriseServicesHelper.cs / 1 / EnterpriseServicesHelper.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** File: ComponentServices.cs ** ** ** Purpose: Defines the general purpose ComponentServices ** ** ===========================================================*/ namespace System.Runtime.Remoting.Services { using System; using System.Reflection; using System.Runtime.Remoting.Activation; using System.Runtime.Remoting.Proxies; using System.Runtime.Remoting.Messaging; using System.Text; using System.Runtime.Serialization; using System.Runtime.CompilerServices; using System.Security.Permissions; using System.Runtime.InteropServices; //---------------------------------------------------------\\ //---------------------------------------------------------\\ // internal sealed class ComponentServices \\ //---------------------------------------------------------\\ //----------------------------------------------------------\\ [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.Infrastructure)] [System.Runtime.InteropServices.ComVisible(true)] public sealed class EnterpriseServicesHelper { [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)] public static Object WrapIUnknownWithComObject(IntPtr punk) { return Marshal.InternalWrapIUnknownWithComObject(punk); } [System.Runtime.InteropServices.ComVisible(true)] public static IConstructionReturnMessage CreateConstructionReturnMessage(IConstructionCallMessage ctorMsg, MarshalByRefObject retObj) { IConstructionReturnMessage ctorRetMsg = null; // Create the return message ctorRetMsg = new ConstructorReturnMessage(retObj, null, 0, null, ctorMsg); // NOTE: WE ALLOW ONLY DEFAULT CTORs on SERVICEDCOMPONENTS return ctorRetMsg; } [SecurityPermissionAttribute(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)] public static void SwitchWrappers(RealProxy oldcp, RealProxy newcp) { Object oldtp = oldcp.GetTransparentProxy(); Object newtp = newcp.GetTransparentProxy(); IntPtr oldcontextId = RemotingServices.GetServerContextForProxy(oldtp); IntPtr newcontextId = RemotingServices.GetServerContextForProxy(newtp); // switch the CCW from oldtp to new tp Marshal.InternalSwitchCCW(oldtp, newtp); } }; }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TcpWorkerProcess.cs
- PermissionSet.cs
- AlgoModule.cs
- FixedTextPointer.cs
- FilterException.cs
- DeviceFilterDictionary.cs
- AdornerDecorator.cs
- CompilerLocalReference.cs
- HtmlTernaryTree.cs
- CompilerError.cs
- QueryCreatedEventArgs.cs
- FactoryRecord.cs
- SelectionEditingBehavior.cs
- ListenerChannelContext.cs
- MessageLogger.cs
- ClientFormsAuthenticationMembershipProvider.cs
- SoapCodeExporter.cs
- OLEDB_Util.cs
- QueryValue.cs
- ServiceEndpointElement.cs
- Error.cs
- XPathDocumentNavigator.cs
- XhtmlBasicFormAdapter.cs
- CLSCompliantAttribute.cs
- _BufferOffsetSize.cs
- WebResponse.cs
- TextBox.cs
- Config.cs
- DeferredSelectedIndexReference.cs
- EventSinkActivity.cs
- ListDictionaryInternal.cs
- FieldNameLookup.cs
- FontStyleConverter.cs
- ExitEventArgs.cs
- SecurityContext.cs
- SortKey.cs
- ServiceDefaults.cs
- DbConnectionPoolOptions.cs
- ItemDragEvent.cs
- BindingMAnagerBase.cs
- DesignerListAdapter.cs
- CustomAttributeFormatException.cs
- ResourceReader.cs
- XMLUtil.cs
- UdpDiscoveryEndpointProvider.cs
- SmtpNetworkElement.cs
- ProgressBar.cs
- Encoder.cs
- Point3DAnimationBase.cs
- RadioButton.cs
- HttpClientCertificate.cs
- NotifyCollectionChangedEventArgs.cs
- EnumerableRowCollectionExtensions.cs
- SQLByte.cs
- Material.cs
- Command.cs
- FontStyleConverter.cs
- ToolStripPanelSelectionBehavior.cs
- MarkupWriter.cs
- AccessDataSourceView.cs
- XmlILOptimizerVisitor.cs
- EventLogTraceListener.cs
- DecoderBestFitFallback.cs
- AssemblyNameProxy.cs
- CommonGetThemePartSize.cs
- IgnoreFileBuildProvider.cs
- ClientProtocol.cs
- SchemaImporterExtensionElement.cs
- ThreadStaticAttribute.cs
- RenderingEventArgs.cs
- UriSectionData.cs
- X509ServiceCertificateAuthenticationElement.cs
- NonClientArea.cs
- ComNativeDescriptor.cs
- SpotLight.cs
- SqlInternalConnectionTds.cs
- TextDecorationCollection.cs
- FileClassifier.cs
- TextProviderWrapper.cs
- StreamInfo.cs
- Bits.cs
- BindingListCollectionView.cs
- FormConverter.cs
- HotSpot.cs
- ParserStreamGeometryContext.cs
- ParserHooks.cs
- HScrollProperties.cs
- ContractMapping.cs
- TdsParserStaticMethods.cs
- HttpProfileGroupBase.cs
- WrapPanel.cs
- AsymmetricSignatureFormatter.cs
- EastAsianLunisolarCalendar.cs
- PkcsUtils.cs
- IdentityNotMappedException.cs
- SetterBase.cs
- MatrixTransform3D.cs
- MarkedHighlightComponent.cs
- SectionXmlInfo.cs
- ColorConvertedBitmap.cs