From 2e0209be05b005537d879a78c10d8ef157600fe2 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Fri, 17 Jul 2015 18:21:40 +0200 Subject: [PATCH] related to #18 Windows may sent the exception to the application --- src/ce_common.pas | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/ce_common.pas b/src/ce_common.pas index f7dab2ec..4c5591fc 100644 --- a/src/ce_common.pas +++ b/src/ce_common.pas @@ -638,13 +638,15 @@ begin try for drv := 'A' to 'Z' do begin - ltr := drv + ':\'; - if not GetVolumeInformation(PChar(ltr), PChar(nme), 255, nil, nil, nil, nil, 0) then - continue; - case GetDriveType(PChar(ltr)) of - DRIVE_REMOVABLE, - DRIVE_FIXED, - DRIVE_REMOTE: aList.Add(ltr); + try + ltr := drv + ':\'; + if not GetVolumeInformation(PChar(ltr), PChar(nme), 255, nil, nil, nil, nil, 0) then + continue; + case GetDriveType(PChar(ltr)) of + DRIVE_REMOVABLE, DRIVE_FIXED, DRIVE_REMOTE: aList.Add(ltr); + end; + except + // SEM_FAILCRITICALERRORS: exception is sent to application. end; end; finally