- Store WSAPROTOCOL_INFOW struct on the stack
svn path=/trunk/; revision=54616
{
INT ret, len;
LPWSTR szTemp;
{
INT ret, len;
LPWSTR szTemp;
- LPWSAPROTOCOL_INFOW lpProtoInfoW = NULL;
+ WSAPROTOCOL_INFOW ProtoInfoW;
len = MultiByteToWideChar(CP_ACP,
0,
len = MultiByteToWideChar(CP_ACP,
0,
- len = WSAPROTOCOL_LEN+1;
- lpProtoInfoW = HeapAlloc(GetProcessHeap(),
- 0,
- FIELD_OFFSET(WSAPROTOCOL_INFOW, szProtocol) +
- (len * sizeof(WCHAR)));
-
- memcpy(lpProtoInfoW,
lpProtocolInfo,
FIELD_OFFSET(WSAPROTOCOL_INFOA, szProtocol));
lpProtocolInfo,
FIELD_OFFSET(WSAPROTOCOL_INFOA, szProtocol));
0,
lpProtocolInfo->szProtocol,
-1,
0,
lpProtocolInfo->szProtocol,
-1,
- lpProtoInfoW->szProtocol,
- len);
+ ProtoInfoW.szProtocol,
+ WSAPROTOCOL_LEN + 1);
}
ret = WSAStringToAddressW(szTemp,
AddressFamily,
}
ret = WSAStringToAddressW(szTemp,
AddressFamily,
lpAddress,
lpAddressLength);
lpAddress,
lpAddressLength);
- if (lpProtocolInfo)
- HeapFree(GetProcessHeap(),
- 0,
- lpProtoInfoW);
-
WSASetLastError(ret);
return ret;
}
WSASetLastError(ret);
return ret;
}