209 references to FreeHGlobal
aspire (3)
Processes\WindowsConsoleProcessJob.cs (1)
102Marshal.FreeHGlobal(infoPtr);
Processes\WindowsProcessInterop.cs (2)
485Marshal.FreeHGlobal(envBlockHandle); 511Marshal.FreeHGlobal(attrList);
Aspire.Hosting.Browsers (8)
BrowserLogsPipeBrowserProcessLauncher.Unix.cs (3)
185Marshal.FreeHGlobal(Pointer); 227Marshal.FreeHGlobal(Pointer); 327Marshal.FreeHGlobal(Pointer);
BrowserLogsPipeBrowserProcessLauncher.Windows.cs (5)
139Marshal.FreeHGlobal(startupInfoPointer); 140Marshal.FreeHGlobal(attributeList); 141Marshal.FreeHGlobal(handleList); 142Marshal.FreeHGlobal(commandLine); 294Marshal.FreeHGlobal(jobInfoPointer);
Aspire.Hosting.Browsers.Tests (8)
src\Aspire.Hosting.Browsers\BrowserLogsPipeBrowserProcessLauncher.Unix.cs (3)
185Marshal.FreeHGlobal(Pointer); 227Marshal.FreeHGlobal(Pointer); 327Marshal.FreeHGlobal(Pointer);
src\Aspire.Hosting.Browsers\BrowserLogsPipeBrowserProcessLauncher.Windows.cs (5)
139Marshal.FreeHGlobal(startupInfoPointer); 140Marshal.FreeHGlobal(attributeList); 141Marshal.FreeHGlobal(handleList); 142Marshal.FreeHGlobal(commandLine); 294Marshal.FreeHGlobal(jobInfoPointer);
csc (2)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
469/// <returns>Pointer to environment block that must be freed with <see cref="Marshal.FreeHGlobal"/></returns> 622Marshal.FreeHGlobal(environmentBlockPtr);
dotnet (2)
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26424.106\contentFiles\cs\net11.0\BuildServerConnection.cs (2)
469/// <returns>Pointer to environment block that must be freed with <see cref="Marshal.FreeHGlobal"/></returns> 622Marshal.FreeHGlobal(environmentBlockPtr);
Microsoft.AspNetCore.Authentication.Negotiate (1)
Internal\NegotiateChannelBinding.cs (1)
25Marshal.FreeHGlobal(handle);
Microsoft.AspNetCore.Cryptography.Internal (1)
SafeHandles\LocalAllocHandle.cs (1)
21Marshal.FreeHGlobal(handle); // actually calls LocalFree
Microsoft.AspNetCore.DataProtection (2)
Cng\DpapiSecretSerializerHelper.cs (2)
113Marshal.FreeHGlobal((IntPtr)dataOut.pbData); 254Marshal.FreeHGlobal((IntPtr)dataOut.pbData);
Microsoft.AspNetCore.Server.HttpSys (1)
NativeInterop\RequestQueue.cs (1)
129Marshal.FreeHGlobal(pSecurityDescriptor.Value);
Microsoft.Build.Tasks.CodeAnalysis (2)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
469/// <returns>Pointer to environment block that must be freed with <see cref="Marshal.FreeHGlobal"/></returns> 622Marshal.FreeHGlobal(environmentBlockPtr);
Microsoft.CodeAnalysis.Workspaces (1)
Serialization\SerializerService_Reference.cs (1)
501() => Marshal.FreeHGlobal(unmanagedMemory));
Microsoft.Diagnostics.DataContractReader.Legacy (2)
NativeStringHolder.cs (2)
62Marshal.FreeHGlobal(_objectPtr); 63Marshal.FreeHGlobal(_vtablePtr);
Microsoft.Extensions.Diagnostics.ResourceMonitoring (5)
Windows\Network\WindowsTcpStateInfo.cs (5)
120Marshal.FreeHGlobal(tcpTable); 126Marshal.FreeHGlobal(tcpTable); 133Marshal.FreeHGlobal(tcpTable); 173Marshal.FreeHGlobal(tcpTable); 198Marshal.FreeHGlobal(tcpTable);
Microsoft.ML.Vision (1)
ImageClassificationTrainer.cs (1)
1546Marshal.FreeHGlobal(data);
Microsoft.Win32.Registry (1)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
70Marshal.FreeHGlobal(nativeMsgPtr);
Microsoft.Win32.SystemEvents (1)
Microsoft\Win32\SystemEvents.cs (1)
1123Marshal.FreeHGlobal(lParam);
NuGet.Packaging (2)
Signing\Cms\NativeMethods.cs (1)
170Marshal.FreeHGlobal(handle);
Signing\Cms\NativeUtility.cs (1)
17Marshal.FreeHGlobal(ptr);
PresentationFramework (2)
MS\Internal\Printing\PrintDlgExMarshaler.cs (1)
683Marshal.FreeHGlobal(unmanagedBuffer);
System\Windows\Documents\NLGSpellerInterop.cs (1)
258Marshal.FreeHGlobal(inputArray);
PresentationUI (1)
MS\Internal\Documents\PeoplePickerWrapper.cs (1)
479Marshal.FreeHGlobal(_ptrToDsObjectNames);
System.Data.Odbc (1)
Common\System\Data\Common\SafeNativeMethods.cs (1)
19Marshal.FreeHGlobal(ptr);
System.Diagnostics.EventLog (12)
System\Diagnostics\Reader\NativeWrapper.cs (12)
382Marshal.FreeHGlobal(buffer); 411Marshal.FreeHGlobal(buffer); 441Marshal.FreeHGlobal(buffer); 477Marshal.FreeHGlobal(buffer); 551Marshal.FreeHGlobal(buffer); 581Marshal.FreeHGlobal(buffer); 618Marshal.FreeHGlobal(buffer); 786Marshal.FreeHGlobal(buffer); 884Marshal.FreeHGlobal(buffer); 930Marshal.FreeHGlobal(buffer); 1037Marshal.FreeHGlobal(buffer); 1069Marshal.FreeHGlobal(buffer);
System.Diagnostics.PerformanceCounter (3)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
70Marshal.FreeHGlobal(nativeMsgPtr);
System\Diagnostics\PerformanceData\CounterSetInstanceCounterDataSet.cs (1)
183Marshal.FreeHGlobal((IntPtr)_dataBlock);
System\Diagnostics\SharedPerformanceCounter.cs (1)
1764Marshal.FreeHGlobal((IntPtr)pSecurityDescriptor);
System.DirectoryServices (40)
System\DirectoryServices\ActiveDirectory\ActiveDirectorySite.cs (1)
224Marshal.FreeHGlobal(ptr);
System\DirectoryServices\ActiveDirectory\DirectoryServer.cs (1)
750Marshal.FreeHGlobal(unmanagedGuid);
System\DirectoryServices\ActiveDirectory\ForestTrustRelationshipInformation.cs (6)
286Marshal.FreeHGlobal((IntPtr)ptrList[i]!); 296Marshal.FreeHGlobal(records); 301Marshal.FreeHGlobal(forestInfo); 308Marshal.FreeHGlobal(target); 311Marshal.FreeHGlobal(fileTime); 442Marshal.FreeHGlobal(targetPtr);
System\DirectoryServices\ActiveDirectory\Locator.cs (1)
171Marshal.FreeHGlobal(sockAddressList);
System\DirectoryServices\ActiveDirectory\TrustHelper.cs (20)
114Marshal.FreeHGlobal(target); 238Marshal.FreeHGlobal(target); 244Marshal.FreeHGlobal(newInfo); 319Marshal.FreeHGlobal(target); 420Marshal.FreeHGlobal(target); 423Marshal.FreeHGlobal(ptr); 426Marshal.FreeHGlobal(data); 538Marshal.FreeHGlobal(fileTime); 547Marshal.FreeHGlobal(unmanagedPassword); 550Marshal.FreeHGlobal(unmanagedAuthData); 665Marshal.FreeHGlobal(target); 671Marshal.FreeHGlobal(newBuffer); 674Marshal.FreeHGlobal(fileTime); 677Marshal.FreeHGlobal(unmanagedPassword); 680Marshal.FreeHGlobal(unmanagedAuthData); 806Marshal.FreeHGlobal(target); 812Marshal.FreeHGlobal(newBuffer); 815Marshal.FreeHGlobal(fileTime); 818Marshal.FreeHGlobal(unmanagedPassword); 821Marshal.FreeHGlobal(unmanagedAuthData);
System\DirectoryServices\ActiveDirectory\Utils.cs (9)
162Marshal.FreeHGlobal(ptr); 165Marshal.FreeHGlobal(name); 238Marshal.FreeHGlobal(ptr); 241Marshal.FreeHGlobal(name); 2021Marshal.FreeHGlobal(pCopyOfUserSid); 2024Marshal.FreeHGlobal(pMachineDomainSid); 2134Marshal.FreeHGlobal(pBuffer); 2296Marshal.FreeHGlobal(pSid); 2314Marshal.FreeHGlobal(pBytes);
System\DirectoryServices\DirectorySearcher.cs (2)
856Marshal.FreeHGlobal(vlvPtr); 948Marshal.FreeHGlobal(ptr);
System.DirectoryServices.AccountManagement (15)
System\DirectoryServices\AccountManagement\AD\ADStoreCtx_LoadStore.cs (2)
542Marshal.FreeHGlobal(pSid); 597Marshal.FreeHGlobal(pSid);
System\DirectoryServices\AccountManagement\AD\SidList.cs (1)
256Marshal.FreeHGlobal(pSid);
System\DirectoryServices\AccountManagement\AuthZSet.cs (2)
216Marshal.FreeHGlobal(pBuffer); 540Marshal.FreeHGlobal(handle);
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 (7)
143Marshal.FreeHGlobal(pSid); 165Marshal.FreeHGlobal(pBytes); 196Marshal.FreeHGlobal(pSid); 269Marshal.FreeHGlobal(pSid); 333Marshal.FreeHGlobal(pCopyOfUserSid); 336Marshal.FreeHGlobal(pMachineDomainSid); 460Marshal.FreeHGlobal(pBuffer);
System.DirectoryServices.Protocols (32)
src\runtime\src\libraries\Common\src\Interop\Interop.Ldap.cs (2)
303Marshal.FreeHGlobal(attribute); 308Marshal.FreeHGlobal(values);
System\DirectoryServices\Protocols\common\BerConverter.cs (4)
448Marshal.FreeHGlobal(berValue.bv_val); 567Marshal.FreeHGlobal(ptr); 569Marshal.FreeHGlobal(berValArray); 577Marshal.FreeHGlobal(managedBerval.bv_val);
System\DirectoryServices\Protocols\Interop\LdapPal.Linux.cs (1)
139Marshal.FreeHGlobal(passwordPtr);
System\DirectoryServices\Protocols\Interop\SafeHandles.cs (1)
22Marshal.FreeHGlobal(handle);
System\DirectoryServices\Protocols\ldap\LdapConnection.cs (14)
779Marshal.FreeHGlobal(tempPtr); 782Marshal.FreeHGlobal(serverControlArray); 791Marshal.FreeHGlobal(managedServerControls[i].ldctl_oid); 798Marshal.FreeHGlobal(managedServerControls[i].ldctl_value.bv_val); 812Marshal.FreeHGlobal(tempPtr); 816Marshal.FreeHGlobal(clientControlArray); 825Marshal.FreeHGlobal(managedClientControls[i].ldctl_oid); 832Marshal.FreeHGlobal(managedClientControls[i].ldctl_value.bv_val); 846Marshal.FreeHGlobal(tempPtr); 850Marshal.FreeHGlobal(modArray); 857Marshal.FreeHGlobal(tempPtr); 862Marshal.FreeHGlobal(berValuePtr.bv_val); 872Marshal.FreeHGlobal(tempPtr); 876Marshal.FreeHGlobal(searchAttributes);
System\DirectoryServices\Protocols\ldap\LdapConnection.Linux.cs (1)
151Marshal.FreeHGlobal(ptrToDefaults);
System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs (9)
679Marshal.FreeHGlobal(tempPtr); 682Marshal.FreeHGlobal(serverControlArray); 691Marshal.FreeHGlobal(managedServerControls[i].ldctl_oid); 698Marshal.FreeHGlobal(managedServerControls[i].ldctl_value.bv_val); 712Marshal.FreeHGlobal(tempPtr); 716Marshal.FreeHGlobal(clientControlArray); 725Marshal.FreeHGlobal(managedClientControls[i].ldctl_oid); 731Marshal.FreeHGlobal(managedClientControls[i].ldctl_value.bv_val); 864Marshal.FreeHGlobal(inValue);
System.Drawing.Common (5)
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 (1)
52Marshal.FreeHGlobal(_parameterValue);
System.IO.FileSystem.AccessControl (1)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
70Marshal.FreeHGlobal(nativeMsgPtr);
System.Management (2)
System\Management\ManagementObject.cs (2)
1520Marshal.FreeHGlobal(ppwbemCallResult); 1818Marshal.FreeHGlobal(ppwbemCallResult);
System.Net.Http.WinHttpHandler (5)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
70Marshal.FreeHGlobal(nativeMsgPtr);
System\Net\Http\WinHttpChannelBinding.cs (2)
34Marshal.FreeHGlobal(data); 70Marshal.FreeHGlobal(this.handle);
System\Net\Http\WinHttpHandler.cs (2)
1328Marshal.FreeHGlobal(proxyInfo.Proxy); 1329Marshal.FreeHGlobal(proxyInfo.ProxyBypass);
System.Net.NetworkInformation (1)
System\Net\NetworkInformation\LinuxNetworkInterface.cs (1)
136Marshal.FreeHGlobal(globalMemory);
System.Net.Security (1)
System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs (1)
63Marshal.FreeHGlobal(handle);
System.Private.CoreLib (5)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.cs (2)
1309FreeHGlobal(s); 1319FreeHGlobal(s);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (1)
77public static void FreeCoTaskMem(IntPtr ptr) => FreeHGlobal(ptr);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (2)
402Marshal.FreeHGlobal(ptr); 468Marshal.FreeHGlobal(handle);
System.Reflection.Metadata (1)
System\Reflection\Internal\MemoryBlocks\NativeHeapMemoryBlock.cs (1)
49Marshal.FreeHGlobal(ptr);
System.Security.AccessControl (3)
System\Security\AccessControl\SecurityDescriptor.cs (1)
499Marshal.FreeHGlobal(byteArray);
System\Security\AccessControl\Win32.cs (2)
40Marshal.FreeHGlobal(ByteArray); 172Marshal.FreeHGlobal(ByteArray);
System.Security.Cryptography (10)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
70Marshal.FreeHGlobal(nativeMsgPtr);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeUnicodeStringHandle.cs (1)
54Marshal.FreeHGlobal(handle);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.EncryptDecrypt.cs (2)
108Marshal.FreeHGlobal(namePtr); 188Marshal.FreeHGlobal(namePtr);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSACng.SignVerify.cs (3)
79Marshal.FreeHGlobal(namePtr); 116Marshal.FreeHGlobal(namePtr); 164Marshal.FreeHGlobal(namePtr);
System\Security\Cryptography\CngAsnFormatter.cs (1)
47Marshal.FreeHGlobal(oidValuePtr);
System\Security\Cryptography\X509Certificates\CertificatePal.Windows.cs (1)
326Marshal.FreeHGlobal(pFriendlyName);
System\Security\Cryptography\X509Certificates\SafeLocalAllocHandle.cs (1)
23Marshal.FreeHGlobal(handle);
System.Security.Cryptography.Pkcs (1)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
70Marshal.FreeHGlobal(nativeMsgPtr);
System.Security.Cryptography.ProtectedData (2)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
70Marshal.FreeHGlobal(nativeMsgPtr);
System\Security\Cryptography\ProtectedData.cs (1)
405Marshal.FreeHGlobal(outputBlob.pbData);
System.Security.Principal.Windows (2)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeLocalAllocHandle.cs (1)
39Marshal.FreeHGlobal(handle);
System\Security\Principal\Win32.cs (1)
124Marshal.FreeHGlobal((IntPtr)pSid);
System.ServiceProcess.ServiceController (8)
System\ServiceProcess\ServiceBase.cs (2)
637Marshal.FreeHGlobal(entries[i].name); 641Marshal.FreeHGlobal(entriesPointer);
System\ServiceProcess\ServiceController.cs (6)
226Marshal.FreeHGlobal(enumBuffer); 376Marshal.FreeHGlobal(bufPtr); 411Marshal.FreeHGlobal(bufPtr); 794Marshal.FreeHGlobal(memory); 889Marshal.FreeHGlobal(argPtrs[i]); 907Marshal.FreeHGlobal(argPtrs[i]);
System.Speech (1)
Internal\HGlobalSafeHandle.cs (1)
85Marshal.FreeHGlobal(handle);
System.Text.Encoding.CodePages (1)
Microsoft\Win32\SafeHandles\SafeAllocHHandle.cs (1)
28Marshal.FreeHGlobal(handle);
System.Threading.AccessControl (1)
src\runtime\src\libraries\Common\src\Interop\Windows\Kernel32\Interop.FormatMessage.cs (1)
70Marshal.FreeHGlobal(nativeMsgPtr);
System.Windows.Forms (5)
System\Windows\Forms\Components\KioskModeManager\KioskModeManager.cs (1)
871Marshal.FreeHGlobal(reasonString);
System\Windows\Forms\Controls\ListView\ListView.cs (2)
4159Marshal.FreeHGlobal(hGlobalColumns); 4237Marshal.FreeHGlobal(hGlobalColumns);
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.cs (2)
263private static void FreeConfig(IntPtr ptrToFree) => Marshal.FreeHGlobal(ptrToFree); 1548Marshal.FreeHGlobal(ptrToFree);
System.Windows.Forms.Design (1)
System\Drawing\Design\ColorEditor.CustomColorDialog.cs (1)
49Marshal.FreeHGlobal(_hInstance);
vbc (2)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
469/// <returns>Pointer to environment block that must be freed with <see cref="Marshal.FreeHGlobal"/></returns> 622Marshal.FreeHGlobal(environmentBlockPtr);
VBCSCompiler (2)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
469/// <returns>Pointer to environment block that must be freed with <see cref="Marshal.FreeHGlobal"/></returns> 622Marshal.FreeHGlobal(environmentBlockPtr);