mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 01:29:19 +02:00
* Patch by Martin Friebe: mark duplicated handle for close instead of original
This commit is contained in:
parent
5305cd2734
commit
d3b8aa728e
@ -370,8 +370,9 @@ begin
|
|||||||
DUPLICATE_SAME_ACCESS
|
DUPLICATE_SAME_ACCESS
|
||||||
);
|
);
|
||||||
if Res then begin
|
if Res then begin
|
||||||
if (IOType=iotHandle) and not FAutoCloseCustomHandle then
|
// Either AutoCloseCustomHandle or set in OnGetHandle
|
||||||
FCloseHandleOnExecute:=True // AutoCloseCustomHandle protects the original Handle
|
if (IOType=iotHandle) and not FCloseHandleOnExecute then
|
||||||
|
FCloseHandleOnExecute:=True // the original CustomHandle is kept open / Set True for the duplicate handle
|
||||||
else
|
else
|
||||||
Res:=CloseHandle(oldHandle);
|
Res:=CloseHandle(oldHandle);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user