{***********************************************************************}
{									}
{ __RetIDUtl  Return the current process identification 		}
{									}
{ procedure __RetIDUtl(var ProgSeg : word);				}
{									}
{	      ProgSeg  The program segment of the currently executing	}
{		       process. 					}
{									}
{ Description DOS keeps track of the currently executing process by	}
{	      recording its program segment.  This is important 	}
{	      because the PSP is used to keep track of open files	}
{	      and for a scratch area for some DOS functions.  This	}
{	      procedure allows you to return the current program	}
{	      segment value.  For standard programs, this is precisely	}
{	      the program segment prefix (PrefixSeg), but for memory	}
{	      resident programs, it is the PSP of the foreground	}
{	      process.							}
{									}
{	      For DOS 3.00 and later, __RetIDUtl can be called at any	}
{	      time, but for earlier versions it cannot be called if	}
{	      DOS is executing (that is, the InDOS flag must be clear). }
{									}
{ Version     4.00 (C)Copyright Blaise Computing Inc.  1987		}
{_______________________________________________________________________}

procedure __RetIDUtl(var ProgSeg : word);

  var
    Reg : registers;

  begin {__RetIDUtl}

    with Reg do
      begin			       { DOS function call $51		}
	AH := $51;
	Intr(_DOS,Reg);
	ProgSeg := BX
      end

  end;	{__RetIDUtl}
