wininet: Rename WININET_strdup_WtoA to heap_strdupWtoA.

This commit is contained in:
Jacek Caban 2009-07-17 01:12:04 +02:00 committed by Alexandre Julliard
parent e09dfcfa99
commit 5d6f01b76b
3 changed files with 12 additions and 7 deletions

View File

@ -2609,7 +2609,7 @@ static BOOL FTP_SendCommand(INT nSocket, FTP_COMMAND ftpCmd, LPCWSTR lpszParam,
INTERNET_STATUS_CALLBACK lpfnStatusCB, object_header_t *hdr, DWORD_PTR dwContext)
{
BOOL ret;
LPSTR lpszParamA = lpszParam?WININET_strdup_WtoA(lpszParam):NULL;
LPSTR lpszParamA = heap_strdupWtoA(lpszParam);
ret = FTP_SendCommandA(nSocket, ftpCmd, lpszParamA, lpfnStatusCB, hdr, dwContext);
HeapFree(GetProcessHeap(), 0, lpszParamA);
return ret;

View File

@ -87,12 +87,17 @@ static inline WCHAR *heap_strdupAtoW(const char *str)
return ret;
}
static inline LPSTR WININET_strdup_WtoA( LPCWSTR str )
static inline char *heap_strdupWtoA(LPCWSTR str)
{
int len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
LPSTR ret = HeapAlloc( GetProcessHeap(), 0, len );
if (ret)
WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL);
char *ret = NULL;
if(str) {
DWORD size = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, NULL, NULL);
ret = HeapAlloc(GetProcessHeap(), 0, size);
if(ret)
WideCharToMultiByte(CP_ACP, 0, str, -1, ret, size, NULL, NULL);
}
return ret;
}

View File

@ -324,7 +324,7 @@ VOID INTERNET_SendCallback(object_header_t *hdr, DWORD_PTR dwContext,
break;
case INTERNET_STATUS_RESOLVING_NAME:
case INTERNET_STATUS_REDIRECT:
lpvNewInfo = WININET_strdup_WtoA(lpvStatusInfo);
lpvNewInfo = heap_strdupWtoA(lpvStatusInfo);
break;
}
}