From: Martin Str|mberg Message-Id: <200001061624.RAA06442@father.ludd.luth.se> Subject: Re: The endless int31 hooking debugging continued To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii) Date: Thu, 6 Jan 100 17:24:17 +0100 (MET) Cc: djgpp AT delorie DOT com (DJGPP) In-Reply-To: from Eli Zaretskii at "Jan 6, 0 06:15:21 pm" X-Mailer: ELM [version 2.4ME+ PL15 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk According to Eli Zaretskii: > On Thu, 6 Jan 100, Martin Str|mberg wrote: > I think I can help you ;-) > > > movw %ss, %ax > > movw %ax, _org_ss > > movw _my_ds, %ax > > movw %ax, %es > > movw %ax, %ss > > You changed SS, but left ESP at its previous value. This is a disaster > waiting to happen. Ooops (Blush)! Thanks! > What you need to do is to save ESP in some variable before calling the > DPMI functions, then use that saved value inside the hook (decrement it > by some slack, to guard against usage inside the DPMI functions). > > Or, better still, don't call any library functions from within the hook; > then you don't need to worry about SS and ESP. Yes, but I need call cputs to get some debug information out. Pettersson, Symphony 13, MartinS