Example #1
0
STDMETHODIMP PyGDebugDocumentText::GetText(
		/* [in] */ ULONG cCharacterPosition,
		/* [size_is][length_is][out][in] */ WCHAR __RPC_FAR * pcharText,
		/* [size_is][length_is][out][in] */ SOURCE_TEXT_ATTR __RPC_FAR * pstaTextAttr,
		/* [out][in] */ ULONG __RPC_FAR * pcNumChars,
		/* [in] */ ULONG cMaxChars)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetText", &result, "iii", cCharacterPosition, cMaxChars, (pstaTextAttr!=NULL));
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	PyObject *obText, *obAttr;
	if (!PyArg_ParseTuple(result, "OO" , &obText, &obAttr))
		 return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	BSTR bstr;
	BOOL ok = TRUE;
	ok = PyCom_BstrFromPyObject(obText, &bstr);
	if (ok) {
		*pcNumChars = SysStringLen(bstr);
		wcsncpy(pcharText, bstr, *pcNumChars);
		SysFreeString(bstr);
	}
	if (ok && pstaTextAttr) {
		ok = PyAXDebug_PyObject_AsSOURCE_TEXT_ATTR(obAttr, pstaTextAttr, *pcNumChars);
	}
	Py_DECREF(result);
	if (!ok)
		 return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	return hr;
}
STDMETHODIMP PyGPersistFile::GetCurFile(
		/* [out] */ LPOLESTR __RPC_FAR * ppszFileName)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetCurFile", &result);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	PyObject *obppszFileName;
	if (!PyArg_Parse(result, "O" , &obppszFileName))
		hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	else if (!PyWinObject_AsTaskAllocatedWCHAR(obppszFileName, ppszFileName))
		hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
