Creating Instance Data in a Win32s DLL (109620)
The information in this article applies to:
- Microsoft Win32s 1.3
- Microsoft Win32s 1.0
- Microsoft Win32s 1.1
- Microsoft Win32s 1.2
This article was previously published under Q109620 SUMMARY
The Win32 dynamic-link libraries (DLLs) that are running on Win32s use
shared data by default. This means that any global data in the DLL is
shared by all processes that use the DLL. Thread local storage (TLS) can be
used to create instance data; that is, data in the DLL that is specific to
each process.
The Win32s "Programmer[ASCII 146]s Reference" mentions that TLS can be used to create
instance data, but provides no details. The sample code below shows the
source for a DLL that uses instance data on both Win32 and Win32s. The
sample code was built using Microsoft Visual C++, 32-bit edition.
If you use a development environment that does not have similar support for
TLS, you should still be able to use the API (application programming
interface) calls. The API calls for TLS are TlsAlloc, TlsGetValue,
TlsSetValue, and TlsFree.
Modification Type: | Major | Last Reviewed: | 4/9/2004 |
---|
Keywords: | KB109620 |
---|
|