Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

817 lines
22 KiB

  1. page ,132
  2. title COMMAND Resident DATA
  3. ;/*
  4. ; * Microsoft Confidential
  5. ; * Copyright (C) Microsoft Corporation 1991
  6. ; * All Rights Reserved.
  7. ; */
  8. ;
  9. ; Revision History
  10. ; ================
  11. ; M003 SR 07/16/90 Added LoadHiFlg for LoadHigh support
  12. ;
  13. ; M004 SR 07/17/90 Transient is now moved to its final
  14. ; location at EndInit time by allocating
  15. ; the largest available block, moving
  16. ; the transient to the top of the block
  17. ; and then freeing up the block.
  18. ;
  19. ; M027 SR 9/20/90 Fixed bug #2827. EndInit was using
  20. ; INIT seg variables after INIT seg
  21. ; had been freed.
  22. ;
  23. ; M036 SR 11/1/90 Free up environment segment passed
  24. ; by Exec always.
  25. ;
  26. .xlist
  27. .xcref
  28. include dossym.inc
  29. include pdb.inc
  30. include syscall.inc
  31. include comsw.asm
  32. include comseg.asm
  33. include resmsg.equ
  34. include comequ.asm
  35. include cmdsvc.inc
  36. .list
  37. .cref
  38. ; Equates for initialization (from COMEQU)
  39. ;
  40. ; Bugbug: Toss these after putting ctrl-c handler in init module.
  41. INITINIT equ 01h ; initialization in progress
  42. INITSPECIAL equ 02h ; in initialization time/date routine
  43. INITCTRLC equ 04h ; already in ^C handler
  44. CODERES segment public byte
  45. extrn Ext_Exec:near
  46. extrn MsgRetriever:far
  47. extrn TRemCheck:near
  48. ;SR;
  49. ; The stack has no right to be in the code segment. Moved it to DATARES
  50. ;
  51. ; bugbug: Why this odd stack size? And what should stack size be?
  52. ;; db (80h - 3) dup (?)
  53. ;;RStack label word
  54. ;; public RStack
  55. CODERES ends
  56. INIT segment
  57. extrn ConProc:near
  58. extrn Chuckenv:byte
  59. extrn UsedEnv:word
  60. extrn OldEnv:word
  61. extrn EnvSiz:word
  62. extrn TrnSize:word ; M004
  63. INIT ends
  64. TAIL segment
  65. extrn TranStart :word
  66. TAIL ends
  67. TRANCODE segment public byte
  68. extrn Command:near
  69. TRANCODE ends
  70. TRANSPACE segment
  71. extrn TranSpaceEnd :byte
  72. TRANSPACE ends
  73. ;SR;
  74. ; All the routines below are entry points into the stub from the transient.
  75. ;The stub will then transfer control to the appropriate routines in the
  76. ;resident code segment, wherever it is present.
  77. ;
  78. DATARES segment
  79. extrn Exec_Trap :near
  80. extrn RemCheck_Trap :near
  81. extrn MsgRetrv_Trap :near
  82. extrn HeadFix_Trap :near
  83. extrn Issue_Exec_Call :near
  84. DATARES ends
  85. DATARES segment public byte
  86. assume cs:DATARES
  87. Org 0
  88. ZERO = $
  89. ;; Org 100h
  90. ;;ProgStart:
  91. ;; jmp RESGROUP:ConProc
  92. public Abort_Char
  93. public Append_Flag
  94. public Append_State
  95. public BadFatSubst
  96. public Batch
  97. public Batch_Abort
  98. public BlkDevErrRw
  99. public BlkDevErrSubst
  100. public Call_Batch_Flag
  101. public Call_Flag
  102. public CDevAt
  103. public CharDevErrSubst
  104. public CharDevErrRw
  105. public Com_Fcb1
  106. public Com_Fcb2
  107. public Com_Ptr
  108. public ComDrv
  109. public ComSpec
  110. public ComSpec_End
  111. public Crit_Err_Info
  112. public Crit_Msg_Off
  113. public Crit_Msg_Seg
  114. public CritMsgPtrs
  115. public DataResEnd
  116. public Dbcs_Vector_Addr
  117. public DevName
  118. public DrvLet
  119. public EchoFlag
  120. public EnvirSeg
  121. public ErrCd_24
  122. public ErrType
  123. public Exec_block
  124. public ExecErrSubst
  125. public Extcom
  126. public ExtMsgEnd
  127. public Fail_Char
  128. public fFail
  129. public ForFlag
  130. public ForPtr
  131. public FUCase_Addr
  132. public Handle01
  133. public IfFlag
  134. public Ignore_Char
  135. public In_Batch
  136. public InitFlag
  137. public InPipePtr
  138. public Int_2e_Ret
  139. public Int2fHandler
  140. public Io_Save
  141. public Io_Stderr
  142. public LenMsgOrPathBuf
  143. public Loading
  144. public LTpa
  145. public MemSiz
  146. public MsgBuffer
  147. public MsgPtrLists
  148. public MySeg
  149. public MySeg1
  150. public MySeg2
  151. public MySeg3
  152. public NeedVol
  153. public NeedVolSubst
  154. public Nest
  155. public Next_Batch
  156. public No_Char
  157. public NullFlag
  158. public NUMEXTMSGS
  159. public NUMPARSMSGS
  160. public OldErrNo
  161. public OldTerm
  162. public OutPipePtr
  163. public Parent
  164. public ParsMsgPtrs
  165. public PermCom
  166. public Pipe1
  167. ;;; public Pipe1T
  168. public Pipe2
  169. ;;; public Pipe2T
  170. public PipeFiles
  171. public PipeFlag
  172. public PipePtr
  173. public PipeStr
  174. public KSwitchFlag
  175. public PutBackComSpec
  176. public PutBackDrv
  177. public PutBackSubst
  178. public RDirChar
  179. public Re_Out_App
  180. public Re_OutStr
  181. public ResMsgEnd
  182. public Res_Tpa
  183. public RestDir
  184. public ResTest
  185. public RetCode
  186. public Retry_Char
  187. public RSwitChar
  188. public SafePathBuffer ; MSKK01 07/14/89
  189. public Save_Pdb
  190. public SingleCom
  191. public Sum
  192. public Suppress
  193. public Trans
  194. public TranVarEnd
  195. public TranVars
  196. public TrnSeg
  197. public TrnMvFlg
  198. public VerVal
  199. public VolName
  200. public VolSer
  201. public Yes_Char
  202. public ResSize
  203. public RStack
  204. public OldDS
  205. public LoadHiFlg ;For LoadHigh support ; M003
  206. public SCS_Is_First
  207. public SCS_REENTERED
  208. public SCS_FIRSTCOM
  209. public SCS_PAUSE
  210. public SCS_CMDPROMPT
  211. public SCS_DOSONLY
  212. public SCS_PROMPT16
  213. public SCS_FIRSTTSR
  214. public RES_RDRINFO
  215. public RES_BATSTATUS
  216. extrn LodCom_Trap:near
  217. extrn Alloc_error:near
  218. ;*** Message substitution blocks
  219. BlkDevErrSubst label byte
  220. BlkDevErrRw subst <STRING,> ; "reading" or "writing"
  221. subst <CHAR,DATARES:DrvLet> ; block device drive letter
  222. DrvLet db 'A' ; drive letter
  223. CharDevErrSubst label byte
  224. CharDevErrRw subst <STRING,> ; "reading" or "writing"
  225. CharDevErrDev subst <STRING,DATARES:DevName> ; character device name
  226. DevName db 8 dup (?),0 ; device name, asciiz
  227. NeedVolSubst label byte
  228. subst <STRING,DATARES:VolName> ; volume name
  229. subst <HEX,DATARES:VolSer+2> ; hi word of serial #
  230. subst <HEX,DATARES:VolSer> ; lo word of serial #
  231. ; NOTE: VolName and VolSer must be adjacent
  232. VolName db 11 dup (?),0 ; volume name
  233. VolSer dd 0 ; volume serial #
  234. CDevAt db ?
  235. BadFatSubst label byte
  236. subst <CHAR,DATARES:DrvLet> ; drive letter
  237. PutBackSubst label byte
  238. PutBackComSpec subst <STRING,> ; comspec string
  239. subst <CHAR,DATARES:PutBackDrv> ; drive to put it in
  240. PutBackDrv db ' ' ; drive letter
  241. ExecErrSubst subst <STRING,DATARES:SafePathBuffer>
  242. NeedVol dd ? ; ptr to volume name from get ext err
  243. ErrType db ? ; critical error message style, 0=old, 1=new
  244. Int_2e_Ret dd ? ; magic command executer return address
  245. Save_Pdb dw ?
  246. Parent dw ?
  247. OldTerm dd ?
  248. ErrCd_24 dw ?
  249. Handle01 dw ?
  250. Loading db 0
  251. Batch dw 0 ; assume no batch mode initially
  252. ;;;;SR;
  253. ;;;; This flag has been added for a gross hack introduced in batch processing.
  254. ;;;;We use it to indicate that this batch file has no CR-LF before EOF and that
  255. ;;;;we need to fake the CR-LF for the line to be properly processed
  256. ;;;;
  257. ;;;BatchEOF db 0
  258. ; Bugbug: ComSpec should be 64+3+12+1?
  259. ; What's this comspec_end about?
  260. ComSpec db 64 dup (0)
  261. ComSpec_End dw ?
  262. Trans label dword
  263. dw TRANGROUP:Command
  264. TrnSeg dw ?
  265. TrnMvFlg db 0 ; set if transient portion has been moved
  266. In_Batch db 0 ; set if we are in batch processing mode
  267. Batch_Abort db 0 ; set if user wants to abort from batch mode
  268. ComDrv db ? ; drive spec to load autoexec and command
  269. MemSiz dw ?
  270. Sum dw ?
  271. ExtCom db 1 ; for init, pretend just did an external
  272. RetCode dw ?
  273. Crit_Err_Info db ? ; hold critical error flags for r,i,f
  274. ; The echo flag needs to be pushed and popped around pipes and batch files.
  275. ; We implement this as a bit queue that is shr/shl for push and pop.
  276. EchoFlag db 00000001b ; low bit true => echo commands
  277. Suppress db 1 ; used for echo, 1=echo line
  278. Io_Save dw ?
  279. Io_Stderr db ?
  280. RestDir db 0
  281. PermCom db 0 ; true => permanent command
  282. SingleCom dw 0 ; true => single command version
  283. KSwitchFlag db 0
  284. VerVal dw -1
  285. fFail db 0 ; true => fail all int 24s
  286. IfFlag db 0 ; true => IF statement in progress
  287. ForFlag db 0 ; true => FOR statement in progress
  288. ForPtr dw 0
  289. Nest dw 0 ; nested batch file counter
  290. Call_Flag db 0 ; no CALL (batch command) in progress
  291. Call_Batch_Flag db 0
  292. Next_Batch dw 0 ; address of next batch segment
  293. NullFlag db 0 ; flag if no command on command line
  294. FUCase_Addr db 5 dup (0) ; buffer for file ucase address
  295. ; Bugbug: don't need crit_msg_ anymore?
  296. Crit_Msg_Off dw 0 ; saved critical error message offset
  297. Crit_Msg_Seg dw 0 ; saved critical error message segment
  298. Dbcs_Vector_Addr dw 0 ; DBCS vector offset
  299. dw 0 ; DBCS vector segment
  300. Append_State dw 0 ; current state of append
  301. ; (if Append_Flag is set)
  302. Append_Flag db 0 ; set if append state is valid
  303. SCS_PAUSE db 0 ; yst 4-5-93
  304. Re_Out_App db 0
  305. Re_OutStr db 64+3+13 dup (?)
  306. SCS_Is_First db 1
  307. SCS_REENTERED db 0
  308. SCS_FIRSTCOM db 0
  309. SCS_CMDPROMPT db 0 ; means on TSR/Shell out use command.com
  310. SCS_DOSONLY db 0 ; means by default run all binaries
  311. ; when at command.com prompt. if 1 means
  312. ; allow only dos binaries.
  313. SCS_PROMPT16 db 0
  314. SCS_FIRSTTSR db 1
  315. RES_RDRINFO DD 0
  316. RES_BATSTATUS db 0
  317. ; We flag the state of COMMAND in order to correctly handle the ^Cs at
  318. ; various times. Here is the breakdown:
  319. ;
  320. ; INITINIT We are in the init code.
  321. ; INITSPECIAL We are in the date/time prompt
  322. ; INITCTRLC We are handling a ^C already.
  323. ;
  324. ; If we get a ^C in the initialization but not in the date/time prompt, we
  325. ; ignore the ^C. This is so the system calls work on nested commands.
  326. ;
  327. ; If we are in the date/time prompt at initialization, we stuff the user's
  328. ; input buffer with a CR to pretend an empty response.
  329. ;
  330. ; If we are already handling a ^C, we set the carry bit and return to the user
  331. ; (ourselves). We can then detect the carry set and properly retry the
  332. ; operation.
  333. InitFlag db INITINIT
  334. ; Note: these two bytes are referenced as a word
  335. PipeFlag db 0
  336. PipeFiles db 0
  337. ;--- 2.x data for piping
  338. ;
  339. ; All the "_" are substituted later, the one before the : is substituted
  340. ; by the current drive, and the others by the CreateTemp call with the
  341. ; unique file name. Note that the first 0 is the first char of the pipe
  342. ; name. -MU
  343. ;
  344. ;--- Order-dependent, do not change
  345. ;;;Pipe1 db "_:/"
  346. ;;;Pipe1T db 0
  347. ;;; db "_______.___",0
  348. ;;;Pipe2 db "_:/"
  349. ;;;Pipe2T db 0
  350. ;;; db "_______.___",0
  351. ;SR
  352. ; Pipe1 & Pipe2 now need to store full-fledged pathnames
  353. ;
  354. ; Bugbug: can we find any way around maintaining these
  355. ; large buffers?
  356. Pipe1 db 67+12 dup (?)
  357. Pipe2 db 67+12 dup (?)
  358. PipePtr dw ?
  359. PipeStr db 129 dup (?)
  360. EndPipe label byte ; marks end of buffers; M004
  361. ;SR;
  362. ; We can move our EndInit code into above buffers. This way, the code will
  363. ;automatically be discarded after init.
  364. ;
  365. ; M004; We overlap our code with the Pipe buffers located above by changing
  366. ; M004; the origin.
  367. ;
  368. ORG Pipe1 ; M004
  369. ; Bugbug: really need a procedure header for EndInit, describing
  370. ; what it expects, what it does.
  371. Public EndInit
  372. EndInit:
  373. push ds
  374. push es ;save segments
  375. push cs
  376. pop ds
  377. assume ds:RESGROUP
  378. ;
  379. ; M004; Save size of transient here before INIT segment is deallocated
  380. ;
  381. mov dx,TrnSize ; M004
  382. ;M027
  383. ; These variables are also defined in the INIT segment and need to be saved
  384. ;before we resize
  385. ;
  386. mov ax,OldEnv ; Old Environment seg ;M027
  387. mov bx,EnvSiz ; Size of new environment ;M027
  388. mov cx,UsedEnv ; Size of old environment ;M027
  389. push ax ; Save all these values ;M027
  390. push bx ; M027
  391. push cx ; M027
  392. ; Bugbug: push ds, pop es here.
  393. mov bx,ds
  394. mov es,bx ;es = RESGROUP
  395. ;
  396. ;ResSize is the actual size to be retained -- only data for HIMEM COMMAND,
  397. ; code + data for low COMMAND
  398. ;
  399. mov bx,ResSize ;Total size of resident
  400. mov ah,SETBLOCK
  401. int 21h ;Set block to resident size
  402. ;
  403. ;We check if this is for autoexec.bat (PermCom = 1). If so, we then
  404. ;allocate a new batch segment, copy the old one into new batchseg and free
  405. ;the old batchseg. Remember that the old batchseg was allocated on top of the
  406. ;transient and we will leave a big hole if TSRs are loaded by autoexec.bat
  407. ;
  408. ; Bugbug: also describe why we alloc & copy batch seg BEFORE environment.
  409. cmp PermCom,1 ;permanent command.com?
  410. jne adjust_env ;no, do not free batchseg
  411. cmp Batch,0 ;was there a valid batchseg?
  412. je adjust_env ;no, dont juggle
  413. ; NTVDM temp name of the batch file may be up to 63 bytes, plus NULL
  414. ; mov bx,((SIZE BatchSegment) + 15 + 1 + 0fh)/16 ;batchseg size
  415. mov bx,((SIZE BatchSegment) + 64 + 1 + 0fh)/16 ;batchseg size
  416. mov ah,ALLOC
  417. int 21h
  418. ; Bugbug: I just had a thought. If DOS or SHARE or somebody leaves
  419. ; a hole, the batch segment COULD already be in the ideal place. We
  420. ; could be making it worse! We're second-guessing where memory
  421. ; allocations go, which might not be such a great idea. Is there
  422. ; a strategy, short of doing something even worse like diddling
  423. ; arena headers, where we can minimize the possibility of fragmentation
  424. ; under all cases? Hmm..
  425. jc adjust_env ;no memory, use old batchseg
  426. mov es,ax ;es = New batch segment
  427. xor di,di
  428. xor si,si
  429. push ds
  430. mov ds,Batch ;ds = Old Batch Segment
  431. assume ds:nothing
  432. mov cx,SIZE BatchSegment
  433. ; NTVDM temp name of the batch file may be up to 63 bytes, plus NULL
  434. ; add cx,16 ;for the filename
  435. add cx,64
  436. ; Bugbug: 16? Shouldn't this be a common equate or something?
  437. ; It's sure be bad if we copied more bytes than the batch segment
  438. ; holds!
  439. cld
  440. rep movsb
  441. pop ds
  442. assume ds:RESGROUP
  443. mov cx,es ;save new batch segment
  444. mov es,Batch
  445. mov ah,DEALLOC
  446. int 21h ;free the old batch segment
  447. ; Bugbug: should we check for error?
  448. mov Batch,cx ;store new batch segment address
  449. adjust_env:
  450. pop cx ;cx = size of old env ;M027
  451. pop bx ;bx = size of new env needed ;M027
  452. pop bp ;bp = old env seg ;M027
  453. ;
  454. ;Allocate the correct size for the environment
  455. ;
  456. mov ah,ALLOC
  457. int 21h ;get memory
  458. jc init_env_err ;out of memory,signal error
  459. ; Bugbug: why not continue, leaving environment where it is?
  460. mov EnvirSeg,ax ;Store new environment segment
  461. mov ds:PDB_Environ,ax ;Put new env seg in PSP
  462. mov es,ax ;es = address of allocated memory
  463. assume es:nothing
  464. cmp PermCom, 1
  465. jne copy_old_env
  466. ;
  467. ; First get the size of 32bit env
  468. ;
  469. push bx
  470. mov bx, 0
  471. CMDSVC SVC_GETINITENVIRONMENT
  472. mov ax, bx
  473. pop bx
  474. cmp ax, 0 ;bx returns 0, use old environment
  475. je copy_old_env
  476. ;
  477. ; now compute the new size
  478. ; [ax] = size of 32 bit env
  479. ;
  480. add bx, ax
  481. mov ah, DEALLOC ;free the block
  482. int 21h
  483. mov ah, ALLOC ;and get a new block(don't use realloc please)
  484. int 21h
  485. jc nomem_err
  486. mov EnvirSeg,ax ;Store new environment segment
  487. mov ds:PDB_Environ,ax ;Put new env seg in PSP
  488. mov es,ax ;es = address of allocated memory
  489. mov EnvSiz, bx ;new size
  490. push bx
  491. CMDSVC SVC_GETINITENVIRONMENT ;get new environment
  492. pop ax
  493. cmp bx, ax
  494. jbe adjust_env_done
  495. init_env_err:
  496. jmp short nomem_err
  497. copy_old_env:
  498. ;
  499. ;Copy the environment to the newly allocated segment
  500. ;
  501. push ds
  502. mov ds, bp ;ds = Old environment segment
  503. assume ds:nothing
  504. xor si,si
  505. mov di,si ;Start transfer from 0
  506. cld
  507. rep movsb ;Do the copy
  508. pop ds ;ds = RESGROUP
  509. assume ds:RESGROUP
  510. adjust_env_done:
  511. ;
  512. ;We have to free the old environment block if it was allocated by INIT
  513. ;
  514. ; Bugbug: is this only for the case when we were NOT passed an environment,
  515. ; or does it also apply to passed environments?
  516. ;M036
  517. ; Free up old env segment always because this is a copy passed by Exec and
  518. ;takes up memory that is never used
  519. ;
  520. ;M044
  521. ;Go back to the old strategy of not freeing the environment. Freeing it leaves
  522. ;a hole behind that Ventura does not like. Basically, Ventura gives strange
  523. ;errors if it gets a memory alloc that it is below its load segment. The
  524. ;freed environment creates a large enough hole for some of its allocs to fit
  525. ;in
  526. ;
  527. cmp Chuckenv,0 ;has env been allocated by INIT?
  528. jne no_free ;no, do not free it
  529. mov es,bp
  530. mov ah,DEALLOC
  531. int 21h ;Free it
  532. no_free:
  533. ;
  534. ; M004; Start of changes
  535. ;
  536. ;
  537. ; Move the transient now. We will allocate the biggest block available
  538. ; now and move the transient to the top of the block. We will then
  539. ; deallocate this block. When the resident starts executing, it will
  540. ; hopefully allocate this block again and find the transient intact.
  541. ;
  542. MOV TrnMvFlg, 1 ; Indicate that transient has been moved
  543. push es
  544. mov si,offset ResGroup:TranStart
  545. mov di,0
  546. mov cx,offset TranGroup:TranSpaceEnd ;size to move
  547. ;
  548. ; Find the largest block available
  549. ;
  550. mov bx,0ffffh
  551. mov ah,ALLOC
  552. int 21h
  553. ;
  554. ; dx = size of transient saved previously
  555. ;
  556. cmp bx,dx ;enough memory?
  557. jb nomem_err ;not enough memory for transient
  558. mov ah,ALLOC
  559. int 21h ;get the largest block
  560. jc nomem_err ;something is really messed up
  561. push ax ;save memory address
  562. add ax,bx ;ax = top of my memory block
  563. sub ax,dx ;less size of transient
  564. mov TrnSeg,ax ;save transient segment
  565. mov es,ax ;
  566. pop ax ;restore our seg addr
  567. ;
  568. ; Everything is set for a move. We need to move in the reverse direction to
  569. ; make sure we dont overwrite ourselves while copying
  570. ;
  571. add si,cx
  572. dec si
  573. add di,cx
  574. dec di
  575. std
  576. rep movsb
  577. cld
  578. ;
  579. ; Now we have to free up this block so that resident can get hold of it
  580. ;
  581. mov es,ax
  582. mov ah,DEALLOC
  583. int 21h ;release the memory block
  584. ;
  585. ; M004; End of changes
  586. ;
  587. mov InitFlag,FALSE ;indicate INIT is done
  588. pop es
  589. pop ds
  590. ; Bugbug: did we need to save & restore seg reg's during EndInit?
  591. assume ds:nothing
  592. jmp LodCom_Trap ;allocate transient
  593. nomem_err:
  594. ;
  595. ;We call the error routine which will never return. It will either exit
  596. ;with an error ( if not the first COMMAND ) or just hang after an error
  597. ;message ( if first COMMAND )
  598. ;
  599. jmp Alloc_error
  600. public EndCodeInit ; M004
  601. EndCodeInit label byte ; M004
  602. ;
  603. ; M004; Check if the EndInit code will fit into the Pipe buffers above.
  604. ; M004; If not, we signal an assembly error
  605. ;
  606. IF2
  607. IF ($ GT EndPipe)
  608. .err
  609. %out "ENDINIT CODE TOO BIG"
  610. ENDIF
  611. ENDIF
  612. ;
  613. ; M004; Set the origin back to what it was at the end of the buffers
  614. ;
  615. ORG EndPipe ; M004
  616. InPipePtr dw offset DATARES:Pipe1
  617. OutPipePtr dw offset DATARES:Pipe2
  618. Exec_Block label byte ; the data block for exec calls
  619. EnvirSeg dw ?
  620. Com_Ptr label dword
  621. dw 80h ; point at unformatted parameters
  622. dw ?
  623. Com_Fcb1 label dword
  624. dw 5Ch
  625. dw ?
  626. Com_Fcb2 label dword
  627. dw 6Ch
  628. dw ?
  629. ; variables passed to transient
  630. TranVars label byte
  631. dw offset DATARES:HeadFix_Trap
  632. MySeg dw 0 ; put our own segment here
  633. LTpa dw 0 ; will store tpa segment here
  634. RSwitChar db "/"
  635. RDirChar db "\"
  636. dw offset DATARES:Issue_Exec_Call
  637. MySeg1 dw ?
  638. dw offset DATARES:RemCheck_Trap
  639. MySeg2 dw 0
  640. ResTest dw 0
  641. Res_Tpa dw 0 ; original tpa (not rounded to 64k)
  642. TranVarEnd label byte
  643. OldErrNo dw ?
  644. ;* NOTE: MsgBuffer and SafePathBuffer use the same
  645. ; memory. MsgBuffer is only used while a command
  646. ; is being executed. SafePathBuffer is no longer
  647. ; needed, since it is used for unsuccessful program
  648. ; launches.
  649. MsgBuffer label byte ; buffer for messages from disk
  650. SafePathBuffer label byte ; resident pathname for EXEC
  651. ; db 128 dup (0) ; path + 'd:\' 'file.ext' + null
  652. db EXECPATHLEN dup (0) ; MAX_PATH+13 ntvdm extended
  653. LenMsgOrPathBuf equ $ - MsgBuffer
  654. Int2fHandler dd ? ; address of next int 2f handler
  655. ResMsgEnd dw 0 ; holds offset of msg end (end of resident)
  656. ;SR;
  657. ; The three vars below have been added for a pure COMMAND.COM
  658. ;
  659. ResSize dw ?
  660. ;SR;
  661. ; Moved the stack here from the code segment
  662. ;
  663. ; bugbug: Why this odd stack size? And what should stack size be?
  664. db (80h - 3) dup (?)
  665. RStack label word
  666. OldDS dw ? ;keeps old ds value when jumping to
  667. ;resident code segments
  668. LoadHiFlg db 0 ;Flag set to 1 if UMB loading enabled ; M003
  669. ifdef BETA3WARN
  670. %out Take this out before we ship
  671. public Beta3Warned
  672. Beta3Warned db 0
  673. endif
  674. ;*** MESSAGES
  675. ; and other translatable text
  676. include comrmsg.inc ;M00
  677. DATARES ends
  678. end
  679.