[pywin32-checkins] pywin32/win32/src PythonService.cpp,1.6,1.7
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: <mha...@us...> - 2003-10-16 05:28:08
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1:/tmp/cvs-serv6148 Modified Files: PythonService.cpp Log Message: Major revamp of PythonService. There now exists a 'servicemanager.pyd' file, which does all of the service work. ServiceManager.exe remains, but becomes a stub. It is now possible (although not implemented) for python.exe to host a service. New versions of py2exe will use the same executable stub for services as for other executables. Index: PythonService.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PythonService.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PythonService.cpp 8 Oct 2003 00:14:58 -0000 1.6 --- PythonService.cpp 16 Oct 2003 05:27:56 -0000 1.7 *************** *** 2,5 **** --- 2,12 ---- // // PURPOSE: An executable that hosts Python services. + // This source file is used to compile 2 discrete targets: + // * servicemanager.pyd - A Python extension that contains + // all the functionality. + // * PythonService.exe - This simply loads servicemanager.pyd, and + // calls a public function. Note that PythonService.exe may one + // day die - it is now possible for python.exe to directly host + // services. [...1487 lines suppressed...] ! Py_DECREF(f); ! if (!hmod) { ! PyErr_Format(PyExc_RuntimeError, "servicemanager.__file__ could not be loaded - win32 error code is %d", GetLastError()); ! goto failed; } ! proc = GetProcAddress(hmod, "PythonService_main"); ! if (!proc) { ! PyErr_Format(PyExc_RuntimeError, "servicemanager.__file__ does not contain PythonService_main - win32 error code is %d", GetLastError()); ! goto failed; } ! typedef int (* FNPythonService_main)(int argc, char **argv); ! return ((FNPythonService_main)proc)(argc, argv); ! failed: ! fprintf(stderr, "PythonService was unable to locate the service manager. " ! "Please see the event log for details\n"); ! ReportPythonError(PYS_E_NO_SERVICEMANAGER); ! return 1; } + #endif |