Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!usc!snorkelwacker!bloom-beacon!eru!hagbard!sunic!news.funet.fi!funic!fuug!tuura!risto From: risto@tuura.UUCP (Risto Lankinen) Newsgroups: comp.windows.ms Subject: Re: Show-stopper in wstdio.c/3.0 SDK tty sample app Keywords: Win 3.0 SDK, tty sample app, wstdio.c, LocalAlloc, LocalLock Message-ID: <772@tuura.UUCP> Date: 25 Sep 90 07:30:13 GMT References: <6589@sugar.hackercorp.com> <1990Sep24.201443.1377@sj.ate.slb.com> Organization: Nokia Data Systems Oy Lines: 33 poffen@sj.ate.slb.com (Russell Poffenberger) writes: >In article <6589@sugar.hackercorp.com> karl@sugar.hackercorp.com (Karl Lehenbauer) writes: >>The wstdio.c module in the tty sample application has some code that >>is a guaranteed GP ever time. >> >>I guess just having a WNDCLASS structure created on the stack is no >>good unless you know you're going to be large model only since >>DS != SS. >> Hi! It is possible to do a function, say, RegWinClassDirect(), which takes all the members of WNDCLASS structure as parameters in the *opposite* order. Make it in .ASM into a DLL and call the RegisterWindowClass() with the far ptr parameter SS:BP+06 (which points to the 'structure' of WNDCLASS members pushed to stack for RegWinClassDirect() ). I've done it, and it hasn't failed so far even without LockData() (*) . And I think it even will not, since RegisterWindowClass() is supposed not to call any functions such that would trigger memory movement. The only importance as far as I see is that the correct (segment register of the) far pointer is passed. Terveisin: Risto Lankinen (*) footnote: For memory models, where DS==SS, I take for granted that the LockData() also locks the value of SS , but how is the matter for DLL's for example? -- Risto Lankinen / product specialist *************************************** Nokia Data Systems, Technology Dept * 2 2 * THIS SPACE INTENTIONALLY LEFT BLANK * 2 -1 is PRIME! Now working on 2 +1 * replies: risto@yj.data.nokia.fi ***************************************