delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/19/05:29:22

X-Authentication-Warning: ieva01.lanet.lv: pavenis owned process doing -bs
Date: Fri, 19 Feb 1999 09:57:58 +0200 (WET)
From: Andris Pavenis <pavenis AT lanet DOT lv>
To: djgpp AT delorie DOT com
Subject: Re: Does Windows 98 lose DMPI descriptors?
In-Reply-To: <199902182027.PAA13221@envy.delorie.com>
Message-ID: <Pine.A41.4.05.9902190949200.50776-100000@ieva01.lanet.lv>
MIME-Version: 1.0
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 <go32.h>
#include <dpmi.h>
#include <stdio.h>
#include <process.h>
#include <sys/segments.h>

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;
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019