Subversion Repositories SvarDOS

Rev

Rev 459 | Rev 475 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 459 Rev 465
Line 38... Line 38...
38
  char far *myptr, far *mcb;
38
  char far *myptr, far *mcb;
39
  unsigned short far *owner;
39
  unsigned short far *owner;
40
  const unsigned short sizeof_rmodandprops_paras = (0x100 + rmod_len + sizeof(struct rmod_props) + 15) / 16;
40
  const unsigned short sizeof_rmodandprops_paras = (0x100 + rmod_len + sizeof(struct rmod_props) + 15) / 16;
41
  unsigned short rmodseg = 0xffff;
41
  unsigned short rmodseg = 0xffff;
42
  unsigned short envseg, origenvseg;
42
  unsigned short envseg, origenvseg;
43
  struct rmod_props far *res = NULL;
43
  struct rmod_props far *res;
44
 
44
 
45
  /* read my current env segment from PSP and save it */
45
  /* read my current env segment from PSP and save it */
46
  envseg = *((unsigned short *)0x2c);
46
  envseg = *((unsigned short *)0x2c);
47
  origenvseg = envseg;
47
  origenvseg = envseg;
48
 
48
 
Line 187... Line 187...
187
 * otherwise return NULL */
187
 * otherwise return NULL */
188
struct rmod_props far *rmod_find(void) {
188
struct rmod_props far *rmod_find(void) {
189
  unsigned short *parent = (void *)0x0C; /* parent's seg in PSP[Ch] ("prev. int22 handler") */
189
  unsigned short *parent = (void *)0x0C; /* parent's seg in PSP[Ch] ("prev. int22 handler") */
190
  unsigned short far *ptr;
190
  unsigned short far *ptr;
191
  const unsigned short sig[] = {0x1983, 0x1985, 0x2017, 0x2019};
191
  const unsigned short sig[] = {0x1983, 0x1985, 0x2017, 0x2019};
-
 
192
  unsigned char *cmdtail = (void *)0x80;
192
  unsigned char i;
193
  unsigned char i;
193
  /* is it rmod? */
194
  /* is it rmod? */
194
  ptr = MK_FP(*parent, 0x100);
195
  ptr = MK_FP(*parent, 0x100);
195
  for (i = 0; i < 4; i++) if (ptr[i] != sig[i]) return(NULL);
196
  for (i = 0; i < 4; i++) if (ptr[i] != sig[i]) return(NULL);
196
  /* match successfull (rmod is my parent) */
197
  /* match successfull (rmod is my parent) - but is it really a respawn?
-
 
198
   * command-line tail should contain a single character '\r' */
-
 
199
  if ((cmdtail[0] != 1) || (cmdtail[1] != '\n')) return(NULL);
-
 
200
  cmdtail[0] = 0;
-
 
201
  cmdtail[1] = '\r';
-
 
202
  /* */
197
  return(MK_FP(*parent, 0x100 + rmod_len));
203
  return(MK_FP(*parent, 0x100 + rmod_len));
198
}
204
}
199
 
205
 
200
 
206
 
201
/* update rmod's pointer to comspec */
207
/* update rmod's pointer to comspec */