[python-win32] How to get a proxy instance of a WMI object.

Tim Golden mail at timgolden.me.uk
Fri Jun 24 16:29:32 CEST 2011


On 24/06/2011 15:09, Graham Bloice wrote:
> On 24/06/2011 14:59, M Saunders TAS wrote:
>>
>> Graham Bloice wrote:
>>> In the Python call to AddVirtualSystemResources() you've reversed the order of the parameters.
>> Additionally the method signature for AddVirtualSystemResources() returns
>> <function AddVirtualSystemResources (ResourceSettingData[], TargetSystem) =>  (Job, NewResources[], ReturnValue)>
>> Which is backwards to the previously demonstrated powershell example.
>>
>> Thanks
>>
>>
> That's really handy, not!

FWIW, the wmi method signature is simply a summary of whatever
the .InParameters & .OutParameters give for that method. Not
sure what PowerShell's doing differently here.

The __setattr__ logic does involve a certain level of cacheing
and redirection, so there definitely is scope for an error in
the WMI code, especially as WMI is most often a read-only or
a method-set technology. (ie the __setattr__ logic probably
hasn't been exercised as much as it might have).

I've contacted the OP off-list to see if we can take it further
with a direct connection.

TJG


More information about the python-win32 mailing list