| Update of /cvsroot/pywin32/pywin32/com/win32comext/adsi/demos
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15226
Modified Files:
	search.py 
Log Message:
Show how to extract a SID, and remove a workaround for a fixed bug in
the framework.
Index: search.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/adsi/demos/search.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** search.py	24 Sep 2004 07:31:16 -0000	1.1
--- search.py	6 Oct 2004 02:04:49 -0000	1.2
***************
*** 2,6 ****
  from win32com.adsi.adsicon import *
  from win32com.adsi import adsicon
! import pythoncom, pywintypes
  
  options = None # set to optparse options object
--- 2,6 ----
  from win32com.adsi.adsicon import *
  from win32com.adsi import adsicon
! import pythoncom, pywintypes, win32security
  
  options = None # set to optparse options object
***************
*** 19,26 ****
--- 19,30 ----
      return pywintypes.IID(b, True)
  
+ def _sid_from_buffer(b):
+     return str(pywintypes.SID(b))
+ 
  _null_converter = lambda x: x
  
  converters = {
      'objectGUID' : _guid_from_buffer,
+     'objectSid' : _sid_from_buffer,
      'instanceType' : getADsTypeName,
  }
***************
*** 82,87 ****
                  try:
                      data = gc.GetColumn(h, a)
-                     # for some reason we don't get a valid name in this case.
-                     data = a, data[1], data[2]
                      print_attribute(data)
                  except adsi.error, details:
--- 86,89 ----
 |