akaraali / winetricks

Automatically exported from code.google.com/p/winetricks
0 stars 0 forks source link

Does WMI actually work? #201

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I used winetricks to install WMI, however when running an application that 
requires it I get a WMI error.

Invalid parameter 
at System.Management.ManagementScope.Initialize() 
at System.Management.ManagementObjectSearcher.Initialize() 
at System.Management.ManagementObjectSearcher.Get() 
At Siemens_EMML.AppIsRegistered.DaysRemaning(Int32 
ProductCode, String Registration, String Signature)

Is there anything I'm missing besides doing sh winetricks wmi?

Original issue reported on code.google.com by Fha...@gmail.com on 24 Apr 2012 at 3:37

GoogleCodeExporter commented 8 years ago
 I don't know much about wmi.  Can you point to a simple script that reproduces the problem?

Original comment by daniel.r...@gmail.com on 24 Apr 2012 at 3:51

GoogleCodeExporter commented 8 years ago
Unfortunately I don't have a sample script on hand, all I have is the 
application I'm trying to run. I can also provide a log of how the application 
interacts with a Windows machine for calls and reports, but that's about all I 
can do given what I know.

Original comment by Fha...@gmail.com on 24 Apr 2012 at 4:20

GoogleCodeExporter commented 8 years ago
I found this example: 
http://stackoverflow.com/questions/4158890/system-management-access-denied

I'm sure I can locate some more that re-create the specific errors, but I don't 
have anything that can re-create everything at once short of this application.

Original comment by Fha...@gmail.com on 25 Apr 2012 at 3:03

GoogleCodeExporter commented 8 years ago
OK, here's a little Javascript example:

WScript.Echo("hello");
/*
 Translated from VB example at
 http://msdn.microsoft.com/en-us/library/windows/desktop/aa394373(v=vs.85).aspx
 */
var obj = GetObject("winmgmts:root\\CIMV2:Win32_Processor='cpu0'");
WScript.Echo("architecture is " + obj.Architecture);
WScript.Echo("goodbye");

Put that in bar.js and run with 'wscript bar.js'.

Under Windows, it shows a numerical CPU type.
Under wine with a clean wineprefix, it displays nothing; wine complains
fixme:jscript:JScript_SetScriptState unimplemented SCRIPTSTATE_INITIALIZED
fixme:wscript:Host_Echo (0x1358b8)

"winetricks wsh57 wscript.exe=native cscript.exe=native" gets it a bit further:
it then outputs

hello
Z:\home\dank\bar.js(6, 1) Microsoft JScript runtime error: File name or class 
name not found during Automation operation

WINEDEBUG=+ole shows, among other things,
trace:ole:MkParseDisplayName (0x13cac0, 
L"winmgmts:root\\CIMV2:Win32_Processor='cpu0'", 0x32f03c, 0x32f048)
warn:ole:CLSIDFromProgID couldn't open key for ProgID L"winmgmts"

A similar script and warning show up in
http://bugs.etersoft.ru/show_bug.cgi?id=3760

Right, so now let's try
  winetricks wmi
This does install all sorts of things into system32/wbem,
but doesn't seem to install a different wmi.dll.  Nevertheless,
it changes the behavior of the test script a bit; the log shows
trace:ole:MkParseDisplayName (0x13cac0, 
L"winmgmts:root\\CIMV2:Win32_Processor='cpu0'", 0x32f03c, 0x32f048)
trace:ole:__CLSIDFromString L"{172BDDF8-CEEA-11D1-8B05-00600806D9B6}" -> 
0x32efd8
but then
err:ole:create_server class {172bddf8-ceea-11d1-8b05-00600806d9b6} not 
registered
fixme:ole:CoGetClassObject CLSCTX_REMOTE_SERVER not supported
err:ole:CoGetClassObject no class object {172bddf8-ceea-11d1-8b05-00600806d9b6} 
could be created for context 0x15
fixme:ole:ProxyCliSec_QueryBlanket (0x142394, 0x32ed64, 0x32ed68, (nil), 
0x32ed98, 0x32ed8c, (nil), 0x32ed7c): stub
fixme:ole:ProxyCliSec_CopyProxy (0x142394, 0x32eda4): stub
Z:\home\dank\bar.js(6, 1) (null): 0x80041001

So something's broken, probably in Wine rather than Winetricks.

Might be time to file a wine bugs for the javascript and 
native wmi problems in this small example.
There are a few wmi bugs already, but none that quite matches this, I think.
I'm out of time for the moment, though.

Original comment by daniel.r...@gmail.com on 25 Apr 2012 at 7:25

GoogleCodeExporter commented 8 years ago
Thank you for your time and effort put into this. I greatly appreciate it.

I will go ahead and open a new bug with Wine for Javascript and WMI problems 
and see how that goes.

Original comment by Fha...@gmail.com on 25 Apr 2012 at 8:05