Example #3
0
STDMETHODIMP PyGDebugDocumentTextExternalAuthor::GetFileName(
    /* [out] */ BSTR __RPC_FAR * pbstrShortName)
{
    PY_GATEWAY_METHOD;
    PyObject *result;
    HRESULT hr=InvokeViaPolicy("GetFileName", &result);
    if (FAILED(hr)) return hr;
    // Process the Python results, and convert back to the real params
    PyObject *obpbstrShortName;
    if (!PyArg_Parse(result, "O" , &obpbstrShortName)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
    BOOL bPythonIsHappy = TRUE;
    if (!PyCom_BstrFromPyObject(obpbstrShortName, pbstrShortName)) bPythonIsHappy = FALSE;
    if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
    Py_DECREF(result);
    return hr;
}
STDMETHODIMP PyGDebugDocumentInfo::GetDocumentClassId(
		/* [out] */ GUID __RPC_FAR * pclsidDocument)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetDocumentClassId", &result);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	PyObject *obpclsidDocument;
	if (!PyArg_Parse(result, "O" , &obpclsidDocument)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	BOOL bPythonIsHappy = TRUE;
	if (!PyWinObject_AsIID(obpclsidDocument, pclsidDocument)) bPythonIsHappy = FALSE;
	if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
STDMETHODIMP PyGLockBytes::Stat(
		/* [out] */ STATSTG __RPC_FAR * pstatstg,
		/* [in] */ DWORD grfStatFlag)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("Stat", &result, "i", grfStatFlag);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	PyObject *obpstatstg;
	if (!PyArg_Parse(result, "O" , &obpstatstg)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	BOOL bPythonIsHappy = TRUE;
	if (!PyCom_PyObjectAsSTATSTG(obpstatstg, pstatstg, 0/*flags*/)) bPythonIsHappy = FALSE;
	if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
Example #6
0
STDMETHODIMP PyGDebugExpression::GetResultAsString(
		/* [out] */ HRESULT __RPC_FAR * phrResult,
		/* [out] */ BSTR __RPC_FAR * pbstrResult)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetResultAsString", &result);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	PyObject *obpbstrResult;
	if (!PyArg_ParseTuple(result, "iO" , phrResult, &obpbstrResult)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	BOOL bPythonIsHappy = TRUE;
	if (!PyCom_BstrFromPyObject(obpbstrResult, pbstrResult, TRUE)) bPythonIsHappy = FALSE;
	if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
Example #7
0
STDMETHODIMP PyGInternetPriority::GetPriority(
		/* [out] */ LONG __RPC_FAR * pnPriority)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetPriority", &result);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	if (!PyArg_Parse(result, "i" , pnPriority)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
Example #8
0
STDMETHODIMP PyGDebugDocumentText::GetDocumentAttributes(
		/* [out] */ TEXT_DOC_ATTR __RPC_FAR * ptextdocattr)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetDocumentAttributes", &result);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	if (!PyArg_Parse(result, "i" , ptextdocattr)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
STDMETHODIMP PyGDebugApplication::HandleBreakPoint(
		/* [in] */ BREAKREASON br,
		/* [out] */ BREAKRESUMEACTION __RPC_FAR * pbra)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("HandleBreakPoint", &result, "i", br);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	if (!PyArg_Parse(result, "i" , pbra)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
Example #10
0
STDMETHODIMP PyGDebugDocumentText::GetPositionOfLine(
		/* [in] */ ULONG cLineNumber,
		/* [out] */ ULONG __RPC_FAR * pcCharacterPosition)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetPositionOfLine", &result, "i", cLineNumber);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	if (!PyArg_Parse(result, "i" , pcCharacterPosition)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
Example #11
0
STDMETHODIMP PyGDebugDocumentText::GetSize(
		/* [out] */ ULONG __RPC_FAR * pcNumLines,
		/* [out] */ ULONG __RPC_FAR * pcNumChars)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetSize", &result);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	if (!PyArg_ParseTuple(result, "ii" , pcNumLines, pcNumChars)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
STDMETHODIMP PyGOleInPlaceSiteWindowless::GetDC(
		/* [in] */ LPCRECT pRect,
		/* [in] */ DWORD grfFlags,
		/* [out] */ HDC __RPC_FAR * phDC)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetDC", &result, "(llll)l", pRect->left, pRect->top, pRect->right, pRect->bottom, grfFlags);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	if (!PyArg_Parse(result, "l" , phDC)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
STDMETHODIMP PyGOleInPlaceSiteWindowless::OnDefWindowMessage(
		/* [in] */ UINT msg,
		/* [in] */ WPARAM wParam,
		/* [in] */ LPARAM lParam,
		/* [out] */ LRESULT __RPC_FAR * plResult)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("OnDefWindowMessage", &result, "iil", msg, wParam, lParam);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	if (!PyArg_Parse(result, "l" , plResult)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
Example #14
0
STDMETHODIMP PyGMachineDebugManager::AddApplication(
		/* [in] */ IRemoteDebugApplication __RPC_FAR * pda,
		/* [out] */ DWORD __RPC_FAR * pdwAppCookie)
{
	PY_GATEWAY_METHOD;
	PyObject *obpda = PyCom_PyObjectFromIUnknown(pda, IID_IRemoteDebugApplication, TRUE);
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("AddApplication", &result, "O", obpda);
	Py_XDECREF(obpda);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	if (!PyArg_Parse(result, "i" , pdwAppCookie)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
Example #15
0
STDMETHODIMP PyGActiveScriptSite::GetLCID( 
            /* [out] */ LCID FAR *plcid)
{
	PY_GATEWAY_METHOD;
	if ( plcid == NULL )
		return E_POINTER;

	PyObject *result;
	HRESULT hr = InvokeViaPolicy("GetLCID", &result, NULL);
	if (FAILED(hr))
		return hr;

	*plcid = PyInt_AsLong(result);
	Py_DECREF(result);
	return PyCom_HandlePythonFailureToCOM();
}
Example #16
0
STDMETHODIMP PyGDebugDocumentText::GetPositionOfContext(
		/* [in] */ IDebugDocumentContext __RPC_FAR * psc,
		/* [out] */ ULONG __RPC_FAR * pcCharacterPosition,
		/* [out] */ ULONG __RPC_FAR * cNumChars)
{
	PY_GATEWAY_METHOD;
	PyObject *obpsc;
	obpsc = PyCom_PyObjectFromIUnknown(psc, IID_IDebugDocumentContext, TRUE);
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetPositionOfContext", &result, "O", obpsc);
	Py_XDECREF(obpsc);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	if (!PyArg_ParseTuple(result, "ii" , pcCharacterPosition, cNumChars)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}
Example #17
0
STDMETHODIMP PyGDebugDocumentText::GetLineOfPosition(
		/* [in] */ ULONG cCharacterPosition,
		/* [out] */ ULONG __RPC_FAR * pcLineNumber,
		/* [out] */ ULONG __RPC_FAR * pcCharacterOffsetInLine)
{
	PY_GATEWAY_METHOD;
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetLineOfPosition", &result, "i", cCharacterPosition);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	ULONG cLineNumber, cCharacterOffsetInLine;
	if (!PyArg_ParseTuple(result, "ii" , &cLineNumber, &cCharacterOffsetInLine)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	if (pcLineNumber) *pcLineNumber = cLineNumber;
	if (pcCharacterOffsetInLine) *pcCharacterOffsetInLine = cCharacterOffsetInLine;
	Py_DECREF(result);
	return hr;
}
STDMETHODIMP PyGActiveScriptDebug::GetScriptTextAttributes(
		/* [size_is][in] */ LPCOLESTR pstrCode,
		/* [in] */ ULONG uNumCodeChars,
		/* [in] */ LPCOLESTR pstrDelimiter,
		/* [in] */ DWORD dwFlags,
		/* [size_is][out][in] */ SOURCE_TEXT_ATTR __RPC_FAR * pattr)
{
	PY_GATEWAY_METHOD;
	PyObject *obCode = PyWinObject_FromOLECHAR(pstrCode,uNumCodeChars);
	PyObject *obszpstrDelimiter = PyWinObject_FromOLECHAR(pstrDelimiter);
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetScriptTextAttributes", &result, "OOi", obCode, obszpstrDelimiter, dwFlags);
	Py_XDECREF(obCode);
	Py_XDECREF(obszpstrDelimiter);
	if (FAILED(hr)) return hr;
	if (!PyAXDebug_PyObject_AsSOURCE_TEXT_ATTR(result, pattr, uNumCodeChars))
		hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
	Py_DECREF(result);
	return hr;
}