pywin32-checkins Mailing List for Python for Windows Extensions (Page 18)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(6) |
Jul
(50) |
Aug
(11) |
Sep
(24) |
Oct
(184) |
Nov
(118) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(31) |
Feb
(25) |
Mar
(34) |
Apr
(105) |
May
(49) |
Jun
(38) |
Jul
(39) |
Aug
(7) |
Sep
(98) |
Oct
(79) |
Nov
(20) |
Dec
(17) |
2005 |
Jan
(66) |
Feb
(32) |
Mar
(43) |
Apr
(30) |
May
(58) |
Jun
(30) |
Jul
(16) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(11) |
Dec
(14) |
2006 |
Jan
(42) |
Feb
(30) |
Mar
(22) |
Apr
(1) |
May
(9) |
Jun
(15) |
Jul
(20) |
Aug
(9) |
Sep
(8) |
Oct
(1) |
Nov
(9) |
Dec
(43) |
2007 |
Jan
(52) |
Feb
(45) |
Mar
(20) |
Apr
(12) |
May
(59) |
Jun
(39) |
Jul
(35) |
Aug
(31) |
Sep
(17) |
Oct
(20) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(28) |
Feb
(111) |
Mar
(4) |
Apr
(27) |
May
(40) |
Jun
(27) |
Jul
(32) |
Aug
(94) |
Sep
(87) |
Oct
(153) |
Nov
(336) |
Dec
(331) |
2009 |
Jan
(298) |
Feb
(127) |
Mar
(20) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
2010 |
Jan
(7) |
Feb
(1) |
Mar
|
Apr
|
May
(15) |
Jun
(4) |
Jul
(3) |
Aug
(28) |
Sep
(1) |
Oct
(19) |
Nov
(16) |
Dec
(6) |
2011 |
Jan
(2) |
Feb
(18) |
Mar
(17) |
Apr
(12) |
May
(5) |
Jun
(11) |
Jul
(7) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(4) |
Dec
|
2012 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(8) |
May
(4) |
Jun
(3) |
Jul
(13) |
Aug
(27) |
Sep
(8) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(10) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
2014 |
Jan
(2) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Roger U. <ru...@us...> - 2009-02-09 01:06:00
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13677 Modified Files: configui.py formatter.py Log Message: Whitespace background acts as overall default background Remove "Default background" registry hack Use CLR_INVALID in place of None for style default Index: configui.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/configui.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** configui.py 3 Sep 2008 00:55:10 -0000 1.6 --- configui.py 9 Feb 2009 01:05:54 -0000 1.7 *************** *** 7,10 **** --- 7,13 ---- import scintillacon + # Used to indicate that style should use default color + from win32con import CLR_INVALID + ###################################################### # Property Page for syntax formatting options *************** *** 163,167 **** style = self.GetSelectedStyle() bg = win32api.RGB(0xff, 0xff, 0xff) ! if style.background is not None: bg = style.background d=win32ui.CreateColorDialog(bg, 0, self) --- 166,170 ---- style = self.GetSelectedStyle() bg = win32api.RGB(0xff, 0xff, 0xff) ! if style.background != CLR_INVALID: bg = style.background d=win32ui.CreateColorDialog(bg, 0, self) *************** *** 177,181 **** if isDef: # Being reset to the default color style = self.GetSelectedStyle() ! style.background = None self.UpdateUIForStyle(style) self.scintilla.ApplyFormattingStyles(0) --- 180,184 ---- if isDef: # Being reset to the default color style = self.GetSelectedStyle() ! style.background = CLR_INVALID self.UpdateUIForStyle(style) self.scintilla.ApplyFormattingStyles(0) *************** *** 206,211 **** self.GetDlgItem(win32ui.IDC_BUTTON3).EnableWindow(not style.IsBasedOnDefault()) ! self.butIsDefaultBackground.SetCheck(style.background is None) ! self.GetDlgItem(win32ui.IDC_BUTTON4).EnableWindow(style.background is not None) bold = format[1] & win32con.CFE_BOLD != 0; italic = format[1] & win32con.CFE_ITALIC != 0 --- 209,214 ---- self.GetDlgItem(win32ui.IDC_BUTTON3).EnableWindow(not style.IsBasedOnDefault()) ! self.butIsDefaultBackground.SetCheck(style.background == CLR_INVALID) ! self.GetDlgItem(win32ui.IDC_BUTTON4).EnableWindow(style.background != CLR_INVALID) bold = format[1] & win32con.CFE_BOLD != 0; italic = format[1] & win32con.CFE_ITALIC != 0 Index: formatter.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/formatter.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** formatter.py 8 Feb 2009 21:35:25 -0000 1.19 --- formatter.py 9 Feb 2009 01:05:54 -0000 1.20 *************** *** 10,13 **** --- 10,16 ---- WM_KICKIDLE = 0x036A + # Used to indicate that style should use default color + from win32con import CLR_INVALID + debugging = 0 if debugging: *************** *** 23,29 **** """Represents a single format """ ! def __init__(self, name, format, background = None): self.name = name # Name the format representes eg, "String", "Class" ! self.background = background if type(format)==type(''): self.aliased = format --- 26,34 ---- """Represents a single format """ ! def __init__(self, name, format, background = CLR_INVALID): self.name = name # Name the format representes eg, "String", "Class" ! # Default background for each style is only used when there are no ! # saved settings (generally on first startup) ! self.background = self.default_background = background if type(format)==type(''): self.aliased = format *************** *** 66,86 **** self.styles = {} # Indexed by name self.styles_by_id = {} # Indexed by allocated ID. - # Default Background - self.default_background = None - self._LoadBackground() - self.SetStyles() - - - def _LoadBackground( self ): - #load default background - bg = int( self.LoadPreference( "Default Background", -1 ) ) - if bg != -1: - self.default_background = bg - if self.default_background is None: - self.default_background = win32api.GetSysColor(win32con.COLOR_WINDOW) - - def GetDefaultBackground( self ): - return self.default_background def HookFormatter(self, parent = None): --- 71,75 ---- *************** *** 137,146 **** else: scintilla.SCIStyleSetItalic(stylenum, 0) scintilla.SCIStyleSetSize(stylenum, int(baseFormat[2]/20)) - if style.background is not None: - scintilla.SCIStyleSetBack(stylenum, style.background) - else: - scintilla.SCIStyleSetBack(stylenum, self.GetDefaultBackground() ) scintilla.SCIStyleSetEOLFilled(stylenum, 1) # Only needed for unclosed strings. def GetStyleByNum(self, stylenum): return self.styles_by_id[stylenum] --- 126,142 ---- else: scintilla.SCIStyleSetItalic(stylenum, 0) scintilla.SCIStyleSetSize(stylenum, int(baseFormat[2]/20)) scintilla.SCIStyleSetEOLFilled(stylenum, 1) # Only needed for unclosed strings. + ## Default style background to whitespace background if set, + ## otherwise use system window color + bg = style.background + if bg == CLR_INVALID: + bg = self.styles[STYLE_DEFAULT].background + if bg == CLR_INVALID: + bg = win32api.GetSysColor(win32con.COLOR_WINDOW) + scintilla.SCIStyleSetBack(stylenum, bg) + + + def GetStyleByNum(self, stylenum): return self.styles_by_id[stylenum] *************** *** 170,181 **** try: style.format = eval(new) - bg = int(self.LoadPreference(style.name + " background", -1)) - if bg != -1: - style.background = bg - if style.background == self.default_background: - style.background = None - except: print "Error loading style data for", style.name def LoadPreference(self, name, default): --- 166,173 ---- try: style.format = eval(new) except: print "Error loading style data for", style.name + # Use "vanilla" background hardcoded in PYTHON_STYLES if no settings in registry + style.background = int(self.LoadPreference(style.name + " background", style.default_background)) def LoadPreference(self, name, default): *************** *** 190,199 **** self.SavePreference(style.name, str(style.format)) bg_name = style.name + " background" ! self.SavePreference(bg_name, style.background) # May be None def SavePreference(self, name, value): - ## LoadPreference uses -1 to indicate default - if value is None: - value=-1 win32ui.WriteProfileVal("Format", name, value) --- 182,188 ---- self.SavePreference(style.name, str(style.format)) bg_name = style.name + " background" ! self.SavePreference(bg_name, style.background) def SavePreference(self, name, value): win32ui.WriteProfileVal("Format", name, value) *************** *** 315,335 **** # However, if we use the built-in lexer, then we must use its style numbers # so in that case, they _are_ special. PYTHON_STYLES = [ ! (STYLE_DEFAULT, (0, 0, 200, 0, 0x808080), None, scintillacon.SCE_P_DEFAULT ), ! (STYLE_COMMENT, (0, 2, 200, 0, 0x008000), None, scintillacon.SCE_P_COMMENTLINE ), ! (STYLE_COMMENT_BLOCK,(0, 2, 200, 0, 0x808080), None, scintillacon.SCE_P_COMMENTBLOCK ), ! (STYLE_NUMBER, (0, 0, 200, 0, 0x808000), None, scintillacon.SCE_P_NUMBER ), ! (STYLE_STRING, (0, 0, 200, 0, 0x008080), None, scintillacon.SCE_P_STRING ), ! (STYLE_SQSTRING, STYLE_STRING, None, scintillacon.SCE_P_CHARACTER ), ! (STYLE_TQSSTRING, STYLE_STRING, None, scintillacon.SCE_P_TRIPLE ), ! (STYLE_TQDSTRING, STYLE_STRING, None, scintillacon.SCE_P_TRIPLEDOUBLE), (STYLE_STRINGEOL, (0, 0, 200, 0, 0x000000), 0x008080, scintillacon.SCE_P_STRINGEOL), ! (STYLE_KEYWORD, (0, 1, 200, 0, 0x800000), None, scintillacon.SCE_P_WORD), ! (STYLE_CLASS, (0, 1, 200, 0, 0xFF0000), None, scintillacon.SCE_P_CLASSNAME ), ! (STYLE_METHOD, (0, 1, 200, 0, 0x808000), None, scintillacon.SCE_P_DEFNAME), ! (STYLE_OPERATOR, (0, 0, 200, 0, 0x000000), None, scintillacon.SCE_P_OPERATOR), ! (STYLE_IDENTIFIER, (0, 0, 200, 0, 0x000000), None, scintillacon.SCE_P_IDENTIFIER ), ! (STYLE_LINENUMBER, (0, 0, 200, 0, 0x000000), None, scintillacon.STYLE_LINENUMBER), ! (STYLE_INDENTGUIDE, (0, 0, 200, 0, 0x000000), None, scintillacon.STYLE_INDENTGUIDE), ] --- 304,323 ---- # However, if we use the built-in lexer, then we must use its style numbers # so in that case, they _are_ special. + # (name, format, background, scintilla id) PYTHON_STYLES = [ ! (STYLE_DEFAULT, (0, 0, 200, 0, 0x808080), CLR_INVALID, scintillacon.SCE_P_DEFAULT ), ! (STYLE_COMMENT, (0, 2, 200, 0, 0x008000), CLR_INVALID, scintillacon.SCE_P_COMMENTLINE ), ! (STYLE_COMMENT_BLOCK,(0, 2, 200, 0, 0x808080), CLR_INVALID, scintillacon.SCE_P_COMMENTBLOCK ), ! (STYLE_NUMBER, (0, 0, 200, 0, 0x808000), CLR_INVALID, scintillacon.SCE_P_NUMBER ), ! (STYLE_STRING, (0, 0, 200, 0, 0x008080), CLR_INVALID, scintillacon.SCE_P_STRING ), ! (STYLE_SQSTRING, STYLE_STRING, CLR_INVALID, scintillacon.SCE_P_CHARACTER ), ! (STYLE_TQSSTRING, STYLE_STRING, CLR_INVALID, scintillacon.SCE_P_TRIPLE ), ! (STYLE_TQDSTRING, STYLE_STRING, CLR_INVALID, scintillacon.SCE_P_TRIPLEDOUBLE), (STYLE_STRINGEOL, (0, 0, 200, 0, 0x000000), 0x008080, scintillacon.SCE_P_STRINGEOL), ! (STYLE_KEYWORD, (0, 1, 200, 0, 0x800000), CLR_INVALID, scintillacon.SCE_P_WORD), ! (STYLE_CLASS, (0, 1, 200, 0, 0xFF0000), CLR_INVALID, scintillacon.SCE_P_CLASSNAME ), ! (STYLE_METHOD, (0, 1, 200, 0, 0x808000), CLR_INVALID, scintillacon.SCE_P_DEFNAME), ! (STYLE_OPERATOR, (0, 0, 200, 0, 0x000000), CLR_INVALID, scintillacon.SCE_P_OPERATOR), ! (STYLE_IDENTIFIER, (0, 0, 200, 0, 0x000000), CLR_INVALID, scintillacon.SCE_P_IDENTIFIER ), ] *************** *** 339,342 **** --- 327,332 ---- (STYLE_BRACE, (0, 0, 200, 0, 0x000000), 0xffff80, scintillacon.STYLE_BRACELIGHT), (STYLE_BRACEBAD, (0, 0, 200, 0, 0x000000), 0x8ea5f2, scintillacon.STYLE_BRACEBAD), + (STYLE_LINENUMBER, (0, 0, 200, 0, 0x000000), win32api.GetSysColor(win32con.COLOR_3DFACE), scintillacon.STYLE_LINENUMBER), + (STYLE_INDENTGUIDE, (0, 0, 200, 0, 0x000000), CLR_INVALID, scintillacon.STYLE_INDENTGUIDE), ] |
From: Roger U. <ru...@us...> - 2009-02-08 22:16:39
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26275 Modified Files: formatter.py Log Message: Patch [ 2560427 ] Line number formatting, from MizardX Index: formatter.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/formatter.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** formatter.py 31 Jan 2009 03:52:39 -0000 1.18 --- formatter.py 8 Feb 2009 21:35:25 -0000 1.19 *************** *** 307,310 **** --- 307,312 ---- STYLE_BRACEBAD = "Brace/Paren - unmatched" STYLE_STRINGEOL = "String with no terminator" + STYLE_LINENUMBER = "Line numbers" + STYLE_INDENTGUIDE = "Indent guide" STRING_STYLES = [STYLE_STRING, STYLE_SQSTRING, STYLE_TQSSTRING, STYLE_TQDSTRING, STYLE_STRINGEOL] *************** *** 328,331 **** --- 330,335 ---- (STYLE_OPERATOR, (0, 0, 200, 0, 0x000000), None, scintillacon.SCE_P_OPERATOR), (STYLE_IDENTIFIER, (0, 0, 200, 0, 0x000000), None, scintillacon.SCE_P_IDENTIFIER ), + (STYLE_LINENUMBER, (0, 0, 200, 0, 0x000000), None, scintillacon.STYLE_LINENUMBER), + (STYLE_INDENTGUIDE, (0, 0, 200, 0, 0x000000), None, scintillacon.STYLE_INDENTGUIDE), ] |
From: Roger U. <ru...@us...> - 2009-02-08 20:20:54
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8897 Modified Files: configui.py Log Message: Fix for [ 2560391 ] Fold margin default values inconsistent Patch from MizardX Index: configui.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/configui.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** configui.py 25 Feb 2008 05:31:46 -0000 1.8 --- configui.py 8 Feb 2009 20:20:50 -0000 1.9 *************** *** 32,36 **** # Folding ! self._AddEditorOption(win32ui.IDC_MARGIN_FOLD, "i", "Fold Margin Width", 20) self._AddEditorOption(win32ui.IDC_FOLD_ENABLE, "i", "Enable Folding", 1) self._AddEditorOption(win32ui.IDC_FOLD_ON_OPEN, "i", "Fold On Open", 0) --- 32,36 ---- # Folding ! self._AddEditorOption(win32ui.IDC_MARGIN_FOLD, "i", "Fold Margin Width", 12) self._AddEditorOption(win32ui.IDC_FOLD_ENABLE, "i", "Enable Folding", 1) self._AddEditorOption(win32ui.IDC_FOLD_ON_OPEN, "i", "Fold On Open", 0) |
From: Roger U. <ru...@us...> - 2009-02-08 20:11:53
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/color In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6358 Modified Files: coloreditor.py Log Message: Fix [ 2560351 ] Can't change Folding Margin width Patch from MizardX Index: coloreditor.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/color/coloreditor.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** coloreditor.py 4 Dec 2008 12:44:44 -0000 1.15 --- coloreditor.py 8 Feb 2009 20:11:47 -0000 1.16 *************** *** 120,124 **** width = GetEditorOption("Marker Margin Width", 16) self.SCISetMarginWidthN(1, width) ! width = GetEditorOption("Folding Margin Width", 12) self.SCISetMarginWidthN(2, width) width = GetEditorOption("Line Number Margin Width", 0) --- 120,124 ---- width = GetEditorOption("Marker Margin Width", 16) self.SCISetMarginWidthN(1, width) ! width = GetEditorOption("Fold Margin Width", 12) self.SCISetMarginWidthN(2, width) width = GetEditorOption("Line Number Margin Width", 0) |
From: Roger U. <ru...@us...> - 2009-02-08 19:38:38
|
Update of /cvsroot/pywin32/pywin32/win32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29001 Removed Files: win32file.dsp Log Message: --- win32file.dsp DELETED --- |
From: Roger U. <ru...@us...> - 2009-02-08 19:38:38
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29001/src Removed Files: win32filemodule.cpp Log Message: --- win32filemodule.cpp DELETED --- |
From: Roger U. <ru...@us...> - 2009-02-08 19:31:27
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27123 Modified Files: setup.py Log Message: Specify sources for win32file so .dsp can be removed Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** setup.py 7 Feb 2009 04:28:59 -0000 1.100 --- setup.py 8 Feb 2009 19:31:20 -0000 1.101 *************** *** 1437,1440 **** --- 1437,1441 ---- for info in ( + # (name, libraries, UNICODE, WINVER, sources) ("mmapfile", "", None), ("odbc", "odbc32 odbccp32", None), *************** *** 1444,1448 **** ("win32cred", "AdvAPI32 credui", True, 0x0501, 'win32/src/win32credmodule.cpp'), ("win32crypt", "Crypt32", None, 0x0500, 'win32/src/win32crypt.i'), ! ("win32file", "oleaut32", None, 0x0500), ("win32event", "user32", None), ("win32clipboard", "gdi32 user32 shell32", None), --- 1445,1452 ---- ("win32cred", "AdvAPI32 credui", True, 0x0501, 'win32/src/win32credmodule.cpp'), ("win32crypt", "Crypt32", None, 0x0500, 'win32/src/win32crypt.i'), ! ("win32file", "", None, 0x0500, """ ! win32/src/win32file.i ! win32/src/win32file_comm.cpp ! """), ("win32event", "user32", None), ("win32clipboard", "gdi32 user32 shell32", None), |
From: Roger U. <ru...@us...> - 2009-02-08 19:25:38
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25718 Modified Files: PyWinTypesmodule.cpp Log Message: Restore PyType_Ready calls in PyWinGlobals_Ensure Index: PyWinTypesmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypesmodule.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** PyWinTypesmodule.cpp 8 Feb 2009 10:11:11 -0000 1.52 --- PyWinTypesmodule.cpp 8 Feb 2009 19:25:34 -0000 1.53 *************** *** 916,919 **** --- 916,945 ---- // @tupleitem 3|None/int|argerror|The index of the argument in error, or (usually) None or -1 } + + /* PyType_Ready *needs* to be called anytime pywintypesxx.dll is loaded, since + other extension modules can use types defined here without pywintypes itself + having been imported. + ??? All extension modules that call this need to be changed to check the exit code ??? + */ + if (PyType_Ready(&PyHANDLEType) == -1 + ||PyType_Ready(&PyOVERLAPPEDType) == -1 + ||PyType_Ready(&PyDEVMODEAType) == -1 + ||PyType_Ready(&PyDEVMODEWType) == -1 + ||PyType_Ready(&PyWAVEFORMATEXType) == -1 + #ifndef NO_PYWINTYPES_TIME + ||PyType_Ready(&PyTimeType) == -1 + #endif // NO_PYWINTYPES_TIME + #ifndef NO_PYWINTYPES_IID + ||PyType_Ready(&PyIIDType) == -1 + #endif // NO_PYWINTYPES_IID + #ifndef NO_PYWINTYPES_SECURITY + ||PyType_Ready(&PySECURITY_DESCRIPTORType) == -1 + ||PyType_Ready(&PySECURITY_ATTRIBUTESType) == -1 + ||PyType_Ready(&PySIDType) == -1 + ||PyType_Ready(&PyACLType) == -1 + #endif + ) + return -1; + if (!_PyWinDateTime_Init()) return -1; |
From: Roger U. <ru...@us...> - 2009-02-08 15:51:47
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13348 Modified Files: win32file.i Log Message: Misplaced closing brace Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** win32file.i 8 Feb 2009 10:11:11 -0000 1.104 --- win32file.i 8 Feb 2009 15:51:42 -0000 1.105 *************** *** 366,371 **** }; return PyMemoryView_FromBuffer(&info); - #endif } --- 366,372 ---- }; return PyMemoryView_FromBuffer(&info); } + #endif + |
From: Mark H. <mha...@us...> - 2009-02-08 10:16:59
|
Update of /cvsroot/pywin32/pywin32/isapi/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13860/isapi/src Modified Files: PythonEng.cpp Log Message: PyObject_Compare no longer exists in py3k Index: PythonEng.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PythonEng.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PythonEng.cpp 3 Feb 2009 00:51:42 -0000 1.7 --- PythonEng.cpp 8 Feb 2009 10:16:55 -0000 1.8 *************** *** 154,158 **** for (int i=0; i<PyList_Size(obPathList); i++){ PyObject * obItem = PyList_GetItem(obPathList, i); ! if(PyObject_Compare(obNew, obItem) == 0){ bFnd = true; break; --- 154,158 ---- for (int i=0; i<PyList_Size(obPathList); i++){ PyObject * obItem = PyList_GetItem(obPathList, i); ! if(PyObject_RichCompare(obNew, obItem, Py_EQ) == Py_True){ bFnd = true; break; |
From: Mark H. <mha...@us...> - 2009-02-08 10:11:50
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv10122/win32/test Modified Files: test_win32guistruct.py Log Message: add DEV_BROADCAST_* tests Index: test_win32guistruct.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32guistruct.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_win32guistruct.py 13 Jan 2009 22:57:11 -0000 1.1 --- test_win32guistruct.py 8 Feb 2009 10:11:44 -0000 1.2 *************** *** 3,6 **** --- 3,8 ---- import win32gui_struct import win32con + import array + import pythoncom class TestBase(unittest.TestCase): *************** *** 184,187 **** --- 186,223 ---- + class TestDEV_BROADCAST_HANDLE(TestBase): + def testPackUnpack(self): + s = win32gui_struct.PackDEV_BROADCAST_HANDLE(123) + c = array.array("b", s) + got = win32gui_struct.UnpackDEV_BROADCAST(c.buffer_info()[0]) + self.failUnlessEqual(got.handle, 123) + + def testGUID(self): + s = win32gui_struct.PackDEV_BROADCAST_HANDLE(123, + guid=pythoncom.IID_IUnknown) + c = array.array("b", s) + got = win32gui_struct.UnpackDEV_BROADCAST(c.buffer_info()[0]) + self.failUnlessEqual(got.handle, 123) + self.failUnlessEqual(got.eventguid, pythoncom.IID_IUnknown) + + + class TestDEV_BROADCAST_DEVICEINTERFACE(TestBase): + def testPackUnpack(self): + s = win32gui_struct.PackDEV_BROADCAST_DEVICEINTERFACE(pythoncom.IID_IUnknown, + "hello") + c = array.array("b", s) + got = win32gui_struct.UnpackDEV_BROADCAST(c.buffer_info()[0]) + self.failUnlessEqual(got.classguid, pythoncom.IID_IUnknown) + self.failUnlessEqual(got.name, "hello") + + + class TestDEV_BROADCAST_VOLUME(TestBase): + def testPackUnpack(self): + s = win32gui_struct.PackDEV_BROADCAST_VOLUME(123, 456) + c = array.array("b", s) + got = win32gui_struct.UnpackDEV_BROADCAST(c.buffer_info()[0]) + self.failUnlessEqual(got.unitmask, 123) + self.failUnlessEqual(got.flags, 456) + if __name__=='__main__': unittest.main() |
From: Mark H. <mha...@us...> - 2009-02-08 10:11:19
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9719/win32/src Modified Files: PyWinTypes.h PyWinTypesmodule.cpp win32file.i Log Message: Fix PyBuffer_FromMemory, make PyBuffer_FromReadWriteMemory private Index: PyWinTypesmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypesmodule.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** PyWinTypesmodule.cpp 8 Feb 2009 05:20:02 -0000 1.51 --- PyWinTypesmodule.cpp 8 Feb 2009 10:11:11 -0000 1.52 *************** *** 46,80 **** } - PyObject *PyBuffer_FromReadWriteMemory(void *buf, Py_ssize_t size){ - // buf is not freed by returned object !!!!!!! - Py_buffer info={ - buf, - NULL, // obj added in 3.0b3 - size, - FALSE, // readonly - NULL, // format - 0, // ndim - NULL, // shape - NULL, // strided - NULL, // suboffsets - 0, // itemsize - NULL, // internal - }; - return PyMemoryView_FromBuffer(&info); - } - PyObject *PyBuffer_FromMemory(void *buf, Py_ssize_t size){ // buf is not freed by returned object !!!!!!! Py_buffer info={ buf, NULL, // obj added in 3.0b3 ! size, TRUE, // readonly NULL, // format ! 0, // ndim ! NULL, // shape ! NULL, // strided NULL, // suboffsets - 0, // itemsize NULL, // internal }; --- 46,63 ---- } PyObject *PyBuffer_FromMemory(void *buf, Py_ssize_t size){ // buf is not freed by returned object !!!!!!! + Py_ssize_t shape0 = size; Py_buffer info={ buf, NULL, // obj added in 3.0b3 ! size, // len ! 1, // itemsize TRUE, // readonly + 1, // ndim NULL, // format ! &shape0, // shape ! NULL, // strides NULL, // suboffsets NULL, // internal }; Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** PyWinTypes.h 8 Feb 2009 05:20:02 -0000 1.68 --- PyWinTypes.h 8 Feb 2009 10:11:11 -0000 1.69 *************** *** 203,207 **** // Py3k uses memoryview object in place of buffer extern PYWINTYPES_EXPORT PyObject *PyBuffer_New(Py_ssize_t size); - extern PYWINTYPES_EXPORT PyObject *PyBuffer_FromReadWriteMemory(void *buf, Py_ssize_t size); extern PYWINTYPES_EXPORT PyObject *PyBuffer_FromMemory(void *buf, Py_ssize_t size); #endif --- 203,206 ---- Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** win32file.i 2 Feb 2009 15:54:26 -0000 1.103 --- win32file.i 8 Feb 2009 10:11:11 -0000 1.104 *************** *** 348,351 **** --- 348,373 ---- %{ + #if (PY_VERSION_HEX >= 0x03000000) + // theoretically this could be in pywintypes, but this is the only place + // it is called... + static PyObject *PyBuffer_FromReadWriteMemory(void *buf, Py_ssize_t size){ + Py_buffer info={ + buf, + NULL, // obj added in 3.0b3 + size, + FALSE, // readonly + 0, // ndim + NULL, // format + NULL, // shape + NULL, // strides + NULL, // suboffsets + 0, // itemsize + NULL, // internal + }; + return PyMemoryView_FromBuffer(&info); + #endif + } + + // @pyswig str/buffer|DeviceIoControl|Sends a control code to a device or file system driver // @comm Accepts keyword args |
From: Mark H. <mha...@us...> - 2009-02-08 10:09:29
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8444/win32/Lib Modified Files: win32gui_struct.py Log Message: move to PyMakeBuffer, 64bit fixes and DEV_BROADCAST_* fixes Index: win32gui_struct.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32gui_struct.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** win32gui_struct.py 13 Jan 2009 22:57:11 -0000 1.12 --- win32gui_struct.py 8 Feb 2009 10:09:25 -0000 1.13 *************** *** 28,31 **** --- 28,32 ---- # the Unpack* functions, where the aim is user convenience. + import sys import win32gui import win32con *************** *** 58,65 **** return _make_text_buffer("\0" * cch) # Generic WM_NOTIFY unpacking def UnpackWMNOTIFY(lparam): format = "iii" ! buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) hwndFrom, idFrom, code = struct.unpack(format, buf) return hwndFrom, idFrom, code --- 59,79 ---- return _make_text_buffer("\0" * cch) + if sys.version_info < (3,0): + def _make_memory(ob): + return str(buffer(ob)) + + def _make_bytes(sval): + return sval + else: + def _make_memory(ob): + return bytes(memoryview(ob)) + + def _make_bytes(sval): + return sval.encode('ascii') + # Generic WM_NOTIFY unpacking def UnpackWMNOTIFY(lparam): format = "iii" ! buf = win32gui.PyGetMemory(lparam, struct.calcsize(format)) hwndFrom, idFrom, code = struct.unpack(format, buf) return hwndFrom, idFrom, code *************** *** 372,376 **** def UnpackTVNOTIFY(lparam): format = "iiii40s40s" ! buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) hwndFrom, id, code, action, buf_old, buf_new \ = struct.unpack(format, buf) --- 386,390 ---- def UnpackTVNOTIFY(lparam): format = "iiii40s40s" ! buf = win32gui.PyGetMemory(lparam, struct.calcsize(format)) hwndFrom, id, code, action, buf_old, buf_new \ = struct.unpack(format, buf) *************** *** 381,385 **** def UnpackTVDISPINFO(lparam): format = "iii40s" ! buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) hwndFrom, id, code, buf_item = struct.unpack(format, buf) item = UnpackTVITEM(buf_item) --- 395,399 ---- def UnpackTVDISPINFO(lparam): format = "iii40s" ! buf = win32gui.PyGetMemory(lparam, struct.calcsize(format)) hwndFrom, id, code, buf_item = struct.unpack(format, buf) item = UnpackTVITEM(buf_item) *************** *** 446,450 **** def UnpackLVDISPINFO(lparam): format = "iii40s" ! buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) hwndFrom, id, code, buf_item = struct.unpack(format, buf) item = UnpackLVITEM(buf_item) --- 460,464 ---- def UnpackLVDISPINFO(lparam): format = "iii40s" ! buf = win32gui.PyGetMemory(lparam, struct.calcsize(format)) hwndFrom, id, code, buf_item = struct.unpack(format, buf) item = UnpackLVITEM(buf_item) *************** *** 453,457 **** def UnpackLVNOTIFY(lparam): format = "3i8i" ! buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) hwndFrom, id, code, item, subitem, newstate, oldstate, \ changed, pt_x, pt_y, lparam = struct.unpack(format, buf) --- 467,471 ---- def UnpackLVNOTIFY(lparam): format = "3i8i" ! buf = win32gui.PyGetMemory(lparam, struct.calcsize(format)) hwndFrom, id, code, item, subitem, newstate, oldstate, \ changed, pt_x, pt_y, lparam = struct.unpack(format, buf) *************** *** 585,593 **** # Generic function for packing a DEV_BROADCAST_* structure - generally used # by the other PackDEV_BROADCAST_* functions in this module. ! def PackDEV_BROADCAST(devicetype, rest_fmt, rest_data, extra_data=''): # It seems a requirement is 4 byte alignment, even for the 'BYTE data[1]' # field (eg, that would make DEV_BROADCAST_HANDLE 41 bytes, but we must # be 44. ! extra_data += '\0' * (4-len(extra_data)%4) format = "iii" + rest_fmt full_size = struct.calcsize(format) + len(extra_data) --- 599,607 ---- # Generic function for packing a DEV_BROADCAST_* structure - generally used # by the other PackDEV_BROADCAST_* functions in this module. ! def PackDEV_BROADCAST(devicetype, rest_fmt, rest_data, extra_data=_make_bytes('')): # It seems a requirement is 4 byte alignment, even for the 'BYTE data[1]' # field (eg, that would make DEV_BROADCAST_HANDLE 41 bytes, but we must # be 44. ! extra_data += _make_bytes('\0' * (4-len(extra_data)%4)) format = "iii" + rest_fmt full_size = struct.calcsize(format) + len(extra_data) *************** *** 595,607 **** return struct.pack(format, *data) + extra_data ! def PackDEV_BROADCAST_HANDLE(handle, hdevnotify=0, guid="\0"*16, name_offset=0, data="\0"): return PackDEV_BROADCAST(win32con.DBT_DEVTYP_HANDLE, "PP16sl", ! (long(handle), long(hdevnotify), str(buffer(guid)), name_offset), data) def PackDEV_BROADCAST_DEVICEINTERFACE(classguid, name=""): rest_fmt = "16s%ds" % len(name) ! # str(buffer(iid)) hoops necessary to get the raw IID bytes. ! rest_data = (str(buffer(pywintypes.IID(classguid))), name) return PackDEV_BROADCAST(win32con.DBT_DEVTYP_DEVICEINTERFACE, rest_fmt, rest_data) --- 609,636 ---- return struct.pack(format, *data) + extra_data ! def PackDEV_BROADCAST_HANDLE(handle, hdevnotify=0, guid=_make_bytes("\0"*16), name_offset=0, data=_make_bytes("\0")): return PackDEV_BROADCAST(win32con.DBT_DEVTYP_HANDLE, "PP16sl", ! (long(handle), long(hdevnotify), _make_memory(guid), name_offset), data) + def PackDEV_BROADCAST_VOLUME(unitmask, flags): + return PackDEV_BROADCAST(win32con.DBT_DEVTYP_VOLUME, "II", + (unitmask, flags)) + def PackDEV_BROADCAST_DEVICEINTERFACE(classguid, name=""): + if win32gui.UNICODE: + # This really means "is py3k?" - so not accepting bytes is OK + if not isinstance(name, unicode): + raise TypeError("Must provide unicode for the name") + name = name.encode('unicode-internal') + else: + # py2k was passed a unicode object - encode as mbcs. + if isinstance(name, unicode): + name = name.encode('mbcs') + + # 16 bytes for the IID followed by \0 term'd string. rest_fmt = "16s%ds" % len(name) ! # _make_memory(iid) hoops necessary to get the raw IID bytes. ! rest_data = (_make_memory(pywintypes.IID(classguid)), name) return PackDEV_BROADCAST(win32con.DBT_DEVTYP_DEVICEINTERFACE, rest_fmt, rest_data) *************** *** 616,644 **** # Support for unpacking the 'lparam' def UnpackDEV_BROADCAST(lparam): - # guard for 0 here, otherwise PyMakeBuffer will create a new buffer. if lparam == 0: return None ! hdr_size = struct.calcsize("iii") ! hdr_buf = win32gui.PyMakeBuffer(hdr_size, lparam) size, devtype, reserved = struct.unpack("iii", hdr_buf) ! rest = win32gui.PyMakeBuffer(size-hdr_size, lparam+hdr_size) extra = x = {} if devtype == win32con.DBT_DEVTYP_HANDLE: # 2 handles, a GUID, a LONG and possibly an array following... ! fmt = "PP16sl" ! x['handle'], x['hdevnotify'], guid_bytes, x['nameoffset'] = \ ! struct.unpack(fmt, rest[:struct.calcsize(fmt)]) x['eventguid'] = pywintypes.IID(guid_bytes, True) elif devtype == win32con.DBT_DEVTYP_DEVICEINTERFACE: ! # guid, null-terminated name ! x['classguid'] = pywintypes.IID(rest[:16], 1) ! name = rest[16:] ! if '\0' in name: ! name = name.split('\0', 1)[0] ! x['name'] = name elif devtype == win32con.DBT_DEVTYP_VOLUME: # int mask and flags ! x['unitmask'], x['flags'] = struct.unpack("II", rest[:struct.calcsize("II")]) else: raise NotImplementedError("unknown device type %d" % (devtype,)) --- 645,675 ---- # Support for unpacking the 'lparam' def UnpackDEV_BROADCAST(lparam): if lparam == 0: return None ! hdr_format = "iii" ! hdr_size = struct.calcsize(hdr_format) ! hdr_buf = win32gui.PyGetMemory(lparam, hdr_size) size, devtype, reserved = struct.unpack("iii", hdr_buf) ! # Due to x64 alignment issues, we need to use the full format string over ! # the entire buffer. ie, on x64: ! # calcsize('iiiP') != calcsize('iii')+calcsize('P') ! buf = win32gui.PyGetMemory(lparam, size) extra = x = {} if devtype == win32con.DBT_DEVTYP_HANDLE: # 2 handles, a GUID, a LONG and possibly an array following... ! fmt = hdr_format + "PP16sl" ! _, _, _, x['handle'], x['hdevnotify'], guid_bytes, x['nameoffset'] = \ ! struct.unpack(fmt, buf[:struct.calcsize(fmt)]) x['eventguid'] = pywintypes.IID(guid_bytes, True) elif devtype == win32con.DBT_DEVTYP_DEVICEINTERFACE: ! fmt = hdr_format + "16s" ! _, _, _, guid_bytes = struct.unpack(fmt, buf[:struct.calcsize(fmt)]) ! x['classguid'] = pywintypes.IID(guid_bytes, True) ! x['name'] = win32gui.PyGetString(lparam + struct.calcsize(fmt)) elif devtype == win32con.DBT_DEVTYP_VOLUME: # int mask and flags ! fmt = hdr_format + "II" ! _, _, _, x['unitmask'], x['flags'] = struct.unpack(fmt, buf[:struct.calcsize(fmt)]) else: raise NotImplementedError("unknown device type %d" % (devtype,)) |
From: Mark H. <mha...@us...> - 2009-02-08 10:04:50
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5144/win32/Demos Modified Files: win32gui_menu.py Log Message: py3k fixes; use PyGetMemory instead of PyGetString Index: win32gui_menu.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_menu.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** win32gui_menu.py 4 Dec 2008 07:21:50 -0000 1.11 --- win32gui_menu.py 8 Feb 2009 10:04:45 -0000 1.12 *************** *** 299,303 **** ## lparam is a DRAWITEMSTRUCT fmt = "5i2P4iP" ! data = struct.unpack(fmt, PyGetString(lparam, struct.calcsize(fmt))) ctlType, ctlID, itemID, itemAction, itemState, hwndItem, \ hDC, left, top, right, bot, itemData = data --- 299,303 ---- ## lparam is a DRAWITEMSTRUCT fmt = "5i2P4iP" ! data = struct.unpack(fmt, PyGetMemory(lparam, struct.calcsize(fmt))) ctlType, ctlID, itemID, itemAction, itemState, hwndItem, \ hDC, left, top, right, bot, itemData = data |
From: Mark H. <mha...@us...> - 2009-02-08 09:59:24
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv827/win32/test Modified Files: test_win32gui.py Log Message: tests for PyGetMemory() Index: test_win32gui.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32gui.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_win32gui.py 11 Dec 2008 00:25:40 -0000 1.1 --- test_win32gui.py 8 Feb 2009 09:59:19 -0000 1.2 *************** *** 2,7 **** import unittest import win32gui ! class TestMisc(unittest.TestCase): def test_get_string(self): # test invalid addresses cause a ValueError rather than crash! --- 2,19 ---- import unittest import win32gui + import pywin32_testutil + import operator + import array ! # theoretically should be in pywin32_testutil, but this is the only place ! # that currently needs such a function... ! def ob2bytes(ob): ! if sys.version_info < (3,0): ! return str(buffer(ob)) ! # py3k. ! return bytes(ob) ! ! ! class TestPyGetString(unittest.TestCase): def test_get_string(self): # test invalid addresses cause a ValueError rather than crash! *************** *** 10,13 **** --- 22,65 ---- self.assertRaises(ValueError, win32gui.PyGetString, 1,1) + class TestPyGetMemory(unittest.TestCase): + def test_ob(self): + # Check the PyGetMemory result and a bytes string can be compared + test_data = pywin32_testutil.str2bytes("\0\1\2\3\4\5\6") + c = array.array("b", test_data) + addr, buflen = c.buffer_info() + got = win32gui.PyGetMemory(addr, buflen) + self.failUnlessEqual(len(got), len(test_data)) + self.failUnlessEqual(ob2bytes(got), test_data) + + def test_memory_index(self): + # Check we can index into the buffer object returned by PyGetMemory + test_data = pywin32_testutil.str2bytes("\0\1\2\3\4\5\6") + c = array.array("b", test_data) + addr, buflen = c.buffer_info() + got = win32gui.PyGetMemory(addr, buflen) + self.failUnlessEqual(got[0], pywin32_testutil.str2bytes('\0')) + + def test_real_view(self): + # Do the PyGetMemory, then change the original memory, then ensure + # the initial object we fetched sees the new value. + test_data = pywin32_testutil.str2bytes("\0\1\2\3\4\5\6") + c = array.array("b", test_data) + addr, buflen = c.buffer_info() + got = win32gui.PyGetMemory(addr, buflen) + self.failUnlessEqual(got[0], pywin32_testutil.str2bytes('\0')) + new = pywin32_testutil.str2bytes('\1') + c[0] = 1 + self.failUnlessEqual(got[0], new) + + def test_memory_not_writable(self): + # Check the buffer object fetched by PyGetMemory isn't writable. + test_data = pywin32_testutil.str2bytes("\0\1\2\3\4\5\6") + c = array.array("b", test_data) + addr, buflen = c.buffer_info() + got = win32gui.PyGetMemory(addr, buflen) + new = pywin32_testutil.str2bytes('\1') + self.failUnlessRaises(TypeError, operator.setitem, got, 0, new) + + if __name__=='__main__': unittest.main() |
From: Mark H. <mha...@us...> - 2009-02-08 09:58:54
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32760/win32/src Modified Files: win32gui.i Log Message: deprecate PyMakeBuffer, replaced with PyGetMemory Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -d -r1.125 -r1.126 *** win32gui.i 3 Feb 2009 03:23:07 -0000 1.125 --- win32gui.i 8 Feb 2009 09:58:49 -0000 1.126 *************** *** 1558,1564 **** %{ ! // @pyswig object|PyMakeBuffer|Returns a buffer object from addr,len or just len static PyObject *PyMakeBuffer(PyObject *self, PyObject *args) { size_t len; void *addr=NULL; --- 1558,1568 ---- %{ ! // NOTE: PyMakeBuffer() is a dumb name for lots of reasons, including that ! // it implies the memory is "new" and "owned" by the caller. The "natural" ! // order of the params is wrong too. So it's deprecated! ! static PyObject *PyMakeBuffer(PyObject *self, PyObject *args) { + PyErr_Warn(PyExc_PendingDeprecationWarning, "PyMakeBuffer is deprecated; use PyGetMemory instead"); size_t len; void *addr=NULL; *************** *** 1568,1577 **** static char *input_fmt="l|l:PyMakeBuffer"; #endif - // @pyparm int|len||length of the buffer object - // @pyparm int|addr||Address of the memory to reference. If zero or not - // specified, a new buffer object is created with the specified size. - // @todo We should consider deprecating and dropping the behaviour when - // the address is zero - it leads to unexpected bugs, as passing NULL - // appears to return a reference to what was valid memory. if (!PyArg_ParseTuple(args, input_fmt, &len,&addr)) return NULL; --- 1572,1575 ---- *************** *** 1582,1586 **** if (IsBadReadPtr(addr, len)) { PyErr_SetString(PyExc_ValueError, ! "The value is not a valid address for reading"); return NULL; } --- 1580,1584 ---- if (IsBadReadPtr(addr, len)) { PyErr_SetString(PyExc_ValueError, ! "The value is not a valid address for reading"); return NULL; } *************** *** 1592,1595 **** --- 1590,1619 ---- %{ + // @pyswig object|PyGetMemory|Returns a buffer object from and address and length + static PyObject *PyGetMemory(PyObject *self, PyObject *args) + { + void *addr; + size_t len; + #ifdef _WIN64 + static char *input_fmt="LL:PyGetMemory"; + #else + static char *input_fmt="ll:PyGetMemory"; + #endif + // @pyparm int|addr||Address of the memory to reference. + // @pyparm int|len||Number of bytes to return. + // @comm If zero is passed a ValueError will be raised. + if (!PyArg_ParseTuple(args, input_fmt, &addr, &len)) + return NULL; + if (IsBadReadPtr(addr, len)) { + PyErr_SetString(PyExc_ValueError, + "The value is not a valid address for reading"); + return NULL; + } + return PyBuffer_FromMemory(addr, len); + } + %} + %native (PyGetMemory) PyGetMemory; + + %{ // @pyswig string|PyGetString|Returns a string from an address. // @rdesc If win32gui.UNICODE is True, this will return a unicode object. |
From: Mark H. <mha...@us...> - 2009-02-08 09:57:15
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31531/win32/src Modified Files: PyWinObjects.h Log Message: PyDEVMODE/A/W changes Index: PyWinObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinObjects.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** PyWinObjects.h 4 Feb 2009 04:07:54 -0000 1.20 --- PyWinObjects.h 8 Feb 2009 09:57:09 -0000 1.21 *************** *** 176,180 **** #endif /* __PYWINTYPES_H__ */ ! class PYWINTYPES_EXPORT PyDEVMODE : public PyObject { public: --- 176,180 ---- #endif /* __PYWINTYPES_H__ */ ! class PYWINTYPES_EXPORT PyDEVMODEA : public PyObject { public: *************** *** 191,197 **** static void deallocFunc(PyObject *ob); ! PyDEVMODE(PDEVMODE); ! PyDEVMODE(void); ! PyDEVMODE(USHORT); static PyObject *Clear(PyObject *self, PyObject *args); static PyObject *tp_new(PyTypeObject *, PyObject *, PyObject *); --- 191,197 ---- static void deallocFunc(PyObject *ob); ! PyDEVMODEA(PDEVMODEA); ! PyDEVMODEA(void); ! PyDEVMODEA(USHORT); static PyObject *Clear(PyObject *self, PyObject *args); static PyObject *tp_new(PyTypeObject *, PyObject *, PyObject *); *************** *** 199,209 **** void modify_in_place(void) {memcpy(&devmode, pdevmode, pdevmode->dmSize);} ! PDEVMODE GetDEVMODE(void); protected: // Pointer to variable length DEVMODE with dmDriverExtra bytes allocated at end, always use this externally ! PDEVMODE pdevmode; // copy of fixed portion of DEVMODE for structmember api to access ! DEVMODE devmode; ! ~PyDEVMODE(); }; --- 199,209 ---- void modify_in_place(void) {memcpy(&devmode, pdevmode, pdevmode->dmSize);} ! PDEVMODEA GetDEVMODE(void); protected: // Pointer to variable length DEVMODE with dmDriverExtra bytes allocated at end, always use this externally ! PDEVMODEA pdevmode; // copy of fixed portion of DEVMODE for structmember api to access ! DEVMODEA devmode; ! ~PyDEVMODEA(); }; *************** *** 240,241 **** --- 240,247 ---- ~PyDEVMODEW(); }; + + #ifdef UNICODE + #define PyDEVMODE PyDEVMODEW + #else + #define PyDEVMODE PyDEVMODEA + #endif |
From: Mark H. <mha...@us...> - 2009-02-08 09:56:29
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30800/win32/Lib Modified Files: win32timezone.py Log Message: remove use of cmp; it's been removed in py3k Index: win32timezone.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32timezone.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** win32timezone.py 7 Feb 2009 01:12:07 -0000 1.26 --- win32timezone.py 8 Feb 2009 09:56:21 -0000 1.27 *************** *** 731,737 **** # the following code implements a RangeMap and its support classes ! ascending = cmp def descending(a, b): ! return -ascending(a, b) class RangeMap(dict): --- 731,737 ---- # the following code implements a RangeMap and its support classes ! ascending = lambda a, b: b < a def descending(a, b): ! return not ascending(a, b) class RangeMap(dict): |
From: Mark H. <mha...@us...> - 2009-02-08 09:53:45
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28877/win32/Demos Modified Files: win32rcparser_demo.py Log Message: use int division Index: win32rcparser_demo.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32rcparser_demo.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** win32rcparser_demo.py 4 Dec 2008 03:36:52 -0000 1.4 --- win32rcparser_demo.py 8 Feb 2009 09:53:40 -0000 1.5 *************** *** 46,51 **** l,t,r,b = win32gui.GetWindowRect(self.hwnd) dt_l, dt_t, dt_r, dt_b = win32gui.GetWindowRect(desktop) ! centre_x, centre_y = win32gui.ClientToScreen( desktop, ( (dt_r-dt_l)/2, (dt_b-dt_t)/2) ) ! win32gui.MoveWindow(hwnd, centre_x-(r/2), centre_y-(b/2), r-l, b-t, 0) def OnCommand(self, hwnd, msg, wparam, lparam): --- 46,51 ---- l,t,r,b = win32gui.GetWindowRect(self.hwnd) dt_l, dt_t, dt_r, dt_b = win32gui.GetWindowRect(desktop) ! centre_x, centre_y = win32gui.ClientToScreen( desktop, ( (dt_r-dt_l)//2, (dt_b-dt_t)//2) ) ! win32gui.MoveWindow(hwnd, centre_x-(r//2), centre_y-(b//2), r-l, b-t, 0) def OnCommand(self, hwnd, msg, wparam, lparam): |
From: Mark H. <mha...@us...> - 2009-02-08 09:53:20
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28674/win32/Demos Modified Files: win32gui_devicenotify.py Log Message: print str() of our object as it is friendlier for debugging etc Index: win32gui_devicenotify.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_devicenotify.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32gui_devicenotify.py 4 May 2008 10:45:54 -0000 1.1 --- win32gui_devicenotify.py 8 Feb 2009 09:53:17 -0000 1.2 *************** *** 15,19 **** # using the self-identifying data inside the DEV_BROADCAST_HDR. info = win32gui_struct.UnpackDEV_BROADCAST(lp) ! print "Device change notification:", wp, info if wp==win32con.DBT_DEVICEQUERYREMOVE and info.devicetype==win32con.DBT_DEVTYP_HANDLE: # Our handle is stored away in the structure - just close it --- 15,19 ---- # using the self-identifying data inside the DEV_BROADCAST_HDR. info = win32gui_struct.UnpackDEV_BROADCAST(lp) ! print "Device change notification:", wp, str(info) if wp==win32con.DBT_DEVICEQUERYREMOVE and info.devicetype==win32con.DBT_DEVTYP_HANDLE: # Our handle is stored away in the structure - just close it |
From: Mark H. <mha...@us...> - 2009-02-08 09:52:47
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28379/win32/Demos Modified Files: win32console_demo.py Log Message: move to exception attributes Index: win32console_demo.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32console_demo.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32console_demo.py 22 Sep 2005 02:21:44 -0000 1.1 --- win32console_demo.py 8 Feb 2009 09:52:43 -0000 1.2 *************** *** 10,15 **** try: win32console.AllocConsole() ! except win32console.error, err_tuple: ! if err_tuple[0]!=5: raise ## only free console if one was created successfully --- 10,15 ---- try: win32console.AllocConsole() ! except win32console.error, exc: ! if exc.winerror!=5: raise ## only free console if one was created successfully |
From: Mark H. <mha...@us...> - 2009-02-08 05:20:08
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21775 Modified Files: PyDEVMODE.cpp PyWinTypes.h PyWinTypesmodule.cpp Log Message: PyDEVMODE renamed to PyDEVMODEA and PyDEVMODE becomes either the W or A version depending if UNICODE is defined. Also remove redundant PyType_Ready calls; our ADD_TYPE macro also does this. Index: PyDEVMODE.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyDEVMODE.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PyDEVMODE.cpp 19 Dec 2008 05:24:35 -0000 1.9 --- PyDEVMODE.cpp 8 Feb 2009 05:20:02 -0000 1.10 *************** *** 10,20 **** // @object PyDEVMODE|Python object wrapping a DEVMODE structure ! struct PyMethodDef PyDEVMODE::methods[] = { ! {"Clear", PyDEVMODE::Clear, 1}, // @pymeth Clear|Resets all members of the structure {NULL} }; ! #define OFF(e) offsetof(PyDEVMODE, e) ! struct PyMemberDef PyDEVMODE::members[] = { // @prop int|SpecVersion|Should always be set to DM_SPECVERSION {"SpecVersion", T_USHORT, OFF(devmode.dmSpecVersion), 0, "Should always be set to DM_SPECVERSION"}, --- 10,20 ---- // @object PyDEVMODE|Python object wrapping a DEVMODE structure ! struct PyMethodDef PyDEVMODEA::methods[] = { ! {"Clear", PyDEVMODEA::Clear, 1}, // @pymeth Clear|Resets all members of the structure {NULL} }; ! #define OFF(e) offsetof(PyDEVMODEA, e) ! struct PyMemberDef PyDEVMODEA::members[] = { // @prop int|SpecVersion|Should always be set to DM_SPECVERSION {"SpecVersion", T_USHORT, OFF(devmode.dmSpecVersion), 0, "Should always be set to DM_SPECVERSION"}, *************** *** 106,112 **** // @prop str|DeviceName|String of at most 32 chars ! PyObject *PyDEVMODE::get_DeviceName(PyObject *self, void *unused) { ! PDEVMODE pdevmode=((PyDEVMODE *)self)->pdevmode; if (pdevmode->dmDeviceName[CCHDEVICENAME-1]==0) // in case DeviceName fills space and has no trailing NULL return PyString_FromString((char *)&pdevmode->dmDeviceName); --- 106,112 ---- // @prop str|DeviceName|String of at most 32 chars ! PyObject *PyDEVMODEA::get_DeviceName(PyObject *self, void *unused) { ! PDEVMODEA pdevmode=((PyDEVMODEA *)self)->pdevmode; if (pdevmode->dmDeviceName[CCHDEVICENAME-1]==0) // in case DeviceName fills space and has no trailing NULL return PyString_FromString((char *)&pdevmode->dmDeviceName); *************** *** 115,119 **** } ! int PyDEVMODE::set_DeviceName(PyObject *self, PyObject *v, void *unused) { if(v==NULL){ --- 115,119 ---- } ! int PyDEVMODEA::set_DeviceName(PyObject *self, PyObject *v, void *unused) { if(v==NULL){ *************** *** 129,144 **** return -1; } ! PDEVMODE pdevmode=&((PyDEVMODE *)self)->devmode; ZeroMemory(&pdevmode->dmDeviceName, CCHDEVICENAME); memcpy(&pdevmode->dmDeviceName, value, valuelen); // update variable length DEVMODE with same value ! memcpy(((PyDEVMODE *)self)->pdevmode, pdevmode, pdevmode->dmSize); return 0; } // @prop str|FormName|Name of form as returned by <om win32print.EnumForms>, at most 32 chars ! PyObject *PyDEVMODE::get_FormName(PyObject *self, void *unused) { ! PDEVMODE pdevmode=((PyDEVMODE *)self)->pdevmode; if (pdevmode->dmFormName[CCHFORMNAME-1]==0) // If dmFormName occupies whole 32 chars, trailing NULL not present return PyString_FromString((char *)&pdevmode->dmFormName); --- 129,144 ---- return -1; } ! PDEVMODEA pdevmode=&((PyDEVMODEA *)self)->devmode; ZeroMemory(&pdevmode->dmDeviceName, CCHDEVICENAME); memcpy(&pdevmode->dmDeviceName, value, valuelen); // update variable length DEVMODE with same value ! memcpy(((PyDEVMODEA *)self)->pdevmode, pdevmode, pdevmode->dmSize); return 0; } // @prop str|FormName|Name of form as returned by <om win32print.EnumForms>, at most 32 chars ! PyObject *PyDEVMODEA::get_FormName(PyObject *self, void *unused) { ! PDEVMODEA pdevmode=((PyDEVMODEA *)self)->pdevmode; if (pdevmode->dmFormName[CCHFORMNAME-1]==0) // If dmFormName occupies whole 32 chars, trailing NULL not present return PyString_FromString((char *)&pdevmode->dmFormName); *************** *** 148,152 **** } ! int PyDEVMODE::set_FormName(PyObject *self, PyObject *v, void *unused) { if(v==NULL){ --- 148,152 ---- } ! int PyDEVMODEA::set_FormName(PyObject *self, PyObject *v, void *unused) { if(v==NULL){ *************** *** 162,177 **** return -1; } ! PDEVMODE pdevmode=&((PyDEVMODE *)self)->devmode; ZeroMemory(&pdevmode->dmFormName, CCHFORMNAME); memcpy(&pdevmode->dmFormName, value, valuelen); // update variable length PDEVMODE with same value ! memcpy(((PyDEVMODE *)self)->pdevmode, pdevmode, pdevmode->dmSize); return 0; } // @prop str|DriverData|Driver data appended to end of structure ! PyObject *PyDEVMODE::get_DriverData(PyObject *self, void *unused) { ! PDEVMODE pdevmode=((PyDEVMODE *)self)->pdevmode; if (pdevmode->dmDriverExtra==0){ // No extra space allocated Py_INCREF(Py_None); --- 162,177 ---- return -1; } ! PDEVMODEA pdevmode=&((PyDEVMODEA *)self)->devmode; ZeroMemory(&pdevmode->dmFormName, CCHFORMNAME); memcpy(&pdevmode->dmFormName, value, valuelen); // update variable length PDEVMODE with same value ! memcpy(((PyDEVMODEA *)self)->pdevmode, pdevmode, pdevmode->dmSize); return 0; } // @prop str|DriverData|Driver data appended to end of structure ! PyObject *PyDEVMODEA::get_DriverData(PyObject *self, void *unused) { ! PDEVMODEA pdevmode=((PyDEVMODEA *)self)->pdevmode; if (pdevmode->dmDriverExtra==0){ // No extra space allocated Py_INCREF(Py_None); *************** *** 181,185 **** } ! int PyDEVMODE::set_DriverData(PyObject *self, PyObject *v, void *unused) { if(v==NULL){ --- 181,185 ---- } ! int PyDEVMODEA::set_DriverData(PyObject *self, PyObject *v, void *unused) { if(v==NULL){ *************** *** 191,195 **** if (PyString_AsStringAndSize(v, &value, &valuelen)==-1) return -1; ! PDEVMODE pdevmode=((PyDEVMODE *)self)->pdevmode; if (valuelen > pdevmode->dmDriverExtra){ PyErr_Format(PyExc_ValueError,"Length of DriverData cannot be longer that DriverExtra (%d bytes)", pdevmode->dmDriverExtra); --- 191,195 ---- if (PyString_AsStringAndSize(v, &value, &valuelen)==-1) return -1; ! PDEVMODEA pdevmode=((PyDEVMODEA *)self)->pdevmode; if (valuelen > pdevmode->dmDriverExtra){ PyErr_Format(PyExc_ValueError,"Length of DriverData cannot be longer that DriverExtra (%d bytes)", pdevmode->dmDriverExtra); *************** *** 203,212 **** } ! PyGetSetDef PyDEVMODE::getset[] = { ! {"DeviceName", PyDEVMODE::get_DeviceName, PyDEVMODE::set_DeviceName, "String of at most 32 chars"}, ! {"FormName", PyDEVMODE::get_FormName, PyDEVMODE::set_FormName, "Name of form as returned by EnumForms, at most 32 chars"}, ! {"DriverData", PyDEVMODE::get_DriverData, PyDEVMODE::set_DriverData, "Driver data appended to end of structure"}, {NULL} --- 203,212 ---- } ! PyGetSetDef PyDEVMODEA::getset[] = { ! {"DeviceName", PyDEVMODEA::get_DeviceName, PyDEVMODEA::set_DeviceName, "String of at most 32 chars"}, ! {"FormName", PyDEVMODEA::get_FormName, PyDEVMODEA::set_FormName, "Name of form as returned by EnumForms, at most 32 chars"}, ! {"DriverData", PyDEVMODEA::get_DriverData, PyDEVMODEA::set_DriverData, "Driver data appended to end of structure"}, {NULL} *************** *** 214,224 **** ! PYWINTYPES_EXPORT PyTypeObject PyDEVMODEType = { PYWIN_OBJECT_HEAD ! "PyDEVMODE", ! sizeof(PyDEVMODE), 0, ! PyDEVMODE::deallocFunc, 0, // tp_print; 0, // tp_getattr --- 214,224 ---- ! PYWINTYPES_EXPORT PyTypeObject PyDEVMODEAType = { PYWIN_OBJECT_HEAD ! "PyDEVMODEA", ! sizeof(PyDEVMODEA), 0, ! PyDEVMODEA::deallocFunc, 0, // tp_print; 0, // tp_getattr *************** *** 243,249 **** 0, // tp_iter 0, // iternextfunc tp_iternext ! PyDEVMODE::methods, ! PyDEVMODE::members, ! PyDEVMODE::getset, // tp_getset; 0, // tp_base; 0, // tp_dict; --- 243,249 ---- 0, // tp_iter 0, // iternextfunc tp_iternext ! PyDEVMODEA::methods, ! PyDEVMODEA::members, ! PyDEVMODEA::getset, // tp_getset; 0, // tp_base; 0, // tp_dict; *************** *** 253,266 **** 0, // tp_init; 0, // tp_alloc; ! PyDEVMODE::tp_new // newfunc tp_new; }; ! PyDEVMODE::PyDEVMODE(PDEVMODE pdm) { ! ob_type = &PyDEVMODEType; memcpy(&devmode, pdm, pdm->dmSize); ! pdevmode=(PDEVMODE)malloc(pdm->dmSize + pdm->dmDriverExtra); if (pdevmode==NULL) ! PyErr_Format(PyExc_MemoryError, "PyDEVMODE::PyDEVMODE - Unable to allocate DEVMODE of size %d", pdm->dmSize + pdm->dmDriverExtra); else --- 253,266 ---- 0, // tp_init; 0, // tp_alloc; ! PyDEVMODEA::tp_new // newfunc tp_new; }; ! PyDEVMODEA::PyDEVMODEA(PDEVMODEA pdm) { ! ob_type = &PyDEVMODEAType; memcpy(&devmode, pdm, pdm->dmSize); ! pdevmode=(PDEVMODEA)malloc(pdm->dmSize + pdm->dmDriverExtra); if (pdevmode==NULL) ! PyErr_Format(PyExc_MemoryError, "PyDEVMODEA::PyDEVMODE - Unable to allocate DEVMODE of size %d", pdm->dmSize + pdm->dmDriverExtra); else *************** *** 269,277 **** } ! PyDEVMODE::PyDEVMODE(void) { ! ob_type = &PyDEVMODEType; ! static WORD dmSize=sizeof(DEVMODE); ! pdevmode=(PDEVMODE)malloc(dmSize); ZeroMemory(pdevmode,dmSize); pdevmode->dmSize=dmSize; --- 269,277 ---- } ! PyDEVMODEA::PyDEVMODEA(void) { ! ob_type = &PyDEVMODEAType; ! static WORD dmSize=sizeof(DEVMODEA); ! pdevmode=(PDEVMODEA)malloc(dmSize); ZeroMemory(pdevmode,dmSize); pdevmode->dmSize=dmSize; *************** *** 283,291 **** } ! PyDEVMODE::PyDEVMODE(USHORT dmDriverExtra) { ! ob_type = &PyDEVMODEType; ! static WORD dmSize=sizeof(DEVMODE); ! pdevmode=(PDEVMODE)malloc(dmSize+dmDriverExtra); ZeroMemory(pdevmode,dmSize+dmDriverExtra); pdevmode->dmSize=dmSize; --- 283,291 ---- } ! PyDEVMODEA::PyDEVMODEA(USHORT dmDriverExtra) { ! ob_type = &PyDEVMODEAType; ! static WORD dmSize=sizeof(DEVMODEA); ! pdevmode=(PDEVMODEA)malloc(dmSize+dmDriverExtra); ZeroMemory(pdevmode,dmSize+dmDriverExtra); pdevmode->dmSize=dmSize; *************** *** 299,303 **** } ! PyDEVMODE::~PyDEVMODE() { if (pdevmode!=NULL) --- 299,303 ---- } ! PyDEVMODEA::~PyDEVMODEA() { if (pdevmode!=NULL) *************** *** 307,311 **** BOOL PyDEVMODE_Check(PyObject *ob) { ! if (ob->ob_type!=&PyDEVMODEType){ PyErr_SetString(PyExc_TypeError,"Object must be a PyDEVMODE"); return FALSE; --- 307,311 ---- BOOL PyDEVMODE_Check(PyObject *ob) { ! if (ob->ob_type!=&PyDEVMODEAType){ PyErr_SetString(PyExc_TypeError,"Object must be a PyDEVMODE"); return FALSE; *************** *** 314,323 **** } ! void PyDEVMODE::deallocFunc(PyObject *ob) { ! delete (PyDEVMODE *)ob; } ! PDEVMODE PyDEVMODE::GetDEVMODE(void) { return pdevmode; --- 314,323 ---- } ! void PyDEVMODEA::deallocFunc(PyObject *ob) { ! delete (PyDEVMODEA *)ob; } ! PDEVMODEA PyDEVMODEA::GetDEVMODE(void) { return pdevmode; *************** *** 325,331 **** // @pymethod |PyDEVMODE|Clear|Resets all members of the structure ! PyObject *PyDEVMODE::Clear(PyObject *self, PyObject *args) { ! PDEVMODE pdevmode=((PyDEVMODE *)self)->pdevmode; USHORT dmDriverExtra=pdevmode->dmDriverExtra; WORD dmSize=pdevmode->dmSize; --- 325,331 ---- // @pymethod |PyDEVMODE|Clear|Resets all members of the structure ! PyObject *PyDEVMODEA::Clear(PyObject *self, PyObject *args) { ! PDEVMODEA pdevmode=((PyDEVMODEA *)self)->pdevmode; USHORT dmDriverExtra=pdevmode->dmDriverExtra; WORD dmSize=pdevmode->dmSize; *************** *** 336,340 **** pdevmode->dmSpecVersion=DM_SPECVERSION; ! pdevmode=&((PyDEVMODE *)self)->devmode; ZeroMemory(pdevmode, dmSize); pdevmode->dmDriverExtra=dmDriverExtra; --- 336,340 ---- pdevmode->dmSpecVersion=DM_SPECVERSION; ! pdevmode=&((PyDEVMODEA *)self)->devmode; ZeroMemory(pdevmode, dmSize); pdevmode->dmDriverExtra=dmDriverExtra; *************** *** 345,349 **** } ! PyObject *PyDEVMODE::tp_new(PyTypeObject *typ, PyObject *args, PyObject *kwargs) { USHORT DriverExtra=0; --- 345,349 ---- } ! PyObject *PyDEVMODEA::tp_new(PyTypeObject *typ, PyObject *args, PyObject *kwargs) { USHORT DriverExtra=0; *************** *** 351,355 **** if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|H", keywords, &DriverExtra)) return NULL; ! return new PyDEVMODE(DriverExtra); } --- 351,355 ---- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|H", keywords, &DriverExtra)) return NULL; ! return new PyDEVMODEA(DriverExtra); } *************** *** 370,381 **** if (!PyDEVMODE_Check(ob)) return FALSE; ! *ppDEVMODE=((PyDEVMODE *)ob)->GetDEVMODE(); return TRUE; } ! PyObject *PyWinObject_FromDEVMODE(PDEVMODE pDEVMODE) { static WORD dmSize=sizeof(DEVMODE); ! if (pDEVMODE==NULL){ Py_INCREF(Py_None); return Py_None; --- 370,381 ---- if (!PyDEVMODE_Check(ob)) return FALSE; ! *ppDEVMODE=((PyDEVMODEA *)ob)->GetDEVMODE(); return TRUE; } ! PyObject *PyWinObject_FromDEVMODE(PDEVMODEA pdevmode) { static WORD dmSize=sizeof(DEVMODE); ! if (pdevmode==NULL){ Py_INCREF(Py_None); return Py_None; *************** *** 383,393 **** // make sure we can't overflow the fixed size DEVMODE in PyDEVMODE ! if (pDEVMODE->dmSize>dmSize){ ! PyErr_Format(PyExc_WindowsError,"DEVMODE structure of size %d greater than supported size of %d", pDEVMODE->dmSize, dmSize); return NULL; } ! PyObject *ret=new PyDEVMODE(pDEVMODE); // check that variable sized pdevmode is allocated ! if (((PyDEVMODE *)ret)->GetDEVMODE()==NULL){ Py_DECREF(ret); ret=NULL; --- 383,393 ---- // make sure we can't overflow the fixed size DEVMODE in PyDEVMODE ! if (pdevmode->dmSize>dmSize){ ! PyErr_Format(PyExc_WindowsError,"DEVMODE structure of size %d greater than supported size of %d", pdevmode->dmSize, dmSize); return NULL; } ! PyObject *ret=new PyDEVMODEA(pdevmode); // check that variable sized pdevmode is allocated ! if (((PyDEVMODEA *)ret)->GetDEVMODE()==NULL){ Py_DECREF(ret); ret=NULL; *************** *** 656,660 **** pdevmode=(PDEVMODEW)malloc(pdm->dmSize + pdm->dmDriverExtra); if (pdevmode==NULL) ! PyErr_Format(PyExc_MemoryError, "PyDEVMODE::PyDEVMODE - Unable to allocate DEVMODE of size %d", pdm->dmSize + pdm->dmDriverExtra); else --- 656,660 ---- pdevmode=(PDEVMODEW)malloc(pdm->dmSize + pdm->dmDriverExtra); if (pdevmode==NULL) ! PyErr_Format(PyExc_MemoryError, "PyDEVMODEA::PyDEVMODE - Unable to allocate DEVMODE of size %d", pdm->dmSize + pdm->dmDriverExtra); else Index: PyWinTypesmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypesmodule.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** PyWinTypesmodule.cpp 3 Feb 2009 05:16:44 -0000 1.50 --- PyWinTypesmodule.cpp 8 Feb 2009 05:20:02 -0000 1.51 *************** *** 933,962 **** // @tupleitem 3|None/int|argerror|The index of the argument in error, or (usually) None or -1 } - - /* PyType_Ready needs to be called anytime pywintypesxx.dll is loaded, since - other extension modules can use types defined here without pywintypes itself - having been imported. - ??? All extension modules that call this need to be changed to check the exit code ??? - */ - if (PyType_Ready(&PyHANDLEType) == -1 - ||PyType_Ready(&PyOVERLAPPEDType) == -1 - ||PyType_Ready(&PyDEVMODEType) == -1 - ||PyType_Ready(&PyDEVMODEWType) == -1 - ||PyType_Ready(&PyWAVEFORMATEXType) == -1 - #ifndef NO_PYWINTYPES_TIME - ||PyType_Ready(&PyTimeType) == -1 - #endif // NO_PYWINTYPES_TIME - #ifndef NO_PYWINTYPES_IID - ||PyType_Ready(&PyIIDType) == -1 - #endif // NO_PYWINTYPES_IID - #ifndef NO_PYWINTYPES_SECURITY - ||PyType_Ready(&PySECURITY_DESCRIPTORType) == -1 - ||PyType_Ready(&PySECURITY_ATTRIBUTESType) == -1 - ||PyType_Ready(&PySIDType) == -1 - ||PyType_Ready(&PyACLType) == -1 - #endif - ) - return -1; - if (!_PyWinDateTime_Init()) return -1; --- 933,936 ---- *************** *** 1038,1043 **** ADD_TYPE(HANDLEType); ADD_TYPE(OVERLAPPEDType); ! ADD_TYPE(DEVMODEType); ADD_TYPE(DEVMODEWType); ADD_TYPE(WAVEFORMATEXType); --- 1012,1024 ---- ADD_TYPE(HANDLEType); ADD_TYPE(OVERLAPPEDType); ! ADD_TYPE(DEVMODEAType); ADD_TYPE(DEVMODEWType); + #ifdef UNICODE + if (PyDict_SetItemString(dict, "DEVMODEType", (PyObject *)&PyDEVMODEWType) == -1) + #else + if (PyDict_SetItemString(dict, "DEVMODEType", (PyObject *)&PyDEVMODEAType) == -1) + #endif + PYWIN_MODULE_INIT_RETURN_ERROR; + ADD_TYPE(WAVEFORMATEXType); Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** PyWinTypes.h 3 Feb 2009 04:42:05 -0000 1.67 --- PyWinTypes.h 8 Feb 2009 05:20:02 -0000 1.68 *************** *** 556,560 **** extern PYWINTYPES_EXPORT PyTypeObject PySECURITY_ATTRIBUTESType; #define PySECURITY_ATTRIBUTES_Check(ob) ((ob)->ob_type == &PySECURITY_ATTRIBUTESType) ! extern PYWINTYPES_EXPORT PyTypeObject PyDEVMODEType; extern PYWINTYPES_EXPORT PyTypeObject PyDEVMODEWType; --- 556,560 ---- extern PYWINTYPES_EXPORT PyTypeObject PySECURITY_ATTRIBUTESType; #define PySECURITY_ATTRIBUTES_Check(ob) ((ob)->ob_type == &PySECURITY_ATTRIBUTESType) ! extern PYWINTYPES_EXPORT PyTypeObject PyDEVMODEAType; extern PYWINTYPES_EXPORT PyTypeObject PyDEVMODEWType; |
From: Mark H. <mha...@us...> - 2009-02-08 05:17:01
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21238 Modified Files: win32credmodule.cpp Log Message: zero all elts of array so we don't free invalid memory if an error occurs during the fill. Index: win32credmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32credmodule.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** win32credmodule.cpp 8 Dec 2008 13:16:37 -0000 1.9 --- win32credmodule.cpp 8 Feb 2009 05:16:56 -0000 1.10 *************** *** 101,105 **** ret=FALSE; } ! else for (attr_ind=0; attr_ind<*attr_cnt; attr_ind++){ ret=PyWinObject_AsCREDENTIAL_ATTRIBUTE(PyTuple_GET_ITEM(attr_tuple, attr_ind), &(*attrs)[attr_ind]); --- 101,106 ---- ret=FALSE; } ! else { ! memset(*attrs, 0, *attr_cnt * sizeof(CREDENTIAL_ATTRIBUTE)); for (attr_ind=0; attr_ind<*attr_cnt; attr_ind++){ ret=PyWinObject_AsCREDENTIAL_ATTRIBUTE(PyTuple_GET_ITEM(attr_tuple, attr_ind), &(*attrs)[attr_ind]); *************** *** 108,111 **** --- 109,113 ---- } } + } if (!ret) PyWinObject_FreeCREDENTIAL_ATTRIBUTEArray(attrs, *attr_cnt); |
Update of /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26073/com/win32comext/axdebug/src Modified Files: AXDebug.cpp PyIActiveScriptDebug.cpp PyIActiveScriptDebug.h PyIActiveScriptSiteDebug.cpp PyIActiveScriptSiteDebug.h PyIDebugApplication.cpp PyIDebugApplication.h PyIDebugApplicationThread.cpp PyIDebugApplicationThread.h PyIDebugDocumentHelper.cpp PyIDebugDocumentHelper.h PyIDebugProperties.cpp PyIDebugStackFrameSnifferEx.cpp PyIDebugStackFrameSnifferEx.h PyIEnumDebugApplicationNodes.cpp PyIEnumDebugCodeContexts.cpp PyIEnumDebugExpressionContexts.cpp PyIEnumDebugPropertyInfo.cpp PyIEnumDebugStackFrames.cpp PyIEnumRemoteDebugApplicationThreads.cpp PyIEnumRemoteDebugApplications.cpp PyIProcessDebugManager.h Log Message: Get the axdebug extension building on amd64. With lots of help from Steve Yin via [1727357] new VC8.0 build patch for AMD64 branch (inc axdebug) Index: PyIDebugDocumentHelper.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIDebugDocumentHelper.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIDebugDocumentHelper.h 1 Sep 1999 23:09:04 -0000 1.1 --- PyIDebugDocumentHelper.h 7 Feb 2009 04:28:59 -0000 1.2 *************** *** 77,81 **** --- 77,85 ---- IActiveScript __RPC_FAR * pas, BOOL fScriptlet, + #ifdef _WIN64 + DWORDLONG __RPC_FAR * pdwSourceContext); + #else DWORD __RPC_FAR * pdwSourceContext); + #endif STDMETHOD(SetDefaultTextAttr)( *************** *** 100,104 **** --- 104,112 ---- STDMETHOD(GetScriptBlockInfo)( + #ifdef _WIN64 + DWORDLONG dwSourceContext, + #else DWORD dwSourceContext, + #endif IActiveScript __RPC_FAR *__RPC_FAR * ppasd, ULONG __RPC_FAR * piCharPos, Index: PyIEnumDebugStackFrames.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIEnumDebugStackFrames.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIEnumDebugStackFrames.cpp 19 Nov 1999 04:14:44 -0000 1.2 --- PyIEnumDebugStackFrames.cpp 7 Feb 2009 04:28:59 -0000 1.3 *************** *** 177,180 **** --- 177,181 ---- PY_GATEWAY_METHOD; PyObject *result; + Py_ssize_t len; HRESULT hr = InvokeViaPolicy("Next", &result, "i", celt); if ( FAILED(hr) ) *************** *** 183,197 **** if ( !PySequence_Check(result) ) goto error; - int len; len = PyObject_Length(result); if ( len == -1 ) goto error; ! if ( len > (int)celt) len = celt; if ( pCeltFetched ) ! *pCeltFetched = len; ! int i; for ( i = 0; i < len; ++i ) { --- 184,197 ---- if ( !PySequence_Check(result) ) goto error; len = PyObject_Length(result); if ( len == -1 ) goto error; ! if ( len > (Py_ssize_t)celt) len = celt; if ( pCeltFetched ) ! *pCeltFetched = PyWin_SAFE_DOWNCAST(len, Py_ssize_t, ULONG); ! Py_ssize_t i; for ( i = 0; i < len; ++i ) { *************** *** 222,226 **** Py_DECREF(result); ! return len < (int)celt ? S_FALSE : S_OK; error: --- 222,226 ---- Py_DECREF(result); ! return len < (Py_ssize_t)celt ? S_FALSE : S_OK; error: Index: PyIDebugStackFrameSnifferEx.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIDebugStackFrameSnifferEx.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIDebugStackFrameSnifferEx.cpp 1 Sep 1999 23:09:04 -0000 1.1 --- PyIDebugStackFrameSnifferEx.cpp 7 Feb 2009 04:28:59 -0000 1.2 *************** *** 32,36 **** --- 32,40 ---- if ( pIDSFS == NULL ) return NULL; + #ifdef _WIN64 + IEnumDebugStackFrames64 *ppedsf; + #else IEnumDebugStackFrames *ppedsf; + #endif DWORD spMin; if ( !PyArg_ParseTuple(args, "l:EnumStackFramesEx", &spMin) ) *************** *** 65,71 **** --- 69,81 ---- // Gateway Implementation + #ifdef _WIN64 + STDMETHODIMP PyGDebugStackFrameSnifferEx::EnumStackFramesEx64( + /* [in] */ DWORDLONG dwSpMin, + /* [out] */ IEnumDebugStackFrames64 __RPC_FAR *__RPC_FAR * ppedsf) + #else STDMETHODIMP PyGDebugStackFrameSnifferEx::EnumStackFramesEx( /* [in] */ DWORD dwSpMin, /* [out] */ IEnumDebugStackFrames __RPC_FAR *__RPC_FAR * ppedsf) + #endif { PY_GATEWAY_METHOD; Index: PyIActiveScriptSiteDebug.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIActiveScriptSiteDebug.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIActiveScriptSiteDebug.cpp 26 Nov 1999 14:14:24 -0000 1.2 --- PyIActiveScriptSiteDebug.cpp 7 Feb 2009 04:28:59 -0000 1.3 *************** *** 142,146 **** --- 142,150 ---- STDMETHODIMP PyGActiveScriptSiteDebug::GetDocumentContextFromPosition( + #ifdef _WIN64 + /* [in] */ DWORDLONG dwSourceContext, + #else /* [in] */ DWORD dwSourceContext, + #endif /* [in] */ ULONG uCharacterOffset, /* [in] */ ULONG uNumChars, Index: PyIDebugProperties.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIDebugProperties.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIDebugProperties.cpp 6 Jan 2000 04:10:30 -0000 1.2 --- PyIDebugProperties.cpp 7 Feb 2009 04:28:59 -0000 1.3 *************** *** 62,66 **** return FALSE; } ! int len = PySequence_Length(ob); if (len<1) { PyErr_SetString(PyExc_ValueError, "DebugProperty sequence must be at least 1"); --- 62,66 ---- return FALSE; } ! Py_ssize_t len = PySequence_Length(ob); if (len<1) { PyErr_SetString(PyExc_ValueError, "DebugProperty sequence must be at least 1"); Index: PyIEnumDebugCodeContexts.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIEnumDebugCodeContexts.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIEnumDebugCodeContexts.cpp 19 Nov 1999 04:14:44 -0000 1.2 --- PyIEnumDebugCodeContexts.cpp 7 Feb 2009 04:28:59 -0000 1.3 *************** *** 172,175 **** --- 172,176 ---- PY_GATEWAY_METHOD; PyObject *result; + Py_ssize_t len; HRESULT hr = InvokeViaPolicy("Next", &result, "i", celt); if ( FAILED(hr) ) *************** *** 178,192 **** if ( !PySequence_Check(result) ) goto error; - int len; len = PyObject_Length(result); if ( len == -1 ) goto error; ! if ( len > (int)celt) len = celt; if ( pCeltFetched ) ! *pCeltFetched = len; ! int i; for ( i = 0; i < len; ++i ) { --- 179,192 ---- if ( !PySequence_Check(result) ) goto error; len = PyObject_Length(result); if ( len == -1 ) goto error; ! if ( len > (Py_ssize_t)celt) len = celt; if ( pCeltFetched ) ! *pCeltFetched = PyWin_SAFE_DOWNCAST(len, Py_ssize_t, ULONG); ! Py_ssize_t i; for ( i = 0; i < len; ++i ) { *************** *** 206,210 **** Py_DECREF(result); ! return len < (int)celt ? S_FALSE : S_OK; error: --- 206,210 ---- Py_DECREF(result); ! return len < (Py_ssize_t )celt ? S_FALSE : S_OK; error: Index: PyIEnumDebugApplicationNodes.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIEnumDebugApplicationNodes.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIEnumDebugApplicationNodes.cpp 19 Nov 1999 04:14:44 -0000 1.2 --- PyIEnumDebugApplicationNodes.cpp 7 Feb 2009 04:28:59 -0000 1.3 *************** *** 173,176 **** --- 173,177 ---- PY_GATEWAY_METHOD; PyObject *result; + Py_ssize_t len; HRESULT hr = InvokeViaPolicy("Next", &result, "i", celt); if ( FAILED(hr) ) *************** *** 179,193 **** if ( !PySequence_Check(result) ) goto error; - int len; len = PyObject_Length(result); if ( len == -1 ) goto error; ! if ( len > (int)celt) len = celt; if ( pCeltFetched ) ! *pCeltFetched = len; ! int i; for ( i = 0; i < len; ++i ) { --- 180,193 ---- if ( !PySequence_Check(result) ) goto error; len = PyObject_Length(result); if ( len == -1 ) goto error; ! if ( len > (Py_ssize_t)celt) len = celt; if ( pCeltFetched ) ! *pCeltFetched = PyWin_SAFE_DOWNCAST(len, Py_ssize_t, ULONG); ! Py_ssize_t i; for ( i = 0; i < len; ++i ) { *************** *** 207,211 **** Py_DECREF(result); ! return len < (int)celt ? S_FALSE : S_OK; error: --- 207,211 ---- Py_DECREF(result); ! return len < (Py_ssize_t)celt ? S_FALSE : S_OK; error: Index: PyIDebugDocumentHelper.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIDebugDocumentHelper.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIDebugDocumentHelper.cpp 1 Sep 1999 23:09:04 -0000 1.1 --- PyIDebugDocumentHelper.cpp 7 Feb 2009 04:28:59 -0000 1.2 *************** *** 225,229 **** --- 225,233 ---- IActiveScript *pas; BOOL fScriptlet; + #ifdef _WIN64 + DWORDLONG pdwSourceContext; + #else DWORD pdwSourceContext; + #endif if ( !PyArg_ParseTuple(args, "iiOi:DefineScriptBlock", &ulCharOffset, &cChars, &obpas, &fScriptlet) ) return NULL; *************** *** 611,615 **** --- 615,623 ---- /* [in] */ IActiveScript __RPC_FAR * pas, /* [in] */ BOOL fScriptlet, + #ifdef _WIN64 + /* [out] */ DWORDLONG __RPC_FAR * pdwSourceContext) + #else /* [out] */ DWORD __RPC_FAR * pdwSourceContext) + #endif { PY_GATEWAY_METHOD; *************** *** 696,700 **** --- 704,712 ---- STDMETHODIMP PyGDebugDocumentHelper::GetScriptBlockInfo( + #ifdef _WIN64 + /* [in] */ DWORDLONG dwSourceContext, + #else /* [in] */ DWORD dwSourceContext, + #endif /* [out] */ IActiveScript __RPC_FAR *__RPC_FAR * ppasd, /* [out] */ ULONG __RPC_FAR * piCharPos, Index: PyIDebugStackFrameSnifferEx.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIDebugStackFrameSnifferEx.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIDebugStackFrameSnifferEx.h 1 Sep 1999 23:09:04 -0000 1.1 --- PyIDebugStackFrameSnifferEx.h 7 Feb 2009 04:28:59 -0000 1.2 *************** *** 31,36 **** --- 31,42 ---- // IDebugStackFrameSnifferEx + #ifdef _WIN64 + STDMETHOD(EnumStackFramesEx64)( + DWORDLONG dwSpMin, + IEnumDebugStackFrames64 __RPC_FAR *__RPC_FAR * ppedsf); + #else STDMETHOD(EnumStackFramesEx)( DWORD dwSpMin, IEnumDebugStackFrames __RPC_FAR *__RPC_FAR * ppedsf); + #endif }; Index: AXDebug.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/AXDebug.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AXDebug.cpp 17 Dec 2008 13:09:45 -0000 1.7 --- AXDebug.cpp 7 Feb 2009 04:28:59 -0000 1.8 *************** *** 216,219 **** --- 216,222 ---- }; + // special case so we use __uuidof, to avoid needing a .lib we don't have! + #undef PYCOM_INTERFACE_FULL + #define PYCOM_INTERFACE_FULL PYCOM_INTERFACE_FULL_UUIDOF // The list of interfaces and gateways we support. Index: PyIDebugApplicationThread.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIDebugApplicationThread.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIDebugApplicationThread.cpp 1 Sep 1999 23:09:04 -0000 1.1 --- PyIDebugApplicationThread.cpp 7 Feb 2009 04:28:59 -0000 1.2 *************** *** 40,44 **** // @pyparm int|dwParam3||Description for dwParam3 PyObject *obpstcb; ! IDebugThreadCall *pstcb; DWORD dwParam1; DWORD dwParam2; --- 40,44 ---- // @pyparm int|dwParam3||Description for dwParam3 PyObject *obpstcb; ! IDebugThreadCall32 *pstcb; DWORD dwParam1; DWORD dwParam2; *************** *** 51,55 **** if (!bPythonIsHappy) return NULL; PY_INTERFACE_PRECALL; ! HRESULT hr = pIDAT->SynchronousCallIntoThread( pstcb, dwParam1, dwParam2, dwParam3 ); pstcb->Release(); PY_INTERFACE_POSTCALL; --- 51,55 ---- if (!bPythonIsHappy) return NULL; PY_INTERFACE_PRECALL; ! HRESULT hr = pIDAT->SynchronousCallIntoThread32( pstcb, dwParam1, dwParam2, dwParam3 ); pstcb->Release(); PY_INTERFACE_POSTCALL; *************** *** 193,198 **** ! STDMETHODIMP PyGDebugApplicationThread::SynchronousCallIntoThread( ! /* [in] */ IDebugThreadCall __RPC_FAR * pstcb, /* [in] */ DWORD dwParam1, /* [in] */ DWORD dwParam2, --- 193,198 ---- ! STDMETHODIMP PyGDebugApplicationThread::SynchronousCallIntoThread32( ! /* [in] */ IDebugThreadCall32 __RPC_FAR * pstcb, /* [in] */ DWORD dwParam1, /* [in] */ DWORD dwParam2, Index: PyIDebugApplication.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIDebugApplication.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIDebugApplication.h 1 Sep 1999 23:09:04 -0000 1.1 --- PyIDebugApplication.h 7 Feb 2009 04:28:59 -0000 1.2 *************** *** 130,136 **** --- 130,142 ---- STDMETHOD(SynchronousCallInDebuggerThread)( IDebugThreadCall __RPC_FAR * pptc, + #ifdef _WIN64 + DWORDLONG dwParam1, + DWORDLONG dwParam2, + DWORDLONG dwParam3); + #else DWORD dwParam1, DWORD dwParam2, DWORD dwParam3); + #endif STDMETHOD(CreateApplicationNode)( *************** *** 156,163 **** --- 162,177 ---- STDMETHOD(AddGlobalExpressionContextProvider)( IProvideExpressionContexts __RPC_FAR * pdsfs, + #ifdef _WIN64 + DWORDLONG __RPC_FAR * pdwCookie); + #else DWORD __RPC_FAR * pdwCookie); + #endif STDMETHOD(RemoveGlobalExpressionContextProvider)( + #ifdef _WIN64 + DWORDLONG dwCookie); + #else DWORD dwCookie); + #endif }; Index: PyIEnumRemoteDebugApplications.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIEnumRemoteDebugApplications.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIEnumRemoteDebugApplications.cpp 19 Nov 1999 04:14:44 -0000 1.2 --- PyIEnumRemoteDebugApplications.cpp 7 Feb 2009 04:28:59 -0000 1.3 *************** *** 172,175 **** --- 172,176 ---- PY_GATEWAY_METHOD; PyObject *result; + Py_ssize_t len; HRESULT hr = InvokeViaPolicy("Next", &result, "i", celt); if ( FAILED(hr) ) *************** *** 178,192 **** if ( !PySequence_Check(result) ) goto error; - int len; len = PyObject_Length(result); if ( len == -1 ) goto error; ! if ( len > (int)celt) len = celt; if ( pCeltFetched ) ! *pCeltFetched = len; ! int i; for ( i = 0; i < len; ++i ) { --- 179,192 ---- if ( !PySequence_Check(result) ) goto error; len = PyObject_Length(result); if ( len == -1 ) goto error; ! if ( len > (Py_ssize_t)celt) len = celt; if ( pCeltFetched ) ! *pCeltFetched = PyWin_SAFE_DOWNCAST(len, Py_ssize_t, ULONG); ! Py_ssize_t i; for ( i = 0; i < len; ++i ) { *************** *** 206,210 **** Py_DECREF(result); ! return len < (int)celt ? S_FALSE : S_OK; error: --- 206,210 ---- Py_DECREF(result); ! return len < (Py_ssize_t)celt ? S_FALSE : S_OK; error: Index: PyIEnumDebugPropertyInfo.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIEnumDebugPropertyInfo.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIEnumDebugPropertyInfo.cpp 10 Dec 2000 01:19:23 -0000 1.2 --- PyIEnumDebugPropertyInfo.cpp 7 Feb 2009 04:28:59 -0000 1.3 *************** *** 191,194 **** --- 191,195 ---- PY_GATEWAY_METHOD; PyObject *result; + Py_ssize_t len; HRESULT hr = InvokeViaPolicy("Next", &result, "i", celt); if ( FAILED(hr) ) *************** *** 197,211 **** if ( !PySequence_Check(result) ) goto error; - int len; len = PyObject_Length(result); if ( len == -1 ) goto error; ! if ( len > (int)celt) len = celt; if ( pCeltFetched ) ! *pCeltFetched = len; ! int i; for ( i = 0; i < len; ++i ) { --- 198,211 ---- if ( !PySequence_Check(result) ) goto error; len = PyObject_Length(result); if ( len == -1 ) goto error; ! if ( len > (Py_ssize_t)celt) len = celt; if ( pCeltFetched ) ! *pCeltFetched = PyWin_SAFE_DOWNCAST(len, Py_ssize_t, ULONG); ! Py_ssize_t i; for ( i = 0; i < len; ++i ) { *************** *** 223,227 **** Py_DECREF(result); ! return len < (int)celt ? S_FALSE : S_OK; error: --- 223,227 ---- Py_DECREF(result); ! return len < (Py_ssize_t)celt ? S_FALSE : S_OK; error: Index: PyIProcessDebugManager.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIProcessDebugManager.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIProcessDebugManager.h 1 Sep 1999 23:09:05 -0000 1.1 --- PyIProcessDebugManager.h 7 Feb 2009 04:28:59 -0000 1.2 *************** *** 31,35 **** protected: PyGProcessDebugManager(PyObject *instance) : PyGatewayBase(instance) { ; } ! PYGATEWAY_MAKE_SUPPORT(PyGProcessDebugManager, IProcessDebugManager, IID_IProcessDebugManager) // IProcessDebugManager --- 31,35 ---- protected: PyGProcessDebugManager(PyObject *instance) : PyGatewayBase(instance) { ; } ! PYGATEWAY_MAKE_SUPPORT(PyGProcessDebugManager, IProcessDebugManager, __uuidof(IProcessDebugManager)) // IProcessDebugManager Index: PyIActiveScriptSiteDebug.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIActiveScriptSiteDebug.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIActiveScriptSiteDebug.h 1 Sep 1999 23:09:03 -0000 1.1 --- PyIActiveScriptSiteDebug.h 7 Feb 2009 04:28:59 -0000 1.2 *************** *** 34,38 **** --- 34,42 ---- // IActiveScriptSiteDebug STDMETHOD(GetDocumentContextFromPosition)( + #ifdef _WIN64 + DWORDLONG dwSourceContext, + #else DWORD dwSourceContext, + #endif ULONG uCharacterOffset, ULONG uNumChars, Index: PyIActiveScriptDebug.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIActiveScriptDebug.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIActiveScriptDebug.cpp 1 Sep 1999 23:09:03 -0000 1.1 --- PyIActiveScriptDebug.cpp 7 Feb 2009 04:28:59 -0000 1.2 *************** *** 185,189 **** --- 185,193 ---- STDMETHODIMP PyGActiveScriptDebug::EnumCodeContextsOfPosition( + #ifdef _WIN64 + /* [in] */ DWORDLONG dwSourceContext, + #else /* [in] */ DWORD dwSourceContext, + #endif /* [in] */ ULONG uCharacterOffset, /* [in] */ ULONG uNumChars, Index: PyIEnumDebugExpressionContexts.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIEnumDebugExpressionContexts.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIEnumDebugExpressionContexts.cpp 19 Nov 1999 04:14:44 -0000 1.2 --- PyIEnumDebugExpressionContexts.cpp 7 Feb 2009 04:28:59 -0000 1.3 *************** *** 170,173 **** --- 170,174 ---- PY_GATEWAY_METHOD; PyObject *result; + Py_ssize_t len; HRESULT hr = InvokeViaPolicy("Next", &result, "i", celt); if ( FAILED(hr) ) *************** *** 176,190 **** if ( !PySequence_Check(result) ) goto error; - int len; len = PyObject_Length(result); if ( len == -1 ) goto error; ! if ( len > (int)celt) len = celt; if ( pCeltFetched ) ! *pCeltFetched = len; ! int i; for ( i = 0; i < len; ++i ) { --- 177,190 ---- if ( !PySequence_Check(result) ) goto error; len = PyObject_Length(result); if ( len == -1 ) goto error; ! if ( len > (Py_ssize_t)celt) len = celt; if ( pCeltFetched ) ! *pCeltFetched = PyWin_SAFE_DOWNCAST(len, Py_ssize_t, ULONG); ! Py_ssize_t i; for ( i = 0; i < len; ++i ) { *************** *** 202,206 **** Py_DECREF(result); ! return len < (int)celt ? S_FALSE : S_OK; error: --- 202,206 ---- Py_DECREF(result); ! return len < (Py_ssize_t)celt ? S_FALSE : S_OK; error: Index: PyIDebugApplication.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIDebugApplication.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIDebugApplication.cpp 26 Nov 1999 14:14:24 -0000 1.2 --- PyIDebugApplication.cpp 7 Feb 2009 04:28:59 -0000 1.3 *************** *** 499,503 **** --- 499,507 ---- PyObject *obpdsfs; IProvideExpressionContexts * pdsfs; + #ifdef _WIN64 + DWORDLONG pdwCookie; + #else DWORD pdwCookie; + #endif if ( !PyArg_ParseTuple(args, "O:AddGlobalExpressionContextProvider", &obpdsfs) ) return NULL; *************** *** 747,753 **** --- 751,763 ---- STDMETHODIMP PyGDebugApplication::SynchronousCallInDebuggerThread( /* [in] */ IDebugThreadCall __RPC_FAR * pptc, + #ifdef _WIN64 + /* [in] */ DWORDLONG dwParam1, + /* [in] */ DWORDLONG dwParam2, + /* [in] */ DWORDLONG dwParam3) + #else /* [in] */ DWORD dwParam1, /* [in] */ DWORD dwParam2, /* [in] */ DWORD dwParam3) + #endif { PY_GATEWAY_METHOD; *************** *** 835,839 **** --- 845,853 ---- STDMETHODIMP PyGDebugApplication::AddGlobalExpressionContextProvider( /* [in] */ IProvideExpressionContexts __RPC_FAR * pdsfs, + #ifdef _WIN64 + /* [out] */ DWORDLONG __RPC_FAR * pdwCookie) + #else /* [out] */ DWORD __RPC_FAR * pdwCookie) + #endif { PY_GATEWAY_METHOD; *************** *** 851,855 **** --- 865,873 ---- STDMETHODIMP PyGDebugApplication::RemoveGlobalExpressionContextProvider( + #ifdef _WIN64 + /* [in] */ DWORDLONG dwCookie) + #else /* [in] */ DWORD dwCookie) + #endif { PY_GATEWAY_METHOD; Index: PyIActiveScriptDebug.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIActiveScriptDebug.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIActiveScriptDebug.h 1 Sep 1999 23:09:03 -0000 1.1 --- PyIActiveScriptDebug.h 7 Feb 2009 04:28:59 -0000 1.2 *************** *** 47,51 **** --- 47,55 ---- STDMETHOD(EnumCodeContextsOfPosition)( + #ifdef _WIN64 + DWORDLONG dwSourceContext, + #else DWORD dwSourceContext, + #endif ULONG uCharacterOffset, ULONG uNumChars, Index: PyIDebugApplicationThread.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIDebugApplicationThread.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIDebugApplicationThread.h 1 Sep 1999 23:09:04 -0000 1.1 --- PyIDebugApplicationThread.h 7 Feb 2009 04:28:59 -0000 1.2 *************** *** 64,69 **** // IDebugApplicationThread ! STDMETHOD(SynchronousCallIntoThread)( ! IDebugThreadCall __RPC_FAR * pstcb, DWORD dwParam1, DWORD dwParam2, --- 64,69 ---- // IDebugApplicationThread ! STDMETHOD(SynchronousCallIntoThread32)( ! IDebugThreadCall32 __RPC_FAR * pstcb, DWORD dwParam1, DWORD dwParam2, Index: PyIEnumRemoteDebugApplicationThreads.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/PyIEnumRemoteDebugApplicationThreads.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIEnumRemoteDebugApplicationThreads.cpp 19 Nov 1999 04:14:44 -0000 1.2 --- PyIEnumRemoteDebugApplicationThreads.cpp 7 Feb 2009 04:28:59 -0000 1.3 *************** *** 172,175 **** --- 172,176 ---- PY_GATEWAY_METHOD; PyObject *result; + Py_ssize_t len; HRESULT hr = InvokeViaPolicy("Next", &result, "i", celt); if ( FAILED(hr) ) *************** *** 178,186 **** if ( !PySequence_Check(result) ) goto error; - int len; len = PyObject_Length(result); if ( len == -1 ) goto error; ! if ( len > (int)celt) len = celt; --- 179,186 ---- if ( !PySequence_Check(result) ) goto error; len = PyObject_Length(result); if ( len == -1 ) goto error; ! if ( len > (Py_ssize_t)celt) len = celt; *************** *** 188,192 **** *pCeltFetched = len; ! int i; for ( i = 0; i < len; ++i ) { --- 188,192 ---- *pCeltFetched = len; ! Py_ssize_t i; for ( i = 0; i < len; ++i ) { *************** *** 206,210 **** Py_DECREF(result); ! return len < (int)celt ? S_FALSE : S_OK; error: --- 206,210 ---- Py_DECREF(result); ! return len < (Py_ssize_t)celt ? S_FALSE : S_OK; error: |
From: Mark H. <mha...@us...> - 2009-02-07 04:29:02
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26073/com/win32com/src/include Modified Files: PythonCOMRegister.h Log Message: Get the axdebug extension building on amd64. With lots of help from Steve Yin via [1727357] new VC8.0 build patch for AMD64 branch (inc axdebug) Index: PythonCOMRegister.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PythonCOMRegister.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PythonCOMRegister.h 29 Mar 2000 01:47:00 -0000 1.3 --- PythonCOMRegister.h 7 Feb 2009 04:28:59 -0000 1.4 *************** *** 29,32 **** --- 29,42 ---- #define PYCOM_INTERFACE_FULL(ifc) { &IID_I##ifc, "I" #ifc, "IID_I" #ifc, &PyI##ifc::type, GET_PYGATEWAY_CTOR(PyG##ifc)} + // Versions that use __uuidof() to get the IID, which seems to avoid the need + // to link with a lib holding the IIDs. Note that almost all extensions + // build with __uuidof() being the default; the build failed at 'shell' - so + // we could consider making this the default and making the 'explicit' version + // above the special case. + #define PYCOM_INTERFACE_IID_ONLY_UUIDOF(ifc) { &__uuidof(I##ifc), "I" #ifc, "IID_I" #ifc, NULL, NULL } + #define PYCOM_INTERFACE_CLIENT_ONLY_UUIDOF(ifc) { &__uuidof(I##ifc), "I" #ifc, "IID_I" #ifc, &PyI##ifc::type, NULL } + #define PYCOM_INTERFACE_SERVER_ONLY_UUIDOF(ifc) { &__uuidof(I##ifc), "I" #ifc, "IID_I" #ifc, NULL, GET_PYGATEWAY_CTOR(PyG##ifc)} + #define PYCOM_INTERFACE_FULL_UUIDOF(ifc) { &__uuidof(I##ifc), "I" #ifc, "IID_I" #ifc, &PyI##ifc::type, GET_PYGATEWAY_CTOR(PyG##ifc)} + // Prototypes for the register functions |