1
2// Licensed to the .NET Foundation under one or more agreements.
3// The .NET Foundation licenses this file to you under the MIT license.
4// See the LICENSE file in the project root for more information.
5
6/******************************************************************
7
8DO NOT MODIFY. AUTOGENERATED FILE.
9This file is generated using the logic from <root>/src/scripts/genLttngProvider.py
10
11******************************************************************/
12
13
14#define TRACEPOINT_DEFINE
15#define TRACEPOINT_PROBE_DYNAMIC_LINKAGE
16
17#include "stdlib.h"
18#include "pal_mstypes.h"
19#include "pal_error.h"
20#include "pal.h"
21#define PAL_free free
22#define PAL_realloc realloc
23#include "pal/stackstring.hpp"
24#include "tpdotnetruntimerundown.h"
25
26#ifndef tracepoint_enabled
27#define tracepoint_enabled(provider, name) TRUE
28#define do_tracepoint tracepoint
29#endif
30
31#define wcslen PAL_wcslen
32
33bool ResizeBuffer(char *&buffer, size_t& size, size_t currLen, size_t newSize, bool &fixedBuffer);
34bool WriteToBuffer(PCWSTR str, char *&buffer, size_t& offset, size_t& size, bool &fixedBuffer);
35bool WriteToBuffer(const char *str, char *&buffer, size_t& offset, size_t& size, bool &fixedBuffer);
36bool WriteToBuffer(const BYTE *src, size_t len, char *&buffer, size_t& offset, size_t& size, bool &fixedBuffer);
37
38template <typename T>
39bool WriteToBuffer(const T &value, char *&buffer, size_t& offset, size_t& size, bool &fixedBuffer)
40{
41 if (sizeof(T) + offset > size)
42 {
43 if (!ResizeBuffer(buffer, size, offset, size + sizeof(T), fixedBuffer))
44 return false;
45 }
46
47 memcpy(buffer + offset, (char *)&value, sizeof(T));
48 offset += sizeof(T);
49 return true;
50}
51
52extern "C" BOOL EventXplatEnabledCLRStackWalkDCStart(){ return tracepoint_enabled(DotNETRuntimeRundown, CLRStackWalkDCStart); }
53
54extern "C" ULONG FireEtXplatCLRStackWalkDCStart(
55 const unsigned short ClrInstanceID,
56 const unsigned char Reserved1,
57 const unsigned char Reserved2,
58 const unsigned int FrameCount,
59 const void** Stack)
60{
61 if (!EventXplatEnabledCLRStackWalkDCStart())
62 return ERROR_SUCCESS;
63
64 do_tracepoint(DotNETRuntimeRundown,
65 CLRStackWalkDCStart,
66 ClrInstanceID,
67 Reserved1,
68 Reserved2,
69 FrameCount,
70 (const size_t*) Stack);
71
72 return ERROR_SUCCESS;
73}
74
75extern "C" BOOL EventXplatEnabledMethodDCStart(){ return tracepoint_enabled(DotNETRuntimeRundown, MethodDCStart); }
76
77extern "C" ULONG FireEtXplatMethodDCStart(
78 const unsigned __int64 MethodID,
79 const unsigned __int64 ModuleID,
80 const unsigned __int64 MethodStartAddress,
81 const unsigned int MethodSize,
82 const unsigned int MethodToken,
83 const unsigned int MethodFlags)
84{
85 if (!EventXplatEnabledMethodDCStart())
86 return ERROR_SUCCESS;
87
88 do_tracepoint(DotNETRuntimeRundown,
89 MethodDCStart,
90 MethodID,
91 ModuleID,
92 MethodStartAddress,
93 MethodSize,
94 MethodToken,
95 MethodFlags);
96
97 return ERROR_SUCCESS;
98}
99
100extern "C" BOOL EventXplatEnabledMethodDCStart_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, MethodDCStart_V1); }
101
102extern "C" ULONG FireEtXplatMethodDCStart_V1(
103 const unsigned __int64 MethodID,
104 const unsigned __int64 ModuleID,
105 const unsigned __int64 MethodStartAddress,
106 const unsigned int MethodSize,
107 const unsigned int MethodToken,
108 const unsigned int MethodFlags,
109 const unsigned short ClrInstanceID)
110{
111 if (!EventXplatEnabledMethodDCStart_V1())
112 return ERROR_SUCCESS;
113
114 do_tracepoint(DotNETRuntimeRundown,
115 MethodDCStart_V1,
116 MethodID,
117 ModuleID,
118 MethodStartAddress,
119 MethodSize,
120 MethodToken,
121 MethodFlags,
122 ClrInstanceID);
123
124 return ERROR_SUCCESS;
125}
126
127extern "C" BOOL EventXplatEnabledMethodDCStart_V2(){ return tracepoint_enabled(DotNETRuntimeRundown, MethodDCStart_V2); }
128
129extern "C" ULONG FireEtXplatMethodDCStart_V2(
130 const unsigned __int64 MethodID,
131 const unsigned __int64 ModuleID,
132 const unsigned __int64 MethodStartAddress,
133 const unsigned int MethodSize,
134 const unsigned int MethodToken,
135 const unsigned int MethodFlags,
136 const unsigned short ClrInstanceID,
137 const unsigned __int64 ReJITID)
138{
139 if (!EventXplatEnabledMethodDCStart_V2())
140 return ERROR_SUCCESS;
141
142 do_tracepoint(DotNETRuntimeRundown,
143 MethodDCStart_V2,
144 MethodID,
145 ModuleID,
146 MethodStartAddress,
147 MethodSize,
148 MethodToken,
149 MethodFlags,
150 ClrInstanceID,
151 ReJITID);
152
153 return ERROR_SUCCESS;
154}
155
156extern "C" BOOL EventXplatEnabledMethodDCEnd(){ return tracepoint_enabled(DotNETRuntimeRundown, MethodDCEnd); }
157
158extern "C" ULONG FireEtXplatMethodDCEnd(
159 const unsigned __int64 MethodID,
160 const unsigned __int64 ModuleID,
161 const unsigned __int64 MethodStartAddress,
162 const unsigned int MethodSize,
163 const unsigned int MethodToken,
164 const unsigned int MethodFlags)
165{
166 if (!EventXplatEnabledMethodDCEnd())
167 return ERROR_SUCCESS;
168
169 do_tracepoint(DotNETRuntimeRundown,
170 MethodDCEnd,
171 MethodID,
172 ModuleID,
173 MethodStartAddress,
174 MethodSize,
175 MethodToken,
176 MethodFlags);
177
178 return ERROR_SUCCESS;
179}
180
181extern "C" BOOL EventXplatEnabledMethodDCEnd_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, MethodDCEnd_V1); }
182
183extern "C" ULONG FireEtXplatMethodDCEnd_V1(
184 const unsigned __int64 MethodID,
185 const unsigned __int64 ModuleID,
186 const unsigned __int64 MethodStartAddress,
187 const unsigned int MethodSize,
188 const unsigned int MethodToken,
189 const unsigned int MethodFlags,
190 const unsigned short ClrInstanceID)
191{
192 if (!EventXplatEnabledMethodDCEnd_V1())
193 return ERROR_SUCCESS;
194
195 do_tracepoint(DotNETRuntimeRundown,
196 MethodDCEnd_V1,
197 MethodID,
198 ModuleID,
199 MethodStartAddress,
200 MethodSize,
201 MethodToken,
202 MethodFlags,
203 ClrInstanceID);
204
205 return ERROR_SUCCESS;
206}
207
208extern "C" BOOL EventXplatEnabledMethodDCEnd_V2(){ return tracepoint_enabled(DotNETRuntimeRundown, MethodDCEnd_V2); }
209
210extern "C" ULONG FireEtXplatMethodDCEnd_V2(
211 const unsigned __int64 MethodID,
212 const unsigned __int64 ModuleID,
213 const unsigned __int64 MethodStartAddress,
214 const unsigned int MethodSize,
215 const unsigned int MethodToken,
216 const unsigned int MethodFlags,
217 const unsigned short ClrInstanceID,
218 const unsigned __int64 ReJITID)
219{
220 if (!EventXplatEnabledMethodDCEnd_V2())
221 return ERROR_SUCCESS;
222
223 do_tracepoint(DotNETRuntimeRundown,
224 MethodDCEnd_V2,
225 MethodID,
226 ModuleID,
227 MethodStartAddress,
228 MethodSize,
229 MethodToken,
230 MethodFlags,
231 ClrInstanceID,
232 ReJITID);
233
234 return ERROR_SUCCESS;
235}
236
237extern "C" BOOL EventXplatEnabledMethodDCStartVerbose(){ return tracepoint_enabled(DotNETRuntimeRundown, MethodDCStartVerbose); }
238
239extern "C" ULONG FireEtXplatMethodDCStartVerbose(
240 const unsigned __int64 MethodID,
241 const unsigned __int64 ModuleID,
242 const unsigned __int64 MethodStartAddress,
243 const unsigned int MethodSize,
244 const unsigned int MethodToken,
245 const unsigned int MethodFlags,
246 PCWSTR MethodNamespace,
247 PCWSTR MethodName,
248 PCWSTR MethodSignature)
249{
250 if (!EventXplatEnabledMethodDCStartVerbose())
251 return ERROR_SUCCESS;
252 INT MethodNamespace_path_size = -1;
253 PathCharString MethodNamespace_PS;
254 INT MethodNamespace_full_name_path_size = (wcslen(MethodNamespace) + 1)*sizeof(WCHAR);
255 CHAR* MethodNamespace_full_name = MethodNamespace_PS.OpenStringBuffer(MethodNamespace_full_name_path_size );
256 if (MethodNamespace_full_name == NULL ) { return ERROR_WRITE_FAULT; }
257 INT MethodName_path_size = -1;
258 PathCharString MethodName_PS;
259 INT MethodName_full_name_path_size = (wcslen(MethodName) + 1)*sizeof(WCHAR);
260 CHAR* MethodName_full_name = MethodName_PS.OpenStringBuffer(MethodName_full_name_path_size );
261 if (MethodName_full_name == NULL ) { return ERROR_WRITE_FAULT; }
262 INT MethodSignature_path_size = -1;
263 PathCharString MethodSignature_PS;
264 INT MethodSignature_full_name_path_size = (wcslen(MethodSignature) + 1)*sizeof(WCHAR);
265 CHAR* MethodSignature_full_name = MethodSignature_PS.OpenStringBuffer(MethodSignature_full_name_path_size );
266 if (MethodSignature_full_name == NULL ) { return ERROR_WRITE_FAULT; }
267
268 MethodNamespace_path_size = WideCharToMultiByte( CP_ACP, 0, MethodNamespace, -1, MethodNamespace_full_name, MethodNamespace_full_name_path_size, NULL, NULL );
269 _ASSERTE(MethodNamespace_path_size < MethodNamespace_full_name_path_size );
270 MethodNamespace_PS.CloseBuffer(MethodNamespace_path_size );
271 if( MethodNamespace_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
272 MethodName_path_size = WideCharToMultiByte( CP_ACP, 0, MethodName, -1, MethodName_full_name, MethodName_full_name_path_size, NULL, NULL );
273 _ASSERTE(MethodName_path_size < MethodName_full_name_path_size );
274 MethodName_PS.CloseBuffer(MethodName_path_size );
275 if( MethodName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
276 MethodSignature_path_size = WideCharToMultiByte( CP_ACP, 0, MethodSignature, -1, MethodSignature_full_name, MethodSignature_full_name_path_size, NULL, NULL );
277 _ASSERTE(MethodSignature_path_size < MethodSignature_full_name_path_size );
278 MethodSignature_PS.CloseBuffer(MethodSignature_path_size );
279 if( MethodSignature_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
280 do_tracepoint(DotNETRuntimeRundown,
281 MethodDCStartVerbose,
282 MethodID,
283 ModuleID,
284 MethodStartAddress,
285 MethodSize,
286 MethodToken,
287 MethodFlags,
288 MethodNamespace_full_name,
289 MethodName_full_name,
290 MethodSignature_full_name);
291
292 return ERROR_SUCCESS;
293}
294
295extern "C" BOOL EventXplatEnabledMethodDCStartVerbose_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, MethodDCStartVerbose_V1); }
296
297extern "C" ULONG FireEtXplatMethodDCStartVerbose_V1(
298 const unsigned __int64 MethodID,
299 const unsigned __int64 ModuleID,
300 const unsigned __int64 MethodStartAddress,
301 const unsigned int MethodSize,
302 const unsigned int MethodToken,
303 const unsigned int MethodFlags,
304 PCWSTR MethodNamespace,
305 PCWSTR MethodName,
306 PCWSTR MethodSignature,
307 const unsigned short ClrInstanceID)
308{
309 if (!EventXplatEnabledMethodDCStartVerbose_V1())
310 return ERROR_SUCCESS;
311
312 char stackBuffer[230];
313 char *buffer = stackBuffer;
314 size_t offset = 0;
315 size_t size = 230;
316 bool fixedBuffer = true;
317
318 bool success = true;
319 success &= WriteToBuffer(MethodID, buffer, offset, size, fixedBuffer);
320 success &= WriteToBuffer(ModuleID, buffer, offset, size, fixedBuffer);
321 success &= WriteToBuffer(MethodStartAddress, buffer, offset, size, fixedBuffer);
322 success &= WriteToBuffer(MethodSize, buffer, offset, size, fixedBuffer);
323 success &= WriteToBuffer(MethodToken, buffer, offset, size, fixedBuffer);
324 success &= WriteToBuffer(MethodFlags, buffer, offset, size, fixedBuffer);
325 success &= WriteToBuffer(MethodNamespace, buffer, offset, size, fixedBuffer);
326 success &= WriteToBuffer(MethodName, buffer, offset, size, fixedBuffer);
327 success &= WriteToBuffer(MethodSignature, buffer, offset, size, fixedBuffer);
328 success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer);
329
330 if (!success)
331 {
332 if (!fixedBuffer)
333 delete[] buffer;
334 return ERROR_WRITE_FAULT;
335 }
336
337 do_tracepoint(DotNETRuntimeRundown, MethodDCStartVerbose_V1, offset, buffer);
338
339 if (!fixedBuffer)
340 delete[] buffer;
341
342 return ERROR_SUCCESS;
343}
344
345extern "C" BOOL EventXplatEnabledMethodDCStartVerbose_V2(){ return tracepoint_enabled(DotNETRuntimeRundown, MethodDCStartVerbose_V2); }
346
347extern "C" ULONG FireEtXplatMethodDCStartVerbose_V2(
348 const unsigned __int64 MethodID,
349 const unsigned __int64 ModuleID,
350 const unsigned __int64 MethodStartAddress,
351 const unsigned int MethodSize,
352 const unsigned int MethodToken,
353 const unsigned int MethodFlags,
354 PCWSTR MethodNamespace,
355 PCWSTR MethodName,
356 PCWSTR MethodSignature,
357 const unsigned short ClrInstanceID,
358 const unsigned __int64 ReJITID)
359{
360 if (!EventXplatEnabledMethodDCStartVerbose_V2())
361 return ERROR_SUCCESS;
362
363 char stackBuffer[238];
364 char *buffer = stackBuffer;
365 size_t offset = 0;
366 size_t size = 238;
367 bool fixedBuffer = true;
368
369 bool success = true;
370 success &= WriteToBuffer(MethodID, buffer, offset, size, fixedBuffer);
371 success &= WriteToBuffer(ModuleID, buffer, offset, size, fixedBuffer);
372 success &= WriteToBuffer(MethodStartAddress, buffer, offset, size, fixedBuffer);
373 success &= WriteToBuffer(MethodSize, buffer, offset, size, fixedBuffer);
374 success &= WriteToBuffer(MethodToken, buffer, offset, size, fixedBuffer);
375 success &= WriteToBuffer(MethodFlags, buffer, offset, size, fixedBuffer);
376 success &= WriteToBuffer(MethodNamespace, buffer, offset, size, fixedBuffer);
377 success &= WriteToBuffer(MethodName, buffer, offset, size, fixedBuffer);
378 success &= WriteToBuffer(MethodSignature, buffer, offset, size, fixedBuffer);
379 success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer);
380 success &= WriteToBuffer(ReJITID, buffer, offset, size, fixedBuffer);
381
382 if (!success)
383 {
384 if (!fixedBuffer)
385 delete[] buffer;
386 return ERROR_WRITE_FAULT;
387 }
388
389 do_tracepoint(DotNETRuntimeRundown, MethodDCStartVerbose_V2, offset, buffer);
390
391 if (!fixedBuffer)
392 delete[] buffer;
393
394 return ERROR_SUCCESS;
395}
396
397extern "C" BOOL EventXplatEnabledMethodDCEndVerbose(){ return tracepoint_enabled(DotNETRuntimeRundown, MethodDCEndVerbose); }
398
399extern "C" ULONG FireEtXplatMethodDCEndVerbose(
400 const unsigned __int64 MethodID,
401 const unsigned __int64 ModuleID,
402 const unsigned __int64 MethodStartAddress,
403 const unsigned int MethodSize,
404 const unsigned int MethodToken,
405 const unsigned int MethodFlags,
406 PCWSTR MethodNamespace,
407 PCWSTR MethodName,
408 PCWSTR MethodSignature)
409{
410 if (!EventXplatEnabledMethodDCEndVerbose())
411 return ERROR_SUCCESS;
412 INT MethodNamespace_path_size = -1;
413 PathCharString MethodNamespace_PS;
414 INT MethodNamespace_full_name_path_size = (wcslen(MethodNamespace) + 1)*sizeof(WCHAR);
415 CHAR* MethodNamespace_full_name = MethodNamespace_PS.OpenStringBuffer(MethodNamespace_full_name_path_size );
416 if (MethodNamespace_full_name == NULL ) { return ERROR_WRITE_FAULT; }
417 INT MethodName_path_size = -1;
418 PathCharString MethodName_PS;
419 INT MethodName_full_name_path_size = (wcslen(MethodName) + 1)*sizeof(WCHAR);
420 CHAR* MethodName_full_name = MethodName_PS.OpenStringBuffer(MethodName_full_name_path_size );
421 if (MethodName_full_name == NULL ) { return ERROR_WRITE_FAULT; }
422 INT MethodSignature_path_size = -1;
423 PathCharString MethodSignature_PS;
424 INT MethodSignature_full_name_path_size = (wcslen(MethodSignature) + 1)*sizeof(WCHAR);
425 CHAR* MethodSignature_full_name = MethodSignature_PS.OpenStringBuffer(MethodSignature_full_name_path_size );
426 if (MethodSignature_full_name == NULL ) { return ERROR_WRITE_FAULT; }
427
428 MethodNamespace_path_size = WideCharToMultiByte( CP_ACP, 0, MethodNamespace, -1, MethodNamespace_full_name, MethodNamespace_full_name_path_size, NULL, NULL );
429 _ASSERTE(MethodNamespace_path_size < MethodNamespace_full_name_path_size );
430 MethodNamespace_PS.CloseBuffer(MethodNamespace_path_size );
431 if( MethodNamespace_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
432 MethodName_path_size = WideCharToMultiByte( CP_ACP, 0, MethodName, -1, MethodName_full_name, MethodName_full_name_path_size, NULL, NULL );
433 _ASSERTE(MethodName_path_size < MethodName_full_name_path_size );
434 MethodName_PS.CloseBuffer(MethodName_path_size );
435 if( MethodName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
436 MethodSignature_path_size = WideCharToMultiByte( CP_ACP, 0, MethodSignature, -1, MethodSignature_full_name, MethodSignature_full_name_path_size, NULL, NULL );
437 _ASSERTE(MethodSignature_path_size < MethodSignature_full_name_path_size );
438 MethodSignature_PS.CloseBuffer(MethodSignature_path_size );
439 if( MethodSignature_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
440 do_tracepoint(DotNETRuntimeRundown,
441 MethodDCEndVerbose,
442 MethodID,
443 ModuleID,
444 MethodStartAddress,
445 MethodSize,
446 MethodToken,
447 MethodFlags,
448 MethodNamespace_full_name,
449 MethodName_full_name,
450 MethodSignature_full_name);
451
452 return ERROR_SUCCESS;
453}
454
455extern "C" BOOL EventXplatEnabledMethodDCEndVerbose_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, MethodDCEndVerbose_V1); }
456
457extern "C" ULONG FireEtXplatMethodDCEndVerbose_V1(
458 const unsigned __int64 MethodID,
459 const unsigned __int64 ModuleID,
460 const unsigned __int64 MethodStartAddress,
461 const unsigned int MethodSize,
462 const unsigned int MethodToken,
463 const unsigned int MethodFlags,
464 PCWSTR MethodNamespace,
465 PCWSTR MethodName,
466 PCWSTR MethodSignature,
467 const unsigned short ClrInstanceID)
468{
469 if (!EventXplatEnabledMethodDCEndVerbose_V1())
470 return ERROR_SUCCESS;
471
472 char stackBuffer[230];
473 char *buffer = stackBuffer;
474 size_t offset = 0;
475 size_t size = 230;
476 bool fixedBuffer = true;
477
478 bool success = true;
479 success &= WriteToBuffer(MethodID, buffer, offset, size, fixedBuffer);
480 success &= WriteToBuffer(ModuleID, buffer, offset, size, fixedBuffer);
481 success &= WriteToBuffer(MethodStartAddress, buffer, offset, size, fixedBuffer);
482 success &= WriteToBuffer(MethodSize, buffer, offset, size, fixedBuffer);
483 success &= WriteToBuffer(MethodToken, buffer, offset, size, fixedBuffer);
484 success &= WriteToBuffer(MethodFlags, buffer, offset, size, fixedBuffer);
485 success &= WriteToBuffer(MethodNamespace, buffer, offset, size, fixedBuffer);
486 success &= WriteToBuffer(MethodName, buffer, offset, size, fixedBuffer);
487 success &= WriteToBuffer(MethodSignature, buffer, offset, size, fixedBuffer);
488 success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer);
489
490 if (!success)
491 {
492 if (!fixedBuffer)
493 delete[] buffer;
494 return ERROR_WRITE_FAULT;
495 }
496
497 do_tracepoint(DotNETRuntimeRundown, MethodDCEndVerbose_V1, offset, buffer);
498
499 if (!fixedBuffer)
500 delete[] buffer;
501
502 return ERROR_SUCCESS;
503}
504
505extern "C" BOOL EventXplatEnabledMethodDCEndVerbose_V2(){ return tracepoint_enabled(DotNETRuntimeRundown, MethodDCEndVerbose_V2); }
506
507extern "C" ULONG FireEtXplatMethodDCEndVerbose_V2(
508 const unsigned __int64 MethodID,
509 const unsigned __int64 ModuleID,
510 const unsigned __int64 MethodStartAddress,
511 const unsigned int MethodSize,
512 const unsigned int MethodToken,
513 const unsigned int MethodFlags,
514 PCWSTR MethodNamespace,
515 PCWSTR MethodName,
516 PCWSTR MethodSignature,
517 const unsigned short ClrInstanceID,
518 const unsigned __int64 ReJITID)
519{
520 if (!EventXplatEnabledMethodDCEndVerbose_V2())
521 return ERROR_SUCCESS;
522
523 char stackBuffer[238];
524 char *buffer = stackBuffer;
525 size_t offset = 0;
526 size_t size = 238;
527 bool fixedBuffer = true;
528
529 bool success = true;
530 success &= WriteToBuffer(MethodID, buffer, offset, size, fixedBuffer);
531 success &= WriteToBuffer(ModuleID, buffer, offset, size, fixedBuffer);
532 success &= WriteToBuffer(MethodStartAddress, buffer, offset, size, fixedBuffer);
533 success &= WriteToBuffer(MethodSize, buffer, offset, size, fixedBuffer);
534 success &= WriteToBuffer(MethodToken, buffer, offset, size, fixedBuffer);
535 success &= WriteToBuffer(MethodFlags, buffer, offset, size, fixedBuffer);
536 success &= WriteToBuffer(MethodNamespace, buffer, offset, size, fixedBuffer);
537 success &= WriteToBuffer(MethodName, buffer, offset, size, fixedBuffer);
538 success &= WriteToBuffer(MethodSignature, buffer, offset, size, fixedBuffer);
539 success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer);
540 success &= WriteToBuffer(ReJITID, buffer, offset, size, fixedBuffer);
541
542 if (!success)
543 {
544 if (!fixedBuffer)
545 delete[] buffer;
546 return ERROR_WRITE_FAULT;
547 }
548
549 do_tracepoint(DotNETRuntimeRundown, MethodDCEndVerbose_V2, offset, buffer);
550
551 if (!fixedBuffer)
552 delete[] buffer;
553
554 return ERROR_SUCCESS;
555}
556
557extern "C" BOOL EventXplatEnabledDCStartComplete(){ return tracepoint_enabled(DotNETRuntimeRundown, DCStartComplete); }
558
559extern "C" ULONG FireEtXplatDCStartComplete(
560)
561{
562 if (!EventXplatEnabledDCStartComplete())
563 return ERROR_SUCCESS;
564
565 do_tracepoint(DotNETRuntimeRundown, DCStartComplete);
566
567 return ERROR_SUCCESS;
568}
569
570extern "C" BOOL EventXplatEnabledDCStartComplete_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, DCStartComplete_V1); }
571
572extern "C" ULONG FireEtXplatDCStartComplete_V1(
573 const unsigned short ClrInstanceID)
574{
575 if (!EventXplatEnabledDCStartComplete_V1())
576 return ERROR_SUCCESS;
577
578 do_tracepoint(DotNETRuntimeRundown,
579 DCStartComplete_V1,
580 ClrInstanceID);
581
582 return ERROR_SUCCESS;
583}
584
585extern "C" BOOL EventXplatEnabledDCEndComplete(){ return tracepoint_enabled(DotNETRuntimeRundown, DCEndComplete); }
586
587extern "C" ULONG FireEtXplatDCEndComplete(
588)
589{
590 if (!EventXplatEnabledDCEndComplete())
591 return ERROR_SUCCESS;
592
593 do_tracepoint(DotNETRuntimeRundown, DCEndComplete);
594
595 return ERROR_SUCCESS;
596}
597
598extern "C" BOOL EventXplatEnabledDCEndComplete_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, DCEndComplete_V1); }
599
600extern "C" ULONG FireEtXplatDCEndComplete_V1(
601 const unsigned short ClrInstanceID)
602{
603 if (!EventXplatEnabledDCEndComplete_V1())
604 return ERROR_SUCCESS;
605
606 do_tracepoint(DotNETRuntimeRundown,
607 DCEndComplete_V1,
608 ClrInstanceID);
609
610 return ERROR_SUCCESS;
611}
612
613extern "C" BOOL EventXplatEnabledDCStartInit(){ return tracepoint_enabled(DotNETRuntimeRundown, DCStartInit); }
614
615extern "C" ULONG FireEtXplatDCStartInit(
616)
617{
618 if (!EventXplatEnabledDCStartInit())
619 return ERROR_SUCCESS;
620
621 do_tracepoint(DotNETRuntimeRundown, DCStartInit);
622
623 return ERROR_SUCCESS;
624}
625
626extern "C" BOOL EventXplatEnabledDCStartInit_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, DCStartInit_V1); }
627
628extern "C" ULONG FireEtXplatDCStartInit_V1(
629 const unsigned short ClrInstanceID)
630{
631 if (!EventXplatEnabledDCStartInit_V1())
632 return ERROR_SUCCESS;
633
634 do_tracepoint(DotNETRuntimeRundown,
635 DCStartInit_V1,
636 ClrInstanceID);
637
638 return ERROR_SUCCESS;
639}
640
641extern "C" BOOL EventXplatEnabledDCEndInit(){ return tracepoint_enabled(DotNETRuntimeRundown, DCEndInit); }
642
643extern "C" ULONG FireEtXplatDCEndInit(
644)
645{
646 if (!EventXplatEnabledDCEndInit())
647 return ERROR_SUCCESS;
648
649 do_tracepoint(DotNETRuntimeRundown, DCEndInit);
650
651 return ERROR_SUCCESS;
652}
653
654extern "C" BOOL EventXplatEnabledDCEndInit_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, DCEndInit_V1); }
655
656extern "C" ULONG FireEtXplatDCEndInit_V1(
657 const unsigned short ClrInstanceID)
658{
659 if (!EventXplatEnabledDCEndInit_V1())
660 return ERROR_SUCCESS;
661
662 do_tracepoint(DotNETRuntimeRundown,
663 DCEndInit_V1,
664 ClrInstanceID);
665
666 return ERROR_SUCCESS;
667}
668
669extern "C" BOOL EventXplatEnabledMethodDCStartILToNativeMap(){ return tracepoint_enabled(DotNETRuntimeRundown, MethodDCStartILToNativeMap); }
670
671extern "C" ULONG FireEtXplatMethodDCStartILToNativeMap(
672 const unsigned __int64 MethodID,
673 const unsigned __int64 ReJITID,
674 const unsigned char MethodExtent,
675 const unsigned short CountOfMapEntries,
676 const unsigned int* ILOffsets,
677 const unsigned int* NativeOffsets,
678 const unsigned short ClrInstanceID)
679{
680 if (!EventXplatEnabledMethodDCStartILToNativeMap())
681 return ERROR_SUCCESS;
682
683 char stackBuffer[32];
684 char *buffer = stackBuffer;
685 size_t offset = 0;
686 size_t size = 32;
687 bool fixedBuffer = true;
688
689 bool success = true;
690 success &= WriteToBuffer(MethodID, buffer, offset, size, fixedBuffer);
691 success &= WriteToBuffer(ReJITID, buffer, offset, size, fixedBuffer);
692 success &= WriteToBuffer(MethodExtent, buffer, offset, size, fixedBuffer);
693 success &= WriteToBuffer(CountOfMapEntries, buffer, offset, size, fixedBuffer);
694 success &= WriteToBuffer((const BYTE *)ILOffsets, sizeof(const unsigned int) * (int)CountOfMapEntries, buffer, offset, size, fixedBuffer);
695 success &= WriteToBuffer((const BYTE *)NativeOffsets, sizeof(const unsigned int) * (int)CountOfMapEntries, buffer, offset, size, fixedBuffer);
696 success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer);
697
698 if (!success)
699 {
700 if (!fixedBuffer)
701 delete[] buffer;
702 return ERROR_WRITE_FAULT;
703 }
704
705 do_tracepoint(DotNETRuntimeRundown, MethodDCStartILToNativeMap, offset, buffer);
706
707 if (!fixedBuffer)
708 delete[] buffer;
709
710 return ERROR_SUCCESS;
711}
712
713extern "C" BOOL EventXplatEnabledMethodDCEndILToNativeMap(){ return tracepoint_enabled(DotNETRuntimeRundown, MethodDCEndILToNativeMap); }
714
715extern "C" ULONG FireEtXplatMethodDCEndILToNativeMap(
716 const unsigned __int64 MethodID,
717 const unsigned __int64 ReJITID,
718 const unsigned char MethodExtent,
719 const unsigned short CountOfMapEntries,
720 const unsigned int* ILOffsets,
721 const unsigned int* NativeOffsets,
722 const unsigned short ClrInstanceID)
723{
724 if (!EventXplatEnabledMethodDCEndILToNativeMap())
725 return ERROR_SUCCESS;
726
727 char stackBuffer[32];
728 char *buffer = stackBuffer;
729 size_t offset = 0;
730 size_t size = 32;
731 bool fixedBuffer = true;
732
733 bool success = true;
734 success &= WriteToBuffer(MethodID, buffer, offset, size, fixedBuffer);
735 success &= WriteToBuffer(ReJITID, buffer, offset, size, fixedBuffer);
736 success &= WriteToBuffer(MethodExtent, buffer, offset, size, fixedBuffer);
737 success &= WriteToBuffer(CountOfMapEntries, buffer, offset, size, fixedBuffer);
738 success &= WriteToBuffer((const BYTE *)ILOffsets, sizeof(const unsigned int) * (int)CountOfMapEntries, buffer, offset, size, fixedBuffer);
739 success &= WriteToBuffer((const BYTE *)NativeOffsets, sizeof(const unsigned int) * (int)CountOfMapEntries, buffer, offset, size, fixedBuffer);
740 success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer);
741
742 if (!success)
743 {
744 if (!fixedBuffer)
745 delete[] buffer;
746 return ERROR_WRITE_FAULT;
747 }
748
749 do_tracepoint(DotNETRuntimeRundown, MethodDCEndILToNativeMap, offset, buffer);
750
751 if (!fixedBuffer)
752 delete[] buffer;
753
754 return ERROR_SUCCESS;
755}
756
757extern "C" BOOL EventXplatEnabledDomainModuleDCStart(){ return tracepoint_enabled(DotNETRuntimeRundown, DomainModuleDCStart); }
758
759extern "C" ULONG FireEtXplatDomainModuleDCStart(
760 const unsigned __int64 ModuleID,
761 const unsigned __int64 AssemblyID,
762 const unsigned __int64 AppDomainID,
763 const unsigned int ModuleFlags,
764 const unsigned int Reserved1,
765 PCWSTR ModuleILPath,
766 PCWSTR ModuleNativePath)
767{
768 if (!EventXplatEnabledDomainModuleDCStart())
769 return ERROR_SUCCESS;
770 INT ModuleILPath_path_size = -1;
771 PathCharString ModuleILPath_PS;
772 INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR);
773 CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size );
774 if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
775 INT ModuleNativePath_path_size = -1;
776 PathCharString ModuleNativePath_PS;
777 INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR);
778 CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size );
779 if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
780
781 ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL );
782 _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size );
783 ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size );
784 if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
785 ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL );
786 _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size );
787 ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size );
788 if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
789 do_tracepoint(DotNETRuntimeRundown,
790 DomainModuleDCStart,
791 ModuleID,
792 AssemblyID,
793 AppDomainID,
794 ModuleFlags,
795 Reserved1,
796 ModuleILPath_full_name,
797 ModuleNativePath_full_name);
798
799 return ERROR_SUCCESS;
800}
801
802extern "C" BOOL EventXplatEnabledDomainModuleDCStart_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, DomainModuleDCStart_V1); }
803
804extern "C" ULONG FireEtXplatDomainModuleDCStart_V1(
805 const unsigned __int64 ModuleID,
806 const unsigned __int64 AssemblyID,
807 const unsigned __int64 AppDomainID,
808 const unsigned int ModuleFlags,
809 const unsigned int Reserved1,
810 PCWSTR ModuleILPath,
811 PCWSTR ModuleNativePath,
812 const unsigned short ClrInstanceID)
813{
814 if (!EventXplatEnabledDomainModuleDCStart_V1())
815 return ERROR_SUCCESS;
816 INT ModuleILPath_path_size = -1;
817 PathCharString ModuleILPath_PS;
818 INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR);
819 CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size );
820 if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
821 INT ModuleNativePath_path_size = -1;
822 PathCharString ModuleNativePath_PS;
823 INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR);
824 CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size );
825 if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
826
827 ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL );
828 _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size );
829 ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size );
830 if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
831 ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL );
832 _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size );
833 ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size );
834 if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
835 do_tracepoint(DotNETRuntimeRundown,
836 DomainModuleDCStart_V1,
837 ModuleID,
838 AssemblyID,
839 AppDomainID,
840 ModuleFlags,
841 Reserved1,
842 ModuleILPath_full_name,
843 ModuleNativePath_full_name,
844 ClrInstanceID);
845
846 return ERROR_SUCCESS;
847}
848
849extern "C" BOOL EventXplatEnabledDomainModuleDCEnd(){ return tracepoint_enabled(DotNETRuntimeRundown, DomainModuleDCEnd); }
850
851extern "C" ULONG FireEtXplatDomainModuleDCEnd(
852 const unsigned __int64 ModuleID,
853 const unsigned __int64 AssemblyID,
854 const unsigned __int64 AppDomainID,
855 const unsigned int ModuleFlags,
856 const unsigned int Reserved1,
857 PCWSTR ModuleILPath,
858 PCWSTR ModuleNativePath)
859{
860 if (!EventXplatEnabledDomainModuleDCEnd())
861 return ERROR_SUCCESS;
862 INT ModuleILPath_path_size = -1;
863 PathCharString ModuleILPath_PS;
864 INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR);
865 CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size );
866 if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
867 INT ModuleNativePath_path_size = -1;
868 PathCharString ModuleNativePath_PS;
869 INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR);
870 CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size );
871 if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
872
873 ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL );
874 _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size );
875 ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size );
876 if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
877 ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL );
878 _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size );
879 ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size );
880 if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
881 do_tracepoint(DotNETRuntimeRundown,
882 DomainModuleDCEnd,
883 ModuleID,
884 AssemblyID,
885 AppDomainID,
886 ModuleFlags,
887 Reserved1,
888 ModuleILPath_full_name,
889 ModuleNativePath_full_name);
890
891 return ERROR_SUCCESS;
892}
893
894extern "C" BOOL EventXplatEnabledDomainModuleDCEnd_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, DomainModuleDCEnd_V1); }
895
896extern "C" ULONG FireEtXplatDomainModuleDCEnd_V1(
897 const unsigned __int64 ModuleID,
898 const unsigned __int64 AssemblyID,
899 const unsigned __int64 AppDomainID,
900 const unsigned int ModuleFlags,
901 const unsigned int Reserved1,
902 PCWSTR ModuleILPath,
903 PCWSTR ModuleNativePath,
904 const unsigned short ClrInstanceID)
905{
906 if (!EventXplatEnabledDomainModuleDCEnd_V1())
907 return ERROR_SUCCESS;
908 INT ModuleILPath_path_size = -1;
909 PathCharString ModuleILPath_PS;
910 INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR);
911 CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size );
912 if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
913 INT ModuleNativePath_path_size = -1;
914 PathCharString ModuleNativePath_PS;
915 INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR);
916 CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size );
917 if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
918
919 ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL );
920 _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size );
921 ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size );
922 if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
923 ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL );
924 _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size );
925 ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size );
926 if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
927 do_tracepoint(DotNETRuntimeRundown,
928 DomainModuleDCEnd_V1,
929 ModuleID,
930 AssemblyID,
931 AppDomainID,
932 ModuleFlags,
933 Reserved1,
934 ModuleILPath_full_name,
935 ModuleNativePath_full_name,
936 ClrInstanceID);
937
938 return ERROR_SUCCESS;
939}
940
941extern "C" BOOL EventXplatEnabledModuleDCStart(){ return tracepoint_enabled(DotNETRuntimeRundown, ModuleDCStart); }
942
943extern "C" ULONG FireEtXplatModuleDCStart(
944 const unsigned __int64 ModuleID,
945 const unsigned __int64 AssemblyID,
946 const unsigned int ModuleFlags,
947 const unsigned int Reserved1,
948 PCWSTR ModuleILPath,
949 PCWSTR ModuleNativePath)
950{
951 if (!EventXplatEnabledModuleDCStart())
952 return ERROR_SUCCESS;
953 INT ModuleILPath_path_size = -1;
954 PathCharString ModuleILPath_PS;
955 INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR);
956 CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size );
957 if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
958 INT ModuleNativePath_path_size = -1;
959 PathCharString ModuleNativePath_PS;
960 INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR);
961 CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size );
962 if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
963
964 ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL );
965 _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size );
966 ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size );
967 if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
968 ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL );
969 _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size );
970 ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size );
971 if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
972 do_tracepoint(DotNETRuntimeRundown,
973 ModuleDCStart,
974 ModuleID,
975 AssemblyID,
976 ModuleFlags,
977 Reserved1,
978 ModuleILPath_full_name,
979 ModuleNativePath_full_name);
980
981 return ERROR_SUCCESS;
982}
983
984extern "C" BOOL EventXplatEnabledModuleDCStart_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, ModuleDCStart_V1); }
985
986extern "C" ULONG FireEtXplatModuleDCStart_V1(
987 const unsigned __int64 ModuleID,
988 const unsigned __int64 AssemblyID,
989 const unsigned int ModuleFlags,
990 const unsigned int Reserved1,
991 PCWSTR ModuleILPath,
992 PCWSTR ModuleNativePath,
993 const unsigned short ClrInstanceID)
994{
995 if (!EventXplatEnabledModuleDCStart_V1())
996 return ERROR_SUCCESS;
997 INT ModuleILPath_path_size = -1;
998 PathCharString ModuleILPath_PS;
999 INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR);
1000 CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size );
1001 if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
1002 INT ModuleNativePath_path_size = -1;
1003 PathCharString ModuleNativePath_PS;
1004 INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR);
1005 CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size );
1006 if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
1007
1008 ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL );
1009 _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size );
1010 ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size );
1011 if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
1012 ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL );
1013 _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size );
1014 ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size );
1015 if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
1016 do_tracepoint(DotNETRuntimeRundown,
1017 ModuleDCStart_V1,
1018 ModuleID,
1019 AssemblyID,
1020 ModuleFlags,
1021 Reserved1,
1022 ModuleILPath_full_name,
1023 ModuleNativePath_full_name,
1024 ClrInstanceID);
1025
1026 return ERROR_SUCCESS;
1027}
1028
1029extern "C" BOOL EventXplatEnabledModuleDCStart_V2(){ return tracepoint_enabled(DotNETRuntimeRundown, ModuleDCStart_V2); }
1030
1031extern "C" ULONG FireEtXplatModuleDCStart_V2(
1032 const unsigned __int64 ModuleID,
1033 const unsigned __int64 AssemblyID,
1034 const unsigned int ModuleFlags,
1035 const unsigned int Reserved1,
1036 PCWSTR ModuleILPath,
1037 PCWSTR ModuleNativePath,
1038 const unsigned short ClrInstanceID,
1039 const GUID* ManagedPdbSignature,
1040 const unsigned int ManagedPdbAge,
1041 PCWSTR ManagedPdbBuildPath,
1042 const GUID* NativePdbSignature,
1043 const unsigned int NativePdbAge,
1044 PCWSTR NativePdbBuildPath)
1045{
1046 if (!EventXplatEnabledModuleDCStart_V2())
1047 return ERROR_SUCCESS;
1048
1049 char stackBuffer[290];
1050 char *buffer = stackBuffer;
1051 size_t offset = 0;
1052 size_t size = 290;
1053 bool fixedBuffer = true;
1054
1055 bool success = true;
1056 success &= WriteToBuffer(ModuleID, buffer, offset, size, fixedBuffer);
1057 success &= WriteToBuffer(AssemblyID, buffer, offset, size, fixedBuffer);
1058 success &= WriteToBuffer(ModuleFlags, buffer, offset, size, fixedBuffer);
1059 success &= WriteToBuffer(Reserved1, buffer, offset, size, fixedBuffer);
1060 success &= WriteToBuffer(ModuleILPath, buffer, offset, size, fixedBuffer);
1061 success &= WriteToBuffer(ModuleNativePath, buffer, offset, size, fixedBuffer);
1062 success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer);
1063 success &= WriteToBuffer(*ManagedPdbSignature, buffer, offset, size, fixedBuffer);
1064 success &= WriteToBuffer(ManagedPdbAge, buffer, offset, size, fixedBuffer);
1065 success &= WriteToBuffer(ManagedPdbBuildPath, buffer, offset, size, fixedBuffer);
1066 success &= WriteToBuffer(*NativePdbSignature, buffer, offset, size, fixedBuffer);
1067 success &= WriteToBuffer(NativePdbAge, buffer, offset, size, fixedBuffer);
1068 success &= WriteToBuffer(NativePdbBuildPath, buffer, offset, size, fixedBuffer);
1069
1070 if (!success)
1071 {
1072 if (!fixedBuffer)
1073 delete[] buffer;
1074 return ERROR_WRITE_FAULT;
1075 }
1076
1077 do_tracepoint(DotNETRuntimeRundown, ModuleDCStart_V2, offset, buffer);
1078
1079 if (!fixedBuffer)
1080 delete[] buffer;
1081
1082 return ERROR_SUCCESS;
1083}
1084
1085extern "C" BOOL EventXplatEnabledModuleDCEnd(){ return tracepoint_enabled(DotNETRuntimeRundown, ModuleDCEnd); }
1086
1087extern "C" ULONG FireEtXplatModuleDCEnd(
1088 const unsigned __int64 ModuleID,
1089 const unsigned __int64 AssemblyID,
1090 const unsigned int ModuleFlags,
1091 const unsigned int Reserved1,
1092 PCWSTR ModuleILPath,
1093 PCWSTR ModuleNativePath)
1094{
1095 if (!EventXplatEnabledModuleDCEnd())
1096 return ERROR_SUCCESS;
1097 INT ModuleILPath_path_size = -1;
1098 PathCharString ModuleILPath_PS;
1099 INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR);
1100 CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size );
1101 if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
1102 INT ModuleNativePath_path_size = -1;
1103 PathCharString ModuleNativePath_PS;
1104 INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR);
1105 CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size );
1106 if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
1107
1108 ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL );
1109 _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size );
1110 ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size );
1111 if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
1112 ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL );
1113 _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size );
1114 ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size );
1115 if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
1116 do_tracepoint(DotNETRuntimeRundown,
1117 ModuleDCEnd,
1118 ModuleID,
1119 AssemblyID,
1120 ModuleFlags,
1121 Reserved1,
1122 ModuleILPath_full_name,
1123 ModuleNativePath_full_name);
1124
1125 return ERROR_SUCCESS;
1126}
1127
1128extern "C" BOOL EventXplatEnabledModuleDCEnd_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, ModuleDCEnd_V1); }
1129
1130extern "C" ULONG FireEtXplatModuleDCEnd_V1(
1131 const unsigned __int64 ModuleID,
1132 const unsigned __int64 AssemblyID,
1133 const unsigned int ModuleFlags,
1134 const unsigned int Reserved1,
1135 PCWSTR ModuleILPath,
1136 PCWSTR ModuleNativePath,
1137 const unsigned short ClrInstanceID)
1138{
1139 if (!EventXplatEnabledModuleDCEnd_V1())
1140 return ERROR_SUCCESS;
1141 INT ModuleILPath_path_size = -1;
1142 PathCharString ModuleILPath_PS;
1143 INT ModuleILPath_full_name_path_size = (wcslen(ModuleILPath) + 1)*sizeof(WCHAR);
1144 CHAR* ModuleILPath_full_name = ModuleILPath_PS.OpenStringBuffer(ModuleILPath_full_name_path_size );
1145 if (ModuleILPath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
1146 INT ModuleNativePath_path_size = -1;
1147 PathCharString ModuleNativePath_PS;
1148 INT ModuleNativePath_full_name_path_size = (wcslen(ModuleNativePath) + 1)*sizeof(WCHAR);
1149 CHAR* ModuleNativePath_full_name = ModuleNativePath_PS.OpenStringBuffer(ModuleNativePath_full_name_path_size );
1150 if (ModuleNativePath_full_name == NULL ) { return ERROR_WRITE_FAULT; }
1151
1152 ModuleILPath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleILPath, -1, ModuleILPath_full_name, ModuleILPath_full_name_path_size, NULL, NULL );
1153 _ASSERTE(ModuleILPath_path_size < ModuleILPath_full_name_path_size );
1154 ModuleILPath_PS.CloseBuffer(ModuleILPath_path_size );
1155 if( ModuleILPath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
1156 ModuleNativePath_path_size = WideCharToMultiByte( CP_ACP, 0, ModuleNativePath, -1, ModuleNativePath_full_name, ModuleNativePath_full_name_path_size, NULL, NULL );
1157 _ASSERTE(ModuleNativePath_path_size < ModuleNativePath_full_name_path_size );
1158 ModuleNativePath_PS.CloseBuffer(ModuleNativePath_path_size );
1159 if( ModuleNativePath_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
1160 do_tracepoint(DotNETRuntimeRundown,
1161 ModuleDCEnd_V1,
1162 ModuleID,
1163 AssemblyID,
1164 ModuleFlags,
1165 Reserved1,
1166 ModuleILPath_full_name,
1167 ModuleNativePath_full_name,
1168 ClrInstanceID);
1169
1170 return ERROR_SUCCESS;
1171}
1172
1173extern "C" BOOL EventXplatEnabledModuleDCEnd_V2(){ return tracepoint_enabled(DotNETRuntimeRundown, ModuleDCEnd_V2); }
1174
1175extern "C" ULONG FireEtXplatModuleDCEnd_V2(
1176 const unsigned __int64 ModuleID,
1177 const unsigned __int64 AssemblyID,
1178 const unsigned int ModuleFlags,
1179 const unsigned int Reserved1,
1180 PCWSTR ModuleILPath,
1181 PCWSTR ModuleNativePath,
1182 const unsigned short ClrInstanceID,
1183 const GUID* ManagedPdbSignature,
1184 const unsigned int ManagedPdbAge,
1185 PCWSTR ManagedPdbBuildPath,
1186 const GUID* NativePdbSignature,
1187 const unsigned int NativePdbAge,
1188 PCWSTR NativePdbBuildPath)
1189{
1190 if (!EventXplatEnabledModuleDCEnd_V2())
1191 return ERROR_SUCCESS;
1192
1193 char stackBuffer[290];
1194 char *buffer = stackBuffer;
1195 size_t offset = 0;
1196 size_t size = 290;
1197 bool fixedBuffer = true;
1198
1199 bool success = true;
1200 success &= WriteToBuffer(ModuleID, buffer, offset, size, fixedBuffer);
1201 success &= WriteToBuffer(AssemblyID, buffer, offset, size, fixedBuffer);
1202 success &= WriteToBuffer(ModuleFlags, buffer, offset, size, fixedBuffer);
1203 success &= WriteToBuffer(Reserved1, buffer, offset, size, fixedBuffer);
1204 success &= WriteToBuffer(ModuleILPath, buffer, offset, size, fixedBuffer);
1205 success &= WriteToBuffer(ModuleNativePath, buffer, offset, size, fixedBuffer);
1206 success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer);
1207 success &= WriteToBuffer(*ManagedPdbSignature, buffer, offset, size, fixedBuffer);
1208 success &= WriteToBuffer(ManagedPdbAge, buffer, offset, size, fixedBuffer);
1209 success &= WriteToBuffer(ManagedPdbBuildPath, buffer, offset, size, fixedBuffer);
1210 success &= WriteToBuffer(*NativePdbSignature, buffer, offset, size, fixedBuffer);
1211 success &= WriteToBuffer(NativePdbAge, buffer, offset, size, fixedBuffer);
1212 success &= WriteToBuffer(NativePdbBuildPath, buffer, offset, size, fixedBuffer);
1213
1214 if (!success)
1215 {
1216 if (!fixedBuffer)
1217 delete[] buffer;
1218 return ERROR_WRITE_FAULT;
1219 }
1220
1221 do_tracepoint(DotNETRuntimeRundown, ModuleDCEnd_V2, offset, buffer);
1222
1223 if (!fixedBuffer)
1224 delete[] buffer;
1225
1226 return ERROR_SUCCESS;
1227}
1228
1229extern "C" BOOL EventXplatEnabledAssemblyDCStart(){ return tracepoint_enabled(DotNETRuntimeRundown, AssemblyDCStart); }
1230
1231extern "C" ULONG FireEtXplatAssemblyDCStart(
1232 const unsigned __int64 AssemblyID,
1233 const unsigned __int64 AppDomainID,
1234 const unsigned int AssemblyFlags,
1235 PCWSTR FullyQualifiedAssemblyName)
1236{
1237 if (!EventXplatEnabledAssemblyDCStart())
1238 return ERROR_SUCCESS;
1239 INT FullyQualifiedAssemblyName_path_size = -1;
1240 PathCharString FullyQualifiedAssemblyName_PS;
1241 INT FullyQualifiedAssemblyName_full_name_path_size = (wcslen(FullyQualifiedAssemblyName) + 1)*sizeof(WCHAR);
1242 CHAR* FullyQualifiedAssemblyName_full_name = FullyQualifiedAssemblyName_PS.OpenStringBuffer(FullyQualifiedAssemblyName_full_name_path_size );
1243 if (FullyQualifiedAssemblyName_full_name == NULL ) { return ERROR_WRITE_FAULT; }
1244
1245 FullyQualifiedAssemblyName_path_size = WideCharToMultiByte( CP_ACP, 0, FullyQualifiedAssemblyName, -1, FullyQualifiedAssemblyName_full_name, FullyQualifiedAssemblyName_full_name_path_size, NULL, NULL );
1246 _ASSERTE(FullyQualifiedAssemblyName_path_size < FullyQualifiedAssemblyName_full_name_path_size );
1247 FullyQualifiedAssemblyName_PS.CloseBuffer(FullyQualifiedAssemblyName_path_size );
1248 if( FullyQualifiedAssemblyName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
1249 do_tracepoint(DotNETRuntimeRundown,
1250 AssemblyDCStart,
1251 AssemblyID,
1252 AppDomainID,
1253 AssemblyFlags,
1254 FullyQualifiedAssemblyName_full_name);
1255
1256 return ERROR_SUCCESS;
1257}
1258
1259extern "C" BOOL EventXplatEnabledAssemblyDCStart_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, AssemblyDCStart_V1); }
1260
1261extern "C" ULONG FireEtXplatAssemblyDCStart_V1(
1262 const unsigned __int64 AssemblyID,
1263 const unsigned __int64 AppDomainID,
1264 const unsigned __int64 BindingID,
1265 const unsigned int AssemblyFlags,
1266 PCWSTR FullyQualifiedAssemblyName,
1267 const unsigned short ClrInstanceID)
1268{
1269 if (!EventXplatEnabledAssemblyDCStart_V1())
1270 return ERROR_SUCCESS;
1271 INT FullyQualifiedAssemblyName_path_size = -1;
1272 PathCharString FullyQualifiedAssemblyName_PS;
1273 INT FullyQualifiedAssemblyName_full_name_path_size = (wcslen(FullyQualifiedAssemblyName) + 1)*sizeof(WCHAR);
1274 CHAR* FullyQualifiedAssemblyName_full_name = FullyQualifiedAssemblyName_PS.OpenStringBuffer(FullyQualifiedAssemblyName_full_name_path_size );
1275 if (FullyQualifiedAssemblyName_full_name == NULL ) { return ERROR_WRITE_FAULT; }
1276
1277 FullyQualifiedAssemblyName_path_size = WideCharToMultiByte( CP_ACP, 0, FullyQualifiedAssemblyName, -1, FullyQualifiedAssemblyName_full_name, FullyQualifiedAssemblyName_full_name_path_size, NULL, NULL );
1278 _ASSERTE(FullyQualifiedAssemblyName_path_size < FullyQualifiedAssemblyName_full_name_path_size );
1279 FullyQualifiedAssemblyName_PS.CloseBuffer(FullyQualifiedAssemblyName_path_size );
1280 if( FullyQualifiedAssemblyName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
1281 do_tracepoint(DotNETRuntimeRundown,
1282 AssemblyDCStart_V1,
1283 AssemblyID,
1284 AppDomainID,
1285 BindingID,
1286 AssemblyFlags,
1287 FullyQualifiedAssemblyName_full_name,
1288 ClrInstanceID);
1289
1290 return ERROR_SUCCESS;
1291}
1292
1293extern "C" BOOL EventXplatEnabledAssemblyDCEnd(){ return tracepoint_enabled(DotNETRuntimeRundown, AssemblyDCEnd); }
1294
1295extern "C" ULONG FireEtXplatAssemblyDCEnd(
1296 const unsigned __int64 AssemblyID,
1297 const unsigned __int64 AppDomainID,
1298 const unsigned int AssemblyFlags,
1299 PCWSTR FullyQualifiedAssemblyName)
1300{
1301 if (!EventXplatEnabledAssemblyDCEnd())
1302 return ERROR_SUCCESS;
1303 INT FullyQualifiedAssemblyName_path_size = -1;
1304 PathCharString FullyQualifiedAssemblyName_PS;
1305 INT FullyQualifiedAssemblyName_full_name_path_size = (wcslen(FullyQualifiedAssemblyName) + 1)*sizeof(WCHAR);
1306 CHAR* FullyQualifiedAssemblyName_full_name = FullyQualifiedAssemblyName_PS.OpenStringBuffer(FullyQualifiedAssemblyName_full_name_path_size );
1307 if (FullyQualifiedAssemblyName_full_name == NULL ) { return ERROR_WRITE_FAULT; }
1308
1309 FullyQualifiedAssemblyName_path_size = WideCharToMultiByte( CP_ACP, 0, FullyQualifiedAssemblyName, -1, FullyQualifiedAssemblyName_full_name, FullyQualifiedAssemblyName_full_name_path_size, NULL, NULL );
1310 _ASSERTE(FullyQualifiedAssemblyName_path_size < FullyQualifiedAssemblyName_full_name_path_size );
1311 FullyQualifiedAssemblyName_PS.CloseBuffer(FullyQualifiedAssemblyName_path_size );
1312 if( FullyQualifiedAssemblyName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
1313 do_tracepoint(DotNETRuntimeRundown,
1314 AssemblyDCEnd,
1315 AssemblyID,
1316 AppDomainID,
1317 AssemblyFlags,
1318 FullyQualifiedAssemblyName_full_name);
1319
1320 return ERROR_SUCCESS;
1321}
1322
1323extern "C" BOOL EventXplatEnabledAssemblyDCEnd_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, AssemblyDCEnd_V1); }
1324
1325extern "C" ULONG FireEtXplatAssemblyDCEnd_V1(
1326 const unsigned __int64 AssemblyID,
1327 const unsigned __int64 AppDomainID,
1328 const unsigned __int64 BindingID,
1329 const unsigned int AssemblyFlags,
1330 PCWSTR FullyQualifiedAssemblyName,
1331 const unsigned short ClrInstanceID)
1332{
1333 if (!EventXplatEnabledAssemblyDCEnd_V1())
1334 return ERROR_SUCCESS;
1335 INT FullyQualifiedAssemblyName_path_size = -1;
1336 PathCharString FullyQualifiedAssemblyName_PS;
1337 INT FullyQualifiedAssemblyName_full_name_path_size = (wcslen(FullyQualifiedAssemblyName) + 1)*sizeof(WCHAR);
1338 CHAR* FullyQualifiedAssemblyName_full_name = FullyQualifiedAssemblyName_PS.OpenStringBuffer(FullyQualifiedAssemblyName_full_name_path_size );
1339 if (FullyQualifiedAssemblyName_full_name == NULL ) { return ERROR_WRITE_FAULT; }
1340
1341 FullyQualifiedAssemblyName_path_size = WideCharToMultiByte( CP_ACP, 0, FullyQualifiedAssemblyName, -1, FullyQualifiedAssemblyName_full_name, FullyQualifiedAssemblyName_full_name_path_size, NULL, NULL );
1342 _ASSERTE(FullyQualifiedAssemblyName_path_size < FullyQualifiedAssemblyName_full_name_path_size );
1343 FullyQualifiedAssemblyName_PS.CloseBuffer(FullyQualifiedAssemblyName_path_size );
1344 if( FullyQualifiedAssemblyName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
1345 do_tracepoint(DotNETRuntimeRundown,
1346 AssemblyDCEnd_V1,
1347 AssemblyID,
1348 AppDomainID,
1349 BindingID,
1350 AssemblyFlags,
1351 FullyQualifiedAssemblyName_full_name,
1352 ClrInstanceID);
1353
1354 return ERROR_SUCCESS;
1355}
1356
1357extern "C" BOOL EventXplatEnabledAppDomainDCStart(){ return tracepoint_enabled(DotNETRuntimeRundown, AppDomainDCStart); }
1358
1359extern "C" ULONG FireEtXplatAppDomainDCStart(
1360 const unsigned __int64 AppDomainID,
1361 const unsigned int AppDomainFlags,
1362 PCWSTR AppDomainName)
1363{
1364 if (!EventXplatEnabledAppDomainDCStart())
1365 return ERROR_SUCCESS;
1366 INT AppDomainName_path_size = -1;
1367 PathCharString AppDomainName_PS;
1368 INT AppDomainName_full_name_path_size = (wcslen(AppDomainName) + 1)*sizeof(WCHAR);
1369 CHAR* AppDomainName_full_name = AppDomainName_PS.OpenStringBuffer(AppDomainName_full_name_path_size );
1370 if (AppDomainName_full_name == NULL ) { return ERROR_WRITE_FAULT; }
1371
1372 AppDomainName_path_size = WideCharToMultiByte( CP_ACP, 0, AppDomainName, -1, AppDomainName_full_name, AppDomainName_full_name_path_size, NULL, NULL );
1373 _ASSERTE(AppDomainName_path_size < AppDomainName_full_name_path_size );
1374 AppDomainName_PS.CloseBuffer(AppDomainName_path_size );
1375 if( AppDomainName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
1376 do_tracepoint(DotNETRuntimeRundown,
1377 AppDomainDCStart,
1378 AppDomainID,
1379 AppDomainFlags,
1380 AppDomainName_full_name);
1381
1382 return ERROR_SUCCESS;
1383}
1384
1385extern "C" BOOL EventXplatEnabledAppDomainDCStart_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, AppDomainDCStart_V1); }
1386
1387extern "C" ULONG FireEtXplatAppDomainDCStart_V1(
1388 const unsigned __int64 AppDomainID,
1389 const unsigned int AppDomainFlags,
1390 PCWSTR AppDomainName,
1391 const unsigned int AppDomainIndex,
1392 const unsigned short ClrInstanceID)
1393{
1394 if (!EventXplatEnabledAppDomainDCStart_V1())
1395 return ERROR_SUCCESS;
1396 INT AppDomainName_path_size = -1;
1397 PathCharString AppDomainName_PS;
1398 INT AppDomainName_full_name_path_size = (wcslen(AppDomainName) + 1)*sizeof(WCHAR);
1399 CHAR* AppDomainName_full_name = AppDomainName_PS.OpenStringBuffer(AppDomainName_full_name_path_size );
1400 if (AppDomainName_full_name == NULL ) { return ERROR_WRITE_FAULT; }
1401
1402 AppDomainName_path_size = WideCharToMultiByte( CP_ACP, 0, AppDomainName, -1, AppDomainName_full_name, AppDomainName_full_name_path_size, NULL, NULL );
1403 _ASSERTE(AppDomainName_path_size < AppDomainName_full_name_path_size );
1404 AppDomainName_PS.CloseBuffer(AppDomainName_path_size );
1405 if( AppDomainName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
1406 do_tracepoint(DotNETRuntimeRundown,
1407 AppDomainDCStart_V1,
1408 AppDomainID,
1409 AppDomainFlags,
1410 AppDomainName_full_name,
1411 AppDomainIndex,
1412 ClrInstanceID);
1413
1414 return ERROR_SUCCESS;
1415}
1416
1417extern "C" BOOL EventXplatEnabledAppDomainDCEnd(){ return tracepoint_enabled(DotNETRuntimeRundown, AppDomainDCEnd); }
1418
1419extern "C" ULONG FireEtXplatAppDomainDCEnd(
1420 const unsigned __int64 AppDomainID,
1421 const unsigned int AppDomainFlags,
1422 PCWSTR AppDomainName)
1423{
1424 if (!EventXplatEnabledAppDomainDCEnd())
1425 return ERROR_SUCCESS;
1426 INT AppDomainName_path_size = -1;
1427 PathCharString AppDomainName_PS;
1428 INT AppDomainName_full_name_path_size = (wcslen(AppDomainName) + 1)*sizeof(WCHAR);
1429 CHAR* AppDomainName_full_name = AppDomainName_PS.OpenStringBuffer(AppDomainName_full_name_path_size );
1430 if (AppDomainName_full_name == NULL ) { return ERROR_WRITE_FAULT; }
1431
1432 AppDomainName_path_size = WideCharToMultiByte( CP_ACP, 0, AppDomainName, -1, AppDomainName_full_name, AppDomainName_full_name_path_size, NULL, NULL );
1433 _ASSERTE(AppDomainName_path_size < AppDomainName_full_name_path_size );
1434 AppDomainName_PS.CloseBuffer(AppDomainName_path_size );
1435 if( AppDomainName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
1436 do_tracepoint(DotNETRuntimeRundown,
1437 AppDomainDCEnd,
1438 AppDomainID,
1439 AppDomainFlags,
1440 AppDomainName_full_name);
1441
1442 return ERROR_SUCCESS;
1443}
1444
1445extern "C" BOOL EventXplatEnabledAppDomainDCEnd_V1(){ return tracepoint_enabled(DotNETRuntimeRundown, AppDomainDCEnd_V1); }
1446
1447extern "C" ULONG FireEtXplatAppDomainDCEnd_V1(
1448 const unsigned __int64 AppDomainID,
1449 const unsigned int AppDomainFlags,
1450 PCWSTR AppDomainName,
1451 const unsigned int AppDomainIndex,
1452 const unsigned short ClrInstanceID)
1453{
1454 if (!EventXplatEnabledAppDomainDCEnd_V1())
1455 return ERROR_SUCCESS;
1456 INT AppDomainName_path_size = -1;
1457 PathCharString AppDomainName_PS;
1458 INT AppDomainName_full_name_path_size = (wcslen(AppDomainName) + 1)*sizeof(WCHAR);
1459 CHAR* AppDomainName_full_name = AppDomainName_PS.OpenStringBuffer(AppDomainName_full_name_path_size );
1460 if (AppDomainName_full_name == NULL ) { return ERROR_WRITE_FAULT; }
1461
1462 AppDomainName_path_size = WideCharToMultiByte( CP_ACP, 0, AppDomainName, -1, AppDomainName_full_name, AppDomainName_full_name_path_size, NULL, NULL );
1463 _ASSERTE(AppDomainName_path_size < AppDomainName_full_name_path_size );
1464 AppDomainName_PS.CloseBuffer(AppDomainName_path_size );
1465 if( AppDomainName_path_size == 0 ){ return ERROR_INVALID_PARAMETER; }
1466 do_tracepoint(DotNETRuntimeRundown,
1467 AppDomainDCEnd_V1,
1468 AppDomainID,
1469 AppDomainFlags,
1470 AppDomainName_full_name,
1471 AppDomainIndex,
1472 ClrInstanceID);
1473
1474 return ERROR_SUCCESS;
1475}
1476
1477extern "C" BOOL EventXplatEnabledThreadDC(){ return tracepoint_enabled(DotNETRuntimeRundown, ThreadDC); }
1478
1479extern "C" ULONG FireEtXplatThreadDC(
1480 const unsigned __int64 ManagedThreadID,
1481 const unsigned __int64 AppDomainID,
1482 const unsigned int Flags,
1483 const unsigned int ManagedThreadIndex,
1484 const unsigned int OSThreadID,
1485 const unsigned short ClrInstanceID)
1486{
1487 if (!EventXplatEnabledThreadDC())
1488 return ERROR_SUCCESS;
1489
1490 do_tracepoint(DotNETRuntimeRundown,
1491 ThreadDC,
1492 ManagedThreadID,
1493 AppDomainID,
1494 Flags,
1495 ManagedThreadIndex,
1496 OSThreadID,
1497 ClrInstanceID);
1498
1499 return ERROR_SUCCESS;
1500}
1501
1502extern "C" BOOL EventXplatEnabledModuleRangeDCStart(){ return tracepoint_enabled(DotNETRuntimeRundown, ModuleRangeDCStart); }
1503
1504extern "C" ULONG FireEtXplatModuleRangeDCStart(
1505 const unsigned short ClrInstanceID,
1506 const unsigned __int64 ModuleID,
1507 const unsigned int RangeBegin,
1508 const unsigned int RangeSize,
1509 const unsigned char RangeType)
1510{
1511 if (!EventXplatEnabledModuleRangeDCStart())
1512 return ERROR_SUCCESS;
1513
1514 do_tracepoint(DotNETRuntimeRundown,
1515 ModuleRangeDCStart,
1516 ClrInstanceID,
1517 ModuleID,
1518 RangeBegin,
1519 RangeSize,
1520 RangeType);
1521
1522 return ERROR_SUCCESS;
1523}
1524
1525extern "C" BOOL EventXplatEnabledModuleRangeDCEnd(){ return tracepoint_enabled(DotNETRuntimeRundown, ModuleRangeDCEnd); }
1526
1527extern "C" ULONG FireEtXplatModuleRangeDCEnd(
1528 const unsigned short ClrInstanceID,
1529 const unsigned __int64 ModuleID,
1530 const unsigned int RangeBegin,
1531 const unsigned int RangeSize,
1532 const unsigned char RangeType)
1533{
1534 if (!EventXplatEnabledModuleRangeDCEnd())
1535 return ERROR_SUCCESS;
1536
1537 do_tracepoint(DotNETRuntimeRundown,
1538 ModuleRangeDCEnd,
1539 ClrInstanceID,
1540 ModuleID,
1541 RangeBegin,
1542 RangeSize,
1543 RangeType);
1544
1545 return ERROR_SUCCESS;
1546}
1547
1548extern "C" BOOL EventXplatEnabledRuntimeInformationDCStart(){ return tracepoint_enabled(DotNETRuntimeRundown, RuntimeInformationDCStart); }
1549
1550extern "C" ULONG FireEtXplatRuntimeInformationDCStart(
1551 const unsigned short ClrInstanceID,
1552 const unsigned short Sku,
1553 const unsigned short BclMajorVersion,
1554 const unsigned short BclMinorVersion,
1555 const unsigned short BclBuildNumber,
1556 const unsigned short BclQfeNumber,
1557 const unsigned short VMMajorVersion,
1558 const unsigned short VMMinorVersion,
1559 const unsigned short VMBuildNumber,
1560 const unsigned short VMQfeNumber,
1561 const unsigned int StartupFlags,
1562 const unsigned char StartupMode,
1563 PCWSTR CommandLine,
1564 const GUID* ComObjectGuid,
1565 PCWSTR RuntimeDllPath)
1566{
1567 if (!EventXplatEnabledRuntimeInformationDCStart())
1568 return ERROR_SUCCESS;
1569
1570 char stackBuffer[153];
1571 char *buffer = stackBuffer;
1572 size_t offset = 0;
1573 size_t size = 153;
1574 bool fixedBuffer = true;
1575
1576 bool success = true;
1577 success &= WriteToBuffer(ClrInstanceID, buffer, offset, size, fixedBuffer);
1578 success &= WriteToBuffer(Sku, buffer, offset, size, fixedBuffer);
1579 success &= WriteToBuffer(BclMajorVersion, buffer, offset, size, fixedBuffer);
1580 success &= WriteToBuffer(BclMinorVersion, buffer, offset, size, fixedBuffer);
1581 success &= WriteToBuffer(BclBuildNumber, buffer, offset, size, fixedBuffer);
1582 success &= WriteToBuffer(BclQfeNumber, buffer, offset, size, fixedBuffer);
1583 success &= WriteToBuffer(VMMajorVersion, buffer, offset, size, fixedBuffer);
1584 success &= WriteToBuffer(VMMinorVersion, buffer, offset, size, fixedBuffer);
1585 success &= WriteToBuffer(VMBuildNumber, buffer, offset, size, fixedBuffer);
1586 success &= WriteToBuffer(VMQfeNumber, buffer, offset, size, fixedBuffer);
1587 success &= WriteToBuffer(StartupFlags, buffer, offset, size, fixedBuffer);
1588 success &= WriteToBuffer(StartupMode, buffer, offset, size, fixedBuffer);
1589 success &= WriteToBuffer(CommandLine, buffer, offset, size, fixedBuffer);
1590 success &= WriteToBuffer(*ComObjectGuid, buffer, offset, size, fixedBuffer);
1591 success &= WriteToBuffer(RuntimeDllPath, buffer, offset, size, fixedBuffer);
1592
1593 if (!success)
1594 {
1595 if (!fixedBuffer)
1596 delete[] buffer;
1597 return ERROR_WRITE_FAULT;
1598 }
1599
1600 do_tracepoint(DotNETRuntimeRundown, RuntimeInformationDCStart, offset, buffer);
1601
1602 if (!fixedBuffer)
1603 delete[] buffer;
1604
1605 return ERROR_SUCCESS;
1606}
1607
1608
1609