pywin32-checkins Mailing List for Python for Windows Extensions (Page 136)
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: Mark H. <mha...@us...> - 2004-04-25 03:58:20
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21030 Modified Files: testAccess.py Log Message: Check the bookmark property is what we set it to (and as this is a buffer object, the test is useful and not done many other places!) Index: testAccess.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testAccess.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** testAccess.py 18 Nov 2002 11:20:06 -0000 1.5 --- testAccess.py 25 Apr 2004 03:58:12 -0000 1.6 *************** *** 91,94 **** --- 91,97 ---- tab1.Bookmark = bk + if tab1.Bookmark != bk: + raise RuntimeError, "The bookmark data is not the same" + if tab1.Fields("First Name").Value != "Mark": raise RuntimeError, "The bookmark did not reset the record pointer correctly" |
From: Mark H. <mha...@us...> - 2004-04-25 03:29:46
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17123 Modified Files: genpy.py Log Message: * We still redirected stdout in some cases. * We neglected to write the DispatchBaseClass import in some bForDemand cases. Index: genpy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** genpy.py 22 Apr 2004 07:40:52 -0000 1.42 --- genpy.py 25 Apr 2004 03:29:38 -0000 1.43 *************** *** 629,633 **** self.bHaveWrittenCoClassBaseClass = 0 self.bHaveWrittenEventBaseClass = 0 - self.typelib = typelib self.sourceFilename = sourceFilename --- 629,632 ---- *************** *** 763,766 **** --- 762,770 ---- docDesc = moduleDoc[1] + # Reset all the 'per file' state + self.bHaveWrittenDispatchBaseClass = 0 + self.bHaveWrittenCoClassBaseClass = 0 + self.bHaveWrittenEventBaseClass = 0 + # encodings were giving me grief with McMillan's Installer # until I get to the bottom of this, don't generate *************** *** 904,908 **** "Generate a single child. May force a few children to be built as we generate deps" self.generate_type = GEN_DEMAND_CHILD - oldOut = sys.stdout la = self.typelib.GetLibAttr() --- 908,911 ---- *************** *** 964,969 **** for oleitem, vtableitem in items.values(): an_item = oleitem or vtableitem self.file = open(os.path.join(dir, an_item.python_name) + ".py", "w") - sys.stdout = self.file try: if oleitem is not None: --- 967,972 ---- for oleitem, vtableitem in items.values(): an_item = oleitem or vtableitem + assert not self.file, "already have a file?" self.file = open(os.path.join(dir, an_item.python_name) + ".py", "w") try: if oleitem is not None: *************** *** 973,981 **** self.progress.Tick() finally: - sys.stdout = oldOut self.file.close() self.file = None finally: - sys.stdout = oldOut self.progress.Finished() --- 976,982 ---- |
From: Mark H. <mha...@us...> - 2004-04-24 00:54:28
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21326 Modified Files: win32con.py Log Message: Patch [ 891068 ] win32con.py: added font qualities and charsets Index: win32con.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32con.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** win32con.py 2 Jul 2003 03:39:12 -0000 1.4 --- win32con.py 24 Apr 2004 00:54:19 -0000 1.5 *************** *** 2601,2604 **** --- 2601,2608 ---- DRAFT_QUALITY = 1 PROOF_QUALITY = 2 + NONANTIALIASED_QUALITY = 3 + ANTIALIASED_QUALITY = 4 + CLEARTYPE_QUALITY = 5 + CLEARTYPE_NATURAL_QUALITY = 6 DEFAULT_PITCH = 0 FIXED_PITCH = 1 *************** *** 2611,2614 **** --- 2615,2629 ---- CHINESEBIG5_CHARSET = 136 OEM_CHARSET = 255 + JOHAB_CHARSET = 130 + HEBREW_CHARSET = 177 + ARABIC_CHARSET = 178 + GREEK_CHARSET = 161 + TURKISH_CHARSET = 162 + VIETNAMESE_CHARSET = 163 + THAI_CHARSET = 222 + EASTEUROPE_CHARSET = 238 + RUSSIAN_CHARSET = 204 + MAC_CHARSET = 77 + BALTIC_CHARSET = 186 FF_DONTCARE = (0<<4) FF_ROMAN = (1<<4) |
From: Mark H. <mha...@us...> - 2004-04-22 10:03:31
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6897 Modified Files: win32gui.i Log Message: Fix to [ 838232 ] SetScrollInfo incorrectly raises exception. Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** win32gui.i 18 Apr 2004 05:42:19 -0000 1.35 --- win32gui.i 22 Apr 2004 10:03:20 -0000 1.36 *************** *** 2471,2475 **** // @comm When passed to Python, will always be a tuple of size 6, and items may be None if not available. // @comm When passed from Python, it must have the addn mask attribute, but all other items may be None, or not exist. - // <nl>userob is any Python object at all, but no reference count is kept, so you must ensure the object remains referenced throught the lists life. BOOL ParseSCROLLINFOTuple( PyObject *args, SCROLLINFO *pInfo) { --- 2471,2474 ---- *************** *** 2557,2560 **** --- 2556,2560 ---- // @pyswig |SetScrollInfo|Sets information about a scroll-bar + // @rdesc Returns an int with the current position of the scroll box. static PyObject *PySetScrollInfo(PyObject *self, PyObject *args) { int nBar; *************** *** 2579,2589 **** } GUI_BGN_SAVE; ! BOOL ok = SetScrollInfo(hwnd, nBar, &info, bRedraw); GUI_END_SAVE; ! if (!ok) { ! PyWin_SetAPIError("SetScrollInfo"); ! return NULL; ! } ! RETURN_NONE; } %} --- 2579,2585 ---- } GUI_BGN_SAVE; ! int rc = SetScrollInfo(hwnd, nBar, &info, bRedraw); GUI_END_SAVE; ! return PyInt_FromLong(rc); } %} *************** *** 2597,2611 **** HWND hwnd; int nBar; ! // @pyparm int|nBar||The scroll bar to examine. Can be one of win32con.SB_BOTH, win32con.SB_VERT or win32con.SB_HORZ // @pyparm int|mask|SIF_ALL|The mask for attributes to retrieve. ! if (!PyArg_ParseTuple(args, "li:GetScrollInfo", &hwnd, &nBar)) return NULL; SCROLLINFO info; info.cbSize = sizeof(SCROLLINFO); GUI_BGN_SAVE; BOOL ok = GetScrollInfo(hwnd, nBar, &info); GUI_END_SAVE; ! if (!ok) PyWin_SetAPIError("GetScrollInfo"); return MakeSCROLLINFOTuple(&info); } --- 2593,2612 ---- HWND hwnd; int nBar; ! UINT fMask = SIF_ALL; ! // @pyparm int|hwnd||The handle to the window. ! // @pyparm int|nBar||The scroll bar to examine. Can be one of win32con.SB_CTL, win32con.SB_VERT or win32con.SB_HORZ // @pyparm int|mask|SIF_ALL|The mask for attributes to retrieve. ! if (!PyArg_ParseTuple(args, "li|i:GetScrollInfo", &hwnd, &nBar, &fMask)) return NULL; SCROLLINFO info; info.cbSize = sizeof(SCROLLINFO); + info.fMask = fMask; GUI_BGN_SAVE; BOOL ok = GetScrollInfo(hwnd, nBar, &info); GUI_END_SAVE; ! if (!ok) { PyWin_SetAPIError("GetScrollInfo"); + return NULL; + } return MakeSCROLLINFOTuple(&info); } |
From: Mark H. <mha...@us...> - 2004-04-22 08:39:44
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23157 Modified Files: win32pdhmodule.cpp Log Message: Fix [ 787974 ] PyGetCounterInfo() fails on XP Index: win32pdhmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32pdhmodule.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** win32pdhmodule.cpp 6 Oct 2003 13:00:33 -0000 1.10 --- win32pdhmodule.cpp 22 Apr 2004 08:39:34 -0000 1.11 *************** *** 623,627 **** pdhStatus = (*pPdhGetCounterInfo) (handle, bExplainText, &bufSize, NULL); Py_END_ALLOW_THREADS ! if (pdhStatus != ERROR_SUCCESS) return PyWin_SetAPIError("GetCounterInfo for size", pdhStatus); --- 623,628 ---- pdhStatus = (*pPdhGetCounterInfo) (handle, bExplainText, &bufSize, NULL); Py_END_ALLOW_THREADS ! // as usual, pre-xp returns ERROR_SUCCESS, xp returns PDH_MORE_DATA ! if (pdhStatus != ERROR_SUCCESS && pdhStatus != PDH_MORE_DATA) return PyWin_SetAPIError("GetCounterInfo for size", pdhStatus); |
From: Mark H. <mha...@us...> - 2004-04-22 08:24:10
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19999 Modified Files: testall.py Added Files: .cvsignore pippo.idl pippo_server.py testPippo.py Log Message: New "pippo" tests, that helped nail universal memory leaks. Stolen from bug [ 753154 ] memory leak wrapping object having _typelib_guid_ attribute --- NEW FILE: .cvsignore --- pippo.tlb Index: testall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testall.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** testall.py 25 Nov 2003 05:07:24 -0000 1.20 --- testall.py 22 Apr 2004 08:24:00 -0000 1.21 *************** *** 32,36 **** import win32com.client.gencache win32com.client.gencache.__init__() # Reset ! class PyCOMTest(TestCase): def testit(self): --- 32,45 ---- import win32com.client.gencache win32com.client.gencache.__init__() # Reset ! ! def ExecuteSilentlyIfOK(cmd): ! f = os.popen(cmd) ! data = f.read() ! rc = f.close() ! if rc: ! print data ! self.fail("Executing '%s' failed (%d)" % (cmd, rc)) ! return data.strip() ! class PyCOMTest(TestCase): def testit(self): *************** *** 39,49 **** fname = os.path.join(os.path.dirname(this_file), "testPyComTest.py") cmd = '%s "%s" -q 2>&1' % (sys.executable, fname) ! f = os.popen(cmd) ! data = f.read() ! rc = f.close() ! if rc: ! print data ! self.fail("Executing '%s' failed (%d)" % (cmd, rc)) ! data = string.strip(data) if data: print "** testPyCOMTest generated unexpected output" --- 48,52 ---- fname = os.path.join(os.path.dirname(this_file), "testPyComTest.py") cmd = '%s "%s" -q 2>&1' % (sys.executable, fname) ! data = ExecuteSilentlyIfOK(cmd) if data: print "** testPyCOMTest generated unexpected output" *************** *** 51,54 **** --- 54,69 ---- print string.join(string.split(data, "\n"), "\r\n") + class PippoTest(TestCase): + def testit(self): + # Execute pippo via python_d, so it can refcount check. + exe_dir = os.path.dirname(sys.executable) + python = os.path.join(exe_dir, "python_d.exe") + if not os.path.isfile(python): + print "Can't find python_d (but pippo would prefer it!)" + python = sys.executable + fname = os.path.join(os.path.dirname(this_file), "testPippo.py") + cmd = '%s "%s" 2>&1' % (python, fname) + ExecuteSilentlyIfOK(cmd) + unittest_modules = [ # Level 1 tests. *************** *** 86,89 **** --- 101,105 ---- [ PyCOMTest, + PippoTest, ], # Level 2 tests. --- NEW FILE: testPippo.py --- import sys import unittest import pythoncom from win32com.client import Dispatch class PippoTester(unittest.TestCase): def setUp(self): try: self.object = Dispatch("Python.Test.Pippo") except pythoncom.com_error: # register the server import pippo_server pippo_server.main([pippo_server.__file__]) self.object = Dispatch("Python.Test.Pippo") def testLeaks(self): try: gtrc = sys.gettotalrefcount except AttributeError: print "Please run this with python_d for leak tests" return # note creating self.object() should have consumed our "one time" leaks self.object.Method1() start = gtrc() for i in range(1000): object = Dispatch("Python.Test.Pippo") object.Method1() object = None end = gtrc() if end-start > 5: self.fail("We lost %d references!" % (end-start,)) if __name__=='__main__': unittest.main() --- NEW FILE: pippo.idl --- // TestServer.idl : IDL source for TestServer.dll // // This file will be processed by the MIDL tool to // produce the type library (TestServer.tlb) and marshalling code. import "oaidl.idl"; import "ocidl.idl"; [ object, uuid(50086EE8-F535-464B-806E-365ADBB727CF), dual, helpstring("ITestServerApp Interface"), pointer_default(unique) ] interface ITestServerApp : IDispatch { [id(1), helpstring("method Test1")] HRESULT Test1([out, retval] ITestServerApp **pVal); [id(2), helpstring("method Test2")] HRESULT Test2([out, retval] VARIANT *pVar); [propget, id(3), helpstring("property MyProp1")] HRESULT MyProp1([out, retval] long *pVal); }; [ object, uuid(F1A3CC2E-4B2A-4A81-992D-67862076949B), dual, helpstring("IPippo Interface"), pointer_default(unique) ] interface IPippo : IDispatch { [id(1), helpstring("method Method1")] HRESULT Method1([out, retval] IPippo **val); [propget, id(2), helpstring("property MyProp1")] HRESULT MyProp1([out, retval] long *pVal); }; [ uuid(41059C57-975F-4B36-8FF3-C5117426647A), version(1.0), helpstring("TestServer 1.0 Type Library") ] library TESTSERVERLib { importlib("stdole32.tlb"); importlib("stdole2.tlb"); importlib("msado15.dll"); [ uuid(49E44E89-5A72-4456-B1D5-68268A19E798), helpstring("TestServerApp Class") ] coclass TestServerApp { [default] interface ITestServerApp; }; [ uuid(E19C0A68-F61C-450B-A974-A7BA6957829C), helpstring("Pippo Class") ] coclass Pippo { [default] interface IPippo; }; }; --- NEW FILE: pippo_server.py --- # A little test server, complete with typelib, we can use for testing. # Originally submitted with bug: # [ 753154 ] memory leak wrapping object having _typelib_guid_ attribute # but modified by mhammond for use as part of the test suite. import sys, os import pythoncom import win32com import winerror from win32com.server.util import wrap try: __file__ # 2.3 only for __main__ except NameError: __file__ = sys.argv[0] class CPippo: # # COM declarations # _reg_clsid_ = "{05AC1CCE-3F9B-4d9a-B0B5-DFE8BE45AFA8}" _reg_desc_ = "Pippo Python test object" _reg_progid_ = "Python.Test.Pippo" #_reg_clsctx_ = pythoncom.CLSCTX_LOCAL_SERVER ### ### Link to typelib _typelib_guid_ = '{41059C57-975F-4B36-8FF3-C5117426647A}' _typelib_version_ = 1, 0 _com_interfaces_ = ['IPippo'] def __init__(self): self.MyProp1 = 10 def Method1(self): return wrap(CPippo()) def BuildTypelib(): from distutils.dep_util import newer this_dir = os.path.dirname(__file__) idl = os.path.abspath(os.path.join(this_dir, "pippo.idl")) tlb=os.path.splitext(idl)[0] + '.tlb' if newer(idl, tlb): print "Compiling %s" % (idl,) rc = os.system ('midl "%s"' % (idl,)) if rc: raise RuntimeError, "Compiling MIDL failed!" # Can't work out how to prevent MIDL from generating the stubs. # just nuke them for fname in "dlldata.c pippo_i.c pippo_p.c pippo.h".split(): os.remove(os.path.join(this_dir, fname)) print "Registering %s" % (tlb,) tli=pythoncom.LoadTypeLib(tlb) pythoncom.RegisterTypeLib(tli,tlb) def UnregisterTypelib(): k = CPippo try: pythoncom.UnRegisterTypeLib(k._typelib_guid_, k._typelib_version_[0], k._typelib_version_[1], 0, pythoncom.SYS_WIN32) print "Unregistered typelib" except pythoncom.error, details: if details[0]==winerror.TYPE_E_REGISTRYACCESS: pass else: raise def main(argv=None): if argv is None: argv = sys.argv[1:] if '--unregister' in argv: # Unregister the type-libraries. UnregisterTypelib() else: # Build and register the type-libraries. BuildTypelib() import win32com.server.register win32com.server.register.UseCommandLine(CPippo) if __name__=='__main__': main(sys.argv) |
From: Mark H. <mha...@us...> - 2004-04-22 08:09:27
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11921 Modified Files: genpy.py Log Message: Fix my recent fix regarding not all interfaces being written, and demand generation is enabled - if we know the class name, always used it. Index: genpy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** genpy.py 20 Apr 2004 09:54:16 -0000 1.41 --- genpy.py 22 Apr 2004 07:40:52 -0000 1.42 *************** *** 554,557 **** --- 554,559 ---- print >> stream, "__import__('%s.%s')" % (generator.base_mod_name, ref.python_name) print >> stream, "%s = sys.modules['%s.%s'].%s" % (ref.python_name, generator.base_mod_name, ref.python_name, ref.python_name) + # And pretend we have written it - the name is now available as if we had! + ref.bWritten = 1 try: progId = pythoncom.ProgIDFromCLSID(self.clsid) |
From: Mark H. <mha...@us...> - 2004-04-22 07:55:45
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4365 Modified Files: Register.cpp Log Message: Fix one real memory leak in IsGatewayRegistered(), and 2 potential others in error situations. Index: Register.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/Register.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Register.cpp 19 Mar 2004 04:31:01 -0000 1.12 --- Register.cpp 22 Apr 2004 06:47:15 -0000 1.13 *************** *** 105,108 **** --- 105,109 ---- } if (PyDict_SetItem(g_obPyCom_MapGatewayIIDToName, keyObject, valueObject)!=0) { + Py_DECREF(valueObject); Py_DECREF(keyObject); return E_FAIL; *************** *** 119,122 **** --- 120,124 ---- // Note we reuse the key as the value, and value as the key! if (PyDict_SetItem(g_obPyCom_MapInterfaceNameToIID, valueObject, keyObject)!=0) { + Py_DECREF(valueObject); Py_DECREF(keyObject); return E_FAIL; *************** *** 176,182 **** return 0; } ! return PyMapping_HasKey( ! g_obPyCom_MapServerIIDToGateway, ! keyObject); } --- 178,184 ---- return 0; } ! int rc = PyMapping_HasKey(g_obPyCom_MapServerIIDToGateway, keyObject); ! Py_DECREF(keyObject); ! return rc; } |
From: Mark H. <mha...@us...> - 2004-04-22 07:55:25
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12446 Modified Files: univgw.cpp Log Message: Fixed the memory leaks brought to light in: [ 753154 ] memory leak wrapping object having _typelib_guid_ attribute Index: univgw.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/univgw.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** univgw.cpp 31 Oct 2003 02:45:13 -0000 1.8 --- univgw.cpp 22 Apr 2004 07:43:41 -0000 1.9 *************** *** 1,4 **** --- 1,5 ---- /* ** Universal gateway module + ** Written by Bill Tutt and Greg Stein. */ *************** *** 25,34 **** PyObject * dispatcher; // dispatcher from the COM2Py thunk definition - // Python CObject that owns freeing this object. - // This is here so that the method function pointer array - // exists as long as the tear off interface does. - // This is also here so that the tear off interfaces have the absolute - // minimum state necessary. - PyObject * obVTable; IID iid; // the IID of this interface UINT cMethod; // count of methods --- 26,29 ---- *************** *** 45,48 **** --- 40,44 ---- { pfnGWMethod * vtbl; + PyObject * obVTable; // reference to vtable IInternalUnwrapPythonObject * punk; // the identity interface LONG cRef; *************** *** 267,271 **** _this->punk->Release(); CEnterLeavePython _celp; ! Py_DECREF(GET_DEFN(_this)->obVTable); free(_this); return 0; --- 263,267 ---- _this->punk->Release(); CEnterLeavePython _celp; ! Py_DECREF(_this->obVTable); free(_this); return 0; *************** *** 379,387 **** vtbl->magic = GW_VTBL_MAGIC; - Py_INCREF(obDef); vtbl->iid = iid; vtbl->cMethod = count; vtbl->cReservedMethods = numReservedVtables; - vtbl->obVTable = NULL; vtbl->dispatcher = PyObject_GetAttrString(obDef, "dispatch"); --- 375,381 ---- *************** *** 433,442 **** return NULL; } - - // Stick the CObject into the vtable itself - // so that the tear off interfaces can INCREF/DECREF it at - // their own whim. - vtbl->obVTable = result; - Py_INCREF(result); // the vtable's reference. return result; --- 427,430 ---- *************** *** 474,482 **** punk->punk = (IInternalUnwrapPythonObject *)gatewayBase; punk->punk->AddRef(); // we start with one reference (the object we return) punk->cRef = 1; - // Make sure the vtbl doesn't go away before we do. - Py_INCREF(vtbl->obVTable); - return (IUnknown *)punk; } --- 462,469 ---- punk->punk = (IInternalUnwrapPythonObject *)gatewayBase; punk->punk->AddRef(); + punk->obVTable = obVTable; + Py_INCREF(obVTable); // we start with one reference (the object we return) punk->cRef = 1; return (IUnknown *)punk; } *************** *** 523,530 **** } if (!punk) - { - Py_DECREF(obVTable); return NULL; - } // Convert to a PyObject. --- 510,514 ---- |
From: Mark H. <mha...@us...> - 2004-04-22 00:28:26
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16738 Modified Files: selecttlb.py combrowse.py Log Message: Fix [ 887212 ] Exception raised accessing REG_EXPAND_SZ type in registry The COM browser and typelib selection dialog did not handle typelibs that used REG_EXPAND_SZ (generally referencing %SystemRoot%). Index: combrowse.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/combrowse.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** combrowse.py 22 Mar 2001 13:03:00 -0000 1.5 --- combrowse.py 22 Apr 2004 00:26:44 -0000 1.6 *************** *** 158,162 **** except win32api.error: break ! value = win32api.RegQueryValue(key, subKey) if subKey=="HELPDIR": helpPath = value --- 158,168 ---- except win32api.error: break ! hSubKey = win32api.RegOpenKey(key, subKey) ! try: ! value, typ = win32api.RegQueryValueEx(hSubKey, None) ! if typ == win32con.REG_EXPAND_SZ: ! value = win32api.ExpandEnvironmentStrings(value) ! except win32api.error: ! value = "" if subKey=="HELPDIR": helpPath = value *************** *** 174,178 **** except win32api.error: break ! fname = win32api.RegQueryValue(lcidkey, platform) collected.append((lcid, platform, fname)) lcidnum = lcidnum + 1 --- 180,190 ---- except win32api.error: break ! try: ! hplatform = win32api.RegOpenKey(lcidkey, platform) ! fname, typ = win32api.RegQueryValueEx(hplatform, None) ! if typ == win32con.REG_EXPAND_SZ: ! fname = win32api.ExpandEnvironmentStrings(fname) ! except win32api.error: ! fname = "" collected.append((lcid, platform, fname)) lcidnum = lcidnum + 1 Index: selecttlb.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/selecttlb.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** selecttlb.py 21 Apr 2003 10:35:11 -0000 1.6 --- selecttlb.py 22 Apr 2004 00:26:42 -0000 1.7 *************** *** 54,57 **** --- 54,59 ---- break try: + # Note this doesn't handle REG_EXPAND_SZ, but the implementation + # here doesn't need to - that is handled as the data is read. val = win32api.RegQueryValue(root, item) except win32api.error: *************** *** 103,107 **** try: lcid = int(lcid) ! except ValueError: # crap in the registry! continue # Only care about "{lcid}\win32" key - jump straight there. --- 105,109 ---- try: lcid = int(lcid) ! except ValueError: # not an LCID entry continue # Only care about "{lcid}\win32" key - jump straight there. *************** *** 111,115 **** continue try: ! dll = win32api.RegQueryValue(key4, None) except win32api.error: dll = None --- 113,119 ---- continue try: ! dll, typ = win32api.RegQueryValueEx(key4, None) ! if typ==win32con.REG_EXPAND_SZ: ! dll = win32api.ExpandEnvironmentStrings(dll) except win32api.error: dll = None |
From: Mark H. <mha...@us...> - 2004-04-21 06:42:05
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25790 Modified Files: win32process.i Log Message: Fix [ 929490 ] Win2K Priority class definitions missing from win32process Index: win32process.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32process.i,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** win32process.i 15 Mar 2004 02:18:41 -0000 1.12 --- win32process.i 21 Apr 2004 06:41:56 -0000 1.13 *************** *** 5,11 **** %{ #ifndef MS_WINCE - #define _WIN32_WINNT 0x0400 #include "process.h" - //#include "assert.h" #endif #include "windows.h" --- 5,9 ---- *************** *** 1321,1330 **** #define DETACHED_PROCESS DETACHED_PROCESS // For console processes, the new process does not have access to the console of the parent process. The new process can call the AllocConsole function at a later time to create a new console. This flag cannot be used with the CREATE_NEW_CONSOLE flag. - #ifdef ABOVE_NORMAL_PRIORITY_CLASS #define ABOVE_NORMAL_PRIORITY_CLASS ABOVE_NORMAL_PRIORITY_CLASS // Windows 2000: Indicates a process that has priority above NORMAL_PRIORITY_CLASS but below HIGH_PRIORITY_CLASS. - #endif /* ABOVE_NORMAL_PRIORITY_CLASS */ - #ifdef BELOW_NORMAL_PRIORITY_CLASS #define BELOW_NORMAL_PRIORITY_CLASS BELOW_NORMAL_PRIORITY_CLASS // Windows 2000: Indicates a process that has priority above IDLE_PRIORITY_CLASS but below NORMAL_PRIORITY_CLASS. - #endif #define HIGH_PRIORITY_CLASS HIGH_PRIORITY_CLASS // Indicates a process that performs time-critical tasks that must be executed immediately for it to run correctly. The threads of a high-priority class process preempt the threads of normal-priority or idle-priority class processes. An example is the Task List, which must respond quickly when called by the user, regardless of the load on the system. Use extreme care when using the high-priority class, because a high-priority class CPU-bound application can use nearly all available cycles. #define IDLE_PRIORITY_CLASS IDLE_PRIORITY_CLASS // Indicates a process whose threads run only when the system is idle and are preempted by the threads of any process running in a higher priority class. An example is a screen saver. The idle priority class is inherited by child processes. --- 1319,1324 ---- *************** *** 1342,1346 **** #define STARTF_USECOUNTCHARS STARTF_USECOUNTCHARS ! // If this value is not specified, the dwXCountChars and dwYCountChars members are ignored. #define STARTF_USEFILLATTRIBUTE STARTF_USEFILLATTRIBUTE // If this value is not specified, the dwFillAttribute member is ignored. --- 1336,1340 ---- #define STARTF_USECOUNTCHARS STARTF_USECOUNTCHARS ! // If this value is not specified, the dwXCountChars and dwYCountChars members are ignored. #define STARTF_USEFILLATTRIBUTE STARTF_USEFILLATTRIBUTE // If this value is not specified, the dwFillAttribute member is ignored. |
From: Mark H. <mha...@us...> - 2004-04-21 06:40:43
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25400 Modified Files: win32eventmodule.cpp win32filemodule.cpp win32guimodule.cpp win32processmodule.cpp Log Message: When building via distutils, no longer #include the real .cpp file (These files are built seperately by distutils) Index: win32guimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32guimodule.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32guimodule.cpp 2 Sep 1999 00:19:38 -0000 1.1 --- win32guimodule.cpp 21 Apr 2004 06:40:33 -0000 1.2 *************** *** 4,10 **** // so this source file controls which one is actually used! #ifdef UNDER_CE #include "win32guimodule_wince.cpp" #else #include "win32guimodule_win32.cpp" ! #endif \ No newline at end of file --- 4,12 ---- // so this source file controls which one is actually used! + #ifndef DISTUTILS_BUILD /* Not needed for distutils based builds */ #ifdef UNDER_CE #include "win32guimodule_wince.cpp" #else #include "win32guimodule_win32.cpp" ! #endif ! #endif /* DISTUTILS_BUILD */ Index: win32processmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32processmodule.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32processmodule.cpp 2 Sep 1999 00:19:38 -0000 1.1 --- win32processmodule.cpp 21 Apr 2004 06:40:33 -0000 1.2 *************** *** 4,10 **** // so this source file controls which one is actually used! #ifdef UNDER_CE #include "win32processmodule_wince.cpp" #else #include "win32processmodule_win32.cpp" ! #endif \ No newline at end of file --- 4,12 ---- // so this source file controls which one is actually used! + #ifndef DISTUTILS_BUILD /* Not needed for distutils based builds */ #ifdef UNDER_CE #include "win32processmodule_wince.cpp" #else #include "win32processmodule_win32.cpp" ! #endif ! #endif /* DISTUTILS_BUILD */ Index: win32filemodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32filemodule.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32filemodule.cpp 2 Sep 1999 00:19:38 -0000 1.1 --- win32filemodule.cpp 21 Apr 2004 06:40:33 -0000 1.2 *************** *** 4,10 **** // so this source file controls which one is actually used! #ifdef UNDER_CE #include "win32filemodule_wince.cpp" #else #include "win32filemodule_win32.cpp" ! #endif \ No newline at end of file --- 4,12 ---- // so this source file controls which one is actually used! + #ifndef DISTUTILS_BUILD /* Not needed for distutils based builds */ #ifdef UNDER_CE #include "win32filemodule_wince.cpp" #else #include "win32filemodule_win32.cpp" ! #endif ! #endif /* DISTUTILS_BUILD */ Index: win32eventmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32eventmodule.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32eventmodule.cpp 2 Sep 1999 00:19:37 -0000 1.1 --- win32eventmodule.cpp 21 Apr 2004 06:40:33 -0000 1.2 *************** *** 4,10 **** // so this source file controls which one is actually used! #ifdef UNDER_CE #include "win32eventmodule_wince.cpp" #else #include "win32eventmodule_win32.cpp" ! #endif \ No newline at end of file --- 4,12 ---- // so this source file controls which one is actually used! + #ifndef DISTUTILS_BUILD /* Not needed for distutils based builds */ #ifdef UNDER_CE #include "win32eventmodule_wince.cpp" #else #include "win32eventmodule_win32.cpp" ! #endif ! #endif /* DISTUTILS_BUILD */ |
From: Mark H. <mha...@us...> - 2004-04-21 06:38:02
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24972 Modified Files: setup_win32all.py Log Message: Finally track and fix the bug that causes some our .i files changing to not rebuild the final module. Also, win32process needs a late SDK. Index: setup_win32all.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup_win32all.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** setup_win32all.py 10 Apr 2004 05:19:20 -0000 1.15 --- setup_win32all.py 21 Apr 2004 06:37:45 -0000 1.16 *************** *** 113,117 **** sources = sources or [] sources.extend(self.get_source_files(dsp_file)) ! self.pch_header = pch_header self.windows_h_version = windows_h_version --- 113,120 ---- sources = sources or [] sources.extend(self.get_source_files(dsp_file)) ! # Some of our swigged files behave differently in distutils vs ! # MSVC based builds. Always define DISTUTILS_BUILD so they can tell. ! define_macros = define_macros or [] ! define_macros.append(("DISTUTILS_BUILD", None)) self.pch_header = pch_header self.windows_h_version = windows_h_version *************** *** 441,445 **** # .obj. output_dir = os.path.join(self.build_temp, ext.name) - print "OD is", output_dir # 2.2 has no 'depends' param. kw = {'output_dir': output_dir, --- 444,447 ---- *************** *** 589,594 **** # source -- but there should be an option to put SWIG output in # the temp dir. ! # XXX - further, the way the win32/wince SWIG modules #include the ! # real .cpp file prevents us generating the .cpp files in the temp dir. target_ext = '.cpp' for source in sources: --- 591,598 ---- # source -- but there should be an option to put SWIG output in # the temp dir. ! # XXX - Note that swig_wince_modules no longer #include the real ! # generated .cpp file (well, they do, but are avoided via the ! # pre-processor.) So this is no longer a reason we can't generate ! # directly to the temp directory. target_ext = '.cpp' for source in sources: *************** *** 603,607 **** swig_targets[source] = base + target_ext elif os.path.basename(base) in swig_wince_modules: ! swig_targets[source] = base + 'module_win32' + target_ext else: swig_targets[source] = base + 'module' + target_ext --- 607,615 ---- swig_targets[source] = base + target_ext elif os.path.basename(base) in swig_wince_modules: ! # We need to add this .cpp to the sources, so it ! # will be built. ! new_target = base + 'module_win32' + target_ext ! swig_targets[source] = new_target ! new_sources.append(new_target) else: swig_targets[source] = base + 'module' + target_ext *************** *** 706,710 **** ("win32pipe", "", False), ("win32print", "winspool user32", False), ! ("win32process", "advapi32 user32", False), ("win32ras", "rasapi32 user32", False), ("win32security", "advapi32 user32", True), --- 714,718 ---- ("win32pipe", "", False), ("win32print", "winspool user32", False), ! ("win32process", "advapi32 user32", False, 0x0500), ("win32ras", "rasapi32 user32", False), ("win32security", "advapi32 user32", True), |
From: Mark H. <mha...@us...> - 2004-04-20 22:56:02
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14710 Modified Files: PyIDispatch.cpp Log Message: The description for 2 of the args to InvokeTypes() were reversed. Index: PyIDispatch.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyIDispatch.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyIDispatch.cpp 31 Oct 2003 09:39:39 -0000 1.7 --- PyIDispatch.cpp 20 Apr 2004 22:55:48 -0000 1.8 *************** *** 294,299 **** LCID lcid = PyInt_AsLong(PyTuple_GET_ITEM(args, 1)); // @pyparm int|lcid||The locale ID. Please see <om PyIDispatch.Invoke>. UINT wFlags = PyInt_AsLong(PyTuple_GET_ITEM(args, 2)); // @pyparm int|wFlags||Flags for the call. Please see <om PyIDispatch.Invoke>. ! PyObject *resultElemDesc = PyTuple_GET_ITEM(args, 3); // @pyparm (tuple, ...)|typeDesc||A sequence of tuples describing the types of the parameters for the function. ! PyObject *argsElemDescArray = PyTuple_GET_ITEM(args, 4); // @pyparm tuple|resultTypeDesc||A tuple describing the type of the result. // @pyparm object, ...|args||The args to the function. if ( PyErr_Occurred() ) --- 294,299 ---- LCID lcid = PyInt_AsLong(PyTuple_GET_ITEM(args, 1)); // @pyparm int|lcid||The locale ID. Please see <om PyIDispatch.Invoke>. UINT wFlags = PyInt_AsLong(PyTuple_GET_ITEM(args, 2)); // @pyparm int|wFlags||Flags for the call. Please see <om PyIDispatch.Invoke>. ! PyObject *resultElemDesc = PyTuple_GET_ITEM(args, 3); // @pyparm tuple|resultTypeDesc||A tuple describing the type of the result. ! PyObject *argsElemDescArray = PyTuple_GET_ITEM(args, 4); // @pyparm (tuple, ...)|typeDesc||A sequence of tuples describing the types of the parameters for the function. // @pyparm object, ...|args||The args to the function. if ( PyErr_Occurred() ) |
From: Mark H. <mha...@us...> - 2004-04-20 09:54:25
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19122 Modified Files: genpy.py Log Message: Fix a problem where not all generated classes were written to CLSIDToClassMap, and thus would cause some objects to fall back to dynamic dispatch. Most notably 'Indesign.Application'. As referenced by http://groups.google.com/groups?selm=80ef91b8.0403080605.4056b891%40posting.google.com Index: genpy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** genpy.py 8 Apr 2004 03:32:42 -0000 1.40 --- genpy.py 20 Apr 2004 09:54:16 -0000 1.41 *************** *** 567,577 **** if flag & pythoncom.IMPLTYPEFLAG_FDEFAULT: defItem = item ! # check if non-dispatchable - if so no real Python class has been written. Write the iid as a string instead. ! if item.bIsDispatch: key = item.python_name else: key = repr(str(item.clsid)) # really the iid. print >> stream, '\t\t%s,' % (key) print >> stream, '\t]' if defItem: ! if defItem.bIsDispatch: defName = defItem.python_name else: defName = repr(str(defItem.clsid)) # really the iid. print >> stream, '\tdefault_source = %s' % (defName,) --- 567,578 ---- if flag & pythoncom.IMPLTYPEFLAG_FDEFAULT: defItem = item ! # If we have written a Python class, reference the name - ! # otherwise just the IID. ! if item.bWritten: key = item.python_name else: key = repr(str(item.clsid)) # really the iid. print >> stream, '\t\t%s,' % (key) print >> stream, '\t]' if defItem: ! if defItem.bWritten: defName = defItem.python_name else: defName = repr(str(defItem.clsid)) # really the iid. print >> stream, '\tdefault_source = %s' % (defName,) *************** *** 581,591 **** if flag & pythoncom.IMPLTYPEFLAG_FDEFAULT: # and dual: defItem = item ! # check if non-dispatchable - if so no real Python class has been written. Write the iid as a string instead. ! if item.bIsDispatch: key = item.python_name else: key = repr(str(item.clsid)) # really the iid. print >> stream, '\t\t%s,' % (key,) print >> stream, '\t]' if defItem: ! if defItem.bIsDispatch: defName = defItem.python_name else: defName = repr(str(defItem.clsid)) # really the iid. print >> stream, '\tdefault_interface = %s' % (defName,) --- 582,592 ---- if flag & pythoncom.IMPLTYPEFLAG_FDEFAULT: # and dual: defItem = item ! # If we have written a class, refeence its name, otherwise the IID ! if item.bWritten: key = item.python_name else: key = repr(str(item.clsid)) # really the iid. print >> stream, '\t\t%s,' % (key,) print >> stream, '\t]' if defItem: ! if defItem.bWritten: defName = defItem.python_name else: defName = repr(str(defItem.clsid)) # really the iid. print >> stream, '\tdefault_interface = %s' % (defName,) *************** *** 853,857 **** print >> stream, 'CLSIDToClassMap = {' for item in oleItems.values(): ! if item is not None and item.bWritten and item.bIsDispatch: print >> stream, "\t'%s' : %s," % (str(item.clsid), item.python_name) print >> stream, '}' --- 854,858 ---- print >> stream, 'CLSIDToClassMap = {' for item in oleItems.values(): ! if item is not None and item.bWritten: print >> stream, "\t'%s' : %s," % (str(item.clsid), item.python_name) print >> stream, '}' *************** *** 986,990 **** self.do_gen_file_header() oleitem.WriteClass(self) ! if oleitem.bIsDispatch: print >> self.file, 'win32com.client.CLSIDToClass.RegisterCLSID( "%s", %s )' % (oleitem.clsid, oleitem.python_name) --- 987,991 ---- self.do_gen_file_header() oleitem.WriteClass(self) ! if oleitem.bWritten: print >> self.file, 'win32com.client.CLSIDToClass.RegisterCLSID( "%s", %s )' % (oleitem.clsid, oleitem.python_name) |
From: Roger U. <ru...@us...> - 2004-04-18 22:01:20
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/taskscheduler/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14999/com/win32comext/taskscheduler/src Modified Files: taskscheduler.cpp Added Files: PyIProvideTaskPage.cpp PyIProvideTaskPage.h Log Message: Add IProvideTaskPage (although we can't do anything with an HPROPSHEETPAGE yet) --- NEW FILE: PyIProvideTaskPage.cpp --- // This file implements the IProvideTaskPage Interface for Python. // Generated by makegw.py #include "PyIProvideTaskPage.h" #include "PyWinObjects.h" // @doc - This file contains autoduck documentation // --------------------------------------------------- // // Interface Implementation PyIProvideTaskPage::PyIProvideTaskPage(IUnknown *pdisp): PyIUnknown(pdisp) { ob_type = &type; } PyIProvideTaskPage::~PyIProvideTaskPage() { } /* static */ IProvideTaskPage *PyIProvideTaskPage::GetI(PyObject *self) { return (IProvideTaskPage *)PyIUnknown::GetI(self); } // @pymethod |PyIProvideTaskPage|GetPage|Return a property sheet page handle for the spedified type (TASKPAGE_TASK,TASKPAGE_SCHEDULE,TASKPAGE_SETTINGS) // @comm There's not yet anything useful that can be done with this handle - return type subject to change PyObject *PyIProvideTaskPage::GetPage(PyObject *self, PyObject *args) { IProvideTaskPage *pIPTP = GetI(self); if ( pIPTP == NULL ) return NULL; TASKPAGE tpType; // @pyparm int|tpType||Type of page to retreive (TASKPAGE_TASK,TASKPAGE_SCHEDULE,TASKPAGE_SETTINGS) // @pyparm bool|PersistChanges||Indicates if changes should be saved automatically HPROPSHEETPAGE phPage; BOOL bPersistChanges=FALSE; if ( !PyArg_ParseTuple(args, "ii:GetPage", &tpType, &bPersistChanges)) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pIPTP->GetPage(tpType, bPersistChanges, &phPage); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pIPTP, IID_IProvideTaskPage ); return new PyHANDLE(phPage); } // @object PyIProvideTaskPage|Description of the interface static struct PyMethodDef PyIProvideTaskPage_methods[] = { { "GetPage", PyIProvideTaskPage::GetPage, 1 }, // @pymeth GetPage|Return a property sheet page handle for the spedified type (TASKPAGE_TASK,TASKPAGE_SCHEDULE,TASKPAGE_SETTINGS) { NULL } }; PyComTypeObject PyIProvideTaskPage::type("PyIProvideTaskPage", &PyIUnknown::type, sizeof(PyIProvideTaskPage), PyIProvideTaskPage_methods, GET_PYCOM_CTOR(PyIProvideTaskPage)); --- NEW FILE: PyIProvideTaskPage.h --- // This file declares the IProvideTaskPage Interface for Python. // Generated by makegw.py // --------------------------------------------------- // // Interface Declaration #include "mstask.h" #include "PythonCOM.h" class PyIProvideTaskPage : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIProvideTaskPage); static IProvideTaskPage *GetI(PyObject *self); static PyComTypeObject type; // The Python methods static PyObject *GetPage(PyObject *self, PyObject *args); protected: PyIProvideTaskPage(IUnknown *pdisp); ~PyIProvideTaskPage(); }; Index: taskscheduler.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/taskscheduler/src/taskscheduler.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** taskscheduler.cpp 10 Apr 2004 05:18:41 -0000 1.1 --- taskscheduler.cpp 18 Apr 2004 22:01:11 -0000 1.2 *************** *** 6,10 **** # include "PyITask.h" # include "PyITaskTrigger.h" ! static struct PyMethodDef taskscheduler_methods[]= { --- 6,11 ---- # include "PyITask.h" # include "PyITaskTrigger.h" ! # include "PyIProvideTaskPage.h" ! static struct PyMethodDef taskscheduler_methods[]= { *************** *** 20,24 **** PYCOM_INTERFACE_CLIENT_ONLY( Task ), PYCOM_INTERFACE_CLIENT_ONLY( TaskTrigger ), ! PYCOM_INTERFACE_CLIENT_ONLY( ScheduledWorkItem ) }; --- 21,26 ---- PYCOM_INTERFACE_CLIENT_ONLY( Task ), PYCOM_INTERFACE_CLIENT_ONLY( TaskTrigger ), ! PYCOM_INTERFACE_CLIENT_ONLY( ScheduledWorkItem ), ! PYCOM_INTERFACE_CLIENT_ONLY( ProvideTaskPage ) }; *************** *** 51,55 **** PyModule_AddIntConstant(module,"TASK_TRIGGER_FLAG_DISABLED", TASK_TRIGGER_FLAG_DISABLED); - // task statuses from msterr.h PyModule_AddIntConstant(module,"SCHED_S_TASK_READY", SCHED_S_TASK_READY); --- 53,56 ---- *************** *** 126,128 **** --- 127,135 ---- PyModule_AddIntConstant(module,"TASK_FOURTH_WEEK", TASK_FOURTH_WEEK); PyModule_AddIntConstant(module,"TASK_LAST_WEEK", TASK_LAST_WEEK); + + // property sheet identifiers + PyModule_AddIntConstant(module,"TASKPAGE_TASK", TASKPAGE_TASK); + PyModule_AddIntConstant(module,"TASKPAGE_SCHEDULE", TASKPAGE_SCHEDULE); + PyModule_AddIntConstant(module,"TASKPAGE_SETTINGS", TASKPAGE_SETTINGS); + } |
From: Mark H. <mha...@us...> - 2004-04-18 05:58:25
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29393/lib Added Files: win32timezone.py Log Message: New module win32timezone for working with all the timezone information Windows has in its registry. Contributed by Jason Coombs. --- NEW FILE: win32timezone.py --- # -*- coding: UTF-8 -*- """ win32timezone: Module for handling datetime.tzinfo time zones using the windows registry for time zone information. The time zone names are dependent on the registry entries defined by the operating system. Currently, this module only supports the Windows NT line of products and not Windows 95/98/Me. This module may be tested using the doctest module. Written by Jason R. Coombs (ja...@ja...). Copyright © 2003. All Rights Reserved. To use this time zone module with the datetime module, simply pass the TimeZoneInfo object to the datetime constructor. For example, >>> import win32timezone, datetime >>> assert 'Mountain Standard Time' in win32timezone.GetTimeZoneNames() >>> tzi = TimeZoneInfo( 'Mountain Standard Time' ) >>> now = datetime.datetime.now( tzi ) The now object is now a time-zone aware object, and daylight savings- aware methods may be called on it. >>> now.utcoffset() in ( datetime.timedelta(-1, 61200), datetime.timedelta(-1, 64800) ) True (note that the result of utcoffset call will be different based on when now was generated, unless standard time is always used) >>> now = datetime.datetime.now( TimeZoneInfo( 'Mountain Standard Time', True ) ) >>> now.utcoffset() datetime.timedelta(-1, 61200) >>> aug2 = datetime.datetime( 2003, 8, 2, tzinfo = tzi ) >>> aug2.utctimetuple() (2003, 8, 2, 6, 0, 0, 5, 214, 0) >>> nov2 = datetime.datetime( 2003, 11, 2, tzinfo = tzi ) >>> nov2.utctimetuple() (2003, 11, 2, 7, 0, 0, 6, 306, 0) To convert from one timezone to another, just use the astimezone method. >>> aug2.isoformat() '2003-08-02T00:00:00-06:00' >>> aug2est = aug2.astimezone( win32timezone.TimeZoneInfo( 'Eastern Standard Time' ) ) >>> aug2est.isoformat() '2003-08-02T02:00:00-04:00' calling the displayName member will return the display name as set in the registry. >>> est = win32timezone.TimeZoneInfo( 'Eastern Standard Time' ) >>> est.displayName '(GMT-05:00) Eastern Time (US & Canada)' >>> gmt = win32timezone.TimeZoneInfo( 'GMT Standard Time', True ) >>> gmt.displayName '(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London' """ __author__ = 'Jason R. Coombs <ja...@ja...>' __version__ = '$Revision: 1.1 $'[11:-2] __vssauthor__ = '$Author: mhammond $'[9:-2] __date__ = '$Modtime: 04-04-14 10:52 $'[10:-2] import os, win32api, win32con, struct, datetime class TimeZoneInfo( datetime.tzinfo ): """ Main class for handling win32 time zones. Usage: TimeZoneInfo( <Time Zone Standard Name>, [<Fix Standard Time>] ) If <Fix Standard Time> evaluates to True, daylight savings time is calculated in the same way as standard time. """ # this key works for WinNT+, but not for the Win95 line. tzRegKey = r'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones' def __init__( self, timeZoneName, fixedStandardTime=False ): self.timeZoneName = timeZoneName tzRegKeyPath = os.path.join( self.tzRegKey, timeZoneName ) try: key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, tzRegKeyPath, 0, win32con.KEY_READ ) except: raise ValueError, 'Timezone Name %s not found.' % timeZoneName self._LoadInfoFromKey( key ) self.fixedStandardTime = fixedStandardTime def _LoadInfoFromKey( self, key ): """Loads the information from an opened time zone registry key into relevant fields of this TZI object""" self.displayName = win32api.RegQueryValueEx( key, "Display" )[0] self.standardName = win32api.RegQueryValueEx( key, "Std" )[0] self.daylightName = win32api.RegQueryValueEx( key, "Dlt" )[0] # TZI contains a structure of time zone information and is similar to # TIME_ZONE_INFORMATION described in the Windows Platform SDK winTZI, type = win32api.RegQueryValueEx( key, "TZI" ) winTZI = struct.unpack( '3l8h8h', winTZI ) makeMinuteTimeDelta = lambda x: datetime.timedelta( minutes = x ) self.bias, self.standardBiasOffset, self.daylightBiasOffset = \ map( makeMinuteTimeDelta, winTZI[:3] ) # daylightEnd and daylightStart are 8-tuples representing a Win32 SYSTEMTIME structure self.daylightEnd, self.daylightStart = winTZI[3:11], winTZI[11:19] def __repr__( self ): result = '%s( %s' % ( self.__class__.__name__, repr( self.timeZoneName ) ) if self.fixedStandardTime: result += ', True' result += ' )' return result def __str__( self ): return self.displayName def tzname( self, dt ): if self.dst( dt ) == self.daylightBiasOffset: result = self.daylightName elif self.dst( dt ) == self.standardBiasOffset: result = self.standardName return result def _getStandardBias( self ): return self.bias + self.standardBiasOffset standardBias = property( _getStandardBias ) def _getDaylightBias( self ): return self.bias + self.daylightBiasOffset daylightBias = property( _getDaylightBias ) def utcoffset( self, dt ): "Calculates the utcoffset according to the datetime.tzinfo spec" return -( self.bias + self.dst( dt ) ) def dst( self, dt ): "Calculates the daylight savings offset according to the datetime.tzinfo spec" assert dt.tzinfo is self result = self.standardBiasOffset try: dstStart = self.GetDSTStartTime( dt.year ) dstEnd = self.GetDSTEndTime( dt.year ) if dstStart <= dt.replace( tzinfo=None ) < dstEnd and not self.fixedStandardTime: result = self.daylightBiasOffset except ValueError: # there was an error parsing the time zone, which is normal when a # start and end time are not specified. pass return result def GetDSTStartTime( self, year ): "Given a year, determines the time when daylight savings time starts" return self._LocateDay( year, self.daylightStart ) def GetDSTEndTime( self, year ): "Given a year, determines the time when daylight savings ends." return self._LocateDay( year, self.daylightEnd ) def _LocateDay( self, year, win32SystemTime ): """ Takes a SYSTEMTIME structure as retrieved from a TIME_ZONE_INFORMATION structure and interprets it based on the given year to identify the actual day. This method is necessary because the SYSTEMTIME structure refers to a day by its day of the week or week of the month (e.g. 4th saturday in April). Refer to the Windows Platform SDK for more information on the SYSTEMTIME and TIME_ZONE_INFORMATION structures. """ month = win32SystemTime[ 1 ] # MS stores Sunday as 0, Python datetime stores Monday as zero targetWeekday = ( win32SystemTime[ 2 ] + 6 ) % 7 # win32SystemTime[3] is the week of the month, so the following # is the first day of that week day = ( win32SystemTime[ 3 ] - 1 ) * 7 + 1 hour, min, sec, msec = win32SystemTime[4:] result = datetime.datetime( year, month, day, hour, min, sec, msec ) # now the result is the correct week, but not necessarily the correct day of the week daysToGo = targetWeekday - result.weekday() result += datetime.timedelta( daysToGo ) # if we selected a day in the month following the target month, # move back a week or two. # This is necessary because Microsoft defines the fifth week in a month # to be the last week in a month and adding the time delta might have # pushed the result into the next month. while result.month == month + 1: result -= datetime.timedelta( weeks = 1 ) return result def _RegKeyEnumerator( key ): "Enumerates an open registry key as an iterable generator" index = 0 try: while 1: yield win32api.RegEnumKey( key, index ) index += 1 except win32api.error: pass def GetTimeZoneNames( ): "Returns the names of the time zones as defined in the registry" key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, TimeZoneInfo.tzRegKey, 0, win32con.KEY_READ ) return _RegKeyEnumerator( key ) def GetIndexedTimeZoneNames( ): """Returns the names of the time zones as defined in the registry, but includes the index by which they may be sorted longitudinally.""" for timeZoneName in GetTimeZoneNames(): tzRegKeyPath = os.path.join( TimeZoneInfo.tzRegKey, timeZoneName ) key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, tzRegKeyPath, 0, win32con.KEY_READ ) tzIndex, type = win32api.RegQueryValueEx( key, 'Index' ) yield ( tzIndex, timeZoneName ) def GetSortedTimeZoneNames( ): """ Uses GetIndexedTimeZoneNames to return the time zone names sorted longitudinally.""" tzs = list( GetIndexedTimeZoneNames() ) tzs.sort() return zip( *tzs )[1] def GetLocalTimeZone( ): """Returns the local time zone as defined by the operating system in the registry >>> localTZ = GetLocalTimeZone() >>> nowLoc = datetime.datetime.now( localTZ ) >>> nowUTC = datetime.datetime.utcnow( ) >>> ( nowUTC - nowLoc ) < datetime.timedelta( seconds = 5 ) Traceback (most recent call last): ... TypeError: can't subtract offset-naive and offset-aware datetimes >>> nowUTC = nowUTC.replace( tzinfo = TimeZoneInfo( 'GMT Standard Time', True ) ) Now one can compare the results of the two offset aware values >>> ( nowUTC - nowLoc ) < datetime.timedelta( seconds = 5 ) True """ tzRegKey = r'SYSTEM\CurrentControlSet\Control\TimeZoneInformation' key = win32api.RegOpenKeyEx( win32con.HKEY_LOCAL_MACHINE, tzRegKey, 0, win32con.KEY_READ ) tzName, type = win32api.RegQueryValueEx( key, 'StandardName' ) return TimeZoneInfo( tzName ) |
From: Mark H. <mha...@us...> - 2004-04-18 05:58:25
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29393/test Added Files: test_win32timezone.py Log Message: New module win32timezone for working with all the timezone information Windows has in its registry. Contributed by Jason Coombs. --- NEW FILE: test_win32timezone.py --- # Test module for win32timezone import unittest, win32timezone, doctest class Win32TimeZoneTest(unittest.TestCase): def testWin32TZ(self): failed, total = doctest.testmod( win32timezone, verbose = True ) self.failIf( failed ) if __name__ == '__main__': unittest.main() |
From: Mark H. <mha...@us...> - 2004-04-18 05:42:27
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26614 Modified Files: win32gui.i Log Message: Add basic support for accelerators, and fix TranslateMessage/DispatchMessage Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** win32gui.i 9 Apr 2004 11:08:01 -0000 1.34 --- win32gui.i 18 Apr 2004 05:42:19 -0000 1.35 *************** *** 64,67 **** --- 64,70 ---- typedef long HIMAGELIST + %apply HACCEL {long}; + typedef long HACCEL + %apply COLORREF {long}; typedef long COLORREF *************** *** 83,87 **** %typemap(python,in) MSG *INPUT { ! if (PyArg_ParseTuple($source, "(iiiii(ii))", &$target->hwnd, &$target->message, --- 86,91 ---- %typemap(python,in) MSG *INPUT { ! $target = (MSG *)calloc(1, sizeof(MSG)); ! if (!PyArg_ParseTuple($source, "iiiii(ii):MSG param for $name", &$target->hwnd, &$target->message, *************** *** 90,97 **** &$target->time, &$target->pt.x, ! &$target->pt.y)) ! return PyErr_Format(PyExc_TypeError, "%s: This param must be a tuple of format 'iiiii(ii)'", "$name"); } - %typemap(python,ignore) RECT *OUTPUT(RECT temp) { --- 94,101 ---- &$target->time, &$target->pt.x, ! &$target->pt.y)) { ! return NULL; ! } } %typemap(python,ignore) RECT *OUTPUT(RECT temp) { *************** *** 1459,1462 **** --- 1463,1519 ---- ); + // @pyswig HACCEL|CreateAcceleratorTable|Creates an accelerator table + %{ + PyObject *PyCreateAcceleratorTable(PyObject *self, PyObject *args) + { + int num, i; + ACCEL *accels = NULL; + PyObject *ret = NULL; + PyObject *obAccels; + HACCEL ha; + // @pyparm ( (int, int, int), ...)|accels||A sequence of (fVirt, key, cmd), + // as per the Win32 ACCEL structure. + if (!PyArg_ParseTuple(args, "O:CreateAcceleratorTable", &obAccels)) + return NULL; + if (!PySequence_Check(obAccels)) + return PyErr_Format(PyExc_TypeError, "accels must be a sequence of tuples (got '%s')", + obAccels->ob_type->tp_name); + num = PySequence_Length(obAccels); + if (num==0) { + PyErr_SetString(PyExc_ValueError, "Can't create an accelerator with zero items"); + goto done; + } + accels = (ACCEL *)malloc(num * sizeof(ACCEL)); + if (!accels) { + PyErr_NoMemory(); + goto done; + } + for (i=0;i<num;i++) { + ACCEL *p = accels+i; + PyObject *ob = PySequence_GetItem(obAccels, i); + if (!ob) goto done; + if (!PyArg_ParseTuple(ob, "BHH:ACCEL", &p->fVirt, &p->key, &p->cmd)) { + Py_DECREF(ob); + goto done; + } + Py_DECREF(ob); + } + ha = ::CreateAcceleratorTable(accels, num); + if (ha) + ret = PyLong_FromVoidPtr((void *)ha); + else + PyWin_SetAPIError("CreateAcceleratorTable"); + done: + if (accels) + free(accels); + return ret; + } + %} + %native (CreateAcceleratorTable) PyCreateAcceleratorTable; + + // @pyswig |DestroyAccleratorTable|Destroys an accelerator table + // @pyparm int|haccel|| + BOOLAPI DestroyAcceleratorTable(HACCEL haccel); + // @pyswig HMENU|LoadMenu|Loads a menu HMENU LoadMenu(HINSTANCE hInst, RESOURCE_ID name); *************** *** 1813,1825 **** --- 1870,1892 ---- // @pyswig int|TranslateMessage| + // @pyparm MSG|msg|| BOOL TranslateMessage(MSG *INPUT); // @pyswig int|DispatchMessage| + // @pyparm MSG|msg|| LRESULT DispatchMessage(MSG *INPUT); + // @pyswig int|TranslateAccelerator| + int TranslateAccelerator( + HWND hwnd, // @pyparm int|hwnd|| + HACCEL haccel, // @pyparm int|haccel|| + MSG *INPUT // @pyparm MSG|msg|| + ); + // DELETE ME! %{ static PyObject *Unicode(PyObject *self, PyObject *args) { + PyErr_Warn(PyExc_PendingDeprecationWarning, "win32gui.Unicode will die!"); char *text; if (!PyArg_ParseTuple(args, "s", &text)) |
From: Mark H. <mha...@us...> - 2004-04-15 07:56:35
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16981 Modified Files: win32netcon.py Log Message: Hex constants to decimal. Index: win32netcon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32netcon.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** win32netcon.py 18 Dec 1999 08:53:35 -0000 1.2 --- win32netcon.py 15 Apr 2004 07:56:22 -0000 1.3 *************** *** 50,64 **** PLATFORM_ID_VMS = 700 MAX_LANMAN_MESSAGE_ID = 5799 ! UF_SCRIPT = 0x0001 ! UF_ACCOUNTDISABLE = 0x0002 ! UF_HOMEDIR_REQUIRED = 0x0008 ! UF_LOCKOUT = 0x0010 ! UF_PASSWD_NOTREQD = 0x0020 ! UF_PASSWD_CANT_CHANGE = 0x0040 ! UF_TEMP_DUPLICATE_ACCOUNT = 0x0100 ! UF_NORMAL_ACCOUNT = 0x0200 ! UF_INTERDOMAIN_TRUST_ACCOUNT = 0x0800 ! UF_WORKSTATION_TRUST_ACCOUNT = 0x1000 ! UF_SERVER_TRUST_ACCOUNT = 0x2000 UF_MACHINE_ACCOUNT_MASK = ( UF_INTERDOMAIN_TRUST_ACCOUNT | \ UF_WORKSTATION_TRUST_ACCOUNT | \ --- 50,64 ---- PLATFORM_ID_VMS = 700 MAX_LANMAN_MESSAGE_ID = 5799 ! UF_SCRIPT = 1 ! UF_ACCOUNTDISABLE = 2 ! UF_HOMEDIR_REQUIRED = 8 ! UF_LOCKOUT = 16 ! UF_PASSWD_NOTREQD = 32 ! UF_PASSWD_CANT_CHANGE = 64 ! UF_TEMP_DUPLICATE_ACCOUNT = 256 ! UF_NORMAL_ACCOUNT = 512 ! UF_INTERDOMAIN_TRUST_ACCOUNT = 2048 ! UF_WORKSTATION_TRUST_ACCOUNT = 4096 ! UF_SERVER_TRUST_ACCOUNT = 8192 UF_MACHINE_ACCOUNT_MASK = ( UF_INTERDOMAIN_TRUST_ACCOUNT | \ UF_WORKSTATION_TRUST_ACCOUNT | \ *************** *** 71,76 **** UF_SERVER_TRUST_ACCOUNT \ ) ! UF_DONT_EXPIRE_PASSWD = 0x10000 ! UF_MNS_LOGON_ACCOUNT = 0x20000 UF_SETTABLE_BITS = ( \ UF_SCRIPT | \ --- 71,76 ---- UF_SERVER_TRUST_ACCOUNT \ ) ! UF_DONT_EXPIRE_PASSWD = 65536 ! UF_MNS_LOGON_ACCOUNT = 131072 UF_SETTABLE_BITS = ( \ UF_SCRIPT | \ *************** *** 84,97 **** UF_MNS_LOGON_ACCOUNT \ ) ! FILTER_TEMP_DUPLICATE_ACCOUNT = (0x0001) ! FILTER_NORMAL_ACCOUNT = (0x0002) ! FILTER_INTERDOMAIN_TRUST_ACCOUNT = (0x0008) ! FILTER_WORKSTATION_TRUST_ACCOUNT = (0x0010) ! FILTER_SERVER_TRUST_ACCOUNT = (0x0020) ! LG_INCLUDE_INDIRECT = (0x0001) ! AF_OP_PRINT = 0x1 ! AF_OP_COMM = 0x2 ! AF_OP_SERVER = 0x4 ! AF_OP_ACCOUNTS = 0x8 AF_SETTABLE_BITS = (AF_OP_PRINT | AF_OP_COMM | \ AF_OP_SERVER | AF_OP_ACCOUNTS) --- 84,97 ---- UF_MNS_LOGON_ACCOUNT \ ) ! FILTER_TEMP_DUPLICATE_ACCOUNT = (1) ! FILTER_NORMAL_ACCOUNT = (2) ! FILTER_INTERDOMAIN_TRUST_ACCOUNT = (8) ! FILTER_WORKSTATION_TRUST_ACCOUNT = (16) ! FILTER_SERVER_TRUST_ACCOUNT = (32) ! LG_INCLUDE_INDIRECT = (1) ! AF_OP_PRINT = 1 ! AF_OP_COMM = 2 ! AF_OP_SERVER = 4 ! AF_OP_ACCOUNTS = 8 AF_SETTABLE_BITS = (AF_OP_PRINT | AF_OP_COMM | \ AF_OP_SERVER | AF_OP_ACCOUNTS) *************** *** 183,187 **** UNITS_PER_DAY = 24 UNITS_PER_WEEK = UNITS_PER_DAY * 7 ! USER_PRIV_MASK = 0x3 USER_PRIV_GUEST = 0 USER_PRIV_USER = 1 --- 183,187 ---- UNITS_PER_DAY = 24 UNITS_PER_WEEK = UNITS_PER_DAY * 7 ! USER_PRIV_MASK = 3 USER_PRIV_GUEST = 0 USER_PRIV_USER = 1 *************** *** 226,230 **** MODALS_DOMAIN_ID_INFOLEVEL = \ (PARMNUM_BASE_INFOLEVEL + MODALS_DOMAIN_ID_PARMNUM) ! GROUPIDMASK = 0x8000 GROUP_ALL_PARMNUM = 0 GROUP_NAME_PARMNUM = 1 --- 226,230 ---- MODALS_DOMAIN_ID_INFOLEVEL = \ (PARMNUM_BASE_INFOLEVEL + MODALS_DOMAIN_ID_PARMNUM) ! GROUPIDMASK = 32768 GROUP_ALL_PARMNUM = 0 GROUP_NAME_PARMNUM = 1 *************** *** 243,265 **** MAXPERMENTRIES = 64 ACCESS_NONE = 0 ! ACCESS_READ = 0x01 ! ACCESS_WRITE = 0x02 ! ACCESS_CREATE = 0x04 ! ACCESS_EXEC = 0x08 ! ACCESS_DELETE = 0x10 ! ACCESS_ATRIB = 0x20 ! ACCESS_PERM = 0x40 ! ACCESS_GROUP = 0x8000 ! ACCESS_AUDIT = 0x1 ! ACCESS_SUCCESS_OPEN = 0x10 ! ACCESS_SUCCESS_WRITE = 0x20 ! ACCESS_SUCCESS_DELETE = 0x40 ! ACCESS_SUCCESS_ACL = 0x80 ! ACCESS_SUCCESS_MASK = 0xF0 ! ACCESS_FAIL_OPEN = 0x100 ! ACCESS_FAIL_WRITE = 0x200 ! ACCESS_FAIL_DELETE = 0x400 ! ACCESS_FAIL_ACL = 0x800 ! ACCESS_FAIL_MASK = 0xF00 ACCESS_FAIL_SHIFT = 4 ACCESS_RESOURCE_NAME_PARMNUM = 1 --- 243,265 ---- MAXPERMENTRIES = 64 ACCESS_NONE = 0 ! ACCESS_READ = 1 ! ACCESS_WRITE = 2 ! ACCESS_CREATE = 4 ! ACCESS_EXEC = 8 ! ACCESS_DELETE = 16 ! ACCESS_ATRIB = 32 ! ACCESS_PERM = 64 ! ACCESS_GROUP = 32768 ! ACCESS_AUDIT = 1 ! ACCESS_SUCCESS_OPEN = 16 ! ACCESS_SUCCESS_WRITE = 32 ! ACCESS_SUCCESS_DELETE = 64 ! ACCESS_SUCCESS_ACL = 128 ! ACCESS_SUCCESS_MASK = 240 ! ACCESS_FAIL_OPEN = 256 ! ACCESS_FAIL_WRITE = 512 ! ACCESS_FAIL_DELETE = 1024 ! ACCESS_FAIL_ACL = 2048 ! ACCESS_FAIL_MASK = 3840 ACCESS_FAIL_SHIFT = 4 ACCESS_RESOURCE_NAME_PARMNUM = 1 *************** *** 284,296 **** NETLOGON_CONTROL_TRANSPORT_NOTIFY = 7 NETLOGON_CONTROL_FIND_USER = 8 ! NETLOGON_CONTROL_UNLOAD_NETLOGON_DLL = 0xFFFB ! NETLOGON_CONTROL_BACKUP_CHANGE_LOG = 0xFFFC ! NETLOGON_CONTROL_TRUNCATE_LOG = 0xFFFD ! NETLOGON_CONTROL_SET_DBFLAG = 0xFFFE ! NETLOGON_CONTROL_BREAKPOINT = 0xFFFF ! NETLOGON_REPLICATION_NEEDED = 0x01 ! NETLOGON_REPLICATION_IN_PROGRESS = 0x02 ! NETLOGON_FULL_SYNC_REPLICATION = 0x04 ! NETLOGON_REDO_NEEDED = 0x08 ###################### --- 284,296 ---- NETLOGON_CONTROL_TRANSPORT_NOTIFY = 7 NETLOGON_CONTROL_FIND_USER = 8 ! NETLOGON_CONTROL_UNLOAD_NETLOGON_DLL = 65531 ! NETLOGON_CONTROL_BACKUP_CHANGE_LOG = 65532 ! NETLOGON_CONTROL_TRUNCATE_LOG = 65533 ! NETLOGON_CONTROL_SET_DBFLAG = 65534 ! NETLOGON_CONTROL_BREAKPOINT = 65535 ! NETLOGON_REPLICATION_NEEDED = 1 ! NETLOGON_REPLICATION_IN_PROGRESS = 2 ! NETLOGON_FULL_SYNC_REPLICATION = 4 ! NETLOGON_REDO_NEEDED = 8 ###################### *************** *** 310,314 **** DEF_MAX_PWAGE = TIMEQ_FOREVER DEF_MIN_PWAGE = 0 ! DEF_FORCE_LOGOFF = 0xffffffff ONE_DAY = 01*24*3600 GROUP_SPECIALGRP_USERS = "USERS" --- 310,314 ---- DEF_MAX_PWAGE = TIMEQ_FOREVER DEF_MIN_PWAGE = 0 ! DEF_FORCE_LOGOFF = -1 ONE_DAY = 01*24*3600 GROUP_SPECIALGRP_USERS = "USERS" *************** *** 321,356 **** SV_PLATFORM_ID_OS2 = 400 SV_PLATFORM_ID_NT = 500 ! MAJOR_VERSION_MASK = 0x0F ! SV_TYPE_WORKSTATION = 0x00000001 ! SV_TYPE_SERVER = 0x00000002 ! SV_TYPE_SQLSERVER = 0x00000004 ! SV_TYPE_DOMAIN_CTRL = 0x00000008 ! SV_TYPE_DOMAIN_BAKCTRL = 0x00000010 ! SV_TYPE_TIME_SOURCE = 0x00000020 ! SV_TYPE_AFP = 0x00000040 ! SV_TYPE_NOVELL = 0x00000080 ! SV_TYPE_DOMAIN_MEMBER = 0x00000100 ! SV_TYPE_PRINTQ_SERVER = 0x00000200 ! SV_TYPE_DIALIN_SERVER = 0x00000400 ! SV_TYPE_XENIX_SERVER = 0x00000800 SV_TYPE_SERVER_UNIX = SV_TYPE_XENIX_SERVER ! SV_TYPE_NT = 0x00001000 ! SV_TYPE_WFW = 0x00002000 ! SV_TYPE_SERVER_MFPN = 0x00004000 ! SV_TYPE_SERVER_NT = 0x00008000 ! SV_TYPE_POTENTIAL_BROWSER = 0x00010000 ! SV_TYPE_BACKUP_BROWSER = 0x00020000 ! SV_TYPE_MASTER_BROWSER = 0x00040000 ! SV_TYPE_DOMAIN_MASTER = 0x00080000 ! SV_TYPE_SERVER_OSF = 0x00100000 ! SV_TYPE_SERVER_VMS = 0x00200000 ! SV_TYPE_WINDOWS = 0x00400000 ! SV_TYPE_DFS = 0x00800000 ! SV_TYPE_CLUSTER_NT = 0x01000000 ! SV_TYPE_DCE = 0x10000000 ! SV_TYPE_ALTERNATE_XPORT = 0x20000000 ! SV_TYPE_LOCAL_LIST_ONLY = 0x40000000 ! SV_TYPE_DOMAIN_ENUM = 0x80000000 ! SV_TYPE_ALL = 0xFFFFFFFF SV_NODISC = (-1L) SV_USERSECURITY = 1 --- 321,356 ---- SV_PLATFORM_ID_OS2 = 400 SV_PLATFORM_ID_NT = 500 ! MAJOR_VERSION_MASK = 15 ! SV_TYPE_WORKSTATION = 1 ! SV_TYPE_SERVER = 2 ! SV_TYPE_SQLSERVER = 4 ! SV_TYPE_DOMAIN_CTRL = 8 ! SV_TYPE_DOMAIN_BAKCTRL = 16 ! SV_TYPE_TIME_SOURCE = 32 ! SV_TYPE_AFP = 64 ! SV_TYPE_NOVELL = 128 ! SV_TYPE_DOMAIN_MEMBER = 256 ! SV_TYPE_PRINTQ_SERVER = 512 ! SV_TYPE_DIALIN_SERVER = 1024 ! SV_TYPE_XENIX_SERVER = 2048 SV_TYPE_SERVER_UNIX = SV_TYPE_XENIX_SERVER ! SV_TYPE_NT = 4096 ! SV_TYPE_WFW = 8192 ! SV_TYPE_SERVER_MFPN = 16384 ! SV_TYPE_SERVER_NT = 32768 ! SV_TYPE_POTENTIAL_BROWSER = 65536 ! SV_TYPE_BACKUP_BROWSER = 131072 ! SV_TYPE_MASTER_BROWSER = 262144 ! SV_TYPE_DOMAIN_MASTER = 524288 ! SV_TYPE_SERVER_OSF = 1048576 ! SV_TYPE_SERVER_VMS = 2097152 ! SV_TYPE_WINDOWS = 4194304 ! SV_TYPE_DFS = 8388608 ! SV_TYPE_CLUSTER_NT = 16777216 ! SV_TYPE_DCE = 268435456 ! SV_TYPE_ALTERNATE_XPORT = 536870912 ! SV_TYPE_LOCAL_LIST_ONLY = 1073741824 ! SV_TYPE_DOMAIN_ENUM = -2147483648 ! SV_TYPE_ALL = -1 SV_NODISC = (-1L) SV_USERSECURITY = 1 *************** *** 492,500 **** SVI2_NUM_ELEMENTS = 40 SVI3_NUM_ELEMENTS = 44 ! SW_AUTOPROF_LOAD_MASK = 0x1 ! SW_AUTOPROF_SAVE_MASK = 0x2 SV_MAX_SRV_HEUR_LEN = 32 SV_USERS_PER_LICENSE = 5 ! SVTI2_REMAP_PIPE_NAMES = 0x2 # Generated by h2py from lmshare.h --- 492,500 ---- SVI2_NUM_ELEMENTS = 40 SVI3_NUM_ELEMENTS = 44 ! SW_AUTOPROF_LOAD_MASK = 1 ! SW_AUTOPROF_SAVE_MASK = 2 SV_MAX_SRV_HEUR_LEN = 32 SV_USERS_PER_LICENSE = 5 ! SVTI2_REMAP_PIPE_NAMES = 2 # Generated by h2py from lmshare.h *************** *** 514,526 **** STYPE_DEVICE = 2 STYPE_IPC = 3 ! STYPE_SPECIAL = 0x80000000 ! SHI1005_FLAGS_DFS = 0x01 ! SHI1005_FLAGS_DFS_ROOT = 0x02 ! COW_PERMACHINE = 0x04 ! COW_PERUSER = 0x08 ! CSC_CACHEABLE = 0x10 ! CSC_NOFLOWOPS = 0x20 ! CSC_AUTO_INWARD = 0x40 ! CSC_AUTO_OUTWARD = 0x80 SHI1005_VALID_FLAGS_SET = ( CSC_CACHEABLE | \ CSC_NOFLOWOPS | \ --- 514,526 ---- STYPE_DEVICE = 2 STYPE_IPC = 3 ! STYPE_SPECIAL = -2147483648 ! SHI1005_FLAGS_DFS = 1 ! SHI1005_FLAGS_DFS_ROOT = 2 ! COW_PERMACHINE = 4 ! COW_PERUSER = 8 ! CSC_CACHEABLE = 16 ! CSC_NOFLOWOPS = 32 ! CSC_AUTO_INWARD = 64 ! CSC_AUTO_OUTWARD = 128 SHI1005_VALID_FLAGS_SET = ( CSC_CACHEABLE | \ CSC_NOFLOWOPS | \ *************** *** 530,637 **** COW_PERUSER ) SHI1007_VALID_FLAGS_SET = SHI1005_VALID_FLAGS_SET ! SESS_GUEST = 0x00000001 ! SESS_NOENCRYPTION = 0x00000002 SESI1_NUM_ELEMENTS = 8 SESI2_NUM_ELEMENTS = 9 ! PERM_FILE_READ = 0x1 ! PERM_FILE_WRITE = 0x2 ! PERM_FILE_CREATE = 0x4 # Generated by h2py from d:\mssdk\include\winnetwk.h ! WNNC_NET_MSNET = 0x00010000 ! WNNC_NET_LANMAN = 0x00020000 ! WNNC_NET_NETWARE = 0x00030000 ! WNNC_NET_VINES = 0x00040000 ! WNNC_NET_10NET = 0x00050000 ! WNNC_NET_LOCUS = 0x00060000 ! WNNC_NET_SUN_PC_NFS = 0x00070000 ! WNNC_NET_LANSTEP = 0x00080000 ! WNNC_NET_9TILES = 0x00090000 ! WNNC_NET_LANTASTIC = 0x000A0000 ! WNNC_NET_AS400 = 0x000B0000 ! WNNC_NET_FTP_NFS = 0x000C0000 ! WNNC_NET_PATHWORKS = 0x000D0000 ! WNNC_NET_LIFENET = 0x000E0000 ! WNNC_NET_POWERLAN = 0x000F0000 ! WNNC_NET_BWNFS = 0x00100000 ! WNNC_NET_COGENT = 0x00110000 ! WNNC_NET_FARALLON = 0x00120000 ! WNNC_NET_APPLETALK = 0x00130000 ! WNNC_NET_INTERGRAPH = 0x00140000 ! WNNC_NET_SYMFONET = 0x00150000 ! WNNC_NET_CLEARCASE = 0x00160000 ! WNNC_NET_FRONTIER = 0x00170000 ! WNNC_NET_BMC = 0x00180000 ! WNNC_NET_DCE = 0x00190000 ! WNNC_NET_DECORB = 0x00200000 ! WNNC_NET_PROTSTOR = 0x00210000 ! WNNC_NET_FJ_REDIR = 0x00220000 ! WNNC_NET_DISTINCT = 0x00230000 ! WNNC_NET_TWINS = 0x00240000 ! WNNC_NET_RDR2SAMPLE = 0x00250000 ! RESOURCE_CONNECTED = 0x00000001 ! RESOURCE_GLOBALNET = 0x00000002 ! RESOURCE_REMEMBERED = 0x00000003 ! RESOURCE_RECENT = 0x00000004 ! RESOURCE_CONTEXT = 0x00000005 ! RESOURCETYPE_ANY = 0x00000000 ! RESOURCETYPE_DISK = 0x00000001 ! RESOURCETYPE_PRINT = 0x00000002 ! RESOURCETYPE_RESERVED = 0x00000008 ! RESOURCETYPE_UNKNOWN = 0xFFFFFFFF ! RESOURCEUSAGE_CONNECTABLE = 0x00000001 ! RESOURCEUSAGE_CONTAINER = 0x00000002 ! RESOURCEUSAGE_NOLOCALDEVICE = 0x00000004 ! RESOURCEUSAGE_SIBLING = 0x00000008 ! RESOURCEUSAGE_ATTACHED = 0x00000010 RESOURCEUSAGE_ALL = (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED) ! RESOURCEUSAGE_RESERVED = 0x80000000 ! RESOURCEDISPLAYTYPE_GENERIC = 0x00000000 ! RESOURCEDISPLAYTYPE_DOMAIN = 0x00000001 ! RESOURCEDISPLAYTYPE_SERVER = 0x00000002 ! RESOURCEDISPLAYTYPE_SHARE = 0x00000003 ! RESOURCEDISPLAYTYPE_FILE = 0x00000004 ! RESOURCEDISPLAYTYPE_GROUP = 0x00000005 ! RESOURCEDISPLAYTYPE_NETWORK = 0x00000006 ! RESOURCEDISPLAYTYPE_ROOT = 0x00000007 ! RESOURCEDISPLAYTYPE_SHAREADMIN = 0x00000008 ! RESOURCEDISPLAYTYPE_DIRECTORY = 0x00000009 ! RESOURCEDISPLAYTYPE_TREE = 0x0000000A ! RESOURCEDISPLAYTYPE_NDSCONTAINER = 0x0000000B NETPROPERTY_PERSISTENT = 1 ! CONNECT_UPDATE_PROFILE = 0x00000001 ! CONNECT_UPDATE_RECENT = 0x00000002 ! CONNECT_TEMPORARY = 0x00000004 ! CONNECT_INTERACTIVE = 0x00000008 ! CONNECT_PROMPT = 0x00000010 ! CONNECT_NEED_DRIVE = 0x00000020 ! CONNECT_REFCOUNT = 0x00000040 ! CONNECT_REDIRECT = 0x00000080 ! CONNECT_LOCALDRIVE = 0x00000100 ! CONNECT_CURRENT_MEDIA = 0x00000200 ! CONNECT_DEFERRED = 0x00000400 ! CONNECT_RESERVED = 0xFF000000 ! CONNDLG_RO_PATH = 0x00000001 ! CONNDLG_CONN_POINT = 0x00000002 ! CONNDLG_USE_MRU = 0x00000004 ! CONNDLG_HIDE_BOX = 0x00000008 ! CONNDLG_PERSIST = 0x00000010 ! CONNDLG_NOT_PERSIST = 0x00000020 ! DISC_UPDATE_PROFILE = 0x00000001 ! DISC_NO_FORCE = 0x00000040 ! UNIVERSAL_NAME_INFO_LEVEL = 0x00000001 ! REMOTE_NAME_INFO_LEVEL = 0x00000002 ! WNFMT_MULTILINE = 0x01 ! WNFMT_ABBREVIATED = 0x02 ! WNFMT_INENUM = 0x10 ! WNFMT_CONNECTION = 0x20 ! NETINFO_DLL16 = 0x00000001 ! NETINFO_DISKRED = 0x00000004 ! NETINFO_PRINTERRED = 0x00000008 ! RP_LOGON = 0x01 ! RP_INIFILE = 0x02 ! PP_DISPLAYERRORS = 0x01 ! WNCON_FORNETCARD = 0x00000001 ! WNCON_NOTROUTED = 0x00000002 ! WNCON_SLOWLINK = 0x00000004 ! WNCON_DYNAMIC = 0x00000008 --- 530,637 ---- COW_PERUSER ) SHI1007_VALID_FLAGS_SET = SHI1005_VALID_FLAGS_SET ! SESS_GUEST = 1 ! SESS_NOENCRYPTION = 2 SESI1_NUM_ELEMENTS = 8 SESI2_NUM_ELEMENTS = 9 ! PERM_FILE_READ = 1 ! PERM_FILE_WRITE = 2 ! PERM_FILE_CREATE = 4 # Generated by h2py from d:\mssdk\include\winnetwk.h ! WNNC_NET_MSNET = 65536 ! WNNC_NET_LANMAN = 131072 ! WNNC_NET_NETWARE = 196608 ! WNNC_NET_VINES = 262144 ! WNNC_NET_10NET = 327680 ! WNNC_NET_LOCUS = 393216 ! WNNC_NET_SUN_PC_NFS = 458752 ! WNNC_NET_LANSTEP = 524288 ! WNNC_NET_9TILES = 589824 ! WNNC_NET_LANTASTIC = 655360 ! WNNC_NET_AS400 = 720896 ! WNNC_NET_FTP_NFS = 786432 ! WNNC_NET_PATHWORKS = 851968 ! WNNC_NET_LIFENET = 917504 ! WNNC_NET_POWERLAN = 983040 ! WNNC_NET_BWNFS = 1048576 ! WNNC_NET_COGENT = 1114112 ! WNNC_NET_FARALLON = 1179648 ! WNNC_NET_APPLETALK = 1245184 ! WNNC_NET_INTERGRAPH = 1310720 ! WNNC_NET_SYMFONET = 1376256 ! WNNC_NET_CLEARCASE = 1441792 ! WNNC_NET_FRONTIER = 1507328 ! WNNC_NET_BMC = 1572864 ! WNNC_NET_DCE = 1638400 ! WNNC_NET_DECORB = 2097152 ! WNNC_NET_PROTSTOR = 2162688 ! WNNC_NET_FJ_REDIR = 2228224 ! WNNC_NET_DISTINCT = 2293760 ! WNNC_NET_TWINS = 2359296 ! WNNC_NET_RDR2SAMPLE = 2424832 ! RESOURCE_CONNECTED = 1 ! RESOURCE_GLOBALNET = 2 ! RESOURCE_REMEMBERED = 3 ! RESOURCE_RECENT = 4 ! RESOURCE_CONTEXT = 5 ! RESOURCETYPE_ANY = 0 ! RESOURCETYPE_DISK = 1 ! RESOURCETYPE_PRINT = 2 ! RESOURCETYPE_RESERVED = 8 ! RESOURCETYPE_UNKNOWN = -1 ! RESOURCEUSAGE_CONNECTABLE = 1 ! RESOURCEUSAGE_CONTAINER = 2 ! RESOURCEUSAGE_NOLOCALDEVICE = 4 ! RESOURCEUSAGE_SIBLING = 8 ! RESOURCEUSAGE_ATTACHED = 16 RESOURCEUSAGE_ALL = (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED) ! RESOURCEUSAGE_RESERVED = -2147483648 ! RESOURCEDISPLAYTYPE_GENERIC = 0 ! RESOURCEDISPLAYTYPE_DOMAIN = 1 ! RESOURCEDISPLAYTYPE_SERVER = 2 ! RESOURCEDISPLAYTYPE_SHARE = 3 ! RESOURCEDISPLAYTYPE_FILE = 4 ! RESOURCEDISPLAYTYPE_GROUP = 5 ! RESOURCEDISPLAYTYPE_NETWORK = 6 ! RESOURCEDISPLAYTYPE_ROOT = 7 ! RESOURCEDISPLAYTYPE_SHAREADMIN = 8 ! RESOURCEDISPLAYTYPE_DIRECTORY = 9 ! RESOURCEDISPLAYTYPE_TREE = 10 ! RESOURCEDISPLAYTYPE_NDSCONTAINER = 11 NETPROPERTY_PERSISTENT = 1 ! CONNECT_UPDATE_PROFILE = 1 ! CONNECT_UPDATE_RECENT = 2 ! CONNECT_TEMPORARY = 4 ! CONNECT_INTERACTIVE = 8 ! CONNECT_PROMPT = 16 ! CONNECT_NEED_DRIVE = 32 ! CONNECT_REFCOUNT = 64 ! CONNECT_REDIRECT = 128 ! CONNECT_LOCALDRIVE = 256 ! CONNECT_CURRENT_MEDIA = 512 ! CONNECT_DEFERRED = 1024 ! CONNECT_RESERVED = -16777216 ! CONNDLG_RO_PATH = 1 ! CONNDLG_CONN_POINT = 2 ! CONNDLG_USE_MRU = 4 ! CONNDLG_HIDE_BOX = 8 ! CONNDLG_PERSIST = 16 ! CONNDLG_NOT_PERSIST = 32 ! DISC_UPDATE_PROFILE = 1 ! DISC_NO_FORCE = 64 ! UNIVERSAL_NAME_INFO_LEVEL = 1 ! REMOTE_NAME_INFO_LEVEL = 2 ! WNFMT_MULTILINE = 1 ! WNFMT_ABBREVIATED = 2 ! WNFMT_INENUM = 16 ! WNFMT_CONNECTION = 32 ! NETINFO_DLL16 = 1 ! NETINFO_DISKRED = 4 ! NETINFO_PRINTERRED = 8 ! RP_LOGON = 1 ! RP_INIFILE = 2 ! PP_DISPLAYERRORS = 1 ! WNCON_FORNETCARD = 1 ! WNCON_NOTROUTED = 2 ! WNCON_SLOWLINK = 4 ! WNCON_DYNAMIC = 8 |
From: Mark H. <mha...@us...> - 2004-04-15 07:54:52
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16470 Added Files: test_win32rcparser.py Log Message: Test win32rcparser module --- NEW FILE: test_win32rcparser.py --- import sys, os import unittest import win32rcparser class TestParser(unittest.TestCase): def setUp(self): rc_file = os.path.join(os.path.dirname(__file__), "win32rcparser", "test.rc") self.resources = win32rcparser.Parse(rc_file) def testStrings(self): for sid, expected in [ ("IDS_TEST_STRING4", "Test 'single quoted' string"), ("IDS_TEST_STRING1", 'Test "quoted" string'), ("IDS_TEST_STRING3", 'String with single " quote'), ("IDS_TEST_STRING2", 'Test string'), ]: got = self.resources.stringTable[sid].value self.assertEqual(got, expected) if __name__=='__main__': unittest.main() |
From: Mark H. <mha...@us...> - 2004-04-15 07:53:56
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16207 Added Files: test_win32net.py Log Message: Tests for the win32net module. --- NEW FILE: test_win32net.py --- import unittest import win32net, win32netcon class TestCase(unittest.TestCase): def testGroupsGoodResume(self, server=None): res=0 level=0 #setting it to 1 will provide more detailed info while True: (user_list,total,res)=win32net.NetGroupEnum(server,level,res) for i in user_list: pass if not res: break def testGroupsBadResume(self, server=None): res=1 # Can't pass this first time round. self.assertRaises(win32net.error, win32net.NetGroupEnum, server,0,res) if __name__ == '__main__': unittest.main() |
From: Mark H. <mha...@us...> - 2004-04-15 07:52:40
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15928 Modified Files: shell.cpp Log Message: Correct flag checking in SHChangeNotify - now you can pass modifiers as well as type flags. Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** shell.cpp 15 Apr 2004 05:53:34 -0000 1.20 --- shell.cpp 15 Apr 2004 07:52:32 -0000 1.21 *************** *** 1147,1151 **** void *p1, *p2; ! if (flags == SHCNF_DWORD) { if (!PyInt_Check(ob1) || !(ob2==Py_None || PyInt_Check(ob2))) { PyErr_SetString(PyExc_TypeError, "SHCNF_DWORD is set - items must be integers"); --- 1147,1151 ---- void *p1, *p2; ! if ((flags & SHCNF_DWORD)== SHCNF_DWORD) { if (!PyInt_Check(ob1) || !(ob2==Py_None || PyInt_Check(ob2))) { PyErr_SetString(PyExc_TypeError, "SHCNF_DWORD is set - items must be integers"); *************** *** 1154,1158 **** p1 = (void *)PyInt_AsLong(ob1); p2 = (void *)(ob2==Py_None ? NULL : PyInt_AsLong(ob2)); ! } else if (flags == SHCNF_IDLIST) { ITEMIDLIST *pidl1, *pidl2; if (!PyObject_AsPIDL(ob1, &pidl1, FALSE)) --- 1154,1158 ---- p1 = (void *)PyInt_AsLong(ob1); p2 = (void *)(ob2==Py_None ? NULL : PyInt_AsLong(ob2)); ! } else if ((flags & SHCNF_IDLIST)==SHCNF_IDLIST) { ITEMIDLIST *pidl1, *pidl2; if (!PyObject_AsPIDL(ob1, &pidl1, FALSE)) *************** *** 1164,1168 **** p1 = (void *)pidl1; p2 = (void *)pidl2; ! } else if (flags == SHCNF_PATH || flags == SHCNF_PRINTER) { if (!PyString_Check(ob1) || !(ob2==Py_None || PyString_Check(ob2))) { PyErr_SetString(PyExc_TypeError, "SHCNF_PATH/PRINTER is set - items must be strings"); --- 1164,1168 ---- p1 = (void *)pidl1; p2 = (void *)pidl2; ! } else if ((flags & SHCNF_PATH) || (flags & SHCNF_PRINTER)) { if (!PyString_Check(ob1) || !(ob2==Py_None || PyString_Check(ob2))) { PyErr_SetString(PyExc_TypeError, "SHCNF_PATH/PRINTER is set - items must be strings"); *************** *** 1172,1177 **** p2 = (void *)(ob2==Py_None ? NULL : PyString_AsString(ob2)); } else { ! PyErr_SetString(PyExc_ValueError, "unknown data flags"); ! return NULL; } PY_INTERFACE_PRECALL; --- 1172,1176 ---- p2 = (void *)(ob2==Py_None ? NULL : PyString_AsString(ob2)); } else { ! return PyErr_Format(PyExc_ValueError, "unknown data flags 0x%x", flags); } PY_INTERFACE_PRECALL; |
From: Mark H. <mha...@us...> - 2004-04-15 07:51:38
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15346 Modified Files: gencache.py Log Message: Handle strangeness in QueryPathOfRegTypeLib() - an extra \0 is added under windows, but not in the mainwin toolkit. Handle this. Also handle unicode better - if the platform supports unicode, don't convert at all - but fallback to string conversion if necessary. Drop the assertion about mod.__dict__._in_gencache_ - this can happen if the module is being reloaded. Index: gencache.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/gencache.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** gencache.py 20 Jan 2004 22:58:24 -0000 1.27 --- gencache.py 15 Apr 2004 07:51:29 -0000 1.28 *************** *** 418,421 **** --- 418,432 ---- try: typLibPath = pythoncom.QueryPathOfRegTypeLib(typelibCLSID, major, minor, lcid) + # windows seems to add an extra \0 (via the underlying BSTR) + # The mainwin toolkit does not add this erroneous \0 + if typLibPath[-1]=='\0': + typLibPath=typLibPath[:-1] + suf = getattr(os.path, "supports_unicode_filenames", 0) + if not suf: + # can't pass unicode filenames directly - convert + try: + typLibPath=typLibPath.encode(sys.getfilesystemencoding()) + except AttributeError: # no sys.getfilesystemencoding + typLibPath=str(typLibPath) tlbAttributes = pythoncom.LoadRegTypeLib(typelibCLSID, major, minor, lcid).GetLibAttr() except pythoncom.com_error: *************** *** 434,443 **** filePathPyc = filePathPyc + "o" # Verify that type library is up to date. - #print "Grabbing typelib" - # If the following doesn't throw an exception, then we have a valid type library - typLibPath = pythoncom.QueryPathOfRegTypeLib(typelibCLSID, major, minor, lcid) - tlbAttributes = pythoncom.LoadRegTypeLib(typelibCLSID, major, minor, lcid).GetLibAttr() - #print "Grabbed typelib: ", tlbAttributes[3], tlbAttributes[4] - ##print module.MinorVersion # If we have a differing MinorVersion or genpy has bumped versions, update the file import genpy --- 445,448 ---- *************** *** 479,483 **** #print "Trying stat typelib", pyModTime #print str(typLibPath) ! typLibModTime = os.stat(str(typLibPath[:-1]))[8] if fModTimeSet and (typLibModTime > pyModTime): bReloadNeeded = 1 --- 484,488 ---- #print "Trying stat typelib", pyModTime #print str(typLibPath) ! typLibModTime = os.stat(typLibPath)[8] if fModTimeSet and (typLibModTime > pyModTime): bReloadNeeded = 1 *************** *** 544,549 **** fname = GetGeneratedFileName(typelibclsid, lcid, major, minor) mod = _GetModule(fname) ! assert not mod.__dict__.has_key("_in_gencache_"), \ ! "This module has already been processed by this process" mod._in_gencache_ = 1 dict = mod.CLSIDToClassMap --- 549,554 ---- fname = GetGeneratedFileName(typelibclsid, lcid, major, minor) mod = _GetModule(fname) ! # if mod._in_gencache_ is already true, then we are reloading this ! # module - this doesn't mean anything special though! mod._in_gencache_ = 1 dict = mod.CLSIDToClassMap |
From: Mark H. <mha...@us...> - 2004-04-15 05:53:43
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29691 Modified Files: shell.cpp Log Message: * Fix a bug that would have prevented many PIDLs from not being freed. * Add SHFileOperation (but multiple filenames not yet supported) Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** shell.cpp 10 Apr 2004 05:18:40 -0000 1.19 --- shell.cpp 15 Apr 2004 05:53:34 -0000 1.20 *************** *** 78,81 **** --- 78,82 ---- return Py_None; } + LPCITEMIDLIST pidl_free = pidl; PyObject *ret = PyList_New(0); if (!ret) *************** *** 103,107 **** } if (bFreeSystemPIDL) ! PyShell_FreeMem( (void *)pidl); return ret; } --- 104,108 ---- } if (bFreeSystemPIDL) ! PyShell_FreeMem( (void *)pidl_free); return ret; } *************** *** 653,656 **** --- 654,732 ---- } + static BOOL MakeDoubleTerminatedStringList(PyObject *ob, TCHAR **ret) + { + if (ob==Py_None) { + *ret = NULL; + return TRUE; + } + if (PyString_Check(ob) || PyUnicode_Check(ob)) { + // single string specified. + DWORD len; + TCHAR *sz; + if (!PyWinObject_AsTCHAR(ob, &sz, FALSE, &len)) + return FALSE; + *ret = (TCHAR *)malloc( sizeof(TCHAR) * (len+2) ); + if (!*ret) + PyErr_NoMemory(); + else { + _tcscpy(*ret, sz); + (*ret)[len+1] = '\0'; // second term. + } + PyWinObject_FreeTCHAR(sz); + return TRUE; + } + + if (!PySequence_Check(ob)) { + PyErr_Format(PyExc_TypeError, + "Must be a string or sequence of strings (got '%s')", ob->ob_type->tp_name); + return FALSE; + } + PyErr_Format(PyExc_RuntimeError, "Sequences of names not yet supported"); + return FALSE; + } + + void PyObject_FreeSHFILEOPSTRUCT(SHFILEOPSTRUCT *p) + { + if (p->pFrom) + free((void *)p->pFrom); + if (p->pTo) + free((void *)p->pTo); + if (p->lpszProgressTitle) + PyWinObject_FreeTCHAR((TCHAR *)p->lpszProgressTitle); + } + + // @object SHFILEOPSTRUCT|A tuple representing a Win32 shell SHFILEOPSTRUCT structure. + BOOL PyObject_AsSHFILEOPSTRUCT(PyObject *ob, SHFILEOPSTRUCT *p) + { + PyObject *obFrom, *obTo, *obNameMappings = Py_None, *obProgressTitle = Py_None; + memset(p, 0, sizeof(*p)); + if (!PyArg_ParseTuple(ob, "iiOO|iOO", + &p->hwnd, // @tupleitem 0|int|hwnd| + &p->wFunc, // @tupleitem 1|int|wFunc| + &obFrom, // @tupleitem 2|string/list of stringsfrom| + &obTo, // @tupleitem 3|string/list of strings|to| + &p->fFlags, // @tupleitem 4|int|flags|Default=0 + &obNameMappings, // @tupleitem 5|None|nameMappings|Default=None + &obProgressTitle)) // @tupleitem 6|string|progressTitle|Default=None + return FALSE; + + if (obNameMappings != Py_None) { + PyErr_SetString(PyExc_TypeError, "The nameMappings value must be None"); + return FALSE; + } + if (!MakeDoubleTerminatedStringList(obFrom, (LPTSTR *)&p->pFrom)) + goto error; + + if (!MakeDoubleTerminatedStringList(obTo, (LPTSTR *)&p->pTo)) + goto error; + + if (!PyWinObject_AsTCHAR(obProgressTitle, (LPSTR *)&p->lpszProgressTitle, TRUE)) + return FALSE; + return TRUE; + error: + PyObject_FreeSHFILEOPSTRUCT(p); + return FALSE; + } + ////////////////////////////////////////////////// // *************** *** 999,1002 **** --- 1075,1098 ---- } + // @pymethod int, int|shell|SHFileOperation|Copies, moves, renames, or deletes a file system object. + // The result is the int result of the function itself, and the result of the + // fAnyOperationsAborted member after the operation. + static PyObject *PySHFileOperation(PyObject *self, PyObject *args) + { + PyObject *ob; + if (!PyArg_ParseTuple(args, "O:SHFileOperation", + &ob)) // @pyparm <o SHFILEOPSTRUCT>|operation||Defines the operation to perform. + return NULL; + SHFILEOPSTRUCT op; + if (!PyObject_AsSHFILEOPSTRUCT(ob, &op)) + return NULL; + PY_INTERFACE_PRECALL; + int rc = SHFileOperation(&op); + PY_INTERFACE_POSTCALL; + BOOL did_cancel = op.fAnyOperationsAborted; + PyObject_FreeSHFILEOPSTRUCT(&op); + return Py_BuildValue("iO", rc, did_cancel ? Py_True : Py_False); + } + // @pymethod <o PyIShellFolder>|shell|SHGetDesktopFolder|Retrieves the <o PyIShellFolder> interface for the desktop folder, which is the root of the shell's namespace. static PyObject *PySHGetDesktopFolder(PyObject *self, PyObject *args) *************** *** 1297,1300 **** --- 1393,1397 ---- { "SHChangeNotifyDeregister", PySHChangeNotifyDeregister, 1}, // @pymeth SHChangeNotifyDeregister|Unregisters the client's window process from receiving notification events { "SHGetInstanceExplorer", PySHGetInstanceExplorer, 1}, // @pymeth SHGetInstanceExplorer|Allows components that run in a Web browser (Iexplore.exe) or a nondefault Windows® Explorer (Explorer.exe) process to hold a reference to the process. The components can use the reference to prevent the process from closing prematurely. + { "SHFileOperation", PySHFileOperation, 1}, // @pymeth SHFileOperation|Copies, moves, renames, or deletes a file system object. { "StringAsCIDA", PyStringAsCIDA, 1}, // @pymeth StringAsCIDA|Given a CIDA as a raw string, return pidl_folder, [pidl_children, ...] { "CIDAAsString", PyCIDAAsString, 1}, // @pymeth CIDAAsString|Given a (pidl, child_pidls) object, return a CIDA as a string |