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 2013
----- 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
16 participants
348 discussions
Start a n
N
ew thread
[hbelusca] 60889: [NTVDM] - BIOS: Implement INT 12h (BiosGetMemorySize) - BOP/DOS: Add some DPRINTs for INT 25h, 2Fh and for unimplemented functions of INT 21h. It's for helping in testing 4DOS.COM
by hbelusca@svn.reactos.org
Author: hbelusca Date: Fri Nov 8 23:15:58 2013 New Revision: 60889 URL:
http://svn.reactos.org/svn/reactos?rev=60889&view=rev
Log: [NTVDM] - BIOS: Implement INT 12h (BiosGetMemorySize) - BOP/DOS: Add some DPRINTs for INT 25h, 2Fh and for unimplemented functions of INT 21h. It's for helping in testing
4DOS.COM
Modified: branches/ntvdm/subsystems/ntvdm/bios.c branches/ntvdm/subsystems/ntvdm/bios.h branches/ntvdm/subsystems/ntvdm/bop.c branches/ntvdm/subsystems/ntvdm/dos.c Modified: branches/ntvdm/subsystems/ntvdm/bios.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.c?r…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] Fri Nov 8 23:15:58 2013 @@ -467,6 +467,13 @@ /* Initialize the BDA */ Bda = (PBIOS_DATA_AREA)SEG_OFF_TO_PTR(BDA_SEGMENT, 0); Bda->EquipmentList = BIOS_EQUIPMENT_LIST; + /* + * Conventional memory size is 640 kB, + * see:
http://webpages.charter.net/danrollins/techhelp/0184.HTM
+ * and see Ralf Brown:
http://www.ctyme.com/intr/rb-0598.htm
+ * for more information. + */ + Bda->MemorySize = 0x0280; Bda->KeybdBufferStart = FIELD_OFFSET(BIOS_DATA_AREA, KeybdBuffer); Bda->KeybdBufferEnd = Bda->KeybdBufferStart + BIOS_KBD_BUFFER_SIZE * sizeof(WORD); @@ -1294,6 +1301,12 @@ { /* Return the equipment list */ setAX(Bda->EquipmentList); +} + +VOID BiosGetMemorySize(LPWORD Stack) +{ + /* Return the conventional memory size in kB, typically 640 kB */ + setAX(Bda->MemorySize); } VOID BiosHandleIrq(BYTE IrqNumber, LPWORD Stack) Modified: branches/ntvdm/subsystems/ntvdm/bios.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.h?r…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios.h [iso-8859-1] Fri Nov 8 23:15:58 2013 @@ -26,6 +26,7 @@ #define BIOS_VIDEO_INTERRUPT 0x10 #define BIOS_EQUIPMENT_INTERRUPT 0x11 +#define BIOS_MEMORY_SIZE 0x12 #define BIOS_KBD_INTERRUPT 0x16 #define BIOS_TIME_INTERRUPT 0x1A #define BIOS_SYS_TIMER_INTERRUPT 0x1C @@ -131,6 +132,7 @@ VOID BiosSetCursorPosition(BYTE Row, BYTE Column, BYTE Page); VOID BiosVideoService(LPWORD Stack); VOID BiosEquipmentService(LPWORD Stack); +VOID BiosGetMemorySize(LPWORD Stack); VOID BiosKeyboardService(LPWORD Stack); VOID BiosTimeService(LPWORD Stack); VOID BiosHandleIrq(BYTE IrqNumber, LPWORD Stack); Modified: branches/ntvdm/subsystems/ntvdm/bop.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bop.c?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bop.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bop.c [iso-8859-1] Fri Nov 8 23:15:58 2013 @@ -19,6 +19,7 @@ //#include "pic.h" //#include "ps2.h" //#include "timer.h" +#include "registers.h" LPCWSTR ExceptionName[] = { @@ -376,6 +377,12 @@ BiosEquipmentService(Stack); break; } + case BIOS_MEMORY_SIZE: + { + /* This is the BIOS "get memory size" command, call the BIOS */ + BiosGetMemorySize(Stack); + break; + } case BIOS_KBD_INTERRUPT: { /* This is the keyboard BIOS interrupt, call the BIOS */ @@ -407,6 +414,13 @@ case 0x23: { DosBreakInterrupt(Stack); + break; + } + case 0x2F: + { + DPRINT1("DOS System Function INT 0x2F, AH = %xh, AL = %xh NOT IMPLEMENTED!\n", + getAH(), getAL()); + Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; break; } default: Modified: branches/ntvdm/subsystems/ntvdm/dos.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos.c?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] Fri Nov 8 23:15:58 2013 @@ -1691,6 +1691,7 @@ case 0x25: { DWORD FarPointer = MAKELONG(getDX(), getDS()); + DPRINT1("Setting interrupt 0x%x ...\n", getAL()); /* Write the new far pointer to the IDT */ ((PDWORD)BaseAddress)[getAL()] = FarPointer; @@ -2393,7 +2394,8 @@ /* Unsupported */ default: { - DPRINT1("DOS Function INT 0x21, AH = 0x%02X NOT IMPLEMENTED!\n", getAH()); + DPRINT1("DOS Function INT 0x21, AH = %xh, AL = %xh NOT IMPLEMENTED!\n", + getAH(), getAL()); Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; } }
11 years, 1 month
1
0
0
0
[aandrejevic] 60888: [NTVDM] For better visibility, double the screen size if the resolution is too low.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Fri Nov 8 21:56:30 2013 New Revision: 60888 URL:
http://svn.reactos.org/svn/reactos?rev=60888&view=rev
Log: [NTVDM] For better visibility, double the screen size if the resolution is too low. Modified: branches/ntvdm/subsystems/ntvdm/vga.c branches/ntvdm/subsystems/ntvdm/vga.h Modified: branches/ntvdm/subsystems/ntvdm/vga.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vga.c?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] Fri Nov 8 21:56:30 2013 @@ -92,6 +92,7 @@ static HANDLE GraphicsConsoleBuffer = NULL; static HANDLE ConsoleMutex = NULL; static HPALETTE PaletteHandle = NULL; +static BOOLEAN DoubleVision = FALSE; static BYTE VgaLatchRegisters[VGA_NUM_BANKS] = {0, 0, 0, 0}; static BYTE VgaMiscRegister; @@ -439,6 +440,13 @@ BYTE BitmapInfoBuffer[VGA_BITMAP_INFO_SIZE]; LPBITMAPINFO BitmapInfo = (LPBITMAPINFO)BitmapInfoBuffer; LPWORD PaletteIndex = (LPWORD)(BitmapInfo->bmiColors); + + if ((Resolution->X < VGA_MINIMUM_WIDTH) && (Resolution->Y < VGA_MINIMUM_HEIGHT)) + { + DoubleVision = TRUE; + Resolution->X *= 2; + Resolution->Y *= 2; + } /* Fill the bitmap info header */ ZeroMemory(&BitmapInfo->bmiHeader, sizeof(BITMAPINFOHEADER)); @@ -500,6 +508,7 @@ ConsoleMutex = NULL; CloseHandle(GraphicsConsoleBuffer); GraphicsConsoleBuffer = NULL; + DoubleVision = FALSE; } static BOOL VgaEnterTextMode(PCOORD Resolution) @@ -738,14 +747,32 @@ PixelData = VgaAcRegisters[PixelData]; } - /* Now check if the resulting pixel data has changed */ - if (GraphicsBuffer[i * Resolution.X + j] != PixelData) + if (DoubleVision) { - /* Yes, write the new value */ - GraphicsBuffer[i * Resolution.X + j] = PixelData; - - /* Mark the specified pixel as changed */ - VgaMarkForUpdate(i, j); + /* Now check if the resulting pixel data has changed */ + if (GraphicsBuffer[(i * Resolution.X * 4) + (j * 2)] != PixelData) + { + /* Yes, write the new value */ + GraphicsBuffer[(i * Resolution.X * 4) + (j * 2)] = PixelData; + GraphicsBuffer[(i * Resolution.X * 4) + (j * 2 + 1)] = PixelData; + GraphicsBuffer[((i * 2 + 1) * Resolution.X * 2) + (j * 2)] = PixelData; + GraphicsBuffer[((i * 2 + 1) * Resolution.X * 2) + (j * 2 + 1)] = PixelData; + + /* Mark the specified pixel as changed */ + VgaMarkForUpdate(i, j); + } + } + else + { + /* Now check if the resulting pixel data has changed */ + if (GraphicsBuffer[i * Resolution.X + j] != PixelData) + { + /* Yes, write the new value */ + GraphicsBuffer[i * Resolution.X + j] = PixelData; + + /* Mark the specified pixel as changed */ + VgaMarkForUpdate(i, j); + } } } @@ -952,6 +979,15 @@ Resolution, Origin, &UpdateRectangle); + } + + if (DoubleVision) + { + /* Scale the update rectangle */ + UpdateRectangle.Left *= 2; + UpdateRectangle.Top *= 2; + UpdateRectangle.Right = UpdateRectangle.Right * 2 + 1; + UpdateRectangle.Bottom = UpdateRectangle.Bottom * 2 + 1; } /* Redraw the screen */ Modified: branches/ntvdm/subsystems/ntvdm/vga.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vga.h?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/vga.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/vga.h [iso-8859-1] Fri Nov 8 21:56:30 2013 @@ -38,6 +38,8 @@ #define VGA_MAX_COLORS 256 #define VGA_PALETTE_SIZE (VGA_MAX_COLORS * 3) #define VGA_BITMAP_INFO_SIZE (sizeof(BITMAPINFOHEADER) + 2 * (VGA_PALETTE_SIZE / 3)) +#define VGA_MINIMUM_WIDTH 400 +#define VGA_MINIMUM_HEIGHT 300 #define VGA_DAC_TO_COLOR(x) (((x) << 2) | ((x) >> 6)) #define VGA_COLOR_TO_DAC(x) ((x) >> 2)
11 years, 1 month
1
0
0
0
[hbelusca] 60887: [NTVDM]: Further modularize initialization/resetting of the VGA palette code.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Fri Nov 8 20:06:10 2013 New Revision: 60887 URL:
http://svn.reactos.org/svn/reactos?rev=60887&view=rev
Log: [NTVDM]: Further modularize initialization/resetting of the VGA palette code. Modified: branches/ntvdm/subsystems/ntvdm/vga.c Modified: branches/ntvdm/subsystems/ntvdm/vga.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vga.c?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] Fri Nov 8 20:06:10 2013 @@ -381,6 +381,57 @@ } } +static VOID VgaRestoreDefaultPalette(PPALETTEENTRY Entries, USHORT NumOfEntries) +{ + USHORT i; + + /* Copy the colors of the default palette to the DAC and console palette */ + for (i = 0; i < NumOfEntries; i++) + { + /* Set the palette entries */ + Entries[i].peRed = GetRValue(VgaDefaultPalette[i]); + Entries[i].peGreen = GetGValue(VgaDefaultPalette[i]); + Entries[i].peBlue = GetBValue(VgaDefaultPalette[i]); + Entries[i].peFlags = 0; + + /* Set the DAC registers */ + VgaDacRegisters[i * 3] = VGA_COLOR_TO_DAC(GetRValue(VgaDefaultPalette[i])); + VgaDacRegisters[i * 3 + 1] = VGA_COLOR_TO_DAC(GetGValue(VgaDefaultPalette[i])); + VgaDacRegisters[i * 3 + 2] = VGA_COLOR_TO_DAC(GetBValue(VgaDefaultPalette[i])); + } +} + +static BOOLEAN VgaInitializePalette(VOID) +{ + LPLOGPALETTE Palette; + + /* Allocate storage space for the palette */ + Palette = (LPLOGPALETTE)HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(LOGPALETTE) + + VGA_MAX_COLORS * sizeof(PALETTEENTRY)); + if (Palette == NULL) return FALSE; + + /* Initialize the palette */ + Palette->palVersion = 0x0300; + Palette->palNumEntries = VGA_MAX_COLORS; + + /* Restore the default palette */ + VgaRestoreDefaultPalette(Palette->palPalEntry, Palette->palNumEntries); + + /* Create the palette */ + PaletteHandle = CreatePalette(Palette); + + /* Free the palette */ + HeapFree(GetProcessHeap(), 0, Palette); + + /* Fail if the palette wasn't successfully created... */ + if (PaletteHandle == NULL) return FALSE; + + /* ... otherwise return success */ + return TRUE; +} + static BOOL VgaEnterGraphicsMode(PCOORD Resolution) { DWORD i; @@ -472,8 +523,8 @@ * Set the text mode palette. * * WARNING: This call should fail on Windows (and therefore - * we get the default palette and we our external behaviour - * is just like Windows' one), but should success on ReactOS + * we get the default palette and our external behaviour is + * just like Windows' one), but it should success on ReactOS * (so that we get console palette changes even for text-mode * screen-buffers, which is a new feature on ReactOS). */ @@ -1197,23 +1248,10 @@ VOID VgaResetPalette(VOID) { - INT i; PALETTEENTRY Entries[VGA_MAX_COLORS]; - /* Copy the colors of the default palette to the DAC and console palette */ - for (i = 0; i < VGA_MAX_COLORS; i++) - { - /* Set the palette entries */ - Entries[i].peRed = GetRValue(VgaDefaultPalette[i]); - Entries[i].peGreen = GetGValue(VgaDefaultPalette[i]); - Entries[i].peBlue = GetBValue(VgaDefaultPalette[i]); - Entries[i].peFlags = 0; - - /* Set the DAC registers */ - VgaDacRegisters[i * 3] = VGA_COLOR_TO_DAC(GetRValue(VgaDefaultPalette[i])); - VgaDacRegisters[i * 3 + 1] = VGA_COLOR_TO_DAC(GetGValue(VgaDefaultPalette[i])); - VgaDacRegisters[i * 3 + 2] = VGA_COLOR_TO_DAC(GetBValue(VgaDefaultPalette[i])); - } + /* Restore the default palette */ + VgaRestoreDefaultPalette(Entries, VGA_MAX_COLORS); SetPaletteEntries(PaletteHandle, 0, VGA_MAX_COLORS, Entries); PaletteChanged = TRUE; @@ -1230,42 +1268,9 @@ PCHAR_INFO CharBuffer; DWORD Address = 0; DWORD CurrentAddr; - LPLOGPALETTE Palette; - - /* Allocate storage space for the palette */ - Palette = (LPLOGPALETTE)HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, - sizeof(LOGPALETTE) + - VGA_MAX_COLORS * sizeof(PALETTEENTRY)); - if (Palette == NULL) return FALSE; - - /* Initialize the palette */ - Palette->palVersion = 0x0300; - Palette->palNumEntries = VGA_MAX_COLORS; - - /* Copy the colors of the default palette to the DAC and console palette */ - for (i = 0; i < VGA_MAX_COLORS; i++) - { - /* Set the palette entries */ - Palette->palPalEntry[i].peRed = GetRValue(VgaDefaultPalette[i]); - Palette->palPalEntry[i].peGreen = GetGValue(VgaDefaultPalette[i]); - Palette->palPalEntry[i].peBlue = GetBValue(VgaDefaultPalette[i]); - Palette->palPalEntry[i].peFlags = 0; - - /* Set the DAC registers */ - VgaDacRegisters[i * 3] = VGA_COLOR_TO_DAC(GetRValue(VgaDefaultPalette[i])); - VgaDacRegisters[i * 3 + 1] = VGA_COLOR_TO_DAC(GetGValue(VgaDefaultPalette[i])); - VgaDacRegisters[i * 3 + 2] = VGA_COLOR_TO_DAC(GetBValue(VgaDefaultPalette[i])); - } - - /* Create the palette */ - PaletteHandle = CreatePalette(Palette); - - /* Free the palette */ - HeapFree(GetProcessHeap(), 0, Palette); - - /* Fail if the palette wasn't successfully created */ - if (PaletteHandle == NULL) return FALSE; + + /* Initialize the VGA palette and fail if it isn't successfully created */ + if (!VgaInitializePalette()) return FALSE; /* Set the global handle */ TextConsoleBuffer = TextHandle;
11 years, 1 month
1
0
0
0
[aandrejevic] 60886: [NTVDM] Implement the use of palettes for text mode. Adapted from a patch by Hermes Belusca-Maito. Reset the palette during every BIOS video mode switch.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Fri Nov 8 19:30:58 2013 New Revision: 60886 URL:
http://svn.reactos.org/svn/reactos?rev=60886&view=rev
Log: [NTVDM] Implement the use of palettes for text mode. Adapted from a patch by Hermes Belusca-Maito. Reset the palette during every BIOS video mode switch. Modified: branches/ntvdm/subsystems/ntvdm/bios.c branches/ntvdm/subsystems/ntvdm/vga.c branches/ntvdm/subsystems/ntvdm/vga.h Modified: branches/ntvdm/subsystems/ntvdm/bios.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/bios.c?r…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/bios.c [iso-8859-1] Fri Nov 8 19:30:58 2013 @@ -415,6 +415,9 @@ VgaWritePort(VGA_AC_WRITE, *(Values++)); } + /* Reset the palette */ + VgaResetPalette(); + /* Update the values in the BDA */ Bda->VideoMode = ModeNumber; Bda->VideoPage = 0; Modified: branches/ntvdm/subsystems/ntvdm/vga.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vga.c?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/vga.c [iso-8859-1] Fri Nov 8 19:30:58 2013 @@ -373,6 +373,12 @@ /* Save the value */ VgaAcRegisters[VgaAcIndex] = Data; + + if (VgaAcIndex <= VGA_AC_PAL_F_REG) + { + /* Set the palette change flag */ + PaletteChanged = TRUE; + } } static BOOL VgaEnterGraphicsMode(PCOORD Resolution) @@ -461,6 +467,19 @@ VdmRunning = FALSE; return FALSE; } + + /* + * Set the text mode palette. + * + * WARNING: This call should fail on Windows (and therefore + * we get the default palette and we our external behaviour + * is just like Windows' one), but should success on ReactOS + * (so that we get console palette changes even for text-mode + * screen-buffers, which is a new feature on ReactOS). + */ + SetConsolePalette(TextConsoleBuffer, + PaletteHandle, + SYSPAL_NOSTATIC256); /* Set the text mode flag */ TextMode = TRUE; @@ -826,6 +845,7 @@ VOID VgaRefreshDisplay(VOID) { + HANDLE ConsoleBufferHandle = NULL; COORD Resolution = VgaGetDisplayResolution(); DPRINT("VgaRefreshDisplay\n"); @@ -838,15 +858,12 @@ if (PaletteChanged) { - if (VgaGcRegisters[VGA_GC_MISC_REG] & VGA_GC_MISC_NOALPHA) - { - /* Trigger a full update of the screen */ - NeedsUpdate = TRUE; - UpdateRectangle.Left = 0; - UpdateRectangle.Top = 0; - UpdateRectangle.Right = Resolution.X; - UpdateRectangle.Bottom = Resolution.Y; - } + /* Trigger a full update of the screen */ + NeedsUpdate = TRUE; + UpdateRectangle.Left = 0; + UpdateRectangle.Top = 0; + UpdateRectangle.Right = Resolution.X; + UpdateRectangle.Bottom = Resolution.Y; PaletteChanged = FALSE; } @@ -870,14 +887,13 @@ if (VgaGcRegisters[VGA_GC_MISC_REG] & VGA_GC_MISC_NOALPHA) { /* Graphics mode */ - - /* Redraw the screen */ - InvalidateConsoleDIBits(GraphicsConsoleBuffer, &UpdateRectangle); + ConsoleBufferHandle = GraphicsConsoleBuffer; } else { /* Text mode */ COORD Origin = { UpdateRectangle.Left, UpdateRectangle.Top }; + ConsoleBufferHandle = TextConsoleBuffer; /* Write the data to the console */ WriteConsoleOutputA(TextConsoleBuffer, @@ -885,8 +901,10 @@ Resolution, Origin, &UpdateRectangle); - - } + } + + /* Redraw the screen */ + InvalidateConsoleDIBits(ConsoleBufferHandle, &UpdateRectangle); /* Clear the update flag */ NeedsUpdate = FALSE; @@ -1177,6 +1195,30 @@ ZeroMemory(VgaMemory, sizeof(VgaMemory)); } +VOID VgaResetPalette(VOID) +{ + INT i; + PALETTEENTRY Entries[VGA_MAX_COLORS]; + + /* Copy the colors of the default palette to the DAC and console palette */ + for (i = 0; i < VGA_MAX_COLORS; i++) + { + /* Set the palette entries */ + Entries[i].peRed = GetRValue(VgaDefaultPalette[i]); + Entries[i].peGreen = GetGValue(VgaDefaultPalette[i]); + Entries[i].peBlue = GetBValue(VgaDefaultPalette[i]); + Entries[i].peFlags = 0; + + /* Set the DAC registers */ + VgaDacRegisters[i * 3] = VGA_COLOR_TO_DAC(GetRValue(VgaDefaultPalette[i])); + VgaDacRegisters[i * 3 + 1] = VGA_COLOR_TO_DAC(GetGValue(VgaDefaultPalette[i])); + VgaDacRegisters[i * 3 + 2] = VGA_COLOR_TO_DAC(GetBValue(VgaDefaultPalette[i])); + } + + SetPaletteEntries(PaletteHandle, 0, VGA_MAX_COLORS, Entries); + PaletteChanged = TRUE; +} + BOOLEAN VgaInitialize(HANDLE TextHandle) { INT i, j; @@ -1190,6 +1232,41 @@ DWORD CurrentAddr; LPLOGPALETTE Palette; + /* Allocate storage space for the palette */ + Palette = (LPLOGPALETTE)HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(LOGPALETTE) + + VGA_MAX_COLORS * sizeof(PALETTEENTRY)); + if (Palette == NULL) return FALSE; + + /* Initialize the palette */ + Palette->palVersion = 0x0300; + Palette->palNumEntries = VGA_MAX_COLORS; + + /* Copy the colors of the default palette to the DAC and console palette */ + for (i = 0; i < VGA_MAX_COLORS; i++) + { + /* Set the palette entries */ + Palette->palPalEntry[i].peRed = GetRValue(VgaDefaultPalette[i]); + Palette->palPalEntry[i].peGreen = GetGValue(VgaDefaultPalette[i]); + Palette->palPalEntry[i].peBlue = GetBValue(VgaDefaultPalette[i]); + Palette->palPalEntry[i].peFlags = 0; + + /* Set the DAC registers */ + VgaDacRegisters[i * 3] = VGA_COLOR_TO_DAC(GetRValue(VgaDefaultPalette[i])); + VgaDacRegisters[i * 3 + 1] = VGA_COLOR_TO_DAC(GetGValue(VgaDefaultPalette[i])); + VgaDacRegisters[i * 3 + 2] = VGA_COLOR_TO_DAC(GetBValue(VgaDefaultPalette[i])); + } + + /* Create the palette */ + PaletteHandle = CreatePalette(Palette); + + /* Free the palette */ + HeapFree(GetProcessHeap(), 0, Palette); + + /* Fail if the palette wasn't successfully created */ + if (PaletteHandle == NULL) return FALSE; + /* Set the global handle */ TextConsoleBuffer = TextHandle; @@ -1235,40 +1312,8 @@ Address += ScanlineSize; } - /* Allocate storage space for the palette */ - Palette = (LPLOGPALETTE)HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, - sizeof(LOGPALETTE) - + VGA_MAX_COLORS * sizeof(PALETTEENTRY)); - if (Palette == NULL) return FALSE; - - /* Initialize the palette */ - Palette->palVersion = 0x0300; - Palette->palNumEntries = VGA_MAX_COLORS; - - /* Copy the colors of the default palette to the DAC and console palette */ - for (i = 0; i < VGA_MAX_COLORS; i++) - { - /* Set the palette entries */ - Palette->palPalEntry[i].peRed = GetRValue(VgaDefaultPalette[i]); - Palette->palPalEntry[i].peGreen = GetGValue(VgaDefaultPalette[i]); - Palette->palPalEntry[i].peBlue = GetBValue(VgaDefaultPalette[i]); - Palette->palPalEntry[i].peFlags = 0; - - /* Set the DAC registers */ - VgaDacRegisters[i * 3] = VGA_COLOR_TO_DAC(GetRValue(VgaDefaultPalette[i])); - VgaDacRegisters[i * 3 + 1] = VGA_COLOR_TO_DAC(GetGValue(VgaDefaultPalette[i])); - VgaDacRegisters[i * 3 + 2] = VGA_COLOR_TO_DAC(GetBValue(VgaDefaultPalette[i])); - } - - /* Create the palette */ - PaletteHandle = CreatePalette(Palette); - - /* Free the palette */ - HeapFree(GetProcessHeap(), 0, Palette); - - /* Return success if the palette was successfully created */ - return (PaletteHandle ? TRUE : FALSE); + /* Return success */ + return TRUE; } /* EOF */ Modified: branches/ntvdm/subsystems/ntvdm/vga.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/vga.h?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/vga.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/vga.h [iso-8859-1] Fri Nov 8 19:30:58 2013 @@ -200,6 +200,7 @@ BYTE VgaReadPort(WORD Port); VOID VgaWritePort(WORD Port, BYTE Data); VOID VgaClearMemory(VOID); +VOID VgaResetPalette(VOID); BOOLEAN VgaInitialize(HANDLE TextHandle); #endif // _VGA_H_
11 years, 1 month
1
0
0
0
[hbelusca] 60885: [CONSRV]: Make changing the console palette for text buffers working properly (needed for NTVDM).
by hbelusca@svn.reactos.org
Author: hbelusca Date: Fri Nov 8 17:59:04 2013 New Revision: 60885 URL:
http://svn.reactos.org/svn/reactos?rev=60885&view=rev
Log: [CONSRV]: Make changing the console palette for text buffers working properly (needed for NTVDM). Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] Fri Nov 8 17:59:04 2013 @@ -21,6 +21,17 @@ /* FUNCTIONS ******************************************************************/ + +COLORREF RGBFromAttrib2(PCONSOLE Console, WORD Attribute) +{ + HPALETTE hPalette = Console->ActiveBuffer->PaletteHandle; + PALETTEENTRY pe; + + if (hPalette == NULL) return RGBFromAttrib(Console, Attribute); + + GetPaletteEntries(hPalette, Attribute, 1, &pe); + return PALETTERGB(pe.peRed, pe.peGreen, pe.peBlue); +} VOID GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer) @@ -217,8 +228,8 @@ LastAttribute = ConioCoordToPointer(Buffer, LeftChar, TopLine)->Attributes; - SetTextColor(GuiData->hMemDC, RGBFromAttrib(Console, TextAttribFromAttrib(LastAttribute))); - SetBkColor(GuiData->hMemDC, RGBFromAttrib(Console, BkgdAttribFromAttrib(LastAttribute))); + SetTextColor(GuiData->hMemDC, RGBFromAttrib2(Console, TextAttribFromAttrib(LastAttribute))); + SetBkColor(GuiData->hMemDC, RGBFromAttrib2(Console, BkgdAttribFromAttrib(LastAttribute))); OldFont = SelectObject(GuiData->hMemDC, GuiData->Font); @@ -247,8 +258,8 @@ Attribute = From->Attributes; if (Attribute != LastAttribute) { - SetTextColor(GuiData->hMemDC, RGBFromAttrib(Console, TextAttribFromAttrib(Attribute))); - SetBkColor(GuiData->hMemDC, RGBFromAttrib(Console, BkgdAttribFromAttrib(Attribute))); + SetTextColor(GuiData->hMemDC, RGBFromAttrib2(Console, TextAttribFromAttrib(Attribute))); + SetBkColor(GuiData->hMemDC, RGBFromAttrib2(Console, BkgdAttribFromAttrib(Attribute))); LastAttribute = Attribute; } } @@ -280,7 +291,7 @@ Attribute = ConioCoordToPointer(Buffer, Buffer->CursorPosition.X, Buffer->CursorPosition.Y)->Attributes; if (Attribute == DEFAULT_SCREEN_ATTRIB) Attribute = Buffer->ScreenDefaultAttrib; - CursorBrush = CreateSolidBrush(RGBFromAttrib(Console, Attribute)); + CursorBrush = CreateSolidBrush(RGBFromAttrib2(Console, TextAttribFromAttrib(Attribute))); OldBrush = SelectObject(GuiData->hMemDC, CursorBrush); PatBlt(GuiData->hMemDC,
11 years, 1 month
1
0
0
0
[jimtabor] 60884: - Fix the broken references.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Fri Nov 8 13:28:43 2013 New Revision: 60884 URL:
http://svn.reactos.org/svn/reactos?rev=60884&view=rev
Log: - Fix the broken references. Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.c Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgque…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] Fri Nov 8 13:28:43 2013 @@ -631,7 +631,11 @@ } else { - //if (!IntGetCaptureWindow()) ptiLastInput = pti; + if (!IntGetCaptureWindow()) + { + // ERR("ptiLastInput is set\n"); + // ptiLastInput = pti; // Once this is set during Reboot or Shutdown, this prevents the exit window having foreground. + } TRACE("Posting mouse message to hwnd=%p!\n", UserHMGetHandle(pwnd)); MsqPostMessage(pti, Msg, TRUE, QS_MOUSEBUTTON, 0); } @@ -1104,8 +1108,6 @@ { PVOID WaitObjects[3]; - ObReferenceObject(ptirec->pEThread); - WaitObjects[0] = &CompletionEvent; // Wait 0 WaitObjects[1] = pti->pEventQueueServer; // Wait 1 WaitObjects[2] = ptirec->pEThread; // Wait 2 @@ -1162,14 +1164,10 @@ TRACE("MsqSendMessage timed out 2\n"); break; } - /*if (WaitStatus == STATUS_WAIT_1) + // Receiving thread passed on and left us hanging with issues still pending. + if ( WaitStatus == STATUS_WAIT_2 ) { - ERR("Event hit\n"); - }*/ - // Receiving thread passed on and left us hanging with issues still pending. - if (WaitStatus == STATUS_WAIT_2) - { - ERR("Thread woken up dead!\n"); + ERR("Receiving Thread woken up dead!\n"); Entry = pti->DispatchingMessagesHead.Flink; while (Entry != &pti->DispatchingMessagesHead) { @@ -1189,11 +1187,10 @@ ; } while (NT_SUCCESS(WaitStatus) && WaitStatus == STATUS_WAIT_1); - ObDereferenceObject(ptirec->pEThread); } if(WaitStatus != STATUS_TIMEOUT) - *uResult = (STATUS_WAIT_0 == WaitStatus ? Result : -1); + if (uResult) *uResult = (STATUS_WAIT_0 == WaitStatus ? Result : -1); return WaitStatus; }
11 years, 1 month
1
0
0
0
[jimtabor] 60883: [Win32k] - Add support for receiving message thread death, no real tests are available at this time.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Fri Nov 8 02:17:05 2013 New Revision: 60883 URL:
http://svn.reactos.org/svn/reactos?rev=60883&view=rev
Log: [Win32k] - Add support for receiving message thread death, no real tests are available at this time. Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.c Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgque…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] Fri Nov 8 02:17:05 2013 @@ -1102,15 +1102,19 @@ } else { - PVOID WaitObjects[2]; - - WaitObjects[0] = &CompletionEvent; - WaitObjects[1] = pti->pEventQueueServer; + PVOID WaitObjects[3]; + + ObReferenceObject(ptirec->pEThread); + + WaitObjects[0] = &CompletionEvent; // Wait 0 + WaitObjects[1] = pti->pEventQueueServer; // Wait 1 + WaitObjects[2] = ptirec->pEThread; // Wait 2 + do { UserLeaveCo(); - WaitStatus = KeWaitForMultipleObjects(2, WaitObjects, WaitAny, UserRequest, + WaitStatus = KeWaitForMultipleObjects(3, WaitObjects, WaitAny, UserRequest, UserMode, FALSE, (uTimeout ? &Timeout : NULL), NULL); UserEnterCo(); @@ -1158,10 +1162,34 @@ TRACE("MsqSendMessage timed out 2\n"); break; } + /*if (WaitStatus == STATUS_WAIT_1) + { + ERR("Event hit\n"); + }*/ + // Receiving thread passed on and left us hanging with issues still pending. + if (WaitStatus == STATUS_WAIT_2) + { + ERR("Thread woken up dead!\n"); + Entry = pti->DispatchingMessagesHead.Flink; + while (Entry != &pti->DispatchingMessagesHead) + { + if ((PUSER_SENT_MESSAGE) CONTAINING_RECORD(Entry, USER_SENT_MESSAGE, DispatchingListEntry) + == Message) + { + Message->CompletionEvent = NULL; + Message->Result = NULL; + RemoveEntryList(&Message->DispatchingListEntry); + Message->DispatchingListEntry.Flink = NULL; + break; + } + Entry = Entry->Flink; + } + } while (co_MsqDispatchOneSentMessage(pti)) ; } - while (NT_SUCCESS(WaitStatus) && STATUS_WAIT_0 != WaitStatus); + while (NT_SUCCESS(WaitStatus) && WaitStatus == STATUS_WAIT_1); + ObDereferenceObject(ptirec->pEThread); } if(WaitStatus != STATUS_TIMEOUT)
11 years, 1 month
1
0
0
0
[jimtabor] 60882: Sync up wine class test to current. CORE-????.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Fri Nov 8 01:47:45 2013 New Revision: 60882 URL:
http://svn.reactos.org/svn/reactos?rev=60882&view=rev
Log: Sync up wine class test to current. CORE-????. Modified: trunk/rostests/winetests/user32/class.c Modified: trunk/rostests/winetests/user32/class.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/class.c?…
============================================================================== --- trunk/rostests/winetests/user32/class.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/class.c [iso-8859-1] Fri Nov 8 01:47:45 2013 @@ -28,13 +28,11 @@ #include "wine/test.h" #include "windef.h" #include "winbase.h" +#include "winnls.h" #include "winreg.h" #include "wingdi.h" #include "winuser.h" - -/* we don't want to include commctrl.h: */ -static const CHAR WC_EDITA[] = "Edit"; -static const WCHAR WC_EDITW[] = {'E','d','i','t',0}; +#include "commctrl.h" #define NUMCLASSWORDS 4 @@ -201,9 +199,9 @@ static void check_style( const char *name, int must_exist, UINT style, UINT ignore ) { - WNDCLASS wc; - - if (GetClassInfo( 0, name, &wc )) + WNDCLASSA wc; + + if (GetClassInfoA( 0, name, &wc )) { ok( !(~wc.style & style & ~ignore), "System class %s is missing bits %x (%08x/%08x)\n", name, ~wc.style & style, wc.style, style ); @@ -237,8 +235,8 @@ static void check_class_(int line, HINSTANCE inst, const char *name, const char *menu_name) { - WNDCLASS wc; - UINT atom = GetClassInfo(inst,name,&wc); + WNDCLASSA wc; + UINT atom = GetClassInfoA(inst,name,&wc); ok_(__FILE__,line)( atom, "Class %s %p not found\n", name, inst ); if (atom) { @@ -259,7 +257,7 @@ WNDCLASSA wc; HWND hwnd; - ok_(__FILE__,line)( GetClassInfo( inst, name, &wc ), "Couldn't find class %s inst %p\n", name, inst ); + ok_(__FILE__,line)( GetClassInfoA( inst, name, &wc ), "Couldn't find class %s inst %p\n", name, inst ); ok_(__FILE__,line)( wc.hInstance == info_inst, "Wrong info instance %p/%p for class %s\n", wc.hInstance, info_inst, name ); hwnd = CreateWindowExA( 0, name, "test_window", 0, 0, 0, 0, 0, 0, 0, inst, 0 ); @@ -363,7 +361,7 @@ wcexA.cbSize = sizeof(wcexA); ok( RegisterClassExA( &wcexA ), "Failed with valid number of cbSize bytes\n"); wcexA.cbSize = 0xdeadbeef; - ok( GetClassInfoEx(main_module, wcexA.lpszClassName, &wcexA), "GetClassInfoEx failed\n"); + ok( GetClassInfoExA(main_module, wcexA.lpszClassName, &wcexA), "GetClassInfoEx failed\n"); ok( wcexA.cbSize == 0xdeadbeef, "GetClassInfoEx returned wrong cbSize value %d\n", wcexA.cbSize); UnregisterClassA(wcexA.lpszClassName, main_module); @@ -411,13 +409,13 @@ check_class( kernel32, name, "kernel32" ); check_instance( name, kernel32, kernel32, kernel32 ); check_thread_instance( name, kernel32, kernel32, kernel32 ); - ok( !GetClassInfo( 0, name, &wc ), "Class found with null instance\n" ); + ok( !GetClassInfoA( 0, name, &wc ), "Class found with null instance\n" ); ok( UnregisterClassA( name, kernel32 ), "Unregister failed for kernel32\n" ); /* GetClassInfo with instance 0 finds user32 instance */ SetClassLongPtrA( hwnd, GCLP_HMODULE, (LONG_PTR)user32 ); ok( RegisterClassA( &cls ), "Failed to register local class for kernel32\n" ); - if (!GetClassInfo( 0, name, &wc )) zero_instance = user32; /* instance 0 not supported on wow64 */ + if (!GetClassInfoA( 0, name, &wc )) zero_instance = user32; /* instance 0 not supported on wow64 */ else { check_instance( name, 0, 0, kernel32 ); @@ -440,7 +438,7 @@ check_instance( name, (HINSTANCE)0x12345678, (HINSTANCE)0x12345678, (HINSTANCE)0x12345678 ); check_thread_instance( name, kernel32, kernel32, kernel32 ); check_thread_instance( name, (HINSTANCE)0x12345678, (HINSTANCE)0x12345678, (HINSTANCE)0x12345678 ); - ok( !GetClassInfo( 0, name, &wc ), "Class found with null instance\n" ); + ok( !GetClassInfoA( 0, name, &wc ), "Class found with null instance\n" ); /* creating a window with instance 0 uses the first class found */ cls.hInstance = (HINSTANCE)0xdeadbeef; @@ -458,7 +456,7 @@ "Didn't get kernel32 class for null instance\n" ); DestroyWindow( hwnd2 ); - r = GetClassName( hwnd, buffer, 4 ); + r = GetClassNameA( hwnd, buffer, 4 ); ok( r == 3, "expected 3, got %d\n", r ); ok( !strcmp( buffer, "__t"), "name wrong: %s\n", buffer ); @@ -484,7 +482,7 @@ check_class( main_module, name, "null" ); check_instance( name, main_module, main_module, main_module ); check_thread_instance( name, main_module, main_module, main_module ); - ok( !GetClassInfo( 0, name, &wc ), "Class found with null instance\n" ); + ok( !GetClassInfoA( 0, name, &wc ), "Class found with null instance\n" ); ok( GetLastError() == ERROR_CLASS_DOES_NOT_EXIST, "Wrong error code %d\n", GetLastError() ); ok( UnregisterClassA( name, 0 ), "Unregister failed for null instance\n" ); @@ -581,12 +579,12 @@ check_thread_instance( "BUTTON", user32, zero_instance, user32 ); /* we can unregister system classes */ - ok( GetClassInfo( 0, "BUTTON", &wc ), "Button class not found with null instance\n" ); - ok( GetClassInfo( kernel32, "BUTTON", &wc ), "Button class not found with kernel32\n" ); - ok( UnregisterClass( "BUTTON", (HINSTANCE)0x12345678 ), "Failed to unregister button\n" ); - ok( !UnregisterClass( "BUTTON", (HINSTANCE)0x87654321 ), "Unregistered button a second time\n" ); + ok( GetClassInfoA( 0, "BUTTON", &wc ), "Button class not found with null instance\n" ); + ok( GetClassInfoA( kernel32, "BUTTON", &wc ), "Button class not found with kernel32\n" ); + ok( UnregisterClassA( "BUTTON", (HINSTANCE)0x12345678 ), "Failed to unregister button\n" ); + ok( !UnregisterClassA( "BUTTON", (HINSTANCE)0x87654321 ), "Unregistered button a second time\n" ); ok( GetLastError() == ERROR_CLASS_DOES_NOT_EXIST, "Wrong error code %d\n", GetLastError() ); - ok( !GetClassInfo( 0, "BUTTON", &wc ), "Button still exists\n" ); + ok( !GetClassInfoA( 0, "BUTTON", &wc ), "Button still exists\n" ); /* last error not set reliably */ /* we can change the instance of a system class */ @@ -624,10 +622,10 @@ HWND hwnd; int i; - pDefWindowProcA = (void *)GetProcAddress(GetModuleHandle("user32.dll"), "DefWindowProcA"); - pDefWindowProcW = (void *)GetProcAddress(GetModuleHandle("user32.dll"), "DefWindowProcW"); - pNtdllDefWindowProcA = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "NtdllDefWindowProc_A"); - pNtdllDefWindowProcW = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "NtdllDefWindowProc_W"); + pDefWindowProcA = (void *)GetProcAddress(GetModuleHandleA("user32.dll"), "DefWindowProcA"); + pDefWindowProcW = (void *)GetProcAddress(GetModuleHandleA("user32.dll"), "DefWindowProcW"); + pNtdllDefWindowProcA = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtdllDefWindowProc_A"); + pNtdllDefWindowProcW = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtdllDefWindowProc_W"); /* On Vista+, the user32.dll export DefWindowProcA/W is forwarded to */ /* ntdll.NtdllDefWindowProc_A/W. However, the wndproc returned by */ @@ -641,7 +639,7 @@ { ZeroMemory(&cls, sizeof(cls)); cls.cbSize = sizeof(cls); - cls.hInstance = GetModuleHandle(NULL); + cls.hInstance = GetModuleHandleA(NULL); cls.hbrBackground = GetStockObject (WHITE_BRUSH); if (i & 1) cls.lpfnWndProc = pDefWindowProcA; @@ -660,7 +658,7 @@ } ok(atom != 0, "Couldn't register class, i=%d, %d\n", i, GetLastError()); - hwnd = CreateWindowA(classA, NULL, 0, 0, 0, 100, 100, NULL, NULL, GetModuleHandle(NULL), NULL); + hwnd = CreateWindowA(classA, NULL, 0, 0, 0, 100, 100, NULL, NULL, GetModuleHandleA(NULL), NULL); ok(hwnd != NULL, "Couldn't create window i=%d\n", i); ok(GetWindowLongPtrA(hwnd, GWLP_WNDPROC) == (LONG_PTR)pDefWindowProcA, "Wrong ANSI wndproc: %p vs %p\n", @@ -674,21 +672,21 @@ (void *)GetClassLongPtrW(hwnd, GCLP_WNDPROC), pDefWindowProcW); DestroyWindow(hwnd); - UnregisterClass((LPSTR)(DWORD_PTR)atom, GetModuleHandle(NULL)); + UnregisterClassA((LPSTR)(DWORD_PTR)atom, GetModuleHandleA(NULL)); } } /* built-in winproc - window A/W type automatically detected */ ZeroMemory(&cls, sizeof(cls)); cls.cbSize = sizeof(cls); - cls.hInstance = GetModuleHandle(NULL); + cls.hInstance = GetModuleHandleA(NULL); cls.hbrBackground = GetStockObject (WHITE_BRUSH); cls.lpszClassName = classA; cls.lpfnWndProc = pDefWindowProcW; atom = RegisterClassExA(&cls); hwnd = CreateWindowExW(0, classW, NULL, WS_OVERLAPPEDWINDOW, - CW_USEDEFAULT, CW_USEDEFAULT, 680, 260, NULL, NULL, GetModuleHandleA(NULL), 0); + CW_USEDEFAULT, CW_USEDEFAULT, 680, 260, NULL, NULL, GetModuleHandleW(NULL), 0); ok(IsWindowUnicode(hwnd), "Windows should be Unicode\n"); SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)pDefWindowProcA); ok(IsWindowUnicode(hwnd), "Windows should have remained Unicode\n"); @@ -706,12 +704,12 @@ ok(IsWindowUnicode(hwnd) == FALSE, "SetWindowLongPtrA should have switched window to ANSI\n"); DestroyWindow(hwnd); - UnregisterClass((LPSTR)(DWORD_PTR)atom, GetModuleHandle(NULL)); + UnregisterClassA((LPSTR)(DWORD_PTR)atom, GetModuleHandleA(NULL)); /* custom winproc - the same function can be used as both A and W*/ ZeroMemory(&cls, sizeof(cls)); cls.cbSize = sizeof(cls); - cls.hInstance = GetModuleHandle(NULL); + cls.hInstance = GetModuleHandleA(NULL); cls.hbrBackground = GetStockObject (WHITE_BRUSH); cls.lpszClassName = classA; cls.lpfnWndProc = ClassTest_WndProc2; @@ -726,7 +724,7 @@ ok(IsWindowUnicode(hwnd) == FALSE, "SetWindowLongPtrA should have changed window to ANSI\n"); DestroyWindow(hwnd); - UnregisterClass((LPSTR)(DWORD_PTR)atom, GetModuleHandle(NULL)); + UnregisterClassA((LPSTR)(DWORD_PTR)atom, GetModuleHandleA(NULL)); /* For most of the builtin controls both GetWindowLongPtrA and W returns a pointer that is executed directly * by CallWindowProcA/W */ @@ -736,7 +734,7 @@ hwnd = CreateWindowExA(0, NORMAL_CLASSES[i], classA, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 680, 260, NULL, NULL, NULL, 0); ok(hwnd != NULL, "Couldn't create window of class %s\n", NORMAL_CLASSES[i]); - SetWindowText(hwnd, classA); /* ComboBox needs this */ + SetWindowTextA(hwnd, classA); /* ComboBox needs this */ procA = (WNDPROC)GetWindowLongPtrA(hwnd, GWLP_WNDPROC); procW = (WNDPROC)GetWindowLongPtrW(hwnd, GWLP_WNDPROC); ok(!IS_WNDPROC_HANDLE(procA), "procA should not be a handle for %s (%p)\n", NORMAL_CLASSES[i], procA); @@ -837,30 +835,30 @@ static LRESULT WINAPI TestDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - return DefWindowProc(hWnd, uMsg, wParam, lParam); + return DefWindowProcA(hWnd, uMsg, wParam, lParam); } static BOOL RegisterTestDialog(HINSTANCE hInstance) { - WNDCLASSEX wcx; + WNDCLASSEXA wcx; ATOM atom = 0; - ZeroMemory(&wcx, sizeof(WNDCLASSEX)); + ZeroMemory(&wcx, sizeof(WNDCLASSEXA)); wcx.cbSize = sizeof(wcx); wcx.lpfnWndProc = TestDlgProc; wcx.cbClsExtra = 0; wcx.cbWndExtra = DLGWINDOWEXTRA; wcx.hInstance = hInstance; - wcx.hIcon = LoadIcon(NULL, IDI_APPLICATION); - wcx.hCursor = LoadCursor(NULL, IDC_ARROW); + wcx.hIcon = LoadIconA(NULL, (LPCSTR)IDI_APPLICATION); + wcx.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); wcx.hbrBackground = GetStockObject(WHITE_BRUSH); wcx.lpszClassName = "TestDialog"; wcx.lpszMenuName = "TestDialog"; - wcx.hIconSm = LoadImage(hInstance, MAKEINTRESOURCE(5), IMAGE_ICON, + wcx.hIconSm = LoadImageA(hInstance, (LPCSTR)MAKEINTRESOURCE(5), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); - atom = RegisterClassEx(&wcx); + atom = RegisterClassExA(&wcx); ok(atom != 0, "RegisterClassEx returned 0\n"); return atom; @@ -874,7 +872,7 @@ if (RegisterTestDialog(hInstance)) { - hWndMain = CreateDialogParam(hInstance, "CLASS_TEST_DIALOG", NULL, 0, 0); + hWndMain = CreateDialogParamA(hInstance, "CLASS_TEST_DIALOG", NULL, 0, 0); ok(hWndMain != NULL, "CreateDialogParam returned NULL\n"); ShowWindow(hWndMain, SW_SHOW); DestroyWindow(hWndMain); @@ -901,8 +899,8 @@ int i; for(i=0; i< sizeof(extra_values)/sizeof(extra_values[0]); i++) { - WNDCLASSEX wcx; - BOOL ret = GetClassInfoEx(NULL,extra_values[i].name,&wcx); + WNDCLASSEXA wcx; + BOOL ret = GetClassInfoExA(NULL,extra_values[i].name,&wcx); ok( ret, "GetClassInfo (0) failed for global class %s\n", extra_values[i].name); if (!ret) continue; @@ -1029,9 +1027,91 @@ DestroyWindow(hwnd); } +static void test_comctl32_class( const char *name ) +{ + WNDCLASSA wcA; + WNDCLASSW wcW; + BOOL ret; + HMODULE module; + WCHAR nameW[20]; + HWND hwnd; + + module = GetModuleHandleA( "comctl32" ); + ok( !module, "comctl32 already loaded\n" ); + ret = GetClassInfoA( 0, name, &wcA ); + ok( ret || broken(!ret) /* <= winxp */, "GetClassInfoA failed for %s\n", name ); + if (!ret) return; + MultiByteToWideChar( CP_ACP, 0, name, -1, nameW, sizeof(nameW)/sizeof(WCHAR) ); + ret = GetClassInfoW( 0, nameW, &wcW ); + ok( ret, "GetClassInfoW failed for %s\n", name ); + module = GetModuleHandleA( "comctl32" ); + ok( module != 0, "comctl32 not loaded\n" ); + FreeLibrary( module ); + module = GetModuleHandleA( "comctl32" ); + ok( !module, "comctl32 still loaded\n" ); + hwnd = CreateWindowA( name, "test", WS_OVERLAPPEDWINDOW, 0, 0, 10, 10, NULL, NULL, NULL, 0 ); + ok( hwnd != 0, "failed to create window for %s\n", name ); + module = GetModuleHandleA( "comctl32" ); + ok( module != 0, "comctl32 not loaded\n" ); +} + +/* verify that comctl32 classes are automatically loaded by user32 */ +static void test_comctl32_classes(void) +{ + char path_name[MAX_PATH]; + PROCESS_INFORMATION info; + STARTUPINFOA startup; + char **argv; + int i; + + static const char *classes[] = + { + ANIMATE_CLASSA, + WC_COMBOBOXEXA, + DATETIMEPICK_CLASSA, + WC_HEADERA, + HOTKEY_CLASSA, + WC_IPADDRESSA, + WC_LISTVIEWA, + MONTHCAL_CLASSA, + WC_NATIVEFONTCTLA, + WC_PAGESCROLLERA, + PROGRESS_CLASSA, + REBARCLASSNAMEA, + STATUSCLASSNAMEA, + WC_TABCONTROLA, + TOOLBARCLASSNAMEA, + TOOLTIPS_CLASSA, + TRACKBAR_CLASSA, + WC_TREEVIEWA, + UPDOWN_CLASSA + }; + + winetest_get_mainargs( &argv ); + for (i = 0; i < sizeof(classes) / sizeof(classes[0]); i++) + { + memset( &startup, 0, sizeof(startup) ); + startup.cb = sizeof( startup ); + sprintf( path_name, "%s class %s", argv[0], classes[i] ); + ok( CreateProcessA( NULL, path_name, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info ), + "CreateProcess failed.\n" ); + winetest_wait_child_process( info.hProcess ); + CloseHandle( info.hProcess ); + CloseHandle( info.hThread ); + } +} + START_TEST(class) { + char **argv; HANDLE hInstance = GetModuleHandleA( NULL ); + int argc = winetest_get_mainargs( &argv ); + + if (argc >= 3) + { + test_comctl32_class( argv[2] ); + return; + } test_GetClassInfo(); test_extra_values(); @@ -1048,6 +1128,7 @@ test_styles(); test_builtinproc(); test_icons(); + test_comctl32_classes(); /* this test unregisters the Button class so it should be executed at the end */ test_instances();
11 years, 1 month
1
0
0
0
[jimtabor] 60881: [Win32k] - Attempt to fix CORE-7554.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Fri Nov 8 00:26:08 2013 New Revision: 60881 URL:
http://svn.reactos.org/svn/reactos?rev=60881&view=rev
Log: [Win32k] - Attempt to fix CORE-7554. Modified: trunk/reactos/win32ss/user/ntuser/vis.c trunk/reactos/win32ss/user/ntuser/windc.c Modified: trunk/reactos/win32ss/user/ntuser/vis.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/vis.c?…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/vis.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/vis.c [iso-8859-1] Fri Nov 8 00:26:08 2013 @@ -45,10 +45,9 @@ CurrentWindow = Wnd->spwndParent; while (CurrentWindow) { - if ( CurrentWindow->state2 & WNDS2_INDESTROY || - CurrentWindow->state & WNDS_DESTROYED ) + if (!VerifyWnd(CurrentWindow)) { - ERR("ATM the Current Window or Parent is dead!\n"); + ERR("ATM the Current Window or Parent is dead! %p\n",CurrentWindow); if (VisRgn) GreDeleteObject(VisRgn); return NULL; } Modified: trunk/reactos/win32ss/user/ntuser/windc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/windc.…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/windc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/windc.c [iso-8859-1] Fri Nov 8 00:26:08 2013 @@ -245,7 +245,7 @@ Dce->DCXFlags &= ~DCX_DCEDIRTY; GdiSelectVisRgn(Dce->hDC, hRgnVisible); - if (Window != NULL) + if (VerifyWnd(Window)) // Window maybe dead by this time before finishing the DCE release. { IntEngWindowChanged(Window, WOC_RGN_CLIENT); }
11 years, 1 month
1
0
0
0
[gadamopoulos] 60880: [shell32] - Initialize comctl32 properly
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Thu Nov 7 14:14:26 2013 New Revision: 60880 URL:
http://svn.reactos.org/svn/reactos?rev=60880&view=rev
Log: [shell32] - Initialize comctl32 properly Modified: trunk/reactos/dll/win32/shell32/shell32_main.cpp Modified: trunk/reactos/dll/win32/shell32/shell32_main.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32_…
============================================================================== --- trunk/reactos/dll/win32/shell32/shell32_main.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shell32_main.cpp [iso-8859-1] Thu Nov 7 14:14:26 2013 @@ -1463,7 +1463,11 @@ GetModuleFileNameW(hInstance, swShell32Name, MAX_PATH); swShell32Name[MAX_PATH - 1] = '\0'; - InitCommonControlsEx(NULL); + /* Initialize comctl32 */ + INITCOMMONCONTROLSEX InitCtrls; + InitCtrls.dwSize = sizeof(INITCOMMONCONTROLSEX); + InitCtrls.dwICC = ICC_WIN95_CLASSES | ICC_DATE_CLASSES | ICC_USEREX_CLASSES; + InitCommonControlsEx(&InitCtrls); SIC_Initialize(); InitChangeNotifications();
11 years, 1 month
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
35
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
Results per page:
10
25
50
100
200