Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14888/com/win32comext/shell/src
Modified Files:
Tag: py3k
PyIExtractIcon.cpp PyIExtractIcon.h
Log Message:
Merge various changes from trunk and py3k-integration bzr branch
Index: PyIExtractIcon.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIExtractIcon.h,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -d -r1.2 -r1.2.4.1
*** PyIExtractIcon.h 7 Oct 2003 02:32:11 -0000 1.2
--- PyIExtractIcon.h 26 Nov 2008 07:17:39 -0000 1.2.4.1
***************
*** 9,13 ****
public:
MAKE_PYCOM_CTOR(PyIExtractIcon);
! static IExtractIcon *GetI(PyObject *self);
static PyComTypeObject type;
--- 9,13 ----
public:
MAKE_PYCOM_CTOR(PyIExtractIcon);
! static IExtractIconA *GetI(PyObject *self);
static PyComTypeObject type;
***************
*** 24,28 ****
// Gateway Declaration
! class PyGExtractIcon : public PyGatewayBase, public IExtractIcon
{
protected:
--- 24,28 ----
// Gateway Declaration
! class PyGExtractIcon : public PyGatewayBase, public IExtractIconA
{
protected:
***************
*** 32,38 ****
! // IExtractIcon
STDMETHOD(Extract)(
! LPCTSTR pszFile,
UINT nIconIndex,
HICON * phiconLarge,
--- 32,38 ----
! // IExtractIconA
STDMETHOD(Extract)(
! LPCSTR pszFile,
UINT nIconIndex,
HICON * phiconLarge,
***************
*** 42,46 ****
STDMETHOD(GetIconLocation)(
UINT uFlags,
! LPTSTR szIconFile,
UINT cchMax,
LPINT piIndex,
--- 42,46 ----
STDMETHOD(GetIconLocation)(
UINT uFlags,
! LPSTR szIconFile,
UINT cchMax,
LPINT piIndex,
Index: PyIExtractIcon.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIExtractIcon.cpp,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -C2 -d -r1.5.2.1 -r1.5.2.2
*** PyIExtractIcon.cpp 13 Sep 2008 15:48:31 -0000 1.5.2.1
--- PyIExtractIcon.cpp 26 Nov 2008 07:17:39 -0000 1.5.2.2
***************
*** 18,24 ****
}
! /* static */ IExtractIcon *PyIExtractIcon::GetI(PyObject *self)
{
! return (IExtractIcon *)PyIUnknown::GetI(self);
}
--- 18,24 ----
}
! /* static */ IExtractIconA *PyIExtractIcon::GetI(PyObject *self)
{
! return (IExtractIconA *)PyIUnknown::GetI(self);
}
***************
*** 26,30 ****
PyObject *PyIExtractIcon::Extract(PyObject *self, PyObject *args)
{
! IExtractIcon *pIEI = GetI(self);
if ( pIEI == NULL )
return NULL;
--- 26,30 ----
PyObject *PyIExtractIcon::Extract(PyObject *self, PyObject *args)
{
! IExtractIconA *pIEI = GetI(self);
if ( pIEI == NULL )
return NULL;
***************
*** 35,39 ****
HICON hiconSmall;
PyObject *obpszFile;
! TCHAR *pszFile;
UINT nIconIndex;
UINT nIconSize;
--- 35,39 ----
HICON hiconSmall;
PyObject *obpszFile;
! char *pszFile;
UINT nIconIndex;
UINT nIconSize;
***************
*** 41,50 ****
return NULL;
BOOL bPythonIsHappy = TRUE;
! if (!PyWinObject_AsTCHAR(obpszFile, &pszFile)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIEI->Extract( pszFile, nIconIndex, &hiconLarge, &hiconSmall, nIconSize );
! PyWinObject_FreeTCHAR(pszFile);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
--- 41,50 ----
return NULL;
BOOL bPythonIsHappy = TRUE;
! if (!PyWinObject_AsString(obpszFile, &pszFile)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIEI->Extract( pszFile, nIconIndex, &hiconLarge, &hiconSmall, nIconSize );
! PyWinObject_FreeString(pszFile);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
***************
*** 62,66 ****
PyObject *PyIExtractIcon::GetIconLocation(PyObject *self, PyObject *args)
{
! IExtractIcon *pIEI = GetI(self);
if ( pIEI == NULL )
return NULL;
--- 62,66 ----
PyObject *PyIExtractIcon::GetIconLocation(PyObject *self, PyObject *args)
{
! IExtractIconA *pIEI = GetI(self);
if ( pIEI == NULL )
return NULL;
***************
*** 71,75 ****
if ( !PyArg_ParseTuple(args, "i|i:GetIconLocation", &uFlags, &cchMax))
return NULL;
! TCHAR *buf = (TCHAR *)malloc(cchMax * sizeof(TCHAR));
if (!buf)
return PyErr_NoMemory();
--- 71,75 ----
if ( !PyArg_ParseTuple(args, "i|i:GetIconLocation", &uFlags, &cchMax))
return NULL;
! char *buf = (char *)malloc(cchMax * sizeof(char));
if (!buf)
return PyErr_NoMemory();
***************
*** 84,88 ****
return PyCom_BuildPyException(hr, pIEI, IID_IExtractIcon );
}
! PyObject *retStr = PyWinObject_FromTCHAR(buf);
free(buf);
return Py_BuildValue("iNii", hr, retStr, iIndex, flags);
--- 84,88 ----
return PyCom_BuildPyException(hr, pIEI, IID_IExtractIcon );
}
! PyObject *retStr = PyString_FromString(buf);
free(buf);
return Py_BuildValue("iNii", hr, retStr, iIndex, flags);
***************
*** 106,110 ****
// Gateway Implementation
STDMETHODIMP PyGExtractIcon::Extract(
! /* [unique][in] */ LPCTSTR pszFile,
/* [unique][in] */ UINT nIconIndex,
/* [out] */ HICON * phiconLarge,
--- 106,110 ----
// Gateway Implementation
STDMETHODIMP PyGExtractIcon::Extract(
! /* [unique][in] */ LPCSTR pszFile,
/* [unique][in] */ UINT nIconIndex,
/* [out] */ HICON * phiconLarge,
***************
*** 114,118 ****
PY_GATEWAY_METHOD;
PyObject *obpszFile;
! obpszFile = PyWinObject_FromTCHAR(pszFile);
PyObject *result;
HRESULT hr=InvokeViaPolicy("Extract", &result, "Oii", obpszFile, nIconIndex, nIconSize);
--- 114,118 ----
PY_GATEWAY_METHOD;
PyObject *obpszFile;
! obpszFile = PyString_FromString(pszFile);
PyObject *result;
HRESULT hr=InvokeViaPolicy("Extract", &result, "Oii", obpszFile, nIconIndex, nIconSize);
***************
*** 137,141 ****
STDMETHODIMP PyGExtractIcon::GetIconLocation(
/* [unique][in] */ UINT uFlags,
! /* [unique][out] */ LPTSTR szIconFile,
/* [unique][in] */ UINT cchMax,
/* [unique][out] */ LPINT piIndex,
--- 137,141 ----
STDMETHODIMP PyGExtractIcon::GetIconLocation(
/* [unique][in] */ UINT uFlags,
! /* [unique][out] */ LPSTR szIconFile,
/* [unique][in] */ UINT cchMax,
/* [unique][out] */ LPINT piIndex,
***************
*** 156,163 ****
else {
if (PyArg_ParseTuple(result, "Oii", &obFileName, piIndex, pflags)) {
! TCHAR *filename;
! if (PyWinObject_AsTCHAR(obFileName, &filename)) {
! _tcsncpy(szIconFile, filename, cchMax);
! PyWinObject_FreeTCHAR(filename);
}
}
--- 156,163 ----
else {
if (PyArg_ParseTuple(result, "Oii", &obFileName, piIndex, pflags)) {
! char *filename;
! if (PyWinObject_AsString(obFileName, &filename)) {
! strncpy(szIconFile, filename, cchMax);
! PyWinObject_FreeString(filename);
}
}
|