- Url Cache improvements.

- In Internet{Set,Query}Option functions, hInternet can be NULL.
- Add traces to Internet* functions.
This commit is contained in:
Robert Shearman 2003-12-12 06:01:20 +00:00 committed by Alexandre Julliard
parent 755762426c
commit fa7d78f118
3 changed files with 1017 additions and 420 deletions

View File

@ -102,6 +102,9 @@ CRITICAL_SECTION csQueue;
LPWORKREQUEST lpHeadWorkQueue; LPWORKREQUEST lpHeadWorkQueue;
LPWORKREQUEST lpWorkQueueTail; LPWORKREQUEST lpWorkQueueTail;
extern void URLCacheContainers_CreateDefaults();
extern void URLCacheContainers_DeleteAll();
/*********************************************************************** /***********************************************************************
* DllMain [Internal] Initializes the internal 'WININET.DLL'. * DllMain [Internal] Initializes the internal 'WININET.DLL'.
* *
@ -131,6 +134,8 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
hWorkEvent = CreateEventA(0, FALSE, FALSE, NULL); hWorkEvent = CreateEventA(0, FALSE, FALSE, NULL);
InitializeCriticalSection(&csQueue); InitializeCriticalSection(&csQueue);
URLCacheContainers_CreateDefaults();
dwNumThreads = 0; dwNumThreads = 0;
dwNumIdleThreads = 0; dwNumIdleThreads = 0;
dwNumJobs = 0; dwNumJobs = 0;
@ -156,6 +161,8 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
URLCacheContainers_DeleteAll();
if (g_dwTlsErrIndex != TLS_OUT_OF_INDEXES) if (g_dwTlsErrIndex != TLS_OUT_OF_INDEXES)
{ {
HeapFree(GetProcessHeap(), 0, TlsGetValue(g_dwTlsErrIndex)); HeapFree(GetProcessHeap(), 0, TlsGetValue(g_dwTlsErrIndex));
@ -360,6 +367,8 @@ HINTERNET WINAPI InternetOpenW(LPCWSTR lpszAgent, DWORD dwAccessType,
CHAR *szProxy = (CHAR *)HeapAlloc(GetProcessHeap(), 0, lenProxy*sizeof(CHAR)); CHAR *szProxy = (CHAR *)HeapAlloc(GetProcessHeap(), 0, lenProxy*sizeof(CHAR));
CHAR *szBypass = (CHAR *)HeapAlloc(GetProcessHeap(), 0, lenBypass*sizeof(CHAR)); CHAR *szBypass = (CHAR *)HeapAlloc(GetProcessHeap(), 0, lenBypass*sizeof(CHAR));
TRACE("(%s, 0x%08lx, %s, %s, 0x%08lx)\n", debugstr_w(lpszAgent), dwAccessType, debugstr_w(lpszProxy), debugstr_w(lpszProxyBypass), dwFlags);
if (!szAgent || !szProxy || !szBypass) if (!szAgent || !szProxy || !szBypass)
{ {
if (szAgent) if (szAgent)
@ -430,6 +439,8 @@ BOOL WINAPI InternetGetLastResponseInfoA(LPDWORD lpdwError,
*/ */
BOOL WINAPI InternetGetConnectedState(LPDWORD lpdwStatus, DWORD dwReserved) BOOL WINAPI InternetGetConnectedState(LPDWORD lpdwStatus, DWORD dwReserved)
{ {
TRACE("(%p, 0x%08lx)\n", lpdwStatus, dwReserved);
if (lpdwStatus) { if (lpdwStatus) {
FIXME("always returning LAN connection.\n"); FIXME("always returning LAN connection.\n");
*lpdwStatus = INTERNET_CONNECTION_LAN; *lpdwStatus = INTERNET_CONNECTION_LAN;
@ -451,6 +462,8 @@ BOOL WINAPI InternetGetConnectedState(LPDWORD lpdwStatus, DWORD dwReserved)
BOOL WINAPI InternetGetConnectedStateExW(LPDWORD lpdwStatus, LPWSTR lpszConnectionName, BOOL WINAPI InternetGetConnectedStateExW(LPDWORD lpdwStatus, LPWSTR lpszConnectionName,
DWORD dwNameLen, DWORD dwReserved) DWORD dwNameLen, DWORD dwReserved)
{ {
TRACE("(%p, %s, %ld, 0x%08lx)\n", lpdwStatus, debugstr_w(lpszConnectionName), dwNameLen, dwReserved);
/* Must be zero */ /* Must be zero */
if(dwReserved) if(dwReserved)
return FALSE; return FALSE;
@ -1458,12 +1471,6 @@ static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD d
TRACE("(%p, 0x%08lx, %p, %p)\n", hInternet, dwOption, lpBuffer, lpdwBufferLength); TRACE("(%p, 0x%08lx, %p, %p)\n", hInternet, dwOption, lpBuffer, lpdwBufferLength);
if (NULL == hInternet)
{
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
return FALSE;
}
lpwhh = (LPWININETHANDLEHEADER) hInternet; lpwhh = (LPWININETHANDLEHEADER) hInternet;
switch (dwOption) switch (dwOption)
@ -1538,6 +1545,9 @@ static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD d
bSuccess = TRUE; bSuccess = TRUE;
break; break;
} }
case INTERNET_OPTION_SECURITY_FLAGS:
FIXME("INTERNET_OPTION_SECURITY_FLAGS: Stub\n");
break;
default: default:
FIXME("Stub! %ld \n",dwOption); FIXME("Stub! %ld \n",dwOption);
@ -1597,12 +1607,6 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
TRACE("0x%08lx\n", dwOption); TRACE("0x%08lx\n", dwOption);
if (NULL == hInternet)
{
INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
return FALSE;
}
lpwhh = (LPWININETHANDLEHEADER) hInternet; lpwhh = (LPWININETHANDLEHEADER) hInternet;
switch (dwOption) switch (dwOption)
@ -1631,6 +1635,15 @@ BOOL WINAPI InternetSetOptionW(HINTERNET hInternet, DWORD dwOption,
FIXME("Option INTERNET_OPTION_REQUEST_PRIORITY (%ld): STUB\n",priority); FIXME("Option INTERNET_OPTION_REQUEST_PRIORITY (%ld): STUB\n",priority);
} }
break; break;
case INTERNET_OPTION_RESET_URLCACHE_SESSION:
FIXME("Option INTERNET_OPTION_RESET_URLCACHE_SESSION: STUB\n");
break;
case INTERNET_OPTION_END_BROWSER_SESSION:
FIXME("Option INTERNET_OPTION_END_BROWSER_SESSION: STUB\n");
break;
case INTERNET_OPTION_CONNECTED_STATE:
FIXME("Option INTERNET_OPTION_CONNECTED_STATE: STUB\n");
break;
default: default:
FIXME("Option %ld STUB\n",dwOption); FIXME("Option %ld STUB\n",dwOption);
INTERNET_SetLastError(ERROR_INVALID_PARAMETER); INTERNET_SetLastError(ERROR_INVALID_PARAMETER);
@ -1932,6 +1945,8 @@ HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl,
CHAR *szUrl = (CHAR *)HeapAlloc(GetProcessHeap(), 0, lenUrl*sizeof(CHAR)); CHAR *szUrl = (CHAR *)HeapAlloc(GetProcessHeap(), 0, lenUrl*sizeof(CHAR));
CHAR *szHeaders = (CHAR *)HeapAlloc(GetProcessHeap(), 0, lenHeaders*sizeof(CHAR)); CHAR *szHeaders = (CHAR *)HeapAlloc(GetProcessHeap(), 0, lenHeaders*sizeof(CHAR));
TRACE("\n");
if (!szUrl || !szHeaders) if (!szUrl || !szHeaders)
{ {
if (szUrl) if (szUrl)
@ -2508,6 +2523,9 @@ BOOL WINAPI InternetCombineUrlA(LPCSTR lpszBaseUrl, LPCSTR lpszRelativeUrl,
DWORD dwFlags) DWORD dwFlags)
{ {
HRESULT hr=S_OK; HRESULT hr=S_OK;
TRACE("(%s, %s, %p, %p, 0x%08lx)\n", debugstr_a(lpszBaseUrl), debugstr_a(lpszRelativeUrl), lpszBuffer, lpdwBufferLength, dwFlags);
/* Flip this bit to correspond to URL_ESCAPE_UNSAFE */ /* Flip this bit to correspond to URL_ESCAPE_UNSAFE */
dwFlags ^= ICU_NO_ENCODE; dwFlags ^= ICU_NO_ENCODE;
hr=UrlCombineA(lpszBaseUrl,lpszRelativeUrl,lpszBuffer,lpdwBufferLength,dwFlags); hr=UrlCombineA(lpszBaseUrl,lpszRelativeUrl,lpszBuffer,lpdwBufferLength,dwFlags);
@ -2532,6 +2550,9 @@ BOOL WINAPI InternetCombineUrlW(LPCWSTR lpszBaseUrl, LPCWSTR lpszRelativeUrl,
DWORD dwFlags) DWORD dwFlags)
{ {
HRESULT hr=S_OK; HRESULT hr=S_OK;
TRACE("(%s, %s, %p, %p, 0x%08lx)\n", debugstr_w(lpszBaseUrl), debugstr_w(lpszRelativeUrl), lpszBuffer, lpdwBufferLength, dwFlags);
/* Flip this bit to correspond to URL_ESCAPE_UNSAFE */ /* Flip this bit to correspond to URL_ESCAPE_UNSAFE */
dwFlags ^= ICU_NO_ENCODE; dwFlags ^= ICU_NO_ENCODE;
hr=UrlCombineW(lpszBaseUrl,lpszRelativeUrl,lpszBuffer,lpdwBufferLength,dwFlags); hr=UrlCombineW(lpszBaseUrl,lpszRelativeUrl,lpszBuffer,lpdwBufferLength,dwFlags);

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,21 @@
101 stub -noname DoConnectoidsExist
102 stub -noname GetDiskInfoA
103 stub -noname PerformOperationOverUrlCacheA
104 stub -noname HttpCheckDavComplianceA
105 stub -noname HttpCheckDavComplianceW
108 stub -noname ImportCookieFileA
109 stub -noname ExportCookieFileA
110 stub -noname ImportCookieFileW
111 stub -noname ExportCookieFileW
112 stub -noname IsProfilesEnabled
116 stub -noname IsDomainlegalCookieDomainA
117 stub -noname IsDomainLegalCookieDomainW
118 stub -noname FindP3PPolicySymbol
120 stub -noname MapResourceToPolicy
121 stub -noname GetP3PPolicy
122 stub -noname FreeP3PObject
123 stub -noname GetP3PRequestStatus
@ stdcall InternetInitializeAutoProxyDll(long) @ stdcall InternetInitializeAutoProxyDll(long)
@ stub ShowCertificate @ stub ShowCertificate
@ stdcall CommitUrlCacheEntryA(str str double double long str long str str) @ stdcall CommitUrlCacheEntryA(str str double double long str long str str)