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
November 2014
----- 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
18 participants
373 discussions
Start a n
N
ew thread
[hbelusca] 65375: [NTVDM]: Errm... fix the "fix": apps *must* always set AX (not AL) to a correct value before calling INT 33h. The app that wrongly set AX did it once... ^^
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Nov 11 01:57:59 2014 New Revision: 65375 URL:
http://svn.reactos.org/svn/reactos?rev=65375&view=rev
Log: [NTVDM]: Errm... fix the "fix": apps *must* always set AX (not AL) to a correct value before calling INT 33h. The app that wrongly set AX did it once... ^^ Modified: trunk/reactos/subsystems/ntvdm/dos/mouse32.c Modified: trunk/reactos/subsystems/ntvdm/dos/mouse32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/mouse…
============================================================================== --- trunk/reactos/subsystems/ntvdm/dos/mouse32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/dos/mouse32.c [iso-8859-1] Tue Nov 11 01:57:59 2014 @@ -176,7 +176,7 @@ static VOID WINAPI DosMouseService(LPWORD Stack) { - switch (getAL()) + switch (getAX()) { /* Reset Driver */ case 0x00: @@ -601,7 +601,7 @@ default: { - DPRINT1("BIOS Function INT 33h, AL = 0x%02X NOT IMPLEMENTED\n", getAL()); + DPRINT1("BIOS Function INT 33h, AX = 0x%04X NOT IMPLEMENTED\n", getAX()); } } }
10 years, 1 month
1
0
0
0
[hbelusca] 65374: [NTVDM] - Disable some DPRINTs and reenable some others (those concerning programs loading). - INT 15h, AH=C2h calls a dedicated mouse bios function, which is stubplemented. - Mov...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Tue Nov 11 01:40:23 2014 New Revision: 65374 URL:
http://svn.reactos.org/svn/reactos?rev=65374&view=rev
Log: [NTVDM] - Disable some DPRINTs and reenable some others (those concerning programs loading). - INT 15h, AH=C2h calls a dedicated mouse bios function, which is stubplemented. - Move part of the HW mouse / driver hack from the HW mouse module into the BIOS mouse. - INT 33h: s/BiosMouseService/DosMouseService/, in this interrupt we need to check for function numbers in AL (not in AX :) fixes few apps). - Reenable mouse user handler callbacks calls in CallMouseUserHandlers. - Some apps (e.g. the demo from
http://www.brackeen.com/vga/mouse.html
) draw by themselves the cursor and do not bother to call the INT 33h "Show cursor" function, but expects that moving the mouse we report its correct position. Fix DosMouseUpdatePosition so that it always updates the stored mouse position, but redraws it only when the cursor is shown. Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.c trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.c trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.h trunk/reactos/subsystems/ntvdm/dos/dem.c trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c trunk/reactos/subsystems/ntvdm/dos/mouse32.c trunk/reactos/subsystems/ntvdm/dos/mouse32.h trunk/reactos/subsystems/ntvdm/hardware/mouse.c Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c [iso-8859-1] Tue Nov 11 01:40:23 2014 @@ -264,7 +264,7 @@ /* Pointing Device BIOS Interface (PS) */ case 0xC2: { - DPRINT1("INT 15h, AH = C2h must be implemented in order to support vendor mouse drivers\n"); + BiosMousePs2Interface(Stack); break; } @@ -442,8 +442,8 @@ * because some programs may hook only BIOS_SYS_TIMER_INTERRUPT * for their purpose... */ - /** EmulatorInterrupt(BIOS_SYS_TIMER_INTERRUPT); **/ Int32Call(&BiosContext, BIOS_SYS_TIMER_INTERRUPT); + // BiosSystemTimerInterrupt(Stack); PicIRQComplete(Stack); } @@ -581,9 +581,11 @@ VOID Bios32Post(VOID) { +#if 0 BOOLEAN Success; - - DPRINT1("Bios32Post\n"); +#endif + + DPRINT("Bios32Post\n"); /* Initialize the stack */ // That's what says IBM... (stack at 30:00FF going downwards) @@ -631,9 +633,11 @@ ///////////// MUST BE DONE AFTER IVT INITIALIZATION !! ///////////////////// +#if 0 /* Load some ROMs */ Success = LoadRom("boot.bin", (PVOID)0xE0000, NULL); DPRINT1("Test ROM loading %s ; GetLastError() = %u\n", Success ? "succeeded" : "failed", GetLastError()); +#endif SearchAndInitRoms(&BiosContext); @@ -646,7 +650,7 @@ static VOID WINAPI Bios32ResetBop(LPWORD Stack) { - DPRINT1("Bios32ResetBop\n"); + DPRINT("Bios32ResetBop\n"); /* Disable interrupts */ setIF(0); Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.c [iso-8859-1] Tue Nov 11 01:40:23 2014 @@ -302,15 +302,16 @@ Bda->KeybdBufferEnd = Bda->KeybdBufferStart + BIOS_KBD_BUFFER_SIZE * sizeof(WORD); Bda->KeybdBufferHead = Bda->KeybdBufferTail = Bda->KeybdBufferStart; - // FIXME: Fill the keyboard buffer with invalid values, for diagnostic purposes... - RtlFillMemory(((LPVOID)((ULONG_PTR)Bda + Bda->KeybdBufferStart)), BIOS_KBD_BUFFER_SIZE * sizeof(WORD), 'A'); - - /* Register the BIOS 32-bit Interrupts */ - - /* Initialize software vector handlers */ + // FIXME: Fill the keyboard buffer with invalid values for diagnostic purposes... + RtlFillMemory(((LPVOID)((ULONG_PTR)Bda + Bda->KeybdBufferStart)), + BIOS_KBD_BUFFER_SIZE * sizeof(WORD), 'A'); + + /* + * Register the BIOS 32-bit Interrupts: + * - Software vector handler + * - HW vector interrupt + */ RegisterBiosInt32(BIOS_KBD_INTERRUPT, BiosKeyboardService); - - /* Set up the HW vector interrupts */ EnableHwIRQ(1, BiosKeyboardIrq); return TRUE; Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.c [iso-8859-1] Tue Nov 11 01:40:23 2014 @@ -18,6 +18,9 @@ #include "io.h" #include "hardware/mouse.h" +// HACK: For the PS/2 bypass and
MOUSE.COM
driver direct call +#include "dos/mouse32.h" + /* PRIVATE VARIABLES **********************************************************/ /* PRIVATE FUNCTIONS **********************************************************/ @@ -25,7 +28,88 @@ // Mouse IRQ 12 static VOID WINAPI BiosMouseIrq(LPWORD Stack) { + // HACK!! Call directly the
MOUSE.COM
driver instead of going + // through the regular interfaces!! + extern COORD DosNewPosition; + extern WORD DosButtonState; + DosMouseUpdatePosition(&DosNewPosition); + DosMouseUpdateButtons(DosButtonState); + PicIRQComplete(Stack); +} + +VOID BiosMousePs2Interface(LPWORD Stack) +{ + DPRINT1("INT 15h, AH = C2h must be implemented in order to support vendor mouse drivers\n"); + + switch (getAL()) + { + /* Enable / Disable */ + case 0x00: + { + break; + } + + /* Reset */ + case 0x01: + { + break; + } + + /* Set Sampling Rate */ + case 0x02: + { + break; + } + + /* Set Resolution */ + case 0x03: + { + break; + } + + /* Get Type */ + case 0x04: + { + break; + } + + /* Initialize */ + case 0x05: + { + break; + } + + /* Extended Commands */ + case 0x06: + { + break; + } + + /* Set Device Handler Address */ + case 0x07: + { + break; + } + + /* Write to Pointer Port */ + case 0x08: + { + break; + } + + /* Read from Pointer Port */ + case 0x09: + { + break; + } + + default: + { + DPRINT1("INT 15h, AH = C2h, AL = 0x%02X NOT IMPLEMENTED\n", + getAL()); + } + } } /* PUBLIC FUNCTIONS ***********************************************************/ @@ -34,7 +118,6 @@ { /* Set up the HW vector interrupts */ EnableHwIRQ(12, BiosMouseIrq); - return TRUE; } Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.h [iso-8859-1] Tue Nov 11 01:40:23 2014 @@ -15,7 +15,7 @@ /* DEFINES ********************************************************************/ -#define BIOS_MOUSE_INTERRUPT 0x33 +#if 0 // This code is for the
MOUSE.COM
driver enum { @@ -70,10 +70,12 @@ } GraphicsCursor; } MOUSE_DRIVER_STATE, *PMOUSE_DRIVER_STATE; +#endif + /* FUNCTIONS ******************************************************************/ -VOID MouseBiosUpdatePosition(PCOORD NewPosition); -VOID MouseBiosUpdateButtons(WORD ButtonStatus); +VOID BiosMousePs2Interface(LPWORD Stack); + BOOLEAN MouseBios32Initialize(VOID); VOID MouseBios32Cleanup(VOID); Modified: trunk/reactos/subsystems/ntvdm/dos/dem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/dem.c…
============================================================================== --- trunk/reactos/subsystems/ntvdm/dos/dem.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/dos/dem.c [iso-8859-1] Tue Nov 11 01:40:23 2014 @@ -246,7 +246,7 @@ } /* Start the process from the command line */ - DPRINT("Starting '%s' ('%s')...\n", AppName, CmdLine); + DPRINT1("Starting '%s' ('%s')...\n", AppName, CmdLine); Result = DosStartProcess(AppName, CmdLine, Env); if (Result != ERROR_SUCCESS) { Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/dos32…
============================================================================== --- trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Tue Nov 11 01:40:23 2014 @@ -916,7 +916,7 @@ PWORD RelocWord; LPSTR CmdLinePtr = (LPSTR)CommandLine; - DPRINT("DosLoadExecutable(%d, %s, %s, %s, 0x%08X, 0x%08X)\n", + DPRINT1("DosLoadExecutable(%d, %s, %s, %s, 0x%08X, 0x%08X)\n", LoadType, ExecutablePath, CommandLine, Modified: trunk/reactos/subsystems/ntvdm/dos/mouse32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/mouse…
============================================================================== --- trunk/reactos/subsystems/ntvdm/dos/mouse32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/dos/mouse32.c [iso-8859-1] Tue Nov 11 01:40:23 2014 @@ -25,6 +25,11 @@ static BOOLEAN DriverEnabled = TRUE; static MOUSE_DRIVER_STATE DriverState; +/**/ +COORD DosNewPosition; +WORD DosButtonState; +/**/ + /* PRIVATE FUNCTIONS **********************************************************/ static VOID PaintMouseCursor(VOID) @@ -81,7 +86,6 @@ static VOID CallMouseUserHandlers(USHORT CallMask) { -#if 0 USHORT i; USHORT AX, BX, CX, DX, SI, DI; @@ -109,10 +113,10 @@ setSI(DriverState.MickeysPerCellHoriz); setDI(DriverState.MickeysPerCellVert); - DPRINT1("Calling Handler0 %04X:%04X with CallMask 0x%04X\n", - HIWORD(DriverState.Handler0.Callback), - LOWORD(DriverState.Handler0.Callback), - CallMask); + DPRINT("Calling Handler0 %04X:%04X with CallMask 0x%04X\n", + HIWORD(DriverState.Handler0.Callback), + LOWORD(DriverState.Handler0.Callback), + CallMask); /* Call the callback */ RunCallback16(&DosContext, DriverState.Handler0.Callback); @@ -168,12 +172,11 @@ setDI(DI); } } -#endif -} - -static VOID WINAPI BiosMouseService(LPWORD Stack) -{ - switch (getAX()) +} + +static VOID WINAPI DosMouseService(LPWORD Stack) +{ + switch (getAL()) { /* Reset Driver */ case 0x00: @@ -598,14 +601,14 @@ default: { - DPRINT1("BIOS Function INT 33h, AX = 0x%04X NOT IMPLEMENTED\n", getAX()); + DPRINT1("BIOS Function INT 33h, AL = 0x%02X NOT IMPLEMENTED\n", getAL()); } } } /* PUBLIC FUNCTIONS ***********************************************************/ -VOID MouseBiosUpdatePosition(PCOORD NewPosition) +VOID DosMouseUpdatePosition(PCOORD NewPosition) { SHORT DeltaX = NewPosition->X - DriverState.Position.X; SHORT DeltaY = NewPosition->Y - DriverState.Position.Y; @@ -615,18 +618,16 @@ DriverState.HorizCount += (DeltaX * (SHORT)DriverState.MickeysPerCellHoriz) / 8; DriverState.VertCount += (DeltaY * (SHORT)DriverState.MickeysPerCellVert ) / 8; - if (DriverState.ShowCount > 0) - { - EraseMouseCursor(); - DriverState.Position = *NewPosition; - PaintMouseCursor(); - } + if (DriverState.ShowCount > 0) EraseMouseCursor(); + DriverState.Position = *NewPosition; + if (DriverState.ShowCount > 0) PaintMouseCursor(); /* Call the mouse handlers */ + // if (DeltaX || DeltaY) CallMouseUserHandlers(0x0001); // We use MS MOUSE v1.0+ format } -VOID MouseBiosUpdateButtons(WORD ButtonState) +VOID DosMouseUpdateButtons(WORD ButtonState) { USHORT i; USHORT CallMask = 0x0000; // We use MS MOUSE v1.0+ format @@ -668,7 +669,7 @@ RtlZeroMemory(&DriverState, sizeof(DriverState)); /* Initialize the interrupt handler */ - RegisterDosInt32(BIOS_MOUSE_INTERRUPT, BiosMouseService); + RegisterDosInt32(DOS_MOUSE_INTERRUPT, DosMouseService); return TRUE; } Modified: trunk/reactos/subsystems/ntvdm/dos/mouse32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/mouse…
============================================================================== --- trunk/reactos/subsystems/ntvdm/dos/mouse32.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/dos/mouse32.h [iso-8859-1] Tue Nov 11 01:40:23 2014 @@ -15,7 +15,7 @@ /* DEFINES ********************************************************************/ -#define BIOS_MOUSE_INTERRUPT 0x33 +#define DOS_MOUSE_INTERRUPT 0x33 enum { @@ -72,8 +72,8 @@ /* FUNCTIONS ******************************************************************/ -VOID MouseBiosUpdatePosition(PCOORD NewPosition); -VOID MouseBiosUpdateButtons(WORD ButtonStatus); +VOID DosMouseUpdatePosition(PCOORD NewPosition); +VOID DosMouseUpdateButtons(WORD ButtonStatus); BOOLEAN DosMouseInitialize(VOID); VOID DosMouseCleanup(VOID); Modified: trunk/reactos/subsystems/ntvdm/hardware/mouse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/hardware/…
============================================================================== --- trunk/reactos/subsystems/ntvdm/hardware/mouse.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/hardware/mouse.c [iso-8859-1] Tue Nov 11 01:40:23 2014 @@ -13,9 +13,6 @@ #include "mouse.h" #include "ps2.h" // #include "pic.h" - -// HACK: For the PS/2 bypass and
MOUSE.COM
driver direct call -#include "dos/mouse32.h" /* PRIVATE VARIABLES **********************************************************/ @@ -310,11 +307,16 @@ VOID MouseEventHandler(PMOUSE_EVENT_RECORD MouseEvent) { +extern COORD DosNewPosition; +extern WORD DosButtonState; + // FIXME: Sync our private data + MouseUpdatePosition(&MouseEvent->dwMousePosition); + MouseUpdateButtons(MouseEvent->dwButtonState); // HACK: Bypass PS/2 and instead, notify the
MOUSE.COM
driver directly - MouseBiosUpdatePosition(&MouseEvent->dwMousePosition); - MouseBiosUpdateButtons(LOWORD(MouseEvent->dwButtonState)); + DosNewPosition = MouseEvent->dwMousePosition; + DosButtonState = LOWORD(MouseEvent->dwButtonState); // PS2QueuePush(PS2Port, Data); }
10 years, 1 month
1
0
0
0
[dquintana] 65373: [RSHELL] * Make use of the CToolbar class here too. * Fix the menubar logic for closing menus on a second click. Almost. There's some glitch when clicking too fast, that I will f...
by dquintana@svn.reactos.org
Author: dquintana Date: Tue Nov 11 01:05:39 2014 New Revision: 65373 URL:
http://svn.reactos.org/svn/reactos?rev=65373&view=rev
Log: [RSHELL] * Make use of the CToolbar class here too. * Fix the menubar logic for closing menus on a second click. Almost. There's some glitch when clicking too fast, that I will fix later. Modified: branches/shell-experiments/base/shell/explorer-new/taskswnd.cpp branches/shell-experiments/base/shell/rshell/CMenuBand.cpp branches/shell-experiments/base/shell/rshell/CMenuBand.h branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp branches/shell-experiments/base/shell/rshell/CMenuToolbars.h branches/shell-experiments/base/shell/rshell/precomp.h branches/shell-experiments/include/reactos/rosctrls.h Modified: branches/shell-experiments/base/shell/explorer-new/taskswnd.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/ex…
============================================================================== --- branches/shell-experiments/base/shell/explorer-new/taskswnd.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/explorer-new/taskswnd.cpp [iso-8859-1] Tue Nov 11 01:05:39 2014 @@ -27,10 +27,12 @@ /* Set DUMP_TASKS to 1 to enable a dump of the tasks and task groups every 5 seconds */ #define DUMP_TASKS 0 +#define DEBUG_SHELL_HOOK 0 const WCHAR szTaskSwitchWndClass [] = TEXT("MSTaskSwWClass"); const WCHAR szRunningApps [] = TEXT("Running Applications"); +#if DEBUG_SHELL_HOOK const struct { INT msg; LPCWSTR msg_name; @@ -51,6 +53,7 @@ { HSHELL_WINDOWREPLACING, L"HSHELL_WINDOWREPLACING" }, { HSHELL_RUDEAPPACTIVATED, L"HSHELL_RUDEAPPACTIVATED" }, }; +#endif typedef struct _TASK_GROUP { @@ -1445,6 +1448,7 @@ case HSHELL_GETMINRECT: default: { +#if DEBUG_SHELL_HOOK int i, found; for (i = 0, found = 0; i != sizeof(hshell_msg) / sizeof(hshell_msg[0]); i++) { @@ -1455,10 +1459,10 @@ break; } } - if (!found) - { - TRACE("Shell message %d unhandled (lParam = 0x%p)!\n", (INT) wParam, lParam); - } + if (found) + break; +#endif + TRACE("Shell message %d unhandled (lParam = 0x%p)!\n", (INT) wParam, lParam); break; } } Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Tue Nov 11 01:05:39 2014 @@ -389,14 +389,14 @@ if (m_staticToolbar != NULL) { - hr = m_staticToolbar->ShowWindow(fShow); + hr = m_staticToolbar->ShowDW(fShow); if (FAILED_UNEXPECTEDLY(hr)) return hr; } if (m_SFToolbar != NULL) { - hr = m_SFToolbar->ShowWindow(fShow); + hr = m_SFToolbar->ShowDW(fShow); if (FAILED_UNEXPECTEDLY(hr)) return hr; } @@ -1061,6 +1061,15 @@ return S_OK; } +HRESULT CMenuBand::_BeforeCancelPopup() +{ + if (m_staticToolbar) + m_staticToolbar->BeforeCancelPopup(); + if (m_SFToolbar) + m_SFToolbar->BeforeCancelPopup(); + return S_OK; +} + HRESULT CMenuBand::_DisableMouseTrack(BOOL bDisable) { if (m_staticToolbar) Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] Tue Nov 11 01:05:39 2014 @@ -189,6 +189,7 @@ HRESULT _MenuItemHotTrack(DWORD changeType); HRESULT _CancelCurrentPopup(); HRESULT _OnPopupSubMenu(IShellMenu * childShellMenu, POINTL * pAt, RECTL * pExclude, BOOL mouseInitiated); + HRESULT _BeforeCancelPopup(); HRESULT _DisableMouseTrack(BOOL bDisable); HRESULT _SetChildBand(CMenuBand * child); HRESULT _SetParentBand(CMenuBand * parent); Modified: branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] Tue Nov 11 01:05:39 2014 @@ -383,8 +383,10 @@ // Don't do anything if another window is capturing the mouse. HWND cCapture = ::GetCapture(); if (cCapture && cCapture != m_captureHwnd && m_current->type != TrackedMenuEntry) + { + TRACE("Foreign capture active.\n"); return TRUE; - + } POINT pt = msg->pt; @@ -392,9 +394,21 @@ StackEntry * entry = NULL; if (IsTrackedWindow(child, &entry) != S_OK) + { + TRACE("Foreign window detected.\n"); return TRUE; + } TRACE("MouseDown %d\n", m_isLButtonDown); + + if (entry->type == MenuBarEntry) + { + if (entry != m_current) + { + TRACE("Menubar with popup active.\n"); + return TRUE; + } + } if (entry) { @@ -473,33 +487,17 @@ switch (msg->message) { - case WM_NCLBUTTONDOWN: case WM_LBUTTONDOWN: - case WM_NCRBUTTONDOWN: case WM_RBUTTONDOWN: - if (m_menuBar) + if (m_menuBar && m_current->type == TrackedMenuEntry) { POINT pt = msg->pt; HWND child = WindowFromPoint(pt); BOOL hoveringMenuBar = m_menuBar->mb->IsWindowOwner(child) == S_OK; if (hoveringMenuBar) { - m_menuBar->mb->_DisableMouseTrack(TRUE); - if (m_current->type == TrackedMenuEntry) - { - SendMessage(m_parent->hwnd, WM_CANCELMODE, 0, 0); - msg->message = WM_NULL; - } + m_menuBar->mb->_BeforeCancelPopup(); } - } - break; - case WM_NCLBUTTONUP: - case WM_LBUTTONUP: - case WM_NCRBUTTONUP: - case WM_RBUTTONUP: - if (m_current && m_current->type != TrackedMenuEntry) - { - msg->message = WM_NULL; } break; case WM_MOUSEMOVE: @@ -564,6 +562,18 @@ // fallthrough; case WM_NCRBUTTONDOWN: case WM_RBUTTONDOWN: + if (m_menuBar && m_current->type == MenuPopupEntry) + { + POINT pt = msg->pt; + HWND child = WindowFromPoint(pt); + BOOL hoveringMenuBar = m_menuBar->mb->IsWindowOwner(child) == S_OK; + if (hoveringMenuBar) + { + m_current->mb->_MenuItemHotTrack(MPOS_FULLCANCEL); + break; + } + } + if (m_current->type == MenuPopupEntry) { HWND child = WindowFromPoint(pt); Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Tue Nov 11 01:05:39 2014 @@ -18,13 +18,15 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #include "precomp.h" -#include <windowsx.h> #include <commoncontrols.h> #include <shlwapi_undoc.h> #include <uxtheme.h> #include "CMenuBand.h" #include "CMenuToolbars.h" + +#define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) +#define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) WINE_DEFAULT_DEBUG_CHANNEL(CMenuToolbars); @@ -41,6 +43,13 @@ // User-defined timer ID used while hot-tracking around the menu #define TIMERID_HOTTRACK 1 +LRESULT CMenuToolbarBase::OnWinEventWrap(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + LRESULT lr; + bHandled = OnWinEvent(m_hWnd, uMsg, wParam, lParam, &lr) != S_FALSE; + return lr; +} + HRESULT CMenuToolbarBase::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) { NMHDR * hdr; @@ -116,38 +125,6 @@ return S_FALSE; } -LRESULT CALLBACK CMenuToolbarBase::s_SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - CMenuToolbarBase * pthis = reinterpret_cast<CMenuToolbarBase *>(GetWindowLongPtr(hWnd, GWLP_USERDATA)); - return pthis->SubclassProc(hWnd, uMsg, wParam, lParam); -} - -LRESULT CMenuToolbarBase::SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - LRESULT lr; - - switch (uMsg) - { - case WM_USER_ISTRACKEDITEM: - m_SubclassOld(hWnd, uMsg, wParam, lParam); - return IsTrackedItem(wParam); - case WM_USER_CHANGETRACKEDITEM: - m_SubclassOld(hWnd, uMsg, wParam, lParam); - return ChangeTrackedItem(wParam, LOWORD(lParam), HIWORD(lParam)); - - case WM_COMMAND: - OnWinEvent(hWnd, uMsg, wParam, lParam, &lr); - break; - case WM_NOTIFY: - OnWinEvent(hWnd, uMsg, wParam, lParam, &lr); - break; - case WM_TIMER: - OnPopupTimer(wParam); - } - - return m_SubclassOld(hWnd, uMsg, wParam, lParam); -} - HRESULT CMenuToolbarBase::DisableMouseTrack(BOOL bDisable) { if (m_disableMouseTrack != bDisable) @@ -175,10 +152,6 @@ HRESULT CMenuToolbarBase::OnCustomDraw(LPNMTBCUSTOMDRAW cdraw, LRESULT * theResult) { - RECT rc; - HDC hdc; - COLORREF clrText; - HBRUSH bgBrush; bool isHot, isPopup; TBBUTTONINFO btni; @@ -189,16 +162,18 @@ return S_OK; case CDDS_ITEMPREPAINT: - - rc = cdraw->nmcd.rc; - hdc = cdraw->nmcd.hdc; - + // The item with an active submenu gets the CHECKED flag. isHot = m_hotBar == this && (int) cdraw->nmcd.dwItemSpec == m_hotItem; isPopup = m_popupBar == this && (int) cdraw->nmcd.dwItemSpec == m_popupItem; if (m_initFlags & SMINIT_VERTICAL || IsAppThemed()) { + COLORREF clrText; + HBRUSH bgBrush; + RECT rc = cdraw->nmcd.rc; + HDC hdc = cdraw->nmcd.hdc; + // Remove HOT and CHECKED flags (will restore HOT if necessary) cdraw->nmcd.uItemState &= ~(CDIS_HOT | CDIS_CHECKED); @@ -250,7 +225,7 @@ // Fetch the button style btni.cbSize = sizeof(btni); btni.dwMask = TBIF_STYLE; - SendMessage(m_hwndToolbar, TB_GETBUTTONINFO, cdraw->nmcd.dwItemSpec, reinterpret_cast<LPARAM>(&btni)); + GetButtonInfo(cdraw->nmcd.dwItemSpec, &btni); // Check if we need to draw a submenu arrow if (btni.fsStyle & BTNS_DROPDOWN) @@ -278,8 +253,7 @@ } CMenuToolbarBase::CMenuToolbarBase(CMenuBand *menuBand, BOOL usePager) : - m_hwnd(NULL), - m_hwndToolbar(NULL), + m_pager(this, 1), m_useFlatMenus(FALSE), m_SubclassOld(NULL), m_disableMouseTrack(FALSE), @@ -288,9 +262,12 @@ m_dwMenuFlags(0), m_hasSizes(FALSE), m_usePager(usePager), + m_hotBar(NULL), m_hotItem(-1), + m_popupBar(NULL), m_popupItem(-1), - m_isTrackingPopup(FALSE) + m_isTrackingPopup(FALSE), + m_cancelingPopup(FALSE) { m_idealSize.cx = 0; m_idealSize.cy = 0; @@ -304,23 +281,23 @@ CMenuToolbarBase::~CMenuToolbarBase() { - if (m_hwndToolbar && m_hwndToolbar != m_hwnd) - DestroyWindow(m_hwndToolbar); - - if (m_hwnd) - DestroyWindow(m_hwnd); + if (m_hWnd) + DestroyWindow(); + + if (m_pager.m_hWnd) + m_pager.DestroyWindow(); DeleteObject(m_marlett); } void CMenuToolbarBase::InvalidateDraw() { - InvalidateRect(m_hwnd, NULL, FALSE); -} - -HRESULT CMenuToolbarBase::ShowWindow(BOOL fShow) -{ - ::ShowWindow(m_hwnd, fShow ? SW_SHOW : SW_HIDE); + InvalidateRect(NULL, FALSE); +} + +HRESULT CMenuToolbarBase::ShowDW(BOOL fShow) +{ + ShowWindow(fShow ? SW_SHOW : SW_HIDE); // Ensure that the right image list is assigned to the toolbar UpdateImageLists(); @@ -336,7 +313,7 @@ if ((m_initFlags & (SMINIT_TOPLEVEL | SMINIT_VERTICAL)) == SMINIT_TOPLEVEL) // not vertical. { // No image list, prevents the buttons from having a margin at the left side - SendMessageW(m_hwnd, TB_SETIMAGELIST, 0, 0); + SetImageList(NULL); return S_OK; } @@ -346,36 +323,34 @@ if (m_menuBand->UseBigIcons()) { shiml = SHIL_LARGE; - SendMessageW(m_hwndToolbar, TB_SETPADDING, 0, MAKELPARAM(4, 0)); + SetPadding(4, 0); } else { shiml = SHIL_SMALL; - SendMessageW(m_hwndToolbar, TB_SETPADDING, 0, MAKELPARAM(4, 4)); + SetPadding(4, 4); } IImageList * piml; HRESULT hr = SHGetImageList(shiml, IID_PPV_ARG(IImageList, &piml)); if (FAILED_UNEXPECTEDLY(hr)) { - SendMessageW(m_hwndToolbar, TB_SETIMAGELIST, 0, 0); + SetImageList(NULL); } else { - SendMessageW(m_hwndToolbar, TB_SETIMAGELIST, 0, reinterpret_cast<LPARAM>(piml)); + SetImageList((HIMAGELIST)piml); } return S_OK; } HRESULT CMenuToolbarBase::Close() { - if (m_hwndToolbar != m_hwnd) - DestroyWindow(m_hwndToolbar); - - DestroyWindow(m_hwnd); - - m_hwndToolbar = NULL; - m_hwnd = NULL; + if (m_hWnd) + DestroyWindow(); + + if (m_pager.m_hWnd) + m_pager.DestroyWindow(); return S_OK; } @@ -412,13 +387,7 @@ rc.bottom = 1; } - HWND hwndToolbar = CreateWindowEx( - tbExStyles, TOOLBARCLASSNAMEW, NULL, - tbStyles, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, - hwndParent, NULL, _AtlBaseModule.GetModuleInstance(), 0); - - if (hwndToolbar == NULL) - return E_FAIL; + SubclassWindow(Create(hwndParent, tbStyles, tbExStyles)); // If needed, create the pager. if (m_usePager) @@ -431,26 +400,12 @@ pgStyles, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, hwndParent, NULL, _AtlBaseModule.GetModuleInstance(), 0); - ::SetParent(hwndToolbar, hwndPager); - ::SetParent(hwndPager, hwndParent); - - SendMessage(hwndPager, PGM_SETCHILD, 0, reinterpret_cast<LPARAM>(hwndToolbar)); - m_hwndToolbar = hwndToolbar; - m_hwnd = hwndPager; - } - else - { - ::SetParent(hwndToolbar, hwndParent); - m_hwndToolbar = hwndToolbar; - m_hwnd = hwndToolbar; - } - - // Identify the version of the used Common Controls DLL by sending the size of the TBBUTTON structure. - SendMessageW(hwndToolbar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0); - - // Apply subclassing - SetWindowLongPtr(hwndToolbar, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(this)); - m_SubclassOld = (WNDPROC) SetWindowLongPtr(hwndToolbar, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(CMenuToolbarBase::s_SubclassProc)); + m_pager.SubclassWindow(hwndPager); + + ::SetParent(m_hWnd, hwndPager); + + m_pager.SendMessageW(PGM_SETCHILD, 0, reinterpret_cast<LPARAM>(m_hWnd)); + } // Configure the image lists UpdateImageLists(); @@ -470,16 +425,16 @@ if (m_hasSizes) return S_OK; - if (!m_hwndToolbar) + if (!m_hWnd) return S_OK; // Obtain the ideal size, to be used as min and max - SendMessageW(m_hwndToolbar, TB_AUTOSIZE, 0, 0); - SendMessageW(m_hwndToolbar, TB_GETMAXSIZE, 0, reinterpret_cast<LPARAM>(&m_idealSize)); - SendMessageW(m_hwndToolbar, TB_GETIDEALSIZE, (m_initFlags & SMINIT_VERTICAL) != 0, reinterpret_cast<LPARAM>(&m_idealSize)); + AutoSize(); + GetMaxSize(&m_idealSize); + GetIdealSize((m_initFlags & SMINIT_VERTICAL) != 0, &m_idealSize); // Obtain the button size, to be used as the integral size - DWORD size = SendMessageW(m_hwndToolbar, TB_GETBUTTONSIZE, 0, 0); + DWORD size = GetButtonSize(); m_itemSize.cx = GET_X_LPARAM(size); m_itemSize.cy = GET_Y_LPARAM(size); m_hasSizes = TRUE; @@ -496,20 +451,23 @@ HRESULT CMenuToolbarBase::SetPosSize(int x, int y, int cx, int cy) { + // Update the toolbar or pager to fit the requested rect // If we have a pager, set the toolbar height to the ideal height of the toolbar - if (m_hwnd != m_hwndToolbar) - { - SetWindowPos(m_hwndToolbar, NULL, x, y, cx, m_idealSize.cy, 0); - } - - // Update the toolbar or pager to fit the requested rect - SetWindowPos(m_hwnd, NULL, x, y, cx, cy, 0); + if (m_pager.m_hWnd) + { + SetWindowPos(NULL, x, y, cx, m_idealSize.cy, 0); + m_pager.SetWindowPos(NULL, x, y, cx, cy, 0); + } + else + { + SetWindowPos(NULL, x, y, cx, cy, 0); + } // In a vertical menu, resize the buttons to fit the width if (m_initFlags & SMINIT_VERTICAL) { - DWORD btnSize = SendMessage(m_hwndToolbar, TB_GETBUTTONSIZE, 0, 0); - SendMessage(m_hwndToolbar, TB_SETBUTTONSIZE, 0, MAKELPARAM(cx, HIWORD(btnSize))); + DWORD btnSize = GetButtonSize(); + SetButtonSize(cx, GET_Y_LPARAM(btnSize)); } return S_OK; @@ -517,8 +475,8 @@ HRESULT CMenuToolbarBase::IsWindowOwner(HWND hwnd) { - if (m_hwnd && m_hwnd == hwnd) return S_OK; - if (m_hwndToolbar && m_hwndToolbar == hwnd) return S_OK; + if (m_hWnd && m_hWnd == hwnd) return S_OK; + if (m_pager.m_hWnd && m_pager.m_hWnd == hwnd) return S_OK; return S_FALSE; } @@ -527,7 +485,10 @@ if (!phwnd) return E_FAIL; - *phwnd = m_hwnd; + if (m_pager.m_hWnd) + *phwnd = m_pager.m_hWnd; + else + *phwnd = m_hWnd; return S_OK; } @@ -544,35 +505,38 @@ return InternalGetTooltip(iItem, index, dwData, tip->pszText, tip->cchTextMax); } -HRESULT CMenuToolbarBase::OnPopupTimer(DWORD timerId) -{ - if (timerId != TIMERID_HOTTRACK) - return S_FALSE; - - KillTimer(m_hwndToolbar, TIMERID_HOTTRACK); +HRESULT CMenuToolbarBase::OnPopupTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + if (wParam != TIMERID_HOTTRACK) + { + bHandled = FALSE; + return 0; + } + + KillTimer(TIMERID_HOTTRACK); if (!m_timerEnabled) - return S_FALSE; + return 0; m_timerEnabled = FALSE; if (m_hotItem < 0) - return S_FALSE; + return 0; // Returns S_FALSE if the current item did not show a submenu HRESULT hr = PopupItem(m_hotItem, FALSE); if (hr != S_FALSE) - return hr; + return 0; // If we didn't switch submenus, cancel the current popup regardless if (m_popupBar) { HRESULT hr = CancelCurrentPopup(); if (FAILED_UNEXPECTEDLY(hr)) - return hr; - } - - return S_OK; + return 0; + } + + return 0; } HRESULT CMenuToolbarBase::KillPopupTimer() @@ -580,7 +544,7 @@ if (m_timerEnabled) { m_timerEnabled = FALSE; - KillTimer(m_hwndToolbar, TIMERID_HOTTRACK); + KillTimer(TIMERID_HOTTRACK); return S_OK; } return S_FALSE; @@ -603,7 +567,7 @@ // Notify the toolbar if the hot-tracking left this toolbar if (m_hotBar == this && toolbar != this) { - SendMessage(m_hwndToolbar, TB_SETHOTITEM, (WPARAM) -1, 0); + SetHotItem(-1); } TRACE("Hot item changed from %p %p, to %p %p\n", m_hotBar, m_hotItem, toolbar, item); @@ -625,7 +589,7 @@ { DWORD elapsed = 0; SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &elapsed, 0); - SetTimer(m_hwndToolbar, TIMERID_HOTTRACK, elapsed, NULL); + SetTimer(TIMERID_HOTTRACK, elapsed); m_timerEnabled = TRUE; TRACE("SetTimer called with m_hotItem=%d\n", m_hotItem); } @@ -636,9 +600,9 @@ info.cbSize = sizeof(info); info.dwMask = 0; - int index = SendMessage(m_hwndToolbar, TB_GETBUTTONINFO, item, reinterpret_cast<LPARAM>(&info)); - - SendMessage(m_hwndToolbar, TB_SETHOTITEM, index, 0); + int index = GetButtonInfo(item, &info); + + SetHotItem(index); } } @@ -655,7 +619,7 @@ // Notify the toolbar if the popup-tracking this toolbar if (m_popupBar == this && toolbar != this) { - SendMessage(m_hwndToolbar, TB_CHECKBUTTON, m_popupItem, FALSE); + CheckButton(m_popupItem, FALSE); m_isTrackingPopup = FALSE; } @@ -664,24 +628,24 @@ if (m_popupBar == this) { - SendMessage(m_hwndToolbar, TB_CHECKBUTTON, m_popupItem, TRUE); + CheckButton(m_popupItem, TRUE); } InvalidateDraw(); return S_OK; } -HRESULT CMenuToolbarBase::IsTrackedItem(INT index) +LRESULT CMenuToolbarBase::IsTrackedItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { TBBUTTON btn; if (m_hotBar != this) return S_FALSE; - if (index < 0) + if (wParam < 0) return S_FALSE; - if (!SendMessage(m_hwndToolbar, TB_GETBUTTON, index, reinterpret_cast<LPARAM>(&btn))) + if (!GetButton(wParam, &btn)) return E_FAIL; if (m_hotItem == btn.idCommand) @@ -693,20 +657,23 @@ return S_FALSE; } -HRESULT CMenuToolbarBase::ChangeTrackedItem(INT index, BOOL wasTracking, BOOL mouse) -{ +LRESULT CMenuToolbarBase::ChangeTrackedItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + BOOL wasTracking = LOWORD(lParam); + BOOL mouse = HIWORD(lParam); + TBBUTTON btn; - if (index < 0) + if (wParam < 0) { m_isTrackingPopup = FALSE; return m_menuBand->_ChangeHotItem(NULL, -1, HICF_MOUSE); } - if (!SendMessage(m_hwndToolbar, TB_GETBUTTON, index, reinterpret_cast<LPARAM>(&btn))) + if (!GetButton(wParam, &btn)) return E_FAIL; - TRACE("ChangeTrackedItem %d, %d\n", index, wasTracking); + TRACE("ChangeTrackedItem %d, %d\n", wParam, wasTracking); m_isTrackingPopup = wasTracking; return m_menuBand->_ChangeHotItem(this, btn.idCommand, mouse ? HICF_MOUSE : 0); } @@ -717,20 +684,22 @@ RECT rc = { 0 }; RECT rcx = { 0 }; - if (!SendMessage(m_hwndToolbar, TB_GETITEMRECT, index, reinterpret_cast<LPARAM>(&rc))) + if (!GetItemRect(index, &rc)) return E_FAIL; - GetWindowRect(m_hwnd, &rcx); + HWND topWnd; + GetWindow(&topWnd); + GetWindowRect(topWnd, &rcx); POINT a = { rc.left, rc.top }; POINT b = { rc.right, rc.bottom }; POINT c = { rcx.left, rcx.top }; POINT d = { rcx.right, rcx.bottom }; - ClientToScreen(m_hwndToolbar, &a); - ClientToScreen(m_hwndToolbar, &b); - ClientToScreen(m_hwnd, &c); - ClientToScreen(m_hwnd, &d); + ClientToScreen(m_hWnd, &a); + ClientToScreen(m_hWnd, &b); + ClientToScreen(topWnd, &c); + ClientToScreen(topWnd, &d); POINTL pt = { a.x, b.y }; RECTL rcl = { c.x, c.y, d.x, d.y }; @@ -755,14 +724,14 @@ // Calculate the submenu position and exclude area RECT rc = { 0 }; - if (!SendMessage(m_hwndToolbar, TB_GETITEMRECT, index, reinterpret_cast<LPARAM>(&rc))) + if (!GetItemRect(index, &rc)) return E_FAIL; POINT a = { rc.left, rc.top }; POINT b = { rc.right, rc.bottom }; - ClientToScreen(m_hwndToolbar, &a); - ClientToScreen(m_hwndToolbar, &b); + ClientToScreen(m_hWnd, &a); + ClientToScreen(m_hWnd, &b); POINT pt = { a.x, b.y }; RECT rcl = { a.x, a.y, b.x, b.y }; @@ -782,8 +751,6 @@ m_menuBand->_ChangePopupItem(NULL, -1); m_isTrackingPopup = FALSE; - m_menuBand->_ChangeHotItem(NULL, -1, 0); - return S_OK; } @@ -798,6 +765,13 @@ return m_menuBand->_TrackContextMenu(contextMenu, pt.x, pt.y); } +HRESULT CMenuToolbarBase::BeforeCancelPopup() +{ + m_cancelingPopup = TRUE; + DbgPrint("BeforeCancelPopup\n"); + return S_OK; +} + HRESULT CMenuToolbarBase::ProcessClick(INT iItem) { if (m_disableMouseTrack) @@ -828,10 +802,15 @@ { TBBUTTON btn; - if (m_initFlags & SMINIT_VERTICAL) - return S_OK; - - ::SendMessageW(m_hwndToolbar, TB_GETBUTTON, iIndex, reinterpret_cast<LPARAM>(&btn)); + if ((m_initFlags & SMINIT_VERTICAL) + || m_popupBar + || m_cancelingPopup) + { + m_cancelingPopup = FALSE; + return S_OK; + } + + GetButton(iIndex, &btn); return ProcessClick(btn.idCommand); } @@ -839,10 +818,12 @@ { TBBUTTON btn; + m_cancelingPopup = FALSE; + if (!(m_initFlags & SMINIT_VERTICAL)) return S_OK; - ::SendMessageW(m_hwndToolbar, TB_GETBUTTON, iIndex, reinterpret_cast<LPARAM>(&btn)); + GetButton(iIndex, &btn); return ProcessClick(btn.idCommand); } @@ -877,7 +858,7 @@ if (dwSelectType != 0xFFFFFFFF) { - int count = SendMessage(m_hwndToolbar, TB_BUTTONCOUNT, 0, 0); + int count = GetButtonCount(); if (dwSelectType == VK_HOME) { @@ -896,7 +877,7 @@ TBBUTTONINFO info = { 0 }; info.cbSize = sizeof(TBBUTTONINFO); info.dwMask = 0; - index = SendMessage(m_hwndToolbar, TB_GETBUTTONINFO, m_hotItem, reinterpret_cast<LPARAM>(&info)); + index = GetButtonInfo(m_hotItem, &info); } if (index < 0) @@ -926,7 +907,7 @@ TBBUTTON btn = { 0 }; while (index >= 0 && index < count) { - DWORD res = SendMessage(m_hwndToolbar, TB_GETBUTTON, index, reinterpret_cast<LPARAM>(&btn)); + DWORD res = GetButton(index, &btn); if (!res) return E_FAIL; @@ -939,8 +920,8 @@ { HWND tlw; m_menuBand->_GetTopLevelWindow(&tlw); - SendMessage(tlw, WM_CANCELMODE, 0, 0); - PostMessage(m_hwndToolbar, WM_USER_CHANGETRACKEDITEM, index, MAKELPARAM(m_isTrackingPopup, FALSE)); + SendMessageW(tlw, WM_CANCELMODE, 0, 0); + PostMessageW(m_hWnd, WM_USER_CHANGETRACKEDITEM, index, MAKELPARAM(m_isTrackingPopup, FALSE)); } else m_menuBand->_ChangeHotItem(this, btn.idCommand, 0); @@ -993,9 +974,10 @@ tbb.iBitmap = iconId; tbb.dwData = buttonData; - if (!SendMessageW(m_hwndToolbar, TB_ADDBUTTONS, 1, reinterpret_cast<LPARAM>(&tbb))) + m_hasSizes = FALSE; + + if (!AddButtons(1, &tbb)) return HRESULT_FROM_WIN32(GetLastError()); - return S_OK; } @@ -1011,7 +993,9 @@ tbb.fsStyle = BTNS_SEP; tbb.iBitmap = 0; - if (!SendMessageW(m_hwndToolbar, TB_ADDBUTTONS, 1, reinterpret_cast<LPARAM>(&tbb))) + m_hasSizes = FALSE; + + if (!AddButtons(1, &tbb)) return HRESULT_FROM_WIN32(GetLastError()); return S_OK; @@ -1020,14 +1004,16 @@ HRESULT CMenuToolbarBase::AddPlaceholder() { TBBUTTON tbb = { 0 }; - PCWSTR MenuString = L"(Empty)"; + PCWSTR MenuString = L"(Empty)"; // FIXME: Make localizable tbb.fsState = 0; tbb.fsStyle = 0; tbb.iString = (INT_PTR) MenuString; tbb.iBitmap = -1; - if (!SendMessageW(m_hwndToolbar, TB_ADDBUTTONS, 1, reinterpret_cast<LPARAM>(&tbb))) + m_hasSizes = FALSE; + + if (!AddButtons(1, &tbb)) return HRESULT_FROM_WIN32(GetLastError()); return S_OK; @@ -1035,10 +1021,11 @@ HRESULT CMenuToolbarBase::ClearToolbar() { - while (SendMessage(m_hwndToolbar, TB_DELETEBUTTON, 0, 0)) + while (DeleteButton(0)) { // empty; } + m_hasSizes = FALSE; return S_OK; } @@ -1058,7 +1045,7 @@ info.cbSize = sizeof(TBBUTTONINFO); info.dwMask = TBIF_COMMAND | TBIF_LPARAM; - int index = SendMessage(m_hwndToolbar, TB_GETBUTTONINFO, iItem, reinterpret_cast<LPARAM>(&info)); + int index = GetButtonInfo(iItem, &info); if (index < 0) return E_FAIL; Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] Tue Nov 11 01:05:39 2014 @@ -25,11 +25,11 @@ #define WM_USER_ISTRACKEDITEM (WM_APP+41) #define WM_USER_CHANGETRACKEDITEM (WM_APP+42) -class CMenuToolbarBase +class CMenuToolbarBase : + public CToolbar<DWORD_PTR> { + CContainedWindow m_pager; private: - HWND m_hwnd; // May be the pager - HWND m_hwndToolbar; HFONT m_marlett; BOOL m_useFlatMenus; WNDPROC m_SubclassOld; @@ -55,10 +55,7 @@ INT m_executeItem; DWORD_PTR m_executeData; -private: - static LRESULT CALLBACK s_SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); - - LRESULT SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); + BOOL m_cancelingPopup; public: CMenuToolbarBase(CMenuBand *menuBand, BOOL usePager); @@ -67,7 +64,7 @@ HRESULT IsWindowOwner(HWND hwnd); HRESULT CreateToolbar(HWND hwndParent, DWORD dwFlags); HRESULT GetWindow(HWND *phwnd); - HRESULT ShowWindow(BOOL fShow); + HRESULT ShowDW(BOOL fShow); HRESULT Close(); HRESULT OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult); @@ -83,9 +80,6 @@ HRESULT PrepareExecuteItem(INT iItem); HRESULT ExecuteItem(); - - HRESULT IsTrackedItem(INT index); - HRESULT ChangeTrackedItem(INT index, BOOL wasTracking, BOOL mouse); HRESULT GetSizes(SIZE* pMinSize, SIZE* pMaxSize, SIZE* pIntegralSize); HRESULT SetPosSize(int x, int y, int cx, int cy); @@ -105,6 +99,7 @@ HRESULT MenuBarMouseDown(INT iIndex); HRESULT MenuBarMouseUp(INT iIndex); HRESULT ProcessClick(INT iItem); + HRESULT BeforeCancelPopup(); protected: virtual HRESULT OnDeletingButton(const NMTOOLBAR * tb) = 0; @@ -120,16 +115,28 @@ HRESULT AddPlaceholder(); HRESULT ClearToolbar(); - HWND GetToolbar() { return m_hwndToolbar; } + HWND GetToolbar() { return m_hWnd; } private: HRESULT UpdateImageLists(); HRESULT OnPagerCalcSize(LPNMPGCALCSIZE csize); - HRESULT OnPopupTimer(DWORD timerId); HRESULT OnContextMenu(NMMOUSE * rclick); HRESULT OnCustomDraw(LPNMTBCUSTOMDRAW cdraw, LRESULT * theResult); HRESULT OnGetInfoTip(NMTBGETINFOTIP * tip); + + LRESULT IsTrackedItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT ChangeTrackedItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnWinEventWrap(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + HRESULT OnPopupTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + + BEGIN_MSG_MAP(CMenuToolbarBase) + MESSAGE_HANDLER(WM_USER_ISTRACKEDITEM, IsTrackedItem) + MESSAGE_HANDLER(WM_USER_CHANGETRACKEDITEM, ChangeTrackedItem) + MESSAGE_HANDLER(WM_COMMAND, OnWinEventWrap) + MESSAGE_HANDLER(WM_NOTIFY, OnWinEventWrap) + MESSAGE_HANDLER(WM_TIMER, OnPopupTimer) + END_MSG_MAP() }; class CMenuStaticToolbar : Modified: branches/shell-experiments/base/shell/rshell/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] Tue Nov 11 01:05:39 2014 @@ -58,7 +58,10 @@ #include <atlbase.h> #include <atlcom.h> +#include <atlwin.h> #include <undocshell.h> + +#include <rosctrls.h> #include <wine/debug.h> Modified: branches/shell-experiments/include/reactos/rosctrls.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/include/react…
============================================================================== --- branches/shell-experiments/include/reactos/rosctrls.h [iso-8859-1] (original) +++ branches/shell-experiments/include/reactos/rosctrls.h [iso-8859-1] Tue Nov 11 01:05:39 2014 @@ -253,6 +253,11 @@ return SendMessageW(TB_GETHOTITEM); } + DWORD SetHotItem(INT item) + { + return SendMessageW(TB_SETHOTITEM, item); + } + public: // Button list management methods int GetButtonCount() { @@ -261,22 +266,22 @@ DWORD GetButton(int index, TBBUTTON * btn) { - return SendMessageW(TB_GETBUTTON, index, (LPARAM) btn); + return SendMessageW(TB_GETBUTTON, index, reinterpret_cast<LPARAM>(btn)); } DWORD AddButton(TBBUTTON * btn) { - return SendMessageW(TB_ADDBUTTONS, 1, (LPARAM) btn); + return SendMessageW(TB_ADDBUTTONS, 1, reinterpret_cast<LPARAM>(btn)); } DWORD AddButtons(int count, TBBUTTON * buttons) { - return SendMessageW(TB_ADDBUTTONS, count, (LPARAM) buttons); + return SendMessageW(TB_ADDBUTTONS, count, reinterpret_cast<LPARAM>(buttons)); } DWORD InsertButton(int insertAt, TBBUTTON * btn) { - return SendMessageW(TB_INSERTBUTTON, insertAt, (LPARAM) btn); + return SendMessageW(TB_INSERTBUTTON, insertAt, reinterpret_cast<LPARAM>(btn)); } DWORD MoveButton(int oldIndex, int newIndex) @@ -291,18 +296,28 @@ DWORD GetButtonInfo(int cmdId, TBBUTTONINFO * info) { - return SendMessageW(TB_GETBUTTONINFO, cmdId, (LPARAM) info); + return SendMessageW(TB_GETBUTTONINFO, cmdId, reinterpret_cast<LPARAM>(info)); } DWORD SetButtonInfo(int cmdId, TBBUTTONINFO * info) { - return SendMessageW(TB_SETBUTTONINFO, cmdId, (LPARAM) info); + return SendMessageW(TB_SETBUTTONINFO, cmdId, reinterpret_cast<LPARAM>(info)); + } + + DWORD CheckButton(int cmdId, BOOL bCheck) + { + return SendMessageW(TB_CHECKBUTTON, cmdId, MAKELPARAM(bCheck, 0)); } public: // Layout management methods + DWORD GetButtonSize() + { + return SendMessageW(TB_GETBUTTONSIZE); + } + DWORD SetButtonSize(int w, int h) { - return SendMessageW(TB_SETBUTTONSIZE, 0, MAKELONG(w, h)); + return SendMessageW(TB_SETBUTTONSIZE, 0, MAKELPARAM(w, h)); } DWORD AutoSize() @@ -310,36 +325,56 @@ return SendMessageW(TB_AUTOSIZE); } + DWORD GetMaxSize(LPSIZE size) + { + return SendMessageW(TB_GETMAXSIZE, 0, reinterpret_cast<LPARAM>(size)); + } + + DWORD GetIdealSize(BOOL useHeight, LPSIZE size) + { + return SendMessageW(TB_GETIDEALSIZE, useHeight, reinterpret_cast<LPARAM>(size)); + } + DWORD GetMetrics(TBMETRICS * tbm) { - return SendMessageW(TB_GETMETRICS, 0, (LPARAM) tbm); + return SendMessageW(TB_GETMETRICS, 0, reinterpret_cast<LPARAM>(tbm)); } DWORD SetMetrics(TBMETRICS * tbm) { - return SendMessageW(TB_SETMETRICS, 0, (LPARAM) tbm); + return SendMessageW(TB_SETMETRICS, 0, reinterpret_cast<LPARAM>(tbm)); } DWORD GetItemRect(int index, LPRECT prcItem) { - return SendMessageW(TB_GETITEMRECT, index, (LPARAM) prcItem); + return SendMessageW(TB_GETITEMRECT, index, reinterpret_cast<LPARAM>(prcItem)); } DWORD SetRedraw(BOOL bEnable) { return SendMessageW(WM_SETREDRAW, bEnable); + } + + DWORD GetPadding() + { + return SendMessageW(TB_GETPADDING); + } + + DWORD SetPadding(int x, int y) + { + return SendMessageW(TB_SETPADDING, 0, MAKELPARAM(x, y)); } public: // Image list management methods DWORD SetImageList(HIMAGELIST himl) { - return SendMessageW(TB_SETIMAGELIST, 0, (LPARAM) himl); + return SendMessageW(TB_SETIMAGELIST, 0, reinterpret_cast<LPARAM>(himl)); } public: // Other methods INT HitTest(PPOINT ppt) { - return (INT) SendMessageW(TB_HITTEST, 0, (LPARAM) ppt); + return (INT) SendMessageW(TB_HITTEST, 0, reinterpret_cast<LPARAM>(ppt)); } public: // Utility methods
10 years, 1 month
1
0
0
0
[pschweitzer] 65372: [FASTFAT] - Implement VPB swapout in our FAT driver for dismout (see VfatCheckForDismount) - Dereference volume handles on close (not on cleanup) - Keep track of the VDO in our...
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Mon Nov 10 22:11:36 2014 New Revision: 65372 URL:
http://svn.reactos.org/svn/reactos?rev=65372&view=rev
Log: [FASTFAT] - Implement VPB swapout in our FAT driver for dismout (see VfatCheckForDismount) - Dereference volume handles on close (not on cleanup) - Keep track of the VDO in our VCB - Let VfatCheckForDismount() do the actual dismount, instead of VfatDismountVolume() which just initiates it CORE-8732 #comment Can you retry? Modified: trunk/reactos/drivers/filesystems/fastfat/cleanup.c trunk/reactos/drivers/filesystems/fastfat/close.c trunk/reactos/drivers/filesystems/fastfat/fsctl.c trunk/reactos/drivers/filesystems/fastfat/misc.c trunk/reactos/drivers/filesystems/fastfat/vfat.h Modified: trunk/reactos/drivers/filesystems/fastfat/cleanup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/cleanup.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/cleanup.c [iso-8859-1] Mon Nov 10 22:11:36 2014 @@ -38,7 +38,6 @@ if (pFcb->Flags & FCB_IS_VOLUME) { pFcb->OpenHandleCount--; - DeviceExt->OpenHandleCount--; if (pFcb->OpenHandleCount != 0) { @@ -111,6 +110,11 @@ ExReleaseResourceLite(&pFcb->MainResource); } + if (DeviceExt->Flags & VCB_DISMOUNT_PENDING) + { + VfatCheckForDismount(DeviceExt, FALSE); + } + return STATUS_SUCCESS; } Modified: trunk/reactos/drivers/filesystems/fastfat/close.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/close.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/close.c [iso-8859-1] Mon Nov 10 22:11:36 2014 @@ -75,10 +75,16 @@ FileObject->FsContext2 = NULL; FileObject->FsContext = NULL; FileObject->SectionObjectPointer = NULL; + DeviceExt->OpenHandleCount--; if (pCcb) { vfatDestroyCCB(pCcb); + } + + if (DeviceExt->OpenHandleCount == 0) + { + VfatCheckForDismount(DeviceExt, FALSE); } return Status; Modified: trunk/reactos/drivers/filesystems/fastfat/fsctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/fsctl.c [iso-8859-1] Mon Nov 10 22:11:36 2014 @@ -447,6 +447,7 @@ RtlZeroMemory(DeviceExt, ROUND_UP(sizeof(DEVICE_EXTENSION), sizeof(ULONG)) + sizeof(HASHENTRY*) * HashTableSize); DeviceExt->FcbHashTable = (HASHENTRY**)((ULONG_PTR)DeviceExt + ROUND_UP(sizeof(DEVICE_EXTENSION), sizeof(ULONG))); DeviceExt->HashTableSize = HashTableSize; + DeviceExt->VolumeDevice = DeviceObject; /* use same vpb as device disk */ DeviceObject->Vpb = Vpb; @@ -962,7 +963,6 @@ /* Mark we're being dismounted */ DeviceExt->Flags |= VCB_DISMOUNT_PENDING; - IrpContext->DeviceObject->Vpb->Flags &= ~VPB_MOUNTED; ExReleaseResourceLite(&DeviceExt->FatResource); Modified: trunk/reactos/drivers/filesystems/fastfat/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/misc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/misc.c [iso-8859-1] Mon Nov 10 22:11:36 2014 @@ -312,3 +312,90 @@ return STATUS_SUCCESS; } + +BOOLEAN +VfatCheckForDismount( + IN PDEVICE_EXTENSION DeviceExt, + IN BOOLEAN Create) +{ + KIRQL OldIrql; + PVPB Vpb; + BOOLEAN Delete; + + DPRINT1("VfatCheckForDismount(%p, %u)\n", DeviceExt, Create); + + /* Lock VPB */ + IoAcquireVpbSpinLock(&OldIrql); + + /* Reference it and check if a create is being done */ + Vpb = DeviceExt->IoVPB; + if (Vpb->ReferenceCount != Create) + { + /* Copy the VPB to our local own to prepare later dismount */ + if (DeviceExt->SpareVPB != NULL) + { + RtlZeroMemory(DeviceExt->SpareVPB, sizeof(VPB)); + DeviceExt->SpareVPB->Type = IO_TYPE_VPB; + DeviceExt->SpareVPB->Size = sizeof(VPB); + DeviceExt->SpareVPB->RealDevice = DeviceExt->IoVPB->RealDevice; + DeviceExt->SpareVPB->DeviceObject = NULL; + DeviceExt->SpareVPB->Flags = DeviceExt->IoVPB->Flags & VPB_REMOVE_PENDING; + DeviceExt->IoVPB->RealDevice->Vpb = DeviceExt->SpareVPB; + DeviceExt->SpareVPB = NULL; + DeviceExt->IoVPB->Flags |= VPB_PERSISTENT; + } + + /* Don't do anything */ + Delete = FALSE; + } + else + { + /* Otherwise, delete the volume */ + Delete = TRUE; + + /* Check if it has a VPB and unmount it */ + if (Vpb->RealDevice->Vpb == Vpb) + { + Vpb->DeviceObject = NULL; + Vpb->Flags &= ~VPB_MOUNTED; + } + } + + /* Release lock and return status */ + IoReleaseVpbSpinLock(OldIrql); + + /* If we were to delete, delete volume */ + if (Delete) + { + PVPB DelVpb; + + /* If we have a local VPB, we'll have to delete it + * but we won't dismount us - something went bad before + */ + if (DeviceExt->SpareVPB) + { + DelVpb = DeviceExt->SpareVPB; + } + /* Otherwise, dismount our device if possible */ + else + { + if (DeviceExt->IoVPB->ReferenceCount) + { + ObfDereferenceObject(DeviceExt->StorageDevice); + IoDeleteDevice(DeviceExt->VolumeDevice); + return Delete; + } + + DelVpb = DeviceExt->IoVPB; + } + + /* Delete any of the available VPB and dismount */ + ExFreePool(DelVpb); + ObfDereferenceObject(DeviceExt->StorageDevice); + IoDeleteDevice(DeviceExt->VolumeDevice); + + return Delete; + } + + return Delete; +} Modified: trunk/reactos/drivers/filesystems/fastfat/vfat.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/vfat.h [iso-8859-1] Mon Nov 10 22:11:36 2014 @@ -271,6 +271,7 @@ ULONG HashTableSize; struct _HASHENTRY **FcbHashTable; + PDEVICE_OBJECT VolumeDevice; PDEVICE_OBJECT StorageDevice; PFILE_OBJECT FATFileObject; FATINFO FatInfo; @@ -297,7 +298,7 @@ LIST_ENTRY NotifyList; PNOTIFY_SYNC NotifySync; - /* Incremented on IRP_MJ_CREATE, decremented on IRP_MJ_CLEANUP */ + /* Incremented on IRP_MJ_CREATE, decremented on IRP_MJ_CLOSE */ ULONG OpenHandleCount; /* VPBs for dismount */ @@ -928,6 +929,11 @@ IN ULONG, IN LOCK_OPERATION); +BOOLEAN +VfatCheckForDismount( + IN PDEVICE_EXTENSION DeviceExt, + IN BOOLEAN Create); + /* pnp.c */ NTSTATUS
10 years, 1 month
1
0
0
0
[jgardou] 65371: [TCPIP] - Implement setting the TTL for a socket. - Stubplement setting the IP_DONTFRAGMENT flag. - Properly set IoStatus.Information when receiving datagram. - Properly skip the I...
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Nov 10 21:37:55 2014 New Revision: 65371 URL:
http://svn.reactos.org/svn/reactos?rev=65371&view=rev
Log: [TCPIP] - Implement setting the TTL for a socket. - Stubplement setting the IP_DONTFRAGMENT flag. - Properly set IoStatus.Information when receiving datagram. - Properly skip the IP header when we're not receiving UDP datagrams Modified: branches/tcpip_revolution/drivers/network/tcpip/address.c branches/tcpip_revolution/drivers/network/tcpip/address.h branches/tcpip_revolution/drivers/network/tcpip/information.c branches/tcpip_revolution/drivers/network/tcpip/precomp.h Modified: branches/tcpip_revolution/drivers/network/tcpip/address.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/address.c [iso-8859-1] (original) +++ branches/tcpip_revolution/drivers/network/tcpip/address.c [iso-8859-1] Mon Nov 10 21:37:55 2014 @@ -55,7 +55,8 @@ LIST_ENTRY* ListEntry; RECEIVE_DATAGRAM_REQUEST* Request; ip_addr_t RequestAddr; - BOOLEAN Result = FALSE; + + DPRINT1("Receiving datagram for addr 0x%08x on port %u.\n", ip4_addr_get_u32(addr), port); /* Block any cancellation that could occur */ IoAcquireCancelSpinLock(&OldIrql); @@ -74,16 +75,26 @@ ((Request->RemoteAddress.sin_port == port) || !port))) { PTA_IP_ADDRESS ReturnAddress; + PIRP Irp; + + DPRINT1("Found a corresponding IRP.\n"); + + Irp = Request->Irp; /* We found a request for this one */ - IoSetCancelRoutine(Request->Irp, NULL); + IoSetCancelRoutine(Irp, NULL); RemoveEntryList(&Request->ListEntry); KeReleaseSpinLockFromDpcLevel(&AddressFile->RequestLock); IoReleaseCancelSpinLock(OldIrql); - /* Return what we have to */ - pbuf_copy_partial(p, Request->Buffer, Request->BufferLength, 0); + /* In case of UDP, lwip provides a pbuf directly pointing to the data. + * In other case, we must skip the IP header */ + Irp->IoStatus.Information = pbuf_copy_partial( + p, + Request->Buffer, + Request->BufferLength, + AddressFile->Protocol == IPPROTO_UDP ? 0 : IP_HLEN); ReturnAddress = Request->ReturnInfo->RemoteAddress; ReturnAddress->Address->AddressLength = TDI_ADDRESS_LENGTH_IP; ReturnAddress->Address->AddressType = TDI_ADDRESS_TYPE_IP; @@ -92,27 +103,22 @@ RtlZeroMemory(ReturnAddress->Address->Address->sin_zero, sizeof(ReturnAddress->Address->Address->sin_zero)); - Request->Irp->IoStatus.Status = STATUS_SUCCESS; - - Result = TRUE; - - IoCompleteRequest(Request->Irp, IO_NETWORK_INCREMENT); + Irp->IoStatus.Status = STATUS_SUCCESS; + IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); ExFreePoolWithTag(Request, TAG_ADDRESS_FILE); - - /* Restart from the beginning of the list */ - IoAcquireCancelSpinLock(&OldIrql); - KeAcquireSpinLockAtDpcLevel(&AddressFile->RequestLock); - ListEntry = AddressFile->RequestListHead.Flink; + pbuf_free(p); + + return TRUE; } } KeReleaseSpinLockFromDpcLevel(&AddressFile->RequestLock); IoReleaseCancelSpinLock(OldIrql); - if (Result || MustFree) + if (MustFree) pbuf_free(p); - return Result; + return FALSE; } static @@ -582,3 +588,54 @@ IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); return Status; } + +NTSTATUS +AddressSetIpDontFragment( + _In_ TDIEntityID ID, + _In_ PVOID InBuffer, + _In_ ULONG BufferSize) +{ + /* Silently ignore. + * lwip doesn't have such thing, and already tries to fragment data as less as possible */ + return STATUS_SUCCESS; +} + +NTSTATUS +AddressSetTtl( + _In_ TDIEntityID ID, + _In_ PVOID InBuffer, + _In_ ULONG BufferSize) +{ + ADDRESS_FILE* AddressFile; + TCPIP_INSTANCE* Instance; + NTSTATUS Status; + ULONG Value; + + if (BufferSize < sizeof(ULONG)) + return STATUS_BUFFER_TOO_SMALL; + + /* Get the address file */ + Status = GetInstance(ID, &Instance); + if (!NT_SUCCESS(Status)) + return Status; + + AddressFile = CONTAINING_RECORD(Instance, ADDRESS_FILE, Instance); + + /* Get the value */ + Value = *((ULONG*)InBuffer); + + switch (AddressFile->Protocol) + { + case IPPROTO_TCP: + DPRINT1("TCP not supported yet.\n"); + break; + case IPPROTO_UDP: + AddressFile->lwip_udp_pcb->ttl = Value; + break; + default: + AddressFile->lwip_raw_pcb->ttl = Value; + break; + } + + return STATUS_SUCCESS; +} Modified: branches/tcpip_revolution/drivers/network/tcpip/address.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/address.h [iso-8859-1] (original) +++ branches/tcpip_revolution/drivers/network/tcpip/address.h [iso-8859-1] Mon Nov 10 21:37:55 2014 @@ -39,3 +39,15 @@ NTSTATUS TcpIpSendDatagram( _Inout_ PIRP Irp); + +NTSTATUS +AddressSetIpDontFragment( + _In_ TDIEntityID ID, + _In_ PVOID InBuffer, + _In_ ULONG BufferSize); + +NTSTATUS +AddressSetTtl( + _In_ TDIEntityID ID, + _In_ PVOID InBuffer, + _In_ ULONG BufferSize); Modified: branches/tcpip_revolution/drivers/network/tcpip/information.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/information.c [iso-8859-1] (original) +++ branches/tcpip_revolution/drivers/network/tcpip/information.c [iso-8859-1] Mon Nov 10 21:37:55 2014 @@ -30,9 +30,11 @@ } InfoHandlers[] = { - { GENERIC_ENTITY, INFO_CLASS_GENERIC, INFO_TYPE_PROVIDER, ENTITY_LIST_ID, QueryEntityList, NULL }, - { IF_ENTITY, INFO_CLASS_PROTOCOL, INFO_TYPE_PROVIDER, IP_MIB_STATS_ID, QueryInterfaceEntry, NULL }, - { CL_NL_ENTITY, INFO_CLASS_PROTOCOL, INFO_TYPE_PROVIDER, IP_MIB_ADDRTABLE_ENTRY_ID, QueryInterfaceAddrTable, NULL }, + { GENERIC_ENTITY, INFO_CLASS_GENERIC, INFO_TYPE_PROVIDER, ENTITY_LIST_ID, QueryEntityList, NULL }, + { IF_ENTITY, INFO_CLASS_PROTOCOL, INFO_TYPE_PROVIDER, IP_MIB_STATS_ID, QueryInterfaceEntry, NULL }, + { CL_NL_ENTITY, INFO_CLASS_PROTOCOL, INFO_TYPE_PROVIDER, IP_MIB_ADDRTABLE_ENTRY_ID, QueryInterfaceAddrTable, NULL }, + { ER_ENTITY, INFO_CLASS_PROTOCOL, INFO_TYPE_ADDRESS_OBJECT, AO_OPTION_TTL, NULL, AddressSetTtl }, + { ER_ENTITY, INFO_CLASS_PROTOCOL, INFO_TYPE_ADDRESS_OBJECT, AO_OPTION_IP_DONTFRAGMENT, NULL, AddressSetIpDontFragment }, { (ULONG)-1, (ULONG)-1, (ULONG)-1, (ULONG)-1, NULL } }; Modified: branches/tcpip_revolution/drivers/network/tcpip/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/precomp.h [iso-8859-1] (original) +++ branches/tcpip_revolution/drivers/network/tcpip/precomp.h [iso-8859-1] Mon Nov 10 21:37:55 2014 @@ -18,6 +18,7 @@ #include <pseh/pseh2.h> +#include <lwip/ip.h> #include <lwip/tcpip.h> #include <lwip/snmp.h> #include <lwip/raw.h>
10 years, 1 month
1
0
0
0
[jgardou] 65370: [TCPIP] - Add skeleton code to handle IOCTL_TCP_SET_INFORMATION_EX
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Nov 10 21:37:25 2014 New Revision: 65370 URL:
http://svn.reactos.org/svn/reactos?rev=65370&view=rev
Log: [TCPIP] - Add skeleton code to handle IOCTL_TCP_SET_INFORMATION_EX Modified: branches/tcpip_revolution/drivers/network/tcpip/information.c branches/tcpip_revolution/drivers/network/tcpip/information.h branches/tcpip_revolution/drivers/network/tcpip/main.c Modified: branches/tcpip_revolution/drivers/network/tcpip/information.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/information.c [iso-8859-1] (original) +++ branches/tcpip_revolution/drivers/network/tcpip/information.c [iso-8859-1] Mon Nov 10 21:37:25 2014 @@ -16,17 +16,23 @@ _Out_opt_ PVOID OutBuffer, _Inout_ ULONG* BufferSize); +typedef NTSTATUS (*SET_INFO_HANDLER)( + _In_ TDIEntityID ID, + _In_ PVOID InBuffer, + _In_ ULONG BufferSize); + static struct { ULONG Entity, Class, Type, Id; - QUERY_INFO_HANDLER Handler; + QUERY_INFO_HANDLER QueryHandler; + SET_INFO_HANDLER SetHandler; } InfoHandlers[] = { - { GENERIC_ENTITY, INFO_CLASS_GENERIC, INFO_TYPE_PROVIDER, ENTITY_LIST_ID, QueryEntityList }, - { IF_ENTITY, INFO_CLASS_PROTOCOL, INFO_TYPE_PROVIDER, IP_MIB_STATS_ID, QueryInterfaceEntry}, - { CL_NL_ENTITY, INFO_CLASS_PROTOCOL, INFO_TYPE_PROVIDER, IP_MIB_ADDRTABLE_ENTRY_ID, QueryInterfaceAddrTable}, + { GENERIC_ENTITY, INFO_CLASS_GENERIC, INFO_TYPE_PROVIDER, ENTITY_LIST_ID, QueryEntityList, NULL }, + { IF_ENTITY, INFO_CLASS_PROTOCOL, INFO_TYPE_PROVIDER, IP_MIB_STATS_ID, QueryInterfaceEntry, NULL }, + { CL_NL_ENTITY, INFO_CLASS_PROTOCOL, INFO_TYPE_PROVIDER, IP_MIB_ADDRTABLE_ENTRY_ID, QueryInterfaceAddrTable, NULL }, { (ULONG)-1, (ULONG)-1, (ULONG)-1, (ULONG)-1, NULL } }; @@ -95,14 +101,14 @@ } /* Find the handler for this particular query */ - for (i = 0; InfoHandlers[i].Handler != NULL; i++) + for (i = 0; InfoHandlers[i].Entity != (ULONG)-1; i++) { if ((InfoHandlers[i].Entity == Query->ID.toi_entity.tei_entity) && (InfoHandlers[i].Class == Query->ID.toi_class) && (InfoHandlers[i].Type == Query->ID.toi_type) && (InfoHandlers[i].Id == Query->ID.toi_id)) { - Handler = InfoHandlers[i].Handler; + Handler = InfoHandlers[i].QueryHandler; break; } } @@ -177,3 +183,44 @@ IoCompleteRequest(Irp, IO_NETWORK_INCREMENT); return Status; } + +NTSTATUS +TcpIpSetInformation( + _Inout_ PIRP Irp +) +{ + TCP_REQUEST_SET_INFORMATION_EX* Query; + SET_INFO_HANDLER Handler = NULL; + NTSTATUS Status; + ULONG i; + + /* Get the input buffer */ + Query = Irp->AssociatedIrp.SystemBuffer; + + /* Find the handler for this particular query */ + for (i = 0; InfoHandlers[i].Entity != (ULONG)-1; i++) + { + if ((InfoHandlers[i].Entity == Query->ID.toi_entity.tei_entity) && + (InfoHandlers[i].Class == Query->ID.toi_class) && + (InfoHandlers[i].Type == Query->ID.toi_type) && + (InfoHandlers[i].Id == Query->ID.toi_id)) + { + Handler = InfoHandlers[i].SetHandler; + break; + } + } + + if (!Handler) + { + DPRINT1("TCPIP - Unknown query: entity 0x%x, class 0x%x, type 0x%x, Id 0x%x.\n", + Query->ID.toi_entity.tei_entity, Query->ID.toi_class, Query->ID.toi_type, Query->ID.toi_id); + return STATUS_NOT_IMPLEMENTED; + } + + Status = Handler(Query->ID.toi_entity, &Query->Buffer, Query->BufferSize); + + if (NT_SUCCESS(Status)) + Irp->IoStatus.Information = Query->BufferSize; + + return Status; +} Modified: branches/tcpip_revolution/drivers/network/tcpip/information.h URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/information.h [iso-8859-1] (original) +++ branches/tcpip_revolution/drivers/network/tcpip/information.h [iso-8859-1] Mon Nov 10 21:37:25 2014 @@ -10,3 +10,8 @@ TcpIpQueryKernelInformation( _In_ PIRP Irp ); + +NTSTATUS +TcpIpSetInformation( + _Inout_ PIRP Irp +); Modified: branches/tcpip_revolution/drivers/network/tcpip/main.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/drivers/networ…
============================================================================== --- branches/tcpip_revolution/drivers/network/tcpip/main.c [iso-8859-1] (original) +++ branches/tcpip_revolution/drivers/network/tcpip/main.c [iso-8859-1] Mon Nov 10 21:37:25 2014 @@ -455,8 +455,7 @@ break; case IOCTL_TCP_SET_INFORMATION_EX: - DPRINT1("TCPIP: Should handle IOCTL_TCP_SET_INFORMATION_EX.\n"); - Status = STATUS_NOT_IMPLEMENTED; + Status = TcpIpSetInformation(Irp); break; case IOCTL_SET_IP_ADDRESS:
10 years, 1 month
1
0
0
0
[akhaldi] 65369: [CMAKE][NTVDM] * There is no folder named ntvdm inside ntvdm. * Improve some inclusions (avoid ../ types).
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 10 19:47:28 2014 New Revision: 65369 URL:
http://svn.reactos.org/svn/reactos?rev=65369&view=rev
Log: [CMAKE][NTVDM] * There is no folder named ntvdm inside ntvdm. * Improve some inclusions (avoid ../ types). Modified: trunk/reactos/subsystems/ntvdm/CMakeLists.txt trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.h trunk/reactos/subsystems/ntvdm/bios/bios32/bios32p.h trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.c trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.h trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.h trunk/reactos/subsystems/ntvdm/bios/bios32/vidbios32.c trunk/reactos/subsystems/ntvdm/bios/bios32/vidbios32.h trunk/reactos/subsystems/ntvdm/hardware/vga.c Modified: trunk/reactos/subsystems/ntvdm/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/CMakeList…
============================================================================== --- trunk/reactos/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/CMakeLists.txt [iso-8859-1] Mon Nov 10 19:47:28 2014 @@ -1,8 +1,5 @@ -include_directories( - ${REACTOS_SOURCE_DIR}/include/reactos/libs/fast486 - ntvdm) - +include_directories(${REACTOS_SOURCE_DIR}/include/reactos/libs/fast486) spec2def(ntvdm.exe ntvdm.spec) list(APPEND SOURCE Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.c [iso-8859-1] Mon Nov 10 19:47:28 2014 @@ -18,8 +18,8 @@ #include "cpu/bop.h" #include "int32.h" -#include "../bios.h" -#include "../rom.h" +#include <bios/bios.h> +#include <bios/rom.h> #include "bios32.h" #include "bios32p.h" #include "kbdbios32.h" Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/bios32.h [iso-8859-1] Mon Nov 10 19:47:28 2014 @@ -12,7 +12,7 @@ /* INCLUDES *******************************************************************/ #include "ntvdm.h" -// #include "../bios.h" +// #include <bios/bios.h> /* DEFINES ********************************************************************/ Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/bios32p.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/bios32p.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/bios32p.h [iso-8859-1] Mon Nov 10 19:47:28 2014 @@ -12,7 +12,7 @@ /* INCLUDES *******************************************************************/ #include "ntvdm.h" -#include "../bios.h" +#include <bios/bios.h> /**/ #include "int32.h" /**/ Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.c [iso-8859-1] Mon Nov 10 19:47:28 2014 @@ -15,7 +15,7 @@ #include "int32.h" #include "kbdbios32.h" -#include "../kbdbios.h" +#include <bios/kbdbios.h> #include "bios32p.h" #include "io.h" Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/kbdbios32.h [iso-8859-1] Mon Nov 10 19:47:28 2014 @@ -41,6 +41,6 @@ BOOLEAN KbdBios32Initialize(VOID); VOID KbdBios32Cleanup(VOID); -#endif // _KBDBIOS32_H_ +#endif /* _KBDBIOS32_H_ */ /* EOF */ Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/moubios32.h [iso-8859-1] Mon Nov 10 19:47:28 2014 @@ -77,6 +77,6 @@ BOOLEAN MouseBios32Initialize(VOID); VOID MouseBios32Cleanup(VOID); -#endif // _MOUBIOS32_H_ +#endif /* _MOUBIOS32_H_ */ /* EOF */ Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/vidbios32.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/vidbios32.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/vidbios32.c [iso-8859-1] Mon Nov 10 19:47:28 2014 @@ -16,7 +16,7 @@ #include "int32.h" #include "vidbios32.h" -#include "../vidbios.h" +#include <bios/vidbios.h> #include "bios32p.h" /* PUBLIC FUNCTIONS ***********************************************************/ Modified: trunk/reactos/subsystems/ntvdm/bios/bios32/vidbios32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/bios/bios…
============================================================================== --- trunk/reactos/subsystems/ntvdm/bios/bios32/vidbios32.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/bios/bios32/vidbios32.h [iso-8859-1] Mon Nov 10 19:47:28 2014 @@ -24,6 +24,6 @@ BOOLEAN VidBios32Initialize(VOID); VOID VidBios32Cleanup(VOID); -#endif // _VIDBIOS32_H_ +#endif /* _VIDBIOS32_H_ */ /* EOF */ Modified: trunk/reactos/subsystems/ntvdm/hardware/vga.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/hardware/…
============================================================================== --- trunk/reactos/subsystems/ntvdm/hardware/vga.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/hardware/vga.c [iso-8859-1] Mon Nov 10 19:47:28 2014 @@ -12,7 +12,7 @@ #include "emulator.h" #include "vga.h" -#include "../bios/vidbios.h" +#include <bios/vidbios.h> #include "io.h"
10 years, 1 month
1
0
0
0
[akhaldi] 65368: [CMAKE][BOOTSECT] * Improve some inclusions (avoid ../ types).
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 10 19:21:06 2014 New Revision: 65368 URL:
http://svn.reactos.org/svn/reactos?rev=65368&view=rev
Log: [CMAKE][BOOTSECT] * Improve some inclusions (avoid ../ types). Modified: trunk/reactos/boot/freeldr/bootsect/fat.S trunk/reactos/boot/freeldr/bootsect/fat32.S trunk/reactos/boot/freeldr/bootsect/fatx.S trunk/reactos/boot/freeldr/bootsect/isoboot.S trunk/reactos/cmake/gcc.cmake trunk/reactos/cmake/msvc.cmake Modified: trunk/reactos/boot/freeldr/bootsect/fat.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/fat.…
============================================================================== --- trunk/reactos/boot/freeldr/bootsect/fat.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/bootsect/fat.S [iso-8859-1] Mon Nov 10 19:21:06 2014 @@ -39,7 +39,7 @@ // boots dramatically. #include <asm.inc> -#include "../freeldr/include/arch/pc/x86common.h" +#include <freeldr/include/arch/pc/x86common.h> #define BP_REL(x) [bp+x-offset start] Modified: trunk/reactos/boot/freeldr/bootsect/fat32.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/fat3…
============================================================================== --- trunk/reactos/boot/freeldr/bootsect/fat32.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/bootsect/fat32.S [iso-8859-1] Mon Nov 10 19:21:06 2014 @@ -9,7 +9,7 @@ /* INCLUDES ******************************************************************/ #include <asm.inc> -#include "../freeldr/include/arch/pc/x86common.h" +#include <freeldr/include/arch/pc/x86common.h> #define BP_REL(x) [bp+x-offset start] Modified: trunk/reactos/boot/freeldr/bootsect/fatx.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/fatx…
============================================================================== --- trunk/reactos/boot/freeldr/bootsect/fatx.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/bootsect/fatx.S [iso-8859-1] Mon Nov 10 19:21:06 2014 @@ -30,7 +30,7 @@ /* INCLUDES ******************************************************************/ #include <asm.inc> -#include "../freeldr/include/arch/pc/x86common.h" +#include <freeldr/include/arch/pc/x86common.h> #define ADDRESS_FOR_DIRENTRIES HEX(10000) Modified: trunk/reactos/boot/freeldr/bootsect/isoboot.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/bootsect/isob…
============================================================================== --- trunk/reactos/boot/freeldr/bootsect/isoboot.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/bootsect/isoboot.S [iso-8859-1] Mon Nov 10 19:21:06 2014 @@ -9,7 +9,7 @@ /* INCLUDES ******************************************************************/ #include <asm.inc> -#include "../freeldr/include/arch/pc/x86common.h" +#include <freeldr/include/arch/pc/x86common.h> .code16 Modified: trunk/reactos/cmake/gcc.cmake URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/gcc.cmake?rev=65368&…
============================================================================== --- trunk/reactos/cmake/gcc.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/gcc.cmake [iso-8859-1] Mon Nov 10 19:21:06 2014 @@ -404,7 +404,7 @@ add_custom_command( OUTPUT ${_object_file} - COMMAND ${CMAKE_ASM_COMPILER} -x assembler-with-cpp -o ${_object_file} -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm -D__ASM__ -c ${_asm_file} + COMMAND ${CMAKE_ASM_COMPILER} -x assembler-with-cpp -o ${_object_file} -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm -I${REACTOS_SOURCE_DIR}/boot/freeldr -D__ASM__ -c ${_asm_file} DEPENDS ${_asm_file}) add_custom_command( Modified: trunk/reactos/cmake/msvc.cmake URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/cmake/msvc.cmake?rev=65368…
============================================================================== --- trunk/reactos/cmake/msvc.cmake [iso-8859-1] (original) +++ trunk/reactos/cmake/msvc.cmake [iso-8859-1] Mon Nov 10 19:21:06 2014 @@ -367,7 +367,7 @@ add_custom_command( OUTPUT ${_temp_file} - COMMAND ${CMAKE_C_COMPILER} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm /D__ASM__ /D_USE_ML /EP /c ${_asm_file} > ${_temp_file} + COMMAND ${CMAKE_C_COMPILER} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm /I${REACTOS_SOURCE_DIR}/boot/freeldr /D__ASM__ /D_USE_ML /EP /c ${_asm_file} > ${_temp_file} DEPENDS ${_asm_file}) if(ARCH STREQUAL "arm")
10 years, 1 month
1
0
0
0
[pschweitzer] 65367: [PARTTEST] Add a dummy application that will open first disk and check first sector for MBR and then will open first partition to check for something known (& not MBR)
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Mon Nov 10 18:26:34 2014 New Revision: 65367 URL:
http://svn.reactos.org/svn/reactos?rev=65367&view=rev
Log: [PARTTEST] Add a dummy application that will open first disk and check first sector for MBR and then will open first partition to check for something known (& not MBR) Added: trunk/rostests/tests/parttest/ trunk/rostests/tests/parttest/CMakeLists.txt (with props) trunk/rostests/tests/parttest/parttest.c (with props) Added: trunk/rostests/tests/parttest/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/tests/parttest/CMakeLists…
============================================================================== --- trunk/rostests/tests/parttest/CMakeLists.txt (added) +++ trunk/rostests/tests/parttest/CMakeLists.txt [iso-8859-1] Mon Nov 10 18:26:34 2014 @@ -0,0 +1,4 @@ +add_executable(parttest parttest.c) +set_module_type(parttest win32cui) +add_importlibs(parttest ntdll msvcrt kernel32) +add_cd_file(TARGET parttest DESTINATION reactos/bin FOR all) Propchange: trunk/rostests/tests/parttest/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/tests/parttest/parttest.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/tests/parttest/parttest.c…
============================================================================== --- trunk/rostests/tests/parttest/parttest.c (added) +++ trunk/rostests/tests/parttest/parttest.c [iso-8859-1] Mon Nov 10 18:26:34 2014 @@ -0,0 +1,344 @@ +/* + * PROJECT: ReactOS partitions tests/dump + * LICENSE: LGPLv2+ - See COPYING.LIB in the top level directory + * PURPOSE: Open disk & partition trying to get information about volumes & MBR + * PROGRAMMER: Pierre Schweitzer <pierre(a)reactos.org> + */ + +#include <stdio.h> +#include <stdlib.h> +#include <winternl.h> + +#ifndef NT_SUCCESS +# define NT_SUCCESS(_Status) (((NTSTATUS)(_Status)) >= 0) +#endif + +#define SECTOR_SIZE 512 +#define BOOT_RECORD_SIGNATURE 0xAA55 + +PCWSTR DiskFormat = L"\\Device\\Harddisk%lu\\Partition%lu"; + +#include <pshpack1.h> +typedef struct { + unsigned char magic0, res0, magic1; + unsigned char OEMName[8]; + unsigned short BytesPerSector; + unsigned char SectorsPerCluster; + unsigned short ReservedSectors; + unsigned char FATCount; + unsigned short RootEntries, Sectors; + unsigned char Media; + unsigned short FATSectors, SectorsPerTrack, Heads; + unsigned long HiddenSectors, SectorsHuge; + unsigned long FATSectors32; + unsigned short ExtFlag; + unsigned short FSVersion; + unsigned long RootCluster; + unsigned short FSInfoSector; + unsigned short BootBackup; + unsigned char Res3[12]; + unsigned char Drive; + unsigned char Res4; + unsigned char ExtBootSignature; + unsigned long VolumeID; + unsigned char VolumeLabel[11], SysType[8]; + unsigned char Res2[420]; + unsigned short Signature1; +} FATBootSector, *PFATBootSector; + +typedef struct { + UCHAR Jump[3]; + UCHAR OEMID[8]; + USHORT BytesPerSector; + UCHAR SectorsPerCluster; + UCHAR Unused0[7]; + UCHAR MediaId; + UCHAR Unused1[2]; + USHORT SectorsPerTrack; + USHORT Heads; + UCHAR Unused2[4]; + UCHAR Unused3[4]; + USHORT Unknown[2]; + ULONGLONG SectorCount; + ULONGLONG MftLocation; + ULONGLONG MftMirrLocation; + CHAR ClustersPerMftRecord; + UCHAR Unused4[3]; + CHAR ClustersPerIndexRecord; + UCHAR Unused5[3]; + ULONGLONG SerialNumber; + UCHAR Checksum[4]; + UCHAR BootStrap[426]; + USHORT EndSector; +} NTFSBootSector, *PNTFSBootSector; + +typedef struct { + UCHAR BootIndicator; + UCHAR StartHead; + UCHAR StartSector; + UCHAR StartCylinder; + UCHAR SystemIndicator; + UCHAR EndHead; + UCHAR EndSector; + UCHAR EndCylinder; + ULONG SectorCountBeforePartition; + ULONG PartitionSectorCount; +} PARTITION_TABLE_ENTRY, *PPARTITION_TABLE_ENTRY; + +typedef struct { + UCHAR MasterBootRecordCodeAndData[0x1B8]; + ULONG Signature; + USHORT Reserved; + PARTITION_TABLE_ENTRY PartitionTable[4]; + USHORT MasterBootRecordMagic; +} MASTER_BOOT_RECORD, *PMASTER_BOOT_RECORD; +#include <poppack.h> + +BOOL CheckAgainstFAT(PFATBootSector Sector) +{ + if (Sector->Signature1 != 0xaa55) + { + return FALSE; + } + + if (Sector->BytesPerSector != 512 && + Sector->BytesPerSector != 1024 && + Sector->BytesPerSector != 2048 && + Sector->BytesPerSector != 4096) + { + return FALSE; + } + + if (Sector->FATCount != 1 && + Sector->FATCount != 2) + { + return FALSE; + } + + if (Sector->Media != 0xf0 && + Sector->Media != 0xf8 && + Sector->Media != 0xf9 && + Sector->Media != 0xfa && + Sector->Media != 0xfb && + Sector->Media != 0xfc && + Sector->Media != 0xfd && + Sector->Media != 0xfe && + Sector->Media != 0xff) + { + return FALSE; + } + + if (Sector->SectorsPerCluster != 1 && + Sector->SectorsPerCluster != 2 && + Sector->SectorsPerCluster != 4 && + Sector->SectorsPerCluster != 8 && + Sector->SectorsPerCluster != 16 && + Sector->SectorsPerCluster != 32 && + Sector->SectorsPerCluster != 64 && + Sector->SectorsPerCluster != 128) + { + return FALSE; + } + + if (Sector->BytesPerSector * Sector->SectorsPerCluster > 32 * 1024) + { + return FALSE; + } + + return TRUE; +} + +BOOL CheckAgainstNTFS(PNTFSBootSector Sector) +{ + ULONG k; + ULONG ClusterSize; + + /* OEMID: this field must be NTFS */ + if (RtlCompareMemory(Sector->OEMID, "NTFS ", 8) != 8) + { + return FALSE; + } + + /* Unused0: this field must be COMPLETELY null */ + for (k = 0; k < 7; k++) + { + if (Sector->Unused0[k] != 0) + { + return FALSE; + } + } + + /* Unused3: this field must be COMPLETELY null */ + for (k = 0; k < 4; k++) + { + if (Sector->Unused3[k] != 0) + { + return FALSE; + } + } + + /* Check cluster size */ + ClusterSize = Sector->BytesPerSector * Sector->SectorsPerCluster; + if (ClusterSize != 512 && ClusterSize != 1024 && + ClusterSize != 2048 && ClusterSize != 4096 && + ClusterSize != 8192 && ClusterSize != 16384 && + ClusterSize != 32768 && ClusterSize != 65536) + { + return FALSE; + } + + return TRUE; +} + +BOOL CheckAgainstMBR(PMASTER_BOOT_RECORD Sector) +{ + if (Sector->MasterBootRecordMagic != BOOT_RECORD_SIGNATURE) + { + return FALSE; + } + + return TRUE; +} + +int main(int argc, char ** argv) +{ + HANDLE FileHandle; + NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes; + IO_STATUS_BLOCK IoStatusBlock; + WCHAR Buffer[MAX_PATH]; + UNICODE_STRING Name; + PVOID Sector; + + Sector = malloc(SECTOR_SIZE); + if (Sector == NULL) + { + fprintf(stderr, "Failed allocating memory!\n"); + return 0; + } + + /* We first open disk */ + swprintf(Buffer, DiskFormat, 0, 0); + RtlInitUnicodeString(&Name, Buffer); + InitializeObjectAttributes(&ObjectAttributes, + &Name, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + Status = NtOpenFile(&FileHandle, + GENERIC_READ | SYNCHRONIZE, + &ObjectAttributes, + &IoStatusBlock, + 0, + FILE_SYNCHRONOUS_IO_NONALERT); + if (!NT_SUCCESS(Status)) + { + free(Sector); + fprintf(stderr, "Failed opening disk! %lx\n", Status); + return 0; + } + + /* Read first sector of the disk */ + Status = NtReadFile(FileHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + Sector, + SECTOR_SIZE, + NULL, + NULL); + NtClose(FileHandle); + if (!NT_SUCCESS(Status)) + { + free(Sector); + fprintf(stderr, "Failed reading sector 0! %lx\n", Status); + return 0; + } + + /* Is it FAT? */ + if (CheckAgainstFAT(Sector)) + { + printf("Sector 0 seems to be FAT boot sector\n"); + } + /* Is it NTFS? */ + else if (CheckAgainstNTFS(Sector)) + { + printf("Sector 0 seems to be NTFS boot sector\n"); + } + /* Is it MBR? */ + else if (CheckAgainstMBR(Sector)) + { + printf("Sector 0 might be MBR\n"); + } + /* We don't support anything else */ + else + { + printf("Sector 0 not recognized\n"); + } + + /* Redo it with first partition */ + swprintf(Buffer, DiskFormat, 0, 1); + RtlInitUnicodeString(&Name, Buffer); + InitializeObjectAttributes(&ObjectAttributes, + &Name, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + + Status = NtOpenFile(&FileHandle, + GENERIC_READ | SYNCHRONIZE, + &ObjectAttributes, + &IoStatusBlock, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + FILE_SYNCHRONOUS_IO_NONALERT); + if (!NT_SUCCESS(Status)) + { + free(Sector); + fprintf(stderr, "Failed opening partition! %lx\n", Status); + return 0; + } + + /* Read first sector of the partition */ + Status = NtReadFile(FileHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + Sector, + SECTOR_SIZE, + NULL, + NULL); + if (!NT_SUCCESS(Status)) + { + free(Sector); + fprintf(stderr, "Failed reading first sector of the partition! %lx\n", Status); + return 0; + } + + /* Is it FAT? */ + if (CheckAgainstFAT(Sector)) + { + printf("Seems to be a FAT partittion\n"); + } + /* Is it NTFS? */ + else if (CheckAgainstNTFS(Sector)) + { + printf("Seems to be a NTFS partition\n"); + } + /* Is it MBR? */ + else if (CheckAgainstMBR(Sector)) + { + printf("Seems to be MBR\n"); + } + /* We don't support anything else */ + else + { + printf("Not recognized\n"); + } + + free(Sector); + + return 0; +} Propchange: trunk/rostests/tests/parttest/parttest.c ------------------------------------------------------------------------------ svn:eol-style = native
10 years, 1 month
1
0
0
0
[jgardou] 65366: [LWIP] - Remove last bits of old tcpip implementation
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Nov 10 18:06:30 2014 New Revision: 65366 URL:
http://svn.reactos.org/svn/reactos?rev=65366&view=rev
Log: [LWIP] - Remove last bits of old tcpip implementation Modified: branches/tcpip_revolution/lib/drivers/lwip/src/sys_arch.c Modified: branches/tcpip_revolution/lib/drivers/lwip/src/sys_arch.c URL:
http://svn.reactos.org/svn/reactos/branches/tcpip_revolution/lib/drivers/lw…
============================================================================== --- branches/tcpip_revolution/lib/drivers/lwip/src/sys_arch.c [iso-8859-1] (original) +++ branches/tcpip_revolution/lib/drivers/lwip/src/sys_arch.c [iso-8859-1] Mon Nov 10 18:06:30 2014 @@ -10,8 +10,6 @@ static KSPIN_LOCK ThreadListLock; KEVENT TerminationEvent; -NPAGED_LOOKASIDE_LIST MessageLookasideList; -NPAGED_LOOKASIDE_LIST QueueEntryLookasideList; static LARGE_INTEGER StartTime; @@ -340,7 +338,4 @@ ZwClose(Container->Handle); } } - - ExDeleteNPagedLookasideList(&MessageLookasideList); - ExDeleteNPagedLookasideList(&QueueEntryLookasideList); -} +}
10 years, 1 month
1
0
0
0
← Newer
1
...
14
15
16
17
18
19
20
...
38
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
Results per page:
10
25
50
100
200