Browse Source

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
v0.9.6-release
Scott Blomquist 12 years ago
committed by Bert Belder
parent
commit
5a39df4959
  1. 7
      src/node_win32_perfctr_provider.cc

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);

Loading…
Cancel
Save