STDMETHODIMP PyGInternetSecurityManager::GetSecurityId(
		/* [in] */ LPCWSTR pwszUrl,
		/* [size_is][out] */ BYTE * pbSecurityId,
		/* [out][in] */ DWORD * pcbSecurityId,
		/* [in] */ DWORD_PTR dwReserved)
{
	PY_GATEWAY_METHOD;
	PyObject *obdwReserved = PyWinObject_FromDWORD_PTR(dwReserved);
	if (obdwReserved==NULL) return MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetSecurityId");
	PyObject *obpwszUrl;
	obpwszUrl = MakeOLECHARToObj(pwszUrl);
	PyObject *result;
	HRESULT hr=InvokeViaPolicy("GetSecurityId", &result, "OlO", obpwszUrl, *pcbSecurityId, obdwReserved);
	Py_XDECREF(obpwszUrl);
	Py_DECREF(obdwReserved);
	if (FAILED(hr)) return hr;
	// Process the Python results, and convert back to the real params
	void *buf;
	DWORD buf_len;
	if (!PyWinObject_AsReadBuffer(result, &buf, &buf_len)) {
		Py_DECREF(result);
		return MAKE_PYCOM_GATEWAY_FAILURE_CODE("GetSecurityId");
	}
	*pcbSecurityId = min(buf_len, *pcbSecurityId);
	memcpy(pbSecurityId, buf, *pcbSecurityId);
	Py_DECREF(result);
	return hr;
}
Ejemplo n.º 2
0
// @pymethod |PyCPrintInfo|DoModal|Call DoModal on the dialog.
// @pyseemfc CPrintDialog|DoModal
static PyObject *ui_do_modal(PyObject * self, PyObject * args)
{
  CHECK_NO_ARGS2(args, DoModal);
  CPrintInfo *pInfo = ui_prinfo_object::GetPrintInfo(self);
  if (!pInfo)
    return NULL;
  GUI_BGN_SAVE;
  INT_PTR res = pInfo->m_pPD->DoModal();
  GUI_END_SAVE;
  return PyWinObject_FromDWORD_PTR(res);
}
Ejemplo n.º 3
0
// @pymethod int|PyCPropertySheet|DoModal|Displays the property sheet as a modal dialog.
PyObject *ui_propsheet_do_modal( PyObject *self, PyObject *args )
{
	CHECK_NO_ARGS(args);
	CPropertySheet *pPS;
	if (!(pPS=GetPropSheet(self)))
		return NULL;
	if (!PropSheetCheckForDisplay(pPS))
		return NULL;
	Py_INCREF(self);	// make sure Python doesnt kill the object while in a modal call.
					// really only for the common dialog(!?), and other non CPythonPropSheet's
	INT_PTR ret;
	GUI_BGN_SAVE;
	ret = pPS->DoModal();
	GUI_END_SAVE;
	DODECREF(self);
	return PyWinObject_FromDWORD_PTR(ret);
}
Ejemplo n.º 4
0
// @pymethod object|PyCTreeCtrl|GetItemData|Retrieves the application-specific value associated with an item.
PyObject *PyCTreeCtrl_GetItemData( PyObject *self, PyObject *args )
{
	PyObject *obItem;
	if (!PyArg_ParseTuple( args, "O:GetItemData",
	                   &obItem)) // @pyparm HTREEITEM|item||The index of the item whose data is to be retrieved.

		return NULL;
	CTreeCtrl *pList = GetTreeCtrl(self);
	if (!pList) return NULL;
	HTREEITEM item;
	if (!PyWinObject_AsHANDLE(obItem, (HANDLE *)&item))
		return NULL;
	GUI_BGN_SAVE;
	DWORD_PTR rc = pList->GetItemData(item);
	GUI_END_SAVE;
	return PyWinObject_FromDWORD_PTR(rc);
}