Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetAdaptersAddresses
Message
From
10/08/2016 17:12:25
 
 
To
10/08/2016 16:24:18
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
01639334
Message ID:
01639348
Views:
62
>>>>I want to try out this API function:
>>>>
>>>>ULONG WINAPI GetAdaptersAddresses(
>>>> _In_ ULONG Family,
>>>> _In_ ULONG Flags,
>>>> _In_ PVOID Reserved,
>>>> _Inout_ PIP_ADAPTER_ADDRESSES AdapterAddresses,
>>>> _Inout_ PULONG SizePointer
>>>>);
>>>>
>>>>How do I use that in VFP?
>>>>
>>>>See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365915(v=vs.85).aspx for more detail
>>>
>>>If restricted to Vista and upwards, you may consider this alternative:
>>>
>>>
>>>CLEAR
>>>
>>>LOCAL WMIService, AllNetworkAdapters, NetworkAdapter, MACAddress
>>>
>>>m.WMIService = GETOBJECT("winmgmts:\\.\root\cimv2")
>>>
>>>m.AllNetworkAdapters = m.WMIService.ExecQuery("Select * from Win32_NetworkAdapter",,48)
>>>
>>>FOR EACH m.NetworkAdapter IN m.AllNetworkAdapters
>>>	m.MACAddress = m.NetworkAdapter.MACAddress
>>>	IF !ISNULL(m.MACAddress)
>>>		? m.NetworkAdapter.name + ": " + m.MACAddress + " (" + IIF(m.NetworkAdapter.PhysicalAdapter,"","not ") + "physical)"
>>>	ENDIF
>>>ENDFOR
>>>
>>>
>>>Complete set of properties at https://msdn.microsoft.com/en-us/library/aa394216(v=vs.85).aspx
>>
>>Thanks, I've never felt comfortable that the WMI will always be available. I may be wrong, but it can be disabled, can't it?
>
>Yes. But... https://msdn.microsoft.com/en-us/library/aa826517(v=vs.85).aspx

Yes, but I do not want to start something on a client's PC that their IT people have disabled, even if it's only temporarily.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform