[pywin32-checkins] pywin32/win32/src PythonService.cpp,1.18,1.19
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2005-09-20 12:45:22
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9664 Modified Files: PythonService.cpp Log Message: SetEventSourceName takes an optional second param which indicates if the event source should be registered immediately (True) or when the first event log record is written (False - the default and old behaviour) Index: PythonService.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PythonService.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** PythonService.cpp 11 Apr 2005 00:34:30 -0000 1.18 --- PythonService.cpp 20 Sep 2005 12:45:07 -0000 1.19 *************** *** 46,49 **** --- 46,50 ---- static void ReportPythonError(DWORD); static BOOL ReportError(DWORD, LPCTSTR *inserts = NULL, WORD errorType = EVENTLOG_ERROR_TYPE); + static void CheckRegisterEventSourceFile(); #include "PythonServiceMessages.h" *************** *** 286,290 **** { PyObject *obName; ! if (!PyArg_ParseTuple(args, "O:SetEventSourceName", &obName)) return NULL; TCHAR *msg; --- 287,302 ---- { PyObject *obName; ! // @pyparm string|sourceName||The event source name ! // @pyparm bool|registerNow|False|If True, the event source name in the ! // registry will be updated immediately. ! // If False, the name will be registered the first time an event log entry ! // is written via any pythonservice methods (or possibly never if no record ! // if written). ! // <nl>Note that in some cases, the service itself will not have permission ! // to write the event source in the registry. Therefore, it would be ! // prudent for your installation program to call this function with ! // registerNow=True, to ensure your services can write useful entries. ! int registerNow = 0; ! if (!PyArg_ParseTuple(args, "O|i:SetEventSourceName", &obName, ®isterNow)) return NULL; TCHAR *msg; *************** *** 295,298 **** --- 307,312 ---- PyWinObject_FreeTCHAR(msg); g_bRegisteredEventSource = FALSE; // so this name re-registered. + if (registerNow) + CheckRegisterEventSourceFile(); Py_INCREF(Py_None); return Py_None; |