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
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
January 2005
----- 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
28 participants
703 discussions
Start a n
N
ew thread
[gvg] 13004: Add wine_dbgstr_w
by gvg@svn.reactos.com
Add wine_dbgstr_w Modified: trunk/reactos/lib/libwine/debug.c _____ Modified: trunk/reactos/lib/libwine/debug.c --- trunk/reactos/lib/libwine/debug.c 2005-01-12 23:10:02 UTC (rev 13003) +++ trunk/reactos/lib/libwine/debug.c 2005-01-12 23:18:20 UTC (rev 13004) @@ -222,3 +222,8 @@ return buffer; } + +const char *wine_dbgstr_w( const WCHAR *s ) +{ + return wine_dbgstr_wn( s, -1 ); +}
19 years, 10 months
1
0
0
0
[gvg] 13003: Sync to Wine-20050111:
by gvg@svn.reactos.com
Sync to Wine-20050111: Michael Stefaniuc <mstefani(a)redhat.de> - Do not check for non NULL pointer before HeapFree'ing it. It's redundant. Jacek Caban <jack(a)itma.pwr.wroc.pl> - Added test of BindToStorage. - Added some declarations to urlmon.idl. - Implemented CreateAsyncBindCtx. - Added test. Modified: trunk/reactos/lib/urlmon/umon.c _____ Modified: trunk/reactos/lib/urlmon/umon.c --- trunk/reactos/lib/urlmon/umon.c 2005-01-12 23:07:36 UTC (rev 13002) +++ trunk/reactos/lib/urlmon/umon.c 2005-01-12 23:10:02 UTC (rev 13003) @@ -123,9 +123,7 @@ /* destroy the object if there's no more reference on it */ if (ref == 0) { - if (This->URLName!=NULL) - HeapFree(GetProcessHeap(),0,This->URLName); - + HeapFree(GetProcessHeap(),0,This->URLName); HeapFree(GetProcessHeap(),0,This); } @@ -186,8 +184,7 @@ res = IStream_Read(pStm, &len, sizeof(ULONG), &got); if(SUCCEEDED(res)) { if(got == sizeof(ULONG)) { - if(This->URLName) - HeapFree(GetProcessHeap(), 0, This->URLName); + HeapFree(GetProcessHeap(), 0, This->URLName); This->URLName=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(len+1)); if(!This->URLName) res = E_OUTOFMEMORY; @@ -324,6 +321,7 @@ IBindStatusCallback *pbscb; BINDINFO bi; DWORD bindf; + IStream *pstr; FIXME("(%p)->(%p,%p,%s,%p): stub\n",This,pbc,pmkToLeft,debugstr_guid(riid),ppvObject); if(pmkToLeft) { @@ -339,32 +337,31 @@ We also need to implement IStream ourselves so that IStream_Read can return E_PENDING */ - hres = CreateStreamOnHGlobal(0, TRUE, (IStream**)ppvObject); + hres = CreateStreamOnHGlobal(0, TRUE, &pstr); - if(SUCCEEDED(hres)) { - TRACE("Created dummy stream...\n"); + TRACE("Created dummy stream...\n"); - hres = IBindCtx_GetObjectParam(pbc, (LPOLESTR)BSCBHolder, (IUnknown**)&pbscb); - if(SUCCEEDED(hres)) { - TRACE("Got IBindStatusCallback...\n"); + hres = IBindCtx_GetObjectParam(pbc, (LPOLESTR)BSCBHolder, (IUnknown**)&pbscb); + if(SUCCEEDED(hres)) { + TRACE("Got IBindStatusCallback...\n"); - memset(&bi, 0, sizeof(bi)); - bi.cbSize = sizeof(bi); - bindf = 0; - hres = IBindStatusCallback_GetBindInfo(pbscb, &bindf, &bi); - if(SUCCEEDED(hres)) { - URL_COMPONENTSW url; - WCHAR *host, *path; - DWORD len, lensz = sizeof(len), total_read = 0; - LARGE_INTEGER last_read_pos; - FORMATETC fmt; - STGMEDIUM stg; + memset(&bi, 0, sizeof(bi)); + bi.cbSize = sizeof(bi); + bindf = 0; + hres = IBindStatusCallback_GetBindInfo(pbscb, &bindf, &bi); + if(SUCCEEDED(hres)) { + URL_COMPONENTSW url; + WCHAR *host, *path; + DWORD len, lensz = sizeof(len), total_read = 0; + LARGE_INTEGER last_read_pos; + FORMATETC fmt; + STGMEDIUM stg; - TRACE("got bindinfo. bindf = %08lx extrainfo = %s bindinfof = %08lx bindverb = %08lx iid %s\n", - bindf, debugstr_w(bi.szExtraInfo), bi.grfBindInfoF, bi.dwBindVerb, debugstr_guid(&bi.iid)); - hres = IBindStatusCallback_OnStartBinding(pbscb, 0, (IBinding*)&This->lpvtbl2); - TRACE("OnStartBinding rets %08lx\n", hres); + TRACE("got bindinfo. bindf = %08lx extrainfo = %s bindinfof = %08lx bindverb = %08lx iid %s\n", + bindf, debugstr_w(bi.szExtraInfo), bi.grfBindInfoF, bi.dwBindVerb, debugstr_guid(&bi.iid)); + hres = IBindStatusCallback_OnStartBinding(pbscb, 0, (IBinding*)&This->lpvtbl2); + TRACE("OnStartBinding rets %08lx\n", hres); #if 0 if(!registered_wndclass) { @@ -377,80 +374,81 @@ URLMON_hInstance, NULL); #endif - memset(&url, 0, sizeof(url)); - url.dwStructSize = sizeof(url); - url.dwSchemeLength = url.dwHostNameLength = url.dwUrlPathLength = 1; - InternetCrackUrlW(This->URLName, 0, 0, &url); - host = HeapAlloc(GetProcessHeap(), 0, (url.dwHostNameLength + 1) * sizeof(WCHAR)); - memcpy(host, url.lpszHostName, url.dwHostNameLength * sizeof(WCHAR)); - host[url.dwHostNameLength] = '\0'; - path = HeapAlloc(GetProcessHeap(), 0, (url.dwUrlPathLength + 1) * sizeof(WCHAR)); - memcpy(path, url.lpszUrlPath, url.dwUrlPathLength * sizeof(WCHAR)); - path[url.dwUrlPathLength] = '\0'; + memset(&url, 0, sizeof(url)); + url.dwStructSize = sizeof(url); + url.dwSchemeLength = url.dwHostNameLength = url.dwUrlPathLength = 1; + InternetCrackUrlW(This->URLName, 0, 0, &url); + host = HeapAlloc(GetProcessHeap(), 0, (url.dwHostNameLength + 1) * sizeof(WCHAR)); + memcpy(host, url.lpszHostName, url.dwHostNameLength * sizeof(WCHAR)); + host[url.dwHostNameLength] = '\0'; + path = HeapAlloc(GetProcessHeap(), 0, (url.dwUrlPathLength + 1) * sizeof(WCHAR)); + memcpy(path, url.lpszUrlPath, url.dwUrlPathLength * sizeof(WCHAR)); + path[url.dwUrlPathLength] = '\0'; - This->hinternet = InternetOpenA("User Agent", 0, NULL, NULL, 0 /*INTERNET_FLAG_ASYNC*/); -/* InternetSetStatusCallback(This->hinternet, URLMON_InternetCallback);*/ + This->hinternet = InternetOpenA("User Agent", 0, NULL, NULL, 0 /*INTERNET_FLAG_ASYNC*/); +/* InternetSetStatusCallback(This->hinternet, URLMON_InternetCallback);*/ - This->hconnect = InternetConnectW(This->hinternet, host, INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, - INTERNET_SERVICE_HTTP, 0, (DWORD)This); - This->hrequest = HttpOpenRequestW(This->hconnect, NULL, path, NULL, NULL, NULL, 0, (DWORD)This); + This->hconnect = InternetConnectW(This->hinternet, host, INTERNET_DEFAULT_HTTP_PORT, NULL, NULL, + INTERNET_SERVICE_HTTP, 0, (DWORD)This); + This->hrequest = HttpOpenRequestW(This->hconnect, NULL, path, NULL, NULL, NULL, 0, (DWORD)This); - hres = IBindStatusCallback_OnProgress(pbscb, 0, 0, 0x22, NULL); - hres = IBindStatusCallback_OnProgress(pbscb, 0, 0, BINDSTATUS_FINDINGRESOURCE, NULL); - hres = IBindStatusCallback_OnProgress(pbscb, 0, 0, BINDSTATUS_CONNECTING, NULL); - hres = IBindStatusCallback_OnProgress(pbscb, 0, 0, BINDSTATUS_SENDINGREQUEST, NULL); - hres = E_OUTOFMEMORY; /* FIXME */ - if(HttpSendRequestW(This->hrequest, NULL, 0, NULL, 0)) { + hres = IBindStatusCallback_OnProgress(pbscb, 0, 0, 0x22, NULL); + hres = IBindStatusCallback_OnProgress(pbscb, 0, 0, BINDSTATUS_FINDINGRESOURCE, NULL); + hres = IBindStatusCallback_OnProgress(pbscb, 0, 0, BINDSTATUS_CONNECTING, NULL); + hres = IBindStatusCallback_OnProgress(pbscb, 0, 0, BINDSTATUS_SENDINGREQUEST, NULL); + hres = E_OUTOFMEMORY; /* FIXME */ + if(HttpSendRequestW(This->hrequest, NULL, 0, NULL, 0)) { + len = 0; + HttpQueryInfoW(This->hrequest, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, &len, &lensz, NULL); - len = 0; - HttpQueryInfoW(This->hrequest, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, &len, &lensz, NULL); + TRACE("res = %ld gle = %08lx url len = %ld\n", hres, GetLastError(), len); - TRACE("res = %ld gle = %08lx url len = %ld\n", hres, GetLastError(), len); + last_read_pos.u.LowPart = last_read_pos.u.HighPart = 0; + fmt.cfFormat = 0; + fmt.ptd = NULL; + fmt.dwAspect = 0; + fmt.lindex = -1; + fmt.tymed = TYMED_ISTREAM; + stg.tymed = TYMED_ISTREAM; + stg.u.pstm = pstr; + stg.pUnkForRelease = NULL; - last_read_pos.u.LowPart = last_read_pos.u.HighPart = 0; - fmt.cfFormat = 0; - fmt.ptd = NULL; - fmt.dwAspect = 0; - fmt.lindex = -1; - fmt.tymed = TYMED_ISTREAM; - stg.tymed = TYMED_ISTREAM; - stg.u.pstm = *(IStream**)ppvObject; - stg.pUnkForRelease = NULL; - - while(1) { - char buf[4096]; - DWORD bufread; - DWORD written; - if(InternetReadFile(This->hrequest, buf, sizeof(buf), &bufread)) { - TRACE("read %ld bytes %s...\n", bufread, debugstr_an(buf, 10)); - if(bufread == 0) break; - IStream_Write(*(IStream**)ppvObject, buf, bufread, &written); - total_read += bufread; - IStream_Seek(*(IStream**)ppvObject, last_read_pos, STREAM_SEEK_SET, NULL); - hres = IBindStatusCallback_OnProgress(pbscb, total_read, len, (total_read == bufread) ? - BINDSTATUS_BEGINDOWNLOADDATA : - BINDSTATUS_DOWNLOADINGDATA, NULL); - hres = IBindStatusCallback_OnDataAvailable(pbscb, - (total_read == bufread) ? BSCF_FIRSTDATANOTIFICATION : - BSCF_INTERMEDIATEDATANOTIFICATION, - total_read, &fmt, &stg); - last_read_pos.u.LowPart += bufread; /* FIXME */ - } else - break; + while(1) { + char buf[4096]; + DWORD bufread; + DWORD written; + if(InternetReadFile(This->hrequest, buf, sizeof(buf), &bufread)) { + TRACE("read %ld bytes %s...\n", bufread, debugstr_an(buf, 10)); + if(bufread == 0) break; + IStream_Write(pstr, buf, bufread, &written); + total_read += bufread; + IStream_Seek(pstr, last_read_pos, STREAM_SEEK_SET, NULL); + hres = IBindStatusCallback_OnProgress(pbscb, total_read, len, (total_read == bufread) ? + BINDSTATUS_BEGINDOWNLOADDATA : + BINDSTATUS_DOWNLOADINGDATA, NULL); + hres = IBindStatusCallback_OnDataAvailable(pbscb, + (total_read == bufread) ? BSCF_FIRSTDATANOTIFICATION : + BSCF_INTERMEDIATEDATANOTIFICATION, + total_read, &fmt, &stg); + last_read_pos.u.LowPart += bufread; /* FIXME */ + } else + break; } - hres = IBindStatusCallback_OnProgress(pbscb, total_read, len, BINDSTATUS_ENDDOWNLOADDATA, NULL); - hres = IBindStatusCallback_OnDataAvailable(pbscb, BSCF_LASTDATANOTIFICATION, total_read, &fmt, &stg); - TRACE("OnDataAvail rets %08lx\n", hres); - hres = IBindStatusCallback_OnStopBinding(pbscb, S_OK, NULL); - TRACE("OnStop rets %08lx\n", hres); - hres = S_OK; - } - InternetCloseHandle(This->hrequest); - InternetCloseHandle(This->hconnect); - InternetCloseHandle(This->hinternet); - } - } + hres = IBindStatusCallback_OnProgress(pbscb, total_read, len, BINDSTATUS_ENDDOWNLOADDATA, NULL); + hres = IBindStatusCallback_OnDataAvailable(pbscb, BSCF_LASTDATANOTIFICATION, total_read, &fmt, &stg); + TRACE("OnDataAvail rets %08lx\n", hres); + hres = IBindStatusCallback_OnStopBinding(pbscb, S_OK, NULL); + TRACE("OnStop rets %08lx\n", hres); + hres = S_OK; + } + InternetCloseHandle(This->hrequest); + InternetCloseHandle(This->hconnect); + InternetCloseHandle(This->hinternet); + IBindStatusCallback_Release(pbscb); + } + } } + *ppvObject = (VOID*)pstr; return hres; } @@ -752,7 +750,7 @@ static HRESULT WINAPI URLMonikerImpl_IBinding_GetBindResult(IBinding* iface, CLSID* pclsidProtocol, DWORD* pdwResult, LPOLESTR* pszResult, DWORD* pdwReserved) { ICOM_THIS_MULTI(URLMonikerImpl, lpvtbl2, iface); - FIXME("(%p)->(%s, %p, %p, %p): stub\n", This, debugstr_guid(pclsidProtocol), pdwResult, pszResult, pdwReserved); + FIXME("(%p)->(%p, %p, %p, %p): stub\n", This, pclsidProtocol, pdwResult, pszResult, pdwReserved); return E_NOTIMPL; } @@ -882,8 +880,36 @@ HRESULT WINAPI CreateAsyncBindCtx(DWORD reserved, IBindStatusCallback *callback, IEnumFORMATETC *format, IBindCtx **pbind) { - FIXME("stub.\n"); - return E_INVALIDARG; + HRESULT hres; + BIND_OPTS bindopts; + IBindCtx *bctx; + + TRACE("(%08lx %p %p %p)\n", reserved, callback, format, pbind); + + if(!callback) + return E_INVALIDARG; + if(format) + FIXME("format is not supported yet\n"); + + hres = CreateBindCtx(0, &bctx); + if(FAILED(hres)) + return hres; + + bindopts.cbStruct = sizeof(BIND_OPTS); + bindopts.grfFlags = BIND_MAYBOTHERUSER; + bindopts.grfMode = STGM_READWRITE | STGM_SHARE_EXCLUSIVE; + bindopts.dwTickCountDeadline = 0; + IBindCtx_SetBindOptions(bctx, &bindopts); + + hres = IBindCtx_RegisterObjectParam(bctx, (LPOLESTR)BSCBHolder, (IUnknown*)callback); + if(FAILED(hres)) { + IBindCtx_Release(bctx); + return hres; + } + + *pbind = bctx; + + return S_OK; } /*********************************************************************** * CreateAsyncBindCtxEx (URLMON.@) @@ -892,7 +918,7 @@ * * FIXME * Not implemented. - */ + */ HRESULT WINAPI CreateAsyncBindCtxEx(IBindCtx *ibind, DWORD options, IBindStatusCallback *callback, IEnumFORMATETC *format, IBindCtx** pbind, DWORD reserved)
19 years, 10 months
1
0
0
0
[gvg] 13002: Sync to Wine-20050111:
by gvg@svn.reactos.com
Sync to Wine-20050111: Eric Pouech <pouech-eric(a)wanadoo.fr> - Another round of const correctness fixes. Modified: trunk/reactos/lib/unicode/utf8.c _____ Modified: trunk/reactos/lib/unicode/utf8.c --- trunk/reactos/lib/unicode/utf8.c 2005-01-12 23:04:52 UTC (rev 13001) +++ trunk/reactos/lib/unicode/utf8.c 2005-01-12 23:07:36 UTC (rev 13002) @@ -145,7 +145,7 @@ unsigned int res; const char *srcend = src + srclen; - if (!dstlen) return get_length_mbs_utf8( src, srclen ); + if (!dstlen) return get_length_mbs_utf8( (const unsigned char*)src, srclen ); for (count = dstlen; count && (src < srcend); count--, dst++) {
19 years, 10 months
1
0
0
0
[gvg] 13001: Sync to Wine-20050111:
by gvg@svn.reactos.com
Sync to Wine-20050111: Michael Stefaniuc <mstefani(a)redhat.de> - Do not check for non NULL pointer before HeapFree'ing it. It's redundant. Hans Leidekker <hans(a)it.vu.nl> - Implement and test URLIS_URL flag in UrlIs(). Jon Griffiths <jon_p_griffiths(a)yahoo.com> - Const correctness fix. - Remove unneeded headers to reduce unneeded rebuilds. - Include shlwapi.h to get prototypes, and correct 2 wrong ones. - Documentation fix. Michael Stefaniuc <mstefani(a)redhat.de> - Missing HeapFree's + 1 LocalFree (found by smatch). Eric Pouech <pouech-eric(a)wanadoo.fr> - Removed excessive statement (break after return or goto, not useful break, not needed vars...) Jacek Caban <jack(a)itma.pwr.wroc.pl> - Get rid of W->A calls. Mike McCormack <mike(a)codeweavers.com> - Use CreateEventW in preference to CreateEventA for unnamed events. Francois Gouget <fgouget(a)free.fr> - Remove unneeded NULL casts. James Hawkins <truiken(a)gmail.com> - use only stored result of Interlocked* in AddRef/Release - expand TRACEs to display the ref count Modified: trunk/reactos/lib/shlwapi/msgbox.c Modified: trunk/reactos/lib/shlwapi/ordinal.c Modified: trunk/reactos/lib/shlwapi/regstream.c Modified: trunk/reactos/lib/shlwapi/stopwatch.c Modified: trunk/reactos/lib/shlwapi/string.c Modified: trunk/reactos/lib/shlwapi/thread.c Modified: trunk/reactos/lib/shlwapi/url.c Modified: trunk/reactos/lib/shlwapi/wsprintf.c _____ Modified: trunk/reactos/lib/shlwapi/msgbox.c --- trunk/reactos/lib/shlwapi/msgbox.c 2005-01-12 22:57:30 UTC (rev 13000) +++ trunk/reactos/lib/shlwapi/msgbox.c 2005-01-12 23:04:52 UTC (rev 13001) @@ -273,8 +273,7 @@ iRetVal = SHMessageBoxCheckW(hWnd, szTextBuff, lpszTitle ? szTitleBuff : NULL, dwType, iRet, szIdBuff); - if (szTextBuff) - HeapFree(GetProcessHeap(), 0, szTextBuff); + HeapFree(GetProcessHeap(), 0, szTextBuff); return iRetVal; } _____ Modified: trunk/reactos/lib/shlwapi/ordinal.c --- trunk/reactos/lib/shlwapi/ordinal.c 2005-01-12 22:57:30 UTC (rev 13000) +++ trunk/reactos/lib/shlwapi/ordinal.c 2005-01-12 23:04:52 UTC (rev 13001) @@ -42,15 +42,12 @@ #include "shlguid.h" #include "wingdi.h" #include "shlobj.h" -#include "olectl.h" #include "shellapi.h" #include "commdlg.h" #include "wine/unicode.h" -#include "servprov.h" #include "winreg.h" #include "wine/debug.h" #include "shlwapi.h" -#include "winnt.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -611,7 +608,7 @@ *buflen, NULL, NULL); *buflen = buflenW ? convlen : 0; - if(langbufW) HeapFree(GetProcessHeap(), 0, langbufW); + HeapFree(GetProcessHeap(), 0, langbufW); return retval; } @@ -621,9 +618,9 @@ * Convert a GUID to a string. * * PARAMS - * guid [I] GUID to convert - * str [O] Destination for string - * cmax [I] Length of output buffer + * guid [I] GUID to convert + * lpszDest [O] Destination for string + * cchMax [I] Length of output buffer * * RETURNS * The length of the string created. @@ -651,15 +648,35 @@ /*********************************************************************** ** * @ [SHLWAPI.24] * - * Unicode version of SHStringFromGUIDA. + * Convert a GUID to a string. + * + * PARAMS + * guid [I] GUID to convert + * str [O] Destination for string + * cmax [I] Length of output buffer + * + * RETURNS + * The length of the string created. */ INT WINAPI SHStringFromGUIDW(REFGUID guid, LPWSTR lpszDest, INT cchMax) { - char xguid[40]; - INT iLen = SHStringFromGUIDA(guid, xguid, cchMax); + WCHAR xguid[40]; + INT iLen; + static const WCHAR wszFormat[] = {'{','%','0','8','l','X','-','%','0','4','X','-','%','0','4','X','-', + '%','0','2','X','%','0','2','X','-','%','0','2','X','%','0','2','X','%', '0','2','X','%','0','2', + 'X','%','0','2','X','%','0','2','X','}',0}; - if (iLen) - MultiByteToWideChar(CP_ACP, 0, xguid, -1, lpszDest, cchMax); + TRACE("(%s,%p,%d)\n", debugstr_guid(guid), lpszDest, cchMax); + + sprintfW(xguid, wszFormat, guid->Data1, guid->Data2, guid->Data3, + guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], + guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); + + iLen = strlenW(xguid) + 1; + + if (iLen > cchMax) + return 0; + memcpy(lpszDest, xguid, iLen*sizeof(WCHAR)); return iLen; } @@ -1940,7 +1957,7 @@ mi.fMask = MIIM_SUBMENU; if (!GetMenuItemInfoA(hMenu, uID, 0, &mi)) - return (HMENU)NULL; + return NULL; return mi.hSubMenu; } @@ -2422,8 +2439,8 @@ wc.cbClsExtra = 0; wc.cbWndExtra = 4; wc.hInstance = shlwapi_hInstance; - wc.hIcon = (HICON)0; - wc.hCursor = LoadCursorA((HINSTANCE)0, (LPSTR)IDC_ARROW); + wc.hIcon = NULL; + wc.hCursor = LoadCursorA(NULL, (LPSTR)IDC_ARROW); wc.hbrBackground = (HBRUSH)COLOR_BTNSHADOW; wc.lpszMenuName = NULL; wc.lpszClassName = szClass; @@ -2709,8 +2726,8 @@ wc.cbClsExtra = 0; wc.cbWndExtra = 4; wc.hInstance = shlwapi_hInstance; - wc.hIcon = (HICON)0; - wc.hCursor = LoadCursorA((HINSTANCE)0, (LPSTR)IDC_ARROW); + wc.hIcon = NULL; + wc.hCursor = LoadCursorW(NULL, (LPWSTR)IDC_ARROW); wc.hbrBackground = (HBRUSH)COLOR_BTNSHADOW; wc.lpszMenuName = NULL; wc.lpszClassName = szClass; @@ -2723,10 +2740,10 @@ hWndParent, hMenu, shlwapi_hInstance, 0); if (hWnd) { - SetWindowLongA(hWnd, DWL_MSGRESULT, z); + SetWindowLongW(hWnd, DWL_MSGRESULT, z); if (wndProc) - SetWindowLongPtrA(hWnd, GWLP_WNDPROC, wndProc); + SetWindowLongPtrW(hWnd, GWLP_WNDPROC, wndProc); } return hWnd; } _____ Modified: trunk/reactos/lib/shlwapi/regstream.c --- trunk/reactos/lib/shlwapi/regstream.c 2005-01-12 22:57:30 UTC (rev 13000) +++ trunk/reactos/lib/shlwapi/regstream.c 2005-01-12 23:04:52 UTC (rev 13001) @@ -94,8 +94,7 @@ { TRACE(" destroying SHReg IStream (%p)\n",This); - if (This->pbBuffer) - HeapFree(GetProcessHeap(),0,This->pbBuffer); + HeapFree(GetProcessHeap(),0,This->pbBuffer); if (This->hKey) RegCloseKey(This->hKey); @@ -388,8 +387,7 @@ dwType == REG_BINARY) return IStream_Create(hStrKey, lpBuff, dwLength); - if (lpBuff) - HeapFree (GetProcessHeap(), 0, lpBuff); + HeapFree (GetProcessHeap(), 0, lpBuff); if (hStrKey) RegCloseKey(hStrKey); return NULL; @@ -418,8 +416,7 @@ dwType == REG_BINARY) return IStream_Create(hStrKey, lpBuff, dwLength); - if (lpBuff) - HeapFree (GetProcessHeap(), 0, lpBuff); + HeapFree (GetProcessHeap(), 0, lpBuff); if (hStrKey) RegCloseKey(hStrKey); return NULL; _____ Modified: trunk/reactos/lib/shlwapi/stopwatch.c --- trunk/reactos/lib/shlwapi/stopwatch.c 2005-01-12 22:57:30 UTC (rev 13000) +++ trunk/reactos/lib/shlwapi/stopwatch.c 2005-01-12 23:04:52 UTC (rev 13001) @@ -32,15 +32,10 @@ #define NONAMELESSUNION #define NONAMELESSSTRUCT -#include "wine/unicode.h" #include "windef.h" #include "winbase.h" -#include "wingdi.h" -#include "winuser.h" #include "winreg.h" #include "winternl.h" -#define NO_SHLWAPI_STREAM -#include "shlwapi.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); _____ Modified: trunk/reactos/lib/shlwapi/string.c --- trunk/reactos/lib/shlwapi/string.c 2005-01-12 22:57:30 UTC (rev 13000) +++ trunk/reactos/lib/shlwapi/string.c 2005-01-12 23:04:52 UTC (rev 13001) @@ -599,7 +599,7 @@ while (lpszStr <= lpszEnd && *lpszStr) { - if (!ChrCmpIA(*lpszSearch, *lpszStr)) + if (!ChrCmpIW(*lpszSearch, *lpszStr)) { if (!StrCmpNIW(lpszStr, lpszSearch, iLen)) lpszRet = (LPWSTR)lpszStr; @@ -2186,7 +2186,7 @@ return 1; else { - iDiff = SHLWAPI_ChrCmpHelperA(*lpszStr,*lpszComp,NORM_IGNORECASE); + iDiff = SHLWAPI_ChrCmpHelperW(*lpszStr,*lpszComp,NORM_IGNORECASE); if (iDiff > 0) return 1; else if (iDiff < 0) @@ -2208,12 +2208,12 @@ LONGLONG dLimit; double dDivisor; double dNormaliser; - LPCSTR lpszFormat; - CHAR wPrefix; + LPCWSTR lpwszFormat; + WCHAR wPrefix; } SHLWAPI_BYTEFORMATS; /*********************************************************************** ** - * StrFormatByteSize64A [SHLWAPI.@] + * StrFormatByteSizeW [SHLWAPI.@] * * Create a string containing an abbreviated byte count of up to 2^63-1. * @@ -2228,12 +2228,12 @@ * NOTES * There is no StrFormatByteSize64W function, it is called StrFormatByteSizeW(). */ -LPSTR WINAPI StrFormatByteSize64A(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax) +LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, UINT cchMax) { - static const char szBytes[] = "%ld bytes"; - static const char sz3_0[] = "%3.0f"; - static const char sz3_1[] = "%3.1f"; - static const char sz3_2[] = "%3.2f"; + static const WCHAR wszBytes[] = {'%','l','d',' ','b','y','t','e','s',0}; + static const WCHAR wsz3_0[] = {'%','3','.','0','f',0}; + static const WCHAR wsz3_1[] = {'%','3','.','1','f',0}; + static const WCHAR wsz3_2[] = {'%','3','.','2','f',0}; #define KB ((ULONGLONG)1024) #define MB (KB*KB) @@ -2243,25 +2243,25 @@ static const SHLWAPI_BYTEFORMATS bfFormats[] = { - { 10*KB, 10.24, 100.0, sz3_2, 'K' }, /* 10 KB */ - { 100*KB, 102.4, 10.0, sz3_1, 'K' }, /* 100 KB */ - { 1000*KB, 1024.0, 1.0, sz3_0, 'K' }, /* 1000 KB */ - { 10*MB, 10485.76, 100.0, sz3_2, 'M' }, /* 10 MB */ - { 100*MB, 104857.6, 10.0, sz3_1, 'M' }, /* 100 MB */ - { 1000*MB, 1048576.0, 1.0, sz3_0, 'M' }, /* 1000 MB */ - { 10*GB, 10737418.24, 100.0, sz3_2, 'G' }, /* 10 GB */ - { 100*GB, 107374182.4, 10.0, sz3_1, 'G' }, /* 100 GB */ - { 1000*GB, 1073741824.0, 1.0, sz3_0, 'G' }, /* 1000 GB */ - { 10*TB, 10485.76, 100.0, sz3_2, 'T' }, /* 10 TB */ - { 100*TB, 104857.6, 10.0, sz3_1, 'T' }, /* 100 TB */ - { 1000*TB, 1048576.0, 1.0, sz3_0, 'T' }, /* 1000 TB */ - { 10*PB, 10737418.24, 100.00, sz3_2, 'P' }, /* 10 PB */ - { 100*PB, 107374182.4, 10.00, sz3_1, 'P' }, /* 100 PB */ - { 1000*PB, 1073741824.0, 1.00, sz3_0, 'P' }, /* 1000 PB */ - { 0, 10995116277.76, 100.00, sz3_2, 'E' } /* EB's, catch all */ + { 10*KB, 10.24, 100.0, wsz3_2, 'K' }, /* 10 KB */ + { 100*KB, 102.4, 10.0, wsz3_1, 'K' }, /* 100 KB */ + { 1000*KB, 1024.0, 1.0, wsz3_0, 'K' }, /* 1000 KB */ + { 10*MB, 10485.76, 100.0, wsz3_2, 'M' }, /* 10 MB */ + { 100*MB, 104857.6, 10.0, wsz3_1, 'M' }, /* 100 MB */ + { 1000*MB, 1048576.0, 1.0, wsz3_0, 'M' }, /* 1000 MB */ + { 10*GB, 10737418.24, 100.0, wsz3_2, 'G' }, /* 10 GB */ + { 100*GB, 107374182.4, 10.0, wsz3_1, 'G' }, /* 100 GB */ + { 1000*GB, 1073741824.0, 1.0, wsz3_0, 'G' }, /* 1000 GB */ + { 10*TB, 10485.76, 100.0, wsz3_2, 'T' }, /* 10 TB */ + { 100*TB, 104857.6, 10.0, wsz3_1, 'T' }, /* 100 TB */ + { 1000*TB, 1048576.0, 1.0, wsz3_0, 'T' }, /* 1000 TB */ + { 10*PB, 10737418.24, 100.00, wsz3_2, 'P' }, /* 10 PB */ + { 100*PB, 107374182.4, 10.00, wsz3_1, 'P' }, /* 100 PB */ + { 1000*PB, 1073741824.0, 1.00, wsz3_0, 'P' }, /* 1000 PB */ + { 0, 10995116277.76, 100.00, wsz3_2, 'E' } /* EB's, catch all */ }; - char szBuff[32]; - char szAdd[4]; + WCHAR wszBuff[32]; + WCHAR wszAdd[] = {' ','?','B',0}; double dBytes; UINT i = 0; @@ -2272,7 +2272,7 @@ if (llBytes < 1024) /* 1K */ { - snprintf (lpszDest, cchMax, szBytes, (long)llBytes); + snprintfW(lpszDest, cchMax, wszBytes, (long)llBytes); return lpszDest; } @@ -2298,30 +2298,26 @@ dBytes = floor(dBytes / bfFormats[i].dDivisor) / bfFormats[i].dNormaliser; - sprintf(szBuff, bfFormats[i].lpszFormat, dBytes); - szAdd[0] = ' '; - szAdd[1] = bfFormats[i].wPrefix; - szAdd[2] = 'B'; - szAdd[3] = '\0'; - strcat(szBuff, szAdd); - strncpy(lpszDest, szBuff, cchMax); + sprintfW(wszBuff, bfFormats[i].lpwszFormat, dBytes); + wszAdd[1] = bfFormats[i].wPrefix; + strcatW(wszBuff, wszAdd); + strncpyW(lpszDest, wszBuff, cchMax); return lpszDest; } /*********************************************************************** ** - * StrFormatByteSizeW [SHLWAPI.@] + * StrFormatByteSize64A [SHLWAPI.@] * - * See StrFormatByteSize64A. + * See StrFormatByteSizeW. */ -LPWSTR WINAPI StrFormatByteSizeW(LONGLONG llBytes, LPWSTR lpszDest, - UINT cchMax) +LPSTR WINAPI StrFormatByteSize64A(LONGLONG llBytes, LPSTR lpszDest, UINT cchMax) { - char szBuff[32]; + WCHAR wszBuff[32]; - StrFormatByteSize64A(llBytes, szBuff, sizeof(szBuff)); + StrFormatByteSizeW(llBytes, wszBuff, sizeof(wszBuff)/sizeof(WCHAR)); if (lpszDest) - MultiByteToWideChar(CP_ACP, 0, szBuff, -1, lpszDest, cchMax); + WideCharToMultiByte(CP_ACP, 0, wszBuff, -1, lpszDest, cchMax, 0, 0); return lpszDest; } @@ -2560,6 +2556,7 @@ { SHTruncateString(mem, *lpiLen); lstrcpynA(lpDstStr, mem, *lpiLen + 1); + HeapFree(GetProcessHeap(), 0, mem); return *lpiLen + 1; } HeapFree(GetProcessHeap(), 0, mem); @@ -2568,7 +2565,6 @@ lpDstStr[*lpiLen] = '\0'; return *lpiLen; } - break; default: break; } _____ Modified: trunk/reactos/lib/shlwapi/thread.c --- trunk/reactos/lib/shlwapi/thread.c 2005-01-12 22:57:30 UTC (rev 13000) +++ trunk/reactos/lib/shlwapi/thread.c 2005-01-12 23:04:52 UTC (rev 13001) @@ -288,7 +288,7 @@ ti.pfnCallback = pfnCallback; ti.pData = pData; ti.bInitCom = dwFlags & CTF_COINIT ? TRUE : FALSE; - ti.hEvent = CreateEventA(NULL,FALSE,FALSE,NULL); + ti.hEvent = CreateEventW(NULL,FALSE,FALSE,NULL); /* Hold references to the current thread and IE process, if desired */ if(dwFlags & CTF_THREAD_REF) _____ Modified: trunk/reactos/lib/shlwapi/url.c --- trunk/reactos/lib/shlwapi/url.c 2005-01-12 22:57:30 UTC (rev 13000) +++ trunk/reactos/lib/shlwapi/url.c 2005-01-12 23:04:52 UTC (rev 13001) @@ -444,6 +444,7 @@ break; default: FIXME("how did we get here - state=%d\n", state); + HeapFree(GetProcessHeap(), 0, lpszUrlCpy); return E_INVALIDARG; } } @@ -1416,7 +1417,7 @@ * return the same digests for the same URL. */ WideCharToMultiByte(0, 0, pszUrl, -1, szUrl, MAX_PATH, 0, 0); - HashData((PBYTE)szUrl, (int)strlen(szUrl), lpDest, nDestLen); + HashData((const BYTE*)szUrl, (int)strlen(szUrl), lpDest, nDestLen); return S_OK; } @@ -1631,6 +1632,8 @@ DWORD res1; LPCSTR last; + TRACE("(%s %d)\n", debugstr_a(pszUrl), Urlis); + switch (Urlis) { case URLIS_OPAQUE: @@ -1650,6 +1653,8 @@ return (last >= pszUrl && (*last == '/' || *last == '\\' )); case URLIS_URL: + return PathIsURLA(pszUrl); + case URLIS_NOHISTORY: case URLIS_APPLIABLE: case URLIS_HASQUERY: @@ -1671,6 +1676,8 @@ DWORD res1; LPCWSTR last; + TRACE("(%s %d)\n", debugstr_w(pszUrl), Urlis); + switch (Urlis) { case URLIS_OPAQUE: @@ -1690,6 +1697,8 @@ return (last >= pszUrl && (*last == '/' || *last == '\\')); case URLIS_URL: + return PathIsURLW(pszUrl); + case URLIS_NOHISTORY: case URLIS_APPLIABLE: case URLIS_HASQUERY: _____ Modified: trunk/reactos/lib/shlwapi/wsprintf.c --- trunk/reactos/lib/shlwapi/wsprintf.c 2005-01-12 22:57:30 UTC (rev 13000) +++ trunk/reactos/lib/shlwapi/wsprintf.c 2005-01-12 23:04:52 UTC (rev 13001) @@ -28,8 +28,8 @@ #include "windef.h" #include "winbase.h" -#include "wingdi.h" -#include "winuser.h" +#define NO_SHLWAPI_REG +#include "shlwapi.h" #include "wine/debug.h" @@ -284,7 +284,7 @@ * Success: The number of characters written. * Failure: -1. */ -INT WINAPI wvnsprintfA( LPSTR buffer, UINT maxlen, LPCSTR spec, va_list args ) +INT WINAPI wvnsprintfA( LPSTR buffer, INT maxlen, LPCSTR spec, va_list args ) { WPRINTF_FORMAT format; LPSTR p = buffer; @@ -389,7 +389,7 @@ * * See wvnsprintfA. */ -INT WINAPI wvnsprintfW( LPWSTR buffer, UINT maxlen, LPCWSTR spec, va_list args ) +INT WINAPI wvnsprintfW( LPWSTR buffer, INT maxlen, LPCWSTR spec, va_list args ) { WPRINTF_FORMAT format; LPWSTR p = buffer;
19 years, 10 months
1
0
0
0
[gvg] 13000: Sync to Wine-20050111:
by gvg@svn.reactos.com
Sync to Wine-20050111: Eric Pouech <pouech-eric(a)wanadoo.fr> - Removed excessive statement (break after return or goto, not useful break, not needed vars...) Modified: trunk/reactos/lib/shdocvw/shdocvw_main.c _____ Modified: trunk/reactos/lib/shdocvw/shdocvw_main.c --- trunk/reactos/lib/shdocvw/shdocvw_main.c 2005-01-12 22:51:23 UTC (rev 12999) +++ trunk/reactos/lib/shdocvw/shdocvw_main.c 2005-01-12 22:57:30 UTC (rev 13000) @@ -414,7 +414,6 @@ SHDOCVW_TryDownloadMozillaControl(); bTried = TRUE; } - return TRUE; } /*********************************************************************** **
19 years, 10 months
1
0
0
0
[gvg] 12999: Add SHFMT_ constants
by gvg@svn.reactos.com
Add SHFMT_ constants Modified: trunk/reactos/w32api/include/shlobj.h _____ Modified: trunk/reactos/w32api/include/shlobj.h --- trunk/reactos/w32api/include/shlobj.h 2005-01-12 22:49:57 UTC (rev 12998) +++ trunk/reactos/w32api/include/shlobj.h 2005-01-12 22:51:23 UTC (rev 12999) @@ -385,6 +385,9 @@ #define PCS_REMOVEDCHAR 0x00000002 #define PCS_TRUNCATED 0x00000004 #define PCS_PATHTOOLONG 0x00000008 +#define SHFMT_ERROR 0xFFFFFFFFL +#define SHFMT_CANCEL 0xFFFFFFFEL +#define SHFMT_NOFORMAT 0xFFFFFFFDL typedef ULONG SFGAOF; typedef DWORD SHGDNF;
19 years, 10 months
1
0
0
0
[gvg] 12998: Sync to Wine-20050111:
by gvg@svn.reactos.com
Sync to Wine-20050111: Jon Griffiths <jon_p_griffiths(a)yahoo.com> - Remove unneeded headers to reduce unneeded rebuilds. Jacek Caban <jack(a)itma.pwr.wroc.pl> - Get rid of W->A call. Michael Stefaniuc <mstefani(a)redhat.de> - Do not check for non NULL pointer before HeapFree'ing it. It's redundant. Alexandre Julliard <julliard(a)winehq.org> - Remove some no longer needed AW functions. - Janitorial: C booleans must not be compared against TRUE. Hans Leidekker <hans(a)it.vu.nl> - Stub implementations for SHUpdateImageA, SHHandleUpdateImage, SHObjectProperties, SHGetNewLinkInfo{A,W}, SHStartNetConnectionDialog, SHEmptyRecycleBin{A,W}, SHFormatDrive, SHQueryRecycleBin{A,W}. - 'HeapAlloc can fail' fix for ExtractIconExA. - Implement ExtractAssociatedIconA -> W. - Correct prototype for SHObjectProperties. - Forward SHGetNewLinkInfo to SHGetNewLinkInfoA. Robert Shearman <rob(a)codeweavers.com> - Remove unnecessary WNDPROC casts. - Don't sort the children of My Computer in shell browse for folder dialog. Eric Pouech <pouech-eric(a)wanadoo.fr> - Removed excessive statement (break after return or goto, not useful break, not needed vars...) - Fixed some errors in function prototypes. Jose Manuel Ferrer Ortiz <jmfo1982(a)yahoo.es> - Added some Spanish translations. Juan Lang <juan_lang(a)yahoo.com> - Revert shell32 version to Win2K SP4 level. Rein Klazes <wijn(a)wanadoo.nl> - ShellExecuteEx, ExtractIconEx, SHFileOperation, SHGetFileInfo, SHGetPathFromIDList spec entries always refer to the Ansi version. Problem found by Paul Vriens. Modified: trunk/reactos/lib/shell32/autocomplete.c Modified: trunk/reactos/lib/shell32/brsfolder.c Modified: trunk/reactos/lib/shell32/changenotify.c Modified: trunk/reactos/lib/shell32/cpanelfolder.c Modified: trunk/reactos/lib/shell32/enumidlist.c Modified: trunk/reactos/lib/shell32/folders.c Modified: trunk/reactos/lib/shell32/iconcache.c Modified: trunk/reactos/lib/shell32/pidl.c Modified: trunk/reactos/lib/shell32/shell32.spec Modified: trunk/reactos/lib/shell32/shell32_Es.rc Modified: trunk/reactos/lib/shell32/shell32_main.c Modified: trunk/reactos/lib/shell32/shelllink.c Modified: trunk/reactos/lib/shell32/shellole.c Modified: trunk/reactos/lib/shell32/shellord.c Modified: trunk/reactos/lib/shell32/shellreg.c Modified: trunk/reactos/lib/shell32/shfldr_mycomp.c Modified: trunk/reactos/lib/shell32/shlexec.c Modified: trunk/reactos/lib/shell32/shlfileop.c Modified: trunk/reactos/lib/shell32/shlfolder.c Modified: trunk/reactos/lib/shell32/shlfsbind.c Modified: trunk/reactos/lib/shell32/shlview.c Modified: trunk/reactos/lib/shell32/systray.c Modified: trunk/reactos/lib/shell32/undocshell.h Modified: trunk/reactos/lib/shell32/version.h _____ Modified: trunk/reactos/lib/shell32/autocomplete.c --- trunk/reactos/lib/shell32/autocomplete.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/autocomplete.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -187,10 +187,8 @@ if (!--(This->ref)) { TRACE(" destroying IAutoComplete(%p)\n",This); - if (This->quickComplete) - HeapFree(GetProcessHeap(), 0, This->quickComplete); - if (This->txtbackup) - HeapFree(GetProcessHeap(), 0, This->txtbackup); + HeapFree(GetProcessHeap(), 0, This->quickComplete); + HeapFree(GetProcessHeap(), 0, This->txtbackup); if (This->hwndListBox) DestroyWindow(This->hwndListBox); if (This->enumstr) _____ Modified: trunk/reactos/lib/shell32/brsfolder.c --- trunk/reactos/lib/shell32/brsfolder.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/brsfolder.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -330,7 +330,10 @@ if (SUCCEEDED(IShellFolder_BindToObject(lptvid->lpsfParent, lptvid->lpi,0,(REFIID)&IID_IShellFolder,(LPVOID *)&lpsf2))) { FillTreeView( lpsf2, lptvid->lpifq, pnmtv->itemNew.hItem, lptvid->pEnumIL); } - TreeView_SortChildren(hwndTreeView, pnmtv->itemNew.hItem, FALSE); + /* My Computer is already sorted and trying to do a simple text + * sort will only mess things up */ + if (!_ILIsMyComputer(lptvid->lpi)) + TreeView_SortChildren(hwndTreeView, pnmtv->itemNew.hItem, FALSE); } break; case TVN_SELCHANGEDA: @@ -491,10 +494,7 @@ WideCharToMultiByte(CP_ACP, 0, bi.pszDisplayName, -1, lpbi->pszDisplayName, MAX_PATH, 0, NULL); HeapFree(GetProcessHeap(), 0, bi.pszDisplayName); } - if (bi.lpszTitle) - { - HeapFree(GetProcessHeap(), 0, (LPVOID)bi.lpszTitle); - } + HeapFree(GetProcessHeap(), 0, (LPVOID)bi.lpszTitle); lpbi->iImage = bi.iImage; return lpid; } _____ Modified: trunk/reactos/lib/shell32/changenotify.c --- trunk/reactos/lib/shell32/changenotify.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/changenotify.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -27,9 +27,7 @@ #include "winbase.h" #include "wine/debug.h" #include "wingdi.h" -#include "pidl.h" #include "shell32_main.h" -#include "undocshell.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); _____ Modified: trunk/reactos/lib/shell32/cpanelfolder.c --- trunk/reactos/lib/shell32/cpanelfolder.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/cpanelfolder.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -47,7 +47,6 @@ #include "shell32_main.h" #include "shresdef.h" #include "shlwapi.h" -#include "shellfolder.h" #include "wine/debug.h" #include "debughlp.h" #include "shfldr.h" _____ Modified: trunk/reactos/lib/shell32/enumidlist.c --- trunk/reactos/lib/shell32/enumidlist.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/enumidlist.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -28,13 +28,9 @@ #include "windef.h" #include "winbase.h" #include "winreg.h" -#include "undocshell.h" #include "shlwapi.h" -#include "winerror.h" -#include "objbase.h" #include "pidl.h" -#include "shlguid.h" #include "enumidlist.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); _____ Modified: trunk/reactos/lib/shell32/folders.c --- trunk/reactos/lib/shell32/folders.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/folders.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -34,10 +34,8 @@ #include "undocshell.h" #include "shlguid.h" #include "winreg.h" -#include "shlwapi.h" #include "wine/debug.h" -#include "wine/unicode.h" #include "pidl.h" #include "shell32_main.h" _____ Modified: trunk/reactos/lib/shell32/iconcache.c --- trunk/reactos/lib/shell32/iconcache.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/iconcache.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -43,7 +43,6 @@ #include "pidl.h" #include "shell32_main.h" #include "undocshell.h" -#include "shlwapi.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -420,15 +419,6 @@ } /*********************************************************************** ** - * ExtractIconEx [SHELL32.@] - */ -UINT WINAPI ExtractIconExAW(LPCVOID lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons) -{ if (SHELL_OsIsUnicode()) - return ExtractIconExW ( lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons); - return ExtractIconExA ( lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons); -} - -/********************************************************************** *** * ExtractIconExW [SHELL32.@] * RETURNS * 0 no icon found @@ -460,15 +450,18 @@ */ UINT WINAPI ExtractIconExA(LPCSTR lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons) { - UINT ret; + UINT ret = 0; INT len = MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, NULL, 0); LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); TRACE("%s %i %p %p %i\n", lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons); - MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, lpwstrFile, len); - ret = ExtractIconExW (lpwstrFile, nIconIndex, phiconLarge, phiconSmall, nIcons); - HeapFree(GetProcessHeap(), 0, lpwstrFile); + if (lpwstrFile) + { + MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, lpwstrFile, len); + ret = ExtractIconExW(lpwstrFile, nIconIndex, phiconLarge, phiconSmall, nIcons); + HeapFree(GetProcessHeap(), 0, lpwstrFile); + } return ret; } @@ -480,43 +473,55 @@ */ HICON WINAPI ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIcon) { - HICON hIcon; - WORD wDummyIcon = 0; - - TRACE("\n"); + HICON hIcon = NULL; + INT len = MultiByteToWideChar(CP_ACP, 0, lpIconPath, -1, NULL, 0); + LPWSTR lpIconPathW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - if(lpiIcon == NULL) - lpiIcon = &wDummyIcon; + TRACE("%p %s %p\n", hInst, debugstr_a(lpIconPath), lpiIcon); - hIcon = ExtractIconA(hInst, lpIconPath, *lpiIcon); + if (lpIconPathW) + { + MultiByteToWideChar(CP_ACP, 0, lpIconPath, -1, lpIconPathW, len); + hIcon = ExtractAssociatedIconW(hInst, lpIconPathW, lpiIcon); + HeapFree(GetProcessHeap(), 0, lpIconPathW); + } + return hIcon; +} - if( hIcon < (HICON)2 ) - { if( hIcon == (HICON)1 ) /* no icons found in given file */ - { char tempPath[0x80]; - HINSTANCE uRet = FindExecutableA(lpIconPath,NULL,tempPath); +HICON WINAPI ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD lpiIcon) +{ + HICON hIcon = NULL; + WORD wDummyIcon = 0; - if( uRet > (HINSTANCE)32 && tempPath[0] ) - { strcpy(lpIconPath,tempPath); - hIcon = ExtractIconA(hInst, lpIconPath, *lpiIcon); - if( hIcon > (HICON)2 ) - return hIcon; - } - else hIcon = 0; - } + TRACE("%p %s %p\n", hInst, debugstr_w(lpIconPath), lpiIcon); - if( hIcon == (HICON)1 ) - *lpiIcon = 2; /* MSDOS icon - we found .exe but no icons in it */ - else - *lpiIcon = 6; /* generic icon - found nothing */ + if(lpiIcon == NULL) + lpiIcon = &wDummyIcon; - if (GetModuleFileNameA(hInst, lpIconPath, 0x80)) - { - /* terminate string (GetModuleFileName doesn't do if buffer is too small) */ - lpIconPath[0x80 - 1] = '\0'; - hIcon = LoadIconA( hInst, MAKEINTRESOURCEA(*lpiIcon)); - } - } - return hIcon; + hIcon = ExtractIconW(hInst, lpIconPath, *lpiIcon); + + if( hIcon < (HICON)2 ) + { if( hIcon == (HICON)1 ) /* no icons found in given file */ + { WCHAR tempPath[MAX_PATH]; + HINSTANCE uRet = FindExecutableW(lpIconPath,NULL,tempPath); + + if( uRet > (HINSTANCE)32 && tempPath[0] ) + { lstrcpyW(lpIconPath,tempPath); + hIcon = ExtractIconW(hInst, lpIconPath, *lpiIcon); + if( hIcon > (HICON)2 ) + return hIcon; + } + } + + if( hIcon == (HICON)1 ) + *lpiIcon = 2; /* MSDOS icon - we found .exe but no icons in it */ + else + *lpiIcon = 6; /* generic icon - found nothing */ + + if (GetModuleFileNameW(hInst, lpIconPath, MAX_PATH)) + hIcon = LoadIconW(hInst, MAKEINTRESOURCEW(*lpiIcon)); + } + return hIcon; } /*********************************************************************** ** _____ Modified: trunk/reactos/lib/shell32/pidl.c --- trunk/reactos/lib/shell32/pidl.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/pidl.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -47,7 +47,6 @@ #include "shlwapi.h" #include "pidl.h" -#include "debughlp.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(pidl); @@ -1058,7 +1057,7 @@ _ILParsePathW(wPath, NULL, TRUE, &pidl, NULL); - if (wPath) HeapFree(GetProcessHeap(), 0, wPath); + HeapFree(GetProcessHeap(), 0, wPath); TRACE("%s %p\n", debugstr_a(lpszPath), pidl); return pidl; } @@ -1366,18 +1365,6 @@ } /*********************************************************************** ** - * SHGetPathFromIDList [SHELL32.@][NT 4.0: SHELL32.219] - */ -BOOL WINAPI SHGetPathFromIDListAW(LPCITEMIDLIST pidl,LPVOID pszPath) -{ - TRACE_(shell)("(pidl=%p,%p)\n",pidl,pszPath); - - if (SHELL_OsIsUnicode()) - return SHGetPathFromIDListW(pidl,pszPath); - return SHGetPathFromIDListA(pidl,pszPath); -} - -/********************************************************************** *** * SHBindToParent [shell version 5.0] */ HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCITEMIDLIST *ppidlLast) _____ Modified: trunk/reactos/lib/shell32/shell32.spec --- trunk/reactos/lib/shell32/shell32.spec 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/shell32.spec 2005-01-12 22:49:57 UTC (rev 12998) @@ -169,9 +169,9 @@ 175 stdcall SHGetSpecialFolderPath(long long long long) SHGetSpecialFolderPathAW 176 stdcall SHSetInstanceExplorer (long) 177 stub DAD_SetDragImageFromListView - 178 stub SHObjectProperties - 179 stub SHGetNewLinkInfoA - 180 stub SHGetNewLinkInfoW + 178 stdcall SHObjectProperties(long long wstr wstr) + 179 stdcall SHGetNewLinkInfoA(str str ptr long long) + 180 stdcall SHGetNewLinkInfoW(wstr wstr ptr long long) 181 stdcall RegisterShellHook(long long) 182 varargs ShellMessageBoxW(long long long str long) 183 varargs ShellMessageBoxA(long long long str long) @@ -182,9 +182,9 @@ 188 stdcall ShellDDEInit(long) 189 stdcall ILCreateFromPathA(str) 190 stdcall ILCreateFromPathW(wstr) - 191 stub SHUpdateImageA + 191 stdcall SHUpdateImageA(str long long long) 192 stdcall SHUpdateImageW(wstr long long long) - 193 stub SHHandleUpdateImage + 193 stdcall SHHandleUpdateImage(ptr) 194 stub SHCreatePropSheetExtArrayEx 195 stdcall SHFree(ptr) 196 stdcall SHAlloc(long) @@ -206,7 +206,7 @@ 212 stub Printers_AddPrinterPropPages 213 stub Printers_RegisterWindowW 214 stub Printers_UnregisterWindow - 215 stub SHStartNetConnectionDialog + 215 stdcall SHStartNetConnectionDialog(long str long) 243 stdcall @(long long) shell32_243 244 stdcall SHInitRestricted(ptr ptr) 247 stdcall SHGetDataFromIDListA (ptr ptr long ptr long) @@ -235,15 +235,15 @@ 288 stdcall ShellAboutA(long str str long) 289 stdcall ShellAboutW(long wstr wstr long) 290 stdcall ShellExecuteA(long str str str str long) - 291 stdcall ShellExecuteEx (long) ShellExecuteExAW + 291 stdcall ShellExecuteEx (long) ShellExecuteExA 292 stdcall ShellExecuteExA (long) 293 stdcall ShellExecuteExW (long) 294 stdcall ShellExecuteW (long wstr wstr wstr wstr long) 296 stdcall Shell_NotifyIcon(long ptr) Shell_NotifyIconA 297 stdcall Shell_NotifyIconA(long ptr) 298 stdcall Shell_NotifyIconW(long ptr) - 299 stub Shl1632_ThunkData32 - 300 stub Shl3216_ThunkData32 +#299 stub Shl1632_ThunkData32 +#300 stub Shl3216_ThunkData32 301 stdcall StrChrA(str long) shlwapi.StrChrA 302 stdcall StrChrIA(str long) shlwapi.StrChrIA 303 stdcall StrChrIW(wstr long) shlwapi.StrChrIW @@ -338,12 +338,12 @@ @ stdcall DoEnvironmentSubstW(wstr wstr) @ stub DragQueryFileAorW @ stdcall DuplicateIcon(long long) -@ stdcall ExtractAssociatedIconA(long ptr long) +@ stdcall ExtractAssociatedIconA(long str ptr) @ stdcall ExtractAssociatedIconExA(long str long long) @ stdcall ExtractAssociatedIconExW(long wstr long long) -@ stub ExtractAssociatedIconW +@ stdcall ExtractAssociatedIconW(long wstr ptr) @ stdcall ExtractIconA(long str long) -@ stdcall ExtractIconEx(ptr long ptr ptr long)ExtractIconExAW +@ stdcall ExtractIconEx(ptr long ptr ptr long) ExtractIconExA @ stdcall ExtractIconExA(str long ptr ptr long) @ stdcall ExtractIconExW(wstr long ptr ptr long) @ stdcall ExtractIconW(long wstr long) @@ -376,21 +376,21 @@ @ stdcall SHCreateDirectoryExA(long str ptr) @ stdcall SHCreateDirectoryExW(long wstr ptr) @ stub ShellHookProc -@ stub SHEmptyRecycleBinA -@ stub SHEmptyRecycleBinW -@ stdcall SHFileOperation(ptr)SHFileOperationAW +@ stdcall SHEmptyRecycleBinA(long str long) +@ stdcall SHEmptyRecycleBinW(long wstr long) +@ stdcall SHFileOperation(ptr) SHFileOperationA @ stdcall SHFileOperationA(ptr) @ stdcall SHFileOperationW(ptr) -@ stub SHFormatDrive +@ stdcall SHFormatDrive(long long long long) @ stdcall SHFreeNameMappings(ptr) @ stdcall SHGetDesktopFolder(ptr) -@ stdcall SHGetFileInfo(ptr long ptr long long)SHGetFileInfoAW +@ stdcall SHGetFileInfo(ptr long ptr long long) SHGetFileInfoA @ stdcall SHGetFileInfoA(ptr long ptr long long) @ stdcall SHGetFileInfoW(ptr long ptr long long) @ stdcall SHGetInstanceExplorer(long) @ stdcall SHGetMalloc(ptr) -@ stub SHGetNewLinkInfo -@ stdcall SHGetPathFromIDList(ptr ptr)SHGetPathFromIDListAW +@ stdcall SHGetNewLinkInfo(str str ptr long long) SHGetNewLinkInfoA +@ stdcall SHGetPathFromIDList(ptr ptr) SHGetPathFromIDListA @ stdcall SHGetPathFromIDListA(ptr ptr) @ stdcall SHGetPathFromIDListW(ptr ptr) @ stdcall SHGetSettings(ptr long) @@ -399,8 +399,8 @@ @ stub SHHelpShortcuts_RunDLLA @ stub SHHelpShortcuts_RunDLLW @ stdcall SHLoadInProc(long) -@ stub SHQueryRecycleBinA -@ stub SHQueryRecycleBinW +@ stdcall SHQueryRecycleBinA(str ptr) +@ stdcall SHQueryRecycleBinW(wstr ptr) @ stub SHUpdateRecycleBinIcon @ stub WOWShellExecute _____ Modified: trunk/reactos/lib/shell32/shell32_Es.rc --- trunk/reactos/lib/shell32/shell32_Es.rc 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/shell32_Es.rc 2005-01-12 22:49:57 UTC (rev 12998) @@ -188,3 +188,35 @@ IDS_SHUTDOWN_TITLE "Apagar" IDS_SHUTDOWN_PROMPT "¿Desea terminar su sesión ReactOS?" } + +/* shell folder path default values */ +STRINGTABLE DISCARDABLE +{ + IDS_PROGRAMS "Menú Inicio\\Programas" + IDS_PERSONAL "Mis documentos" + IDS_FAVORITES "Favoritos" + IDS_STARTUP "Menú Inicio\\Programas\\Inicio" + IDS_RECENT "Recent" + IDS_SENDTO "SendTo" + IDS_STARTMENU "Menú Inicio" + IDS_MYMUSIC "Mis documentos\\Mi música" + IDS_MYVIDEO "Mis documentos\\Mis vídeos" + IDS_DESKTOPDIRECTORY "Escritorio" + IDS_NETHOOD "Entorno de red" + IDS_TEMPLATES "Templates" + IDS_APPDATA "Application Data" + IDS_PRINTHOOD "PrintHood" + IDS_LOCAL_APPDATA "Configuración local\\Datos de programa" + IDS_INTERNET_CACHE "Archivos temporales de Internet" + IDS_COOKIES "Cookies" + IDS_HISTORY "Historial" + IDS_PROGRAM_FILES "Archivos de programa" + IDS_MYPICTURES "Mis documentos\\Mis imágenes" + IDS_PROGRAM_FILES_COMMON "Archivos de programa\\Archivos comunes" + IDS_COMMON_DOCUMENTS "Documentos" + IDS_ADMINTOOLS "Menú Inicio\\Programas\\Accesorios\\Herramientas del sistema" + IDS_COMMON_MUSIC "Documentos\\Mi música" + IDS_COMMON_PICTURES "Documentos\\Mis imágenes" + IDS_COMMON_VIDEO "Documentos\\Mis vídeos" + IDS_CDBURN_AREA "Configuración local\\Datos de programa\\Microsoft\\CD Burning" +} _____ Modified: trunk/reactos/lib/shell32/shell32_main.c --- trunk/reactos/lib/shell32/shell32_main.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/shell32_main.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -543,21 +543,6 @@ } /*********************************************************************** ** - * SHGetFileInfo [SHELL32.@] - */ -DWORD WINAPI SHGetFileInfoAW( - LPCVOID path, - DWORD dwFileAttributes, - LPVOID psfi, - UINT sizeofpsfi, - UINT flags) -{ - if(SHELL_OsIsUnicode()) - return SHGetFileInfoW(path, dwFileAttributes, psfi, sizeofpsfi, flags ); - return SHGetFileInfoA(path, dwFileAttributes, psfi, sizeofpsfi, flags ); -} - -/********************************************************************** *** * DuplicateIcon [SHELL32.@] */ HICON WINAPI DuplicateIcon( HINSTANCE hInstance, HICON hIcon) @@ -827,8 +812,8 @@ ret = ShellAboutW(hWnd, appW, otherW, hIcon); - if (otherW) HeapFree(GetProcessHeap(), 0, otherW); - if (appW) HeapFree(GetProcessHeap(), 0, appW); + HeapFree(GetProcessHeap(), 0, otherW); + HeapFree(GetProcessHeap(), 0, appW); return ret; } @@ -844,10 +829,12 @@ HRSRC hRes; LPVOID template; BOOL bRet; + static const WCHAR wszSHELL_ABOUT_MSGBOX[] = + {'S','H','E','L','L','_','A','B','O','U','T','_','M','S','G','B','O','X' ,0}; TRACE("\n"); - if(!(hRes = FindResourceA(shell32_hInstance, "SHELL_ABOUT_MSGBOX", (LPSTR)RT_DIALOG))) + if(!(hRes = FindResourceW(shell32_hInstance, wszSHELL_ABOUT_MSGBOX, (LPWSTR)RT_DIALOG))) return FALSE; if(!(template = (LPVOID)LoadResource(shell32_hInstance, hRes))) return FALSE; _____ Modified: trunk/reactos/lib/shell32/shelllink.c --- trunk/reactos/lib/shell32/shelllink.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/shelllink.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -993,21 +993,12 @@ TRACE("-- destroying IShellLink(%p)\n",This); - if (This->sIcoPath) - HeapFree(GetProcessHeap(), 0, This->sIcoPath); + HeapFree(GetProcessHeap(), 0, This->sIcoPath); + HeapFree(GetProcessHeap(), 0, This->sArgs); + HeapFree(GetProcessHeap(), 0, This->sWorkDir); + HeapFree(GetProcessHeap(), 0, This->sDescription); + HeapFree(GetProcessHeap(),0,This->sPath); - if (This->sArgs) - HeapFree(GetProcessHeap(), 0, This->sArgs); - - if (This->sWorkDir) - HeapFree(GetProcessHeap(), 0, This->sWorkDir); - - if (This->sDescription) - HeapFree(GetProcessHeap(), 0, This->sDescription); - - if (This->sPath) - HeapFree(GetProcessHeap(),0,This->sPath); - if (This->pPidl) ILFree(This->pPidl); @@ -1080,8 +1071,7 @@ TRACE("(%p)->(pName=%s)\n", This, pszName); - if (This->sDescription) - HeapFree(GetProcessHeap(), 0, This->sDescription); + HeapFree(GetProcessHeap(), 0, This->sDescription); This->sDescription = HEAP_strdupAtoW( GetProcessHeap(), 0, pszName); if ( !This->sDescription ) return E_OUTOFMEMORY; @@ -1112,8 +1102,7 @@ TRACE("(%p)->(dir=%s)\n",This, pszDir); - if (This->sWorkDir) - HeapFree(GetProcessHeap(), 0, This->sWorkDir); + HeapFree(GetProcessHeap(), 0, This->sWorkDir); This->sWorkDir = HEAP_strdupAtoW( GetProcessHeap(), 0, pszDir); if ( !This->sWorkDir ) return E_OUTOFMEMORY; @@ -1144,8 +1133,7 @@ TRACE("(%p)->(args=%s)\n",This, pszArgs); - if (This->sArgs) - HeapFree(GetProcessHeap(), 0, This->sArgs); + HeapFree(GetProcessHeap(), 0, This->sArgs); This->sArgs = HEAP_strdupAtoW( GetProcessHeap(), 0, pszArgs); if( !This->sArgs ) return E_OUTOFMEMORY; @@ -1276,8 +1264,7 @@ TRACE("(%p)->(path=%s iicon=%u)\n",This, pszIconPath, iIcon); - if (This->sIcoPath) - HeapFree(GetProcessHeap(), 0, This->sIcoPath); + HeapFree(GetProcessHeap(), 0, This->sIcoPath); This->sIcoPath = HEAP_strdupAtoW(GetProcessHeap(), 0, pszIconPath); if ( !This->sIcoPath ) return E_OUTOFMEMORY; @@ -1294,8 +1281,7 @@ FIXME("(%p)->(path=%s %lx)\n",This, pszPathRel, dwReserved); - if (This->sPathRel) - HeapFree(GetProcessHeap(), 0, This->sPathRel); + HeapFree(GetProcessHeap(), 0, This->sPathRel); This->sPathRel = HEAP_strdupAtoW(GetProcessHeap(), 0, pszPathRel); This->bDirty = TRUE; @@ -1354,9 +1340,7 @@ if (!GetFullPathNameA(pszFile, MAX_PATH, buffer, &fname)) return E_FAIL; - if (This->sPath) - HeapFree(GetProcessHeap(), 0, This->sPath); - + HeapFree(GetProcessHeap(), 0, This->sPath); This->sPath = HEAP_strdupAtoW(GetProcessHeap(), 0, buffer); if( !This->sPath ) return E_OUTOFMEMORY; @@ -1499,8 +1483,7 @@ TRACE("(%p)->(desc=%s)\n",This, debugstr_w(pszName)); - if (This->sDescription) - HeapFree(GetProcessHeap(), 0, This->sDescription); + HeapFree(GetProcessHeap(), 0, This->sDescription); This->sDescription = HeapAlloc( GetProcessHeap(), 0, (lstrlenW( pszName )+1)*sizeof(WCHAR) ); if ( !This->sDescription ) @@ -1532,8 +1515,7 @@ TRACE("(%p)->(dir=%s)\n",This, debugstr_w(pszDir)); - if (This->sWorkDir) - HeapFree(GetProcessHeap(), 0, This->sWorkDir); + HeapFree(GetProcessHeap(), 0, This->sWorkDir); This->sWorkDir = HeapAlloc( GetProcessHeap(), 0, (lstrlenW( pszDir )+1)*sizeof (WCHAR) ); if ( !This->sWorkDir ) @@ -1564,8 +1546,7 @@ TRACE("(%p)->(args=%s)\n",This, debugstr_w(pszArgs)); - if (This->sArgs) - HeapFree(GetProcessHeap(), 0, This->sArgs); + HeapFree(GetProcessHeap(), 0, This->sArgs); This->sArgs = HeapAlloc( GetProcessHeap(), 0, (lstrlenW( pszArgs )+1)*sizeof (WCHAR) ); if ( !This->sArgs ) @@ -1697,8 +1678,7 @@ TRACE("(%p)->(path=%s iicon=%u)\n",This, debugstr_w(pszIconPath), iIcon); - if (This->sIcoPath) - HeapFree(GetProcessHeap(), 0, This->sIcoPath); + HeapFree(GetProcessHeap(), 0, This->sIcoPath); This->sIcoPath = HeapAlloc( GetProcessHeap(), 0, (lstrlenW( pszIconPath )+1)*sizeof (WCHAR) ); if ( !This->sIcoPath ) @@ -1717,8 +1697,7 @@ TRACE("(%p)->(path=%s %lx)\n",This, debugstr_w(pszPathRel), dwReserved); - if (This->sPathRel) - HeapFree(GetProcessHeap(), 0, This->sPathRel); + HeapFree(GetProcessHeap(), 0, This->sPathRel); This->sPathRel = HeapAlloc( GetProcessHeap(), 0, (lstrlenW( pszPathRel )+1) * sizeof (WCHAR) ); if ( !This->sPathRel ) @@ -1781,9 +1760,7 @@ if (!GetFullPathNameW(pszFile, MAX_PATH, buffer, &fname)) return E_FAIL; - if (This->sPath) - HeapFree(GetProcessHeap(), 0, This->sPath); - + HeapFree(GetProcessHeap(), 0, This->sPath); This->sPath = HeapAlloc( GetProcessHeap(), 0, (lstrlenW( buffer )+1) * sizeof (WCHAR) ); if (!This->sPath) _____ Modified: trunk/reactos/lib/shell32/shellole.c --- trunk/reactos/lib/shell32/shellole.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/shellole.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -704,7 +704,7 @@ lpDrop = (LPSTR) lpDropFileStruct + lpDropFileStruct->pFiles; - if(lpDropFileStruct->fWide == TRUE) { + if(lpDropFileStruct->fWide) { LPWSTR lpszFileW = NULL; if(lpszFile) { _____ Modified: trunk/reactos/lib/shell32/shellord.c --- trunk/reactos/lib/shell32/shellord.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/shellord.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -1546,5 +1546,90 @@ */ void WINAPI SHUpdateImageW(LPCWSTR pszHashItem, int iIndex, UINT uFlags, int iImageIndex) { - FIXME("%s, %d, 0x%x, %d\n", debugstr_w(pszHashItem), iIndex, uFlags, iImageIndex); + FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_w(pszHashItem), iIndex, uFlags, iImageIndex); } + +VOID WINAPI SHUpdateImageA(LPCSTR pszHashItem, INT iIndex, UINT uFlags, INT iImageIndex) +{ + FIXME("%s, %d, 0x%x, %d - stub\n", debugstr_a(pszHashItem), iIndex, uFlags, iImageIndex); +} + +INT WINAPI SHHandleUpdateImage(LPCITEMIDLIST pidlExtra) +{ + FIXME("%p - stub\n", pidlExtra); + + return -1; +} + +BOOL WINAPI SHObjectProperties(HWND hwnd, DWORD dwType, LPCWSTR szObject, LPCWSTR szPage) +{ + FIXME("%p, 0x%08lx, %s, %s - stub\n", hwnd, dwType, debugstr_w(szObject), debugstr_w(szPage)); + + return TRUE; +} + +BOOL WINAPI SHGetNewLinkInfoA(LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName, BOOL *pfMustCopy, + UINT uFlags) +{ + FIXME("%s, %s, %p, %p, 0x%08x - stub\n", debugstr_a(pszLinkTo), debugstr_a(pszDir), + pszName, pfMustCopy, uFlags); + + return FALSE; +} + +BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy, + UINT uFlags) +{ + FIXME("%s, %s, %p, %p, 0x%08x - stub\n", debugstr_w(pszLinkTo), debugstr_w(pszDir), + pszName, pfMustCopy, uFlags); + + return FALSE; +} + +HRESULT WINAPI SHStartNetConnectionDialog(HWND hwnd, LPCSTR pszRemoteName, DWORD dwType) +{ + FIXME("%p, %s, 0x%08lx - stub\n", hwnd, debugstr_a(pszRemoteName), dwType); + + return S_OK; +} + +HRESULT WINAPI SHEmptyRecycleBinA(HWND hwnd, LPCSTR pszRootPath, DWORD dwFlags) +{ + FIXME("%p, %s, 0x%08lx - stub\n", hwnd, debugstr_a(pszRootPath), dwFlags); + + return S_OK; +} + +HRESULT WINAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags) +{ + FIXME("%p, %s, 0x%08lx - stub\n", hwnd, debugstr_w(pszRootPath), dwFlags); + + return S_OK; +} + +DWORD WINAPI SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options) +{ + FIXME("%p, 0x%08x, 0x%08x, 0x%08x - stub\n", hwnd, drive, fmtID, options); + + return SHFMT_NOFORMAT; +} + +HRESULT WINAPI SHQueryRecycleBinA(LPCSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo) +{ + FIXME("%s, %p - stub\n", debugstr_a(pszRootPath), pSHQueryRBInfo); + + pSHQueryRBInfo->i64Size = 0; + pSHQueryRBInfo->i64NumItems = 0; + + return S_OK; +} + +HRESULT WINAPI SHQueryRecycleBinW(LPCWSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo) +{ + FIXME("%s, %p - stub\n", debugstr_w(pszRootPath), pSHQueryRBInfo); + + pSHQueryRBInfo->i64Size = 0; + pSHQueryRBInfo->i64NumItems = 0; + + return S_OK; +} _____ Modified: trunk/reactos/lib/shell32/shellreg.c --- trunk/reactos/lib/shell32/shellreg.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/shellreg.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -36,7 +36,6 @@ #include "undocshell.h" #include "wine/winbase16.h" -#include "shell32_main.h" #include "wine/debug.h" _____ Modified: trunk/reactos/lib/shell32/shfldr_mycomp.c --- trunk/reactos/lib/shell32/shfldr_mycomp.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/shfldr_mycomp.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -45,7 +45,6 @@ #include "shell32_main.h" #include "shresdef.h" #include "shlwapi.h" -#include "shellfolder.h" #include "wine/debug.h" #include "debughlp.h" #include "shfldr.h" _____ Modified: trunk/reactos/lib/shell32/shlexec.c --- trunk/reactos/lib/shell32/shlexec.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/shlexec.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -38,17 +38,12 @@ #include "winbase.h" #include "winerror.h" #include "winreg.h" -#include "wownt32.h" -#include "shellapi.h" -#include "wingdi.h" #include "winuser.h" -#include "shlobj.h" #include "shlwapi.h" #include "ddeml.h" #include "wine/winbase16.h" #include "shell32_main.h" -#include "undocshell.h" #include "pidl.h" #include "wine/debug.h" @@ -1284,7 +1279,7 @@ retval = execute_from_key(lpstrProtocol, wszApplicationName, env, sei_tmp.lpParameters, execfunc, &sei_tmp, sei); else retval = execfunc(wszQuotedCmd, env, FALSE, &sei_tmp, sei); - if (env) HeapFree( GetProcessHeap(), 0, env ); + HeapFree( GetProcessHeap(), 0, env ); } else if (PathIsURLW((LPWSTR)lpFile)) /* File not found, check for URL */ { @@ -1369,17 +1364,6 @@ } /*********************************************************************** ** - * ShellExecuteEx [SHELL32.291] - * - */ -BOOL WINAPI ShellExecuteExAW (LPVOID sei) -{ - if (SHELL_OsIsUnicode()) - return ShellExecuteExW32 (sei, SHELL_ExecuteW); - return ShellExecuteExA (sei); -} - -/********************************************************************** *** * ShellExecuteExA [SHELL32.292] * */ _____ Modified: trunk/reactos/lib/shell32/shlfileop.c --- trunk/reactos/lib/shell32/shlfileop.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/shlfileop.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -1335,8 +1335,7 @@ if (hFind != INVALID_HANDLE_VALUE) FindClose(hFind); hFind = INVALID_HANDLE_VALUE; - if (pTempFrom) - HeapFree(GetProcessHeap(), 0, pTempFrom); + HeapFree(GetProcessHeap(), 0, pTempFrom); if (retCode) nFileOp.fAnyOperationsAborted = TRUE; TRACE("%s level=%ld AnyOpsAborted=%s ret=0x%x, with %s %s%s\n", @@ -1348,17 +1347,6 @@ return retCode; } -/********************************************************************** *** - * SHFileOperation [SHELL32.@] - * - */ -DWORD WINAPI SHFileOperationAW(LPVOID lpFileOp) -{ - if (SHELL_OsIsUnicode()) - return SHFileOperationW(lpFileOp); - return SHFileOperationA(lpFileOp); -} - #define SHDSA_GetItemCount(hdsa) (*(int*)(hdsa)) /*********************************************************************** ** _____ Modified: trunk/reactos/lib/shell32/shlfolder.c --- trunk/reactos/lib/shell32/shlfolder.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/shlfolder.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -45,11 +45,8 @@ #include "pidl.h" #include "undocshell.h" #include "shell32_main.h" -#include "shresdef.h" #include "shlwapi.h" -#include "shellfolder.h" #include "wine/debug.h" -#include "debughlp.h" #include "shfldr.h" WINE_DEFAULT_DEBUG_CHANNEL (shell); _____ Modified: trunk/reactos/lib/shell32/shlfsbind.c --- trunk/reactos/lib/shell32/shlfsbind.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/shlfsbind.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -33,7 +33,6 @@ #include "shlobj.h" #include "shell32_main.h" -#include "debughlp.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(pidl); _____ Modified: trunk/reactos/lib/shell32/shlview.c --- trunk/reactos/lib/shell32/shlview.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/shlview.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -1380,7 +1380,6 @@ } return TRUE; } - break; case LVN_ENDLABELEDITA: { @@ -1411,7 +1410,6 @@ } return FALSE; } - break; case LVN_KEYDOWN: { @@ -1822,7 +1820,7 @@ { ZeroMemory(&wc, sizeof(wc)); wc.style = CS_HREDRAW | CS_VREDRAW; - wc.lpfnWndProc = (WNDPROC) ShellView_WndProc; + wc.lpfnWndProc = ShellView_WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = shell32_hInstance; _____ Modified: trunk/reactos/lib/shell32/systray.c --- trunk/reactos/lib/shell32/systray.c 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/systray.c 2005-01-12 22:49:57 UTC (rev 12998) @@ -162,7 +162,7 @@ WNDCLASSA wc; wc.style = CS_SAVEBITS|CS_DBLCLKS; - wc.lpfnWndProc = (WNDPROC)SYSTRAY_WndProc; + wc.lpfnWndProc = SYSTRAY_WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = 0; _____ Modified: trunk/reactos/lib/shell32/undocshell.h --- trunk/reactos/lib/shell32/undocshell.h 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/undocshell.h 2005-01-12 22:49:57 UTC (rev 12998) @@ -559,7 +559,7 @@ LPDWORD lpdwUsage, REFIID riidObject); -void WINAPI SHFreeUnusedLibraries(); +void WINAPI SHFreeUnusedLibraries(void); /* SHCreateLinks flags */ #define SHCLF_PREFIXNAME 0x01 _____ Modified: trunk/reactos/lib/shell32/version.h --- trunk/reactos/lib/shell32/version.h 2005-01-12 21:02:21 UTC (rev 12997) +++ trunk/reactos/lib/shell32/version.h 2005-01-12 22:49:57 UTC (rev 12998) @@ -18,11 +18,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#define WINE_FILEVERSION_MAJOR 6 +#define WINE_FILEVERSION_MAJOR 5 #define WINE_FILEVERSION_MINOR 0 -#define WINE_FILEVERSION_BUILD 2600 -#define WINE_FILEVERSION_PLATFORMID 1 +#define WINE_FILEVERSION_BUILD 3900 +#define WINE_FILEVERSION_PLATFORMID 6975 /* FIXME: when libs/wpp gets fixed to support concatenation we can remove * this and define it in version.rc */ -#define WINE_FILEVERSION "6.0.2600.1" +#define WINE_FILEVERSION "5.0.3900.6975"
19 years, 10 months
1
0
0
0
[navaraf] 12997: Fix definion of udphdr and use it.
by navaraf@svn.reactos.com
Fix definion of udphdr and use it. Modified: trunk/reactos/apps/utils/net/tracert/tracert.c _____ Modified: trunk/reactos/apps/utils/net/tracert/tracert.c --- trunk/reactos/apps/utils/net/tracert/tracert.c 2005-01-12 20:49:51 UTC (rev 12996) +++ trunk/reactos/apps/utils/net/tracert/tracert.c 2005-01-12 21:02:21 UTC (rev 12997) @@ -231,10 +231,10 @@ #include <winsock.h> //void print(buf, cc, from); -char * inetname(in); -double deltaT(t1p, t2p); +char * inetname(struct in_addr); +double deltaT(struct timeval *, struct timeval *); void usage(); -void send_probe(seq, ttl); +void send_probe(int, int); #define bzero( ptr, count ) memset( ptr, 0, count ) #define bcopy(src,dest,len) memcpy(dest,src,len) @@ -336,22 +336,22 @@ #define Sprintf (void)sprintf #define Printf (void)printf -// Define the UDP header -// -typedef struct udp_hdr -{ - unsigned short src_portno; // Source port number - unsigned short dst_portno; // Destination port number - unsigned short udp_length; // UDP packet length - unsigned short udp_checksum; // UDP checksum (optional) -} UDP_HDR, *PUDP_HDR; +/* + * Define the UDP header + */ +typedef struct udphdr { + u_short uh_dport; + u_short uh_sport; + u_short uh_sum; + u_short uh_ulen; +} udphdr; /* * format of a (udp) probe packet. */ struct opacket { struct ip ip; - UDP_HDR udp; + udphdr udp; u_char seq; /* sequence number of this packet */ u_char ttl; /* ttl packet left with */ struct timeval tv; /* time packet left */ @@ -428,12 +428,6 @@ WSADATA wsadata; INT status; - status = WSAStartup(MAKEWORD(2, 2), &wsadata); - if (status != 0) { - printf("Could not initialize winsock dll.\n"); - return FALSE; - } - on = 1; seq = tos = 0; to = (struct sockaddr_in *)&whereto; @@ -512,6 +506,12 @@ if (argc < 1) usage(); + status = WSAStartup(MAKEWORD(2, 2), &wsadata); + if (status != 0) { + printf("Could not initialize winsock dll.\n"); + return FALSE; + } + setlinebuf (stdout); (void) bzero((char *)&whereto, sizeof(struct sockaddr)); @@ -736,10 +736,10 @@ ip->ip_v = IPVERSION; ip->ip_id = htons(ident+seq); -// up->uh_sport = htons(ident); -// up->uh_dport = htons(port+seq); -// up->uh_ulen = htons((u_short)(datalen - sizeof(struct ip))); -// up->uh_sum = 0; + up->uh_sport = htons(ident); + up->uh_dport = htons(port+seq); + up->uh_ulen = htons((u_short)(datalen - sizeof(struct ip))); + up->uh_sum = 0; op->seq = seq; op->ttl = ttl; @@ -826,9 +826,9 @@ hip = &icp->icmp_ip; hlen = hip->ip_hl << 2; up = (struct udphdr *)((u_char *)hip + hlen); -// if (hlen + 12 <= cc && hip->ip_p == IPPROTO_UDP && -// up->uh_sport == htons(ident) && -// up->uh_dport == htons(port+seq)) + if (hlen + 12 <= cc && hip->ip_p == IPPROTO_UDP && + up->uh_sport == htons(ident) && + up->uh_dport == htons(port+seq)) if (hlen + 12 <= cc && hip->ip_p == IPPROTO_UDP) return (type == ICMP_TIMXCEED? -1 : code+1); }
19 years, 10 months
1
0
0
0
[arty] 12996: Added table entry for SOCK_RAW IPPROTO_ICMP
by arty@svn.reactos.com
Added table entry for SOCK_RAW IPPROTO_ICMP Modified: trunk/reactos/bootdata/hivesys.inf _____ Modified: trunk/reactos/bootdata/hivesys.inf --- trunk/reactos/bootdata/hivesys.inf 2005-01-12 20:40:52 UTC (rev 12995) +++ trunk/reactos/bootdata/hivesys.inf 2005-01-12 20:49:51 UTC (rev 12996) @@ -719,7 +719,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\WinSock","MaxSo ckAddrLength",0x00010001,0x00000010 HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\WinSock","MinSo ckAddrLength",0x00010001,0x00000010 HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\WinSock","Helpe rDllName",0x00000000,"%SystemRoot%\System32\wshtcpip.dll" -HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\WinSock","Mapp ing",0x00000001,0b,00,00,00,03,00,00,00,02,00,00,00,01,00,00,00,06,00,00 ,00,02,00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,00,00,00,00,06,00,00 ,00,00,00,00,00,00,00,00,00,06,00,00,00,00,00,00,00,01,00,00,00,06,00,00 ,00,02,00,00,00,02,00,00,00,11,00,00,00,02,00,00,00,02,00,00,00,00,00,00 ,00,02,00,00,00,00,00,00,00,11,00,00,00,00,00,00,00,00,00,00,00,11,00,00 ,00,00,00,00,00,02,00,00,00,11,00,00,00,02,00,00,00,03,00,00,00,00,00,00 ,00 +HKLM,"SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\WinSock","Mapp ing",0x00000001,0c,00,00,00,03,00,00,00,02,00,00,00,01,00,00,00,06,00,00 ,00,02,00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,00,00,00,00,06,00,00 ,00,00,00,00,00,00,00,00,00,06,00,00,00,00,00,00,00,01,00,00,00,06,00,00 ,00,02,00,00,00,02,00,00,00,11,00,00,00,02,00,00,00,02,00,00,00,00,00,00 ,00,02,00,00,00,00,00,00,00,11,00,00,00,00,00,00,00,00,00,00,00,11,00,00 ,00,00,00,00,00,02,00,00,00,11,00,00,00,02,00,00,00,03,00,00,00,00,00,00 ,00,02,00,00,00,03,00,00,00,01,00,00 HKLM,"SYSTEM\CurrentControlSet\Services\Winsock\Parameters","Transports" ,0x00010000,"Tcpip" ; Virtual FAT filesystem driver
19 years, 10 months
1
0
0
0
[navaraf] 12995: Call WSAStartup and WSACleanup.
by navaraf@svn.reactos.com
Call WSAStartup and WSACleanup. Modified: trunk/reactos/apps/utils/net/tracert/tracert.c _____ Modified: trunk/reactos/apps/utils/net/tracert/tracert.c --- trunk/reactos/apps/utils/net/tracert/tracert.c 2005-01-12 20:30:04 UTC (rev 12994) +++ trunk/reactos/apps/utils/net/tracert/tracert.c 2005-01-12 20:40:52 UTC (rev 12995) @@ -425,7 +425,15 @@ struct protoent *pe; struct sockaddr_in from, *to; int ch, i, on, probe, seq, tos, ttl; + WSADATA wsadata; + INT status; + status = WSAStartup(MAKEWORD(2, 2), &wsadata); + if (status != 0) { + printf("Could not initialize winsock dll.\n"); + return FALSE; + } + on = 1; seq = tos = 0; to = (struct sockaddr_in *)&whereto; @@ -439,6 +447,7 @@ if (max_ttl <= 1) { Fprintf(stderr, "traceroute: max ttl must be >1.\n"); + WSACleanup(); exit(1); } break; @@ -450,6 +459,7 @@ if (port < 1) { Fprintf(stderr, "traceroute: port must be >0.\n"); + WSACleanup(); exit(1); } break; @@ -458,6 +468,7 @@ if (nprobes < 1) { Fprintf(stderr, "traceroute: nprobes must be >0.\n"); + WSACleanup(); exit(1); } break; @@ -476,6 +487,7 @@ if (tos < 0 || tos > 255) { Fprintf(stderr, "traceroute: tos must be 0 to 255.\n"); + WSACleanup(); exit(1); } break; @@ -487,6 +499,7 @@ if (waittime <= 1) { Fprintf(stderr, "traceroute: wait must be >1 sec.\n"); + WSACleanup(); exit(1); } break; @@ -515,6 +528,7 @@ } else { (void)fprintf(stderr, "traceroute: unknown host %s\n", *argv); + WSACleanup(); exit(1); } } @@ -524,12 +538,14 @@ Fprintf(stderr, "traceroute: packet size must be 0 <= s < %ld.\n", MAXPACKET - sizeof(struct opacket)); + WSACleanup(); exit(1); } datalen += sizeof(struct opacket); outpacket = (struct opacket *)malloc((unsigned)datalen); if (! outpacket) { perror("traceroute: malloc"); + WSACleanup(); exit(1); } (void) bzero((char *)outpacket, datalen); @@ -542,10 +558,12 @@ if ((pe = getprotobyname("icmp")) == NULL) { Fprintf(stderr, "icmp: unknown protocol\n"); + WSACleanup(); exit(10); } if ((s = socket(AF_INET, SOCK_RAW, pe->p_proto)) < 0) { perror("traceroute: icmp socket"); + WSACleanup(); exit(5); } if (options & SO_DEBUG) @@ -557,12 +575,14 @@ if ((sndsock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW)) < 0) { perror("traceroute: raw socket"); + WSACleanup(); exit(5); } #ifdef SO_SNDBUF if (setsockopt(sndsock, SOL_SOCKET, SO_SNDBUF, (char *)&datalen, sizeof(datalen)) < 0) { perror("traceroute: SO_SNDBUF"); + WSACleanup(); exit(6); } #endif /* SO_SNDBUF */ @@ -570,6 +590,7 @@ if (setsockopt(sndsock, IPPROTO_IP, IP_HDRINCL, (char *)&on, sizeof(on)) < 0) { perror("traceroute: IP_HDRINCL"); + WSACleanup(); exit(6); } #endif /* IP_HDRINCL */ @@ -586,12 +607,14 @@ from.sin_addr.s_addr = inet_addr(source); if (from.sin_addr.s_addr == -1) { Printf("traceroute: unknown host %s\n", source); + WSACleanup(); exit(1); } outpacket->ip.ip_src = from.sin_addr; #ifndef IP_HDRINCL if (bind(sndsock, (struct sockaddr *)&from, sizeof(from)) < 0) { perror ("traceroute: bind:"); + WSACleanup(); exit (1); } #endif /* IP_HDRINCL */ @@ -664,9 +687,14 @@ (void) fflush(stdout); } putchar('\n'); - if (got_there || unreachable >= nprobes-1) + if (got_there || unreachable >= nprobes-1) { + WSACleanup(); exit(0); + } } + + WSACleanup(); + return 0; } int
19 years, 10 months
1
0
0
0
← Newer
1
...
35
36
37
38
39
40
41
...
71
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
Results per page:
10
25
50
100
200