mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[WS2_32]
- Store WSAPROTOCOL_INFOW struct on the stack svn path=/trunk/; revision=54616
This commit is contained in:
parent
1805dc67b0
commit
de4cb19466
1 changed files with 5 additions and 16 deletions
|
@ -371,7 +371,7 @@ WSAStringToAddressA(IN LPSTR AddressString,
|
||||||
{
|
{
|
||||||
INT ret, len;
|
INT ret, len;
|
||||||
LPWSTR szTemp;
|
LPWSTR szTemp;
|
||||||
LPWSAPROTOCOL_INFOW lpProtoInfoW = NULL;
|
WSAPROTOCOL_INFOW ProtoInfoW;
|
||||||
|
|
||||||
len = MultiByteToWideChar(CP_ACP,
|
len = MultiByteToWideChar(CP_ACP,
|
||||||
0,
|
0,
|
||||||
|
@ -393,13 +393,7 @@ WSAStringToAddressA(IN LPSTR AddressString,
|
||||||
|
|
||||||
if (lpProtocolInfo)
|
if (lpProtocolInfo)
|
||||||
{
|
{
|
||||||
len = WSAPROTOCOL_LEN+1;
|
memcpy(&ProtoInfoW,
|
||||||
lpProtoInfoW = HeapAlloc(GetProcessHeap(),
|
|
||||||
0,
|
|
||||||
FIELD_OFFSET(WSAPROTOCOL_INFOW, szProtocol) +
|
|
||||||
(len * sizeof(WCHAR)));
|
|
||||||
|
|
||||||
memcpy(lpProtoInfoW,
|
|
||||||
lpProtocolInfo,
|
lpProtocolInfo,
|
||||||
FIELD_OFFSET(WSAPROTOCOL_INFOA, szProtocol));
|
FIELD_OFFSET(WSAPROTOCOL_INFOA, szProtocol));
|
||||||
|
|
||||||
|
@ -407,13 +401,13 @@ WSAStringToAddressA(IN LPSTR AddressString,
|
||||||
0,
|
0,
|
||||||
lpProtocolInfo->szProtocol,
|
lpProtocolInfo->szProtocol,
|
||||||
-1,
|
-1,
|
||||||
lpProtoInfoW->szProtocol,
|
ProtoInfoW.szProtocol,
|
||||||
len);
|
WSAPROTOCOL_LEN + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = WSAStringToAddressW(szTemp,
|
ret = WSAStringToAddressW(szTemp,
|
||||||
AddressFamily,
|
AddressFamily,
|
||||||
lpProtoInfoW,
|
&ProtoInfoW,
|
||||||
lpAddress,
|
lpAddress,
|
||||||
lpAddressLength);
|
lpAddressLength);
|
||||||
|
|
||||||
|
@ -421,11 +415,6 @@ WSAStringToAddressA(IN LPSTR AddressString,
|
||||||
0,
|
0,
|
||||||
szTemp );
|
szTemp );
|
||||||
|
|
||||||
if (lpProtocolInfo)
|
|
||||||
HeapFree(GetProcessHeap(),
|
|
||||||
0,
|
|
||||||
lpProtoInfoW);
|
|
||||||
|
|
||||||
WSASetLastError(ret);
|
WSASetLastError(ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue