This repository has been archived by the owner. It is now read-only.
Permalink
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...
sblom authored and piscisaureus committed Jan 3, 2013
1 parent a7d8c21 commit 5a39df49593a862d0de9ef01db2f83e23b2fd67f
Showing with 7 additions and 0 deletions.
  1. +7 −0 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);

0 comments on commit 5a39df4

Please sign in to comment.