Skip to content

Commit b55f107

Browse files
authored
Merge pull request #15 from pyroscope-io/chore/update_to_2_19
chore: update to 2.19
2 parents 0e75cd3 + 109993a commit b55f107

File tree

295 files changed

+8355
-2865
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+8355
-2865
lines changed

Datadog.Trace.sln

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "azure-functions", "azure-fu
379379
tracer\test\test-applications\azure-functions\Directory.Build.props = tracer\test\test-applications\azure-functions\Directory.Build.props
380380
EndProjectSection
381381
EndProject
382-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AzureFunctions.AllTriggers", "tracer\test\test-applications\azure-functions\Samples.AzureFunctions.AllTriggers\Samples.AzureFunctions.AllTriggers.csproj", "{536F1D82-D40C-4E33-B7FA-76A0F17BF672}"
382+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AzureFunctions.V3InProcess", "tracer\test\test-applications\azure-functions\Samples.AzureFunctions.V3InProcess\Samples.AzureFunctions.V3InProcess.csproj", "{536F1D82-D40C-4E33-B7FA-76A0F17BF672}"
383383
EndProject
384384
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Samples.Shared", "tracer\test\test-applications\Samples.Shared\Samples.Shared.shproj", "{5A806F4B-39E7-4F38-B36F-F5CFC4F8760A}"
385385
EndProject
@@ -498,6 +498,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.WeakCipher", "trace
498498
EndProject
499499
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Deduplication", "tracer\test\test-applications\integrations\Samples.Deduplication\Samples.Deduplication.csproj", "{63B3A841-F3E0-4D60-B85D-156D7251FFDF}"
500500
EndProject
501+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.AzureFunctions.V4InProcess", "tracer\test\test-applications\azure-functions\Samples.AzureFunctions.V4InProcess\Samples.AzureFunctions.V4InProcess.csproj", "{0F0F7D45-0E13-42B0-A158-8F303BBE8358}"
502+
EndProject
501503
Global
502504
GlobalSection(SharedMSBuildProjectFiles) = preSolution
503505
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{3c6dd42e-9214-4747-92ba-78de29aace59}*SharedItemsImports = 4
@@ -2504,6 +2506,14 @@ Global
25042506
{63B3A841-F3E0-4D60-B85D-156D7251FFDF}.Release|x64.Build.0 = Release|x64
25052507
{63B3A841-F3E0-4D60-B85D-156D7251FFDF}.Release|x86.ActiveCfg = Release|x86
25062508
{63B3A841-F3E0-4D60-B85D-156D7251FFDF}.Release|x86.Build.0 = Release|x86
2509+
{0F0F7D45-0E13-42B0-A158-8F303BBE8358}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2510+
{0F0F7D45-0E13-42B0-A158-8F303BBE8358}.Debug|x64.ActiveCfg = Debug|Any CPU
2511+
{0F0F7D45-0E13-42B0-A158-8F303BBE8358}.Debug|x64.Build.0 = Debug|Any CPU
2512+
{0F0F7D45-0E13-42B0-A158-8F303BBE8358}.Debug|x86.ActiveCfg = Debug|Any CPU
2513+
{0F0F7D45-0E13-42B0-A158-8F303BBE8358}.Release|Any CPU.ActiveCfg = Release|Any CPU
2514+
{0F0F7D45-0E13-42B0-A158-8F303BBE8358}.Release|x64.ActiveCfg = Release|Any CPU
2515+
{0F0F7D45-0E13-42B0-A158-8F303BBE8358}.Release|x64.Build.0 = Release|Any CPU
2516+
{0F0F7D45-0E13-42B0-A158-8F303BBE8358}.Release|x86.ActiveCfg = Release|Any CPU
25072517
EndGlobalSection
25082518
GlobalSection(SolutionProperties) = preSolution
25092519
HideSolutionNode = FALSE
@@ -2693,6 +2703,7 @@ Global
26932703
{8C615906-AA60-4BA7-9B04-6A4E20969D6D} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
26942704
{43C696FA-3812-4312-9529-98CECCD32A81} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
26952705
{63B3A841-F3E0-4D60-B85D-156D7251FFDF} = {BAF8F246-3645-42AD-B1D0-0F7EAFBAB34A}
2706+
{0F0F7D45-0E13-42B0-A158-8F303BBE8358} = {C4C1E313-C7C1-4490-AECE-0DD0062380A4}
26962707
EndGlobalSection
26972708
GlobalSection(ExtensibilityGlobals) = postSolution
26982709
SolutionGuid = {160A1D00-1F5B-40F8-A155-621B4459D78F}

