jascam / CodePlexFoo

0 stars 0 forks source link

Get mac address of physical NIC card from firmware & physical/virtual ethernet identification #298

Open jascam opened 7 years ago

jascam commented 7 years ago

Hi,   I need a small shell based program that prints the mac address of physical ethernet adapter from it's firmware. I need this utility for license generation and appliance activation. I have tried several example but none of them is flawless, The easiest method I have found is to parese the output of "ipconfig /all" command but it has also some drawbacks, finally I am here at MS and hoping that people might help me out. More description:

Firstly program should differentiate between physical and virtual adapters. Physical means installed on board(wired or wireless) or installed additionally. Virtual adapters are those created by VPN or created by virtualization apps such as VirtualBox/VMWare etc. I am not interested in virtual ones. In case of more them one physical adapters(wired and wireless), it should print the mac address and description(name & vendor) of both/all adapters. If media is disconnected then also it should be able to read the mac address and description(name, vendor) of card. This one is bit complex. I have heard there are tools and utility available that changes the mac address to desired one. Although I am not into hardware or network programming but I suppose that even if mac address is changed by some utility, still you can read the mac address that is burned into firmware. Utility should supports 2k/xp/vista/7 (32/64bit) .   Best Regards   Prashant

Attachments

getmac.zip

Migrated CodePlex Work Item Details

CodePlex Work Item ID: '8607' Vote count: '3'

jascam commented 7 years ago

Hello anarki,

Thank you for using our code sample request service.

I'd like to confirm with you my understanding of the sample request:

Your sample idea is that you want some information about network card. In the past, we would usually develop it under the visual c++ 6.0 environment using ddk library. Now we can use P/INVOKE to invoke ddk function .And I guess we can use WMI to implement the same function. I would dive into it and provide feasible scheme to our internal audit system. Thanks for your sample idea.

Is my understanding correct? Please let me know if I misunderstood your needs.

Thanks All-In-One Code Framework http://1code.codeplex.com

This comment was posted by orichisonic on 4/6/2011

jascam commented 7 years ago

Hi orichisonic, Thanks for the updates. I am mainly interested in mac address, provided it is always the mac address of physical ethernet interface and never the mac address of any virtual adapter. Rest of the information(vendor and description of interface) is not that important but if you can get it, it would be great. I have absolutely no experience with ddk and with WMI. I have gathered some solution from the net, if you are interested then I can attach a zip here. Please let me know.

Looking forward for a solution...;-)

Thanks Prashant

This comment was posted by anarki on 4/6/2011

jascam commented 7 years ago

This comment was posted by on 4/6/2011

jascam commented 7 years ago

hi anarki, I have submitted them to our system in order to checking this sample idea. And I find out four ways to solve this issue. So the sample idea mentioned above includes of Various programming schemes. Thank you for your sample idea.

Sincerely All-In-One Code Framework http://1code.codeplex.com

This comment was posted by orichisonic on 4/6/2011

jascam commented 7 years ago

Hi orichisonic, I have tried using NetBIOS, RPC, and SNMP methods as mentioned here: http://tangentsoft.net/wskfaq/ (6.7 - 6.9) but none of them is satisfying the requirements. Keep me posted for any updates.

Thanks

Prashant

This comment was posted by anarki on 4/7/2011

jascam commented 7 years ago

Hi anarki , You should use DeviceIoControl() and createfile() to implement its function. Never mind. I have Submitted this sample idea this afternoon. Thank you for concerning with it.

Sincerely All-In-One Code Framework http://1code.codeplex.com

This comment was posted by orichisonic on 4/7/2011

jascam commented 7 years ago

This comment was posted by on 4/8/2011

jascam commented 7 years ago

Hi orichisonic, I was looking for DeviceIoControl() and createfile() as per you suggestion and found this: http://www.winvistatips.com/oid_xxx_permanent_address-does-not-work-network-adpaters-and-cisco-vpn-t190270.html Is this is the correct way? Later in the post user said that this method is failed to differentiate between virtual and physical adapter. Is there anything missing in this example? I tried building the solution using VS 2005 but lots of error. The file is attached.

Cheers Prashant

This comment was posted by anarki on 4/8/2011

jascam commented 7 years ago

Hi orichisonic, I was looking for DeviceIoControl() and createfile() as per you suggestion and found this: http://www.winvistatips.com/oid_xxx_permanent_address-does-not-work-network-adpaters-and-cisco-vpn-t190270.html Is this is the correct way? Later in the post user said that this method is failed to differentiate between virtual and physical adapter. Is there anything missing in this example? I tried building the solution using VS 2005 but lots of error. The file is attached.

Cheers Prashant

This comment was posted by anarki on 4/8/2011

jascam commented 7 years ago

hi anarki, Never mind. This sample request has been submitted already. It seems that it could be approved. Thanks for your additional sample example.

Thanks All-In-One Code Framework http://1code.codeplex.com

This comment was posted by orichisonic on 4/18/2011

jascam commented 7 years ago

This comment was posted by on 8/28/2011

jascam commented 7 years ago

This comment was posted by on 2/21/2013