12 writes to hGlobal
System.Private.Windows.Core (11)
System\Private\Windows\Ole\Composition.ManagedToNativeAdapter.cs (5)
78
pmedium->
hGlobal
= PInvokeCore.GlobalAlloc(GLOBAL_ALLOC_FLAGS.GMEM_MOVEABLE | GLOBAL_ALLOC_FLAGS.GMEM_ZEROINIT, 1);
89
pmedium->
hGlobal
= HGLOBAL.Null;
144
pmedium->
hGlobal
= HGLOBAL.Null;
274
=> dataStream.SaveStreamToHGLOBAL(ref medium.
hGlobal
),
290
=> SaveObjectToHGLOBAL(ref medium.
hGlobal
, data, format),
System\Private\Windows\Ole\DragDropFormat.cs (4)
69
mediumDestination.
hGlobal
= (HGLOBAL)(nint)PInvokeCore.OleDuplicateData(
85
mediumDestination.
hGlobal
= mediumSource.hGlobal;
92
mediumDestination.
hGlobal
= HGLOBAL.Null;
121
_medium.
hGlobal
= HGLOBAL.Null;
System\Private\Windows\Ole\DragDropHelper.cs (2)
203
hGlobal
= PInvokeCore.GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, (nuint)sizeof(BOOL))
361
hGlobal
= PInvokeCore.GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, (nuint)sizeof(DROPDESCRIPTION))
System.Private.Windows.Core.Tests (1)
System\Private\Windows\Ole\HGlobalNativeDataObject.cs (1)
63
result = _stream.SaveStreamToHGLOBAL(ref pmedium->
hGlobal
);
52 references to hGlobal
PresentationCore (2)
System\Windows\Ole\WpfOleServices.cs (2)
123
(HBITMAP)(nint)medium.
hGlobal
,
137
object metafile = SystemDrawingHelper.GetMetafileFromHemf((HENHMETAFILE)(nint)medium.
hGlobal
);
System.Private.Windows.Core (28)
System\Private\Windows\Ole\Composition.ManagedToNativeAdapter.cs (10)
80
if (pmedium->
hGlobal
.IsNull)
88
PInvokeCore.GlobalFree(pmedium->
hGlobal
);
141
catch (Exception) when (!pmedium->
hGlobal
.IsNull)
143
PInvokeCore.GlobalFree(pmedium->
hGlobal
);
276
=> SaveDbcsToHGLOBAL(medium.
hGlobal
, data.ToString() ?? ""),
278
=> SaveUtf8ToHGLOBAL(medium.
hGlobal
, data.ToString() ?? ""),
280
=> SaveUtf16ToHGLOBAL(medium.
hGlobal
, data.ToString() ?? ""),
282
=> SaveFileListToHGLOBAL(medium.
hGlobal
, (string[])data),
284
=> SaveDbcsToHGLOBAL(medium.
hGlobal
, ((string[])data)[0]),
286
=> SaveUtf16ToHGLOBAL(medium.
hGlobal
, ((string[])data)[0]),
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (4)
322
if (medium.tymed == Com.TYMED.TYMED_HGLOBAL && !medium.
hGlobal
.IsNull && hr != HRESULT.COR_E_SERIALIZATION)
324
result = TryGetDataFromHGLOBAL(medium.
hGlobal
, in request, out data);
369
if (medium.tymed != Com.TYMED.TYMED_ISTREAM || medium.
hGlobal
.IsNull)
374
using ComScope<Com.IStream> pStream = new((Com.IStream*)medium.
hGlobal
);
System\Private\Windows\Ole\DragDropFormat.cs (4)
70
(HANDLE)(nint)mediumSource.
hGlobal
,
75
if (mediumDestination.
hGlobal
.IsNull)
85
mediumDestination.hGlobal = mediumSource.
hGlobal
;
86
Marshal.AddRef(mediumSource.
hGlobal
);
System\Private\Windows\Ole\DragDropHelper.cs (10)
134
void* basePtr = PInvokeCore.GlobalLock(dragDropFormat.Medium.
hGlobal
);
139
PInvokeCore.GlobalUnlock(dragDropFormat.Medium.
hGlobal
);
206
if (medium.
hGlobal
.IsNull)
211
void* basePtr = PInvokeCore.GlobalLock(medium.
hGlobal
);
214
PInvokeCore.GlobalFree(medium.
hGlobal
);
219
PInvokeCore.GlobalUnlock(medium.
hGlobal
);
364
if (medium.
hGlobal
.IsNull)
369
void* basePtr = PInvokeCore.GlobalLock(medium.
hGlobal
);
372
PInvokeCore.GlobalFree(medium.
hGlobal
);
380
PInvokeCore.GlobalUnlock(medium.
hGlobal
);
System.Windows.Forms (2)
System\Windows\Forms\OLE\WinFormsOleServices.cs (2)
108
&& !medium.
hGlobal
.IsNull
109
&& Image.FromHbitmap(medium.
hGlobal
) is Bitmap clipboardBitmap)
System.Windows.Forms.Tests (20)
System\Windows\Forms\DataObjectTests.cs (1)
2928
medium.
hGlobal
.IsNull.Should().BeTrue();
System\Windows\Forms\DragDropFormatTests.cs (6)
76
int handleSize = (int)PInvokeCore.GlobalSize(dragDropFormat.Medium.
hGlobal
);
80
Assert.True(dragDropFormat.Medium.
hGlobal
.IsNull);
109
Assert.NotEqual(medium.unionmember, data.
hGlobal
);
117
Assert.Equal(medium.unionmember, (nint)data.
hGlobal
);
146
(HANDLE)(nint)dragDropFormat.Medium.
hGlobal
,
149
_ => dragDropFormat.Medium.
hGlobal
,
System\Windows\Forms\DragDropHelperTests.cs (13)
121
void* basePtr = PInvokeCore.GlobalLock(dragDropFormat.Medium.
hGlobal
);
126
PInvokeCore.GlobalUnlock(dragDropFormat.Medium.
hGlobal
);
148
void* basePtr = PInvokeCore.GlobalLock(dragDropFormat.Medium.
hGlobal
);
153
PInvokeCore.GlobalUnlock(dragDropFormat.Medium.
hGlobal
);
217
void* basePtr = PInvokeCore.GlobalLock(dragDropFormat.Medium.
hGlobal
);
222
PInvokeCore.GlobalUnlock(dragDropFormat.Medium.
hGlobal
);
285
Assert.Equal(nint.Zero, (nint)dragDropFormat.Medium.
hGlobal
);
298
void* basePtr = PInvokeCore.GlobalLock(dragDropFormat.Medium.
hGlobal
);
303
PInvokeCore.GlobalUnlock(dragDropFormat.Medium.
hGlobal
);
325
void* basePtr = PInvokeCore.GlobalLock(dragDropFormat.Medium.
hGlobal
);
330
PInvokeCore.GlobalUnlock(dragDropFormat.Medium.
hGlobal
);
356
void* basePtr = PInvokeCore.GlobalLock(dragDropFormat.Medium.
hGlobal
);
358
PInvokeCore.GlobalUnlock(dragDropFormat.Medium.
hGlobal
);