home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wunderki.zip / DOS.PAS < prev    next >
Pascal/Delphi Source File  |  1993-09-19  |  19KB  |  648 lines

  1. Unit Dos;
  2.  
  3. Interface
  4.  
  5. Const
  6.   fmClosed = $D7B0;
  7.   fmInput  = $D7B1;
  8.   fmOutput = $D7B2;
  9.   fmInOut  = $D7B3;
  10.  
  11. Const
  12.   ReadOnly  = $01;
  13.   Hidden    = $02;
  14.   SysFile   = $04;
  15.   Directory = $10;
  16.   Archive   = $20;
  17.   AnyFile   = $37;
  18.  
  19. Type
  20.   ComStr  = String[127];
  21.   PathStr = String[79];
  22.   DirStr  = String[67];
  23.   NameStr = String[8];
  24.   ExtStr  = String[4];
  25.  
  26. Type
  27.   FileRec = Record
  28.               Handle   : Word;
  29.               Mode     : Word;
  30.               RecSize  : Word;
  31.               Private  : Array[1..26] of Byte;
  32.               UserData : Array[1..16] of Byte;
  33.               Name     : Array[0..79] of Char;
  34.             End;
  35. Type
  36.   TextBuf = Array[0..127] of Char;
  37.   TextRec = Record
  38.               Handle    : Word;
  39.               Mode      : Word;
  40.               BufSize   : Word;
  41.               Private   : Word;
  42.               BufPos    : Word;
  43.               BufEnd    : Word;
  44.               BufPtr    : ^TextBuf;
  45.               OpenFunc  : Pointer;
  46.               InOutFunc : Pointer;
  47.               FlushFunc : Pointer;
  48.               CloseFunc : Pointer;
  49.               UserData  : Array[1..16] of Byte;
  50.               Name      : Array[0..79] of Char;
  51.               Buffer    : TextBuf;
  52.             End;
  53.  
  54. Type
  55.   SearchRec = Record
  56.                 Fill : Array[1..21] of Byte;
  57.                 Attr : Byte;
  58.                 Time : LongInt;
  59.                 Size : LongInt;
  60.                 Name : String[12];
  61.               End;
  62.  
  63. Type
  64.   DateTime = Record
  65.                Year,Month,Day,Hour,Min,Sec : Word;
  66.              End;
  67.  
  68. Type
  69.   TPID = Word;
  70.   TTID = Word;
  71.   TSel = Word;
  72. Type
  73.   PGlobalInfoSeg = ^TGlobalInfoSeg;
  74.   TGlobalInfoSeg = Record
  75.                      time                : LongInt;
  76.                      msecs               : LongInt;
  77.                      hour                : Byte;
  78.                      minutes             : Byte;
  79.                      seconds             : Byte;
  80.                      hundredths          : Byte;
  81.                      timezone            : Word;
  82.                      cusecTimerInterval  : Word;
  83.                      day                 : Byte;
  84.                      month               : Byte;
  85.                      year                : Word;
  86.                      weekday             : Byte;
  87.                      uchMajorVersion     : Byte;
  88.                      uchMinorVersion     : Byte;
  89.                      chRevisionLetter    : Byte;
  90.                      sgCurrent           : Byte;
  91.                      sgMax               : Byte;
  92.                      cHugeShift          : Byte;
  93.                      fProtectModeOnly    : Byte;
  94.                      pidForeground       : Word;
  95.                      fDynamicSched       : Byte;
  96.                      csecMaxWait         : Byte;
  97.                      cmsecMinSlice       : Word;
  98.                      cmsecMaxSlice       : Word;
  99.                      bootdrive           : Word;
  100.                      amecRAS             : Array[1..32] of Byte;
  101.                      csgWindowableVioMax : Byte;
  102.                      csgPMMax            : Byte;
  103.                    End;
  104.   PLocalInfoSeg = ^TLocalInfoSeg;
  105.   TLocalInfoSeg  = Record
  106.                      pidCurrent          : TPID;
  107.                      pidParent           : TPID;
  108.                      prtyCurrent         : Word;
  109.                      tidCurrent          : TTID;
  110.                      sgCurrent           : Word;
  111.                      rfProcStatus        : Byte;
  112.                      dummy1              : Byte;
  113.                      fForeground         : WordBool;
  114.                      typeProcess         : Byte;
  115.                      dummy2              : Byte;
  116.                      selEnvironment      : TSel;
  117.                      offCmdLine          : Word;
  118.                      cbDataSegment       : Word;
  119.                      cbStack             : Word;
  120.                      cbHeap              : Word;
  121.                      hmod                : Word;
  122.                      selDS               : TSel;
  123.                    End;
  124.  
  125. Const
  126.   ExecFlags     : Word = 0;   { EXEC_SYNC }
  127. Var
  128.   DosError      : Integer;
  129.   GlobalInfoSeg : PGlobalInfoSeg;
  130.   LocalInfoSeg  : PLocalInfoSeg;
  131.  
  132.   Function  DosVersion : Word;
  133.   Procedure GetDate(Var Year,Month,Day,DayofWeek : Word);
  134.   Procedure SetDate(Year,Month,Day,DayofWeek : Word);
  135.   Procedure GetTime(Var Hour,Minute,Second,Sec100 : Word);
  136.   Procedure SetTime(Hour,Minute,Second,Sec100 : Word);
  137.   Procedure GetVerify(Var Verify : Boolean);
  138.   Procedure SetVerify(Verify : Boolean);
  139.   Function  DiskFree(Drive : Byte) : LongInt;
  140.   Function  DiskSize(Drive : Byte) : LongInt;
  141.   Procedure GetFAttr(Var f;Var Attr : Word);
  142.   Procedure SetFAttr(Var f;Attr : Word);
  143.   Procedure GetFTime(Var f;Var Time : LongInt);
  144.   Procedure SetFTime(Var f;Time : LongInt);
  145.   Procedure FindFirst(Path : PathStr;Attr : Word;Var S : SearchRec);
  146.   Procedure FindNext(Var S : SearchRec);
  147.   Procedure PackTime(Var T : DateTime;Var P : LongInt);
  148.   Procedure UnpackTime(P : LongInt;Var T : DateTime);
  149.   Function  FSearch(Path : PathStr;DirList : String) : PathStr;
  150.   Function  FExpand(Path : PathStr) : PathStr;
  151.   Procedure FSplit(Path : PathStr;Var Dir : DirStr;Var Name : NameStr;Var Ext : ExtStr);
  152.   Function  EnvCount : Integer;
  153.   Function  EnvStr(Index : Integer) : String;
  154.   Function  GetEnv(EnvVar : String) : String;
  155.   Procedure Exec(Path : PathStr;ComLine : ComStr);
  156.   Function  DosExitCode : Word;
  157.   Procedure PlaySound(Frequency,Duration : Word);
  158.  
  159. Implementation
  160.  
  161. Type
  162.   OS2DateTime = Record
  163.                   Hours,
  164.                   Minutes,
  165.                   Seconds,
  166.                   Hundredths,
  167.                   Day,
  168.                   Month        : Byte;
  169.                   Year         : Word;
  170.                   TimeZone     : ShortInt;
  171.                   WeekDay      : Byte;
  172.                 End;
  173.   OS2FSAllocate = Record
  174.                     idFileSystem : LongInt;
  175.                     cSectorUnit  : LongInt;
  176.                     cUnit        : LongInt;
  177.                     cUnitAvail   : LongInt;
  178.                     cbSector     : Word;
  179.                   End;
  180.   OS2FileStatus = Record
  181.                     fDateCreation   : Word;
  182.                     fTimeCreation   : Word;
  183.                     fDateLastAccess : Word;
  184.                     fTimeLastAccess : Word;
  185.                     fDateLastWrite  : Word;
  186.                     fTimeLastWrite  : Word;
  187.                     cbFile          : LongInt;
  188.                     cbFileAlloc     : LongInt;
  189.                     AttrFile        : Word;
  190.                   End;
  191.   OS2FileFindBuf = Record
  192.                     fDateCreation   : Word;
  193.                     fTimeCreation   : Word;
  194.                     fDateLastAccess : Word;
  195.                     fTimeLastAccess : Word;
  196.                     fDateLastWrite  : Word;
  197.                     fTimeLastWrite  : Word;
  198.                     cbFile          : LongInt;
  199.                     cbFileAlloc     : LongInt;
  200.                     AttrFile        : Word;
  201.                     cchName         : Byte;
  202.                     achName         : Array[0..12] of Char;
  203.                    End;
  204.  
  205.   Function DosGetInfoSeg(Var GlobalSeg,LocalSeg : TSel) : Word; Far;
  206.     External 'DOSCALLS' Index $08;
  207.   Function DosSetDateTime(Var DateTime : OS2DateTime) : Word; Far;
  208.     External 'DOSCALLS' Index $1C;
  209.   Function DosGetDateTime(Var DateTime : OS2DateTime) : Word; Far;
  210.     External 'DOSCALLS' Index $21;
  211.   Function DosBeep(Freq,Durat : Word) : Word; Far;
  212.     External 'DOSCALLS' Index $32;
  213.   Function DosFindClose(DirHandle : Word) : Word; Far;
  214.     External 'DOSCALLS' Index $3F;
  215.   Function DosFindFirst(PathName : PChar;Var DirHandle : Word;Attrib : Word;Var FindBuf;BufLen : Word;
  216.                         Var SearchCount : Word;Reserved : LongInt) : Word; Far;
  217.     External 'DOSCALLS' Index $40;
  218.   Function DosFindNext(DirHandle : Word;Var FindBuf;BufLen : Word;Var SearchCount : Word) : Word; Far;
  219.     External 'DOSCALLS' Index $41;
  220.   Function DosQFileInfo(Handle : Word;InfoLevel : Word;Var Info;InfoLen : Word) : Word; Far;
  221.     External 'DOSCALLS' Index $4A;
  222.   Function DosQFileMode(Name : PChar;Var Attrib : Word;Reserved : LongInt) : Word; Far;
  223.     External 'DOSCALLS' Index $4B;
  224.   Function DosQFSInfo(DriveNo : Word;InfoLevel : Word;Var Info;InfoLen : Word) : Word; Far;
  225.     External 'DOSCALLS' Index $4C;
  226.   Function DosQVerify(Var Verify : Word) : Word; Far;
  227.     External 'DOSCALLS' Index $4E;
  228.   Function DosSetFileInfo(Handle : Word;InfoLevel : Word;Var Info;InfoLen : Word) : Word; Far;
  229.     External 'DOSCALLS' Index $53;
  230.   Function DosSetFileMode(Name : PChar;Attrib : Word;Reserved : LongInt) : Word; Far;
  231.     External 'DOSCALLS' Index $54;
  232.   Function DosSetVerify(Verify : Word) : Word; Far;
  233.     External 'DOSCALLS' Index $56;
  234.   Function DosGetVersion(Var Version : Word) : Word; Far;
  235.     External 'DOSCALLS' Index $5C;
  236.   Function DosExecPgm(Var FailBuf;FailBufLen : Word;Flags : Word;Args : PChar;Env : PChar;
  237.                       Var Result;ExecName : PChar) : Word; Far;
  238.     External 'DOSCALLS' Index $90;
  239.  
  240.   Function DosVersion : Word;
  241.   Var
  242.     Version : Word;
  243.   Begin
  244.     DosError := DosGetVersion(Version);
  245.     If DosError = 0 then
  246.       DosVersion := Version
  247.     else
  248.       DosVersion := 0;
  249.   End;
  250.  
  251.   Procedure GetDate(Var Year,Month,Day,DayofWeek : Word);
  252.   Var
  253.     DT : OS2DateTime;
  254.   Begin
  255.     DosError := DosGetDateTime(DT);
  256.     If DosError = 0 then
  257.       Begin
  258.         Year      := DT.Year;
  259.         Month     := DT.Month;
  260.         Day       := DT.Day;
  261.         DayOfWeek := DT.WeekDay;
  262.       End
  263.     else
  264.       Begin
  265.         Year      := 0;
  266.         Month     := 0;
  267.         Day       := 0;
  268.         DayOfWeek := 0;
  269.       End;
  270.   End;
  271.  
  272.   Procedure SetDate(Year,Month,Day,DayofWeek : Word);
  273.   Var
  274.     DT : OS2DateTime;
  275.   Begin
  276.     DosError := DosGetDateTime(DT);
  277.     If DosError = 0 then
  278.       Begin
  279.         DT.Year    := Year;
  280.         DT.Month   := Month;
  281.         DT.Day     := Day;
  282.         DT.WeekDay := DayOfWeek;
  283.         DosSetDateTime(DT);
  284.       End;
  285.   End;
  286.  
  287.   Procedure GetTime(Var Hour,Minute,Second,Sec100 : Word);
  288.   Var
  289.     DT : OS2DateTime;
  290.   Begin
  291.     DosError := DosGetDateTime(DT);
  292.     If DosError = 0 then
  293.       Begin
  294.         Hour   := DT.Hours;
  295.         Minute := DT.Minutes;
  296.         Second := DT.Seconds;
  297.         Sec100 := DT.Hundredths;
  298.       End
  299.     else
  300.       Begin
  301.         Hour   := 0;
  302.         Minute := 0;
  303.         Second := 0;
  304.         Sec100 := 0;
  305.       End;
  306.   End;
  307.  
  308.   Procedure SetTime(Hour,Minute,Second,Sec100 : Word);
  309.   Var
  310.     DT : OS2DateTime;
  311.   Begin
  312.     DosError := DosGetDateTime(DT);
  313.     If DosError = 0 then
  314.       Begin
  315.         DT.Hours      := Hour;
  316.         DT.Minutes    := Minute;
  317.         DT.Seconds    := Second;
  318.         DT.Hundredths := Sec100;
  319.         DosSetDateTime(DT);
  320.       End;
  321.   End;
  322.  
  323.   Procedure GetVerify(Var Verify : Boolean);
  324.   Var
  325.     V : Word;
  326.   Begin
  327.     DosError := DosQVerify(V);
  328.     If DosError = 0 then
  329.       Verify := Boolean(V)
  330.     else
  331.       Verify := False;
  332.   End;
  333.  
  334.   Procedure SetVerify(Verify : Boolean);
  335.   Begin
  336.     DosError := DosSetVerify(Word(Verify));
  337.   End;
  338.  
  339.   Function DiskFree(Drive : Byte) : LongInt;
  340.   Var
  341.     FI : OS2FSAllocate;
  342.   Begin
  343.     DosError := DosQFSInfo(Drive,1,FI,sizeof(FI));
  344.     If DosError = 0 then
  345.       DiskFree := FI.cUnitAvail * FI.cSectorUnit * FI.cbSector
  346.     else
  347.       DiskFree := -1;
  348.   End;
  349.  
  350.   Function DiskSize(Drive : Byte) : LongInt;
  351.   Var
  352.     FI : OS2FSAllocate;
  353.   Begin
  354.     DosError := DosQFSInfo(Drive,1,FI,sizeof(FI));
  355.     If DosError = 0 then
  356.       DiskSize := FI.cUnit * FI.cSectorUnit * FI.cbSector
  357.     else
  358.       DiskSize := -1;
  359.   End;
  360.  
  361.   Procedure GetFAttr(Var f;Var Attr : Word);
  362.   Var
  363.     A : Word;
  364.   Begin
  365.     DosError := DosQFileMode(FileRec(f).Name,A,0);
  366.     If DosError = 0 then
  367.       Attr := A
  368.     else
  369.       Attr := 0;
  370.   End;
  371.  
  372.   Procedure SetFAttr(Var f;Attr : Word);
  373.   Begin
  374.     DosError := DosSetFileMode(FileRec(f).Name,Attr,0);
  375.   End;
  376.  
  377.   Procedure GetFTime(Var f;Var Time : LongInt);
  378.   Var
  379.     FI : OS2FileStatus;
  380.     T1 : Record
  381.            Time,Date : Word;
  382.          End Absolute Time;
  383.   Begin
  384.     DosError := DosQFileInfo(FileRec(f).Handle,1,FI,SizeOf(FI));
  385.     If DosError = 0 then
  386.       Begin
  387.         T1.Time := FI.fTimeLastWrite;
  388.         T1.Date := FI.fDateLastWrite;
  389.       End
  390.     else
  391.       Begin
  392.         T1.Time := 0;
  393.         T1.Date := 0;
  394.       End;
  395.   End;
  396.  
  397.   Procedure SetFTime(Var f;Time : LongInt);
  398.   Var
  399.     FI : OS2FileStatus;
  400.     T1 : Record
  401.            Time,Date : Word;
  402.          End Absolute Time;
  403.   Begin
  404.     DosError := DosQFileInfo(FileRec(f).Handle,1,FI,SizeOf(FI));
  405.     If DosError = 0 then
  406.       Begin
  407.         FI.fTimeLastWrite := T1.Time;
  408.         FI.fDateLastWrite := T1.Date;
  409.         DosError := DosSetFileInfo(FileRec(f).Handle,1,FI,SizeOf(FI));
  410.       End;
  411.   End;
  412.  
  413.   Procedure FindFirst(Path : PathStr;Attr : Word;Var S : SearchRec);
  414.   Var
  415.     FF    : OS2FileFindBuf;
  416.     N     : String;
  417.     Count : Word;
  418.   Type
  419.     PWord = ^Word;
  420.   Begin
  421.     N := Path + #0;
  422.     Count := 1;
  423.     PWord(@S)^ := $FFFF; { HDIR_CREATE }
  424.     DosError := DosFindFirst(@N[1],PWord(@S)^,Attr,FF,SizeOf(FF),Count,0);
  425.     If DosError = 0 then
  426.       Begin
  427.         S.Attr := FF.AttrFile;
  428.         S.Time := (LongInt(FF.fDateLastWrite) Shl 16) + FF.fTimeLastWrite;
  429.         S.Size := FF.cbFileAlloc;
  430.         Move(FF.cchName,S.Name,SizeOf(S.Name))
  431.       End;
  432.   End;
  433.  
  434.   Procedure FindNext(Var S : SearchRec);
  435.   Var
  436.     FF    : OS2FileFindBuf;
  437.     Count : Word;
  438.   Type
  439.     PWord = ^Word;
  440.   Begin
  441.     Count := 1;
  442.     DosError := DosFindNext(PWord(@S)^,FF,SizeOf(FF),Count);
  443.     If DosError = 0 then
  444.       Begin
  445.         S.Attr := FF.AttrFile;
  446.         S.Time := (LongInt(FF.fDateLastWrite) Shl 16) + FF.fTimeLastWrite;
  447.         S.Size := FF.cbFileAlloc;
  448.         Move(FF.cchName,S.Name,SizeOf(S.Name))
  449.       End
  450.     else
  451.       DosFindClose(PWord(@S)^);
  452.   End;
  453.  
  454.   Procedure PackTime(Var T : DateTime;Var P : LongInt);
  455.   Var
  456.     P1 : Record
  457.            Time,Date : Word;
  458.          End Absolute P;
  459.   Begin
  460.     P1.Date := (T.Year - 1980) Shl 9 + T.Month Shl 5 + T.Day;
  461.     P1.Time := T.Hour Shl 11 + T.Min Shl 5 + T.Sec Shr 1;
  462.   End;
  463.  
  464.   Procedure UnpackTime(P : LongInt;Var T : DateTime);
  465.   Var
  466.     P1 : Record
  467.            Time,Date : Word;
  468.          End Absolute P;
  469.   Begin
  470.     T.Year  := P1.Date Shr 9 + 1980;
  471.     T.Month := (P1.Date Shr 5) And 15;
  472.     T.Day   := P1.Date And 31;
  473.     T.Hour  := P1.Time Shr 11;
  474.     T.Min   := (P1.Time Shr 5) And 63;
  475.     T.Sec   := (P1.Time And 31) Shl 1;
  476.   End;
  477.  
  478.   Function FSearch(Path : PathStr;DirList : String) : PathStr;
  479.   Var
  480.     Name   : String;
  481.     Attrib : Word;
  482.     p      : Byte;
  483.   Begin
  484.     FSearch := '';
  485.     Name := Path;
  486.     Repeat
  487.       Name := Name + #0;
  488.       DosError := DosQFileMode(@Name[1],Attrib,0);
  489.       If (DosError = 0) and ((Attrib And $18) = 0) then
  490.         Begin
  491.           FSearch := Copy(Name,1,Length(Name) - 1);
  492.           Break;
  493.         End
  494.       else
  495.         Begin
  496.           If DirList = '' then Break;
  497.           p := Pos(';',DirList);
  498.           If p <> 0 then
  499.             Begin
  500.               Name := Copy(DirList,1,p - 1) + '\' + Path;
  501.               DirList := Copy(DirList,p + 1,255);
  502.             End
  503.           else
  504.             Begin
  505.               Name := DirList + '\' + Path;
  506.               DirList := '';
  507.             End;
  508.         End;
  509.     Until False;
  510.   End;
  511.  
  512.   Function FExpand(Path : PathStr) : PathStr;
  513.   Var
  514.     s : String;
  515.   Begin
  516.     GetDir(0,s);
  517.     If s <> '' then
  518.       If s[Length(s) - 1] <> '\' then
  519.         s := s + '\';
  520.     FExpand := s + Path;
  521.   End;
  522.  
  523.   Procedure FSplit(Path : PathStr;Var Dir : DirStr;Var Name : NameStr;Var Ext : ExtStr);
  524.   Var
  525.     l : Integer;
  526.   Begin
  527.     l := Length(Path);
  528.     While Not(Path[l] in ['\',':']) and (l > 0) do Dec(l);
  529.     Dir := Copy(Path,1,l);
  530.     Path := Copy(Path,l + 1,255);
  531.     l := Pos('.',Path);
  532.     If l <> 0 then
  533.       Begin
  534.         Name := Copy(Path,1,l - 1);
  535.         Ext  := Copy(Path,l,4);
  536.       End
  537.     else
  538.       Begin
  539.         Name := Path;
  540.         Ext  := '';
  541.       End;
  542.   End;
  543.  
  544.   Function EnvCount : Integer;
  545.   Var
  546.     p   : PChar;
  547.     i,l : Integer;
  548.   Begin
  549.     p := Ptr(EnvironmentSeg,0);
  550.     i := 0;
  551.     Repeat
  552.       l := 0;
  553.       While p^ <> #0 do
  554.         Begin
  555.           Inc(l); Inc(p);
  556.         End;
  557.       Inc(p);
  558.       If l = 0 then Break;
  559.       Inc(i);
  560.     Until False;
  561.     EnvCount := i;
  562.   End;
  563.  
  564.   Function EnvStr(Index : Integer) : String;
  565.   Var
  566.     p : PChar;
  567.     s : String;
  568.     i : Integer;
  569.   Begin
  570.     p := Ptr(EnvironmentSeg,0);
  571.     s := '';
  572.     For i := 1 to Index do
  573.       Begin
  574.         s := '';
  575.         While p^ <> #0 do
  576.           Begin
  577.             s := s + p^; Inc(p);
  578.           End;
  579.         Inc(p);
  580.         If s = '' then Break;
  581.       End;
  582.     EnvStr := s;
  583.   End;
  584.  
  585.   Function GetEnv(EnvVar : String) : String;
  586.   Var
  587.     Count,i : Integer;
  588.     s       : String;
  589.     p       : Byte;
  590.   Begin
  591.     Count := EnvCount;
  592.     For i := 1 to Count do
  593.       Begin
  594.         s := EnvStr(i);
  595.         p := Pos('=',s);
  596.         If p <> 0 then
  597.           If Copy(s,1,p - 1) = EnvVar then
  598.             Begin
  599.               GetEnv := Copy(s,p + 1,255);
  600.               Exit;
  601.             End;
  602.       End;
  603.     GetEnv := '';
  604.   End;
  605.  
  606. Var
  607.   ExecResult : Record
  608.                  CodeTerminate,CodeResult : Word;
  609.                End;
  610.  
  611.   Procedure Exec(Path : PathStr;ComLine : ComStr);
  612.   Var
  613.     b : Array[0..255] of Char;
  614.   Begin
  615.     Path := Path + #0;
  616.     ComLine := ComLine + #0#0;
  617.     DosError := DosExecPgm(b,256,ExecFlags,@ComLine[1],Ptr(EnvironmentSeg,0),ExecResult,@Path[1]);
  618.   End;
  619.  
  620.   Function DosExitCode : Word;
  621.   Begin
  622.     DosExitCode := ExecResult.CodeResult;
  623.   End;
  624.  
  625.   Procedure PlaySound(Frequency,Duration : Word);
  626.   Begin
  627.     DosBeep(Frequency,Duration);
  628.   End;
  629.  
  630.   Procedure DosInit;
  631.   Var
  632.     GlobalSel,LocalSel : Word;
  633.   Begin
  634.     If DosGetInfoSeg(GlobalSel,LocalSel) = 0 then
  635.       Begin
  636.         GlobalInfoSeg := Ptr(GlobalSel,0);
  637.         LocalInfoSeg  := Ptr(LocalSel,0);
  638.       End
  639.     else
  640.       Begin
  641.         GlobalInfoSeg := Nil;
  642.         LocalInfoSeg  := Nil;
  643.       End;
  644.   End;
  645.  
  646. Begin
  647.   DosInit;
  648. End.