Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / Msmq.cs / 1 / Msmq.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Channels { using System.Threading; using System.Net.Security; internal static class Msmq { static Version longhornVersion = new Version(4, 0); static Version version; static bool activeDirectoryEnabled; static object xpSendLock = null; static UriPrefixTabletransportManagerTable = new UriPrefixTable (); static object staticLock = new object(); static SafeLibraryHandle errorStrings = null; static Msmq() { MsmqQueue.GetMsmqInformation(ref version, ref activeDirectoryEnabled); MsmqDiagnostics.MsmqDetected(version); Version osVersion = System.Environment.OSVersion.Version; if (osVersion.Major == 5 && osVersion.Minor == 1) xpSendLock = new object(); } internal static bool ActiveDirectoryEnabled { get { return activeDirectoryEnabled; } } internal static Version Version { get { return version; } } internal static bool IsPerAppDeadLetterQueueSupported { get { return Msmq.Version >= longhornVersion; } } internal static bool IsAdvancedPoisonHandlingSupported { get { return Msmq.Version >= longhornVersion; } } internal static bool IsRejectMessageSupported { get { return Msmq.Version >= longhornVersion; } } internal static UriPrefixTable StaticTransportManagerTable { get { return transportManagerTable; } } internal static IPoisonHandlingStrategy CreatePoisonHandler(MsmqReceiveHelper receiver) { if (receiver.Transactional) { if (Msmq.Version < longhornVersion) { return new Msmq3PoisonHandler(receiver); } else { if (receiver.ListenUri.AbsoluteUri.Contains(";")) return new Msmq4SubqueuePoisonHandler(receiver); else return new Msmq4PoisonHandler(receiver); } } else { return new MsmqNonTransactedPoisonHandler(receiver); } } internal static SafeLibraryHandle ErrorStrings { get { if (null == errorStrings) { lock (staticLock) { if (null == errorStrings) { #pragma warning suppress 56523 // Callers (there is only one) handle an invalid handle returned from here. errorStrings = UnsafeNativeMethods.LoadLibrary("MQUTIL.DLL"); } } } return errorStrings; } } internal static void EnterXPSendLock(out bool lockHeld, ProtectionLevel protectionLevel) { lockHeld = false; if (null != xpSendLock && (ProtectionLevel.None != protectionLevel)) { try { } finally { Monitor.Enter(xpSendLock); lockHeld = true; } } } internal static void LeaveXPSendLock() { Monitor.Exit(xpSendLock); } } } // 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
- CodeCompiler.cs
- LocatorGroup.cs
- ProcessHostConfigUtils.cs
- WindowsGraphicsCacheManager.cs
- DataServices.cs
- WebPartConnectionsConnectVerb.cs
- FilteredSchemaElementLookUpTable.cs
- RSAPKCS1KeyExchangeFormatter.cs
- SortFieldComparer.cs
- ObjectDataSourceChooseTypePanel.cs
- TransformedBitmap.cs
- DataGridViewImageColumn.cs
- FontSource.cs
- ConfigurationSection.cs
- EpmHelper.cs
- StorageEndPropertyMapping.cs
- PortCache.cs
- SrgsSemanticInterpretationTag.cs
- CurrentChangedEventManager.cs
- AttributeAction.cs
- OdbcException.cs
- EntityDesignerUtils.cs
- Matrix.cs
- XComponentModel.cs
- ActiveXContainer.cs
- ApplicationHost.cs
- DBAsyncResult.cs
- XmlSchemaObject.cs
- VBCodeProvider.cs
- XmlWrappingWriter.cs
- Rect.cs
- ProcessProtocolHandler.cs
- HtmlTitle.cs
- DuplicateWaitObjectException.cs
- SHA384.cs
- HttpConfigurationSystem.cs
- Size.cs
- StorageComplexPropertyMapping.cs
- ParameterModifier.cs
- SqlServices.cs
- RuntimeHelpers.cs
- FrameworkContextData.cs
- WebPartConnectVerb.cs
- TaskForm.cs
- SizeChangedEventArgs.cs
- ServiceCredentials.cs
- ResolveNameEventArgs.cs
- InputProcessorProfilesLoader.cs
- TdsParserSafeHandles.cs
- ReaderContextStackData.cs
- LinearGradientBrush.cs
- HttpRuntime.cs
- ReflectionUtil.cs
- OrthographicCamera.cs
- RuntimeHandles.cs
- CodeAccessSecurityEngine.cs
- DisableDpiAwarenessAttribute.cs
- Icon.cs
- SizeAnimationUsingKeyFrames.cs
- BlockCollection.cs
- DataGridViewAddColumnDialog.cs
- XsdCachingReader.cs
- PageThemeParser.cs
- MemoryFailPoint.cs
- MemoryMappedViewAccessor.cs
- ToolBarOverflowPanel.cs
- Form.cs
- ValueExpressions.cs
- WindowCollection.cs
- StylusPlugInCollection.cs
- DesignerTransaction.cs
- CalendarDay.cs
- RequestTimeoutManager.cs
- HttpServerVarsCollection.cs
- ToolboxSnapDragDropEventArgs.cs
- XmlSchemaObjectTable.cs
- SafeEventLogWriteHandle.cs
- SelectionUIHandler.cs
- RelationshipManager.cs
- AssemblyHelper.cs
- ConsoleKeyInfo.cs
- DuplicateWaitObjectException.cs
- XPathDocumentBuilder.cs
- FlagsAttribute.cs
- DataListDesigner.cs
- PropertySourceInfo.cs
- SqlServer2KCompatibilityAnnotation.cs
- PointKeyFrameCollection.cs
- ContentPosition.cs
- StatusBarAutomationPeer.cs
- SimpleTextLine.cs
- ExpressionLink.cs
- IsolatedStorageFileStream.cs
- SQLDateTime.cs
- SessionSymmetricTransportSecurityProtocolFactory.cs
- PropertyDescriptorGridEntry.cs
- activationcontext.cs
- EncodingDataItem.cs
- PackageRelationshipCollection.cs
- PasswordRecovery.cs