@@ -421,7 +421,6 @@ HRESULT CordbValue::InternalCreateHandle(CorDebugHandleType handleType,
421421
422422 DebuggerIPCEvent event;
423423 CordbProcess *process;
424- BOOL fStrong = FALSE ;
425424
426425 // @dbgtodo- , as part of inspection, convert this path to throwing.
427426 if (ppHandle == NULL )
@@ -431,13 +430,14 @@ HRESULT CordbValue::InternalCreateHandle(CorDebugHandleType handleType,
431430
432431 *ppHandle = NULL ;
433432
434- if (handleType == HANDLE_STRONG )
433+ switch (handleType)
435434 {
436- fStrong = TRUE ;
437- }
438- else
439- {
440- _ASSERTE (handleType == HANDLE_WEAK_TRACK_RESURRECTION);
435+ case HANDLE_STRONG:
436+ case HANDLE_WEAK_TRACK_RESURRECTION:
437+ case HANDLE_PINNED:
438+ break ;
439+ default :
440+ return E_INVALIDARG;
441441 }
442442
443443
@@ -460,7 +460,7 @@ HRESULT CordbValue::InternalCreateHandle(CorDebugHandleType handleType,
460460
461461 CORDB_ADDRESS addr = GetValueHome () != NULL ? GetValueHome ()->GetAddress () : NULL ;
462462 event.CreateHandle .objectToken = CORDB_ADDRESS_TO_PTR (addr);
463- event.CreateHandle .fStrong = fStrong ;
463+ event.CreateHandle .handleType = handleType ;
464464
465465 // Note: two-way event here...
466466 HRESULT hr = process->SendIPCEvent (&event, sizeof (DebuggerIPCEvent));
@@ -1827,6 +1827,10 @@ HRESULT CordbObjectValue::QueryInterface(REFIID id, void **pInterface)
18271827 {
18281828 *pInterface = static_cast <ICorDebugHeapValue3*>(this );
18291829 }
1830+ else if (id == IID_ICorDebugHeapValue4)
1831+ {
1832+ *pInterface = static_cast <ICorDebugHeapValue4*>(this );
1833+ }
18301834 else if ((id == IID_ICorDebugStringValue) &&
18311835 (m_info.objTypeData .elementType == ELEMENT_TYPE_STRING))
18321836 {
@@ -1963,6 +1967,21 @@ HRESULT CordbObjectValue::CreateHandle(
19631967 return CordbValue::InternalCreateHandle (handleType, ppHandle);
19641968} // CreateHandle
19651969
1970+ /*
1971+ * Creates a pinned handle for this heap value.
1972+ *
1973+ * Not Implemented In-Proc.
1974+ */
1975+ HRESULT CordbObjectValue::CreatePinnedHandle (
1976+ ICorDebugHandleValue ** ppHandle)
1977+ {
1978+ PUBLIC_API_ENTRY (this );
1979+ FAIL_IF_NEUTERED (this );
1980+ ATT_REQUIRE_STOPPED_MAY_FAIL (GetProcess ());
1981+
1982+ return CordbValue::InternalCreateHandle (HANDLE_PINNED, ppHandle);
1983+ } // CreatePinnedHandle
1984+
19661985// Get class information for this object
19671986// Arguments:
19681987// output: ppClass - ICDClass instance for this object
@@ -3325,6 +3344,10 @@ HRESULT CordbBoxValue::QueryInterface(REFIID id, void **pInterface)
33253344 {
33263345 *pInterface = static_cast <ICorDebugHeapValue3*>(this );
33273346 }
3347+ else if (id == IID_ICorDebugHeapValue4)
3348+ {
3349+ *pInterface = static_cast <ICorDebugHeapValue4*>(this );
3350+ }
33283351 else if (id == IID_IUnknown)
33293352 {
33303353 *pInterface = static_cast <IUnknown*>(static_cast <ICorDebugBoxValue*>(this ));
@@ -3387,6 +3410,24 @@ HRESULT CordbBoxValue::CreateHandle(
33873410 return CordbValue::InternalCreateHandle (handleType, ppHandle);
33883411} // CordbBoxValue::CreateHandle
33893412
3413+ // Creates a pinned handle for this heap value.
3414+ // Not Implemented In-Proc.
3415+ // Create a handle for a heap object.
3416+ // @todo: How to prevent this being called by non-heap object?
3417+ // Arguments:
3418+ // output: ppHandle - on success, the newly created handle
3419+ // Return Value: S_OK on success or E_INVALIDARG, E_OUTOFMEMORY, or CORDB_E_HELPER_MAY_DEADLOCK
3420+ HRESULT CordbBoxValue::CreatePinnedHandle (
3421+ ICorDebugHandleValue ** ppHandle)
3422+ {
3423+ PUBLIC_API_ENTRY (this );
3424+ FAIL_IF_NEUTERED (this );
3425+ ATT_REQUIRE_STOPPED_MAY_FAIL (GetProcess ());
3426+
3427+ return CordbValue::InternalCreateHandle (HANDLE_PINNED, ppHandle);
3428+ } // CreatePinnedHandle
3429+
3430+
33903431HRESULT CordbBoxValue::GetValue (void *pTo)
33913432{
33923433 // Can't get a whole copy of a box.
@@ -3565,6 +3606,10 @@ HRESULT CordbArrayValue::QueryInterface(REFIID id, void **pInterface)
35653606 {
35663607 *pInterface = static_cast <ICorDebugHeapValue3*>(this );
35673608 }
3609+ else if (id == IID_ICorDebugHeapValue4)
3610+ {
3611+ *pInterface = static_cast <ICorDebugHeapValue4*>(this );
3612+ }
35683613 else if (id == IID_IUnknown)
35693614 {
35703615 *pInterface = static_cast <IUnknown*>(static_cast <ICorDebugArrayValue*>(this ));
@@ -3888,6 +3933,23 @@ HRESULT CordbArrayValue::CreateHandle(
38883933 return CordbValue::InternalCreateHandle (handleType, ppHandle);
38893934} // CordbArrayValue::CreateHandle
38903935
3936+ /*
3937+ * Creates a pinned handle for this heap value.
3938+ * Not Implemented In-Proc.
3939+ * Arguments:
3940+ * output: ppHandle - on success, the newly created handle
3941+ * Return Value: S_OK on success or E_INVALIDARG, E_OUTOFMEMORY, or CORDB_E_HELPER_MAY_DEADLOCK
3942+ */
3943+ HRESULT CordbArrayValue::CreatePinnedHandle (
3944+ ICorDebugHandleValue ** ppHandle)
3945+ {
3946+ PUBLIC_API_ENTRY (this );
3947+ FAIL_IF_NEUTERED (this );
3948+ ATT_REQUIRE_STOPPED_MAY_FAIL (GetProcess ());
3949+
3950+ return CordbValue::InternalCreateHandle (HANDLE_PINNED, ppHandle);
3951+ } // CreatePinnedHandle
3952+
38913953// get a copy of the array
38923954// Arguments
38933955// output: pTo - pointer to a caller-allocated and managed buffer to hold the copy. The caller must guarantee
0 commit comments