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!
26748 Discussions

API interface error GetUserName in ADVAPI32.f90/compiler 18.0

andrew_4619
Honored Contributor I
203 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 I
203 Views
4 Replies
Steve_Lionel
Black Belt Retired Employee
203 Views

Best to report this through the Intel Service Center.

andrew_4619
Honored Contributor I
204 Views
Robert_van_Amerongen
New Contributor III
203 Views

Andrew,

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

Robert

 

andrew_4619
Honored Contributor I
203 Views

Indeed Robert, the interface is wrong for nsize.

Reply