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
- SelectedCellsCollection.cs
- InvokeMethodActivity.cs
- WindowsFormsHostAutomationPeer.cs
- EmptyEnumerable.cs
- GridViewColumn.cs
- NavigationWindowAutomationPeer.cs
- PackageRelationshipSelector.cs
- HierarchicalDataSourceConverter.cs
- RouteParametersHelper.cs
- HtmlAnchor.cs
- ObjectAnimationUsingKeyFrames.cs
- VectorAnimationUsingKeyFrames.cs
- DynamicUpdateCommand.cs
- DLinqColumnProvider.cs
- ControlDesigner.cs
- NotifyCollectionChangedEventArgs.cs
- WaitForChangedResult.cs
- ContentControl.cs
- QilVisitor.cs
- HitTestWithPointDrawingContextWalker.cs
- TextContainerChangeEventArgs.cs
- PropertyDescriptor.cs
- MetadataArtifactLoader.cs
- SingleKeyFrameCollection.cs
- PropertyTabAttribute.cs
- TypeConverterHelper.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- DiscoveryClientElement.cs
- ZipFileInfo.cs
- StringStorage.cs
- OleDbRowUpdatingEvent.cs
- ChtmlMobileTextWriter.cs
- DataSourceXmlSerializationAttribute.cs
- HttpProcessUtility.cs
- StrokeNode.cs
- ColumnCollection.cs
- FunctionUpdateCommand.cs
- PasswordTextContainer.cs
- SortAction.cs
- WSAddressing10ProblemHeaderQNameFault.cs
- ObfuscationAttribute.cs
- DbConnectionPoolCounters.cs
- Label.cs
- versioninfo.cs
- Random.cs
- CatalogPartCollection.cs
- Highlights.cs
- RoutedPropertyChangedEventArgs.cs
- WeakReferenceEnumerator.cs
- CallInfo.cs
- CodeArrayIndexerExpression.cs
- DBDataPermission.cs
- PasswordTextNavigator.cs
- SubMenuStyle.cs
- XmlSchemaSimpleType.cs
- BehaviorDragDropEventArgs.cs
- ResponseStream.cs
- DesignConnectionCollection.cs
- ServiceControllerDesigner.cs
- SqlCacheDependencyDatabase.cs
- DataTemplateKey.cs
- Int64Converter.cs
- QilList.cs
- WinFormsComponentEditor.cs
- SiteMapNodeItem.cs
- TextEditorTables.cs
- DataGridViewCellPaintingEventArgs.cs
- DataListItemCollection.cs
- SmtpFailedRecipientsException.cs
- StorageInfo.cs
- ComPlusInstanceProvider.cs
- AssociationType.cs
- NamespaceQuery.cs
- Configuration.cs
- _OverlappedAsyncResult.cs
- XhtmlBasicTextBoxAdapter.cs
- EndpointAddress.cs
- CmsUtils.cs
- __FastResourceComparer.cs
- TextClipboardData.cs
- UInt32.cs
- GACIdentityPermission.cs
- RequestUriProcessor.cs
- ContextStaticAttribute.cs
- SequenceFullException.cs
- Compiler.cs
- RowVisual.cs
- UserPersonalizationStateInfo.cs
- DetailsViewModeEventArgs.cs
- WinInet.cs
- KnowledgeBase.cs
- EntityExpressionVisitor.cs
- XmlNullResolver.cs
- ImmComposition.cs
- ResourceContainer.cs
- XmlResolver.cs
- MemberDescriptor.cs
- ClonableStack.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- _AuthenticationState.cs