Code:
/ FX-1434 / FX-1434 / 1.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
- SvcMapFile.cs
- StringComparer.cs
- EntityDataSourceMemberPath.cs
- RTTrackingProfile.cs
- XmlAnyElementAttributes.cs
- Debugger.cs
- WindowsFormsHost.cs
- RegexFCD.cs
- RecognizedPhrase.cs
- ValidationSummary.cs
- BitVector32.cs
- AnnotationResource.cs
- AuthenticationModuleElement.cs
- DiagnosticStrings.cs
- TagPrefixInfo.cs
- ProxyWebPartManager.cs
- ConsoleKeyInfo.cs
- Executor.cs
- UserControl.cs
- Console.cs
- SslStreamSecurityBindingElement.cs
- WebSysDescriptionAttribute.cs
- StrongNameIdentityPermission.cs
- ChtmlLinkAdapter.cs
- DebugHandleTracker.cs
- Accessors.cs
- DateTimeAutomationPeer.cs
- Properties.cs
- GenericRootAutomationPeer.cs
- XPathNodeList.cs
- _CookieModule.cs
- ChineseLunisolarCalendar.cs
- Buffer.cs
- ObjectStateEntry.cs
- CommonRemoteMemoryBlock.cs
- ProcessHostServerConfig.cs
- RoutedEvent.cs
- PrintPreviewGraphics.cs
- ImageIndexEditor.cs
- RichTextBox.cs
- ConcurrentDictionary.cs
- EmptyStringExpandableObjectConverter.cs
- InstancePersistenceException.cs
- IIS7WorkerRequest.cs
- ProfileServiceManager.cs
- SoapElementAttribute.cs
- FileUtil.cs
- Clipboard.cs
- _SecureChannel.cs
- EventLogEntryCollection.cs
- TextCompositionManager.cs
- webproxy.cs
- DefaultWorkflowTransactionService.cs
- SqlDataSourceConfigureSelectPanel.cs
- ReverseInheritProperty.cs
- FixedTextView.cs
- ToolboxComponentsCreatedEventArgs.cs
- BlobPersonalizationState.cs
- NullableLongAverageAggregationOperator.cs
- ObjectToken.cs
- UnicodeEncoding.cs
- TextSelectionHelper.cs
- ZipIOModeEnforcingStream.cs
- DataGridRowClipboardEventArgs.cs
- XmlSerializationWriter.cs
- CompilerScopeManager.cs
- BamlRecordHelper.cs
- InternalDuplexChannelListener.cs
- WebUtility.cs
- TimersDescriptionAttribute.cs
- SettingsAttributes.cs
- IgnoreFlushAndCloseStream.cs
- XmlILModule.cs
- HierarchicalDataTemplate.cs
- AdRotator.cs
- NotSupportedException.cs
- TableLayoutSettings.cs
- COM2PropertyDescriptor.cs
- DbgUtil.cs
- XmlIlVisitor.cs
- IndexedWhereQueryOperator.cs
- _SafeNetHandles.cs
- DashStyles.cs
- EventLogger.cs
- HttpCachePolicyElement.cs
- StateManagedCollection.cs
- CTreeGenerator.cs
- SubqueryRules.cs
- linebase.cs
- RefreshEventArgs.cs
- BatchParser.cs
- InheritedPropertyChangedEventArgs.cs
- XmlQueryOutput.cs
- DynamicValueConverter.cs
- ObjectDataSourceDisposingEventArgs.cs
- WindowsIdentity.cs
- BindableTemplateBuilder.cs
- JournalEntryStack.cs
- CngKey.cs
- ButtonChrome.cs