[pywin32-checkins] pywin32/win32/src win32pdhmodule.cpp,1.19,1.20
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2010-05-18 15:54:41
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12132 Modified Files: win32pdhmodule.cpp Log Message: Various improvements to BrowseCounters: Accept keyword args Allow multiple counters to be passed to Callback function Accept extra arg to be passed to callback function Add a few extra flags Accept InitialPath to be used as initially selected counter Accept DataSource to read from pdh log file Print exceptions when Python errors occur during callback Create a class for TCHAR that frees itself to simplify cleanup More consistent use of Py_*_ALLOW_THREAD macros Index: win32pdhmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32pdhmodule.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** win32pdhmodule.cpp 8 Dec 2008 13:16:38 -0000 1.19 --- win32pdhmodule.cpp 18 May 2010 15:54:33 -0000 1.20 *************** *** 16,19 **** --- 16,24 ---- #include "pdhmsg.h" + /* + According to MSDN, Pdh calls are thread safe, although there was a bug + in Win2k that might make it appear to not be. Plus, the PyW32* macros + weren't actually used most places, so would be no point in using them anywhere. + // It appears PDH it not thread safe! // Use a critical section to protect calls into it [...1360 lines suppressed...] PYWIN_MODULE_INIT_PREPARE(win32pdh, win32pdh_functions, "A module, encapsulating the Windows Performance Data Helpers API"); ! InitializeCriticalSection(&critSec); PyDict_SetItemString(dict, "error", PyWinExc_ApiError); --- 1218,1222 ---- PYWIN_MODULE_INIT_PREPARE(win32pdh, win32pdh_functions, "A module, encapsulating the Windows Performance Data Helpers API"); ! // InitializeCriticalSection(&critSec); PyDict_SetItemString(dict, "error", PyWinExc_ApiError); *************** *** 1149,1152 **** --- 1244,1249 ---- ADD_CONSTANT(PERF_DETAIL_EXPERT); ADD_CONSTANT(PERF_DETAIL_WIZARD); + ADD_CONSTANT(PDH_PATH_WBEM_RESULT); + ADD_CONSTANT(PDH_PATH_WBEM_INPUT); // ADD_CONSTANT(); PYWIN_MODULE_INIT_RETURN_SUCCESS; |