Share via


FreeLibrary32W

Use the FreeLibrary32W function in 16-bit code to free a 32-bit DLL that it had previously loaded with the LoadLibraryEx32W function.

DWORD FAR PASCAL FreeLibrary32W(
  DWORD hInst
);

Parameters

Return Value

Returns TRUE if successful or FALSE otherwise.

Remarks

The system does not do any cleanup of 32-bit thunk DLLs when the 16-bit application exits. The 16-bit application or DLL must free the 32-bit thunk DLL when it is finished using it.

When linking 16-bit code, you need to import the generic thunking functions from the system kernel. For example, using Microsoft Visual C++, you would create an IMPORTS section in the module definition (.def) file as follows.

IMPORTS
    kernel.CallProcEx32W
    kernel.FreeLibrary32W
    kernel.GetProcAddress32W
    kernel.GetVDMPointer32W
    kernel.LoadLibraryEx32W

**Windows Me/98/95:  **This function releases the Win16Mutex. If this function is called from a 16-bit DLL, it can be reentered as soon as the 32-bit DLL entry-point function is called. This happens when another 32-bit process thunks to the 16-bit DLL or when another 16-bit DLL calls this 16-bit DLL. However, if this function is called in a 16-bit application and the 32-bit DLL entry-point function does not yield, the function is not reentered.

Requirements

Client Requires Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
Server Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server.
Header

Declared in Wownt16.h.

See Also

Generic Thunks Overview
16-bit Generic Thunk Functions
LoadLibraryEx32W