Skip to content

Commit a43f681

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 22b2d1a commit a43f681

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
@@ -27,12 +27,6 @@
2727
#include "node_win32_etw_provider.h"
2828
#include "node_etw_provider.h"
2929

30-
#if defined(_WIN64)
31-
# define ETW_WRITE_INTPTR_DATA ETW_WRITE_INT64_DATA
32-
#else
33-
# define ETW_WRITE_INTPTR_DATA ETW_WRITE_INT32_DATA
34-
#endif
35-
3630
namespace node {
3731

3832
// From node_win32_etw_provider.cc
@@ -100,7 +94,7 @@ extern int events_enabled;
10094
ETW_WRITE_ADDRESS_DATA(descriptors, &context); \
10195
ETW_WRITE_ADDRESS_DATA(descriptors + 1, &startAddr); \
10296
ETW_WRITE_INT64_DATA(descriptors + 2, &size); \
103-
ETW_WRITE_INTPTR_DATA(descriptors + 3, &id); \
97+
ETW_WRITE_INT32_DATA(descriptors + 3, &id); \
10498
ETW_WRITE_INT16_DATA(descriptors + 4, &flags); \
10599
ETW_WRITE_INT16_DATA(descriptors + 5, &rangeId); \
106100
ETW_WRITE_INT64_DATA(descriptors + 6, &sourceId); \
@@ -253,7 +247,7 @@ void NODE_V8SYMBOL_ADD(LPCSTR symbol,
253247
}
254248
void* context = nullptr;
255249
INT64 size = (INT64)len;
256-
INT_PTR id = (INT_PTR)addr1;
250+
INT32 id = (INT32)addr1;
257251
INT16 flags = 0;
258252
INT16 rangeid = 1;
259253
INT32 col = 1;

0 commit comments

Comments
 (0)