Retrofitting the WM_COPYDATA message onto Windows 3.1
The article discusses how to retrofit the WM_COPYDATA message, which was introduced in Win32s, onto Windows 3.1 to allow inter-process communication between 16-bit and 32-bit applications. It explains the challenges and solutions for implementing this message in a 16-bit environment that originally lacked it.
Background
- This is a post by **Raymond Chen**, a veteran Microsoft developer who writes "The Old New Thing" blog — essential reading for understanding Windows internals and historical design decisions.
- **WM_COPYDATA** is a Windows message (introduced in Windows 3.1) that lets one application safely send a block of data to another application's window. It's a core inter-process communication (IPC) mechanism, still used today.
- Windows 3.1 (1992) was a major upgrade from Windows 3.0, adding multimedia support, OLE (Object Linking and Embedding), and TrueType fonts — but its cooperative multitasking model and limited memory protection made cross-process data sharing tricky.
- The article explains the *engineering challenge* of retrofitting this feature: how to share memory between processes on an OS that lacked proper memory protection, using GlobalAlloc flags and selective address-space mapping.