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
2025
January
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
April 2009
----- 2025 -----
January 2025
----- 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
25 participants
476 discussions
Start a n
N
ew thread
[cfinck] 372: Reorganize the directory structure to make more sense and checkouts on the Web Server easier
by cfinck@svn.reactos.org
Author: cfinck Date: Wed Apr 15 18:13:42 2009 New Revision: 372 URL:
http://svn.reactos.org/svn/reactos?rev=372&view=rev
Log: Reorganize the directory structure to make more sense and checkouts on the Web Server easier Added: branches/danny-web/resources/ (props changed) - copied from r371,
branches/danny-web/reactos.org/resources/
branches/danny-web/scripts/ (props changed) - copied from r371,
branches/danny-web/reactos.org/scripts/
branches/danny-web/sql/ (props changed) - copied from r371,
branches/danny-web/reactos.org/sql/
branches/danny-web/www/ - copied from r371,
branches/danny-web/reactos.org/
branches/danny-web/www/www.reactos.org/
- copied from r371,
branches/danny-web/reactos.org/htdocs/
Removed:
branches/danny-web/reactos.org/
branches/danny-web/www/htdocs/ branches/danny-web/www/resources/ branches/danny-web/www/scripts/ branches/danny-web/www/sql/ Propchange: branches/danny-web/resources/ ------------------------------------------------------------------------------ svn:mergeinfo = /trunk/web/reactos.org/resources:288-336 Propchange: branches/danny-web/scripts/ ------------------------------------------------------------------------------ svn:mergeinfo = /trunk/web/reactos.org/scripts:288-336 Propchange: branches/danny-web/sql/ ------------------------------------------------------------------------------ svn:mergeinfo = /trunk/web/reactos.org/sql:288-336
15 years, 9 months
1
0
0
0
[gschneider] 40526: - Allow creation of icons without color bitmap in CreateIconIndirect - Compare color and mask size if color is present, compare height against height - Fixes 13 user32 cursoricon winetests - DbgPrint -> ERR or FIXME
by gschneider@svn.reactos.org
Author: gschneider Date: Wed Apr 15 16:36:37 2009 New Revision: 40526 URL:
http://svn.reactos.org/svn/reactos?rev=40526&view=rev
Log: - Allow creation of icons without color bitmap in CreateIconIndirect - Compare color and mask size if color is present, compare height against height - Fixes 13 user32 cursoricon winetests - DbgPrint -> ERR or FIXME Modified: trunk/reactos/dll/win32/user32/windows/bitmap.c trunk/reactos/dll/win32/user32/windows/icon.c Modified: trunk/reactos/dll/win32/user32/windows/bitmap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/b…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/bitmap.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/bitmap.c [iso-8859-1] Wed Apr 15 16:36:37 2009 @@ -285,7 +285,7 @@ if (fuLoad & LR_SHARED) { - DbgPrint("FIXME: need LR_SHARED support for loading icon images from files\n"); + FIXME("Need LR_SHARED support for loading icon images from files\n"); } hFile = CreateFileW(lpszName, GENERIC_READ, FILE_SHARE_READ, NULL, @@ -491,7 +491,7 @@ if (Hit) { - DbgPrint("We have a thread overrun, these are already freed! pi -> %d bi -> %d\n", PrivateInfo, BitmapInfo); + ERR("We have a thread overrun, these are already freed! pi -> %d, bi -> %d\n", PrivateInfo, BitmapInfo); RtlFreeHeap(GetProcessHeap(), 0, PrivateInfo); if (fuLoad & LR_LOADFROMFILE) UnmapViewOfFile(BitmapInfo); Modified: trunk/reactos/dll/win32/user32/windows/icon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/i…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/icon.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/icon.c [iso-8859-1] Wed Apr 15 16:36:37 2009 @@ -345,20 +345,19 @@ { return (HICON)0; } - /* FIXME - does there really *have* to be a color bitmap? monochrome cursors don't have one */ - if(/*IconInfo->hbmColor &&*/ !GetObjectW(IconInfo->hbmColor, sizeof(BITMAP), &ColorBitmap)) + + /* Try to get color bitmap */ + if (GetObjectW(IconInfo->hbmColor, sizeof(BITMAP), &ColorBitmap)) { - return (HICON)0; + /* Compare size of color and mask bitmap*/ + if(ColorBitmap.bmWidth != MaskBitmap.bmWidth || + ColorBitmap.bmHeight != MaskBitmap.bmHeight) + { + ERR("Color and mask size are different!"); + SetLastError(ERROR_INVALID_PARAMETER); + return (HICON)0; + } } - - /* FIXME - i doubt this is right (monochrome cursors */ - /*if(ColorBitmap.bmWidth != MaskBitmap.bmWidth || - ColorBitmap.bmHeight != MaskBitmap.bmWidth) - { - SetLastError(ERROR_INVALID_PARAMETER); - return (HICON)0; - }*/ - return (HICON)NtUserCreateCursorIconHandle(IconInfo, TRUE); }
15 years, 9 months
1
0
0
0
[dgoette] 371: * fix a problem in subsystem_wiki, wrong user_id was used and resulted in an error message * remove some queries that inserted a new mapping, where only the subsystem data should be updated
by dgoette@svn.reactos.org
Author: dgoette Date: Wed Apr 15 16:12:25 2009 New Revision: 371 URL:
http://svn.reactos.org/svn/reactos?rev=371&view=rev
Log: * fix a problem in subsystem_wiki, wrong user_id was used and resulted in an error message * remove some queries that inserted a new mapping, where only the subsystem data should be updated Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_Bugzil…
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_PHPBB.…
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_Wiki.c…
Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_Bugzil…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_Bugzil…
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_Bugzil…
[iso-8859-1] Wed Apr 15 16:12:25 2009 @@ -235,16 +235,8 @@ if (false === self::updateUserPrivate($user_id, $user['name'], $user['email'],$user['register'], $bz_user_id)){ return false; } - - // Insert a row in the mapping table - $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_SUBSYS." (user_id, subsys, subsys_user_id) VALUES(:roscms_user, 'bugzilla', :bugzilla_user)"); - $stmt->bindParam('roscms_user',$user_id,PDO::PARAM_INT); - $stmt->bindParam('bugzilla_user',$bz_user_id,PDO::PARAM_INT); - $stmt->execute() or die('DB error (subsys_bugzilla #9)'); - - return true; - } - return false; + } + return true; } // end of member function addMapping Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_PHPBB.…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_PHPBB.…
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_PHPBB.…
[iso-8859-1] Wed Apr 15 16:12:25 2009 @@ -232,22 +232,8 @@ if (false === self::updateUserPrivate($user_id, $user['name'], $user['email'],$user['register'], $phpbb_user_id)){ return false; } - - $stmt=&DBConnection::getInstance()->prepare("SELECT 1 FROM ".ROSCMST_SUBSYS." WHERE user_id=:roscms_user AND subsys='phpbb' AND subsys_user_id=:phpbb_user"); - $stmt->bindParam('roscms_user',$user_id,PDO::PARAM_INT); - $stmt->bindParam('phpbb_user',$phpbb_user_id,PDO::PARAM_INT); - $stmt->execute(); - if ($stmt->fetchColumn() === false) { - - // Insert a row in the mapping table - $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_SUBSYS." (user_id, subsys, subsys_user_id) VALUES(:roscms_user, 'phpbb', :phpbb_user)"); - $stmt->bindParam('roscms_user',$user_id,PDO::PARAM_INT); - $stmt->bindParam('phpbb_user',$phpbb_user_id,PDO::PARAM_INT); - $stmt->execute() or die('DB error (subsys_phpbb #9)'); - } - - return true; - } + } + return true; } // end of member function addUser Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_Wiki.c…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_Wiki.c…
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_Wiki.c…
[iso-8859-1] Wed Apr 15 16:12:25 2009 @@ -120,7 +120,7 @@ $stmt=&DBConnection::getInstance()->prepare("SELECT COUNT(*) FROM ".$this->user_table." WHERE (LOWER(user_name) = LOWER(:user_name) OR LOWER(user_email) = LOWER(:user_email)) AND user_id <> :user_id"); $stmt->bindParam('user_name',$wiki_user_name,PDO::PARAM_STR); $stmt->bindParam('user_email',$user_email,PDO::PARAM_STR); - $stmt->bindParam('user_id',$user_id,PDO::PARAM_INT); + $stmt->bindParam('user_id',$subsys_user,PDO::PARAM_INT); $stmt->execute() or die('DB error (subsys_wiki #7)'); // stop if one of both already exists @@ -214,13 +214,8 @@ if (false === self::updateUserPrivate($user_id, $user['name'], $user['email'], $user['fullname'], $wiki_user_id)) { return false; } - - // Insert a row in the mapping table - $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_SUBSYS." (user_id, subsys, subsys_user_id) VALUES(:roscms_user, 'wiki', :wiki_user)"); - $stmt->bindParam('roscms_user',$user_id,PDO::PARAM_INT); - $stmt->bindParam('wiki_user',$wiki_user_id,PDO::PARAM_INT); - return $stmt->execute(); - } + } + return true; } // end of member function addUser
15 years, 9 months
1
0
0
0
[dchapyshev] 40525: - Implement ThreadPriorityBoost case in NtQueryInformationThread - Add ThreadDescriptorTableEntry case - Add check of parametres Approved by Aleksey.
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Apr 15 15:57:48 2009 New Revision: 40525 URL:
http://svn.reactos.org/svn/reactos?rev=40525&view=rev
Log: - Implement ThreadPriorityBoost case in NtQueryInformationThread - Add ThreadDescriptorTableEntry case - Add check of parametres Approved by Aleksey. Modified: trunk/reactos/ntoskrnl/ps/query.c Modified: trunk/reactos/ntoskrnl/ps/query.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/query.c?rev=40…
============================================================================== --- trunk/reactos/ntoskrnl/ps/query.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ps/query.c [iso-8859-1] Wed Apr 15 15:57:48 2009 @@ -1306,17 +1306,27 @@ KIRQL OldIrql; PAGED_CODE(); - /* Verify Information Class validity */ -#if 0 - Status = DefaultQueryInfoBufferCheck(ThreadInformationClass, - PsThreadInfoClass, - RTL_NUMBER_OF(PsThreadInfoClass), - ThreadInformation, - ThreadInformationLength, - ReturnLength, - PreviousMode); - if (!NT_SUCCESS(Status)) return Status; -#endif + if (PreviousMode != KernelMode) + { + _SEH2_TRY + { + ProbeForWrite(ThreadInformation, + ThreadInformationLength, + sizeof(ULONG)); + + if (ReturnLength) + { + ProbeForWriteUlong(ReturnLength); + } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if (!NT_SUCCESS(Status)) return Status; + } /* Check what class this is */ Access = THREAD_QUERY_INFORMATION; @@ -1497,6 +1507,33 @@ /* Lower IRQL back */ KeLowerIrql(OldIrql); + break; + + case ThreadDescriptorTableEntry: + DPRINT1("NtQueryInformationThread(): case ThreadDescriptorTableEntry not implemented!\n"); + Status = STATUS_NOT_IMPLEMENTED; + break; + + case ThreadPriorityBoost: + + /* Set the return length*/ + Length = sizeof(ULONG); + + if (ThreadInformationLength != Length) + { + Status = STATUS_INFO_LENGTH_MISMATCH; + break; + } + + _SEH2_TRY + { + *(PULONG)ThreadInformation = Thread->Tcb.DisableBoost ? 1 : 0; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; break; /* Anything else */
15 years, 9 months
1
0
0
0
[dgoette] 370: * fix old table name and old attribute * fix typo in another attribute
by dgoette@svn.reactos.org
Author: dgoette Date: Wed Apr 15 15:57:10 2009 New Revision: 370 URL:
http://svn.reactos.org/svn/reactos?rev=370&view=rev
Log: * fix old table name and old attribute * fix typo in another attribute Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_Bugzil…
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_User_Login.class…
Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_Bugzil…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_Bugzil…
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/subsystem/Subsystem_Bugzil…
[iso-8859-1] Wed Apr 15 15:57:10 2009 @@ -186,7 +186,7 @@ } // Finally, insert a row in the mapping table - $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_SUBSYS." (user_id, subsys, subsy_user_id) VALUES(:user_id, 'bugzilla', LAST_INSERT_ID())"); + $stmt=&DBConnection::getInstance()->prepare("INSERT INTO ".ROSCMST_SUBSYS." (user_id, subsys, subsys_user_id) VALUES(:user_id, 'bugzilla', LAST_INSERT_ID())"); $stmt->bindParam('user_id',$user_id,PDO::PARAM_INT); return $stmt->execute(); } // end of member function addUser Modified:
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_User_Login.class…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/reactos.org/htdocs/ro…
============================================================================== ---
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_User_Login.class…
[iso-8859-1] (original) +++
branches/danny-web/reactos.org/htdocs/roscms/lib/view/HTML_User_Login.class…
[iso-8859-1] Wed Apr 15 15:57:10 2009 @@ -153,7 +153,7 @@ // At this point, we've passed all checks and we have a valid login check if there's an existing session, if so, end that session if (0 != Login::in( Login::OPTIONAL, '')) { - $stmt=&DBConnection::getInstance()->prepare("DELETE FROM user_sessions WHERE usersession_user_id =:user_id"); + $stmt=&DBConnection::getInstance()->prepare("DELETE FROM ".ROSCMST_SESSIONS." WHERE user_id =:user_id"); $stmt->bindParam('user_id',$_COOKIE[$config->cookieUserKey()],PDO::PARAM_INT); $stmt->execute(); }
15 years, 9 months
1
0
0
0
[janderwald] 40524: - Plug in sample rate conversion library, doesnt work yet - Implement calloc, memset, memcpy as calling their Rtl* wrapper doesnt work- Add define for AC97 hacks
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Apr 15 14:41:41 2009 New Revision: 40524 URL:
http://svn.reactos.org/svn/reactos?rev=40524&view=rev
Log: - Plug in sample rate conversion library, doesnt work yet - Implement calloc, memset, memcpy as calling their Rtl* wrapper doesnt work- Add define for AC97 hacks Modified: trunk/reactos/drivers/wdm/audio/filters/kmixer/pin.c trunk/reactos/drivers/wdm/audio/sysaudio/control.c Modified: trunk/reactos/drivers/wdm/audio/filters/kmixer/pin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/filters/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/filters/kmixer/pin.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/filters/kmixer/pin.c [iso-8859-1] Wed Apr 15 14:41:41 2009 @@ -9,6 +9,140 @@ #include "kmixer.h" const GUID KSPROPSETID_Connection = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}}; + +NTSTATUS +PerformSampleRateConversion( + PUCHAR Buffer, + ULONG BufferLength, + ULONG OldRate, + ULONG NewRate, + ULONG BytesPerSample, + ULONG NumChannels, + PVOID * Result, + PULONG ResultLength) +{ + KFLOATING_SAVE FloatSave; + NTSTATUS Status; + ULONG Index; + SRC_STATE * State; + SRC_DATA Data; + PUCHAR ResultOut; + int error; + PFLOAT FloatIn, FloatOut; + ULONG NumSamples; + ULONG NewSamples; + + DPRINT("PerformSampleRateConversion OldRate %u NewRate %u BytesPerSample %u NumChannels %u Irql %u\n", OldRate, NewRate, BytesPerSample, NumChannels, KeGetCurrentIrql()); + + /* first acquire float save context */ + Status = KeSaveFloatingPointState(&FloatSave); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("KeSaveFloatingPointState failed with %x\n", Status); + return Status; + } + + NumSamples = BufferLength / BytesPerSample; + + FloatIn = ExAllocatePool(NonPagedPool, NumSamples * sizeof(FLOAT)); + if (!FloatIn) + { + KeRestoreFloatingPointState(&FloatSave); + return STATUS_INSUFFICIENT_RESOURCES; + } + + NewSamples = lrintf(((FLOAT)NumSamples * ((FLOAT)NewRate / (FLOAT)OldRate))) + 2; + + FloatOut = ExAllocatePool(NonPagedPool, NewSamples * sizeof(FLOAT)); + if (!FloatOut) + { + ExFreePool(FloatIn); + KeRestoreFloatingPointState(&FloatSave); + return STATUS_INSUFFICIENT_RESOURCES; + } + + ResultOut = ExAllocatePool(NonPagedPool, NewSamples * (BytesPerSample/8)); + if (!FloatOut) + { + ExFreePool(FloatIn); + ExFreePool(FloatOut); + KeRestoreFloatingPointState(&FloatSave); + return STATUS_INSUFFICIENT_RESOURCES; + } + + State = src_new(SRC_SINC_FASTEST, NumChannels, &error); + if (!State) + { + DPRINT1("KeSaveFloatingPointState failed with %x\n", Status); + KeRestoreFloatingPointState(&FloatSave); + ExFreePool(FloatIn); + ExFreePool(FloatOut); + ExFreePool(ResultOut); + return STATUS_UNSUCCESSFUL; + } + + /* fixme use asm */ + if (BytesPerSample == 8) + { + for(Index = 0; Index < NumSamples; Index++) + FloatIn[Index] = (float)Buffer[Index]; + } + else if (BytesPerSample == 16) + { + PUSHORT Res = (PUSHORT)ResultOut; + for(Index = 0; Index < NumSamples; Index++) + FloatIn[Index] = (float)_byteswap_ushort(Res[Index]); + } + else + { + UNIMPLEMENTED + KeRestoreFloatingPointState(&FloatSave); + ExFreePool(FloatIn); + ExFreePool(FloatOut); + ExFreePool(ResultOut); + return STATUS_UNSUCCESSFUL; + } + + Data.data_in = FloatIn; + Data.data_out = FloatOut; + Data.input_frames = NumSamples / NumChannels; + Data.output_frames = NewSamples / NumChannels; + Data.src_ratio = (double)NewRate / (double)OldRate; + + error = src_process(State, &Data); + if (error) + { + DPRINT1("src_process failed with %x\n", error); + KeRestoreFloatingPointState(&FloatSave); + ExFreePool(FloatIn); + ExFreePool(FloatOut); + ExFreePool(ResultOut); + return STATUS_UNSUCCESSFUL; + } + + if (BytesPerSample == 8) + { + for(Index = 0; Index < Data.output_frames_gen * NumChannels; Index++) + ResultOut[Index] = lrintf(FloatOut[Index]); + } + else if (BytesPerSample == 16) + { + PUSHORT Res = (PUSHORT)ResultOut; + + for(Index = 0; Index < Data.output_frames_gen * NumChannels; Index++) + Res[Index] = _byteswap_ushort(lrintf(FloatOut[Index])); + } + + *Result = ResultOut; + *ResultLength = Data.output_frames_gen * (BytesPerSample/8) * NumChannels; + ExFreePool(FloatIn); + ExFreePool(FloatOut); + src_delete(State); + KeRestoreFloatingPointState(&FloatSave); + + return STATUS_SUCCESS; +} NTSTATUS PerformChannelConversion( @@ -502,7 +636,7 @@ StreamHeader->DataUsed, InputFormat->WaveFormatEx.nChannels, OutputFormat->WaveFormatEx.nChannels, - InputFormat->WaveFormatEx.wBitsPerSample, + OutputFormat->WaveFormatEx.wBitsPerSample, &BufferOut, &BufferLength); @@ -516,9 +650,20 @@ if (InputFormat->WaveFormatEx.nSamplesPerSec != OutputFormat->WaveFormatEx.nSamplesPerSec) { - /* sample format conversion must be done in a deferred routine */ - DPRINT1("SampleRate conversion not available yet %u %u\n", InputFormat->WaveFormatEx.nSamplesPerSec, OutputFormat->WaveFormatEx.nSamplesPerSec); - return FALSE; + Status = PerformSampleRateConversion(StreamHeader->Data, + StreamHeader->DataUsed, + InputFormat->WaveFormatEx.nSamplesPerSec, + OutputFormat->WaveFormatEx.nSamplesPerSec, + OutputFormat->WaveFormatEx.wBitsPerSample, + OutputFormat->WaveFormatEx.nChannels, + &BufferOut, + &BufferLength); + if (NT_SUCCESS(Status)) + { + ExFreePool(StreamHeader->Data); + StreamHeader->Data = BufferOut; + StreamHeader->DataUsed = BufferLength; + } } if (NT_SUCCESS(Status)) @@ -567,9 +712,13 @@ void * calloc(size_t Elements, size_t ElementSize) { - PVOID Block = ExAllocatePool(NonPagedPool, Elements * ElementSize); - if (Block) - RtlZeroMemory(Block, Elements * ElementSize); + ULONG Index; + PUCHAR Block = ExAllocatePool(NonPagedPool, Elements * ElementSize); + if (!Block) + return NULL; + + for(Index = 0; Index < Elements * ElementSize; Index++) + Block[Index] = 0; return Block; } @@ -584,7 +733,12 @@ int c, size_t count) { - RtlFillMemory(dest, count, c); + ULONG Index; + PUCHAR Block = (PUCHAR)dest; + + for(Index = 0; Index < count; Index++) + Block[Index] = c; + return dest; } @@ -593,18 +747,10 @@ const void* src, size_t count) { - RtlCopyMemory(dest, src, count); + ULONG Index; + PUCHAR Src = (PUCHAR)src, Dest = (PUCHAR)dest; + + for(Index = 0; Index < count; Index++) + Dest[Index] = Src[Index]; return dest; } - -void *memmove( - void* dest, - const void* src, - size_t count) -{ - RtlMoveMemory(dest, src, count); - return dest; -} - - - Modified: trunk/reactos/drivers/wdm/audio/sysaudio/control.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/control.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/control.c [iso-8859-1] Wed Apr 15 14:41:41 2009 @@ -201,6 +201,7 @@ PFILE_OBJECT RealFileObject = NULL, VirtualFileObject = NULL; PSYSAUDIO_CLIENT AudioClient; PSYSAUDIO_PIN_HANDLE ClientPinHandle; + PKSDATAFORMAT_WAVEFORMATEX InputFormat; PKSDATAFORMAT_WAVEFORMATEX OutputFormat = NULL; PKSPIN_CONNECT MixerPinConnect = NULL; PPIN_WORKER_CONTEXT WorkerContext = (PPIN_WORKER_CONTEXT)Context; @@ -215,6 +216,11 @@ ASSERT(WorkerContext->PinConnect); ASSERT(WorkerContext->Entry->Pins); ASSERT(WorkerContext->Entry->NumberOfPins > WorkerContext->PinConnect->PinId); + + + /* Fetch input format */ + InputFormat = (PKSDATAFORMAT_WAVEFORMATEX)(WorkerContext->PinConnect + 1); + /* Let's try to create the audio irp pin */ Status = KsCreatePin(WorkerContext->Entry->Handle, WorkerContext->PinConnect, GENERIC_READ | GENERIC_WRITE, &RealPinHandle); @@ -258,6 +264,8 @@ KeBugCheck(0); return; } + DPRINT(" InputFormat: SampleRate %u Bits %u Channels %u\n", InputFormat->WaveFormatEx.nSamplesPerSec, InputFormat->WaveFormatEx.wBitsPerSample, InputFormat->WaveFormatEx.nChannels); + DPRINT("OutputFormat: SampleRate %u Bits %u Channels %u\n", OutputFormat->WaveFormatEx.nSamplesPerSec, OutputFormat->WaveFormatEx.wBitsPerSample, OutputFormat->WaveFormatEx.nChannels); } /* get pin file object */ @@ -286,15 +294,10 @@ /* Do we need to transform the audio stream */ if (OutputFormat != NULL) { - PKSDATAFORMAT InputFormat; - - /* Fetch input format */ - InputFormat = (PKSDATAFORMAT)(WorkerContext->PinConnect + 1); - /* Now create the mixer pin */ Status = CreateMixerPinAndSetFormat(WorkerContext->DeviceExtension->KMixerHandle, MixerPinConnect, - InputFormat, + (PKSDATAFORMAT)InputFormat, (PKSDATAFORMAT)OutputFormat, &WorkerContext->DispatchContext->hMixerPin, &WorkerContext->DispatchContext->MixerFileObject); @@ -583,6 +586,7 @@ AudioRange = (PKSDATARANGE_AUDIO)((PUCHAR)AudioRange + AudioRange->DataRange.FormatSize); } /* Select best quality available */ + MixerFormat->DataFormat.FormatSize = sizeof(KSDATAFORMAT) + sizeof(WAVEFORMATEX); MixerFormat->DataFormat.Flags = 0; MixerFormat->DataFormat.Reserved = 0; @@ -591,9 +595,23 @@ MixerFormat->DataFormat.Specifier = KSDATAFORMAT_SPECIFIER_WAVEFORMATEX; MixerFormat->DataFormat.SampleSize = 4; MixerFormat->WaveFormatEx.wFormatTag = ClientFormat->WaveFormatEx.wFormatTag; - MixerFormat->WaveFormatEx.nChannels = min(2, AudioRange->MaximumChannels); /* AC97 does not support mono render / record */ +#ifndef NO_AC97_HACK + /* HACK: AC97 does not support mono render / record */ + MixerFormat->WaveFormatEx.nChannels = 2; + /*HACK: AC97 only supports 16-Bit Bits */ + MixerFormat->WaveFormatEx.wBitsPerSample = 16; + +#else + MixerFormat->WaveFormatEx.nChannels = min(ClientFormat->WaveFormatEx.nSamplesPerSec, AudioRange->MaximumChannels); + MixerFormat->WaveFormatEx.wBitsPerSample = AudioRange->MaximumBitsPerSample; +#endif + +#ifdef KMIXER_RESAMPLING_IMPLEMENTED MixerFormat->WaveFormatEx.nSamplesPerSec = AudioRange->MaximumSampleFrequency; - MixerFormat->WaveFormatEx.wBitsPerSample = AudioRange->MaximumBitsPerSample; +#else + MixerFormat->WaveFormatEx.nSamplesPerSec = max(AudioRange->MinimumSampleFrequency, min(ClientFormat->WaveFormatEx.nSamplesPerSec, AudioRange->MaximumSampleFrequency)); +#endif + MixerFormat->WaveFormatEx.cbSize = 0; MixerFormat->WaveFormatEx.nBlockAlign = (MixerFormat->WaveFormatEx.nChannels * MixerFormat->WaveFormatEx.wBitsPerSample) / 8; MixerFormat->WaveFormatEx.nAvgBytesPerSec = MixerFormat->WaveFormatEx.nChannels * MixerFormat->WaveFormatEx.nSamplesPerSec * (MixerFormat->WaveFormatEx.wBitsPerSample / 8);
15 years, 9 months
1
0
0
0
[dchapyshev] 40523: - At an exception returns STATUS_DLL_NOT_FOUND. It fixes one wine test
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Apr 15 14:20:10 2009 New Revision: 40523 URL:
http://svn.reactos.org/svn/reactos?rev=40523&view=rev
Log: - At an exception returns STATUS_DLL_NOT_FOUND. It fixes one wine test Modified: trunk/reactos/dll/ntdll/ldr/utils.c Modified: trunk/reactos/dll/ntdll/ldr/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/utils.c?rev=…
============================================================================== --- trunk/reactos/dll/ntdll/ldr/utils.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/utils.c [iso-8859-1] Wed Apr 15 14:20:10 2009 @@ -2512,7 +2512,7 @@ } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - /* Ignore exception and return */ + _SEH2_YIELD(return STATUS_DLL_NOT_FOUND); } _SEH2_END; return STATUS_PROCEDURE_NOT_FOUND;
15 years, 9 months
1
0
0
0
[dchapyshev] 40522: - Use SEH in LdrGetProcedureAddress. It fixes an exception in "kernel32_winetest module" and some wine tests
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Apr 15 13:27:59 2009 New Revision: 40522 URL:
http://svn.reactos.org/svn/reactos?rev=40522&view=rev
Log: - Use SEH in LdrGetProcedureAddress. It fixes an exception in "kernel32_winetest module" and some wine tests Modified: trunk/reactos/dll/ntdll/ldr/utils.c Modified: trunk/reactos/dll/ntdll/ldr/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/utils.c?rev=…
============================================================================== --- trunk/reactos/dll/ntdll/ldr/utils.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/utils.c [iso-8859-1] Wed Apr 15 13:27:59 2009 @@ -2486,7 +2486,9 @@ DPRINT("LdrGetProcedureAddress (BaseAddress %p Name %Z Ordinal %lu ProcedureAddress %p)\n", BaseAddress, Name, Ordinal, ProcedureAddress); - if (Name && Name->Length) + _SEH2_TRY + { + if (Name && Name->Length) { /* by name */ *ProcedureAddress = LdrGetExportByName(BaseAddress, (PUCHAR)Name->Buffer, 0xffff); @@ -2496,7 +2498,7 @@ } DPRINT("LdrGetProcedureAddress: Can't resolve symbol '%Z'\n", Name); } - else + else { /* by ordinal */ Ordinal &= 0x0000FFFF; @@ -2507,6 +2509,12 @@ } DPRINT("LdrGetProcedureAddress: Can't resolve symbol @%lu\n", Ordinal); } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + /* Ignore exception and return */ + } + _SEH2_END; return STATUS_PROCEDURE_NOT_FOUND; }
15 years, 9 months
1
0
0
0
[fireball] 40521: - Disable ACPI once again until bug 3363 and bug 4221 are fixed. See issue #3363 for more details.
by fireball@svn.reactos.org
Author: fireball Date: Wed Apr 15 13:19:24 2009 New Revision: 40521 URL:
http://svn.reactos.org/svn/reactos?rev=40521&view=rev
Log: - Disable ACPI once again until bug 3363 and bug 4221 are fixed. See issue #3363 for more details. Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Wed Apr 15 13:19:24 2009 @@ -13,7 +13,7 @@ #define NDEBUG #include <debug.h> -#define ENABLE_ACPI +//#define ENABLE_ACPI /* GLOBALS *******************************************************************/
15 years, 9 months
1
0
0
0
[cwittich] 40520: sync wininet urlcache.c with wine 1.1.19 - fixes memory corruptions
by cwittich@svn.reactos.org
Author: cwittich Date: Wed Apr 15 13:17:12 2009 New Revision: 40520 URL:
http://svn.reactos.org/svn/reactos?rev=40520&view=rev
Log: sync wininet urlcache.c with wine 1.1.19 - fixes memory corruptions Modified: trunk/reactos/dll/win32/wininet/urlcache.c 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] Wed Apr 15 13:17:12 2009 @@ -2,7 +2,7 @@ * Wininet - Url Cache functions * * Copyright 2001,2002 CodeWeavers - * Copyright 2003 Robert Shearman + * Copyright 2003-2008 Robert Shearman * * Eric Kohl * Aric Stewart @@ -25,14 +25,22 @@ #include "config.h" #include "wine/port.h" +#define NONAMELESSUNION +#define NONAMELESSSTRUCT + +#if defined(__MINGW32__) || defined (_MSC_VER) +#include <ws2tcpip.h> +#endif + #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <sys/types.h> +#ifdef HAVE_SYS_SOCKET_H +# include <sys/socket.h> +#endif #include <time.h> - -#define NONAMELESSUNION -#define NONAMELESSSTRUCT #include "windef.h" #include "winbase.h" @@ -178,7 +186,7 @@ /* List of all containers available */ static struct list UrlContainers = LIST_INIT(UrlContainers); -static HASH_CACHEFILE_ENTRY *URLCache_CreateHashTable(LPURLCACHE_HEADER pHeader, HASH_CACHEFILE_ENTRY *pPrevHash); +static DWORD URLCache_CreateHashTable(LPURLCACHE_HEADER pHeader, HASH_CACHEFILE_ENTRY *pPrevHash, HASH_CACHEFILE_ENTRY **ppHash); /*********************************************************************** * URLCache_PathToObjectName (Internal) @@ -206,11 +214,11 @@ * Opens the index file and saves mapping handle in hCacheIndexMapping * * RETURNS - * TRUE if succeeded - * FALSE if failed - * - */ -static BOOL URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer) + * ERROR_SUCCESS if succeeded + * Any other Win32 error code if failed + * + */ +static DWORD URLCacheContainer_OpenIndex(URLCACHECONTAINER * pContainer) { HANDLE hFile; WCHAR wszFilePath[MAX_PATH]; @@ -220,7 +228,7 @@ static const WCHAR wszMappingFormat[] = {'%','s','%','s','_','%','l','u',0}; if (pContainer->hMapping) - return TRUE; + return ERROR_SUCCESS; strcpyW(wszFilePath, pContainer->path); strcatW(wszFilePath, wszIndex); @@ -235,7 +243,7 @@ if (hFile == INVALID_HANDLE_VALUE) { TRACE("Could not open or create cache index file \"%s\"\n", debugstr_w(wszFilePath)); - return FALSE; + return GetLastError(); } /* At this stage we need the mutex because we may be about to create the @@ -247,7 +255,7 @@ if (dwFileSize == INVALID_FILE_SIZE) { ReleaseMutex(pContainer->hMutex); - return FALSE; + return GetLastError(); } if (dwFileSize == 0) @@ -256,7 +264,7 @@ HKEY key; char achZeroes[0x1000]; DWORD dwOffset; - DWORD dwError = 0; + DWORD dwError = ERROR_SUCCESS; /* Write zeroes to the entire file so we can safely map it without * fear of getting a SEGV because the disk is full. @@ -282,7 +290,7 @@ } } - if (!dwError) + if (dwError == ERROR_SUCCESS) { HANDLE hMapping = CreateFileMappingW(hFile, NULL, PAGE_READWRITE, 0, NEWFILE_SIZE, NULL); @@ -296,6 +304,7 @@ WCHAR wszDirPath[MAX_PATH]; FILETIME ft; int i, j; + HASH_CACHEFILE_ENTRY *pHashEntry; dwFileSize = NEWFILE_SIZE; @@ -326,7 +335,7 @@ RegCloseKey(key); } - URLCache_CreateHashTable(pHeader, NULL); + URLCache_CreateHashTable(pHeader, NULL, &pHashEntry); /* Last step - create the directories */ @@ -416,8 +425,7 @@ CloseHandle(hFile); DeleteFileW(wszFilePath); ReleaseMutex(pContainer->hMutex); - SetLastError(dwError); - return FALSE; + return dwError; } } @@ -433,10 +441,10 @@ if (!pContainer->hMapping) { ERR("Couldn't create file mapping (error is %d)\n", GetLastError()); - return FALSE; - } - - return TRUE; + return GetLastError(); + } + + return ERROR_SUCCESS; } /*********************************************************************** @@ -579,7 +587,7 @@ ); } -static BOOL URLCacheContainers_FindContainerW(LPCWSTR lpwszUrl, URLCACHECONTAINER ** ppContainer) +static DWORD URLCacheContainers_FindContainerW(LPCWSTR lpwszUrl, URLCACHECONTAINER ** ppContainer) { URLCACHECONTAINER * pContainer; @@ -590,19 +598,18 @@ int prefix_len = strlenW(pContainer->cache_prefix); if (!strncmpW(pContainer->cache_prefix, lpwszUrl, prefix_len)) { - TRACE("found container with prefx %s for URL %s\n", debugstr_w(pContainer->cache_prefix), debugstr_w(lpwszUrl)); + TRACE("found container with prefix %s for URL %s\n", debugstr_w(pContainer->cache_prefix), debugstr_w(lpwszUrl)); *ppContainer = pContainer; - return TRUE; + return ERROR_SUCCESS; } } ERR("no container found\n"); - SetLastError(ERROR_FILE_NOT_FOUND); - return FALSE; -} - -static BOOL URLCacheContainers_FindContainerA(LPCSTR lpszUrl, URLCACHECONTAINER ** ppContainer) -{ - BOOL ret; + return ERROR_FILE_NOT_FOUND; +} + +static DWORD URLCacheContainers_FindContainerA(LPCSTR lpszUrl, URLCACHECONTAINER ** ppContainer) +{ + DWORD ret; LPWSTR lpwszUrl; int url_len = MultiByteToWideChar(CP_ACP, 0, lpszUrl, -1, NULL, 0); if (url_len && (lpwszUrl = HeapAlloc(GetProcessHeap(), 0, url_len * sizeof(WCHAR)))) @@ -612,7 +619,7 @@ HeapFree(GetProcessHeap(), 0, lpwszUrl); return ret; } - return FALSE; + return GetLastError(); } static BOOL URLCacheContainers_Enum(LPCWSTR lpwszSearchPattern, DWORD dwIndex, URLCACHECONTAINER ** ppContainer) @@ -654,12 +661,18 @@ /*********************************************************************** * URLCacheContainer_LockIndex (Internal) * + * Locks the index for system-wide exclusive access. + * + * RETURNS + * Cache file header if successful + * NULL if failed and calls SetLastError. */ static LPURLCACHE_HEADER URLCacheContainer_LockIndex(URLCACHECONTAINER * pContainer) { BYTE index; LPVOID pIndexData; URLCACHE_HEADER * pHeader; + DWORD error; /* acquire mutex */ WaitForSingleObject(pContainer->hMutex, INFINITE); @@ -670,7 +683,7 @@ { ReleaseMutex(pContainer->hMutex); ERR("Couldn't MapViewOfFile. Error: %d\n", GetLastError()); - return FALSE; + return NULL; } pHeader = (URLCACHE_HEADER *)pIndexData; @@ -680,10 +693,12 @@ if (pHeader->dwFileSize != pContainer->file_size) { URLCacheContainer_CloseIndex(pContainer); - if (!URLCacheContainer_OpenIndex(pContainer)) + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) { ReleaseMutex(pContainer->hMutex); - return FALSE; + SetLastError(error); + return NULL; } pIndexData = MapViewOfFile(pContainer->hMapping, FILE_MAP_WRITE, 0, 0, 0); @@ -691,7 +706,7 @@ { ReleaseMutex(pContainer->hMutex); ERR("Couldn't MapViewOfFile. Error: %d\n", GetLastError()); - return FALSE; + return NULL; } pHeader = (URLCACHE_HEADER *)pIndexData; } @@ -931,11 +946,11 @@ * Copies an entry from the cache index file to the Win32 structure * * RETURNS - * TRUE if the buffer was big enough - * FALSE if the buffer was too small - * - */ -static BOOL URLCache_CopyEntry( + * ERROR_SUCCESS if the buffer was big enough + * ERROR_INSUFFICIENT_BUFFER if the buffer was too small + * + */ +static DWORD URLCache_CopyEntry( URLCACHECONTAINER * pContainer, LPCURLCACHE_HEADER pHeader, LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo, @@ -983,9 +998,9 @@ DWORD lenUrlBytes = (lenUrl+1) * (bUnicode ? sizeof(WCHAR) : sizeof(CHAR)); lpCacheEntryInfo->lpszSourceUrlName = (LPSTR)lpCacheEntryInfo + dwRequiredSize - lenUrlBytes; - if (bUnicode) - MultiByteToWideChar(CP_ACP, 0, (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl, -1, (LPWSTR)lpCacheEntryInfo->lpszSourceUrlName, lenUrl + 1); - else + if (bUnicode) + MultiByteToWideChar(CP_ACP, 0, (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl, -1, (LPWSTR)lpCacheEntryInfo->lpszSourceUrlName, lenUrl + 1); + else memcpy(lpCacheEntryInfo->lpszSourceUrlName, (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl, lenUrlBytes); } @@ -1000,7 +1015,7 @@ lpszLocalFileName = (LPSTR)lpCacheEntryInfo + dwRequiredSize; nLocalFilePathSize = *lpdwBufferSize - dwRequiredSize; if ((bUnicode && URLCache_LocalFileNameToPathW(pContainer, pHeader, (LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName, pUrlEntry->CacheDir, (LPWSTR)lpszLocalFileName, &nLocalFilePathSize)) || - URLCache_LocalFileNameToPathA(pContainer, pHeader, (LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName, pUrlEntry->CacheDir, lpszLocalFileName, &nLocalFilePathSize)) + (!bUnicode && URLCache_LocalFileNameToPathA(pContainer, pHeader, (LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName, pUrlEntry->CacheDir, lpszLocalFileName, &nLocalFilePathSize))) { lpCacheEntryInfo->lpszLocalFileName = lpszLocalFileName; } @@ -1049,11 +1064,10 @@ if (dwRequiredSize > *lpdwBufferSize) { *lpdwBufferSize = dwRequiredSize; - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return FALSE; + return ERROR_INSUFFICIENT_BUFFER; } *lpdwBufferSize = dwRequiredSize; - return TRUE; + return ERROR_SUCCESS; } @@ -1064,11 +1078,11 @@ * according to the flags set by dwFieldControl. * * RETURNS - * TRUE if the buffer was big enough - * FALSE if the buffer was too small - * - */ -static BOOL URLCache_SetEntryInfo(URL_CACHEFILE_ENTRY * pUrlEntry, const INTERNET_CACHE_ENTRY_INFOW * lpCacheEntryInfo, DWORD dwFieldControl) + * ERROR_SUCCESS if the buffer was big enough + * ERROR_INSUFFICIENT_BUFFER if the buffer was too small + * + */ +static DWORD URLCache_SetEntryInfo(URL_CACHEFILE_ENTRY * pUrlEntry, const INTERNET_CACHE_ENTRY_INFOW * lpCacheEntryInfo, DWORD dwFieldControl) { if (dwFieldControl & CACHE_ENTRY_ACCTIME_FC) pUrlEntry->LastAccessTime = lpCacheEntryInfo->LastAccessTime; @@ -1087,7 +1101,7 @@ if (dwFieldControl & CACHE_ENTRY_SYNCTIME_FC) FileTimeToDosDateTime(&lpCacheEntryInfo->LastAccessTime, &pUrlEntry->wLastSyncDate, &pUrlEntry->wLastSyncTime); - return TRUE; + return ERROR_SUCCESS; } /*********************************************************************** @@ -1285,11 +1299,11 @@ * key are entered into the hash table. * * RETURNS - * TRUE if the entry was added - * FALSE if the entry could not be added - * - */ -static BOOL URLCache_AddEntryToHash(LPURLCACHE_HEADER pHeader, LPCSTR lpszUrl, DWORD dwOffsetEntry) + * ERROR_SUCCESS if the entry was added + * Any other Win32 error code if the entry could not be added + * + */ +static DWORD URLCache_AddEntryToHash(LPURLCACHE_HEADER pHeader, LPCSTR lpszUrl, DWORD dwOffsetEntry) { /* see URLCache_FindEntryInHash for structure of hash tables */ @@ -1297,6 +1311,7 @@ DWORD offset = (key % HASHTABLE_NUM_ENTRIES) * sizeof(struct _HASH_ENTRY); HASH_CACHEFILE_ENTRY * pHashEntry; DWORD dwHashTableNumber = 0; + DWORD error; key = (key / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES; @@ -1324,17 +1339,17 @@ { pHashElement->dwHashKey = key; pHashElement->dwOffsetEntry = dwOffsetEntry; - return TRUE; + return ERROR_SUCCESS; } } } - pHashEntry = URLCache_CreateHashTable(pHeader, pHashEntry); - if (!pHashEntry) - return FALSE; + error = URLCache_CreateHashTable(pHeader, pHashEntry, &pHashEntry); + if (error != ERROR_SUCCESS) + return error; pHashEntry->HashTable[offset].dwHashKey = key; pHashEntry->HashTable[offset].dwOffsetEntry = dwOffsetEntry; - return TRUE; + return ERROR_SUCCESS; } /*********************************************************************** @@ -1344,38 +1359,36 @@ * hash tables. * * RETURNS - * TRUE if the hash table was created - * FALSE if the hash table could not be created - * - */ -static HASH_CACHEFILE_ENTRY *URLCache_CreateHashTable(LPURLCACHE_HEADER pHeader, HASH_CACHEFILE_ENTRY *pPrevHash) -{ - HASH_CACHEFILE_ENTRY *pHash; + * ERROR_SUCCESS if the hash table was created + * ERROR_DISK_FULL if the hash table could not be created + * + */ +static DWORD URLCache_CreateHashTable(LPURLCACHE_HEADER pHeader, HASH_CACHEFILE_ENTRY *pPrevHash, HASH_CACHEFILE_ENTRY **ppHash) +{ DWORD dwOffset; int i; - if (!URLCache_FindFirstFreeEntry(pHeader, 0x20, (CACHEFILE_ENTRY **)&pHash)) + if (!URLCache_FindFirstFreeEntry(pHeader, 0x20, (CACHEFILE_ENTRY **)ppHash)) { FIXME("no free space for hash table\n"); - SetLastError(ERROR_DISK_FULL); - return NULL; - } - - dwOffset = (BYTE *)pHash - (BYTE *)pHeader; + return ERROR_DISK_FULL; + } + + dwOffset = (BYTE *)*ppHash - (BYTE *)pHeader; if (pPrevHash) pPrevHash->dwAddressNext = dwOffset; else pHeader->dwOffsetFirstHashTable = dwOffset; - pHash->CacheFileEntry.dwSignature = HASH_SIGNATURE; - pHash->CacheFileEntry.dwBlocksUsed = 0x20; - pHash->dwHashTableNumber = pPrevHash ? pPrevHash->dwHashTableNumber + 1 : 0; + (*ppHash)->CacheFileEntry.dwSignature = HASH_SIGNATURE; + (*ppHash)->CacheFileEntry.dwBlocksUsed = 0x20; + (*ppHash)->dwHashTableNumber = pPrevHash ? pPrevHash->dwHashTableNumber + 1 : 0; for (i = 0; i < HASHTABLE_SIZE; i++) { - pHash->HashTable[i].dwOffsetEntry = 0; - pHash->HashTable[i].dwHashKey = HASHTABLE_FREE; - } - return pHash; + (*ppHash)->HashTable[i].dwOffsetEntry = 0; + (*ppHash)->HashTable[i].dwHashKey = HASHTABLE_FREE; + } + return ERROR_SUCCESS; } /*********************************************************************** @@ -1488,14 +1501,23 @@ const CACHEFILE_ENTRY * pEntry; const URL_CACHEFILE_ENTRY * pUrlEntry; URLCACHECONTAINER * pContainer; + DWORD error; TRACE("(%s, %p, %p)\n", debugstr_a(lpszUrlName), lpCacheEntryInfo, lpdwCacheEntryInfoBufferSize); - if (!URLCacheContainers_FindContainerA(lpszUrlName, &pContainer)) - return FALSE; - - if (!URLCacheContainer_OpenIndex(pContainer)) - return FALSE; + error = URLCacheContainers_FindContainerA(lpszUrlName, &pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } + + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) return FALSE; @@ -1524,18 +1546,23 @@ if (lpdwCacheEntryInfoBufferSize) { - if (!URLCache_CopyEntry( + if (!lpCacheEntryInfo) + *lpdwCacheEntryInfoBufferSize = 0; + + error = URLCache_CopyEntry( pContainer, pHeader, lpCacheEntryInfo, lpdwCacheEntryInfoBufferSize, pUrlEntry, - FALSE /* ANSI */)) + FALSE /* ANSI */); + if (error != ERROR_SUCCESS) { URLCacheContainer_UnlockIndex(pContainer, pHeader); + SetLastError(error); return FALSE; } - TRACE("Local File Name: %s\n", debugstr_a(lpCacheEntryInfo->lpszLocalFileName)); + TRACE("Local File Name: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName)); } URLCacheContainer_UnlockIndex(pContainer, pHeader); @@ -1556,14 +1583,23 @@ const CACHEFILE_ENTRY * pEntry; const URL_CACHEFILE_ENTRY * pUrlEntry; URLCACHECONTAINER * pContainer; + DWORD error; TRACE("(%s, %p, %p)\n", debugstr_w(lpszUrl), lpCacheEntryInfo, lpdwCacheEntryInfoBufferSize); - if (!URLCacheContainers_FindContainerW(lpszUrl, &pContainer)) - return FALSE; - - if (!URLCacheContainer_OpenIndex(pContainer)) - return FALSE; + error = URLCacheContainers_FindContainerW(lpszUrl, &pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } + + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) return FALSE; @@ -1591,18 +1627,23 @@ if (lpdwCacheEntryInfoBufferSize) { - if (!URLCache_CopyEntry( + if (!lpCacheEntryInfo) + *lpdwCacheEntryInfoBufferSize = 0; + + error = URLCache_CopyEntry( pContainer, pHeader, (LPINTERNET_CACHE_ENTRY_INFOA)lpCacheEntryInfo, lpdwCacheEntryInfoBufferSize, pUrlEntry, - TRUE /* UNICODE */)) + TRUE /* UNICODE */); + if (error != ERROR_SUCCESS) { URLCacheContainer_UnlockIndex(pContainer, pHeader); + SetLastError(error); return FALSE; } - TRACE("Local File Name: %s\n", debugstr_w(lpCacheEntryInfo->lpszLocalFileName)); + TRACE("Local File Name: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName)); } URLCacheContainer_UnlockIndex(pContainer, pHeader); @@ -1657,14 +1698,23 @@ struct _HASH_ENTRY * pHashEntry; CACHEFILE_ENTRY * pEntry; URLCACHECONTAINER * pContainer; + DWORD error; TRACE("(%s, %p, 0x%08x)\n", debugstr_a(lpszUrlName), lpCacheEntryInfo, dwFieldControl); - if (!URLCacheContainers_FindContainerA(lpszUrlName, &pContainer)) - return FALSE; - - if (!URLCacheContainer_OpenIndex(pContainer)) - return FALSE; + error = URLCacheContainers_FindContainerA(lpszUrlName, &pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } + + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) return FALSE; @@ -1705,14 +1755,23 @@ struct _HASH_ENTRY * pHashEntry; CACHEFILE_ENTRY * pEntry; URLCACHECONTAINER * pContainer; + DWORD error; TRACE("(%s, %p, 0x%08x)\n", debugstr_w(lpszUrl), lpCacheEntryInfo, dwFieldControl); - if (!URLCacheContainers_FindContainerW(lpszUrl, &pContainer)) - return FALSE; - - if (!URLCacheContainer_OpenIndex(pContainer)) - return FALSE; + error = URLCacheContainers_FindContainerW(lpszUrl, &pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } + + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) return FALSE; @@ -1760,6 +1819,7 @@ CACHEFILE_ENTRY * pEntry; URL_CACHEFILE_ENTRY * pUrlEntry; URLCACHECONTAINER * pContainer; + DWORD error; TRACE("(%s, %p, %p, 0x%08x)\n", debugstr_a(lpszUrlName), @@ -1767,11 +1827,26 @@ lpdwCacheEntryInfoBufferSize, dwReserved); - if (!URLCacheContainers_FindContainerA(lpszUrlName, &pContainer)) - return FALSE; - - if (!URLCacheContainer_OpenIndex(pContainer)) - return FALSE; + if (!lpszUrlName || !lpdwCacheEntryInfoBufferSize || + (!lpCacheEntryInfo && *lpdwCacheEntryInfoBufferSize)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + error = URLCacheContainers_FindContainerA(lpszUrlName, &pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } + + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) return FALSE; @@ -1801,12 +1876,16 @@ pUrlEntry->dwUseCount++; URLCache_HashEntrySetUse(pHashEntry, pUrlEntry->dwUseCount); - if (!URLCache_CopyEntry(pContainer, pHeader, lpCacheEntryInfo, lpdwCacheEntryInfoBufferSize, pUrlEntry, FALSE)) + error = URLCache_CopyEntry(pContainer, pHeader, lpCacheEntryInfo, + lpdwCacheEntryInfoBufferSize, pUrlEntry, + FALSE); + if (error != ERROR_SUCCESS) { URLCacheContainer_UnlockIndex(pContainer, pHeader); - return FALSE; - } - TRACE("Local File Name: %s\n", lpCacheEntryInfo->lpszLocalFileName); + SetLastError(error); + return FALSE; + } + TRACE("Local File Name: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName)); URLCacheContainer_UnlockIndex(pContainer, pHeader); @@ -1829,6 +1908,7 @@ CACHEFILE_ENTRY * pEntry; URL_CACHEFILE_ENTRY * pUrlEntry; URLCACHECONTAINER * pContainer; + DWORD error; TRACE("(%s, %p, %p, 0x%08x)\n", debugstr_w(lpszUrlName), @@ -1836,11 +1916,26 @@ lpdwCacheEntryInfoBufferSize, dwReserved); - if (!URLCacheContainers_FindContainerW(lpszUrlName, &pContainer)) - return FALSE; - - if (!URLCacheContainer_OpenIndex(pContainer)) - return FALSE; + if (!lpszUrlName || !lpdwCacheEntryInfoBufferSize || + (!lpCacheEntryInfo && *lpdwCacheEntryInfoBufferSize)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + error = URLCacheContainers_FindContainerW(lpszUrlName, &pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } + + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) return FALSE; @@ -1870,18 +1965,20 @@ pUrlEntry->dwUseCount++; URLCache_HashEntrySetUse(pHashEntry, pUrlEntry->dwUseCount); - if (!URLCache_CopyEntry( + error = URLCache_CopyEntry( pContainer, pHeader, (LPINTERNET_CACHE_ENTRY_INFOA)lpCacheEntryInfo, lpdwCacheEntryInfoBufferSize, pUrlEntry, - TRUE /* UNICODE */)) + TRUE /* UNICODE */); + if (error != ERROR_SUCCESS) { URLCacheContainer_UnlockIndex(pContainer, pHeader); - return FALSE; - } - TRACE("Local File Name: %s\n", debugstr_w(lpCacheEntryInfo->lpszLocalFileName)); + SetLastError(error); + return FALSE; + } + TRACE("Local File Name: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName)); URLCacheContainer_UnlockIndex(pContainer, pHeader); @@ -1902,6 +1999,7 @@ CACHEFILE_ENTRY * pEntry; URL_CACHEFILE_ENTRY * pUrlEntry; URLCACHECONTAINER * pContainer; + DWORD error; TRACE("(%s, 0x%08x)\n", debugstr_a(lpszUrlName), dwReserved); @@ -1912,11 +2010,19 @@ return FALSE; } - if (!URLCacheContainers_FindContainerA(lpszUrlName, &pContainer)) + error = URLCacheContainers_FindContainerA(lpszUrlName, &pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); return FALSE; - - if (!URLCacheContainer_OpenIndex(pContainer)) - return FALSE; + } + + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) return FALSE; @@ -1964,6 +2070,7 @@ CACHEFILE_ENTRY * pEntry; URL_CACHEFILE_ENTRY * pUrlEntry; URLCACHECONTAINER * pContainer; + DWORD error; TRACE("(%s, 0x%08x)\n", debugstr_w(lpszUrlName), dwReserved); @@ -1974,11 +2081,19 @@ return FALSE; } - if (!URLCacheContainers_FindContainerW(lpszUrlName, &pContainer)) - return FALSE; - - if (!URLCacheContainer_OpenIndex(pContainer)) - return FALSE; + error = URLCacheContainers_FindContainerW(lpszUrlName, &pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } + + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) return FALSE; @@ -2095,6 +2210,7 @@ LONG lBufferSize; BOOL bFound = FALSE; int count; + DWORD error; static const WCHAR szWWW[] = {'w','w','w',0}; TRACE("(%s, 0x%08x, %s, %p, 0x%08x)\n", @@ -2144,6 +2260,8 @@ if (!len) return FALSE; szFile[len] = '\0'; + while(len && szFile[--len] == '/') szFile[len] = '\0'; + /* FIXME: get rid of illegal characters like \, / and : */ } else @@ -2153,11 +2271,19 @@ TRACE("File name: %s\n", debugstr_a(szFile)); - if (!URLCacheContainers_FindContainerW(lpszUrlName, &pContainer)) - return FALSE; - - if (!URLCacheContainer_OpenIndex(pContainer)) - return FALSE; + error = URLCacheContainers_FindContainerW(lpszUrlName, &pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } + + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) return FALSE; @@ -2191,9 +2317,26 @@ for (i = 0; i < 255; i++) { - static const WCHAR szFormat[] = {'[','%','u',']','%','s',0}; + static const WCHAR szFormat[] = {'[','%','u',']','%','s',0}; HANDLE hFile; + WCHAR *p; + wsprintfW(lpszFileNameNoPath + countnoextension, szFormat, i, szExtension); + for (p = lpszFileNameNoPath + 1; *p; p++) + { + switch (*p) + { + case '<': case '>': + case ':': case '"': + case '/': case '\\': + case '|': case '?': + case '*': + *p = '_'; break; + default: break; + } + } + if (p[-1] == ' ' || p[-1] == '.') p[-1] = '_'; + TRACE("Trying: %s\n", debugstr_w(lpszFileName)); hFile = CreateFileW(lpszFileName, GENERIC_READ, 0, NULL, CREATE_NEW, 0, NULL); if (hFile != INVALID_HANDLE_VALUE) @@ -2221,7 +2364,7 @@ * result will lose data for arbitrary binary data. * */ -static BOOL WINAPI CommitUrlCacheEntryInternal( +static BOOL CommitUrlCacheEntryInternal( IN LPCWSTR lpszUrlName, IN LPCWSTR lpszLocalFileName, IN FILETIME ExpireTime, @@ -2250,7 +2393,7 @@ LPSTR lpszUrlNameA = NULL; LPSTR lpszFileExtensionA = NULL; char *pchLocalFileName = 0; - DWORD error = ERROR_SUCCESS; + DWORD error; TRACE("(%s, %s, ..., ..., %x, %p, %d, %s, %s)\n", debugstr_w(lpszUrlName), @@ -2287,11 +2430,19 @@ CloseHandle(hFile); } - if (!URLCacheContainers_FindContainerW(lpszUrlName, &pContainer)) - return FALSE; - - if (!URLCacheContainer_OpenIndex(pContainer)) - return FALSE; + error = URLCacheContainers_FindContainerW(lpszUrlName, &pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } + + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) return FALSE; @@ -2436,13 +2587,10 @@ if (dwOffsetFileExtension) strcpy((LPSTR)((LPBYTE)pUrlEntry + dwOffsetFileExtension), lpszFileExtensionA); - if (!URLCache_AddEntryToHash(pHeader, lpszUrlNameA, (DWORD)((LPBYTE)pUrlEntry - (LPBYTE)pHeader))) - { + error = URLCache_AddEntryToHash(pHeader, lpszUrlNameA, + (DWORD)((LPBYTE)pUrlEntry - (LPBYTE)pHeader)); + if (error != ERROR_SUCCESS) URLCache_DeleteEntry(pHeader, &pUrlEntry->CacheFileEntry); - URLCacheContainer_UnlockIndex(pContainer, pHeader); - HeapFree(GetProcessHeap(), 0, lpszUrlNameA); - return FALSE; - } cleanup: URLCacheContainer_UnlockIndex(pContainer, pHeader); @@ -2675,7 +2823,7 @@ pStream->hFile = hFile; strcpy(pStream->lpszUrl, lpszUrlName); - return (HANDLE)pStream; + return pStream; } /*********************************************************************** @@ -2742,14 +2890,23 @@ LPURLCACHE_HEADER pHeader; struct _HASH_ENTRY * pHashEntry; CACHEFILE_ENTRY * pEntry; + DWORD error; TRACE("(%s)\n", debugstr_a(lpszUrlName)); - if (!URLCacheContainers_FindContainerA(lpszUrlName, &pContainer)) - return FALSE; - - if (!URLCacheContainer_OpenIndex(pContainer)) - return FALSE; + error = URLCacheContainers_FindContainerA(lpszUrlName, &pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } + + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) return FALSE; @@ -2784,6 +2941,7 @@ CACHEFILE_ENTRY * pEntry; LPSTR urlA; int url_len; + DWORD error; TRACE("(%s)\n", debugstr_w(lpszUrlName)); @@ -2796,16 +2954,22 @@ } WideCharToMultiByte(CP_ACP, 0, lpszUrlName, -1, urlA, url_len, NULL, NULL); - if (!URLCacheContainers_FindContainerW(lpszUrlName, &pContainer)) + error = URLCacheContainers_FindContainerW(lpszUrlName, &pContainer); + if (error != ERROR_SUCCESS) { HeapFree(GetProcessHeap(), 0, urlA); - return FALSE; - } - if (!URLCacheContainer_OpenIndex(pContainer)) + SetLastError(error); + return FALSE; + } + + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) { HeapFree(GetProcessHeap(), 0, urlA); - return FALSE; - } + SetLastError(error); + return FALSE; + } + if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) { HeapFree(GetProcessHeap(), 0, urlA); @@ -3057,9 +3221,14 @@ { LPURLCACHE_HEADER pHeader; HASH_CACHEFILE_ENTRY *pHashTableEntry; - - if (!URLCacheContainer_OpenIndex(pContainer)) + DWORD error; + + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); return FALSE; + } if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) return FALSE; @@ -3081,18 +3250,20 @@ TRACE("Found URL: %s\n", (LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl); TRACE("Header info: %s\n", (LPBYTE)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo); - if (!URLCache_CopyEntry( + error = URLCache_CopyEntry( pContainer, pHeader, lpNextCacheEntryInfo, lpdwNextCacheEntryInfoBufferSize, pUrlEntry, - FALSE /* not UNICODE */)) + FALSE /* not UNICODE */); + if (error != ERROR_SUCCESS) { URLCacheContainer_UnlockIndex(pContainer, pHeader); + SetLastError(error); return FALSE; } - TRACE("Local File Name: %s\n", debugstr_a(lpNextCacheEntryInfo->lpszLocalFileName)); + TRACE("Local File Name: %s\n", debugstr_a((LPCSTR)pUrlEntry + pUrlEntry->dwOffsetLocalName)); /* increment the current index so that next time the function * is called the next entry is returned */ @@ -3109,6 +3280,9 @@ return FALSE; } +/*********************************************************************** + * FindNextUrlCacheEntryW (WININET.@) + */ BOOL WINAPI FindNextUrlCacheEntryW( HANDLE hEnumHandle, LPINTERNET_CACHE_ENTRY_INFOW lpNextCacheEntryInfo, @@ -3337,14 +3511,23 @@ const CACHEFILE_ENTRY * pEntry; const URL_CACHEFILE_ENTRY * pUrlEntry; URLCACHECONTAINER * pContainer; + DWORD error; TRACE("(%s, %08x, %p)\n", debugstr_a(url), dwFlags, pftLastModified); - if (!URLCacheContainers_FindContainerA(url, &pContainer)) - return FALSE; - - if (!URLCacheContainer_OpenIndex(pContainer)) - return FALSE; + error = URLCacheContainers_FindContainerA(url, &pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } + + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) return FALSE; @@ -3390,14 +3573,23 @@ const CACHEFILE_ENTRY * pEntry; const URL_CACHEFILE_ENTRY * pUrlEntry; URLCACHECONTAINER * pContainer; + DWORD error; TRACE("(%s, %08x, %p)\n", debugstr_w(url), dwFlags, pftLastModified); - if (!URLCacheContainers_FindContainerW(url, &pContainer)) - return FALSE; - - if (!URLCacheContainer_OpenIndex(pContainer)) - return FALSE; + error = URLCacheContainers_FindContainerW(url, &pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } + + error = URLCacheContainer_OpenIndex(pContainer); + if (error != ERROR_SUCCESS) + { + SetLastError(error); + return FALSE; + } if (!(pHeader = URLCacheContainer_LockIndex(pContainer))) return FALSE; @@ -3427,3 +3619,21 @@ return TRUE; } + +/*********************************************************************** + * GetDiskInfoA (WININET.@) + */ +DWORD WINAPI GetDiskInfoA(void *p0, void *p1, void *p2, void *p3) +{ + FIXME("(%p, %p, %p, %p)\n", p0, p1, p2, p3); + return 0; +} + +/*********************************************************************** + * RegisterUrlCacheNotification (WININET.@) + */ +DWORD WINAPI RegisterUrlCacheNotification(LPVOID a, DWORD b, DWORD c, DWORD d, DWORD e, DWORD f) +{ + FIXME("(%p %x %x %x %x %x)\n", a, b, c, d, e, f); + return 0; +}
15 years, 9 months
1
0
0
0
← Newer
1
...
23
24
25
26
27
28
29
...
48
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
Results per page:
10
25
50
100
200