profiler/build/Contention.linux.net60.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"DD_PROFILING_ENABLED": "1",
2828
"DD_PROFILING_WALLTIME_ENABLED": "0",
2929
"DD_PROFILING_CPU_ENABLED": "0",
30-
"DD_PROFILING_CONTENTION_ENABLED": "1",
30+
"DD_PROFILING_LOCK_ENABLED": "1",
3131
"DD_TRACE_ENABLED" : "0"
3232
}
3333
},
@@ -38,7 +38,7 @@
3838
"DD_PROFILING_ENABLED": "1",
3939
"DD_PROFILING_WALLTIME_ENABLED": "1",
4040
"DD_PROFILING_CPU_ENABLED": "1",
41-
"DD_PROFILING_CONTENTION_ENABLED": "1",
41+
"DD_PROFILING_LOCK_ENABLED": "1",
4242
"DD_TRACE_ENABLED" : "0"
4343
}
4444
}

profiler/build/Contention.windows.net60.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"DD_PROFILING_ENABLED": "1",
2828
"DD_PROFILING_WALLTIME_ENABLED": "0",
2929
"DD_PROFILING_CPU_ENABLED": "0",
30-
"DD_PROFILING_CONTENTION_ENABLED": "1",
30+
"DD_PROFILING_LOCK_ENABLED": "1",
3131
"DD_TRACE_ENABLED" : "0"
3232
}
3333
},
@@ -38,7 +38,7 @@
3838
"DD_PROFILING_ENABLED": "1",
3939
"DD_PROFILING_WALLTIME_ENABLED": "1",
4040
"DD_PROFILING_CPU_ENABLED": "1",
41-
"DD_PROFILING_CONTENTION_ENABLED": "1",
41+
"DD_PROFILING_LOCK_ENABLED": "1",
4242
"DD_TRACE_ENABLED" : "0"
4343
}
4444
}

profiler/src/ProfilerEngine/Datadog.Profiler.Native/Configuration.cpp

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Configuration::Configuration()
3838
_isWallTimeProfilingEnabled = GetEnvironmentValue(EnvironmentVariables::WallTimeProfilingEnabled, true);
3939
_isExceptionProfilingEnabled = GetEnvironmentValue(EnvironmentVariables::ExceptionProfilingEnabled, false);
4040
_isAllocationProfilingEnabled = GetEnvironmentValue(EnvironmentVariables::AllocationProfilingEnabled, false);
41-
_isContentionProfilingEnabled = GetEnvironmentValue(EnvironmentVariables::ContentionProfilingEnabled, false);
41+
_isContentionProfilingEnabled = GetContention();
4242
_uploadPeriod = ExtractUploadInterval();
4343
_userTags = ExtractUserTags();
4444
_version = GetEnvironmentValue(EnvironmentVariables::Version, DefaultVersion);
@@ -373,6 +373,21 @@ int32_t Configuration::ExtractCpuThreadsThreshold()
373373
return threshold;
374374
}
375375

