wsock32 functions use INTEGER(HANDLE) vice CHARACTER*(*)?

With Intel Fortran, the various sockets functions in wsock32 that read/write data take the data in as a character buffer, CHARACTER*(), equivalent to char. The same functions in the PGI Fortran declare that buffer at INTEGER(HANDLE).
So the question is - How do I use these functions and pass in the character buffer data? Is there some way to get the pointer to the character buffer and cast it as INTEGER(HANDLE)? Or some other trick?
Thanks,
Andy Elliott

Here is the INTERFACE block from wsock32.f90 for the send function from Intel:

    FUNCTION send( s, buf, len, flags)
    use ifwinty
    integer(SINT) :: send ! int
    !DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'send' :: send
         integer(UINT_PTR)  s ! SOCKET s
         !DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: buf
         character*(*)  buf ! char*  buf
         integer(SINT) len ! int len
         integer(SINT) flags ! int flags
     END FUNCTION

And here is the same function from PGI:

    FUNCTION send( s, buf, len,  flags)
     USE DFWINTY
      integer(SINT) :: send ! int  
     !DEC$ ATTRIBUTES STDCALL, DECORATE, ALIAS : 'send' :: send
         integer(UINT_PTR) s ! SOCKET s
         integer(HANDLE) buf ! char buf
         integer(SINT) len ! int len
         integer(SINT) flags ! int flags
     END FUNCTION

Just an added note - Looking through kernel32.f90, I discovered that a lot of passed data that are declared otherwise in Intel Fortran are declared INTEGER(HANDLE) in PGI Fortran. So the answer to this question should have general applicability to a lot of WIN API calls.
Andy Elliott

Hi Andy,

It looks like you sent this issue to PGI Customer Service (trs@pgroup.com) who have logged this as TPR#19811 and sent it on to engineering for further investigation.

Thanks,
Mat

That’s true, but there is always the hope that another user has already worked all this out and might respond. I can’t be the only one who needs to use the WIN API functionality.