419 references to Size
Microsoft.AspNetCore.DataProtection (1)
Repositories\RegistryXmlRepository.cs (1)
84var registryView = IntPtr.Size == 4 ? RegistryView.Registry32 : RegistryView.Registry64;
Microsoft.AspNetCore.Routing (2)
Matching\ILEmitTrieFactory.cs (1)
55return (IntPtr.Size == 8) &&
Matching\JumpTableBuilder.cs (1)
68var threshold = IntPtr.Size == 8 ? 100 : 50;
Microsoft.AspNetCore.Routing.Tests (1)
Matching\ILEmitTrieFactoryTest.cs (1)
13var is64Bit = IntPtr.Size == 8;
Microsoft.Build (2)
InprocTrackingNativeMethods.cs (1)
153private static readonly Lazy<string> fileTrackerDllName = new Lazy<string>(() => RuntimeInformation.ProcessArchitecture == Architecture.Arm64 ? "FileTrackerA4.dll" : (IntPtr.Size == sizeof(Int32)) ? "FileTracker32.dll" : "FileTracker64.dll");
XMakeAttributes.cs (1)
446currentArchitecture = (IntPtr.Size == sizeof(Int64)) ? MSBuildArchitectureValues.x64 : MSBuildArchitectureValues.x86;
Microsoft.Build.Framework (1)
SegmentedArrayHelper.cs (1)
92return (2 * IntPtr.Size) + (elementSize * segmentSize);
Microsoft.Build.Tasks.Core (1)
XMakeAttributes.cs (1)
446currentArchitecture = (IntPtr.Size == sizeof(Int64)) ? MSBuildArchitectureValues.x64 : MSBuildArchitectureValues.x86;
Microsoft.CodeAnalysis (1)
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
126return (2 * IntPtr.Size + 8) + (elementSize * segmentSize);
Microsoft.CodeAnalysis.CodeStyle (1)
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
126return (2 * IntPtr.Size + 8) + (elementSize * segmentSize);
Microsoft.CodeAnalysis.Collections.Package (1)
Internal\SegmentedArrayHelper.cs (1)
126return (2 * IntPtr.Size + 8) + (elementSize * segmentSize);
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (20)
CodeGen\CodeGenReadonlyStructTests.cs (1)
1258var isx86 = (IntPtr.Size == 4);
CodeGen\UnsafeTests.cs (19)
7049bool isx86 = (IntPtr.Size == 4); 8069bool isx86 = (IntPtr.Size == 4); 8682bool isx86 = (IntPtr.Size == 4); 8783bool isx86 = (IntPtr.Size == 4); 8884bool isx86 = (IntPtr.Size == 4); 8919bool isx86 = (IntPtr.Size == 4); 9007bool isx86 = (IntPtr.Size == 4); 9054bool isx86 = (IntPtr.Size == 4); 9155bool isx86 = (IntPtr.Size == 4); 9198bool isx86 = (IntPtr.Size == 4); 9268bool isx86 = (IntPtr.Size == 4); 9369bool isx86 = (IntPtr.Size == 4); 9470bool isx86 = (IntPtr.Size == 4); 9505bool isx86 = (IntPtr.Size == 4); 9540bool isx86 = (IntPtr.Size == 4); 9597bool isx86 = (IntPtr.Size == 4); 9654bool isx86 = (IntPtr.Size == 4); 9700bool isx86 = (IntPtr.Size == 4); 10452bool isx86 = (IntPtr.Size == 4);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (91)
Emit\NumericIntPtrTests.cs (91)
1335int size = IntPtr.Size; 2262CompileAndVerify(comp, expectedOutput: IncludeExpectedOutput(IntPtr.Size == 4 ? "System.OverflowException" : "1152921504606846975"), verify: Verification.FailsPEVerify); 2300CompileAndVerify(comp, verify: Verification.FailsPEVerify, expectedOutput: IncludeExpectedOutput(IntPtr.Size == 4 ? "-1" : "1152921504606846975")); 2388constantConversion(sourceType, destinationType, sourceValue, useChecked: true, checkedError, IntPtr.Size == 4 ? checked32 : checked64); 2389constantConversion(sourceType, destinationType, sourceValue, useChecked: false, uncheckedError, IntPtr.Size == 4 ? unchecked32 : unchecked64); 6041object result = (IntPtr.Size == 4) ? 6293expectedResult: $"-2147483647, 0, 1, 2147483647, {(IntPtr.Size == 4 ? "-2147483648" : "2147483648")}", 6329expectedResult: $"1, 2147483648, 4294967295, {(IntPtr.Size == 4 ? "0" : "4294967296")}", 6365expectedResult: $"{(IntPtr.Size == 4 ? "2147483647" : "-2147483649")}, -2147483648, -1, 0, 2147483646", 6401expectedResult: $"{(IntPtr.Size == 4 ? uint.MaxValue.ToString() : ulong.MaxValue.ToString())}, 0, 4294967294", 6438expectedResult: $"-2147483647, 0, 1, 2147483647, {(IntPtr.Size == 4 ? "System.OverflowException" : "2147483648")}", 6474expectedResult: $"1, 2147483648, 4294967295, {(IntPtr.Size == 4 ? "System.OverflowException" : "4294967296")}", 6510expectedResult: $"{(IntPtr.Size == 4 ? "System.OverflowException" : "-2147483649")}, -2147483648, -1, 0, 2147483646", 6667expectedResult: $"-2147483647, 0, 1, 2147483647, {(IntPtr.Size == 4 ? "-2147483648" : "2147483648")}", 6705expectedResult: $"1, 2147483648, 4294967295, {(IntPtr.Size == 4 ? "0" : "4294967296")}", 6743expectedResult: $"{(IntPtr.Size == 4 ? "2147483647" : "-2147483649")}, -2147483648, -1, 0, 2147483646", 6781expectedResult: $"{(IntPtr.Size == 4 ? uint.MaxValue.ToString() : ulong.MaxValue.ToString())}, 0, 4294967294", 8763unaryOperatorCheckedOverflow("System.IntPtr", "-", intMinValue, IntPtr.Size == 4 ? "-2147483648" : "2147483648", IntPtr.Size == 4 ? "System.OverflowException" : "2147483648"); 8774unaryOperatorNotConstant("System.UIntPtr", "~", "0", IntPtr.Size == 4 ? uintMaxValue : ulongMaxValue); 8775unaryOperatorNotConstant("System.UIntPtr", "~", uintMaxValue, IntPtr.Size == 4 ? "0" : "18446744069414584320"); 8777binaryOperatorCheckedOverflow("System.IntPtr", "+", "System.IntPtr", intMinValue, "System.IntPtr", "-1", IntPtr.Size == 4 ? "2147483647" : "-2147483649", IntPtr.Size == 4 ? "System.OverflowException" : "-2147483649"); 8779binaryOperatorCheckedOverflow("System.IntPtr", "+", "System.IntPtr", "1", "System.IntPtr", intMaxValue, IntPtr.Size == 4 ? "-2147483648" : "2147483648", IntPtr.Size == 4 ? "System.OverflowException" : "2147483648"); 8781binaryOperatorCheckedOverflow("System.UIntPtr", "+", "System.UIntPtr", "1", "System.UIntPtr", uintMaxValue, IntPtr.Size == 4 ? "0" : "4294967296", IntPtr.Size == 4 ? "System.OverflowException" : "4294967296"); 8784binaryOperatorCheckedOverflow("System.IntPtr", "-", "System.IntPtr", intMinValue, "System.IntPtr", "1", IntPtr.Size == 4 ? "2147483647" : "-2147483649", IntPtr.Size == 4 ? "System.OverflowException" : "-2147483649"); 8787binaryOperatorCheckedOverflow("System.IntPtr", "-", "System.IntPtr", "-2", "System.IntPtr", intMaxValue, IntPtr.Size == 4 ? "2147483647" : "-2147483649", IntPtr.Size == 4 ? "System.OverflowException" : "-2147483649"); 8788binaryOperatorCheckedOverflow("System.UIntPtr", "-", "System.UIntPtr", "0", "System.UIntPtr", "1", IntPtr.Size == 4 ? uintMaxValue : ulongMaxValue, "System.OverflowException"); 8791binaryOperatorCheckedOverflow("System.IntPtr", "*", "System.IntPtr", intMinValue, "System.IntPtr", "2", IntPtr.Size == 4 ? "0" : "-4294967296", IntPtr.Size == 4 ? "System.OverflowException" : "-4294967296"); 8792binaryOperatorCheckedOverflow("System.IntPtr", "*", "System.IntPtr", intMinValue, "System.IntPtr", "-1", IntPtr.Size == 4 ? "-2147483648" : "2147483648", IntPtr.Size == 4 ? "System.OverflowException" : "2147483648"); 8794binaryOperatorCheckedOverflow("System.IntPtr", "*", "System.IntPtr", "2", "System.IntPtr", intMaxValue, IntPtr.Size == 4 ? "-2" : "4294967294", IntPtr.Size == 4 ? "System.OverflowException" : "4294967294"); 8795binaryOperatorCheckedOverflow("System.UIntPtr", "*", "System.UIntPtr", uintMaxValue, "System.UIntPtr", "2", IntPtr.Size == 4 ? "4294967294" : "8589934590", IntPtr.Size == 4 ? "System.OverflowException" : "8589934590"); 8799binaryOperatorCheckedOverflow("System.IntPtr", "/", "System.IntPtr", intMinValue, "System.IntPtr", "-1", IntPtr.Size == 4 ? "System.OverflowException" : "2147483648", IntPtr.Size == 4 ? "System.OverflowException" : "2147483648"); 8809binaryOperatorCheckedOverflow("System.IntPtr", "%", "System.IntPtr", intMinValue, "System.IntPtr", "-1", IntPtr.Size == 4 ? "System.OverflowException" : "0", IntPtr.Size == 4 ? "System.OverflowException" : "0"); 8860binaryOperatorNotConstant("System.IntPtr", "<<", "System.IntPtr", intMinValue, "int", "1", IntPtr.Size == 4 ? "0" : "-4294967296"); 8862binaryOperatorNotConstant("System.IntPtr", "<<", "System.IntPtr", "-1", "int", "32", IntPtr.Size == 4 ? "-1" : "-4294967296"); 8864binaryOperatorNotConstant("System.UIntPtr", "<<", "System.UIntPtr", uintMaxValue, "int", "1", IntPtr.Size == 4 ? "4294967294" : "8589934590"); 8866binaryOperatorNotConstant("System.UIntPtr", "<<", "System.UIntPtr", "1", "int", "32", IntPtr.Size == 4 ? "1" : "4294967296"); 9128CompileAndVerify(comp, verify: Verification.FailsPEVerify, expectedOutput: IncludeExpectedOutput(IntPtr.Size == 4 ? "System.OverflowException" : "4294967337")).VerifyDiagnostics( 9146CompileAndVerify(comp, verify: Verification.FailsPEVerify, expectedOutput: IncludeExpectedOutput(IntPtr.Size == 4 ? "41" : "4294967337")).VerifyDiagnostics(); 9195CompileAndVerify(comp, verify: Verification.FailsPEVerify, expectedOutput: IncludeExpectedOutput(IntPtr.Size == 4 ? "System.OverflowException" : "2147483648")).VerifyDiagnostics( 9213CompileAndVerify(comp, verify: Verification.FailsPEVerify, expectedOutput: IncludeExpectedOutput(IntPtr.Size == 4 ? "-2147483648" : "2147483648")).VerifyDiagnostics(); 9259{(IntPtr.Size == 4 ? "System.OverflowException" : "2147483648")} 9261{(IntPtr.Size == 4 ? "System.OverflowException" : "0")}")); 9282var expectedValue = IntPtr.Size == 4 ? "fffffffffffffffe" : "fffffffe"; 9306var expectedValue = IntPtr.Size == 4 ? "fffffffe" : "1fffffffe"; 9389convert(fromType: "nint", toType: "nuint", "int.MinValue", IntPtr.Size == 4 ? "2147483648" : "18446744071562067968", null, "System.OverflowException", "conv.ovf.u"); 9393convert(fromType: "nuint", toType: "nint", "uint.MaxValue", IntPtr.Size == 4 ? "-1" : "4294967295", null, IntPtr.Size == 4 ? "System.OverflowException" : "4294967295", "conv.ovf.i.un"); 9395string nintMinValue = IntPtr.Size == 4 ? int.MinValue.ToString() : long.MinValue.ToString(); 9396string nintMaxValue = IntPtr.Size == 4 ? int.MaxValue.ToString() : long.MaxValue.ToString(); 9397string nuintMaxValue = IntPtr.Size == 4 ? uint.MaxValue.ToString() : ulong.MaxValue.ToString(); 9399convert(fromType: "nint", toType: "ulong", nintMinValue, IntPtr.Size == 4 ? "18446744071562067968" : "9223372036854775808", "conv.i8", "System.OverflowException", "conv.ovf.u8"); 9400convert(fromType: "nint", toType: "ulong", nintMaxValue, IntPtr.Size == 4 ? "2147483647" : "9223372036854775807", "conv.i8", IntPtr.Size == 4 ? "2147483647" : "9223372036854775807", "conv.ovf.u8"); 9401convert(fromType: "nint", toType: "nuint", nintMinValue, IntPtr.Size == 4 ? "2147483648" : "9223372036854775808", null, "System.OverflowException", "conv.ovf.u"); 9402convert(fromType: "nint", toType: "nuint", nintMaxValue, IntPtr.Size == 4 ? "2147483647" : "9223372036854775807", null, IntPtr.Size == 4 ? "2147483647" : "9223372036854775807", "conv.ovf.u"); 9404convert(fromType: "nuint", toType: "long", nuintMaxValue, IntPtr.Size == 4 ? "4294967295" : "-1", "conv.u8", IntPtr.Size == 4 ? "4294967295" : "System.OverflowException", "conv.ovf.i8.un"); 9518{(IntPtr.Size == 4 ? "4294967254" : "18446744073709551574")} 9520{(IntPtr.Size == 4 ? "4294967254" : "18446744073709551574")} 9528{(IntPtr.Size == 4 ? "2147483648" : "18446744071562067968")} 9530{(IntPtr.Size == 4 ? "2147483648" : "18446744071562067968")} 9532{(IntPtr.Size == 4 ? "-1" : "4294967295")} 9534{(IntPtr.Size == 4 ? "System.OverflowException" : "4294967295")} 9721convert(baseType: null, fromType: "E", toType: "nuint", "int.MinValue", IntPtr.Size == 4 ? "2147483648" : "18446744071562067968", "conv.i", "System.OverflowException", "conv.ovf.u"); 9732convert(baseType: "sbyte", fromType: "E", toType: "nuint", "sbyte.MinValue", IntPtr.Size == 4 ? "4294967168" : "18446744073709551488", "conv.i", "System.OverflowException", "conv.ovf.u"); 9752convert(baseType: "short", fromType: "E", toType: "nuint", "short.MinValue", IntPtr.Size == 4 ? "4294934528" : "18446744073709518848", "conv.i", "System.OverflowException", "conv.ovf.u"); 9772convert(baseType: "int", fromType: "E", toType: "nuint", "int.MinValue", IntPtr.Size == 4 ? "2147483648" : "18446744071562067968", "conv.i", "System.OverflowException", "conv.ovf.u"); 9781convert(baseType: "uint", fromType: "E", toType: "nint", "uint.MaxValue", IntPtr.Size == 4 ? "-1" : "4294967295", "conv.u", IntPtr.Size == 4 ? "System.OverflowException" : "4294967295", "conv.ovf.i.un"); 9790convert(baseType: "long", fromType: "E", toType: "nint", "long.MinValue", IntPtr.Size == 4 ? "0" : "-9223372036854775808", "conv.i", IntPtr.Size == 4 ? "System.OverflowException" : "-9223372036854775808", "conv.ovf.i"); 9791convert(baseType: "long", fromType: "E", toType: "nint", "long.MaxValue", IntPtr.Size == 4 ? "-1" : "9223372036854775807", "conv.i", IntPtr.Size == 4 ? "System.OverflowException" : "9223372036854775807", "conv.ovf.i"); 9792convert(baseType: "long", fromType: "E", toType: "nuint", "long.MinValue", IntPtr.Size == 4 ? "0" : "9223372036854775808", "conv.u", "System.OverflowException", "conv.ovf.u"); 9793convert(baseType: "long", fromType: "E", toType: "nuint", "long.MaxValue", IntPtr.Size == 4 ? "4294967295" : "9223372036854775807", "conv.u", IntPtr.Size == 4 ? "System.OverflowException" : "9223372036854775807", "conv.ovf.u"); 9802convert(baseType: "ulong", fromType: "E", toType: "nuint", "ulong.MaxValue", IntPtr.Size == 4 ? "4294967295" : "18446744073709551615", "conv.u", IntPtr.Size == 4 ? "System.OverflowException" : "18446744073709551615", "conv.ovf.u.un");
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (11)
EndToEndTests.cs (11)
125int numberFluentCalls = (IntPtr.Size, ExecutionConditionUtil.Configuration) switch 131_ => throw new Exception($"Unexpected configuration {IntPtr.Size * 8}-bit {ExecutionConditionUtil.Configuration}") 182int numberFluentCalls = (IntPtr.Size, ExecutionConditionUtil.Configuration, RuntimeUtilities.IsDesktopRuntime, RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) switch 191_ => throw new Exception($"Unexpected configuration {IntPtr.Size * 8}-bit {ExecutionConditionUtil.Configuration}, Desktop: {RuntimeUtilities.IsDesktopRuntime}") 221throw new Exception($"Depth: {i}, Bytes: {IntPtr.Size}, Config: {ExecutionConditionUtil.Configuration}, Desktop: {RuntimeUtilities.IsDesktopRuntime}", e); 263int nestingLevel = (IntPtr.Size, ExecutionConditionUtil.Configuration) switch 270_ => throw new Exception($"Unexpected configuration {IntPtr.Size * 8}-bit {ExecutionConditionUtil.Configuration}") 415int nestingLevel = (IntPtr.Size, ExecutionConditionUtil.Configuration) switch 421_ => throw new Exception($"Unexpected configuration {IntPtr.Size * 8}-bit {ExecutionConditionUtil.Configuration}") 550int n = (IntPtr.Size, ExecutionConditionUtil.Configuration) switch 556_ => throw new Exception($"Unexpected configuration {IntPtr.Size * 8}-bit {ExecutionConditionUtil.Configuration}")
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (92)
Semantics\NativeIntegerTests.cs (91)
4346int size = IntPtr.Size; 6397CompileAndVerify(comp, expectedOutput: IntPtr.Size == 4 ? "System.OverflowException" : "1152921504606846975"); 6434CompileAndVerify(comp, expectedOutput: IntPtr.Size == 4 ? "-1" : "1152921504606846975"); 6525constantConversion(sourceType, destinationType, sourceValue, useChecked: true, checkedError, IntPtr.Size == 4 ? checked32 : checked64); 6526constantConversion(sourceType, destinationType, sourceValue, useChecked: false, uncheckedError, IntPtr.Size == 4 ? unchecked32 : unchecked64); 9530object result = (IntPtr.Size == 4) ? 9770expectedResult: $"-2147483647, 0, 1, 2147483647, {(IntPtr.Size == 4 ? "-2147483648" : "2147483648")}", 9806expectedResult: $"1, 2147483648, 4294967295, {(IntPtr.Size == 4 ? "0" : "4294967296")}", 9844expectedResult: $"{(IntPtr.Size == 4 ? "2147483647" : "-2147483649")}, -2147483648, -1, 0, 2147483646", 9880expectedResult: $"{(IntPtr.Size == 4 ? uint.MaxValue.ToString() : ulong.MaxValue.ToString())}, 0, 4294967294", 9919expectedResult: $"-2147483647, 0, 1, 2147483647, {(IntPtr.Size == 4 ? "System.OverflowException" : "2147483648")}", 9955expectedResult: $"1, 2147483648, 4294967295, {(IntPtr.Size == 4 ? "System.OverflowException" : "4294967296")}", 9993expectedResult: $"{(IntPtr.Size == 4 ? "System.OverflowException" : "-2147483649")}, -2147483648, -1, 0, 2147483646", 10145expectedResult: $"-2147483647, 0, 1, 2147483647, {(IntPtr.Size == 4 ? "-2147483648" : "2147483648")}", 10183expectedResult: $"1, 2147483648, 4294967295, {(IntPtr.Size == 4 ? "0" : "4294967296")}", 10221expectedResult: $"{(IntPtr.Size == 4 ? "2147483647" : "-2147483649")}, -2147483648, -1, 0, 2147483646", 10259expectedResult: $"{(IntPtr.Size == 4 ? uint.MaxValue.ToString() : ulong.MaxValue.ToString())}, 0, 4294967294", 13013unaryOperatorCheckedOverflow("nint", "-", intMinValue, IntPtr.Size == 4 ? "-2147483648" : "2147483648", IntPtr.Size == 4 ? "System.OverflowException" : "2147483648"); 13024unaryOperatorNotConstant("nuint", "~", "0", IntPtr.Size == 4 ? uintMaxValue : ulongMaxValue); 13025unaryOperatorNotConstant("nuint", "~", uintMaxValue, IntPtr.Size == 4 ? "0" : "18446744069414584320"); 13027binaryOperatorCheckedOverflow("nint", "+", "nint", intMinValue, "nint", "-1", IntPtr.Size == 4 ? "2147483647" : "-2147483649", IntPtr.Size == 4 ? "System.OverflowException" : "-2147483649"); 13029binaryOperatorCheckedOverflow("nint", "+", "nint", "1", "nint", intMaxValue, IntPtr.Size == 4 ? "-2147483648" : "2147483648", IntPtr.Size == 4 ? "System.OverflowException" : "2147483648"); 13031binaryOperatorCheckedOverflow("nuint", "+", "nuint", "1", "nuint", uintMaxValue, IntPtr.Size == 4 ? "0" : "4294967296", IntPtr.Size == 4 ? "System.OverflowException" : "4294967296"); 13034binaryOperatorCheckedOverflow("nint", "-", "nint", intMinValue, "nint", "1", IntPtr.Size == 4 ? "2147483647" : "-2147483649", IntPtr.Size == 4 ? "System.OverflowException" : "-2147483649"); 13037binaryOperatorCheckedOverflow("nint", "-", "nint", "-2", "nint", intMaxValue, IntPtr.Size == 4 ? "2147483647" : "-2147483649", IntPtr.Size == 4 ? "System.OverflowException" : "-2147483649"); 13038binaryOperatorCheckedOverflow("nuint", "-", "nuint", "0", "nuint", "1", IntPtr.Size == 4 ? uintMaxValue : ulongMaxValue, "System.OverflowException"); 13041binaryOperatorCheckedOverflow("nint", "*", "nint", intMinValue, "nint", "2", IntPtr.Size == 4 ? "0" : "-4294967296", IntPtr.Size == 4 ? "System.OverflowException" : "-4294967296"); 13042binaryOperatorCheckedOverflow("nint", "*", "nint", intMinValue, "nint", "-1", IntPtr.Size == 4 ? "-2147483648" : "2147483648", IntPtr.Size == 4 ? "System.OverflowException" : "2147483648"); 13044binaryOperatorCheckedOverflow("nint", "*", "nint", "2", "nint", intMaxValue, IntPtr.Size == 4 ? "-2" : "4294967294", IntPtr.Size == 4 ? "System.OverflowException" : "4294967294"); 13045binaryOperatorCheckedOverflow("nuint", "*", "nuint", uintMaxValue, "nuint", "2", IntPtr.Size == 4 ? "4294967294" : "8589934590", IntPtr.Size == 4 ? "System.OverflowException" : "8589934590"); 13049binaryOperatorCheckedOverflow("nint", "/", "nint", intMinValue, "nint", "-1", IntPtr.Size == 4 ? "System.OverflowException" : "2147483648", IntPtr.Size == 4 ? "System.OverflowException" : "2147483648"); 13059binaryOperatorCheckedOverflow("nint", "%", "nint", intMinValue, "nint", "-1", IntPtr.Size == 4 ? "System.OverflowException" : "0", IntPtr.Size == 4 ? "System.OverflowException" : "0"); 13110binaryOperatorNotConstant("nint", "<<", "nint", intMinValue, "int", "1", IntPtr.Size == 4 ? "0" : "-4294967296"); 13112binaryOperatorNotConstant("nint", "<<", "nint", "-1", "int", "32", IntPtr.Size == 4 ? "-1" : "-4294967296"); 13114binaryOperatorNotConstant("nuint", "<<", "nuint", uintMaxValue, "int", "1", IntPtr.Size == 4 ? "4294967294" : "8589934590"); 13116binaryOperatorNotConstant("nuint", "<<", "nuint", "1", "int", "32", IntPtr.Size == 4 ? "1" : "4294967296"); 13372CompileAndVerify(comp, expectedOutput: IntPtr.Size == 4 ? "System.OverflowException" : "4294967337").VerifyDiagnostics( 13389CompileAndVerify(comp, expectedOutput: IntPtr.Size == 4 ? "41" : "4294967337").VerifyDiagnostics(); 13437CompileAndVerify(comp, expectedOutput: IntPtr.Size == 4 ? "System.OverflowException" : "2147483648").VerifyDiagnostics( 13454CompileAndVerify(comp, expectedOutput: IntPtr.Size == 4 ? "-2147483648" : "2147483648").VerifyDiagnostics(); 13499{(IntPtr.Size == 4 ? "System.OverflowException" : "2147483648")} 13501{(IntPtr.Size == 4 ? "System.OverflowException" : "0")}"); 13522var expectedValue = IntPtr.Size == 4 ? "fffffffffffffffe" : "fffffffe"; 13546var expectedValue = IntPtr.Size == 4 ? "fffffffe" : "1fffffffe"; 13754convert(fromType: "nint", toType: "nuint", "int.MinValue", IntPtr.Size == 4 ? "2147483648" : "18446744071562067968", null, "System.OverflowException", "conv.ovf.u"); 13758convert(fromType: "nuint", toType: "nint", "uint.MaxValue", IntPtr.Size == 4 ? "-1" : "4294967295", null, IntPtr.Size == 4 ? "System.OverflowException" : "4294967295", "conv.ovf.i.un"); 13760string nintMinValue = IntPtr.Size == 4 ? int.MinValue.ToString() : long.MinValue.ToString(); 13761string nintMaxValue = IntPtr.Size == 4 ? int.MaxValue.ToString() : long.MaxValue.ToString(); 13762string nuintMaxValue = IntPtr.Size == 4 ? uint.MaxValue.ToString() : ulong.MaxValue.ToString(); 13764convert(fromType: "nint", toType: "ulong", nintMinValue, IntPtr.Size == 4 ? "18446744071562067968" : "9223372036854775808", "conv.i8", "System.OverflowException", "conv.ovf.u8"); 13765convert(fromType: "nint", toType: "ulong", nintMaxValue, IntPtr.Size == 4 ? "2147483647" : "9223372036854775807", "conv.i8", IntPtr.Size == 4 ? "2147483647" : "9223372036854775807", "conv.ovf.u8"); 13766convert(fromType: "nint", toType: "nuint", nintMinValue, IntPtr.Size == 4 ? "2147483648" : "9223372036854775808", null, "System.OverflowException", "conv.ovf.u"); 13767convert(fromType: "nint", toType: "nuint", nintMaxValue, IntPtr.Size == 4 ? "2147483647" : "9223372036854775807", null, IntPtr.Size == 4 ? "2147483647" : "9223372036854775807", "conv.ovf.u"); 13769convert(fromType: "nuint", toType: "long", nuintMaxValue, IntPtr.Size == 4 ? "4294967295" : "-1", "conv.u8", IntPtr.Size == 4 ? "4294967295" : "System.OverflowException", "conv.ovf.i8.un"); 13881{(IntPtr.Size == 4 ? "4294967254" : "18446744073709551574")} 13883{(IntPtr.Size == 4 ? "4294967254" : "18446744073709551574")} 13891{(IntPtr.Size == 4 ? "2147483648" : "18446744071562067968")} 13893{(IntPtr.Size == 4 ? "2147483648" : "18446744071562067968")} 13895{(IntPtr.Size == 4 ? "-1" : "4294967295")} 13897{(IntPtr.Size == 4 ? "System.OverflowException" : "4294967295")} 14084convert(baseType: null, fromType: "E", toType: "nuint", "int.MinValue", IntPtr.Size == 4 ? "2147483648" : "18446744071562067968", "conv.i", "System.OverflowException", "conv.ovf.u"); 14092convert(baseType: "sbyte", fromType: "E", toType: "nuint", "sbyte.MinValue", IntPtr.Size == 4 ? "4294967168" : "18446744073709551488", "conv.i", "System.OverflowException", "conv.ovf.u"); 14106convert(baseType: "short", fromType: "E", toType: "nuint", "short.MinValue", IntPtr.Size == 4 ? "4294934528" : "18446744073709518848", "conv.i", "System.OverflowException", "conv.ovf.u"); 14120convert(baseType: "int", fromType: "E", toType: "nuint", "int.MinValue", IntPtr.Size == 4 ? "2147483648" : "18446744071562067968", "conv.i", "System.OverflowException", "conv.ovf.u"); 14126convert(baseType: "uint", fromType: "E", toType: "nint", "uint.MaxValue", IntPtr.Size == 4 ? "-1" : "4294967295", "conv.u", IntPtr.Size == 4 ? "System.OverflowException" : "4294967295", "conv.ovf.i.un"); 14132convert(baseType: "long", fromType: "E", toType: "nint", "long.MinValue", IntPtr.Size == 4 ? "0" : "-9223372036854775808", "conv.i", IntPtr.Size == 4 ? "System.OverflowException" : "-9223372036854775808", "conv.ovf.i"); 14133convert(baseType: "long", fromType: "E", toType: "nint", "long.MaxValue", IntPtr.Size == 4 ? "-1" : "9223372036854775807", "conv.i", IntPtr.Size == 4 ? "System.OverflowException" : "9223372036854775807", "conv.ovf.i"); 14134convert(baseType: "long", fromType: "E", toType: "nuint", "long.MinValue", IntPtr.Size == 4 ? "0" : "9223372036854775808", "conv.u", "System.OverflowException", "conv.ovf.u"); 14135convert(baseType: "long", fromType: "E", toType: "nuint", "long.MaxValue", IntPtr.Size == 4 ? "4294967295" : "9223372036854775807", "conv.u", IntPtr.Size == 4 ? "System.OverflowException" : "9223372036854775807", "conv.ovf.u"); 14141convert(baseType: "ulong", fromType: "E", toType: "nuint", "ulong.MaxValue", IntPtr.Size == 4 ? "4294967295" : "18446744073709551615", "conv.u", IntPtr.Size == 4 ? "System.OverflowException" : "18446744073709551615", "conv.ovf.u.un");
Semantics\UnsafeTests.cs (1)
618var expectedOutput = IntPtr.Size.ToString();
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (2)
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\NativeViewExpansion.cs (1)
55var name = "(IUnknown*)0x" + string.Format(IntPtr.Size == 4 ? "{0:x8}" : "{0:x16}", comObject.NativeComPointer);
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.Values.cs (1)
121if (IntPtr.Size == 8)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (2)
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\NativeViewExpansion.cs (1)
55var name = "(IUnknown*)0x" + string.Format(IntPtr.Size == 4 ? "{0:x8}" : "{0:x16}", comObject.NativeComPointer);
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.Values.cs (1)
121if (IntPtr.Size == 8)
Microsoft.CodeAnalysis.InteractiveHost (1)
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
126return (2 * IntPtr.Size + 8) + (elementSize * segmentSize);
Microsoft.CodeAnalysis.Scripting (1)
src\Compilers\Shared\GlobalAssemblyCacheHelpers\GlobalAssemblyCache.cs (1)
37public static readonly ImmutableArray<ProcessorArchitecture> CurrentArchitectures = (IntPtr.Size == 4)
Microsoft.CodeAnalysis.Test.Utilities (3)
Assert\ConditionalFactAttribute.cs (3)
168public static bool IsBitness64 => IntPtr.Size == 8; 193public override bool ShouldSkip => IntPtr.Size != 4; 200public override bool ShouldSkip => IntPtr.Size != 8;
Microsoft.CodeAnalysis.Threading.Package (1)
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
126return (2 * IntPtr.Size + 8) + (elementSize * segmentSize);
Microsoft.CodeAnalysis.Workspaces (1)
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
126return (2 * IntPtr.Size + 8) + (elementSize * segmentSize);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
126return (2 * IntPtr.Size + 8) + (elementSize * segmentSize);
Microsoft.Extensions.Caching.Hybrid.Tests (1)
HybridCacheEventSourceTests.cs (1)
226log.WriteLine($".NET {Environment.Version} on {Environment.OSVersion}, {IntPtr.Size * 8}-bit");
Microsoft.Extensions.Caching.Memory (2)
MemoryCache.cs (2)
288if (IntPtr.Size == 4) 309if (IntPtr.Size == 4)
Microsoft.ML.FastTree (1)
Training\TreeLearners\LeastSquaresRegressionTreeLearner.cs (1)
162_sizeOfReservedMemory += (long)IntPtr.Size * TrainData.NumFlocks;
Microsoft.VisualStudio.LanguageServices (3)
Utilities\IVsShellExtensions.cs (1)
34value = (IntPtr.Size == 4) ? (IntPtr)(int)objValue : (IntPtr)(long)objValue;
Venus\ContainedLanguage.IVsContainedLanguageCodeSupport.cs (2)
242var current = Marshal.AllocCoTaskMem(source.Count() * IntPtr.Size); 247current = IntPtr.Add(current, IntPtr.Size);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
ProjectSystemShim\CSharpHelpers.cs (1)
70Assert.Equal(sizeof(HACK_VariantStructure), 8 + 2 * IntPtr.Size);
MSBuild (1)
XMakeAttributes.cs (1)
446currentArchitecture = (IntPtr.Size == sizeof(Int64)) ? MSBuildArchitectureValues.x64 : MSBuildArchitectureValues.x86;
MSBuildTaskHost (2)
Concurrent\ConcurrentDictionary.cs (1)
87return IntPtr.Size == 8;
XMakeAttributes.cs (1)
450string currentArchitecture = (IntPtr.Size == sizeof(Int64)) ? MSBuildArchitectureValues.x64 : MSBuildArchitectureValues.x86;
PresentationFramework (14)
MS\Internal\Printing\PrintDlgExMarshaler.cs (1)
694return IntPtr.Size == sizeof(long);
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (6)
143m._array = Marshal.AllocCoTaskMem(length * IntPtr.Size); 210data = Marshal.AllocCoTaskMem(length * IntPtr.Size); 640var byte_length = length * IntPtr.Size; 698var byte_length = length * IntPtr.Size; 726var byte_length = length * IntPtr.Size; 731bytes += IntPtr.Size;
System\Windows\Documents\InputScopeAttribute.cs (3)
84ppbstrPhrases = Marshal.AllocCoTaskMem(IntPtr.Size * count); 105offset += IntPtr.Size; 111offset += IntPtr.Size;
System\Windows\Standard\NativeMethods.cs (4)
2361IntPtr currArg = Marshal.ReadIntPtr(argv, i * IntPtr.Size); 2754if (8 == IntPtr.Size) 2910if (8 == IntPtr.Size) 2941if (8 == IntPtr.Size)
PresentationUI (1)
MS\Internal\Documents\Application\CommandEnforcer.cs (1)
135if ((!_isRMMissing) && (IntPtr.Size == 4))
ReachFramework (4)
PrintConfig\FallbackPTProvider.cs (4)
751IntPtr pPrinterName = Marshal.ReadIntPtr(ptr, 1 * IntPtr.Size); 758IntPtr pPortName = Marshal.ReadIntPtr(ptr, 3 * IntPtr.Size); 765IntPtr pDriverName = Marshal.ReadIntPtr(ptr, 4 * IntPtr.Size); 772IntPtr pDevMode = Marshal.ReadIntPtr(ptr, 7 * IntPtr.Size);
StackDepthTest (1)
Program.cs (1)
42Console.WriteLine($"Running in {IntPtr.Size * 8}-bit mode");
System.Collections (2)
System\Collections\Generic\OrderedDictionary.cs (2)
1093if (IntPtr.Size == 8) 1149if (IntPtr.Size == 8)
System.Collections.Concurrent (5)
System\Collections\Concurrent\ConcurrentDictionary.cs (3)
2257if (IntPtr.Size == 8) 2274if (IntPtr.Size == 8) 2309if (IntPtr.Size == 8)
System\Collections\Concurrent\PartitionerStatic.cs (2)
1659Debug.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size"); 1660chunkSize = (DEFAULT_BYTES_PER_CHUNK / IntPtr.Size);
System.Collections.Immutable (1)
System\Collections\Frozen\Constants.cs (1)
82|| ((typeof(T) == typeof(nint) || typeof(T) == typeof(nuint)) && IntPtr.Size == 4);
System.Data.Odbc (16)
Common\System\Data\Common\AdapterUtil.Odbc.cs (1)
573internal static readonly int PtrSize = IntPtr.Size;
Common\System\Data\ProviderBase\DbBuffer.cs (5)
317Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 342ValidateCheck(offset, IntPtr.Size); 593Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 616ValidateCheck(offset, IntPtr.Size); 617Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
System\Data\Odbc\OdbcDataReader.cs (5)
2351buffer.PtrOffset(256, IntPtr.Size).Handle); 2427buffer.PtrOffset(256, IntPtr.Size).Handle); 2521IntPtr colnameActual = buffer.PtrOffset(colnameActualOffset, IntPtr.Size).Handle; 2522IntPtr indexActual = buffer.PtrOffset(indexActualOffset, IntPtr.Size).Handle; 2523IntPtr ordinalActual = buffer.PtrOffset(ordinalActualOffset, IntPtr.Size).Handle;
System\Data\Odbc\OdbcParameter.cs (3)
786_preparedValueOffset = _preparedIntOffset + IntPtr.Size; 787parameterBufferSize += (cbParameterSize + IntPtr.Size); 808HandleRef intBuffer = parameterBuffer.PtrOffset(_preparedIntOffset, IntPtr.Size);
System\Data\Odbc\OdbcParameterCollection.cs (2)
125parameterBufferSize = (parameterBufferSize + (IntPtr.Size - 1)) & ~(IntPtr.Size - 1); // align buffer;
System.Diagnostics.DiagnosticSource (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Diagnostics.Process (1)
System\Diagnostics\Process.Linux.cs (1)
228switch (IntPtr.Size)
System.IO.Compression (1)
System\IO\Compression\ZipArchiveEntry.cs (1)
389private static readonly bool s_allowLargeZipArchiveEntriesInUpdateMode = IntPtr.Size > 4;
System.IO.MemoryMappedFiles (5)
System\IO\MemoryMappedFiles\MemoryMappedFile.cs (4)
295if (IntPtr.Size == 4 && capacity > uint.MaxValue) 352if (IntPtr.Size == 4 && capacity > uint.MaxValue) 411if (IntPtr.Size == 4 && size > uint.MaxValue) 445if (IntPtr.Size == 4 && size > uint.MaxValue)
System\IO\MemoryMappedFiles\MemoryMappedView.cs (1)
86if (IntPtr.Size == 4 && newSize > uint.MaxValue)
System.Linq.Parallel (2)
System\Linq\Parallel\Scheduling\Scheduling.cs (2)
88Debug.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size"); 89chunkSize = (DEFAULT_BYTES_PER_CHUNK / IntPtr.Size);
System.Net.Http (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Net.HttpListener (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Net.Mail (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Net.NetworkInformation (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Net.Primitives (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Net.Quic (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Net.Security (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Net.WebClient (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Numerics.Tensors (4)
System\Numerics\Tensors\netcore\TensorPrimitives.ConvertHelpers.cs (4)
769private static bool IsUInt32Like<T>() => typeof(T) == typeof(uint) || (IntPtr.Size == 4 && typeof(T) == typeof(nuint)); 772private static bool IsInt32Like<T>() => typeof(T) == typeof(int) || (IntPtr.Size == 4 && typeof(T) == typeof(nint)); 775private static bool IsUInt64Like<T>() => typeof(T) == typeof(ulong) || (IntPtr.Size == 8 && typeof(T) == typeof(nuint)); 778private static bool IsInt64Like<T>() => typeof(T) == typeof(long) || (IntPtr.Size == 8 && typeof(T) == typeof(nint));
System.Private.CoreLib (56)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
src\libraries\System.Private.CoreLib\src\System\Array.cs (7)
931if (IntPtr.Size == 4) 935if (IntPtr.Size == 4) 1431if (IntPtr.Size == 4) 1658if (IntPtr.Size == 4) 1866if (IntPtr.Size == 4) 2071if (IntPtr.Size == 4) 2075if (IntPtr.Size == 4)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeMetadataGenerator.cs (1)
662return IntPtr.Size == 4 ? TypeCode.Int32 : TypeCode.Int64;
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipePayloadDecoder.cs (1)
34payload = payload.Slice(IntPtr.Size);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (2)
1827else if (IntPtr.Size == 4 && dataType == typeof(IntPtr)) 1887else if (IntPtr.Size == 8 && dataType == typeof(IntPtr))
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleTypeInfos.cs (2)
152public static TraceLoggingTypeInfo IntPtr() => s_intptr ??= new ScalarArrayTypeInfo(typeof(IntPtr[]), Statics.IntPtrType, System.IntPtr.Size); 153public static TraceLoggingTypeInfo UIntPtr() => s_uintptr ??= new ScalarArrayTypeInfo(typeof(UIntPtr[]), Statics.UIntPtrType, System.IntPtr.Size);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\Statics.cs (3)
32public static readonly TraceLoggingDataType IntPtrType = IntPtr.Size == 8 35public static readonly TraceLoggingDataType UIntPtrType = IntPtr.Size == 8 38public static readonly TraceLoggingDataType HexIntPtrType = IntPtr.Size == 8
src\libraries\System.Private.CoreLib\src\System\Environment.cs (1)
208public static bool Is64BitProcess => IntPtr.Size == 8;
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (1)
26int ret = Interop.Kernel32.LCMapStringEx(cultureName, Interop.Kernel32.LCMAP_SORTHANDLE, null, 0, &handle, IntPtr.Size, null, null, IntPtr.Zero);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (8)
1934if (lowInclusive is int or uint || (IntPtr.Size == 4 && (lowInclusive is nint or nuint))) 1943if (lowInclusive is long or ulong || (IntPtr.Size == 8 && (lowInclusive is nint or nuint))) 1999if (lowInclusive is int or uint || (IntPtr.Size == 4 && (lowInclusive is nint or nuint))) 2008if (lowInclusive is long or ulong || (IntPtr.Size == 8 && (lowInclusive is nint or nuint))) 2064if (lowInclusive is int or uint || (IntPtr.Size == 4 && (lowInclusive is nint or nuint))) 2073if (lowInclusive is long or ulong || (IntPtr.Size == 8 && (lowInclusive is nint or nuint))) 2129if (lowInclusive is int or uint || (IntPtr.Size == 4 && (lowInclusive is nint or nuint))) 2138if (lowInclusive is long or ulong || (IntPtr.Size == 8 && (lowInclusive is nint or nuint)))
src\libraries\System.Private.CoreLib\src\System\Reflection\FieldAccessor.cs (4)
455if (IntPtr.Size == 4) 459else if (IntPtr.Size == 8) 471if (IntPtr.Size == 4) 475else if (IntPtr.Size == 8)
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokerEmitUtil.cs (1)
180il.Emit(OpCodes.Ldc_I4, i * IntPtr.Size);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ComVariant.cs (4)
27if (IntPtr.Size == 4) 29Debug.Assert(variantSize == (4 * IntPtr.Size)); 33Debug.Assert(IntPtr.Size == 8); 34Debug.Assert(variantSize == (3 * IntPtr.Size));
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeBuffer.cs (1)
91if (IntPtr.Size == 4 && numBytes > uint.MaxValue)
src\libraries\System.Private.CoreLib\src\System\Runtime\MemoryFailPoint.Unix.cs (1)
12return IntPtr.Size == 4 ? uint.MaxValue : ulong.MaxValue;
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (1)
34private static int HashShiftPerElement => IntPtr.Size == 8 ? 2 : 1;
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (1)
385int maxLength = IntPtr.Size == 4 ? 1_000_000_000 : int.MaxValue;
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.CaseConversion.cs (2)
316if (IntPtr.Size >= 8 && (elementCount - i) >= (nuint)(8 / sizeof(TFrom))) 426if (IntPtr.Size < 8 || !Vector128.IsHardwareAccelerated)
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.cs (3)
1356if (IntPtr.Size >= 8) 1399if (IntPtr.Size >= 8) 1459if (IntPtr.Size >= 8)
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Utility.cs (4)
558if (IntPtr.Size >= 8) 590if (IntPtr.Size >= 8) 641if (IntPtr.Size >= 8) 701if (IntPtr.Size >= 8)
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf16Utility.Validation.cs (2)
237if (IntPtr.Size == 8) 305if (IntPtr.Size == 8)
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Validation.cs (1)
454if (IntPtr.Size >= 8 && BitConverter.IsLittleEndian)
src\System\GC.CoreCLR.cs (2)
135if (IntPtr.Size == 4) 146if (IntPtr.Size == 4)
src\System\StubHelpers.cs (2)
936vt = (IntPtr.Size == 4 ? VarEnum.VT_I4 : VarEnum.VT_I8); 940vt = (IntPtr.Size == 4 ? VarEnum.VT_UI4 : VarEnum.VT_UI8);
System.Private.DataContractSerialization (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Private.Uri (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Private.Windows.Core (2)
Windows\Win32\System\Variant\VARIANT.cs (2)
121return IntPtr.Size == 8 ? (ulong)data : (object)(uint)data; 734return (uint)IntPtr.Size;
System.Private.Xml (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Reflection.Metadata (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Runtime.Caching (1)
System\Runtime\Caching\CacheMemoryMonitor.cs (1)
92bool is64bit = (IntPtr.Size == 8);
System.Security.Cryptography (2)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (1)
289int targetSize = checked(chainSize * IntPtr.Size);
System.Security.Cryptography.Pkcs (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Security.Cryptography.Xml (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Text.Encodings.Web (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Text.Json (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Text.RegularExpressions (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Text.RegularExpressions.Generator (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Threading.Tasks.Parallel (2)
System\Threading\Tasks\ParallelRangeManager.cs (2)
114if (IntPtr.Size == 4 && _use32BitCurrentIndex) 254_use32BitCurrentIndex = IntPtr.Size == 4 && nRangeSize <= int.MaxValue;
System.Web.HttpUtility (1)
src\libraries\Common\src\System\HexConverter.cs (1)
414if (IntPtr.Size == 8)
System.Windows.Forms (2)
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.cs (2)
1431ptrToFree = Marshal.AllocHGlobal((nint)(sizeToAllocate + (IntPtr.Size - 1))); 1571nuint add = (nuint)(alignment ?? IntPtr.Size) - 1;
System.Windows.Forms.Primitives (1)
Windows\Win32\UI\Controls\ToolInfoWrapper.cs (1)
14private static uint TTTOOLINFO_V2_Size => IntPtr.Size == 4 ? 44u : 64u;
System.Windows.Forms.Primitives.Tests (8)
Interop\Ole32\CALPOLESTRTests.cs (1)
38pElems = (PWSTR*)Marshal.AllocCoTaskMem(IntPtr.Size * values.Length)
Interop\Oleaut32\ITypeInfoTests.cs (3)
257Assert.Equal((uint)IntPtr.Size, pTypeAttr->cbSizeInstance); 262Assert.Equal(7 * IntPtr.Size, pTypeAttr->cbSizeVft); 263Assert.Equal((ushort)IntPtr.Size, pTypeAttr->cbAlignment);
Interop\Oleaut32\SAFEARRAYTests.cs (3)
45yield return new object[] { VT_BSTR, FADF_HAVEVARTYPE | FADF_BSTR, IntPtr.Size }; 46yield return new object[] { VT_UNKNOWN, FADF_HAVEIID | FADF_UNKNOWN, IntPtr.Size }; 47yield return new object[] { VT_DISPATCH, FADF_HAVEIID | FADF_DISPATCH, IntPtr.Size };
Interop\Richedit\EDITSTREAMTests.cs (1)
13if (IntPtr.Size == 4)
System.Windows.Forms.Primitives.TestUtilities (2)
ArchitectureDetection.cs (2)
8public static bool Is32bit => IntPtr.Size == 4; 9public static bool Is64bit => IntPtr.Size == 8;
System.Windows.Forms.Tests (12)
System\Windows\Forms\RichTextBoxTests.cs (12)
10228Marshal.WriteInt32(ptr, IntPtr.Size * 2, (int)PInvoke.EN_PROTECTED); 10229Marshal.WriteInt32(ptr, IntPtr.Size * 2 + IntPtr.Size, (int)PInvokeCore.EM_SETCHARFORMAT); 10230Marshal.WriteIntPtr(ptr, IntPtr.Size * 2 + IntPtr.Size + 4 + IntPtr.Size, (IntPtr)(&format)); 10464Marshal.WriteInt32(ptr, IntPtr.Size * 2, (int)PInvoke.EN_PROTECTED); 10465Marshal.WriteInt32(ptr, IntPtr.Size * 2 + IntPtr.Size, (int)PInvokeCore.EM_SETCHARFORMAT); 10466Marshal.WriteIntPtr(ptr, IntPtr.Size * 2 + IntPtr.Size + 4 + IntPtr.Size, (IntPtr)(&format));
UIAutomationClient (2)
MS\Internal\Automation\Misc.cs (1)
401if (IntPtr.Size == 4)
System\Windows\Automation\Condition.cs (1)
60IntPtr mem = Marshal.AllocCoTaskMem(conditions.Length * IntPtr.Size);
UIAutomationClientSideProviders (2)
MS\Internal\AutomationProxies\CommonXSendMessage.cs (1)
154if (IntPtr.Size == sizeof(int))
MS\Win32\UnsafeNativeMethods.cs (1)
374if (IntPtr.Size == 4)
xunit.console (2)
common\AssemblyResolution\Microsoft.DotNet.PlatformAbstractions\RuntimeEnvironment.cs (1)
23return IntPtr.Size == 8 ? "x64" : "x86";
ConsoleRunner.cs (1)
182Console.WriteLine($"Microsoft.DotNet.XUnitConsoleRunner v{typeof(ConsoleRunner).Assembly.GetName().Version} ({IntPtr.Size * 8}-bit {platform})");