NFRCR
NFRCR

Reputation: 5580

Should I only use the W versions on the Windows API functions from now on?

It seems that soon after the support for Windows XP ended, the Windows SDK guys deprecated all the A versions of the functions.

#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
_WINSOCK_DEPRECATED_BY("WSASocketW()")
WINSOCK_API_LINKAGE
_Must_inspect_result_
SOCKET
WSAAPI
WSASocketA(
    _In_ int af,
    _In_ int type,
    _In_ int protocol,
    _In_opt_ LPWSAPROTOCOL_INFOA lpProtocolInfo,
    _In_ GROUP g,
    _In_ DWORD dwFlags
    );
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion

Upvotes: 3

Views: 1775

Answers (1)

The A versions do work and will continue to work, but since the native API is unicode, those A function calls will be converted internally to W calls, so using the W calls directly is more efficient.

Upvotes: 6

Related Questions