system.pp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2006 by Florian Klaempfl and Pavel Ozerski
  4. member of the Free Pascal development team.
  5. FPC Pascal system unit for the Win64 API.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. unit System;
  13. interface
  14. { $define SYSTEMEXCEPTIONDEBUG}
  15. {$ifdef SYSTEMDEBUG}
  16. {$define SYSTEMEXCEPTIONDEBUG}
  17. {$endif SYSTEMDEBUG}
  18. {$define DISABLE_NO_THREAD_MANAGER}
  19. {$define HAS_WIDESTRINGMANAGER}
  20. {$define DISABLE_NO_DYNLIBS_MANAGER}
  21. {$define FPC_SYSTEM_HAS_SYSDLH}
  22. {$ifdef FPC_USE_WIN64_SEH}
  23. {$define FPC_SYSTEM_HAS_RAISEEXCEPTION}
  24. {$define FPC_SYSTEM_HAS_RERAISE}
  25. {$define FPC_SYSTEM_HAS_CAPTUREBACKTRACE}
  26. {$endif FPC_USE_WIN64_SEH}
  27. { include system-independent routine headers }
  28. {$I systemh.inc}
  29. const
  30. LineEnding = #13#10;
  31. LFNSupport = true;
  32. DirectorySeparator = '\';
  33. DriveSeparator = ':';
  34. ExtensionSeparator = '.';
  35. PathSeparator = ';';
  36. AllowDirectorySeparators : set of char = ['\','/'];
  37. AllowDriveSeparators : set of char = [':'];
  38. { FileNameCaseSensitive and FileNameCasePreserving are defined separately below!!! }
  39. maxExitCode = 65535;
  40. MaxPathLen = 260;
  41. AllFilesMask = '*';
  42. type
  43. PEXCEPTION_FRAME = ^TEXCEPTION_FRAME;
  44. TEXCEPTION_FRAME = record
  45. next : PEXCEPTION_FRAME;
  46. handler : pointer;
  47. end;
  48. const
  49. { Default filehandles }
  50. UnusedHandle : THandle = THandle(-1);
  51. StdInputHandle : THandle = 0;
  52. StdOutputHandle : THandle = 0;
  53. StdErrorHandle : THandle = 0;
  54. System_exception_frame : PEXCEPTION_FRAME =nil;
  55. FileNameCaseSensitive : boolean = false;
  56. FileNameCasePreserving: boolean = true;
  57. CtrlZMarksEOF: boolean = true; (* #26 is considered as end of file *)
  58. sLineBreak = LineEnding;
  59. DefaultTextLineBreakStyle : TTextLineBreakStyle = tlbsCRLF;
  60. var
  61. { C compatible arguments }
  62. argc : longint;
  63. argv : ppchar;
  64. { Win32 Info }
  65. startupinfo : tstartupinfo deprecated; // Delphi does not have one in interface
  66. StartupConsoleMode : dword;
  67. MainInstance : qword;
  68. cmdshow : longint;
  69. DLLreason : dword;
  70. DLLparam : PtrInt;
  71. const
  72. hprevinst: qword=0;
  73. type
  74. TDLL_Entry_Hook = procedure (dllparam : PtrInt);
  75. const
  76. Dll_Process_Detach_Hook : TDLL_Entry_Hook = nil;
  77. Dll_Thread_Attach_Hook : TDLL_Entry_Hook = nil;
  78. Dll_Thread_Detach_Hook : TDLL_Entry_Hook = nil;
  79. Const
  80. { it can be discussed whether fmShareDenyNone means read and write or read, write and delete, see
  81. also http://bugs.freepascal.org/view.php?id=8898, this allows users to configure the used
  82. value
  83. }
  84. fmShareDenyNoneFlags : DWord = 3;
  85. implementation
  86. {$asmmode att}
  87. var
  88. SysInstance : qword;public;
  89. {$ifdef FPC_USE_WIN64_SEH}
  90. function main_wrapper(arg: Pointer; proc: Pointer): ptrint; assembler; nostackframe;
  91. asm
  92. subq $40, %rsp
  93. .seh_stackalloc 40
  94. .seh_endprologue
  95. call %rdx { "arg" is passed in %rcx }
  96. nop { this nop is critical for exception handling }
  97. addq $40, %rsp
  98. .seh_handler __FPC_default_handler,@except,@unwind
  99. end;
  100. {$endif FPC_USE_WIN64_SEH}
  101. {$define FPC_SYSTEM_HAS_STACKTOP}
  102. function StackTop: pointer; assembler;nostackframe;
  103. asm
  104. movq %gs:(8),%rax
  105. end;
  106. { include system independent routines }
  107. {$I system.inc}
  108. {*****************************************************************************
  109. System Dependent Exit code
  110. *****************************************************************************}
  111. {$ifndef FPC_USE_WIN64_SEH}
  112. procedure install_exception_handlers;forward;
  113. {$endif FPC_USE_WIN64_SEH}
  114. procedure PascalMain;stdcall;external name 'PASCALMAIN';
  115. { include code common with win32 }
  116. {$I syswin.inc}
  117. { TLS directory code }
  118. {$I systlsdir.inc}
  119. Procedure system_exit;
  120. begin
  121. { see comments in win32/system.pp about this logic }
  122. if IsLibrary then
  123. begin
  124. if DllInitState in [DLL_PROCESS_ATTACH,DLL_PROCESS_DETACH] then
  125. LongJmp(DLLBuf,1)
  126. else
  127. MainThreadIDWin32:=0;
  128. end;
  129. if not IsConsole then
  130. begin
  131. Close(stderr);
  132. Close(stdout);
  133. Close(erroutput);
  134. Close(Input);
  135. Close(Output);
  136. { what about Input and Output ?? PM }
  137. { now handled, FPK }
  138. end;
  139. { call exitprocess, with cleanup as required }
  140. ExitProcess(exitcode);
  141. end;
  142. var
  143. { old compilers emitted a reference to _fltused if a module contains
  144. floating type code so the linker could leave away floating point
  145. libraries or not. VC does this as well so we need to define this
  146. symbol as well (FK)
  147. }
  148. _fltused : int64;cvar;public;
  149. { value of the stack segment
  150. to check if the call stack can be written on exceptions }
  151. _SS : Cardinal;
  152. procedure Exe_entry;[public,alias:'_FPC_EXE_Entry'];
  153. begin
  154. IsLibrary:=false;
  155. { install the handlers for exe only ?
  156. or should we install them for DLL also ? (PM) }
  157. {$ifndef FPC_USE_WIN64_SEH}
  158. install_exception_handlers;
  159. {$endif FPC_USE_WIN64_SEH}
  160. ExitCode:=0;
  161. asm
  162. xorq %rax,%rax
  163. movw %ss,%ax
  164. movl %eax,_SS(%rip)
  165. movq %rbp,%rsi
  166. xorq %rbp,%rbp
  167. {$ifdef FPC_USE_WIN64_SEH}
  168. xor %rcx,%rcx
  169. lea PASCALMAIN(%rip),%rdx
  170. call main_wrapper
  171. {$else FPC_USE_WIN64_SEH}
  172. call PASCALMAIN
  173. {$endif FPC_USE_WIN64_SEH}
  174. movq %rsi,%rbp
  175. end ['RSI','RBP']; { <-- specifying RSI allows compiler to save/restore it properly }
  176. { if we pass here there was no error ! }
  177. system_exit;
  178. end;
  179. procedure _FPC_DLLMainCRTStartup(_hinstance : qword;_dllreason : dword;_dllparam:Pointer);stdcall;public name '_DLLMainCRTStartup';
  180. begin
  181. IsConsole:=true;
  182. sysinstance:=_hinstance;
  183. dllreason:=_dllreason;
  184. dllparam:=PtrInt(_dllparam);
  185. DLL_Entry;
  186. end;
  187. procedure _FPC_DLLWinMainCRTStartup(_hinstance : qword;_dllreason : dword;_dllparam:Pointer);stdcall;public name '_DLLWinMainCRTStartup';
  188. begin
  189. IsConsole:=false;
  190. sysinstance:=_hinstance;
  191. dllreason:=_dllreason;
  192. dllparam:=PtrInt(_dllparam);
  193. DLL_Entry;
  194. end;
  195. function is_prefetch(p : pointer) : boolean;
  196. var
  197. a : array[0..15] of byte;
  198. doagain : boolean;
  199. instrlo,instrhi,opcode : byte;
  200. i : longint;
  201. begin
  202. result:=false;
  203. { read memory savely without causing another exeception }
  204. if not(ReadProcessMemory(GetCurrentProcess,p,@a,sizeof(a),nil)) then
  205. exit;
  206. i:=0;
  207. doagain:=true;
  208. while doagain and (i<15) do
  209. begin
  210. opcode:=a[i];
  211. instrlo:=opcode and $f;
  212. instrhi:=opcode and $f0;
  213. case instrhi of
  214. { prefix? }
  215. $20,$30:
  216. doagain:=(instrlo and 7)=6;
  217. $60:
  218. doagain:=(instrlo and $c)=4;
  219. $f0:
  220. doagain:=instrlo in [0,2,3];
  221. $0:
  222. begin
  223. result:=(instrlo=$f) and (a[i+1] in [$d,$18]);
  224. exit;
  225. end;
  226. else
  227. doagain:=false;
  228. end;
  229. inc(i);
  230. end;
  231. end;
  232. //
  233. // Hardware exception handling
  234. //
  235. {$I seh64.inc}
  236. type
  237. TVectoredExceptionHandler = function (excep : PExceptionPointers) : Longint;
  238. function AddVectoredExceptionHandler(FirstHandler : DWORD;VectoredHandler : TVectoredExceptionHandler) : longint;
  239. external 'kernel32' name 'AddVectoredExceptionHandler';
  240. {$ifndef FPC_USE_WIN64_SEH}
  241. const
  242. MaxExceptionLevel = 16;
  243. exceptLevel : Byte = 0;
  244. var
  245. exceptRip : array[0..MaxExceptionLevel-1] of Int64;
  246. exceptError : array[0..MaxExceptionLevel-1] of Byte;
  247. resetFPU : array[0..MaxExceptionLevel-1] of Boolean;
  248. {$ifdef SYSTEMEXCEPTIONDEBUG}
  249. procedure DebugHandleErrorAddrFrame(error : longint; addr, frame : pointer);
  250. begin
  251. if IsConsole then
  252. begin
  253. write(stderr,'HandleErrorAddrFrame(error=',error);
  254. write(stderr,',addr=',hexstr(int64(addr),16));
  255. writeln(stderr,',frame=',hexstr(int64(frame),16),')');
  256. end;
  257. HandleErrorAddrFrame(error,addr,frame);
  258. end;
  259. {$endif SYSTEMEXCEPTIONDEBUG}
  260. procedure JumpToHandleErrorFrame;
  261. var
  262. rip, rbp : int64;
  263. error : longint;
  264. begin
  265. // save ebp
  266. asm
  267. movq (%rbp),%rax
  268. movq %rax,rbp
  269. end;
  270. if exceptLevel>0 then
  271. dec(exceptLevel);
  272. rip:=exceptRip[exceptLevel];
  273. error:=exceptError[exceptLevel];
  274. {$ifdef SYSTEMEXCEPTIONDEBUG}
  275. if IsConsole then
  276. writeln(stderr,'In JumpToHandleErrorFrame error=',error);
  277. {$endif SYSTEMEXCEPTIONDEBUG}
  278. if resetFPU[exceptLevel] then
  279. SysResetFPU;
  280. { build a fake stack }
  281. asm
  282. movq rbp,%r8
  283. movq rip,%rdx
  284. movl error,%ecx
  285. pushq rip
  286. movq rbp,%rbp // Change frame pointer
  287. {$ifdef SYSTEMEXCEPTIONDEBUG}
  288. jmpl DebugHandleErrorAddrFrame
  289. {$else not SYSTEMEXCEPTIONDEBUG}
  290. jmpl HandleErrorAddrFrame
  291. {$endif SYSTEMEXCEPTIONDEBUG}
  292. end;
  293. end;
  294. function syswin64_x86_64_exception_handler(excep : PExceptionPointers) : Longint;public;
  295. var
  296. res: longint;
  297. err: byte;
  298. must_reset_fpu: boolean;
  299. begin
  300. res:=EXCEPTION_CONTINUE_SEARCH;
  301. {$ifdef SYSTEMEXCEPTIONDEBUG}
  302. if IsConsole then
  303. Writeln(stderr,'syswin64_x86_64_exception_handler called');
  304. {$endif SYSTEMEXCEPTIONDEBUG}
  305. if excep^.ContextRecord^.SegSs=_SS then
  306. begin
  307. err := 0;
  308. must_reset_fpu := true;
  309. {$ifdef SYSTEMEXCEPTIONDEBUG}
  310. if IsConsole then Writeln(stderr,'Exception ',
  311. hexstr(excep^.ExceptionRecord^.ExceptionCode,8));
  312. {$endif SYSTEMEXCEPTIONDEBUG}
  313. case cardinal(excep^.ExceptionRecord^.ExceptionCode) of
  314. STATUS_INTEGER_DIVIDE_BY_ZERO,
  315. STATUS_FLOAT_DIVIDE_BY_ZERO :
  316. err := 200;
  317. STATUS_ARRAY_BOUNDS_EXCEEDED :
  318. begin
  319. err := 201;
  320. must_reset_fpu := false;
  321. end;
  322. STATUS_STACK_OVERFLOW :
  323. begin
  324. err := 202;
  325. must_reset_fpu := false;
  326. end;
  327. STATUS_FLOAT_OVERFLOW :
  328. err := 205;
  329. STATUS_FLOAT_DENORMAL_OPERAND,
  330. STATUS_FLOAT_UNDERFLOW :
  331. err := 206;
  332. { excep^.ContextRecord^.FloatSave.StatusWord := excep^.ContextRecord^.FloatSave.StatusWord and $ffffff00;}
  333. STATUS_FLOAT_INEXACT_RESULT,
  334. STATUS_FLOAT_INVALID_OPERATION,
  335. STATUS_FLOAT_STACK_CHECK :
  336. err := 207;
  337. STATUS_INTEGER_OVERFLOW :
  338. begin
  339. err := 215;
  340. must_reset_fpu := false;
  341. end;
  342. STATUS_ILLEGAL_INSTRUCTION:
  343. err := 216;
  344. STATUS_ACCESS_VIOLATION:
  345. { Athlon prefetch bug? }
  346. if is_prefetch(pointer(excep^.ContextRecord^.rip)) then
  347. begin
  348. { if yes, then retry }
  349. excep^.ExceptionRecord^.ExceptionCode := 0;
  350. res:=EXCEPTION_CONTINUE_EXECUTION;
  351. end
  352. else
  353. err := 216;
  354. STATUS_CONTROL_C_EXIT:
  355. err := 217;
  356. STATUS_PRIVILEGED_INSTRUCTION:
  357. begin
  358. err := 218;
  359. must_reset_fpu := false;
  360. end;
  361. else
  362. begin
  363. if ((excep^.ExceptionRecord^.ExceptionCode and SEVERITY_ERROR) = SEVERITY_ERROR) then
  364. err := 217
  365. else
  366. { pass through exceptions which aren't an error. The problem is that vectored handlers
  367. always are called before structured ones so we see also internal exceptions of libraries.
  368. I wonder if there is a better solution (FK)
  369. }
  370. res:=EXCEPTION_CONTINUE_SEARCH;
  371. end;
  372. end;
  373. if (err <> 0) and (exceptLevel < MaxExceptionLevel) then
  374. begin
  375. exceptRip[exceptLevel] := excep^.ContextRecord^.Rip;
  376. exceptError[exceptLevel] := err;
  377. resetFPU[exceptLevel] := must_reset_fpu;
  378. inc(exceptLevel);
  379. excep^.ContextRecord^.Rip := Int64(@JumpToHandleErrorFrame);
  380. excep^.ExceptionRecord^.ExceptionCode := 0;
  381. res := EXCEPTION_CONTINUE_EXECUTION;
  382. {$ifdef SYSTEMEXCEPTIONDEBUG}
  383. if IsConsole then begin
  384. writeln(stderr,'Exception Continue Exception set at ',
  385. hexstr(exceptRip[exceptLevel-1],16));
  386. writeln(stderr,'Rip changed to ',
  387. hexstr(int64(@JumpToHandleErrorFrame),16), ' error=', err);
  388. end;
  389. {$endif SYSTEMEXCEPTIONDEBUG}
  390. end;
  391. end;
  392. syswin64_x86_64_exception_handler := res;
  393. end;
  394. procedure install_exception_handlers;
  395. begin
  396. AddVectoredExceptionHandler(1,@syswin64_x86_64_exception_handler);
  397. end;
  398. {$endif ndef FPC_USE_WIN64_SEH}
  399. procedure LinkIn(p1,p2,p3: Pointer); inline;
  400. begin
  401. end;
  402. procedure _FPC_mainCRTStartup;stdcall;public name '_mainCRTStartup';
  403. begin
  404. IsConsole:=true;
  405. GetConsoleMode(GetStdHandle((Std_Input_Handle)),@StartupConsoleMode);
  406. {$ifdef FPC_USE_TLS_DIRECTORY}
  407. LinkIn(@_tls_used,@FreePascal_TLS_callback,@FreePascal_end_of_TLS_callback);
  408. {$endif FPC_USE_TLS_DIRECTORY}
  409. Exe_entry;
  410. end;
  411. procedure _FPC_WinMainCRTStartup;stdcall;public name '_WinMainCRTStartup';
  412. begin
  413. IsConsole:=false;
  414. {$ifdef FPC_USE_TLS_DIRECTORY}
  415. LinkIn(@_tls_used,@FreePascal_TLS_callback,@FreePascal_end_of_TLS_callback);
  416. {$endif FPC_USE_TLS_DIRECTORY}
  417. Exe_entry;
  418. end;
  419. {$ifdef FPC_SECTION_THREADVARS}
  420. function fpc_tls_add(addr: pointer): pointer; assembler; nostackframe;
  421. [public,alias: 'FPC_TLS_ADD']; compilerproc;
  422. asm
  423. sub $56,%rsp { 32 spill area + 16 local vars + 8 misalignment }
  424. .seh_stackalloc 56
  425. .seh_endprologue
  426. lea tls_data_start(%rip),%rax
  427. sub %rax,%rcx
  428. cmpb $0,IsLibrary(%rip)
  429. mov _tls_index(%rip),%eax
  430. jnz .L1
  431. mov %gs:(88),%rdx
  432. add (%rdx,%rax,8),%rcx
  433. mov %rcx,%rax
  434. jmp .L3
  435. .L1:
  436. mov %rcx,32(%rsp)
  437. call GetLastError
  438. mov %rax,40(%rsp) { save LastError }
  439. mov _tls_index(%rip),%ecx
  440. call TlsGetValue
  441. test %rax,%rax
  442. jnz .L2
  443. { This can happen when a thread existed before DLL was loaded,
  444. or if DisableThreadLibraryCalls was called. }
  445. call SysAllocateThreadVars
  446. mov $0x1000000,%rcx
  447. call InitThread
  448. mov _tls_index(%rip),%ecx
  449. call TlsGetValue
  450. .L2:
  451. add %rax,32(%rsp)
  452. mov 40(%rsp),%rcx
  453. call SetLastError
  454. mov 32(%rsp),%rax
  455. .L3:
  456. add $56,%rsp
  457. end;
  458. {$endif FPC_SECTION_THREADVARS}
  459. function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
  460. type
  461. tdosheader = packed record
  462. e_magic : word;
  463. e_cblp : word;
  464. e_cp : word;
  465. e_crlc : word;
  466. e_cparhdr : word;
  467. e_minalloc : word;
  468. e_maxalloc : word;
  469. e_ss : word;
  470. e_sp : word;
  471. e_csum : word;
  472. e_ip : word;
  473. e_cs : word;
  474. e_lfarlc : word;
  475. e_ovno : word;
  476. e_res : array[0..3] of word;
  477. e_oemid : word;
  478. e_oeminfo : word;
  479. e_res2 : array[0..9] of word;
  480. e_lfanew : longint;
  481. end;
  482. tpeheader = packed record
  483. PEMagic : longint;
  484. Machine : word;
  485. NumberOfSections : word;
  486. TimeDateStamp : longint;
  487. PointerToSymbolTable : longint;
  488. NumberOfSymbols : longint;
  489. SizeOfOptionalHeader : word;
  490. Characteristics : word;
  491. Magic : word;
  492. MajorLinkerVersion : byte;
  493. MinorLinkerVersion : byte;
  494. SizeOfCode : longint;
  495. SizeOfInitializedData : longint;
  496. SizeOfUninitializedData : longint;
  497. AddressOfEntryPoint : longint;
  498. BaseOfCode : longint;
  499. {$ifdef win32}
  500. BaseOfData : longint;
  501. {$endif win32}
  502. ImageBase : PtrInt;
  503. SectionAlignment : longint;
  504. FileAlignment : longint;
  505. MajorOperatingSystemVersion : word;
  506. MinorOperatingSystemVersion : word;
  507. MajorImageVersion : word;
  508. MinorImageVersion : word;
  509. MajorSubsystemVersion : word;
  510. MinorSubsystemVersion : word;
  511. Reserved1 : longint;
  512. SizeOfImage : longint;
  513. SizeOfHeaders : longint;
  514. CheckSum : longint;
  515. Subsystem : word;
  516. DllCharacteristics : word;
  517. SizeOfStackReserve : PtrInt;
  518. SizeOfStackCommit : PtrInt;
  519. SizeOfHeapReserve : PtrInt;
  520. SizeOfHeapCommit : PtrInt;
  521. LoaderFlags : longint;
  522. NumberOfRvaAndSizes : longint;
  523. DataDirectory : array[1..$80] of byte;
  524. end;
  525. begin
  526. result:=tpeheader((pointer(getmodulehandle(nil))+(tdosheader(pointer(getmodulehandle(nil))^).e_lfanew))^).SizeOfStackReserve;
  527. end;
  528. begin
  529. { pass dummy value }
  530. StackLength := CheckInitialStkLen($1000000);
  531. StackBottom := StackTop - StackLength;
  532. { get some helpful informations }
  533. GetStartupInfo(@startupinfo);
  534. { some misc Win32 stuff }
  535. if not IsLibrary then
  536. SysInstance:=getmodulehandle(nil);
  537. MainInstance:=SysInstance;
  538. cmdshow:=startupinfo.wshowwindow;
  539. { Setup heap and threading, these may be already initialized from TLS callback }
  540. if not Assigned(CurrentTM.BeginThread) then
  541. begin
  542. InitHeap;
  543. InitSystemThreads;
  544. end;
  545. SysInitExceptions;
  546. initunicodestringmanager;
  547. InitWin32Widestrings;
  548. SysInitStdIO;
  549. { Arguments }
  550. setup_arguments;
  551. InitSystemDynLibs;
  552. { Reset IO Error }
  553. InOutRes:=0;
  554. ProcessID := GetCurrentProcessID;
  555. DispCallByIDProc:=@DoDispCallByIDError;
  556. end.