Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hpcvlx!bturner From: bturner@hpcvlx.HP.COM (Bill Turner) Newsgroups: comp.windows.ms Subject: Re: Spawning in Windows Message-ID: <106580039@hpcvlx.HP.COM> Date: 31 May 89 16:52:09 GMT References: <1989May19.112713.17785@ziebmef.uucp> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 20 >> The interesting bits are the GlobalCompact - to give yourself some room, >> and the LockData - stop data pointers from becoming orphans. > > Does this work for libraries? (where DS!=SS) if so, then what exactly does > LockData do? if not, then what would work there? I think it will. When your program is executing, DS is automatically locked for you. The problem is that the spawn call unlocks DS to do its work. So, if you LockData again, then DS is locked twice (the locks are counted), so spawn unlocking it once still leaves it locked, and you're safe. Now, if you're in the library code, the stack segment is already locked (because for the program, DS == SS). But you will need to lock the library's DS, other- wise the same problem can occur (of DS moving underneath the spawn call). [This raises an entirely different problem about locking the library's DS, which I'll put into another note...] --Bill Turner (bturner@hp-pcd.hp.com) HP Corvallis Information Systems