Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 9358413

Browse files
authored
[Release/3.1] Port profiler APIs to set and retrieve environment variables to 3.1 (#27512)
1 parent d336d32 commit 9358413

File tree

5 files changed

+3011
-1873
lines changed

5 files changed

+3011
-1873
lines changed

src/inc/corprof.idl

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3985,6 +3985,40 @@ interface ICorProfilerInfo10 : ICorProfilerInfo9
39853985
HRESULT ResumeRuntime();
39863986
}
39873987

3988+
[
3989+
object,
3990+
uuid(06398876-8987-4154-B621-40A00D6E4D04),
3991+
pointer_default(unique),
3992+
local
3993+
]
3994+
interface ICorProfilerInfo11 : ICorProfilerInfo10
3995+
{
3996+
/*
3997+
* Get environment variable for the running managed code.
3998+
*/
3999+
HRESULT GetEnvironmentVariable(
4000+
[in, string] const WCHAR *szName,
4001+
[in] ULONG cchValue,
4002+
[out] ULONG *pcchValue,
4003+
[out, annotation("_Out_writes_to_(cchValue, *pcchValue)")]
4004+
WCHAR szValue[]);
4005+
4006+
/*
4007+
* Set environment variable for the running managed code.
4008+
*
4009+
* The code profiler calls this function to modify environment variables of the
4010+
* current managed process. For example, it can be used in the profiler's Initialize()
4011+
* or InitializeForAttach() callbacks.
4012+
*
4013+
* szName is the name of the environment variable, should not be NULL.
4014+
*
4015+
* szValue is the contents of the environment variable, or NULL if the variable should be deleted.
4016+
*/
4017+
HRESULT SetEnvironmentVariable(
4018+
[in, string] const WCHAR *szName,
4019+
[in, string] const WCHAR *szValue);
4020+
}
4021+
39884022
/*
39894023
* This interface lets you iterate over methods in the runtime.
39904024
*/

src/pal/prebuilt/idl/corprof_i.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo9,0x008170DB,0xF8CC,0x4796,0x9A,0x51,0
131131
MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo10,0x2F1B5152,0xC869,0x40C9,0xAA,0x5F,0x3A,0xBE,0x02,0x6B,0xD7,0x20);
132132

133133

134+
MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo11,0x06398876,0x8987,0x4154,0xB6,0x21,0x40,0xA0,0x0D,0x6E,0x4D,0x04);
135+
136+
134137
MIDL_DEFINE_GUID(IID, IID_ICorProfilerMethodEnum,0xFCCEE788,0x0088,0x454B,0xA8,0x11,0xC9,0x9F,0x29,0x8D,0x19,0x42);
135138

136139

0 commit comments

Comments
 (0)