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

GetNetworkParams problems with NT4

0 views
Skip to first unread message

Dirk

unread,
Aug 25, 2003, 12:06:01 PM8/25/03
to
I'm using the GetNetworkParams api call.
When my app is running on NT4 I get an
GetNetworkParams Sizing failed wtih error: 50

after the following sorce:

Error = GetNetworkParams(ByVal 0&, FixedInfoSize)
If Error <> 0 Then
If Error <> ERROR_BUFFER_OVERFLOW Then
dummy = msgbox GetNetworkParams sizing failed with error: " &
Error
Exit Function
End If
End If

On the http://support.microsoft.com/default.aspx?scid=kb;en-us;q234573 you
can see a similar problem.

My test machine is running Windows NT4 SP6a with IE 6.0

The IPHLPAPI.DLL file is version 4.0

Any ideas how to fix this problem?

Peter Huang [MSFT]

unread,
Aug 26, 2003, 7:33:00 AM8/26/03
to
Hi Dirk,

GetNetworkParams is not supported by NT4 , so the error 50 which means
ERROR_NOT_SUPPORTED is the correct return code.
Here is a KB link about the IP Helper APIs.
INFO: IP Helper APIs Add Net Config and Stat Info to Win32 Apps
http://support.microsoft.com/?id=193059

Hope this will help you.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
>From: "Dirk" <di...@woodstone.nu>
>Subject: GetNetworkParams problems with NT4
>Date: Mon, 25 Aug 2003 18:06:01 +0200
>Lines: 36
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
>Message-ID: <#2hPJLya...@TK2MSFTNGP09.phx.gbl>
>Newsgroups: microsoft.public.vb.winapi.networks
>NNTP-Posting-Host: 81-188-4-66.sdsl.easynet.be 81.188.4.66
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.vb.winapi.networks:21133
>X-Tomcat-NG: microsoft.public.vb.winapi.networks

Dirk

unread,
Aug 26, 2003, 7:52:01 AM8/26/03
to
"The IP Helper API (IPHLPAPI) is a public API that provides Windows network
configuration and statistics information to Windows 32-bit applications. The
API is available for Windows NT 4.0 Service Pack 4 and later, and for
Windows 98 and Windows 2000. Not all IP Helper APIs are available for
Windows NT 4.0 and Windows 98 platforms. "


The system is running NT4 SP6a

It's not clear from the article if GetNetworkParams is supporteb by NT4 or
not.
And if it's not, what else can be used (for NT4) to find the DNS server
configured for that host?


dirk.


"Peter Huang [MSFT]" <v-ph...@online.microsoft.com> wrote in message
news:vZT6LX8a...@cpmsftngxa06.phx.gbl...

Peter Huang [MSFT]

unread,
Aug 26, 2003, 9:25:36 AM8/26/03
to
Hi Dirk,

One method is to redirect the output of ipconfig to a file or pipe and then
parse the output.
e.g. ipconfig /all >c:\dnsout.txt

Here is an another alternate method: Applies to Windows NT4.0. You can get
the
information of the DNS IP address in the following registry key
HKEY_LOCAL_MAC
HINE\SYSTEM\CurrentControlSet\Services\TCPIp\parameters.

DhcpNameServer is the key which contains the IP address of the DNS server.
This
parameter specifies the DNS name servers to be queried by Windows Sockets
to re
solve names. It is written by the DHCP client service, if enabled. If the
NameSe
rver parameter has a valid value, then it will override this parameter.

Please let me know if you have any questions or concerns on the above.
It's my
pleasure to be of assistance.


Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
>From: "Dirk" <di...@woodstone.nu>

>References: <#2hPJLya...@TK2MSFTNGP09.phx.gbl>
<vZT6LX8a...@cpmsftngxa06.phx.gbl>
>Subject: Re: GetNetworkParams problems with NT4
>Date: Tue, 26 Aug 2003 13:52:01 +0200
>Lines: 93


>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

>Message-ID: <eH$i3h8aD...@TK2MSFTNGP12.phx.gbl>


>Newsgroups: microsoft.public.vb.winapi.networks
>NNTP-Posting-Host: 81-188-4-66.sdsl.easynet.be 81.188.4.66

>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.vb.winapi.networks:21138
>X-Tomcat-NG: microsoft.public.vb.winapi.networks

Dirk

unread,
Aug 26, 2003, 11:41:24 AM8/26/03
to
And if the system is not a DHCP client?

dirk.

"Peter Huang [MSFT]" <v-ph...@online.microsoft.com> wrote in message

news:BlegCW9a...@cpmsftngxa06.phx.gbl...

Peter Huang [MSFT]

unread,
Aug 26, 2003, 10:52:21 PM8/26/03
to
Hi Dirk,

You may try the WMI class Win32_NetworkAdapterConfiguration.
Here is a link.
http://groups.google.com/groups?q=Win32_NetworkAdapterConfiguration+%22get+d
ns%22&hl=zh-CN&lr=&ie=UTF-8&oe=UTF-8&selm=ejdzYoWGDHA.3804%40tk2msftngp13.ph
x.gbl&rnum=3

If the machine is statically configured then the Ip settings value can be
found
in the following location.


Dns IP address can be found in the following location:

HKEY_LOCAL_MACHINE\system\currentcontrolset\services\tcpip\parameters\NameSe
rver.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
>From: "Dirk" <di...@woodstone.nu>
>References: <#2hPJLya...@TK2MSFTNGP09.phx.gbl>
<vZT6LX8a...@cpmsftngxa06.phx.gbl>

<eH$i3h8aD...@TK2MSFTNGP12.phx.gbl>
<BlegCW9a...@cpmsftngxa06.phx.gbl>


>Subject: Re: GetNetworkParams problems with NT4

>Date: Tue, 26 Aug 2003 17:41:24 +0200
>Lines: 162


>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000

>Message-ID: <u5jQDi#aDHA...@TK2MSFTNGP12.phx.gbl>


>Newsgroups: microsoft.public.vb.winapi.networks
>NNTP-Posting-Host: 81-188-4-66.sdsl.easynet.be 81.188.4.66
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl

>Xref: cpmsftngxa06.phx.gbl microsoft.public.vb.winapi.networks:21140
>X-Tomcat-NG: microsoft.public.vb.winapi.networks

0 new messages