302 |
|
|
303 |
|
uses FBMessages {$IFNDEF FPC}, TypInfo {$ENDIF}; |
304 |
|
|
305 |
+ |
function BufToStr(P: PByte; Len: integer):AnsiString; |
306 |
+ |
begin |
307 |
+ |
SetLength(Result,Len); |
308 |
+ |
Move(P^,Result[1],Len); |
309 |
+ |
end; |
310 |
+ |
|
311 |
|
{$IFDEF FPC} |
312 |
|
{ TOutputBlockItemGroup } |
313 |
|
|
496 |
|
Result := ''; |
497 |
|
with FItemData^ do |
498 |
|
case FDataType of |
499 |
+ |
dtIntegerFixed, |
500 |
|
dtInteger: |
501 |
|
Result := IntToStr(getAsInteger); |
502 |
|
dtByte: |
772 |
|
begin |
773 |
|
for i := 0 to length(FItems) - 1 do |
774 |
|
begin |
775 |
< |
for j := 0 to Length(FItems[i]^.FSubItems) -1 do |
776 |
< |
dispose(FItems[i]^.FSubItems[j]); |
777 |
< |
dispose(FItems[i]); |
775 |
> |
if FItems[i] <> nil then |
776 |
> |
begin |
777 |
> |
for j := 0 to Length(FItems[i]^.FSubItems) -1 do |
778 |
> |
if FItems[i]^.FSubItems[j] <> nil then |
779 |
> |
dispose(FItems[i]^.FSubItems[j]); |
780 |
> |
dispose(FItems[i]); |
781 |
> |
end; |
782 |
|
end; |
783 |
|
FreeMem(FBuffer); |
784 |
|
inherited Destroy; |
854 |
|
else |
855 |
|
begin |
856 |
|
item := TOutputBlockItem.Create(self,(aItems[i])); |
857 |
< |
writeln(Indent,'ItemType = ',byte(FBufPtr^),' Value = ',(item as TOutputBlockItem).GetAsString); |
857 |
> |
try |
858 |
> |
writeln(Indent,'ItemType = ',byte(FBufPtr^),' Value = ',(item as TOutputBlockItem).GetAsString); |
859 |
> |
except |
860 |
> |
writeln(Indent,'Unknown ItemType = ',byte(FBufPtr^)); |
861 |
> |
end; |
862 |
|
end; |
863 |
|
end; |
864 |
|
end; |
875 |
|
if byte(FBuffer[i]) = isc_info_end then break; |
876 |
|
end; |
877 |
|
writeln; |
878 |
+ |
for i := 0 to getBufSize - 1 do |
879 |
+ |
begin |
880 |
+ |
if chr(FBuffer[i]) in [' '..'~'] then |
881 |
+ |
write(chr(Buffer[i])) |
882 |
+ |
else |
883 |
+ |
write('.'); |
884 |
+ |
if byte(FBuffer[i]) = isc_info_end then break; |
885 |
+ |
end; |
886 |
+ |
writeln; |
887 |
|
end; |
888 |
|
|
889 |
|
{ TDBInfoItem } |
1086 |
|
while (P < FBufPtr + FSize) and (P^ <> isc_info_flag_end) do |
1087 |
|
begin |
1088 |
|
SetLength(FSubItems,i+1); |
1089 |
+ |
FSubItems[i] := nil; |
1090 |
|
case group of |
1091 |
|
isc_info_svc_svr_db_info: |
1092 |
|
case integer(P^) of |
1098 |
|
FSubItems[i] := AddStringItem(P); |
1099 |
|
|
1100 |
|
else |
1101 |
< |
IBError(ibxeOutputParsingError, [integer(P^)]); |
1101 |
> |
IBError(ibxeOutputParsingError, [integer(P^),BufToStr(P,FSize - (P-FBufPtr))]); |
1102 |
|
end; |
1103 |
|
|
1104 |
|
isc_info_svc_get_license: |
1107 |
|
isc_spb_lic_key: |
1108 |
|
FSubItems[i] := AddIntegerItem(P); |
1109 |
|
else |
1110 |
< |
IBError(ibxeOutputParsingError, [integer(P^)]); |
1110 |
> |
IBError(ibxeOutputParsingError, [integer(P^),BufToStr(P,FSize - (P-FBufPtr))]); |
1111 |
|
end; |
1112 |
|
|
1113 |
|
isc_info_svc_limbo_trans: |
1126 |
|
isc_spb_tra_state: |
1127 |
|
FSubItems[i] := AddByteItem(P); |
1128 |
|
else |
1129 |
< |
IBError(ibxeOutputParsingError, [integer(P^)]); |
1129 |
> |
IBError(ibxeOutputParsingError, [integer(P^),BufToStr(P,FSize - (P-FBufPtr))]); |
1130 |
|
end; |
1131 |
|
|
1132 |
|
isc_info_svc_get_users: |
1144 |
|
FSubItems[i] := AddStringItem(P); |
1145 |
|
|
1146 |
|
else |
1147 |
< |
IBError(ibxeOutputParsingError, [integer(P^)]); |
1147 |
> |
IBError(ibxeOutputParsingError, [integer(P^),BufToStr(P,FSize - (P-FBufPtr))]); |
1148 |
|
end; |
1149 |
|
|
1150 |
|
end; |
1195 |
|
while (P < Buffer + getBufSize) and (P^ <> isc_info_end) do |
1196 |
|
begin |
1197 |
|
SetLength(FItems,i+1); |
1198 |
+ |
FItems[i] := nil; |
1199 |
|
case integer(P^) of |
1200 |
|
isc_info_svc_line, |
1201 |
|
isc_info_svc_get_env, |
1230 |
|
|
1231 |
|
|
1232 |
|
else |
1233 |
< |
IBError(ibxeOutputParsingError, [integer(P^)]); |
1233 |
> |
IBError(ibxeOutputParsingError, [integer(P^),BufToStr(P,getBufSize - (P-Buffer))]); |
1234 |
|
end; |
1235 |
|
P := P + FItems[i]^.FSize; |
1236 |
|
Inc(i); |