Skip to content

Commit a4c18f7

Browse files
committed
Merge branch 'main' into analysis-sourcegenerator
2 parents 05087e3 + cce49ca commit a4c18f7

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363

6464
# Initializes the CodeQL tools for scanning.
6565
- name: Initialize CodeQL
66-
uses: github/codeql-action/init@fdbfb4d2750291e159f0156def62b853c2798ca2 # tag: v4.31.5
66+
uses: github/codeql-action/init@fe4161a26a8629af62121b670040955b330f9af2 # tag: v4.31.6
6767
with:
6868
languages: ${{ matrix.language }}
6969
build-mode: ${{ matrix.build-mode }}
@@ -93,6 +93,6 @@ jobs:
9393
run: ./build.cmd BuildTracer
9494

9595
- name: Perform CodeQL Analysis
96-
uses: github/codeql-action/analyze@fdbfb4d2750291e159f0156def62b853c2798ca2 # tag: v4.31.5
96+
uses: github/codeql-action/analyze@fe4161a26a8629af62121b670040955b330f9af2 # tag: v4.31.6
9797
with:
9898
category: "/language:${{matrix.language}}"

.github/workflows/ossf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ jobs:
4242
# Upload the results to GitHub's code scanning dashboard (optional).
4343
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
4444
- name: "Upload to code-scanning"
45-
uses: github/codeql-action/upload-sarif@fdbfb4d2750291e159f0156def62b853c2798ca2 # tag: v4.31.5
45+
uses: github/codeql-action/upload-sarif@fe4161a26a8629af62121b670040955b330f9af2 # tag: v4.31.6
4646
with:
4747
sarif_file: results.sarif

src/OpenTelemetry.AutoInstrumentation.StartupHook/NativeMethods.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ static NativeMethods()
1616
NativeLibrary.SetDllImportResolver(typeof(NativeMethods).Assembly, ImportResolver);
1717
}
1818

19+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
1920
[DllImport("OpenTelemetry.AutoInstrumentation.Native")]
2021
public static extern bool IsProfilerAttached();
2122

src/OpenTelemetry.AutoInstrumentation/NativeMethods.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,35 +180,45 @@ private static bool TryParseSpanContext(Activity currentActivity, out ulong trac
180180
// and optional on .NET Core
181181
private static class Windows
182182
{
183+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
183184
[DllImport("OpenTelemetry.AutoInstrumentation.Native.dll")]
184185
public static extern void AddInstrumentations([MarshalAs(UnmanagedType.LPWStr)] string id, [In] NativeCallTargetDefinition[] methodArrays, int size);
185186

187+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
186188
[DllImport("OpenTelemetry.AutoInstrumentation.Native.dll")]
187189
public static extern void AddDerivedInstrumentations([MarshalAs(UnmanagedType.LPWStr)] string id, [In] NativeCallTargetDefinition[] methodArrays, int size);
188190

191+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
189192
[DllImport("OpenTelemetry.AutoInstrumentation.Native.dll")]
190193
public static extern void ConfigureContinuousProfiler(bool threadSamplingEnabled, uint threadSamplingInterval, bool allocationSamplingEnabled, uint maxMemorySamplesPerMinute, uint selectedThreadSamplingInterval);
191194

192195
#if NET
193196

197+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
194198
[DllImport("OpenTelemetry.AutoInstrumentation.Native.dll")]
195199
public static extern int ContinuousProfilerReadThreadSamples(int len, byte[] buf);
196200

201+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
197202
[DllImport("OpenTelemetry.AutoInstrumentation.Native.dll")]
198203
public static extern int ContinuousProfilerReadAllocationSamples(int len, byte[] buf);
199204

205+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
200206
[DllImport("OpenTelemetry.AutoInstrumentation.Native.dll")]
201207
public static extern int SelectiveSamplerReadThreadSamples(int len, byte[] buf);
202208

209+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
203210
[DllImport("OpenTelemetry.AutoInstrumentation.Native.dll")]
204211
public static extern void ContinuousProfilerSetNativeContext(ulong traceIdHigh, ulong traceIdLow, ulong spanId);
205212

213+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
206214
[DllImport("OpenTelemetry.AutoInstrumentation.Native.dll")]
207215
public static extern void ContinuousProfilerNotifySpanStopped(ulong traceIdHigh, ulong traceIdLow, ulong spanId);
208216

217+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
209218
[DllImport("OpenTelemetry.AutoInstrumentation.Native.dll")]
210219
public static extern void SelectiveSamplingStart(ulong traceIdHigh, ulong traceIdLow);
211220

221+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
212222
[DllImport("OpenTelemetry.AutoInstrumentation.Native.dll")]
213223
public static extern void SelectiveSamplingStop(ulong traceIdHigh, ulong traceIdLow);
214224
#endif
@@ -218,34 +228,44 @@ private static class Windows
218228
// assume .NET Core if not running on Windows
219229
private static class NonWindows
220230
{
231+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
221232
[DllImport("OpenTelemetry.AutoInstrumentation.Native")]
222233
public static extern void AddInstrumentations([MarshalAs(UnmanagedType.LPWStr)] string id, [In] NativeCallTargetDefinition[] methodArrays, int size);
223234

235+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
224236
[DllImport("OpenTelemetry.AutoInstrumentation.Native")]
225237
public static extern void AddDerivedInstrumentations([MarshalAs(UnmanagedType.LPWStr)] string id, [In] NativeCallTargetDefinition[] methodArrays, int size);
226238

239+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
227240
[DllImport("OpenTelemetry.AutoInstrumentation.Native")]
228241
public static extern void ConfigureContinuousProfiler(bool threadSamplingEnabled, uint threadSamplingInterval, bool allocationSamplingEnabled, uint maxMemorySamplesPerMinute, uint selectedThreadSamplingInterval);
229242

230243
#if NET
244+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
231245
[DllImport("OpenTelemetry.AutoInstrumentation.Native")]
232246
public static extern int ContinuousProfilerReadThreadSamples(int len, byte[] buf);
233247

248+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
234249
[DllImport("OpenTelemetry.AutoInstrumentation.Native")]
235250
public static extern int ContinuousProfilerReadAllocationSamples(int len, byte[] buf);
236251

252+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
237253
[DllImport("OpenTelemetry.AutoInstrumentation.Native")]
238254
public static extern int SelectiveSamplerReadThreadSamples(int len, byte[] buf);
239255

256+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
240257
[DllImport("OpenTelemetry.AutoInstrumentation.Native")]
241258
public static extern void ContinuousProfilerSetNativeContext(ulong traceIdHigh, ulong traceIdLow, ulong spanId);
242259

260+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
243261
[DllImport("OpenTelemetry.AutoInstrumentation.Native")]
244262
public static extern void ContinuousProfilerNotifySpanStopped(ulong traceIdHigh, ulong traceIdLow, ulong spanId);
245263

264+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
246265
[DllImport("OpenTelemetry.AutoInstrumentation.Native")]
247266
public static extern void SelectiveSamplingStart(ulong traceIdHigh, ulong traceIdLow);
248267

268+
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
249269
[DllImport("OpenTelemetry.AutoInstrumentation.Native")]
250270
public static extern void SelectiveSamplingStop(ulong traceIdHigh, ulong traceIdLow);
251271
#endif

0 commit comments

Comments
 (0)