Skip to content

Commit 52dcc56

Browse files
committed
Increased the buffer size for QueryDosDevice in ImScsiOpenScsiAdapter()
1 parent c448ce9 commit 52dcc56

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.exe
2+
*.dll
3+
*.dcu
4+
*.bkm
5+
*.drc

Definitions.pas

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ DRIVE_LAYOUT_INFORMATION = record
167167
PDriveLayoutInformation = ^TDriveLayoutInformation;
168168

169169
const
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)));

RamdiskUI.dof

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ ActiveLang=
110110
ProjectLang=
111111
RootDir=C:\Program Files (x86)\Borland\Delphi7\Bin\
112112
[Version Info]
113-
IncludeVerInfo=0
113+
IncludeVerInfo=1
114114
AutoIncBuild=0
115115
MajorVer=1
116-
MinorVer=0
117-
Release=0
118-
Build=0
116+
MinorVer=1
117+
Release=1
118+
Build=2
119119
Debug=0
120120
PreRelease=0
121121
Special=0
@@ -126,7 +126,7 @@ CodePage=1251
126126
[Version Info Keys]
127127
CompanyName=
128128
FileDescription=
129-
FileVersion=1.0.0.0
129+
FileVersion=1.1.1.2
130130
InternalName=
131131
LegalCopyright=
132132
LegalTrademarks=

RamdiskUI.res

660 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)