Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / IntPtr.cs / 1 / IntPtr.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: IntPtr ** ** ** Purpose: Platform independent integer ** ** ===========================================================*/ namespace System { using System; using System.Globalization; using System.Runtime.Serialization; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; [Serializable] [System.Runtime.InteropServices.ComVisible(true)] public struct IntPtr : ISerializable { unsafe private void* m_value; // The compiler treats void* closest to uint hence explicit casts are required to preserve int behavior public static readonly IntPtr Zero; // fast way to compare IntPtr to (IntPtr)0 while IntPtr.Zero doesn't work due to slow statics access [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] internal unsafe bool IsNull() { return (this.m_value == null); } [ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)] public unsafe IntPtr(int value) { #if WIN32 m_value = (void *)value; #else m_value = (void *)(long)value; #endif } [ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)] public unsafe IntPtr(long value) { #if WIN32 m_value = (void *)checked((int)value); #else m_value = (void *)value; #endif } [CLSCompliant(false)] [ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)] public unsafe IntPtr(void* value) { m_value = value; } private unsafe IntPtr(SerializationInfo info, StreamingContext context) { long l = info.GetInt64("value"); if (Size==4 && (l>Int32.MaxValue || l
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ProxyWebPartManager.cs
- DependencyProperty.cs
- MatrixStack.cs
- StackSpiller.Bindings.cs
- StateMachine.cs
- QuaternionKeyFrameCollection.cs
- ValidationRule.cs
- LocalValueEnumerator.cs
- SiteMapProvider.cs
- BitmapData.cs
- InheritablePropertyChangeInfo.cs
- NullableDoubleSumAggregationOperator.cs
- CollectionView.cs
- ThreadStartException.cs
- PartitionResolver.cs
- RuntimeComponentFilter.cs
- StringCollection.cs
- LayoutDump.cs
- DynamicResourceExtensionConverter.cs
- ArgumentNullException.cs
- DefaultMemberAttribute.cs
- UnsafePeerToPeerMethods.cs
- ViewBox.cs
- MatrixAnimationUsingKeyFrames.cs
- WebBrowserSiteBase.cs
- TokenBasedSet.cs
- CounterCreationDataCollection.cs
- IISUnsafeMethods.cs
- Bidi.cs
- MemberPath.cs
- WebPartEditVerb.cs
- XmlSchemaProviderAttribute.cs
- IndentTextWriter.cs
- SslStreamSecurityUpgradeProvider.cs
- DownloadProgressEventArgs.cs
- SqlAliaser.cs
- GlobalAllocSafeHandle.cs
- BookmarkScopeHandle.cs
- BeginEvent.cs
- XamlPathDataSerializer.cs
- SQLInt16.cs
- SecurityKeyType.cs
- StorageComplexPropertyMapping.cs
- XmlArrayItemAttribute.cs
- ListViewEditEventArgs.cs
- MsmqMessage.cs
- SecurityException.cs
- HttpListenerRequestUriBuilder.cs
- SoapParser.cs
- BamlStream.cs
- LambdaCompiler.Unary.cs
- CreateUserErrorEventArgs.cs
- RichTextBoxAutomationPeer.cs
- SmtpMail.cs
- ProfileService.cs
- GeneralTransform3DTo2D.cs
- Vector.cs
- DataListItem.cs
- ComponentEvent.cs
- RowCache.cs
- ConstructorExpr.cs
- HtmlShimManager.cs
- SiteMapNodeItemEventArgs.cs
- CustomError.cs
- uribuilder.cs
- Message.cs
- ManagementObjectCollection.cs
- EmbossBitmapEffect.cs
- OdbcConnectionString.cs
- WindowsRichEdit.cs
- DateTimeHelper.cs
- HtmlTextArea.cs
- sqlpipe.cs
- embossbitmapeffect.cs
- ScriptingProfileServiceSection.cs
- SafePEFileHandle.cs
- xmlfixedPageInfo.cs
- MethodAccessException.cs
- DataSourceCache.cs
- SqlVisitor.cs
- CFGGrammar.cs
- ExpanderAutomationPeer.cs
- LineProperties.cs
- CapabilitiesRule.cs
- PropertyTab.cs
- PeerName.cs
- CharConverter.cs
- InternalResources.cs
- PenLineJoinValidation.cs
- DataControlImageButton.cs
- TraceContextRecord.cs
- X509SecurityTokenProvider.cs
- ClientConfigurationHost.cs
- FileRecordSequence.cs
- ProfilePropertyMetadata.cs
- EntityDesignerDataSourceView.cs
- SelfIssuedSamlTokenFactory.cs
- SafeRightsManagementPubHandle.cs
- SQLDecimalStorage.cs
- AnnouncementEndpointElement.cs