376+
bool Configuration::GetContention()
377+
{
378+
// disabled by default
379+
bool lockContentionEnabled = false;
380+
381+
// first look at the supported env var
382+
if (IsEnvironmentValueSet(EnvironmentVariables::LockContentionProfilingEnabled, lockContentionEnabled))
383+
{
384+
return lockContentionEnabled;
385+
}
386+
387+
// if not there, look at the deprecated one
388+
return GetEnvironmentValue(EnvironmentVariables::DeprecatedContentionProfilingEnabled, false);
389+
}
390+
376391
bool Configuration::GetDefaultDebugLogEnabled()
377392
{
378393
auto r = shared::GetEnvironmentValue(EnvironmentVariables::DevelopmentConfiguration);
@@ -450,3 +465,16 @@ T Configuration::GetEnvironmentValue(shared::WSTRING const& name, T const& defau
450465
if (!convert_to(r, result)) return std::move(defaultValue);
451466
return result;
452467
}
468+
469+
template <typename T>
470+
bool Configuration::IsEnvironmentValueSet(shared::WSTRING const& name, T& value)
471+
{
472+
auto r = shared::Trim(shared::GetEnvironmentValue(name));
473+
if (r.empty()) return false;
474+
475+
T result{};
476+
if (!convert_to(r, result)) return false;
477+
478+
value = result;
479+
return true;
480+
}

profiler/src/ProfilerEngine/Datadog.Profiler.Native/Configuration.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,12 @@ class Configuration final : public IConfiguration
6868
static bool GetDefaultDebugLogEnabled();
6969
template <typename T>
7070
static T GetEnvironmentValue(shared::WSTRING const& name, T const& defaultValue);
71+
template <typename T>
72+
static bool IsEnvironmentValueSet(shared::WSTRING const& name, T& value);
7173
static std::chrono::nanoseconds ExtractCpuWallTimeSamplingRate();
7274
static int32_t ExtractWallTimeThreadsThreshold();
7375
static int32_t ExtractCpuThreadsThreshold();
76+
static bool GetContention();
7477

7578
private:
7679
static std::string const DefaultProdSite;

profiler/src/ProfilerEngine/Datadog.Profiler.Native/EnvironmentVariables.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ class EnvironmentVariables final
3232

3333
// only available on .NET 5+
3434
inline static const shared::WSTRING AllocationProfilingEnabled = WStr("DD_PROFILING_ALLOCATION_ENABLED");
35-
inline static const shared::WSTRING ContentionProfilingEnabled = WStr("DD_PROFILING_CONTENTION_ENABLED");
35+
inline static const shared::WSTRING DeprecatedContentionProfilingEnabled = WStr("DD_PROFILING_CONTENTION_ENABLED"); // should be deprecated (only used in 2.18)
36+
inline static const shared::WSTRING LockContentionProfilingEnabled = WStr("DD_PROFILING_LOCK_ENABLED");
3637

3738
inline static const shared::WSTRING ExceptionSampleLimit = WStr("DD_INTERNAL_PROFILING_EXCEPTION_SAMPLE_LIMIT");
3839
inline static const shared::WSTRING AllocationSampleLimit = WStr("DD_INTERNAL_PROFILING_ALLOCATION_SAMPLE_LIMIT");

profiler/test/Datadog.Profiler.IntegrationTests/Helpers/EnvironmentVariables.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal class EnvironmentVariables
1616
public const string ExceptionProfilerEnabled = "DD_PROFILING_EXCEPTION_ENABLED";
1717
public const string ExceptionSampleLimit = "DD_INTERNAL_PROFILING_EXCEPTION_SAMPLE_LIMIT";
1818
public const string AllocationProfilerEnabled = "DD_PROFILING_ALLOCATION_ENABLED";
19-
public const string ContentionProfilerEnabled = "DD_PROFILING_CONTENTION_ENABLED";
19+
public const string ContentionProfilerEnabled = "DD_PROFILING_LOCK_ENABLED";
2020
public const string EndpointProfilerEnabled = "DD_PROFILING_ENDPOINT_COLLECTION_ENABLED";
2121
public const string NamedPipeName = "DD_TRACE_PIPE_NAME";
2222
public const string TimestampsAsLabelEnabled = "DD_INTERNAL_PROFILING_TIMESTAMPS_AS_LABEL_ENABLED";

profiler/test/Datadog.Profiler.Native.Tests/ConfigurationTest.cpp

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,18 +361,48 @@ TEST(ConfigurationTest, CheckContentionProfilingIsDisabledByDefault)
361361

362362
TEST(ConfigurationTest, CheckContentionProfilingIsEnabledIfEnvVarSetToTrue)
363363
{
364-
EnvironmentHelper::EnvironmentVariable ar(EnvironmentVariables::ContentionProfilingEnabled, WStr("1"));
364+
EnvironmentHelper::EnvironmentVariable ar(EnvironmentVariables::LockContentionProfilingEnabled, WStr("1"));
365365
auto configuration = Configuration{};
366366
ASSERT_THAT(configuration.IsContentionProfilingEnabled(), true);
367367
}
368368

369369
TEST(ConfigurationTest, CheckContentionProfilingIsDisabledIfEnvVarSetToFalse)
370370
{
371-
EnvironmentHelper::EnvironmentVariable ar(EnvironmentVariables::ContentionProfilingEnabled, WStr("0"));
371+
EnvironmentHelper::EnvironmentVariable ar(EnvironmentVariables::LockContentionProfilingEnabled, WStr("0"));
372372
auto configuration = Configuration{};
373373
ASSERT_THAT(configuration.IsContentionProfilingEnabled(), false);
374374
}
375375

376+
TEST(ConfigurationTest, CheckDeprecatedContentionProfilingIsEnabledIfEnvVarSetToTrue)
377+
{
378+
EnvironmentHelper::EnvironmentVariable ar(EnvironmentVariables::DeprecatedContentionProfilingEnabled, WStr("1"));
379+
auto configuration = Configuration{};
380+
ASSERT_THAT(configuration.IsContentionProfilingEnabled(), true);
381+
}
382+
383+
TEST(ConfigurationTest, CheckDeprecatedContentionProfilingIsDisabledIfEnvVarSetToFalse)
384+
{
385+
EnvironmentHelper::EnvironmentVariable ar(EnvironmentVariables::DeprecatedContentionProfilingEnabled, WStr("0"));
386+
auto configuration = Configuration{};
387+
ASSERT_THAT(configuration.IsContentionProfilingEnabled(), false);
388+
}
389+
390+
TEST(ConfigurationTest, CheckLockProfilingOverrideContentionEnvVarIfSetToFalse)
391+
{
392+
EnvironmentHelper::EnvironmentVariable ar1(EnvironmentVariables::LockContentionProfilingEnabled, WStr("0"));
393+
EnvironmentHelper::EnvironmentVariable ar2(EnvironmentVariables::DeprecatedContentionProfilingEnabled, WStr("1"));
394+
auto configuration = Configuration{};
395+
ASSERT_THAT(configuration.IsContentionProfilingEnabled(), false);
396+
}
397+
398+
TEST(ConfigurationTest, CheckLockProfilingOverrideContentionEnvVarIfSetToTrue)
399+
{
400+
EnvironmentHelper::EnvironmentVariable ar1(EnvironmentVariables::LockContentionProfilingEnabled, WStr("1"));
401+
EnvironmentHelper::EnvironmentVariable ar2(EnvironmentVariables::DeprecatedContentionProfilingEnabled, WStr("0"));
402+
auto configuration = Configuration{};
403+
ASSERT_THAT(configuration.IsContentionProfilingEnabled(), true);
404+
}
405+
376406
TEST(ConfigurationTest, CheckContentionSampleLimitIfEnvVarSet)
377407
{
378408
EnvironmentHelper::EnvironmentVariable ar(EnvironmentVariables::ContentionSampleLimit, WStr("123"));

shared/src/Datadog.Trace.ClrProfiler.Native/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BIN_DIR})
9393
# ******************************************************
9494

