mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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
This commit is contained in:
committed by
Bert Belder
parent
a7d8c21bca
commit
5a39df4959
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user