| 125 | } |
| 126 | |
| 127 | BOOL WINAPI TerminateExtension(DWORD dwFlags) |
| 128 | { |
| 129 | // extension is being terminated |
| 130 | BOOL bRetStatus; |
| 131 | CEnterLeavePython celp; |
| 132 | PyObject *resultobject = extensionHandler.Callback(HANDLER_TERM, "(i)", dwFlags); |
| 133 | if (! resultobject) { |
| 134 | ExtensionError(NULL, "Extension term function failed!"); |
| 135 | bRetStatus = false; |
| 136 | } else { |
| 137 | if (resultobject == Py_None) |
| 138 | bRetStatus = TRUE; |
| 139 | else if (PyInt_Check(resultobject)) |
| 140 | bRetStatus = PyInt_AsLong(resultobject) ? true : false; |
| 141 | else { |
| 142 | ExtensionError(NULL, "Extension term should return an int, or None"); |
| 143 | bRetStatus = FALSE; |
| 144 | } |
| 145 | } |
| 146 | Py_XDECREF(resultobject); |
| 147 | extensionHandler.Term(); |
| 148 | return bRetStatus; |
| 149 | } |
| 150 | |
| 151 | BOOL WINAPI GetFilterVersion(HTTP_FILTER_VERSION *pVer) |
| 152 | { |
nothing calls this directly
no test coverage detected