[pywin32-checkins] pywin32/win32/src/win32print win32print.cpp,1.16,1.17
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2005-02-11 16:38:39
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32print In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18971/win32/src/win32print Modified Files: win32print.cpp Log Message: Parse out pDependentFiles of DRIVER_INFO_3 Index: win32print.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32print/win32print.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** win32print.cpp 10 Feb 2005 13:01:11 -0000 1.16 --- win32print.cpp 11 Feb 2005 16:38:29 -0000 1.17 *************** *** 1186,1189 **** --- 1186,1217 ---- } + PyObject * PyWinObject_FromWCHARMultiple(WCHAR *multistring) + { + PyObject *obelement, *ret=NULL; + // takes a consecutive sequence of NULL terminated unicode strings, + // terminated by an additional NULL and returns a list + int elementlen; + if (multistring==NULL){ + Py_INCREF(Py_None); + return Py_None; + } + ret=PyList_New(0); + if (ret==NULL) + return NULL; + elementlen=wcslen(multistring); + do{ + obelement=PyWinObject_FromWCHAR(multistring, elementlen); + if ((obelement==NULL)||(PyList_Append(ret,obelement)==-1)){ + Py_DECREF(ret); + return NULL; + } + Py_DECREF(obelement); + multistring+=elementlen+1; + elementlen=wcslen(multistring); + } + while (elementlen>0); + return ret; + } + // @pymethod (dict,...)|win32print|EnumPrinterDrivers|Lists installed printer drivers static PyObject *PyEnumPrinterDrivers(PyObject *self, PyObject *args) *************** *** 1266,1270 **** di3=(DRIVER_INFO_3W *)buf; for (i=0; i<return_cnt; i++){ ! tuple_item=Py_BuildValue("{s:l,s:u,s:u,s:u,s:u,s:u,s:u,s:u,s:u,s:u}", "Version",di3->cVersion, "Name",di3->pName, --- 1294,1298 ---- di3=(DRIVER_INFO_3W *)buf; for (i=0; i<return_cnt; i++){ ! tuple_item=Py_BuildValue("{s:l,s:u,s:u,s:u,s:u,s:u,s:u,s:O&,s:u,s:u}", "Version",di3->cVersion, "Name",di3->pName, *************** *** 1274,1279 **** "ConfigFile",di3->pConfigFile, "HelpFile", di3->pHelpFile, ! "DependentFiles",di3->pDependentFiles, ! // ???? pDependentFiles can contain multiple null-terminated strings, need to parse them out ???? "MonitorName",di3->pMonitorName, "DefaultDataType",di3->pDefaultDataType); --- 1302,1306 ---- "ConfigFile",di3->pConfigFile, "HelpFile", di3->pHelpFile, ! "DependentFiles",PyWinObject_FromWCHARMultiple,di3->pDependentFiles, "MonitorName",di3->pMonitorName, "DefaultDataType",di3->pDefaultDataType); *************** *** 1759,1764 **** } // @flag DC_MEDIATYPES|Sequence of ints, DMMEDIA_* constants ! case DC_MEDIATYPES:{ ! // need to add DMMEDIA_STANDARD, DMMEDIA_GLOSSY, DMMEDIA_TRANSPARENCY, DMMEDIA_USER to win32con DWORD *pdword; retsize=sizeof(DWORD); --- 1786,1790 ---- } // @flag DC_MEDIATYPES|Sequence of ints, DMMEDIA_* constants ! case DC_MEDIATYPES:{ DWORD *pdword; retsize=sizeof(DWORD); |