python WMI pass by reference

Roger Upole rupole at hotmail.com
Tue Feb 4 22:03:02 EST 2003


import win32com.client
fs=win32com.client.GetObject("winmgmts:win32_logicalFileSecuritySetting.path
='c:\\boot.ini'")
sd=fs.ExecMethod_('GetSecurityDescriptor')
d=sd.Properties_('Descriptor').Value
acl=d.Properties_('DACL').Value
for ace in acl:
    print ace.Properties_('Trustee').Value.Properties_('Name').Value

     hth
        Roger


"Roman Rohr" <rr at oliva.uhk.cz> wrote in message
news:mailman.1044404350.30130.python-list at python.org...
> Can anyone rewrite this small vb script in python?
>
>
getobject("winmgmts:win32_logicalFileSecuritySetting.path='c:\boot.ini'").ge
tsecuritydescriptor sd
> for each t in sd.dacl
>   wscript.echo t.trustee.name
> next
>
> Only first line and passing parameter sd is important. Sorry for
> disturbing with vbscript code, but I hope this is best way to explain my
> problem.
>
> I don't know how to make "pass by reference" in python. In this case how
> to pass variable sd, which should receive object from called function? I
> read nearly everything on the Internet. I know that:
>
> 1. I don't need pass by ref in python at all. Each function can return
> tupple or list.
>
> 2. I can use COM makepy utility and use COM objects without any problem.
> But if I understand well, WMI objects are not COM objects.
>
> Thanks in advance for any hint. First line translated into python is more
> than enough.
>
> Roman
>




-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
   http://www.newsfeed.com       The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----




More information about the Python-list mailing list