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

API interface error GetUserName in ADVAPI32.f90/compiler 18.0

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

Best to report this through the Intel Service Center.

andrew_4619
Honored Contributor II
333 Views

Done

Robert_van_Amerongen
New Contributor III
332 Views

Andrew,

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

Robert

 

andrew_4619
Honored Contributor II
332 Views

Indeed Robert, the interface is wrong for nsize.

Reply