@@ -167,7 +167,7 @@ DRIVE_LAYOUT_INFORMATION = record
167167 PDriveLayoutInformation = ^TDriveLayoutInformation;
168168
169169const
170- MAX_DOS_NAMES = 20000 ; // enough room to handle all possible block and serial devices on an average PC, sometimes it might not be enough !!!
170+ MAX_DOS_NAMES = 125000 ; // enough room to handle all possible block and serial devices on an average PC, sometimes it might not be enough !!!
171171 OBJ_CASE_INSENSITIVE = $00000040 ;
172172 FILE_NON_DIRECTORY_FILE = $00000040 ;
173173 FILE_SYNCHRONOUS_IO_NONALERT = $00000020 ;
@@ -381,7 +381,7 @@ procedure InitializeObjectAttributes(var InitializedAttributes: TObjectAttribute
381381 if len = 0 then
382382 begin
383383 tmp:=GetLastError;
384- raise Exception.Create(SysErrorMessage(tmp));
384+ raise Exception.Create(' ImScsiOpenScsiAdapter:QueryDosDevice = ' + SysErrorMessage(tmp));
385385 end ;
386386 for i:=1 to len Do
387387 if dosDevs[i] = #0 then dosDevs[i]:= #13 ;
@@ -397,7 +397,16 @@ procedure InitializeObjectAttributes(var InitializedAttributes: TObjectAttribute
397397 portNum:=StrToInt(Copy(devices[i],5 ,Length(devices[i])-5 ));
398398 if portNum < 256 Then
399399 Begin
400- if QueryDosDevice(PAnsiChar(devices[i]), PAnsiChar(target), Length(target)) = 0 then RaiseLastOSError;
400+ if QueryDosDevice(PAnsiChar(devices[i]), PAnsiChar(target), Length(target)) = 0 then
401+ try
402+ RaiseLastOSError;
403+ except
404+ on E:Exception do
405+ Begin
406+ E.Message:= ' ImScsiOpenScsiAdapter:QueryDosDevice[' + IntToStr(i) + ' ] = ' + E.Message;
407+ raise E;
408+ end ;
409+ end ;
401410 if (Pos(scsiport_prefix, target) = 1 ) Or (Pos(storport_prefix, target) = 1 ) then
402411 Begin
403412 RtlInitUnicodeString(@devName, PWideChar(WideString(target)));
0 commit comments