KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q25321: Using EXEHDR or EXEMOD to Change the Stack Size of an .EXE

Article: Q25321
Product(s): See article
Version(s): 1.00 2.01 | 1.00 2.01
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | s_exehdr s_exemod | mspl13_basic
Last Modified: 6-FEB-1991

The EXEHDR and EXEMOD utilities can be used to change the stack size
of a program. EXEHDR runs in both DOS and OS/2, while EXEMOD is an
older utility that only runs under DOS.

To view the current size of the stack, no options are used. Both
EXEHDR and EXEMOD will produce a table of information with a line such
as the following:

   Initial SS:SP 0000:0800 0

The offset portion of this line gives the current stack size in hex.
In this example, the stack size is set at 2K. If you wanted to change
it to 4K, you could use the /STACK option of EXEHDR or EXEMOD in the
following way:

   EXEHDR file /STACK 1000

-or-

   EXEMOD file /STACK 1000

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.