View Issue Details

IDProjectCategoryView StatusLast Update
0023343FPCDocumentationpublic2013-09-20 12:28
ReporterSergei Gorelkin Assigned ToMichael Van Canneyt  
Status closedResolutionfixed 
Product Version2.7.1 
Target Version2.6.2Fixed in Version3.0.0 
Summary0023343: Description of FileCreate and FileOpen return value is outdated
DescriptionFileCreate and FileOpen functions return a THandle, which has been changed into PtrUInt for Windows platforms in due time. Therefore, return value of said functions on error is not literal -1, but THandle(-1).

Possibly this issue goes slightly beyond documentation and we need to declare a constant like InvalidHandleValue=THandle(-1) and recommend using it for comparing with FileCreate/FileOpen output value.
TagsNo tags attached.
Fixed in Revision971
Attached Files


Michael Van Canneyt

2012-12-26 17:17

administrator   ~0064477

Adapted. We should indeed define InvalidFileHandle = THandle(-1).

I think the windows unit defines something similar, but a SysUtils version would not be bad.

Issue History

Date Modified Username Field Change
2012-11-18 11:49 Sergei Gorelkin New Issue
2012-11-18 11:49 Sergei Gorelkin Status new => assigned
2012-11-18 11:49 Sergei Gorelkin Assigned To => Michael Van Canneyt
2012-11-18 11:49 Sergei Gorelkin FPCOldBugId => 0
2012-12-26 17:17 Michael Van Canneyt Fixed in Revision => 971
2012-12-26 17:17 Michael Van Canneyt Status assigned => resolved
2012-12-26 17:17 Michael Van Canneyt Fixed in Version => 2.7.1
2012-12-26 17:17 Michael Van Canneyt Resolution open => fixed
2012-12-26 17:17 Michael Van Canneyt Note Added: 0064477
2012-12-26 17:17 Michael Van Canneyt Target Version => 2.6.2
2013-09-20 12:28 Sergei Gorelkin Status resolved => closed