MCPcopy Create free account
hub / github.com/mhammond/pywin32 / GetFilterVersion

Function GetFilterVersion

isapi/src/pyISAPI.cpp:151–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151BOOL WINAPI GetFilterVersion(HTTP_FILTER_VERSION *pVer)
152{
153 pVer->dwFilterVersion = HTTP_FILTER_REVISION;
154 // ensure our handler ready to go
155 if (!filterHandler.Init(&pyEngine, name_filter_factory,
156 name_filter_init, name_filter_do, name_filter_term))
157 // error already reported.
158 return FALSE;
159
160 CEnterLeavePython celp;
161 PyFILTER_VERSION *pyFV = new PyFILTER_VERSION(pVer);
162 PyObject *resultobject = filterHandler.Callback(HANDLER_INIT, "(N)", pyFV);
163 BOOL bRetStatus;
164 if (! resultobject) {
165 FilterError(NULL, "Filter version function failed!");
166 bRetStatus = false;
167 } else {
168 if (resultobject == Py_None)
169 bRetStatus = TRUE;
170 else if (PyInt_Check(resultobject))
171 bRetStatus = PyInt_AsLong(resultobject) ? true : false;
172 else {
173 FilterError(NULL, "Filter init should return an int, or None");
174 bRetStatus = FALSE;
175 }
176 }
177 if (bRetStatus)
178 // We need the SF_NOTIFY_END_OF_NET_SESSION notification for cleanup
179 pVer->dwFlags |= SF_NOTIFY_END_OF_NET_SESSION;
180 Py_XDECREF(resultobject);
181 return bRetStatus;
182}
183
184DWORD WINAPI HttpFilterProc(HTTP_FILTER_CONTEXT *phfc, DWORD NotificationType, VOID *pvData)
185{

Callers

nothing calls this directly

Calls 3

CallbackMethod · 0.80
FilterErrorFunction · 0.70
InitMethod · 0.45

Tested by

no test coverage detected