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