home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / ms_sh23s.zip / Patch.lib < prev    next >
Text File  |  1994-08-26  |  3KB  |  103 lines

  1.  MS-DOS Shell Version 2.2    Patch.Lib            Decmeber 1993
  2.  
  3.  MS-DOS SHELL - Copyright (c) 1990,3 Data Logic Limited and Charles Forsyth
  4.  
  5.  This code is based on (in part) the shell program written by Charles
  6.  Forsyth and is subject to the following copyright restrictions:
  7.  
  8.  1.  Redistribution and use in source and binary forms are permitted
  9.      provided that the above copyright notice is duplicated in the
  10.      source form and the copyright notice in file sh6.c is displayed
  11.      on entry to the program.
  12.  
  13.  2.  The sources (or parts thereof) or objects generated from the
  14.      sources (or parts of sources) cannot be sold under any circumstances.
  15.  
  16.     $Header: /usr/users/istewart/shell/sh2.3/Release/RCS/Patch.lib,v 2.2 1993/12/03 13:32:52 istewart Exp $
  17.  
  18.     $Log: Patch.lib,v $
  19.     Revision 2.2  1993/12/03  13:32:52  istewart
  20.     Release 2.2
  21.  
  22.     Revision 2.1  1992/12/14  11:13:55  istewart
  23.     BETA 215 Fixes and 2.1 Release
  24.  
  25.     Revision 2.0  1992/04/13  17:40:33  Ian_Stewartson
  26.     MS-Shell 2.0 Baseline release
  27.  
  28.     
  29. ________________________________________________________________________________
  30.  
  31. This document provides a set of instructions for modifying the Microsoft C
  32. v5.1 Library function open so that the O_NOINHERIT flag is passed to MSDOS.
  33. The CodeView commands are given where appropriate.
  34.  
  35. 1.  Using CodeView (or a similar debugger), set a breakpoint on the call to
  36.     open in S_open.
  37.  
  38.     - v S_open
  39.     move cursor to open
  40.     - <F9>
  41.  
  42. 2.  Execute to the break point.  You may have to enter a command which opens
  43.     a file.
  44.  
  45.     - g
  46.  
  47. 3.  Display the Assembly listing
  48.  
  49.     - <F3>
  50.  
  51. 4.  Single step the debugger into the open function
  52.  
  53.     - <F8> (5 times on my system)
  54.  
  55. 5.  Page through the assembler listing until you find the Interrupt 21 call.
  56.     In my version, this is about 16 assembler instructions into the open
  57.     function.  The call sequence is:
  58.  
  59.     mov        byte ptr [bp - 4], 80H
  60.     push    ds
  61.     lds        dx, dword ptr [bp + 6]
  62.     and        al, 03
  63.     or        al, bh
  64.     mov        ah, 3d
  65.     int        21H
  66.  
  67. 6.  Record the machine code values for this sequence (especially the last 4
  68.     instructions).  On my system these are:
  69.  
  70.     2403    and        al, 03
  71.     0AC7    or        al, bh
  72.     B43D    mov        ah, 3d
  73.     CD21    int        21H
  74.  
  75. 7.  Exit CodeView
  76.  
  77. 8.  Extract the module open.obj from your library.
  78.  
  79.     lib llibce "*open.obj;"
  80.  
  81. 9.  Using an appropriate binary editor (or hex dump program) look for the
  82.     sequence of machine code values leading up to the interrupt (see step 6
  83.     above).  In my version of open.obj, it starts at offset 0x0f2 in the
  84.     file.  Change the AND AL, 03 instruction to AND AL, 83 by changing 24
  85.     03 to 24 83.
  86.  
  87.     You may have to write a little program to open the file in binary mode,
  88.     seek to the appropriate location and write 0x83 to the file and close
  89.     it.
  90.  
  91. 10. Re-load the module in the library (you may want to keep a copy of the
  92.     original module/library in case of problems).
  93.  
  94.     lib llibce "-+open.obj;"
  95.  
  96. 11. Re-link the shell
  97.  
  98. 12. Check that the AND AL, 03 has become an AND AL, 83 using steps 1 to 5.
  99.  
  100. Note:
  101.     Microsoft, MSDOS and CodeView are registered trademarks of Microsoft
  102.     Corporation
  103.