Skip to content

Commit

Permalink
Profiler API to modify environment variables (#23383)
Browse files Browse the repository at this point in the history
  • Loading branch information
k15tfu committed Oct 19, 2019
1 parent fd0ca99 commit 260734d
Show file tree
Hide file tree
Showing 5 changed files with 3,027 additions and 1,872 deletions.
34 changes: 34 additions & 0 deletions src/inc/corprof.idl
Original file line number Diff line number Diff line change
Expand Up @@ -3982,6 +3982,40 @@ interface ICorProfilerInfo10 : ICorProfilerInfo9
HRESULT ResumeRuntime();
}

[
object,
uuid(DBCED7DD-C08F-4591-BCBF-0B6E4629030E),
pointer_default(unique),
local
]
interface ICorProfilerInfo11 : ICorProfilerInfo10
{
/*
* Get environment variable for the running managed code.
*/
HRESULT GetEnvironmentVariable(
[in, string] const WCHAR *szName,
[in] ULONG cchValue,
[out] ULONG *pcchValue,
[out, annotation("_Out_writes_to_(cchValue, *pcchValue)")]
WCHAR szValue[]);

/*
* Set environment variable for the running managed code.
*
* The code profiler calls this function to modify environment variables of the
* current managed process. For example, it can be used in the profiler's Initialize()
* or InitializeForAttach() callbacks.
*
* szName is the name of the environment variable, should not be NULL.
*
* szValue is the contents of the environment variable, or NULL if the variable should be deleted.
*/
HRESULT SetEnvironmentVariable(
[in, string] const WCHAR *szName,
[in, string] const WCHAR *szValue);
}

/*
* This interface lets you iterate over methods in the runtime.
*/
Expand Down
3 changes: 3 additions & 0 deletions src/pal/prebuilt/idl/corprof_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo9,0x008170DB,0xF8CC,0x4796,0x9A,0x51,0
MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo10,0x2F1B5152,0xC869,0x40C9,0xAA,0x5F,0x3A,0xBE,0x02,0x6B,0xD7,0x20);


MIDL_DEFINE_GUID(IID, IID_ICorProfilerInfo11,0xDBCED7DD,0xC08F,0x4591,0xBC,0xBF,0x0B,0x6E,0x46,0x29,0x03,0x0E);


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


Expand Down
Loading

0 comments on commit 260734d

Please sign in to comment.