ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2008
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
27 participants
747 discussions
Start a n
N
ew thread
[cgutman] 35944: - Fix 2 memory leaks - Set ParameterValue to NULL on failure
by cgutman@svn.reactos.org
Author: cgutman Date: Thu Sep 4 13:42:49 2008 New Revision: 35944 URL:
http://svn.reactos.org/svn/reactos?rev=35944&view=rev
Log: - Fix 2 memory leaks - Set ParameterValue to NULL on failure Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/config.c Modified: branches/aicom-network-fixes/drivers/network/ndis/ndis/config.c URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
============================================================================== --- branches/aicom-network-fixes/drivers/network/ndis/ndis/config.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/ndis/ndis/config.c [iso-8859-1] Thu Sep 4 13:42:49 2008 @@ -521,9 +521,11 @@ ExFreePool(KeyInformation); - if(*Status != STATUS_SUCCESS) + if(*Status != STATUS_SUCCESS) { + ExFreePool(*ParameterValue); + *ParameterValue = NULL; *Status = NDIS_STATUS_FAILURE; - else + } else *Status = NDIS_STATUS_SUCCESS; return; @@ -567,6 +569,7 @@ if(!MiniportResource) { NDIS_DbgPrint(MIN_TRACE,("Insufficient resources.\n")); + ExFreePool(RegData); ExFreePool(KeyInformation); ExFreePool(*ParameterValue); *ParameterValue = NULL;
16 years, 3 months
1
0
0
0
[cfinck] 35943: - Sync wininet to Wine HEAD - Remove a change from our "wininet_ros.diff" file, which has been applied to Wine as well in the meantime - Eliminate a warning in our "inet_ntop.c" (ROS glue code)
by cfinck@svn.reactos.org
Author: cfinck Date: Thu Sep 4 13:37:34 2008 New Revision: 35943 URL:
http://svn.reactos.org/svn/reactos?rev=35943&view=rev
Log: - Sync wininet to Wine HEAD - Remove a change from our "wininet_ros.diff" file, which has been applied to Wine as well in the meantime - Eliminate a warning in our "inet_ntop.c" (ROS glue code) Added: trunk/reactos/dll/win32/wininet/wininet_Ro.rc (with props) Modified: trunk/reactos/dll/win32/wininet/cookie.c trunk/reactos/dll/win32/wininet/ftp.c trunk/reactos/dll/win32/wininet/http.c trunk/reactos/dll/win32/wininet/inet_ntop.c trunk/reactos/dll/win32/wininet/internet.c trunk/reactos/dll/win32/wininet/internet.h trunk/reactos/dll/win32/wininet/netconnection.c trunk/reactos/dll/win32/wininet/rsrc.rc trunk/reactos/dll/win32/wininet/urlcache.c trunk/reactos/dll/win32/wininet/utility.c trunk/reactos/dll/win32/wininet/wininet_ros.diff Modified: trunk/reactos/dll/win32/wininet/cookie.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/cookie.c…
============================================================================== --- trunk/reactos/dll/win32/wininet/cookie.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/cookie.c [iso-8859-1] Thu Sep 4 13:37:34 2008 @@ -631,10 +631,10 @@ * * See InternetEnumPerSiteCookieDecisionW. */ -BOOL WINAPI InternetEnumPerSiteCookieDecisionA( LPSTR pszSiteName, unsigned long *pcSiteNameSize, - unsigned long *pdwDecision, unsigned long dwIndex ) -{ - FIXME("(%s, %p, %p, 0x%08lx) stub\n", +BOOL WINAPI InternetEnumPerSiteCookieDecisionA( LPSTR pszSiteName, ULONG *pcSiteNameSize, + ULONG *pdwDecision, ULONG dwIndex ) +{ + FIXME("(%s, %p, %p, 0x%08x) stub\n", debugstr_a(pszSiteName), pcSiteNameSize, pdwDecision, dwIndex); return FALSE; } @@ -649,10 +649,10 @@ * FALSE on failure * */ -BOOL WINAPI InternetEnumPerSiteCookieDecisionW( LPWSTR pszSiteName, unsigned long *pcSiteNameSize, - unsigned long *pdwDecision, unsigned long dwIndex ) -{ - FIXME("(%s, %p, %p, 0x%08lx) stub\n", +BOOL WINAPI InternetEnumPerSiteCookieDecisionW( LPWSTR pszSiteName, ULONG *pcSiteNameSize, + ULONG *pdwDecision, ULONG dwIndex ) +{ + FIXME("(%s, %p, %p, 0x%08x) stub\n", debugstr_w(pszSiteName), pcSiteNameSize, pdwDecision, dwIndex); return FALSE; } @@ -660,7 +660,7 @@ /*********************************************************************** * InternetGetPerSiteCookieDecisionA (WININET.@) */ -BOOL WINAPI InternetGetPerSiteCookieDecisionA( LPCSTR pwchHostName, unsigned long *pResult ) +BOOL WINAPI InternetGetPerSiteCookieDecisionA( LPCSTR pwchHostName, ULONG *pResult ) { FIXME("(%s, %p) stub\n", debugstr_a(pwchHostName), pResult); return FALSE; @@ -669,7 +669,7 @@ /*********************************************************************** * InternetGetPerSiteCookieDecisionW (WININET.@) */ -BOOL WINAPI InternetGetPerSiteCookieDecisionW( LPCWSTR pwchHostName, unsigned long *pResult ) +BOOL WINAPI InternetGetPerSiteCookieDecisionW( LPCWSTR pwchHostName, ULONG *pResult ) { FIXME("(%s, %p) stub\n", debugstr_w(pwchHostName), pResult); return FALSE; Modified: trunk/reactos/dll/win32/wininet/ftp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/ftp.c?re…
============================================================================== --- trunk/reactos/dll/win32/wininet/ftp.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/ftp.c [iso-8859-1] Thu Sep 4 13:37:34 2008 @@ -1227,8 +1227,7 @@ return ERROR_SUCCESS; } - FIXME("Not implemented option %d\n", option); - return ERROR_INTERNET_INVALID_OPTION; + return INET_QueryOption(option, buffer, size, unicode); } static DWORD FTPFILE_ReadFile(WININETHANDLEHEADER *hdr, void *buffer, DWORD size, DWORD *read) @@ -1553,6 +1552,7 @@ &iar, sizeof(INTERNET_ASYNC_RESULT)); } + if (!bSuccess) DeleteFileW(lpszNewFile); return bSuccess; } @@ -2194,8 +2194,7 @@ return ERROR_SUCCESS; } - FIXME("Not implemented option %d\n", option); - return ERROR_INTERNET_INVALID_OPTION; + return INET_QueryOption(option, buffer, size, unicode); } static const HANDLEHEADERVtbl FTPSESSIONVtbl = { @@ -3275,8 +3274,7 @@ return ERROR_SUCCESS; } - FIXME("Not implemented option %d\n", option); - return ERROR_INTERNET_INVALID_OPTION; + return INET_QueryOption(option, buffer, size, unicode); } static DWORD FTPFINDNEXT_FindNextFileW(WININETHANDLEHEADER *hdr, void *data) Modified: trunk/reactos/dll/win32/wininet/http.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/http.c?r…
============================================================================== --- trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] Thu Sep 4 13:37:34 2008 @@ -1348,6 +1348,8 @@ INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_STATUS_NAME_RESOLVED, szaddr, strlen(szaddr)+1); + + TRACE("resolved %s to %s\n", debugstr_w(lpwhs->lpszServerName), szaddr); return TRUE; } @@ -1394,7 +1396,6 @@ static void HTTPREQ_CloseConnection(WININETHANDLEHEADER *hdr) { LPWININETHTTPREQW lpwhr = (LPWININETHTTPREQW) hdr; - LPWININETHTTPSESSIONW lpwhs = NULL; TRACE("%p\n",lpwhr); @@ -1426,8 +1427,6 @@ lpwhr->pProxyAuthInfo = NULL; } - lpwhs = lpwhr->lpHttpSession; - INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext, INTERNET_STATUS_CLOSING_CONNECTION, 0, 0); @@ -1456,14 +1455,20 @@ WCHAR url[INTERNET_MAX_URL_LENGTH]; HTTPHEADERW *host; DWORD len; - - static const WCHAR formatW[] = {'h','t','t','p',':','/','/','%','s','%','s',0}; + WCHAR *pch; + + static const WCHAR httpW[] = {'h','t','t','p',':','/','/',0}; static const WCHAR hostW[] = {'H','o','s','t',0}; TRACE("INTERNET_OPTION_URL\n"); host = HTTP_GetHeader(req, hostW); - sprintfW(url, formatW, host->lpszValue, req->lpszPath); + strcpyW(url, httpW); + strcatW(url, host->lpszValue); + if (NULL != (pch = strchrW(url + strlenW(httpW), ':'))) + *pch = 0; + strcatW(url, req->lpszPath); + TRACE("INTERNET_OPTION_URL: %s\n",debugstr_w(url)); if(unicode) { @@ -1576,8 +1581,7 @@ } } - FIXME("Not implemented option %d\n", option); - return ERROR_INTERNET_INVALID_OPTION; + return INET_QueryOption(option, buffer, size, unicode); } static DWORD HTTPREQ_SetOption(WININETHANDLEHEADER *hdr, DWORD option, void *buffer, DWORD size) @@ -1886,13 +1890,10 @@ { LPWININETAPPINFOW hIC = NULL; LPWININETHTTPREQW lpwhr; - LPWSTR lpszCookies; - LPWSTR lpszUrl = NULL; - DWORD nCookieSize; + LPWSTR lpszHostName = NULL; HINTERNET handle = NULL; - static const WCHAR szUrlForm[] = {'h','t','t','p',':','/','/','%','s',0}; + static const WCHAR szHostForm[] = {'%','s',':','%','u',0}; DWORD len; - LPHTTPHEADERW Host; TRACE("-->\n"); @@ -1916,6 +1917,14 @@ WININET_AddRef( &lpwhs->hdr ); lpwhr->lpHttpSession = lpwhs; list_add_head( &lpwhs->hdr.children, &lpwhr->hdr.entry ); + + lpszHostName = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * + (strlenW(lpwhs->lpszHostName) + 7 /* length of ":65535" + 1 */)); + if (NULL == lpszHostName) + { + INTERNET_SetLastError(ERROR_OUTOFMEMORY); + goto lend; + } handle = WININET_AllocHandle( &lpwhr->hdr ); if (NULL == handle) @@ -1971,7 +1980,17 @@ else lpwhr->lpszVersion = WININET_strdupW(g_szHttp1_1); - HTTP_ProcessHeader(lpwhr, szHost, lpwhs->lpszHostName, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REQ); + if (lpwhs->nHostPort != INTERNET_INVALID_PORT_NUMBER && + lpwhs->nHostPort != INTERNET_DEFAULT_HTTP_PORT && + lpwhs->nHostPort != INTERNET_DEFAULT_HTTPS_PORT) + { + sprintfW(lpszHostName, szHostForm, lpwhs->lpszHostName, lpwhs->nHostPort); + HTTP_ProcessHeader(lpwhr, szHost, lpszHostName, + HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REQ); + } + else + HTTP_ProcessHeader(lpwhr, szHost, lpwhs->lpszHostName, + HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REQ); if (lpwhs->nServerPort == INTERNET_INVALID_PORT_NUMBER) lpwhs->nServerPort = (dwFlags & INTERNET_FLAG_SECURE ? @@ -1986,47 +2005,12 @@ if (NULL != hIC->lpszProxy && hIC->lpszProxy[0] != 0) HTTP_DealWithProxy( hIC, lpwhs, lpwhr ); - Host = HTTP_GetHeader(lpwhr,szHost); - - len = lstrlenW(Host->lpszValue) + strlenW(szUrlForm); - lpszUrl = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - sprintfW( lpszUrl, szUrlForm, Host->lpszValue ); - - if (!(lpwhr->hdr.dwFlags & INTERNET_FLAG_NO_COOKIES) && - InternetGetCookieW(lpszUrl, NULL, NULL, &nCookieSize)) - { - int cnt = 0; - static const WCHAR szCookie[] = {'C','o','o','k','i','e',':',' ',0}; - static const WCHAR szcrlf[] = {'\r','\n',0}; - - lpszCookies = HeapAlloc(GetProcessHeap(), 0, (nCookieSize + 1 + 8)*sizeof(WCHAR)); - - cnt += sprintfW(lpszCookies, szCookie); - InternetGetCookieW(lpszUrl, NULL, lpszCookies + cnt, &nCookieSize); - strcatW(lpszCookies, szcrlf); - - HTTP_HttpAddRequestHeadersW(lpwhr, lpszCookies, strlenW(lpszCookies), - HTTP_ADDREQ_FLAG_ADD); - HeapFree(GetProcessHeap(), 0, lpszCookies); - } - HeapFree(GetProcessHeap(), 0, lpszUrl); - - INTERNET_SendCallback(&lpwhs->hdr, dwContext, INTERNET_STATUS_HANDLE_CREATED, &handle, sizeof(handle)); - /* - * A STATUS_REQUEST_COMPLETE is NOT sent here as per my tests on windows - */ - - if (!HTTP_ResolveName(lpwhr)) - { - InternetCloseHandle( handle ); - handle = NULL; - } - lend: + HeapFree(GetProcessHeap(), 0, lpszHostName); if( lpwhr ) WININET_Release( &lpwhr->hdr ); @@ -3027,17 +3011,16 @@ if (!using_proxy) { - HeapFree(GetProcessHeap(), 0, lpwhs->lpszServerName); - lpwhs->lpszServerName = WININET_strdupW(hostName); - lpwhs->nServerPort = urlComponents.nPort; - - if (!HTTP_ResolveName(lpwhr)) - return FALSE; - - NETCON_close(&lpwhr->netConnection); - - if (!NETCON_init(&lpwhr->netConnection,lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE)) - return FALSE; + if (strcmpiW(lpwhs->lpszServerName, hostName) || lpwhs->nServerPort != urlComponents.nPort) + { + HeapFree(GetProcessHeap(), 0, lpwhs->lpszServerName); + lpwhs->lpszServerName = WININET_strdupW(hostName); + lpwhs->nServerPort = urlComponents.nPort; + + NETCON_close(&lpwhr->netConnection); + if (!HTTP_ResolveName(lpwhr)) return FALSE; + if (!NETCON_init(&lpwhr->netConnection, lpwhr->hdr.dwFlags & INTERNET_FLAG_SECURE)) return FALSE; + } } else TRACE("Redirect through proxy\n"); @@ -3139,6 +3122,37 @@ return TRUE; } +static void HTTP_InsertCookies(LPWININETHTTPREQW lpwhr) +{ + static const WCHAR szUrlForm[] = {'h','t','t','p',':','/','/','%','s',0}; + LPWSTR lpszCookies, lpszUrl = NULL; + DWORD nCookieSize, size; + LPHTTPHEADERW Host = HTTP_GetHeader(lpwhr,szHost); + + size = (strlenW(Host->lpszValue) + strlenW(szUrlForm)) * sizeof(WCHAR); + if (!(lpszUrl = HeapAlloc(GetProcessHeap(), 0, size))) return; + sprintfW( lpszUrl, szUrlForm, Host->lpszValue ); + + if (InternetGetCookieW(lpszUrl, NULL, NULL, &nCookieSize)) + { + int cnt = 0; + static const WCHAR szCookie[] = {'C','o','o','k','i','e',':',' ',0}; + static const WCHAR szcrlf[] = {'\r','\n',0}; + + size = sizeof(szCookie) + nCookieSize * sizeof(WCHAR) + sizeof(szcrlf); + if ((lpszCookies = HeapAlloc(GetProcessHeap(), 0, size))) + { + cnt += sprintfW(lpszCookies, szCookie); + InternetGetCookieW(lpszUrl, NULL, lpszCookies + cnt, &nCookieSize); + strcatW(lpszCookies, szcrlf); + + HTTP_HttpAddRequestHeadersW(lpwhr, lpszCookies, strlenW(lpszCookies), HTTP_ADDREQ_FLAG_ADD); + HeapFree(GetProcessHeap(), 0, lpszCookies); + } + } + HeapFree(GetProcessHeap(), 0, lpszUrl); +} + /*********************************************************************** * HTTP_HttpSendRequestW (internal) * @@ -3159,7 +3173,6 @@ INT responseLen; BOOL loop_next; INTERNET_ASYNC_RESULT iar; - static const WCHAR szClose[] = { 'C','l','o','s','e',0 }; static const WCHAR szPost[] = { 'P','O','S','T',0 }; static const WCHAR szContentLength[] = { 'C','o','n','t','e','n','t','-','L','e','n','g','t','h',':',' ','%','l','i','\r','\n',0 }; @@ -3169,9 +3182,6 @@ assert(lpwhr->hdr.htype == WH_HHTTPREQ); - /* Clear any error information */ - INTERNET_SetLastError(0); - /* if the verb is NULL default to GET */ if (!lpwhr->lpszVerb) lpwhr->lpszVerb = WININET_strdupW(szGET); @@ -3193,6 +3203,17 @@ HTTP_HttpAddRequestHeadersW(lpwhr, agent_header, strlenW(agent_header), HTTP_ADDREQ_FLAG_ADD_IF_NEW); HeapFree(GetProcessHeap(), 0, agent_header); + } + if (lpwhr->hdr.dwFlags & INTERNET_FLAG_PRAGMA_NOCACHE) + { + static const WCHAR pragma_nocache[] = {'P','r','a','g','m','a',':',' ','n','o','-','c','a','c','h','e','\r','\n',0}; + HTTP_HttpAddRequestHeadersW(lpwhr, pragma_nocache, strlenW(pragma_nocache), HTTP_ADDREQ_FLAG_ADD_IF_NEW); + } + if ((lpwhr->hdr.dwFlags & INTERNET_FLAG_NO_CACHE_WRITE) && !strcmpW(lpwhr->lpszVerb, szPost)) + { + static const WCHAR cache_control[] = {'C','a','c','h','e','-','C','o','n','t','r','o','l',':', + ' ','n','o','-','c','a','c','h','e','\r','\n',0}; + HTTP_HttpAddRequestHeadersW(lpwhr, cache_control, strlenW(cache_control), HTTP_ADDREQ_FLAG_ADD_IF_NEW); } do @@ -3214,12 +3235,15 @@ } HTTP_FixURL(lpwhr); - HTTP_ProcessHeader(lpwhr, szConnection, - lpwhr->hdr.dwFlags & INTERNET_FLAG_KEEP_CONNECTION ? szKeepAlive : szClose, - HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE); - + if (lpwhr->hdr.dwFlags & INTERNET_FLAG_KEEP_CONNECTION) + { + HTTP_ProcessHeader(lpwhr, szConnection, szKeepAlive, HTTP_ADDHDR_FLAG_REQ | HTTP_ADDHDR_FLAG_REPLACE); + } HTTP_InsertAuthorization(lpwhr, lpwhr->pAuthInfo, szAuthorization); HTTP_InsertAuthorization(lpwhr, lpwhr->pProxyAuthInfo, szProxy_Authorization); + + if (!(lpwhr->hdr.dwFlags & INTERNET_FLAG_NO_COOKIES)) + HTTP_InsertCookies(lpwhr); /* add the headers the caller supplied */ if( lpszHeaders && dwHeaderLength ) @@ -3413,6 +3437,7 @@ sizeof(INTERNET_ASYNC_RESULT)); TRACE("<--\n"); + if (bSuccess) INTERNET_SetLastError(ERROR_SUCCESS); return bSuccess; } @@ -3451,8 +3476,7 @@ return ERROR_SUCCESS; } - FIXME("Not implemented option %d\n", option); - return ERROR_INTERNET_INVALID_OPTION; + return INET_QueryOption(option, buffer, size, unicode); } static const HANDLEHEADERVtbl HTTPSESSIONVtbl = { @@ -3598,6 +3622,7 @@ bSuccess = TRUE; goto lend; } + if (!HTTP_ResolveName(lpwhr)) goto lend; lpwhs = lpwhr->lpHttpSession; @@ -3612,7 +3637,7 @@ if (!NETCON_create(&lpwhr->netConnection, lpwhs->socketAddress.sin_family, SOCK_STREAM, 0)) { - WARN("Socket creation failed\n"); + WARN("Socket creation failed: %u\n", INTERNET_GetLastError()); goto lend; } @@ -3813,7 +3838,10 @@ if (bSuccess) return rc; else + { + HeapFree(GetProcessHeap(), 0, lpszRawHeaders); return 0; + } } @@ -4026,7 +4054,9 @@ BOOL HTTP_FinishedReading(LPWININETHTTPREQW lpwhr) { WCHAR szVersion[10]; + WCHAR szConnectionResponse[20]; DWORD dwBufferSize = sizeof(szVersion); + BOOL keepalive = FALSE; TRACE("\n"); @@ -4036,15 +4066,19 @@ &dwBufferSize, NULL) || strcmpiW(szVersion, g_szHttp1_1)) { - WCHAR szConnectionResponse[20]; - dwBufferSize = sizeof(szConnectionResponse); - if ((!HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_CONNECTION, szConnectionResponse, &dwBufferSize, NULL) || - strcmpiW(szConnectionResponse, szKeepAlive)) && - (!HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_PROXY_CONNECTION, szConnectionResponse, &dwBufferSize, NULL) || - strcmpiW(szConnectionResponse, szKeepAlive))) - { - HTTPREQ_CloseConnection(&lpwhr->hdr); - } + keepalive = TRUE; + } + + dwBufferSize = sizeof(szConnectionResponse); + if (HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_PROXY_CONNECTION, szConnectionResponse, &dwBufferSize, NULL) || + HTTP_HttpQueryInfoW(lpwhr, HTTP_QUERY_CONNECTION, szConnectionResponse, &dwBufferSize, NULL)) + { + keepalive = !strcmpiW(szConnectionResponse, szKeepAlive); + } + + if (!keepalive) + { + HTTPREQ_CloseConnection(&lpwhr->hdr); } /* FIXME: store data in the URL cache here */ @@ -4142,6 +4176,9 @@ return FALSE; lpwhr->nCustHeaders--; + HeapFree(GetProcessHeap(), 0, lpwhr->pCustHeaders[index].lpszField); + HeapFree(GetProcessHeap(), 0, lpwhr->pCustHeaders[index].lpszValue); + memmove( &lpwhr->pCustHeaders[index], &lpwhr->pCustHeaders[index+1], (lpwhr->nCustHeaders - index)* sizeof(HTTPHEADERW) ); memset( &lpwhr->pCustHeaders[lpwhr->nCustHeaders], 0, sizeof(HTTPHEADERW) ); Modified: trunk/reactos/dll/win32/wininet/inet_ntop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/inet_nto…
============================================================================== --- trunk/reactos/dll/win32/wininet/inet_ntop.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/inet_ntop.c [iso-8859-1] Thu Sep 4 13:37:34 2008 @@ -39,7 +39,10 @@ */ static const char *inet_ntop4(const u_char *src, char *dst, size_t size); + +#ifdef INET6 static const char *inet_ntop6(const u_char *src, char *dst, size_t size); +#endif /* char * * inet_ntop(af, src, dst, size) Modified: trunk/reactos/dll/win32/wininet/internet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
============================================================================== --- trunk/reactos/dll/win32/wininet/internet.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/internet.c [iso-8859-1] Thu Sep 4 13:37:34 2008 @@ -181,9 +181,13 @@ TRACE( "closing connection %p\n", info); info->vtbl->CloseConnection( info ); } - INTERNET_SendCallback(info, info->dwContext, - INTERNET_STATUS_HANDLE_CLOSING, &info->hInternet, - sizeof(HINTERNET)); + /* Don't send a callback if this is a session handle created with InternetOpenUrl */ + if (info->htype != WH_HHTTPSESSION || !(info->dwInternalFlags & INET_OPENURL)) + { + INTERNET_SendCallback(info, info->dwContext, + INTERNET_STATUS_HANDLE_CLOSING, &info->hInternet, + sizeof(HINTERNET)); + } TRACE( "destroying object %p\n", info); if ( info->htype != WH_HINIT ) list_remove( &info->entry ); @@ -491,6 +495,8 @@ static DWORD APPINFO_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void *buffer, DWORD *size, BOOL unicode) { + LPWININETAPPINFOW ai = (LPWININETAPPINFOW)hdr; + switch(option) { case INTERNET_OPTION_HANDLE_TYPE: TRACE("INTERNET_OPTION_HANDLE_TYPE\n"); @@ -501,10 +507,98 @@ *size = sizeof(DWORD); *(DWORD*)buffer = INTERNET_HANDLE_TYPE_INTERNET; return ERROR_SUCCESS; - } - - FIXME("Not implemented option %d\n", option); - return ERROR_INTERNET_INVALID_OPTION; + + case INTERNET_OPTION_USER_AGENT: { + DWORD bufsize; + + TRACE("INTERNET_OPTION_USER_AGENT\n"); + + bufsize = *size; + + if (unicode) { + *size = (strlenW(ai->lpszAgent) + 1) * sizeof(WCHAR); + if(!buffer || bufsize < *size) + return ERROR_INSUFFICIENT_BUFFER; + + strcpyW(buffer, ai->lpszAgent); + }else { + *size = WideCharToMultiByte(CP_ACP, 0, ai->lpszAgent, -1, NULL, 0, NULL, NULL); + if(!buffer || bufsize < *size) + return ERROR_INSUFFICIENT_BUFFER; + + WideCharToMultiByte(CP_ACP, 0, ai->lpszAgent, -1, buffer, *size, NULL, NULL); + } + + return ERROR_SUCCESS; + } + + case INTERNET_OPTION_PROXY: + if (unicode) { + INTERNET_PROXY_INFOW *pi = (INTERNET_PROXY_INFOW *)buffer; + DWORD proxyBytesRequired = 0, proxyBypassBytesRequired = 0; + LPWSTR proxy, proxy_bypass; + + if (ai->lpszProxy) + proxyBytesRequired = (lstrlenW(ai->lpszProxy) + 1) * sizeof(WCHAR); + if (ai->lpszProxyBypass) + proxyBypassBytesRequired = (lstrlenW(ai->lpszProxyBypass) + 1) * sizeof(WCHAR); + if (*size < sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired + proxyBypassBytesRequired) + return ERROR_INSUFFICIENT_BUFFER; + + proxy = (LPWSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOW)); + proxy_bypass = (LPWSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired); + + pi->dwAccessType = ai->dwAccessType; + pi->lpszProxy = NULL; + pi->lpszProxyBypass = NULL; + if (ai->lpszProxy) { + lstrcpyW(proxy, ai->lpszProxy); + pi->lpszProxy = proxy; + } + + if (ai->lpszProxyBypass) { + lstrcpyW(proxy_bypass, ai->lpszProxyBypass); + pi->lpszProxyBypass = proxy_bypass; + } + + *size = sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired + proxyBypassBytesRequired; + return ERROR_SUCCESS; + }else { + INTERNET_PROXY_INFOA *pi = (INTERNET_PROXY_INFOA *)buffer; + DWORD proxyBytesRequired = 0, proxyBypassBytesRequired = 0; + LPSTR proxy, proxy_bypass; + + if (ai->lpszProxy) + proxyBytesRequired = WideCharToMultiByte(CP_ACP, 0, ai->lpszProxy, -1, NULL, 0, NULL, NULL); + if (ai->lpszProxyBypass) + proxyBypassBytesRequired = WideCharToMultiByte(CP_ACP, 0, ai->lpszProxyBypass, -1, + NULL, 0, NULL, NULL); + if (*size < sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired + proxyBypassBytesRequired) + return ERROR_INSUFFICIENT_BUFFER; + + proxy = (LPSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOA)); + proxy_bypass = (LPSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired); + + pi->dwAccessType = ai->dwAccessType; + pi->lpszProxy = NULL; + pi->lpszProxyBypass = NULL; + if (ai->lpszProxy) { + WideCharToMultiByte(CP_ACP, 0, ai->lpszProxy, -1, proxy, proxyBytesRequired, NULL, NULL); + pi->lpszProxy = proxy; + } + + if (ai->lpszProxyBypass) { + WideCharToMultiByte(CP_ACP, 0, ai->lpszProxyBypass, -1, proxy_bypass, + proxyBypassBytesRequired, NULL, NULL); + pi->lpszProxyBypass = proxy_bypass; + } + + *size = sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired + proxyBypassBytesRequired; + return ERROR_SUCCESS; + } + } + + return INET_QueryOption(option, buffer, size, unicode); } static const HANDLEHEADERVtbl APPINFOVtbl = { @@ -1046,14 +1140,14 @@ /*********************************************************************** * ConvertUrlComponentValue (Internal) * - * Helper function for InternetCrackUrlW + * Helper function for InternetCrackUrlA * */ static void ConvertUrlComponentValue(LPSTR* lppszComponent, LPDWORD dwComponentLen, LPWSTR lpwszComponent, DWORD dwwComponentLen, LPCSTR lpszStart, LPCWSTR lpwszStart) { - TRACE("%p %d %p %d %p %p\n", lppszComponent, *dwComponentLen, lpwszComponent, dwwComponentLen, lpszStart, lpwszStart); + TRACE("%p %d %p %d %p %p\n", *lppszComponent, *dwComponentLen, lpwszComponent, dwwComponentLen, lpszStart, lpwszStart); if (*dwComponentLen != 0) { DWORD nASCIILength=WideCharToMultiByte(CP_ACP,0,lpwszComponent,dwwComponentLen,NULL,0,NULL,NULL); @@ -1087,9 +1181,13 @@ { DWORD nLength; URL_COMPONENTSW UCW; - WCHAR* lpwszUrl; - - TRACE("(%s %u %x %p)\n", debugstr_a(lpszUrl), dwUrlLength, dwFlags, lpUrlComponents); + BOOL ret = FALSE; + WCHAR *lpwszUrl, *hostname = NULL, *username = NULL, *password = NULL, *path = NULL, + *scheme = NULL, *extra = NULL; + + TRACE("(%s %u %x %p)\n", + lpszUrl ? debugstr_an(lpszUrl, dwUrlLength ? dwUrlLength : strlen(lpszUrl)) : "(null)", + dwUrlLength, dwFlags, lpUrlComponents); if (!lpszUrl || !*lpszUrl || !lpUrlComponents || lpUrlComponents->dwStructSize != sizeof(URL_COMPONENTSA)) @@ -1111,53 +1209,92 @@ memset(&UCW,0,sizeof(UCW)); UCW.dwStructSize = sizeof(URL_COMPONENTSW); - if(lpUrlComponents->dwHostNameLength!=0) - UCW.dwHostNameLength= lpUrlComponents->dwHostNameLength; - if(lpUrlComponents->dwUserNameLength!=0) - UCW.dwUserNameLength=lpUrlComponents->dwUserNameLength; - if(lpUrlComponents->dwPasswordLength!=0) - UCW.dwPasswordLength=lpUrlComponents->dwPasswordLength; - if(lpUrlComponents->dwUrlPathLength!=0) - UCW.dwUrlPathLength=lpUrlComponents->dwUrlPathLength; - if(lpUrlComponents->dwSchemeLength!=0) - UCW.dwSchemeLength=lpUrlComponents->dwSchemeLength; - if(lpUrlComponents->dwExtraInfoLength!=0) - UCW.dwExtraInfoLength=lpUrlComponents->dwExtraInfoLength; - if(!InternetCrackUrlW(lpwszUrl,nLength,dwFlags,&UCW)) + if (lpUrlComponents->dwHostNameLength) { - HeapFree(GetProcessHeap(), 0, lpwszUrl); - return FALSE; + UCW.dwHostNameLength = lpUrlComponents->dwHostNameLength; + if (lpUrlComponents->lpszHostName) + { + hostname = HeapAlloc(GetProcessHeap(), 0, UCW.dwHostNameLength * sizeof(WCHAR)); + UCW.lpszHostName = hostname; + } } - - ConvertUrlComponentValue(&lpUrlComponents->lpszHostName, &lpUrlComponents->dwHostNameLength, - UCW.lpszHostName, UCW.dwHostNameLength, - lpszUrl, lpwszUrl); - ConvertUrlComponentValue(&lpUrlComponents->lpszUserName, &lpUrlComponents->dwUserNameLength, - UCW.lpszUserName, UCW.dwUserNameLength, - lpszUrl, lpwszUrl); - ConvertUrlComponentValue(&lpUrlComponents->lpszPassword, &lpUrlComponents->dwPasswordLength, - UCW.lpszPassword, UCW.dwPasswordLength, - lpszUrl, lpwszUrl); - ConvertUrlComponentValue(&lpUrlComponents->lpszUrlPath, &lpUrlComponents->dwUrlPathLength, - UCW.lpszUrlPath, UCW.dwUrlPathLength, - lpszUrl, lpwszUrl); - ConvertUrlComponentValue(&lpUrlComponents->lpszScheme, &lpUrlComponents->dwSchemeLength, - UCW.lpszScheme, UCW.dwSchemeLength, - lpszUrl, lpwszUrl); - ConvertUrlComponentValue(&lpUrlComponents->lpszExtraInfo, &lpUrlComponents->dwExtraInfoLength, - UCW.lpszExtraInfo, UCW.dwExtraInfoLength, - lpszUrl, lpwszUrl); - lpUrlComponents->nScheme=UCW.nScheme; - lpUrlComponents->nPort=UCW.nPort; + if (lpUrlComponents->dwUserNameLength) + { + UCW.dwUserNameLength = lpUrlComponents->dwUserNameLength; + if (lpUrlComponents->lpszUserName) + { + username = HeapAlloc(GetProcessHeap(), 0, UCW.dwUserNameLength * sizeof(WCHAR)); + UCW.lpszUserName = username; + } + } + if (lpUrlComponents->dwPasswordLength) + { + UCW.dwPasswordLength = lpUrlComponents->dwPasswordLength; + if (lpUrlComponents->lpszPassword) + { + password = HeapAlloc(GetProcessHeap(), 0, UCW.dwPasswordLength * sizeof(WCHAR)); + UCW.lpszPassword = password; + } + } + if (lpUrlComponents->dwUrlPathLength) + { + UCW.dwUrlPathLength = lpUrlComponents->dwUrlPathLength; + if (lpUrlComponents->lpszUrlPath) + { + path = HeapAlloc(GetProcessHeap(), 0, UCW.dwUrlPathLength * sizeof(WCHAR)); + UCW.lpszUrlPath = path; + } + } + if (lpUrlComponents->dwSchemeLength) + { + UCW.dwSchemeLength = lpUrlComponents->dwSchemeLength; + if (lpUrlComponents->lpszScheme) + { + scheme = HeapAlloc(GetProcessHeap(), 0, UCW.dwSchemeLength * sizeof(WCHAR)); + UCW.lpszScheme = scheme; + } + } + if (lpUrlComponents->dwExtraInfoLength) + { + UCW.dwExtraInfoLength = lpUrlComponents->dwExtraInfoLength; + if (lpUrlComponents->lpszExtraInfo) + { + extra = HeapAlloc(GetProcessHeap(), 0, UCW.dwExtraInfoLength * sizeof(WCHAR)); + UCW.lpszExtraInfo = extra; + } + } + if ((ret = InternetCrackUrlW(lpwszUrl, nLength, dwFlags, &UCW))) + { + ConvertUrlComponentValue(&lpUrlComponents->lpszHostName, &lpUrlComponents->dwHostNameLength, + UCW.lpszHostName, UCW.dwHostNameLength, lpszUrl, lpwszUrl); + ConvertUrlComponentValue(&lpUrlComponents->lpszUserName, &lpUrlComponents->dwUserNameLength, + UCW.lpszUserName, UCW.dwUserNameLength, lpszUrl, lpwszUrl); + ConvertUrlComponentValue(&lpUrlComponents->lpszPassword, &lpUrlComponents->dwPasswordLength, + UCW.lpszPassword, UCW.dwPasswordLength, lpszUrl, lpwszUrl); + ConvertUrlComponentValue(&lpUrlComponents->lpszUrlPath, &lpUrlComponents->dwUrlPathLength, + UCW.lpszUrlPath, UCW.dwUrlPathLength, lpszUrl, lpwszUrl); + ConvertUrlComponentValue(&lpUrlComponents->lpszScheme, &lpUrlComponents->dwSchemeLength, + UCW.lpszScheme, UCW.dwSchemeLength, lpszUrl, lpwszUrl); + ConvertUrlComponentValue(&lpUrlComponents->lpszExtraInfo, &lpUrlComponents->dwExtraInfoLength, + UCW.lpszExtraInfo, UCW.dwExtraInfoLength, lpszUrl, lpwszUrl); + + lpUrlComponents->nScheme = UCW.nScheme; + lpUrlComponents->nPort = UCW.nPort; + + TRACE("%s: scheme(%s) host(%s) path(%s) extra(%s)\n", lpszUrl, + debugstr_an(lpUrlComponents->lpszScheme, lpUrlComponents->dwSchemeLength), + debugstr_an(lpUrlComponents->lpszHostName, lpUrlComponents->dwHostNameLength), + debugstr_an(lpUrlComponents->lpszUrlPath, lpUrlComponents->dwUrlPathLength), + debugstr_an(lpUrlComponents->lpszExtraInfo, lpUrlComponents->dwExtraInfoLength)); + } HeapFree(GetProcessHeap(), 0, lpwszUrl); - - TRACE("%s: scheme(%s) host(%s) path(%s) extra(%s)\n", lpszUrl, - debugstr_an(lpUrlComponents->lpszScheme,lpUrlComponents->dwSchemeLength), - debugstr_an(lpUrlComponents->lpszHostName,lpUrlComponents->dwHostNameLength), - debugstr_an(lpUrlComponents->lpszUrlPath,lpUrlComponents->dwUrlPathLength), - debugstr_an(lpUrlComponents->lpszExtraInfo,lpUrlComponents->dwExtraInfoLength)); - - return TRUE; + HeapFree(GetProcessHeap(), 0, hostname); + HeapFree(GetProcessHeap(), 0, username); + HeapFree(GetProcessHeap(), 0, password); + HeapFree(GetProcessHeap(), 0, path); + HeapFree(GetProcessHeap(), 0, scheme); + HeapFree(GetProcessHeap(), 0, extra); + return ret; } static const WCHAR url_schemes[][7] = @@ -1264,10 +1401,10 @@ LPCWSTR lpszcp = NULL; LPWSTR lpszUrl_decode = NULL; DWORD dwUrlLength = dwUrlLength_orig; - const WCHAR lpszSeparators[3]={';','?',0}; - const WCHAR lpszSlash[2]={'/',0}; - - TRACE("(%s %u %x %p)\n", debugstr_w(lpszUrl), dwUrlLength, dwFlags, lpUC); + + TRACE("(%s %u %x %p)\n", + lpszUrl ? debugstr_wn(lpszUrl, dwUrlLength ? dwUrlLength : strlenW(lpszUrl)) : "(null)", + dwUrlLength, dwFlags, lpUC); if (!lpszUrl_orig || !*lpszUrl_orig || !lpUC) { @@ -1278,16 +1415,33 @@ if (dwFlags & ICU_DECODE) { - lpszUrl_decode=HeapAlloc( GetProcessHeap(), 0, dwUrlLength * sizeof (WCHAR) ); - if( InternetCanonicalizeUrlW(lpszUrl_orig, lpszUrl_decode, &dwUrlLength, dwFlags)) - { - lpszUrl = lpszUrl_decode; - } + WCHAR *url_tmp; + DWORD len = dwUrlLength + 1; + + if (!(url_tmp = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) + { + INTERNET_SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + memcpy(url_tmp, lpszUrl_orig, dwUrlLength * sizeof(WCHAR)); + url_tmp[dwUrlLength] = 0; + if (!(lpszUrl_decode = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) + { + HeapFree(GetProcessHeap(), 0, url_tmp); + INTERNET_SetLastError(ERROR_OUTOFMEMORY); + return FALSE; + } + if (InternetCanonicalizeUrlW(url_tmp, lpszUrl_decode, &len, ICU_DECODE | ICU_NO_ENCODE)) + { + dwUrlLength = len; + lpszUrl = lpszUrl_decode; + } + HeapFree(GetProcessHeap(), 0, url_tmp); } lpszap = lpszUrl; /* Determine if the URI is absolute. */ - while (*lpszap != '\0') + while (lpszap - lpszUrl < dwUrlLength) { if (isalnumW(*lpszap)) { @@ -1311,7 +1465,9 @@ lpUC->nPort = INTERNET_INVALID_PORT_NUMBER; /* Parse <params> */ - lpszParam = strpbrkW(lpszap, lpszSeparators); + if (!(lpszParam = memchrW(lpszap, ';', dwUrlLength - (lpszap - lpszUrl)))) + lpszParam = memchrW(lpszap, '?', dwUrlLength - (lpszap - lpszUrl)); + SetUrlComponentValueW(&lpUC->lpszExtraInfo, &lpUC->dwExtraInfoLength, lpszParam, lpszParam ? dwUrlLength-(lpszParam-lpszUrl) : 0); @@ -1332,7 +1488,7 @@ { lpszcp += 2; - lpszNetLoc = strpbrkW(lpszcp, lpszSlash); + lpszNetLoc = memchrW(lpszcp, '/', dwUrlLength - (lpszcp - lpszUrl)); if (lpszParam) { if (lpszNetLoc) @@ -1352,7 +1508,7 @@ /* [<user>[<:password>]@]<host>[:<port>] */ /* First find the user and password if they exist */ - lpszHost = strchrW(lpszcp, '@'); + lpszHost = memchrW(lpszcp, '@', dwUrlLength - (lpszcp - lpszUrl)); if (lpszHost == NULL || lpszHost > lpszNetLoc) { /* username and password not specified. */ @@ -1461,7 +1617,7 @@ * <protocol>:[//<net_loc>][/path][;<params>][?<query>][#<fragment>] * ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ - if (lpszcp != 0 && *lpszcp != '\0' && (!lpszParam || lpszcp < lpszParam)) + if (lpszcp != 0 && lpszcp - lpszUrl < dwUrlLength && (!lpszParam || lpszcp < lpszParam)) { INT len; @@ -1475,7 +1631,7 @@ /* Leave the parameter list in lpszUrlPath. Strip off any trailing * newlines if necessary. */ - LPWSTR lpsznewline = strchrW(lpszcp, '\n'); + LPWSTR lpsznewline = memchrW(lpszcp, '\n', dwUrlLength - (lpszcp - lpszUrl)); if (lpsznewline != NULL) len = lpsznewline - lpszcp; else @@ -1486,6 +1642,8 @@ } else { + if (lpUC->lpszUrlPath && (lpUC->dwUrlPathLength > 0)) + lpUC->lpszUrlPath[0] = 0; lpUC->dwUrlPathLength = 0; } @@ -1586,7 +1744,7 @@ DWORD dwURLFlags = URL_WININET_COMPATIBILITY | URL_ESCAPE_UNSAFE; TRACE("(%s, %p, %p, 0x%08x) bufferlength: %d\n", debugstr_w(lpszUrl), lpszBuffer, - lpdwBufferLength, lpdwBufferLength ? *lpdwBufferLength : -1, dwFlags); + lpdwBufferLength, dwFlags, lpdwBufferLength ? *lpdwBufferLength : -1); if(dwFlags & ICU_DECODE) { @@ -1861,315 +2019,137 @@ return FALSE; } -/*********************************************************************** - * INET_QueryOptionHelper (internal) - */ -static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD dwOption, - LPVOID lpBuffer, LPDWORD lpdwBufferLength) -{ - LPWININETHANDLEHEADER lpwhh; - BOOL bSuccess = FALSE; - - TRACE("(%p, 0x%08x, %p, %p)\n", hInternet, dwOption, lpBuffer, lpdwBufferLength); - - lpwhh = WININET_GetObject( hInternet ); - - switch (dwOption) - { - case INTERNET_OPTION_REQUEST_FLAGS: - { - ULONG flags = 4; - TRACE("INTERNET_OPTION_REQUEST_FLAGS: %d\n", flags); - if (*lpdwBufferLength < sizeof(ULONG)) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - memcpy(lpBuffer, &flags, sizeof(ULONG)); - bSuccess = TRUE; - } - *lpdwBufferLength = sizeof(ULONG); - break; - } - - case INTERNET_OPTION_USER_AGENT: - { - DWORD required; - LPWININETAPPINFOW ai = (LPWININETAPPINFOW)lpwhh; - - TRACE("INTERNET_OPTION_USER_AGENT\n"); - - if (lpwhh->htype != INTERNET_HANDLE_TYPE_INTERNET) - { - INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE); - return FALSE; - } - if (bIsUnicode) - { - required = (strlenW(ai->lpszAgent) + 1) * sizeof(WCHAR); - if (*lpdwBufferLength < required) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else if (lpBuffer) - { - strcpyW(lpBuffer, ai->lpszAgent); - bSuccess = TRUE; - } - } - else - { - required = WideCharToMultiByte(CP_ACP, 0, ai->lpszAgent, -1, NULL, 0, NULL, NULL); - if (*lpdwBufferLength < required) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else if (lpBuffer) - { - WideCharToMultiByte(CP_ACP, 0, ai->lpszAgent, -1, lpBuffer, required, NULL, NULL); - bSuccess = TRUE; - } - } - *lpdwBufferLength = required; - break; - } - case INTERNET_OPTION_HTTP_VERSION: - { - if (*lpdwBufferLength < sizeof(HTTP_VERSION_INFO)) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - /* - * Presently hardcoded to 1.1 - */ - ((HTTP_VERSION_INFO*)lpBuffer)->dwMajorVersion = 1; - ((HTTP_VERSION_INFO*)lpBuffer)->dwMinorVersion = 1; - bSuccess = TRUE; - } - *lpdwBufferLength = sizeof(HTTP_VERSION_INFO); - break; - } - case INTERNET_OPTION_CONNECTED_STATE: - { - DWORD *pdwConnectedState = (DWORD *)lpBuffer; - FIXME("INTERNET_OPTION_CONNECTED_STATE: semi-stub\n"); - - if (*lpdwBufferLength < sizeof(*pdwConnectedState)) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - *pdwConnectedState = INTERNET_STATE_CONNECTED; - bSuccess = TRUE; - } - *lpdwBufferLength = sizeof(*pdwConnectedState); - break; - } - case INTERNET_OPTION_PROXY: - { - LPWININETAPPINFOW lpwai = (LPWININETAPPINFOW)lpwhh; - WININETAPPINFOW wai; - - if (lpwai == NULL) - { - TRACE("Getting global proxy info\n"); - memset(&wai, 0, sizeof(WININETAPPINFOW)); - INTERNET_ConfigureProxy( &wai ); - lpwai = &wai; - } - - if (bIsUnicode) - { - INTERNET_PROXY_INFOW *pPI = (INTERNET_PROXY_INFOW *)lpBuffer; - DWORD proxyBytesRequired = 0, proxyBypassBytesRequired = 0; - - if (lpwai->lpszProxy) - proxyBytesRequired = (lstrlenW(lpwai->lpszProxy) + 1) * - sizeof(WCHAR); - if (lpwai->lpszProxyBypass) - proxyBypassBytesRequired = - (lstrlenW(lpwai->lpszProxyBypass) + 1) * sizeof(WCHAR); - if (*lpdwBufferLength < sizeof(INTERNET_PROXY_INFOW) + - proxyBytesRequired + proxyBypassBytesRequired) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - LPWSTR proxy = (LPWSTR)((LPBYTE)lpBuffer + - sizeof(INTERNET_PROXY_INFOW)); - LPWSTR proxy_bypass = (LPWSTR)((LPBYTE)lpBuffer + - sizeof(INTERNET_PROXY_INFOW) + - proxyBytesRequired); - - pPI->dwAccessType = lpwai->dwAccessType; - pPI->lpszProxy = NULL; - pPI->lpszProxyBypass = NULL; - if (lpwai->lpszProxy) - { - lstrcpyW(proxy, lpwai->lpszProxy); - pPI->lpszProxy = proxy; - } - - if (lpwai->lpszProxyBypass) - { - lstrcpyW(proxy_bypass, lpwai->lpszProxyBypass); - pPI->lpszProxyBypass = proxy_bypass; - } - bSuccess = TRUE; - } - *lpdwBufferLength = sizeof(INTERNET_PROXY_INFOW) + - proxyBytesRequired + proxyBypassBytesRequired; - } - else - { - INTERNET_PROXY_INFOA *pPI = (INTERNET_PROXY_INFOA *)lpBuffer; - DWORD proxyBytesRequired = 0, proxyBypassBytesRequired = 0; - - if (lpwai->lpszProxy) - proxyBytesRequired = WideCharToMultiByte(CP_ACP, 0, - lpwai->lpszProxy, -1, NULL, 0, NULL, NULL); - if (lpwai->lpszProxyBypass) - proxyBypassBytesRequired = WideCharToMultiByte(CP_ACP, 0, - lpwai->lpszProxyBypass, -1, NULL, 0, NULL, NULL); - if (*lpdwBufferLength < sizeof(INTERNET_PROXY_INFOA) + - proxyBytesRequired + proxyBypassBytesRequired) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - LPSTR proxy = (LPSTR)((LPBYTE)lpBuffer + - sizeof(INTERNET_PROXY_INFOA)); - LPSTR proxy_bypass = (LPSTR)((LPBYTE)lpBuffer + - sizeof(INTERNET_PROXY_INFOA) + - proxyBytesRequired); - - pPI->dwAccessType = lpwai->dwAccessType; - pPI->lpszProxy = NULL; - pPI->lpszProxyBypass = NULL; - if (lpwai->lpszProxy) - { - WideCharToMultiByte(CP_ACP, 0, lpwai->lpszProxy, -1, - proxy, proxyBytesRequired, NULL, NULL); - pPI->lpszProxy = proxy; - } - - if (lpwai->lpszProxyBypass) - { - WideCharToMultiByte(CP_ACP, 0, lpwai->lpszProxyBypass, - -1, proxy_bypass, proxyBypassBytesRequired, - NULL, NULL); - pPI->lpszProxyBypass = proxy_bypass; - } - bSuccess = TRUE; - } - *lpdwBufferLength = sizeof(INTERNET_PROXY_INFOA) + - proxyBytesRequired + proxyBypassBytesRequired; - } - break; - } - case INTERNET_OPTION_MAX_CONNS_PER_SERVER: - { - ULONG conn = 2; - TRACE("INTERNET_OPTION_MAX_CONNS_PER_SERVER: %d\n", conn); - if (*lpdwBufferLength < sizeof(ULONG)) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - memcpy(lpBuffer, &conn, sizeof(ULONG)); - bSuccess = TRUE; - } - *lpdwBufferLength = sizeof(ULONG); - break; - } - case INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER: - { - ULONG conn = 4; - TRACE("INTERNET_OPTION_MAX_CONNS_1_0_SERVER: %d\n", conn); - if (*lpdwBufferLength < sizeof(ULONG)) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - memcpy(lpBuffer, &conn, sizeof(ULONG)); - bSuccess = TRUE; - } - *lpdwBufferLength = sizeof(ULONG); - break; - } - case INTERNET_OPTION_SECURITY_FLAGS: - FIXME("INTERNET_OPTION_SECURITY_FLAGS: Stub\n"); - bSuccess = TRUE; - break; - - case INTERNET_OPTION_VERSION: - { - TRACE("INTERNET_OPTION_VERSION\n"); - if (*lpdwBufferLength < sizeof(INTERNET_VERSION_INFO)) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - static const INTERNET_VERSION_INFO info = { 1, 2 }; - memcpy(lpBuffer, &info, sizeof(info)); - *lpdwBufferLength = sizeof(info); - bSuccess = TRUE; - } - break; - } - case INTERNET_OPTION_PER_CONNECTION_OPTION: - FIXME("INTERNET_OPTION_PER_CONNECTION_OPTION stub\n"); - if (*lpdwBufferLength < sizeof(INTERNET_PER_CONN_OPTION_LISTW)) - INTERNET_SetLastError(ERROR_INSUFFICIENT_BUFFER); - else - { - INTERNET_PER_CONN_OPTION_LISTW *con = lpBuffer; - int x; - bSuccess = TRUE; - for (x = 0; x < con->dwOptionCount; ++x) - { - INTERNET_PER_CONN_OPTIONW *option = con->pOptions + x; - switch (option->dwOption) - { - case INTERNET_PER_CONN_FLAGS: - option->Value.dwValue = PROXY_TYPE_DIRECT; - break; - - case INTERNET_PER_CONN_PROXY_SERVER: - case INTERNET_PER_CONN_PROXY_BYPASS: - case INTERNET_PER_CONN_AUTOCONFIG_URL: - case INTERNET_PER_CONN_AUTODISCOVERY_FLAGS: - case INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL: - case INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS: - case INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME: - case INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL: - FIXME("Unhandled dwOption %d\n", option->dwOption); - option->Value.dwValue = 0; - bSuccess = FALSE; - break; - - default: - FIXME("Unknown dwOption %d\n", option->dwOption); - bSuccess = FALSE; - break; - } - } - if (!bSuccess) - INTERNET_SetLastError(ERROR_INVALID_PARAMETER); - } - break; - case 66: - FIXME("66\n"); - bSuccess = TRUE; - break; - default: { - if(lpwhh) { - DWORD res; - - res = lpwhh->vtbl->QueryOption(lpwhh, dwOption, lpBuffer, lpdwBufferLength, bIsUnicode); - if(res == ERROR_SUCCESS) - bSuccess = TRUE; - else - SetLastError(res); - }else { - FIXME("Stub! %d\n", dwOption); +DWORD INET_QueryOption(DWORD option, void *buffer, DWORD *size, BOOL unicode) +{ + switch(option) { + case INTERNET_OPTION_REQUEST_FLAGS: + TRACE("INTERNET_OPTION_REQUEST_FLAGS\n"); + + if (*size < sizeof(ULONG)) + return ERROR_INSUFFICIENT_BUFFER; + + *(ULONG*)buffer = 4; + *size = sizeof(ULONG); + + return ERROR_SUCCESS; + + case INTERNET_OPTION_HTTP_VERSION: + if (*size < sizeof(HTTP_VERSION_INFO)) + return ERROR_INSUFFICIENT_BUFFER; + + /* + * Presently hardcoded to 1.1 + */ + ((HTTP_VERSION_INFO*)buffer)->dwMajorVersion = 1; + ((HTTP_VERSION_INFO*)buffer)->dwMinorVersion = 1; + *size = sizeof(HTTP_VERSION_INFO); + + return ERROR_SUCCESS; + + case INTERNET_OPTION_CONNECTED_STATE: + FIXME("INTERNET_OPTION_CONNECTED_STATE: semi-stub\n"); + + if (*size < sizeof(ULONG)) + return ERROR_INSUFFICIENT_BUFFER; + + *(ULONG*)buffer = INTERNET_STATE_CONNECTED; + *size = sizeof(ULONG); + + return ERROR_SUCCESS; + + case INTERNET_OPTION_PROXY: { + WININETAPPINFOW ai; + + TRACE("Getting global proxy info\n"); + memset(&ai, 0, sizeof(WININETAPPINFOW)); + INTERNET_ConfigureProxy(&ai); + + return APPINFO_QueryOption(&ai.hdr, INTERNET_OPTION_PROXY, buffer, size, unicode); /* FIXME */ + } + + case INTERNET_OPTION_MAX_CONNS_PER_SERVER: + TRACE("INTERNET_OPTION_MAX_CONNS_PER_SERVER\n"); + + if (*size < sizeof(ULONG)) + return ERROR_INSUFFICIENT_BUFFER; + + *(ULONG*)buffer = 2; + *size = sizeof(ULONG); + + return ERROR_SUCCESS; + + case INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER: + TRACE("INTERNET_OPTION_MAX_CONNS_1_0_SERVER\n"); + + if (*size < sizeof(ULONG)) + return ERROR_INSUFFICIENT_BUFFER; + + *(ULONG*)size = 4; + *size = sizeof(ULONG); + + return ERROR_SUCCESS; + + case INTERNET_OPTION_SECURITY_FLAGS: + FIXME("INTERNET_OPTION_SECURITY_FLAGS: Stub\n"); + return ERROR_SUCCESS; + + case INTERNET_OPTION_VERSION: { + static const INTERNET_VERSION_INFO info = { 1, 2 }; + + TRACE("INTERNET_OPTION_VERSION\n"); + + if (*size < sizeof(INTERNET_VERSION_INFO)) + return ERROR_INSUFFICIENT_BUFFER; + + memcpy(buffer, &info, sizeof(info)); + *size = sizeof(info); + + return ERROR_SUCCESS; + } + + case INTERNET_OPTION_PER_CONNECTION_OPTION: { + INTERNET_PER_CONN_OPTION_LISTW *con = buffer; + DWORD res = ERROR_SUCCESS, i; + + FIXME("INTERNET_OPTION_PER_CONNECTION_OPTION stub\n"); + + if (*size < sizeof(INTERNET_PER_CONN_OPTION_LISTW)) + return ERROR_INSUFFICIENT_BUFFER; + + for (i = 0; i < con->dwOptionCount; i++) { + INTERNET_PER_CONN_OPTIONW *option = con->pOptions + i; + + switch (option->dwOption) { + case INTERNET_PER_CONN_FLAGS: + option->Value.dwValue = PROXY_TYPE_DIRECT; + break; + + case INTERNET_PER_CONN_PROXY_SERVER: + case INTERNET_PER_CONN_PROXY_BYPASS: + case INTERNET_PER_CONN_AUTOCONFIG_URL: + case INTERNET_PER_CONN_AUTODISCOVERY_FLAGS: + case INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL: + case INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS: + case INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME: + case INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL: + FIXME("Unhandled dwOption %d\n", option->dwOption); + option->Value.dwValue = 0; + res = ERROR_INVALID_PARAMETER; + break; + + default: + FIXME("Unknown dwOption %d\n", option->dwOption); + res = ERROR_INVALID_PARAMETER; break; } } - } - if (lpwhh) - WININET_Release( lpwhh ); - - return bSuccess; + + return res; + } + } + + FIXME("Stub for %d\n", option); + return ERROR_INTERNET_INCORRECT_HANDLE_TYPE; } /*********************************************************************** @@ -2185,7 +2165,24 @@ BOOL WINAPI InternetQueryOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength) { - return INET_QueryOptionHelper(TRUE, hInternet, dwOption, lpBuffer, lpdwBufferLength); + LPWININETHANDLEHEADER hdr; + DWORD res = ERROR_INVALID_HANDLE; + + TRACE("%p %d %p %p\n", hInternet, dwOption, lpBuffer, lpdwBufferLength); + + if(hInternet) { + hdr = WININET_GetObject(hInternet); + if (hdr) { + res = hdr->vtbl->QueryOption(hdr, dwOption, lpBuffer, lpdwBufferLength, TRUE); + WININET_Release(hdr); + } + }else { + res = INET_QueryOption(dwOption, lpBuffer, lpdwBufferLength, TRUE); + } + + if(res != ERROR_SUCCESS) + SetLastError(res); + return res == ERROR_SUCCESS; } /*********************************************************************** @@ -2201,7 +2198,24 @@ BOOL WINAPI InternetQueryOptionA(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength) { - return INET_QueryOptionHelper(FALSE, hInternet, dwOption, lpBuffer, lpdwBufferLength); + LPWININETHANDLEHEADER hdr; + DWORD res = ERROR_INVALID_HANDLE; + + TRACE("%p %d %p %p\n", hInternet, dwOption, lpBuffer, lpdwBufferLength); + + if(hInternet) { + hdr = WININET_GetObject(hInternet); + if (hdr) { + res = hdr->vtbl->QueryOption(hdr, dwOption, lpBuffer, lpdwBufferLength, FALSE); + WININET_Release(hdr); + } + }else { + res = INET_QueryOption(dwOption, lpBuffer, lpdwBufferLength, FALSE); + } + + if(res != ERROR_SUCCESS) + SetLastError(res); + return res == ERROR_SUCCESS; } @@ -2254,44 +2268,44 @@ break; case INTERNET_OPTION_ERROR_MASK: { - unsigned long flags=*(unsigned long*)lpBuffer; - FIXME("Option INTERNET_OPTION_ERROR_MASK(%ld): STUB\n",flags); + ULONG flags = *(ULONG *)lpBuffer; + FIXME("Option INTERNET_OPTION_ERROR_MASK(%d): STUB\n", flags); } break; case INTERNET_OPTION_CODEPAGE: { - unsigned long codepage=*(unsigned long*)lpBuffer; - FIXME("Option INTERNET_OPTION_CODEPAGE (%ld): STUB\n",codepage); + ULONG codepage = *(ULONG *)lpBuffer; + FIXME("Option INTERNET_OPTION_CODEPAGE (%d): STUB\n", codepage); } break; case INTERNET_OPTION_REQUEST_PRIORITY: { - unsigned long priority=*(unsigned long*)lpBuffer; - FIXME("Option INTERNET_OPTION_REQUEST_PRIORITY (%ld): STUB\n",priority); + ULONG priority = *(ULONG *)lpBuffer; + FIXME("Option INTERNET_OPTION_REQUEST_PRIORITY (%d): STUB\n", priority); } break; case INTERNET_OPTION_CONNECT_TIMEOUT: { - unsigned long connecttimeout=*(unsigned long*)lpBuffer; - FIXME("Option INTERNET_OPTION_CONNECT_TIMEOUT (%ld): STUB\n",connecttimeout); + ULONG connecttimeout = *(ULONG *)lpBuffer; + FIXME("Option INTERNET_OPTION_CONNECT_TIMEOUT (%d): STUB\n", connecttimeout); } break; case INTERNET_OPTION_DATA_RECEIVE_TIMEOUT: { - unsigned long receivetimeout=*(unsigned long*)lpBuffer; - FIXME("Option INTERNET_OPTION_DATA_RECEIVE_TIMEOUT (%ld): STUB\n",receivetimeout); + ULONG receivetimeout = *(ULONG *)lpBuffer; + FIXME("Option INTERNET_OPTION_DATA_RECEIVE_TIMEOUT (%d): STUB\n", receivetimeout); } break; case INTERNET_OPTION_MAX_CONNS_PER_SERVER: { - unsigned long conns=*(unsigned long*)lpBuffer; - FIXME("Option INTERNET_OPTION_MAX_CONNS_PER_SERVER (%ld): STUB\n",conns); + ULONG conns = *(ULONG *)lpBuffer; + FIXME("Option INTERNET_OPTION_MAX_CONNS_PER_SERVER (%d): STUB\n", conns); } break; case INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER: { - unsigned long conns=*(unsigned long*)lpBuffer; - FIXME("Option INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER (%ld): STUB\n",conns); + ULONG conns = *(ULONG *)lpBuffer; + FIXME("Option INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER (%d): STUB\n", conns); } break; case INTERNET_OPTION_RESET_URLCACHE_SESSION: @@ -2308,16 +2322,25 @@ break; case INTERNET_OPTION_SEND_TIMEOUT: case INTERNET_OPTION_RECEIVE_TIMEOUT: - FIXME("INTERNET_OPTION_SEND/RECEIVE_TIMEOUT\n"); + { + ULONG timeout = *(ULONG *)lpBuffer; + FIXME("INTERNET_OPTION_SEND/RECEIVE_TIMEOUT %d\n", timeout); break; + } case INTERNET_OPTION_CONNECT_RETRIES: - FIXME("Option INTERNET_OPTION_CONNECT_RETRIES: STUB\n"); + { + ULONG retries = *(ULONG *)lpBuffer; + FIXME("INTERNET_OPTION_CONNECT_RETRIES %d\n", retries); break; + } case INTERNET_OPTION_CONTEXT_VALUE: FIXME("Option INTERNET_OPTION_CONTEXT_VALUE; STUB\n"); break; case INTERNET_OPTION_SECURITY_FLAGS: FIXME("Option INTERNET_OPTION_SECURITY_FLAGS; STUB\n"); + break; + case INTERNET_OPTION_DISABLE_AUTODIAL: + FIXME("Option INTERNET_OPTION_DISABLE_AUTODIAL; STUB\n"); break; case 86: FIXME("86\n"); @@ -2638,7 +2661,7 @@ URL_COMPONENTSW components; ZeroMemory(&components,sizeof(URL_COMPONENTSW)); - components.lpszHostName = (LPWSTR)&hostW; + components.lpszHostName = (LPWSTR)hostW; components.dwHostNameLength = 1024; if (!InternetCrackUrlW(lpszUrl,0,0,&components)) @@ -3353,7 +3376,7 @@ index = scheme - INTERNET_SCHEME_FIRST; if (index >= sizeof(url_schemes)/sizeof(url_schemes[0])) return NULL; - return (LPCWSTR)&url_schemes[index]; + return (LPCWSTR)url_schemes[index]; } /* we can calculate using ansi strings because we're just Modified: trunk/reactos/dll/win32/wininet/internet.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/internet…
============================================================================== --- trunk/reactos/dll/win32/wininet/internet.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/internet.h [iso-8859-1] Thu Sep 4 13:37:34 2008 @@ -41,18 +41,6 @@ # include <sys/types.h> # include <netinet/in.h> #endif -#ifdef HAVE_OPENSSL_SSL_H -#define DSA __ssl_DSA /* avoid conflict with commctrl.h */ -#undef FAR -/* avoid conflict with wincrypt.h */ -#undef PKCS7_SIGNER_INFO -#undef X509_NAME -#undef X509_CERT_PAIR -# include <openssl/ssl.h> -#undef FAR -#define FAR do_not_use_this_in_wine -#undef DSA -#endif #ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> #endif @@ -72,12 +60,10 @@ { BOOL useSSL; int socketFD; -#ifdef HAVE_OPENSSL_SSL_H - SSL *ssl_s; + void *ssl_s; char *peek_msg; char *peek_msg_mem; size_t peek_len; -#endif } WININET_NETCONNECTION; static inline LPWSTR WININET_strdupW( LPCWSTR str ) @@ -364,6 +350,8 @@ BOOL WININET_Release( LPWININETHANDLEHEADER info ); BOOL WININET_FreeHandle( HINTERNET hinternet ); +DWORD INET_QueryOption(DWORD,void*,DWORD*,BOOL); + time_t ConvertTimeString(LPCWSTR asctime); HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, Modified: trunk/reactos/dll/win32/wininet/netconnection.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/netconne…
============================================================================== --- trunk/reactos/dll/win32/wininet/netconnection.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/netconnection.c [iso-8859-1] Thu Sep 4 13:37:34 2008 @@ -23,6 +23,7 @@ #include "config.h" #include "wine/port.h" +#include <sys/types.h> #ifdef HAVE_POLL_H #include <poll.h> #endif @@ -42,6 +43,22 @@ #ifdef HAVE_SYS_IOCTL_H # include <sys/ioctl.h> #endif +#include <time.h> +#ifdef HAVE_NETDB_H +# include <netdb.h> +#endif +#ifdef HAVE_NETINET_IN_H +# include <netinet/in.h> +#endif +#ifdef HAVE_OPENSSL_SSL_H +# include <openssl/ssl.h> +#undef FAR +#undef DSA +#endif +#ifdef HAVE_SYS_SOCKET_H +# include <sys/socket.h> +#endif + #include <stdarg.h> #include <stdlib.h> #include <string.h> Modified: trunk/reactos/dll/win32/wininet/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/rsrc.rc?…
============================================================================== --- trunk/reactos/dll/win32/wininet/rsrc.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/rsrc.rc [iso-8859-1] Thu Sep 4 13:37:34 2008 @@ -57,6 +57,7 @@ #include "wininet_No.rc" #include "wininet_Pl.rc" #include "wininet_Pt.rc" +#include "wininet_Ro.rc" #include "wininet_Ru.rc" #include "wininet_Si.rc" #include "wininet_Sv.rc" Modified: trunk/reactos/dll/win32/wininet/urlcache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/urlcache…
============================================================================== --- trunk/reactos/dll/win32/wininet/urlcache.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/urlcache.c [iso-8859-1] Thu Sep 4 13:37:34 2008 @@ -2339,7 +2339,7 @@ /* skip container path prefix */ lpszLocalFileName += lstrlenW(pContainer->path); - WideCharToMultiByte(CP_ACP, 0, lpszLocalFileName, -1, achFile, -1, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, lpszLocalFileName, -1, achFile, MAX_PATH, NULL, NULL); pchLocalFileName = achFile; for (cDirectory = 0; cDirectory < pHeader->DirectoryCount; cDirectory++) Modified: trunk/reactos/dll/win32/wininet/utility.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/utility.…
============================================================================== --- trunk/reactos/dll/win32/wininet/utility.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/utility.c [iso-8859-1] Thu Sep 4 13:37:34 2008 @@ -39,6 +39,16 @@ #include "internet.h" WINE_DEFAULT_DEBUG_CHANNEL(wininet); + +/* critical section to protect non-reentrant gethostbyname() */ +static CRITICAL_SECTION cs_gethostbyname; +static CRITICAL_SECTION_DEBUG critsect_debug = +{ + 0, 0, &cs_gethostbyname, + { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": cs_gethostbyname") } +}; +static CRITICAL_SECTION cs_gethostbyname = { &critsect_debug, -1, 0, 0, 0, 0 }; #define TIME_STRING_LEN 30 @@ -151,12 +161,15 @@ name = HeapAlloc(GetProcessHeap(), 0, sz+1); WideCharToMultiByte( CP_UNIXCP, 0, lpszServerName, len, name, sz, NULL, NULL ); name[sz] = 0; + + EnterCriticalSection( &cs_gethostbyname ); phe = gethostbyname(name); HeapFree( GetProcessHeap(), 0, name ); if (NULL == phe) { TRACE("Failed to get hostname: (%s)\n", debugstr_w(lpszServerName) ); + LeaveCriticalSection( &cs_gethostbyname ); return FALSE; } @@ -165,6 +178,7 @@ psa->sin_family = phe->h_addrtype; psa->sin_port = htons(nServerPort); + LeaveCriticalSection( &cs_gethostbyname ); return TRUE; } Added: trunk/reactos/dll/win32/wininet/wininet_Ro.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/wininet_…
============================================================================== --- trunk/reactos/dll/win32/wininet/wininet_Ro.rc (added) +++ trunk/reactos/dll/win32/wininet/wininet_Ro.rc [iso-8859-1] Thu Sep 4 13:37:34 2008 @@ -1,0 +1,49 @@ +/* + * Copyright 2003 Mike McCormack for CodeWeavers + * Copyright 2008 Michael Stefaniuc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL + +#pragma code_page(65001) + +IDD_PROXYDLG DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 250, 154 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Introducere parolÄ de reÈea" +FONT 8, "MS Shell Dlg" +{ + LTEXT "IntroduceÈi numele de utilizator Èi parola:", -1, 40, 6, 150, 15 + LTEXT "Proxy", -1, 40, 26, 50, 10 + LTEXT "Realm", -1, 40, 46, 50, 10 + LTEXT "Utilizator", -1, 40, 66, 50, 10 + LTEXT "ParolÄ", -1, 40, 86, 50, 10 + LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 + LTEXT "" IDC_REALM, 80, 46, 150, 14, 0 + EDITTEXT IDC_USERNAME, 80, 66, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP + EDITTEXT IDC_PASSWORD, 80, 86, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP | ES_PASSWORD + CHECKBOX "&SalveazÄ aceastÄ parolÄ (nesigur)", IDC_SAVEPASSWORD, + 80, 106, 150, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON "OK", IDOK, 98, 126, 56, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON + PUSHBUTTON "RenunÈÄ", IDCANCEL, 158, 126, 56, 14, WS_GROUP | WS_TABSTOP +} + +STRINGTABLE DISCARDABLE +{ + IDS_LANCONNECTION "Conexiune LAN" +} + +#pragma code_page(default) Propchange: trunk/reactos/dll/win32/wininet/wininet_Ro.rc ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/dll/win32/wininet/wininet_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/wininet_…
============================================================================== --- trunk/reactos/dll/win32/wininet/wininet_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/wininet_ros.diff [iso-8859-1] Thu Sep 4 13:37:34 2008 @@ -9,28 +9,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wininet); static const WCHAR g_szHttp1_0[] = {'H','T','T','P','/','1','.','0',0}; -@@ -1617,8 +1619,9 @@ - - if(req->lpszCacheFile) { - BOOL res; -+ DWORD dwBytesWritten; - -- res = WriteFile(req->hCacheFile, buffer, bytes_read, NULL, NULL); -+ res = WriteFile(req->hCacheFile, buffer, bytes_read, &dwBytesWritten, NULL); - if(!res) - WARN("WriteFile failed: %u\n", GetLastError()); - } -@@ -1686,7 +1689,9 @@ - - if (req->lpszCacheFile) - { -- if (!WriteFile(req->hCacheFile, p, bytes_read, NULL, NULL)) -+ DWORD dwBytesWritten; -+ -+ if (!WriteFile(req->hCacheFile, p, bytes_read, &dwBytesWritten, NULL)) - WARN("WriteFile failed: %u\n", GetLastError()); - } - p += bytes_read; --- D:/Wine-CVS/wine/dlls/wininet/internet.c Wed May 28 14:33:28 2008 +++ D:/ReactOS-Trunk/reactos/dll/win32/wininet/internet.c Fri May 30 18:04:29 2008 @@ -3101,19 +3101,22 @@
16 years, 3 months
1
0
0
0
[tkreuzer] 35942: Make apic.c compile on amd64 build.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Thu Sep 4 12:43:00 2008 New Revision: 35942 URL:
http://svn.reactos.org/svn/reactos?rev=35942&view=rev
Log: Make apic.c compile on amd64 build. Modified: branches/ros-amd64-bringup/reactos/hal/halx86/mp/apic.c Modified: branches/ros-amd64-bringup/reactos/hal/halx86/mp/apic.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/h…
============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/mp/apic.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/mp/apic.c [iso-8859-1] Thu Sep 4 12:43:00 2008 @@ -228,7 +228,7 @@ { PULONG p; - p = (PULONG)((ULONG)APICBase + Offset); + p = (PULONG)((ULONG_PTR)APICBase + Offset); return *p; } @@ -238,7 +238,7 @@ { PULONG p; - p = (PULONG)((ULONG)APICBase + Offset); + p = (PULONG)((ULONG_PTR)APICBase + Offset); *p = Value; } @@ -252,7 +252,7 @@ lastregw[CPU] = Offset; lastvalw[CPU] = Value; - p = (PULONG)((ULONG)APICBase + Offset); + p = (PULONG)((ULONG_PTR)APICBase + Offset); *p = Value; } @@ -264,7 +264,7 @@ { PULONG p; - p = (PULONG)((ULONG)APICBase + Offset); + p = (PULONG)((ULONG_PTR)APICBase + Offset); return *p; } #else @@ -276,7 +276,7 @@ lastregr[CPU] = Offset; lastvalr[CPU] = 0; - p = (PULONG)((ULONG)APICBase + Offset); + p = (PULONG)((ULONG_PTR)APICBase + Offset); lastvalr[CPU] = *p; return lastvalr[CPU]; @@ -775,6 +775,9 @@ MpsIRQTrapFrameToTrapFrame(PKIRQ_TRAPFRAME IrqTrapFrame, PKTRAP_FRAME TrapFrame) { +#ifdef _M_AMD64 + UNIMPLEMENTED; +#else TrapFrame->SegGs = (USHORT)IrqTrapFrame->Gs; TrapFrame->SegFs = (USHORT)IrqTrapFrame->Fs; TrapFrame->SegEs = (USHORT)IrqTrapFrame->Es; @@ -790,6 +793,7 @@ TrapFrame->Eip = IrqTrapFrame->Eip; TrapFrame->SegCs = IrqTrapFrame->Cs; TrapFrame->EFlags = IrqTrapFrame->Eflags; +#endif } VOID @@ -864,7 +868,7 @@ APICSetupLVTT(1000000000); - TSCPresent = ((PKIPCR)KeGetPcr())->PrcbData.FeatureBits & KF_RDTSC ? TRUE : FALSE; + TSCPresent = KeGetCurrentPrcb()->FeatureBits & KF_RDTSC ? TRUE : FALSE; /* * The timer chip counts down to zero. Let's wait @@ -893,7 +897,7 @@ DPRINT("CPU clock speed is %ld.%04ld MHz.\n", CPUMap[CPU].CoreSpeed/1000000, CPUMap[CPU].CoreSpeed%1000000); - ((PKIPCR)KeGetPcr())->PrcbData.MHz = CPUMap[CPU].CoreSpeed/1000000; + KeGetCurrentPrcb()->MHz = CPUMap[CPU].CoreSpeed/1000000; } CPUMap[CPU].BusSpeed = (HZ * (long)(tt1 - tt2) * APIC_DIVISOR); @@ -909,8 +913,11 @@ } VOID -SetInterruptGate(ULONG index, ULONG address) -{ +SetInterruptGate(ULONG index, ULONG_PTR address) +{ +#ifdef _M_AMD64 +UNIMPLEMENTED; +#else KIDTENTRY *idt; KIDT_ACCESS Access; @@ -926,6 +933,7 @@ idt->Selector = KGDT_R0_CODE; idt->Access = Access.Value; idt->ExtendedOffset = address >> 16; +#endif } VOID HaliInitBSP(VOID) @@ -946,11 +954,11 @@ BSPInitialized = TRUE; /* Setup interrupt handlers */ - SetInterruptGate(LOCAL_TIMER_VECTOR, (ULONG)MpsTimerInterrupt); - SetInterruptGate(ERROR_VECTOR, (ULONG)MpsErrorInterrupt); - SetInterruptGate(SPURIOUS_VECTOR, (ULONG)MpsSpuriousInterrupt); + SetInterruptGate(LOCAL_TIMER_VECTOR, (ULONG_PTR)MpsTimerInterrupt); + SetInterruptGate(ERROR_VECTOR, (ULONG_PTR)MpsErrorInterrupt); + SetInterruptGate(SPURIOUS_VECTOR, (ULONG_PTR)MpsSpuriousInterrupt); #ifdef CONFIG_SMP - SetInterruptGate(IPI_VECTOR, (ULONG)MpsIpiInterrupt); + SetInterruptGate(IPI_VECTOR, (ULONG_PTR)MpsIpiInterrupt); #endif DPRINT("APIC is mapped at 0x%X\n", APICBase);
16 years, 3 months
1
0
0
0
[gedmurphy] 35941: missed this, it's not needed.
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Thu Sep 4 10:55:46 2008 New Revision: 35941 URL:
http://svn.reactos.org/svn/reactos?rev=35941&view=rev
Log: missed this, it's not needed. Modified: trunk/reactos/dll/cpl/timedate/clock.c Modified: trunk/reactos/dll/cpl/timedate/clock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/timedate/clock.c?r…
============================================================================== --- trunk/reactos/dll/cpl/timedate/clock.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/timedate/clock.c [iso-8859-1] Thu Sep 4 10:55:46 2008 @@ -244,8 +244,6 @@ case CLM_STARTCLOCK: if (!pClockData->bTimer) { - InvalidateRect(hwnd, NULL, FALSE); - SetTimer(hwnd, ID_TIMER, 1000, NULL); pClockData->bTimer = TRUE; }
16 years, 3 months
1
0
0
0
[gedmurphy] 35940: restart the clock when it's been stopped to be altered
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Thu Sep 4 10:51:11 2008 New Revision: 35940 URL:
http://svn.reactos.org/svn/reactos?rev=35940&view=rev
Log: restart the clock when it's been stopped to be altered Modified: trunk/reactos/dll/cpl/timedate/clock.c trunk/reactos/dll/cpl/timedate/dateandtime.c trunk/reactos/dll/cpl/timedate/timedate.h Modified: trunk/reactos/dll/cpl/timedate/clock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/timedate/clock.c?r…
============================================================================== --- trunk/reactos/dll/cpl/timedate/clock.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/timedate/clock.c [iso-8859-1] Thu Sep 4 10:51:11 2008 @@ -158,7 +158,7 @@ case WM_TIMER: GetLocalTime(&pClockData->stCurrent); - InvalidateRect(hwnd, NULL, TRUE); + InvalidateRect(hwnd, NULL, FALSE); pClockData->stPrevious = pClockData->stCurrent; break; @@ -233,19 +233,22 @@ HeapFree(GetProcessHeap(), 0, pClockData); break; - case CLM_SETTIME: - /* Stop the timer if it is still running */ + case CLM_STOPCLOCK: if (pClockData->bTimer) { KillTimer(hwnd, ID_TIMER); pClockData->bTimer = FALSE; } - - /* Set the current time */ - CopyMemory(&pClockData->stPrevious, (LPSYSTEMTIME)lParam, sizeof(SYSTEMTIME)); - - /* Redraw the clock */ - InvalidateRect(hwnd, NULL, TRUE); + break; + + case CLM_STARTCLOCK: + if (!pClockData->bTimer) + { + InvalidateRect(hwnd, NULL, FALSE); + + SetTimer(hwnd, ID_TIMER, 1000, NULL); + pClockData->bTimer = TRUE; + } break; default: Modified: trunk/reactos/dll/cpl/timedate/dateandtime.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/timedate/dateandti…
============================================================================== --- trunk/reactos/dll/cpl/timedate/dateandtime.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/timedate/dateandtime.c [iso-8859-1] Thu Sep 4 10:51:11 2008 @@ -347,8 +347,8 @@ KillTimer(hwndDlg, ID_TIMER); /* Tell the clock to stop ticking */ - SendDlgItemMessageW(hwndDlg, IDC_CLOCKWND, CLM_SETTIME, - 0, (LPARAM)&((LPNMDATETIMECHANGE)lpnm)->st); + SendDlgItemMessageW(hwndDlg, IDC_CLOCKWND, CLM_STOPCLOCK, + 0, 0); /* Enable the 'Apply' button */ PropSheet_Changed(GetParent(hwndDlg), hwndDlg); @@ -381,6 +381,10 @@ case PSN_APPLY: SetLocalSystemTime(hwndDlg); SetTimer(hwndDlg, ID_TIMER, 1000, NULL); + + /* Tell the clock to start ticking */ + SendDlgItemMessageW(hwndDlg, IDC_CLOCKWND, CLM_STARTCLOCK, + 0, 0); return TRUE; } break; Modified: trunk/reactos/dll/cpl/timedate/timedate.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/timedate/timedate.…
============================================================================== --- trunk/reactos/dll/cpl/timedate/timedate.h [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/timedate/timedate.h [iso-8859-1] Thu Sep 4 10:51:11 2008 @@ -51,7 +51,8 @@ /* clock.c */ -#define CLM_SETTIME (WM_USER + 1) +#define CLM_STOPCLOCK (WM_USER + 1) +#define CLM_STARTCLOCK (WM_USER + 2) BOOL RegisterClockControl(VOID); VOID UnregisterClockControl(VOID);
16 years, 3 months
1
0
0
0
[cwittich] 35939: work around a bug in ReactOS (FindFirstFile isn't working with environment vars)
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Sep 4 10:28:40 2008 New Revision: 35939 URL:
http://svn.reactos.org/svn/reactos?rev=35939&view=rev
Log: work around a bug in ReactOS (FindFirstFile isn't working with environment vars) Modified: trunk/reactos/dll/win32/syssetup/wizard.c Modified: trunk/reactos/dll/win32/syssetup/wizard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/wizard.…
============================================================================== --- trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] Thu Sep 4 10:28:40 2008 @@ -2221,7 +2221,7 @@ /* winetests */ - hFind = FindFirstFileA("%windir%\\bin\\*.exe", &ffd); + hFind = FindFirstFileA("c:\\reactos\\bin\\*.exe", &ffd); /* %windir% isn't working on ros */ if (hFind != INVALID_HANDLE_VALUE) { do
16 years, 3 months
1
0
0
0
[dreimer] 35938: Partial revert of my previous commit. Some things were not that well...
by dreimer@svn.reactos.org
Author: dreimer Date: Thu Sep 4 10:24:44 2008 New Revision: 35938 URL:
http://svn.reactos.org/svn/reactos?rev=35938&view=rev
Log: Partial revert of my previous commit. Some things were not that well... Modified: trunk/tools/RosBE/RosBE-Windows/Root/Clean.cmd trunk/tools/RosBE/RosBE-Windows/Root/charch.cmd trunk/tools/RosBE/RosBE-Windows/Root/chdefdir.cmd trunk/tools/RosBE/RosBE-Windows/Root/chdefgcc.cmd trunk/tools/RosBE/RosBE-Windows/Root/reladdr2line.cmd Modified: trunk/tools/RosBE/RosBE-Windows/Root/Clean.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/Cle…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/Clean.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/Clean.cmd [iso-8859-1] Thu Sep 4 10:24:44 2008 @@ -44,7 +44,7 @@ ) else ( echo ERROR: There are no logs to clean. ) -goto :EOC +goto :EOF :DEL @@ -174,6 +174,8 @@ rd /s /q "reactos" 1> NUL 2> NUL ) +goto :EOF + :EOC if defined _ROSBE_VERSION ( title ReactOS Build Environment %_ROSBE_VERSION% Modified: trunk/tools/RosBE/RosBE-Windows/Root/charch.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/cha…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/charch.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/charch.cmd [iso-8859-1] Thu Sep 4 10:24:44 2008 @@ -60,6 +60,7 @@ echo ERROR: You must enter a Architecture. goto :EOC ) +goto :EOF :EOC if defined _ROSBE_VERSION ( Modified: trunk/tools/RosBE/RosBE-Windows/Root/chdefdir.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/chd…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/chdefdir.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/chdefdir.cmd [iso-8859-1] Thu Sep 4 10:24:44 2008 @@ -45,6 +45,7 @@ echo ERROR: You must enter a ReactOS source directory, or 'previous'. goto :EOC ) +goto :EOF :EOC if defined _ROSBE_VERSION ( Modified: trunk/tools/RosBE/RosBE-Windows/Root/chdefgcc.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/chd…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/chdefgcc.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/chdefgcc.cmd [iso-8859-1] Thu Sep 4 10:24:44 2008 @@ -48,6 +48,7 @@ echo ERROR: You must enter a MinGW/GCC directory. goto :EOC ) +goto :EOF :EOC if defined _ROSBE_VERSION ( Modified: trunk/tools/RosBE/RosBE-Windows/Root/reladdr2line.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/rel…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/reladdr2line.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/reladdr2line.cmd [iso-8859-1] Thu Sep 4 10:24:44 2008 @@ -69,7 +69,7 @@ if "%_2%" == "" ( set /p _2="Please enter the address you would like to analyze: " ) -goto :EOC +goto :EOF :: :: Check if the user supplied a path, if they didn't look for @@ -81,7 +81,7 @@ if errorlevel 2 ( for /f "usebackq" %%i in (`"dir /a:-d /s /b %_1% 2>NUL | findstr "%_1%""`) do set _1=%%i ) -goto :EOC +goto :EOF :EOC if defined _ROSBE_VERSION (
16 years, 3 months
1
0
0
0
[gedmurphy] 35937: Please test your code before you ruin mine. It's annoying fixing other peoples mess in your own code. See issue #3701 for more details.
by gedmurphy@svn.reactos.org
Author: gedmurphy Date: Thu Sep 4 10:13:07 2008 New Revision: 35937 URL:
http://svn.reactos.org/svn/reactos?rev=35937&view=rev
Log: Please test your code before you ruin mine. It's annoying fixing other peoples mess in your own code. See issue #3701 for more details. Modified: trunk/reactos/dll/cpl/timedate/clock.c Modified: trunk/reactos/dll/cpl/timedate/clock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/timedate/clock.c?r…
============================================================================== --- trunk/reactos/dll/cpl/timedate/clock.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/timedate/clock.c [iso-8859-1] Thu Sep 4 10:13:07 2008 @@ -26,16 +26,6 @@ #define TWOPI (2 * 3.14159) static const WCHAR szClockWndClass[] = L"ClockWndClass"; - - -static VOID -SetIsotropic(HDC hdc, PCLOCKDATA pClockData) -{ - /* set isotropic mode */ - SetMapMode(hdc, MM_ISOTROPIC); - /* position axis in centre of window */ - SetViewportOrgEx(hdc, pClockData->cxClient / 2, pClockData->cyClient / 2, NULL); -} static VOID @@ -141,8 +131,7 @@ LPARAM lParam) { PCLOCKDATA pClockData; - HDC hdc, dcMem; - HBITMAP bmMem, bmOld; + HDC hdc, hdcMem; PAINTSTRUCT ps; pClockData = (PCLOCKDATA)GetWindowLongPtrW(hwnd, GWLP_USERDATA); @@ -169,38 +158,68 @@ case WM_TIMER: GetLocalTime(&pClockData->stCurrent); - //InvalidateRect(hwnd, NULL, TRUE); - InvalidateRect(hwnd, NULL, FALSE); + InvalidateRect(hwnd, NULL, TRUE); pClockData->stPrevious = pClockData->stCurrent; break; case WM_PAINT: hdc = BeginPaint(hwnd, &ps); - /* Use an offscreen dc to avoid flicker */ - - dcMem = CreateCompatibleDC(hdc); - bmMem = CreateCompatibleBitmap(hdc, ps.rcPaint.right - ps.rcPaint.left, ps.rcPaint.bottom - ps.rcPaint.top); - - bmOld = SelectObject(dcMem, bmMem); - SetViewportOrgEx(dcMem, -ps.rcPaint.left, -ps.rcPaint.top, NULL); - FillRect(dcMem, &ps.rcPaint, GetSysColorBrush(COLOR_BTNFACE)); - - SetIsotropic(dcMem, pClockData); - DrawClock(dcMem, pClockData); - DrawHands(dcMem, &pClockData->stPrevious, TRUE); - - /* Blit the changes to the screen */ - BitBlt(hdc, - ps.rcPaint.left, ps.rcPaint.top, - ps.rcPaint.right - ps.rcPaint.left, ps.rcPaint.bottom - ps.rcPaint.top, - dcMem, - ps.rcPaint.left, ps.rcPaint.top, - SRCCOPY); - - SelectObject(dcMem, bmOld); - DeleteObject(bmMem); - DeleteObject(dcMem); + hdcMem = CreateCompatibleDC(hdc); + if (hdcMem) + { + HBITMAP hBmp, hBmpOld; + + hBmp = CreateCompatibleBitmap(hdc, + pClockData->cxClient, + pClockData->cyClient); + if (hBmp) + { + HBRUSH hWinBrush, hWinBrushOld; + INT oldMap; + POINT oldOrg; + + hBmpOld = SelectObject(hdcMem, hBmp); + + hWinBrush = GetSysColorBrush(COLOR_BTNFACE); + hWinBrushOld = SelectObject(hdcMem, hWinBrush); + PatBlt(hdcMem, + 0, + 0, + pClockData->cxClient, + pClockData->cyClient, + PATCOPY); + + oldMap = SetMapMode(hdcMem, MM_ISOTROPIC); + SetViewportOrgEx(hdcMem, + pClockData->cxClient / 2, + pClockData->cyClient / 2, + &oldOrg); + + DrawClock(hdcMem, pClockData); + DrawHands(hdcMem, &pClockData->stPrevious, TRUE); + + SetMapMode(hdcMem, oldMap); + SetViewportOrgEx(hdcMem, oldOrg.x, oldOrg.y, NULL); + + BitBlt(hdc, + 0, + 0, + pClockData->cxClient, + pClockData->cyClient, + hdcMem, + 0, + 0, + SRCCOPY); + + SelectObject(hdcMem, hWinBrushOld); + SelectObject(hdcMem, hBmpOld); + DeleteObject(hBmp); + } + + DeleteDC(hdcMem); + } + EndPaint(hwnd, &ps); break; @@ -226,7 +245,7 @@ CopyMemory(&pClockData->stPrevious, (LPSYSTEMTIME)lParam, sizeof(SYSTEMTIME)); /* Redraw the clock */ - InvalidateRect(hwnd, NULL, FALSE); + InvalidateRect(hwnd, NULL, TRUE); break; default:
16 years, 3 months
1
0
0
0
[cwittich] 35936: run all winetests
by cwittich@svn.reactos.org
Author: cwittich Date: Thu Sep 4 10:11:49 2008 New Revision: 35936 URL:
http://svn.reactos.org/svn/reactos?rev=35936&view=rev
Log: run all winetests Modified: trunk/reactos/dll/win32/syssetup/wizard.c Modified: trunk/reactos/dll/win32/syssetup/wizard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/wizard.…
============================================================================== --- trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] Thu Sep 4 10:11:49 2008 @@ -2192,6 +2192,8 @@ { char szPath[MAX_PATH]; FILE * file; + WIN32_FIND_DATAA ffd; + HANDLE hFind = INVALID_HANDLE_VALUE; #if 0 if (!SHGetSpecialFolderPathA(0, szPath, CSIDL_DESKTOP, FALSE)) { @@ -2217,7 +2219,20 @@ (const BYTE*)szPath, strlen(szPath) * sizeof(char)); - fprintf(file, "%s\n", "dbgprint --winetest %windir%\\bin\\version_winetest.exe"); + + /* winetests */ + hFind = FindFirstFileA("%windir%\\bin\\*.exe", &ffd); + if (hFind != INVALID_HANDLE_VALUE) + { + do + { + if (ffd.dwFileAttributes & ~FILE_ATTRIBUTE_DIRECTORY) + fprintf(file, "%s%s\n", "dbgprint --winetest %windir%\\bin\\", ffd.cFileName); + } + while (FindNextFileA(hFind, &ffd) != 0); + FindClose(hFind); + } + fprintf(file, "%s\n", "dbgprint SYSREG_CHECKPOINT:THIRDBOOT_COMPLETE"); fprintf(file, "%s\n", "shutdown -s"); fclose(file);
16 years, 3 months
1
0
0
0
[dreimer] 35935: Various small fixes.
by dreimer@svn.reactos.org
Author: dreimer Date: Thu Sep 4 08:16:52 2008 New Revision: 35935 URL:
http://svn.reactos.org/svn/reactos?rev=35935&view=rev
Log: Various small fixes. Modified: trunk/tools/RosBE/RosBE-Windows/Root/Build.cmd trunk/tools/RosBE/RosBE-Windows/Root/Clean.cmd trunk/tools/RosBE/RosBE-Windows/Root/MinGW.cmd trunk/tools/RosBE/RosBE-Windows/Root/RosBE.cmd trunk/tools/RosBE/RosBE-Windows/Root/charch.cmd trunk/tools/RosBE/RosBE-Windows/Root/chdefdir.cmd trunk/tools/RosBE/RosBE-Windows/Root/chdefgcc.cmd trunk/tools/RosBE/RosBE-Windows/Root/reladdr2line.cmd trunk/tools/RosBE/RosBE-Windows/Root/rosbe-gcc-env.cmd trunk/tools/RosBE/RosBE-Windows/Root/scut.cmd Modified: trunk/tools/RosBE/RosBE-Windows/Root/Build.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/Bui…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/Build.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/Build.cmd [iso-8859-1] Thu Sep 4 08:16:52 2008 @@ -34,7 +34,7 @@ endlocal :: -:: Check if strip or ccache are being used and set the appropriate options. +:: Check if strip, no Debug Symbols or ccache are being used and set the appropriate options. :: if .%_ROSBE_NOSTRIP%. == .1. ( set ROS_BUILDNOSTRIP=yes @@ -48,6 +48,7 @@ set ROS_LEAN_AND_MEAN=no ) +:: Small Security Check to prevent useless apps. if .%ROS_LEAN_AND_MEAN%. == .yes. ( if .%ROS_BUILDNOSTRIP%. == .yes. ( cls Modified: trunk/tools/RosBE/RosBE-Windows/Root/Clean.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/Cle…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/Clean.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/Clean.cmd [iso-8859-1] Thu Sep 4 08:16:52 2008 @@ -44,7 +44,7 @@ ) else ( echo ERROR: There are no logs to clean. ) -goto :EOF +goto :EOC :DEL @@ -70,6 +70,7 @@ ) else ( echo ERROR: There is no compiler output to clean. ) + goto :ROS ) if .%ROS_ARCH%. == .i386. ( :: @@ -93,6 +94,7 @@ ) else ( echo ERROR: There is no compiler output to clean. ) + goto :ROS ) if .%ROS_ARCH%. == .ppc. ( :: @@ -116,6 +118,7 @@ ) else ( echo ERROR: There is no compiler output to clean. ) + goto :ROS ) if .%ROS_ARCH%. == .amd64. ( :: @@ -139,6 +142,7 @@ ) else ( echo ERROR: There is no compiler output to clean. ) + goto :ROS ) if .%ROS_ARCH%. == .. ( :: @@ -162,13 +166,13 @@ ) else ( echo ERROR: There is no compiler output to clean. ) + goto :ROS ) +:ROS if exist "reactos\." ( rd /s /q "reactos" 1> NUL 2> NUL ) - -goto :EOF :EOC if defined _ROSBE_VERSION ( Modified: trunk/tools/RosBE/RosBE-Windows/Root/MinGW.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/Min…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/MinGW.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/MinGW.cmd [iso-8859-1] Thu Sep 4 08:16:52 2008 @@ -16,7 +16,7 @@ if not "%1" == "" ( cls echo Unknown parameter specified. Exiting. - goto :EOC + goto :EOF ) color 0A @@ -46,5 +46,3 @@ doskey /macrofile="%_ROSBE_BASEDIR%\MinGW.mac" if not exist "%_ROSBE_BASEDIR%\scut.cmd" ( doskey SCUT= ) - -:EOC Modified: trunk/tools/RosBE/RosBE-Windows/Root/RosBE.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/Ros…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/RosBE.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/RosBE.cmd [iso-8859-1] Thu Sep 4 08:16:52 2008 @@ -31,6 +31,7 @@ set _ROSBE_WRITELOG=1 set _ROSBE_USECCACHE=0 set _ROSBE_STRIP=0 +set _ROSBE_NOSTRIP=0 set _ROSBE_MINGWPATH=%_ROSBE_BASEDIR%\4.1.3 set _ROSBE_LOGDIR=%CD%\RosBE-Logs set _ROSBE_OBJPATH= @@ -64,16 +65,19 @@ goto :EndCommandParse ) if /i "%1" == "arm" ( + cls set _ROSBE_ARCH=1 call :RosBE4 goto :EndCommandParse ) if /i "%1" == "ppc" ( + cls set _ROSBE_ARCH=2 call :RosBE4 goto :EndCommandParse ) if /i "%1" == "amd64" ( + cls set _ROSBE_ARCH=3 call :RosBE4 goto :EndCommandParse @@ -159,5 +163,6 @@ if not exist "%_ROSBE_BASEDIR%\scut.cmd" ( doskey SCUT= ) if not exist "%_ROSBE_BASEDIR%\sSVN.cmd" ( doskey SSVN= ) if not exist "%_ROSBE_BASEDIR%\sSVN.cmd" ( doskey SVN= ) + if not exist "%_ROSBE_BASEDIR%\update.cmd" ( doskey UPDATE= ) if not exist "%_ROSBE_BASEDIR%\options.cmd" ( doskey OPTIONS= ) goto :EOF Modified: trunk/tools/RosBE/RosBE-Windows/Root/charch.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/cha…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/charch.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/charch.cmd [iso-8859-1] Thu Sep 4 08:16:52 2008 @@ -16,7 +16,8 @@ :: :: Parse the command line arguments. :: ROS_ARCH: Set to x86, x64, ppc or arm. -:: ROS_PREFIX: Default is mingw32. ppc could be ppc-pc-mingw32, arm arm-pc-mingw32, x64 x86_64-pc-mingw32. +:: ROS_PREFIX: Default is mingw32. ppc could be ppc-pc-mingw32, +:: arm arm-pc-mingw32, x64 x86_64-pc-mingw32. :: if "%1" == "" ( @@ -59,11 +60,8 @@ echo ERROR: You must enter a Architecture. goto :EOC ) -goto :EOF :EOC -REM chdefgcc %PATH% - if defined _ROSBE_VERSION ( title ReactOS Build Environment %_ROSBE_VERSION% ) Modified: trunk/tools/RosBE/RosBE-Windows/Root/chdefdir.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/chd…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/chdefdir.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/chdefdir.cmd [iso-8859-1] Thu Sep 4 08:16:52 2008 @@ -45,7 +45,6 @@ echo ERROR: You must enter a ReactOS source directory, or 'previous'. goto :EOC ) -goto :EOF :EOC if defined _ROSBE_VERSION ( Modified: trunk/tools/RosBE/RosBE-Windows/Root/chdefgcc.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/chd…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/chdefgcc.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/chdefgcc.cmd [iso-8859-1] Thu Sep 4 08:16:52 2008 @@ -48,7 +48,6 @@ echo ERROR: You must enter a MinGW/GCC directory. goto :EOC ) -goto :EOF :EOC if defined _ROSBE_VERSION ( Modified: trunk/tools/RosBE/RosBE-Windows/Root/reladdr2line.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/rel…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/reladdr2line.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/reladdr2line.cmd [iso-8859-1] Thu Sep 4 08:16:52 2008 @@ -69,7 +69,7 @@ if "%_2%" == "" ( set /p _2="Please enter the address you would like to analyze: " ) -goto :EOF +goto :EOC :: :: Check if the user supplied a path, if they didn't look for @@ -81,7 +81,7 @@ if errorlevel 2 ( for /f "usebackq" %%i in (`"dir /a:-d /s /b %_1% 2>NUL | findstr "%_1%""`) do set _1=%%i ) -goto :EOF +goto :EOC :EOC if defined _ROSBE_VERSION ( Modified: trunk/tools/RosBE/RosBE-Windows/Root/rosbe-gcc-env.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/ros…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/rosbe-gcc-env.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/rosbe-gcc-env.cmd [iso-8859-1] Thu Sep 4 08:16:52 2008 @@ -75,8 +75,12 @@ if exist "%_ROSBE_MINGWPATH%\bin\nasm.exe" ( nasm -v ) else ( - if "%_ROSBE_MODE%" == "RosBE" ( - echo ERROR: NASM is required to build ReactOS, none found in the current MinGW/GCC. + if exist "%_ROSBE_MINGWPATH%\bin\yasm.exe" ( + yasm --version | find "yasm 0" + ) else ( + if "%_ROSBE_MODE%" == "RosBE" ( + echo ERROR: NASM or YASM is required to build ReactOS, none found in the current MinGW/GCC. + ) ) ) if exist "%_ROSBE_MINGWPATH%\bin\bison.exe" ( Modified: trunk/tools/RosBE/RosBE-Windows/Root/scut.cmd URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE/RosBE-Windows/Root/scu…
============================================================================== --- trunk/tools/RosBE/RosBE-Windows/Root/scut.cmd [iso-8859-1] (original) +++ trunk/tools/RosBE/RosBE-Windows/Root/scut.cmd [iso-8859-1] Thu Sep 4 08:16:52 2008 @@ -25,12 +25,12 @@ :: It's a shortcut name, so change the directory for /f "usebackq tokens=*" %%i in (`""%_ROSBE_BASEDIR%\Tools\scut.exe" %*"`) do ( - if /i not "%%i" == "Default" ( - if exist "%%i\." ( - cd /d %%i - set _ROSBE_ROSSOURCEDIR=%%i - ) - ) + if /i not "%%i" == "Default" ( + if exist "%%i\." ( + cd /d %%i + set _ROSBE_ROSSOURCEDIR=%%i + ) + ) ) goto :EOC
16 years, 3 months
1
0
0
0
← Newer
1
...
63
64
65
66
67
68
69
...
75
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Results per page:
10
25
50
100
200