129 references to AllocHGlobal
mscorlib (2)
system\security\securestring.cs (2)
543ptr = Marshal.AllocHGlobal((length + 1) * 2); 611ptr = Marshal.AllocHGlobal(byteCount);
PresentationCore (2)
Core\CSharp\System\Windows\Media\ColorTransform.cs (2)
147paInputColors = Marshal.AllocHGlobal(64); 151paOutputColors = Marshal.AllocHGlobal(64);
PresentationFramework (7)
src\Framework\MS\Internal\Printing\PrintDlgExMarshaler.cs (6)
582pdex.lpPageRanges = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NativeMethods.PRINTPAGERANGE))); 622unmanagedBuffer = Marshal.AllocHGlobal(cbBufferSize); 659pdex.lpPageRanges = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NativeMethods.PRINTPAGERANGE))); 699unmanagedBuffer = Marshal.AllocHGlobal(cbBufferSize); 832hDevNames = Marshal.AllocHGlobal(cbDevNames); 938IntPtr hDevMode = Marshal.AllocHGlobal(devModeData.Length);
src\Framework\System\Windows\Documents\NLGSpellerInterop.cs (1)
218IntPtr inputArray = Marshal.AllocHGlobal(count * 2);
System (4)
net\System\Net\_AutoWebProxyScriptHelper.cs (1)
651 IntPtr pSocketAddressList = Marshal.AllocHGlobal(cbRequiredBytes);
net\System\Net\_SafeNetHandles.cs (1)
914IntPtr ptr = Marshal.AllocHGlobal(size);
net\System\Net\_SSPIWrapper.cs (1)
333IntPtr p = Marshal.AllocHGlobal(alertTokenByteSize);
parent\parent\parent\InternalApis\NDP_FX\inc\ZLibNative.cs (1)
763IntPtr ptr = Marshal.AllocHGlobal(byteCount);
System.Configuration (1)
System\Configuration\DPAPIProtectedConfigurationProvider.cs (1)
239db.pbData = Marshal.AllocHGlobal(db.cbData);
System.Core (13)
System\Diagnostics\Eventing\Reader\NativeWrapper.cs (12)
421buffer = Marshal.AllocHGlobal((int)bufferNeeded); 448buffer = Marshal.AllocHGlobal((int)bufferNeeded); 476buffer = Marshal.AllocHGlobal((int)bufferNeeded); 502buffer = Marshal.AllocHGlobal((int)bufferNeeded); 588buffer = Marshal.AllocHGlobal((int)bufferNeeded); 614buffer = Marshal.AllocHGlobal((int)bufferNeeded); 644buffer = Marshal.AllocHGlobal((int)bufferNeeded); 803buffer = Marshal.AllocHGlobal((int)bufferNeeded); 835buffer = Marshal.AllocHGlobal((int)bufferNeeded); 933buffer = Marshal.AllocHGlobal((int)bufferNeeded); 1033buffer = Marshal.AllocHGlobal(bufferNeeded * 2); 1083buffer = Marshal.AllocHGlobal((int)bufferNeeded);
System\Diagnostics\PerformanceData\CounterSetInstanceCounterDataSet.cs (1)
125m_dataBlock = (byte *) Marshal.AllocHGlobal(m_instance.m_counterSet.m_idToCounter.Count * sizeof(Int64));
System.Data (6)
fx\src\data\System\Data\SqlClient\SqlConnection.cs (4)
2347pNtAuthority = Marshal.AllocHGlobal(sizeofSID_IDENTIFIER_AUTHORITY); 2389pSecurityDescriptor = Marshal.AllocHGlobal(sizeofSECURITY_DESCRIPTOR); 2401pDacl = Marshal.AllocHGlobal(cbAcl); 2476pSecurityAttributes = Marshal.AllocHGlobal(sizeofSECURITY_ATTRIBUTES);
fx\src\data\System\Data\SQLTypes\SQLFileStream.cs (2)
895pbBuffer = Marshal.AllocHGlobal ( Marshal.SizeOf ( objectName ) ); 1062pbBuffer = Marshal.AllocHGlobal(m_cbBuffer);
System.Drawing (63)
commonui\System\Drawing\Advanced\ColorPalette.cs (1)
93IntPtr memory = Marshal.AllocHGlobal(checked(4 * (2 + length)));
commonui\System\Drawing\Advanced\EncoderParameter.cs (16)
103parameterValue = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Byte))); 125parameterValue = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Byte))); 144parameterValue = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Int16))); 163parameterValue = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(Int32))); 184parameterValue = Marshal.AllocHGlobal(2*size); 206parameterValue = Marshal.AllocHGlobal(2*size); 230parameterValue = Marshal.AllocHGlobal(4*size); 270parameterValue = Marshal.AllocHGlobal(numberOfValues); 293parameterValue = Marshal.AllocHGlobal(numberOfValues); 314parameterValue = Marshal.AllocHGlobal(checked(numberOfValues*size)); 335parameterValue = Marshal.AllocHGlobal(checked(numberOfValues*size)); 365parameterValue = Marshal.AllocHGlobal(checked(numberOfValues*2*size)); 394parameterValue = Marshal.AllocHGlobal(checked(numberOfValues*2*size)); 427parameterValue = Marshal.AllocHGlobal(checked(numberOfValues*4*size)); 472parameterValue = Marshal.AllocHGlobal(bytes); 516parameterValue = Marshal.AllocHGlobal(bytes);
commonui\System\Drawing\Advanced\EncoderParameters.cs (1)
81IntPtr memory = Marshal.AllocHGlobal(checked(length * size + Marshal.SizeOf(typeof(IntPtr))));
commonui\System\Drawing\Advanced\Gdiplus.cs (4)
3263IntPtr memory = Marshal.AllocHGlobal(checked(count*size)); 3284IntPtr memory = Marshal.AllocHGlobal(checked(count*size)); 3305IntPtr memory = Marshal.AllocHGlobal(checked(count*size)); 3326IntPtr memory = Marshal.AllocHGlobal(checked(count*size));
commonui\System\Drawing\Advanced\GPStream.cs (1)
74IntPtr buffer = Marshal.AllocHGlobal(bufsize);
commonui\System\Drawing\Advanced\GraphicsPath.cs (5)
104IntPtr typebuf = Marshal.AllocHGlobal(count); 157IntPtr typebuf = Marshal.AllocHGlobal(count); 309IntPtr memoryPathData = Marshal.AllocHGlobal(3*IntPtr.Size); 310IntPtr memoryPoints = Marshal.AllocHGlobal(checked(ptSize*numPts)); 1723IntPtr buf = Marshal.AllocHGlobal(checked(count * size));
commonui\System\Drawing\Advanced\GraphicsPathIterator.cs (2)
274IntPtr memoryPts = Marshal.AllocHGlobal(checked(count * size)); 316IntPtr memoryPts = Marshal.AllocHGlobal(checked(count * size));
commonui\System\Drawing\Advanced\ImageAttributes.cs (1)
621IntPtr memory = Marshal.AllocHGlobal(checked(mapSize*size*2));
commonui\System\Drawing\Advanced\ImageCodecInfo.cs (2)
161IntPtr memory = Marshal.AllocHGlobal(size); 194IntPtr memory = Marshal.AllocHGlobal(size);
commonui\System\Drawing\Advanced\LinearGradientBrush.cs (8)
425factors = Marshal.AllocHGlobal(size); 426positions = Marshal.AllocHGlobal(size); 464factors = Marshal.AllocHGlobal(size); 465positions = Marshal.AllocHGlobal(size); 580colors = Marshal.AllocHGlobal(size); 581positions = Marshal.AllocHGlobal(size); 658colors = Marshal.AllocHGlobal(size); 659positions = Marshal.AllocHGlobal(size);
commonui\System\Drawing\Advanced\Matrix.cs (1)
193IntPtr buf = Marshal.AllocHGlobal(6 * 8); // 6 elements x 8 bytes (float)
commonui\System\Drawing\Advanced\Metafile.cs (3)
818IntPtr memory = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(MetafileHeaderEmf))); 863IntPtr memory = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(MetafileHeaderEmf))); 910IntPtr memory = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(MetafileHeaderEmf)));
commonui\System\Drawing\Advanced\PathGradientBrush.cs (8)
379factors = Marshal.AllocHGlobal(size); 380positions = Marshal.AllocHGlobal(size); 421factors = Marshal.AllocHGlobal(size); 422positions = Marshal.AllocHGlobal(size); 543colors = Marshal.AllocHGlobal(size); 544positions = Marshal.AllocHGlobal(size); 592colors = Marshal.AllocHGlobal(size); 593positions = Marshal.AllocHGlobal(size);
commonui\System\Drawing\Image.cs (5)
541IntPtr buffer = Marshal.AllocHGlobal(size); 993IntPtr memory = Marshal.AllocHGlobal(size); 1086IntPtr buffer = Marshal.AllocHGlobal(checked(size*count)); 1213IntPtr propdata = Marshal.AllocHGlobal(size); 1286IntPtr propdata = Marshal.AllocHGlobal(size);
commonui\System\Drawing\Pen.cs (2)
1005IntPtr buf = Marshal.AllocHGlobal(checked(4 * count)); 1036IntPtr buf = Marshal.AllocHGlobal(checked(4 * count));
commonui\System\Drawing\PropertyItemInternal.cs (1)
58propItemInternal.value = Marshal.AllocHGlobal(length);
commonui\System\Drawing\Region.cs (1)
1002IntPtr memoryRects = Marshal.AllocHGlobal(checked(rectsize*count));
commonui\System\Drawing\UnsafeNativeMethods.cs (1)
255IntPtr buffer = Marshal.AllocHGlobal(bufsize);
System.IdentityModel (1)
System\IdentityModel\SspiSafeHandles.cs (1)
1447IntPtr ptr = Marshal.AllocHGlobal(cb);
System.IdentityModel.Selectors (1)
infocard\common\managed\HGlobalSafeHandle.cs (1)
40return new HGlobalSafeHandle(Marshal.AllocHGlobal(bytes), bytes);
System.Management (3)
InteropClasses\WMIInterop.cs (1)
93hGlobal = Marshal.AllocHGlobal(rg.Length);
managementobject.cs (2)
1494ppwbemCallResult = Marshal.AllocHGlobal(IntPtr.Size); 1795ppwbemCallResult = Marshal.AllocHGlobal(IntPtr.Size);
System.Messaging (5)
System\Messaging\AccessControlList.cs (1)
151entries[i].data = (IntPtr)Marshal.AllocHGlobal(sidSize);
System\Messaging\Interop\Columns.cs (1)
26this.columnSet.columnIdentifiers = Marshal.AllocHGlobal(maxCount * 4);
System\Messaging\Interop\Restrictions.cs (3)
35IntPtr data = Marshal.AllocHGlobal(16); 42IntPtr data = Marshal.AllocHGlobal(16); 91this.restrinctions = Marshal.AllocHGlobal(maxCount * GetRestrictionSize());
System.Net (3)
net\PeerToPeer\Collaboration\UnsafeCollabNativeMethods.cs (1)
134handle = Marshal.AllocHGlobal(cb);
net\PeerToPeer\PeerNameRegistration.cs (2)
391IntPtr pSocketAddrList = Marshal.AllocHGlobal(cbRequriedBytes); 574IntPtr pSocketAddrList = Marshal.AllocHGlobal(cbRequriedBytes);
System.ServiceModel (4)
System\ServiceModel\Channels\ChannelBindingUtility.cs (1)
265base.SetHandle(Marshal.AllocHGlobal(bytesToAllocate));
System\ServiceModel\Channels\PeerUnsafeNativeMethods.cs (3)
265result.SetHandle(Marshal.AllocHGlobal(size)); 317result.SetHandle(Marshal.AllocHGlobal(size)); 346result.SetHandle(Marshal.AllocHGlobal(size));
System.ServiceModel.Activation (1)
System\ServiceModel\Activation\Interop\SafeHGlobalHandleCritical.cs (1)
79IntPtr ptr = Marshal.AllocHGlobal(cb);
System.Web (1)
AspNetEventSource.cs (1)
226PtrToNullChar = Marshal.AllocHGlobal(sizeof(char));
System.Windows.Forms (11)
winforms\Managed\System\WinForms\Control.cs (1)
16880IntPtr accelBlob = Marshal.AllocHGlobal(accelSize * accelCount * 2);
winforms\Managed\System\WinForms\FolderBrowserDialog.cs (3)
271pszDisplayName = Marshal.AllocHGlobal(NativeMethods.MAX_PATH * Marshal.SystemDefaultCharSize); 272pszSelectedPath = Marshal.AllocHGlobal((NativeMethods.MAX_PATH + 1) * Marshal.SystemDefaultCharSize); 349IntPtr pszSelectedPath = Marshal.AllocHGlobal((NativeMethods.MAX_PATH + 1) * Marshal.SystemDefaultCharSize);
winforms\Managed\System\WinForms\ListView.cs (3)
3914hGlobalColumns = Marshal.AllocHGlobal(lvItem.cColumns * Marshal.SizeOf(typeof(int))); 4573prc = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NativeMethods.RECT))); 4579pwpos = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NativeMethods.WINDOWPOS)));
winforms\Managed\System\WinForms\MenuItem.cs (1)
1049msaaMenuInfoPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(MsaaMenuInfoWithId)));
winforms\Managed\System\WinForms\MonthCalendar.cs (1)
1940mdsBuffer = Marshal.AllocHGlobal(mdsBufferSize);
winforms\Managed\System\WinForms\ToolBar.cs (1)
1377ptbbuttons = Marshal.AllocHGlobal(checked(cb * count));
winforms\Managed\System\WinForms\UnsafeNativeMethods.cs (1)
6658IntPtr buffer = Marshal.AllocHGlobal(bufsize);
WindowsBase (1)
parent\parent\InternalApis\NDP_FX\inc\ZLibNative.cs (1)
763IntPtr ptr = Marshal.AllocHGlobal(byteCount);