Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Activation / HttpModule.cs / 1 / HttpModule.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Activation { using System.Threading; using System.ServiceModel; using System.Web; using System.Web.Hosting; using System.Security; using System.Security.Permissions; using System.Diagnostics; class HttpModule : IHttpModule { static bool disabled; ////// RequiresReview - called outside PermitOnly context, /// [SecurityRequiresReview] public void Dispose() { } ////// Critical - entry-point from asp.net, accesses ProcessRequest which is SecurityCritical /// [SecurityCritical] public void Init(HttpApplication context) { context.PostAuthenticateRequest += new EventHandler(ProcessRequest); } ////// Critical - Entry-point from asp.net, called outside PermitOnly context /// ASP calls are critical /// HostedHttpRequestAsyncResult..ctor is critical because it captures HostedImpersonationContext /// (and makes it available later) so caller must ensure that this is called in the right place /// [SecurityCritical] static void ProcessRequest(object sender, EventArgs e) { if (HttpModule.disabled) { return; } try { ServiceHostingEnvironment.SafeEnsureInitialized(); } catch (SecurityException exception) { HttpModule.disabled = true; if (DiagnosticUtility.ShouldTraceWarning) { DiagnosticUtility.ExceptionUtility.TraceHandledException(exception, TraceEventType.Warning); } // If requesting a .svc file, the HttpHandler will try to handle it. It will call // SafeEnsureInitialized() again, which will fail with the same exception (it is // idempotent on failure). This is the correct behavior. return; } if (ServiceHostingEnvironment.AspNetCompatibilityEnabled) { return; } // Check to see whether the extension is supported HttpApplication application = (HttpApplication)sender; string extension = System.IO.Path.GetExtension(application.Request.FilePath); if (extension == null || !ServiceHostingEnvironment.GetExtensionSupported(extension)) { return; } HostedHttpRequestAsyncResult.ExecuteSynchronous(application, false); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FileLogRecordStream.cs
- FormatterServices.cs
- QilTargetType.cs
- UrlMappingCollection.cs
- PropertyRef.cs
- XsltOutput.cs
- EnumValAlphaComparer.cs
- GridViewSelectEventArgs.cs
- DockEditor.cs
- UpdateCompiler.cs
- AccessDataSourceView.cs
- ConnectionOrientedTransportChannelFactory.cs
- IPAddress.cs
- Logging.cs
- DocumentViewerBase.cs
- XamlWrappingReader.cs
- JobCollate.cs
- Triangle.cs
- ButtonBaseAutomationPeer.cs
- GetReadStreamResult.cs
- WebConfigurationFileMap.cs
- SaveFileDialogDesigner.cs
- OleDbCommandBuilder.cs
- KoreanCalendar.cs
- DataGridViewHitTestInfo.cs
- _AuthenticationState.cs
- SqlBooleanizer.cs
- SecurityElement.cs
- SoapElementAttribute.cs
- TextPointerBase.cs
- FixedSchema.cs
- DropDownList.cs
- ExclusiveTcpListener.cs
- PropertyReferenceSerializer.cs
- DynamicExpression.cs
- PageAdapter.cs
- GroupQuery.cs
- DiscoveryClient.cs
- ContextActivityUtils.cs
- QuerySettings.cs
- _NetworkingPerfCounters.cs
- regiisutil.cs
- webbrowsersite.cs
- SystemIPv4InterfaceProperties.cs
- HttpProfileBase.cs
- FilterException.cs
- DbConnectionPoolIdentity.cs
- PixelFormatConverter.cs
- StsCommunicationException.cs
- OutputCacheProfile.cs
- NameTable.cs
- ObjectNotFoundException.cs
- XmlEntity.cs
- PanelDesigner.cs
- SafeSystemMetrics.cs
- WindowsGraphicsCacheManager.cs
- BitmapEffectCollection.cs
- NGCSerializationManagerAsync.cs
- QuerySafeNavigator.cs
- ViewGenerator.cs
- ModelPerspective.cs
- Cast.cs
- DataGridHeaderBorder.cs
- ProfileManager.cs
- ProtectedConfiguration.cs
- WebPartEditorApplyVerb.cs
- SizeConverter.cs
- TextEffectCollection.cs
- CacheDependency.cs
- Effect.cs
- OperationCanceledException.cs
- ResourceContainerWrapper.cs
- TextElement.cs
- DetailsViewModeEventArgs.cs
- DPTypeDescriptorContext.cs
- PeerUnsafeNativeCryptMethods.cs
- StorageComplexPropertyMapping.cs
- FontNamesConverter.cs
- DBDataPermission.cs
- DataGridViewCellCancelEventArgs.cs
- AliasGenerator.cs
- SqlFlattener.cs
- DataGridViewTextBoxEditingControl.cs
- ImageField.cs
- Floater.cs
- MembershipUser.cs
- PathData.cs
- EdmTypeAttribute.cs
- ResolveCompletedEventArgs.cs
- FixedPage.cs
- UniqueEventHelper.cs
- Helper.cs
- ListView.cs
- AnnotationHelper.cs
- CheckPair.cs
- PartialClassGenerationTaskInternal.cs
- PropertyGridCommands.cs
- TextTreeInsertElementUndoUnit.cs
- DeclarationUpdate.cs
- DataBinding.cs