| 61 | } |
| 62 | |
| 63 | BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer) |
| 64 | { |
| 65 | pVer->dwExtensionVersion = MAKELONG( HSE_VERSION_MINOR, HSE_VERSION_MAJOR ); |
| 66 | // ensure our handler ready to go |
| 67 | if (!extensionHandler.Init(&pyEngine, name_ext_factory, |
| 68 | name_ext_init, name_ext_do, name_ext_term)) { |
| 69 | // already have reported any errors to Python. |
| 70 | TRACE("Unable to load Python handler"); |
| 71 | return false; |
| 72 | } |
| 73 | PyObject *resultobject = NULL; |
| 74 | bool bRetStatus = true; |
| 75 | CEnterLeavePython celp; |
| 76 | |
| 77 | // create the Python object |
| 78 | PyVERSION_INFO *pyVO = new PyVERSION_INFO(pVer); |
| 79 | resultobject = extensionHandler.Callback(HANDLER_INIT, "(N)", pyVO); |
| 80 | if (! resultobject) { |
| 81 | ExtensionError(NULL, "Extension version function failed!"); |
| 82 | bRetStatus = false; |
| 83 | } else { |
| 84 | if (resultobject == Py_None) |
| 85 | bRetStatus = TRUE; |
| 86 | else if (PyInt_Check(resultobject)) |
| 87 | bRetStatus = PyInt_AsLong(resultobject) ? true : false; |
| 88 | else { |
| 89 | ExtensionError(NULL, "Filter init should return an int, or None"); |
| 90 | bRetStatus = FALSE; |
| 91 | } |
| 92 | } |
| 93 | Py_XDECREF(resultobject); |
| 94 | return bRetStatus; |
| 95 | } |
| 96 | |
| 97 | DWORD WINAPI HttpExtensionProc(EXTENSION_CONTROL_BLOCK *pECB) |
| 98 | { |
nothing calls this directly
no test coverage detected