From: "Salvador Eduardo Tropea (SET)" To: djgpp AT delorie DOT com Subject: Problems with CWSDPMI and nested app. Date: Wed, 26 Jun 1996 14:19:43 +0300 (GMT) Message-ID: <9606261419.aa10878@ailin.inti.edu.ar> Hi everybody: I have a problem with CWSDPMI, seems to be a bug: When i use the function __dpmi_segment_to_descriptor in a nested application (a DJGPP v2 app called by another DJGPP v2 app) the function lies (don't make your job but says that all is OK). Code to reproduce the problem: >>>>>> Batch to make all: @Echo Creating offending code @gcc -O2 -Wall -opp -g3 pp.c @gcc -O2 -Wall -opp2 -g3 pp2.c pp2 @symify pp >>>>>> Batch to make all, end >>>>>> PP.C #include #include #include int main(void) { int sel=__dpmi_segment_to_descriptor(0xA000); printf("Descriptor: %d\n",sel); _farsetsel(sel); return 0; } >>>>>> PP.C, end >>>>>> PP2.C #include int main(void) { system("pp"); system("pp"); return 0; } >>>>>> PP2.C, end All works OK under Win3.1 (but there are more serious bugs on this DPMI server ;), under MS-DOS 6.20 with CWSDPMI the second call to "PP" gets the same descriptor but when i charge this value to the register >K-Bum<. The problem is that the second call to __dpmi_segment_to_descriptor returns the descriptor but not allocates any descriptor in the LDT (i see this using FSDB, thanks Morten!!!). Note: When the first "PP" exits the entry allocated by __dpmi_segment_to_descriptor is automatically liberated. Here are some details of the platform: OS: MS-DOS 6.20 CPU: Cyrix 5x86 DPMI server: CWSDPMI V0.90+ (r1) or CWSDPMI V0.90+ (r2). Config.SYS: LASTDRIVE=Z DEVICE=\DOS6\HIMEM.SYS /TESTMEM:OFF DEVICE=\DOS6\EMM386.EXE NOEMS D=64 BUFFERS=30 FILES = 60 FCBS=16,0 DOS=UMB DOS=HIGH DEVICEHIGH =\DEV\ATAPI_CD.SYS /H /D:SONY_000 SHELL=C:\DOS6\COMMAND.COM C:\DOS6\ /E:1024 /p BREAK=ON COUNTRY=034,,C:\DOS6\COUNTRY.SYS DeviceHigh = C:\DOS6\Ansi.SYS DEVICEHIGH=C:\DOS6\RAMDRIVE.SYS 4096 /E STACKS=18,512 Autoexec.BAT: LH e:\tvgautil\utility\setreg e:\tvgautil\utility\smonitor 0 call d:\tbav\TBSTART.BAT @Echo AutoExec.BAT @Echo @Echo Sound Blaster SET SOUND=C:\SB16 SET BLASTER=A220 I5 D1 H5 P330 T6 C:\SB16\SB16SET /M:220 /VOC:220 /CD:220 /MIDI:220 /LINE:220 /TREBLE:0 C:\SB16\SBCONFIG.EXE /S LH C:\DOS6\SMARTDRV.EXE /N 4096 SET PATH=C:\WINDOWS;C:\DOS6;C:\DJ\BIN;C:\UTILES;C:\BorlandC\Bin;C:\BLINKER3;C:\IDI\Cli5\Bin;D:\Micros\Keil\Bin PATH=%PATH%;d:\tbav Set C51Lib=D:\Micros\Keil\Lib Set C51Inc=D:\Micros\Keil\Inc PROMPT $P$G Set Temp=F: SET OBJ=C:\IDI\CLI5\Obj;C:\BLINKER3\OBJ;C:\Idi\Cli5\ObjSis SET PLL=C:\IDI\CLI5\PLL SET LIB=C:\BLINKER3\LIB;C:\Lite286\BC3\Lib;C:\Idi\Cli5\Lib SET INCLUDE=C:\Idi\C5\Include;C:\Blinker3\C;C:\Idi\Cli5\Include SET BASES=C:\CONFIGUR SET SONIDOS=C:\CONFIGUR Rem DJ: Set DJGPP=c:/dj/djgpp.env Set TMPDIR=f: Set GO32=driver c:/dj/drivers/tridnt89.grd gw 800 gh 600 LH C:\UTILES\MOUSE /L6 LH C:\BIN\MSCDEX.EXE /D:SONY_000 /M:10 Rem Acentuador castellano MADE IN ARGENTINA LH Acent C:\norton\NC ******************************************************************************** Salvador Eduardo Tropea (SET) - salvador AT inti DOT edu DOT ar Work: INTI (National Institute of Industrial Technology) Sector: ICE (Electronic Control & Instrumentation) Post (Home): Curapaligue 2124 - Caseros (1678)- Buenos Aires - Argentina