[pywin32-checkins] pywin32/com/win32comext/shell/src shell.cpp, 1.71, 1.72
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2008-12-03 10:02:32
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12956/com/win32comext/shell/src Modified Files: shell.cpp Log Message: Better support for building with UNICODE and for long ints, from py3k branch Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** shell.cpp 26 Nov 2008 01:13:10 -0000 1.71 --- shell.cpp 3 Dec 2008 10:02:28 -0000 1.72 *************** *** 1748,1752 **** return PyErr_NoMemory(); nchars = ::DragQueryFile(hglobal, index, sz, nchars); ! PyObject *ret = PyString_FromStringAndSize(sz, nchars); free(sz); return ret; --- 1748,1752 ---- return PyErr_NoMemory(); nchars = ::DragQueryFile(hglobal, index, sz, nchars); ! PyObject *ret = PyWinObject_FromTCHAR(sz, nchars); free(sz); return ret; *************** *** 1947,1951 **** --- 1947,1955 ---- // on what other attributes exist. // @pyparm bool|make_unicode|False|If true, a FILEDESCRIPTORW object is created + #ifdef UNICODE + int make_unicode = TRUE; + #else int make_unicode = FALSE; + #endif if (!PyArg_ParseTuple(args, "O|i", &ob, &make_unicode)) return NULL; *************** *** 2068,2072 **** if (attr && attr != Py_None) { fd->dwFlags |= FD_FILESIZE; ! ok = PyLong_AsTwoI32(attr, (int *)&fd->nFileSizeHigh, (unsigned *)&fd->nFileSizeLow); } Py_XDECREF(attr); --- 2072,2081 ---- if (attr && attr != Py_None) { fd->dwFlags |= FD_FILESIZE; ! ULARGE_INTEGER fsize; ! ok=PyWinObject_AsULARGE_INTEGER(attr, &fsize); ! if (ok){ ! fd->nFileSizeHigh=fsize.HighPart; ! fd->nFileSizeLow=fsize.LowPart; ! } } Py_XDECREF(attr); *************** *** 2218,2222 **** if (fd->dwFlags & FD_FILESIZE) { ! val = PyLong_FromTwoInts(fd->nFileSizeHigh, fd->nFileSizeLow); if (val) PyDict_SetItemString(sub, "nFileSize", val); Py_XDECREF(val); --- 2227,2234 ---- if (fd->dwFlags & FD_FILESIZE) { ! ULARGE_INTEGER fsize; ! fsize.LowPart=fd->nFileSizeLow; ! fsize.HighPart=fd->nFileSizeHigh; ! val = PyWinObject_FromULARGE_INTEGER(fsize); if (val) PyDict_SetItemString(sub, "nFileSize", val); Py_XDECREF(val); *************** *** 3169,3173 **** /* List of module functions */ ! // @module shell|A module, encapsulating the ActiveX Control interfaces static struct PyMethodDef shell_methods[]= { --- 3181,3185 ---- /* List of module functions */ ! // @module shell|A module wrapping Windows Shell functions and interfaces static struct PyMethodDef shell_methods[]= { *************** *** 3312,3315 **** --- 3324,3328 ---- #define ADD_IID(tok) AddIID(dict, #tok, tok) + /* Module initialisation */ extern "C" __declspec(dllexport) void initshell() |