Post by Ivan Brugiolo [MSFT]About DISP_E_EXCEPTION, I haven't seen the message
Sorry, I'm coming back from a short vacation,
and I skipped 200 messages.
Looks like some marshaling error in the OleAutomaiton code,
but it's hard to tell without context.
Here's the context:
I have written a simple test app "WMI Bridge" in VB .Net, in C#, and in
Java talking via JNI to a .dll that in turn calls wbemdisp to make the
appropriate calls, just to test various settings of WMI. It is working,
but with some caveats I am trying to understand.
When the WMI Bridge starts up, it makes a call to the WMI services
running locally on that box, to make sure it can access WMI. It does
this using a method I named 'doPollAvailability(<machine name>,
<username>, <password>). When it tries to connect locally, it uses null
for both the name and the password arguments, and passes the IP address
of the machine (I have also tried 'localhost', and the actual machine
name of my test box when I experienced the problems outlined below, all
with the same results).
This method gets a reference to an SWbemLocator object, and uses the
standard ConnectServer() call to connect to the machine name that was
passed in. If an error occcurs during this ConnectServer call, the
method returns FALSE, otherwise it returns TRUE.
When I start up this little process on an XP box, it works just fine.
doPollAvailability() returns TRUE. When I move this to a w2k server, I
get an 80020009 exception.
If I start this on the XP box, then make another call and pass the IP
address of the w2k server for it to test from the XP box,
doPollAvailability() returns TRUE for the w2k box, and in fact I can get
all sorts of info via WMI about the w2k box, as long as I ask for it
FROM the XP box, and not trying to host the WMI Bridge app ON the w2k box.
Oh, I can always get all the information I want from the XP box when
running the WMI Bridge on the XP Box, so it isn't a matter of the app
not working on a localhost arrangement - just not when localhost is a
w2k machine, evidently!
One other item that might be important: the XP box is a laptop that was
once part of a domain (but is not any longer). It is part of a workgroup
now, and the w2k server is part of this same workgroup - but it has
NEVER been part of any domain.
Any ideas?
Thx.
Tad