Skip to content

Commit b166837

Browse files
joaocgreisMylesBorins
authored andcommitted
src,etw: fix event 9 on 64 bit Windows
The event manifest specifies the MethodID field as a 32 bit integer. The 32 bit node executable publishes this correctly, but the 64 bit executable published a 64 bit integer, making the event undecodable. PR-URL: #15563 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Hitesh Kanwathirtha <hiteshk@microsoft.com>
1 parent eefa0a2 commit b166837

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/node_win32_etw_provider-inl.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66
#include "node_win32_etw_provider.h"
77
#include "node_etw_provider.h"
88

9-
#if defined(_WIN64)
10-
# define ETW_WRITE_INTPTR_DATA ETW_WRITE_INT64_DATA
11-
#else
12-
# define ETW_WRITE_INTPTR_DATA ETW_WRITE_INT32_DATA
13-
#endif
14-
159
namespace node {
1610

1711
// From node_win32_etw_provider.cc
@@ -79,7 +73,7 @@ extern int events_enabled;
7973
ETW_WRITE_ADDRESS_DATA(descriptors, &context); \
8074
ETW_WRITE_ADDRESS_DATA(descriptors + 1, &startAddr); \
8175
ETW_WRITE_INT64_DATA(descriptors + 2, &size); \
82-
ETW_WRITE_INTPTR_DATA(descriptors + 3, &id); \
76+
ETW_WRITE_INT32_DATA(descriptors + 3, &id); \
8377
ETW_WRITE_INT16_DATA(descriptors + 4, &flags); \
8478
ETW_WRITE_INT16_DATA(descriptors + 5, &rangeId); \
8579
ETW_WRITE_INT64_DATA(descriptors + 6, &sourceId); \
@@ -232,7 +226,7 @@ void NODE_V8SYMBOL_ADD(LPCSTR symbol,
232226
}
233227
void* context = nullptr;
234228
INT64 size = (INT64)len;
235-
INT_PTR id = (INT_PTR)addr1;
229+
INT32 id = (INT32)addr1;
236230
INT16 flags = 0;
237231
INT16 rangeid = 1;
238232
INT32 col = 1;

0 commit comments

Comments
 (0)