5768 references to Marshal
aspire (8)
Processes\DetachedProcessLauncher.Windows.cs (8)
34throw new Win32Exception(Marshal.GetLastWin32Error(), "Failed to open NUL device"); 40throw new Win32Exception(Marshal.GetLastWin32Error(), "Failed to set NUL handle inheritance"); 47var attrList = Marshal.AllocHGlobal(attrListSize); 52throw new Win32Exception(Marshal.GetLastWin32Error(), "Failed to initialize process thread attribute list"); 73throw new Win32Exception(Marshal.GetLastWin32Error(), "Failed to update process thread attribute list"); 79si.cb = Marshal.SizeOf<STARTUPINFOEX>(); 103throw new Win32Exception(Marshal.GetLastWin32Error(), "Failed to create detached process"); 132Marshal.FreeHGlobal(attrList);
csc (6)
src\roslyn\src\Compilers\Shared\BuildClient.cs (1)
363var commandLine = Marshal.PtrToStringUni(ptr)!;
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (5)
469/// <returns>Pointer to environment block that must be freed with <see cref="Marshal.FreeHGlobal"/></returns> 491return Marshal.StringToHGlobalUni(envBlock.ToString()); 572startInfo.cb = Marshal.SizeOf(startInfo); 614logger.LogError("Failed to create process. GetLastError={0}", Marshal.GetLastWin32Error()); 622Marshal.FreeHGlobal(environmentBlockPtr);
dotnet (7)
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.9.0-1.26307.102\contentFiles\cs\net11.0\BuildServerConnection.cs (5)
469/// <returns>Pointer to environment block that must be freed with <see cref="Marshal.FreeHGlobal"/></returns> 491return Marshal.StringToHGlobalUni(envBlock.ToString()); 572startInfo.cb = Marshal.SizeOf(startInfo); 614logger.LogError("Failed to create process. GetLastError={0}", Marshal.GetLastWin32Error()); 622Marshal.FreeHGlobal(environmentBlockPtr);
Telemetry\ExternalTelemetryProperties.cs (2)
94return Marshal.PtrToStringUTF8(gnu_get_libc_release()); 118return Marshal.PtrToStringUTF8(gnu_get_libc_version());
dotnet-svcutil.xmlserializer (1)
Microsoft\Tools\ServiceModel\SvcUtil\InputModule.cs (1)
142&& Marshal.GetHRForException(ie) == ToolInputException.COR_E_ASSEMBLYEXPECTED)
dotnet-svcutil-lib (1)
FrameworkFork\Microsoft.CodeDom\Compiler\TempFiles.cs (1)
228if (retryCount == 0 || Marshal.GetHRForException(e) != HR_ERROR_FILE_EXISTS)
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
507Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
ILCompiler.Compiler (6)
Compiler\Disassembler.cs (1)
110instruction = Marshal.PtrToStringUTF8(GetOutputBuffer());
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\IntrinsicId.cs (5)
220/// <see cref="System.Runtime.InteropServices.Marshal.SizeOf(System.Type)"/> 224/// <see cref="System.Runtime.InteropServices.Marshal.OffsetOf(System.Type, string)"/> 228/// <see cref="System.Runtime.InteropServices.Marshal.PtrToStructure(nint, System.Type)"/> 232/// <see cref="System.Runtime.InteropServices.Marshal.DestroyStructure(nint, System.Type)"/> 236/// <see cref="System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(nint, System.Type)"/>
ILCompiler.Diagnostics (10)
_generated\0\Microsoft.DiaSymReader.ISymNGenWriter.cs (2)
59global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([18, 253, 130, 214, 222, 67, 28, 65, 129, 27, 190, 132, 4, 206, 161, 38]), (global::System.IntPtr)__this); 106global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([18, 253, 130, 214, 222, 67, 28, 65, 129, 27, 190, 132, 4, 206, 161, 38]), (global::System.IntPtr)__this);
_generated\1\Microsoft.DiaSymReader.ISymNGenWriter2.cs (7)
63global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([27, 229, 41, 176, 85, 76, 226, 79, 185, 147, 159, 123, 193, 241, 13, 180]), (global::System.IntPtr)__this); 110global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([27, 229, 41, 176, 85, 76, 226, 79, 185, 147, 159, 123, 193, 241, 13, 180]), (global::System.IntPtr)__this); 151global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([27, 229, 41, 176, 85, 76, 226, 79, 185, 147, 159, 123, 193, 241, 13, 180]), (global::System.IntPtr)__this); 197global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([27, 229, 41, 176, 85, 76, 226, 79, 185, 147, 159, 123, 193, 241, 13, 180]), (global::System.IntPtr)__this); 238global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([27, 229, 41, 176, 85, 76, 226, 79, 185, 147, 159, 123, 193, 241, 13, 180]), (global::System.IntPtr)__this); 293global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([27, 229, 41, 176, 85, 76, 226, 79, 185, 147, 159, 123, 193, 241, 13, 180]), (global::System.IntPtr)__this); 317global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([27, 229, 41, 176, 85, 76, 226, 79, 185, 147, 159, 123, 193, 241, 13, 180]), (global::System.IntPtr)__this);
PdbWriter.cs (1)
199Marshal.Release(pdbWriterInst);
ILCompiler.ReadyToRun (4)
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs (2)
4113Logger.LogMessage(Marshal.PtrToStringUTF8((IntPtr)szFile) + ":" + iLine); 4114Logger.LogMessage(Marshal.PtrToStringUTF8((IntPtr)szExpr));
src\runtime\src\coreclr\tools\Common\JitInterface\JitConfigProvider.cs (2)
184return s_instance.GetIntConfigValue(Marshal.PtrToStringUTF8((IntPtr)name), defaultValue); 190string result = s_instance.GetStringConfigValue(Marshal.PtrToStringUTF8((IntPtr)name));
ILCompiler.RyuJit (4)
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs (2)
4113Logger.LogMessage(Marshal.PtrToStringUTF8((IntPtr)szFile) + ":" + iLine); 4114Logger.LogMessage(Marshal.PtrToStringUTF8((IntPtr)szExpr));
src\runtime\src\coreclr\tools\Common\JitInterface\JitConfigProvider.cs (2)
184return s_instance.GetIntConfigValue(Marshal.PtrToStringUTF8((IntPtr)name), defaultValue); 190string result = s_instance.GetStringConfigValue(Marshal.PtrToStringUTF8((IntPtr)name));
illink (5)
ILLink.RoslynAnalyzer (5)
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\IntrinsicId.cs (5)
220/// <see cref="System.Runtime.InteropServices.Marshal.SizeOf(System.Type)"/> 224/// <see cref="System.Runtime.InteropServices.Marshal.OffsetOf(System.Type, string)"/> 228/// <see cref="System.Runtime.InteropServices.Marshal.PtrToStructure(nint, System.Type)"/> 232/// <see cref="System.Runtime.InteropServices.Marshal.DestroyStructure(nint, System.Type)"/> 236/// <see cref="System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(nint, System.Type)"/>
libmscordaccore_universal (1)
Entrypoints.cs (1)
306Marshal.QueryInterface((nint)ccw, *pIID, out nint ptrToIface);
Microsoft.AspNetCore.Components.Endpoints (1)
Rendering\EndpointHtmlRenderer.Streaming.cs (1)
131var 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.Cryptography.Internal (33)
_generated\0\LibraryImports.g.cs (27)
28global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 30__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 51global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 112global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 114__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 126global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 161global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 163__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 173global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 203global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 205__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 223global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 769global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 771__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 776global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 805global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 807__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 819global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 839global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 841__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 846global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 866global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 868__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 873global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 902global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 904__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 916global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
SafeHandles\LocalAllocHandle.cs (1)
21Marshal.FreeHGlobal(handle); // actually calls LocalFree
SafeHandles\SafeLibraryHandle.cs (3)
103return Marshal.GetDelegateForFunctionPointer<TDelegate>(pfnProc); 201int hr = Marshal.GetHRForLastWin32Error(); 202Marshal.ThrowExceptionForHR(hr);
SafeHandles\SecureLocalAllocHandle.cs (1)
46handle = Marshal.AllocHGlobal(cb); // actually calls LocalAlloc
UnsafeNativeMethods.cs (1)
478var lastError = Marshal.GetLastWin32Error();
Microsoft.AspNetCore.DataProtection (5)
Cng\DpapiSecretSerializerHelper.cs (5)
98var errorCode = Marshal.GetLastWin32Error(); 104Marshal.Copy((IntPtr)dataOut.pbData, retVal, 0, dataLength); 113Marshal.FreeHGlobal((IntPtr)dataOut.pbData); 241var errorCode = Marshal.GetLastWin32Error(); 254Marshal.FreeHGlobal((IntPtr)dataOut.pbData);
Microsoft.AspNetCore.Server.IISIntegration (3)
_generated\0\LibraryImports.g.cs (3)
14global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 16__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 21global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
Microsoft.Build.Framework (6)
_generated\0\LibraryImports.g.cs (3)
20global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 22__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 25global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
FileSystem\NativeWin32Exception.cs (1)
15/// associated recent error code (<see cref="System.Runtime.InteropServices.Marshal.GetLastWin32Error" />). The <see cref="Exception.Message" />
NativeMethods.cs (2)
830errorMessage = symbolicLinkCreated ? null : Marshal.GetLastWin32Error().ToString(); 976Marshal.ThrowExceptionForHR(errorCode);
Microsoft.Build.Tasks.CodeAnalysis (10)
src\roslyn\src\Compilers\Core\MSBuildTask\RCWForCurrentContext.cs (5)
40IntPtr iunknownPtr = Marshal.GetIUnknownForObject(rcw); 45objInCurrentCtx = Marshal.GetObjectForIUnknown(iunknownPtr); 49Marshal.Release(iunknownPtr); 116Marshal.IsComObject(_rcwForCurrentCtx)) 121Marshal.ReleaseComObject(_rcwForCurrentCtx);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (5)
469/// <returns>Pointer to environment block that must be freed with <see cref="Marshal.FreeHGlobal"/></returns> 491return Marshal.StringToHGlobalUni(envBlock.ToString()); 572startInfo.cb = Marshal.SizeOf(startInfo); 614logger.LogError("Failed to create process. GetLastError={0}", Marshal.GetLastWin32Error()); 622Marshal.FreeHGlobal(environmentBlockPtr);
Microsoft.Build.Tasks.Core (19)
Copy.cs (1)
1033int code = Marshal.GetHRForException(e);
ManifestUtil\ComImporter.cs (4)
63var typeLibAttr = (ComTypes.TYPELIBATTR)Marshal.PtrToStructure(typeLibAttrPtr, typeof(ComTypes.TYPELIBATTR)); 83ComTypes.TYPEATTR tinfoAttr = (ComTypes.TYPEATTR)Marshal.PtrToStructure(tinfoAttrPtr, typeof(ComTypes.TYPEATTR)); 104Marshal.ReleaseComObject(tinfo); 131Marshal.ReleaseComObject(tlib);
ManifestUtil\EmbeddedManifestReader.cs (1)
55Marshal.Copy(hResource, buffer, 0, buffer.Length);
ManifestUtil\mansign2.cs (9)
429string issuerKeyHash = Marshal.PtrToStringUni(pIssuerKeyHash); 545string publicKeyToken = Marshal.PtrToStringUni(pPublicKeyToken); 815throw new CryptographicException(Marshal.GetLastWin32Error()); 819var timestampContext = (Win32.CRYPT_TIMESTAMP_CONTEXT)Marshal.PtrToStructure(ppTsContext, typeof(Win32.CRYPT_TIMESTAMP_CONTEXT)); 821Marshal.Copy(timestampContext.pbEncoded, encodedBytes, 0, (int)timestampContext.cbEncoded); 893Marshal.Copy(timestampBlob.pbData, timestampSignature, 0, timestampSignature.Length); 1270_hash = Marshal.PtrToStringUni(signerInfo.pwszHash); 1274_description = Marshal.PtrToStringUni(signerInfo.pwszDescription); 1278_descriptionUrl = Marshal.PtrToStringUni(signerInfo.pwszDescriptionUrl);
ManifestUtil\SecurityUtil.cs (1)
740int exceptionHR = Marshal.GetHRForException(ex);
Move.cs (2)
274Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error());
NativeMethods.cs (1)
117errorMessage = hardLinkCreated ? null : log.FormatResourceString("Copy.NonWindowsLinkErrorMessage", "link()", Marshal.GetLastWin32Error());
Microsoft.CodeAnalysis (14)
DiaSymReader\SymUnmanagedFactory.cs (8)
123Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 132Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 138var creator = Marshal.GetDelegateForFunctionPointer<NativeFactory>(createAddress); 146Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 160lazyType = Marshal.GetTypeFromCLSID(clsid);
DiaSymReader\Utilities\ComMemoryStream.cs (2)
129Marshal.Copy(_chunks[chunkIndex], chunkOffset, (IntPtr)(pv + destinationIndex), bytesToCopy); 226Marshal.Copy((IntPtr)(pv + bytesWritten), _chunks[chunkIndex], chunkOffset, bytesToCopy);
DiaSymReader\Utilities\InteropUtilities.cs (1)
30Marshal.ThrowExceptionForHR(hr, s_ignoreIErrorInfo);
DiaSymReader\Writer\SymUnmanagedWriterImpl.cs (1)
370Marshal.GetNativeVariantForObject(value, new IntPtr(&variant));
InternalUtilities\ReadOnlyUnmanagedMemoryStream.cs (1)
38Marshal.Copy(_data + _position, buffer, offset, bytesRead);
StrongName\DesktopStrongNameProvider.cs (1)
218Marshal.Copy(keyBlob, pubKey, 0, keyBlobByteCount);
Microsoft.CodeAnalysis.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
507Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
Microsoft.CodeAnalysis.AnalyzerUtilities (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
507Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
Microsoft.CodeAnalysis.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
507Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
Microsoft.CodeAnalysis.Features (3)
Debugging\DebugInformationReaderProvider.cs (2)
90if (symReader != null && Marshal.IsComObject(symReader)) 95Marshal.ReleaseComObject(symReader);
EditAndContinue\EditAndContinueDebugInfoReader.cs (1)
223Marshal.ThrowExceptionForHR(hr);
Microsoft.CodeAnalysis.Rebuild (1)
CompilationOptionsReader.cs (1)
282Marshal.Copy(new IntPtr(contentPtr), content, 0, length);
Microsoft.CodeAnalysis.ResxSourceGenerator (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
507Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
Microsoft.CodeAnalysis.Scripting (15)
src\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\ClrGlobalAssemblyCache.cs (4)
152Exception e = Marshal.GetExceptionForHR(hr); 182Marshal.ThrowExceptionForHR(hr); 241cbAssemblyInfo = (uint)Marshal.SizeOf<ASSEMBLY_INFO>(), 252var result = Marshal.PtrToStringUni((IntPtr)info.pszCurrentAssemblyPathBuf, (int)info.cchBuf - 1);
src\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs (8)
142throw Marshal.GetExceptionForHR(hr); 151throw Marshal.GetExceptionForHR(hr); 154return Marshal.PtrToStringUni((IntPtr)p, (int)characterCountIncludingTerminator - 1); 171throw Marshal.GetExceptionForHR(hr); 180throw Marshal.GetExceptionForHR(hr); 197return Marshal.PtrToStringUni((IntPtr)p, (data.Length / 2) - 1); 293throw Marshal.GetExceptionForHR(hr); 437Marshal.ThrowExceptionForHR(CreateAssemblyNameObject(out result, null, 0, IntPtr.Zero));
src\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\GlobalAssemblyCacheLocation.cs (3)
53throw Marshal.GetExceptionForHR(hr); 62throw Marshal.GetExceptionForHR(hr); 65return Marshal.PtrToStringUni((IntPtr)p);
Microsoft.CodeAnalysis.Workspaces (4)
Serialization\SerializerService_Reference.cs (2)
490var unmanagedMemory = Marshal.AllocHGlobal(length); 501() => Marshal.FreeHGlobal(unmanagedMemory));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
507Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
TemporaryStorage\TemporaryStorageService.DirectMemoryAccessStreamReader.cs (1)
69Marshal.Copy((IntPtr)_position, buffer, index, count);
Microsoft.CodeAnalysis.Workspaces.MSBuild (3)
src\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\GlobalAssemblyCacheLocation.cs (3)
53throw Marshal.GetExceptionForHR(hr); 62throw Marshal.GetExceptionForHR(hr); 65return Marshal.PtrToStringUni((IntPtr)p);
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (1)
MonoMSBuildDiscovery.cs (1)
61var result = Marshal.PtrToStringAnsi(ptr); // uses UTF8 on Unix
Microsoft.CSharp (58)
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (1)
181return obj != null && Marshal.IsComObject(obj);
Microsoft\CSharp\RuntimeBinder\ComInterop\ComBinder.cs (1)
24return value != null && Marshal.IsComObject(value);
Microsoft\CSharp\RuntimeBinder\ComInterop\ComEventSinksContainer.cs (3)
27object data = Marshal.GetComObjectData(rcw, s_comObjectEventSinksKey); 35data = Marshal.GetComObjectData(rcw, s_comObjectEventSinksKey); 42if (!Marshal.SetComObjectData(rcw, s_comObjectEventSinksKey, comEventSinks))
Microsoft\CSharp\RuntimeBinder\ComInterop\ComInvokeBinder.cs (2)
501typeof(Marshal).GetMethod(nameof(Marshal.GetIDispatchForObject)),
Microsoft\CSharp\RuntimeBinder\ComInterop\ComObject.cs (3)
40object data = Marshal.GetComObjectData(rcw, s_comObjectInfoKey); 48data = Marshal.GetComObjectData(rcw, s_comObjectInfoKey); 55if (!Marshal.SetComObjectData(rcw, s_comObjectInfoKey, comObjectInfo))
Microsoft\CSharp\RuntimeBinder\ComInterop\ComRuntimeHelpers.cs (11)
81Marshal.ThrowExceptionForHR(hresult); 130Marshal.ThrowExceptionForHR(hresult); 149Marshal.ThrowExceptionForHR(hresult); 154Marshal.ThrowExceptionForHR(ComHresults.E_FAIL); 160typeInfo = Marshal.GetObjectForIUnknown(typeInfoPtr) as ComTypes.ITypeInfo; 164Marshal.Release(typeInfoPtr); 259variant = ComVariant.CreateRaw(VarEnum.VT_DISPATCH, obj is not null ? Marshal.GetIDispatchForObject(obj) : 0); 263Marshal.GetNativeVariantForObject(obj, ConvertVariantByrefToPtr(ref variant)); 270return Marshal.GetObjectForNativeVariant(ptr); 333Marshal.ThrowExceptionForHR(hresult); 344return Marshal.UnsafeAddrOfPinnedArrayElement(keywordArgDispIds, 0);
Microsoft\CSharp\RuntimeBinder\ComInterop\ComTypeEnumDesc.cs (2)
39varDesc = Marshal.PtrToStructure<ComTypes.VARDESC>(p); 43memberValues[i] = Marshal.GetObjectForNativeVariant(varDesc.desc.lpvarValue);
Microsoft\CSharp\RuntimeBinder\ComInterop\DispatchArgBuilder.cs (4)
48typeof(Marshal).GetMethod(nameof(System.Runtime.InteropServices.Marshal.GetIDispatchForObject)), 61typeof(Marshal).GetMethod(nameof(System.Runtime.InteropServices.Marshal.GetObjectForIUnknown)),
Microsoft\CSharp\RuntimeBinder\ComInterop\DynamicVariantExtensions.cs (3)
58case TypeCode.Object: variant = ComVariant.CreateRaw(VarEnum.VT_UNKNOWN, Marshal.GetIUnknownForObject(value)); break; 382variant = ComVariant.CreateRaw(VarEnum.VT_UNKNOWN, value is null ? IntPtr.Zero : Marshal.GetIUnknownForObject(value)); 387variant = ComVariant.CreateRaw(VarEnum.VT_DISPATCH, value is null ? IntPtr.Zero : Marshal.GetIDispatchForObject(value));
Microsoft\CSharp\RuntimeBinder\ComInterop\ExcepInfo.cs (5)
32Debug.Assert(Marshal.SizeOf<ExcepInfo>() == Marshal.SizeOf<ComTypes.EXCEPINFO>()); 43string result = Marshal.PtrToStringBSTR(bstr); 44Marshal.FreeBSTR(bstr); 65Exception exception = Marshal.GetExceptionForHR(errorCode) ?? new COMException(null, errorCode);
Microsoft\CSharp\RuntimeBinder\ComInterop\IDispatchComObject.cs (2)
484return Marshal.GetObjectForIUnknown(typeInfoPtr) as ComTypes.ITypeInfo; 491Marshal.Release(typeInfoPtr);
Microsoft\CSharp\RuntimeBinder\ComInterop\StringArgBuilder.cs (4)
47typeof(Marshal).GetMethod(nameof(System.Runtime.InteropServices.Marshal.StringToBSTR)), 59typeof(Marshal).GetMethod(nameof(System.Runtime.InteropServices.Marshal.PtrToStringBSTR)),
Microsoft\CSharp\RuntimeBinder\ComInterop\UnknownArgBuilder.cs (4)
48typeof(Marshal).GetMethod(nameof(System.Runtime.InteropServices.Marshal.GetIUnknownForObject)), 61typeof(Marshal).GetMethod(nameof(System.Runtime.InteropServices.Marshal.GetObjectForIUnknown)),
Microsoft\CSharp\RuntimeBinder\ComInterop\VariantBuilder.cs (2)
115return Expression.Call(typeof(Marshal).GetMethod(nameof(Marshal.FreeBSTR)), TempVariable);
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\BuiltInVariantExtensions.cs (8)
40Marshal.GetNativeVariantForObject(value, (IntPtr)(void*)&vArray); 102variant.GetByRefDataRef<IntPtr>() = Marshal.GetIUnknownForObject(value); 106variant.GetByRefDataRef<IntPtr>() = Marshal.GetIDispatchForObject(value); 110variant.GetByRefDataRef<IntPtr>() = Marshal.StringToBSTR((string)value); 122Marshal.GetNativeVariantForObject(value, variant.GetRawDataRef<IntPtr>()); 157VarEnum.VT_BSTR => variant.GetRawDataRef<nint>() is 0 ? null : Marshal.PtrToStringBSTR(variant.GetRawDataRef<nint>()), 158VarEnum.VT_UNKNOWN or VarEnum.VT_DISPATCH => variant.GetRawDataRef<nint>() is 0 ? null : Marshal.GetObjectForIUnknown(variant.GetRawDataRef<nint>()), 167return Marshal.GetObjectForNativeVariant((nint)pVariant);
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\ComEventsSink.cs (3)
216Marshal.GetNativeVariantForObject(result, pVarResult); 238ppv = Marshal.GetComInterfaceForObject(this, typeof(IDispatch), CustomQueryInterfaceMode.Ignore); 268Marshal.ReleaseComObject(_connectionPoint);
Microsoft.Diagnostics.DataContractReader (1)
ContractDescriptorTarget.cs (1)
553throw Marshal.GetExceptionForHR(hr) ?? new InvalidOperationException($"Failed to allocate {size} bytes in the target process (HRESULT: 0x{hr:x8}).");
Microsoft.Diagnostics.DataContractReader.Contracts (38)
Contracts\StackWalk\Context\ARM64\ARM64Unwinder.cs (10)
919TargetPointer sourceAddress = startingSp + (uint)Marshal.OffsetOf<ARM64Context>(nameof(ARM64Context.X0)); 926sourceAddress = startingSp + (uint)Marshal.OffsetOf<ARM64Context>(nameof(ARM64Context.V)); 937sourceAddress = startingSp + (uint)Marshal.OffsetOf<ARM64Context>(nameof(ARM64Context.Cpsr)); 940sourceAddress = startingSp + (uint)Marshal.OffsetOf<ARM64Context>(nameof(ARM64Context.Fp)); 943sourceAddress = startingSp + (uint)Marshal.OffsetOf<ARM64Context>(nameof(ARM64Context.Lr)); 946sourceAddress = startingSp + (uint)Marshal.OffsetOf<ARM64Context>(nameof(ARM64Context.Sp)); 949sourceAddress = startingSp + (uint)Marshal.OffsetOf<ARM64Context>(nameof(ARM64Context.Pc)); 952sourceAddress = startingSp + (uint)Marshal.OffsetOf<ARM64Context>(nameof(ARM64Context.Fpcr)); 955sourceAddress = startingSp + (uint)Marshal.OffsetOf<ARM64Context>(nameof(ARM64Context.Fpsr)); 961sourceAddress = startingSp + (uint)Marshal.OffsetOf<ARM64Context>(nameof(ARM64Context.ContextFlags));
Contracts\StackWalk\Context\LoongArch64\LoongArch64Unwinder.cs (14)
591TargetPointer sourceAddress = startingSp + (uint)Marshal.OffsetOf<LoongArch64Context>(nameof(LoongArch64Context.R0)); 594sourceAddress = startingSp + (uint)Marshal.OffsetOf<LoongArch64Context>(nameof(LoongArch64Context.Ra)); 597sourceAddress = startingSp + (uint)Marshal.OffsetOf<LoongArch64Context>(nameof(LoongArch64Context.Tp)); 600sourceAddress = startingSp + (uint)Marshal.OffsetOf<LoongArch64Context>(nameof(LoongArch64Context.Sp)); 603sourceAddress = startingSp + (uint)Marshal.OffsetOf<LoongArch64Context>(nameof(LoongArch64Context.A0)); 620sourceAddress = startingSp + (uint)Marshal.OffsetOf<LoongArch64Context>(nameof(LoongArch64Context.T0)); 639sourceAddress = startingSp + (uint)Marshal.OffsetOf<LoongArch64Context>(nameof(LoongArch64Context.X0)); 642sourceAddress = startingSp + (uint)Marshal.OffsetOf<LoongArch64Context>(nameof(LoongArch64Context.Fp)); 645sourceAddress = startingSp + (uint)Marshal.OffsetOf<LoongArch64Context>(nameof(LoongArch64Context.S0)); 667sourceAddress = startingSp + (uint)Marshal.OffsetOf<LoongArch64Context>(nameof(LoongArch64Context.Pc)); 670sourceAddress = startingSp + (uint)Marshal.OffsetOf<LoongArch64Context>(nameof(LoongArch64Context.F)); 677sourceAddress = startingSp + (uint)Marshal.OffsetOf<LoongArch64Context>(nameof(LoongArch64Context.Fcc)); 680sourceAddress = startingSp + (uint)Marshal.OffsetOf<LoongArch64Context>(nameof(LoongArch64Context.Fcsr)); 686sourceAddress = startingSp + (uint)Marshal.OffsetOf<LoongArch64Context>(nameof(LoongArch64Context.ContextFlags));
Contracts\StackWalk\Context\RISCV64\RISCV64Unwinder.cs (14)
605TargetPointer sourceAddress = startingSp + (uint)Marshal.OffsetOf<RISCV64Context>(nameof(RISCV64Context.Ra)); 608sourceAddress = startingSp + (uint)Marshal.OffsetOf<RISCV64Context>(nameof(RISCV64Context.Sp)); 611sourceAddress = startingSp + (uint)Marshal.OffsetOf<RISCV64Context>(nameof(RISCV64Context.Gp)); 614sourceAddress = startingSp + (uint)Marshal.OffsetOf<RISCV64Context>(nameof(RISCV64Context.Tp)); 617sourceAddress = startingSp + (uint)Marshal.OffsetOf<RISCV64Context>(nameof(RISCV64Context.T0)); 624sourceAddress = startingSp + (uint)Marshal.OffsetOf<RISCV64Context>(nameof(RISCV64Context.Fp)); 627sourceAddress = startingSp + (uint)Marshal.OffsetOf<RISCV64Context>(nameof(RISCV64Context.S1)); 630sourceAddress = startingSp + (uint)Marshal.OffsetOf<RISCV64Context>(nameof(RISCV64Context.A0)); 647sourceAddress = startingSp + (uint)Marshal.OffsetOf<RISCV64Context>(nameof(RISCV64Context.S2)); 668sourceAddress = startingSp + (uint)Marshal.OffsetOf<RISCV64Context>(nameof(RISCV64Context.T3)); 680sourceAddress = startingSp + (uint)Marshal.OffsetOf<RISCV64Context>(nameof(RISCV64Context.Pc)); 683sourceAddress = startingSp + (uint)Marshal.OffsetOf<RISCV64Context>(nameof(RISCV64Context.F)); 690sourceAddress = startingSp + (uint)Marshal.OffsetOf<RISCV64Context>(nameof(RISCV64Context.Fcsr)); 696sourceAddress = startingSp + (uint)Marshal.OffsetOf<RISCV64Context>(nameof(RISCV64Context.ContextFlags));
Microsoft.Diagnostics.DataContractReader.Legacy (72)
_generated\38\Microsoft.Diagnostics.DataContractReader.Legacy.ISOSDacInterface9.cs (1)
49global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([216, 66, 202, 78, 123, 126, 138, 76, 161, 22, 123, 251, 246, 146, 146, 103]), (global::System.IntPtr)__this);
ClrDataFrame.cs (3)
197throw Marshal.GetExceptionForHR(HResults.E_INVALIDARG)!; 302throw Marshal.GetExceptionForHR(HResults.E_INVALIDARG)!; 560throw Marshal.GetExceptionForHR(HResults.E_FAIL)!;
ClrDataMethodInstance.cs (2)
202throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 298throw Marshal.GetExceptionForHR(HResults.E_FAIL)!;
ClrDataModule.cs (4)
50Marshal.Release(_legacyModulePointer); 94if (_legacyModulePointer != 0 && Marshal.QueryInterface(_legacyModulePointer, iidMetaDataImport, out nint ppMdi) >= 0) 97Marshal.Release(ppMdi); 471throw Marshal.GetExceptionForHR(E_INSUFFICIENT_BUFFER)!;
ClrDataTask.cs (2)
112throw Marshal.GetExceptionForHR(/*E_NOINTERFACE*/ HResults.COR_E_INVALIDCAST)!; 154throw Marshal.GetExceptionForHR(/*E_NOINTERFACE*/ HResults.COR_E_INVALIDCAST)!;
ClrDataValue.cs (1)
159throw Marshal.GetExceptionForHR(/*ERROR_BUFFER_OVERFLOW*/ CorDbgHResults.ERROR_BUFFER_OVERFLOW)!;
Dbi\DacDbiImpl.cs (28)
606throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_NOTREADY)!; 637throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_NOTREADY)!; 777throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_BAD_THREAD_STATE)!; 1719throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_TARGET_INCONSISTENT)!; 1756throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_FUNCTION_NOT_IL)!; 1765throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_FUNCTION_NOT_IL)!; 1768throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_FUNCTION_NOT_IL)!; 1888throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_CLASS_NOT_LOADED)!; 1944throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_CLASS_NOT_LOADED)!; 2267throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_CLASS_NOT_LOADED)!; 2270throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_CLASS_NOT_LOADED)!; 2325throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_CLASS_NOT_LOADED)!; 2358throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_CLASS_NOT_LOADED)!; 2370throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_CLASS_NOT_LOADED)!; 2400throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_CLASS_NOT_LOADED)!; 2403throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_CLASS_NOT_LOADED)!; 2763throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_CLASS_NOT_LOADED)!; 2771throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_TARGET_INCONSISTENT)!; 3616throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_CLASS_NOT_LOADED)!; 3767throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_CLASS_NOT_LOADED)!; 3821throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_CLASS_NOT_LOADED)!; 3842throw Marshal.GetExceptionForHR(HResults.E_INVALIDARG)!; 3991throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_NOTREADY)!; 4020throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_NOTREADY)!; 4235throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_UNSUPPORTED_DELEGATE)!; 4243throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_UNSUPPORTED_DELEGATE)!; 4293throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_UNSUPPORTED_DELEGATE)!; 4298throw Marshal.GetExceptionForHR(CorDbgHResults.CORDBG_E_UNSUPPORTED_DELEGATE)!;
MetaDataImportImpl.cs (4)
1410throw Marshal.GetExceptionForHR(CldbHResults.CLDB_E_FILE_CORRUPT)!; 1417throw Marshal.GetExceptionForHR(CldbHResults.CLDB_E_FILE_CORRUPT)!; 1421throw Marshal.GetExceptionForHR(CldbHResults.CLDB_E_FILE_CORRUPT)!; 1663throw Marshal.GetExceptionForHR(CldbHResults.CLDB_E_RECORD_NOTFOUND)!;
NativeStringHolder.cs (8)
36IntPtr fnPtr = Marshal.GetFunctionPointerForDelegate(assignCopy); 39_vtablePtr = Marshal.AllocHGlobal(IntPtr.Size); 40Marshal.WriteIntPtr(_vtablePtr, fnPtr); 43_objectPtr = Marshal.AllocHGlobal(IntPtr.Size); 44Marshal.WriteIntPtr(_objectPtr, _vtablePtr); 54Value = Marshal.PtrToStringUni(psz); 62Marshal.FreeHGlobal(_objectPtr); 63Marshal.FreeHGlobal(_vtablePtr);
SOSDacImpl.cs (19)
746throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 1914throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 1959throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 2119throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 2225throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 2744throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 3490throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 3541throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 4687throw Marshal.GetExceptionForHR(E_ABORT)!; 5058throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 5100throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 5256throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 5747throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 5816throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 5878throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 5947throw Marshal.GetExceptionForHR(HResults.E_FAIL)!; 6499entries[i] = (heapTypes[i], Marshal.StringToHGlobalAnsi(heapTypes[i].ToString())); 6568string cdacName = Marshal.PtrToStringAnsi((nint)ppNames[i])!; 6569string dacName = Marshal.PtrToStringAnsi((nint)ppNamesLocal[i])!;
Microsoft.DiaSymReader (156)
_generated\32\Microsoft.DiaSymReader.IUnsafeComStream.cs (11)
68global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([12, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70]), (global::System.IntPtr)__this); 107global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([12, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70]), (global::System.IntPtr)__this); 146global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([12, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70]), (global::System.IntPtr)__this); 185global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([12, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70]), (global::System.IntPtr)__this); 224global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([12, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70]), (global::System.IntPtr)__this); 263global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([12, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70]), (global::System.IntPtr)__this); 302global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([12, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70]), (global::System.IntPtr)__this); 341global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([12, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70]), (global::System.IntPtr)__this); 380global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([12, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70]), (global::System.IntPtr)__this); 421global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([12, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70]), (global::System.IntPtr)__this); 468global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([12, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70]), (global::System.IntPtr)__this);
_generated\33\Microsoft.DiaSymReader.ISymUnmanagedAsyncMethodPropertiesWriter.cs (3)
52global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([116, 55, 7, 252, 57, 23, 50, 66, 189, 86, 160, 39, 41, 75, 236, 21]), (global::System.IntPtr)__this); 91global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([116, 55, 7, 252, 57, 23, 50, 66, 189, 86, 160, 39, 41, 75, 236, 21]), (global::System.IntPtr)__this); 134global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([116, 55, 7, 252, 57, 23, 50, 66, 189, 86, 160, 39, 41, 75, 236, 21]), (global::System.IntPtr)__this);
_generated\35\Microsoft.DiaSymReader.ISymUnmanagedDocumentWriter.cs (2)
52global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([235, 175, 31, 176, 80, 196, 77, 58, 190, 236, 180, 206, 236, 1, 224, 6]), (global::System.IntPtr)__this); 100global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([235, 175, 31, 176, 80, 196, 77, 58, 190, 236, 180, 206, 236, 1, 224, 6]), (global::System.IntPtr)__this);
_generated\36\Microsoft.DiaSymReader.IPdbWriter.cs (5)
57global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([30, 238, 236, 152, 45, 117, 211, 17, 141, 86, 0, 192, 79, 104, 11, 43]), (global::System.IntPtr)__this); 102global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([30, 238, 236, 152, 45, 117, 211, 17, 141, 86, 0, 192, 79, 104, 11, 43]), (global::System.IntPtr)__this); 147global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([30, 238, 236, 152, 45, 117, 211, 17, 141, 86, 0, 192, 79, 104, 11, 43]), (global::System.IntPtr)__this); 192global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([30, 238, 236, 152, 45, 117, 211, 17, 141, 86, 0, 192, 79, 104, 11, 43]), (global::System.IntPtr)__this); 241global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([30, 238, 236, 152, 45, 117, 211, 17, 141, 86, 0, 192, 79, 104, 11, 43]), (global::System.IntPtr)__this);
_generated\37\Microsoft.DiaSymReader.ISymUnmanagedWriter5.cs (33)
122global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 193global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 232global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 271global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 311global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 355global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 394global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 435global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 478global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 521global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 564global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 605global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 646global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 689global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 730global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 771global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 819global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 880global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 938global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 996global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 1074global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 1125global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 1188global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 1237global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 1278global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 1321global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 1364global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 1405global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 1444global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 1487global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 1534global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 1573global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this); 1617global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([13, 120, 247, 220, 233, 189, 223, 69, 172, 254, 33, 115, 26, 50, 0, 12]), (global::System.IntPtr)__this);
_generated\38\Microsoft.DiaSymReader.ISymUnmanagedWriter8.cs (38)
96global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 146global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 185global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 224global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 263global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 312global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 344global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 362global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 380global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 399global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 418global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 436global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 456global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 476global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 496global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 516global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 534global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 554global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 574global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 592global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 612global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 637global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 673global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 702global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 731global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 755global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 785global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 817global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 841global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 861global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 881global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 901global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 919global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 937global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 959global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 977global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 995global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this); 1018global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([59, 47, 165, 91, 248, 107, 252, 64, 180, 118, 211, 156, 82, 155, 51, 30]), (global::System.IntPtr)__this);
_generated\6\Microsoft.DiaSymReader.IMetadataEmit.cs (49)
144global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 183global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 222global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 261global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 300global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 339global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 378global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 417global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 456global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 495global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 534global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 573global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 612global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 651global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 690global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 729global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 768global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 807global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 846global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 885global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 925global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 969global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1008global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1047global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1086global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1125global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1164global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1203global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1242global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1281global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1320global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1359global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1398global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1437global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1476global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1515global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1554global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1593global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1632global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1671global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1710global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1749global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1788global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1827global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1866global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1905global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1944global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 1983global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this); 2022global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([76, 238, 63, 186, 185, 236, 65, 78, 131, 183, 24, 63, 164, 28, 216, 89]), (global::System.IntPtr)__this);
_generated\8\Microsoft.DiaSymReader.IMetadataImportProvider.cs (1)
53global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([147, 162, 243, 237, 13, 161, 74, 79, 166, 9, 56, 213, 237, 227, 95, 137]), (global::System.IntPtr)__this);
Extensions\SymUnmanagedExtensions.Document.cs (2)
100Marshal.ThrowExceptionForHR(document.GetSourceLength(out int length)); 112Marshal.ThrowExceptionForHR(document.GetSourceRange(0, 0, int.MaxValue, int.MaxValue, length, out int bytesRead, blob));
Reader\ISymUnmanagedSourceServerModule.cs (1)
22/// Caller must free using <see cref="Marshal.FreeCoTaskMem(IntPtr)"/>.
SymUnmanagedFactory.cs (7)
138Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 148Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 167Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 178Marshal.ThrowExceptionForHR(hr);
Utilities\ComMemoryStream.cs (2)
135Marshal.Copy(_chunks[chunkIndex], chunkOffset, (IntPtr)(pv + destinationIndex), bytesToCopy); 230Marshal.Copy((IntPtr)(pv + bytesWritten), _chunks[chunkIndex], chunkOffset, bytesToCopy);
Utilities\ComStreamWrapper.cs (1)
226Marshal.Release(unmanaged);
Utilities\InteropUtilities.cs (1)
23Marshal.ThrowExceptionForHR(hr, s_ignoreIErrorInfo);
Microsoft.DotNet.Build.Tasks.Feed (9)
_generated\0\LibraryImports.g.cs (6)
17global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 19__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 24global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 46global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 48__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 51global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\common\NativeMethods.cs (3)
25errorMessage = hardLinkCreated ? null : Marshal.GetExceptionForHR(Marshal.GetHRForLastWin32Error()).Message; 30errorMessage = hardLinkCreated ? null : $"The link() library call failed with the following error code: {Marshal.GetLastWin32Error()}.";
Microsoft.DotNet.Build.Tasks.VisualStudio (1)
Vsix\GetPkgDefAssemblyDependencyGuid.cs (1)
57int targetBlockSize = Marshal.SizeOf(typeof(Guid));
Microsoft.DotNet.HotReload.Watch (2)
Utilities\ProcessUtilities.cs (2)
30var error = Marshal.GetLastPInvokeError(); 32return $"{Marshal.GetPInvokeErrorMessage(error)} (code {error})";
Microsoft.DotNet.NativeWrapper (6)
_generated\0\LibraryImports.g.cs (3)
16__result_native = result != null ? global::System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(result) : default; 62__result_native = result != null ? global::System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(result) : default; 101__result_native = result != null ? global::System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(result) : default;
NETCoreSdkResolverNativeWrapper.cs (1)
31nint errorWriter = Marshal.GetFunctionPointerForDelegate(swallowErrors);
PlatformString.cs (2)
32return Marshal.PtrToStringUTF8(Value) ?? string.Empty; 36return Marshal.PtrToStringUni(Value) ?? string.Empty;
Microsoft.Extensions.Diagnostics.ResourceMonitoring (18)
Windows\Interop\JobObjectInfo.cs (2)
318Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error());
Windows\Interop\MemoryInfo.cs (2)
25Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error());
Windows\Network\WindowsTcpStateInfo.cs (14)
120Marshal.FreeHGlobal(tcpTable); 121tcpTable = Marshal.AllocHGlobal((int)size); 126Marshal.FreeHGlobal(tcpTable); 133Marshal.FreeHGlobal(tcpTable); 155var rawTcpTable = Marshal.PtrToStructure<MIB_TCPTABLE>(tcpTable); 158var offset = Marshal.OffsetOf<MIB_TCPTABLE>(nameof(MIB_TCPTABLE.Table)).ToInt32(); 162var row = Marshal.PtrToStructure<MIB_TCPROW>(rowPtr); 163rowPtr = IntPtr.Add(rowPtr, Marshal.SizeOf<MIB_TCPROW>()); 173Marshal.FreeHGlobal(tcpTable); 180var rawtcpTable = Marshal.PtrToStructure<MIB_TCP6TABLE>(tcpTable); 183var offset = Marshal.OffsetOf<MIB_TCP6TABLE>(nameof(MIB_TCP6TABLE.Table)).ToInt32(); 187var row = Marshal.PtrToStructure<MIB_TCP6ROW>(rowPtr); 188rowPtr = IntPtr.Add(rowPtr, Marshal.SizeOf<MIB_TCP6ROW>()); 198Marshal.FreeHGlobal(tcpTable);
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (14)
Windows\Tcp6TableInfoTests.cs (8)
123Marshal.StructureToPtr(fakeTcp6Table, pTcp6Table, false); 124var offset = Marshal.OffsetOf<MIB_TCP6TABLE>(nameof(MIB_TCP6TABLE.Table)).ToInt32(); 129Marshal.StructureToPtr(fakeRows[i], fakePtr, false); 130fakePtr = IntPtr.Add(fakePtr, Marshal.SizeOf<MIB_TCP6ROW>()); 215Marshal.StructureToPtr(fakeTcp6Table, pTcp6Table, false); 216var offset = Marshal.OffsetOf<MIB_TCP6TABLE>(nameof(MIB_TCP6TABLE.Table)).ToInt32(); 221Marshal.StructureToPtr(fakeRows[i], fakePtr, false); 222fakePtr = IntPtr.Add(fakePtr, Marshal.SizeOf<MIB_TCP6ROW>());
Windows\TcpTableInfoTests.cs (6)
89Marshal.StructureToPtr(fakeTcpTable, pTcpTable, false); 90var offset = Marshal.OffsetOf<MIB_TCPTABLE>(nameof(MIB_TCPTABLE.Table)).ToInt32(); 95Marshal.StructureToPtr(fakeRows[i], fakePtr, false); 158Marshal.StructureToPtr(fakeTcpTable, pTcpTable, false); 159var offset = Marshal.OffsetOf<MIB_TCPTABLE>(nameof(MIB_TCPTABLE.Table)).ToInt32(); 164Marshal.StructureToPtr(fakeRows[i], fakePtr, false);
Microsoft.Extensions.DotNetDeltaApplier (2)
src\sdk\src\Dotnet.Watch\HotReloadAgent.Host\StartupHook.cs (2)
154var error = Marshal.GetLastPInvokeError(); 156return $"{Marshal.GetPInvokeErrorMessage(error)} (code {error})";
Microsoft.Extensions.Hosting.WindowsServices (12)
_generated\0\LibraryImports.g.cs (12)
14global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 16__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 21global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 40global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 42__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 45global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 65global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 67__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 72global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 92global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 94__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 99global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
Microsoft.Extensions.Logging.Console (6)
_generated\1\LibraryImports.g.cs (6)
17global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 19__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 24global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 44global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 46__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 51global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
Microsoft.Maui.Resizetizer (1)
SkiaSharpTools.cs (1)
223 var code = Marshal.GetHRForException(ex);
Microsoft.ML.Core (3)
Data\ModelHeader.cs (3)
109Contracts.Assert(Marshal.SizeOf(typeof(ModelHeader)) == Size); 311Marshal.Copy((IntPtr)pheader, bytes, 0, Size); 378Marshal.Copy(bytes, 0, (IntPtr)pheader, Size);
Microsoft.ML.Data (10)
Data\Conversion.cs (2)
442if (Marshal.SizeOf(keySrc.RawType) > Marshal.SizeOf(typeDst.RawType))
DataLoadSave\Binary\BinaryLoader.cs (1)
1041Marshal.Copy(headerBytes, 0, (IntPtr)(&header), Header.HeaderSize);
DataLoadSave\Binary\BinarySaver.cs (2)
557Marshal.Copy(new IntPtr(&header), headerBytes, 0, Marshal.SizeOf(typeof(Header)));
DataLoadSave\Binary\Codecs.cs (2)
213Marshal.Copy(ptr, _buffer, 0, sublen); 274Marshal.Copy(_buffer, 0, ptr, sublen);
DataLoadSave\Transpose\TransposeLoader.cs (1)
569Marshal.Copy(headerBytes, 0, (IntPtr)(&header), Header.HeaderSize);
DataLoadSave\Transpose\TransposeSaver.cs (2)
179Marshal.Copy(new IntPtr(&header), headerBytes, 0, Marshal.SizeOf(typeof(Header)));
Microsoft.ML.FastTree (1)
Utils\BufferPoolManager.cs (1)
81if (buffer != null && buffer.Length * Marshal.SizeOf(typeof(T)) >= MinBufferSizeInBytes)
Microsoft.ML.LightGbm (2)
WrappedLightGbmInterface.cs (2)
242string mes = Marshal.PtrToStringAnsi(charPtr); 291return Marshal.PtrToStringAnsi(src);
Microsoft.ML.Mkl.Components (1)
SymSgdClassificationTrainer.cs (1)
388_sizeofT = Marshal.SizeOf(typeof(T));
Microsoft.ML.Recommender (2)
SafeTrainingAndModelBuffer.cs (2)
398Marshal.Copy((IntPtr)_pMFModel->P, p, 0, p.Length); 399Marshal.Copy((IntPtr)_pMFModel->Q, q, 0, q.Length);
Microsoft.ML.TestFrameworkCommon (2)
Attributes\AttributeHelpers.cs (1)
23version = Version.Parse(Marshal.PtrToStringUTF8(gnu_get_libc_version()));
Utility\NativeLibrary.cs (1)
144return Marshal.GetDelegateForFunctionPointer<T>(functionPtr);
Microsoft.ML.TimeSeries (1)
FftUtils.cs (1)
208throw Contracts.Except(Marshal.PtrToStringAnsi(ErrorMessage(status)));
Microsoft.ML.Vision (3)
ImageClassificationTrainer.cs (3)
1546Marshal.FreeHGlobal(data); 1551int sizeOfTString = Marshal.SizeOf<TF_TString>(); 1554IntPtr tstringPtr = Marshal.AllocHGlobal(sizeOfTString);
Microsoft.NET.Sdk.Razor.Tasks (2)
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerConnection.cs (2)
347startInfo.cb = Marshal.SizeOf(startInfo); 379ServerLogger.Log("Failed to create process. GetLastError={0}", Marshal.GetLastWin32Error());
Microsoft.Private.Windows.Core (28)
_generated\10\Windows.Win32.BSTR.g.cs (1)
50 public override string ToString() => this.Value != null ? Marshal.PtrToStringBSTR(new IntPtr(this.Value)) : null;
_generated\119\Windows.Win32.HRESULT.g.cs (3)
65 /// <inheritdoc cref="Marshal.ThrowExceptionForHR(int, IntPtr)" /> 73 /// <seealso cref="Marshal.ThrowExceptionForHR(int, IntPtr)"/> 77 Marshal.ThrowExceptionForHR(this.Value, errorInfo);
System\Private\Windows\Ole\ClipboardCore.cs (1)
206originalObject = Marshal.GetObjectForIUnknown((nint)unknown.Value);
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (1)
168Marshal.Copy((nint)buffer, bytes, 0, size);
System\Private\Windows\Ole\DragDropFormat.cs (1)
85Marshal.AddRef(mediumSource.hGlobal);
System\Private\Windows\Ole\DragDropHelper.cs (4)
216throw new Win32Exception(Marshal.GetLastWin32Error(), SR.ExternalException); 223throw new Win32Exception(Marshal.GetLastWin32Error(), SR.ExternalException); 374throw new Win32Exception(Marshal.GetLastWin32Error(), SR.ExternalException); 381throw new Win32Exception(Marshal.GetLastWin32Error(), SR.ExternalException);
Windows\Win32\Foundation\BSTR.cs (2)
10public BSTR(string? value) : this((char*)Marshal.StringToBSTR(value)) 18Marshal.FreeBSTR((nint)Value);
Windows\Win32\Foundation\PWSTR.cs (1)
16Marshal.FreeCoTaskMem((IntPtr)Value);
Windows\Win32\PInvokeCore.EnumChildWindows.cs (1)
14(delegate* unmanaged[Stdcall]<HWND, LPARAM, BOOL>)Marshal.GetFunctionPointerForDelegate(s_enumChildWindowsNativeCallback);
Windows\Win32\PInvokeCore.EnumDisplayMonitors.cs (1)
14(delegate* unmanaged[Stdcall]<HMONITOR, HDC, RECT*, LPARAM, BOOL>)Marshal.GetFunctionPointerForDelegate(s_enumDisplayMonitorsNativeCallback);
Windows\Win32\PInvokeCore.EnumThreadWindows.cs (1)
14(delegate* unmanaged[Stdcall]<HWND, LPARAM, BOOL>)Marshal.GetFunctionPointerForDelegate(s_enumThreadWindowsNativeCallback);
Windows\Win32\PInvokeCore.EnumWindows.cs (1)
14(delegate* unmanaged[Stdcall]<HWND, LPARAM, BOOL>)Marshal.GetFunctionPointerForDelegate(s_enumWindowsNativeCallback);
Windows\Win32\PInvokeCore.GetWindowText.cs (1)
28int error = Marshal.GetLastWin32Error();
Windows\Win32\PInvokeCore.SetWindowLong.cs (1)
36IntPtr pointer = Marshal.GetFunctionPointerForDelegate(dwNewLong);
Windows\Win32\System\Com\ComHelpers.cs (2)
109ccw = (ComUnknown*)Marshal.GetIUnknownForObject(@object); 308return Marshal.GetObjectForIUnknown((nint)unknown);
Windows\Win32\System\Com\ComManagedStream.cs (1)
217pstatstg->pwcsName = (char*)Marshal.StringToCoTaskMemUni(_dataStream is FileStream fs ? fs.Name : _dataStream.ToString());
Windows\Win32\System\Com\Lifetime.cs (2)
32Marshal.FreeCoTaskMem((nint)lifetime); 54var wrapper = (Lifetime<TVTable, TObject>*)Marshal.AllocCoTaskMem(sizeof(Lifetime<TVTable, TObject>));
Windows\Win32\System\Variant\VARIANT.cs (2)
84return Marshal.GetObjectForNativeVariant((nint)thisVariant); 1023Marshal.GetNativeVariantForObject(value, (nint)(void*)&variant);
Windows\Win32\System\Variant\VARIANTVector.cs (1)
23Marshal.GetNativeVariantForObject(values[i], (IntPtr)(&pVariants[i]));
Microsoft.TestPlatform.CrossPlatEngine (1)
PostProcessing\ArtifactProcessingManager.cs (1)
277int error = Marshal.GetLastWin32Error();
Microsoft.TestPlatform.Extensions.BlameDataCollector (3)
MiniDumpWriteDump.cs (2)
60int err = Marshal.GetHRForLastWin32Error(); 63Marshal.ThrowExceptionForHR(err);
ProcessCodeMethods.cs (1)
95var res = NtQueryInformationProcess(handle, 0, out var pbi, Marshal.SizeOf<ProcessBasicInformation>(), out int size);
Microsoft.VisualBasic.Core (2)
Microsoft\VisualBasic\ErrObject.vb (1)
326Return Marshal.GetLastWin32Error()
Microsoft\VisualBasic\Interaction.vb (1)
551Return Marshal.BindToMoniker([PathName])
Microsoft.VisualBasic.Forms (4)
Microsoft\VisualBasic\CompilerServices\ExceptionUtils.vb (1)
135Return New ComponentModel.Win32Exception(Marshal.GetLastWin32Error(), GetResourceString(resourceKey, placeHolders))
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)()
Microsoft\VisualBasic\Interaction.vb (1)
330errorCode = Marshal.GetLastWin32Error()
Microsoft.VisualStudio.TestPlatform.ObjectModel (2)
Navigation\FullSymbolReader.cs (2)
159Marshal.FinalReleaseComObject(_source); 474Marshal.FinalReleaseComObject(obj);
Microsoft.Win32.Registry (5)
_generated\0\LibraryImports.g.cs (3)
12global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 14__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 17global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (2)
56if (Marshal.GetLastWin32Error() == ERROR_INSUFFICIENT_BUFFER) 69Marshal.FreeHGlobal(nativeMsgPtr);
Microsoft.Win32.SystemEvents (32)
_generated\0\LibraryImports.g.cs (25)
16global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 18__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 21global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 152global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 154__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 159global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 258global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 260__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 263global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 379global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 381__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 384global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 413global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 415__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 418global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 514global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 516__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 519global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 539global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 541__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 546global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 569__handler_native = handler != null ? global::System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(handler) : default; 571global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 573__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 580global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
Microsoft\Win32\SystemEvents.cs (7)
525if (lParam != 0 && Marshal.PtrToStringUni(lParam)!.Equals("Policy")) 529else if (lParam != 0 && Marshal.PtrToStringUni(lParam)!.Equals("intl")) 674lpfnWndProc = Marshal.GetFunctionPointerForDelegate(_windowProc), 682Debug.WriteLine("Unable to register broadcast window class: {0}", Marshal.GetLastPInvokeError()); 1083newString = Marshal.PtrToStringUni(lParam); 1086newStringPtr = Marshal.StringToHGlobalUni(newString); 1123Marshal.FreeHGlobal(lParam);
Mono.Cecil.Pdb (2)
Mono.Cecil.Pdb\SymWriter.cs (2)
83 Marshal.ReleaseComObject (writer); 86 Marshal.ReleaseComObject (document);
mscorlib (1)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
707[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.Marshal))]
netstandard (1)
netstandard.cs (1)
1713[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.Marshal))]
NuGet.Common (1)
PathUtil\NuGetEnvironment.cs (1)
60var errno = Marshal.GetLastWin32Error(); // fetch the errno before running any other operation
NuGet.Configuration (1)
Utility\FileSystemUtility.cs (1)
45var errno = Marshal.GetLastWin32Error(); // fetch the errno before running any other operation
NuGet.Packaging (75)
Signing\Cms\HeapBlockRetainer.cs (2)
24var hBlock = new SafeLocalAllocHandle(Marshal.AllocHGlobal(cbSize)); 33Marshal.Copy(b, 0, pb, b.Length);
Signing\Cms\NativeCms.cs (55)
71Marshal.Copy( 108var unsignedAttributes = Marshal.PtrToStructure<CRYPT_ATTRIBUTES>(pointer); 109int sizeOfCryptAttributeString = Marshal.SizeOf<CRYPT_ATTRIBUTE_STRING>(); 110int sizeOfCryptIntegerBlob = Marshal.SizeOf<CRYPT_INTEGER_BLOB>(); 117var attribute = Marshal.PtrToStructure<CRYPT_ATTRIBUTE_STRING>(attributePointer); 128var attributeValue = Marshal.PtrToStructure<CRYPT_INTEGER_BLOB>(attributeValuePointer); 151var counterSignerInfo = Marshal.PtrToStructure<CMSG_SIGNER_INFO>(counterSignerInfoPointer); 171int sizeOfCryptAttributeString = Marshal.SizeOf<CRYPT_ATTRIBUTE_STRING>(); 176var signedAttribute = Marshal.PtrToStructure<CRYPT_ATTRIBUTE_STRING>(signedAttributePointer); 189int sizeOfCryptIntegerBlob = Marshal.SizeOf<CRYPT_INTEGER_BLOB>(); 195var attributeValue = Marshal.PtrToStructure<CRYPT_INTEGER_BLOB>(attributeValuePointer); 198Marshal.Copy(attributeValue.pbData, bytes, startIndex: 0, length: bytes.Length); 226Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 231Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 245Marshal.Copy(encodedCert, 0, unmanagedCert, encodedCert.Length); 252var unmanagedBlob = hb.Alloc(Marshal.SizeOf(blob)); 253Marshal.StructureToPtr(blob, unmanagedBlob, fDeleteOld: false); 261Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 300countersignatureDelAttr.cbSize = (uint)Marshal.SizeOf(countersignatureDelAttr); 301var unmanagedCountersignatureDelAttr = hb.Alloc(Marshal.SizeOf(countersignatureDelAttr)); 302Marshal.StructureToPtr(countersignatureDelAttr, unmanagedCountersignatureDelAttr, fDeleteOld: false); 310Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 317var sizeOfCryptAttribute = Marshal.SizeOf<CRYPT_ATTRIBUTE>(); 326var existingAttribute = Marshal.PtrToStructure<CRYPT_ATTRIBUTE>(existingAttributePointer); 345var unmanagedSignerInfo = hb.Alloc(Marshal.SizeOf(signerInfo)); 346Marshal.StructureToPtr(signerInfo, unmanagedSignerInfo, fDeleteOld: false); 358var err = Marshal.GetLastWin32Error(); 361Marshal.ThrowExceptionForHR(NativeMethods.GetHRForWin32Error(err)); 375Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 384var unmanagedBlob = hb.Alloc(Marshal.SizeOf(encondedSignerBlob)); 385Marshal.StructureToPtr(encondedSignerBlob, unmanagedBlob, fDeleteOld: false); 398signerInfoAddAttr.cbSize = (uint)Marshal.SizeOf(signerInfoAddAttr); 399var unmanagedSignerInfoAddAttr = hb.Alloc(Marshal.SizeOf(signerInfoAddAttr)); 401Marshal.StructureToPtr(signerInfoAddAttr, unmanagedSignerInfoAddAttr, fDeleteOld: false); 409Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 421timestampAddAttr.cbSize = (uint)Marshal.SizeOf(timestampAddAttr); 422var unmanagedTimestampAddAttr = hb.Alloc(Marshal.SizeOf(timestampAddAttr)); 423Marshal.StructureToPtr(timestampAddAttr, unmanagedTimestampAddAttr, fDeleteOld: false); 431Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 439Marshal.Copy(data, 0, unmanagedData, data.Length); 446var unmanagedBlob = hb.Alloc(Marshal.SizeOf(blob)); 447Marshal.StructureToPtr(blob, unmanagedBlob, fDeleteOld: false); 461var unmanagedAttr = hb.Alloc(Marshal.SizeOf(attr)); 462Marshal.StructureToPtr(attr, unmanagedAttr, fDeleteOld: false); 474var err = Marshal.GetLastWin32Error(); 477Marshal.ThrowExceptionForHR(NativeMethods.GetHRForWin32Error(err)); 491Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error());
Signing\Cms\NativeMethods.cs (1)
170Marshal.FreeHGlobal(handle);
Signing\Cms\NativeUtility.cs (17)
17Marshal.FreeHGlobal(ptr); 25Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 38var context = Marshal.PtrToStructure<CERT_CONTEXT>(cert.Handle); 47signedInfo.cbSize = Marshal.SizeOf(signedInfo); 50using (var signerInfoHandle = new SafeLocalAllocHandle(Marshal.AllocHGlobal(Marshal.SizeOf(signerInfo)))) 52Marshal.StructureToPtr(signerInfo, signerInfoHandle.DangerousGetHandle(), fDeleteOld: false); 57using (var certificatesHandle = new SafeLocalAllocHandle(Marshal.AllocHGlobal(Marshal.SizeOf(certificateBlobs[0]) * certificateBlobs.Length))) 61Marshal.StructureToPtr(certificateBlobs[i], new IntPtr(certificatesHandle.DangerousGetHandle().ToInt64() + Marshal.SizeOf(certificateBlobs[i]) * i), fDeleteOld: false); 117signerInfo.cbSize = (uint)Marshal.SizeOf(signerInfo); 118signerInfo.pCertInfo = Marshal.PtrToStructure<CERT_CONTEXT>(cmsSigner.Certificate!.Handle).pCertInfo; 169int sizeOfCryptAttribute = Marshal.SizeOf<CRYPT_ATTRIBUTE>(); 170int sizeOfCryptIntegerBlob = Marshal.SizeOf<CRYPT_INTEGER_BLOB>(); 191Marshal.Copy(attrData, 0, blob->pbData, attrData.Length);
PresentationCore (150)
MS\Internal\AppModel\CookieHandler.cs (1)
118if (!throwIfNoCookie && Marshal.GetLastWin32Error() == NativeMethods.ERROR_NO_MORE_ITEMS)
MS\Internal\DpiUtil\DpiUtil+WindowDpiScaleHelper.cs (1)
98Marshal.ThrowExceptionForHR(hr);
MS\Internal\FontCache\FontCacheUtil.cs (2)
75Marshal.Copy((IntPtr)_pointer, b, 0, Size); 828Util.ThrowWin32Exception(Marshal.GetLastWin32Error(), fileName);
MS\Internal\FontFace\FontDriver.cs (1)
250Marshal.Copy((IntPtr)fontData, fontCopy, 0, fileSize);
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (9)
520int allocationSize = (int)(Marshal.SizeOf(typeof(MS.Win32.Recognizer.PACKET_PROPERTY)) * packetDescription.cPacketProperties); 521packetDescription.pPacketProperties = Marshal.AllocCoTaskMem(allocationSize); 527Marshal.StructureToPtr(packetProperties[i], new IntPtr(pElement), false); 538packets = Marshal.AllocCoTaskMem(countOfBytes); 539Marshal.Copy(rawPackets, 0, packets, packetCount); 559Marshal.DestroyStructure(new IntPtr(pElement), typeof(MS.Win32.Recognizer.PACKET_PROPERTY)); 563Marshal.FreeCoTaskMem(pd.pPacketProperties); 569Marshal.FreeCoTaskMem(pd.pguidButtons); 575Marshal.FreeCoTaskMem(packets);
MS\Internal\IO\Packaging\ByteRangeDownloader.cs (1)
478throw new Win32Exception(Marshal.GetLastWin32Error());
MS\Internal\Text\TextInterface\DWriteUtil.cs (2)
39System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(hr, new System.IntPtr(-1)); 55System.Exception e = System.Runtime.InteropServices.Marshal.GetExceptionForHR(hr);
MS\Internal\Text\TextInterface\Factory.cs (10)
61IntPtr pIDWriteFontFileLoaderMirror = Marshal.GetComInterfaceForObject( 77Marshal.Release(pIDWriteFontFileLoaderMirror); 81IntPtr pIDWriteFontCollectionLoaderMirror = Marshal.GetComInterfaceForObject( 88Marshal.Release(pIDWriteFontCollectionLoaderMirror); 300IntPtr pIDWriteFontCollectionLoaderMirror = Marshal.GetComInterfaceForObject( 315Marshal.Release(pIDWriteFontCollectionLoaderMirror); 353IntPtr pIDWriteFontCollectionLoaderMirror = Marshal.GetComInterfaceForObject( 358Marshal.Release(pIDWriteFontCollectionLoaderMirror); 365IntPtr pIDWriteFontFileLoaderMirror = Marshal.GetComInterfaceForObject( 370Marshal.Release(pIDWriteFontFileLoaderMirror);
MS\Internal\Text\TextInterface\FontCollectionLoader.cs (2)
68IntPtr pIDWriteFontFileEnumeratorMirror = Marshal.GetComInterfaceForObject( 76hr = Marshal.GetHRForException(exception);
MS\Internal\TextFormatting\LineServicesCallbacks.cs (1)
2311Marshal.StructureToPtr(inlineInit, (System.IntPtr)objectInfo, false);
MS\Internal\WindowsRuntime\Windows\UI\ViewManagement\InputPane.cs (1)
247Marshal.ReleaseComObject(_inputPane);
MS\Internal\WindowsRuntime\Windows\UI\ViewManagement\InputPaneRcw.cs (3)
25Marshal.ThrowExceptionForHR(NativeMethods.WindowsCreateString(typeName, typeName.Length, out hstring)); 29Marshal.ThrowExceptionForHR(NativeMethods.RoGetActivationFactory(hstring, ref iid, out object factory)); 34Marshal.ThrowExceptionForHR(NativeMethods.WindowsDeleteString(hstring));
MS\Internal\WindowsRuntime\Windows\UI\ViewManagement\UISettings.cs (1)
167Marshal.ReleaseComObject(_uisettings);
MS\Internal\WindowsRuntime\Windows\UI\ViewManagement\UISettingsRcw.cs (3)
21Marshal.ThrowExceptionForHR(hr); 25Marshal.ThrowExceptionForHR(hr); 31Marshal.ThrowExceptionForHR(hr);
src\wpf\src\Microsoft.DotNet.Wpf\src\Common\Graphics\wgx_render.cs (1)
775Exception exceptionForHR = Marshal.GetExceptionForHR(hr, (IntPtr)(-1));
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (1)
52int win32Err = Marshal.GetLastWin32Error();
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SecurityHelper.cs (4)
133return Marshal.GetExceptionForHR(hr, new IntPtr(-1)); 140Marshal.ThrowExceptionForHR(hr, new IntPtr(-1)); 150int hr = Marshal.GetHRForException(exception); 154Marshal.GetHRForException(new Exception());
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\WinInet.cs (3)
28UInt32 size = (UInt32)Marshal.SizeOf(icci); 38int hr = Marshal.GetHRForLastWin32Error(); 42Marshal.ThrowExceptionForHR(hr);
System\Windows\DpiChangedEventArgs.cs (1)
48NativeMethods.RECT suggestedRect = Marshal.PtrToStructure<NativeMethods.RECT>(lParam);
System\Windows\Input\Cursor.cs (1)
171int errorCode = Marshal.GetLastWin32Error();
System\Windows\Input\DefaultTextStore.cs (1)
283Marshal.ReleaseComObject(compartment);
System\Windows\Input\DefaultTextStoreTextComposition.cs (4)
65Marshal.ReleaseComObject(composition); 68Marshal.ReleaseComObject(context); 88Marshal.ReleaseComObject(doc); 107Marshal.ReleaseComObject(enumCompositionView);
System\Windows\Input\InputMethod.cs (5)
1510Marshal.ReleaseComObject(fnConfigure); 1513Marshal.ReleaseComObject(funcPrv); 1563Marshal.ReleaseComObject(fnConfigure); 1566Marshal.ReleaseComObject(funcPrv); 1674Marshal.ReleaseComObject(enumIpp);
System\Windows\Input\InputProcessorProfiles.cs (2)
58Marshal.ReleaseComObject(_ipp); 119Marshal.FreeCoTaskMem(ptrLanguageIDs);
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (2)
791Marshal.Copy(pPackets, data, 0, cItems); 1120Marshal.ReleaseComObject(penContext._pimcContext);
System\Windows\Input\Stylus\Wisp\WispTabletDevice.cs (1)
342Marshal.ReleaseComObject(tablet);
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (3)
123int result = (int)MS.Win32.UnsafeNativeMethods.GetRawInputDeviceList(null, ref deviceCount, (uint)Marshal.SizeOf(typeof(NativeMethods.RAWINPUTDEVICELIST))); 128int count = (int)MS.Win32.UnsafeNativeMethods.GetRawInputDeviceList(ridl, ref deviceCount, (uint)Marshal.SizeOf(typeof(NativeMethods.RAWINPUTDEVICELIST))); 138cbSize = (uint)Marshal.SizeOf(typeof(NativeMethods.RID_DEVICE_INFO))
System\Windows\Input\TextServicesCompartment.cs (6)
98Marshal.ReleaseComObject(compartment); 99Marshal.ReleaseComObject(source); 117Marshal.ReleaseComObject(compartment); 118Marshal.ReleaseComObject(source); 198Marshal.ReleaseComObject(compartment); 210Marshal.ReleaseComObject(compartment);
System\Windows\Input\TextServicesContext.cs (6)
81Marshal.ReleaseComObject(_defaultTextStore.DocumentManager); 120Marshal.ReleaseComObject(_dimEmpty); 129Marshal.ReleaseComObject(_threadManager); 218Marshal.ReleaseComObject(context); 359Marshal.ReleaseComObject(comp); 391Marshal.ReleaseComObject(comp);
System\Windows\InterOp\HwndMouseInputProvider.cs (1)
231int n = UnsafeNativeMethods.GetMouseMovePointsEx((uint)(Marshal.SizeOf(mp_in)), ref mp_in, mp_out, 64, mode);
System\Windows\InterOp\HwndSource.cs (2)
1347NativeMethods.WINDOWPOS windowPos = Marshal.PtrToStructure<NativeMethods.WINDOWPOS>(lParam); 1396Marshal.StructureToPtr(windowPos, lParam, true);
System\Windows\InterOp\HwndTarget.cs (3)
877Marshal.PtrToStructure<NativeMethods.RECT>(lParam); 1462return new IntPtr(Marshal.GetHRForException(e)); 1865NativeMethods.WINDOWPOS windowPos = Marshal.PtrToStructure<NativeMethods.WINDOWPOS>(lParam);
System\Windows\Media\ByteStreamGeometryContext.cs (2)
493Marshal.Copy(_chunkList[currentChunk], bufferOffset, (IntPtr)pbData, cbDataForThisChunk); 497Marshal.Copy((IntPtr)pbData, _chunkList[currentChunk], bufferOffset, cbDataForThisChunk);
System\Windows\Media\ColorContext.cs (2)
646HRESULT.Check(Marshal.GetHRForLastWin32Error()); 660HRESULT.Check(Marshal.GetHRForLastWin32Error());
System\Windows\Media\ColorContextHelper.cs (1)
93HRESULT.Check(Marshal.GetHRForLastWin32Error());
System\Windows\Media\ColorTransformHelper.cs (1)
100HRESULT.Check(Marshal.GetHRForLastWin32Error());
System\Windows\Media\EventProxy.cs (1)
93return Marshal.GetHRForException(e);
System\Windows\Media\GlyphTypeface.cs (1)
1280Marshal.Copy(new IntPtr(pMilPathGeometry), data, 0, checked((int)size));
System\Windows\Media\ImageSourceConverter.cs (2)
228if (Marshal.ReadInt16(addr) != 0x1c15) 239OBJECTHEADER pHeader = Marshal.PtrToStructure<OBJECTHEADER>(addr);
System\Windows\Media\Imaging\BitmapEncoder.cs (2)
28pstrName = Marshal.StringToCoTaskMemUni(name); 33Marshal.FreeCoTaskMem(pstrName);
System\Windows\Media\Imaging\BitmapMetadata.cs (3)
233pIEnumMetadata = Marshal.GetComInterfaceForObject( 683blockWriter = Marshal.GetComInterfaceForObject( 732blockWriter = Marshal.GetComInterfaceForObject(
System\Windows\Media\Imaging\BitmapMetadataEnumerator.cs (2)
82_current = Marshal.PtrToStringUni(ppStr); 89Marshal.FreeCoTaskMem(ppStr);
System\Windows\Media\Imaging\BitmapSource.cs (3)
571_wicSource = new BitmapSourceSafeMILHandle(Marshal.GetComInterfaceForObject( 1791rc = Marshal.PtrToStructure<Int32Rect>(prc); 1833Marshal.Copy(managedArray, y * rectRowSize, new IntPtr(rowPtr), rectRowSize);
System\Windows\Media\Imaging\PropVariant.cs (40)
132long size = Marshal.SizeOf(type) * length; 137destPtr = Marshal.AllocCoTaskMem((int)size); 154Marshal.FreeCoTaskMem(destPtr); 184destPtr = Marshal.AllocCoTaskMem((int)size); 190pString = Marshal.StringToCoTaskMemAnsi(value[index]); 194pString = Marshal.StringToCoTaskMemUni(value[index]); 196Marshal.WriteIntPtr(destPtr, (int)index*sizeIntPtr, pString); 209IntPtr pString = Marshal.ReadIntPtr(destPtr, i*sizeIntPtr); 210Marshal.FreeCoTaskMem(pString); 213Marshal.FreeCoTaskMem(destPtr); 240pszVal = Marshal.StringToCoTaskMemAnsi(new String(value as char[])); 319pwszVal = Marshal.StringToCoTaskMemUni(value as String); 339pszVal = Marshal.StringToCoTaskMemAnsi(new String(stackalloc char[] { (char)value })); 385pclsidVal = Marshal.AllocCoTaskMem(guid.Length); 386Marshal.Copy(guid, 0, pclsidVal, guid.Length); 447UnsafeNativeMethods.MILUnknown.Release(Marshal.ReadIntPtr(punkPtr, (int) (i*sizeIntPtr))); 461Marshal.FreeCoTaskMem(Marshal.ReadIntPtr(strPtr, (int) (i*sizeIntPtr))); 465Marshal.FreeCoTaskMem(ca.pElems); 472Marshal.FreeCoTaskMem(pwszVal); 498array[i] = (sbyte) Marshal.ReadByte(ca.pElems, i); 505Marshal.Copy(ca.pElems, array, 0, (int)ca.cElems); 512Marshal.Copy(ca.pElems, array, 0, (int)ca.cElems); 520array[i] = (ushort) Marshal.ReadInt16(ca.pElems, i*sizeof(ushort)); 527Marshal.Copy(ca.pElems, array, 0, (int)ca.cElems); 535array[i] = (uint) Marshal.ReadInt32(ca.pElems, i*sizeof(uint)); 542Marshal.Copy(ca.pElems, array, 0, (int)ca.cElems); 550array[i] = (UInt64) Marshal.ReadInt64(ca.pElems, i*sizeof(UInt64)); 557Marshal.Copy(ca.pElems, array, 0, (int)ca.cElems); 564Marshal.Copy(ca.pElems, array, 0, (int)ca.cElems); 572array[i] = (bool) (Marshal.ReadInt16(ca.pElems, i*sizeof(ushort)) != 0); 582Marshal.Copy(ca.pElems, guid, i*16, 16); 599IntPtr ptr = Marshal.ReadIntPtr(ca.pElems, i*sizeIntPtr); 600array[i] = Marshal.PtrToStringAnsi(ptr); 616IntPtr ptr = Marshal.ReadIntPtr(ca.pElems, i*sizeIntPtr); 617array[i] = Marshal.PtrToStringUni(ptr); 672Marshal.Copy(pclsidVal, guid, 0, 16); 676return Marshal.PtrToStringAnsi(pszVal); 679return Marshal.PtrToStringUni(pwszVal); 684Marshal.Copy(ca.pElems, blob, 0, (int)ca.cElems);
System\Windows\Media\Imaging\WriteableBitmap.cs (2)
1072elementSize = Marshal.SizeOf(exemplar); 1100elementSize = Marshal.SizeOf(exemplar);
System\Windows\Media\MediaContextNotificationWindow.cs (1)
187ChangeWindowMessageFilterNative function = Marshal.GetDelegateForFunctionPointer(
System\Windows\Media\RenderData.cs (2)
108Marshal.Copy((IntPtr)(&header), this._buffer, _curOffset, sizeof(RecordHeader)); 109Marshal.Copy((IntPtr)pbRecord, this._buffer, _curOffset + sizeof(RecordHeader), cbRecordSize);
PresentationFramework (350)
MS\Internal\AppModel\AppSecurityManager.cs (1)
119sei.cbSize = Marshal.SizeOf(sei);
MS\Internal\AppModel\IconHelper.cs (1)
234Marshal.Copy(colorArray, 0, bits, colorArray.Length);
MS\Internal\Controls\ActiveXSite.cs (1)
259lpFrameInfo.cb = (uint)Marshal.SizeOf(typeof(NativeMethods.OLEINPLACEFRAMEINFO));
MS\Internal\Controls\ConnectionPointCookie.cs (4)
47else if (sink == null || !eventInterface.IsInstanceOfType(sink) && !Marshal.IsComObject(sink)) 57Marshal.FinalReleaseComObject(connectionPoint); 73Marshal.FinalReleaseComObject(connectionPoint); 114System.Runtime.InteropServices.Marshal.FinalReleaseComObject(connectionPoint);
MS\Internal\Controls\EnumUnknown.cs (4)
40Marshal.WriteInt32(pceltFetched, 0, 0); 58Marshal.WriteIntPtr(rgelt, Marshal.GetIUnknownForObject(this.arr[this.loc])); 66Marshal.WriteInt32(pceltFetched, 0, fetched);
MS\Internal\IO\Packaging\indexingfiltermarshaler.cs (9)
104Marshal.Copy(s.ToCharArray(), 0, p, s.Length); 107Marshal.WriteInt16(p, s.Length * _int16Size, 0); 125native.union.name = Marshal.StringToCoTaskMemUni(propSpec.PropName); 187pszVal = Marshal.StringToCoTaskMemAnsi((string)obj); 212pNative = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(PROPVARIANT))); 218Marshal.StructureToPtr(v, pNative, false); 224Marshal.FreeCoTaskMem(pszVal); 229Marshal.FreeCoTaskMem(pNative);
MS\Internal\IO\Packaging\ManagedFilter.cs (1)
121PropName = Marshal.PtrToStringUni(propSpec.union.name);
MS\Internal\IO\Packaging\ManagedIStream.cs (3)
46Marshal.WriteInt32(bytesReadPtr, bytesRead); 85Marshal.WriteInt64(newPositionPtr, position); 150Marshal.WriteInt32(bytesWrittenPtr, bufferSize);
MS\Internal\IO\Packaging\XpsFilter.cs (4)
125Marshal.WriteInt16(pBuffer, 0); 180short shCharacter = Marshal.ReadInt16(pBuffer); 199shCharacter = Marshal.ReadInt16(pBuffer, _int16Size); 257Marshal.WriteInt16(pBuffer, (int)bufCharacterCount * _int16Size, 0);
MS\Internal\Printing\NativeMethods.cs (2)
28public int lStructSize = Marshal.SizeOf(typeof(PRINTDLGEX32)); 54public int lStructSize = Marshal.SizeOf(typeof(PRINTDLGEX64));
MS\Internal\Printing\PrintDlgExMarshaler.cs (37)
235NativeMethods.PRINTDLGEX32 pdex = Marshal.PtrToStructure<NativeMethods.PRINTDLGEX32>(unmanagedBuffer); 243NativeMethods.PRINTDLGEX64 pdex = Marshal.PtrToStructure<NativeMethods.PRINTDLGEX64>(unmanagedBuffer); 257NativeMethods.PRINTPAGERANGE pageRangeStruct = Marshal.PtrToStructure<NativeMethods.PRINTPAGERANGE>(pageRangePtr); 276NativeMethods.DEVNAMES devNames = Marshal.PtrToStructure<NativeMethods.DEVNAMES>(pDevNames); 277int devNamesOffset = checked(devNames.wDeviceOffset * Marshal.SystemDefaultCharSize); 278printerName = Marshal.PtrToStringAuto(pDevNames + devNamesOffset); 369NativeMethods.DEVMODE devMode = Marshal.PtrToStructure<NativeMethods.DEVMODE>(pDevMode); 371Marshal.Copy(pDevMode, devModeData, 0, devModeData.Length); 415NativeMethods.PRINTDLGEX32 pdex = Marshal.PtrToStructure<NativeMethods.PRINTDLGEX32>(unmanagedBuffer); 420NativeMethods.PRINTDLGEX64 pdex = Marshal.PtrToStructure<NativeMethods.PRINTDLGEX64>(unmanagedBuffer); 490pdex.lpPageRanges = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NativeMethods.PRINTPAGERANGE))); 496Marshal.StructureToPtr(range, pdex.lpPageRanges, false); 529int cbBufferSize = Marshal.SizeOf(typeof(NativeMethods.PRINTDLGEX32)); 530unmanagedBuffer = Marshal.AllocHGlobal(cbBufferSize); 531Marshal.StructureToPtr(pdex, unmanagedBuffer, false); 569pdex.lpPageRanges = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NativeMethods.PRINTPAGERANGE))); 575Marshal.StructureToPtr(range, pdex.lpPageRanges, false); 608int cbBufferSize = Marshal.SizeOf(typeof(NativeMethods.PRINTDLGEX64)); 609unmanagedBuffer = Marshal.AllocHGlobal(cbBufferSize); 610Marshal.StructureToPtr(pdex, unmanagedBuffer, false); 655NativeMethods.PRINTDLGEX32 pdex = Marshal.PtrToStructure<NativeMethods.PRINTDLGEX32>(unmanagedBuffer); 662NativeMethods.PRINTDLGEX64 pdex = Marshal.PtrToStructure<NativeMethods.PRINTDLGEX64>(unmanagedBuffer); 683Marshal.FreeHGlobal(unmanagedBuffer); 722int cbDevNames = checked(((printer.Length + 3) * Marshal.SystemDefaultCharSize) + 723Marshal.SizeOf(typeof(NativeMethods.DEVNAMES))); 724hDevNames = Marshal.AllocHGlobal(cbDevNames); 726ushort baseOffset = (ushort)Marshal.SizeOf(typeof(NativeMethods.DEVNAMES)); 736devNames.wDeviceOffset = (ushort)(baseOffset / Marshal.SystemDefaultCharSize); 740Marshal.StructureToPtr(devNames, hDevNames, false); 750checked((IntPtr)((long)offsetName + (printer.Length * Marshal.SystemDefaultCharSize))); 760byte[] nulls = new byte[3 * Marshal.SystemDefaultCharSize]; 762Marshal.Copy( 767Marshal.Copy( 815IntPtr hDevMode = Marshal.AllocHGlobal(devModeData.Length); 816Marshal.Copy(devModeData, 0, hDevMode, devModeData.Length);
MS\Internal\WindowsRuntime\Generated\Windows.Data.Text.cs (14)
458var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 3); 459Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false); 630var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 17); 631Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false); 1142var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 3); 1143Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false); 1294var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 4); 1295Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false); 1482var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 1); 1483Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false); 1574Invoke = Marshal.GetFunctionPointerForDelegate(AbiInvokeDelegate) 1576var nativeVftbl = ComWrappersSupport.AllocateVtableMemory(typeof(WordSegmentsTokenizingHandler), Marshal.SizeOf<global::WinRT.Interop.IDelegateVftbl>()); 1577Marshal.StructureToPtr(AbiToProjectionVftable, nativeVftbl, false); 1607var abiInvoke = Marshal.GetDelegateForFunctionPointer<Abi_Invoke>(_nativeDelegate.Vftbl.Invoke);
MS\Internal\WindowsRuntime\Generated\Windows.Globalization.cs (12)
233var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 4); 234Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false); 417var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 1); 418Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false); 491var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 1); 492Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false); 572var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 1); 573Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false); 655var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 2); 656Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false); 771var nativeVftbl = (IntPtr*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 1); 772Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false);
MS\Internal\WindowsRuntime\Generated\WinRT.cs (15)
17Marshal.ThrowExceptionForHR((int)del.DynamicInvoke(invoke_params)); 22return Marshal.GetDelegateForFunctionPointer<T>( 23Marshal.GetFunctionPointerForDelegate(del)); 47Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 49return Marshal.GetDelegateForFunctionPointer<T>(functionPtr); 137Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 145_CanUnloadNow = Marshal.GetDelegateForFunctionPointer<DllCanUnloadNow>(canUnloadNow); 166Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); 201Marshal.ThrowExceptionForHR(Platform.CoIncrementMTAUsage(&mtaCookie)); 217Marshal.ThrowExceptionForHR(Platform.CoDecrementMTAUsage(_mtaCookie)); 247Marshal.ThrowExceptionForHR(hr); 255Marshal.ThrowExceptionForHR(_IActivationFactory.Vftbl.ActivateInstance(_IActivationFactory.ThisPtr, out IntPtr instancePtr));
MS\Internal\WindowsRuntime\Generated\WinRT\ComWrappersSupport.net5.cs (5)
65QueryInterface = Marshal.GetDelegateForFunctionPointer<IUnknownVftbl._QueryInterface>(qi), 66AddRef = Marshal.GetDelegateForFunctionPointer<IUnknownVftbl._AddRef>(addRef), 67Release = Marshal.GetDelegateForFunctionPointer<IUnknownVftbl._Release>(release), 91ComInterfaceEntry* nativeEntries = (ComInterfaceEntry*)Marshal.AllocCoTaskMem(sizeof(ComInterfaceEntry) * count); 151Marshal.FreeCoTaskMem((IntPtr)_data);
MS\Internal\WindowsRuntime\Generated\WinRT\Context.cs (1)
17Marshal.ThrowExceptionForHR(CoGetObjectContext(ref riid, out IntPtr contextCallbackPtr));
MS\Internal\WindowsRuntime\Generated\WinRT\ExceptionHelpers.cs (4)
96Marshal.ThrowExceptionForHR(getRestrictedErrorInfo(out IntPtr restrictedErrorInfoPtr)); 148ex = Marshal.GetExceptionForHR(hr, iErrorInfo?.ThisPtr ?? (IntPtr)(-1)); 208Marshal.ThrowExceptionForHR(getRestrictedErrorInfo(out IntPtr ppRestrictedErrorInfo)); 311Marshal.ThrowExceptionForHR(getRestrictedErrorInfo(out IntPtr restrictedErrorInfoPtr));
MS\Internal\WindowsRuntime\Generated\WinRT\IInspectable.cs (4)
45AbiToProjectionVftablePtr = Marshal.AllocHGlobal(Marshal.SizeOf<Vftbl>()); 46Marshal.StructureToPtr(AbiToProjectionVftable, AbiToProjectionVftablePtr, false); 112Marshal.ThrowExceptionForHR(hr);
MS\Internal\WindowsRuntime\Generated\WinRT\Interop\ExceptionErrorInfo.cs (38)
107var nativeVftbl = (IntPtr*)Marshal.AllocCoTaskMem(Marshal.SizeOf<Vftbl>()); 108Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false); 134source = Marshal.StringToBSTR(_source); 138Marshal.FreeBSTR(source); 152description = Marshal.StringToBSTR(_description); 156Marshal.FreeBSTR(description); 170helpFile = Marshal.StringToBSTR(_helpFile); 174Marshal.FreeBSTR(helpFile); 188helpFileContent = Marshal.StringToBSTR(_helpFileContent); 192Marshal.FreeBSTR(helpFileContent); 217Marshal.ThrowExceptionForHR(_obj.Vftbl.GetGuid_0(ThisPtr, out __return_value__)); 226Marshal.ThrowExceptionForHR(_obj.Vftbl.GetSource_1(ThisPtr, out __retval)); 227return __retval != IntPtr.Zero ? Marshal.PtrToStringBSTR(__retval) : string.Empty; 231Marshal.FreeBSTR(__retval); 240Marshal.ThrowExceptionForHR(_obj.Vftbl.GetDescription_2(ThisPtr, out __retval)); 241return __retval != IntPtr.Zero ? Marshal.PtrToStringBSTR(__retval) : string.Empty; 245Marshal.FreeBSTR(__retval); 254Marshal.ThrowExceptionForHR(_obj.Vftbl.GetHelpFile_3(ThisPtr, out __retval)); 255return __retval != IntPtr.Zero ? Marshal.PtrToStringBSTR(__retval) : string.Empty; 259Marshal.FreeBSTR(__retval); 268Marshal.ThrowExceptionForHR(_obj.Vftbl.GetHelpFileContent_4(ThisPtr, out __retval)); 269return __retval != IntPtr.Zero ? Marshal.PtrToStringBSTR(__retval) : string.Empty; 273Marshal.FreeBSTR(__retval); 309Marshal.ThrowExceptionForHR(_obj.Vftbl.GetLanguageException_0(ThisPtr, out __return_value__)); 341var nativeVftbl = (IntPtr*)Marshal.AllocCoTaskMem(Marshal.SizeOf<Vftbl>()); 342Marshal.StructureToPtr(AbiToProjectionVftable, (IntPtr)nativeVftbl, false); 419Marshal.ThrowExceptionForHR(_obj.Vftbl.GetErrorDetails_0(ThisPtr, out _description, out error, out _restrictedDescription, out _capabilitySid)); 420description = _description != IntPtr.Zero ? Marshal.PtrToStringBSTR(_description) : string.Empty; 421restrictedDescription = _restrictedDescription != IntPtr.Zero ? Marshal.PtrToStringBSTR(_restrictedDescription) : string.Empty; 422capabilitySid = _capabilitySid != IntPtr.Zero ? Marshal.PtrToStringBSTR(_capabilitySid) : string.Empty; 426Marshal.FreeBSTR(_description); 427Marshal.FreeBSTR(_restrictedDescription); 428Marshal.FreeBSTR(_capabilitySid); 437Marshal.ThrowExceptionForHR(_obj.Vftbl.GetReference_1(ThisPtr, out __retval)); 438return __retval != IntPtr.Zero ? Marshal.PtrToStringBSTR(__retval) : string.Empty; 442Marshal.FreeBSTR(__retval);
MS\Internal\WindowsRuntime\Generated\WinRT\Interop\IContextCallback.cs (1)
77Marshal.ThrowExceptionForHR(_obj.Vftbl.ContextCallback_4(ThisPtr, pfnCallback, pParam, ref riid, iMethod, IntPtr.Zero));
MS\Internal\WindowsRuntime\Generated\WinRT\Interop\IUnknownVftbl.cs (3)
25AbiToProjectionVftblPtr = Marshal.AllocHGlobal(Marshal.SizeOf<IUnknownVftbl>()); 26Marshal.StructureToPtr(AbiToProjectionVftbl, AbiToProjectionVftblPtr, false);
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (27)
54Marshal.ThrowExceptionForHR(Platform.WindowsCreateStringReference( 106Marshal.ThrowExceptionForHR( 124Marshal.FreeCoTaskMem(_array); 143m._array = Marshal.AllocCoTaskMem(length * IntPtr.Size); 210data = Marshal.AllocCoTaskMem(length * IntPtr.Size); 268Marshal.FreeCoTaskMem(abi.data); 308var byte_length = length * Marshal.SizeOf<T>(); 309var data = Marshal.AllocCoTaskMem(byte_length); 319int byte_length = array.Length * Marshal.SizeOf<T>(); 335Marshal.FreeCoTaskMem(abi.data); 439Marshal.FreeCoTaskMem(_array); 458var abi_element_size = Marshal.SizeOf(HelperType); 460m._array = Marshal.AllocCoTaskMem(byte_length); 493var abi_element_size = Marshal.SizeOf(HelperType); 496var abi_element = Marshal.PtrToStructure((IntPtr)data, HelperType); 511var abi_element_size = Marshal.SizeOf(HelperType); 514var abi_element = Marshal.PtrToStructure((IntPtr)data, HelperType); 538var abi_element_size = Marshal.SizeOf(HelperType); 540data = Marshal.AllocCoTaskMem(byte_length); 568var abi_element_size = Marshal.SizeOf(HelperType); 587var abi_element_size = Marshal.SizeOf(HelperType); 590var abi_element = Marshal.PtrToStructure((IntPtr)data, HelperType); 602Marshal.FreeCoTaskMem(abi.data); 621Marshal.FreeCoTaskMem(_array); 641m._array = Marshal.AllocCoTaskMem(byte_length); 699data = Marshal.AllocCoTaskMem(byte_length); 756Marshal.FreeCoTaskMem(abi.data);
MS\Internal\WindowsRuntime\Generated\WinRT\ObjectReference.cs (6)
55Marshal.ThrowExceptionForHR(VftblIUnknown.QueryInterface(ThisPtr, ref iid, out IntPtr thatPtr)); 130releaseDelegate = Marshal.PtrToStructure<IUnknownVftbl>(Marshal.PtrToStructure<VftblPtr>(ThisPtr).Vftbl).Release; 206var vftblPtr = Marshal.PtrToStructure<VftblPtr>(thisPtr); 207var vftblIUnknown = Marshal.PtrToStructure<IUnknownVftbl>(vftblPtr.Vftbl); 215vftblT = Marshal.PtrToStructure<T>(vftblPtr.Vftbl);
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IEnumerable.cs (21)
102var vftblPtr = Marshal.PtrToStructure<VftblPtr>(thisPtr); 104IInspectableVftbl = Marshal.PtrToStructure<IInspectable.Vftbl>(vftblPtr.Vftbl); 105First_0 = Marshal.GetDelegateForFunctionPointer<IEnumerable_Delegates.First_0>(vftbl[6]); 117var nativeVftbl = (IntPtr*)Marshal.AllocCoTaskMem(Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 1); 118Marshal.StructureToPtr(AbiToProjectionVftable.IInspectableVftbl, (IntPtr)nativeVftbl, false); 119nativeVftbl[6] = Marshal.GetFunctionPointerForDelegate(AbiToProjectionVftable.First_0); 301if (Marshal.GetHRForException(e) == ExceptionHelpers.E_CHANGED_STATE) 428var vftblPtr = Marshal.PtrToStructure<VftblPtr>(thisPtr); 430IInspectableVftbl = Marshal.PtrToStructure<IInspectable.Vftbl>(vftblPtr.Vftbl); 431get_Current_0 = Marshal.GetDelegateForFunctionPointer(vftbl[6], get_Current_0_Type); 432get_HasCurrent_1 = Marshal.GetDelegateForFunctionPointer<_get_PropertyAsBoolean>(vftbl[7]); 433MoveNext_2 = Marshal.GetDelegateForFunctionPointer<IEnumerator_Delegates.MoveNext_2>(vftbl[8]); 434GetMany_3 = Marshal.GetDelegateForFunctionPointer<IEnumerator_Delegates.GetMany_3>(vftbl[9]); 449var nativeVftbl = (IntPtr*)Marshal.AllocCoTaskMem(Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 4); 450Marshal.StructureToPtr(AbiToProjectionVftable.IInspectableVftbl, (IntPtr)nativeVftbl, false); 451nativeVftbl[6] = Marshal.GetFunctionPointerForDelegate(AbiToProjectionVftable.get_Current_0); 452nativeVftbl[7] = Marshal.GetFunctionPointerForDelegate(AbiToProjectionVftable.get_HasCurrent_1); 453nativeVftbl[8] = Marshal.GetFunctionPointerForDelegate(AbiToProjectionVftable.MoveNext_2); 454nativeVftbl[9] = Marshal.GetFunctionPointerForDelegate(AbiToProjectionVftable.GetMany_3);
MS\Internal\WindowsRuntime\Generated\WinRT\Projections\IReadOnlyList.cs (13)
218var vftblPtr = Marshal.PtrToStructure<VftblPtr>(thisPtr); 220IInspectableVftbl = Marshal.PtrToStructure<IInspectable.Vftbl>(vftblPtr.Vftbl); 221GetAt_0 = Marshal.GetDelegateForFunctionPointer(vftbl[6], GetAt_0_Type); 222get_Size_1 = Marshal.GetDelegateForFunctionPointer<_get_PropertyAsUInt32>(vftbl[7]); 223IndexOf_2 = Marshal.GetDelegateForFunctionPointer(vftbl[8], IndexOf_2_Type); 224GetMany_3 = Marshal.GetDelegateForFunctionPointer<IReadOnlyList_Delegates.GetMany_3>(vftbl[9]); 239var nativeVftbl = (IntPtr*)Marshal.AllocCoTaskMem(Marshal.SizeOf<global::WinRT.IInspectable.Vftbl>() + sizeof(IntPtr) * 4); 240Marshal.StructureToPtr(AbiToProjectionVftable.IInspectableVftbl, (IntPtr)nativeVftbl, false); 241nativeVftbl[6] = Marshal.GetFunctionPointerForDelegate(AbiToProjectionVftable.GetAt_0); 242nativeVftbl[7] = Marshal.GetFunctionPointerForDelegate(AbiToProjectionVftable.get_Size_1); 243nativeVftbl[8] = Marshal.GetFunctionPointerForDelegate(AbiToProjectionVftable.IndexOf_2); 244nativeVftbl[9] = Marshal.GetFunctionPointerForDelegate(AbiToProjectionVftable.GetMany_3);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SecurityHelper.cs (1)
133return Marshal.GetExceptionForHR(hr, new IntPtr(-1));
System\Windows\Controls\PasswordBox.cs (2)
154IntPtr ptr = System.Runtime.InteropServices.Marshal.SecureStringToBSTR(securePassword); 165System.Runtime.InteropServices.Marshal.ZeroFreeBSTR(ptr);
System\Windows\Controls\Primitives\Popup.cs (2)
2672cbSize = Marshal.SizeOf(typeof(NativeMethods.MONITORINFOEX)) 2770int resultOfGetObject = UnsafeNativeMethods.GetObject(iconInfo.hbmMask.MakeHandleRef(null), Marshal.SizeOf(typeof(NativeMethods.BITMAP)), bm);
System\Windows\Controls\WebBrowser.cs (1)
430if (!Marshal.IsTypeVisibleFromCom(t))
System\windows\Documents\CaretElement.cs (4)
988int win32Error = Marshal.GetLastWin32Error(); 1020int win32Error = Marshal.GetLastWin32Error(); 1074int win32Error = Marshal.GetLastWin32Error(); 1086win32Error = Marshal.GetLastWin32Error();
System\Windows\Documents\FrameworkTextComposition.cs (4)
163Marshal.ReleaseComObject(composition); 166Marshal.ReleaseComObject(context); 177Marshal.ReleaseComObject(context); 325Marshal.ReleaseComObject(enumCompositionView);
System\Windows\Documents\ImmComposition.cs (7)
1324int requestSize = Marshal.SizeOf(typeof(NativeMethods.RECONVERTSTRING)) + (target.Length * sizeof(short)) + ((_maxSrounding + 1) * sizeof(short) * 2); 1333NativeMethods.RECONVERTSTRING reconv = Marshal.PtrToStructure<NativeMethods.RECONVERTSTRING>(lParam); 1338reconv.dwStrOffset = Marshal.SizeOf(typeof(NativeMethods.RECONVERTSTRING)); // in byte count 1355Marshal.StructureToPtr(reconv, lParam, true); 1368p += Marshal.SizeOf(typeof(NativeMethods.RECONVERTSTRING)); 1369Marshal.Copy(surrounding.ToCharArray(), 0, new IntPtr((void*)p), surrounding.Length); 1495NativeMethods.RECONVERTSTRING reconv = Marshal.PtrToStructure<NativeMethods.RECONVERTSTRING>(lParam);
System\Windows\Documents\InputScopeAttribute.cs (9)
56ppinputscopes = Marshal.AllocCoTaskMem(sizeof(Int32) * count); 65Marshal.WriteInt32(ppinputscopes, offset, (Int32)((InputScopeName)_inputScope.Names[i]).NameValue); 71ppinputscopes = Marshal.AllocCoTaskMem(sizeof(Int32) * 1); 72Marshal.WriteInt32(ppinputscopes, (Int32)InputScopeNameValue.Default); 84ppbstrPhrases = Marshal.AllocCoTaskMem(IntPtr.Size * count); 97pbstr = Marshal.StringToBSTR(((InputScopePhrase)_inputScope.PhraseList[i]).Name); 104Marshal.FreeBSTR(Marshal.ReadIntPtr(ppbstrPhrases, offset)); 110Marshal.WriteIntPtr(ppbstrPhrases , offset, pbstr);
System\Windows\Documents\MsSpellCheckLib\SpellChecker\OptionDescription.cs (1)
76Marshal.ReleaseComObject(optionDescription);
System\Windows\Documents\MsSpellCheckLib\SpellChecker\SpellChecker.cs (1)
615Marshal.ReleaseComObject(_speller.Value);
System\Windows\Documents\MsSpellCheckLib\SpellChecker\SpellingError.cs (1)
104Marshal.ReleaseComObject(error);
System\Windows\Documents\MsSpellCheckLib\SpellCheckerFactory\SpellCheckerFactory.cs (1)
122Marshal.ReleaseComObject(Singleton.ComFactory);
System\Windows\Documents\MsSpellCheckLib\Utils\Extensions.cs (4)
59Marshal.ReleaseComObject(enumString); 106Marshal.ReleaseComObject(spellingErrors); 164Marshal.ReleaseComObject(iSpellingError); 176Marshal.ReleaseComObject(spellingErrors);
System\Windows\Documents\NLGSpellerInterop.cs (19)
58Marshal.ReleaseComObject(textContext); 80Marshal.ReleaseComObject(_textChunk); 120Marshal.ReleaseComObject(_textChunk); 167Marshal.ReleaseComObject(options); 173Marshal.ReleaseComObject(textContext); 189IntPtr inputArray = Marshal.AllocHGlobal(count * 2); 194Marshal.Copy(text, 0, inputArray, count); 253Marshal.ReleaseComObject(sentenceEnumerator); 258Marshal.FreeHGlobal(inputArray); 281Marshal.ReleaseComObject(lexicon); 285Marshal.ReleaseComObject(textContext); 340Marshal.ReleaseComObject(lexicon); 348Marshal.ReleaseComObject(textContext); 604suggestions.Add(Marshal.PtrToStringUni(variant.data1)); 609Marshal.ReleaseComObject(variantEnumerator); 759Marshal.ReleaseComObject(_textSegment); 848Marshal.ReleaseComObject(sentence); 988Marshal.ReleaseComObject(lexicon); 992Marshal.ReleaseComObject(textContext);
System\windows\Documents\TextEditor.cs (1)
1540Marshal.ReleaseComObject(threadManager);
System\windows\Documents\TextEditorContextMenu.cs (2)
587Marshal.ReleaseComObject(candString); 653Marshal.ReleaseComObject(CandidateList);
System\Windows\Documents\TextFindEngine.cs (1)
579int win32Error = System.Runtime.InteropServices.Marshal.GetLastWin32Error();
System\Windows\Documents\TextServicesDisplayAttributePropertyRanges.cs (6)
157Marshal.ReleaseComObject(attributeRanges[0]); 176Marshal.ReleaseComObject(attributeRangeEnumerator); 179Marshal.ReleaseComObject(displayAttributeProperty); 229Marshal.ReleaseComObject(catmgr); 253Marshal.ReleaseComObject(dai); 261Marshal.ReleaseComObject(dam);
System\Windows\Documents\TextServicesHost.cs (6)
142Marshal.ReleaseComObject(comp); 171Marshal.ReleaseComObject(comp); 240Marshal.ReleaseComObject(context); 244Marshal.ReleaseComObject(textstore.DocumentManager); 339Marshal.ReleaseComObject(context); 377Marshal.ReleaseComObject(_threadManager);
System\Windows\Documents\TextServicesPropertyRanges.cs (5)
88Marshal.ReleaseComObject(outRangesProp[0]); 90Marshal.ReleaseComObject(rangesProp); 93Marshal.ReleaseComObject(outRanges[0]); 95Marshal.ReleaseComObject(ranges); 97Marshal.ReleaseComObject(prop);
System\Windows\Documents\TextStore.cs (17)
90Marshal.ReleaseComObject(_sink); 109Marshal.ReleaseComObject(_sink); 1449Marshal.ReleaseComObject(editRecord); 1778Marshal.ReleaseComObject(funcReconv); 1783Marshal.ReleaseComObject(range); 1801Marshal.ReleaseComObject(funcReconv); 1806Marshal.ReleaseComObject(range); 1856Marshal.ReleaseComObject(functionPrv); 1860Marshal.ReleaseComObject(funcReconv); 1864Marshal.ReleaseComObject(range); 1865Marshal.ReleaseComObject(context); 2791attrval.val.data1 = Marshal.GetIUnknownForObject(obj); 2806attrval.val.data1 = Marshal.StringToBSTR(familyName); 2922Marshal.ReleaseComObject(range); 2923Marshal.ReleaseComObject(view); 4250Marshal.ReleaseComObject(_range); 4256Marshal.ReleaseComObject(_sink);
System\Windows\Interop\ActiveXHost.cs (1)
588Marshal.FinalReleaseComObject(_axInstance);
System\Windows\Shell\WindowChromeWorker.cs (3)
403var rcClientArea = Marshal.PtrToStructure<RECT>(lParam); 421Marshal.StructureToPtr(rcClientArea, lParam, false); 566var wp = Marshal.PtrToStructure<WINDOWPOS>(lParam);
System\Windows\Standard\ErrorCodes.cs (1)
105return new Win32Error(Marshal.GetLastWin32Error());
System\Windows\Standard\MessageWindow.cs (2)
45cbSize = Marshal.SizeOf(typeof(WNDCLASSEX)), 148var createStruct = Marshal.PtrToStructure<CREATESTRUCT>(lParam);
System\Windows\Standard\NativeMethods.cs (9)
1877cbSize = Marshal.SizeOf(typeof(NONCLIENTMETRICS)) 1890cbSize = Marshal.SizeOf(typeof(NONCLIENTMETRICS)) - sizeof(int) 1936public int cbSize = Marshal.SizeOf(typeof(MONITORINFO)); 2155public int length = Marshal.SizeOf(typeof(WINDOWPLACEMENT)); 2330var filterstruct = new CHANGEFILTERSTRUCT { cbSize = (uint)Marshal.SizeOf(typeof(CHANGEFILTERSTRUCT)) }; 2363IntPtr currArg = Marshal.ReadIntPtr(argv, i * IntPtr.Size); 2364result[i] = Marshal.PtrToStringUni(currArg); 3045var hc = new HIGHCONTRAST { cbSize = Marshal.SizeOf(typeof(HIGHCONTRAST)) }; 3207var dti = new DWM_TIMING_INFO { cbSize = Marshal.SizeOf(typeof(DWM_TIMING_INFO)) };
System\Windows\Standard\Utilities.cs (2)
213Assert.IsTrue(Marshal.IsComObject(t)); 214Marshal.ReleaseComObject(t);
System\Windows\SystemParameters.cs (1)
170cbSize = Marshal.SizeOf(typeof(NativeMethods.HIGHCONTRAST_I))
System\Windows\Window.cs (5)
3949length = Marshal.SizeOf(typeof(NativeMethods.WINDOWPLACEMENT)) 5210placement.length = Marshal.SizeOf(placement); 5900length = Marshal.SizeOf(typeof(NativeMethods.WINDOWPLACEMENT)) 5988cbSize = Marshal.SizeOf(typeof(NativeMethods.MONITORINFOEX)) 7392cbSize = Marshal.SizeOf(typeof(NativeMethods.MONITORINFOEX))
PresentationUI (13)
MS\Internal\Documents\PeoplePickerWrapper.cs (13)
133(uint)Marshal.SizeOf(typeof(UnsafeNativeMethods.QueryInitParams)), 144IntPtr queryInitParamsPtr = Marshal.AllocCoTaskMem(Marshal.SizeOf(queryInitParams)); 154Marshal.StructureToPtr(queryInitParams, queryInitParamsPtr, false /*fDeleteOld*/); 168(uint)Marshal.SizeOf(typeof(UnsafeNativeMethods.OpenQueryWindowParams)), 194Marshal.FreeCoTaskMem(queryInitParamsPtr); 325_ptrToDsObjectNames = Marshal.AllocHGlobal(data.Length); 329Marshal.Copy(data, 0, _ptrToDsObjectNames, data.Length); 333_dsObjectNames = Marshal.PtrToStructure<UnsafeNativeMethods.DsObjectNames>(_ptrToDsObjectNames); 422return Marshal.PtrToStringAuto(nameOffset); 455UnsafeNativeMethods.DsObject dsObject = Marshal.PtrToStructure<UnsafeNativeMethods.DsObject>(offset); 479Marshal.FreeHGlobal(_ptrToDsObjectNames); 524Marshal.SizeOf(typeof(UnsafeNativeMethods.DsObject));
ReachFramework (27)
MS\Internal\Printing\Configuration\DevMode.cs (3)
460short dmSize = Marshal.ReadInt16(devModeWPointer, DevMode.DEVMODEW_dmSizeByteOffset); 461short dmExtraSize = Marshal.ReadInt16(devModeWPointer, DevMode.DEVMODEW_dmDriverExtraByteOffset); 465Marshal.Copy(devModeWPointer, devModeWBytes, 0, devModeWByteSize);
MS\Internal\Printing\Configuration\WinSpoolPrinterCapabilities.cs (8)
391return GetArrayCapability<T>(capability, readItem, Marshal.SizeOf(typeof(T))); 446result[i] = (uint)Marshal.ReadInt32(baseAddr, offset); 472result[i] = Marshal.ReadInt16(baseAddr, offset); 498int x = Marshal.ReadInt32(baseAddr, offset); 499int y = Marshal.ReadInt32(baseAddr, offset + (itemByteSize / 2)); 526int w = Marshal.ReadInt32(baseAddr, offset); 527int h = Marshal.ReadInt32(baseAddr, offset + (itemByteSize / 2)); 555string str = Marshal.PtrToStringUni(strAddr, itemByteSize / 2);
PrintConfig\FallbackPTProvider.cs (9)
57throw new PrintQueueException(Marshal.GetLastWin32Error(), "PrintConfig.Provider.BindFail", deviceName); 748IntPtr pPrinterName = Marshal.ReadIntPtr(ptr, 1 * IntPtr.Size); 751PRINTER_INFO_2.pPrinterName = Marshal.PtrToStringUni(pPrinterName); 755IntPtr pPortName = Marshal.ReadIntPtr(ptr, 3 * IntPtr.Size); 758PRINTER_INFO_2.pPortName = Marshal.PtrToStringUni(pPortName); 762IntPtr pDriverName = Marshal.ReadIntPtr(ptr, 4 * IntPtr.Size); 765PRINTER_INFO_2.pDriverName = Marshal.PtrToStringUni(pDriverName); 769IntPtr pDevMode = Marshal.ReadIntPtr(ptr, 7 * IntPtr.Size); 814IntPtr pDevMode = Marshal.ReadIntPtr(pPrinterBuffer.Handle.DangerousGetHandle());
PrintConfig\PTProvider.cs (7)
390IntPtr umDevMode = Marshal.AllocCoTaskMem(devMode.Length); 394Marshal.Copy(devMode, 0, umDevMode, devMode.Length); 424Marshal.FreeCoTaskMem(umDevMode); 476Marshal.Copy(umDevMode, devMode, 0, (int)umDevModeLen); 598Marshal.ReleaseComObject(result); 791Marshal.ThrowExceptionForHR((int)hResult); 801Marshal.ReleaseComObject(stream);
Roslyn.Diagnostics.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (1)
507Marshal.Copy((IntPtr)valuePtr, bytes, 0, bytes.Length);
rzc (2)
ServerProtocol\ServerConnection.cs (2)
347startInfo.cb = Marshal.SizeOf(startInfo); 379ServerLogger.Log("Failed to create process. GetLastError={0}", Marshal.GetLastWin32Error());
System.ComponentModel.TypeConverter (2)
System\ComponentModel\ReferenceConverter.cs (1)
101if (!Marshal.IsComObject(value) && value is IComponent comp)
System\ComponentModel\TypeDescriptor.cs (1)
1773Marshal.Release(unknown);
System.Console (53)
_generated\0\LibraryImports.g.cs (51)
36global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 38__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 41global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 68global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 70__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 79global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 97global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 99__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 102global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 212global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 214__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 235global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 365global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 367__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 377global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 404global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 406__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 415global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 445global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 447__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 456global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 486global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 488__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 497global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 527global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 529__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 538global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 565global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 567__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 576global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 603global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 605__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 614global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 641global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 643__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 652global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 670global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 672__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 675global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 702global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 704__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 713global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 743global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 745__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 754global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 773global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 775__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 780global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 843global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 845__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 848global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
System.Data.Odbc (27)
Common\System\Data\Common\SafeNativeMethods.cs (3)
12var handle = Marshal.AllocHGlobal(initialSize); 19Marshal.FreeHGlobal(ptr); 25Marshal.Copy(zeroes, 0, ptr, length);
Common\System\Data\ProviderBase\DbBuffer.cs (22)
71value = Marshal.PtrToStringUni(ptr); 99value = Marshal.PtrToStringUni(ptr, length); 125value = Marshal.ReadByte(ptr, offset); 158Marshal.Copy(ptr, destination, startIndex, length); 191Marshal.Copy(ptr, destination, startIndex, length); 223value = Marshal.ReadInt16(ptr, offset); 250Marshal.Copy(ptr, destination, startIndex, length); 275value = Marshal.ReadInt32(ptr, offset); 302Marshal.Copy(ptr, destination, startIndex, length); 327value = Marshal.ReadInt64(ptr, offset); 353value = Marshal.ReadIntPtr(ptr, offset); 387ValidateCheck(offset, Marshal.SizeOf(structure.GetType())); 397Marshal.StructureToPtr(structure, ptr, false/*fDeleteOld*/); 421Marshal.WriteByte(ptr, offset, value); 447Marshal.Copy(source, startIndex, ptr, length); 473Marshal.Copy(source, startIndex, ptr, length); 502Marshal.WriteInt16(ptr, offset, value); 528Marshal.Copy(source, startIndex, ptr, length); 552Marshal.WriteInt32(ptr, offset, value); 578Marshal.Copy(source, startIndex, ptr, length); 602Marshal.WriteInt64(ptr, offset, value); 626Marshal.WriteIntPtr(ptr, offset, value);
System\Data\Odbc\OdbcStatementHandle.cs (2)
292IntPtr pwszTableName = Marshal.StringToCoTaskMemUni(tableName); 307Marshal.FreeCoTaskMem(pwszTableName);
System.Data.OleDb (184)
_generated\0\System.Data.Common.UnsafeNativeMethods.ISQLErrorInfo.cs (1)
54global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([116, 58, 115, 12, 28, 42, 206, 17, 173, 229, 0, 170, 0, 68, 119, 61]), (global::System.IntPtr)__this);
_generated\1\System.Data.Common.UnsafeNativeMethods.IErrorInfo.cs (1)
52global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([32, 177, 242, 28, 125, 84, 27, 16, 142, 101, 8, 0, 43, 43, 209, 25]), (global::System.IntPtr)__this);
_generated\2\System.Data.Common.UnsafeNativeMethods.IErrorRecords.cs (5)
58global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([103, 58, 115, 12, 28, 42, 206, 17, 173, 229, 0, 170, 0, 68, 119, 61]), (global::System.IntPtr)__this); 97global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([103, 58, 115, 12, 28, 42, 206, 17, 173, 229, 0, 170, 0, 68, 119, 61]), (global::System.IntPtr)__this); 205global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([103, 58, 115, 12, 28, 42, 206, 17, 173, 229, 0, 170, 0, 68, 119, 61]), (global::System.IntPtr)__this); 262global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([103, 58, 115, 12, 28, 42, 206, 17, 173, 229, 0, 170, 0, 68, 119, 61]), (global::System.IntPtr)__this); 302global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([103, 58, 115, 12, 28, 42, 206, 17, 173, 229, 0, 170, 0, 68, 119, 61]), (global::System.IntPtr)__this);
_generated\3\LibraryImports.g.cs (15)
56global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 58__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 76global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 103global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 105__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 123global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 155global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 157__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 169global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 197global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 199__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 208global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 230global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 232__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 235global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
ColumnBinding.cs (7)
638value = Marshal.PtrToStringBSTR(ptr); 674Marshal.Copy(ptr, value, 0, value.Length); 722value = Marshal.PtrToStringUni(ptr, charCount); 1020value = Marshal.GetObjectForIUnknown(ptr); 1043MethodInfo? mi = typeof(Marshal).GetMethod("GetIDispatchForObject", BindingFlags.Public | BindingFlags.Static); 1067value = Marshal.GetObjectForIUnknown(ptr); 1084IntPtr ptr = Marshal.GetIUnknownForObject(value);
DbPropSet.cs (6)
139IntPtr rgProperties = Marshal.ReadIntPtr(ptr, offset); 142int cProperties = Marshal.ReadInt32(ptr, offset + IntPtr.Size); 190Marshal.PtrToStructure(propertySetPtr, propset); 198Marshal.PtrToStructure(ptr, properties[i]); 254Marshal.StructureToPtr(propset, propsetPtr, false/*deleteold*/); 266Marshal.StructureToPtr(properties[i], propertyPtr, false/*deleteold*/);
OleDb_Util.cs (22)
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>(); 576internal static readonly int OffsetOf_tagDBPROP_Status = IsRunningOnX86 ? Marshal.OffsetOf(typeof(tagDBPROP_x86), "dwStatus").ToInt32() : Marshal.OffsetOf(typeof(tagDBPROP), "dwStatus").ToInt32(); 577internal static readonly int OffsetOf_tagDBPROP_Value = IsRunningOnX86 ? Marshal.OffsetOf(typeof(tagDBPROP_x86), "vValue").ToInt32() : Marshal.OffsetOf(typeof(tagDBPROP), "vValue").ToInt32(); 578internal static readonly int OffsetOf_tagDBPROPSET_Properties = Marshal.OffsetOf(typeof(tagDBPROPSET), "rgProperties").ToInt32(); 579internal static readonly int OffsetOf_tagDBPROPINFO_Value = IsRunningOnX86 ? Marshal.OffsetOf(typeof(tagDBPROPINFO_x86), "vValue").ToInt32() : Marshal.OffsetOf(typeof(tagDBPROPINFO), "vValue").ToInt32(); 580internal static readonly int OffsetOf_tagDBPROPIDSET_PropertySet = Marshal.OffsetOf(typeof(tagDBPROPIDSET), "guidPropertySet").ToInt32(); 581internal static readonly int OffsetOf_tagDBLITERALINFO_it = Marshal.OffsetOf(typeof(tagDBLITERALINFO), "it").ToInt32(); 582internal static readonly int OffsetOf_tagDBBINDING_obValue = Marshal.OffsetOf(typeof(tagDBBINDING), "obValue").ToInt32(); 583internal static readonly int OffsetOf_tagDBBINDING_wType = Marshal.OffsetOf(typeof(tagDBBINDING), "wType").ToInt32();
OleDbCommand.cs (2)
558Marshal.ReleaseComObject(ict); 733Marshal.ReleaseComObject(executeResult);
OleDbConnectionInternal.cs (7)
281Marshal.ReleaseComObject(unknown); 425tag = Marshal.PtrToStructure<tagDBLITERALINFO>((IntPtr)offset)!; 549if ((1 == literalCount) && Marshal.ReadInt32(literalInfo, ODB.OffsetOf_tagDBLITERALINFO_it) == literal) 551literalValue = Marshal.PtrToStringUni(Marshal.ReadIntPtr(literalInfo, 0)); 602supportedSchemas[i]._schemaRowset = Marshal.PtrToStructure<Guid>(ptr)!; 609supportedSchemas[i]._restrictions = Marshal.ReadInt32(schemaRestrictions, i * 4);
OleDbDataReader.cs (7)
505Marshal.PtrToStructure(ADP.IntPtrOffset(columnInfos, offset), dbColumnInfo); 566info.idname = Marshal.PtrToStringUni(dbColumnInfo.columnid.ulPropid); 629Marshal.ReleaseComObject(rowset); 692Marshal.ReleaseComObject(multipleResults); 777Marshal.ReleaseComObject(imultipleResults); 796Marshal.ReleaseComObject(irowset); 807Marshal.ReleaseComObject(irow);
OleDbStruct.cs (2)
52builder.Append("pwszDataSourceType =").Append(Marshal.PtrToStringUni(pwszDataSourceType)).Append(Environment.NewLine); 80builder.AppendLine($"pwszDataSourceType ={Marshal.PtrToStringUni(pwszDataSourceType)}");
OleDbTransaction.cs (1)
202Marshal.ReleaseComObject(wrapper);
OleDbWrapper.cs (39)
35base.handle = Marshal.GetComInterfaceForObject(unknown, typeof(UnsafeNativeMethods.IDataInitialize)); 40IntPtr vtable = Marshal.ReadIntPtr(base.handle, 0); 41IntPtr method = Marshal.ReadIntPtr(vtable, 3 * IntPtr.Size); // GetDataSource is the 4'th vtable entry 42DangerousIDataInitializeGetDataSource = Marshal.GetDelegateForFunctionPointer<UnsafeNativeMethods.IDataInitializeGetDataSource>(method); 82Marshal.InitHandle(newWrapper, handle); 138IntPtr vtable = Marshal.ReadIntPtr(base.handle, 0); 139IntPtr method = Marshal.ReadIntPtr(vtable, 0); 146if ((null == QueryInterface) || (method != Marshal.GetFunctionPointerForDelegate(QueryInterface))) 148QueryInterface = Marshal.GetDelegateForFunctionPointer<UnsafeNativeMethods.IUnknownQueryInterface>(method); 155vtable = Marshal.ReadIntPtr(base.handle, 0); 156method = Marshal.ReadIntPtr(vtable, 3 * IntPtr.Size); // Initialize is the 4'th vtable entry 163if ((null == Initialize) || (method != Marshal.GetFunctionPointerForDelegate(Initialize))) 165Initialize = Marshal.GetDelegateForFunctionPointer<UnsafeNativeMethods.IDBInitializeInitialize>(method); 185vtable = Marshal.ReadIntPtr(idbCreateSession, 0); 186method = Marshal.ReadIntPtr(vtable, 3 * IntPtr.Size); // CreateSession is the 4'th vtable entry 192if ((null == CreateSession) || (method != Marshal.GetFunctionPointerForDelegate(CreateSession))) 194CreateSession = Marshal.GetDelegateForFunctionPointer<UnsafeNativeMethods.IDBCreateSessionCreateSession>(method); 221Marshal.InitHandle(newWrapper, handle); 254Marshal.InitHandle(newWrapper, handle); 273Marshal.Release(idbCreateSession); 338IntPtr vtable = Marshal.ReadIntPtr(base.handle, 0); 339IntPtr method = Marshal.ReadIntPtr(vtable, 0); 340UnsafeNativeMethods.IUnknownQueryInterface QueryInterface = Marshal.GetDelegateForFunctionPointer<UnsafeNativeMethods.IUnknownQueryInterface>(method); 349vtable = Marshal.ReadIntPtr(idbCreateCommand, 0); 350method = Marshal.ReadIntPtr(vtable, 3 * IntPtr.Size); 352DangerousIDBCreateCommandCreateCommand = Marshal.GetDelegateForFunctionPointer<UnsafeNativeMethods.IDBCreateCommandCreateCommand>(method); 365Marshal.Release(ptr); 383IntPtr vtable = Marshal.ReadIntPtr(base.handle, 0); 384IntPtr method = Marshal.ReadIntPtr(vtable, 3 * IntPtr.Size); 391if ((null == CreateCommand) || (method != Marshal.GetFunctionPointerForDelegate(CreateCommand))) 393CreateCommand = Marshal.GetDelegateForFunctionPointer<UnsafeNativeMethods.IDBCreateCommandCreateCommand>(method); 417nativeICommandText = Marshal.GetIUnknownForObject(icommandText); 426icommandText = Marshal.GetObjectForIUnknown(nativeICommandText); 434Marshal.Release(nativeICommandText); 485Marshal.ReleaseComObject(unknown); 518Marshal.ReleaseComObject(unknown); 549Marshal.ReleaseComObject(unknown); 582Marshal.ReleaseComObject(unknown); 613Marshal.ReleaseComObject(unknown);
PropertyIDSet.cs (5)
26Marshal.WriteIntPtr(base.handle, 0, ptr); 28Marshal.WriteInt32(base.handle, IntPtr.Size, /*propertyid count*/1); 31Marshal.StructureToPtr(propertySet, ptr, false/*deleteold*/); 34Marshal.WriteInt32(base.handle, PropertyIDSetSize, propertyID); 44Marshal.StructureToPtr(propertySets[i], ptr, false/*deleteold*/);
PropertyInfoSet.cs (4)
76Marshal.PtrToStructure(setPtr, propinfoset); 82Marshal.PtrToStructure(infoPtr, propinfo); 120IntPtr infoPtr = Marshal.ReadIntPtr(ptr, offset); 123int infoCount = Marshal.ReadInt32(ptr, offset + IntPtr.Size);
RowBinding.cs (17)
138Marshal.StructureToPtr(dbbindings[i], ptr, false/*deleteold*/); 183value = Marshal.GetObjectForNativeVariant(buffer); 217Marshal.GetNativeVariantForObject(value, buffer); 260Marshal.WriteIntPtr(base.handle, offset, ptr); 261Marshal.WriteIntPtr(base.handle, offset + IntPtr.Size, ptr); 299Marshal.WriteIntPtr(base.handle, offset, pinnedValue); // parameter input value 300Marshal.WriteIntPtr(base.handle, offset + IntPtr.Size, pinnedValue); // original parameter value 401int valueOffset = _headerLength + Marshal.ReadIntPtr(ptr, ODB.OffsetOf_tagDBBINDING_obValue).ToInt32(); 402short wtype = Marshal.ReadInt16(ptr, ODB.OffsetOf_tagDBBINDING_wType); 490IntPtr currentValue = Marshal.ReadIntPtr(buffer, valueOffset); 491IntPtr originalValue = Marshal.ReadIntPtr(buffer, valueOffset + IntPtr.Size); 503Marshal.WriteIntPtr(buffer, valueOffset, IntPtr.Zero); 504Marshal.WriteIntPtr(buffer, valueOffset + IntPtr.Size, IntPtr.Zero); 519IntPtr currentValue = Marshal.ReadIntPtr(buffer, valueOffset); 520IntPtr originalValue = Marshal.ReadIntPtr(buffer, valueOffset + IntPtr.Size); 529Marshal.WriteIntPtr(buffer, valueOffset, IntPtr.Zero); 530Marshal.WriteIntPtr(buffer, valueOffset + IntPtr.Size, IntPtr.Zero);
SafeHandles.cs (12)
196hr = (OleDbHResult)Marshal.QueryInterface(ptr, ref IID_IChapteredRowset, out var pChapteredRowset); 200var chapteredRowset = (System.Data.Common.UnsafeNativeMethods.IChapteredRowset)Marshal.GetObjectForIUnknown(pChapteredRowset); 202Marshal.ReleaseComObject(chapteredRowset); 203Marshal.Release(pChapteredRowset); 219hr = (OleDbHResult)Marshal.QueryInterface(ptr, ref IID_ITransactionLocal, out var pTransaction); 223ITransactionLocal transactionLocal = (ITransactionLocal)Marshal.GetObjectForIUnknown(pTransaction); 225Marshal.ReleaseComObject(transactionLocal); 226Marshal.Release(pTransaction); 242hr = (OleDbHResult)Marshal.QueryInterface(ptr, ref IID_ITransactionLocal, out var pTransaction); 246ITransactionLocal transactionLocal = (ITransactionLocal)Marshal.GetObjectForIUnknown(pTransaction); 248Marshal.ReleaseComObject(transactionLocal); 249Marshal.Release(pTransaction);
SafeNativeMethods.cs (1)
18Marshal.Copy(zeroes, 0, ptr, length);
System\Data\ProviderBase\DbBuffer.cs (21)
72value = Marshal.PtrToStringUni(ptr, length); 98value = Marshal.ReadByte(ptr, offset); 131Marshal.Copy(ptr, destination, startIndex, length); 164Marshal.Copy(ptr, destination, startIndex, length); 196value = Marshal.ReadInt16(ptr, offset); 223Marshal.Copy(ptr, destination, startIndex, length); 248value = Marshal.ReadInt32(ptr, offset); 275Marshal.Copy(ptr, destination, startIndex, length); 300value = Marshal.ReadInt64(ptr, offset); 326value = Marshal.ReadIntPtr(ptr, offset); 360ValidateCheck(offset, Marshal.SizeOf<T>()); 370Marshal.StructureToPtr<T>(structure, ptr, false/*fDeleteOld*/); 394Marshal.WriteByte(ptr, offset, value); 420Marshal.Copy(source, startIndex, ptr, length); 446Marshal.Copy(source, startIndex, ptr, length); 475Marshal.WriteInt16(ptr, offset, value); 501Marshal.Copy(source, startIndex, ptr, length); 525Marshal.WriteInt32(ptr, offset, value); 551Marshal.Copy(source, startIndex, ptr, length); 575Marshal.WriteInt64(ptr, offset, value); 599Marshal.WriteIntPtr(ptr, offset, value);
System\Data\ProviderBase\DbConnectionPool.cs (4)
1133waitForMultipleObjectsExHR = Marshal.GetHRForLastWin32Error(); 1239Marshal.ThrowExceptionForHR(waitForMultipleObjectsExHR); 1262releaseSemaphoreResult = Marshal.GetHRForLastWin32Error(); 1272Marshal.ThrowExceptionForHR(releaseSemaphoreResult); // will only throw if (hresult < 0)
System\Data\ProviderBase\DbConnectionPoolIdentity.cs (2)
68int lastError = Marshal.GetHRForLastWin32Error(); 71Marshal.ThrowExceptionForHR(lastError); // will only throw if (hresult < 0)
System\Data\ProviderBase\WrappedIUnknown.cs (3)
30base.handle = Marshal.GetIUnknownForObject(unknown); 55value = Marshal.GetObjectForIUnknown(handle); 74Marshal.Release(ptr);
System.Diagnostics.EventLog (283)
_generated\0\LibraryImports.g.cs (153)
28global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 30__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 51global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 84global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 86__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 99global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 141global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 143__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 166global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 198global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 200__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 212global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 241global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 243__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 255global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 310global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 312__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 324global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 355global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 357__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 369global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 403global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 405__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 426global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 458global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 460__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 472global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 504global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 506__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 518global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 550global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 552__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 564global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 595global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 597__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 618global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 649global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 651__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 672global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 704global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 706__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 718global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 749global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 751__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 772global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 805global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 807__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 819global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 850global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 852__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 873global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 906global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 908__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 920global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 953global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 955__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 976global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1005global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1007__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1019global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1050global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1052__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1064global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1096global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1098__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1110global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1143global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1145__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1166global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1198global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1200__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1212global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1245global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1247__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1259global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1290global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1292__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1304global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1336global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1338__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1350global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1395global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1397__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1428global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1467global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1469__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1482global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1520global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1522__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1535global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1588global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1590__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1619global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1655global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1657__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1670global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1701global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1703__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1726global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1753global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1755__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1773global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1806global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1808__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1821global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1841global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1843__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1848global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1879global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1881__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1893global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1913global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1915__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1920global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1940global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1942__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1947global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1979global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1981__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1993global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2025global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2027__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2039global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2065global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2067__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2070global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2103global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2105__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2118global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2146global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2148__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2166global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2201global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2203__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2215global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2243global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2245__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2263global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2295global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2297__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2309global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2340global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2342__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2351global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2371global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2373__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2378global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2405global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2407__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2425global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2453global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2455__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2464global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
System\Diagnostics\EventLog.cs (2)
660else if (Marshal.GetLastWin32Error() != Interop.Errors.ERROR_INVALID_PARAMETER) 918lastError = Marshal.GetLastWin32Error();
System\Diagnostics\EventLogInternal.cs (5)
469int error = Marshal.GetLastWin32Error(); 731error = Marshal.GetLastWin32Error(); 907int error = Marshal.GetLastWin32Error(); 1078if (Marshal.GetLastWin32Error() != 0) 1103if (Marshal.GetLastWin32Error() != 0)
System\Diagnostics\Reader\CoTaskMemSafeHandle.cs (1)
38Marshal.FreeCoTaskMem(handle);
System\Diagnostics\Reader\CoTaskMemUnicodeSafeHandle.cs (1)
44Marshal.ZeroFreeCoTaskMemUnicode(handle);
System\Diagnostics\Reader\NativeWrapper.cs (109)
59int win32Error = Marshal.GetLastWin32Error(); 77int win32Error = Marshal.GetLastWin32Error(); 91int win32Error = Marshal.GetLastWin32Error(); 101int win32Error = Marshal.GetLastWin32Error(); 126int win32Error = Marshal.GetLastWin32Error(); 140int win32Error = Marshal.GetLastWin32Error(); 149int win32Error = Marshal.GetLastWin32Error(); 163int win32Error = Marshal.GetLastWin32Error(); 179int win32Error = Marshal.GetLastWin32Error(); 192int win32Error = Marshal.GetLastWin32Error(); 205int win32Error = Marshal.GetLastWin32Error(); 218int win32Error = Marshal.GetLastWin32Error(); 226int win32Error = Marshal.GetLastWin32Error(); 245int win32Error = Marshal.GetLastWin32Error(); 258int win32Error = Marshal.GetLastWin32Error(); 271int win32Error = Marshal.GetLastWin32Error(); 282int win32Error = Marshal.GetLastWin32Error(); 300int win32Error = Marshal.GetLastWin32Error(); 308win32Error = Marshal.GetLastWin32Error(); 326int win32Error = Marshal.GetLastWin32Error(); 335int win32Error = Marshal.GetLastWin32Error(); 348int win32Error = Marshal.GetLastWin32Error(); 361int error = Marshal.GetLastWin32Error(); 370buffer = Marshal.AllocHGlobal((int)bufferNeeded); 372error = Marshal.GetLastWin32Error(); 376UnsafeNativeMethods.EvtVariant varVal = Marshal.PtrToStructure<UnsafeNativeMethods.EvtVariant>(buffer); 382Marshal.FreeHGlobal(buffer); 393int error = Marshal.GetLastWin32Error(); 399buffer = Marshal.AllocHGlobal((int)bufferNeeded); 401error = Marshal.GetLastWin32Error(); 405UnsafeNativeMethods.EvtVariant varVal = Marshal.PtrToStructure<UnsafeNativeMethods.EvtVariant>(buffer); 411Marshal.FreeHGlobal(buffer); 423int error = Marshal.GetLastWin32Error(); 429buffer = Marshal.AllocHGlobal((int)bufferNeeded); 431error = Marshal.GetLastWin32Error(); 435UnsafeNativeMethods.EvtVariant varVal = Marshal.PtrToStructure<UnsafeNativeMethods.EvtVariant>(buffer); 441Marshal.FreeHGlobal(buffer); 452int error = Marshal.GetLastWin32Error(); 458buffer = Marshal.AllocHGlobal((int)bufferNeeded); 460error = Marshal.GetLastWin32Error(); 471UnsafeNativeMethods.EvtVariant varVal = Marshal.PtrToStructure<UnsafeNativeMethods.EvtVariant>(buffer); 477Marshal.FreeHGlobal(buffer); 487int error = Marshal.GetLastWin32Error(); 504error = Marshal.GetLastWin32Error(); 532int error = Marshal.GetLastWin32Error(); 539buffer = Marshal.AllocHGlobal((int)bufferNeeded); 541error = Marshal.GetLastWin32Error(); 545UnsafeNativeMethods.EvtVariant varVal = Marshal.PtrToStructure<UnsafeNativeMethods.EvtVariant>(buffer); 551Marshal.FreeHGlobal(buffer); 563int win32Error = Marshal.GetLastWin32Error(); 569buffer = Marshal.AllocHGlobal((int)bufferNeeded); 571win32Error = Marshal.GetLastWin32Error(); 575UnsafeNativeMethods.EvtVariant varVal = Marshal.PtrToStructure<UnsafeNativeMethods.EvtVariant>(buffer); 581Marshal.FreeHGlobal(buffer); 593int win32Error = Marshal.GetLastWin32Error(); 599buffer = Marshal.AllocHGlobal((int)bufferNeeded); 601win32Error = Marshal.GetLastWin32Error(); 612UnsafeNativeMethods.EvtVariant varVal = Marshal.PtrToStructure<UnsafeNativeMethods.EvtVariant>(buffer); 618Marshal.FreeHGlobal(buffer); 643taskMem.SetMemory(Marshal.StringToCoTaskMemUni((string)val)); 650taskMem.SetMemory(Marshal.StringToCoTaskMemUni((string)val)); 693int win32Error = Marshal.GetLastWin32Error(); 703int win32Error = Marshal.GetLastWin32Error(); 718win32Error = Marshal.GetLastWin32Error(); 734int win32Error = Marshal.GetLastWin32Error(); 749win32Error = Marshal.GetLastWin32Error(); 768int win32Error = Marshal.GetLastWin32Error(); 774buffer = Marshal.AllocHGlobal((int)bufferNeeded); 776win32Error = Marshal.GetLastWin32Error(); 780UnsafeNativeMethods.EvtVariant varVal = Marshal.PtrToStructure<UnsafeNativeMethods.EvtVariant>(buffer); 786Marshal.FreeHGlobal(buffer); 802int error = Marshal.GetLastWin32Error(); 807buffer = Marshal.AllocHGlobal((int)bufferNeeded); 809int win32Error = Marshal.GetLastWin32Error(); 817UnsafeNativeMethods.EvtVariant varVal = Marshal.PtrToStructure<UnsafeNativeMethods.EvtVariant>(pointer); 878pointer = new IntPtr(((long)pointer + Marshal.SizeOf(varVal))); 884Marshal.FreeHGlobal(buffer); 903int error = Marshal.GetLastWin32Error(); 908buffer = Marshal.AllocHGlobal((int)bufferNeeded); 910int win32Error = Marshal.GetLastWin32Error(); 920UnsafeNativeMethods.EvtVariant varVal = Marshal.PtrToStructure<UnsafeNativeMethods.EvtVariant>(pointer); 922pointer = new IntPtr(((long)pointer + Marshal.SizeOf(varVal))); 930Marshal.FreeHGlobal(buffer); 939int error = Marshal.GetLastWin32Error(); 960error = Marshal.GetLastWin32Error(); 996int error = Marshal.GetLastWin32Error(); 1008buffer = Marshal.AllocHGlobal(bufferNeeded * 2); 1010error = Marshal.GetLastWin32Error(); 1024string? s = Marshal.PtrToStringUni(pointer); 1037Marshal.FreeHGlobal(buffer); 1051int error = Marshal.GetLastWin32Error(); 1058buffer = Marshal.AllocHGlobal((int)bufferNeeded); 1060error = Marshal.GetLastWin32Error(); 1064return Marshal.PtrToStringUni(buffer)!; 1069Marshal.FreeHGlobal(buffer); 1087int error = Marshal.GetLastWin32Error(); 1108error = Marshal.GetLastWin32Error(); 1164return (val.GuidReference == IntPtr.Zero) ? Guid.Empty : Marshal.PtrToStructure<Guid>(val.GuidReference); 1170UnsafeNativeMethods.SystemTime sysTime = Marshal.PtrToStructure<UnsafeNativeMethods.SystemTime>(val.SystemTime); 1184Marshal.Copy(val.Reference, arByte, 0, (int)val.Count); 1190Marshal.Copy(val.Reference, arInt16, 0, (int)val.Count); 1196Marshal.Copy(val.Reference, arInt32, 0, (int)val.Count); 1202Marshal.Copy(val.Reference, arInt64, 0, (int)val.Count); 1208Marshal.Copy(val.Reference, arSingle, 0, (int)val.Count); 1214Marshal.Copy(val.Reference, arDouble, 0, (int)val.Count); 1261return Marshal.PtrToStringUni(val.StringVal); 1269return Marshal.PtrToStringAnsi(val.AnsiString); 1367stringArray[i] = ansi ? Marshal.PtrToStringAnsi(ptr[i]) : Marshal.PtrToStringUni(ptr[i]);
System\Diagnostics\Reader\UnsafeNativeMethods.cs (12)
391_value.Server = Marshal.StringToCoTaskMemUni(managed.Server); 392_value.User = Marshal.StringToCoTaskMemUni(managed.User); 393_value.Domain = Marshal.StringToCoTaskMemUni(managed.Domain); 418server: Marshal.PtrToStringUni(_value.Server)!, 419user: Marshal.PtrToStringUni(_value.User), 420domain: Marshal.PtrToStringUni(_value.Domain), 428Marshal.FreeCoTaskMem(_value.Server); 429Marshal.FreeCoTaskMem(_value.User); 430Marshal.FreeCoTaskMem(_value.Domain); 741StringVal = Marshal.StringToCoTaskMemUni(managed.StringVal); 750StringVal = Marshal.PtrToStringUni(StringVal), 758Marshal.FreeCoTaskMem(StringVal);
System.Diagnostics.FileVersionInfo (11)
_generated\0\LibraryImports.g.cs (9)
48global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 50__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 59global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 89global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 91__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 100global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 130global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 132__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 141global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
System.Diagnostics.PerformanceCounter (68)
_generated\0\LibraryImports.g.cs (49)
13global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 15__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 18global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 128global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 130__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 135global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 158global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 160__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 165global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 243global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 245__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 266global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 294global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 296__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 314global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 349global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 351__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 373global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 393global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 395__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 400global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 462global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 464__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 476global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 497global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 499__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 502global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 533global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 535__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 556global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 586global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 588__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 606global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 634global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 636__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 654global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 674global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 676__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 681global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 711global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 713__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 722global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 750global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 752__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 761global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 820__ControlCallback_native = ControlCallback != null ? global::System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(ControlCallback) : default; 874global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 876__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 885global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
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>();
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (2)
56if (Marshal.GetLastWin32Error() == ERROR_INSUFFICIENT_BUFFER) 69Marshal.FreeHGlobal(nativeMsgPtr);
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.ProcessWaitHandle.cs (2)
29int error = Marshal.GetHRForLastWin32Error(); 31Marshal.ThrowExceptionForHR(error);
System\Diagnostics\PerformanceCounterLib.cs (2)
1274throw new Win32Exception(Marshal.GetHRForException(e)); 1309error = Marshal.GetHRForException(e);
System\Diagnostics\PerformanceData\CounterSetInstance.cs (1)
37int Status = (int)((_nativeInst != null) ? Interop.Errors.ERROR_SUCCESS : Marshal.GetLastWin32Error());
System\Diagnostics\PerformanceData\CounterSetInstanceCounterDataSet.cs (2)
125_dataBlock = (byte*)Marshal.AllocHGlobal(_instance._counterSet._idToCounter.Count * sizeof(long)); 183Marshal.FreeHGlobal((IntPtr)_dataBlock);
System\Diagnostics\SharedPerformanceCounter.cs (5)
1305int error = Marshal.GetLastWin32Error(); 1717if ((Marshal.GetLastWin32Error() != Interop.Errors.ERROR_ACCESS_DENIED) || !_fileMappingHandle.IsInvalid) 1727if ((Marshal.GetLastWin32Error() != Interop.Errors.ERROR_FILE_NOT_FOUND) || !_fileMappingHandle.IsInvalid) 1764Marshal.FreeHGlobal((IntPtr)pSecurityDescriptor); 1781Marshal.Copy(tmp, 0, (nint)nativePointer, tmp.Length);
System.Diagnostics.Process (110)
_generated\0\LibraryImports.g.cs (102)
46global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 48__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 51global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 81global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 83__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 92global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 124global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 126__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 138global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 168global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 170__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 179global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 209global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 211__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 220global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 241global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 243__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 246global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 274global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 276__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 285global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 312global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 314__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 323global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 341global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 343__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 346global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 364global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 366__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 369global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 387global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 389__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 392global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 426global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 428__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 438global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 465global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 467__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 476global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 553global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 555__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 558global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 576global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 578__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 581global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 608global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 610__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 615global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 678global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 680__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 683global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 710global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 712__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 717global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 778global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 780__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 789global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 826global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 828__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 831global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 851global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 853__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 856global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 883global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 885__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 894global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 912global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 914__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 917global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 940global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 942__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 945global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 972global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 974__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 983global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1013global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1015__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1024global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1054global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1056__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1065global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1095global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1097__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1106global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1140global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1142__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1145global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1277global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1279__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1288global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1315global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1317__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1326global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1355global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1357__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1376global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1404global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1406__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1409global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1430global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1432__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1435global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (1)
81return result == 0 ? 0 : Marshal.GetLastPInvokeError();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetSetPriority.cs (1)
35return Marshal.GetLastPInvokeError();
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (2)
48error = Marshal.GetLastPInvokeError(); 66Marshal.SetLastPInvokeError(error);
System\Diagnostics\ProcessWaitState.Unix.cs (2)
602int errorCode = Marshal.GetLastWin32Error(); 648int errorCode = Marshal.GetLastWin32Error();
System.DirectoryServices (348)
_generated\0\LibraryImports.g.cs (57)
139global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 141__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 157global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 180global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 182__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 185global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 205global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 207__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 212global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 294global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 296__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 301global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 321global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 323__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 328global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 347global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 349__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 352global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 372global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 374__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 379global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 403global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 405__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 408global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 427global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 429__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 432global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 526global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 528__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 531global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 568global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 570__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 588global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 794global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 796__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 815global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 842global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 844__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 863global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 883global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 885__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 890global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 910global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 912__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 917global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 939global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 941__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 944global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 964global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 966__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 971global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1099global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1101__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1104global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1134global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1136__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1139global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
Interop\AdsValueHelper2.cs (10)
134Marshal.PtrToStructure(adsvalue.pointer.value, dnb); 137Marshal.Copy(dnb.lpBinaryValue, bytes, 0, dnb.dwLength); 157strb.Append(Marshal.PtrToStringUni(dnb.pszDNString)); 165Marshal.PtrToStructure(adsvalue.pointer.value, dns); 166string strValue = Marshal.PtrToStringUni(dns.pszStringValue) ?? string.Empty; 168return $"S:{strValue.Length}:{strValue}:{Marshal.PtrToStringUni(dns.pszDNString)}"; 178return Marshal.PtrToStringUni(adsvalue.pointer.value)!; 194Marshal.Copy(adsvalue.octetString.value, value, 0, len); 228Marshal.PtrToStructure(adsvalue.octetString.value, vlv); 234Marshal.Copy(vlv.contextID, bytes, 0, vlv.contextIDlength);
Interop\EnumVariant.cs (1)
74_currentValue = Marshal.GetObjectForNativeVariant((IntPtr)(&variant))!;
Interop\UnsafeNativeMethods.cs (2)
22ppObject = ppObjectNative != IntPtr.Zero ? Marshal.GetObjectForIUnknown(ppObjectNative) : null!; 29Marshal.Release(ppObjectNative);
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 (8)
210string siteName = Marshal.PtrToStringUni(ptr)!; 224Marshal.FreeHGlobal(ptr); 1312throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 1325Marshal.PtrToStructure((IntPtr)pDomains, names); 1334tmpPtr = IntPtr.Add(val, Marshal.SizeOf<DS_NAME_RESULT_ITEM>() * i); 1336Marshal.PtrToStructure(tmpPtr, nameResult); 1339string? domainName = Marshal.PtrToStringUni(nameResult.pName); 1356throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError());
System\DirectoryServices\ActiveDirectory\AttributeMetaData.cs (5)
24Marshal.PtrToStructure(info, attrMetaData); 27Name = Marshal.PtrToStringUni(attrMetaData.pszAttributeName)!; 34_pszLastOriginatingDsaDN = Marshal.PtrToStringUni(attrMetaData.pszLastOriginatingDsaDN); 39Marshal.PtrToStructure(info, attrMetaData); 42Name = Marshal.PtrToStringUni(attrMetaData.pszAttributeName)!;
System\DirectoryServices\ActiveDirectory\DirectoryContext.cs (2)
580Marshal.PtrToStructure(pResponseBuffer, responseBuffer); 689throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError());
System\DirectoryServices\ActiveDirectory\DirectoryServer.cs (21)
288throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 312throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 336throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 401Marshal.PtrToStructure(info, cursors); 435Marshal.PtrToStructure(info, cursors); 461Marshal.PtrToStructure(info, operations); 488Marshal.PtrToStructure(info, neighbors); 512Marshal.PtrToStructure(info, failures); 537Marshal.PtrToStructure(info, objMetaData); 556Marshal.PtrToStructure(info, objMetadata); 587Marshal.PtrToStructure(update, syncAllUpdate); 614Marshal.PtrToStructure(temp, sync); 616targetName = Marshal.PtrToStringUni(sync.pszDstId); 617sourceName = Marshal.PtrToStringUni(sync.pszSrcId); 639throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 645IntPtr syncAllFunctionPointer = Marshal.GetFunctionPointerForDelegate(syncAllCallback); 684throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 698unmanagedGuid = Marshal.AllocHGlobal(structSize); 715Marshal.StructureToPtr(guid, unmanagedGuid, false); 722throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 750Marshal.FreeHGlobal(unmanagedGuid);
System\DirectoryServices\ActiveDirectory\Domain.cs (3)
1304obj.DnsDomainName = Marshal.PtrToStringUni(unmanagedTrust.DnsDomainName); 1306obj.NetbiosDomainName = Marshal.PtrToStringUni(unmanagedTrust.NetbiosDomainName); 1339localDomainParent = Marshal.PtrToStringUni(parentTrust.DnsDomainName);
System\DirectoryServices\ActiveDirectory\DomainController.cs (11)
1063throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 1090Marshal.PtrToStructure(currentDc, domainControllerInfo3); 1107currentDc = IntPtr.Add(currentDc, Marshal.SizeOf(domainControllerInfo3)); 1112Marshal.PtrToStructure(currentDc, domainControllerInfo2); 1129currentDc = IntPtr.Add(currentDc, Marshal.SizeOf(domainControllerInfo2)); 1147throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 1235throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 1244Marshal.PtrToStructure(rolesPtr, dsNameResult); 1249Marshal.PtrToStructure(currentItem, dsNameResultItem); 1262currentItem = IntPtr.Add(currentItem, Marshal.SizeOf(dsNameResultItem)); 1274throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError());
System\DirectoryServices\ActiveDirectory\Exception.cs (12)
423Marshal.PtrToStructure(errorInfo, error); 425string? source = Marshal.PtrToStringUni(error.pszSrcId); 426string? target = Marshal.PtrToStringUni(error.pszSvrId); 442IntPtr tempPtr = Marshal.ReadIntPtr(errorInfo); 448Marshal.PtrToStructure(tempPtr, error); 453string? source = Marshal.PtrToStringUni(error.pszSrcId); 454string? target = Marshal.PtrToStringUni(error.pszSvrId); 461tempPtr = Marshal.ReadIntPtr(errorInfo, i * IntPtr.Size); 482Marshal.PtrToStructure(collisionInfo, collision); 488addr = Marshal.ReadIntPtr(collision.Entries, i * IntPtr.Size); 490Marshal.PtrToStructure(addr, record); 493string recordName = Marshal.PtrToStringUni(record.Name.Buffer, record.Name.Length / 2);
System\DirectoryServices\ActiveDirectory\Forest.cs (7)
855throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 864Marshal.PtrToStructure(sitesPtr, dsNameResult); 871Marshal.PtrToStructure(currentItem, dsNameResultItem); 879currentItem = IntPtr.Add(currentItem, Marshal.SizeOf(dsNameResultItem)); 891throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 1118tmpDNSName = Marshal.PtrToStringUni(unmanagedTrust.DnsDomainName); 1120tmpNetBIOSName = Marshal.PtrToStringUni(unmanagedTrust.NetbiosDomainName);
System\DirectoryServices\ActiveDirectory\ForestTrustDomainInformation.cs (3)
26DnsName = Marshal.PtrToStringUni(domainInfo.DNSNameBuffer, domainInfo.DNSNameLength / 2); 27NetBiosName = Marshal.PtrToStringUni(domainInfo.NetBIOSNameBuffer, domainInfo.NetBIOSNameLength / 2); 33throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError());
System\DirectoryServices\ActiveDirectory\ForestTrustRelationshipInformation.cs (45)
33tmpDNSName = Marshal.PtrToStringUni(unmanagedTrust.DnsDomainName); 35tmpNetBIOSName = Marshal.PtrToStringUni(unmanagedTrust.NetbiosDomainName); 110records = Marshal.AllocHGlobal(count * IntPtr.Size); 118fileTime = Marshal.AllocHGlobal(Marshal.SizeOf<FileTime>()); 123Marshal.PtrToStructure(fileTime, currentTime); 133ptr = Marshal.StringToHGlobalUni(TLN.Name); 137tmpPtr = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_FOREST_TRUST_RECORD>()); 139Marshal.StructureToPtr(record, tmpPtr, false); 141Marshal.WriteIntPtr(records, IntPtr.Size * currentCount, tmpPtr); 163ptr = Marshal.StringToHGlobalUni(_excludedNames[i]); 166tmpPtr = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_FOREST_TRUST_RECORD>()); 168Marshal.StructureToPtr(record, tmpPtr, false); 170Marshal.WriteIntPtr(records, IntPtr.Size * currentCount, tmpPtr); 187throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 191record.DomainInfo.DNSNameBuffer = Marshal.StringToHGlobalUni(tmp.DnsName); 195record.DomainInfo.NetBIOSNameBuffer = Marshal.StringToHGlobalUni(tmp.NetBiosName); 199tmpPtr = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_FOREST_TRUST_RECORD>()); 201Marshal.StructureToPtr(record, tmpPtr, false); 203Marshal.WriteIntPtr(records, IntPtr.Size * currentCount, tmpPtr); 221record.Data.Buffer = Marshal.AllocHGlobal(record.Data.Length); 223Marshal.Copy((byte[])_binaryData[i]!, 0, record.Data.Buffer, record.Data.Length); 225tmpPtr = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_FOREST_TRUST_RECORD>()); 227Marshal.StructureToPtr(record, tmpPtr, false); 229Marshal.WriteIntPtr(records, IntPtr.Size * currentCount, tmpPtr); 238forestInfo = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_FOREST_TRUST_INFORMATION>()); 239Marshal.StructureToPtr(trustInformation, forestInfo, false); 252target = Marshal.StringToHGlobalUni(TargetName); 286Marshal.FreeHGlobal((IntPtr)ptrList[i]!); 296Marshal.FreeHGlobal(records); 301Marshal.FreeHGlobal(forestInfo); 308Marshal.FreeHGlobal(target); 311Marshal.FreeHGlobal(fileTime); 341targetPtr = Marshal.StringToHGlobalUni(TargetName); 368Marshal.PtrToStructure(forestTrustInfo, trustInfo); 374addr = Marshal.ReadIntPtr(trustInfo.Entries, i * IntPtr.Size); 376Marshal.PtrToStructure(addr, record); 390string excludedName = Marshal.PtrToStringUni(record.TopLevelName.Buffer, record.TopLevelName.Length / 2); 409Marshal.Copy(record.Data.Buffer, byteArray, 0, length); 442Marshal.FreeHGlobal(targetPtr);
System\DirectoryServices\ActiveDirectory\Locator.cs (3)
52Marshal.PtrToStructure(pDomainControllerInfo, domainControllerInfo); 159dcDnsHostName = Marshal.PtrToStringUni(dcDnsHostNamePtr)!; 171Marshal.FreeHGlobal(sockAddressList);
System\DirectoryServices\ActiveDirectory\NativeMethods.cs (1)
166osVersionInfoSize = (int)Marshal.SizeOf(this);
System\DirectoryServices\ActiveDirectory\ReplicationCursor.cs (1)
29_serverDN = Marshal.PtrToStringUni(dn);
System\DirectoryServices\ActiveDirectory\ReplicationCursorCollection.cs (4)
58addr = IntPtr.Add(info, sizeof(int) * 2 + i * Marshal.SizeOf<DS_REPL_CURSOR_3>()); 60Marshal.PtrToStructure(addr, cursor); 72addr = IntPtr.Add(info, sizeof(int) * 2 + i * Marshal.SizeOf<DS_REPL_CURSOR>()); 74Marshal.PtrToStructure(addr, cursor);
System\DirectoryServices\ActiveDirectory\ReplicationFailure.cs (2)
21Marshal.PtrToStructure(addr, failure); 23_sourceDsaDN = Marshal.PtrToStringUni(failure.pszDsaDN);
System\DirectoryServices\ActiveDirectory\ReplicationFailureCollection.cs (1)
55addr = IntPtr.Add(info, sizeof(int) * 2 + i * Marshal.SizeOf<DS_REPL_KCC_DSA_FAILURE>());
System\DirectoryServices\ActiveDirectory\ReplicationNeighbor.cs (4)
46Marshal.PtrToStructure(addr, neighbor); 48PartitionName = Marshal.PtrToStringUni(neighbor.pszNamingContext); 49_sourceServerDN = Marshal.PtrToStringUni(neighbor.pszSourceDsaDN); 51string? transportDN = Marshal.PtrToStringUni(neighbor.pszAsyncIntersiteTransportDN);
System\DirectoryServices\ActiveDirectory\ReplicationNeighborCollection.cs (1)
55addr = IntPtr.Add(info, sizeof(int) * 2 + i * Marshal.SizeOf<DS_REPL_NEIGHBOR>());
System\DirectoryServices\ActiveDirectory\ReplicationOperation.cs (3)
20Marshal.PtrToStructure(addr, operation); 35PartitionName = Marshal.PtrToStringUni(operation.pszNamingContext); 38_dsaDN = Marshal.PtrToStringUni(operation.pszDsaDN);
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\TopLevelName.cs (1)
25Name = Marshal.PtrToStringUni(val.Buffer, val.Length / 2);
System\DirectoryServices\ActiveDirectory\TrustHelper.cs (59)
50target = Marshal.StringToHGlobalUni(targetName); 114Marshal.FreeHGlobal(target); 144target = Marshal.StringToHGlobalUni(targetName); 221newInfo = Marshal.AllocHGlobal(sizeof(Interop.Advapi32.TRUSTED_DOMAIN_INFORMATION_EX)); 222Marshal.StructureToPtr(domainInfo, newInfo, false); 238Marshal.FreeHGlobal(target); 244Marshal.FreeHGlobal(newInfo); 270target = Marshal.StringToHGlobalUni(targetName); 319Marshal.FreeHGlobal(target); 349target = Marshal.StringToHGlobalUni(targetName); 356data = Marshal.StringToHGlobalUni(targetName); 359data = Marshal.StringToHGlobalUni(targetName + "\\" + preferredTargetServer); 360ptr = Marshal.AllocHGlobal(IntPtr.Size); 361Marshal.WriteIntPtr(ptr, data); 370Marshal.PtrToStructure(buffer1, info); 420Marshal.FreeHGlobal(target); 423Marshal.FreeHGlobal(ptr); 426Marshal.FreeHGlobal(data); 457Marshal.PtrToStructure(info, domainInfo); 460fileTime = Marshal.AllocHGlobal(Marshal.SizeOf<FileTime>()); 465Marshal.PtrToStructure(fileTime, tmp); 471unmanagedPassword = Marshal.StringToHGlobalUni(password); 475unmanagedAuthData = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_AUTH_INFORMATION>()); 476Marshal.StructureToPtr(AuthData, unmanagedAuthData, false); 538Marshal.FreeHGlobal(fileTime); 547Marshal.FreeHGlobal(unmanagedPassword); 550Marshal.FreeHGlobal(unmanagedAuthData); 582target = Marshal.StringToHGlobalUni(targetName); 613fileTime = Marshal.AllocHGlobal(Marshal.SizeOf<FileTime>()); 618Marshal.PtrToStructure(fileTime, tmp); 624unmanagedPassword = Marshal.StringToHGlobalUni(password); 628unmanagedAuthData = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_AUTH_INFORMATION>()); 629Marshal.StructureToPtr(AuthData, unmanagedAuthData, false); 648newBuffer = Marshal.AllocHGlobal(sizeof(Interop.Advapi32.TRUSTED_DOMAIN_FULL_INFORMATION)); 649Marshal.StructureToPtr(domainInfo, newBuffer, false); 665Marshal.FreeHGlobal(target); 671Marshal.FreeHGlobal(newBuffer); 674Marshal.FreeHGlobal(fileTime); 677Marshal.FreeHGlobal(unmanagedPassword); 680Marshal.FreeHGlobal(unmanagedAuthData); 711target = Marshal.StringToHGlobalUni(targetName); 739fileTime = Marshal.AllocHGlobal(Marshal.SizeOf<FileTime>()); 744Marshal.PtrToStructure(fileTime, tmp); 750unmanagedPassword = Marshal.StringToHGlobalUni(password); 754unmanagedAuthData = Marshal.AllocHGlobal(Marshal.SizeOf<LSA_AUTH_INFORMATION>()); 755Marshal.StructureToPtr(AuthData, unmanagedAuthData, false); 789newBuffer = Marshal.AllocHGlobal(sizeof(Interop.Advapi32.TRUSTED_DOMAIN_FULL_INFORMATION)); 790Marshal.StructureToPtr(domainInfo, newBuffer, false); 806Marshal.FreeHGlobal(target); 812Marshal.FreeHGlobal(newBuffer); 815Marshal.FreeHGlobal(fileTime); 818Marshal.FreeHGlobal(unmanagedPassword); 821Marshal.FreeHGlobal(unmanagedAuthData);
System\DirectoryServices\ActiveDirectory\Utils.cs (51)
119throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 122IntPtr name = Marshal.StringToHGlobalUni(distinguishedName); 123IntPtr ptr = Marshal.AllocHGlobal(IntPtr.Size); 124Marshal.WriteIntPtr(ptr, name); 132Marshal.PtrToStructure(results, dsNameResult); 136Marshal.PtrToStructure(dsNameResult.items, dsNameResultItem); 162Marshal.FreeHGlobal(ptr); 165Marshal.FreeHGlobal(name); 174throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 214throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 216IntPtr name = Marshal.StringToHGlobalUni(dnsName + "/"); 217IntPtr ptr = Marshal.AllocHGlobal(IntPtr.Size); 218Marshal.WriteIntPtr(ptr, name); 226Marshal.PtrToStructure(results, dsNameResult); 231Marshal.PtrToStructure(dsNameResult.items, dsNameResultItem); 238Marshal.FreeHGlobal(ptr); 241Marshal.FreeHGlobal(name); 249throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 643throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 672throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 694throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 721throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 879stringGuid = Marshal.PtrToStringUni(ptr); 966throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 973result = Marshal.GetLastPInvokeError(); 990throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 996throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 1009throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 1866throw ExceptionHelper.GetExceptionFromErrorCode(Marshal.GetLastPInvokeError()); 2021Marshal.FreeHGlobal(pCopyOfUserSid); 2024Marshal.FreeHGlobal(pMachineDomainSid); 2049if ((error = Marshal.GetLastPInvokeError()) == 1008) // ERROR_NO_TOKEN 2061int lastError = Marshal.GetLastPInvokeError(); 2085if ((getTokenInfoError = Marshal.GetLastPInvokeError()) != 122) // ERROR_INSUFFICIENT_BUFFER 2093pBuffer = Marshal.AllocHGlobal((int)neededBufferSize); 2105int lastError = Marshal.GetLastPInvokeError(); 2118IntPtr pCopyOfUserSid = Marshal.AllocHGlobal(userSidLength); 2122int lastError = Marshal.GetLastPInvokeError(); 2134Marshal.FreeHGlobal(pBuffer); 2175IntPtr pCopyOfSid = Marshal.AllocHGlobal(sidLength); 2179int lastError = Marshal.GetLastPInvokeError(); 2216Marshal.PtrToStructure<DSROLE_PRIMARY_DOMAIN_INFO_BASIC>(dsRoleInfoPtr)!; 2238int rid = Marshal.ReadInt32(pRid); 2275int ridCount = Marshal.ReadByte(pRidCount); 2277int lastRid = Marshal.ReadInt32(pLastRid); 2296Marshal.FreeHGlobal(pSid); 2306pBytes = Marshal.AllocHGlobal(bytes.Length); 2310Marshal.Copy(bytes, 0, pBytes, bytes.Length); 2314Marshal.FreeHGlobal(pBytes); 2333int subAuthorityCount = Marshal.ReadByte(psubAuthorityCount); 2358int currentSubauthority = Marshal.ReadInt32(pcurrentSubauthority);
System\DirectoryServices\DirectoryEntry.cs (2)
910System.Runtime.InteropServices.Marshal.ReleaseComObject(_adsObject); // release old handle 1021System.Runtime.InteropServices.Marshal.ReleaseComObject(_adsObject);
System\DirectoryServices\DirectorySearcher.cs (19)
810sortKey.pszAttrType = Marshal.StringToCoTaskMemUni(Sort.PropertyName); 814byte[] sortKeyBytes = new byte[Marshal.SizeOf(sortKey)]; 815Marshal.Copy((INTPTR_INTPTRCAST)(&sortKey), sortKeyBytes, 0, sortKeyBytes.Length); 831vlvValue.target = Marshal.StringToCoTaskMemUni(_vlv.Target); 843vlvValue.contextID = Marshal.AllocCoTaskMem(vlvValue.contextIDlength); 845Marshal.Copy(_vlv.DirectoryVirtualListViewContext._context, 0, vlvValue.contextID, vlvValue.contextIDlength); 847IntPtr vlvPtr = Marshal.AllocHGlobal(Marshal.SizeOf<AdsVLV>()); 848byte[] vlvBytes = new byte[Marshal.SizeOf(vlvValue)]; 851Marshal.StructureToPtr(vlvValue, vlvPtr, false); 852Marshal.Copy(vlvPtr, vlvBytes, 0, vlvBytes.Length); 856Marshal.FreeHGlobal(vlvPtr); 885Marshal.FreeCoTaskMem(ptrToFree); 888Marshal.FreeCoTaskMem(ptrVLVToFree); 891Marshal.FreeCoTaskMem(ptrVLVContexToFree); 898IntPtr ptr = Marshal.AllocHGlobal(structSize * prefs.Length); 904Marshal.StructureToPtr(prefs[i], tempPtr, false); 914int status = Marshal.ReadInt32(tempPtr, 32); 948Marshal.FreeHGlobal(ptr);
System\DirectoryServices\SearchResultCollection.cs (5)
24private readonly IntPtr _adsDirsynCookieName = Marshal.StringToCoTaskMemUni(ADS_DIRSYNC_COOKIE); 26private readonly IntPtr _adsVLVResponseName = Marshal.StringToCoTaskMemUni(ADS_VLV_RESPONSE); 180Marshal.FreeCoTaskMem(_adsDirsynCookieName); 183Marshal.FreeCoTaskMem(_adsVLVResponseName); 321entry.Properties.Add(Marshal.PtrToStringUni(pszColumnName)!, new ResultPropertyValueCollection(values));
System.DirectoryServices.AccountManagement (113)
_generated\0\LibraryImports.g.cs (60)
45global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 47__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 63global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 86global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 88__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 91global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 111global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 113__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 118global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 200global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 202__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 207global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 226global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 228__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 231global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 251global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 253__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 258global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 282global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 284__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 287global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 313global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 315__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 318global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 337global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 339__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 342global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 361global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 363__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 366global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 403global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 405__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 429global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 466global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 468__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 486global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 538global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 540__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 559global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 586global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 588__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 607global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 627global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 629__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 634global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 657global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 659__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 664global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 687global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 689__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 694global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 741global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 743__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 748global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 792global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 794__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 797global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 849global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 851__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 856global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaLookupSids.cs (1)
30referencedDomains.Initialize((uint)Marshal.SizeOf<Interop.LSA_REFERENCED_DOMAIN_LIST>());
System\DirectoryServices\AccountManagement\AD\ADStoreCtx_LoadStore.cs (2)
542Marshal.FreeHGlobal(pSid); 597Marshal.FreeHGlobal(pSid);
System\DirectoryServices\AccountManagement\AD\SidList.cs (4)
136namesHandle.Initialize((uint)sidCount, (uint)Marshal.SizeOf<Interop.LSA_TRANSLATED_NAME>()); 180entry.name = Marshal.PtrToStringUni(name.Name.Buffer, name.Name.Length / 2); 188entry.sidIssuerName = Marshal.PtrToStringUni(domain.Name.Buffer, domain.Name.Length / 2); 256Marshal.FreeHGlobal(pSid);
System\DirectoryServices\AccountManagement\AuthZSet.cs (8)
103if (!f && (bufferSize > 0) && (Marshal.GetLastPInvokeError() == 122) /*ERROR_INSUFFICIENT_BUFFER*/) 110pBuffer = Marshal.AllocHGlobal(bufferSize); 157lastError = Marshal.GetLastPInvokeError(); 162lastError = Marshal.GetLastPInvokeError(); 168lastError = Marshal.GetLastPInvokeError(); 173lastError = Marshal.GetLastPInvokeError(); 216Marshal.FreeHGlobal(pBuffer); 540Marshal.FreeHGlobal(handle);
System\DirectoryServices\AccountManagement\Context.cs (1)
141System.Runtime.InteropServices.Marshal.ReleaseComObject(value);
System\DirectoryServices\AccountManagement\interopt.cs (2)
26ppObject = Marshal.GetObjectForIUnknown(ppObjPtr); 37Marshal.Release(ppObjPtr);
System\DirectoryServices\AccountManagement\SAM\SAMStoreCtx.cs (1)
1057Marshal.PtrToStructure<UnsafeNativeMethods.WKSTA_INFO_100>(buffer);
System\DirectoryServices\AccountManagement\SAM\SAMStoreCtx_LoadStore.cs (2)
369Marshal.FreeHGlobal(pSid); 434Marshal.FreeHGlobal(pSid);
System\DirectoryServices\AccountManagement\User.cs (1)
210System.Runtime.InteropServices.Marshal.FreeHGlobal(pSid);
System\DirectoryServices\AccountManagement\Utils.cs (31)
131int lastErrorCode = Marshal.GetLastPInvokeError(); 143Marshal.FreeHGlobal(pSid); 153pBytes = Marshal.AllocHGlobal(bytes.Length); 157Marshal.Copy(bytes, 0, pBytes, bytes.Length); 165Marshal.FreeHGlobal(pBytes); 178Marshal.Copy(pSid, sid, 0, sidLength); 196Marshal.FreeHGlobal(pSid); 211int rid = Marshal.ReadInt32(pRid); 248int ridCount = Marshal.ReadByte(pRidCount); 250int lastRid = Marshal.ReadInt32(pLastRid); 269Marshal.FreeHGlobal(pSid); 333Marshal.FreeHGlobal(pCopyOfUserSid); 336Marshal.FreeHGlobal(pMachineDomainSid); 361if ((error = Marshal.GetLastPInvokeError()) == 1008) // ERROR_NO_TOKEN 373int lastError = Marshal.GetLastPInvokeError(); 401if ((getTokenInfoError = Marshal.GetLastPInvokeError()) != 122) // ERROR_INSUFFICIENT_BUFFER 411pBuffer = Marshal.AllocHGlobal((int)neededBufferSize); 423int lastError = Marshal.GetLastPInvokeError(); 440IntPtr pCopyOfUserSid = Marshal.AllocHGlobal(userSidLength); 444int lastError = Marshal.GetLastPInvokeError(); 460Marshal.FreeHGlobal(pBuffer); 510IntPtr pCopyOfSid = Marshal.AllocHGlobal(sidLength); 514int lastError = Marshal.GetLastPInvokeError(); 577Marshal.PtrToStructure<UnsafeNativeMethods.DomainControllerInfo>(domainControllerInfoPtr); 609int lastErr = Marshal.GetLastPInvokeError(); 628lastErr = Marshal.GetLastPInvokeError(); 758int lastError = Marshal.GetLastPInvokeError(); 768int lastError = Marshal.GetLastPInvokeError(); 809Marshal.PtrToStructure<UnsafeNativeMethods.DSROLE_PRIMARY_DOMAIN_INFO_BASIC>(dsRoleInfoPtr); 832int subAuthorityCount = Marshal.ReadByte(psubAuthorityCount); 857int currentSubauthority = Marshal.ReadInt32(pcurrentSubauthority);
System.DirectoryServices.Protocols (146)
_generated\0\LibraryImports.g.cs (15)
25global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 27__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 36global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 373global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 375__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 384global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 499global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 501__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 510global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 534__outValue_native = outValue != null ? global::System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(outValue) : default; 574__outValue_native = outValue != null ? global::System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(outValue) : default; 620global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 622__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 631global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1055__proc_native = proc != null ? global::System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(proc) : default;
src\runtime\src\libraries\Common\src\Interop\Interop.Ldap.cs (16)
61n.user = Marshal.StringToCoTaskMemUni(managed.user); 63n.domain = Marshal.StringToCoTaskMemUni(managed.domain); 65n.password = Marshal.StringToCoTaskMemUni(managed.password); 68n.packageList = Marshal.StringToCoTaskMemUni(managed.packageList); 75Marshal.FreeCoTaskMem(native.user); 76Marshal.FreeCoTaskMem(native.domain); 77Marshal.FreeCoTaskMem(native.password); 78Marshal.FreeCoTaskMem(native.packageList); 248_native.query = managed.query is not null ? Marshal.GetFunctionPointerForDelegate(managed.query) : IntPtr.Zero; 249_native.notify = managed.notify is not null ? Marshal.GetFunctionPointerForDelegate(managed.notify) : IntPtr.Zero; 250_native.dereference = managed.dereference is not null ? Marshal.GetFunctionPointerForDelegate(managed.dereference) : IntPtr.Zero; 262query = _native.query != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer<QUERYFORCONNECTIONInternal>(_native.query) : null, 263notify = _native.notify != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer<NOTIFYOFNEWCONNECTIONInternal>(_native.notify) : null, 264dereference = _native.dereference != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer<DEREFERENCECONNECTIONInternal>(_native.dereference) : null 303Marshal.FreeHGlobal(attribute); 308Marshal.FreeHGlobal(values);
System\DirectoryServices\Protocols\common\BerConverter.cs (22)
269Marshal.PtrToStructure(flattenptr, binaryValue); 280Marshal.Copy(binaryValue.bv_val, encodingResult, 0, (int)binaryValue.bv_len.Value); 324berValue.bv_val = Marshal.AllocHGlobal(value.Length); 325Marshal.Copy(value, 0, berValue.bv_val, value.Length); 448Marshal.FreeHGlobal(berValue.bv_val); 469IntPtr tmp = Marshal.AllocHGlobal(tempValue.Length); 470Marshal.Copy(tempValue, 0, tmp, tempValue.Length); 499Marshal.PtrToStructure(result, binaryValue); 502Marshal.Copy(binaryValue.bv_val, byteArray, 0, (int)binaryValue.bv_len.Value); 529int structSize = Marshal.SizeOf<BerVal>(); 543managedBervalArray[i].bv_val = Marshal.AllocHGlobal(byteArray.Length); 544Marshal.Copy(byteArray, 0, managedBervalArray[i].bv_val, byteArray.Length); 548IntPtr valPtr = Marshal.AllocHGlobal(structSize); 549Marshal.StructureToPtr(managedBervalArray[i], valPtr, false); 565IntPtr ptr = Marshal.ReadIntPtr(berValArray, IntPtr.Size * i); 567Marshal.FreeHGlobal(ptr); 569Marshal.FreeHGlobal(berValArray); 577Marshal.FreeHGlobal(managedBerval.bv_val); 603tempPtr = Marshal.ReadIntPtr(ptrResult); 607Marshal.PtrToStructure(tempPtr, ber); 610Marshal.Copy(ber.bv_val, berArray, 0, (int)ber.bv_len.Value); 615tempPtr = Marshal.ReadIntPtr(ptrResult, i * IntPtr.Size);
System\DirectoryServices\Protocols\common\utils.cs (2)
44IntPtr intPtrArray = Marshal.AllocHGlobal(IntPtr.Size * size); 48Marshal.WriteIntPtr(tempPtr, IntPtr.Zero);
System\DirectoryServices\Protocols\Interop\LdapPal.Linux.cs (9)
139Marshal.FreeHGlobal(passwordPtr); 176internal static string PtrToString(IntPtr requestName) => Marshal.PtrToStringAnsi(requestName); 178internal static IntPtr StringToPtr(string s) => Marshal.StringToHGlobalAnsi(s); 198SaslInteractiveChallenge interactChallenge = Marshal.PtrToStructure<SaslInteractiveChallenge>(currentInteractPtr); 199SaslDefaultCredentials defaults = Marshal.PtrToStructure<SaslDefaultCredentials>(defaultsPtr); 223interactChallenge.result = Marshal.StringToHGlobalAnsi(interactChallenge.defresult); 228Marshal.StructureToPtr(interactChallenge, currentInteractPtr, false); 229currentInteractPtr = IntPtr.Add(currentInteractPtr, Marshal.SizeOf<SaslInteractiveChallenge>()); 230interactChallenge = Marshal.PtrToStructure<SaslInteractiveChallenge>(currentInteractPtr);
System\DirectoryServices\Protocols\Interop\SafeHandles.cs (1)
22Marshal.FreeHGlobal(handle);
System\DirectoryServices\Protocols\ldap\LdapConnection.cs (51)
526int structSize = Marshal.SizeOf<LdapControl>(); 534IntPtr controlPtr = Marshal.AllocHGlobal(structSize); 535Marshal.StructureToPtr(managedServerControls[i], controlPtr, false); 550IntPtr controlPtr = Marshal.AllocHGlobal(structSize); 551Marshal.StructureToPtr(managedClientControls[i], controlPtr, false); 612bv_val = Marshal.AllocHGlobal(byteArray.Length) 614Marshal.Copy(byteArray, 0, berValuePtr.bv_val, byteArray.Length); 640int modStructSize = Marshal.SizeOf<LdapMod>(); 644IntPtr controlPtr = Marshal.AllocHGlobal(modStructSize); 645Marshal.StructureToPtr(modifications[i], controlPtr, false); 678bv_val = Marshal.AllocHGlobal(val.Length) 680Marshal.Copy(val, 0, berValuePtr.bv_val, val.Length); 776IntPtr tempPtr = Marshal.ReadIntPtr(serverControlArray, IntPtr.Size * i); 779Marshal.FreeHGlobal(tempPtr); 782Marshal.FreeHGlobal(serverControlArray); 791Marshal.FreeHGlobal(managedServerControls[i].ldctl_oid); 798Marshal.FreeHGlobal(managedServerControls[i].ldctl_value.bv_val); 809IntPtr tempPtr = Marshal.ReadIntPtr(clientControlArray, IntPtr.Size * i); 812Marshal.FreeHGlobal(tempPtr); 816Marshal.FreeHGlobal(clientControlArray); 825Marshal.FreeHGlobal(managedClientControls[i].ldctl_oid); 832Marshal.FreeHGlobal(managedClientControls[i].ldctl_value.bv_val); 843IntPtr tempPtr = Marshal.ReadIntPtr(modArray, IntPtr.Size * i); 846Marshal.FreeHGlobal(tempPtr); 850Marshal.FreeHGlobal(modArray); 857Marshal.FreeHGlobal(tempPtr); 862Marshal.FreeHGlobal(berValuePtr.bv_val); 869IntPtr tempPtr = Marshal.ReadIntPtr(searchAttributes, IntPtr.Size * i); 872Marshal.FreeHGlobal(tempPtr); 876Marshal.FreeHGlobal(searchAttributes); 909Marshal.Copy(info.pbData, context, 0, dataLength); 1059length = Marshal.SizeOf<SEC_WINNT_AUTH_IDENTITY_EX>(), 1225bv_val = Marshal.AllocHGlobal(sizeof(byte) * byteControlValue.Length) 1227Marshal.Copy(byteControlValue, 0, managedControls[i].ldctl_value.bv_val, (int)managedControls[i].ldctl_value.bv_len.Value); 1313bv_val = Marshal.AllocHGlobal(byteArray.Length) 1318Marshal.Copy(byteArray, 0, berValues[j].bv_val, (int)berValues[j].bv_len.Value); 1324int structSize = Marshal.SizeOf<BerVal>(); 1330controlPtr = Marshal.AllocHGlobal(structSize); 1334Marshal.StructureToPtr(berValues[m], controlPtr, false); 1466Marshal.PtrToStructure(requestValue, val); 1470Marshal.Copy(val.bv_val, requestValueArray, 0, (int)val.bv_len.Value); 1651IntPtr singleControl = Marshal.ReadIntPtr(tempControlPtr, 0); 1659singleControl = Marshal.ReadIntPtr(tempControlPtr, i * IntPtr.Size); 1782IntPtr tempPtr = Marshal.ReadIntPtr(valuesArray, IntPtr.Size * count); 1786Marshal.PtrToStructure(tempPtr, bervalue); 1791Marshal.Copy(bervalue.bv_val, byteArray, 0, (int)bervalue.bv_len.Value); 1796tempPtr = Marshal.ReadIntPtr(valuesArray, IntPtr.Size * count); 1825tempPtr = Marshal.ReadIntPtr(referenceArray, IntPtr.Size * count); 1832tempPtr = Marshal.ReadIntPtr(referenceArray, IntPtr.Size * count); 1921Marshal.PtrToStructure(controlPtr, control); 1927Marshal.Copy(control.ldctl_value.bv_val, bytes, 0, (int)control.ldctl_value.bv_len.Value);
System\DirectoryServices\Protocols\ldap\LdapConnection.Linux.cs (7)
140IntPtr ptrToDefaults = Marshal.AllocHGlobal(Marshal.SizeOf(defaults)); 141Marshal.StructureToPtr(defaults, ptrToDefaults, false); 151Marshal.FreeHGlobal(ptrToDefaults); 162defaults.realm = Marshal.PtrToStringAnsi(outValue); 167defaults.authcid = Marshal.PtrToStringAnsi(outValue); 172defaults.authzid = Marshal.PtrToStringAnsi(outValue);
System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs (23)
574int structSize = Marshal.SizeOf<LdapControl>(); 581IntPtr controlPtr = Marshal.AllocHGlobal(structSize); 582Marshal.StructureToPtr(managedServerControls[i], controlPtr, false); 597IntPtr controlPtr = Marshal.AllocHGlobal(structSize); 598Marshal.StructureToPtr(managedClientControls[i], controlPtr, false); 676IntPtr tempPtr = Marshal.ReadIntPtr(serverControlArray, IntPtr.Size * i); 679Marshal.FreeHGlobal(tempPtr); 682Marshal.FreeHGlobal(serverControlArray); 691Marshal.FreeHGlobal(managedServerControls[i].ldctl_oid); 698Marshal.FreeHGlobal(managedServerControls[i].ldctl_value.bv_val); 709IntPtr tempPtr = Marshal.ReadIntPtr(clientControlArray, IntPtr.Size * i); 712Marshal.FreeHGlobal(tempPtr); 716Marshal.FreeHGlobal(clientControlArray); 725Marshal.FreeHGlobal(managedClientControls[i].ldctl_oid); 731Marshal.FreeHGlobal(managedClientControls[i].ldctl_value.bv_val); 864Marshal.FreeHGlobal(inValue); 873sizeofcallback = Marshal.SizeOf<LdapReferralCallback>(), 898string target = $"{Marshal.PtrToStringUni(HostNamePtr)}:{PortNumber}"; 962string target = $"{Marshal.PtrToStringUni(hostNamePtr)}:{portNumber}"; 1081string user = Marshal.PtrToStringUni(SecAuthIdentit->user); 1082string domain = Marshal.PtrToStringUni(SecAuthIdentit->domain); 1083string password = Marshal.PtrToStringUni(SecAuthIdentit->password); 1099certPtr = Marshal.ReadIntPtr(serverCert);
System.Drawing.Common (53)
_generated\19\Windows.Win32.PInvoke.USER32.dll.g.cs (3)
62 Marshal.SetLastSystemError(0); 64 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
_generated\20\Windows.Win32.PInvoke.winspool.drv.g.cs (3)
102 Marshal.SetLastSystemError(0); 104 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
System\Drawing\BufferedGraphicsContext.cs (1)
412throw new Win32Exception(Marshal.GetLastWin32Error());
System\Drawing\Font.cs (4)
277if (Marshal.SizeOf(type) != nativeSize) 289Marshal.PtrToStructure(new IntPtr(&nativeLogFont), logFont); 634if (Marshal.SizeOf(type) != nativeSize) 644Marshal.StructureToPtr(lf, new IntPtr(&logFont), fDeleteOld: false);
System\Drawing\Graphics.cs (4)
2191callback is null ? 0 : Marshal.GetFunctionPointerForDelegate(callback), 2244callback is null ? 0 : Marshal.GetFunctionPointerForDelegate(callback), 2306callback is null ? 0 : Marshal.GetFunctionPointerForDelegate(callback), 3562WIN32_ERROR error = (WIN32_ERROR)Marshal.GetLastWin32Error();
System\Drawing\Graphics.EnumerateMetafileDataAdapter.cs (1)
28NativeCallback = Marshal.GetFunctionPointerForDelegate(_nativeCallback);
System\Drawing\Icon.cs (2)
650Marshal.Copy(_iconData, newOffset + j * width, (IntPtr)pixelPtr, lineLength); 893Marshal.ThrowExceptionForHR((int)result);
System\Drawing\Image.cs (4)
282Marshal.FreeHGlobal((nint)nativeParameters); 323Marshal.FreeHGlobal((nint)nativeParameters); 352Marshal.FreeHGlobal((nint)nativeParameters); 384Marshal.FreeHGlobal((nint)nativeParameters);
System\Drawing\Imaging\EncoderParameter.cs (21)
52Marshal.FreeHGlobal(_parameterValue); 69_parameterValue = Marshal.AllocHGlobal(sizeof(byte)); 84_parameterValue = Marshal.AllocHGlobal(sizeof(byte)); 96_parameterValue = Marshal.AllocHGlobal(sizeof(short)); 108_parameterValue = Marshal.AllocHGlobal(sizeof(int)); 120_parameterValue = Marshal.AllocHGlobal(2 * sizeof(int)); 133_parameterValue = Marshal.AllocHGlobal(2 * sizeof(int)); 151_parameterValue = Marshal.AllocHGlobal(4 * sizeof(int)); 166_parameterValue = Marshal.StringToHGlobalAnsi(value); 177_parameterValue = Marshal.AllocHGlobal(_numberOfValues); 179Marshal.Copy(value, 0, _parameterValue, _numberOfValues); 190_parameterValue = Marshal.AllocHGlobal(_numberOfValues); 192Marshal.Copy(value, 0, _parameterValue, _numberOfValues); 202_parameterValue = Marshal.AllocHGlobal(checked(_numberOfValues * sizeof(short))); 204Marshal.Copy(value, 0, _parameterValue, _numberOfValues); 214_parameterValue = Marshal.AllocHGlobal(checked(_numberOfValues * sizeof(int))); 234_parameterValue = Marshal.AllocHGlobal(checked(_numberOfValues * 2 * sizeof(int))); 254_parameterValue = Marshal.AllocHGlobal(checked(_numberOfValues * 2 * sizeof(int))); 281_parameterValue = Marshal.AllocHGlobal(checked(_numberOfValues * 4 * sizeof(int))); 310_parameterValue = Marshal.AllocHGlobal(bytes); 336_parameterValue = Marshal.AllocHGlobal(bytes);
System\Drawing\Imaging\EncoderParameters.cs (1)
21GdiPlus.EncoderParameters* native = (GdiPlus.EncoderParameters*)Marshal.AllocHGlobal(
System\Drawing\Printing\DefaultPrintController.cs (1)
51WIN32_ERROR error = (WIN32_ERROR)Marshal.GetLastPInvokeError();
System\Drawing\Printing\PrinterSettings.cs (5)
144WIN32_ERROR error = (WIN32_ERROR)Marshal.GetLastPInvokeError(); 640Marshal.Copy(_cachedDevmode, 0, (nint)devmode, _devmodeBytes); 664Marshal.Copy(_extraInfo, 0, (nint)((byte*)devmode + devmode->dmSize), _extraBytes); 996Marshal.Copy((nint)devmode, _cachedDevmode, 0, _devmodeBytes); 1004Marshal.Copy((nint)((byte*)devmode + devmode->dmSize), _extraInfo, 0, _extraBytes);
System\Drawing\SystemIcons.cs (3)
76Marshal.ThrowExceptionForHR((int)result); 102Marshal.ThrowExceptionForHR((int)result); 113Marshal.ThrowExceptionForHR((int)result);
System.Formats.Tar (26)
_generated\0\LibraryImports.g.cs (24)
45global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 47__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 56global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 73global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 75__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 78global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 166global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 168__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 184global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 215global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 217__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 227global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 254global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 256__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 265global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 295global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 297__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 306global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 336global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 338__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 347global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 377global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 379__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 388global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
System.IO.Compression (13)
_generated\0\LibraryImports.g.cs (12)
93global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 95__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 104global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 134global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 136__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 145global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 175global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 177__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 186global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 216global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 218__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 227global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
System\IO\Compression\Zstandard\ZstandardUtils.cs (1)
45return System.Runtime.InteropServices.Marshal.PtrToStringAnsi(errorNamePtr) ?? $"Unknown error {error}";
System.IO.FileSystem.AccessControl (37)
_generated\0\LibraryImports.g.cs (27)
20global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 22__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 40global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 59global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 61__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 66global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 93global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 95__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 113global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 131global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 133__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 136global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 158global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 160__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 165global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 186global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 188__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 191global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 212global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 214__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 217global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 239global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 241__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 246global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 268global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 270__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 275global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (2)
56if (Marshal.GetLastWin32Error() == ERROR_INSUFFICIENT_BUFFER) 69Marshal.FreeHGlobal(nativeMsgPtr);
src\runtime\src\libraries\Common\src\System\IO\FileSystem.Attributes.Windows.cs (2)
61errorCode = Marshal.GetLastPInvokeError(); 87errorCode = Marshal.GetLastPInvokeError();
src\runtime\src\libraries\Common\src\System\IO\FileSystem.DirectoryCreation.Windows.cs (1)
90int currentError = Marshal.GetLastPInvokeError();
src\runtime\src\libraries\Common\src\System\IO\Win32Marshal.cs (2)
19=> GetExceptionForWin32Error(Marshal.GetLastPInvokeError(), path); 85return Marshal.GetPInvokeErrorMessage(errorCode);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PathHelper.Windows.cs (2)
87int errorCode = Marshal.GetLastPInvokeError(); 190int error = Marshal.GetLastPInvokeError();
System\IO\FileSystemAclExtensions.cs (1)
312int errorCode = Marshal.GetLastPInvokeError();
System.IO.FileSystem.DriveInfo (14)
_generated\0\LibraryImports.g.cs (12)
45global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 47__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 56global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 94global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 96__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 105global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 132global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 134__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 143global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 172global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 174__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 193global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
System.IO.FileSystem.Watcher (29)
_generated\0\LibraryImports.g.cs (27)
21global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 23__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 32global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 59global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 61__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 70global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 121global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 123__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 132global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 156global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 158__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 176global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 207global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 209__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 219global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 246global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 248__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 257global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 295global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 297__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 306global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 336global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 338__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 347global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 377global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 379__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 388global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
System.IO.MemoryMappedFiles (62)
_generated\0\LibraryImports.g.cs (60)
36global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 38__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 41global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 61global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 63__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 66global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 96global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 98__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 107global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 139global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 141__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 153global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 183global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 185__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 194global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 224global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 226__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 235global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 256global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 258__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 261global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 289global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 291__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 300global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 318global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 320__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 323global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 341global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 343__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 346global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 364global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 366__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 369global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 399global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 401__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 422global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 440global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 442__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 445global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 472global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 474__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 483global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 501global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 503__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 506global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 536global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 538__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 559global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 586global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 588__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 597global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 627global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 629__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 650global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 668global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 670__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 673global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 700global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 702__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 711global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
System.IO.Pipes (68)
_generated\0\LibraryImports.g.cs (66)
36global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 38__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 41global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 70global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 72__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 81global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 111global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 113__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 122global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 154global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 156__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 159global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 189global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 191__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 200global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 232global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 234__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 246global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 276global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 278__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 287global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 317global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 319__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 328global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 349global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 351__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 354global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 382global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 384__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 393global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 411global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 413__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 416global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 434global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 436__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 439global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 469global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 471__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 492global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 510global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 512__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 515global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 601global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 603__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 612global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 639global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 641__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 650global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 677global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 679__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 688global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 718global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 720__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 729global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 759global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 761__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 770global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 800global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 802__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 811global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 841global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 843__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 852global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 882global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 884__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 893global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
System.IO.Ports (42)
_generated\0\LibraryImports.g.cs (39)
22global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 24__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 33global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 61global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 63__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 72global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 100global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 102__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 111global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 174global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 176__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 185global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 213global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 215__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 224global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 254global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 256__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 265global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 293global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 295__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 304global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 332global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 334__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 343global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 371global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 373__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 382global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 413global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 415__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 436global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 455global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 457__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 460global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 496global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 498__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 507global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 535global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 537__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 546global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
System\IO\Ports\InternalResources.cs (1)
5using Marshal = System.Runtime.InteropServices.Marshal;
System.Management (156)
_generated\0\LibraryImports.g.cs (6)
14global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 16__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 21global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 117global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 119__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 122global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
System\Management\InteropClasses\WMIInterop.cs (5)
61Marshal.Release(pWbemClassObject); 390Marshal.Release(pWbemQualifierSet); 1351if (0 == Marshal.QueryInterface(pComThreadingInfo, ref Unsafe.AsRef(in IID_IObjectContext), out pObjectContext)) 1358Marshal.Release(pComThreadingInfo); 1360Marshal.Release(pObjectContext);
System\Management\ManagementBaseObject.cs (8)
323Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 430Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 601Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 619(IWbemClassObject_DoNotMarshal)(Marshal.GetObjectForIUnknown(wbemObject)), 628Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 755Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 776Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 798Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f());
System\Management\ManagementClass.cs (13)
91Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 356Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 489Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 619Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 705Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 771Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 849Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 905Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 932Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1061Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1164Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1258Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1350Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f());
System\Management\ManagementEventWatcher.cs (8)
440cachedObjects[i] = new IWbemClassObjectFreeThreaded(Marshal.GetIUnknownForObject(tempArray[i])); 461Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 492Marshal.ThrowExceptionForHR(sink.Status, WmiNetUtilsHelper.GetErrorInfo_f()); 517Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 537Marshal.ReleaseComObject(enumWbem); 660Marshal.AddRef(pWbemClassObject); 734Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 756System.Runtime.InteropServices.Marshal.ReleaseComObject(stub);
System\Management\ManagementObject.cs (34)
700Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 796Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 930Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1066Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1195Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1298Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1418Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1475ppwbemCallResult = Marshal.AllocHGlobal(IntPtr.Size); 1476Marshal.WriteIntPtr(ppwbemCallResult, IntPtr.Zero); // Init to NULL. 1495pwbemCallResult = Marshal.ReadIntPtr(ppwbemCallResult); 1497wbemCallResult = (IWbemCallResult)Marshal.GetObjectForIUnknown(pwbemCallResult); 1510Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1520Marshal.FreeHGlobal(ppwbemCallResult); 1523Marshal.Release(pwbemCallResult); 1526Marshal.ReleaseComObject(wbemCallResult); 1665Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1768ppwbemCallResult = Marshal.AllocHGlobal(IntPtr.Size); 1769Marshal.WriteIntPtr(ppwbemCallResult, IntPtr.Zero); // Init to NULL. 1791pwbemCallResult = Marshal.ReadIntPtr(ppwbemCallResult); 1794wbemCallResult = (IWbemCallResult)Marshal.GetObjectForIUnknown(pwbemCallResult); 1807Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1818Marshal.FreeHGlobal(ppwbemCallResult); 1821Marshal.Release(pwbemCallResult); 1824Marshal.ReleaseComObject(wbemCallResult); 1921Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1983Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 2054Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 2311Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 2387Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 2480Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 2508Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 2660Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 2748Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 2840Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f());
System\Management\ManagementObjectCollection.cs (8)
115Marshal.ReleaseComObject(enumWbem); 317Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 445Marshal.ReleaseComObject(enumWbem); 552Marshal.GetIUnknownForObject(tempArray[i]) 562Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 631Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 636Marshal.ReleaseComObject((IWbemClassObject_DoNotMarshal)(Marshal.GetObjectForIUnknown(cachedObjects[i])));
System\Management\ManagementObjectSearcher.cs (2)
387Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 481Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f());
System\Management\ManagementOptions.cs (1)
1671return System.Runtime.InteropServices.Marshal.SecureStringToBSTR(securePassword);
System\Management\ManagementPath.cs (13)
116Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 286Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 342Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 384Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 531Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 628Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 658Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 785Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 835Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 959Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 986Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1015Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1044Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f());
System\Management\ManagementScope.cs (18)
316throw new Win32Exception(Marshal.GetLastPInvokeError(), SR.Format(SR.LoadLibraryFailed, wminet_utilsPath)); 383(delegate_f = Marshal.GetDelegateForFunctionPointer<TDelegate>(procAddr)) != null; 547IntPtr pUnk = Marshal.GetIUnknownForObject(wbemServices); 550object unknown = Marshal.GetObjectForIUnknown(pUnk); 553Marshal.Release(pUnk); 1010Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1074System.Runtime.InteropServices.Marshal.ZeroFreeBSTR(password); 1122System.Runtime.InteropServices.Marshal.ZeroFreeBSTR(password); 1194System.Runtime.InteropServices.Marshal.ZeroFreeBSTR(password); 1232System.Runtime.InteropServices.Marshal.ZeroFreeBSTR(password); 1258System.Runtime.InteropServices.Marshal.ZeroFreeBSTR(password); 1297System.Runtime.InteropServices.Marshal.ZeroFreeBSTR(password); 1324System.Runtime.InteropServices.Marshal.ZeroFreeBSTR(password); 1351System.Runtime.InteropServices.Marshal.ZeroFreeBSTR(password); 1423System.Runtime.InteropServices.Marshal.ZeroFreeBSTR(password); 1426Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 1449System.Runtime.InteropServices.Marshal.ZeroFreeBSTR(password); 1452Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f());
System\Management\Method.cs (2)
134Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 225Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f());
System\Management\MethodSet.cs (4)
111Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 290Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 383Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 450Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f());
System\Management\Property.cs (9)
111Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 158Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 238Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 334((ManagementBaseObject[])val)[i] = new ManagementBaseObject(new IWbemClassObjectFreeThreaded(Marshal.GetIUnknownForObject(wmiValueArray.GetValue(i)))); 352CimType.Object => new ManagementBaseObject(new IWbemClassObjectFreeThreaded(Marshal.GetIUnknownForObject(wmiValue))), 500((IWbemClassObject_DoNotMarshal[])(wmiValue))[i] = (IWbemClassObject_DoNotMarshal)(Marshal.GetObjectForIUnknown(((ManagementBaseObject)valArray.GetValue(i)).wbemObject)); 570wmiValue = Marshal.GetObjectForIUnknown(((ManagementBaseObject)val).wbemObject); 723((IWbemClassObject_DoNotMarshal[])(wmiValue))[i] = (IWbemClassObject_DoNotMarshal)(Marshal.GetObjectForIUnknown(((ManagementBaseObject)valArray.GetValue(i)).wbemObject)); 805wmiValue = Marshal.GetObjectForIUnknown(((ManagementBaseObject)val).wbemObject);
System\Management\PropertySet.cs (7)
91Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 165Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 271Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 391Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 434Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 476Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 514Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f());
System\Management\Qualifier.cs (6)
87Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 188Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 231Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 287Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 325Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 363Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f());
System\Management\QualifierSet.cs (6)
99Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 140Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 208Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 343Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 433Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f()); 482Marshal.ThrowExceptionForHR(status, WmiNetUtilsHelper.GetErrorInfo_f());
System\Management\WmiEventSink.cs (4)
126Marshal.AddRef(pIWbemClassObject); 146Marshal.AddRef(pErrorObj); 227System.Runtime.InteropServices.Marshal.ReleaseComObject(stub); 289Marshal.AddRef(pIWbemClassObject);
System\Management\wmiutil.cs (2)
37Marshal.QueryInterface(pErrorInfo, ref IWbemClassObjectFreeThreaded.IID_IWbemClassObject, out pIWbemClassObject); 39Marshal.Release(pErrorInfo);
System.Net.Http.WinHttpHandler (130)
_generated\0\LibraryImports.g.cs (88)
13global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 15__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 18global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 38global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 40__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 45global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 77global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 79__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 91global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 110global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 112__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 115global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 136global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 138__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 141global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 169global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 171__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 189global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 209global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 211__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 216global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 249global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 251__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 272global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 309global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 311__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 332global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 363global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 365__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 378global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 409global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 411__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 423global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 452global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 454__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 466global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 495global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 497__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 509global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 538global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 540__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 552global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 581global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 583__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 595global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 628global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 630__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 642global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 675global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 677__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 689global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 721global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 723__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 735global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 766global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 768__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 780global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 812global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 814__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 826global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 855global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 857__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 869global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 900global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 902__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 914global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 943global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 945__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 957global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 989global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 991__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1003global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1039global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1041__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1053global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1082global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1084__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1096global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1119global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1121__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1126global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1161global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1163__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1177global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1202__callback_native = callback != null ? global::System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback) : default; 1207global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1209__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1221global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.CRYPT_BIT_BLOB.cs (1)
22Marshal.Copy(pbData, data, 0, numBytes);
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.DATA_BLOB.cs (1)
31Marshal.Copy(pbData, array, 0, (int)cbData);
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (2)
56if (Marshal.GetLastWin32Error() == ERROR_INSUFFICIENT_BUFFER) 69Marshal.FreeHGlobal(nativeMsgPtr);
src\runtime\src\libraries\Common\src\Interop\Windows\WinHttp\Interop.winhttp_types.cs (3)
288AutoConfigUrl = managed.AutoConfigUrl is not null ? Marshal.StringToCoTaskMemUni(managed.AutoConfigUrl) : IntPtr.Zero; 300AutoConfigUrl = AutoConfigUrl != IntPtr.Zero ? Marshal.PtrToStringUni(AutoConfigUrl) : null, 309Marshal.FreeCoTaskMem(AutoConfigUrl);
src\runtime\src\libraries\Common\src\System\Net\Security\CertificateValidation.Windows.cs (1)
32throw new CryptographicException(Marshal.GetLastPInvokeError());
System\Net\Http\WinHttpChannelBinding.cs (5)
23if (Marshal.GetLastWin32Error() == Interop.WinHttp.ERROR_INSUFFICIENT_BUFFER) 25IntPtr data = Marshal.AllocHGlobal((int)dataSize); 34Marshal.FreeHGlobal(data); 61Marshal.Copy(this.handle, bytes, 0, _size); 70Marshal.FreeHGlobal(this.handle);
System\Net\Http\WinHttpCookieContainerAdapter.cs (1)
65int lastError = Marshal.GetLastWin32Error();
System\Net\Http\WinHttpException.cs (1)
55int lastError = Marshal.GetLastWin32Error();
System\Net\Http\WinHttpHandler.cs (10)
843int lastError = Marshal.GetLastWin32Error(); 1061int lastError = Marshal.GetLastWin32Error(); 1152NetEventSource.Info(this, "Failed to enable WINHTTP_OPTION_REQUIRE_STREAM_END error code: " + Marshal.GetLastWin32Error()); 1304proxyInfo.Proxy = Marshal.StringToHGlobalUni(proxyString); 1318(uint)Marshal.SizeOf(proxyInfo)); 1328Marshal.FreeHGlobal(proxyInfo.Proxy); 1329Marshal.FreeHGlobal(proxyInfo.ProxyBypass); 1429(uint)Marshal.SizeOf<Interop.Crypt32.CERT_CONTEXT>()); 1631int lastError = Marshal.GetLastWin32Error(); 1643int lastError = Marshal.GetLastWin32Error();
System\Net\Http\WinHttpRequestCallback.cs (9)
69IPAddress connectedToIPAddress = IPAddress.Parse(Marshal.PtrToStringUni(statusInformation)!); 84int bytesAvailable = Marshal.ReadInt32(statusInformation); 101var redirectUri = new Uri(Marshal.PtrToStringUni(statusInformation)!); 111statusInformationLength == Marshal.SizeOf<Interop.WinHttp.WINHTTP_ASYNC_RESULT>(), 113" must be sizeof(WINHTTP_ASYNC_RESULT)=" + Marshal.SizeOf<Interop.WinHttp.WINHTTP_ASYNC_RESULT>()); 115var asyncResult = Marshal.PtrToStructure<Interop.WinHttp.WINHTTP_ASYNC_RESULT>(statusInformation); 290int lastError = Marshal.GetLastWin32Error(); 351int lastError = Marshal.GetLastWin32Error(); 540int lastError = Marshal.GetLastWin32Error();
System\Net\Http\WinHttpRequestStream.cs (1)
232Marshal.UnsafeAddrOfPinnedArrayElement(buffer, offset),
System\Net\Http\WinHttpResponseParser.cs (4)
141int lastError = Marshal.GetLastWin32Error(); 166lastError = Marshal.GetLastWin32Error(); 187int lastError = Marshal.GetLastWin32Error(); 220int lastError = Marshal.GetLastWin32Error();
System\Net\Http\WinHttpResponseStream.cs (2)
141if (!Interop.WinHttp.WinHttpReadData(_requestHandle, Marshal.UnsafeAddrOfPinnedArrayElement(buffer, 0), (uint)Math.Min(bytesAvailable, buffer.Length), IntPtr.Zero)) 238Marshal.UnsafeAddrOfPinnedArrayElement(buffer, offset),
System\Net\Http\WinHttpTrailersHelper.cs (1)
57int lastError = Marshal.GetLastWin32Error();
System.Net.HttpListener (1)
System\Net\HttpListenerException.cs (1)
14public HttpListenerException() : base(Marshal.GetLastPInvokeError())
System.Net.NameResolution (9)
_generated\0\LibraryImports.g.cs (6)
52global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 54__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 57global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 75global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 77__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 80global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (1)
152uint addr = (uint)System.Runtime.InteropServices.Marshal.ReadInt32((IntPtr)address);
System.Net.NetworkInformation (14)
_generated\0\LibraryImports.g.cs (9)
28global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 30__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 33global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 59global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 61__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 64global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 114global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 116__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 119global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
src\runtime\src\libraries\Common\src\System\Net\NetworkInformation\NetworkInformationException.cs (1)
25public NetworkInformationException() : base(Marshal.GetLastPInvokeError())
System\Net\NetworkInformation\LinuxNetworkInterface.cs (1)
136Marshal.FreeHGlobal(globalMemory);
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (1)
168Marshal.InitHandle(sh, newSocket);
System.Net.Ping (8)
_generated\0\LibraryImports.g.cs (3)
70global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 72__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 75global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (1)
152uint addr = (uint)System.Runtime.InteropServices.Marshal.ReadInt32((IntPtr)address);
System\Net\NetworkInformation\Ping.RawSocket.cs (2)
397Debug.Assert(Marshal.SizeOf<IcmpHeader>() == 8, "The size of an ICMP Header must be 8 bytes."); 470Marshal.Copy(new IntPtr(&icmpHeader), result, offset, icmpHeaderSize);
System.Net.Primitives (12)
_generated\0\LibraryImports.g.cs (6)
116global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 118__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 121global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 191global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 193__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 196global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (1)
152uint addr = (uint)System.Runtime.InteropServices.Marshal.ReadInt32((IntPtr)address);
System\Net\NetworkCredential.cs (3)
165ptr = Marshal.SecureStringToGlobalAllocUnicode(sstr); 166result = Marshal.PtrToStringUni(ptr)!; 172Marshal.ZeroFreeGlobalAllocUnicode(ptr);
System.Net.Quic (4)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (1)
152uint addr = (uint)System.Runtime.InteropServices.Marshal.ReadInt32((IntPtr)address);
System\Net\Quic\Interop\msquic_generated.cs (1)
3136internal static readonly uint QUIC_EXECUTION_CONFIG_MIN_SIZE = unchecked((uint)((int)(Marshal.OffsetOf<QUIC_EXECUTION_CONFIG>("ProcessorList"))));
System.Net.Security (21)
_generated\0\LibraryImports.g.cs (15)
2740global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2742__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2751global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2782global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2784__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2793global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3010global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3012__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3021global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3055global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3057__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3066global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3102global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3104__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3113global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs (4)
27Marshal.Copy(certHashBytes, 0, CertHashPtr, length); 39handle = Marshal.AllocHGlobal(SecChannelBindingSize + _cbtPrefixByteArraySize + CertHashMaxSize); 56Marshal.StructureToPtr(channelBindings, handle, true); 63Marshal.FreeHGlobal(handle);
System.Net.Sockets (57)
_generated\0\LibraryImports.g.cs (51)
188global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 190__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 193global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 283global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 285__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 288global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 318global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 320__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 329global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 361global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 363__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 375global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 405global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 407__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 416global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 446global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 448__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 457global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 478global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 480__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 483global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 943global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 945__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 955global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1053global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1055__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1064global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1094global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1096__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1105global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1135global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1137__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1146global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1359global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1361__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1370global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1397global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1399__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1408global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1785global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1787__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1790global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1817global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1819__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1828global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1846global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1848__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1851global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1878global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1880__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1889global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (1)
152uint addr = (uint)System.Runtime.InteropServices.Marshal.ReadInt32((IntPtr)address);
src\runtime\src\libraries\Common\src\System\Net\Sockets\SocketExceptionFactory.cs (1)
12return Marshal.GetPInvokeErrorMessage(nativeSocketError) + " " + endPoint.ToString();
System\Net\Sockets\SocketPal.Unix.cs (2)
94Marshal.InitHandle(socket, fd); 1151Marshal.InitHandle(socket, acceptedFd);
System.Net.WebSockets (1)
System\Net\WebSockets\WebSocketException.cs (1)
18: this(Marshal.GetLastPInvokeError())
System.Private.CoreLib (397)
_generated\2\LibraryImports.g.cs (240)
232global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 234__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 237global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1035global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1037__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1040global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1334global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1336__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1339global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1360global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1362__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1365global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1383global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1385__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1388global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1406global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1408__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1411global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1813global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1815__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1824global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1851global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1853__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1862global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1889global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1891__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1900global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1927global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1929__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1938global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1956global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1958__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1961global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1981global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1983__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1986global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2016global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2018__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2027global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2059global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2061__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2073global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2103global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2105__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2114global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2144global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2146__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2155global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2176global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2178__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2181global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2213global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2215__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2225global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2335global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2337__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2340global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2423global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2425__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2434global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2452global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2454__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2457global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2484global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2486__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2495global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2522global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2524__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2533global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2610global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2612__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2615global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2633global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2635__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2638global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2706global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2708__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2711global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2741global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2743__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2759global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2820global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2822__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2825global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2847global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2849__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2865global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2892global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2894__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2903global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2930global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2932__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2941global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2988global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2990__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3000global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3027global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3029__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3038global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3151global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3153__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3162global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3245global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3247__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3256global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3274global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3276__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3279global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3297global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3299__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3302global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3329global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3331__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3340global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3358global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3360__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3363global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3381global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3383__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3386global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3424global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3426__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3447global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3474global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3476__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3485global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3546global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3548__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3557global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3584global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3586__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3595global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3622global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3624__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3633global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3660global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3662__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3671global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3698global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3700__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3709global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3736global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3738__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3747global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3774global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3776__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3785global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3812global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3814__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3823global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3850global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3852__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3861global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3888global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3890__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3899global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3925global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3927__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3930global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3959global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3961__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3970global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4001global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4003__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4013global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4040global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4042__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4051global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4089global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4091__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4100global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4130global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4132__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4141global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4171global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4173__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4182global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4212global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4214__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4223global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4253global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4255__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4264global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4295global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4297__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4307global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4325global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4327__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4330global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4424global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4426__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4435global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4462global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4464__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4473global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4500global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4502__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4511global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4538global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4540__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4549global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4567global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4569__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4572global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4599global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4601__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4610global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4644global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4646__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4649global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4743global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4745__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4750global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4822global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4824__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4829global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4887global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4889__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4892global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4910global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4912__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4915global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4933global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4935__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4938global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4956global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4958__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4961global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4991global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4993__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4996global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 5013global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 5015__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 5018global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 5037global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 5039__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 5044global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 5065global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 5067__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 5070global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
Internal\Runtime\CompilerHelpers\InteropHelpers.cs (14)
92return (char*)Marshal.StringToCoTaskMemUni(str); 101return (byte*)CoTaskMemAllocAndZeroMemory(checked((sb.Capacity + 2) * Marshal.SystemMaxDBCSCharSize)); 119return (byte*)CoTaskMemAllocAndZeroMemory(checked((chArray.Length + 2) * Marshal.SystemMaxDBCSCharSize)); 220return Marshal.PtrToStringBSTR((IntPtr)buffer); 234byte* bstr = (byte*)Marshal.AllocBSTRByteLen((uint)nativeLength); 245return Marshal.PtrToStringAnsi((IntPtr)buffer, (int)Marshal.SysStringByteLen((IntPtr)buffer)); 259int lastSystemError = Marshal.GetLastSystemError(); 271Marshal.SetLastSystemError(lastSystemError); 436byte* ptr = (byte*)Marshal.AllocCoTaskMem(size); 522return Marshal.SizeOf(o.GetType()); 537Marshal.StructureToPtr(o, address, fDeleteOld: false); 550Marshal.PtrToStructureImpl(address, o); 565Marshal.DestroyStructure(address, o.GetType());
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (2)
159return ConvertErrorPlatformToPal(Marshal.GetLastPInvokeError()); 164return new ErrorInfo(Marshal.GetLastPInvokeError());
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadLink.cs (2)
48error = Marshal.GetLastPInvokeError(); 66Marshal.SetLastPInvokeError(error);
src\runtime\src\libraries\System.Private.CoreLib\src\Internal\Runtime\InteropServices\ComponentActivator.cs (2)
39string? result = Marshal.PtrToStringAuto(arg); 351functionPtr = Marshal.GetFunctionPointerForDelegate(d);
src\runtime\src\libraries\System.Private.CoreLib\src\System\ComAwareWeakReference.cs (2)
57Marshal.Release(pComWeakRef); 71Marshal.Release(_pComWeakRef);
src\runtime\src\libraries\System.Private.CoreLib\src\System\ComponentModel\Win32Exception.cs (4)
26public Win32Exception() : this(Marshal.GetLastPInvokeError()) 33public Win32Exception(int error) : this(error, Marshal.GetPInvokeErrorMessage(error)) 48public Win32Exception(string? message) : this(Marshal.GetLastPInvokeError(), message) 58NativeErrorCode = Marshal.GetLastPInvokeError();
src\runtime\src\libraries\System.Private.CoreLib\src\System\DefaultBinder.cs (2)
235if (Marshal.IsBuiltInComSupported && argTypes[index].IsCOMObject) 271if (Marshal.IsBuiltInComSupported && argTypes[j].IsCOMObject)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipe.cs (6)
96native.m_pProviderName = (char*)Marshal.StringToCoTaskMemUni(managed.ProviderName); 99native.m_pFilterData = (char*)Marshal.StringToCoTaskMemUni(managed.FilterData); 106Marshal.FreeCoTaskMem((IntPtr)m_pProviderName); 110Marshal.FreeCoTaskMem((IntPtr)m_pFilterData); 121Span<EventPipeProviderConfigurationNative> providersNative = new Span<EventPipeProviderConfigurationNative>((void*)Marshal.AllocCoTaskMem(sizeof(EventPipeProviderConfigurationNative) * providers.Length), providers.Length); 146Marshal.FreeCoTaskMem((IntPtr)providersNativePointer);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (1)
1344Marshal.Copy((IntPtr)(void*)filterData->Ptr, data, 0, data.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (1)
1942Marshal.Copy(data->DataPointer, blob, 0, blob.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\DataCollector.cs (2)
138Marshal.Copy((IntPtr)p, buffer, oldPos, size); 177Marshal.Copy((IntPtr)p, buffer, oldPos, size);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (3)
72Debug.Assert(ret >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS); 291Debug.Assert(result >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS); 460if (Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_INSUFFICIENT_BUFFER)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Nls.cs (1)
174int lastError = Marshal.GetLastPInvokeError();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (4)
67int lastError = Marshal.GetLastPInvokeError(); 139int lastError = Marshal.GetLastPInvokeError(); 182int lastError = Marshal.GetLastPInvokeError(); 205int lastError = Marshal.GetLastPInvokeError();
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ArrayWithOffset.cs (1)
23if (array is not Array arrayObj || (arrayObj.Rank != 1) || !Marshal.IsPinnable(arrayObj))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (20)
85return Marshal.QueryInterface(wrapper.ExternalComObject, iid, out unknown) == HResults.S_OK; 97return Marshal.QueryInterface(wrapper.ExternalComObject, IID_IUnknown, out unknown) == HResults.S_OK; 332return Marshal.GetHRForException(ex); 581Marshal.QueryInterface(externalComObject, IID_IReferenceTracker, out trackerObject) == HResults.S_OK) 613Marshal.Release(externalComObject); 644Marshal.Release(_inner); 700Marshal.Release(_trackerObject); 737Marshal.Release(_trackerObject); 998if (0 != Marshal.QueryInterface(comObject, IID_TaggedImpl, out nint implMaybe)) 1005Marshal.Release(implMaybe); 1033Marshal.QueryInterface(externalComObject, IID_IReferenceTracker, out IntPtr referenceTrackerPtr) == HResults.S_OK) 1046Marshal.ThrowExceptionForHR(Marshal.QueryInterface(checkForIdentity, IID_IUnknown, out identity)); 1051Marshal.ThrowExceptionForHR(Marshal.QueryInterface(externalComObject, IID_IUnknown, out identity)); 1174Marshal.Release(identity); 1178Marshal.Release(referenceTrackerMaybe); 1567Marshal.Release(unknownPtr); 1631if (Marshal.QueryInterface(target.Ptr, IID_IUnknown, out IntPtr targetIdentityPtr) == HResults.S_OK) 1891Marshal.Release(_ptr);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CriticalHandle.cs (2)
149int lastError = Marshal.GetLastPInvokeError(); 153Marshal.SetLastPInvokeError(lastError);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\DispatchWrapper.cs (2)
19IntPtr pdisp = Marshal.GetIDispatchForObject(obj); 22Marshal.Release(pdisp);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ErrorWrapper.cs (1)
26ErrorCode = Marshal.GetHRForException(e);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\GCHandle.cs (2)
42if (type == GCHandleType.Pinned && !Marshal.IsPinnable(value)) 98if (IsPinned(handle) && !Marshal.IsPinnable(value))
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\IReferenceTracker.cs (5)
11Marshal.ThrowExceptionForHR((*(delegate* unmanaged<IntPtr, int>**)pThis)[3](pThis)); 29Marshal.ThrowExceptionForHR((*(delegate* unmanaged<IntPtr, IntPtr*, int>**)pThis)[6](pThis, ptr)); 34Marshal.ThrowExceptionForHR((*(delegate* unmanaged<IntPtr, int>**)pThis)[7](pThis)); 39Marshal.ThrowExceptionForHR((*(delegate* unmanaged<IntPtr, int>**)pThis)[8](pThis)); 44Marshal.ThrowExceptionForHR((*(delegate* unmanaged<IntPtr, int>**)pThis)[9](pThis));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\AnsiStringMarshaller.cs (8)
27int exactByteCount = Marshal.GetAnsiStringByteCount(managed); // Includes null terminator 28byte* mem = (byte*)Marshal.AllocCoTaskMem(exactByteCount); 31Marshal.GetAnsiStringBytes(managed, buffer); // Includes null terminator 41=> Marshal.PtrToStringAnsi((IntPtr)unmanaged); 48=> Marshal.FreeCoTaskMem((IntPtr)unmanaged); 80if ((long)Marshal.SystemMaxDBCSCharSize * managed.Length >= buffer.Length) 83int exactByteCount = Marshal.GetAnsiStringByteCount(managed); // Includes null terminator 94Marshal.GetAnsiStringBytes(managed, buffer); // Includes null terminator
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ArrayMarshaller.cs (2)
44return (TUnmanagedElement*)Marshal.AllocCoTaskMem(spaceToAllocate); 110=> Marshal.FreeCoTaskMem((IntPtr)unmanaged);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\BStrStringMarshaller.cs (5)
25=> (ushort*)Marshal.StringToBSTR(managed); 37return Marshal.PtrToStringBSTR((IntPtr)unmanaged); 45=> Marshal.FreeBSTR((IntPtr)unmanaged); 84ptrToFirstChar = (ushort*)Marshal.AllocBSTRByteLen((uint)lengthInBytes); 97Debug.Assert(lengthInBytes == Marshal.SysStringByteLen((IntPtr)ptrToFirstChar));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ComVariant.cs (19)
150Marshal.FreeBSTR(_typeUnion._unionTypes._bstr); 160Marshal.Release(_typeUnion._unionTypes._unknown); 170Marshal.ThrowExceptionForHR(((delegate* unmanaged<IntPtr, IntPtr, int>)(*(*(void***)_typeUnion._unionTypes._record._recordInfo + 4 /* IRecordInfo.RecordClear slot */)))(_typeUnion._unionTypes._record._recordInfo, _typeUnion._unionTypes._record._record)); 172Marshal.Release(_typeUnion._unionTypes._record._recordInfo); 177Marshal.FreeCoTaskMem(_typeUnion._unionTypes._byref); 181Marshal.FreeCoTaskMem(_typeUnion._unionTypes._blob._data); 187Marshal.Release(_typeUnion._unionTypes._unknown); 195Marshal.Release(versionedStream->_stream); 197Marshal.FreeCoTaskMem((nint)versionedStream); 204Marshal.FreeCoTaskMem(clipboardData->_data); 205Marshal.FreeCoTaskMem((nint)clipboardData); 215Marshal.FreeBSTR(str); 222Marshal.FreeCoTaskMem(str); 228Marshal.FreeCoTaskMem(cf._data); 240Marshal.FreeCoTaskMem((nint)GetRawDataRef<Vector<byte>>()._data); 297variant._typeUnion._unionTypes._bstr = Marshal.StringToBSTR(((BStrWrapper)(object)value).WrappedObject); 307variant._typeUnion._unionTypes._bstr = Marshal.StringToBSTR((string)(object)value); 485return (T)(object)new BStrWrapper(Marshal.PtrToStringBSTR(_typeUnion._unionTypes._bstr)); 496return (T)(object)Marshal.PtrToStringBSTR(_typeUnion._unionTypes._bstr);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\PointerArrayMarshaller.cs (2)
45return (TUnmanagedElement*)Marshal.AllocCoTaskMem(spaceToAllocate); 111=> Marshal.FreeCoTaskMem((IntPtr)unmanaged);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ReadOnlySpanMarshaller.cs (2)
55return (TUnmanagedElement*)Marshal.AllocCoTaskMem(spaceToAllocate); 232Marshal.FreeCoTaskMem((IntPtr)_unmanagedArray);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\SafeHandleMarshaller.cs (2)
108Marshal.InitHandle(_newHandle, value); 175Marshal.InitHandle(_newHandle, value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\SpanMarshaller.cs (2)
49return (TUnmanagedElement*)Marshal.AllocCoTaskMem(spaceToAllocate); 115=> Marshal.FreeCoTaskMem((IntPtr)unmanaged);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\Utf16StringMarshaller.cs (3)
22=> (ushort*)Marshal.StringToCoTaskMemUni(managed); 30=> Marshal.PtrToStringUni((IntPtr)unmanaged); 37=> Marshal.FreeCoTaskMem((IntPtr)unmanaged);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\Utf8StringMarshaller.cs (3)
29byte* mem = (byte*)Marshal.AllocCoTaskMem(exactByteCount); 43=> Marshal.PtrToStringUTF8((IntPtr)unmanaged); 50=> Marshal.FreeCoTaskMem((IntPtr)unmanaged);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NativeLibrary.cs (1)
263throw new Win32Exception(Marshal.GetLastPInvokeError());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NativeLibrary.Unix.cs (1)
17string? message = Marshal.PtrToStringUTF8(Interop.Sys.GetLoadLibraryError());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ReferenceTrackerHost.cs (9)
45return Marshal.GetHRForException(e); 72return Marshal.GetHRForException(e); 86if (Marshal.QueryInterface(punk, ComWrappers.IID_IUnknown, out IntPtr ppv) != HResults.S_OK) 95return Marshal.QueryInterface(trackerTarget.Ptr, ComWrappers.IID_IReferenceTrackerTarget, out *ppNewReference); 99return Marshal.GetHRForException(e); 115return Marshal.GetHRForException(e); 131return Marshal.GetHRForException(e); 143Marshal.AddRef(pThis); 207Marshal.ThrowExceptionForHR((*(delegate* unmanaged<IntPtr, IntPtr, int>**)pThis)[6](pThis, referenceTrackerHost));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeHandle.cs (2)
259int lastError = Marshal.GetLastPInvokeError(); 261Marshal.SetLastPInvokeError(lastError);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\TrackerObjectManager.cs (1)
36Marshal.Release(referenceTrackerManager);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (10)
323ptr = Marshal.AllocBSTR(length); 336Marshal.FreeBSTR(ptr); 366byteLength = Marshal.GetAnsiStringByteCount(span); 371ptr = Marshal.AllocHGlobal(byteLength); 375ptr = Marshal.AllocCoTaskMem(byteLength); 386Marshal.GetAnsiStringBytes(span, new Span<byte>((void*)ptr, byteLength)); 402Marshal.FreeHGlobal(ptr); 406Marshal.FreeCoTaskMem(ptr); 430buffer.SetHandle(Marshal.AllocHGlobal(byteLength)); 468Marshal.FreeHGlobal(handle);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.Unix.cs (1)
165Marshal.InitHandle(safeWaitHandle, handle);
src\runtime\src\libraries\System.Private.CoreLib\src\System\ThrowHelper.cs (1)
657Exception? ex = Marshal.GetExceptionForHR(hr);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Type.cs (2)
565public static Type? GetTypeFromCLSID(Guid clsid, string? server, bool throwOnError) => Marshal.GetTypeFromCLSID(clsid, server, throwOnError); 574public static Type? GetTypeFromProgID(string progID, string? server, bool throwOnError) => Marshal.GetTypeFromProgID(progID, server, throwOnError);
System\Runtime\InteropServices\PInvokeMarshal.cs (2)
486Marshal.FreeCoTaskMem(new IntPtr(nativeArray)); 519pNative = (byte*)Marshal.AllocCoTaskMem(checked(length + 1));
System.Private.Windows.Core (120)
_generated\10\Windows.Win32.BSTR.g.cs (1)
50 public override string ToString() => this.Value != null ? Marshal.PtrToStringBSTR(new IntPtr(this.Value)) : null;
_generated\120\Windows.Win32.HRESULT.g.cs (3)
65 /// <inheritdoc cref="Marshal.ThrowExceptionForHR(int, IntPtr)" /> 73 /// <seealso cref="Marshal.ThrowExceptionForHR(int, IntPtr)"/> 77 Marshal.ThrowExceptionForHR(this.Value, errorInfo);
_generated\195\Windows.Win32.PInvokeCore.GDI32.dll.g.cs (6)
50 Marshal.SetLastSystemError(0); 52 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 238 Marshal.SetLastSystemError(0); 240 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
_generated\197\Windows.Win32.PInvokeCore.KERNEL32.dll.g.cs (30)
40 Marshal.SetLastSystemError(0); 42 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 64 Marshal.SetLastSystemError(0); 66 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 112 Marshal.SetLastSystemError(0); 114 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 136 Marshal.SetLastSystemError(0); 138 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 166 Marshal.SetLastSystemError(0); 168 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 190 Marshal.SetLastSystemError(0); 192 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 214 Marshal.SetLastSystemError(0); 216 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 238 Marshal.SetLastSystemError(0); 240 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 284 Marshal.SetLastSystemError(0); 286 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 341 Marshal.SetLastSystemError(0); 343 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
_generated\201\Windows.Win32.PInvokeCore.USER32.dll.g.cs (54)
111 Marshal.SetLastSystemError(0); 113 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 164 Marshal.SetLastSystemError(0); 166 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 218 Marshal.SetLastSystemError(0); 220 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 348 Marshal.SetLastSystemError(0); 350 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 384 Marshal.SetLastSystemError(0); 386 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 416 Marshal.SetLastSystemError(0); 418 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 491 Marshal.SetLastSystemError(0); 493 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 527 Marshal.SetLastSystemError(0); 529 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 633 Marshal.SetLastSystemError(0); 635 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 665 Marshal.SetLastSystemError(0); 667 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 690 Marshal.SetLastSystemError(0); 692 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 734 Marshal.SetLastSystemError(0); 736 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 774 Marshal.SetLastSystemError(0); 776 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 930 Marshal.SetLastSystemError(0); 932 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 965 Marshal.SetLastSystemError(0); 967 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1015 Marshal.SetLastSystemError(0); 1017 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1052 Marshal.SetLastSystemError(0); 1054 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1077 Marshal.SetLastSystemError(0); 1079 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (1)
168Marshal.Copy((nint)buffer, bytes, 0, size);
System\Private\Windows\Ole\DragDropFormat.cs (1)
85Marshal.AddRef(mediumSource.hGlobal);
System\Private\Windows\Ole\DragDropHelper.cs (4)
216throw new Win32Exception(Marshal.GetLastWin32Error(), SR.ExternalException); 223throw new Win32Exception(Marshal.GetLastWin32Error(), SR.ExternalException); 374throw new Win32Exception(Marshal.GetLastWin32Error(), SR.ExternalException); 381throw new Win32Exception(Marshal.GetLastWin32Error(), SR.ExternalException);
Windows\Win32\Foundation\BSTR.cs (2)
10public BSTR(string? value) : this((char*)Marshal.StringToBSTR(value)) 18Marshal.FreeBSTR((nint)Value);
Windows\Win32\Foundation\PWSTR.cs (1)
16Marshal.FreeCoTaskMem((IntPtr)Value);
Windows\Win32\PInvokeCore.GetWindowText.cs (1)
28int error = Marshal.GetLastWin32Error();
Windows\Win32\PInvokeCore.SetWindowLong.cs (1)
36IntPtr pointer = Marshal.GetFunctionPointerForDelegate(dwNewLong);
Windows\Win32\System\Com\ComHelpers.cs (3)
109ccw = (ComUnknown*)Marshal.GetIUnknownForObject(@object); 267using ComScope<ComUnknown> ccw = new((ComUnknown*)(void*)Marshal.GetIUnknownForObject(@object)); 318return Marshal.GetObjectForIUnknown((nint)unknown);
Windows\Win32\System\Com\ComManagedStream.cs (1)
217pstatstg->pwcsName = (char*)Marshal.StringToCoTaskMemUni(_dataStream is FileStream fs ? fs.Name : _dataStream.ToString());
Windows\Win32\System\Com\Lifetime.cs (2)
32Marshal.FreeCoTaskMem((nint)lifetime); 54var wrapper = (Lifetime<TVTable, TObject>*)Marshal.AllocCoTaskMem(sizeof(Lifetime<TVTable, TObject>));
Windows\Win32\System\Variant\VARIANT.cs (8)
167return Marshal.PtrToStringUni(*(IntPtr*)data); 169return Marshal.PtrToStringAnsi(*(IntPtr*)data); 388result[i] = Marshal.PtrToStringUni(data[i]); 597SetValue(array, Marshal.PtrToStringUni(data), indices, lowerBounds); 838result[i] = Marshal.PtrToStringUni(data[i]); 850result[i] = Marshal.PtrToStringAnsi(data[i]); 876=> MemoryMarshal.CreateSpan(ref Unsafe.AsRef<T>(Marshal.UnsafeAddrOfPinnedArrayElement(array, 0).ToPointer()), array.Length); 1023Marshal.GetNativeVariantForObject(value, (nint)(void*)&variant);
Windows\Win32\System\Variant\VARIANTVector.cs (1)
23Marshal.GetNativeVariantForObject(values[i], (IntPtr)(&pVariants[i]));
System.Private.Windows.GdiPlus (3)
System\Drawing\IIconExtensions.cs (1)
37return Marshal.GetObjectForIUnknown(picture);
Windows\Win32\System\Ole\IPicture.cs (2)
16return Marshal.GetObjectForIUnknown(picture); 31return Marshal.GetObjectForIUnknown(picture);
System.Reflection.Metadata (5)
System\Reflection\Internal\MemoryBlocks\NativeHeapMemoryBlock.cs (2)
32_pointer = Marshal.AllocHGlobal(size); 49Marshal.FreeHGlobal(ptr);
System\Reflection\Internal\Utilities\EncodingHelper.cs (1)
48Marshal.Copy((IntPtr)bytes, buffer, prefix.Length, byteCount);
System\Reflection\Metadata\BlobReader.cs (1)
437Marshal.Copy((IntPtr)GetCurrentPointerAndAdvance(byteCount), buffer, bufferOffset, byteCount);
System\Reflection\Metadata\Internal\StringHeap.cs (1)
188Marshal.Copy((IntPtr)block.Pointer, bytes, prefix.Length, block.Length);
System.Runtime.InteropServices (32)
src\runtime\artifacts\obj\System.Runtime.InteropServices\Release\net11.0\System.Runtime.InteropServices.Forwards.cs (1)
110[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.InteropServices.Marshal))]
System\Runtime\InteropServices\ComAwareEventInfo.cs (2)
32if (Marshal.IsComObject(target)) 50if (Marshal.IsComObject(target))
System\Runtime\InteropServices\Marshalling\ComImportInteropInterfaceDetailsStrategy.cs (1)
194/// <remarks>The returned object must be an object such that a call to <see cref="Marshal.IsComObject(object)"/> would return true.</remarks>
System\Runtime\InteropServices\Marshalling\ComInterfaceMarshaller.cs (4)
68Marshal.Release((nint)unmanaged); 79if (Marshal.QueryInterface(unknown, in Nullable.GetValueRefOrDefaultRef(in TargetInterfaceIID), out nint interfacePointer) != 0) 81Marshal.Release(unknown); 84Marshal.Release(unknown);
System\Runtime\InteropServices\Marshalling\ComObject.cs (5)
46_runtimeCallableWrapper = Marshal.GetObjectForIUnknown((nint)thisPointer); 47Debug.Assert(Marshal.IsComObject(_runtimeCallableWrapper)); 99Marshal.ThrowExceptionForHR(qiResult); 111Marshal.ThrowExceptionForHR(qiResult); 157Marshal.ThrowExceptionForHR(qiHResult);
System\Runtime\InteropServices\Marshalling\ComVariantMarshaller.cs (5)
195return Marshal.PtrToStringBSTR(*(IntPtr*)unmanaged.GetRawDataRef<nint>()); 306Marshal.FreeBSTR(bstrStorage); 307bstrStorage = Marshal.StringToBSTR(str); 313Marshal.FreeBSTR(bstrStorage); 314bstrStorage = Marshal.StringToBSTR(str.WrappedObject);
System\Runtime\InteropServices\Marshalling\ExceptionAsDefaultMarshaller.cs (1)
23_ = Marshal.GetHRForException(e);
System\Runtime\InteropServices\Marshalling\ExceptionAsHResultMarshaller.cs (1)
38return T.CreateTruncating(Marshal.GetHRForException(e));
System\Runtime\InteropServices\Marshalling\ExceptionAsNaNMarshaller.cs (1)
25_ = Marshal.GetHRForException(e);
System\Runtime\InteropServices\Marshalling\ExceptionAsVoidMarshaller.cs (1)
25_ = Marshal.GetHRForException(e);
System\Runtime\InteropServices\Marshalling\FreeThreadedStrategy.cs (3)
15Marshal.AddRef((nint)unknown); 21int hr = Marshal.QueryInterface((nint)thisPtr, handle, out nint ppv); 34=> Marshal.Release((nint)thisPtr);
System\Runtime\InteropServices\Marshalling\IIUnknownStrategy.cs (2)
35/// <seealso cref="Marshal.QueryInterface(nint, in Guid, out nint)"/> 43/// <seealso cref="Marshal.Release(nint)"/>
System\Runtime\InteropServices\Marshalling\UniqueComInterfaceMarshaller.cs (1)
70Marshal.Release((nint)unmanaged);
System\Security\SecureStringMarshal.cs (4)
10public static IntPtr SecureStringToCoTaskMemAnsi(SecureString s) => Marshal.SecureStringToCoTaskMemAnsi(s); 11public static IntPtr SecureStringToGlobalAllocAnsi(SecureString s) => Marshal.SecureStringToGlobalAllocAnsi(s); 12public static IntPtr SecureStringToCoTaskMemUnicode(SecureString s) => Marshal.SecureStringToCoTaskMemUnicode(s); 13public static IntPtr SecureStringToGlobalAllocUnicode(SecureString s) => Marshal.SecureStringToGlobalAllocUnicode(s);
System.Runtime.InteropServices.JavaScript (11)
System\Runtime\InteropServices\JavaScript\JSFunctionBinding.cs (1)
442var message = Marshal.PtrToStringUni(exceptionPtr)!;
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Byte.cs (2)
94Marshal.Copy(slot.IntPtrValue, value, 0, slot.Length); 114Marshal.Copy(value, 0, slot.IntPtrValue, slot.Length);
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Double.cs (2)
97Marshal.Copy(slot.IntPtrValue, value, 0, slot.Length); 120Marshal.Copy(value, 0, slot.IntPtrValue, slot.Length);
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Int32.cs (2)
94Marshal.Copy(slot.IntPtrValue, value, 0, slot.Length); 114Marshal.Copy(value, 0, slot.IntPtrValue, slot.Length);
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.Single.cs (2)
97Marshal.Copy(slot.IntPtrValue, value, 0, slot.Length); 120Marshal.Copy(value, 0, slot.IntPtrValue, slot.Length);
System\Runtime\InteropServices\JavaScript\Marshaling\JSMarshalerArgument.String.cs (2)
26value = Marshal.PtrToStringUni(slot.IntPtrValue, slot.Length); 54slot.IntPtrValue = Marshal.StringToHGlobalUni(value); // alloc, JS side will free
System.Security.AccessControl (56)
_generated\0\LibraryImports.g.cs (39)
18global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 20__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 25global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 44global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 46__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 51global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 75global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 77__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 82global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 106global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 108__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 113global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 179global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 181__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 190global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 220global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 222__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 225global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 249global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 251__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 254global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 281global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 283__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 288global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 317global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 319__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 338global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 364global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 366__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 385global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 421global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 423__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 435global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 473global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 475__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 487global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 520global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 522__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 546global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
System\Security\AccessControl\Privilege.cs (6)
100int error = Marshal.GetLastPInvokeError(); 177cachingError = Marshal.GetLastPInvokeError(); 223error = Marshal.GetLastPInvokeError(); 456error = Marshal.GetLastPInvokeError(); 458else if (Interop.Errors.ERROR_NOT_ALL_ASSIGNED == Marshal.GetLastPInvokeError()) 551error = Marshal.GetLastPInvokeError();
System\Security\AccessControl\SecurityDescriptor.cs (3)
623error = Marshal.GetLastPInvokeError(); 657Marshal.Copy(byteArray, binaryForm, 0, (int)byteArraySize); 666Marshal.FreeHGlobal(byteArray);
System\Security\AccessControl\Win32.cs (5)
35errorCode = Marshal.GetLastPInvokeError(); 43resultSddl = Marshal.PtrToStringUni(ByteArray)!; 49Marshal.FreeHGlobal(ByteArray); 187Marshal.Copy(ByteArray, BinaryForm, 0, (int)Length); 189Marshal.FreeHGlobal(ByteArray);
System\Security\Principal\Win32.cs (3)
33hr = Marshal.GetHRForLastWin32Error(); 37hr = Marshal.GetHRForLastWin32Error(); 54hr = Marshal.GetHRForLastWin32Error();
System.Security.Cryptography (372)
_generated\0\LibraryImports.g.cs (249)
23global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 25__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 44global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 66global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 68__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 73global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 109global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 111__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 134global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 171global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 173__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 186global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 222global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 224__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 247global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 266global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 268__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 273global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 292global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 294__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 299global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 336global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 338__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 351global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 386global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 388__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 401global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 433global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 435__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 457global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 479global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 481__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 486global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 518global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 520__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 532global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 562global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 564__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 576global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 607global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 609__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 621global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 649global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 651__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 663global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 693global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 695__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 707global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 737global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 739__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 751global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 783global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 785__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 807global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 837global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 839__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 851global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 887global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 889__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 912global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 931global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 933__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 938global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 968global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 970__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 982global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1012global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1014__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1026global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1058global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1060__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1072global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1107global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1109__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1122global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2501global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2503__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2516global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2548global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2550__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2563global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2582global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2584__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2589global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2617global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2619__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2631global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2659global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2661__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2680global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2699global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2701__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2706global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2730global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2732__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2750global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2774global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2776__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2794global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2818global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2820__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2838global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2862global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2864__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2882global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2909global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2911__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2920global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 2950global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 2952__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 2973global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3000global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3002__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3011global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3028global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3030__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3033global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3078global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3080__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3103global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3134global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3136__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3148global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3178global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3180__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3192global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3224global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3226__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3238global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3270global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3272__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3284global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3314global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3316__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3328global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3350global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3352__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3357global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3386global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3388__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3397global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3430global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3432__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3455global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3474global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3476__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3481global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3512global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3514__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3526global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3544global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3546__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3549global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3575global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3577__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3595global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3625global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3627__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3639global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3670global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3672__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3684global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3712global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3714__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3726global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3745global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3747__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3752global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3780global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3782__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3794global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3826global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3828__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3841global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3869global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3871__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3883global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3906global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3908__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3913global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3933global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3935__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 3938global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 3975global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 3977__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4000global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4023global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4025__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4030global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4052global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4054__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4059global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4080global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4082__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4087global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4118global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4120__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4132global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4154global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4156__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4161global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4192global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4194__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4206global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4228global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4230__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4235global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4261global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4263__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4282global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4301global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4303__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4308global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4340global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4342__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4354global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4384global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4386__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4398global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4430global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4432__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4444global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4474global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4476__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4488global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4527global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4529__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4554global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4576global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4578__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4583global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4612global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4614__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4633global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4662global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4664__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4683global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4733global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4735__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4748global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4780global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4782__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4803global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4829global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4831__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4849global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 4867global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 4869__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 4872global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
Microsoft\Win32\SafeHandles\SafePasswordHandle.cs (4)
29handle = Marshal.StringToHGlobalUni(password); 47handle = Marshal.AllocHGlobal(spanLen * sizeof(char)); 68handle = Marshal.SecureStringToGlobalAllocUnicode(password); 77Marshal.ZeroFreeGlobalAllocUnicode(handle);
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.CRYPT_BIT_BLOB.cs (1)
22Marshal.Copy(pbData, data, 0, numBytes);
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.DATA_BLOB.cs (1)
31Marshal.Copy(pbData, array, 0, (int)cbData);
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.FindOidInfo.cs (5)
28return Marshal.PtrToStringAnsi(pszOID); 36return Marshal.PtrToStringUni(pwszName); 62rawKey = Marshal.StringToCoTaskMemAnsi(key); 66rawKey = Marshal.StringToCoTaskMemUni(key); 110Marshal.FreeCoTaskMem(rawKey);
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (2)
56if (Marshal.GetLastWin32Error() == ERROR_INSUFFICIENT_BUFFER) 69Marshal.FreeHGlobal(nativeMsgPtr);
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.NCryptDeriveKeyMaterial.cs (2)
56hashAlgorithmString = Marshal.StringToCoTaskMemUni(hashAlgorithm); 122Marshal.FreeCoTaskMem(hashAlgorithmString);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeCertContextHandleWithKeyContainerDeletion.cs (2)
51string providerName = Marshal.PtrToStringUni((IntPtr)(pProvInfo->pwszProvName))!; 52string keyContainerName = Marshal.PtrToStringUni((IntPtr)(pProvInfo->pwszContainerName))!;
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeUnicodeStringHandle.cs (3)
21handle = Marshal.StringToHGlobalUni(s); 36handle = Marshal.AllocHGlobal(cb); 54Marshal.FreeHGlobal(handle);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.cs (1)
138string valueAsString = Marshal.PtrToStringUni((IntPtr)pValue)!;
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.EncryptDecrypt.cs (4)
93IntPtr namePtr = Marshal.StringToHGlobalUni(padding.OaepHashAlgorithm.Name); 108Marshal.FreeHGlobal(namePtr); 175IntPtr namePtr = Marshal.StringToHGlobalUni(padding.OaepHashAlgorithm.Name); 188Marshal.FreeHGlobal(namePtr);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.SignVerify.cs (6)
56IntPtr namePtr = Marshal.StringToHGlobalUni(hashAlgorithmName); 79Marshal.FreeHGlobal(namePtr); 97IntPtr namePtr = Marshal.StringToHGlobalUni(hashAlgorithmName); 116Marshal.FreeHGlobal(namePtr); 145IntPtr namePtr = Marshal.StringToHGlobalUni(hashAlgorithmName); 164Marshal.FreeHGlobal(namePtr);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\CertificateHelpers.Windows.cs (3)
223int dwErrorCode = Marshal.GetLastPInvokeError(); 241ProviderName = Marshal.PtrToStringUni((IntPtr)(pKeyProvInfo->pwszProvName)), 242KeyContainerName = Marshal.PtrToStringUni((IntPtr)(pKeyProvInfo->pwszContainerName)),
System\Security\Cryptography\CapiHelper.Windows.cs (17)
302IntPtr password = Marshal.SecureStringToCoTaskMemAnsi(parameters.KeyPassword); 319Marshal.ZeroFreeCoTaskMemAnsi(password); 767return Marshal.GetLastPInvokeError(); 989int hr = Marshal.GetHRForLastWin32Error(); 1163int hr = Marshal.GetHRForLastWin32Error(); 1170int hr = Marshal.GetHRForLastWin32Error(); 1243int hr = Marshal.GetHRForLastWin32Error(); 1250int hr = Marshal.GetHRForLastWin32Error(); 1257int hr = Marshal.GetHRForLastWin32Error(); 1270int hr = Marshal.GetHRForLastWin32Error(); 1278int hr = Marshal.GetHRForLastWin32Error(); 1310int hr = Marshal.GetHRForLastWin32Error(); 1318int hr = Marshal.GetHRForLastWin32Error(); 1326int hr = Marshal.GetHRForLastWin32Error(); 1378int hr = Marshal.GetHRForLastWin32Error(); 1391int hr = Marshal.GetHRForLastWin32Error(); 1407int hr = Marshal.GetHRForLastWin32Error();
System\Security\Cryptography\CngAsnFormatter.cs (2)
26IntPtr oidValuePtr = Marshal.StringToHGlobalAnsi(oidValue); 47Marshal.FreeHGlobal(oidValuePtr);
System\Security\Cryptography\CngKey.OpenHandle.cs (1)
38Marshal.InitHandle(providerHandle, rawProviderHandle);
System\Security\Cryptography\CngKey.StandardProperties.cs (3)
368friendlyName = Marshal.PtrToStringUni(pNcryptUiPolicy->pszFriendlyName); 369description = Marshal.PtrToStringUni(pNcryptUiPolicy->pszDescription); 370creationTitle = Marshal.PtrToStringUni(pNcryptUiPolicy->pszCreationTitle);
System\Security\Cryptography\X509Certificates\CertificateHelpers.Windows.cs (1)
14Marshal.GetLastPInvokeError().ToCryptographicException();
System\Security\Cryptography\X509Certificates\CertificatePal.Windows.cs (13)
69throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); 73throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); 86return Marshal.PtrToStringAnsi(certContext->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId)!; 100string keyAlgorithmOid = Marshal.PtrToStringAnsi(pCertContext->pCertInfo->SubjectPublicKeyInfo.Algorithm.pszObjId)!; 158throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); 160throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); 165throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); 214return Marshal.PtrToStringAnsi(pCertContext->pCertInfo->SignatureAlgorithm.pszObjId)!; 283throw Marshal.GetLastPInvokeError().ToCryptographicException(); 317IntPtr pFriendlyName = Marshal.StringToHGlobalUni(friendlyName); 322throw Marshal.GetLastPInvokeError().ToCryptographicException(); 326Marshal.FreeHGlobal(pFriendlyName); 384string oidValue = Marshal.PtrToStringAnsi(pCertExtension->pszObjId)!;
System\Security\Cryptography\X509Certificates\CertificatePal.Windows.Import.cs (5)
64int hr = Marshal.GetHRForLastWin32Error(); 127throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); 134throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); 139throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); 152Exception e = Marshal.GetHRForLastWin32Error().ToCryptographicException();
System\Security\Cryptography\X509Certificates\CertificatePal.Windows.PrivateKey.cs (1)
276Exception e = Marshal.GetLastPInvokeError().ToCryptographicException();
System\Security\Cryptography\X509Certificates\ChainPal.Windows.cs (2)
55int errorCode = Marshal.GetLastPInvokeError(); 79string information = Marshal.PtrToStringUni(pChainElement->pwszExtendedErrorInfo)!;
System\Security\Cryptography\X509Certificates\FindPal.Windows.cs (5)
144string? actual = Marshal.PtrToStringAnsi(pTemplateExt->pszObjId); 243string actual = Marshal.PtrToStringAnsi(pOids[i])!; 265string actual = Marshal.PtrToStringAnsi(pCertPolicyInfo->pszPolicyIdentifier)!; 402Exception e = Marshal.GetHRForLastWin32Error().ToCryptographicException(); 426throw Marshal.GetLastPInvokeError().ToCryptographicException();
System\Security\Cryptography\X509Certificates\LegacyBasicConstraintsDecoder.Windows.cs (1)
28return ((Marshal.ReadByte(pBasicConstraints->SubjectType.pbData) & CERT_BASIC_CONSTRAINTS_INFO.CERT_CA_SUBJECT_FLAG) != 0,
System\Security\Cryptography\X509Certificates\SafeLocalAllocHandle.cs (2)
17h.SetHandle(Marshal.AllocHGlobal(cb)); 23Marshal.FreeHGlobal(handle);
System\Security\Cryptography\X509Certificates\StorePal.Windows.cs (2)
55throw Marshal.GetLastPInvokeError().ToCryptographicException(); 74throw Marshal.GetLastPInvokeError().ToCryptographicException();
System\Security\Cryptography\X509Certificates\StorePal.Windows.Export.cs (7)
42Marshal.Copy((IntPtr)(pCertContext.DangerousCertContext->pbCertEncoded), rawData, 0, rawData.Length); 63throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); 67throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); 145throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); 156throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); 257throw Marshal.GetLastPInvokeError().ToCryptographicException(); 264throw Marshal.GetLastPInvokeError().ToCryptographicException();
System\Security\Cryptography\X509Certificates\StorePal.Windows.Import.cs (5)
54Exception e = Marshal.GetLastPInvokeError().ToCryptographicException(); 136Exception e = Marshal.GetHRForLastWin32Error().ToCryptographicException(); 164throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); 178throw Marshal.GetLastPInvokeError().ToCryptographicException(); 199Exception e = Marshal.GetLastPInvokeError().ToCryptographicException();
System\Security\Cryptography\X509Certificates\WindowsHelpers.cs (4)
94throw Marshal.GetLastPInvokeError().ToCryptographicException(); 116throw Marshal.GetLastPInvokeError().ToCryptographicException(); 140throw Marshal.GetLastPInvokeError().ToCryptographicException(); 162throw Marshal.GetLastPInvokeError().ToCryptographicException();
System\Security\Cryptography\X509Certificates\WindowsInterop.crypt32.cs (8)
29throw Marshal.GetLastPInvokeError().ToCryptographicException(); 37throw Marshal.GetLastPInvokeError().ToCryptographicException(); 70Marshal.InitHandle(pCertContext, (IntPtr)Crypt32.CertEnumCertificatesInStore(hCertStore, pPrevCertContext)); 108throw Marshal.GetLastPInvokeError().ToCryptographicException(); 112throw Marshal.GetLastPInvokeError().ToCryptographicException(); 121throw Marshal.GetLastPInvokeError().ToCryptographicException(); 125throw Marshal.GetLastPInvokeError().ToCryptographicException(); 134Exception e = Marshal.GetLastPInvokeError().ToCryptographicException();
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Windows.cs (2)
204throw Marshal.GetHRForLastWin32Error().ToCryptographicException(); 272Exception e = Marshal.GetHRForLastWin32Error().ToCryptographicException();
System\Security\Cryptography\X509Certificates\X509Pal.Windows.GetCertContentType.cs (2)
37throw Marshal.GetLastPInvokeError().ToCryptographicException(); 66throw Marshal.GetLastPInvokeError().ToCryptographicException();
System\Security\Cryptography\X509Certificates\X509Pal.Windows.PublicKey.cs (4)
145Exception e = Marshal.GetHRForLastWin32Error().ToCryptographicException(); 205throw Marshal.GetLastPInvokeError().ToCryptographicException(); 209throw Marshal.GetLastPInvokeError().ToCryptographicException(); 341string? valueAsString = Marshal.PtrToStringUni((IntPtr)pValue);
System\Security\Cryptography\X509Certificates\X509Pal.Windows.X500DistinguishedName.cs (2)
51throw Marshal.GetLastPInvokeError().ToCryptographicException(); 55throw Marshal.GetLastPInvokeError().ToCryptographicException();
System.Security.Cryptography.Pkcs (140)
_generated\0\LibraryImports.g.cs (93)
24global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 26__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 45global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 65global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 67__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 72global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 92global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 94__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 99global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 128global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 130__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 142global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 173global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 175__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 187global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 218global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 220__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 232global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 252global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 254__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 259global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 278global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 280__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 283global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 303global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 305__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 310global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 342global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 344__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 356global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 387global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 389__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 401global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 434global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 436__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 448global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 481global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 483__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 495global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 516global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 518__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 521global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 540global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 542__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 545global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 581global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 583__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 596global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 618global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 620__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 625global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 648global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 650__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 655global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 675global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 677__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 682global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 713global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 715__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 727global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 758global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 760__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 772global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 805global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 807__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 819global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 850global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 852__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 864global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 897global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 899__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 911global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 942global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 944__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 956global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 981global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 983__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1001global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1032global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1034__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1055global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1088global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1090__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1102global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1133global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1135__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1147global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1180global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1182__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1194global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1221global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1223__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1226global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
Internal\Cryptography\Pal\Windows\DecryptorPalWindows.Decode.cs (2)
33throw Marshal.GetLastPInvokeError().ToCryptographicException(); 41throw Marshal.GetLastPInvokeError().ToCryptographicException();
Internal\Cryptography\Pal\Windows\DecryptorPalWindows.DecodeRecipients.cs (1)
22throw Marshal.GetLastPInvokeError().ToCryptographicException();
Internal\Cryptography\Pal\Windows\DecryptorPalWindows.Decrypt.cs (4)
140ErrorCode errorCode = (ErrorCode)(Marshal.GetLastPInvokeError()); 152ErrorCode errorCode = (ErrorCode)(Marshal.GetLastPInvokeError()); 182return Marshal.GetHRForLastWin32Error().ToCryptographicException(); 264ErrorCode errorCode = (ErrorCode)(Marshal.GetHRForLastWin32Error());
Internal\Cryptography\Pal\Windows\HeapBlockRetainer.cs (1)
61Marshal.Copy(data, 0, pData, data.Length);
Internal\Cryptography\Pal\Windows\HelpersWindows.cs (20)
29return Marshal.PtrToStringAnsi(psz)!; 37throw Marshal.GetLastPInvokeError().ToCryptographicException(); 43throw Marshal.GetLastPInvokeError().ToCryptographicException(); 55throw Marshal.GetLastPInvokeError().ToCryptographicException(); 61Exception e = Marshal.GetLastPInvokeError().ToCryptographicException(); 76Marshal.Copy(blob.pbData, data, 0, length); 85throw Marshal.GetLastPInvokeError().ToCryptographicException(); 94throw Marshal.GetLastPInvokeError().ToCryptographicException(); 129throw Marshal.GetLastPInvokeError().ToCryptographicException(); 162throw Marshal.GetLastPInvokeError().ToCryptographicException(); 166throw Marshal.GetLastPInvokeError().ToCryptographicException(); 187throw Marshal.GetLastPInvokeError().ToCryptographicException(); 196throw Marshal.GetLastPInvokeError().ToCryptographicException(); 273throw Marshal.GetLastPInvokeError().ToCryptographicException(); 342int lastError = Marshal.GetLastPInvokeError(); 379throw Marshal.GetLastPInvokeError().ToCryptographicException(); 393throw Marshal.GetLastPInvokeError().ToCryptographicException(); 455throw Marshal.GetLastPInvokeError().ToCryptographicException(); 460throw Marshal.GetLastPInvokeError().ToCryptographicException(); 468return Marshal.PtrToStringAnsi((IntPtr)asciiPtr, len);
Internal\Cryptography\Pal\Windows\PkcsPalWindows.cs (4)
34throw Marshal.GetLastPInvokeError().ToCryptographicException(); 37throw Marshal.GetLastPInvokeError().ToCryptographicException(); 42throw Marshal.GetLastPInvokeError().ToCryptographicException(); 241exception = Marshal.GetHRForLastWin32Error().ToCryptographicException();
Internal\Cryptography\Pal\Windows\PkcsPalWindows.Encrypt.cs (2)
48throw Marshal.GetLastPInvokeError().ToCryptographicException(); 123Exception e = Marshal.GetLastPInvokeError().ToCryptographicException();
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.CRYPT_BIT_BLOB.cs (1)
22Marshal.Copy(pbData, data, 0, numBytes);
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.CryptEncodeDecodeWrappers.cs (4)
33throw Marshal.GetLastPInvokeError().ToCryptographicException(); 39Exception e = Marshal.GetLastPInvokeError().ToCryptographicException(); 52throw Marshal.GetLastPInvokeError().ToCryptographicException(); 58throw Marshal.GetLastPInvokeError().ToCryptographicException();
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.DATA_BLOB.cs (1)
31Marshal.Copy(pbData, array, 0, (int)cbData);
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.FindOidInfo.cs (5)
28return Marshal.PtrToStringAnsi(pszOID); 36return Marshal.PtrToStringUni(pwszName); 62rawKey = Marshal.StringToCoTaskMemAnsi(key); 66rawKey = Marshal.StringToCoTaskMemUni(key); 110Marshal.FreeCoTaskMem(rawKey);
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (2)
56if (Marshal.GetLastWin32Error() == ERROR_INSUFFICIENT_BUFFER) 69Marshal.FreeHGlobal(nativeMsgPtr);
System.Security.Cryptography.ProtectedData (14)
_generated\0\LibraryImports.g.cs (9)
20global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 22__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 27global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 52global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 54__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 59global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 78global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 80__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 83global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.DATA_BLOB.cs (1)
31Marshal.Copy(pbData, array, 0, (int)cbData);
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (2)
56if (Marshal.GetLastWin32Error() == ERROR_INSUFFICIENT_BUFFER) 69Marshal.FreeHGlobal(nativeMsgPtr);
System\Security\Cryptography\ProtectedData.cs (2)
363int lastWin32Error = Marshal.GetLastPInvokeError(); 405Marshal.FreeHGlobal(outputBlob.pbData);
System.Security.Principal.Windows (114)
_generated\0\LibraryImports.g.cs (72)
36global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 38__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 57global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 79global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 81__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 86global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 121global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 123__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 136global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 167global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 169__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 181global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 214global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 216__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 240global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 269global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 271__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 290global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 309global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 311__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 316global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 343global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 345__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 363global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 381global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 383__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 386global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 436global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 438__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 472global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 508global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 510__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 534global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 552global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 554__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 557global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 575global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 577__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 580global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 608global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 610__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 628global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 650global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 652__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 655global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 677global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 679__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 682global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 703global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 705__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 710global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 732global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 734__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 737global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 757global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 759__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 762global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 785global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 787__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 792global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 821global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 823__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 842global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 861global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 863__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 868global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 896global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 898__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 910global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 1126global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 1128__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 1141global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaLookupNames2.cs (3)
39m.Buffer = Marshal.PtrToStringUni(unmanaged.Buffer)!; 48n.Buffer = Marshal.StringToCoTaskMemUni(managed.Buffer); 54Marshal.FreeCoTaskMem(native.Buffer);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaLookupSids.cs (1)
30referencedDomains.Initialize((uint)Marshal.SizeOf<Interop.LSA_REFERENCED_DOMAIN_LIST>());
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLocalAllocHandle.cs (2)
18h.SetHandle(Marshal.AllocHGlobal(cb)); 39Marshal.FreeHGlobal(handle);
System\Security\Principal\SID.cs (3)
612throw new ArgumentException(Marshal.GetPInvokeErrorMessage(error), "sidType/domainSid"); 1038ReferencedDomains[i] = Marshal.PtrToStringUni(ti->Name.Buffer, ti->Name.Length / sizeof(char)); 1055string account = Marshal.PtrToStringUni(Ltn.Name.Buffer, Ltn.Name.Length / sizeof(char));
System\Security\Principal\Win32.cs (7)
60byte Revision = Marshal.ReadByte(binaryForm, 0); 71byte SubAuthorityCount = Marshal.ReadByte(binaryForm, 1); 90Marshal.Copy(binaryForm, ResultSid, 0, BinaryLength); 112ErrorCode = Marshal.GetLastPInvokeError(); 124Marshal.FreeHGlobal((IntPtr)pSid); 166return Marshal.GetLastPInvokeError(); 221return Marshal.GetLastPInvokeError();
System\Security\Principal\WindowsIdentity.cs (24)
147throw new SecurityException(Marshal.GetLastPInvokeErrorMessage()); 180Marshal.Copy(upnBytes, 0, pKerbS4uLogin->ClientUpn.Buffer, upnBytes.Length); 272Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_INVALID_HANDLE) 288throw new SecurityException(Marshal.GetLastPInvokeErrorMessage()); 401return Marshal.PtrToStringUni(logonSessionData.AuthenticationPackage.Buffer); 491throw new SecurityException(Marshal.GetLastPInvokeErrorMessage()); 499throw new SecurityException(Marshal.GetLastPInvokeErrorMessage()); 759throw new SecurityException(Marshal.GetPInvokeErrorMessage(hr)); 780Environment.FailFast(Marshal.GetLastPInvokeErrorMessage()); 800Environment.FailFast(Marshal.GetLastPInvokeErrorMessage()); 805Environment.FailFast(Marshal.GetLastPInvokeErrorMessage()); 823throw new SecurityException(Marshal.GetPInvokeErrorMessage(hr)); 849return new SecurityException(Marshal.GetPInvokeErrorMessage((int)win32ErrorCode)); 859hr = Marshal.GetHRForLastWin32Error(); 879hr = GetHRForWin32Error(Marshal.GetLastPInvokeError()); 919int dwErrorCode = Marshal.GetLastPInvokeError(); 934throw new SecurityException(Marshal.GetLastPInvokeErrorMessage()); 951throw new SecurityException(Marshal.GetPInvokeErrorMessage(dwErrorCode)); 1259string name = Marshal.PtrToStringUni(windowsClaim.Name)!; 1266Marshal.Copy(windowsClaim.Values.ppString, stringPointers, 0, (int)windowsClaim.ValueCount); 1270Claim c = new Claim(name, Marshal.PtrToStringUni(stringPointers[item])!, ClaimValueTypes.String, _issuerName, _issuerName, this); 1278Marshal.Copy(windowsClaim.Values.pInt64, intValues, 0, (int)windowsClaim.ValueCount); 1291Marshal.Copy(windowsClaim.Values.pUint64, uintValues, 0, (int)windowsClaim.ValueCount); 1303Marshal.Copy(windowsClaim.Values.pUint64, boolValues, 0, (int)windowsClaim.ValueCount);
System\Security\Principal\WindowsPrincipal.cs (2)
160throw new SecurityException(Marshal.GetLastPInvokeErrorMessage()); 171throw new SecurityException(Marshal.GetLastPInvokeErrorMessage());
System.ServiceProcess.ServiceController (75)
_generated\0\LibraryImports.g.cs (43)
14global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 16__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 21global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 50global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 52__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 64global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 96global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 98__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 110global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 146global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 148__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 160global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 192global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 194__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 206global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 238global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 240__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 252global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 274global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 276__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 279global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 309global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 311__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 320global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 352global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 354__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 366global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 395global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 397__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 409global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 438global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 440__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 452global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 472global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 474__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 479global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 499__callback_native = callback != null ? global::System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(callback) : default; 503global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 505__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 510global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 530global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 532__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 537global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
System\ServiceProcess\ServiceBase.cs (8)
584IntPtr entriesPointer = Marshal.AllocHGlobal(checked((services.Length + 1) * sizeof(SERVICE_TABLE_ENTRY))); 637Marshal.FreeHGlobal(entries[i].name); 641Marshal.FreeHGlobal(entriesPointer); 702callback = Marshal.GetFunctionPointerForDelegate(_mainCallback!), 703name = Marshal.StringToHGlobalUni(_serviceName) 722Marshal.PtrToStructure(eventData, sessionNotification); 867_serviceName = Marshal.PtrToStringUni((IntPtr)(*argsAsPtr))!; 876args[index] = Marshal.PtrToStringUni((IntPtr)(*argsAsPtr))!;
System\ServiceProcess\ServiceController.cs (24)
198int lastError = Marshal.GetLastPInvokeError(); 203IntPtr enumBuffer = Marshal.AllocHGlobal((IntPtr)bytesNeeded); 219IntPtr structPtr = (IntPtr)(pEnumBuffer + ((nint)i * Marshal.SizeOf<Interop.Advapi32.ENUM_SERVICE_STATUS>())); 220Marshal.PtrToStructure(structPtr, status); 226Marshal.FreeHGlobal(enumBuffer); 312int lastError = Marshal.GetLastPInvokeError(); 317IntPtr bufPtr = Marshal.AllocHGlobal((IntPtr)bytesNeeded); 325Marshal.PtrToStructure(bufPtr, config); 376Marshal.FreeHGlobal(bufPtr); 391int lastError = Marshal.GetLastPInvokeError(); 396IntPtr bufPtr = Marshal.AllocHGlobal((IntPtr)bytesNeeded); 404Marshal.PtrToStructure(bufPtr, config); 411Marshal.FreeHGlobal(bufPtr); 581int lastError = Marshal.GetLastPInvokeError(); 612int lastError = Marshal.GetLastPInvokeError(); 632Marshal.InitHandle(databaseHandle, machineName.Equals(DefaultMachineName) || machineName.Length == 0 ? 686Marshal.InitHandle(serviceHandle, Interop.Advapi32.OpenService(_serviceManagerHandle, ServiceName, desiredAccess)); 761IntPtr memory = Marshal.AllocHGlobal((IntPtr)bytesNeeded); 786IntPtr structPtr = (IntPtr)(pMemory + ((nint)i * Marshal.SizeOf<Interop.Advapi32.ENUM_SERVICE_STATUS_PROCESS>())); 788Marshal.PtrToStructure(structPtr, status); 794Marshal.FreeHGlobal(memory); 883argPtrs[i] = Marshal.StringToHGlobalUni(args[i]); 889Marshal.FreeHGlobal(argPtrs[i]); 907Marshal.FreeHGlobal(argPtrs[i]);
System.Speech (133)
_generated\0\LibraryImports.g.cs (1)
54__dwCallback_native = dwCallback != null ? global::System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(dwCallback) : default;
AudioFormat\AudioFormatConverter.cs (3)
17WaveFormatEx waveFormatEx = Marshal.PtrToStructure<WaveFormatEx>(waveFormatPtr)!; 20IntPtr extraDataPtr = new(waveFormatPtr.ToInt64() + Marshal.SizeOf<WaveFormatEx>()); 23extraData[i] = Marshal.ReadByte(extraDataPtr, i);
Internal\HGlobalSafeHandle.cs (3)
42SetHandle(Marshal.AllocHGlobal(size)); 46SetHandle(Marshal.ReAllocHGlobal(handle, (IntPtr)size)); 85Marshal.FreeHGlobal(handle);
Internal\ObjectToken\ObjectToken.cs (3)
54Marshal.ReleaseComObject(sapiObjectToken); 69Marshal.ReleaseComObject(_sapiObjectToken); 223ppszCoMemTokenId = Marshal.StringToCoTaskMemUni(Id);
Internal\ObjectToken\ObjectTokenCategory.cs (2)
76Marshal.ReleaseComObject(enumTokens); 80Marshal.ReleaseComObject(category);
Internal\ObjectToken\RegistryDataKey.cs (3)
131tokenId = Marshal.PtrToStringUni(sapiTokenId); 136Marshal.FreeCoTaskMem(sapiTokenId); 435Marshal.ReleaseComObject(_sapiRegKey);
Internal\SapiInterop\SapiGrammar.cs (1)
22Marshal.ReleaseComObject(_sapiGrammar);
Internal\SapiInterop\SapiProxy.cs (2)
103Marshal.ReleaseComObject(_recognizer); 199Invoke2(delegate { Marshal.ReleaseComObject(_recognizer); });
Internal\SapiInterop\SapiRecoContext.cs (1)
24_proxy.Invoke2(delegate { Marshal.ReleaseComObject(_recoContext); });
Internal\SapiInterop\SapiRecognizer.cs (4)
39Marshal.ReleaseComObject(recognizer); 109string tokenId = Marshal.PtrToStringUni(sapiTokenId)!; 115Marshal.FreeCoTaskMem(sapiTokenId); 119Marshal.ReleaseComObject(sapiObjectToken);
Internal\SapiInterop\SapiRecoInterop.cs (4)
453int size = Marshal.SizeOf<SPPHRASEELEMENT>(); 456coMem = Marshal.AllocCoTaskMem(size * elements.Length); 499Marshal.StructureToPtr<SPPHRASEELEMENT>(elements[i], new IntPtr((long)coMem + size * i), false); 508spPhrase.cbSize = (uint)Marshal.SizeOf<SPPHRASE>();
Internal\SapiInterop\SpAudioStreamWrapper.cs (2)
63format = Marshal.AllocCoTaskMem(_wfx.Length); 64Marshal.Copy(_wfx, 0, format, _wfx.Length);
Internal\SapiInterop\SpeechEvent.cs (2)
63Marshal.Release((IntPtr)_lParam); 69Marshal.FreeCoTaskMem((IntPtr)_lParam);
Internal\SapiInterop\SpStreamWrapper.cs (2)
52Marshal.WriteIntPtr(pcbRead, new IntPtr(read)); 67Marshal.WriteIntPtr(plibNewPosition, new IntPtr(_stream.Position));
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 (16)
30int sizeOfOne = Marshal.SizeOf<T>(); 36Marshal.Copy(ab, 0, buffer, sizeObject); 39ao[i] = Marshal.PtrToStructure<T>((nint)buffer + (nint)i * sizeOfOne); 46int sizeOfOne = Marshal.SizeOf<T>(); 53Marshal.StructureToPtr<T>(ao[i], (nint)buffer + (nint)i * sizeOfOne, false); 56Marshal.Copy(buffer, ab, 0, sizeObject); 70Marshal.Copy(ab, 0, buffer, sizeObject); 71Marshal.Copy(buffer, ach, 0, c); 109Marshal.Copy(ach, 0, buffer, c); 110Marshal.Copy(buffer, ab, 0, sizeObject); 118int sizeObject = Marshal.SizeOf<T>(); 123Marshal.Copy(ab, 0, buffer, sizeObject); 124Marshal.PtrToStructure<T>(buffer, o); 130int sizeObject = Marshal.SizeOf<T>(); 134Marshal.StructureToPtr<T>(o, buffer, false); 135Marshal.Copy(buffer, ab, 0, sizeObject);
Internal\Synthesis\AudioBase.cs (15)
46Marshal.Copy(pBuff, buffer, 0, cb); 239int cRiff = Marshal.SizeOf<RIFFHDR>(); 240int cBlock = Marshal.SizeOf<BLOCKHDR>(); 242int cDataHdr = Marshal.SizeOf<DATAHDR>(); 383wfx.wFormatTag = Marshal.ReadInt16(ptr); 384wfx.nChannels = Marshal.ReadInt16(ptr, 2); 385wfx.nSamplesPerSec = Marshal.ReadInt32(ptr, 4); 386wfx.nAvgBytesPerSec = Marshal.ReadInt32(ptr, 8); 387wfx.nBlockAlign = Marshal.ReadInt16(ptr, 12); 388wfx.wBitsPerSample = Marshal.ReadInt16(ptr, 14); 389wfx.cbSize = Marshal.ReadInt16(ptr, 16); 405avgBytesPerSec = Marshal.ReadInt32(ptr, 8); 406nBlockAlign = Marshal.ReadInt16(ptr, 12); 424int cbSize = Marshal.ReadInt16(waveHeader, 16); 426Marshal.Copy(waveHeader, ab, 0, 18 + cbSize);
Internal\Synthesis\AudioDeviceOut.cs (1)
314Interop.WinMM.MMSYSERR result = Interop.WinMM.waveOutGetDevCaps((IntPtr)deviceId, ref caps, Marshal.SizeOf<Interop.WinMM.WAVEOUTCAPS>());
Internal\Synthesis\EngineSite.cs (1)
295string? bookmark = Marshal.PtrToStringUni(sapiEvent.Param2);
Internal\Synthesis\TTSEngineProxy.cs (1)
198Marshal.ReleaseComObject(_sapiEngine);
Internal\Synthesis\TTSVoice.cs (1)
117Marshal.FreeCoTaskMem(waveFormat);
Internal\Synthesis\VoiceSynthesis.cs (2)
1620Marshal.Release(_iSite); 1696_iSite = Marshal.GetComInterfaceForObject(_siteSapi, typeof(ISpEngineSite));
Internal\Synthesis\WaveHeader.cs (1)
89return Marshal.SizeOf<Interop.WinMM.WAVEHDR>();
Recognition\RecognizerBase.cs (9)
809Marshal.ReleaseComObject(token); 818Marshal.ReleaseComObject(category); 907Marshal.ThrowExceptionForHR((int)errorCode); 1920Marshal.FreeCoTaskMem(data); 2524ISpRecoResult sapiResult = (ISpRecoResult)Marshal.GetObjectForIUnknown((IntPtr)speechEvent.LParam); 2535uint sizeOfSerializedBlob = (uint)Marshal.ReadInt32(coMemSerializeBlob); 2537Marshal.Copy(coMemSerializeBlob, serializedBlob, 0, (int)sizeOfSerializedBlob); 2541Marshal.FreeCoTaskMem(coMemSerializeBlob); 2605Marshal.FreeCoTaskMem(waveFormatPtr);
Result\RecognitionResult.cs (12)
161SPWAVEFORMATEX audioHeader = Marshal.PtrToStructure<SPWAVEFORMATEX>(audioBuffer)!; 165Marshal.Copy(rawDataBuffer, rawAudioData, 0, audioLength - (int)audioHeader.cbUsed); 171Marshal.Copy(codecDataBuffer, formatSpecificData, 0, audioHeader.cbSize); 301int headerSize = Marshal.ReadInt32(buffer, 4); // Read header size directly from buffer - 4 is the offset of cbHeaderSize. 303if (headerSize == Marshal.SizeOf<SPRESULTHEADER_Sapi51>()) // SAPI 5.1 size 305SPRESULTHEADER_Sapi51 legacyHeader = Marshal.PtrToStructure<SPRESULTHEADER_Sapi51>(buffer)!; 311_header = Marshal.PtrToStructure<SPRESULTHEADER>(buffer)!; 362int sizeOfSpSerializedPhraseAlt = Marshal.SizeOf<SPSERIALIZEDPHRASEALT>(); 367SPSERIALIZEDPHRASEALT alt = Marshal.PtrToStructure<SPSERIALIZEDPHRASEALT>(altBuffer)!; 437ISpPhraseAlt phraseAlt = (ISpPhraseAlt)Marshal.GetObjectForIUnknown(sapiAlternates[i]); 461Marshal.FreeCoTaskMem(coMemSerializedPhrase); 466Marshal.Release(sapiAlternates[i]);
Result\RecognizedPhrase.cs (29)
164int sizeofPhraseElement = Marshal.SizeOf<SPSERIALIZEDPHRASEELEMENT>(); 173SPSERIALIZEDPHRASEELEMENT element = Marshal.PtrToStructure<SPSERIALIZEDPHRASEELEMENT>(elementBuffer)!; 179displayForm = Marshal.PtrToStringUni(displayFormBuffer); 184lexicalForm = Marshal.PtrToStringUni(lexicalFormBuffer); 190pronunciation = Marshal.PtrToStringUni(pronunciationBuffer)!; 297for (int i = 0; i < _serializedPhrase.cReplacements; i++, itnBuffer = (nint)itnBuffer + Marshal.SizeOf<SPPHRASEREPLACEMENT>()) 299SPPHRASEREPLACEMENT replacement = Marshal.PtrToStructure<SPPHRASEREPLACEMENT>(itnBuffer)!; 300string text = Marshal.PtrToStringUni(new IntPtr((long)buffer + replacement.pszReplacementText))!; 330serializedPhrase = Marshal.PtrToStructure<SPSERIALIZEDPHRASE>(phraseBuffer); 334SPSERIALIZEDPHRASE_Sapi51? legacyPhrase = Marshal.PtrToStructure<SPSERIALIZEDPHRASE_Sapi51>(phraseBuffer); 360Marshal.Copy(phraseBuffer, _phraseBuffer, 0, phraseLength); 546SPSERIALIZEDPHRASEPROPERTY property = Marshal.PtrToStructure<SPSERIALIZEDPHRASEPROPERTY>(propertyBuffer)!; 579Marshal.PtrToStructure<SPSERIALIZEDPHRASEPROPERTY>(propertyBuffer)!; 668propertyName = Marshal.PtrToStringUni(nameBuffer)!; 679propertyValue = Marshal.PtrToStringUni(valueStringBuffer)!; 696propertyValue = Marshal.ReadInt32(valueBuffer); 700propertyValue = Marshal.PtrToStructure<uint>(valueBuffer); 704propertyValue = Marshal.ReadInt64(valueBuffer); 708propertyValue = Marshal.PtrToStructure<ulong>(valueBuffer); 712propertyValue = Marshal.PtrToStructure<float>(valueBuffer); 716propertyValue = Marshal.PtrToStructure<double>(valueBuffer); 720propertyValue = (Marshal.ReadByte(valueBuffer) != 0); 745string name = Marshal.PtrToStringUni(nameBuffer)!; 759SPSERIALIZEDPHRASERULE ruleNext = Marshal.PtrToStructure<SPSERIALIZEDPHRASERULE>(elementBuffer)!; 767SPSERIALIZEDPHRASERULE ruleFirst = Marshal.PtrToStructure<SPSERIALIZEDPHRASERULE>(elementBuffer)!; 787SPSEMANTICERRORINFO semanticError = Marshal.PtrToStructure<SPSEMANTICERRORINFO>((nint)smlBuffer + (nint)_serializedPhrase.SemanticErrorInfoOffset)!; 789string? source = Marshal.PtrToStringUni((nint)smlBuffer + (nint)semanticError.pszSourceOffset); 790string? description = Marshal.PtrToStringUni((nint)smlBuffer + (nint)semanticError.pszDescriptionOffset); 791string? script = Marshal.PtrToStringUni((nint)smlBuffer + (nint)semanticError.pszScriptLineOffset);
System.Text.Encoding.CodePages (2)
Microsoft\Win32\SafeHandles\SafeAllocHHandle.cs (1)
28Marshal.FreeHGlobal(handle);
System\Text\BaseCodePageEncoding.cs (1)
369byte* pNativeMemory = (byte*)Marshal.AllocHGlobal(iSize);
System.Threading.AccessControl (43)
_generated\0\LibraryImports.g.cs (33)
22global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 24__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 36global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 64global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 66__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 78global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 104global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 106__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 124global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 153global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 155__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 173global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 191global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 193__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 196global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 225global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 227__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 245global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 271global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 273__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 291global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 319global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 321__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 333global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 362global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 364__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 382global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 408global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 410__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 428global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 459global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 461__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 473global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (2)
56if (Marshal.GetLastWin32Error() == ERROR_INSUFFICIENT_BUFFER) 69Marshal.FreeHGlobal(nativeMsgPtr);
src\runtime\src\libraries\Common\src\System\IO\Win32Marshal.cs (2)
19=> GetExceptionForWin32Error(Marshal.GetLastPInvokeError(), path); 85return Marshal.GetPInvokeErrorMessage(errorCode);
System\Threading\EventWaitHandleAcl.cs (2)
57int errorCode = Marshal.GetLastPInvokeError(); 135int errorCode = Marshal.GetLastPInvokeError();
System\Threading\MutexAcl.cs (2)
43int errorCode = Marshal.GetLastPInvokeError(); 126int errorCode = Marshal.GetLastPInvokeError();
System\Threading\SemaphoreAcl.cs (2)
62int errorCode = Marshal.GetLastPInvokeError(); 141int errorCode = Marshal.GetLastPInvokeError();
System.Transactions.Local (76)
_generated\10\System.Transactions.DtcProxyShim.DtcInterfaces.ITransaction.cs (3)
54global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([132, 80, 177, 15, 65, 175, 206, 17, 189, 43, 32, 76, 79, 79, 80, 32]), (global::System.IntPtr)__this); 99global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([132, 80, 177, 15, 65, 175, 206, 17, 189, 43, 32, 76, 79, 79, 80, 32]), (global::System.IntPtr)__this); 144global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([132, 80, 177, 15, 65, 175, 206, 17, 189, 43, 32, 76, 79, 79, 80, 32]), (global::System.IntPtr)__this);
_generated\11\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionCloner.cs (4)
56global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([80, 105, 101, 2, 82, 33, 208, 17, 148, 76, 0, 160, 201, 5, 65, 110]), (global::System.IntPtr)__this); 101global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([80, 105, 101, 2, 82, 33, 208, 17, 148, 76, 0, 160, 201, 5, 65, 110]), (global::System.IntPtr)__this); 146global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([80, 105, 101, 2, 82, 33, 208, 17, 148, 76, 0, 160, 201, 5, 65, 110]), (global::System.IntPtr)__this); 193global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([80, 105, 101, 2, 82, 33, 208, 17, 148, 76, 0, 160, 201, 5, 65, 110]), (global::System.IntPtr)__this);
_generated\12\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionExport.cs (2)
57global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([165, 253, 65, 1, 192, 143, 206, 17, 189, 24, 32, 76, 79, 79, 80, 32]), (global::System.IntPtr)__this); 116global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([165, 253, 65, 1, 192, 143, 206, 17, 189, 24, 32, 76, 79, 79, 80, 32]), (global::System.IntPtr)__this);
_generated\13\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionExportFactory.cs (2)
52global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([83, 155, 207, 225, 69, 135, 206, 17, 169, 186, 0, 170, 0, 108, 55, 6]), (global::System.IntPtr)__this); 101global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([83, 155, 207, 225, 69, 135, 206, 17, 169, 186, 0, 170, 0, 108, 55, 6]), (global::System.IntPtr)__this);
_generated\14\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionOptions.cs (2)
52global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([224, 217, 106, 58, 185, 35, 207, 17, 173, 96, 0, 170, 0, 167, 76, 205]), (global::System.IntPtr)__this); 92global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([224, 217, 106, 58, 185, 35, 207, 17, 173, 96, 0, 170, 0, 167, 76, 205]), (global::System.IntPtr)__this);
_generated\15\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionDispenser.cs (2)
54global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([225, 217, 106, 58, 185, 35, 207, 17, 173, 96, 0, 170, 0, 167, 76, 205]), (global::System.IntPtr)__this); 116global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([225, 217, 106, 58, 185, 35, 207, 17, 173, 96, 0, 170, 0, 167, 76, 205]), (global::System.IntPtr)__this);
_generated\16\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionEnlistmentAsync.cs (3)
51global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([129, 80, 177, 15, 65, 175, 206, 17, 189, 43, 32, 76, 79, 79, 80, 32]), (global::System.IntPtr)__this); 89global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([129, 80, 177, 15, 65, 175, 206, 17, 189, 43, 32, 76, 79, 79, 80, 32]), (global::System.IntPtr)__this); 127global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([129, 80, 177, 15, 65, 175, 206, 17, 189, 43, 32, 76, 79, 79, 80, 32]), (global::System.IntPtr)__this);
_generated\17\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionImport.cs (1)
55global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([90, 155, 207, 225, 69, 135, 206, 17, 169, 186, 0, 170, 0, 108, 55, 6]), (global::System.IntPtr)__this);
_generated\18\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionImportWhereabouts.cs (2)
52global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([164, 253, 65, 1, 192, 143, 206, 17, 189, 24, 32, 76, 79, 79, 80, 32]), (global::System.IntPtr)__this); 98global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([164, 253, 65, 1, 192, 143, 206, 17, 189, 24, 32, 76, 79, 79, 80, 32]), (global::System.IntPtr)__this);
_generated\19\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionPhase0EnlistmentAsync.cs (5)
55global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([225, 136, 220, 130, 84, 169, 209, 17, 143, 136, 0, 96, 8, 149, 231, 213]), (global::System.IntPtr)__this); 93global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([225, 136, 220, 130, 84, 169, 209, 17, 143, 136, 0, 96, 8, 149, 231, 213]), (global::System.IntPtr)__this); 131global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([225, 136, 220, 130, 84, 169, 209, 17, 143, 136, 0, 96, 8, 149, 231, 213]), (global::System.IntPtr)__this); 169global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([225, 136, 220, 130, 84, 169, 209, 17, 143, 136, 0, 96, 8, 149, 231, 213]), (global::System.IntPtr)__this); 212global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([225, 136, 220, 130, 84, 169, 209, 17, 143, 136, 0, 96, 8, 149, 231, 213]), (global::System.IntPtr)__this);
_generated\20\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionPhase0Factory.cs (1)
55global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([224, 136, 220, 130, 84, 169, 209, 17, 143, 136, 0, 96, 8, 149, 231, 213]), (global::System.IntPtr)__this);
_generated\21\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionPhase0NotifyAsync.cs (2)
52global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([9, 24, 8, 239, 118, 12, 210, 17, 135, 166, 0, 192, 79, 153, 15, 52]), (global::System.IntPtr)__this); 92global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([9, 24, 8, 239, 118, 12, 210, 17, 135, 166, 0, 192, 79, 153, 15, 52]), (global::System.IntPtr)__this);
_generated\22\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionReceiver.cs (4)
60global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([3, 62, 49, 89, 108, 179, 207, 17, 165, 57, 0, 170, 0, 104, 135, 195]), (global::System.IntPtr)__this); 124global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([3, 62, 49, 89, 108, 179, 207, 17, 165, 57, 0, 170, 0, 104, 135, 195]), (global::System.IntPtr)__this); 177global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([3, 62, 49, 89, 108, 179, 207, 17, 165, 57, 0, 170, 0, 104, 135, 195]), (global::System.IntPtr)__this); 240global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([3, 62, 49, 89, 108, 179, 207, 17, 165, 57, 0, 170, 0, 104, 135, 195]), (global::System.IntPtr)__this);
_generated\23\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionReceiverFactory.cs (1)
52global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([2, 62, 49, 89, 108, 179, 207, 17, 165, 57, 0, 170, 0, 104, 135, 195]), (global::System.IntPtr)__this);
_generated\24\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionResourceAsync.cs (4)
60global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([240, 113, 233, 105, 206, 35, 207, 17, 173, 96, 0, 170, 0, 167, 76, 205]), (global::System.IntPtr)__this); 104global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([240, 113, 233, 105, 206, 35, 207, 17, 173, 96, 0, 170, 0, 167, 76, 205]), (global::System.IntPtr)__this); 145global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([240, 113, 233, 105, 206, 35, 207, 17, 173, 96, 0, 170, 0, 167, 76, 205]), (global::System.IntPtr)__this); 185global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([240, 113, 233, 105, 206, 35, 207, 17, 173, 96, 0, 170, 0, 167, 76, 205]), (global::System.IntPtr)__this);
_generated\25\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionTransmitter.cs (5)
60global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([1, 62, 49, 89, 108, 179, 207, 17, 165, 57, 0, 170, 0, 104, 135, 195]), (global::System.IntPtr)__this); 109global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([1, 62, 49, 89, 108, 179, 207, 17, 165, 57, 0, 170, 0, 104, 135, 195]), (global::System.IntPtr)__this); 155global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([1, 62, 49, 89, 108, 179, 207, 17, 165, 57, 0, 170, 0, 104, 135, 195]), (global::System.IntPtr)__this); 206global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([1, 62, 49, 89, 108, 179, 207, 17, 165, 57, 0, 170, 0, 104, 135, 195]), (global::System.IntPtr)__this); 251global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([1, 62, 49, 89, 108, 179, 207, 17, 165, 57, 0, 170, 0, 104, 135, 195]), (global::System.IntPtr)__this);
_generated\26\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionTransmitterFactory.cs (1)
52global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([0, 62, 49, 89, 108, 179, 207, 17, 165, 57, 0, 170, 0, 104, 135, 195]), (global::System.IntPtr)__this);
_generated\27\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionVoterBallotAsync2.cs (1)
47global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([108, 55, 51, 84, 77, 65, 211, 17, 178, 6, 0, 192, 79, 194, 243, 239]), (global::System.IntPtr)__this);
_generated\28\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionVoterFactory2.cs (1)
57global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([106, 55, 51, 84, 77, 65, 211, 17, 178, 6, 0, 192, 79, 194, 243, 239]), (global::System.IntPtr)__this);
_generated\29\System.Transactions.DtcProxyShim.DtcInterfaces.ITransactionVoterNotifyAsync2.cs (5)
58global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([107, 55, 51, 84, 77, 65, 211, 17, 178, 6, 0, 192, 79, 194, 243, 239]), (global::System.IntPtr)__this); 101global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([107, 55, 51, 84, 77, 65, 211, 17, 178, 6, 0, 192, 79, 194, 243, 239]), (global::System.IntPtr)__this); 141global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([107, 55, 51, 84, 77, 65, 211, 17, 178, 6, 0, 192, 79, 194, 243, 239]), (global::System.IntPtr)__this); 179global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([107, 55, 51, 84, 77, 65, 211, 17, 178, 6, 0, 192, 79, 194, 243, 239]), (global::System.IntPtr)__this); 217global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([107, 55, 51, 84, 77, 65, 211, 17, 178, 6, 0, 192, 79, 194, 243, 239]), (global::System.IntPtr)__this);
_generated\5\System.Transactions.DtcProxyShim.DtcInterfaces.IPrepareInfo.cs (2)
52global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([208, 191, 199, 128, 238, 135, 206, 17, 128, 129, 0, 128, 199, 88, 82, 126]), (global::System.IntPtr)__this); 96global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([208, 191, 199, 128, 238, 135, 206, 17, 128, 129, 0, 128, 199, 88, 82, 126]), (global::System.IntPtr)__this);
_generated\6\System.Transactions.DtcProxyShim.DtcInterfaces.IResourceManagerFactory2.cs (2)
65global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([33, 156, 54, 107, 210, 251, 209, 17, 143, 71, 0, 192, 79, 142, 229, 125]), (global::System.IntPtr)__this); 147global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([33, 156, 54, 107, 210, 251, 209, 17, 143, 71, 0, 192, 79, 142, 229, 125]), (global::System.IntPtr)__this);
_generated\7\System.Transactions.DtcProxyShim.DtcInterfaces.IResourceManager.cs (4)
68global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([33, 29, 116, 19, 235, 135, 206, 17, 128, 129, 0, 128, 199, 88, 82, 126]), (global::System.IntPtr)__this); 140global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([33, 29, 116, 19, 235, 135, 206, 17, 128, 129, 0, 128, 199, 88, 82, 126]), (global::System.IntPtr)__this); 189global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([33, 29, 116, 19, 235, 135, 206, 17, 128, 129, 0, 128, 199, 88, 82, 126]), (global::System.IntPtr)__this); 234global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([33, 29, 116, 19, 235, 135, 206, 17, 128, 129, 0, 128, 199, 88, 82, 126]), (global::System.IntPtr)__this);
_generated\8\System.Transactions.DtcProxyShim.DtcInterfaces.IResourceManagerSink.cs (1)
47global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([129, 49, 86, 13, 251, 222, 206, 17, 174, 209, 0, 170, 0, 81, 226, 196]), (global::System.IntPtr)__this);
_generated\9\System.Transactions.DtcProxyShim.DtcInterfaces.ITmNodeName.cs (2)
52global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([136, 79, 39, 48, 228, 110, 78, 71, 155, 149, 120, 7, 188, 158, 248, 207]), (global::System.IntPtr)__this); 99global::System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(__invokeRetVal, new([136, 79, 39, 48, 228, 110, 78, 71, 155, 149, 120, 7, 188, 158, 248, 207]), (global::System.IntPtr)__this);
System\Transactions\DtcProxyShim\DtcProxyShimFactory.cs (1)
59private static unsafe void DtcGetTransactionManager(string? nodeName, out ITransactionDispenser localDispenser) => Marshal.ThrowExceptionForHR(DtcGetTransactionManagerExW(nodeName, null, Guids.IID_ITransactionDispenser_Guid, 0, null, out localDispenser));
System\Transactions\TransactionInterop.cs (13)
293transactionComObject = (IDtcTransaction)Marshal.GetObjectForIUnknown(transactionNativePtr); 294Marshal.SetComObjectData(transactionComObject, typeof(ITransaction), transactionNative); 296Marshal.Release(transactionNativePtr); 316var transactionNative = (IDtcTransaction)Marshal.GetObjectForIUnknown(transactionNativePtr); 317Marshal.SetComObjectData(transactionNative, typeof(ITransaction), transaction); 319Marshal.Release(transactionNativePtr); 440if (Marshal.GetComObjectData(transactionNative, typeof(ITransaction)) is not ITransaction myTransactionNative) 444nint unknown = Marshal.GetIUnknownForObject(transactionNative); 445if (Marshal.QueryInterface(unknown, Guids.IID_ITransaction_Guid, out IntPtr transactionNativePtr) == 0) 447Marshal.Release(unknown); 449Marshal.SetComObjectData(transactionNative, typeof(ITransaction), myTransactionNative); 450Marshal.Release(transactionNativePtr); 454Marshal.Release(unknown);
System.Windows.Controls.Ribbon (2)
Microsoft\Windows\Controls\Ribbon\NativeMethods.cs (1)
285internal int cbSize = Marshal.SizeOf(typeof(MONITORINFOEX));
Microsoft\Windows\Controls\Ribbon\RibbonDropDownHelper.cs (1)
172cbSize = Marshal.SizeOf(typeof(NativeMethods.MONITORINFOEX))
System.Windows.Extensions (46)
_generated\0\LibraryImports.g.cs (27)
31global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 33__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 47global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 67global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 69__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 74global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 99global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 101__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 119global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 147global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 149__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 158global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 178global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 180__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 185global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 217global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 219__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 231global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 256global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 258__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 276global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 301global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 303__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 315global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError); 343global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0); 345__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError(); 367global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.CRYPT_BIT_BLOB.cs (1)
22Marshal.Copy(pbData, data, 0, numBytes);
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.DATA_BLOB.cs (1)
31Marshal.Copy(pbData, array, 0, (int)cbData);
src\runtime\src\libraries\Common\src\Interop\Windows\CryptUI\Interop.CryptUIDlgCertificate.cs (9)
78szTitle = Marshal.StringToCoTaskMemUni(managed.szTitle); 98Marshal.FreeCoTaskMem(szTitle); 108szTitle = Marshal.PtrToStringUni(szTitle), 188szTitle = Marshal.StringToCoTaskMemUni(managed.szTitle); 190szDisplayString = Marshal.StringToCoTaskMemUni(managed.szDisplayString); 205Marshal.FreeCoTaskMem(szTitle); 206Marshal.FreeCoTaskMem(szDisplayString); 216szTitle = Marshal.PtrToStringUni(szTitle), 218szDisplayString = Marshal.PtrToStringUni(szDisplayString),
System\Media\SoundPlayer.cs (3)
572if (dw < Marshal.SizeOf<Interop.WinMM.WAVEFORMATEX>()) 574dw = Marshal.SizeOf<Interop.WinMM.WAVEFORMATEX>(); 586Marshal.PtrToStructure((IntPtr)pdata, waveFormat);
System\Security\Cryptography\X509Certificates\X509Certificate2UI.cs (3)
81dwErrorCode = Marshal.GetLastPInvokeError(); 117Exception e = new CryptographicException(Marshal.GetLastPInvokeError()); 162dwErrorCode = Marshal.GetLastPInvokeError();
System\Security\Cryptography\X509Certificates\X509Utils.cs (2)
36Exception e = new CryptographicException(Marshal.GetLastPInvokeError()); 53throw new CryptographicException(Marshal.GetLastPInvokeError());
System.Windows.Forms (73)
System\Windows\Forms\Accessibility\AccessibleObject.cs (1)
1167*ppAccessible = (UIA.IAccessible*)Marshal.GetComInterfaceForObject<AccessibleObject, IAccessible>(this);
System\Windows\Forms\Accessibility\LabelEditNativeWindow.cs (1)
46(void*)Marshal.GetFunctionPointerForDelegate(_winEventProcCallback);
System\Windows\Forms\ActiveX\AxHost.cs (4)
2949Marshal.FreeCoTaskMem((IntPtr)uuids.pElems); 3049Marshal.FreeCoTaskMem((IntPtr)uuids.pElems); 3435Marshal.ReleaseComObject(_instance); 3759using ComScope<IDispatch> dispatch = new((IDispatch*)Marshal.GetIDispatchForObject(oleFont));
System\Windows\Forms\ActiveX\AxHost.OleInterfaces.cs (1)
134Marshal.GetNativeVariantForObject(ambient, (nint)result);
System\Windows\Forms\ActiveX\AxHost.State.cs (2)
146Marshal.Copy(_buffer, 0, (nint)pointer, _length); 284Marshal.Copy((nint)pointer, _buffer, 0, _length);
System\Windows\Forms\ActiveX\Control.ActiveXFontMarshaler.cs (1)
24public void CleanUpNativeData(IntPtr pObj) => Marshal.Release(pObj);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (2)
857throw new Win32Exception(Marshal.GetLastWin32Error(), SR.Win32SetParentFailed); 1320Marshal.ThrowExceptionForHR((int)hr);
System\Windows\Forms\ActiveX\Control_ActiveXControlInterfaces.cs (1)
259*pszUserType = (char*)Marshal.StringToCoTaskMemUni(
System\Windows\Forms\ComponentModel\COM2Interop\COM2ComponentEditor.cs (2)
41Marshal.FreeCoTaskMem((IntPtr)uuids.pElems); 121Marshal.FreeCoTaskMem((nint)uuids.pElems);
System\Windows\Forms\ComponentModel\COM2Interop\COM2IManagedPerPropertyBrowsingHandler.cs (2)
212Marshal.FreeCoTaskMem((nint)(void*)values); 240Marshal.FreeCoTaskMem((IntPtr)values);
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyPageUITypeConverter.cs (1)
96Marshal.Release(addresses[i]);
System\Windows\Forms\Control.cs (10)
1387int lastWin32Error = Marshal.GetLastWin32Error(); 3580|| (!returnValue && Marshal.GetLastWin32Error() == (int)WIN32_ERROR.ERROR_INVALID_HANDLE) 6594Marshal.Copy(bytes, 0, m.LParamInternal, bytes.Length); 6595Marshal.Copy(nullBytes, 0, m.LParamInternal + (nint)bytes.Length, nullBytes.Length); 7086throw new Win32Exception(Marshal.GetLastWin32Error(), SR.Win32SetParentFailed); 9358throw new Win32Exception(Marshal.GetLastWin32Error(), SR.Win32SetParentFailed); 9576throw Marshal.GetExceptionForHR((int)hr)!; 9585throw Marshal.GetExceptionForHR((int)hr)!; 10309throw new Win32Exception(Marshal.GetLastWin32Error(), SR.Win32SetParentFailed); 10325throw new Win32Exception(Marshal.GetLastWin32Error(), SR.Win32SetParentFailed);
System\Windows\Forms\Controls\ListView\ListView.cs (6)
4157Marshal.FreeHGlobal(hGlobalColumns); 4160hGlobalColumns = Marshal.AllocHGlobal((int)(lvItem.cColumns * sizeof(int))); 4172Marshal.Copy(columns, 0, (nint)lvItem.puColumns, (int)lvItem.cColumns); 4235Marshal.FreeHGlobal(hGlobalColumns); 5582IntPtr callbackPointer = Marshal.GetFunctionPointerForDelegate(callback); 6889Marshal.Copy(charBuf, 0, destPtr, Math.Min(charBuf.Length, infoTip->cchTextMax));
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarButtonAccessibleObject.cs (1)
135PInvoke.SendInput(1, &mouseInput, Marshal.SizeOf(mouseInput));
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (2)
4071if (obj is not null && !Marshal.IsComObject(obj)) 4305_propertyName = Marshal.PtrToStringAuto((nint)cds->lpData);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.MouseHook.cs (1)
94IntPtr hook = Marshal.GetFunctionPointerForDelegate(_callBack);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (7)
261int lastWin32Error = Marshal.GetLastWin32Error(); 1629Marshal.Copy(buf, bytes, 0, cb); 1717Marshal.Copy(bytes, 0, buf, transferred); 2087Marshal.FreeCoTaskMem(txrg.lpstrText); 2891es.pfnCallback = Marshal.GetFunctionPointerForDelegate(callback); 2995es.pfnCallback = Marshal.GetFunctionPointerForDelegate(callback); 3192Marshal.FreeCoTaskMem(unmanagedBuffer);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (1)
179throw Marshal.GetExceptionForHR((int)hr)!;
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.HostedWindowsFormsMessageHook.cs (1)
65IntPtr hook = Marshal.GetFunctionPointerForDelegate(_callBack);
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (2)
628nint allocatedStringBuffer = Marshal.AllocCoTaskMem((int)info.cch * sizeof(char)); 647Marshal.FreeCoTaskMem(allocatedStringBuffer);
System\Windows\Forms\Controls\TreeView\TreeNode.cs (4)
1841tvis.item.pszText = (char*)Marshal.StringToHGlobalUni(_text); 1891Marshal.FreeCoTaskMem((nint)tvis.item.pszText.Value); 2145item.pszText = (char*)Marshal.StringToHGlobalUni(_text); 2183Marshal.FreeCoTaskMem((nint)item.pszText.Value);
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
479if (!Marshal.IsTypeVisibleFromCom(value.GetType()))
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (1)
871Marshal.FinalReleaseComObject(_activeXInstance);
System\Windows\Forms\Controls\WebBrowser\WebBrowserSiteBase.cs (1)
267lpFrameInfo->cb = (uint)Marshal.SizeOf<OLEINPLACEFRAMEINFO>();
System\Windows\Forms\Design\EventsTab.cs (1)
28public override bool CanExtend(object? extendee) => extendee is null || !Marshal.IsComObject(extendee);
System\Windows\Forms\Dialogs\CommonDialogs\CommonDialog.cs (2)
33_functionPointer = (delegate* unmanaged[Stdcall]<HWND, uint, WPARAM, LPARAM, nuint>)(void*)Marshal.GetFunctionPointerForDelegate(_hookProc); 221nint hookedWndProc = Marshal.GetFunctionPointerForDelegate(ownerWindowProcedure);
System\Windows\Forms\Dialogs\CommonDialogs\FolderBrowserDialog.cs (1)
314throw Marshal.GetExceptionForHR((int)hr)!;
System\Windows\Forms\Dialogs\MessageBox.cs (1)
469int lastWin32Error = Marshal.GetLastWin32Error();
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.cs (4)
263private static void FreeConfig(IntPtr ptrToFree) => Marshal.FreeHGlobal(ptrToFree); 1166string? linkHref = Marshal.PtrToStringUni(lParam); 1427ptrToFree = Marshal.AllocHGlobal((nint)(sizeToAllocate + (IntPtr.Size - 1))); 1544Marshal.FreeHGlobal(ptrToFree);
System\Windows\Forms\Input\Cursor.cs (2)
41throw new Win32Exception(string.Format(SR.FailedToLoadCursor, Marshal.GetLastWin32Error())); 430throw new Win32Exception(string.Format(SR.FailedToLoadCursor, Marshal.GetLastWin32Error()));
System\Windows\Forms\NativeWindow.cs (1)
453lastWin32Error = Marshal.GetLastWin32Error();
System\Windows\Forms\NativeWindow.WindowClass.cs (2)
147throw new Win32Exception(Marshal.GetLastWin32Error(), SR.InvalidWndClsName); 157nint callback = Marshal.GetFunctionPointerForDelegate(_windProc);
System\Windows\Forms\StringSource.cs (1)
96rgelt[fetched] = (char*)Marshal.StringToCoTaskMemUni(_strings[_current]);
System\Windows\Forms\SystemInformation.cs (1)
805return Marshal.GetLastWin32Error() == (int)WIN32_ERROR.ERROR_ACCESS_DENIED;
System\Windows\Forms\WindowSubclassHandler.cs (1)
72_windowProcDelegatePtr = (void*)Marshal.GetFunctionPointerForDelegate(_windowProcDelegate);
System.Windows.Forms.Design (6)
System\Drawing\Design\ColorEditor.CustomColorDialog.cs (3)
28_hInstance = Marshal.AllocHGlobal(size); 29Marshal.Copy(buffer, 0, _hInstance, size); 49Marshal.FreeHGlobal(_hInstance);
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.MouseHook.cs (1)
78IntPtr hook = Marshal.GetFunctionPointerForDelegate(_callBack);
System\Windows\Forms\Design\Behavior\BehaviorService.cs (2)
779Marshal.Copy(bytes, 0, m.LParamInternal, bytes.Length); 780Marshal.Copy(nullBytes, 0, m.LParamInternal + (nint)bytes.Length, nullBytes.Length);
System.Windows.Forms.Primitives (297)
_generated\417\Windows.Win32.PInvoke.KERNEL32.dll.g.cs (45)
54 Marshal.SetLastSystemError(0); 56 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 76 Marshal.SetLastSystemError(0); 78 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 112 Marshal.SetLastSystemError(0); 114 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 139 Marshal.SetLastSystemError(0); 141 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 183 Marshal.SetLastSystemError(0); 185 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 234 Marshal.SetLastSystemError(0); 236 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 255 Marshal.SetLastSystemError(0); 257 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 319 Marshal.SetLastSystemError(0); 321 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 364 Marshal.SetLastSystemError(0); 366 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 393 Marshal.SetLastSystemError(0); 395 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 429 Marshal.SetLastSystemError(0); 431 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 467 Marshal.SetLastSystemError(0); 469 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 511 Marshal.SetLastSystemError(0); 513 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 566 Marshal.SetLastSystemError(0); 568 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 617 Marshal.SetLastSystemError(0); 619 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
_generated\421\Windows.Win32.PInvoke.POWRPROF.dll.g.cs (3)
46 Marshal.SetLastSystemError(0); 48 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
_generated\425\Windows.Win32.PInvoke.USER32.dll.g.cs (228)
42 Marshal.SetLastSystemError(0); 44 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 67 Marshal.SetLastSystemError(0); 69 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 114 Marshal.SetLastSystemError(0); 116 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 147 Marshal.SetLastSystemError(0); 149 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 181 Marshal.SetLastSystemError(0); 183 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 202 Marshal.SetLastSystemError(0); 204 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 313 Marshal.SetLastSystemError(0); 315 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 337 Marshal.SetLastSystemError(0); 339 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 388 Marshal.SetLastSystemError(0); 390 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 412 Marshal.SetLastSystemError(0); 414 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 429 Marshal.SetLastSystemError(0); 431 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 514 Marshal.SetLastSystemError(0); 516 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 603 Marshal.SetLastSystemError(0); 605 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 627 Marshal.SetLastSystemError(0); 629 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 730 Marshal.SetLastSystemError(0); 732 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 848 Marshal.SetLastSystemError(0); 850 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 896 Marshal.SetLastSystemError(0); 898 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1000 Marshal.SetLastSystemError(0); 1002 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1086 Marshal.SetLastSystemError(0); 1088 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1122 Marshal.SetLastSystemError(0); 1124 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1168 Marshal.SetLastSystemError(0); 1170 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1200 Marshal.SetLastSystemError(0); 1202 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1235 Marshal.SetLastSystemError(0); 1237 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1271 Marshal.SetLastSystemError(0); 1273 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1317 Marshal.SetLastSystemError(0); 1319 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1342 Marshal.SetLastSystemError(0); 1344 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1378 Marshal.SetLastSystemError(0); 1380 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1467 Marshal.SetLastSystemError(0); 1469 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1504 Marshal.SetLastSystemError(0); 1506 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1557 Marshal.SetLastSystemError(0); 1559 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1604 Marshal.SetLastSystemError(0); 1606 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1657 Marshal.SetLastSystemError(0); 1659 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1704 Marshal.SetLastSystemError(0); 1706 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1737 Marshal.SetLastSystemError(0); 1739 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1761 Marshal.SetLastSystemError(0); 1763 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1781 Marshal.SetLastSystemError(0); 1783 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1823 Marshal.SetLastSystemError(0); 1825 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1862 Marshal.SetLastSystemError(0); 1864 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1936 Marshal.SetLastSystemError(0); 1938 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1958 Marshal.SetLastSystemError(0); 1960 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 1998 Marshal.SetLastSystemError(0); 2000 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2048 Marshal.SetLastSystemError(0); 2050 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2087 Marshal.SetLastSystemError(0); 2089 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2295 Marshal.SetLastSystemError(0); 2297 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2335 Marshal.SetLastSystemError(0); 2337 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2379 Marshal.SetLastSystemError(0); 2381 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2431 Marshal.SetLastSystemError(0); 2433 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2476 Marshal.SetLastSystemError(0); 2478 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2544 Marshal.SetLastSystemError(0); 2546 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2595 Marshal.SetLastSystemError(0); 2597 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2656 Marshal.SetLastSystemError(0); 2658 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2691 Marshal.SetLastSystemError(0); 2693 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2708 Marshal.SetLastSystemError(0); 2710 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2797 Marshal.SetLastSystemError(0); 2799 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2856 Marshal.SetLastSystemError(0); 2858 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2931 Marshal.SetLastSystemError(0); 2933 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 2977 Marshal.SetLastSystemError(0); 2979 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3023 Marshal.SetLastSystemError(0); 3025 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3047 Marshal.SetLastSystemError(0); 3049 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3107 Marshal.SetLastSystemError(0); 3109 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3131 Marshal.SetLastSystemError(0); 3133 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3180 Marshal.SetLastSystemError(0); 3182 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3214 Marshal.SetLastSystemError(0); 3216 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3242 Marshal.SetLastSystemError(0); 3244 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3271 Marshal.SetLastSystemError(0); 3273 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3301 Marshal.SetLastSystemError(0); 3303 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3371 Marshal.SetLastSystemError(0); 3373 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3426 Marshal.SetLastSystemError(0); 3428 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3454 Marshal.SetLastSystemError(0); 3456 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3493 Marshal.SetLastSystemError(0); 3495 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3536 Marshal.SetLastSystemError(0); 3538 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3595 Marshal.SetLastSystemError(0); 3597 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3634 Marshal.SetLastSystemError(0); 3636 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3719 Marshal.SetLastSystemError(0); 3721 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3789 Marshal.SetLastSystemError(0); 3791 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError()); 3917 Marshal.SetLastSystemError(0); 3919 Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
_generated\62\Windows.Win32.FARPROC.g.cs (1)
49 internal TDelegate CreateDelegate<TDelegate>()where TDelegate : Delegate => Marshal.GetDelegateForFunctionPointer<TDelegate>(this.Value);
Microsoft\Win32\SafeHandles\CoTaskMemSafeHandle.cs (1)
18Marshal.FreeCoTaskMem(handle);
System\Windows\Forms\Automation\UiaTextRange.cs (1)
708Runtime.InteropServices.Marshal.GetNativeVariantForObject(value, (nint)(void*)&variant);
System\Windows\Forms\Internals\ScaleHelper.DpiAwarenessScope.cs (4)
49throw new Win32Exception(Marshal.GetLastWin32Error(), SR.Win32GetThreadsDpiContextFailed); 64throw new Win32Exception(Marshal.GetLastWin32Error(), string.Format(SR.Win32SetThreadsDpiHostingBehaviorFailed, behavior)); 79throw new Win32Exception(Marshal.GetLastWin32Error(), string.Format(SR.Win32SetThreadsDpiHostingBehaviorFailed, _originalDpiHostingBehavior)); 85throw new Win32Exception(Marshal.GetLastWin32Error(), string.Format(SR.Win32SetThreadsDpiContextFailed, _originalDpiAwarenessContext));
System\Windows\Forms\Internals\UnicodeCharBuffer.cs (3)
20IntPtr result = Marshal.AllocCoTaskMem(_buffer.Length * 2); 21Marshal.Copy(_buffer, 0, result, _buffer.Length); 45Marshal.Copy(ptr, _buffer, 0, _buffer.Length);
System\Windows\Forms\Message.cs (1)
89Type cls) => Marshal.PtrToStructure(LParamInternal, cls);
Windows\Win32\PInvoke.CreateWindowEx.cs (5)
56int size = Marshal.SizeOf(lpParam); 57nint native = Marshal.AllocCoTaskMem(size); 61Marshal.StructureToPtr(lpParam, native, fDeleteOld: false); 68Marshal.DestroyStructure(native, lpParam.GetType()); 69Marshal.FreeCoTaskMem(native);
Windows\Win32\PInvoke.LoadLibrary.cs (1)
57if (Marshal.GetLastWin32Error() != (int)WIN32_ERROR.ERROR_INVALID_PARAMETER)
Windows\Win32\System\Ole\CADWORD.cs (1)
20Marshal.FreeCoTaskMem((nint)pElems);
Windows\Win32\UI\Accessibility\UIAHelper.cs (1)
20/// Although <see cref="global::System.Runtime.InteropServices.Marshal.GetNativeVariantForObject"/>
Windows\Win32\UI\Shell\FolderBrowserHelper.cs (2)
54Marshal.FreeCoTaskMem((nint)rootFolderId); 65Marshal.FreeCoTaskMem((nint)resultId);
UIAutomationClient (59)
MS\Internal\Automation\HwndProxyElementProvider.cs (5)
310length = Marshal.SizeOf(typeof(UnsafeNativeMethods.WINDOWPLACEMENT)) 696length = Marshal.SizeOf(typeof(UnsafeNativeMethods.WINDOWPLACEMENT)) 810length = Marshal.SizeOf(typeof(UnsafeNativeMethods.WINDOWPLACEMENT)) 1908int lastWin32Error = Marshal.GetLastWin32Error(); 1933int lastWin32Error = Marshal.GetLastWin32Error();
MS\Internal\Automation\input.cs (2)
64Misc.SendInput(1, ref ki, Marshal.SizeOf(ki)); 83Misc.SendInput(1, ref ki, Marshal.SizeOf(ki));
MS\Internal\Automation\Misc.cs (29)
272int lastWin32Error = Marshal.GetLastWin32Error(); 285int lastWin32Error = Marshal.GetLastWin32Error(); 298int lastWin32Error = Marshal.GetLastWin32Error(); 311int lastWin32Error = Marshal.GetLastWin32Error(); 323guiThreadInfo.cbSize = Marshal.SizeOf(guiThreadInfo); 326int lastWin32Error = Marshal.GetLastWin32Error(); 346int lastWin32Error = Marshal.GetLastWin32Error(); 359int lastWin32Error = Marshal.GetLastWin32Error(); 372int lastWin32Error = Marshal.GetLastWin32Error(); 385int lastWin32Error = Marshal.GetLastWin32Error(); 405error = Marshal.GetLastWin32Error(); 412error = Marshal.GetLastWin32Error(); 427int lastWin32Error = Marshal.GetLastWin32Error(); 440int lastWin32Error = Marshal.GetLastWin32Error(); 453int lastWin32Error = Marshal.GetLastWin32Error(); 466ThrowWin32ExceptionsIfError(Marshal.GetLastWin32Error()); 476lastWin32Error = Marshal.GetLastWin32Error(); 486lastWin32Error = Marshal.GetLastWin32Error(); 513int lastWin32Error = Marshal.GetLastWin32Error(); 524lastWin32Error = Marshal.GetLastWin32Error(); 543int lastWin32Error = Marshal.GetLastWin32Error(); 556int lastWin32Error = Marshal.GetLastWin32Error(); 569int lastWin32Error = Marshal.GetLastWin32Error(); 586int lastWin32Error = Marshal.GetLastWin32Error(); 603int lastWin32Error = Marshal.GetLastWin32Error(); 620int lastWin32Error = Marshal.GetLastWin32Error(); 634int lastWin32Error = Marshal.GetLastWin32Error(); 647int lastWin32Error = Marshal.GetLastWin32Error(); 660int lastWin32Error = Marshal.GetLastWin32Error();
MS\Internal\Automation\ProxyManager.cs (2)
224int lastWin32Error = Marshal.GetLastWin32Error(); 238int lastWin32Error = Marshal.GetLastWin32Error();
MS\Internal\Automation\UiaCoreApi.cs (16)
139IntPtr dataStart = Marshal.AllocCoTaskMem((properties.Length + patterns.Length) * sizeof(int)); 165Marshal.FreeCoTaskMem(_pProperties); 638UiaEventArgs args = Marshal.PtrToStructure<UiaEventArgs>(argsAddr); 656UiaPropertyChangedEventArgs pcargs = Marshal.PtrToStructure<UiaPropertyChangedEventArgs>(argsAddr); 670UiaStructureChangedEventArgs scargs = Marshal.PtrToStructure<UiaStructureChangedEventArgs>(argsAddr); 677UiaAsyncContentLoadedEventArgs aclargs = Marshal.PtrToStructure<UiaAsyncContentLoadedEventArgs>(argsAddr); 683UiaWindowClosedEventArgs wcargs = Marshal.PtrToStructure<UiaWindowClosedEventArgs>(argsAddr); 690UiaNotificationEventArgs nargs = Marshal.PtrToStructure<UiaNotificationEventArgs>(argsAddr); 692Marshal.PtrToStringUni(nargs._displayString), Marshal.PtrToStringUni(nargs._activityId)); 697UiaActiveTextPositionChangedEventArgs atpcargs = Marshal.PtrToStructure<UiaActiveTextPositionChangedEventArgs>(argsAddr); 1126&& !Marshal.IsComObject(arr[1]) 1139IntPtr errorInfoAsIntPtr = Marshal.GetIUnknownForObject(errorInfo); 1142Marshal.Release(errorInfoAsIntPtr); 1145Marshal.ThrowExceptionForHR(hr); 1204Marshal.ThrowExceptionForHR(hr);
System\Windows\Automation\Condition.cs (5)
28Marshal.FreeCoTaskMem(handle); 38int size = Marshal.SizeOf(uiaCondition); 43IntPtr mem = Marshal.AllocCoTaskMem(size); 46Marshal.StructureToPtr(uiaCondition, sh.handle, false); 60IntPtr mem = Marshal.AllocCoTaskMem(conditions.Length * IntPtr.Size);
UIAutomationClientSideProviders (212)
MS\Internal\AutomationProxies\CommonXSendMessage.cs (67)
408return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETITEMW, IntPtr.Zero, new IntPtr(&item), Marshal.SizeOf(item.GetType()), new IntPtr(&item.pszText), item.cchTextMax); 415new IntPtr(&item32), Marshal.SizeOf(item32.GetType()), new IntPtr(&item32.pszText), 423return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETITEMW, IntPtr.Zero, new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), new IntPtr(&item64.pszText), item64.cchTextMax); 437return XSend(hwnd, NativeMethods.LVM_SETITEMSTATE, new IntPtr(index), new IntPtr(&item), Marshal.SizeOf(item.GetType())); 443return XSend(hwnd, NativeMethods.LVM_SETITEMSTATE, new IntPtr(index), new IntPtr(&item32), Marshal.SizeOf(item32.GetType())); 449return XSend(hwnd, NativeMethods.LVM_SETITEMSTATE, new IntPtr(index), new IntPtr(&item64), Marshal.SizeOf(item64.GetType())); 465return XSend(hwnd, NativeMethods.LVM_GETITEMW, IntPtr.Zero, new IntPtr(pItem), Marshal.SizeOf(item.GetType()), XSendMessage.ErrorValue.NoCheck); 472bool result = XSend(hwnd, NativeMethods.LVM_GETITEMW, IntPtr.Zero, new IntPtr(&item32), Marshal.SizeOf(item32.GetType()), XSendMessage.ErrorValue.NoCheck); 484bool result = XSend(hwnd, NativeMethods.LVM_GETITEMW, IntPtr.Zero, new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), XSendMessage.ErrorValue.NoCheck); 505new IntPtr(group.iGroupID), new IntPtr(&group), Marshal.SizeOf(group.GetType())); 512new IntPtr(group.iGroupID), new IntPtr(&group32), Marshal.SizeOf(group32.GetType())); 519new IntPtr(group.iGroupID), new IntPtr(&group64), Marshal.SizeOf(group64.GetType())); 538new IntPtr(group.iGroupID), new IntPtr(pGroup), Marshal.SizeOf(group.GetType())); 549new IntPtr(group.iGroupID), new IntPtr(&group32), Marshal.SizeOf(group32.GetType())); 560new IntPtr(group.iGroupID), new IntPtr(&group64), Marshal.SizeOf(group64.GetType())); 583new IntPtr(group.iGroupID), new IntPtr(pGroup), Marshal.SizeOf(group.GetType())); 594new IntPtr(group.iGroupID), new IntPtr(&group32), Marshal.SizeOf(group32.GetType())); 605new IntPtr(group.iGroupID), new IntPtr(&group64), Marshal.SizeOf(group64.GetType())); 630return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETGROUPINFO, new IntPtr(item.iGroupID), new IntPtr(&item), Marshal.SizeOf(item.GetType()), new IntPtr(&item.pszHeader), item.cchHeader); 642return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETGROUPINFO, new IntPtr(item32.iGroupID), new IntPtr(&item32), Marshal.SizeOf(item32.GetType()), new IntPtr(&item32.pszHeader), item32.cchHeader); 654return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETGROUPINFO, new IntPtr(item64.iGroupID), new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), new IntPtr(&item64.pszHeader), item64.cchHeader); 689return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETGROUPINFO, new IntPtr(item.iGroupID), new IntPtr(&item), Marshal.SizeOf(item.GetType()), textAddress, size, true); 707return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETGROUPINFO, new IntPtr(item32.iGroupID), new IntPtr(&item32), Marshal.SizeOf(item32.GetType()), textAddress, size, true); 725return GetTextWithinStructure(hwnd, NativeMethods.LVM_GETGROUPINFO, new IntPtr(item64.iGroupID), new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), textAddress, size, true); 751return XSend(hwnd, NativeMethods.TCM_GETITEMW, new IntPtr(index), new IntPtr(pItem), Marshal.SizeOf(item.GetType())); 758bool result = XSend(hwnd, NativeMethods.TCM_GETITEMW, new IntPtr(index), new IntPtr(&item32), Marshal.SizeOf(item32.GetType())); 771bool result = XSend(hwnd, NativeMethods.TCM_GETITEMW, new IntPtr(index), new IntPtr(&item64), Marshal.SizeOf(item64.GetType())); 792return GetTextWithinStructure(hwnd, NativeMethods.TCM_GETITEMW, new IntPtr(index), new IntPtr(&item), Marshal.SizeOf(item.GetType()), new IntPtr(&item.pszText), item.cchTextMax); 799new IntPtr(&item32), Marshal.SizeOf(item32.GetType()), new IntPtr(&item32.pszText), 807return GetTextWithinStructure(hwnd, NativeMethods.TCM_GETITEMW, new IntPtr(index), new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), new IntPtr(&item64.pszText), item64.cchTextMax); 833return XSend(hwnd, NativeMethods.HDM_GETITEMW, new IntPtr(index), new IntPtr(pItem), Marshal.SizeOf(item.GetType())); 840bool result = XSend(hwnd, NativeMethods.HDM_GETITEMW, new IntPtr(index), new IntPtr(&item32), Marshal.SizeOf(item32.GetType())); 853bool result = XSend(hwnd, NativeMethods.HDM_GETITEMW, new IntPtr(index), new IntPtr(&item64), Marshal.SizeOf(item64.GetType())); 874return GetTextWithinStructure(hwnd, NativeMethods.HDM_GETITEMW, new IntPtr(index), new IntPtr(&item), Marshal.SizeOf(item.GetType()), new IntPtr(&item.pszText), item.cchTextMax); 882Marshal.SizeOf(item32.GetType()), new IntPtr(&item32.pszText), item32.cchTextMax, 889return GetTextWithinStructure(hwnd, NativeMethods.HDM_GETITEMW, new IntPtr(index), new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), new IntPtr(&item64.pszText), item64.cchTextMax); 915return XSend(hwnd, NativeMethods.TVM_GETITEMW, IntPtr.Zero, new IntPtr(pItem), Marshal.SizeOf(item.GetType())); 922bool result = XSend(hwnd, NativeMethods.TVM_GETITEMW, IntPtr.Zero, new IntPtr(&item32), Marshal.SizeOf(item32.GetType())); 935bool result = XSend(hwnd, NativeMethods.TVM_GETITEMW, IntPtr.Zero, new IntPtr(&item64), Marshal.SizeOf(item64.GetType())); 956return XSend(hwnd, NativeMethods.TVM_SETITEMW, IntPtr.Zero, new IntPtr(&item), Marshal.SizeOf(item.GetType())); 962return XSend(hwnd, NativeMethods.TVM_SETITEMW, IntPtr.Zero, new IntPtr(&item32), Marshal.SizeOf(item32.GetType())); 968return XSend(hwnd, NativeMethods.TVM_SETITEMW, IntPtr.Zero, new IntPtr(&item64), Marshal.SizeOf(item64.GetType())); 990Marshal.SizeOf(hitTestInfo.GetType()), XSendMessage.ErrorValue.Zero)) 999Marshal.SizeOf(hitTestInfo32.GetType()), XSendMessage.ErrorValue.Zero)) 1008Marshal.SizeOf(hitTestInfo64.GetType()), XSendMessage.ErrorValue.Zero)) 1027return GetTextWithinStructure(hwnd, NativeMethods.TVM_GETITEMW, IntPtr.Zero, new IntPtr(&item), Marshal.SizeOf(item.GetType()), new IntPtr(&item.pszText), item.cchTextMax); 1035Marshal.SizeOf(item32.GetType()), new IntPtr(&item32.pszText), item32.cchTextMax, 1042return GetTextWithinStructure(hwnd, NativeMethods.TVM_GETITEMW, IntPtr.Zero, new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), new IntPtr(&item64.pszText), item64.cchTextMax); 1068return XSend(hwnd, NativeMethods.TB_GETBUTTON, new IntPtr(index), new IntPtr(pItem), Marshal.SizeOf(item.GetType()), ErrorValue.Zero); 1075bool result = XSend(hwnd, NativeMethods.TB_GETBUTTON, new IntPtr(index), new IntPtr(&item32), Marshal.SizeOf(item32.GetType()), ErrorValue.Zero); 1088bool result = XSend(hwnd, NativeMethods.TB_GETBUTTON, new IntPtr(index), new IntPtr(&item64), Marshal.SizeOf(item64.GetType()), ErrorValue.Zero); 1126Marshal.SizeOf(item.GetType()), new IntPtr(&item.pszText), maxTextLength, true); 1134Marshal.SizeOf(item32.GetType()), new IntPtr(&item32.pszText), maxTextLength, 1143Marshal.SizeOf(item64.GetType()), new IntPtr(&item64.pszText), maxTextLength, true); 1171int cMem = Marshal.SizeOf(rectW32.GetType()); 1979cbSize = Marshal.SizeOf(typeof(LVGROUP_32)); 1996cbSize = Marshal.SizeOf(typeof(NativeMethods.LVGROUP)), 2045cbSize = Marshal.SizeOf(typeof(LVGROUP_V6_32)); 2078cbSize = Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6)), 2128cbSize = Marshal.SizeOf(typeof(LVGROUP_64)); 2146cbSize = Marshal.SizeOf(typeof(NativeMethods.LVGROUP)), 2196cbSize = Marshal.SizeOf(typeof(LVGROUP_V6_64)); 2230cbSize = Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6)), 2532cbSize = Marshal.SizeOf(typeof(TOOLINFO_32)); 2547cbSize = Marshal.SizeOf(typeof(NativeMethods.TOOLINFO)), 2576cbSize = Marshal.SizeOf(typeof(TOOLINFO_64)); 2591cbSize = Marshal.SizeOf(typeof(NativeMethods.TOOLINFO)),
MS\Internal\AutomationProxies\Input.cs (5)
119if( UnsafeNativeMethods.SendInput( 1, ref mi, Marshal.SizeOf(mi) ) == 0 ) 120throw new Win32Exception(Marshal.GetLastWin32Error()); 144if( UnsafeNativeMethods.SendInput( 1, ref ki, Marshal.SizeOf(ki) ) == 0 ) 145throw new Win32Exception(Marshal.GetLastWin32Error()); 168Misc.SendInput(1, ref ki, Marshal.SizeOf(ki));
MS\Internal\AutomationProxies\Misc.cs (59)
119int lastWin32Error = Marshal.GetLastWin32Error(); 163int lastWin32Error = Marshal.GetLastWin32Error(); 176int lastWin32Error = Marshal.GetLastWin32Error(); 191int lastWin32Error = Marshal.GetLastWin32Error(); 215int lastWin32Error = Marshal.GetLastWin32Error(); 255int lastWin32Error = Marshal.GetLastWin32Error(); 272int lastWin32Error = Marshal.GetLastWin32Error(); 287int lastWin32Error = Marshal.GetLastWin32Error(); 301int lastWin32Error = Marshal.GetLastWin32Error(); 326tool.Init(Marshal.SizeOf(typeof(NativeMethods.TOOLINFO))); 425int lastWin32Error = Marshal.GetLastWin32Error(); 438int lastWin32Error = Marshal.GetLastWin32Error(); 451int lastWin32Error = Marshal.GetLastWin32Error(); 464int lastWin32Error = Marshal.GetLastWin32Error(); 477int lastWin32Error = Marshal.GetLastWin32Error(); 491int lastWin32Error = Marshal.GetLastWin32Error(); 504int lastWin32Error = Marshal.GetLastWin32Error(); 517int lastWin32Error = Marshal.GetLastWin32Error(); 530int lastWin32Error = Marshal.GetLastWin32Error(); 550int lastWin32Error = Marshal.GetLastWin32Error(); 615int lastWin32Error = Marshal.GetLastWin32Error(); 672int lastWin32Error = Marshal.GetLastWin32Error(); 711int lastWin32Error = Marshal.GetLastWin32Error(); 722ThrowWin32ExceptionsIfError(Marshal.GetLastWin32Error()); 778int lastWin32Error = Marshal.GetLastWin32Error(); 879int lastWin32Error = Marshal.GetLastWin32Error(); 893int lastWin32Error = Marshal.GetLastWin32Error(); 918int lastWin32Error = Marshal.GetLastWin32Error(); 984lastWin32Error = Marshal.GetLastWin32Error(); 994lastWin32Error = Marshal.GetLastWin32Error(); 1014int lastWin32Error = Marshal.GetLastWin32Error(); 1025lastWin32Error = Marshal.GetLastWin32Error(); 1046int lastWin32Error = Marshal.GetLastWin32Error(); 1078gui.cbSize = Marshal.SizeOf(gui.GetType()); 1081int lastWin32Error = Marshal.GetLastWin32Error(); 1178ti.cbSize = Marshal.SizeOf(ti.GetType()); 1181int lastWin32Error = Marshal.GetLastWin32Error(); 1194ti.cbSize = Marshal.SizeOf(ti.GetType()); 1197int lastWin32Error = Marshal.GetLastWin32Error(); 1252int lastWin32Error = Marshal.GetLastWin32Error(); 1280int lastWin32Error = Marshal.GetLastWin32Error(); 1306int lastWin32Error = Marshal.GetLastWin32Error(); 1332int lastWin32Error = Marshal.GetLastWin32Error(); 1347int lastWin32Error = Marshal.GetLastWin32Error(); 1383int lastWin32Error = Marshal.GetLastWin32Error(); 1396int lastWin32Error = Marshal.GetLastWin32Error(); 1412int lastWin32Error = Marshal.GetLastWin32Error(); 1426int lastWin32Error = Marshal.GetLastWin32Error(); 1445int lastWin32Error = Marshal.GetLastWin32Error(); 1465int lastWin32Error = Marshal.GetLastWin32Error(); 1606int lastWin32Error = Marshal.GetLastWin32Error(); 1719int lastWin32Error = Marshal.GetLastWin32Error(); 1732int lastWin32Error = Marshal.GetLastWin32Error(); 1745int lastWin32Error = Marshal.GetLastWin32Error(); 1758int lastWin32Error = Marshal.GetLastWin32Error(); 1771int lastWin32Error = Marshal.GetLastWin32Error(); 1784int lastWin32Error = Marshal.GetLastWin32Error(); 1797int lastWin32Error = Marshal.GetLastWin32Error(); 1903tool.Init(Marshal.SizeOf(typeof(NativeMethods.TOOLINFO)));
MS\Internal\AutomationProxies\SafeCoTaskMem.cs (4)
18SetHandle(Marshal.AllocCoTaskMem(length * sizeof (char))); 23return Marshal.PtrToStringAuto(handle); 29return Marshal.PtrToStringUni(handle, length); 34Marshal.FreeCoTaskMem(handle);
MS\Internal\AutomationProxies\WindowsAltTab.cs (2)
236altTabInfo.cbSize = (uint)Marshal.SizeOf(typeof(UnsafeNativeMethods.ALTTABINFO)); 246int lastWin32Error = Marshal.GetLastWin32Error();
MS\Internal\AutomationProxies\WindowsEditBox.cs (2)
553int cb = Marshal.SizeOf(typeof(NativeMethods.LOGFONT)); 706cbSize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(NativeMethods.ScrollInfo)),
MS\Internal\AutomationProxies\WindowsHyperlink.cs (3)
211bGetItemResult = XSendMessage.XSend(_hwnd, NativeMethods.LM_HITTEST, IntPtr.Zero, new IntPtr(&HitTestInfo), Marshal.SizeOf(HitTestInfo.GetType())); 395return XSendMessage.XSend(_hwnd, NativeMethods.LM_SETITEM, IntPtr.Zero, new IntPtr(&linkItem), Marshal.SizeOf(linkItem.GetType())); 492bGetItemResult = XSendMessage.XSend(_hwnd, NativeMethods.LM_HITTEST, IntPtr.Zero, new IntPtr(&HitTestInfo), Marshal.SizeOf(HitTestInfo.GetType()));
MS\Internal\AutomationProxies\WindowsListView.cs (7)
1269if (XSendMessage.XSend(hwnd, NativeMethods.LVM_GETITEMRECT, new IntPtr(item), new IntPtr(location), Marshal.SizeOf(itemRectangle.GetType()))) 1420result = XSendMessage.XSendGetIndex(hwnd, NativeMethods.LVM_SUBITEMHITTEST, IntPtr.Zero, new IntPtr(&hitTestNative), Marshal.SizeOf(hitTestNative.GetType())); 1429result = XSendMessage.XSendGetIndex(hwnd, NativeMethods.LVM_SUBITEMHITTEST, IntPtr.Zero, new IntPtr(&hitTestNative), Marshal.SizeOf(hitTestNative.GetType())); 1493if (XSendMessage.XSend(hwnd, NativeMethods.LVM_GETSUBITEMRECT, new IntPtr(item), new IntPtr(location), Marshal.SizeOf(itemRectangle.GetType()))) 1664scrollBarInfo.cbSize = Marshal.SizeOf(scrollBarInfo.GetType()); 1675si.cbSize = Marshal.SizeOf (si.GetType ()); 1792if (XSendMessage.XSend(hwnd, NativeMethods.LVM_GETITEMPOSITION, new IntPtr(item), new IntPtr(location), Marshal.SizeOf(pt.GetType())))
MS\Internal\AutomationProxies\WindowsListViewGroup.cs (12)
96group.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6))); 106group.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP))); 152group.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6))); 240group.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6))); 306XSendMessage.XSendGetIndex(_hwnd, NativeMethods.LVM_HITTEST, new IntPtr(-1), new IntPtr(&hitTestNative), Marshal.SizeOf(hitTestNative.GetType())); 332groupInfo.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6))); 337bool lresult = XSendMessage.XSend(_hwnd, NativeMethods.LVM_GETGROUPINFOBYINDEX, new IntPtr(groupIndex), new IntPtr(&groupInfo), Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6))); 424group.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP))); 490groupInfo.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6))); 495bool lresult = XSendMessage.XSend(hwnd, NativeMethods.LVM_GETGROUPINFOBYINDEX, new IntPtr(groupIndex), new IntPtr(&groupInfo), Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6))); 504groupInfo.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6))); 606group.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP)));
MS\Internal\AutomationProxies\WindowsListViewGroupHelper.cs (5)
386while (XSendMessage.XSend (hwnd, NativeMethods.LVM_GETNEXTITEMINDEX, new IntPtr(&ii), flags, Marshal.SizeOf(ii.GetType()))) 390groupInfo.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6))); 393bool lresult = XSendMessage.XSend(hwnd, NativeMethods.LVM_GETGROUPINFOBYINDEX, new IntPtr(ii.iGroup), new IntPtr(&groupInfo), Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6))); 703new IntPtr(_groupID), new IntPtr(&rect), Marshal.SizeOf(rect.GetType())); 814sbi.cbSize = Marshal.SizeOf(sbi.GetType());
MS\Internal\AutomationProxies\WindowsListViewGroupSubsetLink.cs (3)
77XSendMessage.XSend(_hwnd, NativeMethods.LVM_GETGROUPRECT, new IntPtr(0), new IntPtr(&rect), Marshal.SizeOf(rect.GetType())); 88groupInfo.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6))); 105group.Init(Marshal.SizeOf(typeof(NativeMethods.LVGROUP_V6)));
MS\Internal\AutomationProxies\WindowsListViewItem.cs (2)
133if (XSendMessage.XSend(_hwnd, NativeMethods.LVM_GETITEMINDEXRECT, new IntPtr(&ii), new IntPtr(&itemRectangle), Marshal.SizeOf(ii.GetType()), Marshal.SizeOf(itemRectangle.GetType())))
MS\Internal\AutomationProxies\WindowsListViewScroll.cs (1)
56si.cbSize = Marshal.SizeOf (si.GetType ());
MS\Internal\AutomationProxies\WindowsMenu.cs (6)
504mbi.cbSize = Marshal.SizeOf(mbi.GetType()); 1886menuItemInfo.cbSize = Marshal.SizeOf(menuItemInfo.GetType()); 1901menuItemInfo.cbSize = Marshal.SizeOf (menuItemInfo.GetType ()); 1945menuItemInfo.cbSize = Marshal.SizeOf(menuItemInfo.GetType()); 2552menuItemInfo.cbSize = Marshal.SizeOf(menuItemInfo.GetType()); 2593int readSize = Marshal.SizeOf(msaaMenuInfo.GetType());
MS\Internal\AutomationProxies\WindowsRebar.cs (3)
206return XSendMessage.XSendGetIndex(_hwnd, NativeMethods.RB_HITTEST, IntPtr.Zero, new IntPtr(&rbHitTestInfo), Marshal.SizeOf(rbHitTestInfo.GetType())); 399if (!XSendMessage.XSend(hwnd, NativeMethods.RB_GETRECT, new IntPtr(item), new IntPtr(&rectW32), Marshal.SizeOf(rectW32.GetType()), XSendMessage.ErrorValue.Zero)) 435if (XSendMessage.XSend(_hwnd, NativeMethods.RB_GETBANDINFOA, new IntPtr(_item), new IntPtr(&rebarBandInfo), Marshal.SizeOf(rebarBandInfo.GetType()), XSendMessage.ErrorValue.Zero))
MS\Internal\AutomationProxies\WindowsRichEditRange.cs (1)
1233Marshal.ThrowExceptionForHR(hr);
MS\Internal\AutomationProxies\WindowsScroll.cs (6)
127sbi.cbSize = Marshal.SizeOf(sbi.GetType()); 143si.cbSize = Marshal.SizeOf (si.GetType ()); 195si.cbSize = Marshal.SizeOf (si.GetType ()); 250si.cbSize = Marshal.SizeOf (si.GetType ()); 291si.cbSize = Marshal.SizeOf(si.GetType ()); 367si.cbSize = Marshal.SizeOf (si.GetType ());
MS\Internal\AutomationProxies\WindowsScrollBar.cs (8)
135sbi.cbSize = Marshal.SizeOf (sbi.GetType ()); 431si.cbSize = Marshal.SizeOf (si.GetType ()); 445sbi.cbSize = Marshal.SizeOf (sbi.GetType ()); 519sbi.cbSize = Marshal.SizeOf (sbi.GetType ()); 572si.cbSize = Marshal.SizeOf (si.GetType ()); 625si.cbSize = Marshal.SizeOf (si.GetType ()); 711sbi.cbSize = Marshal.SizeOf (sbi.GetType ()); 726sbi.cbSize = Marshal.SizeOf(sbi.GetType());
MS\Internal\AutomationProxies\WindowsScrollBarBits.cs (3)
205si.cbSize = Marshal.SizeOf (si.GetType ()); 223sbi.cbSize = Marshal.SizeOf (sbi.GetType ()); 542si.cbSize = Marshal.SizeOf (si.GetType ());
MS\Internal\AutomationProxies\WindowsSlider.cs (2)
460XSendMessage.XSend(hwnd, NativeMethods.TBM_GETCHANNELRECT, IntPtr.Zero, new IntPtr(&rcChannel), Marshal.SizeOf(rcChannel.GetType()), XSendMessage.ErrorValue.NoCheck); 472XSendMessage.XSend(hwnd, NativeMethods.TBM_GETTHUMBRECT, IntPtr.Zero, new IntPtr(&rcThumb), Marshal.SizeOf(rcThumb.GetType()), XSendMessage.ErrorValue.NoCheck);
MS\Internal\AutomationProxies\WindowsSysHeader.cs (2)
161index = XSendMessage.XSendGetIndex(_hwnd, NativeMethods.HDM_HITTEST, IntPtr.Zero, new IntPtr(&HitTestInfo), Marshal.SizeOf(HitTestInfo.GetType())); 568result = XSendMessage.XSend(_hwnd, NativeMethods.HDM_GETITEMRECT, new IntPtr(index), new IntPtr(&rectW32), Marshal.SizeOf(rectW32.GetType()), XSendMessage.ErrorValue.Zero);
MS\Internal\AutomationProxies\WindowsTab.cs (3)
276index = XSendMessage.XSendGetIndex(_hwnd, NativeMethods.TCM_HITTEST, IntPtr.Zero, new IntPtr(&hti), Marshal.SizeOf(hti.GetType())); 653result = XSendMessage.XSend(hwnd, NativeMethods.TCM_GETITEMRECT, new IntPtr(count - 1), new IntPtr(&rectW32), Marshal.SizeOf(rectW32.GetType()), XSendMessage.ErrorValue.Zero); 1272if (!XSendMessage.XSend(_hwnd, NativeMethods.TCM_GETITEMRECT, new IntPtr(_item), new IntPtr(&rectW32), Marshal.SizeOf(rectW32.GetType()), XSendMessage.ErrorValue.Zero))
MS\Internal\AutomationProxies\WindowsTreeView.cs (3)
555if (!XSendMessage.XSend(hwnd, NativeMethods.TVM_GETITEMRECT, partialDisplay, rectangle, Marshal.SizeOf(rc.GetType()))) 935if (Marshal.SizeOf(_hItem.GetType()) > sizeof(int)) 1592int readSize = Marshal.SizeOf(ent.GetType());
MS\Win32\NativeMethods.cs (1)
1486internal static int comboboxInfoSize = Marshal.SizeOf(typeof(NativeMethods.COMBOBOXINFO));
MS\Win32\UnsafeNativeMethods.cs (2)
378error = Marshal.GetLastWin32Error(); 385error = Marshal.GetLastWin32Error();
UIAutomationProvider (1)
MS\Internal\Automation\UiaCoreProviderApi.cs (1)
105Marshal.ThrowExceptionForHR(hr, (IntPtr)(-1));
UIAutomationTypes (57)
MS\Internal\Automation\UiaCoreTypesApi.cs (1)
102Marshal.ThrowExceptionForHR(hr, (IntPtr)(-1));
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsCLR.cs (35)
1525return Marshal.SizeOf(typeof(MONITORINFOEX)); 1538return Marshal.SizeOf(typeof(TRACKMOUSEEVENT)); 1593return Marshal.SizeOf(typeof(NONCLIENTMETRICS)); 1608return Marshal.SizeOf(typeof(ICONMETRICS)); 1738return Marshal.SizeOf(typeof(MENUITEMINFO_T)); 1785return Marshal.SizeOf(typeof(OPENFILENAME_I)); 1964return Marshal.SizeOf(typeof(tagCONTROLINFO)); 1991Marshal.Release(this.data1); 2025IntPtr mem = Marshal.AllocCoTaskMem(16); 2026Marshal.WriteInt16(mem, vt); 2027Marshal.WriteInt16(mem, 2, reserved1); 2028Marshal.WriteInt16(mem, 4, reserved2); 2029Marshal.WriteInt16(mem, 6, reserved3); 2030Marshal.WriteInt32(mem, 8, (int) data1); 2031Marshal.WriteInt32(mem, 12, (int) data2); 2049val = (IntPtr) Marshal.ReadByte(val); 2055val = (IntPtr) Marshal.ReadByte(val); 2062val = (IntPtr) Marshal.ReadInt16(val); 2068val = (IntPtr) Marshal.ReadInt16(val); 2075val = (IntPtr) Marshal.ReadInt32(val); 2082val = (IntPtr) Marshal.ReadInt32(val); 2089longVal = Marshal.ReadInt64(val); 2123return Marshal.PtrToStringUni(val); 2126return Marshal.PtrToStringAnsi(val); 2131return Marshal.GetObjectForIUnknown(val); 2145VARIANT varStruct = Marshal.PtrToStructure<VARIANT>(val); 2149Guid guid = Marshal.PtrToStructure<Guid>(val); 2183return Marshal.ReadIntPtr(value); 2305if (Marshal.SystemDefaultCharSize == 1) 2336IntPtr result = Marshal.AllocCoTaskMem(buffer.Length); 2337Marshal.Copy(buffer, 0, result, buffer.Length); 2360Marshal.Copy(ptr, buffer, 0, buffer.Length); 2394IntPtr result = Marshal.AllocCoTaskMem(buffer.Length * 2); 2395Marshal.Copy(buffer, 0, result, buffer.Length); 2417Marshal.Copy(ptr, buffer, 0, buffer.Length);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsOther.cs (5)
86return Marshal.SizeOf(typeof(OSVERSIONINFOEX)); 157return Marshal.SizeOf(typeof(DOCHOSTUIINFO)); 513return Marshal.SizeOf(typeof(BITMAPINFO)); 544return Marshal.SizeOf(typeof(SECURITY_ATTRIBUTES)); 1083return Marshal.SizeOf(typeof(ANIMATIONINFO));
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\UnsafeNativeMethodsCLR.cs (16)
246int error = Marshal.GetLastWin32Error(); 269int error = Marshal.GetLastWin32Error(); 285int win32Err = Marshal.GetLastWin32Error(); 362int win32Err = Marshal.GetLastWin32Error(); 376int win32Err = Marshal.GetLastWin32Error(); 466int errorCode = Marshal.GetLastWin32Error(); 479int errorCode = Marshal.GetLastWin32Error(); 895int error = Marshal.GetLastWin32Error(); 916int error = Marshal.GetLastWin32Error(); 959int error = Marshal.GetLastWin32Error(); 974int error = Marshal.GetLastWin32Error(); 2551VariantSize = (int)Marshal.OffsetOf(typeof(FindSizeOfVariant), "b"); 2564mem = Marshal.AllocCoTaskMem(len * VariantSize); 2568Marshal.GetNativeVariantForObject(args[i], (IntPtr)(a + VariantSize * i)); 2605Marshal.FreeCoTaskMem(mem); 2609Marshal.ThrowExceptionForHR(hr);
vbc (6)
src\roslyn\src\Compilers\Shared\BuildClient.cs (1)
363var commandLine = Marshal.PtrToStringUni(ptr)!;
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (5)
469/// <returns>Pointer to environment block that must be freed with <see cref="Marshal.FreeHGlobal"/></returns> 491return Marshal.StringToHGlobalUni(envBlock.ToString()); 572startInfo.cb = Marshal.SizeOf(startInfo); 614logger.LogError("Failed to create process. GetLastError={0}", Marshal.GetLastWin32Error()); 622Marshal.FreeHGlobal(environmentBlockPtr);
VBCSCompiler (7)
src\roslyn\src\Compilers\Server\VBCSCompiler\MemoryHelper.cs (1)
21this.Length = (int)Marshal.SizeOf(this);
src\roslyn\src\Compilers\Shared\BuildClient.cs (1)
363var commandLine = Marshal.PtrToStringUni(ptr)!;
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (5)
469/// <returns>Pointer to environment block that must be freed with <see cref="Marshal.FreeHGlobal"/></returns> 491return Marshal.StringToHGlobalUni(envBlock.ToString()); 572startInfo.cb = Marshal.SizeOf(startInfo); 614logger.LogError("Failed to create process. GetLastError={0}", Marshal.GetLastWin32Error()); 622Marshal.FreeHGlobal(environmentBlockPtr);
WindowsFormsIntegration (1)
System\Windows\Integration\WindowsFormsHost.cs (1)
967throw new Win32Exception(Marshal.GetLastWin32Error());