X-Authentication-Warning: ieva01.lanet.lv: pavenis owned process doing -bs Date: Fri, 19 Feb 1999 09:57:58 +0200 (WET) From: Andris Pavenis To: djgpp AT delorie DOT com Subject: Re: Does Windows 98 lose DMPI descriptors? In-Reply-To: <199902182027.PAA13221@envy.delorie.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Thu, 18 Feb 1999, DJ Delorie wrote: > > > A better test would probably be to loop over something that starts > > another program, not an internal command. > > A better test would be to start a program that prints CS, and see if > it keeps going up or reuses the same number. > Here is some example I used to test this. Win95 (also OSR2) and Win98 - yes all these versions lose descriptors WinNT 4.0+SP3 - seems that this problem is not present Don't ask me about numbers there. Simply I have thrown latest source of program I haven't run about a month. After trying to debug this program with FSDB under Win95 seems that DPMI function that frees LDT descriptor is totally broken. Maybe it's possible to hook int 0x31 to avoid real freeing descriptors but reusing them. Only question is whether we are able to simulate ALL needed functions there (including __create_alias_descriptor) Andris ----------------------------------------------------------------- #include #include #include #include #include int main(int argc, char *argv[]) { int i; if (argc > 1) { printf("my_cs: %04X my_ds: %04X dos_ds: %04X\n", _my_cs(),_my_ds(),_dos_ds); return 0; } else { printf("Start: my_cs: %04X my_ds: %04X dos_ds: %04X\n", _my_cs(),_my_ds(),_dos_ds); } for (i=0;i<28;i++) { spawnl(P_WAIT, argv[0], argv[0], "1", NULL); int i, err=0, sel[28]; for (i=0; i<28; i++) sel[i] = __dpmi_create_alias_descriptor (_my_cs()); for (i=0; i<28; i++) { int rc=__dpmi_free_ldt_descriptor (sel[i]); if (rc) { printf (" %04X",sel[i]); err=1; } } if (err) printf ("\n"); } return 0; }