Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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
- COM2ExtendedTypeConverter.cs
- HyperLink.cs
- SoapCommonClasses.cs
- GZipStream.cs
- DelegatingMessage.cs
- SamlAuthenticationStatement.cs
- DirectoryObjectSecurity.cs
- XmlComplianceUtil.cs
- SuppressIldasmAttribute.cs
- InstanceView.cs
- BindingListCollectionView.cs
- SBCSCodePageEncoding.cs
- DesignerActionKeyboardBehavior.cs
- StrongNameKeyPair.cs
- BinaryWriter.cs
- ReceiveSecurityHeaderEntry.cs
- ColumnResult.cs
- HtmlImage.cs
- OletxDependentTransaction.cs
- MeasureItemEvent.cs
- ContentWrapperAttribute.cs
- UnsafeNativeMethodsTablet.cs
- xamlnodes.cs
- SelectionService.cs
- IndexOutOfRangeException.cs
- wgx_sdk_version.cs
- OdbcEnvironment.cs
- SignatureToken.cs
- FamilyMap.cs
- SqlGenerator.cs
- TreeNodeSelectionProcessor.cs
- BitmapEncoder.cs
- DbConnectionClosed.cs
- TreeView.cs
- Converter.cs
- KnownColorTable.cs
- LoginNameDesigner.cs
- ReadOnlyDataSourceView.cs
- SecurityUniqueId.cs
- DateTimeFormat.cs
- ContainerControlDesigner.cs
- DataGridViewCheckBoxColumn.cs
- AttachedAnnotation.cs
- Identity.cs
- odbcmetadatacolumnnames.cs
- WizardStepBase.cs
- DbConnectionFactory.cs
- VisualStateChangedEventArgs.cs
- ViewKeyConstraint.cs
- XmlnsCompatibleWithAttribute.cs
- OleDbCommandBuilder.cs
- MappingMetadataHelper.cs
- BufferManager.cs
- SchemaObjectWriter.cs
- ResourceSet.cs
- RowUpdatingEventArgs.cs
- ResourceContainer.cs
- DataContext.cs
- ListMarkerLine.cs
- HashCodeCombiner.cs
- DBSchemaRow.cs
- FrameworkElementFactoryMarkupObject.cs
- NativeBuffer.cs
- ArraySortHelper.cs
- BitmapScalingModeValidation.cs
- Message.cs
- DependencyObjectType.cs
- PasswordTextContainer.cs
- NavigationWindowAutomationPeer.cs
- SingleAnimationUsingKeyFrames.cs
- Attributes.cs
- RotateTransform.cs
- StackOverflowException.cs
- _Events.cs
- DBSqlParserTable.cs
- HtmlToClrEventProxy.cs
- Compiler.cs
- QueryOutputWriter.cs
- LowerCaseStringConverter.cs
- GenericIdentity.cs
- ImpersonateTokenRef.cs
- RankException.cs
- CollectionViewGroupInternal.cs
- Rule.cs
- TextEditor.cs
- ProfilePropertyNameValidator.cs
- DispatcherProcessingDisabled.cs
- AbstractSvcMapFileLoader.cs
- PropertyNames.cs
- BindUriHelper.cs
- DefaultPropertiesToSend.cs
- KnownIds.cs
- WebPartCollection.cs
- ApplicationDirectory.cs
- DataGridViewCellParsingEventArgs.cs
- HttpConfigurationSystem.cs
- HMACRIPEMD160.cs
- PropertyValueChangedEvent.cs
- ComplexPropertyEntry.cs
- ThreadStaticAttribute.cs