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.

525 lines
16 KiB

  1. PAGE 60,132;
  2. title EDLIN Messages
  3. ;/*
  4. ; * Microsoft Confidential
  5. ; * Copyright (C) Microsoft Corporation 1991
  6. ; * All Rights Reserved.
  7. ; */
  8. ;======================= START OF SPECIFICATIONS =========================
  9. ;
  10. ; MODULE NAME: EDLMES.SAL
  11. ;
  12. ; DESCRIPTIVE NAME: MESSAGE RETRIEVER INTERFACE MODULE
  13. ;
  14. ; FUNCTION: THIS MODULE PROVIDES AN INTERFACE FOR THE MODULES THAT ARE
  15. ; NEEDED TO INVOKE THE MESSAGE RETRIEVER.
  16. ;
  17. ; ENTRY POINT: PRINTF
  18. ;
  19. ; INPUT: OFFSET CARRIED IN DX TO APPLICABLE MESSAGE TABLE
  20. ;
  21. ; EXIT NORMAL: NO CARRY
  22. ;
  23. ; EXIT ERROR : CARRY
  24. ;
  25. ; INTERNAL REFERENCES:
  26. ;
  27. ; ROUTINE: PRINTF - PROVIDES THE ORIGINAL INTERFACE FOR THE ORIGINAL
  28. ; PRINTF USED PRIOR TO VERSION 4.00. PRINTS MESSAGES.
  29. ;
  30. ; DISP_MESSAGE - BUILDS THE REGISTERS NECESSARY FOR INVOCATION
  31. ; OF THE MESSAGE RETRIEVER, BASED ON THE TABLE
  32. ; POINTED TO BY DX.
  33. ;
  34. ; DISP_FATAL - INVOKED IF AN ERROR OCCURS (CARRY) IN THE
  35. ; MESSAGE RETRIEVER. IT DISPLAYS THE APPROPRIATE
  36. ; MESSAGE.
  37. ;
  38. ; EXTERNAL REFERENCES:
  39. ;
  40. ; ROUTINE: SYSLOADMSG - LOAD MESSAGES FOR THE MESSAGE RETRIEVER
  41. ; SYSDISPMSG - DISPLAYS THE REQUESTED MESSAGE
  42. ;
  43. ; NOTES: THIS MODULE IS TO BE PREPPED BY SALUT WITH THE "PR" OPTIONS
  44. ; LINK EDLIN+EDLCMD1+EDLCMD2+EDLMES+EDLPARSE
  45. ;
  46. ; REVISION HISTORY:
  47. ;
  48. ; AN000 VERSION DOS 4.00 - IMPLEMENTATION OF MESSAGE RETRIEVER
  49. ;
  50. ; COPYRIGHT: "MS DOS EDLIN UTILITY"
  51. ; "VERSION 4.00 (C) COPYRIGHT 1988 Microsoft"
  52. ; "LICENSED MATERIAL - PROPERTY OF Microsoft "
  53. ;
  54. ; MICROSOFT REVISION HISTORY
  55. ;
  56. ; MODIFIED BY: AARON R
  57. ; M.A. U
  58. ; N. P
  59. ;======================= END OF SPECIFICATIONS ===========================
  60. .xlist
  61. include sysmsg.inc ;an000;message retriever
  62. msg_utilname <EDLIN> ;an000;EDLIN messages
  63. .list
  64. ;-----------------------------------------------------------------------;
  65. ; ;
  66. ; Done for Vers 2.00 (rev 9) by Aaron R ;
  67. ; Update for rev. 11 by M.A. U ;
  68. ; Printf for 2.5 by Nancy P ;
  69. ; ;
  70. ;-----------------------------------------------------------------------;
  71. ;=========================================================================
  72. ; revised edlmes.asm
  73. ;=========================================================================
  74. fatal_error equ 30 ;an000;fatal message handler
  75. unlim_width equ 00h ;an000;unlimited output width
  76. pad_blank equ 20h ;an000;blank pad
  77. pre_load equ 00h ;an000;normal pre-load
  78. message_table struc ;an000;struc for message table
  79. entry1 dw 0 ;an000;message number
  80. entry2 db 0 ;an000;message type
  81. entry3 dw 0 ;an000;display handle
  82. entry4 dw 0 ;an000;pointer to sublist
  83. entry5 dw 0 ;an000;substitution count
  84. entry6 db 0 ;an000;use keyb input?
  85. entry7 dw 0 ;an000;keyb buffer to use
  86. message_table ends ;an000;end struc
  87. ;=========================================================================
  88. ; macro disp_message: this macro takes a pointer to a message table
  89. ; and displays the applicable message based on
  90. ; the table's contents.
  91. ; this is to provide an interface into the module
  92. ; of the message retriever, SYSDISPMSG.
  93. ;
  94. ; Date : 6/11/87
  95. ;=========================================================================
  96. disp_message macro tbl ;an000;display message macro
  97. push bx ;an000;
  98. push cx ;an000;
  99. push dx ;an000;
  100. push di ;an000;
  101. push si ;an000;
  102. push tbl ;an000;exchange tbl with si
  103. pop si ;an000;exchanged
  104. mov ax,[si].entry1 ;an000;move message number
  105. mov bx,[si].entry3 ;an000;display handle
  106. mov cx,[si].entry5 ;an000;number of subs
  107. mov dl,[si].entry6 ;an000;function type
  108. mov di,[si].entry7 ;an000;input buffer if appl.
  109. mov dh,[si].entry2 ;an000;message type
  110. mov si,[si].entry4 ;an000;sublist
  111. call sysdispmsg ;an000;display the message
  112. pop si ;an000;restore affected regs
  113. pop di ;an000;
  114. pop dx ;an000;
  115. pop cx ;an000;
  116. pop bx ;an000;
  117. endm ;an000;end macro disp_message
  118. ;=========================================================================
  119. ; macro disp_message: end macro
  120. ;=========================================================================
  121. CODE SEGMENT PUBLIC BYTE
  122. CODE ENDS
  123. CONST SEGMENT PUBLIC BYTE
  124. CONST ENDS
  125. cstack segment stack
  126. cstack ends
  127. DATA SEGMENT PUBLIC BYTE
  128. extrn path_name:byte
  129. DATA ENDS
  130. DG GROUP CODE,CONST,cstack,DATA
  131. code segment public byte ;an000;code segment
  132. assume cs:dg,ds:dg,es:dg,ss:CStack ;an000;
  133. public printf ;an000;share printf
  134. public disp_fatal ;an000;fatal error display
  135. public pre_load_message ;an000;message loader
  136. .xlist
  137. msg_services <MSGDATA> ;an000;
  138. .list
  139. ;======================= sysmsg.inc invocation ===========================
  140. ;
  141. ; include sysmsg.inc - message retriever services
  142. ;
  143. ;
  144. ; options selected:
  145. ; NEARmsg
  146. ; DISPLAYmsg
  147. ; LOADmsg
  148. ; CHARmsg
  149. ; NUMmsg
  150. ; CLSAmsg
  151. ; CLSBmsg
  152. ; CLSCmsg
  153. ;
  154. ;=========================================================================
  155. .xlist
  156. msg_services <LOADmsg> ;an000;no version check
  157. msg_services <DISPLAYmsg,CHARmsg,NUMmsg,INPUTmsg> ;an000;display messages
  158. msg_services <EDLIN.CLA,EDLIN.CLB,EDLIN.CLC> ;an000;message types
  159. msg_services <EDLIN.CL1,EDLIN.CL2> ;an000;message types
  160. msg_services <EDLIN.CTL> ;an000;
  161. .list
  162. ;=========================================================================
  163. ; printf: printf is a replacement of the printf procedure used in DOS
  164. ; releases prior to 4.00. printf invokes the macro disp_message
  165. ; to display a message through the new message handler. the
  166. ; interface into printf will continue to be a pointer to a message
  167. ; passed in DX. the pointer is pointing to more than a message
  168. ; now. it is pointing to a table for that message containing
  169. ; all relevant information for printing the message. the macro
  170. ; disp_message operates on these tables.
  171. ;
  172. ; Date : 6/11/87
  173. ;=========================================================================
  174. printf proc near ;an000;printf procedure
  175. disp_message dx ;an000;display a message
  176. ; $if c ;an000;if an error occurred
  177. JNC $$IF1
  178. call disp_fatal ;an000;display the fatal error
  179. ; $endif ;an000;
  180. $$IF1:
  181. ret ;an000;return to caller
  182. printf endp ;an000;end printf proc
  183. ;=========================================================================
  184. ; disp_fatal: this routine displays a fatal error message in the event
  185. ; an error occurred in disp_message.
  186. ;
  187. ; Date : 6/11/87
  188. ;=========================================================================
  189. disp_fatal proc near ;an000;fatal error message
  190. mov ax,fatal_error ;an000;fatal_error number
  191. mov bx,stdout ;an000;print to console
  192. mov cx,0 ;an000;no parameters
  193. mov dl,no_input ;an000;no keyboard input
  194. mov dh,UTILITY_MSG_CLASS ;an000;utility messages
  195. call sysdispmsg ;an000;display fatal error
  196. ret ;an000;return to caller
  197. disp_fatal endp ;an000;end disp_fatal proc
  198. ;=========================================================================
  199. ; PRE_LOAD_MESSAGE : This routine provides access to the messages required
  200. ; by EDLIN. This routine will report if the load was
  201. ; successful. An unsuccessful load will cause EDLIN
  202. ; to terminate with an appropriate error message.
  203. ;
  204. ; Date : 6/11/87
  205. ;=========================================================================
  206. PRE_LOAD_MESSAGE proc near ;an000;pre-load messages
  207. call SYSLOADMSG ;an000;invoke loader
  208. ; $if c ;an000;if an error
  209. JNC $$IF3
  210. pushf ;an000;save flags
  211. call SYSDISPMSG ;an000;let him say why
  212. popf ;an000;restore flags
  213. ; $endif ;an000;
  214. $$IF3:
  215. ret ;an000;return to caller
  216. PRE_LOAD_MESSAGE endp ;an000;end proc
  217. include msgdcl.inc
  218. code ends ;an000;end code segment
  219. CONST SEGMENT PUBLIC BYTE
  220. extrn arg_buf:byte ;an000;
  221. extrn line_num:byte ;an000;
  222. extrn line_flag:byte ;an000;
  223. extrn Temp_Path:byte ;an000;
  224. public baddrv,opt_err_ptr,nobak
  225. public simple_msg
  226. public msg_too_many,dskful,memful_ptr,badcom
  227. public nodir,filenm_ptr,newfil,read_err_ptr
  228. public nosuch,toolng,eof,dest
  229. public mrgerr,ro_err,bcreat,ndname
  230. public dsp_options,dsp_help,num_help_msgs
  231. public ask_ptr,qmes_ptr,msg_crlf,msg_lf
  232. public prompt
  233. public line_num_buf_ptr ;an000;DMS:6/15/87
  234. public arg_buf_ptr ;an000;DMS:6/15/87
  235. public cont_ptr ;an000;DMS:6/18/87
  236. public cp_err ;an000;DMS:6/22/87
  237. public Del_Bak_Ptr ;an000;dms;
  238. ;============== REPLACEABLE PARAMETER SUBLIST STRUCTURE ==================
  239. ;
  240. ; byte 1 - substitution list size, always 11
  241. ; byte 2 - reserved for use by message handler
  242. ; byte 3 - pointer to parameter to be used as a substitution
  243. ; byte 7 - which parameter is this to replace, %1, %2, etc.
  244. ; byte 8 - determines how the parameter is to be output
  245. ; byte 9 - determines the maximum width of the parameter string
  246. ; byte 10 - determines the minimum width of the parameter string
  247. ; byte 11 - define what is to be used as a pad character
  248. ;
  249. ;=========================================================================
  250. ;=========================================================================
  251. ; replaceable parameter sublists
  252. ;=========================================================================
  253. ed_read_sub label dword ;an000;a read error occurred
  254. db 11 ;an000;sublist size
  255. db 00 ;an000;reserved
  256. dd dg:path_name ;an000;pointer to parameter
  257. db 01 ;an000;parm 1
  258. db Char_Field_ASCIIZ ;an000;left align/asciiz/char.
  259. db unlim_width ;an000;unlimited width
  260. db 00 ;an000;minimum width of 0
  261. db pad_blank ;an000;pad with blanks
  262. arg_sub label dword ;an000;line output buffer
  263. db 11 ;an000;sublist size
  264. db 00 ;an000;reserved
  265. dd dg:arg_buf ;an000;pointer to parameter
  266. db 01 ;an000;parm 1
  267. db Char_Field_ASCIIZ ;an000;left align/asciiz/char.
  268. db unlim_width ;an000;unlimited width
  269. db 00 ;an000;minimum width of 0
  270. db pad_blank ;an000;pad with blank
  271. num_sub label dword ;an000;line number
  272. db 11 ;an000;sublist size
  273. db 00 ;an000;reserved
  274. dd dg:line_num ;an000;pointer to parameter
  275. db 01 ;an000;parm 1
  276. db Right_Align+Unsgn_Bin_Word ;an000;right align/decimal
  277. db 08 ;an000;maximum width
  278. db 08 ;an000;minimum width of 0
  279. db pad_blank ;an000;pad with blank
  280. db 11 ;an000;optional flag
  281. db 00 ;an000;reserved
  282. dd dg:line_flag ;an000;pointer to parameter
  283. db 02 ;an000;parm 2
  284. db Char_Field_Char ;an000;character
  285. db 01 ;an000;minimum width of 1
  286. db 01 ;an000;maximum width of 1
  287. db pad_blank ;an000;pad with blank
  288. BAK_Sub label dword ;an000;line output buffer
  289. db 11 ;an000;sublist size
  290. db 00 ;an000;reserved
  291. dd dg:Temp_Path ;an000;pointer to parameter
  292. db 00 ;an000;parm 0
  293. db Char_Field_ASCIIZ ;an000;left align/asciiz/char.
  294. db unlim_width ;an000;unlimited width
  295. db 00 ;an000;minimum width of 0
  296. db pad_blank ;an000;pad with blank
  297. ;=========================================================================
  298. ; end replaceable parameter sublists
  299. ;=========================================================================
  300. ;======================= TABLE STRUCTURE =================================
  301. ;
  302. ; bute 1-2 : message number of message to be displayed
  303. ; byte 3 : message type to be used, i.e.;class 1, utility, etc.
  304. ; byte 4-5 : display handle, i.e.; console, printer, etc.
  305. ; byte 6-7 : pointer to substitution list, if any.
  306. ; byte 8-9 : number of replaceable parameters, if any.
  307. ; byte 10 : type of input from keyboard, if any.
  308. ; byte 11-12: pointer to buffer for keyboard input, if any.
  309. ;
  310. ;=========================================================================
  311. ; a bunch of common messages (class=UTILITY_MSG_CLASS, dest=stdout,
  312. ; no inputs or sublists) are passed
  313. ; through absolute message numbers rather
  314. ; than duplicating the data structure for
  315. ; each one.
  316. prompt = 0006 ; "*"
  317. baddrv = 0007 ; "Invalid drive or file name"
  318. ndname = 0008 ;"File name must be
  319. ;specified",0d,0a,0
  320. ro_err = 0010 ;"File is READ-ONLY",0d,0a,0
  321. bcreat = 0011 ;"File Creation Error",0d,0a,0
  322. msg_too_many = 0012 ;"Too many files open",0d,0a,0
  323. nobak = 0014 ;"Cannot edit .BAK file
  324. ;--rename file",0d,0a,0
  325. nodir = 0015 ;"No room in directory
  326. ;for file",0d,0d,0
  327. dskful = 0016 ;"Disk full. Edits lost.",0d,0a,0
  328. badcom = 0018 ;"Entry error",0d,0a,0
  329. newfil = 0019 ;"New file",0d,0a,0
  330. nosuch = 0020 ;"Not found",0d,0a,0
  331. toolng = 0022 ;"Line too long",0d,0a,0
  332. eof = 0023 ;"End of input file",0d,0a,0
  333. dest = 0025 ;"Must specify destination
  334. ;line number",0d,0a,0
  335. mrgerr = 0026 ;"Not enough room to
  336. ;merge the entire file",0d,0a,0
  337. msg_crlf = 0027 ;0d,0a,0
  338. msg_lf = 0028 ;0a,0
  339. cp_err = 0033 ;"Cannot merge - Code page
  340. ; mismatch",0d,0a
  341. dsp_options = 0300 ; display options
  342. dsp_help = 0301 ; display help
  343. num_help_msgs = 7
  344. simple_msg label word
  345. dw 0000 ; message number (supplied as used)
  346. db UTILITY_MSG_CLASS ; utility message
  347. dw stdout ; display handle
  348. dw 00 ; no sublist
  349. dw 00 ; no sub
  350. db no_input ; no keyboard input
  351. dw 00 ; no keyboard buffer
  352. opt_err_ptr label word ;an000;"Invalid parameter",0d,0a,0
  353. dw 0010 ;an000;message number
  354. db Parse_Err_Class ;an000;utility message
  355. dw StdErr ;an000;display handle
  356. dw 00 ;an000;no sublist
  357. dw 00 ;an000;no sub
  358. db no_input ;an000;no keyboard input
  359. dw 00 ;an000;no keyboard buffer
  360. read_err_ptr label word ;an000;"Read error in:",
  361. ;an000;0d,0a,"%1",0d,0a,0
  362. dw 0013 ;an000;message number
  363. db UTILITY_MSG_CLASS ;an000;utility message
  364. dw stdout ;an000;display handle
  365. dw dg:ed_read_sub ;an000;point to sublist
  366. dw 0001 ;an000;1 sub
  367. db no_input ;an000;no keyboard input
  368. dw 00 ;an000;no keyboard buffer
  369. memful_ptr label word ;an000;"Insufficient memory",0d,0a,0
  370. dw 0008 ;an000;message number
  371. db Ext_Err_Class ;an000;extended error
  372. dw stderr ;an000;display handle
  373. dw 00 ;an000;no sublist
  374. dw 00 ;an000;no sub
  375. db no_input ;an000;no keyboard input
  376. dw 00 ;an000;no keyboard buffer
  377. filenm_ptr label word ;an000;"File not found",0d,0a
  378. dw 0002 ;an000;message number
  379. db Ext_Err_Class ;an000;utility message
  380. dw stderr ;an000;display handle
  381. dw 00 ;an000;no sublist
  382. dw 00 ;an000;no sub
  383. db no_input ;an000;no keyboard input
  384. dw 00 ;an000;no keyboard buffer
  385. ask_ptr label word ;an000;"O.K.? ",0
  386. dw 0021 ;an000;message number
  387. db UTILITY_MSG_CLASS ;an000;utility message
  388. dw stdout ;an000;display handle
  389. dw 00 ;an000;no sub
  390. dw 00 ; no sublist
  391. db DOS_KEYB_INP ;an000;keyboard input - AX
  392. dw 00 ;an000;no keyboard buffer
  393. qmes_ptr label word ;an000;"Abort edit (Y/N)? ",0
  394. dw 0024 ;an000;message number
  395. db UTILITY_MSG_CLASS ;an000;utility message
  396. dw stdout ;an000;display handle
  397. dw 00 ;an000;no sublist
  398. dw 00 ;an000;no sub
  399. db DOS_KEYB_INP ;an000;keyboard input - AX
  400. dw 00 ;an000;no keyboard buffer
  401. cont_ptr label word ;an000;"Continue (Y/N)?"
  402. dw 0029 ;an000;message number
  403. db UTILITY_MSG_CLASS ;an000;utility message
  404. dw stdout ;an000;display handle
  405. dw 00 ;an000;no sublist
  406. dw 00 ;an000;no sub
  407. db DOS_KEYB_INP ;an000;keyboard input
  408. dw 00 ;an000;no keyboard buffer
  409. arg_buf_ptr label word ;an000;argument buffer for
  410. ; line output
  411. dw 0031 ;an000;message number
  412. db UTILITY_MSG_CLASS ;an000;utility message
  413. dw stdout ;an000;display handle
  414. dw dg:arg_sub ;an000;argument sublist
  415. dw 01 ;an000;1 sub
  416. db no_input ;an000;no keyboard input
  417. dw 00 ;an000;no keyboard buffer
  418. line_num_buf_ptr label word ;an000;holds line numbers
  419. dw 0032 ;an000;message number
  420. db UTILITY_MSG_CLASS ;an000;utility message
  421. dw stdout ;an000;display handle
  422. dw dg:num_sub ;an000;argument sublist
  423. dw 02 ;an000;2 subs
  424. db no_input ;an000;no keyboard input
  425. dw 00 ;an000;no keyboard buffer
  426. del_bak_ptr label word ;an000;"Access Denied - xxxxxxxx.BAK"
  427. dw 0005 ;an000;message number
  428. db Ext_Err_Class ;an000;utility message
  429. dw stderr ;an000;display handle
  430. dw dg:BAK_Sub ;an000;no sublist
  431. dw 01 ;an000;no subs
  432. db no_input ;an000;no keyboard input
  433. dw 00 ;an000;no keyboard buffer
  434. CONST ENDS
  435. END
  436.