Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adapter name returned by GetAdaptersInfo

558 views
Skip to first unread message

Edward Diener

unread,
Jul 13, 2008, 12:12:42 PM7/13/08
to
The adapter name returned in IP_ADAPTER_INFO by GetAdaptersInfo for the
primary adapter on my computer is a GUID. Is there any way to get a user
friendly name instead ?

The documentation suggests using GetAdapterAddresses on XP and Vista but
I do not see how the information in the latter corresponds to the
information in GetAdaptersInfo nor how I would determine the primary
adapter for the computer. I mention this only because
GetAdapterAddresses supposedly returns a friendly name in
IP_ADAPTER_ADDRESSES.

Kellie Fitton

unread,
Jul 13, 2008, 3:53:08 PM7/13/08
to
On Jul 13, 9:12 am, Edward Diener

Hi,

You can use the following WMI class to get the adapter's
manufacturer and name:

Win32_NetworkAdapter

http://msdn.microsoft.com/en-us/library/aa394216.aspx

Kellie.

Edward Diener

unread,
Jul 13, 2008, 10:51:49 PM7/13/08
to

Thanks but using WMI really sounds like a horror from the MSDN
documentation.

ManicQin

unread,
Jul 14, 2008, 3:34:38 AM7/14/08
to
On Jul 14, 4:51 am, Edward Diener

Try to read the description field and not the name

Volodymyr M. Shcherbyna

unread,
Jul 14, 2008, 5:10:43 AM7/14/08
to
WMI can be called using COM from C++. But you can get description using
GetAdaptersInfo. Take a look at sample
http://msdn.microsoft.com/en-us/library/aa365917(VS.85).aspx

--
Volodymyr, blog: http://www.shcherbyna.com/
(This posting is provided "AS IS" with no warranties, and confers no
rights)

"Edward Diener" <eddielee_n...@tropicsoft.com> wrote in message
news:uvr$PyV5IH...@TK2MSFTNGP05.phx.gbl...

Vishal Swarnkar

unread,
Jul 14, 2008, 7:44:38 AM7/14/08
to
On Jul 14, 2:10 pm, "Volodymyr M. Shcherbyna"

<v_scherb...@online.mvps.org> wrote:
> WMI can be called using COM from C++. But you can get description using
> GetAdaptersInfo. Take a look at samplehttp://msdn.microsoft.com/en-us/library/aa365917(VS.85).aspx

>
> --
> Volodymyr, blog:http://www.shcherbyna.com/
> (This posting is provided "AS IS" with no warranties, and confers no
> rights)
>
> "Edward Diener" <eddielee_no_spam_h...@tropicsoft.com> wrote in message

>
> news:uvr$PyV5IH...@TK2MSFTNGP05.phx.gbl...
>
>
>
> > Kellie Fitton wrote:
> >> On Jul 13, 9:12 am, Edward Diener
> >> <eddielee_no_spam_h...@tropicsoft.com> wrote:
> >>> The adapter name returned in IP_ADAPTER_INFO by GetAdaptersInfo for the
> >>> primary adapter on my computer is a GUID. Is there any way to get a user
> >>> friendly name instead ?
>
> >>> The documentation suggests using GetAdapterAddresses on XP and Vista but
> >>> I do not see how the information in the latter corresponds to the
> >>> information in GetAdaptersInfo nor how I would determine the primary
> >>> adapter for the computer. I mention this only because
> >>> GetAdapterAddresses supposedly returns a friendly name in
> >>> IP_ADAPTER_ADDRESSES.
>
> >> Hi,
>
> >> You can use the following WMI class to get the adapter's
> >> manufacturer and name:
>
> >> Win32_NetworkAdapter
>
> >>http://msdn.microsoft.com/en-us/library/aa394216.aspx
>
> > Thanks but using WMI really sounds like a horror from the MSDN
> > documentation.- Hide quoted text -
>
> - Show quoted text -

Probably u r fetching "AdapterName" from PIP_ADAPTER_INFO structure.
You need to fetch "Description" to get the FriendlyName of the adapter.

Edward Diener

unread,
Jul 14, 2008, 11:30:45 AM7/14/08
to

Yes, I was picking up AdapterName, as well as Description. I will use
Description for the adapter name. I thought AdapterName would be
something general like "Ethernet Local Area Adapter" or something like
that while Description would be somethingm like "VIA Rhine Network Card
etc. etc.".

Vishal Swarnkar

unread,
Jul 15, 2008, 6:26:56 AM7/15/08
to
On Jul 14, 8:30 pm, Edward Diener
> etc. etc.".- Hide quoted text -

>
> - Show quoted text -

Noh its the FriendlyName which you see in Device Manager.

0 new messages