Skip to content

Commit

Permalink
Profiler API to modify environment variables (#23383) (dotnet#27157)
Browse files Browse the repository at this point in the history
  • Loading branch information
k15tfu authored and davmason committed Oct 28, 2019
1 parent 12f48fe commit 77fbbc8
Show file tree
Hide file tree
Showing 5 changed files with 1,139 additions and 1 deletion.
34 changes: 34 additions & 0 deletions src/inc/corprof.idl
Original file line number Diff line number Diff line change
Expand Up @@ -3985,6 +3985,40 @@ interface ICorProfilerInfo10 : ICorProfilerInfo9
HRESULT ResumeRuntime();
}

[
object,
uuid(06398876-8987-4154-B621-40A00D6E4D04),
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,0x06398876,0x8987,0x4154,0xB6,0x21,0x40,0xA0,0x0D,0x6E,0x4D,0x04);


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


Expand Down
Loading

0 comments on commit 77fbbc8

Please sign in to comment.