[pywin32-checkins] pywin32/win32/src PythonService.cpp,1.27,1.28
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2010-08-30 04:25:52
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12519 Modified Files: PythonService.cpp Log Message: Fix SERVICE_CONTROL_POWEREVENT handling (via bug 2924128) Index: PythonService.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PythonService.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** PythonService.cpp 7 Feb 2009 00:32:30 -0000 1.27 --- PythonService.cpp 30 Aug 2010 04:25:44 -0000 1.28 *************** *** 961,968 **** break; case SERVICE_CONTROL_POWEREVENT: { ! POWERBROADCAST_SETTING *pbs = (POWERBROADCAST_SETTING *)eventData; ! sub = Py_BuildValue("NN", ! PyWinObject_FromIID(pbs->PowerSetting), ! PyString_FromStringAndSize((char *)pbs->Data, pbs->DataLength)); break; } --- 961,973 ---- break; case SERVICE_CONTROL_POWEREVENT: { ! if (dwEventType == PBT_POWERSETTINGCHANGE) { ! POWERBROADCAST_SETTING *pbs = (POWERBROADCAST_SETTING *)eventData; ! sub = Py_BuildValue("NN", ! PyWinObject_FromIID(pbs->PowerSetting), ! PyString_FromStringAndSize((char *)pbs->Data, pbs->DataLength)); ! } else { ! sub = Py_None; ! Py_INCREF(Py_None); ! } break; } |