Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

WINDOWS: Fix perfctr crash on Windows XP and Windows Server 2003 #4511

Closed
wants to merge 2 commits into from

3 participants

Scott Blomquist Ben Noordhuis Bert Belder
Scott Blomquist
Owner

fixes #4462

Ben Noordhuis

The first line of the commit log should be 50 characters max but otherwise LGTM.

Bert Belder
Owner

I don't think that Scott has commit bits yet, I will reword and land.

Bert Belder piscisaureus closed this pull request from a commit
Scott Blomquist sblom 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
5a39df4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/node_win32_perfctr_provider.cc
7 src/node_win32_perfctr_provider.cc
View
@@ -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);
Something went wrong with that request. Please try again.