@pymethod |servicemanager|Initialize|Initialize the module for hosting a service. This is generally called automatically
| 446 | |
| 447 | // @pymethod |servicemanager|Initialize|Initialize the module for hosting a service. This is generally called automatically |
| 448 | static PyObject *PyServiceInitialize(PyObject *self, PyObject *args) |
| 449 | { |
| 450 | PyObject *nameOb = Py_None, *fileOb = Py_None; |
| 451 | // @pyparm <o PyUnicode>|eventSourceName|None|The event source name |
| 452 | // @pyparm <o PyUnicode>|eventSourceFile|None|The name of the file |
| 453 | // (generally a DLL) with the event source messages. |
| 454 | if (!PyArg_ParseTuple(args, "|OO", &nameOb, &fileOb)) |
| 455 | return NULL; |
| 456 | TCHAR *name, *file; |
| 457 | if (!PyWinObject_AsTCHAR(nameOb, &name, TRUE)) |
| 458 | return NULL; |
| 459 | if (!PyWinObject_AsTCHAR(fileOb, &file, TRUE)) { |
| 460 | PyWinObject_FreeTCHAR(name); |
| 461 | return NULL; |
| 462 | } |
| 463 | PythonService_Initialize(name, file); |
| 464 | PyWinObject_FreeTCHAR(name); |
| 465 | PyWinObject_FreeTCHAR(file); |
| 466 | Py_INCREF(Py_None); |
| 467 | return Py_None; |
| 468 | } |
| 469 | |
| 470 | // @pymethod |servicemanager|Finalize| |
| 471 | static PyObject *PyServiceFinalize(PyObject *self) |
nothing calls this directly
no test coverage detected