ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
May 2011
----- 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
26 participants
511 discussions
Start a n
N
ew thread
[rmessiant] 52002: [NTOSKRNL] - Simplify remove lock tracking block list handling. - Correct check for unlimited locking time being allowed. - Eliminate use-after-free after removing a tracking block.
by rmessiant@svn.reactos.org
Author: rmessiant Date: Sun May 29 22:29:10 2011 New Revision: 52002 URL:
http://svn.reactos.org/svn/reactos?rev=52002&view=rev
Log: [NTOSKRNL] - Simplify remove lock tracking block list handling. - Correct check for unlimited locking time being allowed. - Eliminate use-after-free after removing a tracking block. Modified: trunk/reactos/ntoskrnl/io/iomgr/remlock.c Modified: trunk/reactos/ntoskrnl/io/iomgr/remlock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/remlock.…
============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/remlock.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/remlock.c [iso-8859-1] Sun May 29 22:29:10 2011 @@ -16,7 +16,7 @@ typedef struct _IO_REMOVE_LOCK_TRACKING_BLOCK { - SINGLE_LIST_ENTRY BlockEntry; + PIO_REMOVE_LOCK_TRACKING_BLOCK Next; PVOID Tag; LARGE_INTEGER LockMoment; LPCSTR File; @@ -114,7 +114,8 @@ /* Queue the block */ KeAcquireSpinLock(&(Lock->Dbg.Spin), &OldIrql); - PushEntryList((PSINGLE_LIST_ENTRY)&(Lock->Dbg.Blocks), &(TrackingBlock->BlockEntry)); + TrackingBlock->Next = Lock->Dbg.Blocks; + Lock->Dbg.Blocks = TrackingBlock; KeReleaseSpinLock(&(Lock->Dbg.Spin), OldIrql); } } @@ -149,8 +150,8 @@ LONG LockValue; BOOLEAN TagFound; LARGE_INTEGER CurrentMoment; - PSINGLE_LIST_ENTRY ListEntry; PIO_REMOVE_LOCK_TRACKING_BLOCK TrackingBlock; + PIO_REMOVE_LOCK_TRACKING_BLOCK *TrackingBlockLink; PEXTENDED_IO_REMOVE_LOCK Lock = (PEXTENDED_IO_REMOVE_LOCK)RemoveLock; /* Check what kind of lock this is */ @@ -164,12 +165,12 @@ /* Start browsing tracking blocks to find a block that would match given tag */ TagFound = FALSE; - for (ListEntry = ((PSINGLE_LIST_ENTRY)&Lock->Dbg.Blocks)->Next; ListEntry; ListEntry = ListEntry->Next) - { - TrackingBlock = CONTAINING_RECORD(ListEntry, IO_REMOVE_LOCK_TRACKING_BLOCK, BlockEntry); - + TrackingBlock = Lock->Dbg.Blocks; + TrackingBlockLink = &(Lock->Dbg.Blocks); + while (TrackingBlock != NULL) + { /* First of all, check if the lock was locked for too long */ - if (CurrentMoment.QuadPart && + if (TrackingBlock->LockMoment.QuadPart && CurrentMoment.QuadPart - TrackingBlock->LockMoment.QuadPart > Lock->Dbg.MaxLockedTicks) { DPRINT("Lock %#08lx (with tag %#08lx) was supposed to be held at max %I64d ticks but lasted longer\n", @@ -178,29 +179,23 @@ ASSERT(FALSE); } - /* If no tracking was found yet */ - if (TagFound == FALSE) - { - /* Check if the current one could match */ - if (TrackingBlock->Tag == Tag) - { - /* Yes, then remove it from the queue and free it */ - TagFound = TRUE; - if (ListEntry == ((PSINGLE_LIST_ENTRY)&Lock->Dbg.Blocks)->Next) - { - /* Here it is head, remove it using macro */ - PopEntryList((PSINGLE_LIST_ENTRY)&(Lock->Dbg.Blocks)); - ExFreePoolWithTag(TrackingBlock, Lock->Dbg.AllocateTag); - } - else - { - /* It's not head, remove it "manually */ - ListEntry->Next = TrackingBlock->BlockEntry.Next; - ExFreePoolWithTag(TrackingBlock, Lock->Dbg.AllocateTag); - } - } - } - } + /* Check if this is the first matching tracking block */ + if ((TagFound == FALSE) && (TrackingBlock->Tag == Tag)) + { + /* Unlink this tracking block, and free it */ + TagFound = TRUE; + *TrackingBlockLink = TrackingBlock->Next; + ExFreePoolWithTag(TrackingBlock, Lock->Dbg.AllocateTag); + TrackingBlock = *TrackingBlockLink; + } + else + { + /* Go to the next tracking block */ + TrackingBlockLink = &(TrackingBlock->Next); + TrackingBlock = TrackingBlock->Next; + } + } + /* We're done, release queue lock */ KeReleaseSpinLock(&(Lock->Dbg.Spin), OldIrql); @@ -271,7 +266,7 @@ ASSERT(Lock->Dbg.Blocks); /* Get it */ - TrackingBlock = CONTAINING_RECORD(Lock->Dbg.Blocks, IO_REMOVE_LOCK_TRACKING_BLOCK, BlockEntry); + TrackingBlock = Lock->Dbg.Blocks; /* Tag should match */ if (TrackingBlock->Tag != Tag) {
13 years, 6 months
1
0
0
0
[tkreuzer] 52001: [WIN32K] - Implement RFONT_vXlateGlpyhs
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun May 29 22:02:52 2011 New Revision: 52001 URL:
http://svn.reactos.org/svn/reactos?rev=52001&view=rev
Log: [WIN32K] - Implement RFONT_vXlateGlpyhs Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontdata.c Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontdata.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/subsyst…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontdata.c [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontdata.c [iso-8859-1] Sun May 29 22:02:52 2011 @@ -77,6 +77,53 @@ return 0; } +VOID +NTAPI +RFONT_vXlateGlpyhs( + PRFONT prfnt, + ULONG cwc, + WCHAR *pwc, + HGLYPH *phg, + HGLYPH hgDefault) +{ + FD_GLYPHSET *pfdg = prfnt->ppfe->pfdg; + WCRUN *pwcrun; + HGLYPH hg; + WCHAR wc; + ULONG idx; + + /* Loop all WCHARs */ + while (cwc--) + { + wc = *pwc++; + hg = hgDefault; + + /* Loop all WCHAR runs */ + for (pwcrun = &pfdg->awcrun[0]; + pwcrun < &pfdg->awcrun[pfdg->cRuns]; + pwcrun++) + { + /* Check if the char is below the current run */ + if (wc < pwcrun->wcLow) + { + /* We couldn't find it, use default */ + break; + } + + /* Calculate index into the current run */ + idx = wc - pwcrun->wcLow; + if (idx < pwcrun->cGlyphs) + { + hg = pwcrun->phg[idx]; + break; + } + } + + *phg++ = hg; + } +} + + W32KAPI DWORD APIENTRY
13 years, 6 months
1
0
0
0
[osiejka] 52000: Converting POLISH localisation strings to UTF-8. Part 3/4: - dll/win32 and dll/shellext converted - currently, only shell32 is left, due to incoming change to new version, and kern...
by osiejka@svn.reactos.org
Author: osiejka Date: Sun May 29 21:43:37 2011 New Revision: 52000 URL:
http://svn.reactos.org/svn/reactos?rev=52000&view=rev
Log: Converting POLISH localisation strings to UTF-8. Part 3/4: - dll/win32 and dll/shellext converted - currently, only shell32 is left, due to incoming change to new version, and kernel32 - need to research how it should be done. Tested on rbuild/cmake Added: trunk/reactos/dll/win32/browseui/lang/pl-PL.rc (with props) trunk/reactos/dll/win32/msports/lang/pl-PL.rc (with props) Modified: trunk/reactos/dll/shellext/deskadp/lang/pl-PL.rc trunk/reactos/dll/shellext/deskadp/rsrc.rc trunk/reactos/dll/shellext/deskmon/lang/pl-PL.rc trunk/reactos/dll/shellext/deskmon/rsrc.rc trunk/reactos/dll/shellext/slayer/lang/pl-PL.rc trunk/reactos/dll/shellext/slayer/rsrc.rc trunk/reactos/dll/win32/browseui/browseui.rc trunk/reactos/dll/win32/devmgr/devmgr.rc trunk/reactos/dll/win32/devmgr/lang/pl-PL.rc trunk/reactos/dll/win32/modemui/lang/pl-PL.rc trunk/reactos/dll/win32/modemui/modemui.rc trunk/reactos/dll/win32/msgina/lang/pl-PL.rc trunk/reactos/dll/win32/msgina/msgina.rc trunk/reactos/dll/win32/msports/msports.rc trunk/reactos/dll/win32/netcfgx/lang/pl-PL.rc trunk/reactos/dll/win32/netcfgx/netcfgx.rc trunk/reactos/dll/win32/netid/lang/pl-PL.rc trunk/reactos/dll/win32/netid/rsrc.rc trunk/reactos/dll/win32/netshell/lang/pl-PL.rc trunk/reactos/dll/win32/netshell/netshell.rc trunk/reactos/dll/win32/newdev/lang/pl-PL.rc trunk/reactos/dll/win32/newdev/rsrc.rc trunk/reactos/dll/win32/rasdlg/lang/pl-PL.rc trunk/reactos/dll/win32/rasdlg/rasdlg.rc trunk/reactos/dll/win32/serialui/lang/pl-PL.rc trunk/reactos/dll/win32/serialui/serialui.rc trunk/reactos/dll/win32/setupapi/lang/pl-PL.rc trunk/reactos/dll/win32/setupapi/setupapi.rc trunk/reactos/dll/win32/shimgvw/lang/pl-PL.rc trunk/reactos/dll/win32/shimgvw/rsrc.rc trunk/reactos/dll/win32/syssetup/lang/en-US.rc trunk/reactos/dll/win32/syssetup/lang/pl-PL.rc trunk/reactos/dll/win32/syssetup/syssetup.rc trunk/reactos/dll/win32/tapiui/lang/pl-PL.rc trunk/reactos/dll/win32/tapiui/tapiui.rc trunk/reactos/dll/win32/user32/lang/pl-PL.rc trunk/reactos/dll/win32/user32/lang/sk-SK.rc trunk/reactos/dll/win32/userenv/lang/pl-PL.rc trunk/reactos/dll/win32/userenv/userenv.rc [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/shellext/deskadp/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/deskadp/lang/…
Modified: trunk/reactos/dll/shellext/deskadp/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/deskadp/rsrc.…
Modified: trunk/reactos/dll/shellext/deskmon/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/deskmon/lang/…
Modified: trunk/reactos/dll/shellext/deskmon/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/deskmon/rsrc.…
Modified: trunk/reactos/dll/shellext/slayer/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/slayer/lang/p…
Modified: trunk/reactos/dll/shellext/slayer/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/shellext/slayer/rsrc.r…
Modified: trunk/reactos/dll/win32/browseui/browseui.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/browseu…
Added: trunk/reactos/dll/win32/browseui/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/lang/pl…
Modified: trunk/reactos/dll/win32/devmgr/devmgr.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/devmgr.rc…
Modified: trunk/reactos/dll/win32/devmgr/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/lang/pl-P…
Modified: trunk/reactos/dll/win32/modemui/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/modemui/lang/pl-…
Modified: trunk/reactos/dll/win32/modemui/modemui.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/modemui/modemui.…
Modified: trunk/reactos/dll/win32/msgina/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/lang/pl-P…
Modified: trunk/reactos/dll/win32/msgina/msgina.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/msgina.rc…
Added: trunk/reactos/dll/win32/msports/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msports/lang/pl-…
Modified: trunk/reactos/dll/win32/msports/msports.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msports/msports.…
Modified: trunk/reactos/dll/win32/netcfgx/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netcfgx/lang/pl-…
Modified: trunk/reactos/dll/win32/netcfgx/netcfgx.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netcfgx/netcfgx.…
Modified: trunk/reactos/dll/win32/netid/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/lang/pl-PL…
Modified: trunk/reactos/dll/win32/netid/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netid/rsrc.rc?re…
Modified: trunk/reactos/dll/win32/netshell/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netshell/lang/pl…
Modified: trunk/reactos/dll/win32/netshell/netshell.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netshell/netshel…
Modified: trunk/reactos/dll/win32/newdev/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/lang/pl-P…
Modified: trunk/reactos/dll/win32/newdev/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/newdev/rsrc.rc?r…
Modified: trunk/reactos/dll/win32/rasdlg/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rasdlg/lang/pl-P…
Modified: trunk/reactos/dll/win32/rasdlg/rasdlg.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/rasdlg/rasdlg.rc…
Modified: trunk/reactos/dll/win32/serialui/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/serialui/lang/pl…
Modified: trunk/reactos/dll/win32/serialui/serialui.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/serialui/serialu…
Modified: trunk/reactos/dll/win32/setupapi/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/lang/pl…
Modified: trunk/reactos/dll/win32/setupapi/setupapi.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/setupap…
Modified: trunk/reactos/dll/win32/shimgvw/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/lang/pl-…
Modified: trunk/reactos/dll/win32/shimgvw/rsrc.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shimgvw/rsrc.rc?…
Modified: trunk/reactos/dll/win32/syssetup/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/en…
Modified: trunk/reactos/dll/win32/syssetup/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/lang/pl…
Modified: trunk/reactos/dll/win32/syssetup/syssetup.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/syssetu…
Modified: trunk/reactos/dll/win32/tapiui/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/tapiui/lang/pl-P…
Modified: trunk/reactos/dll/win32/tapiui/tapiui.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/tapiui/tapiui.rc…
Modified: trunk/reactos/dll/win32/user32/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/lang/pl-P…
Modified: trunk/reactos/dll/win32/user32/lang/sk-SK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/lang/sk-S…
Modified: trunk/reactos/dll/win32/userenv/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/lang/pl-…
Modified: trunk/reactos/dll/win32/userenv/userenv.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/userenv/userenv.…
13 years, 6 months
1
0
0
0
[tkreuzer] 51999: [WIN32K] - Refactor EngLoadFontFile and EngLoadFontFileFD - Implement more driver support code to query IFIMETRICS and FD_GLYPHSET from the driver
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun May 29 20:14:40 2011 New Revision: 51999 URL:
http://svn.reactos.org/svn/reactos?rev=51999&view=rev
Log: [WIN32K] - Refactor EngLoadFontFile and EngLoadFontFileFD - Implement more driver support code to query IFIMETRICS and FD_GLYPHSET from the driver Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fntdrvsup.c branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontrsrc.c branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fntdrvsup.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/subsyst…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fntdrvsup.c [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fntdrvsup.c [iso-8859-1] Sun May 29 20:14:40 2011 @@ -11,21 +11,6 @@ #define NDEBUG #include <debug.h> -BOOL gbAttachedCSRSS; - -HSEMAPHORE ghsemFontDriver; -LIST_ENTRY gleFontDriverList = {&gleFontDriverList, &gleFontDriverList}; - - -BOOL FASTCALL -InitFontSupport(VOID) -{ - ghsemFontDriver = EngCreateSemaphore(); - if (!ghsemFontDriver) return FALSE; - return TRUE; -} - - typedef struct _FONTDEV { LIST_ENTRY leLink; @@ -40,7 +25,26 @@ C_ASSERT(sizeof(GDIINFO) == 0x130); -//static +BOOL gbAttachedCSRSS; + +HSEMAPHORE ghsemFontDriver; +LIST_ENTRY gleFontDriverList = {&gleFontDriverList, &gleFontDriverList}; + +HSEMAPHORE ghsemPFFList; +LIST_ENTRY glePFFList = {&glePFFList, &glePFFList}; + + +BOOL FASTCALL +InitFontSupport(VOID) +{ + ghsemFontDriver = EngCreateSemaphore(); + if (!ghsemFontDriver) return FALSE; + ghsemPFFList = EngCreateSemaphore(); + if (!ghsemPFFList) return FALSE; + return TRUE; +} + +static VOID AttachCSRSS(KAPC_STATE *pApcState) { @@ -49,7 +53,7 @@ gbAttachedCSRSS = TRUE; } -//static +static VOID DetachCSRSS(KAPC_STATE *pApcState) { @@ -85,19 +89,18 @@ if (hff == 0) return 0; return hff; - -} - +} + +static HFF -NTAPI EngLoadFontFileFD( ULONG cFiles, - PULONG_PTR piFiles, + PFONTFILEVIEW *ppffv, DESIGNVECTOR *pdv, ULONG ulCheckSum, - HDEV *phdev) -{ - KAPC_STATE ApcState; + PFONTDEV *ppfntdev) +{ + PULONG_PTR piFiles = (PULONG_PTR)ppffv; PVOID apvView[FD_MAX_FILES]; ULONG acjView[FD_MAX_FILES]; ULONG i, ulLangID = 0; @@ -115,10 +118,7 @@ } } - /* Attach to CSRSS */ - AttachCSRSS(&ApcState); - - /* Acquire font friver list lock */ + /* Acquire font driver list lock */ EngAcquireSemaphore(ghsemFontDriver); /* Loop all installed font drivers */ @@ -139,7 +139,7 @@ ulCheckSum); if (hff) { - *phdev = (HDEV)pfntdev; + *ppfntdev = pfntdev; break; } } @@ -147,10 +147,193 @@ /* Release font friver list lock */ EngReleaseSemaphore(ghsemFontDriver); + return hff; +} + +static +BOOL +PFF_bCompareFiles( + PPFF ppff, + ULONG cFiles, + PFONTFILEVIEW pffv[]) +{ + ULONG i; + + /* Check if number of files matches */ + if (ppff->cFiles != cFiles) return FALSE; + + /* Loop all files */ + for (i = 0; i < cFiles; i++) + { + /* Check if the files match */ + if (pffv[i] != ppff->apffv[i]) return FALSE; + } + + return TRUE; +} + +static PPFF +EngFindPFF(ULONG cFiles, PFONTFILEVIEW *ppffv) +{ + PLIST_ENTRY ple; + PPFF ppff; + ASSERT(cFiles >= 1 && cFiles <= FD_MAX_FILES); + + /* Acquire PFF list lock */ + EngAcquireSemaphore(ghsemPFFList); + + /* Loop all physical font files (PFF) */ + for (ple = glePFFList.Flink; ple != &glePFFList; ple = ple->Flink) + { + ppff = CONTAINING_RECORD(ple, PFF, leLink); + + /* Check if the files are already loaded */ + if (PFF_bCompareFiles(ppff, cFiles, ppffv)) break; + } + + /* Release PFF list lock */ + EngReleaseSemaphore(ghsemPFFList); + + return ple != &glePFFList ? ppff : NULL; +} + +static void +PFE_vInitialize( + PPFE ppfe, + PPFF ppff, + ULONG iFace) +{ + PFONTDEV pfntdev = (PFONTDEV)ppff->hdev; + PLDEVOBJ pldev = pfntdev->pldev; + ppfe->pPFF = ppff; + ppfe->iFont = iFace; + ppfe->flPFE = 0; + + ppfe->pid = HandleToUlong(PsGetCurrentProcessId()); + ppfe->tid = HandleToUlong(PsGetCurrentThreadId()); + + /* Query IFIMETRICS */ + ppfe->pifi = pldev->pfn.QueryFont(pfntdev->dhpdev, + ppff->hff, + iFace, + &ppfe->idifi); + + /* Query FD_GLYPHSET */ + ppfe->pfdg = pldev->pfn.QueryFontTree(pfntdev->dhpdev, + ppff->hff, + iFace, + QFT_GLYPHSET, + &ppfe->idfdg); + + /* No kerning pairs for now */ + ppfe->pkp = NULL; + ppfe->idkp = 0; + ppfe->ckp = 0; + + ppfe->iOrientation = 0; + ppfe->cjEfdwPFE = 0; + //ppfe->pgiset = 0; + ppfe->ulTimeStamp = 0; + //ppfe->ufi = 0; + //ppfe->ql; + ppfe->pFlEntry = 0; + ppfe->cAlt = 0; + ppfe->cPfdgRef = 0; + //ppfe->aiFamilyName[]; + +} + +PPFF +NTAPI +EngLoadFontFile( + IN ULONG cFiles, + IN PWCHAR apwszFiles[], + IN DESIGNVECTOR *pdv) +{ + PFONTFILEVIEW apffv[FD_MAX_FILES]; + KAPC_STATE ApcState; + PPFF ppff = NULL; + ULONG i, cjSize, cFaces, ulChecksum = 0; + PFONTDEV pfntdev = NULL; + HFF hff; + + /* Loop the files */ + for (i = 0; i < cFiles; i++) + { + /* Try to load the file */ + apffv[i] = (PVOID)EngLoadModuleEx(apwszFiles[i], 0, FVF_FONTFILE); + if (!apffv[i]) + { + /* Cleanup and return */ + while (i--) EngFreeModule(apffv[i]); + return NULL; + } + } + + /* Try to find an existing PFF */ + ppff = EngFindPFF(cFiles, apffv); + if (ppff) + { + /* Cleanup loaded files, we don't need them anymore */ + for (i = 0; i < cFiles; i++) EngFreeModule(apffv[i]); + return ppff; + } + + /* Attach to CSRSS */ + AttachCSRSS(&ApcState); + + /* Try to load the font with any of the font drivers */ + hff = EngLoadFontFileFD(cFiles, apffv, pdv, ulChecksum, &pfntdev); + if (!hff) + { + DPRINT1("File format is not supported by any font driver\n"); + goto leave; + } + + /* Query the number of faces in the font file */ + cFaces = pfntdev->pldev->pfn.QueryFontFile(hff, QFF_NUMFACES, 0, NULL); + + /* Allocate a new PFF */ + cjSize = FIELD_OFFSET(PFF, apfe[cFaces]); + ppff = EngAllocMem(FL_ZERO_MEMORY, cjSize, 'ffpG'); + if (!ppff) + { + DPRINT1("Failed to allocate %ld bytes\n", cjSize); + goto leave; + } + + /* Fill the structure */ + ppff->sizeofThis = cjSize; + ppff->cFiles = cFiles; + ppff->cFonts = cFaces; + ppff->hdev = (HDEV)pfntdev; + ppff->hff = hff; + + /* Copy the FONTFILEVIEW pointers */ + for (i = 0; i < cFiles; i++) ppff->apffv[i] = apffv[i]; + + /* Loop all faces in the font file */ + for (i = 0; i < cFaces; i++) + { + /* Initialize the face */ + PFE_vInitialize(&ppff->apfe[i], ppff, i + 1); + } + + /* Insert the PFF into the list */ + EngAcquireSemaphore(ghsemPFFList); + InsertTailList(&glePFFList, &ppff->leLink); + EngReleaseSemaphore(ghsemPFFList); + +leave: + if (!ppff) + { + for (i = 0; i < cFiles; i++) EngFreeModule(apffv[i]); + } + /* Detach from CSRSS */ DetachCSRSS(&ApcState); - return hff; + return ppff; } BOOL Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontrsrc.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/subsyst…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontrsrc.c [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontrsrc.c [iso-8859-1] Sun May 29 20:14:40 2011 @@ -10,112 +10,6 @@ #define NDEBUG #include <debug.h> - -HSEMAPHORE ghsemPFFList; -LIST_ENTRY glePFFList = {&glePFFList, &glePFFList}; - - -static -BOOL -ComparePFF( - PPFF ppff, - ULONG cFiles, - PFONTFILEVIEW pffv[]) -{ - ULONG i; - ASSERT(cFiles >= 1 && cFiles <= FD_MAX_FILES); - - /* Check if number of files matches */ - if (ppff->cFiles != cFiles) return FALSE; - - /* Loop all files */ - for (i = 0; i < cFiles; i++) - { - /* Check if the files match */ - if (pffv[i] != ppff->apffv[i]) return FALSE; - } - - return TRUE; -} - -PPFF -NTAPI -EngLoadFontFile( - IN ULONG cFiles, - IN PWCHAR apwszFiles[], - IN DESIGNVECTOR *pdv) -{ - PFONTFILEVIEW apffv[FD_MAX_FILES]; - PLIST_ENTRY ple; - PPFF ppff = NULL; - ULONG i, cjSize, ulChecksum = 0; - HDEV hdev; - HFF hff; - - /* Loop the files */ - for (i = 0; i < cFiles; i++) - { - /* Try to load the file */ - apffv[i] = (PVOID)EngLoadModuleEx(apwszFiles[i], 0, FVF_FONTFILE); - if (!apffv[i]) - { - /* Cleanup and return */ - while (i--) EngFreeModule(apffv[i]); - return NULL; - } - } - - /* Acquire PFF list lock */ - EngAcquireSemaphore(ghsemPFFList); - - /* Loop all physical font files (PFF) */ - for (ple = glePFFList.Flink; ple != &glePFFList; ple = ple->Flink) - { - ppff = CONTAINING_RECORD(ple, PFF, leLink); - - /* Check if the files are already loaded */ - if (ComparePFF(ppff, cFiles, apffv)) - { - /* Unload the loaded files */ - while (i--) EngFreeModule(apffv[i]); - goto leave; - } - } - - /* Load the font with any of the font drivers */ - hff = EngLoadFontFileFD(cFiles, (PULONG_PTR)apffv, pdv, ulChecksum, &hdev); - if (!hff) - { - DPRINT1("File format is not supported by any font driver\n"); - while (i--) EngFreeModule(apffv[i]); - goto leave; - } - - /* Allocate a new PFF */ - cjSize = sizeof(PFF); - ppff = EngAllocMem(0, cjSize, 'ffpG'); - if (!ppff) - { - goto leave; - } - - ppff->sizeofThis = cjSize; - ppff->cFiles = cFiles; - ppff->hdev = hdev; - ppff->hff = hff; - - /* Copy the FONTFILEVIEWs */ - for (i = 0; i < cFiles; i++) ppff->apffv[i] = apffv[i]; - - /* Insert the PFF into the list */ - InsertTailList(&glePFFList, &ppff->leLink); - -leave: - /* Release PFF list lock */ - EngReleaseSemaphore(ghsemPFFList); - - return ppff; -} INT NTAPI Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/subsyst…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h [iso-8859-1] Sun May 29 20:14:40 2011 @@ -14,6 +14,32 @@ } POINTEF, *PPOINTEF; typedef struct _RFONT *PRFONT; + +typedef struct _PFE +{ + struct _PFF * pPFF; + ULONG_PTR iFont; + FLONG flPFE; + FD_GLYPHSET *pfdg; + ULONG_PTR idfdg; + IFIMETRICS * pifi; + ULONG_PTR idifi; + FD_KERNINGPAIR *pkp; + ULONG_PTR idkp; + ULONG ckp; + ULONG iOrientation; + ULONG cjEfdwPFE; + //GISET * pgiset; + ULONG ulTimeStamp; + UNIVERSAL_FONT_ID ufi; + DWORD pid; + DWORD tid; + LIST_ENTRY ql; + void * pFlEntry; + ULONG cAlt; + ULONG cPfdgRef; + ULONG aiFamilyName[1]; +} PFE, *PPFE; typedef struct _PFF { @@ -38,33 +64,8 @@ ULONG cFonts; void *pPvtDataHead; PFONTFILEVIEW apffv[FD_MAX_FILES]; + PFE apfe[1]; } PFF, *PPFF; - -typedef struct _PFE -{ - PFF * pPFF; - ULONG_PTR iFont; - FLONG flPFE; - FD_GLYPHSET * pfdg; - ULONG_PTR ulpId; - IFIMETRICS * pifi; - ULONG_PTR idifi; - FD_KERNINGPAIR *pkp; - ULONG_PTR idkp; - ULONG ckp; - ULONG iOrieintation; - ULONG cjEfdwPFE; - //GISET * pgiset; - ULONG ulTimeStamp; - UNIVERSAL_FONT_ID ufi; - DWORD pid; - DWORD tid; - LIST_ENTRY ql; - void * pFlEntry; - ULONG cAlt; - ULONG cPfdgRef; - ULONG aiFamilyName[1]; -} PFE, *PPFE; typedef struct { @@ -219,11 +220,4 @@ NTAPI DC_prfnt(PDC pdc); -HFF -NTAPI -EngLoadFontFileFD( - ULONG cFiles, - PULONG_PTR piFiles, - DESIGNVECTOR *pdv, - ULONG ulCheckSum, - HDEV *phdev); +
13 years, 6 months
1
0
0
0
[janderwald] 51998: [USBOHCI] - Fix OHCI_ISO_TD structure. Fixes host system crashes in Windows XP - Fix multiple bugs in isochronous transfer implementation - Still not yet working, as the interru...
by janderwald@svn.reactos.org
Author: janderwald Date: Sun May 29 19:54:55 2011 New Revision: 51998 URL:
http://svn.reactos.org/svn/reactos?rev=51998&view=rev
Log: [USBOHCI] - Fix OHCI_ISO_TD structure. Fixes host system crashes in Windows XP - Fix multiple bugs in isochronous transfer implementation - Still not yet working, as the interrupt completion is not fired yet Modified: branches/usb-bringup/drivers/usb/usbohci/hardware.h branches/usb-bringup/drivers/usb/usbohci/usb_queue.cpp branches/usb-bringup/drivers/usb/usbohci/usb_request.cpp Modified: branches/usb-bringup/drivers/usb/usbohci/hardware.h URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbohci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbohci/hardware.h [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbohci/hardware.h [iso-8859-1] Sun May 29 19:54:55 2011 @@ -310,12 +310,21 @@ ULONG BufferPhysical; // Physical page number of byte 0 ULONG NextPhysicalDescriptor; // Next isochronous transfer descriptor ULONG LastPhysicalByteAddress; // Physical buffer end - ULONG Offset[OHCI_ITD_NOFFSET]; // Buffer offsets + USHORT Offset[OHCI_ITD_NOFFSET]; // Buffer offsets // Software part PHYSICAL_ADDRESS PhysicalAddress; // Physical address of this descriptor struct _OHCI_ISO_TD_ * NextLogicalDescriptor; // Logical pointer next descriptor }OHCI_ISO_TD, *POHCI_ISO_TD; + +C_ASSERT(FIELD_OFFSET(OHCI_ISO_TD, Flags) == 0); +C_ASSERT(FIELD_OFFSET(OHCI_ISO_TD, BufferPhysical) == 4); +C_ASSERT(FIELD_OFFSET(OHCI_ISO_TD, NextPhysicalDescriptor) == 8); +C_ASSERT(FIELD_OFFSET(OHCI_ISO_TD, LastPhysicalByteAddress) == 12); +C_ASSERT(FIELD_OFFSET(OHCI_ISO_TD, Offset) == 16); +C_ASSERT(FIELD_OFFSET(OHCI_ISO_TD, PhysicalAddress) == 32); +C_ASSERT(FIELD_OFFSET(OHCI_ISO_TD, NextLogicalDescriptor) == 40); +C_ASSERT(sizeof(OHCI_ISO_TD) == 48); #define OHCI_ITD_GET_STARTING_FRAME(x) ((x) & 0x0000ffff) #define OHCI_ITD_SET_STARTING_FRAME(x) ((x) & 0xffff) Modified: branches/usb-bringup/drivers/usb/usbohci/usb_queue.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbohci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbohci/usb_queue.cpp [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbohci/usb_queue.cpp [iso-8859-1] Sun May 29 19:54:55 2011 @@ -43,8 +43,10 @@ // local functions BOOLEAN IsTransferDescriptorInEndpoint(IN POHCI_ENDPOINT_DESCRIPTOR EndpointDescriptor, IN ULONG TransferDescriptorLogicalAddress); + BOOLEAN IsTransferDescriptorInIsoEndpoint(IN POHCI_ENDPOINT_DESCRIPTOR EndpointDescriptor, IN ULONG TransferDescriptorLogicalAddress); NTSTATUS FindTransferDescriptorInEndpoint(IN POHCI_ENDPOINT_DESCRIPTOR EndpointDescriptor, IN ULONG TransferDescriptorLogicalAddress, OUT POHCI_ENDPOINT_DESCRIPTOR *OutEndpointDescriptor, OUT POHCI_ENDPOINT_DESCRIPTOR *OutPreviousEndpointDescriptor); NTSTATUS FindTransferDescriptorInInterruptHeadEndpoints(IN ULONG TransferDescriptorLogicalAddress, OUT POHCI_ENDPOINT_DESCRIPTOR *OutEndpointDescriptor, OUT POHCI_ENDPOINT_DESCRIPTOR *OutPreviousEndpointDescriptor); + NTSTATUS FindTransferDescriptorInIsochronousHeadEndpoints(IN ULONG TransferDescriptorLogicalAddress, OUT POHCI_ENDPOINT_DESCRIPTOR *OutEndpointDescriptor, OUT POHCI_ENDPOINT_DESCRIPTOR *OutPreviousEndpointDescriptor); VOID CleanupEndpointDescriptor(POHCI_ENDPOINT_DESCRIPTOR EndpointDescriptor, POHCI_ENDPOINT_DESCRIPTOR PreviousEndpointDescriptor); POHCI_ENDPOINT_DESCRIPTOR FindInterruptEndpointDescriptor(UCHAR InterruptInterval); @@ -102,6 +104,8 @@ Hardware->GetControlHeadEndpointDescriptor(&m_ControlHeadEndpointDescriptor); // + // get isochronous endpoint + // Hardware->GetIsochronousHeadEndpointDescriptor(&m_IsoHeadEndpointDescriptor); // @@ -170,6 +174,7 @@ POHCI_ENDPOINT_DESCRIPTOR Descriptor; POHCI_ISO_TD CurrentDescriptor; ULONG FrameNumber; + USHORT Frame; DPRINT("CUSBQueue::AddUSBRequest\n"); @@ -244,9 +249,9 @@ m_Hardware->GetCurrentFrameNumber(&FrameNumber); // - // increment frame number - // - FrameNumber++; + // FIXME: increment frame number + // + FrameNumber += 300; // // apply frame number to iso transfer descriptors @@ -254,18 +259,19 @@ CurrentDescriptor = (POHCI_ISO_TD)Descriptor->HeadLogicalDescriptor; DPRINT1("ISO: NextFrameNumber %x\n", FrameNumber); + Frame = (FrameNumber & 0xFFFF); while(CurrentDescriptor) { // // set current frame number // - CurrentDescriptor->Flags |= OHCI_ITD_SET_STARTING_FRAME(FrameNumber); + CurrentDescriptor->Flags |= OHCI_ITD_SET_STARTING_FRAME(Frame); // // move to next frame number // - FrameNumber++; + Frame += OHCI_ITD_GET_FRAME_COUNT(CurrentDescriptor->Flags); // // move to next descriptor @@ -275,14 +281,14 @@ } // + // set descriptor active + // + Descriptor->Flags &= ~OHCI_ENDPOINT_SKIP; + + // // insert endpoint at end // LinkEndpoint(HeadDescriptor, Descriptor); - - // - // set descriptor active - // - Descriptor->Flags &= ~OHCI_ENDPOINT_SKIP; if (Type == USB_ENDPOINT_TYPE_CONTROL || Type == USB_ENDPOINT_TYPE_BULK) { @@ -402,6 +408,97 @@ return STATUS_NOT_FOUND; } +NTSTATUS +CUSBQueue::FindTransferDescriptorInIsochronousHeadEndpoints( + IN ULONG TransferDescriptorLogicalAddress, + OUT POHCI_ENDPOINT_DESCRIPTOR *OutEndpointDescriptor, + OUT POHCI_ENDPOINT_DESCRIPTOR *OutPreviousEndpointDescriptor) +{ + POHCI_ENDPOINT_DESCRIPTOR EndpointDescriptor; + POHCI_ENDPOINT_DESCRIPTOR LastDescriptor = m_IsoHeadEndpointDescriptor; + + + // + // skip first endpoint head + // + EndpointDescriptor = (POHCI_ENDPOINT_DESCRIPTOR)m_IsoHeadEndpointDescriptor->NextDescriptor; + + while(EndpointDescriptor) + { + // + // check if the transfer descriptor is inside the list + // + if (IsTransferDescriptorInIsoEndpoint(EndpointDescriptor, TransferDescriptorLogicalAddress)) + { + // + // found endpoint + // + *OutEndpointDescriptor = EndpointDescriptor; + *OutPreviousEndpointDescriptor = LastDescriptor; + + // + // done + // + return STATUS_SUCCESS; + } + + // + // store last endpoint + // + LastDescriptor = EndpointDescriptor; + + // + // move to next + // + EndpointDescriptor = (POHCI_ENDPOINT_DESCRIPTOR)EndpointDescriptor->NextDescriptor; + } + + // + // failed to endpoint + // + return STATUS_NOT_FOUND; +} + +BOOLEAN +CUSBQueue::IsTransferDescriptorInIsoEndpoint( + IN POHCI_ENDPOINT_DESCRIPTOR EndpointDescriptor, + IN ULONG TransferDescriptorLogicalAddress) +{ + POHCI_ISO_TD Descriptor; + + // + // get first general transfer descriptor + // + Descriptor = (POHCI_ISO_TD)EndpointDescriptor->HeadLogicalDescriptor; + + // + // sanity check + // + ASSERT(Descriptor); + + do + { + if (Descriptor->PhysicalAddress.LowPart == TransferDescriptorLogicalAddress) + { + // + // found descriptor + // + return TRUE; + } + + // + // move to next + // + Descriptor = (POHCI_ISO_TD)Descriptor->NextLogicalDescriptor; + }while(Descriptor); + + // + // no descriptor found + // + return FALSE; +} + + BOOLEAN CUSBQueue::IsTransferDescriptorInEndpoint( IN POHCI_ENDPOINT_DESCRIPTOR EndpointDescriptor, @@ -476,6 +573,8 @@ // //ASSERT(Request->IsRequestComplete()); + Request->FreeEndpointDescriptor(EndpointDescriptor); + // // release request // @@ -511,7 +610,7 @@ POHCI_ENDPOINT_DESCRIPTOR EndpointDescriptor, PreviousEndpointDescriptor; NTSTATUS Status; - DPRINT("CUSBQueue::TransferDescriptorCompletionCallback transfer descriptor %x\n", TransferDescriptorLogicalAddress); + DPRINT1("CUSBQueue::TransferDescriptorCompletionCallback transfer descriptor %x\n", TransferDescriptorLogicalAddress); // // find transfer descriptor in control list @@ -564,13 +663,30 @@ return; } + // + // last try: find the descriptor in isochronous list + // + Status = FindTransferDescriptorInIsochronousHeadEndpoints(TransferDescriptorLogicalAddress, &EndpointDescriptor, &PreviousEndpointDescriptor); + if (NT_SUCCESS(Status)) + { + // + // cleanup endpoint + // + DPRINT1("ISO endpoint complete\n"); +ASSERT(FALSE); + CleanupEndpointDescriptor(EndpointDescriptor, PreviousEndpointDescriptor); + + // + // done + // + return; + } // // hardware reported dead endpoint completed // - DPRINT("CUSBQueue::TransferDescriptorCompletionCallback invalid transfer descriptor %x\n", TransferDescriptorLogicalAddress); + DPRINT1("CUSBQueue::TransferDescriptorCompletionCallback invalid transfer descriptor %x\n", TransferDescriptorLogicalAddress); ASSERT(FALSE); - } POHCI_ENDPOINT_DESCRIPTOR Modified: branches/usb-bringup/drivers/usb/usbohci/usb_request.cpp URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbohci…
============================================================================== --- branches/usb-bringup/drivers/usb/usbohci/usb_request.cpp [iso-8859-1] (original) +++ branches/usb-bringup/drivers/usb/usbohci/usb_request.cpp [iso-8859-1] Sun May 29 19:54:55 2011 @@ -299,7 +299,7 @@ m_TransferBufferMDL = Urb->UrbIsochronousTransfer.TransferBufferMDL; } } - + // // save buffer length // @@ -656,13 +656,12 @@ { POHCI_ISO_TD FirstDescriptor, PreviousDescriptor = NULL, CurrentDescriptor; POHCI_ENDPOINT_DESCRIPTOR EndpointDescriptor; - ULONG Index = 0, SubIndex, NumberOfPackets, PageOffset; + ULONG Index = 0, SubIndex, NumberOfPackets, PageOffset, Page; NTSTATUS Status; PVOID Buffer; PIO_STACK_LOCATION IoStack; PURB Urb; - DPRINT1("cp\n"); // // get current irp stack location // @@ -690,23 +689,27 @@ // // failed to create setup descriptor // + ASSERT(FALSE); return Status; } - DPRINT1("cp\n"); + // // get buffer // Buffer = MmGetSystemAddressForMdlSafe(m_TransferBufferMDL, NormalPagePriority); ASSERT(Buffer); - DPRINT1("cp\n"); + // + // FIXME: support requests which spans serveral pages + // + ASSERT(ADDRESS_AND_SIZE_TO_SPAN_PAGES(MmGetMdlVirtualAddress(m_TransferBufferMDL), MmGetMdlByteCount(m_TransferBufferMDL)) <= 2); + while(Index < Urb->UrbIsochronousTransfer.NumberOfPackets) { // // get number of packets remaining // NumberOfPackets = min(Urb->UrbIsochronousTransfer.NumberOfPackets - Index, OHCI_ITD_NOFFSET); - DPRINT1("cp Number Packets %lu\n", NumberOfPackets); // // allocate iso descriptor // @@ -720,23 +723,29 @@ ASSERT(FALSE); return Status; } - DPRINT1("cp\n"); + + // + // get physical page + // + Page = MmGetPhysicalAddress(Buffer).LowPart; + + // + // get page offset + // + PageOffset = MmGetMdlByteOffset(m_TransferBufferMDL); + // // initialize descriptor // - CurrentDescriptor->BufferPhysical = (MmGetPhysicalAddress(Buffer).LowPart & ~ (PAGE_SIZE - 1)); - - // - // get page offset - // - PageOffset = BYTE_OFFSET(MmGetPhysicalAddress(Buffer).LowPart); - DPRINT1("cp\n"); + CurrentDescriptor->BufferPhysical = Page - PageOffset; + for(SubIndex = 0; SubIndex < NumberOfPackets; SubIndex++) { // // store buffer offset // - CurrentDescriptor->Offset[SubIndex] = Urb->UrbIsochronousTransfer.IsoPacket[Index].Offset + PageOffset; + CurrentDescriptor->Offset[SubIndex] = Urb->UrbIsochronousTransfer.IsoPacket[Index+SubIndex].Offset + PageOffset; + DPRINT1("Index %lu PacketOffset %lu FinalOffset %lu\n", SubIndex+Index, Urb->UrbIsochronousTransfer.IsoPacket[Index+SubIndex].Offset, CurrentDescriptor->Offset[SubIndex]); } // @@ -752,19 +761,14 @@ // // end of transfer // - CurrentDescriptor->LastPhysicalByteAddress = CurrentDescriptor->BufferPhysical + m_TransferBufferLength - 1; + CurrentDescriptor->LastPhysicalByteAddress = CurrentDescriptor->BufferPhysical + PageOffset + m_TransferBufferLength - 1; } else { // // use start address of next packet - 1 // - CurrentDescriptor->LastPhysicalByteAddress = CurrentDescriptor->BufferPhysical + PageOffset + Urb->UrbIsochronousTransfer.IsoPacket[Index + 1].Offset - 1; - - // - // move buffer to next address - // - Buffer = (PVOID)((ULONG_PTR)Buffer + Urb->UrbIsochronousTransfer.IsoPacket[Index + 1].Offset); + CurrentDescriptor->LastPhysicalByteAddress = CurrentDescriptor->BufferPhysical + PageOffset + Urb->UrbIsochronousTransfer.IsoPacket[Index].Offset - 1; } // @@ -790,8 +794,13 @@ // store as previous descriptor // PreviousDescriptor = CurrentDescriptor; - } - DPRINT1("cp\n"); + DPRINT1("Current Descriptor %p Logical %lx StartAddress %x EndAddress %x\n", CurrentDescriptor, CurrentDescriptor->PhysicalAddress.LowPart, CurrentDescriptor->BufferPhysical, CurrentDescriptor->LastPhysicalByteAddress); + + // + // fire interrupt as soon transfer is finished + // + CurrentDescriptor->Flags |= OHCI_TD_SET_DELAY_INTERRUPT(OHCI_TD_INTERRUPT_IMMEDIATE); + } // // clear interrupt mask for last transfer descriptor @@ -814,7 +823,7 @@ EndpointDescriptor->HeadPhysicalDescriptor = FirstDescriptor->PhysicalAddress.LowPart; EndpointDescriptor->TailPhysicalDescriptor = CurrentDescriptor->PhysicalAddress.LowPart; EndpointDescriptor->HeadLogicalDescriptor = FirstDescriptor; - DPRINT1("cp\n"); + // // store result // @@ -1451,48 +1460,95 @@ struct _OHCI_ENDPOINT_DESCRIPTOR * OutDescriptor) { POHCI_GENERAL_TD TransferDescriptor, NextTransferDescriptor; + POHCI_ISO_TD IsoTransferDescriptor, IsoNextTransferDescriptor; + ULONG Index, PacketCount; DPRINT("CUSBRequest::FreeEndpointDescriptor EndpointDescriptor %p Logical %x\n", OutDescriptor, OutDescriptor->PhysicalAddress.LowPart); - // - // get first general transfer descriptor - // - TransferDescriptor = (POHCI_GENERAL_TD)OutDescriptor->HeadLogicalDescriptor; - - // - // release endpoint descriptor - // - m_DmaManager->Release(OutDescriptor, sizeof(OHCI_ENDPOINT_DESCRIPTOR)); - - while(TransferDescriptor) - { - // - // get next - // - NextTransferDescriptor = (POHCI_GENERAL_TD)TransferDescriptor->NextLogicalDescriptor; - - // - // is there a buffer associated - // - if (TransferDescriptor->BufferSize) - { - // - // release buffer - // - m_DmaManager->Release(TransferDescriptor->BufferLogical, TransferDescriptor->BufferSize); - } - - DPRINT("CUSBRequest::FreeEndpointDescriptor Descriptor %p Logical %x Buffer Physical %x EndAddress %x\n", TransferDescriptor, TransferDescriptor->PhysicalAddress.LowPart, TransferDescriptor->BufferPhysical, TransferDescriptor->LastPhysicalByteAddress); - - // - // release descriptor - // - m_DmaManager->Release(TransferDescriptor, sizeof(OHCI_GENERAL_TD)); - - // - // move to next - // - TransferDescriptor = NextTransferDescriptor; + if (OutDescriptor->Flags & OHCI_ENDPOINT_ISOCHRONOUS_FORMAT) + { + // + // get first iso transfer descriptor + // + IsoTransferDescriptor = (POHCI_ISO_TD)OutDescriptor->HeadLogicalDescriptor; + + // + // release endpoint descriptor + // + m_DmaManager->Release(OutDescriptor, sizeof(OHCI_ENDPOINT_DESCRIPTOR)); + + while(IsoTransferDescriptor) + { + // + // get next + // + IsoNextTransferDescriptor = IsoTransferDescriptor->NextLogicalDescriptor; + + // + // get packet count + // + PacketCount = OHCI_ITD_GET_FRAME_COUNT(IsoTransferDescriptor->Flags); + + DPRINT1("CUSBRequest::FreeEndpointDescriptor Descriptor %p Logical %x Buffer Physical %x EndAddress %x PacketCount %lu\n", IsoTransferDescriptor, IsoTransferDescriptor->PhysicalAddress.LowPart, IsoTransferDescriptor->BufferPhysical, IsoTransferDescriptor->LastPhysicalByteAddress, PacketCount); + + for(Index = 0; Index < PacketCount; Index++) + { + DPRINT1("PSW Index %lu Value %x\n", Index, IsoTransferDescriptor->Offset[Index]); + } + + // + // release descriptor + // + m_DmaManager->Release(IsoTransferDescriptor, sizeof(OHCI_ISO_TD)); + + // + // move to next + // + IsoTransferDescriptor = IsoNextTransferDescriptor; + } + } + else + { + // + // get first general transfer descriptor + // + TransferDescriptor = (POHCI_GENERAL_TD)OutDescriptor->HeadLogicalDescriptor; + + // + // release endpoint descriptor + // + m_DmaManager->Release(OutDescriptor, sizeof(OHCI_ENDPOINT_DESCRIPTOR)); + + while(TransferDescriptor) + { + // + // get next + // + NextTransferDescriptor = (POHCI_GENERAL_TD)TransferDescriptor->NextLogicalDescriptor; + + // + // is there a buffer associated + // + if (TransferDescriptor->BufferSize) + { + // + // release buffer + // + m_DmaManager->Release(TransferDescriptor->BufferLogical, TransferDescriptor->BufferSize); + } + + DPRINT("CUSBRequest::FreeEndpointDescriptor Descriptor %p Logical %x Buffer Physical %x EndAddress %x\n", TransferDescriptor, TransferDescriptor->PhysicalAddress.LowPart, TransferDescriptor->BufferPhysical, TransferDescriptor->LastPhysicalByteAddress); + + // + // release descriptor + // + m_DmaManager->Release(TransferDescriptor, sizeof(OHCI_GENERAL_TD)); + + // + // move to next + // + TransferDescriptor = NextTransferDescriptor; + } } }
13 years, 6 months
1
0
0
0
[cgutman] 51997: [NTOSKRNL] - Fix a reference leak which prevented driver objects passed to IoRegisterPlugPlayNotification from being able to unload after the notification was unregistered - Fix a ...
by cgutman@svn.reactos.org
Author: cgutman Date: Sun May 29 16:44:34 2011 New Revision: 51997 URL:
http://svn.reactos.org/svn/reactos?rev=51997&view=rev
Log: [NTOSKRNL] - Fix a reference leak which prevented driver objects passed to IoRegisterPlugPlayNotification from being able to unload after the notification was unregistered - Fix a non-paged pool leak Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpnoti…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpnotify.c [iso-8859-1] Sun May 29 16:44:34 2011 @@ -23,6 +23,7 @@ PVOID Context; UNICODE_STRING Guid; PFILE_OBJECT FileObject; + PDRIVER_OBJECT DriverObject; PDRIVER_NOTIFICATION_CALLBACK_ROUTINE PnpNotificationProc; } PNP_NOTIFY_ENTRY, *PPNP_NOTIFY_ENTRY; @@ -319,6 +320,7 @@ Entry->PnpNotificationProc = CallbackRoutine; Entry->EventCategory = EventCategory; Entry->Context = Context; + Entry->DriverObject = DriverObject; switch (EventCategory) { case EventCategoryDeviceInterfaceChange: @@ -377,9 +379,14 @@ DPRINT("__FUNCTION__(NotificationEntry %p) called\n", Entry); KeAcquireGuardedMutex(&PnpNotifyListLock); - RtlFreeUnicodeString(&Entry->Guid); RemoveEntryList(&Entry->PnpNotifyList); KeReleaseGuardedMutex(&PnpNotifyListLock); + RtlFreeUnicodeString(&Entry->Guid); + + ObDereferenceObject(Entry->DriverObject); + + ExFreePoolWithTag(Entry, TAG_PNP_NOTIFY); + return STATUS_SUCCESS; }
13 years, 6 months
1
0
0
0
[ekohl] 51996: [SETUPAPI] - Add stubs for CM_Set_Class_Registry_PropertyA/W. - Add support for missing properties to CM_Set_DevNode_Registry_Property_ExA/W.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun May 29 16:18:22 2011 New Revision: 51996 URL:
http://svn.reactos.org/svn/reactos?rev=51996&view=rev
Log: [SETUPAPI] - Add stubs for CM_Set_Class_Registry_PropertyA/W. - Add support for missing properties to CM_Set_DevNode_Registry_Property_ExA/W. Modified: trunk/reactos/dll/win32/setupapi/cfgmgr.c trunk/reactos/dll/win32/setupapi/setupapi.spec Modified: trunk/reactos/dll/win32/setupapi/cfgmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/cfgmgr.…
============================================================================== --- trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] Sun May 29 16:18:22 2011 @@ -5001,6 +5001,32 @@ /*********************************************************************** + * CM_Set_Class_Registry_PropertyA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Set_Class_Registry_PropertyA( + LPGUID ClassGuid, ULONG ulProperty, PCVOID Buffer, ULONG ulLength, + ULONG ulFlags, HMACHINE hMachine) +{ + FIXME("%p %lx %p %lu %lx %p\n", + ClassGuid, ulProperty, Buffer, ulLength, ulFlags, hMachine); + return CR_CALL_NOT_IMPLEMENTED; +} + + +/*********************************************************************** + * CM_Set_Class_Registry_PropertyW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Set_Class_Registry_PropertyW( + LPGUID ClassGuid, ULONG ulProperty, PCVOID Buffer, ULONG ulLength, + ULONG ulFlags, HMACHINE hMachine) +{ + FIXME("%p %lx %p %lu %lx %p\n", + ClassGuid, ulProperty, Buffer, ulLength, ulFlags, hMachine); + return CR_CALL_NOT_IMPLEMENTED; +} + + +/*********************************************************************** * CM_Set_DevNode_Problem [SETUPAPI.@] */ CONFIGRET WINAPI CM_Set_DevNode_Problem( @@ -5178,6 +5204,30 @@ case CM_DRP_LOWERFILTERS: ulType = REG_MULTI_SZ; + break; + + case CM_DRP_SECURITY: + ulType = REG_BINARY; + break; + + case CM_DRP_DEVTYPE: + ulType = REG_DWORD; + break; + + case CM_DRP_EXCLUSIVE: + ulType = REG_DWORD; + break; + + case CM_DRP_CHARACTERISTICS: + ulType = REG_DWORD; + break; + + case CM_DRP_UI_NUMBER_DESC_FORMAT: + ulType = REG_SZ; + break; + + case CM_DRP_REMOVAL_POLICY_OVERRIDE: + ulType = REG_DWORD; break; default: @@ -5332,6 +5382,30 @@ ulType = REG_MULTI_SZ; break; + case CM_DRP_SECURITY: + ulType = REG_BINARY; + break; + + case CM_DRP_DEVTYPE: + ulType = REG_DWORD; + break; + + case CM_DRP_EXCLUSIVE: + ulType = REG_DWORD; + break; + + case CM_DRP_CHARACTERISTICS: + ulType = REG_DWORD; + break; + + case CM_DRP_UI_NUMBER_DESC_FORMAT: + ulType = REG_SZ; + break; + + case CM_DRP_REMOVAL_POLICY_OVERRIDE: + ulType = REG_DWORD; + break; + default: return CR_INVALID_PROPERTY; } Modified: trunk/reactos/dll/win32/setupapi/setupapi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/setupap…
============================================================================== --- trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] Sun May 29 16:18:22 2011 @@ -184,8 +184,8 @@ @ stdcall CM_Request_Eject_PC_Ex(long) @ stdcall CM_Run_Detection(long) @ stdcall CM_Run_Detection_Ex(long long) -@ stub CM_Set_Class_Registry_PropertyA -@ stub CM_Set_Class_Registry_PropertyW +@ stdcall CM_Set_Class_Registry_PropertyA(ptr long ptr long long ptr) +@ stdcall CM_Set_Class_Registry_PropertyW(ptr long ptr long long ptr) @ stdcall CM_Set_DevNode_Problem(long long long) @ stdcall CM_Set_DevNode_Problem_Ex(long long long long) @ stdcall CM_Set_DevNode_Registry_PropertyA(long long ptr long long)
13 years, 6 months
1
0
0
0
[ekohl] 51995: [UMPNPMGR] Implement PNP_GetClassRegProp and fix a little bug in PNP_GetDeviceRegProp.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun May 29 15:58:49 2011 New Revision: 51995 URL:
http://svn.reactos.org/svn/reactos?rev=51995&view=rev
Log: [UMPNPMGR] Implement PNP_GetClassRegProp and fix a little bug in PNP_GetDeviceRegProp. Modified: trunk/reactos/base/services/umpnpmgr/umpnpmgr.c Modified: trunk/reactos/base/services/umpnpmgr/umpnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/umpnpmgr/ump…
============================================================================== --- trunk/reactos/base/services/umpnpmgr/umpnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/base/services/umpnpmgr/umpnpmgr.c [iso-8859-1] Sun May 29 15:58:49 2011 @@ -730,14 +730,17 @@ pulRegDataType, Buffer, pulLength); - if (lError == ERROR_MORE_DATA) + if (lError != ERROR_SUCCESS) { - ret = CR_BUFFER_SMALL; - } - else - { - *pulLength = 0; - ret = CR_NO_SUCH_VALUE; + if (lError == ERROR_MORE_DATA) + { + ret = CR_BUFFER_SMALL; + } + else + { + *pulLength = 0; + ret = CR_NO_SUCH_VALUE; + } } } else @@ -827,7 +830,7 @@ } done:; - *pulTransferLen = (ret != CR_SUCCESS) ? 0 : *pulLength; + *pulTransferLen = (ret == CR_SUCCESS) ? *pulLength : 0; if (hKey != NULL) RegCloseKey(hKey); @@ -1234,8 +1237,113 @@ PNP_RPC_STRING_LEN *pulLength, DWORD ulFlags) { - UNIMPLEMENTED; - return CR_CALL_NOT_IMPLEMENTED; + CONFIGRET ret = CR_SUCCESS; + LPWSTR lpValueName = NULL; + HKEY hInstKey = NULL; + HKEY hPropKey = NULL; + LONG lError; + + UNREFERENCED_PARAMETER(hBinding); + + DPRINT("PNP_GetClassRegProp() called\n"); + + if (pulTransferLen == NULL || pulLength == NULL) + { + ret = CR_INVALID_POINTER; + goto done; + } + + if (ulFlags != 0) + { + ret = CR_INVALID_FLAG; + goto done; + } + + if (*pulLength < *pulTransferLen) + *pulLength = *pulTransferLen; + + *pulTransferLen = 0; + + switch (ulProperty) + { + case CM_CRP_SECURITY: + lpValueName = L"Security"; + break; + + case CM_CRP_DEVTYPE: + lpValueName = L"DeviceType"; + break; + + case CM_CRP_EXCLUSIVE: + lpValueName = L"Exclusive"; + break; + + case CM_CRP_CHARACTERISTICS: + lpValueName = L"DeviceCharacteristics"; + break; + + default: + ret = CR_INVALID_PROPERTY; + goto done; + } + + DPRINT("Value name: %S\n", lpValueName); + + lError = RegOpenKeyExW(hClassKey, + pszClassGuid, + 0, + KEY_READ, + &hInstKey); + if (lError != ERROR_SUCCESS) + { + *pulLength = 0; + ret = CR_NO_SUCH_REGISTRY_KEY; + goto done; + } + + lError = RegOpenKeyExW(hInstKey, + L"Properties", + 0, + KEY_READ, + &hPropKey); + if (lError != ERROR_SUCCESS) + { + *pulLength = 0; + ret = CR_NO_SUCH_REGISTRY_KEY; + goto done; + } + + lError = RegQueryValueExW(hPropKey, + lpValueName, + NULL, + pulRegDataType, + Buffer, + pulLength); + if (lError != ERROR_SUCCESS) + { + if (lError == ERROR_MORE_DATA) + { + ret = CR_BUFFER_SMALL; + } + else + { + *pulLength = 0; + ret = CR_NO_SUCH_VALUE; + } + } + +done:; + *pulTransferLen = (ret == CR_SUCCESS) ? *pulLength : 0; + + if (hPropKey != NULL) + RegCloseKey(hPropKey); + + if (hInstKey != NULL) + RegCloseKey(hInstKey); + + DPRINT("PNP_GetClassRegProp() done (returns %lx)\n", ret); + + return ret; } @@ -1264,19 +1372,19 @@ switch (ulProperty) { - case CM_DRP_SECURITY: + case CM_CRP_SECURITY: lpValueName = L"Security"; break; - case CM_DRP_DEVTYPE: + case CM_CRP_DEVTYPE: lpValueName = L"DeviceType"; break; - case CM_DRP_EXCLUSIVE: + case CM_CRP_EXCLUSIVE: lpValueName = L"Exclusive"; break; - case CM_DRP_CHARACTERISTICS: + case CM_CRP_CHARACTERISTICS: lpValueName = L"DeviceCharacteristics"; break;
13 years, 6 months
1
0
0
0
[tkreuzer] 51994: [WIN32K] - Finish implementation of EngLoadFontFile and EngLoadFontFileFD except checksum support - Fix a typo noticed by Amine
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun May 29 14:23:37 2011 New Revision: 51994 URL:
http://svn.reactos.org/svn/reactos?rev=51994&view=rev
Log: [WIN32K] - Finish implementation of EngLoadFontFile and EngLoadFontFileFD except checksum support - Fix a typo noticed by Amine Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fntdrvsup.c branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontrsrc.c branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/textmetric.c branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fntdrvsup.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/subsyst…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fntdrvsup.c [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fntdrvsup.c [iso-8859-1] Sun May 29 14:23:37 2011 @@ -58,9 +58,9 @@ gbAttachedCSRSS = FALSE; } - -ULONG_PTR -FONTDEV_LoadFontFile( +static +HFF +FONTDEV_hffLoadFontFile( PFONTDEV pfntdev, ULONG cFiles, ULONG_PTR *piFile, @@ -88,56 +88,70 @@ } -#if 0 +HFF +NTAPI EngLoadFontFileFD( - PPFF ppff, + ULONG cFiles, + PULONG_PTR piFiles, + DESIGNVECTOR *pdv, + ULONG ulCheckSum, + HDEV *phdev) { KAPC_STATE ApcState; - ULONG_PTR aiFile[FD_MAX_FILES]; PVOID apvView[FD_MAX_FILES]; ULONG acjView[FD_MAX_FILES]; - ULONG ulLangID = 0; + ULONG i, ulLangID = 0; + PFONTDEV pfntdev; + PLIST_ENTRY ple; HFF hff = 0; /* Loop all files */ - for (i = 0; i < ppff->cFiles; i++) - { - /* Setup the file array */ - aiFile[i] = (ULONG_PTR)ppff->ppfv[i]; - + for (i = 0; i < cFiles; i++) + { /* Map the font file */ - bResult = EngMapFontFileFD(aiFile[i], &apvView[i], &acjView[i]); + if (!EngMapFontFileFD(piFiles[i], (PULONG*)&apvView[i], &acjView[i])) + { + ASSERT(FALSE); + } } /* Attach to CSRSS */ AttachCSRSS(&ApcState); + /* Acquire font friver list lock */ + EngAcquireSemaphore(ghsemFontDriver); + /* Loop all installed font drivers */ - for (pfntdev = gleFontDriverList.Flink; - pfntdev != &gleFontDriverList; - pfntdev = pfntdev->leLink.Flink) - { + for (ple = gleFontDriverList.Flink; + ple != &gleFontDriverList; + ple = ple->Flink) + { + pfntdev = CONTAINING_RECORD(ple, FONTDEV, leLink); + /* Try to load the font file */ - hff = FONTDEV_LoadFontFile(pfntdev, - cFiles, - aiFile, - apvView, - acjView, - pdv, - ulLangID, - ppff->ulCheckSum); + hff = FONTDEV_hffLoadFontFile(pfntdev, + cFiles, + piFiles, + apvView, + acjView, + pdv, + ulLangID, + ulCheckSum); if (hff) { - ppff->hff = hff; + *phdev = (HDEV)pfntdev; break; } } + /* Release font friver list lock */ + EngReleaseSemaphore(ghsemFontDriver); + /* Detach from CSRSS */ - DetachCSRSS(&ApcState) - -} -#endif + DetachCSRSS(&ApcState); + + return hff; +} BOOL EngLoadFontDriver( Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontrsrc.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/subsyst…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontrsrc.c [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/fontrsrc.c [iso-8859-1] Sun May 29 14:23:37 2011 @@ -32,7 +32,7 @@ for (i = 0; i < cFiles; i++) { /* Check if the files match */ - if (pffv[i] != ppff->ppfv[i]) return FALSE; + if (pffv[i] != ppff->apffv[i]) return FALSE; } return TRUE; @@ -41,13 +41,16 @@ PPFF NTAPI EngLoadFontFile( + IN ULONG cFiles, IN PWCHAR apwszFiles[], - IN ULONG cFiles) + IN DESIGNVECTOR *pdv) { PFONTFILEVIEW apffv[FD_MAX_FILES]; PLIST_ENTRY ple; - PPFF ppff; - ULONG i, cjSize; + PPFF ppff = NULL; + ULONG i, cjSize, ulChecksum = 0; + HDEV hdev; + HFF hff; /* Loop the files */ for (i = 0; i < cFiles; i++) @@ -79,8 +82,17 @@ } } + /* Load the font with any of the font drivers */ + hff = EngLoadFontFileFD(cFiles, (PULONG_PTR)apffv, pdv, ulChecksum, &hdev); + if (!hff) + { + DPRINT1("File format is not supported by any font driver\n"); + while (i--) EngFreeModule(apffv[i]); + goto leave; + } + /* Allocate a new PFF */ - cjSize = sizeof(PFF) + cFiles * sizeof(PVOID); + cjSize = sizeof(PFF); ppff = EngAllocMem(0, cjSize, 'ffpG'); if (!ppff) { @@ -89,10 +101,11 @@ ppff->sizeofThis = cjSize; ppff->cFiles = cFiles; - ppff->ppfv = (PVOID)(ppff + 1); + ppff->hdev = hdev; + ppff->hff = hff; /* Copy the FONTFILEVIEWs */ - for (i = 0; i < cFiles; i++) ppff->ppfv[i] = apffv[i]; + for (i = 0; i < cFiles; i++) ppff->apffv[i] = apffv[i]; /* Insert the PFF into the list */ InsertTailList(&glePFFList, &ppff->leLink); @@ -186,8 +199,10 @@ INT iRes = 0; /* Check parameters */ - if (cFiles > FD_MAX_FILES || cwc < 3 || cwc > FD_MAX_FILES * MAX_PATH) - { + if (cFiles == 0 || cFiles > FD_MAX_FILES || + cwc < 6 || cwc > FD_MAX_FILES * MAX_PATH) + { + EngSetLastError(ERROR_INVALID_PARAMETER); return 0; } @@ -195,6 +210,7 @@ pvBuffer = EngAllocMem(0, (cwc + 1) * sizeof(WCHAR), 'pmTG'); if (!pvBuffer) { + EngSetLastError(ERROR_NOT_ENOUGH_MEMORY); return 0; } Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/textmetric.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/subsyst…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/textmetric.c [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/textmetric.c [iso-8859-1] Sun May 29 14:23:37 2011 @@ -59,7 +59,7 @@ /* Unlock the DC and return */ DC_UnlockDc(pdc); - return bResult;; + return bResult; } W32KAPI Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/subsyst…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h [iso-8859-1] Sun May 29 14:23:37 2011 @@ -36,8 +36,8 @@ struct _PFT *pPFT; ULONG ulCheckSum; ULONG cFonts; - PFONTFILEVIEW *ppfv; void *pPvtDataHead; + PFONTFILEVIEW apffv[FD_MAX_FILES]; } PFF, *PPFF; typedef struct _PFE @@ -206,7 +206,6 @@ } - HFONT NTAPI GreHfontCreate( @@ -216,3 +215,15 @@ IN FLONG fl, IN PVOID pvCliData); +PRFONT +NTAPI +DC_prfnt(PDC pdc); + +HFF +NTAPI +EngLoadFontFileFD( + ULONG cFiles, + PULONG_PTR piFiles, + DESIGNVECTOR *pdv, + ULONG ulCheckSum, + HDEV *phdev);
13 years, 6 months
1
0
0
0
[mkupfer] 51993: Edijs Kolesnikovics < terminedijs AT yahoo DOT com> - Show GPL licence from beginning - See issue #6278 for details.
by mkupfer@svn.reactos.org
Author: mkupfer Date: Sun May 29 12:55:07 2011 New Revision: 51993 URL:
http://svn.reactos.org/svn/reactos?rev=51993&view=rev
Log: Edijs Kolesnikovics < terminedijs AT yahoo DOT com> - Show GPL licence from beginning - See issue #6278 for details. Modified: trunk/reactos/dll/cpl/sysdm/licence.c Modified: trunk/reactos/dll/cpl/sysdm/licence.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/sysdm/licence.c?re…
============================================================================== --- trunk/reactos/dll/cpl/sysdm/licence.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/sysdm/licence.c [iso-8859-1] Sun May 29 12:55:07 2011 @@ -54,7 +54,7 @@ EM_SETSEL, -1, 0); - + PostMessage(GetDlgItem(hDlg, IDC_LICENCEEDIT), WM_VSCROLL, SB_TOP, 0); return TRUE; }
13 years, 6 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
...
52
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
Results per page:
10
25
50
100
200