How can I access this Win API code?

  • Thread starter Thread starter Leonardo D'Ippolito
  • Start date Start date
Adam, thanks. However, I am looking for a solution without using WMI.
(read my question again)

Any idea?
 
Sorry, I can't believe I missed that...
I'll look around some more. Question though, why are you avoiding WMI?
 
No problem... I am avoiding WMI because I had problems with it. For
example, a Win 98 computer doesn't have WMI service by default .

A solution with Win32 API would work no matter the platform , and wheter WMI
service is started or not.
 
Leonardo D'Ippolito said:
No problem... I am avoiding WMI because I had problems with it. For
example, a Win 98 computer doesn't have WMI service by default .

A solution with Win32 API would work no matter the platform , and wheter
WMI
service is started or not.

This is a very naive assumption, Win32 API's are platform dependent, higher
level COM libraries are invented, just to handle these kind of platform
dependencies.
Take for instance the ip helper iphlpapi.dll, not all OS'ses support all
functions, and some functions return different results depending on the OS.
Consider f.i GetAdaptersInfo, this function should not be used on XP and
W2K3, instead GetAdaptersAddreses should be used.
Are you going to handle all this (correctly) in C# using PInvoke? I'm
affraid you wont.

Willy.
 
Hmm... I haven't tried the code mentioned in the article, I just found it and thought it might be useful to him. The article stated
that it DID work for 95/98/Me/NT/2000/XP. What is wrong with it on 2K/XP?
 
Back
Top