9595
# Sets compiler options
96-
add_compile_options(-std=c++17 -fPIC -fms-extensions)
96+
add_compile_options(-std=c++17 -fPIC -fms-extensions -fvisibility=hidden)
9797
add_compile_options(-DPAL_STDCPP_COMPAT -DPLATFORM_UNIX -DUNICODE)
9898
add_compile_options(-Wno-invalid-noreturn -Wno-macro-redefined)
9999
if (ISMACOS)

shared/src/Datadog.Trace.ClrProfiler.Native/dllmain.cpp

Lines changed: 70 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -5,102 +5,104 @@
55
#include "dynamic_dispatcher.h"
66
#include "util.h"
77

8+
#ifndef _WIN32
9+
#undef EXTERN_C
10+
#define EXTERN_C extern "C" __attribute__((visibility("default")))
11+
#endif
12+
813
using namespace datadog::shared::nativeloader;
914

1015
IDynamicDispatcher* dispatcher;
1116

12-
extern "C"
17+
EXTERN_C BOOL STDMETHODCALLTYPE DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
1318
{
14-
BOOL STDMETHODCALLTYPE DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
19+
// Perform actions based on the reason for calling.
20+
switch (ul_reason_for_call)
1521
{
16-
// Perform actions based on the reason for calling.
17-
switch (ul_reason_for_call)
22+
case DLL_PROCESS_ATTACH:
1823
{
19-
case DLL_PROCESS_ATTACH:
20-
{
21-
// Initialize once for each new process.
22-
// Return FALSE to fail DLL load.
23-
24-
constexpr const bool IsLogDebugEnabledDefault = false;
25-
bool isLogDebugEnabled;
24+
// Initialize once for each new process.
25+
// Return FALSE to fail DLL load.
26+
27+
constexpr const bool IsLogDebugEnabledDefault = false;
28+
bool isLogDebugEnabled;
29+
30+
shared::WSTRING isLogDebugEnabledStr = shared::GetEnvironmentValue(EnvironmentVariables::DebugLogEnabled);
2631

27-
shared::WSTRING isLogDebugEnabledStr = shared::GetEnvironmentValue(EnvironmentVariables::DebugLogEnabled);
32+
// no environment variable set
33+
if (isLogDebugEnabledStr.empty())
34+
{
35+
Log::Info("No \"", EnvironmentVariables::DebugLogEnabled, "\" environment variable has been found.",
36+
" Enable debug log = ", IsLogDebugEnabledDefault, " (default).");
2837

29-
// no environment variable set
30-
if (isLogDebugEnabledStr.empty())
38+
isLogDebugEnabled = IsLogDebugEnabledDefault;
39+
}
40+
else
41+
{
42+
if (!shared::TryParseBooleanEnvironmentValue(isLogDebugEnabledStr, isLogDebugEnabled))
3143
{
32-
Log::Info("No \"", EnvironmentVariables::DebugLogEnabled, "\" environment variable has been found.",
44+
// invalid value for environment variable
45+
Log::Info("Non boolean value \"", isLogDebugEnabledStr, "\" for \"",
46+
EnvironmentVariables::DebugLogEnabled, "\" environment variable.",
3347
" Enable debug log = ", IsLogDebugEnabledDefault, " (default).");
3448

3549
isLogDebugEnabled = IsLogDebugEnabledDefault;
3650
}
3751
else
3852
{
39-
if (!shared::TryParseBooleanEnvironmentValue(isLogDebugEnabledStr, isLogDebugEnabled))
40-
{
41-
// invalid value for environment variable
42-
Log::Info("Non boolean value \"", isLogDebugEnabledStr, "\" for \"",
43-
EnvironmentVariables::DebugLogEnabled, "\" environment variable.",
44-
" Enable debug log = ", IsLogDebugEnabledDefault, " (default).");
45-
46-
isLogDebugEnabled = IsLogDebugEnabledDefault;
47-
}
48-
else
49-
{
50-
// take environment variable into account
51-
Log::Info("Enable debug log = ", isLogDebugEnabled, " from (", EnvironmentVariables::DebugLogEnabled, " environment variable)");
52-
}
53+
// take environment variable into account
54+
Log::Info("Enable debug log = ", isLogDebugEnabled, " from (", EnvironmentVariables::DebugLogEnabled, " environment variable)");
5355
}
56+
}
5457

55-
if (isLogDebugEnabled)
56-
{
57-
Log::EnableDebug();
58-
}
59-
60-
Log::Debug("DllMain: DLL_PROCESS_ATTACH");
61-
Log::Debug("DllMain: Pointer size: ", 8 * sizeof(void*), " bits.");
62-
63-
dispatcher = new DynamicDispatcherImpl();
64-
dispatcher->LoadConfiguration(GetConfigurationFilePath());
65-
66-
// *****************************************************************************************************************
67-
break;
58+
if (isLogDebugEnabled)
59+
{
60+
Log::EnableDebug();
6861
}
6962

70-
case DLL_PROCESS_DETACH:
71-
// Perform any necessary cleanup.
72-
Log::Debug("DllMain: DLL_PROCESS_DETACH");
63+
Log::Debug("DllMain: DLL_PROCESS_ATTACH");
64+
Log::Debug("DllMain: Pointer size: ", 8 * sizeof(void*), " bits.");
65+
66+
dispatcher = new DynamicDispatcherImpl();
67+
dispatcher->LoadConfiguration(GetConfigurationFilePath());
7368

74-
break;
69+
// *****************************************************************************************************************
70+
break;
7571
}
76-
return TRUE; // Successful DLL_PROCESS_ATTACH.
77-
}
7872

79-
HRESULT STDMETHODCALLTYPE DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
80-
{
81-
Log::Debug("DllGetClassObject");
73+
case DLL_PROCESS_DETACH:
74+
// Perform any necessary cleanup.
75+
Log::Debug("DllMain: DLL_PROCESS_DETACH");
8276

83-
// {846F5F1C-F9AE-4B07-969E-05C26BC060D8}
84-
const GUID CLSID_CorProfiler = {0x846f5f1c, 0xf9ae, 0x4b07, {0x96, 0x9e, 0x5, 0xc2, 0x6b, 0xc0, 0x60, 0xd8}};
77+
break;
78+
}
79+
return TRUE; // Successful DLL_PROCESS_ATTACH.
80+
}
8581

86-
if (ppv == NULL || rclsid != CLSID_CorProfiler)
87-
{
88-
return E_FAIL;
89-
}
82+
EXTERN_C HRESULT STDMETHODCALLTYPE DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
83+
{
84+
Log::Debug("DllGetClassObject");
9085

91-
auto factory = new CorProfilerClassFactory(dispatcher);
92-
if (factory == NULL)
93-
{
94-
return E_FAIL;
95-
}
86+
// {846F5F1C-F9AE-4B07-969E-05C26BC060D8}
87+
const GUID CLSID_CorProfiler = {0x846f5f1c, 0xf9ae, 0x4b07, {0x96, 0x9e, 0x5, 0xc2, 0x6b, 0xc0, 0x60, 0xd8}};
9688

97-
return factory->QueryInterface(riid, ppv);
89+
if (ppv == NULL || rclsid != CLSID_CorProfiler)
90+
{
91+
return E_FAIL;
9892
}
9993

100-
HRESULT STDMETHODCALLTYPE DllCanUnloadNow()
94+
auto factory = new CorProfilerClassFactory(dispatcher);
95+
if (factory == NULL)
10196
{
102-
Log::Debug("DllCanUnloadNow");
103-
104-
return dispatcher->DllCanUnloadNow();
97+
return E_FAIL;
10598
}
106-
}
99+
100+
return factory->QueryInterface(riid, ppv);
101+
}
102+
103+
EXTERN_C HRESULT STDMETHODCALLTYPE DllCanUnloadNow()
104+
{
105+
Log::Debug("DllCanUnloadNow");
106+
107+
return dispatcher->DllCanUnloadNow();
108+
}

0 commit comments

Comments
 (0)