wininet: Remove unneeded casts.
This commit is contained in:
parent
6436dd6169
commit
45481db078
|
@ -474,7 +474,7 @@ lend:
|
||||||
{
|
{
|
||||||
INTERNET_ASYNC_RESULT iar;
|
INTERNET_ASYNC_RESULT iar;
|
||||||
|
|
||||||
iar.dwResult = (DWORD)bSuccess;
|
iar.dwResult = bSuccess;
|
||||||
iar.dwError = bSuccess ? ERROR_SUCCESS : ERROR_INTERNET_EXTENDED_ERROR;
|
iar.dwError = bSuccess ? ERROR_SUCCESS : ERROR_INTERNET_EXTENDED_ERROR;
|
||||||
SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE,
|
SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE,
|
||||||
&iar, sizeof(INTERNET_ASYNC_RESULT));
|
&iar, sizeof(INTERNET_ASYNC_RESULT));
|
||||||
|
@ -1008,13 +1008,13 @@ lend:
|
||||||
{
|
{
|
||||||
INTERNET_ASYNC_RESULT iar;
|
INTERNET_ASYNC_RESULT iar;
|
||||||
|
|
||||||
iar.dwResult = (DWORD)bSuccess;
|
iar.dwResult = bSuccess;
|
||||||
iar.dwError = bSuccess ? ERROR_SUCCESS : ERROR_INTERNET_EXTENDED_ERROR;
|
iar.dwError = bSuccess ? ERROR_SUCCESS : ERROR_INTERNET_EXTENDED_ERROR;
|
||||||
SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE,
|
SendAsyncCallback(&lpwfs->hdr, lpwfs->hdr.dwContext, INTERNET_STATUS_REQUEST_COMPLETE,
|
||||||
&iar, sizeof(INTERNET_ASYNC_RESULT));
|
&iar, sizeof(INTERNET_ASYNC_RESULT));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (DWORD) bSuccess;
|
return bSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
|
|
@ -796,7 +796,7 @@ BOOL WINAPI HttpEndRequestA(HINTERNET hRequest,
|
||||||
|
|
||||||
FIXME("Do we need to translate info out of these buffer?\n");
|
FIXME("Do we need to translate info out of these buffer?\n");
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(),0,(LPVOID)ptrW->lpvBuffer);
|
HeapFree(GetProcessHeap(),0,ptrW->lpvBuffer);
|
||||||
ptrW2 = ptrW->Next;
|
ptrW2 = ptrW->Next;
|
||||||
HeapFree(GetProcessHeap(),0,ptrW);
|
HeapFree(GetProcessHeap(),0,ptrW);
|
||||||
ptrW = ptrW2;
|
ptrW = ptrW2;
|
||||||
|
|
|
@ -265,7 +265,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||||
|
|
||||||
URLCacheContainers_CreateDefaults();
|
URLCacheContainers_CreateDefaults();
|
||||||
|
|
||||||
WININET_hModule = (HMODULE)hinstDLL;
|
WININET_hModule = hinstDLL;
|
||||||
|
|
||||||
case DLL_THREAD_ATTACH:
|
case DLL_THREAD_ATTACH:
|
||||||
break;
|
break;
|
||||||
|
@ -568,7 +568,7 @@ lend:
|
||||||
HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType,
|
HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType,
|
||||||
LPCSTR lpszProxy, LPCSTR lpszProxyBypass, DWORD dwFlags)
|
LPCSTR lpszProxy, LPCSTR lpszProxyBypass, DWORD dwFlags)
|
||||||
{
|
{
|
||||||
HINTERNET rc = (HINTERNET)NULL;
|
HINTERNET rc = NULL;
|
||||||
INT len;
|
INT len;
|
||||||
WCHAR *szAgent = NULL, *szProxy = NULL, *szBypass = NULL;
|
WCHAR *szAgent = NULL, *szProxy = NULL, *szBypass = NULL;
|
||||||
|
|
||||||
|
@ -851,7 +851,7 @@ HINTERNET WINAPI InternetConnectA(HINTERNET hInternet,
|
||||||
LPCSTR lpszUserName, LPCSTR lpszPassword,
|
LPCSTR lpszUserName, LPCSTR lpszPassword,
|
||||||
DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext)
|
DWORD dwService, DWORD dwFlags, DWORD_PTR dwContext)
|
||||||
{
|
{
|
||||||
HINTERNET rc = (HINTERNET)NULL;
|
HINTERNET rc = NULL;
|
||||||
INT len = 0;
|
INT len = 0;
|
||||||
LPWSTR szServerName = NULL;
|
LPWSTR szServerName = NULL;
|
||||||
LPWSTR szUserName = NULL;
|
LPWSTR szUserName = NULL;
|
||||||
|
@ -1700,7 +1700,7 @@ BOOL WINAPI InternetWriteFile(HINTERNET hFile, LPCVOID lpBuffer ,
|
||||||
LPWININETHANDLEHEADER lpwh;
|
LPWININETHANDLEHEADER lpwh;
|
||||||
|
|
||||||
TRACE("\n");
|
TRACE("\n");
|
||||||
lpwh = (LPWININETHANDLEHEADER) WININET_GetObject( hFile );
|
lpwh = WININET_GetObject( hFile );
|
||||||
if (NULL == lpwh)
|
if (NULL == lpwh)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -2544,7 +2544,7 @@ BOOL WINAPI InternetSetOptionA(HINTERNET hInternet, DWORD dwOption,
|
||||||
LPWININETHANDLEHEADER lpwh;
|
LPWININETHANDLEHEADER lpwh;
|
||||||
INTERNET_STATUS_CALLBACK callback = *(INTERNET_STATUS_CALLBACK *)lpBuffer;
|
INTERNET_STATUS_CALLBACK callback = *(INTERNET_STATUS_CALLBACK *)lpBuffer;
|
||||||
|
|
||||||
if (!(lpwh = (LPWININETHANDLEHEADER)WININET_GetObject(hInternet))) return FALSE;
|
if (!(lpwh = WININET_GetObject(hInternet))) return FALSE;
|
||||||
r = (set_status_callback(lpwh, callback, FALSE) != INTERNET_INVALID_STATUS_CALLBACK);
|
r = (set_status_callback(lpwh, callback, FALSE) != INTERNET_INVALID_STATUS_CALLBACK);
|
||||||
WININET_Release(lpwh);
|
WININET_Release(lpwh);
|
||||||
return r;
|
return r;
|
||||||
|
@ -3104,7 +3104,7 @@ HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl,
|
||||||
HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl,
|
HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl,
|
||||||
LPCSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
|
LPCSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
|
||||||
{
|
{
|
||||||
HINTERNET rc = (HINTERNET)NULL;
|
HINTERNET rc = NULL;
|
||||||
|
|
||||||
INT lenUrl;
|
INT lenUrl;
|
||||||
INT lenHeaders = 0;
|
INT lenHeaders = 0;
|
||||||
|
@ -3117,16 +3117,16 @@ HINTERNET WINAPI InternetOpenUrlA(HINTERNET hInternet, LPCSTR lpszUrl,
|
||||||
lenUrl = MultiByteToWideChar(CP_ACP, 0, lpszUrl, -1, NULL, 0 );
|
lenUrl = MultiByteToWideChar(CP_ACP, 0, lpszUrl, -1, NULL, 0 );
|
||||||
szUrl = HeapAlloc(GetProcessHeap(), 0, lenUrl*sizeof(WCHAR));
|
szUrl = HeapAlloc(GetProcessHeap(), 0, lenUrl*sizeof(WCHAR));
|
||||||
if(!szUrl)
|
if(!szUrl)
|
||||||
return (HINTERNET)NULL;
|
return NULL;
|
||||||
MultiByteToWideChar(CP_ACP, 0, lpszUrl, -1, szUrl, lenUrl);
|
MultiByteToWideChar(CP_ACP, 0, lpszUrl, -1, szUrl, lenUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(lpszHeaders) {
|
if(lpszHeaders) {
|
||||||
lenHeaders = MultiByteToWideChar(CP_ACP, 0, lpszHeaders, dwHeadersLength, NULL, 0 );
|
lenHeaders = MultiByteToWideChar(CP_ACP, 0, lpszHeaders, dwHeadersLength, NULL, 0 );
|
||||||
szHeaders = HeapAlloc(GetProcessHeap(), 0, lenHeaders*sizeof(WCHAR));
|
szHeaders = HeapAlloc(GetProcessHeap(), 0, lenHeaders*sizeof(WCHAR));
|
||||||
if(!szHeaders) {
|
if(!szHeaders) {
|
||||||
HeapFree(GetProcessHeap(), 0, szUrl);
|
HeapFree(GetProcessHeap(), 0, szUrl);
|
||||||
return (HINTERNET)NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
MultiByteToWideChar(CP_ACP, 0, lpszHeaders, dwHeadersLength, szHeaders, lenHeaders);
|
MultiByteToWideChar(CP_ACP, 0, lpszHeaders, dwHeadersLength, szHeaders, lenHeaders);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1125,7 +1125,7 @@ static BOOL URLCache_FindHash(LPCURLCACHE_HEADER pHeader, LPCSTR lpszUrl, struct
|
||||||
HASH_CACHEFILE_ENTRY * pHashEntry;
|
HASH_CACHEFILE_ENTRY * pHashEntry;
|
||||||
DWORD dwHashTableNumber = 0;
|
DWORD dwHashTableNumber = 0;
|
||||||
|
|
||||||
key = (DWORD)(key / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
|
key = (key / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
|
||||||
|
|
||||||
for (pHashEntry = URLCache_HashEntryFromOffset(pHeader, pHeader->dwOffsetFirstHashTable);
|
for (pHashEntry = URLCache_HashEntryFromOffset(pHeader, pHeader->dwOffsetFirstHashTable);
|
||||||
((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) >= ENTRY_START_OFFSET) && ((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) < pHeader->dwFileSize);
|
((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) >= ENTRY_START_OFFSET) && ((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) < pHeader->dwFileSize);
|
||||||
|
@ -1147,7 +1147,7 @@ static BOOL URLCache_FindHash(LPCURLCACHE_HEADER pHeader, LPCSTR lpszUrl, struct
|
||||||
for (i = 0; i < HASHTABLE_BLOCKSIZE; i++)
|
for (i = 0; i < HASHTABLE_BLOCKSIZE; i++)
|
||||||
{
|
{
|
||||||
struct _HASH_ENTRY * pHashElement = &pHashEntry->HashTable[offset + i];
|
struct _HASH_ENTRY * pHashElement = &pHashEntry->HashTable[offset + i];
|
||||||
if (key == (DWORD)(pHashElement->dwHashKey / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES)
|
if (key == (pHashElement->dwHashKey / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES)
|
||||||
{
|
{
|
||||||
/* FIXME: we should make sure that this is the right element
|
/* FIXME: we should make sure that this is the right element
|
||||||
* before returning and claiming that it is. We can do this
|
* before returning and claiming that it is. We can do this
|
||||||
|
@ -1195,7 +1195,7 @@ static BOOL URLCache_FindHashW(LPCURLCACHE_HEADER pHeader, LPCWSTR lpszUrl, stru
|
||||||
*/
|
*/
|
||||||
static BOOL URLCache_HashEntrySetUse(struct _HASH_ENTRY * pHashEntry, DWORD dwUseCount)
|
static BOOL URLCache_HashEntrySetUse(struct _HASH_ENTRY * pHashEntry, DWORD dwUseCount)
|
||||||
{
|
{
|
||||||
pHashEntry->dwHashKey = dwUseCount | (DWORD)(pHashEntry->dwHashKey / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
|
pHashEntry->dwHashKey = dwUseCount | (pHashEntry->dwHashKey / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1238,7 +1238,7 @@ static BOOL URLCache_AddEntryToHash(LPURLCACHE_HEADER pHeader, LPCSTR lpszUrl, D
|
||||||
HASH_CACHEFILE_ENTRY * pHashEntry;
|
HASH_CACHEFILE_ENTRY * pHashEntry;
|
||||||
DWORD dwHashTableNumber = 0;
|
DWORD dwHashTableNumber = 0;
|
||||||
|
|
||||||
key = (DWORD)(key / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
|
key = (key / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
|
||||||
|
|
||||||
for (pHashEntry = URLCache_HashEntryFromOffset(pHeader, pHeader->dwOffsetFirstHashTable);
|
for (pHashEntry = URLCache_HashEntryFromOffset(pHeader, pHeader->dwOffsetFirstHashTable);
|
||||||
((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) >= ENTRY_START_OFFSET) && ((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) < pHeader->dwFileSize);
|
((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) >= ENTRY_START_OFFSET) && ((DWORD)((LPBYTE)pHashEntry - (LPBYTE)pHeader) < pHeader->dwFileSize);
|
||||||
|
|
|
@ -162,7 +162,7 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort,
|
||||||
memset(psa,0,sizeof(struct sockaddr_in));
|
memset(psa,0,sizeof(struct sockaddr_in));
|
||||||
memcpy((char *)&psa->sin_addr, phe->h_addr, phe->h_length);
|
memcpy((char *)&psa->sin_addr, phe->h_addr, phe->h_length);
|
||||||
psa->sin_family = phe->h_addrtype;
|
psa->sin_family = phe->h_addrtype;
|
||||||
psa->sin_port = htons((u_short)nServerPort);
|
psa->sin_port = htons(nServerPort);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue