Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
windows: fix perfctr crash on XP and 2003
Browse files Browse the repository at this point in the history
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 5a39df4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/node_win32_perfctr_provider.cc
Expand Up @@ -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);
Expand Down

0 comments on commit 5a39df4

Please sign in to comment.