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
October 2009
----- 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
641 discussions
Start a n
N
ew thread
[mkupfer] 43327: - revert SPI_SETCLICKLOCK - small optimization in mgsqueue
by mkupfer@svn.reactos.org
Author: mkupfer Date: Wed Oct 7 20:22:25 2009 New Revision: 43327 URL:
http://svn.reactos.org/svn/reactos?rev=43327&view=rev
Log: - revert SPI_SETCLICKLOCK - small optimization in mgsqueue Modified: trunk/reactos/dll/cpl/main/mouse.c trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c Modified: trunk/reactos/dll/cpl/main/mouse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/main/mouse.c?rev=4…
============================================================================== --- trunk/reactos/dll/cpl/main/mouse.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/main/mouse.c [iso-8859-1] Wed Oct 7 20:22:25 2009 @@ -384,7 +384,7 @@ //SetDoubleClickTime(pButtonData->g_DoubleClickSpeed); #if (WINVER >= 0x0500) - SystemParametersInfo(SPI_SETMOUSECLICKLOCK, 0, &pButtonData->g_ClickLockEnabled, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); + SystemParametersInfo(SPI_SETMOUSECLICKLOCK, 0, (PVOID)pButtonData->g_ClickLockEnabled, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); if (pButtonData->g_ClickLockEnabled) SystemParametersInfo(SPI_SETMOUSECLICKLOCKTIME, pButtonData->g_ClickLockTime, NULL, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); #endif Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] Wed Oct 7 20:22:25 2009 @@ -274,21 +274,18 @@ if(Remove) { + CurInfo->LastBtnDownX = Msg->pt.x; + CurInfo->LastBtnDownY = Msg->pt.y; + CurInfo->ButtonsDown = Msg->message; if (Res) { CurInfo->LastBtnDown = 0; - CurInfo->LastBtnDownX = Msg->pt.x; - CurInfo->LastBtnDownY = Msg->pt.y; CurInfo->LastClkWnd = NULL; - CurInfo->ButtonsDown = Msg->message; } else { - CurInfo->LastBtnDownX = Msg->pt.x; - CurInfo->LastBtnDownY = Msg->pt.y; CurInfo->LastClkWnd = (HANDLE)Msg->hwnd; CurInfo->LastBtnDown = Msg->time; - CurInfo->ButtonsDown = Msg->message; } } Modified: trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] Wed Oct 7 20:22:25 2009 @@ -529,7 +529,7 @@ SpiSetUserPref(DWORD dwMask, PVOID pvValue, FLONG fl) { DWORD dwRegMask; - BOOL bValue = *(BOOL *)pvValue; + BOOL bValue = (BOOL)pvValue; REQ_INTERACTIVE_WINSTA(ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION); @@ -1323,7 +1323,7 @@ return SpiGetUserPref(UPM_CLICKLOCK, pvParam, fl); case SPI_SETMOUSECLICKLOCK: - gspv.bMouseClickLock = *(BOOL*) pvParam; + gspv.bMouseClickLock = (BOOL)pvParam; return SpiSetUserPref(UPM_CLICKLOCK, pvParam, fl); case SPI_GETMOUSEVANISH:
15 years, 2 months
1
0
0
0
[tkreuzer] 43326: Add test for NtUserSystemParametersInfo case SPI_SETMOUSECLICKLOCK
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Oct 7 18:58:53 2009 New Revision: 43326 URL:
http://svn.reactos.org/svn/reactos?rev=43326&view=rev
Log: Add test for NtUserSystemParametersInfo case SPI_SETMOUSECLICKLOCK Modified: trunk/rostests/apitests/w32knapi/ntuser/NtUserSystemParametersInfo.c Modified: trunk/rostests/apitests/w32knapi/ntuser/NtUserSystemParametersInfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntuser/…
============================================================================== --- trunk/rostests/apitests/w32knapi/ntuser/NtUserSystemParametersInfo.c [iso-8859-1] (original) +++ trunk/rostests/apitests/w32knapi/ntuser/NtUserSystemParametersInfo.c [iso-8859-1] Wed Oct 7 18:58:53 2009 @@ -17,8 +17,29 @@ //static const WCHAR* VAL_DRAGWIDTH = L"DragWidth"; //static const WCHAR* VAL_FNTSMOOTH = L"FontSmoothing"; static const WCHAR* VAL_PREFMASK = L"UserPreferencesMask"; -#define PREFMASK_MENUANIM 0x2 -#define PREFMASK_KBDCUES 0x20 + +enum +{ + UPM_ACTIVEWINDOWTRACKING = 0x01, + UPM_MENUANIMATION = 0x02, + UPM_COMBOBOXANIMATION = 0x04, + UPM_LISTBOXSMOOTHSCROLLING = 0x08, + UPM_GRADIENTCAPTIONS = 0x10, + UPM_KEYBOARDCUES = 0x20, + UPM_ACTIVEWNDTRKZORDER = 0x40, + UPM_HOTTRACKING = 0x80, + UPM_RESERVED = 0x100, + UPM_MENUFADE = 0x200, + UPM_SELECTIONFADE = 0x400, + UPM_TOOLTIPANIMATION = 0x800, + UPM_TOOLTIPFADE = 0x1000, + UPM_CURSORSHADOW = 0x2000, + UPM_CLICKLOCK = 0x8000, + // room for more + UPM_UIEFFECTS = 0x80000000, + UPM_DEFAULT = 0x80003E9E +} USERPREFMASKS; + //static const WCHAR* KEY_MDALIGN = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows"; //static const WCHAR* VAL_MDALIGN = L"MenuDropAlignment"; @@ -401,6 +422,15 @@ TEST((dwUserPref & dwPrefMask) == 0); TEST((dwUserPref & (~dwPrefMask)) == (dwUserPrefOrg & (~dwPrefMask))); + /* Value 2 without Registry */ + NtUserSystemParametersInfo(uiSet, 0, (PVOID)2, 0); + NtUserSystemParametersInfo(uiGet, 0, &bTemp, 0); + TEST(bTemp == 1); + cbSize = sizeof(dwUserPref); + TEST(QueryUserRegValueW(KEY_DESKTOP, VAL_PREFMASK, &dwUserPref, &cbSize, NULL) == ERROR_SUCCESS); + TEST((dwUserPref & dwPrefMask) == 0); + TEST((dwUserPref & (~dwPrefMask)) == (dwUserPrefOrg & (~dwPrefMask))); + /* Value 1 with Registry */ NtUserSystemParametersInfo(uiSet, 0, (PVOID)1, SPIF_UPDATEINIFILE); NtUserSystemParametersInfo(uiGet, 0, &bTemp, 0); @@ -942,7 +972,7 @@ TEST(bTemp == 0); cbSize = sizeof(dwUserPrefMask); TEST(QueryUserRegValueW(KEY_DESKTOP, VAL_PREFMASK, &dwUserPrefMask, &cbSize, NULL) == ERROR_SUCCESS); - TEST((dwUserPrefMask & PREFMASK_MENUANIM) == 0); + TEST((dwUserPrefMask & UPM_MENUANIMATION) == 0); /* Value 1 */ NtUserSystemParametersInfo(SPI_SETMENUANIMATION, 0, (PVOID)1, SPIF_UPDATEINIFILE); @@ -950,7 +980,7 @@ TEST(bTemp == 1); cbSize = sizeof(dwUserPrefMask); TEST(QueryUserRegValueW(KEY_DESKTOP, VAL_PREFMASK, &dwUserPrefMask, &cbSize, NULL) == ERROR_SUCCESS); - TEST((dwUserPrefMask & PREFMASK_MENUANIM) != 0); + TEST((dwUserPrefMask & UPM_MENUANIMATION) != 0); /* Restore original values */ @@ -966,7 +996,7 @@ INT Test_SPI_SETKEYBOARDCUES(PTESTINFO pti) { - return Test_UserPref(pti, SPI_GETKEYBOARDCUES, SPI_SETKEYBOARDCUES, PREFMASK_KBDCUES); + return Test_UserPref(pti, SPI_GETKEYBOARDCUES, SPI_SETKEYBOARDCUES, UPM_KEYBOARDCUES); } // Test_SPI_SETACTIVEWNDTRKZORDER(pti); @@ -977,7 +1007,13 @@ // Test_SPI_SETTOOLTIPFADE(pti); // Test_SPI_SETCURSORSHADOW(pti); // Test_SPI_SETMOUSESONAR(pti); -// Test_SPI_SETMOUSECLICKLOCK(pti); + +INT +Test_SPI_SETMOUSECLICKLOCK(PTESTINFO pti) +{ + return Test_UserPref(pti, SPI_GETMOUSECLICKLOCK, SPI_SETMOUSECLICKLOCK, UPM_CLICKLOCK); +} + // Test_SPI_SETMOUSEVANISH(pti); // Test_SPI_SETFLATMENU(pti); // Test_SPI_SETDROPSHADOW(pti); @@ -1091,7 +1127,7 @@ // Test_SPI_SETTOOLTIPFADE(pti); // Test_SPI_SETCURSORSHADOW(pti); // Test_SPI_SETMOUSESONAR(pti); -// Test_SPI_SETMOUSECLICKLOCK(pti); + Test_SPI_SETMOUSECLICKLOCK(pti); // Test_SPI_SETMOUSEVANISH(pti); // Test_SPI_SETFLATMENU(pti); // Test_SPI_SETDROPSHADOW(pti);
15 years, 2 months
1
0
0
0
[mkupfer] 43325: - some preparation for ClickLock implementation
by mkupfer@svn.reactos.org
Author: mkupfer Date: Wed Oct 7 16:25:52 2009 New Revision: 43325 URL:
http://svn.reactos.org/svn/reactos?rev=43325&view=rev
Log: - some preparation for ClickLock implementation Modified: trunk/reactos/subsystems/win32/win32k/include/cursoricon.h trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c Modified: trunk/reactos/subsystems/win32/win32k/include/cursoricon.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/cursoricon.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/cursoricon.h [iso-8859-1] Wed Oct 7 16:25:52 2009 @@ -41,6 +41,8 @@ typedef struct _SYSTEM_CURSORINFO { BOOL Enabled; + BOOL ClickLockActive; + DWORD ClickLockTime; // BOOL SwapButtons; UINT ButtonsDown; CURSORCLIP_INFO CursorClipInfo; Modified: trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] Wed Oct 7 16:25:52 2009 @@ -263,6 +263,7 @@ gspv.iWheelScrollLines = SpiLoadInt(KEY_DESKTOP, VAL_SCRLLLINES, 3); gspv.dwMouseClickLockTime = SpiLoadDWord(KEY_DESKTOP, VAL_CLICKLOCKTIME, 1200); gspv.dwUserPrefMask = SpiLoadUserPrefMask(UPM_DEFAULT); + gspv.bMouseClickLock = (gspv.dwUserPrefMask & UPM_CLICKLOCK) != 0; #if (_WIN32_WINNT >= 0x0600) gspv.iWheelScrollChars = SpiLoadInt(KEY_DESKTOP, VAL_SCRLLCHARS, 3); #endif @@ -1322,6 +1323,7 @@ return SpiGetUserPref(UPM_CLICKLOCK, pvParam, fl); case SPI_SETMOUSECLICKLOCK: + gspv.bMouseClickLock = *(BOOL*) pvParam; return SpiSetUserPref(UPM_CLICKLOCK, pvParam, fl); case SPI_GETMOUSEVANISH: Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c [iso-8859-1] Wed Oct 7 16:25:52 2009 @@ -537,6 +537,8 @@ CurInfo->LastBtnDown = 0; CurInfo->CurrentCursorObject = NULL; CurInfo->ShowingCursor = 0; + CurInfo->ClickLockActive = FALSE; + CurInfo->ClickLockTime = 0; /* // not used anymore
15 years, 2 months
1
0
0
0
[fireball] 43324: [fastfat_new] - Implement FatiQueryNameInformation. It doesn't work right now due to missing file names in the FCB record. - Make a stub for FatSetFcbNames.
by fireball@svn.reactos.org
Author: fireball Date: Wed Oct 7 14:21:13 2009 New Revision: 43324 URL:
http://svn.reactos.org/svn/reactos?rev=43324&view=rev
Log: [fastfat_new] - Implement FatiQueryNameInformation. It doesn't work right now due to missing file names in the FCB record. - Make a stub for FatSetFcbNames. Modified: trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h trunk/reactos/drivers/filesystems/fastfat_new/fcb.c trunk/reactos/drivers/filesystems/fastfat_new/finfo.c Modified: trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h [iso-8859-1] Wed Oct 7 14:21:13 2009 @@ -304,6 +304,10 @@ FatSetFullNameInFcb(PFCB Fcb, PUNICODE_STRING Name); +VOID NTAPI +FatSetFcbNames(IN PFAT_IRP_CONTEXT IrpContext, + IN PFCB Fcb); + /* ------------------------------------------------------------ rw.c */ NTSTATUS NTAPI Modified: trunk/reactos/drivers/filesystems/fastfat_new/fcb.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat_new/fcb.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat_new/fcb.c [iso-8859-1] Wed Oct 7 14:21:13 2009 @@ -149,6 +149,9 @@ Fcb->Header.ValidDataLength.LowPart = FileHandle->Filesize; Fcb->FatHandle = FileHandle; + /* Set names */ + FatSetFcbNames(IrpContext, Fcb); + return Fcb; } @@ -241,4 +244,13 @@ } } +VOID +NTAPI +FatSetFcbNames(IN PFAT_IRP_CONTEXT IrpContext, + IN PFCB Fcb) +{ + // Set the short name first + UNIMPLEMENTED; +} + /* EOF */ Modified: trunk/reactos/drivers/filesystems/fastfat_new/finfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat_new/finfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat_new/finfo.c [iso-8859-1] Wed Oct 7 14:21:13 2009 @@ -61,10 +61,51 @@ FatiQueryNameInformation(IN PFAT_IRP_CONTEXT IrpContext, IN PFCB Fcb, IN PFILE_OBJECT FileObject, - IN OUT PFILE_INTERNAL_INFORMATION Buffer, + IN OUT PFILE_NAME_INFORMATION Buffer, IN OUT PLONG Length) { - UNIMPLEMENTED; + ULONG ByteSize; + ULONG Trim = 0; + BOOLEAN Overflow = FALSE; + + /* Deduct the minimum written length */ + *Length -= FIELD_OFFSET(FILE_NAME_INFORMATION, FileName[0]); + + // Build full name if needed + //if (!Fcb->FullFileName.Buffer) + + DPRINT1("FullFileName %wZ\n", &Fcb->FullFileName); + + if (*Length < Fcb->FullFileName.Length - Trim) + { + /* Buffer can't fit all data */ + ByteSize = *Length; + Overflow = TRUE; + } + else + { + /* Deduct the amount of bytes we are going to write */ + ByteSize = Fcb->FullFileName.Length - Trim; + *Length -= ByteSize; + } + + /* Copy the name */ + RtlCopyMemory(Buffer->FileName, + Fcb->FullFileName.Buffer, + ByteSize); + + /* Set the length */ + Buffer->FileNameLength = Fcb->FullFileName.Length - Trim; + + /* Is this a shortname query? */ + if (Trim) + { + /* Yes, not supported atm */ + ASSERT(FALSE); + } + + /* Indicate overflow by passing -1 as the length */ + if (Overflow) *Length = -1; } NTSTATUS
15 years, 2 months
1
0
0
0
[mkupfer] 43323: - load UserPreferencesMask from registry
by mkupfer@svn.reactos.org
Author: mkupfer Date: Wed Oct 7 13:17:11 2009 New Revision: 43323 URL:
http://svn.reactos.org/svn/reactos?rev=43323&view=rev
Log: - load UserPreferencesMask from registry Modified: trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] Wed Oct 7 13:17:11 2009 @@ -122,6 +122,18 @@ return iValue; } return _wtoi(awcBuffer); +} + +static +DWORD +SpiLoadUserPrefMask(DWORD dValue) +{ + DWORD Result; + if (!RegReadUserSetting(KEY_DESKTOP, VAL_USERPREFMASK, REG_BINARY, &Result, sizeof(Result))) + { + return dValue; + } + return Result; } static @@ -250,6 +262,7 @@ gspv.bDragFullWindows = SpiLoadInt(KEY_DESKTOP, VAL_DRAG, 0); gspv.iWheelScrollLines = SpiLoadInt(KEY_DESKTOP, VAL_SCRLLLINES, 3); gspv.dwMouseClickLockTime = SpiLoadDWord(KEY_DESKTOP, VAL_CLICKLOCKTIME, 1200); + gspv.dwUserPrefMask = SpiLoadUserPrefMask(UPM_DEFAULT); #if (_WIN32_WINNT >= 0x0600) gspv.iWheelScrollChars = SpiLoadInt(KEY_DESKTOP, VAL_SCRLLCHARS, 3); #endif @@ -263,7 +276,6 @@ gspv.uiFocusBorderHeight = 1; gspv.bMenuDropAlign = 1; gspv.bDropShadow = 1; - gspv.dwUserPrefMask = UPM_DEFAULT; gspv.dwMenuShowDelay = 100; gspv.iScrSaverTimeout = 10;
15 years, 2 months
1
0
0
0
[fireball] 43322: [fastfat_new] - Lower importance of some debug messages. - Add FCB locking routines. - Lock VCB and FCB in QueryInformation.
by fireball@svn.reactos.org
Author: fireball Date: Wed Oct 7 12:45:45 2009 New Revision: 43322 URL:
http://svn.reactos.org/svn/reactos?rev=43322&view=rev
Log: [fastfat_new] - Lower importance of some debug messages. - Add FCB locking routines. - Lock VCB and FCB in QueryInformation. Modified: trunk/reactos/drivers/filesystems/fastfat_new/create.c trunk/reactos/drivers/filesystems/fastfat_new/fastfat.c trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h trunk/reactos/drivers/filesystems/fastfat_new/fatstruc.h trunk/reactos/drivers/filesystems/fastfat_new/finfo.c trunk/reactos/drivers/filesystems/fastfat_new/rw.c Modified: trunk/reactos/drivers/filesystems/fastfat_new/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat_new/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat_new/create.c [iso-8859-1] Wed Oct 7 12:45:45 2009 @@ -163,20 +163,20 @@ /* Get current IRP stack location */ IrpSp = IoGetCurrentIrpStackLocation(Irp); - DPRINT1("FatCommonCreate\n", 0 ); - DPRINT1("Irp = %08lx\n", Irp ); - DPRINT1("\t->Flags = %08lx\n", Irp->Flags ); - DPRINT1("\t->FileObject = %08lx\n", IrpSp->FileObject ); - DPRINT1("\t->RelatedFileObject = %08lx\n", IrpSp->FileObject->RelatedFileObject ); - DPRINT1("\t->FileName = %wZ\n", &IrpSp->FileObject->FileName ); - DPRINT1("\t->AllocationSize.LowPart = %08lx\n", Irp->Overlay.AllocationSize.LowPart ); - DPRINT1("\t->AllocationSize.HighPart = %08lx\n", Irp->Overlay.AllocationSize.HighPart ); - DPRINT1("\t->SystemBuffer = %08lx\n", Irp->AssociatedIrp.SystemBuffer ); - DPRINT1("\t->DesiredAccess = %08lx\n", IrpSp->Parameters.Create.SecurityContext->DesiredAccess ); - DPRINT1("\t->Options = %08lx\n", IrpSp->Parameters.Create.Options ); - DPRINT1("\t->FileAttributes = %04x\n", IrpSp->Parameters.Create.FileAttributes ); - DPRINT1("\t->ShareAccess = %04x\n", IrpSp->Parameters.Create.ShareAccess ); - DPRINT1("\t->EaLength = %08lx\n", IrpSp->Parameters.Create.EaLength ); + DPRINT("FatCommonCreate\n", 0 ); + DPRINT("Irp = %08lx\n", Irp ); + DPRINT("\t->Flags = %08lx\n", Irp->Flags ); + DPRINT("\t->FileObject = %08lx\n", IrpSp->FileObject ); + DPRINT("\t->RelatedFileObject = %08lx\n", IrpSp->FileObject->RelatedFileObject ); + DPRINT("\t->FileName = %wZ\n", &IrpSp->FileObject->FileName ); + DPRINT("\t->AllocationSize.LowPart = %08lx\n", Irp->Overlay.AllocationSize.LowPart ); + DPRINT("\t->AllocationSize.HighPart = %08lx\n", Irp->Overlay.AllocationSize.HighPart ); + DPRINT("\t->SystemBuffer = %08lx\n", Irp->AssociatedIrp.SystemBuffer ); + DPRINT("\t->DesiredAccess = %08lx\n", IrpSp->Parameters.Create.SecurityContext->DesiredAccess ); + DPRINT("\t->Options = %08lx\n", IrpSp->Parameters.Create.Options ); + DPRINT("\t->FileAttributes = %04x\n", IrpSp->Parameters.Create.FileAttributes ); + DPRINT("\t->ShareAccess = %04x\n", IrpSp->Parameters.Create.ShareAccess ); + DPRINT("\t->EaLength = %08lx\n", IrpSp->Parameters.Create.EaLength ); /* Apply a special hack for Win32, idea taken from FASTFAT reference driver from WDK */ if ((IrpSp->FileObject->FileName.Length > sizeof(WCHAR)) && @@ -359,7 +359,7 @@ { /* Not a root dir */ ParentDcb = Vcb->RootDcb; - DPRINT1("ParentDcb %p\n", ParentDcb); + DPRINT("ParentDcb %p\n", ParentDcb); } /* Check for backslash at the end */ @@ -515,7 +515,7 @@ ASSERT(FALSE); } - DPRINT1("FirstName %wZ, RemainingPart %wZ\n", &FirstName, &RemainingPart); + DPRINT("FirstName %wZ, RemainingPart %wZ\n", &FirstName, &RemainingPart); /* Break if came to the end */ if (!RemainingPart.Length) break; @@ -579,8 +579,6 @@ PFAT_IRP_CONTEXT IrpContext; NTSTATUS Status; - DPRINT1("FatCreate()\n"); - /* If it's called with our Disk FS device object - it's always open */ // TODO: Add check for CDROM FS device object if (DeviceObject == FatGlobalData.DiskDeviceObject) Modified: trunk/reactos/drivers/filesystems/fastfat_new/fastfat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat_new/fastfat.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat_new/fastfat.c [iso-8859-1] Wed Oct 7 12:45:45 2009 @@ -327,7 +327,7 @@ TypeOfOpen = (*Ccb == NULL ? EaFile : UserFileOpen); - DPRINT1("Referencing a file: %Z\n", &(*FcbOrDcb)->FullFileName); + DPRINT("Referencing a file: %Z\n", &(*FcbOrDcb)->FullFileName); break; @@ -394,6 +394,95 @@ ExReleaseResourceLite(&Vcb->Resource); } +BOOLEAN +NTAPI +FatAcquireExclusiveFcb(IN PFAT_IRP_CONTEXT IrpContext, + IN PFCB Fcb) +{ +RetryLockingE: + /* Try to acquire the exclusive lock*/ + if (ExAcquireResourceExclusiveLite(Fcb->Header.Resource, + BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT))) + { + /* Wait same way MS's FASTFAT wait, i.e. + checking that there are outstanding async writes, + or someone is waiting on it*/ + if (Fcb->OutstandingAsyncWrites && + ((IrpContext->MajorFunction != IRP_MJ_WRITE) || + !FlagOn(IrpContext->Irp->Flags, IRP_NOCACHE) || + ExGetSharedWaiterCount(Fcb->Header.Resource) || + ExGetExclusiveWaiterCount(Fcb->Header.Resource))) + { + KeWaitForSingleObject(Fcb->OutstandingAsyncEvent, + Executive, + KernelMode, + FALSE, + NULL); + + /* Release the lock */ + FatReleaseFcb(IrpContext, Fcb); + + /* Retry */ + goto RetryLockingE; + } + + /* Return success */ + return TRUE; + } + + /* Return failure */ + return FALSE; +} + +BOOLEAN +NTAPI +FatAcquireSharedFcb(IN PFAT_IRP_CONTEXT IrpContext, + IN PFCB Fcb) +{ +RetryLockingS: + /* Try to acquire the shared lock*/ + if (ExAcquireResourceSharedLite(Fcb->Header.Resource, + BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT))) + { + /* Wait same way MS's FASTFAT wait, i.e. + checking that there are outstanding async writes, + or someone is waiting on it*/ + if (Fcb->OutstandingAsyncWrites && + ((IrpContext->MajorFunction != IRP_MJ_WRITE) || + !FlagOn(IrpContext->Irp->Flags, IRP_NOCACHE) || + ExGetSharedWaiterCount(Fcb->Header.Resource) || + ExGetExclusiveWaiterCount(Fcb->Header.Resource))) + { + KeWaitForSingleObject(Fcb->OutstandingAsyncEvent, + Executive, + KernelMode, + FALSE, + NULL); + + /* Release the lock */ + FatReleaseFcb(IrpContext, Fcb); + + /* Retry */ + goto RetryLockingS; + } + + /* Return success */ + return TRUE; + } + + /* Return failure */ + return FALSE; +} + +VOID +NTAPI +FatReleaseFcb(IN PFAT_IRP_CONTEXT IrpContext, + IN PFCB Fcb) +{ + /* Release FCB's resource */ + ExReleaseResourceLite(Fcb->Header.Resource); +} + PVOID FASTCALL FatMapUserBuffer(PIRP Irp) Modified: trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat_new/fastfat.h [iso-8859-1] Wed Oct 7 12:45:45 2009 @@ -146,6 +146,18 @@ VOID NTAPI FatReleaseVcb(IN PFAT_IRP_CONTEXT IrpContext, IN PVCB Vcb); + +BOOLEAN NTAPI +FatAcquireExclusiveFcb(IN PFAT_IRP_CONTEXT IrpContext, + IN PFCB Fcb); + +BOOLEAN NTAPI +FatAcquireSharedFcb(IN PFAT_IRP_CONTEXT IrpContext, + IN PFCB Fcb); + +VOID NTAPI +FatReleaseFcb(IN PFAT_IRP_CONTEXT IrpContext, + IN PFCB Fcb); TYPE_OF_OPEN NTAPI Modified: trunk/reactos/drivers/filesystems/fastfat_new/fatstruc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat_new/fatstruc.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat_new/fatstruc.h [iso-8859-1] Wed Oct 7 12:45:45 2009 @@ -283,6 +283,10 @@ FILE_BASIC_INFORMATION BasicInfo; /* FullFAT file handle */ FF_FILE *FatHandle; + /* The file has outstanding async writes */ + ULONG OutstandingAsyncWrites; + /* The outstanding async writes sync event */ + PKEVENT OutstandingAsyncEvent; union { struct Modified: trunk/reactos/drivers/filesystems/fastfat_new/finfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat_new/finfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat_new/finfo.c [iso-8859-1] Wed Oct 7 12:45:45 2009 @@ -48,6 +48,17 @@ VOID NTAPI FatiQueryInternalInformation(IN PFAT_IRP_CONTEXT IrpContext, + IN PFCB Fcb, + IN PFILE_OBJECT FileObject, + IN OUT PFILE_INTERNAL_INFORMATION Buffer, + IN OUT PLONG Length) +{ + UNIMPLEMENTED; +} + +VOID +NTAPI +FatiQueryNameInformation(IN PFAT_IRP_CONTEXT IrpContext, IN PFCB Fcb, IN PFILE_OBJECT FileObject, IN OUT PFILE_INTERNAL_INFORMATION Buffer, @@ -70,6 +81,7 @@ PCCB Ccb; LONG Length; PVOID Buffer; + BOOLEAN VcbLocked = FALSE, FcbLocked = FALSE; NTSTATUS Status = STATUS_SUCCESS; /* Get IRP stack location */ @@ -93,7 +105,26 @@ DPRINT1("Vcb %p, Fcb %p, Ccb %p, open type %d\n", Vcb, Fcb, Ccb, FileType); - // TODO: Acquire FCB locks + /* Acquire VCB lock */ + if (InfoClass == FileNameInformation || + InfoClass == FileAllInformation) + { + if (!FatAcquireExclusiveVcb(IrpContext, Vcb)) + { + ASSERT(FALSE); + } + + /* Remember we locked the VCB */ + VcbLocked = TRUE; + } + + /* Acquire FCB lock */ + // FIXME: If not paging file + if (!FatAcquireSharedFcb(IrpContext, Fcb)) + { + ASSERT(FALSE); + } + FcbLocked = TRUE; switch (InfoClass) { @@ -103,6 +134,9 @@ case FileInternalInformation: FatiQueryInternalInformation(IrpContext, Fcb, FileObject, Buffer, &Length); break; + case FileNameInformation: + FatiQueryNameInformation(IrpContext, Fcb, FileObject, Buffer, &Length); + break; default: DPRINT1("Unimplemented information class %d requested\n", InfoClass); Status = STATUS_INVALID_PARAMETER; @@ -118,7 +152,9 @@ /* Set IoStatus.Information to amount of filled bytes */ Irp->IoStatus.Information = IrpSp->Parameters.QueryFile.Length - Length; - // TODO: Release FCB locks + /* Release FCB locks */ + if (FcbLocked) FatReleaseFcb(IrpContext, Fcb); + if (VcbLocked) FatReleaseVcb(IrpContext, Vcb); /* Complete request and return status */ FatCompleteRequest(IrpContext, Irp, Status); Modified: trunk/reactos/drivers/filesystems/fastfat_new/rw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat_new/rw.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat_new/rw.c [iso-8859-1] Wed Oct 7 12:45:45 2009 @@ -111,7 +111,6 @@ /* Leave FsRtl critical region */ FsRtlExitFileSystem(); - DPRINT1("FatRead()\n"); return Status; }
15 years, 2 months
1
0
0
0
[janderwald] 43321: [WDMAUD] - Use KsProbeStreamIrp in wdmaud to probe user buffers - Remove a few hacks which were required to pass down irps to portcls [PORTCLS] - Check if there is an automation table [SYSAUDIO] - Release file object of pin to prevent reference leak -- - Audio stack now reacts faster as it now longer copies audio buffers in kernel mode and instead locks down the user buffers. In addition it uses less memory to do the same work.
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Oct 7 12:41:34 2009 New Revision: 43321 URL:
http://svn.reactos.org/svn/reactos?rev=43321&view=rev
Log: [WDMAUD] - Use KsProbeStreamIrp in wdmaud to probe user buffers - Remove a few hacks which were required to pass down irps to portcls [PORTCLS] - Check if there is an automation table [SYSAUDIO] - Release file object of pin to prevent reference leak -- - Audio stack now reacts faster as it now longer copies audio buffers in kernel mode and instead locks down the user buffers. In addition it uses less memory to do the same work. Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/private.hpp trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.cpp trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c trunk/reactos/drivers/wdm/audio/legacy/wdmaud/entry.c trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h trunk/reactos/drivers/wdm/audio/sysaudio/pin.c Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp [iso-8859-1] Wed Oct 7 12:41:34 2009 @@ -113,25 +113,32 @@ if (!Buffer) { - // probe the stream irp - Status = KsProbeStreamIrp(Irp, KSSTREAM_WRITE | KSPROBE_ALLOCATEMDL | KSPROBE_PROBEANDLOCK | KSPROBE_ALLOWFORMATCHANGE | KSPROBE_SYSTEMADDRESS, 0); - - // check for success - if (!NT_SUCCESS(Status)) + if (!Irp->MdlAddress) { - DPRINT1("KsProbeStreamIrp failed with %x\n", Status); - return Status; + // ioctl from KsStudio + // Wdmaud already probes buffers, therefore no need to probe it again + // probe the stream irp + Status = KsProbeStreamIrp(Irp, KSSTREAM_WRITE | KSPROBE_ALLOCATEMDL | KSPROBE_PROBEANDLOCK | KSPROBE_ALLOWFORMATCHANGE | KSPROBE_SYSTEMADDRESS, 0); + + // check for success + if (!NT_SUCCESS(Status)) + { + DPRINT1("KsProbeStreamIrp failed with %x\n", Status); + return Status; + } } - // get the stream header Header = (PKSSTREAM_HEADER)Irp->AssociatedIrp.SystemBuffer; PC_ASSERT(Header); PC_ASSERT(Irp->MdlAddress); + DPRINT("Size %u DataUsed %u FrameExtent %u SizeHeader %u\n", Header->Size, Header->DataUsed, Header->FrameExtent, sizeof(KSSTREAM_HEADER)); + if (Irp->RequestorMode != KernelMode) { // use allocated mdl Header->Data = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority); + PC_ASSERT(Header->Data); } } else @@ -227,7 +234,12 @@ PC_ASSERT(StreamHeader); // store buffersize - *BufferSize = StreamHeader->DataUsed - Offset; + if (StreamHeader->DataUsed) + *BufferSize = StreamHeader->DataUsed - Offset; + else + *BufferSize = StreamHeader->FrameExtent - Offset; + + PC_ASSERT(*BufferSize); // store buffer *Buffer = &((PUCHAR)StreamHeader->Data)[Offset]; @@ -243,8 +255,8 @@ CIrpQueue::UpdateMapping( IN ULONG BytesWritten) { - //PIO_STACK_LOCATION IoStack; PKSSTREAM_HEADER StreamHeader; + ULONG Size; if (!m_Irp) { @@ -252,16 +264,8 @@ return; } -#if 0 - // get current irp stack location - IoStack = IoGetCurrentIrpStackLocation(m_Irp); - // get stream header - StreamHeader = (PKSSTREAM_HEADER)IoStack->Parameters.DeviceIoControl.Type3InputBuffer; -#else - // HACK get stream header StreamHeader = (PKSSTREAM_HEADER)m_Irp->Tail.Overlay.DriverContext[2]; -#endif // sanity check // ASSERT(StreamHeader); @@ -272,7 +276,14 @@ // decrement available data counter m_NumDataAvailable -= BytesWritten; - if (m_CurrentOffset >= StreamHeader->DataUsed) + if (StreamHeader->DataUsed) + Size = StreamHeader->DataUsed; + else + Size = StreamHeader->FrameExtent; + + PC_ASSERT(Size); + + if (m_CurrentOffset >= Size) { // irp has been processed completly m_Irp->IoStatus.Status = STATUS_SUCCESS; @@ -280,14 +291,14 @@ // frame extend contains the original request size, DataUsed contains the real buffer size //is different when kmixer performs channel conversion, upsampling etc - m_Irp->IoStatus.Information = StreamHeader->FrameExtent; - - if (m_Irp->RequestorMode == KernelMode) - { - // HACK - WDMAUD should pass PKSSTREAM_HEADERs - ExFreePool(StreamHeader->Data); - ExFreePool(StreamHeader); - } + m_Irp->IoStatus.Information = Size; + + PC_ASSERT_IRQL(DISPATCH_LEVEL); + MmUnlockPages(m_Irp->MdlAddress); + IoFreeMdl(m_Irp->MdlAddress); + m_Irp->MdlAddress = NULL; + ExFreePool(m_Irp->AssociatedIrp.SystemBuffer); + m_Irp->AssociatedIrp.SystemBuffer = NULL; // complete the request IoCompleteRequest(m_Irp, IO_SOUND_INCREMENT); @@ -439,9 +450,6 @@ Irp->IoStatus.Information = StreamHeader->FrameExtent; - // free stream data, no tag as wdmaud.drv does it atm - ExFreePool(StreamHeader->Data); - // free stream header, no tag as wdmaud.drv allocates it atm ExFreePool(StreamHeader); Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp [iso-8859-1] Wed Oct 7 12:41:34 2009 @@ -578,7 +578,7 @@ { InterlockedIncrement((PLONG)&m_TotalPackets); - DPRINT("IPortPinWaveCyclic_HandleKsStream entered Total %u Pre %u Post %u State %x MinData %u\n", m_TotalPackets, m_State, m_IrpQueue->NumData()); + DPRINT("IPortPinWaveCyclic_HandleKsStream entered Total %u State %x MinData %u\n", m_TotalPackets, m_State, m_IrpQueue->NumData()); m_IrpQueue->AddMapping(NULL, 0, Irp); @@ -729,6 +729,8 @@ IN PIRP Irp) { PCLOSESTREAM_CONTEXT Ctx; + + DPRINT1("CPortPinWaveCyclic::Close entered\n"); if (m_Stream) { @@ -828,27 +830,7 @@ OUT PIO_STATUS_BLOCK StatusBlock, IN PDEVICE_OBJECT DeviceObject) { - NTSTATUS Status; - PCONTEXT_WRITE Packet; - PIRP Irp; - - // HACK to be removed - - DPRINT("CPortPinWaveCyclic::FastRead entered\n"); - - Packet = (PCONTEXT_WRITE)Buffer; - - Irp = Packet->Irp; - StatusBlock->Status = STATUS_PENDING; - - Status = m_IrpQueue->AddMapping((PUCHAR)Buffer, Length, Irp); - - if (!NT_SUCCESS(Status)) - return FALSE; - - StatusBlock->Status = STATUS_PENDING; - - return TRUE; + return KsDispatchFastReadFailure(FileObject, FileOffset, Length, Wait, LockKey, Buffer, StatusBlock, DeviceObject); } @@ -864,27 +846,7 @@ OUT PIO_STATUS_BLOCK StatusBlock, IN PDEVICE_OBJECT DeviceObject) { - NTSTATUS Status; - PCONTEXT_WRITE Packet; - PIRP Irp; - - // HACK to be removed - - InterlockedIncrement((PLONG)&m_TotalPackets); - - DPRINT("CPortPinWaveCyclic::FastWrite entered Total %u State %x MinData %u\n", m_TotalPackets, m_State, m_IrpQueue->NumData()); - - Packet = (PCONTEXT_WRITE)Buffer; - Irp = Packet->Irp; - - Status = m_IrpQueue->AddMapping((PUCHAR)Buffer, Length, Irp); - - if (!NT_SUCCESS(Status)) - return FALSE; - - StatusBlock->Status = STATUS_PENDING; - - return TRUE; + return KsDispatchFastReadFailure(FileObject, FileOffset, Length, Wait, LockKey, Buffer, StatusBlock, DeviceObject); } Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.cpp [iso-8859-1] Wed Oct 7 12:41:34 2009 @@ -722,7 +722,6 @@ OUT PIO_STATUS_BLOCK StatusBlock, IN PDEVICE_OBJECT DeviceObject) { - UNIMPLEMENTED return FALSE; } Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/private.hpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/private.hpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/private.hpp [iso-8859-1] Wed Oct 7 12:41:34 2009 @@ -355,12 +355,6 @@ typedef struct { - KSSTREAM_HEADER Header; - PIRP Irp; -}CONTEXT_WRITE, *PCONTEXT_WRITE; - -typedef struct -{ PVOID Pin; PIO_WORKITEM WorkItem; PIRP Irp; Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.cpp [iso-8859-1] Wed Oct 7 12:41:34 2009 @@ -90,6 +90,13 @@ Node = (PPCNODE_DESCRIPTOR)((ULONG_PTR)SubDeviceDescriptor->DeviceDescriptor->Nodes + (Property->NodeId * SubDeviceDescriptor->DeviceDescriptor->NodeSize)); + if (!Node->AutomationTable) + { + // request is out of bounds + Irp->IoStatus.Information = 0; + return STATUS_INVALID_PARAMETER; + } + PC_ASSERT(Node->AutomationTable); PC_ASSERT(Node->AutomationTable->PropertyCount); PC_ASSERT(Node->AutomationTable->PropertyItemSize); @@ -125,6 +132,13 @@ } Node = (PPCNODE_DESCRIPTOR)((ULONG_PTR)SubDeviceDescriptor->DeviceDescriptor->Nodes + (Property->NodeId * SubDeviceDescriptor->DeviceDescriptor->NodeSize)); + + if (!Node->AutomationTable) + { + // request is out of bounds + Irp->IoStatus.Information = 0; + return STATUS_INVALID_PARAMETER; + } PC_ASSERT(Node->AutomationTable); PC_ASSERT(Node->AutomationTable->PropertyCount); Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/w…
============================================================================== --- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c [iso-8859-1] Wed Oct 7 12:41:34 2009 @@ -266,7 +266,6 @@ return WdmAudSetControlDetails(DeviceObject, Irp, DeviceInfo, ClientInfo); case IOCTL_GETCONTROLDETAILS: return WdmAudGetControlDetails(DeviceObject, Irp, DeviceInfo, ClientInfo); - case IOCTL_GETPOS: case IOCTL_GETDEVID: case IOCTL_GETVOLUME: @@ -279,206 +278,93 @@ return SetIrpIoStatus(Irp, STATUS_NOT_IMPLEMENTED, 0); } + NTSTATUS NTAPI -WdmAudWriteCompletion( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP LowerIrp, - IN PVOID Context) -{ - //PIRP Irp; - ASSERT(LowerIrp->PendingReturned == FALSE); - /* get original irp */ - //Irp = (PIRP)Context; - - /* save status */ - //Irp->IoStatus.Status = LowerIrp->IoStatus.Status; - //Irp->IoStatus.Information = LowerIrp->IoStatus.Information; - /* complete request */ - //IoCompleteRequest(Irp, IO_SOUND_INCREMENT); - /* return success to free irp */ - return STATUS_SUCCESS; -} - - -NTSTATUS -NTAPI -WdmAudWrite( +WdmAudReadWrite( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { + NTSTATUS Status; + PWDMAUD_DEVICE_INFO DeviceInfo; + PFILE_OBJECT FileObject; PIO_STACK_LOCATION IoStack; - PWDMAUD_DEVICE_INFO DeviceInfo; - PWDMAUD_CLIENT ClientInfo; - NTSTATUS Status = STATUS_SUCCESS; - PUCHAR Buffer; - PFILE_OBJECT FileObject; + ULONG Length; PMDL Mdl; - //PIRP LowerIrp; - PCONTEXT_WRITE Packet; - PVOID SystemBuffer; - //LARGE_INTEGER Offset; - IO_STATUS_BLOCK IoStatusBlock; - + + /* get current irp stack location */ IoStack = IoGetCurrentIrpStackLocation(Irp); - //DPRINT("WdmAudWrite entered\n"); - - if (IoStack->Parameters.Write.Length < sizeof(WDMAUD_DEVICE_INFO)) - { - /* invalid parameter */ - DPRINT1("Input buffer too small size %u expected %u\n", IoStack->Parameters.Write.Length, sizeof(WDMAUD_DEVICE_INFO)); - return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); - } - - DeviceInfo = (PWDMAUD_DEVICE_INFO)MmGetMdlVirtualAddress(Irp->MdlAddress); - - + /* store the input buffer in UserBuffer - as KsProbeStreamIrp operates on IRP_MJ_DEVICE_CONTROL */ + Irp->UserBuffer = MmGetMdlVirtualAddress(Irp->MdlAddress); + + /* sanity check */ + ASSERT(Irp->UserBuffer); + + /* get the length of the request length */ + Length = IoStack->Parameters.Write.Length; + + /* store outputbuffer length */ + IoStack->Parameters.DeviceIoControl.OutputBufferLength = Length; + + /* store mdl address */ + Mdl = Irp->MdlAddress; + + /* remove mdladdress as KsProbeStreamIrp will interprete it as an already probed audio buffer */ + Irp->MdlAddress = NULL; + + /* check for success */ + + if (IoStack->MajorFunction == IRP_MJ_WRITE) + { + /* probe the write stream irp */ + Status = KsProbeStreamIrp(Irp, KSPROBE_STREAMWRITE | KSPROBE_ALLOCATEMDL | KSPROBE_PROBEANDLOCK, Length); + } + else + { + /* probe the read stream irp */ + Status = KsProbeStreamIrp(Irp, KSPROBE_STREAMREAD | KSPROBE_ALLOCATEMDL | KSPROBE_PROBEANDLOCK, Length); + } + + /* now free the mdl */ + IoFreeMdl(Mdl); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("KsProbeStreamIrp failed with Status %x\n", Status); + return SetIrpIoStatus(Irp, Status, 0); + } + + /* get device info */ + DeviceInfo = (PWDMAUD_DEVICE_INFO)Irp->AssociatedIrp.SystemBuffer; + ASSERT(DeviceInfo); + + /* now get sysaudio file object */ Status = ObReferenceObjectByHandle(DeviceInfo->hDevice, GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL); if (!NT_SUCCESS(Status)) { - DPRINT1("Invalid buffer handle %x\n", DeviceInfo->hDevice); + DPRINT1("Invalid pin handle %x\n", DeviceInfo->hDevice); return SetIrpIoStatus(Irp, Status, 0); } - - //DPRINT("DeviceInfo %p %p %p\n", DeviceInfo, Irp->MdlAddress->StartVa, Irp->MdlAddress->MappedSystemVa); - if (DeviceInfo->DeviceType < MIN_SOUND_DEVICE_TYPE || DeviceInfo->DeviceType > MAX_SOUND_DEVICE_TYPE) - { - /* invalid parameter */ - DPRINT1("Error: device type not set\n"); - ObDereferenceObject(FileObject); - return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); - } - - if (!IoStack->FileObject) - { - /* file object parameter */ - DPRINT1("Error: file object is not attached\n"); - ObDereferenceObject(FileObject); - return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); - } - ClientInfo = (PWDMAUD_CLIENT)IoStack->FileObject->FsContext; - - - /* setup stream context */ - Packet = (PCONTEXT_WRITE)ExAllocatePool(NonPagedPool, sizeof(CONTEXT_WRITE)); - if (!Packet) - { - /* no memory */ - return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); - } - - Packet->Header.FrameExtent = DeviceInfo->Header.FrameExtent; - Packet->Header.DataUsed = DeviceInfo->Header.DataUsed; - Packet->Header.Size = sizeof(KSSTREAM_HEADER); - Packet->Header.PresentationTime.Numerator = 1; - Packet->Header.PresentationTime.Denominator = 1; - Packet->Irp = Irp; - - Buffer = ExAllocatePool(NonPagedPool, DeviceInfo->Header.DataUsed); - if (!Buffer) - { - /* no memory */ - ExFreePool(Packet); - ObDereferenceObject(FileObject); - return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); - } - Packet->Header.Data = Buffer; - - Mdl = IoAllocateMdl(DeviceInfo->Header.Data, DeviceInfo->Header.DataUsed, FALSE, FALSE, FALSE); - if (!Mdl) - { - /* no memory */ - ExFreePool(Packet); - ObDereferenceObject(FileObject); - ExFreePool(Buffer); - return SetIrpIoStatus(Irp, STATUS_NO_MEMORY, 0); - } - - _SEH2_TRY - { - MmProbeAndLockPages(Mdl, UserMode, IoReadAccess); - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - /* Exception, get the error code */ - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - if (!NT_SUCCESS(Status)) - { - DPRINT1("Invalid buffer supplied\n"); - ExFreePool(Buffer); - ExFreePool(Packet); - IoFreeMdl(Mdl); - ObDereferenceObject(FileObject); - return SetIrpIoStatus(Irp, Status, 0); - } - - SystemBuffer = MmGetSystemAddressForMdlSafe(Mdl, NormalPagePriority ); - if (!SystemBuffer) - { - DPRINT1("Invalid buffer supplied\n"); - ExFreePool(Buffer); - ExFreePool(Packet); - IoFreeMdl(Mdl); - ObDereferenceObject(FileObject); - return SetIrpIoStatus(Irp, STATUS_INSUFFICIENT_RESOURCES, 0); - } - - RtlMoveMemory(Buffer, SystemBuffer, DeviceInfo->Header.DataUsed); - MmUnlockPages(Mdl); - IoFreeMdl(Mdl); - -#if 1 - KsStreamIo(FileObject, NULL, NULL, NULL, NULL, 0, &IoStatusBlock, Packet, sizeof(CONTEXT_WRITE), KSSTREAM_WRITE, UserMode); + /* skip current irp stack location */ + IoSkipCurrentIrpStackLocation(Irp); + + /* get next stack location */ + IoStack = IoGetNextIrpStackLocation(Irp); + + /* attach file object */ + IoStack->FileObject = FileObject; + IoStack->Parameters.Write.Length = sizeof(KSSTREAM_HEADER); + IoStack->MajorFunction = IRP_MJ_WRITE; + + /* mark irp as pending */ + IoMarkIrpPending(Irp); + /* call the driver */ + Status = IoCallDriver(IoGetRelatedDeviceObject(FileObject), Irp); + /* dereference file object */ ObDereferenceObject(FileObject); - return IoStatusBlock.Status; -#else - Offset.QuadPart = 0L; - - /* now build the irp */ - LowerIrp = IoBuildAsynchronousFsdRequest (IRP_MJ_WRITE, - IoGetRelatedDeviceObject(FileObject), - Packet, - sizeof(KSSTREAM_HEADER), - &Offset, - NULL); - - if (!LowerIrp) - { - /* failed to create an associated irp */ - ExFreePool(Buffer); - ExFreePool(Packet); - ObDereferenceObject(FileObject); - - return SetIrpIoStatus(Irp, STATUS_INSUFFICIENT_RESOURCES, 0); - } - - /* get next stack location */ - IoStack = IoGetNextIrpStackLocation(LowerIrp); - - /* attach file object */ - IoStack->FileObject = FileObject; - - /* set a completion routine */ - IoSetCompletionRoutine(LowerIrp, WdmAudWriteCompletion, (PVOID)Irp, TRUE, TRUE, TRUE); - - /* mark irp as pending */ - //IoMarkIrpPending(Irp); - Irp->IoStatus.Information = DeviceInfo->BufferSize; - Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - DPRINT1("Wrote %u\n", DeviceInfo->BufferSize); - /* call the driver */ - Status = IoCallDriver(IoGetRelatedDeviceObject(FileObject), LowerIrp); - - /* dereference file object */ - ObDereferenceObject(FileObject); - - return STATUS_SUCCESS; -#endif -} + + return Status; +} Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/entry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/w…
============================================================================== --- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/entry.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/entry.c [iso-8859-1] Wed Oct 7 12:41:34 2009 @@ -244,14 +244,14 @@ Driver->DriverUnload = WdmAudUnload; - Driver->MajorFunction[IRP_MJ_CREATE] = WdmAudCreate; Driver->MajorFunction[IRP_MJ_CLOSE] = WdmAudClose; Driver->MajorFunction[IRP_MJ_PNP] = WdmAudPnp; Driver->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = KsDefaultForwardIrp; Driver->MajorFunction[IRP_MJ_CLEANUP] = WdmAudCleanup; Driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = WdmAudDeviceControl; - Driver->MajorFunction[IRP_MJ_WRITE] = WdmAudWrite; + Driver->MajorFunction[IRP_MJ_WRITE] = WdmAudReadWrite; + Driver->MajorFunction[IRP_MJ_READ] = WdmAudReadWrite; Driver->MajorFunction[IRP_MJ_POWER] = KsDefaultDispatchPower; return WdmAudInstallDevice(Driver); Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/w…
============================================================================== --- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h [iso-8859-1] Wed Oct 7 12:41:34 2009 @@ -118,12 +118,6 @@ }WDMAUD_DEVICE_EXTENSION, *PWDMAUD_DEVICE_EXTENSION; -typedef struct -{ - KSSTREAM_HEADER Header; - PIRP Irp; -}CONTEXT_WRITE, *PCONTEXT_WRITE; - NTSTATUS NTAPI OpenWavePin( @@ -157,6 +151,12 @@ NTSTATUS NTAPI +WdmAudReadWrite( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp); + +NTSTATUS +NTAPI WdmAudWrite( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp); Modified: trunk/reactos/drivers/wdm/audio/sysaudio/pin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/pin.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/pin.c [iso-8859-1] Wed Oct 7 12:41:34 2009 @@ -115,9 +115,16 @@ IoStack->MajorFunction = IRP_MJ_DEVICE_CONTROL; IoStack->Parameters.DeviceIoControl.IoControlCode = IOCTL_KS_WRITE_STREAM; //FIXME IoStack->Parameters.DeviceIoControl.OutputBufferLength = Length; + ASSERT(Irp->AssociatedIrp.SystemBuffer); /* now call the driver */ - return IoCallDriver(IoGetRelatedDeviceObject(FileObject), Irp); + Status = IoCallDriver(IoGetRelatedDeviceObject(FileObject), Irp); + + /* dereference file object */ + ObDereferenceObject(FileObject); + + return Status; + } NTSTATUS @@ -149,57 +156,6 @@ Irp->IoStatus.Information = 0; IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; -} - -BOOLEAN -NTAPI -Pin_fnFastWrite( - PFILE_OBJECT FileObject, - PLARGE_INTEGER FileOffset, - ULONG Length, - BOOLEAN Wait, - ULONG LockKey, - PVOID Buffer, - PIO_STATUS_BLOCK IoStatus, - PDEVICE_OBJECT DeviceObject) -{ - PDISPATCH_CONTEXT Context; - PFILE_OBJECT RealFileObject; - NTSTATUS Status; - - DPRINT("Pin_fnFastWrite called DeviceObject %p Irp %p\n", DeviceObject); - - Context = (PDISPATCH_CONTEXT)FileObject->FsContext; - - if (Context->hMixerPin) - { - Status = ObReferenceObjectByHandle(Context->hMixerPin, GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&RealFileObject, NULL); - if (NT_SUCCESS(Status)) - { - Status = KsStreamIo(RealFileObject, NULL, NULL, NULL, NULL, 0, IoStatus, Buffer, Length, KSSTREAM_WRITE, UserMode); - ObDereferenceObject(RealFileObject); - } - - if (!NT_SUCCESS(Status)) - { - DPRINT1("Mixing stream failed with %lx\n", Status); - DbgBreakPoint(); - return FALSE; - } - } - - Status = ObReferenceObjectByHandle(Context->Handle, GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&RealFileObject, NULL); - if (!NT_SUCCESS(Status)) - return FALSE; - - Status = KsStreamIo(RealFileObject, NULL, NULL, NULL, NULL, 0, IoStatus, Buffer, Length, KSSTREAM_WRITE, UserMode); - - ObDereferenceObject(RealFileObject); - - if (NT_SUCCESS(Status)) - return TRUE; - else - return FALSE; } static KSDISPATCH_TABLE PinTable = @@ -213,7 +169,7 @@ KsDispatchInvalidDeviceRequest, KsDispatchFastIoDeviceControlFailure, KsDispatchFastReadFailure, - Pin_fnFastWrite, + KsDispatchFastWriteFailure, }; NTSTATUS
15 years, 2 months
1
0
0
0
[janderwald] 43320: - Fix building of ReactOS
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Oct 7 11:43:30 2009 New Revision: 43320 URL:
http://svn.reactos.org/svn/reactos?rev=43320&view=rev
Log: - Fix building of ReactOS Modified: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c Modified: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/wdmau…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] Wed Oct 7 11:43:30 2009 @@ -440,7 +440,6 @@ PSOUND_DEVICE SoundDevice; MMDEVICE_TYPE DeviceType; BOOL Ret; - DWORD BytesTransferred; VALIDATE_MMSYS_PARAMETER( SoundDeviceInstance ); VALIDATE_MMSYS_PARAMETER( OffsetPtr );
15 years, 2 months
1
0
0
0
[fireball] 43319: [fastfat_new] - Properly complete non-implemented volume open requests.
by fireball@svn.reactos.org
Author: fireball Date: Wed Oct 7 11:27:03 2009 New Revision: 43319 URL:
http://svn.reactos.org/svn/reactos?rev=43319&view=rev
Log: [fastfat_new] - Properly complete non-implemented volume open requests. Modified: trunk/reactos/drivers/filesystems/fastfat_new/create.c Modified: trunk/reactos/drivers/filesystems/fastfat_new/create.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat_new/create.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat_new/create.c [iso-8859-1] Wed Oct 7 11:27:03 2009 @@ -300,6 +300,14 @@ /* It is indeed a volume open request */ DPRINT1("Volume open request, not implemented now!\n"); UNIMPLEMENTED; + + /* Unlock VCB */ + FatReleaseVcb(IrpContext, Vcb); + + /* Complete the request */ + FatCompleteRequest(IrpContext, Irp, STATUS_NOT_IMPLEMENTED); + + return STATUS_NOT_IMPLEMENTED; } }
15 years, 2 months
1
0
0
0
[janderwald] 43318: - Implement support for reading from waveIn devices
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Oct 7 11:10:00 2009 New Revision: 43318 URL:
http://svn.reactos.org/svn/reactos?rev=43318&view=rev
Log: - Implement support for reading from waveIn devices Modified: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c Modified: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/wdmau…
============================================================================== --- trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] Wed Oct 7 11:10:00 2009 @@ -435,8 +435,12 @@ IN LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine) { HANDLE Handle; + MMRESULT Result; WDMAUD_DEVICE_INFO DeviceInfo; - + PSOUND_DEVICE SoundDevice; + MMDEVICE_TYPE DeviceType; + BOOL Ret; + DWORD BytesTransferred; VALIDATE_MMSYS_PARAMETER( SoundDeviceInstance ); VALIDATE_MMSYS_PARAMETER( OffsetPtr ); @@ -445,28 +449,46 @@ GetSoundDeviceInstanceHandle(SoundDeviceInstance, &Handle); + + Result = GetSoundDeviceFromInstance(SoundDeviceInstance, &SoundDevice); + + if ( ! MMSUCCESS(Result) ) + { + return TranslateInternalMmResult(Result); + } + + Result = GetSoundDeviceType(SoundDevice, &DeviceType); + SND_ASSERT( Result == MMSYSERR_NOERROR ); + SND_ASSERT(Handle); ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO)); + DeviceInfo.Header.FrameExtent = Length; - DeviceInfo.Header.DataUsed = Length; + if (DeviceType == WAVE_OUT_DEVICE_TYPE) + { + DeviceInfo.Header.DataUsed = Length; + } DeviceInfo.Header.Data = OffsetPtr; - DeviceInfo.Header.Size = sizeof(KSSTREAM_HEADER); + DeviceInfo.Header.Size = sizeof(WDMAUD_DEVICE_INFO); DeviceInfo.Header.PresentationTime.Numerator = 1; DeviceInfo.Header.PresentationTime.Denominator = 1; DeviceInfo.hDevice = Handle; - DeviceInfo.DeviceType = WAVE_OUT_DEVICE_TYPE; //FIXME + DeviceInfo.DeviceType = DeviceType; Overlap->Standard.hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); - if ( ! WriteFileEx(KernelHandle, &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), (LPOVERLAPPED)Overlap, CompletionRoutine)) - { - SND_TRACE(L"WriteFileEx failed with %x\n", GetLastError()); - } - else - { - WaitForSingleObjectEx (KernelHandle, INFINITE, TRUE); - + if (DeviceType == WAVE_OUT_DEVICE_TYPE) + { + Ret = WriteFileEx(KernelHandle, &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), (LPOVERLAPPED)Overlap, CompletionRoutine); + if (Ret) + WaitForSingleObjectEx (KernelHandle, INFINITE, TRUE); + } + else if (DeviceType == WAVE_IN_DEVICE_TYPE) + { + Ret = ReadFileEx(KernelHandle, &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), (LPOVERLAPPED)Overlap, CompletionRoutine); + if (Ret) + WaitForSingleObjectEx (KernelHandle, INFINITE, TRUE); } return MMSYSERR_NOERROR;
15 years, 2 months
1
0
0
0
← Newer
1
...
54
55
56
57
58
59
60
...
65
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Results per page:
10
25
50
100
200