| 56 | } |
| 57 | |
| 58 | STDMETHODIMP PyGActiveScriptParse::ParseScriptText( |
| 59 | /* [in] */ LPCOLESTR pstrCode, |
| 60 | /* [in] */ LPCOLESTR pstrItemName, |
| 61 | /* [in] */ IUnknown __RPC_FAR *punkContext, |
| 62 | /* [in] */ LPCOLESTR pstrDelimiter, |
| 63 | /* [in] */ DWORD_PTR dwSourceContextCookie, |
| 64 | /* [in] */ ULONG ulStartingLineNumber, |
| 65 | /* [in] */ DWORD dwFlags, |
| 66 | /* [out] */ VARIANT __RPC_FAR *pvarResult, |
| 67 | /* [out] */ EXCEPINFO __RPC_FAR *pexcepinfo) |
| 68 | { |
| 69 | PY_GATEWAY_METHOD; |
| 70 | PyObject *context = PyCom_PyObjectFromIUnknown(punkContext, IID_IUnknown, TRUE); |
| 71 | if (context==NULL) { |
| 72 | PyCom_ExcepInfoFromPyException(pexcepinfo); |
| 73 | return DISP_E_EXCEPTION; |
| 74 | } |
| 75 | PyObject *result = NULL; |
| 76 | BOOL bWantResult = pvarResult!=NULL; |
| 77 | PyObject *obCode = PyWinObject_FromOLECHAR(pstrCode); |
| 78 | PyObject *obItemName = PyWinObject_FromOLECHAR(pstrItemName); |
| 79 | PyObject *obDelimiter = PyWinObject_FromOLECHAR(pstrDelimiter); |
| 80 | PyObject *obContext = PyWinObject_FromDWORD_PTR(dwSourceContextCookie); |
| 81 | HRESULT hr = InvokeGatewayViaPolicy(this, "ParseScriptText", pexcepinfo, &result, |
| 82 | "NNONNiii", |
| 83 | obCode, |
| 84 | obItemName, |
| 85 | context, |
| 86 | obDelimiter, |
| 87 | obContext, |
| 88 | ulStartingLineNumber, |
| 89 | dwFlags, |
| 90 | bWantResult); |
| 91 | Py_DECREF(context); |
| 92 | if (FAILED(hr)) return hr; |
| 93 | if (pvarResult) { |
| 94 | if (!PyCom_VariantFromPyObject(result, pvarResult)) { |
| 95 | PyCom_ExcepInfoFromPyException(pexcepinfo); |
| 96 | hr = DISP_E_EXCEPTION; |
| 97 | } |
| 98 | } |
| 99 | Py_DECREF(result); |
| 100 | return hr; |
| 101 | } |