Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / SafeNativeMethods.cs / 1 / SafeNativeMethods.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Channels { using System.Security; using System.Runtime.InteropServices; [SuppressUnmanagedCodeSecurity] internal static class SafeNativeMethods { public const string KERNEL32 = "kernel32.dll"; [DllImport(KERNEL32, SetLastError = false)] static extern uint GetSystemTimeAdjustment( [Out] out int adjustment, [Out] out uint increment, [Out] out uint adjustmentDisabled ); [DllImport(KERNEL32, SetLastError = true)] public static extern void GetSystemTimeAsFileTime(out long time); ////// Critical - calls critical method GetSystemTimeAdjustment /// Safe - method is a SafeNativeMethod /// [SecurityCritical, SecurityTreatAsSafe] internal static long GetSystemTimeResolution() { int dummyAdjustment; uint increment; uint dummyAdjustmentDisabled; if (GetSystemTimeAdjustment(out dummyAdjustment, out increment, out dummyAdjustmentDisabled) != 0) { return (long)increment; } // Assume the default, which is around 15 milliseconds. return 15 * TimeSpan.TicksPerMillisecond; } } } // 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
- AssemblyFilter.cs
- CompoundFileReference.cs
- Vector3DAnimationBase.cs
- PeerNameRecord.cs
- ScriptServiceAttribute.cs
- NullableDecimalSumAggregationOperator.cs
- ListView.cs
- EventManager.cs
- DocumentSequence.cs
- UnsupportedPolicyOptionsException.cs
- StringCollectionMarkupSerializer.cs
- PeerResolver.cs
- XmlBaseWriter.cs
- SchemaDeclBase.cs
- NodeFunctions.cs
- XmlAttributeHolder.cs
- WebPartConnectionsConnectVerb.cs
- DbModificationCommandTree.cs
- ProcessStartInfo.cs
- CodeEventReferenceExpression.cs
- RegexMatch.cs
- AttributeEmitter.cs
- PagedDataSource.cs
- ProviderMetadata.cs
- BehaviorEditorPart.cs
- ActivatableWorkflowsQueryResult.cs
- TableLayout.cs
- SemanticAnalyzer.cs
- AuthenticationModuleElementCollection.cs
- EditCommandColumn.cs
- BreakRecordTable.cs
- RoutedEventValueSerializer.cs
- StrokeIntersection.cs
- DocumentsTrace.cs
- VirtualPath.cs
- RegisteredHiddenField.cs
- DescendantQuery.cs
- XPathMessageFilterElementCollection.cs
- ConsumerConnectionPointCollection.cs
- PopupControlService.cs
- RNGCryptoServiceProvider.cs
- FixUpCollection.cs
- AuthenticatedStream.cs
- ServiceObjectContainer.cs
- PropertyGridDesigner.cs
- DoubleIndependentAnimationStorage.cs
- Control.cs
- WrappedIUnknown.cs
- CustomAttributeBuilder.cs
- SeverityFilter.cs
- HttpServerVarsCollection.cs
- SectionUpdates.cs
- StringSorter.cs
- UiaCoreProviderApi.cs
- Intellisense.cs
- AnnotationResourceChangedEventArgs.cs
- ToggleProviderWrapper.cs
- BoolExpressionVisitors.cs
- StateManagedCollection.cs
- PerformanceCounterPermission.cs
- SingleStorage.cs
- RelOps.cs
- DirtyTextRange.cs
- ProfileSettings.cs
- namescope.cs
- ValidationErrorEventArgs.cs
- StringSource.cs
- DataObjectPastingEventArgs.cs
- MsmqChannelFactory.cs
- PageContentCollection.cs
- SafeNativeMethods.cs
- ForEachAction.cs
- TransportContext.cs
- DesignBindingConverter.cs
- CleanUpVirtualizedItemEventArgs.cs
- StrongTypingException.cs
- ScopeElementCollection.cs
- DataMemberFieldConverter.cs
- FontEmbeddingManager.cs
- D3DImage.cs
- TextServicesManager.cs
- webbrowsersite.cs
- RandomNumberGenerator.cs
- ListView.cs
- WindowsListViewItemCheckBox.cs
- RegexFCD.cs
- ExtendedPropertyCollection.cs
- WebPartEditorCancelVerb.cs
- XamlPathDataSerializer.cs
- ValidationUtility.cs
- Point3DAnimationUsingKeyFrames.cs
- LineServices.cs
- WindowsStatic.cs
- UIInitializationException.cs
- Regex.cs
- AutoCompleteStringCollection.cs
- EnumValidator.cs
- XmlAnyElementAttributes.cs
- DataContractSerializerFaultFormatter.cs
- DataListCommandEventArgs.cs