Re: GetAdapterInfo and Usage Count Increases
From: Adam Dyba [MS] (adyba_at_online.microsoft.com)
Date: 04/29/04
- Next message: visi: "Re: How to view debug information?"
- Previous message: HASH: "System hangs up on Hard Disk read/writes"
- In reply to: troy anderson: "GetAdapterInfo and Usage Count Increases"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 29 Apr 2004 14:34:29 -0700
GetAdaptersInfo is an IP helper API (IPHLPAPI) function which calls
WSAStartup because it uses some Winsock functions - this call will increment
the usage count. IPHLPAPI actually calls WSAStartup in more than one place,
and the usage count may increase up to 3.
Aside, any well behaved library or application using Winsock (1 or 2) should
call WSAStartup before calling any Winsock functions and call WSACleanup
before exiting. It is valid to call WSAStartup more than once as long as
there will be a corresponding WSACleanup call before library/application
unloads.
Adam
"troy anderson" <tander67@hotmail.com> wrote in message
news:%23R%23JtPeLEHA.3016@tk2msftngp13.phx.gbl...
> Why does the usage count on WinSock increase every time I invoke
> GetAdapterInfo but not for other WinSock APIs like send, recv, etc.?
>
> What happens when the Usage Count raps? Will WinSock unload if it wraps
to
> 0?
>
>
- Next message: visi: "Re: How to view debug information?"
- Previous message: HASH: "System hangs up on Hard Disk read/writes"
- In reply to: troy anderson: "GetAdapterInfo and Usage Count Increases"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|