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.

568 lines
14 KiB

  1. page ,132
  2. ; SCCSID = @(#)tspc.asm 4.1 85/09/22
  3. ; SCCSID = @(#)tspc.asm 4.1 85/09/22
  4. TITLE COMMAND Transient Uninitialized DATA
  5. ;/*
  6. ; * Microsoft Confidential
  7. ; * Copyright (C) Microsoft Corporation 1991
  8. ; * All Rights Reserved.
  9. ; */
  10. comment %
  11. The TRANSPACE segment contains variable data that is considered
  12. volatile between command cycles, and therefore is not included in the
  13. transient checksum area. Contents of these variables MUST be
  14. initialized before use, and must not be relied upon from command
  15. cycle to command cycle.
  16. No constant data values should be stored here.
  17. %
  18. .xlist
  19. .xcref
  20. include comsw.asm
  21. include dossym.inc
  22. include find.inc
  23. include intnat.inc
  24. include comequ.asm
  25. include comseg.asm
  26. .list
  27. .cref
  28. ; Uninitialized transient data
  29. TRANSPACE SEGMENT PUBLIC BYTE
  30. PUBLIC ALLSWITCH
  31. PUBLIC append_exec ;AN041;
  32. PUBLIC arg
  33. PUBLIC argbufptr
  34. PUBLIC ARGC
  35. PUBLIC ARG1S
  36. PUBLIC ARG2S
  37. PUBLIC ARGTS
  38. PUBLIC arg_buf
  39. PUBLIC ASCII
  40. PUBLIC AttrSelect
  41. PUBLIC AttrSpecified
  42. PUBLIC BatBuf
  43. PUBLIC BatBufEnd
  44. PUBLIC BatBufPos
  45. PUBLIC BATHAND
  46. PUBLIC BINARY
  47. PUBLIC BITS
  48. PUBLIC BWDBUF
  49. PUBLIC BYTCNT
  50. PUBLIC bytes_free
  51. PUBLIC CFLAG
  52. PUBLIC CHARBUF
  53. PUBLIC CHKDRV
  54. PUBLIC COM
  55. PUBLIC COMBUF
  56. PUBLIC comma
  57. PUBLIC comptr
  58. PUBLIC COMSW
  59. PUBLIC CONCAT
  60. PUBLIC copy_Num
  61. PUBLIC CountryPtrInfo
  62. PUBLIC CountryPtrId
  63. PUBLIC CountryPtr
  64. PUBLIC CPDATE
  65. PUBLIC CPTIME
  66. PUBLIC cpyflag
  67. PUBLIC CURDRV
  68. PUBLIC DATE_DAY ;AN000;
  69. PUBLIC DATE_MONTH ;AN000;
  70. PUBLIC DATE_OUTPUT ;AN000;
  71. PUBLIC DATE_TYPE ;AN000;
  72. PUBLIC DATE_YEAR ;AN000;
  73. PUBLIC DEST
  74. PUBLIC DESTBUF
  75. PUBLIC DestClosed
  76. PUBLIC DESTDIR
  77. PUBLIC DESTFCB
  78. PUBLIC DESTFCB2
  79. PUBLIC DESTHAND
  80. PUBLIC DESTINFO
  81. PUBLIC DESTISDEV
  82. PUBLIC DESTISDIR
  83. PUBLIC DESTNAME
  84. PUBLIC DESTSIZ
  85. PUBLIC DESTSWITCH
  86. PUBLIC DESTTAIL
  87. PUBLIC DESTVARS
  88. PUBLIC DIRBUF
  89. PUBLIC DIRCHAR
  90. PUBLIC dirflag ;AN015;
  91. PUBLIC Dir_Num
  92. PUBLIC display_ioctl ;AN000;
  93. PUBLIC display_mode ;AN000;
  94. PUBLIC display_width ;AN000;
  95. PUBLIC DRIVE_NUMBER ;AN000;
  96. PUBLIC DRIVE_OUTPUT ;AN000;
  97. PUBLIC DRIVE_TYPE ;AN000;
  98. PUBLIC DRIVE_VALUE ;AN000;
  99. PUBLIC ELCNT
  100. PUBLIC ELPOS
  101. PUBLIC ENDDESTBUF
  102. PUBLIC EXECPATH
  103. PUBLIC EXEC_ADDR
  104. PUBLIC EXEFCB
  105. PUBLIC expand_star
  106. PUBLIC ext_entered ;AN005;
  107. PUBLIC FBUF
  108. PUBLIC FileCnt
  109. PUBLIC FileCntTotal
  110. PUBLIC FileSiz
  111. PUBLIC FileSizTotal
  112. PUBLIC file_size_high
  113. PUBLIC file_size_low
  114. PUBLIC FILTYP
  115. PUBLIC FIRSTDEST
  116. PUBLIC FRSTSRCH
  117. PUBLIC GOTOLEN
  118. PUBLIC HEADCALL
  119. PUBLIC ID
  120. PUBLIC IDLEN
  121. PUBLIC IFNOTFLAG
  122. PUBLIC if_not_count
  123. PUBLIC INEXACT
  124. PUBLIC INTERNATVARS
  125. PUBLIC KPARSE
  126. PUBLIC last_arg
  127. PUBLIC PerLine
  128. PUBLIC LeftOnLine
  129. PUBLIC LeftOnPage
  130. PUBLIC linperpag ;AN000;
  131. PUBLIC major_ver_num
  132. PUBLIC MELCOPY
  133. PUBLIC MELSTART
  134. PUBLIC minor_ver_num
  135. PUBLIC msg_flag ;AN022;
  136. PUBLIC msg_numb ;AN022;
  137. PUBLIC NOWRITE
  138. PUBLIC NXTADD
  139. PUBLIC objcnt
  140. PUBLIC OCtrlZ
  141. PUBLIC OFilePtr_Hi
  142. PUBLIC OFilePtr_Lo
  143. PUBLIC OldCtrlCHandler
  144. PUBLIC one_char_val
  145. PUBLIC PARM1
  146. PUBLIC PARM2
  147. PUBLIC parse_last ;AN018;
  148. PUBLIC PARSE1_ADDR ;AN000;
  149. PUBLIC PARSE1_CODE ;AN000;
  150. PUBLIC PARSE1_OUTPUT ;AN000;
  151. PUBLIC PARSE1_SYN ;AN000;
  152. PUBLIC PARSE1_TYPE ;AN000;
  153. PUBLIC PATHCNT
  154. PUBLIC pathinfo
  155. PUBLIC PATHPOS
  156. PUBLIC PATHSW
  157. PUBLIC PLUS
  158. PUBLIC plus_comma
  159. PUBLIC print_err_flag ;AN000;
  160. PUBLIC psep_char
  161. PUBLIC RCH_ADDR
  162. PUBLIC RDEOF
  163. PUBLIC RE_INSTR
  164. PUBLIC RESSEG
  165. PUBLIC SCANBUF
  166. PUBLIC SDIRBUF
  167. PUBLIC search_best
  168. PUBLIC search_best_buf
  169. PUBLIC search_curdir_buf
  170. PUBLIC search_error
  171. PUBLIC SKPDEL
  172. PUBLIC SOURCE
  173. PUBLIC SPECDRV
  174. PUBLIC SRCBUF
  175. PUBLIC SRCHAND
  176. PUBLIC SRCINFO
  177. PUBLIC SRCISDEV
  178. PUBLIC SRCISDIR
  179. PUBLIC SRCPT
  180. PUBLIC SRCSIZ
  181. PUBLIC SRCTAIL
  182. PUBLIC SRCVARS
  183. PUBLIC srcxname
  184. PUBLIC STACK
  185. PUBLIC STARTEL
  186. PUBLIC string_ptr_2
  187. ;AD061; PUBLIC string_ptr_2_sb ;AN000;
  188. PUBLIC subst_buffer ;AN061;
  189. PUBLIC SWITCHAR
  190. PUBLIC system_cpage
  191. PUBLIC TERMREAD
  192. PUBLIC TIME_FRACTION ;AN000;
  193. PUBLIC TIME_HOUR ;AN000;
  194. PUBLIC TIME_MINUTES ;AN000;
  195. PUBLIC TIME_OUTPUT ;AN000;
  196. PUBLIC TIME_SECONDS ;AN000;
  197. PUBLIC TIME_TYPE ;AN000;
  198. PUBLIC TPA
  199. PUBLIC tpbuf
  200. PUBLIC TRANSPACEEND
  201. PUBLIC TRAN_TPA
  202. PUBLIC trgxname
  203. PUBLIC UCOMBUF
  204. PUBLIC USERDIR1
  205. PUBLIC vol_drv
  206. PUBLIC vol_ioctl_buf ;AC030;
  207. PUBLIC vol_serial ;AC030;
  208. PUBLIC vol_label ;AC030;
  209. PUBLIC WRITTEN
  210. PUBLIC zflag
  211. PUBLIC ENV_PTR_SEG
  212. PUBLIC ENV_SIZE
  213. PUBLIC CMD_PTR_SEG
  214. PUBLIC CMD_PTR_OFF
  215. PUBLIC CMD_SIZE
  216. PUBLIC SCS_EXIT_CODE
  217. PUBLIC SCS_CUR_DRIVE
  218. PUBLIC SCS_NUM_DRIVES
  219. PUBLIC SCS_STD_HANDLE
  220. PUBLIC SCS_STD_BITS
  221. PUBLIC SCS_CODEPAGE
  222. PUBLIC SCS_TSREXIT
  223. PUBLIC SCS_BATSTATUS
  224. PUBLIC SCS_RDRINFO
  225. PUBLIC EXECPATH_SEG
  226. PUBLIC EXECPATH_OFF
  227. PUBLIC EXECPATH_SIZE
  228. PUBLIC EXECEXT_TYPE
  229. Public TypeFilSiz ;stores size of file to be typed
  230. IF IBM
  231. PUBLIC ROM_CALL
  232. PUBLIC ROM_CS
  233. PUBLIC ROM_IP
  234. ENDIF
  235. ORG 0
  236. ZERO = $
  237. SRCXNAME DB DIRSTRLEN + 20 DUP (?) ;g buffer for name translate
  238. TRGXNAME DB DIRSTRLEN + 20 DUP (?) ;g buffer for name translate
  239. JUNK1 DB 2(?)
  240. FOO_JUNK DB 2 (?)
  241. UCOMBUF DB COMBUFLEN+3 DUP(?) ; Raw console buffer
  242. COMBUF DB COMBUFLEN+3 DUP(?) ; Cooked console buffer
  243. USERDIR1 DB DIRSTRLEN+3 DUP(?) ; Storage for users current directory
  244. ;EXECPATH DB COMBUFLEN+3 DUP(?) ; Path for external command
  245. EXECPATH DB EXECPATHLEN DUP(?) ; ntvdm MAX_PATH+13 extended
  246. RE_INSTR DB DIRSTRLEN+3+13 DUP (?) ; path for input to redirection
  247. ; sudeepb - start of cmdinfo structure (it should always match cmdsvc.h
  248. ; definition of cmdinfo.
  249. ENV_PTR_SEG DW ?
  250. ENV_SIZE DW ?
  251. SCS_CUR_DRIVE DW ?
  252. SCS_NUM_DRIVES DW ?
  253. CMD_PTR_SEG DW ?
  254. CMD_PTR_OFF DW ?
  255. CMD_SIZE DW ?
  256. SCS_EXIT_CODE DW ?
  257. SCS_STD_HANDLE DW 0
  258. SCS_RDRINFO DD 0
  259. SCS_CODEPAGE DW ?
  260. SCS_TSREXIT DW 0
  261. SCS_BATSTATUS DW 0
  262. EXECPATH_SEG DW 0
  263. EXECPATH_OFF DW 0
  264. EXECPATH_SIZE DW 0
  265. EXECEXT_TYPE DW 0
  266. ; end of cmdinfo
  267. SCS_STD_BITS DB 0
  268. ; Variables passed up from resident
  269. HEADCALL LABEL DWORD
  270. DW ?
  271. RESSEG DW ?
  272. TPA DW ?
  273. SWITCHAR DB ?
  274. DIRCHAR DB ?
  275. EXEC_ADDR DD ?
  276. RCH_ADDR DD ?
  277. fTest DW ?
  278. TRAN_TPA DW ?
  279. CHKDRV DB ?
  280. RDEOF LABEL BYTE ; Misc flags
  281. IFNOTFLAG LABEL BYTE
  282. FILTYP DB ?
  283. CURDRV DB ?
  284. CONCAT LABEL BYTE
  285. PARM1 DB ?
  286. ARGC LABEL BYTE
  287. PARM2 DB ?
  288. COMSW DW ? ; Switches between command and 1st arg
  289. ARG1S DW ? ; Switches between 1st and 2nd arg
  290. DESTSWITCH LABEL WORD
  291. ARG2S DW ? ; Switches after 2nd arg
  292. ALLSWITCH LABEL WORD
  293. ARGTS DW ? ; ALL switches except for COMSW
  294. CFLAG DB ?
  295. DESTCLOSED LABEL BYTE
  296. SPECDRV DB ?
  297. BYTCNT DW ? ; Size of buffer between RES and TRANS
  298. NXTADD DW ?
  299. FRSTSRCH DB ?
  300. LeftOnLine DB ? ; entries left on line u.b. DIR
  301. PerLine DB ? ; entries/line u.b. DIR
  302. LeftOnPage DW ? ; lines left on page u.b. DIR
  303. FileCnt DW ? ; file count u.b. DIR
  304. FileSiz DD ? ; file size u.b. DIR
  305. ; Note: keep FileCntTotal & FileSizTotal adjacent.
  306. FileCntTotal DD ? ; total file count u.b. DIR
  307. FileSizTotal DD ? ; total file size u.b. DIR
  308. CHARBUF DB 80 DUP (?) ;line byte character buffer for xenix write
  309. DESTFCB2 LABEL BYTE
  310. IDLEN DB ?
  311. ID DB 8 DUP(?)
  312. COM DB 3 DUP(?)
  313. DEST DB 37 DUP(?)
  314. DESTNAME DB 11 DUP(?)
  315. DESTFCB LABEL BYTE
  316. DESTDIR DB DIRSTRLEN DUP(?) ; Directory for PATH searches
  317. GOTOLEN LABEL WORD
  318. BWDBUF LABEL BYTE
  319. EXEFCB LABEL WORD
  320. DIRBUF DB DIRSTRLEN+3 DUP(?)
  321. SDIRBUF DB 12 DUP(?)
  322. BITS DW ?
  323. PATHCNT DW ?
  324. PATHPOS DW ?
  325. PATHSW DW ?
  326. AttrSpecified db ? ; attribute bits u.b. DIR
  327. AttrSelect db ? ; attribute bits u.b. DIR
  328. comma db 0 ;g flag set if +,, occurs
  329. plus_comma db 0 ;g flag set if +,, occurs
  330. dirflag db 0 ;AN015; set when pathcrunch called from DIR
  331. parse_last dw 0 ;AN018; used to hold parsing position
  332. system_cpage DW 0 ;AC001; used for CHCP variable
  333. arg_buf db 128 dup (?)
  334. file_size_low dw ? ;AC000;
  335. file_size_high dw ? ;AC000;
  336. string_ptr_2 dw ?
  337. ;AD061;string_ptr_2_sb dw ?
  338. copy_Num dw ?
  339. cpyflag db ?
  340. Dir_Num DW ?
  341. bytes_free dw ?
  342. dw ?
  343. major_ver_num dw ?
  344. minor_ver_num dw ?
  345. one_char_val db ?,0
  346. vol_drv db ?
  347. IF IBM
  348. ROM_CALL DB ? ; flag for rom function
  349. ROM_IP DW ?
  350. ROM_CS DW ?
  351. ENDIF
  352. DESTVARS LABEL BYTE
  353. DESTISDIR DB ?
  354. DESTSIZ DB ?
  355. DESTTAIL DW ?
  356. DESTINFO DB ?
  357. DESTBUF DB DIRSTRLEN + 20 DUP (?)
  358. ENDDESTBUF LABEL BYTE
  359. DESTHAND DW ?
  360. DESTISDEV DB ?
  361. FIRSTDEST DB ?
  362. MELCOPY DB ?
  363. MELSTART DW ?
  364. SRCVARS LABEL BYTE
  365. SRCISDIR DB ?
  366. SRCSIZ DB ?
  367. SRCTAIL DW ?
  368. SRCINFO DB ?
  369. SRCBUF DB DIRSTRLEN + 20 DUP (?)
  370. SRCHAND DW ?
  371. SRCISDEV DB ?
  372. SCANBUF DB DIRSTRLEN + 20 DUP (?)
  373. SRCPT DW ?
  374. INEXACT DB ?
  375. NOWRITE DB ?
  376. BINARY DB ?
  377. WRITTEN DW ?
  378. TERMREAD DB ?
  379. ASCII DB ?
  380. PLUS DB ?
  381. objcnt db ? ; Used in copy
  382. CPDATE DW ?
  383. CPTIME DW ?
  384. OFilePtr_Lo DW ? ; original file ptr for COPY when
  385. OFilePtr_Hi DW ? ; 1st source is also destination
  386. OCtrlZ DB ? ; original ctrl+Z for COPY when ditto
  387. BATHAND DW ? ; Batch handle
  388. STARTEL DW ?
  389. ELCNT DB ?
  390. ELPOS DB ?
  391. SKPDEL DB ?
  392. SOURCE DB 11 DUP(?)
  393. ext_entered db 0 ;AN005;
  394. display_ioctl db 0 ;AN000; info level
  395. db 0 ;AN000; reserved
  396. dw crt_ioctl_ln ;AN000; length of data
  397. dw ? ;AN000; control flags
  398. display_mode db ? ;AN000; display mode, colors
  399. db 0 ;AN000; reserved
  400. dw ? ;AN023; colors
  401. dw ? ;AN000; display width (PELS)
  402. dw ? ;AN000; display length (PELS)
  403. display_width dw ? ;AN000; display width
  404. linperpag dw linesperpage ;AN000; display length (default to linesperpage)
  405. vol_ioctl_buf label byte ;AN000; buffer for ioctl volume label/serial call
  406. dw 0 ;AN000; info level
  407. vol_serial dd 0 ;AN000; volume serial number
  408. vol_label db 11 dup (" ") ;AN000; volume label - init to blanks
  409. db 8 dup (" ") ;AN000; file system type
  410. expand_star db ?
  411. msg_flag db ? ;AN022; flag set if non-utility message issued
  412. msg_numb dw 0 ;AN022; set with extended error message issued
  413. append_exec db 0 ;AN041; set if internal append executed
  414. print_err_flag dw 0 ;AN000; flag set if error during sysdispmsg
  415. subst_buffer db parm_block_size*2 dup (0);AN061;
  416. ;;;; IFDEF DBCS 3/3/KK
  417. KPARSE DB ?
  418. ;;;; ENDIF 3/3/KK
  419. ; Data declarations taken out of parse.asm
  420. arg arg_unit <> ; pointers, arg count, string buffer
  421. argbufptr DW ? ; index for argv[].argpointer
  422. tpbuf DB 128 DUP (?) ; temporary buffer
  423. LAST_ARG DW ? ; point at which to accumulate switch info
  424. comptr dw ? ; ptr into combuf
  425. ; Data declarations taken out of path.asm
  426. fbuf find_buf <> ; dma buffer for findfirst/findnext
  427. pathinfo DW 3 DUP (?) ; ES, SI(old), and SI(new) of user path
  428. psep_char DB ? ; '/' or '\'
  429. search_best DB (?) ; best code, best filename so far
  430. fname_max_len equ 13
  431. search_best_buf DB fname_max_len DUP (?)
  432. search_curdir_buf DB 64 DUP (?) ; a place for CurDir info, if successful
  433. search_error DW (?) ; address of error message to be printed
  434. ; Data declarations taken out of tbatch.asm
  435. if_not_count DW ?
  436. zflag db ? ; Used by typefil to indicate ^Z's
  437. DW 80H DUP(0) ; Init to 0 to make sure the linker is not fooled
  438. STACK LABEL WORD
  439. INTERNATVARS internat_block <>
  440. DB (internat_block_max - ($ - INTERNATVARS)) DUP (?)
  441. ; Buffer for DOS function 64h (Get extended country information)
  442. ; subfunctions 2, 4, 6, or 7:
  443. CountryPtrInfo label byte
  444. CountryPtrId db ?
  445. CountryPtr dd ?
  446. .erre (($ - CountryPtrInfo) GE 5)
  447. OldCtrlCHandler dd ? ; previous int 23 vector
  448. BatBufPos DW ? ; integer position in buffer of next byte
  449. BatBuf DB BatLen DUP (?)
  450. BatBufEnd DW ?
  451. TypeFilSiz dd ? ;stores size of file to be typed
  452. ; *****************************************************
  453. ; EMG 4.00
  454. ; DATA STARTING HERE WAS ADDED BY EMG FOR 4.00
  455. ; FOR IMPLEMENTATION OF COMMON PARSE ROUTINE
  456. ; *****************************************************
  457. ;
  458. ; COMMON PARSE OUTPUT BLOCKS
  459. ;
  460. ;
  461. ; Common output blocks for PARSE number, complex, or string values.
  462. ;
  463. PARSE1_OUTPUT LABEL BYTE ;AN000;
  464. PARSE1_TYPE DB 0 ;AN000; type
  465. PARSE1_CODE DB 0 ;AN000; return value
  466. PARSE1_SYN DW 0 ;AN000; es offset of synonym
  467. PARSE1_ADDR DD 0 ;AN000; numeric value / address
  468. ; of string value
  469. ;
  470. ; Common output block for PARSE date strings.
  471. ;
  472. DATE_OUTPUT LABEL BYTE ;AN000;
  473. DATE_TYPE DB 0 ;AN000; type
  474. DB 0 ;AN000; return value
  475. DW 0 ;AN000; es offset of synonym
  476. DATE_YEAR DW 0 ;AN000; year
  477. DATE_MONTH DB 0 ;AN000; month
  478. DATE_DAY DB 0 ;AN000; day
  479. ;
  480. ; Common output block for PARSE time strings.
  481. ;
  482. TIME_OUTPUT LABEL BYTE ;AN000;
  483. TIME_TYPE DB 0 ;AN000; type
  484. DB 0 ;AN000; return value
  485. DW 0 ;AN000; es offset of synonym
  486. TIME_HOUR DB 0 ;AN000; hour
  487. TIME_MINUTES DB 0 ;AN000; minutes
  488. TIME_SECONDS DB 0 ;AN000; seconds
  489. TIME_FRACTION DB 0 ;AN000; hundredths
  490. ;
  491. ; Common output block for PARSE drive specifier (one based drive number).
  492. ;
  493. DRIVE_OUTPUT LABEL BYTE ;AN000;
  494. DRIVE_TYPE DB 0 ;AN000; type
  495. DRIVE_VALUE DB 0 ;AN000; return value
  496. DW 0 ;AN000; es offset of synonym
  497. DRIVE_NUMBER DB 0 ;AN000; drive number
  498. DB 0,0,0 ;AN000; reserved
  499. TRANSPACEEND LABEL BYTE
  500. TRANSPACE ENDS
  501. END
  502.