Reference Counts for Windows Dynamic Libraries (11467)



The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) 3.1
  • Microsoft Windows Software Development Kit (SDK) 3.0

This article was previously published under Q11467

SUMMARY

Libraries are reference counted and remain resident in memory until they cease to be referenced.

When a task module is started and is dynamically linked to the library, the reference count is incremented by 1 (one). When the task module is terminated, the reference count is decremented by 1 (one).

Two functions, LoadLibrary() and FreeLibrary(), affect the reference count. LoadLibrary() increments the reference count by one while FreeLibrary() decrements the reference count by one.

Modification Type:MajorLast Reviewed:2/25/2004
Keywords:kb16bitonly KB11467