[pywin32-checkins] pywin32/win32/src/win32print win32print.cpp, 1.25, 1.26
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2007-05-30 02:37:01
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32print In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28441/win32/src/win32print Modified Files: win32print.cpp Log Message: Fix 's#' 64-bit issue Index: win32print.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32print/win32print.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** win32print.cpp 24 May 2007 06:01:06 -0000 1.25 --- win32print.cpp 30 May 2007 02:37:01 -0000 1.26 *************** *** 864,868 **** } ! // @pymethod int|win32print|WritePrinter|Copies the specified bytes to the specified printer. Suitable for copying raw Postscript or HPGL files to a printer. StartDocPrinter and EndDocPrinter should be called before and after. Returns number of bytes written to printer. static PyObject *PyWritePrinter(PyObject *self, PyObject *args) { --- 864,871 ---- } ! // @pymethod int|win32print|WritePrinter|Copies the specified bytes to the specified printer. ! // Suitable for copying raw Postscript or HPGL files to a printer. ! // StartDocPrinter and EndDocPrinter should be called before and after. ! // @rdesc Returns number of bytes written to printer. static PyObject *PyWritePrinter(PyObject *self, PyObject *args) { *************** *** 871,882 **** DWORD buf_size; DWORD bufwritten_size; ! ! if (!PyArg_ParseTuple(args, "O&s#:WritePrinter", ! PyWinObject_AsPrinterHANDLE, &hprinter, // @pyparm <o PyPrinterHANDLE>|hprinter||Handle to printer (from OpenPrinter) ! &buf, // @pyparm string|buf||String to send to printer. Embedded NULL bytes are allowed. ! &buf_size ! )) return NULL; - if (!WritePrinter(hprinter, buf, buf_size, &bufwritten_size)) return PyWin_SetAPIError("WritePrinter"); --- 874,884 ---- DWORD buf_size; DWORD bufwritten_size; ! PyObject *obbuf; ! if (!PyArg_ParseTuple(args, "O&O:WritePrinter", ! PyWinObject_AsPrinterHANDLE, &hprinter, // @pyparm <o PyPrinterHANDLE>|hprinter||Handle to printer as returned by <om win32print.OpenPrinter>. ! &obbuf)) // @pyparm string|buf||String or buffer containing data to send to printer. Embedded NULL bytes are allowed. ! return NULL; ! if (!PyWinObject_AsReadBuffer(obbuf, &buf, &buf_size, FALSE)) return NULL; if (!WritePrinter(hprinter, buf, buf_size, &bufwritten_size)) return PyWin_SetAPIError("WritePrinter"); |