Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

API interface error GetUserName in ADVAPI32.f90/compiler 18.0

andrew_4619
Honored Contributor II
547 Views

In ADVAPI32.f90 in compiler 18.0 we have:

INTERFACE 
FUNCTION GetUserName( &
        lpBuffer, &
        nSize)
use ifwinty
  integer(BOOL) :: GetUserName ! BOOL
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'GetUserNameA' :: GetUserName
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpBuffer
  character*(*) lpBuffer ! LPSTR lpBuffer
  integer(LPDWORD) nSize ! LPDWORD nSize
 END FUNCTION
END INTERFACE

Using this causes a crash as nSize is in/out and should be passed by reference. I have applied a local fix but it needs updating....

0 Kudos
1 Solution
andrew_4619
Honored Contributor II
547 Views
0 Kudos
4 Replies
Steve_Lionel
Honored Contributor III
547 Views

Best to report this through the Intel Service Center.

0 Kudos
andrew_4619
Honored Contributor II
548 Views

Done

0 Kudos
Robert_van_Amerongen
New Contributor III
547 Views

Andrew,

the problem is not in the function itself. I have added a small example.

Robert

 

0 Kudos
andrew_4619
Honored Contributor II
547 Views

Indeed Robert, the interface is wrong for nsize.

0 Kudos
Reply