Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26749 Discussions

XE 2018 readfile interface has been updated wrongly

Andrew_Smith
New Contributor III
110 Views
FUNCTION ReadFile( &
        hFile, &
        lpBuffer, &
        nNumberOfBytesToRead, &
        lpNumberOfBytesRead, &
        lpOverlapped)
import
  integer(BOOL) :: ReadFile ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'ReadFile' :: ReadFile
  integer(HANDLE) hFile ! HANDLE hFile
  integer(LPVOID) lpBuffer ! LPVOID lpBuffer
  integer(DWORD) nNumberOfBytesToRead ! DWORD nNumberOfBytesToRead
  integer(DWORD) lpNumberOfBytesRead ! LPDWORD lpNumberOfBytesRead
!DEC$ ATTRIBUTES REFERENCE, IGNORE_LOC, ALLOW_NULL :: lpOverlapped
  TYPE (T_OVERLAPPED) lpOverlapped ! LPOVERLAPPED lpOverlapped
 END FUNCTION

Since number of bytes read is a returned value it needs to be a pointer and  should be declaed with INTEGER(LPDWORD) as it was in your previous kernal32.f90

0 Kudos
1 Reply
Andrew_Smith
New Contributor III
110 Views

writeFile has the same issue.

The new interfaces are causing crashes for me. I substitued the old interface and all is OK now.

Reply