Skip to content

Commit

Permalink
Implement ICorProfilerInfo13 to support object handle creation/destru…
Browse files Browse the repository at this point in the history
…ction/access (#71257)

* Implement ICorProfilerInfo13 to support object handle creation/destruction/access

* Add test for ICorProfilerInfo13 methods about handle management

* Fix compilation issues

* Remove TAB

* Fix build issues

* Complete handles test

* Fix Linux compilation error

* Fix test build issue

* Improve handles test

* Fix build error

* Add logs in handles test

* Add type information to handles test logs

* Take review comments into account

* Add logs to handles test

* Fix test error
  • Loading branch information
chrisnas committed Jul 16, 2022
1 parent a60cc8f commit 4d4ddf9
Show file tree
Hide file tree
Showing 15 changed files with 8,779 additions and 6,966 deletions.
30 changes: 30 additions & 0 deletions src/coreclr/inc/corprof.idl
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,15 @@ typedef struct
UINT32 reserved;
} COR_PRF_EVENT_DATA;

typedef enum _COR_PRF_HANDLE_TYPE
{
COR_PRF_HANDLE_TYPE_WEAK = 0x1,
COR_PRF_HANDLE_TYPE_STRONG = 0x2,
COR_PRF_HANDLE_TYPE_PINNED = 0x3,
} COR_PRF_HANDLE_TYPE;

typedef void** ObjectHandleID;

/* -------------------------------------------------------------------------- *
* Forward declarations
* -------------------------------------------------------------------------- */
Expand Down Expand Up @@ -4215,6 +4224,27 @@ interface ICorProfilerInfo12 : ICorProfilerInfo11
[in] LPCGUID pRelatedActivityId);
}

[
object,
uuid(6E6C7EE2-0701-4EC2-9D29-2E8733B66934),
pointer_default(unique),
local
]
interface ICorProfilerInfo13 : ICorProfilerInfo12
{
HRESULT CreateHandle(
[in] ObjectID object,
[in] COR_PRF_HANDLE_TYPE type,
[out] ObjectHandleID* pHandle);

HRESULT DestroyHandle(
[in] ObjectHandleID handle);

HRESULT GetObjectIDFromHandle(
[in] ObjectHandleID handle,
[out] ObjectID* pObject);
}

/*
* This interface lets you iterate over methods in the runtime.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/pal/prebuilt/idl/corprof_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo11,0x06398876,0x8987,0x4154,0xB6,0x21,
MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo12,0x27b24ccd,0x1cb1,0x47c5,0x96,0xee,0x98,0x19,0x0d,0xc3,0x09,0x59);


MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo13,0x19C4179D,0xF92C,0x4D25,0x9F,0x20,0x5F,0xEB,0xFB,0xBD,0x29,0x78);
MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo13,0x6E6C7EE2,0x0701,0x4EC2,0x9D,0x29,0x2E,0x87,0x33,0xB6,0x69,0x34);


MIDL_DEFINE_GUID(IID, IID_ICorProfilerMethodEnum,0xFCCEE788,0x0088,0x454B,0xA8,0x11,0xC9,0x9F,0x29,0x8D,0x19,0x42);
Expand Down
Loading

0 comments on commit 4d4ddf9

Please sign in to comment.