@pymethod int|EXTENSION_CONTROL_BLOCK|GetAnonymousToken|Calls ServerSupportFunction with HSE_REQ_GET_ANONYMOUS_TOKEN or HSE_REQ_GET_UNICODE_ANONYMOUS_TOKEN
| 679 | |
| 680 | // @pymethod int|EXTENSION_CONTROL_BLOCK|GetAnonymousToken|Calls ServerSupportFunction with HSE_REQ_GET_ANONYMOUS_TOKEN or HSE_REQ_GET_UNICODE_ANONYMOUS_TOKEN |
| 681 | PyObject * PyECB::GetAnonymousToken(PyObject *self, PyObject *args) |
| 682 | { |
| 683 | PyECB * pecb = (PyECB *) self; |
| 684 | if (!pecb || !pecb->Check()) return NULL; |
| 685 | EXTENSION_CONTROL_BLOCK *ecb = pecb->m_pcb->GetECB(); |
| 686 | |
| 687 | PyObject *obStr; |
| 688 | // @pyparm string/unicode|metabase_path|| |
| 689 | if (!PyArg_ParseTuple(args, "O:GetImpersonationToken", &obStr)) |
| 690 | return NULL; |
| 691 | HANDLE handle; |
| 692 | BOOL bRes; |
| 693 | if (PyString_Check(obStr)) { |
| 694 | Py_BEGIN_ALLOW_THREADS |
| 695 | bRes = ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_GET_ANONYMOUS_TOKEN, |
| 696 | PyString_AS_STRING(obStr), |
| 697 | (DWORD *)&handle,NULL); |
| 698 | Py_END_ALLOW_THREADS |
| 699 | } else if (PyUnicode_Check(obStr)) { |
| 700 | Py_BEGIN_ALLOW_THREADS |
| 701 | bRes = ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_GET_UNICODE_ANONYMOUS_TOKEN, |
| 702 | PyUnicode_AS_UNICODE(obStr), |
| 703 | (DWORD *)&handle,NULL); |
| 704 | Py_END_ALLOW_THREADS |
| 705 | } else |
| 706 | return PyErr_Format(PyExc_TypeError, "must pass a string or unicode object (got %s)", obStr->ob_type->tp_name); |
| 707 | if (!bRes) |
| 708 | return SetPyECBError("ServerSupportFunction(HSE_REQ_GET_IMPERSONATION_TOKEN)"); |
| 709 | return PyLong_FromVoidPtr(handle); |
| 710 | } |
| 711 | |
| 712 | // @pymethod int|EXTENSION_CONTROL_BLOCK|IsKeepConn|Calls ServerSupportFunction with HSE_REQ_IS_KEEP_CONN |
| 713 | PyObject * PyECB::IsKeepConn(PyObject *self, PyObject *args) |
nothing calls this directly
no test coverage detected