On Tuesday 26 October 2004 02:51, Alexandre Julliard wrote: > > +INT WINAPI WSAEnumProtocolsA( LPINT lpiProtocols, LPWSAPROTOCOL_INFOA lpBuffer, > > LPDWORD lpdwLength ) > > +{ > > + return WINSOCK_EnumProtocols( lpiProtocols, (WSAPROTOCOL_INFOW *)lpBuffer, > > lpdwLength, FALSE ); > > +} > > You cannot cast a WSAPROTOCOL_INFOA* to a WSAPROTOCOL_INFOW*, the > structures don't have the same size.
Not generally no, but here I can because the size difference comes from the last element of the structure which is either a unicode string or an ansi string. The FALSE parameter signals that we want an ansi string. I know its a dirty trick but it's the least intrusive one since it keeps most of the original code. -Hans