![]() |
|
Welcome to Vista Banter. You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to ask questions and reply to others posts, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact support. |
|
|||||||
| Networking with Windows Vista Networking issues and questions with Windows Vista. (microsoft.public.windows.vista.networking_sharing) |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I need to walk the network connections and determine if I have a live
connection. I've been using INetSharingManager in a delphi function as follows: procedure cNetworkConnected; var pEnum: IEnumVariant; vNetCon: OleVARIANT; dwRetrieved: Cardinal; pUser: PUserType1; NetSharingManager1:INetSharingManager; begin gNetworkConnected := False; NetSharingManager1 := CoNetSharingManager.Create; pEnum := ( NetSharingManager1.EnumEveryConnection._NewEnum as IEnumVariant); while (pEnum.Next(1, vNetCon, dwRetrieved) = S_OK) and not gNetWorkConnected do begin (IUnknown(vNetCon) as INetConnection).GetProperties(pUser); // skip firewire port (1394) if pUser.pszwName '1394 Connection' then begin if (pUser.MediaType = NCM_LAN) and ((pUser.Status = NCS_CONNECTED) or (pUser.Status = NCS_AUTHENTICATION_SUCCEEDED)) then gNetworkConnected := True; if (pUser.MediaType = NCM_PHONE) and (pUser.Status = NCS_CONNECTED) then gNetworkConnected := True; end; end; end; Unfortunately User Account Control in Vista causes this to fail. It works if User Account Control is turned off. MSDN says that this is a deprecated function. How would I walk the network interfaces and get the media type and connection status in a Vista compatible function? |