Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

windows: fix perfctr crash on XP and 2003

Some performance counter related functions are not available on Windows
XP and Windows Server 2003, which caused node to call a NULL pointer.

Closes #4462
Closes #4511
  • Loading branch information...
commit 5a39df49593a862d0de9ef01db2f83e23b2fd67f 1 parent a7d8c21
@sblom sblom authored piscisaureus committed
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/node_win32_perfctr_provider.cc
View
7 src/node_win32_perfctr_provider.cc
@@ -172,6 +172,13 @@ void InitPerfCountersWin32() {
ZeroMemory(&providerContext, sizeof(providerContext));
providerContext.ContextSize = sizeof(providerContext);
+ if (!perfctr_startProvider ||
+ !perfctr_setCounterSetInfo ||
+ !perfctr_createInstance) {
+ NodeCounterProvider = NULL;
+ return;
+ }
+
status = perfctr_startProvider(&NodeCounterSetGuid,
&providerContext,
&NodeCounterProvider);
Please sign in to comment.
Something went wrong with that request. Please try again.