A Windows Vista forum. Vista Banter

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.

Go Back   Home » Vista Banter forum » Microsoft Windows Vista » Networking with Windows Vista
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Networking with Windows Vista Networking issues and questions with Windows Vista. (microsoft.public.windows.vista.networking_sharing)

Vista Replacement for INetSharingManager function



 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old July 17th 07, 01:33 PM posted to microsoft.public.windows.vista.networking_sharing
jim
external usenet poster
 
Posts: 1
Default Vista Replacement for INetSharingManager function

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?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.Search Engine Optimization by vBSEO 3.0.0 RC6
Copyright ©2004-2012 Vista Banter.
The comments are property of their posters.