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
- DropDownButton.cs
- CodeComment.cs
- WindowsPen.cs
- PasswordPropertyTextAttribute.cs
- FileSecurity.cs
- CapabilitiesState.cs
- graph.cs
- TripleDES.cs
- InstanceCreationEditor.cs
- SystemEvents.cs
- DataTableReaderListener.cs
- TransactionTable.cs
- CompositeFontParser.cs
- ItemsPanelTemplate.cs
- CellPartitioner.cs
- SimpleHandlerBuildProvider.cs
- HitTestParameters.cs
- TripleDES.cs
- ProcessInfo.cs
- InputLanguageSource.cs
- BindingExpression.cs
- Types.cs
- diagnosticsswitches.cs
- Attributes.cs
- OdbcParameterCollection.cs
- UIElement.cs
- ZoneLinkButton.cs
- ClientScriptManager.cs
- AddInStore.cs
- EnumType.cs
- ScriptReference.cs
- OneOfElement.cs
- XmlComment.cs
- ipaddressinformationcollection.cs
- XXXOnTypeBuilderInstantiation.cs
- XamlInt32CollectionSerializer.cs
- compensatingcollection.cs
- FormsAuthenticationModule.cs
- ForeignKeyConstraint.cs
- FontConverter.cs
- HtmlSelect.cs
- DocumentViewer.cs
- Stylesheet.cs
- XmlTextWriter.cs
- DataSourceControlBuilder.cs
- DbSource.cs
- CellParaClient.cs
- XmlDataSourceDesigner.cs
- returneventsaver.cs
- RowsCopiedEventArgs.cs
- SiteMapNodeItem.cs
- BindingBase.cs
- Camera.cs
- MessageQueueEnumerator.cs
- EnumMember.cs
- XmlSiteMapProvider.cs
- PageRouteHandler.cs
- ProcessHost.cs
- ContextBase.cs
- WriteTimeStream.cs
- CalendarDayButton.cs
- CharacterString.cs
- BuilderInfo.cs
- XmlSchemaAttribute.cs
- LogicalTreeHelper.cs
- WebPartConnectVerb.cs
- SessionStateModule.cs
- SqlDataSourceDesigner.cs
- DisplayNameAttribute.cs
- ClientData.cs
- BuildProvidersCompiler.cs
- SymmetricSecurityProtocolFactory.cs
- AssemblyHelper.cs
- FontCacheUtil.cs
- MediaContextNotificationWindow.cs
- HostExecutionContextManager.cs
- ScriptingWebServicesSectionGroup.cs
- CompoundFileDeflateTransform.cs
- versioninfo.cs
- InkCanvasAutomationPeer.cs
- WebPartZone.cs
- Psha1DerivedKeyGenerator.cs
- ColorBuilder.cs
- LayoutEditorPart.cs
- SerializationSectionGroup.cs
- PageStatePersister.cs
- EFAssociationProvider.cs
- FormsAuthenticationConfiguration.cs
- XmlSchemaAnyAttribute.cs
- StackSpiller.Generated.cs
- Int32RectValueSerializer.cs
- NamedPipeProcessProtocolHandler.cs
- EmptyElement.cs
- UpdateTracker.cs
- LowerCaseStringConverter.cs
- RootProfilePropertySettingsCollection.cs
- SplitterCancelEvent.cs
- DispatcherTimer.cs
- TableLayoutRowStyleCollection.cs
- AttachInfo.cs