136 references to SizeOf
aspire (1)
Processes\DetachedProcessLauncher.Windows.cs (1)
79si.cb = Marshal.SizeOf<STARTUPINFOEX>();
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\EndpointHtmlRenderer.Streaming.cs (1)
132var bufSizeRequired = count * Marshal.SizeOf<ComponentIdAndDepth>();
Microsoft.AspNetCore.Components.Server (1)
BlazorPack\SequenceOfT.cs (1)
23private static readonly int DefaultLengthFromArrayPool = 1 + (4095 / Marshal.SizeOf<T>());
Microsoft.AspNetCore.Server.HttpSys (7)
AuthenticationManager.cs (1)
23Marshal.SizeOf<HTTP_SERVER_AUTHENTICATION_INFO>();
NativeInterop\RequestQueue.cs (1)
65nLength = (uint)Marshal.SizeOf<SECURITY_ATTRIBUTES>(),
NativeInterop\UrlGroup.cs (4)
18private static readonly int BindingInfoSize = Marshal.SizeOf<HTTP_BINDING_INFO>(); 19private static readonly int QosInfoSize = Marshal.SizeOf<HTTP_QOS_SETTING_INFO>(); 20private static readonly int RequestPropertyInfoSize = Marshal.SizeOf<HTTP_BINDING_INFO>(); 21private static readonly int ChannelBindInfoSize = Marshal.SizeOf<HTTP_CHANNEL_BIND_INFO>();
TimeoutManager.cs (1)
19Marshal.SizeOf<HTTP_TIMEOUT_LIMIT_INFO>();
Microsoft.CodeAnalysis.Scripting (1)
src\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\ClrGlobalAssemblyCache.cs (1)
241cbAssemblyInfo = (uint)Marshal.SizeOf<ASSEMBLY_INFO>(),
Microsoft.CSharp (2)
Microsoft\CSharp\RuntimeBinder\ComInterop\ExcepInfo.cs (2)
32Debug.Assert(Marshal.SizeOf<ExcepInfo>() == Marshal.SizeOf<ComTypes.EXCEPINFO>());
Microsoft.Extensions.Diagnostics.ResourceMonitoring (2)
Windows\Network\WindowsTcpStateInfo.cs (2)
163rowPtr = IntPtr.Add(rowPtr, Marshal.SizeOf<MIB_TCPROW>()); 188rowPtr = IntPtr.Add(rowPtr, Marshal.SizeOf<MIB_TCP6ROW>());
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (2)
Windows\Tcp6TableInfoTests.cs (2)
130fakePtr = IntPtr.Add(fakePtr, Marshal.SizeOf<MIB_TCP6ROW>()); 222fakePtr = IntPtr.Add(fakePtr, Marshal.SizeOf<MIB_TCP6ROW>());
Microsoft.ML.Vision (1)
ImageClassificationTrainer.cs (1)
1551int sizeOfTString = Marshal.SizeOf<TF_TString>();
Microsoft.TestPlatform.Extensions.BlameDataCollector (1)
ProcessCodeMethods.cs (1)
95var res = NtQueryInformationProcess(handle, 0, out var pbi, Marshal.SizeOf<ProcessBasicInformation>(), out int size);
Microsoft.VisualBasic.Forms (2)
Microsoft\VisualBasic\Helpers\NativeMethods.vb (1)
130dwLength = CType(Marshal.SizeOf(Of MEMORYSTATUSEX)(), UInt32)
Microsoft\VisualBasic\Helpers\NativeTypes.SECURITY_ATTRIBUTES.vb (1)
17nLength = Marshal.SizeOf(Of SECURITY_ATTRIBUTES)()
NuGet.Packaging (7)
Signing\Cms\NativeCms.cs (5)
109int sizeOfCryptAttributeString = Marshal.SizeOf<CRYPT_ATTRIBUTE_STRING>(); 110int sizeOfCryptIntegerBlob = Marshal.SizeOf<CRYPT_INTEGER_BLOB>(); 171int sizeOfCryptAttributeString = Marshal.SizeOf<CRYPT_ATTRIBUTE_STRING>(); 189int sizeOfCryptIntegerBlob = Marshal.SizeOf<CRYPT_INTEGER_BLOB>(); 317var sizeOfCryptAttribute = Marshal.SizeOf<CRYPT_ATTRIBUTE>();
Signing\Cms\NativeUtility.cs (2)
169int sizeOfCryptAttribute = Marshal.SizeOf<CRYPT_ATTRIBUTE>(); 170int sizeOfCryptIntegerBlob = Marshal.SizeOf<CRYPT_INTEGER_BLOB>();
PresentationFramework (21)
MS\Internal\WindowsRuntime\Generated\Windows.Data.Text.cs (6)
458var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 3); 630var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 17); 1142var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 3); 1294var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 4); 1482var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 1); 1576var nativeVftbl = ComWrappersSupport.AllocateVtableMemory(typeof(WordSegmentsTokenizingHandler), Marshal.SizeOf<global::WinRT.Interop.IDelegateVftbl>());
MS\Internal\WindowsRuntime\Generated\Windows.Globalization.cs (6)
233var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 4); 417var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 1); 491var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 1); 572var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 1); 655var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 2); 771var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 1);
MS\Internal\WindowsRuntime\Generated\WinRT\IInspectable.cs (1)
45AbiToProjectionVftablePtr = Marshal.AllocHGlobal(Marshal.SizeOf<Vftbl>());
MS\Internal\WindowsRuntime\Generated\WinRT\Interop\ExceptionErrorInfo.cs (2)
107var nativeVftbl = (IntPtr*)Marshal.AllocCoTaskMem(Marshal.SizeOf<Vftbl>()); 341var nativeVftbl = (IntPtr*)Marshal.AllocCoTaskMem(Marshal.SizeOf<Vftbl>());
MS\Internal\WindowsRuntime\Generated\WinRT\Interop\IUnknownVftbl.cs (1)
25AbiToProjectionVftblPtr = Marshal.AllocHGlobal(Marshal.SizeOf<IUnknownVftbl>());
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (2)
308var byte_length = length * Marshal.SizeOf<T>(); 319int byte_length = array.Length * Marshal.SizeOf<T>();
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IEnumerable.cs (2)
117var nativeVftbl = (IntPtr*)Marshal.AllocCoTaskMem(Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 1); 449var nativeVftbl = (IntPtr*)Marshal.AllocCoTaskMem(Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 4);
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IReadOnlyList.cs (1)
239var nativeVftbl = (IntPtr*)Marshal.AllocCoTaskMem(Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 4);
System.Data.OleDb (12)
OleDb_Util.cs (11)
565internal static readonly int SizeOf_tagDBBINDING = Marshal.SizeOf<tagDBBINDING>(); 566internal static readonly int SizeOf_tagDBCOLUMNINFO = Marshal.SizeOf<tagDBCOLUMNINFO>(); 567internal static readonly int SizeOf_tagDBLITERALINFO = Marshal.SizeOf<tagDBLITERALINFO>(); 568internal static readonly int SizeOf_tagDBPROPSET = Marshal.SizeOf<tagDBPROPSET>(); 569internal static readonly int SizeOf_tagDBPROP = IsRunningOnX86 ? Marshal.SizeOf<tagDBPROP_x86>() : Marshal.SizeOf<tagDBPROP>(); 570internal static readonly int SizeOf_tagDBPROPINFOSET = Marshal.SizeOf<tagDBPROPINFOSET>(); 571internal static readonly int SizeOf_tagDBPROPINFO = IsRunningOnX86 ? Marshal.SizeOf<tagDBPROPINFO_x86>() : Marshal.SizeOf<tagDBPROPINFO>(); 572internal static readonly int SizeOf_tagDBPROPIDSET = Marshal.SizeOf<tagDBPROPIDSET>(); 573internal static readonly int SizeOf_Guid = Marshal.SizeOf<Guid>();
System\Data\ProviderBase\DbBuffer.cs (1)
360ValidateCheck(offset, Marshal.SizeOf<T>());
System.Diagnostics.PerformanceCounter (5)
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.PERF_INFO.cs (5)
18internal static readonly int SizeOf = Marshal.SizeOf<PERF_COUNTER_BLOCK>(); 44internal static readonly int SizeOf = Marshal.SizeOf<PERF_COUNTER_DEFINITION>(); 81internal static readonly int SizeOf = Marshal.SizeOf<PERF_DATA_BLOCK>(); 107internal static readonly int SizeOf = Marshal.SizeOf<PERF_INSTANCE_DEFINITION>(); 144internal static readonly int SizeOf = Marshal.SizeOf<PERF_OBJECT_TYPE>();
System.DirectoryServices (22)
System\DirectoryServices\ActiveDirectory\ActiveDirectoryReplicationMetaData.cs (2)
67addr = IntPtr.Add(info, sizeof(int) * 2 + i * Marshal.SizeOf<DS_REPL_ATTR_META_DATA_2>()); 74addr = IntPtr.Add(info, sizeof(int) * 2 + i * Marshal.SizeOf<DS_REPL_ATTR_META_DATA>());
System\DirectoryServices\ActiveDirectory\ActiveDirectorySite.cs (1)
1334tmpPtr = IntPtr.Add(val, Marshal.SizeOf<DS_NAME_RESULT_ITEM>() * i);
System\DirectoryServices\ActiveDirectory\ForestTrustRelationshipInformation.cs (6)
118fileTime = Marshal.AllocHGlobal(Marshal.SizeOf<FileTime>()); 137tmpPtr = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_FOREST_TRUST_RECORD>()); 166tmpPtr = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_FOREST_TRUST_RECORD>()); 199tmpPtr = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_FOREST_TRUST_RECORD>()); 225tmpPtr = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_FOREST_TRUST_RECORD>()); 238forestInfo = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_FOREST_TRUST_INFORMATION>());
System\DirectoryServices\ActiveDirectory\ReplicationCursorCollection.cs (2)
58addr = IntPtr.Add(info, sizeof(int) * 2 + i * Marshal.SizeOf<DS_REPL_CURSOR_3>()); 72addr = IntPtr.Add(info, sizeof(int) * 2 + i * Marshal.SizeOf<DS_REPL_CURSOR>());
System\DirectoryServices\ActiveDirectory\ReplicationFailureCollection.cs (1)
55addr = IntPtr.Add(info, sizeof(int) * 2 + i * Marshal.SizeOf<DS_REPL_KCC_DSA_FAILURE>());
System\DirectoryServices\ActiveDirectory\ReplicationNeighborCollection.cs (1)
55addr = IntPtr.Add(info, sizeof(int) * 2 + i * Marshal.SizeOf<DS_REPL_NEIGHBOR>());
System\DirectoryServices\ActiveDirectory\ReplicationOperationCollection.cs (2)
55addr = IntPtr.Add(info, Marshal.SizeOf<DS_REPL_PENDING_OPS>() + i * Marshal.SizeOf<DS_REPL_OP>());
System\DirectoryServices\ActiveDirectory\TrustHelper.cs (6)
460fileTime = Marshal.AllocHGlobal(Marshal.SizeOf<FileTime>()); 475unmanagedAuthData = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_AUTH_INFORMATION>()); 613fileTime = Marshal.AllocHGlobal(Marshal.SizeOf<FileTime>()); 628unmanagedAuthData = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_AUTH_INFORMATION>()); 739fileTime = Marshal.AllocHGlobal(Marshal.SizeOf<FileTime>()); 754unmanagedAuthData = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_AUTH_INFORMATION>());
System\DirectoryServices\DirectorySearcher.cs (1)
847IntPtr vlvPtr = Marshal.AllocHGlobal(Marshal.SizeOf<AdsVLV>());
System.DirectoryServices.AccountManagement (2)
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaLookupSids.cs (1)
31referencedDomains.Initialize((uint)Marshal.SizeOf<Interop.LSA_REFERENCED_DOMAIN_LIST>());
System\DirectoryServices\AccountManagement\AD\SidList.cs (1)
136namesHandle.Initialize((uint)sidCount, (uint)Marshal.SizeOf<Interop.LSA_TRANSLATED_NAME>());
System.DirectoryServices.Protocols (8)
System\DirectoryServices\Protocols\common\BerConverter.cs (1)
529int structSize = Marshal.SizeOf<BerVal>();
System\DirectoryServices\Protocols\Interop\LdapPal.Linux.cs (1)
229currentInteractPtr = IntPtr.Add(currentInteractPtr, Marshal.SizeOf<SaslInteractiveChallenge>());
System\DirectoryServices\Protocols\ldap\LdapConnection.cs (4)
526int structSize = Marshal.SizeOf<LdapControl>(); 640int modStructSize = Marshal.SizeOf<LdapMod>(); 1059length = Marshal.SizeOf<SEC_WINNT_AUTH_IDENTITY_EX>(), 1324int structSize = Marshal.SizeOf<BerVal>();
System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs (2)
574int structSize = Marshal.SizeOf<LdapControl>(); 873sizeofcallback = Marshal.SizeOf<LdapReferralCallback>(),
System.Net.Http.WinHttpHandler (3)
System\Net\Http\WinHttpHandler.cs (1)
1429(uint)Marshal.SizeOf<Interop.Crypt32.CERT_CONTEXT>());
System\Net\Http\WinHttpRequestCallback.cs (2)
111statusInformationLength == Marshal.SizeOf<Interop.WinHttp.WINHTTP_ASYNC_RESULT>(), 113" must be sizeof(WINHTTP_ASYNC_RESULT)=" + Marshal.SizeOf<Interop.WinHttp.WINHTTP_ASYNC_RESULT>());
System.Net.Ping (1)
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
394Debug.Assert(Marshal.SizeOf<IcmpHeader>() == 8, "The size of an ICMP Header must be 8 bytes.");
System.Security.Principal.Windows (1)
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaLookupSids.cs (1)
31referencedDomains.Initialize((uint)Marshal.SizeOf<Interop.LSA_REFERENCED_DOMAIN_LIST>());
System.ServiceProcess.ServiceController (2)
System\ServiceProcess\ServiceController.cs (2)
219IntPtr structPtr = (IntPtr)(pEnumBuffer + ((nint)i * Marshal.SizeOf<Interop.Advapi32.ENUM_SERVICE_STATUS>())); 786IntPtr structPtr = (IntPtr)(pMemory + ((nint)i * Marshal.SizeOf<Interop.Advapi32.ENUM_SERVICE_STATUS_PROCESS>()));
System.Speech (28)
AudioFormat\AudioFormatConverter.cs (1)
20IntPtr extraDataPtr = new(waveFormatPtr.ToInt64() + Marshal.SizeOf<WaveFormatEx>());
Internal\SapiInterop\SapiRecoInterop.cs (2)
453int size = Marshal.SizeOf<SPPHRASEELEMENT>(); 508spPhrase.cbSize = (uint)Marshal.SizeOf<SPPHRASE>();
Internal\SrgsCompiler\BackEnd.cs (5)
1013uint ulOffset = (uint)Marshal.SizeOf<CfgGrammar.CfgSerializedHeader>(); 1040ulOffset += (uint)(_rules.Count * Marshal.SizeOf<CfgRule>()); 1045ulOffset += (uint)(cArcs * Marshal.SizeOf<CfgArc>()); 1075ulOffset += (uint)(cSemanticTags * Marshal.SizeOf<CfgSemanticTag>()); 1078ulOffset += (uint)(_scriptRefs.Count * Marshal.SizeOf<CfgScriptRef>());
Internal\SrgsCompiler\CFGGrammar.cs (7)
281if (cfgSerializedHeader.pszWords < Marshal.SizeOf<CfgSerializedHeader>()) 303streamHelper.Stream.Position = (int)cfgSerializedHeader.pRules + (header.rules.Length * Marshal.SizeOf<CfgRule>()); 328if (pFH.pszWords < Marshal.SizeOf<CfgSerializedHeader>()) 420CheckSetOffsets(pFH.pRules, pFH.cRules * Marshal.SizeOf<CfgRule>(), ref ullStartOffset, pFH.ulTotalSerializedSize); 426CheckSetOffsets(pFH.pArcs, pFH.cArcs * Marshal.SizeOf<CfgArc>(), ref ullStartOffset, pFH.ulTotalSerializedSize); 438CheckSetOffsets(pFH.tags, pFH.cTags * Marshal.SizeOf<CfgSemanticTag>(), ref ullStartOffset, pFH.ulTotalSerializedSize); 475CheckSetOffsets(pFH.pScripts, pFH.cScripts * Marshal.SizeOf<CfgScriptRef>(), ref ullStartOffset, pFH.ulTotalSerializedSize);
Internal\StreamMarshaler.cs (4)
30int sizeOfOne = Marshal.SizeOf<T>(); 46int sizeOfOne = Marshal.SizeOf<T>(); 118int sizeObject = Marshal.SizeOf<T>(); 130int sizeObject = Marshal.SizeOf<T>();
Internal\Synthesis\AudioBase.cs (3)
239int cRiff = Marshal.SizeOf<RIFFHDR>(); 240int cBlock = Marshal.SizeOf<BLOCKHDR>(); 242int cDataHdr = Marshal.SizeOf<DATAHDR>();
Internal\Synthesis\AudioDeviceOut.cs (1)
314Interop.WinMM.MMSYSERR result = Interop.WinMM.waveOutGetDevCaps((IntPtr)deviceId, ref caps, Marshal.SizeOf<Interop.WinMM.WAVEOUTCAPS>());
Internal\Synthesis\WaveHeader.cs (1)
89return Marshal.SizeOf<Interop.WinMM.WAVEHDR>();
Result\RecognitionResult.cs (2)
303if (headerSize == Marshal.SizeOf<SPRESULTHEADER_Sapi51>()) // SAPI 5.1 size 362int sizeOfSpSerializedPhraseAlt = Marshal.SizeOf<SPSERIALIZEDPHRASEALT>();
Result\RecognizedPhrase.cs (2)
164int sizeofPhraseElement = Marshal.SizeOf<SPSERIALIZEDPHRASEELEMENT>(); 297for (int i = 0; i < _serializedPhrase.cReplacements; i++, itnBuffer = (nint)itnBuffer + Marshal.SizeOf<SPPHRASEREPLACEMENT>())
System.Windows.Extensions (2)
System\Media\SoundPlayer.cs (2)
572if (dw < Marshal.SizeOf<Interop.WinMM.WAVEFORMATEX>()) 574dw = Marshal.SizeOf<Interop.WinMM.WAVEFORMATEX>();
System.Windows.Forms (1)
System\Windows\Forms\Controls\WebBrowser\WebBrowserSiteBase.cs (1)
267lpFrameInfo->cb = (uint)Marshal.SizeOf<OLEINPLACEFRAMEINFO>();