ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
October 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
14 participants
325 discussions
Start a n
N
ew thread
[tfaber] 60741: [NTOS] - Also fix misguided return type aka fix build
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Oct 24 18:05:58 2013 New Revision: 60741 URL:
http://svn.reactos.org/svn/reactos?rev=60741&view=rev
Log: [NTOS] - Also fix misguided return type aka fix build Modified: trunk/reactos/ntoskrnl/mm/mminit.c Modified: trunk/reactos/ntoskrnl/mm/mminit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mminit.c?rev=6…
============================================================================== --- trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] Thu Oct 24 18:05:58 2013 @@ -297,12 +297,15 @@ "Non Paged Pool Expansion PTE Space"); } -NTSTATUS NTAPI -MmMpwThreadMain(PVOID Ignored) +VOID +NTAPI +MmMpwThreadMain(PVOID Parameter) { NTSTATUS Status; ULONG PagesWritten; LARGE_INTEGER Timeout; + + UNREFERENCED_PARAMETER(Parameter); Timeout.QuadPart = -50000000; @@ -317,7 +320,7 @@ { DbgPrint("MpwThread: Wait failed\n"); KeBugCheck(MEMORY_MANAGEMENT); - return(STATUS_UNSUCCESSFUL); + return; } PagesWritten = 0;
11 years, 2 months
1
0
0
0
[tfaber] 60740: [NTOS] - Remove misguided casts
by tfaber@svn.reactos.org
Author: tfaber Date: Thu Oct 24 17:53:45 2013 New Revision: 60740 URL:
http://svn.reactos.org/svn/reactos?rev=60740&view=rev
Log: [NTOS] - Remove misguided casts Modified: trunk/reactos/ntoskrnl/mm/balance.c trunk/reactos/ntoskrnl/mm/mminit.c Modified: trunk/reactos/ntoskrnl/mm/balance.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/balance.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/mm/balance.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/balance.c [iso-8859-1] Thu Oct 24 17:53:45 2013 @@ -381,7 +381,7 @@ ULONG InitialTarget = 0; #if (_MI_PAGING_LEVELS == 2) - if(!MiIsBalancerThread()) + if (!MiIsBalancerThread()) { /* Clean up the unused PDEs */ ULONG_PTR Address; @@ -390,14 +390,14 @@ /* Acquire PFN lock */ KIRQL OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); PMMPDE pointerPde; - for(Address = (ULONG_PTR)MI_LOWEST_VAD_ADDRESS; - Address < (ULONG_PTR)MM_HIGHEST_VAD_ADDRESS; - Address += (PAGE_SIZE * PTE_COUNT)) + for (Address = (ULONG_PTR)MI_LOWEST_VAD_ADDRESS; + Address < (ULONG_PTR)MM_HIGHEST_VAD_ADDRESS; + Address += (PAGE_SIZE * PTE_COUNT)) { - if(MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] == 0) + if (MmWorkingSetList->UsedPageTableEntries[MiGetPdeOffset(Address)] == 0) { pointerPde = MiAddressToPde(Address); - if(pointerPde->u.Hard.Valid) + if (pointerPde->u.Hard.Valid) MiDeletePte(pointerPde, MiPdeToPte(pointerPde), Process, NULL); ASSERT(pointerPde->u.Hard.Valid == 0); } @@ -464,7 +464,7 @@ NULL, NULL, &MiBalancerThreadId, - (PKSTART_ROUTINE) MiBalancerThread, + MiBalancerThread, NULL); if (!NT_SUCCESS(Status)) { Modified: trunk/reactos/ntoskrnl/mm/mminit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mminit.c?rev=6…
============================================================================== --- trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/mminit.c [iso-8859-1] Thu Oct 24 17:53:45 2013 @@ -346,7 +346,7 @@ NULL, NULL, &MpwThreadId, - (PKSTART_ROUTINE) MmMpwThreadMain, + MmMpwThreadMain, NULL); if (!NT_SUCCESS(Status)) {
11 years, 2 months
1
0
0
0
[aandrejevic] 60739: [NTVDM] Remove the code that performs waiting in 32-bit mode since that blocks the emulator and prevents interrupts from working. Implement a 16-bit waiting system in the inter...
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Thu Oct 24 01:01:49 2013 New Revision: 60739 URL:
http://svn.reactos.org/svn/reactos?rev=60739&view=rev
Log: [NTVDM] Remove the code that performs waiting in 32-bit mode since that blocks the emulator and prevents interrupts from working. Implement a 16-bit waiting system in the interrupt handlers. Fix the PS/2 interrupt code. Modified: branches/ntvdm/subsystems/ntvdm/bios.c branches/ntvdm/subsystems/ntvdm/dos.c branches/ntvdm/subsystems/ntvdm/emulator.c branches/ntvdm/subsystems/ntvdm/emulator.h branches/ntvdm/subsystems/ntvdm/ps2.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] Thu Oct 24 01:01:49 2013 @@ -267,14 +267,14 @@ static BOOLEAN BiosKbdBufferPush(WORD Data) { - /* Get the location of the element after the head */ - WORD NextElement = Bda->KeybdBufferHead + 2; + /* Get the location of the element after the tail */ + WORD NextElement = Bda->KeybdBufferTail + 2; /* Wrap it around if it's at or beyond the end */ if (NextElement >= Bda->KeybdBufferEnd) NextElement = Bda->KeybdBufferStart; /* If it's full, fail */ - if (NextElement == Bda->KeybdBufferTail) return FALSE; + if (NextElement == Bda->KeybdBufferHead) return FALSE; /* Put the value in the queue */ *((LPWORD)((ULONG_PTR)Bda + Bda->KeybdBufferTail)) = Data; @@ -468,18 +468,33 @@ IntVecTable[i * 2] = Offset; IntVecTable[i * 2 + 1] = BIOS_SEGMENT; - BiosCode[Offset++] = 0xFA; // cli + BiosCode[Offset++] = 0xFB; // sti BiosCode[Offset++] = 0x6A; // push i BiosCode[Offset++] = (BYTE)i; + + BiosCode[Offset++] = 0x6A; // push 0 + BiosCode[Offset++] = 0x00; + + BiosCode[Offset++] = 0xF8; // clc BiosCode[Offset++] = LOBYTE(EMULATOR_BOP); // BOP sequence BiosCode[Offset++] = HIBYTE(EMULATOR_BOP); BiosCode[Offset++] = LOBYTE(EMULATOR_INT_BOP); BiosCode[Offset++] = HIBYTE(EMULATOR_INT_BOP); - BiosCode[Offset++] = 0x44; // inc sp - BiosCode[Offset++] = 0x44; // inc sp + BiosCode[Offset++] = 0x73; // jnc +3 + BiosCode[Offset++] = 0x03; + + // HACK: The following instruction should be HLT! + BiosCode[Offset++] = 0x90; // nop + + BiosCode[Offset++] = 0xEB; // jmp -10 + BiosCode[Offset++] = 0xF6; + + BiosCode[Offset++] = 0x83; // add sp, 4 + BiosCode[Offset++] = 0xC4; + BiosCode[Offset++] = 0x04; BiosCode[Offset++] = 0xCF; // iret } @@ -590,9 +605,7 @@ WORD BiosGetCharacter(VOID) { - WORD CharacterData; - INPUT_RECORD InputRecord; - DWORD Count; + WORD CharacterData = 0; /* Check if there is a key available */ if (Bda->KeybdBufferHead != Bda->KeybdBufferTail) @@ -603,24 +616,8 @@ } else { - VgaRefreshDisplay(); // HACK: Waiting here blocks the emulator!!! - - while (TRUE) - { - /* Wait for a console event */ - WaitForSingleObject(BiosConsoleInput, INFINITE); - - /* Read the event, and make sure it's a keypress */ - if (!ReadConsoleInput(BiosConsoleInput, &InputRecord, 1, &Count)) continue; - if (InputRecord.EventType != KEY_EVENT) continue; - if (!InputRecord.Event.KeyEvent.bKeyDown) continue; - - /* Save the scan code and end the loop */ - CharacterData = (InputRecord.Event.KeyEvent.wVirtualScanCode << 8) - | InputRecord.Event.KeyEvent.uChar.AsciiChar; - - break; - } + /* Set the handler CF to repeat the BOP */ + EmulatorSetFlag(EMULATOR_FLAG_CF); } return CharacterData; 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] Thu Oct 24 01:01:49 2013 @@ -684,30 +684,17 @@ WORD Result = ERROR_SUCCESS; DWORD BytesRead32 = 0; HANDLE Handle = DosGetRealHandle(FileHandle); - WORD i; DPRINT("DosReadFile: FileHandle 0x%04X, Count 0x%04X\n", FileHandle, Count); /* Make sure the handle is valid */ if (Handle == INVALID_HANDLE_VALUE) return ERROR_INVALID_HANDLE; - if (IsConsoleHandle(Handle)) - { - for (i = 0; i < Count; i++) - { - /* Call the BIOS function to read the character */ - ((LPBYTE)Buffer)[i] = LOBYTE(BiosGetCharacter()); - BytesRead32++; - } - } - else - { - /* Read the file */ - if (!ReadFile(Handle, Buffer, Count, &BytesRead32, NULL)) - { - /* Store the error code */ - Result = (WORD)GetLastError(); - } + /* Read the file */ + if (!ReadFile(Handle, Buffer, Count, &BytesRead32, NULL)) + { + /* Store the error code */ + Result = (WORD)GetLastError(); } /* The number of bytes read is always 16-bit */ @@ -1283,8 +1270,16 @@ CHAR Character = '\0'; WORD BytesRead; - /* Use the file reading function */ - DosReadFile(DOS_INPUT_HANDLE, &Character, sizeof(CHAR), &BytesRead); + if (IsConsoleHandle(DosGetRealHandle(DOS_INPUT_HANDLE))) + { + /* Call the BIOS */ + Character = LOBYTE(BiosGetCharacter()); + } + else + { + /* Use the file reading function */ + DosReadFile(DOS_INPUT_HANDLE, &Character, sizeof(CHAR), &BytesRead); + } return Character; } @@ -1381,7 +1376,12 @@ { Character = DosReadCharacter(); DosPrintCharacter(Character); - EmulatorSetRegister(EMULATOR_REG_AX, (Eax & 0xFFFFFF00) | Character); + + if (!EmulatorGetFlag(EMULATOR_FLAG_CF)) + { + EmulatorSetRegister(EMULATOR_REG_AX, (Eax & 0xFFFFFF00) | Character); + } + break; } @@ -1396,8 +1396,13 @@ case 0x07: case 0x08: { - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFFFF00) | DosReadCharacter()); + Character = DosReadCharacter(); + + if (!EmulatorGetFlag(EMULATOR_FLAG_CF)) + { + EmulatorSetRegister(EMULATOR_REG_AX, (Eax & 0xFFFFFF00) | Character); + } + break; } @@ -1419,6 +1424,8 @@ /* Read Buffered Input */ case 0x0A: { + DPRINT1("FIXME: This function is still not adapted to the new system!\n"); + InputBuffer = (PDOS_INPUT_BUFFER)((ULONG_PTR)BaseAddress + TO_LINEAR(DataSegment, LOWORD(Edx))); @@ -1725,23 +1732,45 @@ /* Read File */ case 0x3F: { + WORD Handle = LOWORD(Ebx); + LPBYTE Buffer = (LPBYTE)((ULONG_PTR)BaseAddress + TO_LINEAR(DataSegment, LOWORD(Edx))); + WORD Count = LOWORD(Ecx); WORD BytesRead = 0; - WORD ErrorCode = DosReadFile(LOWORD(Ebx), - (LPVOID)((ULONG_PTR)BaseAddress - + TO_LINEAR(DataSegment, LOWORD(Edx))), - LOWORD(Ecx), - &BytesRead); + WORD ErrorCode = ERROR_SUCCESS; + + if (IsConsoleHandle(DosGetRealHandle(Handle))) + { + while (Stack[STACK_COUNTER] < Count) + { + /* Read a character from the BIOS */ + Buffer[Stack[STACK_COUNTER]] = LOBYTE(BiosGetCharacter()); // FIXME: Security checks! + + /* Stop if the BOP needs to be repeated */ + if (EmulatorGetFlag(EMULATOR_FLAG_CF)) break; + + /* Increment the counter */ + Stack[STACK_COUNTER]++; + } + + if (Stack[STACK_COUNTER] < Count) ErrorCode = ERROR_NOT_READY; + else BytesRead = Count; + } + else + { + /* Use the file reading function */ + ErrorCode = DosReadFile(Handle, Buffer, Count, &BytesRead); + } if (ErrorCode == 0) { - /* Clear CF */ - Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; - - /* Return the number of bytes read in AX */ - EmulatorSetRegister(EMULATOR_REG_AX, - (Eax & 0xFFFF0000) | BytesRead); - } - else + /* Clear CF */ + Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF; + + /* Return the number of bytes read in AX */ + EmulatorSetRegister(EMULATOR_REG_AX, + (Eax & 0xFFFF0000) | BytesRead); + } + else if (ErrorCode != ERROR_NOT_READY) { /* Set CF */ Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF; Modified: branches/ntvdm/subsystems/ntvdm/emulator.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] Thu Oct 24 01:01:49 2013 @@ -590,9 +590,6 @@ /* Skip the opcodes */ EmulatorContext.state->reg_ip += 4; - // HACK: Refresh the display because the called function may wait. - VgaRefreshDisplay(); - /* Call the BOP handler */ EmulatorBop(Instruction[1]); } Modified: branches/ntvdm/subsystems/ntvdm/emulator.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/emulator.h [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/emulator.h [iso-8859-1] Thu Oct 24 01:01:49 2013 @@ -43,10 +43,11 @@ /* Common definitions */ #define EMULATOR_BOP 0xC4C4 #define EMULATOR_INT_BOP 0xBEEF -#define STACK_INT_NUM 0 -#define STACK_IP 1 -#define STACK_CS 2 -#define STACK_FLAGS 3 +#define STACK_COUNTER 0 +#define STACK_INT_NUM 1 +#define STACK_IP 2 +#define STACK_CS 3 +#define STACK_FLAGS 4 enum { Modified: branches/ntvdm/subsystems/ntvdm/ps2.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/ps2.c?re…
============================================================================== --- branches/ntvdm/subsystems/ntvdm/ps2.c [iso-8859-1] (original) +++ branches/ntvdm/subsystems/ntvdm/ps2.c [iso-8859-1] Thu Oct 24 01:01:49 2013 @@ -271,6 +271,7 @@ HANDLE ConsoleInput = GetStdHandle(STD_INPUT_HANDLE); DWORD i, j, Count, TotalEvents; BYTE ScanCode; + BOOLEAN Interrupt = FALSE; /* Get the number of input events */ if (!GetNumberOfConsoleInputEvents(ConsoleInput, &Count)) return; @@ -300,12 +301,10 @@ KeyboardQueuePush(ScanCode); } - /* Yes, IRQ 1 */ - PicInterruptRequest(1); - - /* Stop the loop */ - break; - } + Interrupt = TRUE; + } + + if (Interrupt) PicInterruptRequest(1); Cleanup: HeapFree(GetProcessHeap(), 0, Buffer);
11 years, 2 months
1
0
0
0
[tkreuzer] 60738: [REACTOS] Fix the mess I left... (remove unwanted changes and commit missing change)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Oct 23 19:38:49 2013 New Revision: 60738 URL:
http://svn.reactos.org/svn/reactos?rev=60738&view=rev
Log: [REACTOS] Fix the mess I left... (remove unwanted changes and commit missing change) Modified: trunk/reactos/lib/rtl/acl.c trunk/reactos/ntoskrnl/ex/sysinfo.c trunk/reactos/ntoskrnl/ntoskrnl.spec Modified: trunk/reactos/lib/rtl/acl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/acl.c?rev=60738&r1…
============================================================================== --- trunk/reactos/lib/rtl/acl.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/acl.c [iso-8859-1] Wed Oct 23 19:38:49 2013 @@ -847,21 +847,21 @@ (Acl->AclRevision > MAX_ACL_REVISION)) { DPRINT1("Invalid ACL revision\n"); - return FALSE; + _SEH2_YIELD(return FALSE); } /* Next, validate that the ACL is USHORT-aligned */ if (ROUND_DOWN(Acl->AclSize, sizeof(USHORT)) != Acl->AclSize) { DPRINT1("Invalid ACL size\n"); - return FALSE; + _SEH2_YIELD(return FALSE); } /* And that it's big enough */ if (Acl->AclSize < sizeof(ACL)) { DPRINT1("Invalid ACL size\n"); - return FALSE; + _SEH2_YIELD(return FALSE); } /* Loop each ACE */ @@ -872,21 +872,21 @@ if (((ULONG_PTR)Ace + sizeof(ACE_HEADER)) >= ((ULONG_PTR)Acl + Acl->AclSize)) { DPRINT1("Invalid ACE size\n"); - return FALSE; + _SEH2_YIELD(return FALSE); } /* Validate the length of this ACE */ if (ROUND_DOWN(Ace->AceSize, sizeof(USHORT)) != Ace->AceSize) { DPRINT1("Invalid ACE size: %lx\n", Ace->AceSize); - return FALSE; + _SEH2_YIELD(return FALSE); } /* Validate we have space for the entire ACE */ if (((ULONG_PTR)Ace + Ace->AceSize) > ((ULONG_PTR)Acl + Acl->AclSize)) { DPRINT1("Invalid ACE size %lx %lx\n", Ace->AceSize, Acl->AclSize); - return FALSE; + _SEH2_YIELD(return FALSE); } /* Check what kind of ACE this is */ @@ -896,14 +896,14 @@ if (ROUND_DOWN(Ace->AceSize, sizeof(ULONG)) != Ace->AceSize) { DPRINT1("Invalid ACE size\n"); - return FALSE; + _SEH2_YIELD(return FALSE); } /* The ACE size should at least have enough for the header */ if (Ace->AceSize < sizeof(ACE_HEADER)) { DPRINT1("Invalid ACE size: %lx %lx\n", Ace->AceSize, sizeof(ACE_HEADER)); - return FALSE; + _SEH2_YIELD(return FALSE); } /* Check if the SID revision is valid */ @@ -911,21 +911,21 @@ if (Sid->Revision != SID_REVISION) { DPRINT1("Invalid SID\n"); - return FALSE; + _SEH2_YIELD(return FALSE); } /* Check if the SID is out of bounds */ if (Sid->SubAuthorityCount > SID_MAX_SUB_AUTHORITIES) { DPRINT1("Invalid SID\n"); - return FALSE; + _SEH2_YIELD(return FALSE); } /* The ACE size should at least have enough for the header and SID */ if (Ace->AceSize < (sizeof(ACE_HEADER) + RtlLengthSid(Sid))) { DPRINT1("Invalid ACE size\n"); - return FALSE; + _SEH2_YIELD(return FALSE); } } else if (Ace->AceType == ACCESS_ALLOWED_COMPOUND_ACE_TYPE) @@ -943,7 +943,7 @@ if (Ace->AceSize < sizeof(ACE_HEADER)) { DPRINT1("Unknown ACE\n"); - return FALSE; + _SEH2_YIELD(return FALSE); } } @@ -954,7 +954,7 @@ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { /* Something was invalid, fail */ - return FALSE; + _SEH2_YIELD(return FALSE); } _SEH2_END; Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Wed Oct 23 19:38:49 2013 @@ -1681,7 +1681,7 @@ /* Call it */ Status = (DriverInit)(&Win32k, NULL); ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); -__debugbreak();__debugbreak(); + /* Unload if we failed */ if (!NT_SUCCESS(Status)) MmUnloadSystemImage(ModuleObject); return Status; Modified: trunk/reactos/ntoskrnl/ntoskrnl.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.spec?rev…
============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl.spec [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ntoskrnl.spec [iso-8859-1] Wed Oct 23 19:38:49 2013 @@ -969,7 +969,7 @@ @ stdcall PsGetCurrentThreadStackLimit() @ stdcall PsGetCurrentThreadTeb() @ stdcall PsGetCurrentThreadWin32Thread() -@ stdcall PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion() +@ stdcall PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion(ptr) @ stdcall PsGetJobLock(ptr) @ stdcall PsGetJobSessionId(ptr) @ stdcall PsGetJobUIRestrictionsClass(ptr)
11 years, 2 months
1
0
0
0
[tkreuzer] 60737: [NTDLL] Use LDR_LOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS flag instead of TRUE [RTL] Fix RtlAddAce (the version checks were inverted.) [NTOSKRNL] Make SystemExtendServiceTableInformat...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Wed Oct 23 19:31:41 2013 New Revision: 60737 URL:
http://svn.reactos.org/svn/reactos?rev=60737&view=rev
Log: [NTDLL] Use LDR_LOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS flag instead of TRUE [RTL] Fix RtlAddAce (the version checks were inverted.) [NTOSKRNL] Make SystemExtendServiceTableInformation case of NtSetSystemInformation behave more like Windows [NTOSKRNL] Fix PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion Modified: trunk/reactos/dll/ntdll/ldr/ldrapi.c trunk/reactos/lib/rtl/acl.c trunk/reactos/lib/rtl/memstream.c trunk/reactos/ntoskrnl/ex/sysinfo.c trunk/reactos/ntoskrnl/ps/thread.c Modified: trunk/reactos/dll/ntdll/ldr/ldrapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/ntdll/ldr/ldrapi.c?rev…
============================================================================== --- trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] (original) +++ trunk/reactos/dll/ntdll/ldr/ldrapi.c [iso-8859-1] Wed Oct 23 19:31:41 2013 @@ -1610,7 +1610,7 @@ ULONG_PTR Cookie; /* Acquire the loader lock */ - LdrLockLoaderLock(TRUE, NULL, &Cookie); + LdrLockLoaderLock(LDR_LOCK_LOADER_LOCK_FLAG_RAISE_ON_ERRORS, NULL, &Cookie); /* Check if there's any alternate resources loaded */ if (AlternateResourceModuleCount) Modified: trunk/reactos/lib/rtl/acl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/acl.c?rev=60737&r1…
============================================================================== --- trunk/reactos/lib/rtl/acl.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/acl.c [iso-8859-1] Wed Oct 23 19:31:41 2013 @@ -579,22 +579,23 @@ /* Bail out if there's no space */ if (!RtlFirstFreeAce(Acl, &FreeAce)) return STATUS_INVALID_PARAMETER; - /* Always use the smaller revision */ - if (Acl->AclRevision <= AclRevision) AclRevision = Acl->AclRevision; - /* Loop over all the ACEs, keeping track of new ACEs as we go along */ for (Ace = AceList, NewAceCount = 0; Ace < (PACE)((ULONG_PTR)AceList + AceListLength); NewAceCount++) { - /* Make sure that the revision of this ACE is valid in this list */ - if (Ace->Header.AceType <= ACCESS_MAX_MS_V3_ACE_TYPE) + /* Make sure that the revision of this ACE is valid in this list. + The initial check looks strange, but it is what Windows does. */ + if (Ace->Header.AceType <= ACCESS_MAX_MS_ACE_TYPE) { - if (AclRevision < ACL_REVISION3) return STATUS_INVALID_PARAMETER; - } - else if (Ace->Header.AceType <= ACCESS_MAX_MS_V4_ACE_TYPE) - { - if (AclRevision < ACL_REVISION4) return STATUS_INVALID_PARAMETER; + if (Ace->Header.AceType > ACCESS_MAX_MS_V3_ACE_TYPE) + { + if (AclRevision < ACL_REVISION4) return STATUS_INVALID_PARAMETER; + } + else if (Ace->Header.AceType > ACCESS_MAX_MS_V2_ACE_TYPE) + { + if (AclRevision < ACL_REVISION3) return STATUS_INVALID_PARAMETER; + } } /* Move to the next ACE */ @@ -627,9 +628,9 @@ Ace, (ULONG_PTR)FreeAce - (ULONG_PTR)Ace); - /* Fill out the header and return */ - Acl->AceCount = Acl->AceCount + NewAceCount; - Acl->AclRevision = (UCHAR)AclRevision; + /* Update the header and return */ + Acl->AceCount += NewAceCount; + Acl->AclRevision = (UCHAR)min(Acl->AclRevision, AclRevision); return STATUS_SUCCESS; } @@ -846,21 +847,21 @@ (Acl->AclRevision > MAX_ACL_REVISION)) { DPRINT1("Invalid ACL revision\n"); - _SEH2_YIELD(return FALSE); + return FALSE; } /* Next, validate that the ACL is USHORT-aligned */ if (ROUND_DOWN(Acl->AclSize, sizeof(USHORT)) != Acl->AclSize) { DPRINT1("Invalid ACL size\n"); - _SEH2_YIELD(return FALSE); + return FALSE; } /* And that it's big enough */ if (Acl->AclSize < sizeof(ACL)) { DPRINT1("Invalid ACL size\n"); - _SEH2_YIELD(return FALSE); + return FALSE; } /* Loop each ACE */ @@ -871,21 +872,21 @@ if (((ULONG_PTR)Ace + sizeof(ACE_HEADER)) >= ((ULONG_PTR)Acl + Acl->AclSize)) { DPRINT1("Invalid ACE size\n"); - _SEH2_YIELD(return FALSE); + return FALSE; } /* Validate the length of this ACE */ if (ROUND_DOWN(Ace->AceSize, sizeof(USHORT)) != Ace->AceSize) { DPRINT1("Invalid ACE size: %lx\n", Ace->AceSize); - _SEH2_YIELD(return FALSE); + return FALSE; } /* Validate we have space for the entire ACE */ if (((ULONG_PTR)Ace + Ace->AceSize) > ((ULONG_PTR)Acl + Acl->AclSize)) { DPRINT1("Invalid ACE size %lx %lx\n", Ace->AceSize, Acl->AclSize); - _SEH2_YIELD(return FALSE); + return FALSE; } /* Check what kind of ACE this is */ @@ -895,14 +896,14 @@ if (ROUND_DOWN(Ace->AceSize, sizeof(ULONG)) != Ace->AceSize) { DPRINT1("Invalid ACE size\n"); - _SEH2_YIELD(return FALSE); + return FALSE; } /* The ACE size should at least have enough for the header */ if (Ace->AceSize < sizeof(ACE_HEADER)) { DPRINT1("Invalid ACE size: %lx %lx\n", Ace->AceSize, sizeof(ACE_HEADER)); - _SEH2_YIELD(return FALSE); + return FALSE; } /* Check if the SID revision is valid */ @@ -910,21 +911,21 @@ if (Sid->Revision != SID_REVISION) { DPRINT1("Invalid SID\n"); - _SEH2_YIELD(return FALSE); + return FALSE; } /* Check if the SID is out of bounds */ if (Sid->SubAuthorityCount > SID_MAX_SUB_AUTHORITIES) { DPRINT1("Invalid SID\n"); - _SEH2_YIELD(return FALSE); + return FALSE; } /* The ACE size should at least have enough for the header and SID */ if (Ace->AceSize < (sizeof(ACE_HEADER) + RtlLengthSid(Sid))) { DPRINT1("Invalid ACE size\n"); - _SEH2_YIELD(return FALSE); + return FALSE; } } else if (Ace->AceType == ACCESS_ALLOWED_COMPOUND_ACE_TYPE) @@ -942,7 +943,7 @@ if (Ace->AceSize < sizeof(ACE_HEADER)) { DPRINT1("Unknown ACE\n"); - _SEH2_YIELD(return FALSE); + return FALSE; } } @@ -953,7 +954,7 @@ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { /* Something was invalid, fail */ - _SEH2_YIELD(return FALSE); + return FALSE; } _SEH2_END; Modified: trunk/reactos/lib/rtl/memstream.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/memstream.c?rev=60…
============================================================================== --- trunk/reactos/lib/rtl/memstream.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/memstream.c [iso-8859-1] Wed Oct 23 19:31:41 2013 @@ -303,7 +303,7 @@ TotalSize = Length.QuadPart; while (TotalSize) { - Left = min(TotalSize, sizeof(Buffer)); + Left = (ULONG)min(TotalSize, sizeof(Buffer)); /* Read */ Result = IStream_Read(This, Buffer, Left, &Amount); Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c [iso-8859-1] Wed Oct 23 19:31:41 2013 @@ -1612,28 +1612,51 @@ /* Check who is calling */ if (PreviousMode != KernelMode) { + static const UNICODE_STRING Win32kName = + RTL_CONSTANT_STRING(L"\\SystemRoot\\System32\\win32k.sys"); + /* Make sure we can load drivers */ if (!SeSinglePrivilegeCheck(SeLoadDriverPrivilege, UserMode)) { /* FIXME: We can't, fail */ - //return STATUS_PRIVILEGE_NOT_HELD; + return STATUS_PRIVILEGE_NOT_HELD; } - } - - /* Probe and capture the driver name */ - ProbeAndCaptureUnicodeString(&ImageName, PreviousMode, Buffer); + + _SEH2_TRY + { + /* Probe and copy the unicode string */ + ProbeForRead(Buffer, sizeof(ImageName), 1); + ImageName = *(PUNICODE_STRING)Buffer; + + /* Probe the string buffer */ + ProbeForRead(ImageName.Buffer, ImageName.Length, sizeof(WCHAR)); + + /* Check if we have the correct name (nothing else is allowed!) */ + if (!RtlEqualUnicodeString(&ImageName, &Win32kName, FALSE)) + { + _SEH2_YIELD(return STATUS_PRIVILEGE_NOT_HELD); + } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + _SEH2_YIELD(return _SEH2_GetExceptionCode()); + } + _SEH2_END; + + /* Recursively call the function, so that we are from kernel mode */ + return ZwSetSystemInformation(SystemExtendServiceTableInformation, + (PVOID)&Win32kName, + sizeof(Win32kName)); + } /* Load the image */ - Status = MmLoadSystemImage(&ImageName, + Status = MmLoadSystemImage((PUNICODE_STRING)Buffer, NULL, NULL, 0, (PVOID)&ModuleObject, &ImageBase); - /* Release String */ - ReleaseCapturedUnicodeString(&ImageName, PreviousMode); - if (!NT_SUCCESS(Status)) return Status; /* Get the headers */ @@ -1658,7 +1681,7 @@ /* Call it */ Status = (DriverInit)(&Win32k, NULL); ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); - +__debugbreak();__debugbreak(); /* Unload if we failed */ if (!NT_SUCCESS(Status)) MmUnloadSystemImage(ModuleObject); return Status; Modified: trunk/reactos/ntoskrnl/ps/thread.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/thread.c?rev=6…
============================================================================== --- trunk/reactos/ntoskrnl/ps/thread.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ps/thread.c [iso-8859-1] Wed Oct 23 19:31:41 2013 @@ -812,10 +812,22 @@ */ PVOID NTAPI -PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion(VOID) -{ +PsGetCurrentThreadWin32ThreadAndEnterCriticalRegion( + _Out_ HANDLE* OutProcessId) +{ + PETHREAD CurrentThread; + + /* Get the current thread */ + CurrentThread = PsGetCurrentThread(); + + /* Return the process id */ + *OutProcessId = CurrentThread->Cid.UniqueProcess; + + /* Enter critical region */ KeEnterCriticalRegion(); - return PsGetCurrentThread()->Tcb.Win32Thread; + + /* Return the win32 thread */ + return CurrentThread->Tcb.Win32Thread; } /*
11 years, 2 months
1
0
0
0
[tfaber] 60736: [MSPAINT][REGEDIT][WINLOGON] - Fix some potential buffer overruns
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Oct 23 11:39:00 2013 New Revision: 60736 URL:
http://svn.reactos.org/svn/reactos?rev=60736&view=rev
Log: [MSPAINT][REGEDIT][WINLOGON] - Fix some potential buffer overruns Modified: trunk/reactos/base/applications/mspaint/dialogs.c trunk/reactos/base/applications/regedit/framewnd.c trunk/reactos/base/system/winlogon/sas.c Modified: trunk/reactos/base/applications/mspaint/dialogs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mspaint/…
============================================================================== --- trunk/reactos/base/applications/mspaint/dialogs.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mspaint/dialogs.c [iso-8859-1] Wed Oct 23 11:39:00 2013 @@ -228,9 +228,9 @@ TCHAR strrcAngle[100]; BOOL tr1, tr2, tr3, tr4; - LoadString(hProgInstance, IDS_INTNUMBERS, strrcIntNumbers, sizeof(strrcIntNumbers)); - LoadString(hProgInstance, IDS_PERCENTAGE, strrcPercentage, sizeof(strrcPercentage)); - LoadString(hProgInstance, IDS_ANGLE, strrcAngle, sizeof(strrcAngle)); + LoadString(hProgInstance, IDS_INTNUMBERS, strrcIntNumbers, SIZEOF(strrcIntNumbers)); + LoadString(hProgInstance, IDS_PERCENTAGE, strrcPercentage, SIZEOF(strrcPercentage)); + LoadString(hProgInstance, IDS_ANGLE, strrcAngle, SIZEOF(strrcAngle)); stretchSkew.percentage.x = GetDlgItemInt(hwnd, IDD_STRETCHSKEWEDITHSTRETCH, &tr1, FALSE); stretchSkew.percentage.y = GetDlgItemInt(hwnd, IDD_STRETCHSKEWEDITVSTRETCH, &tr2, FALSE); Modified: trunk/reactos/base/applications/regedit/framewnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/regedit/…
============================================================================== --- trunk/reactos/base/applications/regedit/framewnd.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/regedit/framewnd.c [iso-8859-1] Wed Oct 23 11:39:00 2013 @@ -249,9 +249,9 @@ c = 0; for(i = 0; i < PairCount; i++) { - c += LoadStringW(hInst, Pairs[i].DisplayID, &Filter[c], 255 * sizeof(WCHAR)); + c += LoadStringW(hInst, Pairs[i].DisplayID, &Filter[c], 255); Filter[++c] = L'\0'; - c += LoadStringW(hInst, Pairs[i].FilterID, &Filter[c], 255 * sizeof(WCHAR)); + c += LoadStringW(hInst, Pairs[i].FilterID, &Filter[c], 255); Filter[++c] = L'\0'; } Filter[++c] = L'\0'; @@ -360,7 +360,7 @@ /* build the "All Files" filter up */ filter.DisplayID = IDS_FLT_ALLFILES; filter.FilterID = IDS_FLT_ALLFILES_FLT; - BuildFilterStrings(Filter, &filter, sizeof(filter)); + BuildFilterStrings(Filter, &filter, 1); ofn.lpstrFilter = Filter; /* load and set the caption and flags for dialog */ LoadStringW(hInst, IDS_LOAD_HIVE, Caption, COUNT_OF(Caption)); Modified: trunk/reactos/base/system/winlogon/sas.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/winlogon/sas.c…
============================================================================== --- trunk/reactos/base/system/winlogon/sas.c [iso-8859-1] (original) +++ trunk/reactos/base/system/winlogon/sas.c [iso-8859-1] Wed Oct 23 11:39:00 2013 @@ -438,7 +438,7 @@ { //WCHAR StatusMsg[256]; WARN("WL: WlxActivateUserShell() failed\n"); - //LoadStringW(hAppInstance, IDS_FAILEDACTIVATEUSERSHELL, StatusMsg, sizeof(StatusMsg)); + //LoadStringW(hAppInstance, IDS_FAILEDACTIVATEUSERSHELL, StatusMsg, sizeof(StatusMsg) / sizeof(StatusMsg[0])); //MessageBoxW(0, StatusMsg, NULL, MB_ICONERROR); goto cleanup; }
11 years, 2 months
1
0
0
0
[aandrejevic] 60735: Sync with trunk for console graphics palettes.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Wed Oct 23 00:26:50 2013 New Revision: 60735 URL:
http://svn.reactos.org/svn/reactos?rev=60735&view=rev
Log: Sync with trunk for console graphics palettes. Added: branches/ntvdm/lib/rtl/memstream.c - copied unchanged from r60734, trunk/reactos/lib/rtl/memstream.c Modified: branches/ntvdm/ (props changed) branches/ntvdm/base/applications/mspaint/drawing.c branches/ntvdm/base/setup/usetup/lang/es-ES.h branches/ntvdm/base/shell/explorer/CMakeLists.txt branches/ntvdm/base/shell/explorer/explorer.cpp branches/ntvdm/base/shell/explorer/globals.h branches/ntvdm/base/shell/explorer/shell/shellbrowser.cpp branches/ntvdm/base/shell/explorer/shell/shellbrowser.h branches/ntvdm/base/shell/explorer/taskbar/desktopbar.cpp branches/ntvdm/base/shell/explorer/taskbar/startmenu.cpp branches/ntvdm/base/shell/explorer/taskbar/taskbar.cpp branches/ntvdm/base/shell/explorer/taskbar/traynotify.cpp branches/ntvdm/base/shell/explorer/utility/shellclasses.cpp branches/ntvdm/base/shell/explorer/utility/shellclasses.h branches/ntvdm/dll/ntdll/CMakeLists.txt branches/ntvdm/dll/ntdll/def/ntdll.spec branches/ntvdm/dll/win32/samsrv/samrpc.c branches/ntvdm/dll/win32/samsrv/samsrv.h branches/ntvdm/dll/win32/samsrv/security.c branches/ntvdm/dll/win32/samsrv/setup.c branches/ntvdm/dll/win32/shell32/shellord.cpp branches/ntvdm/drivers/hid/hidparse/ (props changed) branches/ntvdm/drivers/hid/hidusb/ (props changed) branches/ntvdm/drivers/usb/usbehci/ (props changed) branches/ntvdm/drivers/usb/usbhub/ (props changed) branches/ntvdm/drivers/usb/usbohci/ (props changed) branches/ntvdm/include/ddk/ntsam.h branches/ntvdm/include/ndk/rtlfuncs.h branches/ntvdm/include/ndk/rtltypes.h branches/ntvdm/include/reactos/idl/sam.idl branches/ntvdm/lib/drivers/libusb/common_interfaces.h (props changed) branches/ntvdm/lib/drivers/libusb/hcd_controller.cpp (props changed) branches/ntvdm/lib/drivers/libusb/hub_controller.cpp (props changed) branches/ntvdm/lib/drivers/libusb/libusb.cpp (props changed) branches/ntvdm/lib/drivers/libusb/libusb.h (props changed) branches/ntvdm/lib/drivers/libusb/memory_manager.cpp (props changed) branches/ntvdm/lib/drivers/libusb/misc.cpp (props changed) branches/ntvdm/lib/drivers/libusb/purecall.cpp (props changed) branches/ntvdm/lib/drivers/libusb/usb_device.cpp (props changed) branches/ntvdm/lib/rtl/CMakeLists.txt branches/ntvdm/ntoskrnl/include/internal/i386/asmmacro.S branches/ntvdm/ntoskrnl/include/internal/i386/ke.h branches/ntvdm/ntoskrnl/include/internal/i386/mm.h branches/ntvdm/ntoskrnl/include/internal/i386/trap_x.h branches/ntvdm/ntoskrnl/include/internal/ke.h branches/ntvdm/ntoskrnl/ke/i386/cpu.c branches/ntvdm/ntoskrnl/ke/i386/exp.c branches/ntvdm/ntoskrnl/ke/i386/patpge.c branches/ntvdm/ntoskrnl/ke/i386/trap.s branches/ntvdm/ntoskrnl/ke/i386/traphdlr.c branches/ntvdm/ntoskrnl/ke/i386/usercall.c branches/ntvdm/ntoskrnl/ke/i386/usercall_asm.S branches/ntvdm/ntoskrnl/ke/time.c branches/ntvdm/win32ss/gdi/ntgdi/gdiobj.c branches/ntvdm/win32ss/gdi/ntgdi/gdiobj.h branches/ntvdm/win32ss/include/ntuser.h branches/ntvdm/win32ss/user/ntuser/desktop.c branches/ntvdm/win32ss/user/ntuser/desktop.h branches/ntvdm/win32ss/user/ntuser/focus.c branches/ntvdm/win32ss/user/ntuser/focus.h branches/ntvdm/win32ss/user/ntuser/input.c branches/ntvdm/win32ss/user/ntuser/input.h branches/ntvdm/win32ss/user/ntuser/keyboard.c branches/ntvdm/win32ss/user/ntuser/main.c branches/ntvdm/win32ss/user/ntuser/message.c branches/ntvdm/win32ss/user/ntuser/misc.c branches/ntvdm/win32ss/user/ntuser/msgqueue.c branches/ntvdm/win32ss/user/ntuser/msgqueue.h branches/ntvdm/win32ss/user/ntuser/ntstubs.c branches/ntvdm/win32ss/user/ntuser/object.c branches/ntvdm/win32ss/user/ntuser/object.h branches/ntvdm/win32ss/user/ntuser/window.c branches/ntvdm/win32ss/user/ntuser/winpos.c branches/ntvdm/win32ss/user/user32/windows/prop.c branches/ntvdm/win32ss/user/winsrv/consrv/condrv/conoutput.c branches/ntvdm/win32ss/user/winsrv/consrv/condrv/text.c branches/ntvdm/win32ss/user/winsrv/consrv/conoutput.c branches/ntvdm/win32ss/user/winsrv/consrv/conoutput.h branches/ntvdm/win32ss/user/winsrv/consrv/frontends/gui/graphics.c branches/ntvdm/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h branches/ntvdm/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c branches/ntvdm/win32ss/user/winsrv/consrv/frontends/gui/text.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/ntvdm/base/applications/mspaint/drawing.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/base/applications/mspaint…
Modified: branches/ntvdm/base/setup/usetup/lang/es-ES.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/base/setup/usetup/lang/es…
Modified: branches/ntvdm/base/shell/explorer/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/base/shell/explorer/CMake…
Modified: branches/ntvdm/base/shell/explorer/explorer.cpp URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/base/shell/explorer/explo…
Modified: branches/ntvdm/base/shell/explorer/globals.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/base/shell/explorer/globa…
Modified: branches/ntvdm/base/shell/explorer/shell/shellbrowser.cpp URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/base/shell/explorer/shell…
Modified: branches/ntvdm/base/shell/explorer/shell/shellbrowser.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/base/shell/explorer/shell…
Modified: branches/ntvdm/base/shell/explorer/taskbar/desktopbar.cpp URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/base/shell/explorer/taskb…
Modified: branches/ntvdm/base/shell/explorer/taskbar/startmenu.cpp URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/base/shell/explorer/taskb…
Modified: branches/ntvdm/base/shell/explorer/taskbar/taskbar.cpp URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/base/shell/explorer/taskb…
Modified: branches/ntvdm/base/shell/explorer/taskbar/traynotify.cpp URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/base/shell/explorer/taskb…
Modified: branches/ntvdm/base/shell/explorer/utility/shellclasses.cpp URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/base/shell/explorer/utili…
Modified: branches/ntvdm/base/shell/explorer/utility/shellclasses.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/base/shell/explorer/utili…
Modified: branches/ntvdm/dll/ntdll/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/dll/ntdll/CMakeLists.txt?…
Modified: branches/ntvdm/dll/ntdll/def/ntdll.spec URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/dll/ntdll/def/ntdll.spec?…
Modified: branches/ntvdm/dll/win32/samsrv/samrpc.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/dll/win32/samsrv/samrpc.c…
Modified: branches/ntvdm/dll/win32/samsrv/samsrv.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/dll/win32/samsrv/samsrv.h…
Modified: branches/ntvdm/dll/win32/samsrv/security.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/dll/win32/samsrv/security…
Modified: branches/ntvdm/dll/win32/samsrv/setup.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/dll/win32/samsrv/setup.c?…
Modified: branches/ntvdm/dll/win32/shell32/shellord.cpp URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/dll/win32/shell32/shellor…
Modified: branches/ntvdm/include/ddk/ntsam.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/include/ddk/ntsam.h?rev=6…
Modified: branches/ntvdm/include/ndk/rtlfuncs.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/include/ndk/rtlfuncs.h?re…
Modified: branches/ntvdm/include/ndk/rtltypes.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/include/ndk/rtltypes.h?re…
Modified: branches/ntvdm/include/reactos/idl/sam.idl URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/include/reactos/idl/sam.i…
Modified: branches/ntvdm/lib/rtl/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/rtl/CMakeLists.txt?re…
Modified: branches/ntvdm/ntoskrnl/include/internal/i386/asmmacro.S URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/ntoskrnl/include/internal…
Modified: branches/ntvdm/ntoskrnl/include/internal/i386/ke.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/ntoskrnl/include/internal…
Modified: branches/ntvdm/ntoskrnl/include/internal/i386/mm.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/ntoskrnl/include/internal…
Modified: branches/ntvdm/ntoskrnl/include/internal/i386/trap_x.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/ntoskrnl/include/internal…
Modified: branches/ntvdm/ntoskrnl/include/internal/ke.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/ntoskrnl/include/internal…
Modified: branches/ntvdm/ntoskrnl/ke/i386/cpu.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/ntoskrnl/ke/i386/cpu.c?re…
Modified: branches/ntvdm/ntoskrnl/ke/i386/exp.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/ntoskrnl/ke/i386/exp.c?re…
Modified: branches/ntvdm/ntoskrnl/ke/i386/patpge.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/ntoskrnl/ke/i386/patpge.c…
Modified: branches/ntvdm/ntoskrnl/ke/i386/trap.s URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/ntoskrnl/ke/i386/trap.s?r…
Modified: branches/ntvdm/ntoskrnl/ke/i386/traphdlr.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/ntoskrnl/ke/i386/traphdlr…
Modified: branches/ntvdm/ntoskrnl/ke/i386/usercall.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/ntoskrnl/ke/i386/usercall…
Modified: branches/ntvdm/ntoskrnl/ke/i386/usercall_asm.S URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/ntoskrnl/ke/i386/usercall…
Modified: branches/ntvdm/ntoskrnl/ke/time.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/ntoskrnl/ke/time.c?rev=60…
Modified: branches/ntvdm/win32ss/gdi/ntgdi/gdiobj.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/gdi/ntgdi/gdiobj.…
Modified: branches/ntvdm/win32ss/gdi/ntgdi/gdiobj.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/gdi/ntgdi/gdiobj.…
Modified: branches/ntvdm/win32ss/include/ntuser.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/include/ntuser.h?…
Modified: branches/ntvdm/win32ss/user/ntuser/desktop.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/deskt…
Modified: branches/ntvdm/win32ss/user/ntuser/desktop.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/deskt…
Modified: branches/ntvdm/win32ss/user/ntuser/focus.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/focus…
Modified: branches/ntvdm/win32ss/user/ntuser/focus.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/focus…
Modified: branches/ntvdm/win32ss/user/ntuser/input.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/input…
Modified: branches/ntvdm/win32ss/user/ntuser/input.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/input…
Modified: branches/ntvdm/win32ss/user/ntuser/keyboard.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/keybo…
Modified: branches/ntvdm/win32ss/user/ntuser/main.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/main.…
Modified: branches/ntvdm/win32ss/user/ntuser/message.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/messa…
Modified: branches/ntvdm/win32ss/user/ntuser/misc.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/misc.…
Modified: branches/ntvdm/win32ss/user/ntuser/msgqueue.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/msgqu…
Modified: branches/ntvdm/win32ss/user/ntuser/msgqueue.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/msgqu…
Modified: branches/ntvdm/win32ss/user/ntuser/ntstubs.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/ntstu…
Modified: branches/ntvdm/win32ss/user/ntuser/object.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/objec…
Modified: branches/ntvdm/win32ss/user/ntuser/object.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/objec…
Modified: branches/ntvdm/win32ss/user/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/windo…
Modified: branches/ntvdm/win32ss/user/ntuser/winpos.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/ntuser/winpo…
Modified: branches/ntvdm/win32ss/user/user32/windows/prop.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/user32/windo…
Modified: branches/ntvdm/win32ss/user/winsrv/consrv/condrv/conoutput.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/winsrv/consr…
Modified: branches/ntvdm/win32ss/user/winsrv/consrv/condrv/text.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/winsrv/consr…
Modified: branches/ntvdm/win32ss/user/winsrv/consrv/conoutput.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/winsrv/consr…
Modified: branches/ntvdm/win32ss/user/winsrv/consrv/conoutput.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/winsrv/consr…
Modified: branches/ntvdm/win32ss/user/winsrv/consrv/frontends/gui/graphics.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/winsrv/consr…
Modified: branches/ntvdm/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/winsrv/consr…
Modified: branches/ntvdm/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/winsrv/consr…
Modified: branches/ntvdm/win32ss/user/winsrv/consrv/frontends/gui/text.c URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/win32ss/user/winsrv/consr…
11 years, 2 months
1
0
0
0
[hbelusca] 60734: [CONSRV]: Fix console palette setting. For that, we create a console framebuffer on which we draw the different active screen buffers (be they text or graphics), we can change the...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed Oct 23 00:12:17 2013 New Revision: 60734 URL:
http://svn.reactos.org/svn/reactos?rev=60734&view=rev
Log: [CONSRV]: Fix console palette setting. For that, we create a console framebuffer on which we draw the different active screen buffers (be they text or graphics), we can change the palette associated to this framebuffer and then we draw the framebuffer on screen. Console palettes now work !!!!!! @ [TheFlash] Part 2/2 Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/text.c trunk/reactos/win32ss/user/winsrv/consrv/conoutput.h trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/condrv/text.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/text.c [iso-8859-1] Wed Oct 23 00:12:17 2013 @@ -1340,6 +1340,8 @@ Buffer->ViewSize.X = CapturedWindowRect.Right - CapturedWindowRect.Left + 1; Buffer->ViewSize.Y = CapturedWindowRect.Bottom - CapturedWindowRect.Top + 1; + // TermResizeTerminal(Console); + return STATUS_SUCCESS; } Modified: trunk/reactos/win32ss/user/winsrv/consrv/conoutput.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/conoutput.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/conoutput.h [iso-8859-1] Wed Oct 23 00:12:17 2013 @@ -40,7 +40,7 @@ VOID NTAPI ConioDeleteScreenBuffer(PCONSOLE_SCREEN_BUFFER Buffer); // VOID FASTCALL ConioSetActiveScreenBuffer(PCONSOLE_SCREEN_BUFFER Buffer); -// PCONSOLE_SCREEN_BUFFER -// ConDrvGetActiveScreenBuffer(IN PCONSOLE Console); +PCONSOLE_SCREEN_BUFFER +ConDrvGetActiveScreenBuffer(IN PCONSOLE Console); /* EOF */ Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c [iso-8859-1] Wed Oct 23 00:12:17 2013 @@ -46,10 +46,15 @@ VOID GuiPaintGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, PGUI_CONSOLE_DATA GuiData, - HDC hDC, - PRECT rc) + PRECT rcView, + PRECT rcFramebuffer) { if (Buffer->BitMap == NULL) return; + + rcFramebuffer->left = Buffer->ViewOrigin.X * 1 + rcView->left; + rcFramebuffer->top = Buffer->ViewOrigin.Y * 1 + rcView->top; + rcFramebuffer->right = Buffer->ViewOrigin.X * 1 + rcView->right; + rcFramebuffer->bottom = Buffer->ViewOrigin.Y * 1 + rcView->bottom; /* Grab the mutex */ NtWaitForSingleObject(Buffer->Mutex, FALSE, NULL); @@ -59,15 +64,15 @@ * the Y-coordinate of the "lower-left corner" of the image, be the DIB * in bottom-up or top-down mode. */ - SetDIBitsToDevice(hDC, - /* Coordinates / size of the repainted rectangle, in the view's frame */ - rc->left, - rc->top, - rc->right - rc->left, - rc->bottom - rc->top, + SetDIBitsToDevice(GuiData->hMemDC, + /* Coordinates / size of the repainted rectangle, in the framebuffer's frame */ + rcFramebuffer->left, + rcFramebuffer->top, + rcFramebuffer->right - rcFramebuffer->left, + rcFramebuffer->bottom - rcFramebuffer->top, /* Coordinates / size of the corresponding image portion, in the graphics screen-buffer's frame */ - Buffer->ViewOrigin.X + rc->left, - Buffer->ViewOrigin.Y + rc->top, + rcFramebuffer->left, + rcFramebuffer->top, 0, Buffer->ScreenBufferSize.Y, // == Buffer->BitMapInfo->bmiHeader.biHeight Buffer->BitMap, Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h [iso-8859-1] Wed Oct 23 00:12:17 2013 @@ -41,20 +41,22 @@ { CRITICAL_SECTION Lock; BOOL WindowSizeLock; + HANDLE hGuiInitEvent; - HANDLE hGuiInitEvent; POINT OldCursor; - - HWND hWindow; /* Handle to the console's window */ - HICON hIcon; /* Handle to the console's icon (big) */ - HICON hIconSm; /* Handle to the console's icon (small) */ LONG_PTR WndStyle; LONG_PTR WndStyleEx; BOOL IsWndMax; WINDOWPLACEMENT WndPl; - HPALETTE hSysPalette; /* Handle to the original system palette */ + HWND hWindow; /* Handle to the console's window */ + HDC hMemDC; /* Memory DC holding the console framebuffer */ + HBITMAP hBitmap; /* Console framebuffer */ + HPALETTE hSysPalette; /* Handle to the original system palette */ + + HICON hIcon; /* Handle to the console's icon (big) */ + HICON hIconSm; /* Handle to the console's icon (small) */ /*** The following may be put per-screen-buffer !! ***/ HCURSOR hCursor; /* Handle to the mouse cursor */ Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
============================================================================== --- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1] Wed Oct 23 00:12:17 2013 @@ -250,7 +250,7 @@ static VOID NTAPI GuiDrawRegion(IN OUT PFRONTEND This, SMALL_RECT* Region); static VOID -GuiConsoleResizeWindow(PGUI_CONSOLE_DATA GuiData); +GuiConsoleResizeWindow(PGUI_CONSOLE_DATA GuiData, DWORD WidthUnit, DWORD HeightUnit); static LRESULT @@ -265,7 +265,6 @@ Ret = FALSE; goto Quit; } - // ActiveBuffer = ConDrvGetActiveScreenBuffer(Console); ActiveBuffer = GuiData->ActiveBuffer; /* @@ -412,16 +411,12 @@ } static VOID -GuiConsoleResizeWindow(PGUI_CONSOLE_DATA GuiData) -{ - // PCONSOLE Console = GuiData->Console; - PCONSOLE_SCREEN_BUFFER Buff = GuiData->ActiveBuffer; // ConDrvGetActiveScreenBuffer(Console); +GuiConsoleResizeWindow(PGUI_CONSOLE_DATA GuiData, DWORD WidthUnit, DWORD HeightUnit) +{ + PCONSOLE_SCREEN_BUFFER Buff = GuiData->ActiveBuffer; SCROLLINFO sInfo; DWORD Width, Height; - UINT WidthUnit, HeightUnit; - - GetScreenBufferSizeUnits(Buff, GuiData, &WidthUnit, &HeightUnit); Width = Buff->ViewSize.X * WidthUnit + 2 * (GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXEDGE)); @@ -551,6 +546,11 @@ ReleaseDC(GuiData->hWindow, hDC); + /* Initialize the terminal framebuffer */ + GuiData->hMemDC = CreateCompatibleDC(NULL); + GuiData->hBitmap = NULL; + GuiData->hSysPalette = NULL; /* Original system palette */ + // FIXME: Keep these instructions here ? /////////////////////////////////// Console->ActiveBuffer->CursorBlinkOn = TRUE; Console->ActiveBuffer->ForceCursorOff = FALSE; @@ -570,8 +570,7 @@ static VOID SmallRectToRect(PGUI_CONSOLE_DATA GuiData, PRECT Rect, PSMALL_RECT SmallRect) { - // PCONSOLE Console = GuiData->Console; - PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; // ConDrvGetActiveScreenBuffer(Console); + PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; UINT WidthUnit, HeightUnit; GetScreenBufferSizeUnits(Buffer, GuiData, &WidthUnit, &HeightUnit); @@ -647,13 +646,13 @@ VOID GuiPaintTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, PGUI_CONSOLE_DATA GuiData, - HDC hDC, - PRECT rc); + PRECT rcView, + PRECT rcFramebuffer); VOID GuiPaintGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, PGUI_CONSOLE_DATA GuiData, - HDC hDC, - PRECT rc); + PRECT rcView, + PRECT rcFramebuffer); static VOID GuiConsoleHandlePaint(PGUI_CONSOLE_DATA GuiData) @@ -661,49 +660,54 @@ BOOL Success = TRUE; PCONSOLE Console = GuiData->Console; PCONSOLE_SCREEN_BUFFER ActiveBuffer; - HDC hDC; PAINTSTRUCT ps; + RECT rcPaint; if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) { Success = FALSE; goto Quit; } - // ActiveBuffer = ConDrvGetActiveScreenBuffer(Console); ActiveBuffer = GuiData->ActiveBuffer; - hDC = BeginPaint(GuiData->hWindow, &ps); - if (hDC != NULL && + BeginPaint(GuiData->hWindow, &ps); + if (ps.hdc != NULL && ps.rcPaint.left < ps.rcPaint.right && ps.rcPaint.top < ps.rcPaint.bottom) { EnterCriticalSection(&GuiData->Lock); + /* Compose the current screen-buffer on-memory */ if (GetType(ActiveBuffer) == TEXTMODE_BUFFER) { GuiPaintTextModeBuffer((PTEXTMODE_SCREEN_BUFFER)ActiveBuffer, - GuiData, hDC, &ps.rcPaint); + GuiData, &ps.rcPaint, &rcPaint); } else /* if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) */ { GuiPaintGraphicsBuffer((PGRAPHICS_SCREEN_BUFFER)ActiveBuffer, - GuiData, hDC, &ps.rcPaint); - } + GuiData, &ps.rcPaint, &rcPaint); + } + + /* Send it to screen */ + BitBlt(ps.hdc, + ps.rcPaint.left, + ps.rcPaint.top, + rcPaint.right - rcPaint.left, + rcPaint.bottom - rcPaint.top, + GuiData->hMemDC, + rcPaint.left, + rcPaint.top, + SRCCOPY); if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) { - RECT rc; - SmallRectToRect(GuiData, &rc, &Console->Selection.srSelection); - - /* invert the selection */ - if (IntersectRect(&rc, &ps.rcPaint, &rc)) - { - PatBlt(hDC, - rc.left, - rc.top, - rc.right - rc.left, - rc.bottom - rc.top, - DSTINVERT); + SmallRectToRect(GuiData, &rcPaint, &Console->Selection.srSelection); + + /* Invert the selection */ + if (IntersectRect(&rcPaint, &ps.rcPaint, &rcPaint)) + { + InvertRect(ps.hdc, &rcPaint); } } @@ -751,7 +755,6 @@ if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; - // ActiveBuffer = ConDrvGetActiveScreenBuffer(Console); ActiveBuffer = GuiData->ActiveBuffer; if (Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) @@ -924,14 +927,15 @@ if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; - Buff = GuiData->ActiveBuffer; // ConDrvGetActiveScreenBuffer(Console); + Buff = GuiData->ActiveBuffer; if (GetType(Buff) == TEXTMODE_BUFFER) { GuiInvalidateCell(&Console->TermIFace, Buff->CursorPosition.X, Buff->CursorPosition.Y); Buff->CursorBlinkOn = !Buff->CursorBlinkOn; - if ((GuiData->OldCursor.x != Buff->CursorPosition.X) || (GuiData->OldCursor.y != Buff->CursorPosition.Y)) + if ((GuiData->OldCursor.x != Buff->CursorPosition.X) || + (GuiData->OldCursor.y != Buff->CursorPosition.Y)) { SCROLLINFO xScroll; int OldScrollX = -1, OldScrollY = -1; @@ -946,11 +950,14 @@ // If we successfully got the info for the horizontal scrollbar if (OldScrollX >= 0) { - if ((Buff->CursorPosition.X < Buff->ViewOrigin.X) || (Buff->CursorPosition.X >= (Buff->ViewOrigin.X + Buff->ViewSize.X))) + if ((Buff->CursorPosition.X < Buff->ViewOrigin.X) || + (Buff->CursorPosition.X >= (Buff->ViewOrigin.X + Buff->ViewSize.X))) { // Handle the horizontal scroll bar - if (Buff->CursorPosition.X >= Buff->ViewSize.X) NewScrollX = Buff->CursorPosition.X - Buff->ViewSize.X + 1; - else NewScrollX = 0; + if (Buff->CursorPosition.X >= Buff->ViewSize.X) + NewScrollX = Buff->CursorPosition.X - Buff->ViewSize.X + 1; + else + NewScrollX = 0; } else { @@ -960,11 +967,14 @@ // If we successfully got the info for the vertical scrollbar if (OldScrollY >= 0) { - if ((Buff->CursorPosition.Y < Buff->ViewOrigin.Y) || (Buff->CursorPosition.Y >= (Buff->ViewOrigin.Y + Buff->ViewSize.Y))) + if ((Buff->CursorPosition.Y < Buff->ViewOrigin.Y) || + (Buff->CursorPosition.Y >= (Buff->ViewOrigin.Y + Buff->ViewSize.Y))) { // Handle the vertical scroll bar - if (Buff->CursorPosition.Y >= Buff->ViewSize.Y) NewScrollY = Buff->CursorPosition.Y - Buff->ViewSize.Y + 1; - else NewScrollY = 0; + if (Buff->CursorPosition.Y >= Buff->ViewSize.Y) + NewScrollY = Buff->CursorPosition.Y - Buff->ViewSize.Y + 1; + else + NewScrollY = 0; } else { @@ -999,6 +1009,7 @@ SetScrollInfo(GuiData->hWindow, SB_VERT, &xScroll, TRUE); } UpdateWindow(GuiData->hWindow); + // InvalidateRect(GuiData->hWindow, NULL, FALSE); GuiData->OldCursor.x = Buff->CursorPosition.X; GuiData->OldCursor.y = Buff->CursorPosition.Y; } @@ -1035,9 +1046,20 @@ static LRESULT GuiConsoleHandleNcDestroy(HWND hWnd) { + PGUI_CONSOLE_DATA GuiData = GuiGetGuiData(hWnd); + KillTimer(hWnd, CONGUI_UPDATE_TIMER); GetSystemMenu(hWnd, TRUE); + if (GuiData) + { + /* Free the terminal framebuffer */ + if (GuiData->hMemDC ) DeleteDC(GuiData->hMemDC); + if (GuiData->hBitmap) DeleteObject(GuiData->hBitmap); + // if (GuiData->hSysPalette) DeleteObject(GuiData->hSysPalette); + if (GuiData->Font) DeleteObject(GuiData->Font); + } + /* Free the GuiData registration */ SetWindowLongPtrW(hWnd, GWLP_USERDATA, (DWORD_PTR)NULL); @@ -1047,8 +1069,7 @@ static COORD PointToCoord(PGUI_CONSOLE_DATA GuiData, LPARAM lParam) { - // PCONSOLE Console = GuiData->Console; - PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; // ConDrvGetActiveScreenBuffer(Console); + PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; COORD Coord; UINT WidthUnit, HeightUnit; @@ -1327,7 +1348,7 @@ if (OpenClipboard(GuiData->hWindow) == TRUE) { PCONSOLE Console = GuiData->Console; - PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; // ConDrvGetActiveScreenBuffer(Console); + PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; if (GetType(Buffer) == TEXTMODE_BUFFER) { @@ -1354,8 +1375,7 @@ { if (OpenClipboard(GuiData->hWindow) == TRUE) { - // PCONSOLE Console = GuiData->Console; - PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; // ConDrvGetActiveScreenBuffer(Console); + PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; if (GetType(Buffer) == TEXTMODE_BUFFER) { @@ -1380,7 +1400,6 @@ if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; - // ActiveBuffer = ConDrvGetActiveScreenBuffer(Console); ActiveBuffer = GuiData->ActiveBuffer; GetScreenBufferSizeUnits(ActiveBuffer, GuiData, &WidthUnit, &HeightUnit); @@ -1413,7 +1432,7 @@ if ((GuiData->WindowSizeLock == FALSE) && (wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED || wParam == SIZE_MINIMIZED)) { - PCONSOLE_SCREEN_BUFFER Buff = GuiData->ActiveBuffer; // ConDrvGetActiveScreenBuffer(Console); + PCONSOLE_SCREEN_BUFFER Buff = GuiData->ActiveBuffer; DWORD windx, windy, charx, chary; UINT WidthUnit, HeightUnit; @@ -1453,7 +1472,7 @@ Buff->ViewSize.Y = (chary <= Buff->ScreenBufferSize.Y) ? chary : Buff->ScreenBufferSize.Y; } - GuiConsoleResizeWindow(GuiData); + GuiConsoleResizeWindow(GuiData, WidthUnit, HeightUnit); // Adjust the start of the visible area if we are attempting to show nonexistent areas if ((Buff->ScreenBufferSize.X - Buff->ViewOrigin.X) < Buff->ViewSize.X) Buff->ViewOrigin.X = Buff->ScreenBufferSize.X - Buff->ViewSize.X; @@ -1507,7 +1526,7 @@ if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return 0; - Buff = GuiData->ActiveBuffer; // ConDrvGetActiveScreenBuffer(Console); + Buff = GuiData->ActiveBuffer; if (uMsg == WM_HSCROLL) { @@ -1595,6 +1614,7 @@ SetScrollInfo(GuiData->hWindow, fnBar, &sInfo, TRUE); UpdateWindow(GuiData->hWindow); + // InvalidateRect(GuiData->hWindow, NULL, FALSE); } Quit: @@ -1697,7 +1717,7 @@ case WM_PALETTECHANGED: { - PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; // ConDrvGetActiveScreenBuffer(GuiData->Console); + PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; DPRINT1("WM_PALETTECHANGED called\n"); @@ -1721,19 +1741,13 @@ // if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) if (ActiveBuffer->PaletteHandle) { - /* Get the Device Context of the console window */ - HDC hDC = GetDC(GuiData->hWindow); - DPRINT1("WM_PALETTECHANGED changing palette\n"); - /* Specify the use of the system palette */ - SetSystemPaletteUse(hDC, ActiveBuffer->PaletteUsage); + /* Specify the use of the system palette for the framebuffer */ + SetSystemPaletteUse(GuiData->hMemDC, ActiveBuffer->PaletteUsage); /* Realize the (logical) palette */ - RealizePalette(hDC); - - /* Release the Device Context and return */ - ReleaseDC(GuiData->hWindow, hDC); + RealizePalette(GuiData->hMemDC); } DPRINT1("WM_PALETTECHANGED quit\n"); @@ -1966,9 +1980,32 @@ case PM_RESIZE_TERMINAL: { + PCONSOLE_SCREEN_BUFFER Buff = GuiData->ActiveBuffer; + HDC hDC; + HBITMAP hnew, hold; + + DWORD Width, Height; + UINT WidthUnit, HeightUnit; + + GetScreenBufferSizeUnits(Buff, GuiData, &WidthUnit, &HeightUnit); + + Width = Buff->ScreenBufferSize.X * WidthUnit ; + Height = Buff->ScreenBufferSize.Y * HeightUnit; + + /* Recreate the framebuffer */ + hDC = GetDC(GuiData->hWindow); + hnew = CreateCompatibleBitmap(hDC, Width, Height); + ReleaseDC(GuiData->hWindow, hDC); + hold = SelectObject(GuiData->hMemDC, hnew); + if (GuiData->hBitmap) + { + if (hold == GuiData->hBitmap) DeleteObject(GuiData->hBitmap); + } + GuiData->hBitmap = hnew; + /* Resize the window to the user's values */ GuiData->WindowSizeLock = TRUE; - GuiConsoleResizeWindow(GuiData); + GuiConsoleResizeWindow(GuiData, WidthUnit, HeightUnit); GuiData->WindowSizeLock = FALSE; break; } @@ -2063,9 +2100,7 @@ /* Move and resize the window to the user's values */ /* CAN WE DEADLOCK ?? */ GuiConsoleMoveWindow(GuiData); - GuiData->WindowSizeLock = TRUE; - GuiConsoleResizeWindow(GuiData); - GuiData->WindowSizeLock = FALSE; + SendMessageW(GuiData->hWindow, PM_RESIZE_TERMINAL, 0, 0); /* Switch to full-screen mode if necessary */ if (GuiData->GuiInfo.FullScreen) SwitchFullScreen(GuiData, TRUE); @@ -2423,9 +2458,6 @@ } } - /* Original system palette */ - GuiData->hSysPalette = NULL; - /* Mouse is shown by default with its default cursor shape */ GuiData->hCursor = ghDefaultCursor; GuiData->MouseCursorRefCount = 0; @@ -2511,6 +2543,7 @@ SmallRectToRect(GuiData, &RegionRect, Region); /* Do not erase the background: it speeds up redrawing and reduce flickering */ InvalidateRect(GuiData->hWindow, &RegionRect, FALSE); + /**UpdateWindow(GuiData->hWindow);**/ } static VOID NTAPI @@ -2529,7 +2562,7 @@ if (NULL == GuiData || NULL == GuiData->hWindow) return; - Buff = GuiData->ActiveBuffer; // ConDrvGetActiveScreenBuffer(GuiData->Console); + Buff = GuiData->ActiveBuffer; if (GetType(Buff) != TEXTMODE_BUFFER) return; if (0 != ScrolledLines) @@ -2578,7 +2611,7 @@ { PGUI_CONSOLE_DATA GuiData = This->Data; - if (/*ConDrvGetActiveScreenBuffer(GuiData->Console)*/GuiData->ActiveBuffer == Buff) + if (GuiData->ActiveBuffer == Buff) { GuiInvalidateCell(This, Buff->CursorPosition.X, Buff->CursorPosition.Y); } @@ -2594,7 +2627,7 @@ { PGUI_CONSOLE_DATA GuiData = This->Data; - if (/*ConDrvGetActiveScreenBuffer(GuiData->Console)*/GuiData->ActiveBuffer == Buff) + if (GuiData->ActiveBuffer == Buff) { /* Redraw char at old position (remove cursor) */ GuiInvalidateCell(This, OldCursorX, OldCursorY); @@ -2611,11 +2644,6 @@ PGUI_CONSOLE_DATA GuiData = This->Data; /* Resize the window to the user's values */ - // GuiData->WindowSizeLock = TRUE; - // GuiConsoleResizeWindow(GuiData); - // GuiData->WindowSizeLock = FALSE; - // NOTE: This code ^^ causes deadlocks... - PostMessageW(GuiData->hWindow, PM_RESIZE_TERMINAL, 0, 0); } @@ -2623,15 +2651,14 @@ GuiSetActiveScreenBuffer(IN OUT PFRONTEND This) { PGUI_CONSOLE_DATA GuiData = This->Data; - PCONSOLE_SCREEN_BUFFER ActiveBuffer; // = GuiData->ActiveBuffer; // ConDrvGetActiveScreenBuffer(GuiData->Console); - HDC hDC; + PCONSOLE_SCREEN_BUFFER ActiveBuffer; HPALETTE hPalette; EnterCriticalSection(&GuiData->Lock); GuiData->WindowSizeLock = TRUE; InterlockedExchangePointer(&GuiData->ActiveBuffer, - GuiData->Console->ActiveBuffer); + ConDrvGetActiveScreenBuffer(GuiData->Console)); GuiData->WindowSizeLock = FALSE; LeaveCriticalSection(&GuiData->Lock); @@ -2650,20 +2677,14 @@ DPRINT1("GuiSetActiveScreenBuffer using palette 0x%p\n", hPalette); - /* Get the Device Context of the console window */ - hDC = GetDC(GuiData->hWindow); - - /* Set the new palette */ - SelectPalette(hDC, hPalette, FALSE); - - /* Specify the use of the system palette */ - SetSystemPaletteUse(hDC, ActiveBuffer->PaletteUsage); + /* Set the new palette for the framebuffer */ + SelectPalette(GuiData->hMemDC, hPalette, FALSE); + + /* Specify the use of the system palette for the framebuffer */ + SetSystemPaletteUse(GuiData->hMemDC, ActiveBuffer->PaletteUsage); /* Realize the (logical) palette */ - RealizePalette(hDC); - - /* Release the Device Context */ - ReleaseDC(GuiData->hWindow, hDC); + RealizePalette(GuiData->hMemDC); GuiResizeTerminal(This); // ConioDrawConsole(Console); @@ -2674,7 +2695,6 @@ IN PCONSOLE_SCREEN_BUFFER ScreenBuffer) { PGUI_CONSOLE_DATA GuiData = This->Data; - HDC hDC; /* * If we were notified to release a screen buffer that is not actually @@ -2690,18 +2710,12 @@ * it ONLY. */ - /* Get the Device Context of the console window */ - hDC = GetDC(GuiData->hWindow); - /* Release the old active palette and set the default one */ - if (GetCurrentObject(hDC, OBJ_PAL) == ScreenBuffer->PaletteHandle) + if (GetCurrentObject(GuiData->hMemDC, OBJ_PAL) == ScreenBuffer->PaletteHandle) { /* Set the new palette */ - SelectPalette(hDC, GuiData->hSysPalette, FALSE); - } - - /* Release the Device Context */ - ReleaseDC(GuiData->hWindow, hDC); + SelectPalette(GuiData->hMemDC, GuiData->hSysPalette, FALSE); + } /* Set the adequate active screen buffer */ if (ScreenBuffer != GuiData->Console->ActiveBuffer) @@ -2842,7 +2856,6 @@ return; } - // ActiveBuffer = ConDrvGetActiveScreenBuffer(GuiData->Console); ActiveBuffer = GuiData->ActiveBuffer; if (ActiveBuffer) { @@ -2873,54 +2886,26 @@ HPALETTE PaletteHandle, UINT PaletteUsage) { - BOOL Success = TRUE; PGUI_CONSOLE_DATA GuiData = This->Data; - // PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; // ConDrvGetActiveScreenBuffer(GuiData->Console); - HDC hDC; HPALETTE OldPalette; - DPRINT1("GuiSetPalette checkpt 0\n"); - - // if (GetType(ActiveBuffer) != GRAPHICS_BUFFER) return FALSE; + // if (GetType(GuiData->ActiveBuffer) != GRAPHICS_BUFFER) return FALSE; if (PaletteHandle == NULL) return FALSE; - DPRINT1("GuiSetPalette checkpt 1\n"); - - /* Get the Device Context of the console window */ - hDC = GetDC(GuiData->hWindow); - - DPRINT1("GuiSetPalette calling SelectPalette(0x%p, 0x%p, FALSE)\n", hDC, PaletteHandle); - - /* Set the new palette */ - OldPalette = SelectPalette(hDC, PaletteHandle, FALSE); - DPRINT1("OldPalette = 0x%p\n", OldPalette); - if (OldPalette == NULL) - { - DPRINT1("SelectPalette failed\n"); - Success = FALSE; - goto Quit; - } - - DPRINT1("GuiSetPalette checkpt 2\n"); - - /* Specify the use of the system palette */ - SetSystemPaletteUse(hDC, PaletteUsage); + /* Set the new palette for the framebuffer */ + OldPalette = SelectPalette(GuiData->hMemDC, PaletteHandle, FALSE); + if (OldPalette == NULL) return FALSE; + + /* Specify the use of the system palette for the framebuffer */ + SetSystemPaletteUse(GuiData->hMemDC, PaletteUsage); /* Realize the (logical) palette */ - RealizePalette(hDC); - - DPRINT1("GuiData->hSysPalette before == 0x%p\n", GuiData->hSysPalette); + RealizePalette(GuiData->hMemDC); /* Save the original system palette handle */ if (GuiData->hSysPalette == NULL) GuiData->hSysPalette = OldPalette; - DPRINT1("GuiData->hSysPalette after == 0x%p\n", GuiData->hSysPalette); - -Quit: - DPRINT1("GuiSetPalette Quit\n"); - /* Release the Device Context and return */ - ReleaseDC(GuiData->hWindow, hDC); - return Success; + return TRUE; } static ULONG NTAPI 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] Wed Oct 23 00:12:17 2013 @@ -185,8 +185,8 @@ VOID GuiPaintTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, PGUI_CONSOLE_DATA GuiData, - HDC hDC, - PRECT rc) + PRECT rcView, + PRECT rcFramebuffer) { PCONSOLE Console = Buffer->Header.Console; // ASSERT(Console == GuiData->Console); @@ -202,20 +202,25 @@ if (Buffer->Buffer == NULL) return; - TopLine = rc->top / GuiData->CharHeight + Buffer->ViewOrigin.Y; - BottomLine = (rc->bottom + (GuiData->CharHeight - 1)) / GuiData->CharHeight - 1 + Buffer->ViewOrigin.Y; - LeftChar = rc->left / GuiData->CharWidth + Buffer->ViewOrigin.X; - RightChar = (rc->right + (GuiData->CharWidth - 1)) / GuiData->CharWidth - 1 + Buffer->ViewOrigin.X; + rcFramebuffer->left = Buffer->ViewOrigin.X * GuiData->CharWidth + rcView->left; + rcFramebuffer->top = Buffer->ViewOrigin.Y * GuiData->CharHeight + rcView->top; + rcFramebuffer->right = Buffer->ViewOrigin.X * GuiData->CharWidth + rcView->right; + rcFramebuffer->bottom = Buffer->ViewOrigin.Y * GuiData->CharHeight + rcView->bottom; + + LeftChar = rcFramebuffer->left / GuiData->CharWidth; + TopLine = rcFramebuffer->top / GuiData->CharHeight; + RightChar = rcFramebuffer->right / GuiData->CharWidth; + BottomLine = rcFramebuffer->bottom / GuiData->CharHeight; + + if (RightChar >= Buffer->ScreenBufferSize.X) RightChar = Buffer->ScreenBufferSize.X - 1; + if (BottomLine >= Buffer->ScreenBufferSize.Y) BottomLine = Buffer->ScreenBufferSize.Y - 1; LastAttribute = ConioCoordToPointer(Buffer, LeftChar, TopLine)->Attributes; - SetTextColor(hDC, RGBFromAttrib(Console, TextAttribFromAttrib(LastAttribute))); - SetBkColor(hDC, RGBFromAttrib(Console, BkgdAttribFromAttrib(LastAttribute))); - - if (BottomLine >= Buffer->ScreenBufferSize.Y) BottomLine = Buffer->ScreenBufferSize.Y - 1; - if (RightChar >= Buffer->ScreenBufferSize.X) RightChar = Buffer->ScreenBufferSize.X - 1; - - OldFont = SelectObject(hDC, GuiData->Font); + SetTextColor(GuiData->hMemDC, RGBFromAttrib(Console, TextAttribFromAttrib(LastAttribute))); + SetBkColor(GuiData->hMemDC, RGBFromAttrib(Console, BkgdAttribFromAttrib(LastAttribute))); + + OldFont = SelectObject(GuiData->hMemDC, GuiData->Font); for (Line = TopLine; Line <= BottomLine; Line++) { @@ -232,9 +237,9 @@ */ if (From->Attributes != LastAttribute || (Char - Start == sizeof(LineBuffer) / sizeof(WCHAR))) { - TextOutW(hDC, - (Start - Buffer->ViewOrigin.X) * GuiData->CharWidth , - (Line - Buffer->ViewOrigin.Y) * GuiData->CharHeight, + TextOutW(GuiData->hMemDC, + Start * GuiData->CharWidth, + Line * GuiData->CharHeight, LineBuffer, Char - Start); Start = Char; @@ -242,8 +247,8 @@ Attribute = From->Attributes; if (Attribute != LastAttribute) { - SetTextColor(hDC, RGBFromAttrib(Console, TextAttribFromAttrib(Attribute))); - SetBkColor(hDC, RGBFromAttrib(Console, BkgdAttribFromAttrib(Attribute))); + SetTextColor(GuiData->hMemDC, RGBFromAttrib(Console, TextAttribFromAttrib(Attribute))); + SetBkColor(GuiData->hMemDC, RGBFromAttrib(Console, BkgdAttribFromAttrib(Attribute))); LastAttribute = Attribute; } } @@ -251,9 +256,9 @@ *(To++) = (From++)->Char.UnicodeChar; } - TextOutW(hDC, - (Start - Buffer->ViewOrigin.X) * GuiData->CharWidth , - (Line - Buffer->ViewOrigin.Y) * GuiData->CharHeight, + TextOutW(GuiData->hMemDC, + Start * GuiData->CharWidth, + Line * GuiData->CharHeight, LineBuffer, RightChar - Start + 1); } @@ -271,30 +276,25 @@ TopLine <= CursorY && CursorY <= BottomLine) { CursorHeight = ConioEffectiveCursorSize(Console, GuiData->CharHeight); + Attribute = ConioCoordToPointer(Buffer, Buffer->CursorPosition.X, Buffer->CursorPosition.Y)->Attributes; - - if (Attribute != DEFAULT_SCREEN_ATTRIB) - { - CursorBrush = CreateSolidBrush(RGBFromAttrib(Console, Attribute)); - } - else - { - CursorBrush = CreateSolidBrush(RGBFromAttrib(Console, Buffer->ScreenDefaultAttrib)); - } - - OldBrush = SelectObject(hDC, CursorBrush); - PatBlt(hDC, - (CursorX - Buffer->ViewOrigin.X) * GuiData->CharWidth, - (CursorY - Buffer->ViewOrigin.Y) * GuiData->CharHeight + (GuiData->CharHeight - CursorHeight), + if (Attribute == DEFAULT_SCREEN_ATTRIB) Attribute = Buffer->ScreenDefaultAttrib; + + CursorBrush = CreateSolidBrush(RGBFromAttrib(Console, Attribute)); + OldBrush = SelectObject(GuiData->hMemDC, CursorBrush); + + PatBlt(GuiData->hMemDC, + CursorX * GuiData->CharWidth, + CursorY * GuiData->CharHeight + (GuiData->CharHeight - CursorHeight), GuiData->CharWidth, CursorHeight, PATCOPY); - SelectObject(hDC, OldBrush); + SelectObject(GuiData->hMemDC, OldBrush); DeleteObject(CursorBrush); } } - SelectObject(hDC, OldFont); + SelectObject(GuiData->hMemDC, OldFont); } /* EOF */
11 years, 2 months
1
0
0
0
[tfaber] 60733: [EXPLORER] - Remove no longer needed special casing for __MINGW32__. Patch by Ivan Rodionov. CORE-7335 #resolve #comment Thanks! Committed in r60733.
by tfaber@svn.reactos.org
Author: tfaber Date: Tue Oct 22 19:51:25 2013 New Revision: 60733 URL:
http://svn.reactos.org/svn/reactos?rev=60733&view=rev
Log: [EXPLORER] - Remove no longer needed special casing for __MINGW32__. Patch by Ivan Rodionov. CORE-7335 #resolve #comment Thanks! Committed in r60733. Modified: trunk/reactos/base/shell/explorer/CMakeLists.txt trunk/reactos/base/shell/explorer/explorer.cpp trunk/reactos/base/shell/explorer/globals.h trunk/reactos/base/shell/explorer/shell/shellbrowser.cpp trunk/reactos/base/shell/explorer/shell/shellbrowser.h trunk/reactos/base/shell/explorer/taskbar/desktopbar.cpp trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp trunk/reactos/base/shell/explorer/taskbar/taskbar.cpp trunk/reactos/base/shell/explorer/taskbar/traynotify.cpp trunk/reactos/base/shell/explorer/utility/shellclasses.cpp trunk/reactos/base/shell/explorer/utility/shellclasses.h Modified: trunk/reactos/base/shell/explorer/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/CMakeL…
============================================================================== --- trunk/reactos/base/shell/explorer/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/CMakeLists.txt [iso-8859-1] Tue Oct 22 19:51:25 2013 @@ -5,7 +5,6 @@ add_definitions( -DWIN32 - -D__MINGW32__ -D__WINDRES__) #add_pch(explorer precomp.h) Modified: trunk/reactos/base/shell/explorer/explorer.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/explor…
============================================================================== --- trunk/reactos/base/shell/explorer/explorer.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/explorer.cpp [iso-8859-1] Tue Oct 22 19:51:25 2013 @@ -69,9 +69,7 @@ #endif _log = NULL; -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) _SHRestricted = 0; -#endif _hwndDesktopBar = 0; _hwndShellView = 0; _hwndDesktop = 0; @@ -81,11 +79,7 @@ void ExplorerGlobals::init(HINSTANCE hInstance) { _hInstance = hInstance; - -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) _SHRestricted = (DWORD(STDAPICALLTYPE*)(RESTRICTIONS)) GetProcAddress(GetModuleHandle(TEXT("SHELL32")), "SHRestricted"); -#endif - _icon_cache.init(); } @@ -997,38 +991,6 @@ return 1; } - - - // MinGW does not provide a Unicode startup routine, so we have to implement an own. -#if defined(__MINGW32__) && defined(UNICODE) - -#define _tWinMain wWinMain -int WINAPI wWinMain(HINSTANCE, HINSTANCE, LPWSTR, int); - -int main(int argc, char* argv[]) -{ - CONTEXT("main"); - - STARTUPINFO startupinfo; - int nShowCmd = SW_SHOWNORMAL; - - GetStartupInfo(&startupinfo); - - if (startupinfo.dwFlags & STARTF_USESHOWWINDOW) - nShowCmd = startupinfo.wShowWindow; - - LPWSTR cmdline = GetCommandLineW(); - - while(*cmdline && !_istspace((unsigned)*cmdline)) - ++cmdline; - - while(_istspace((unsigned)*cmdline)) - ++cmdline; - - return wWinMain(GetModuleHandle(NULL), 0, cmdline, nShowCmd); -} - -#endif // __MINGW && UNICODE static bool SetShellReadyEvent(LPCTSTR evtName) Modified: trunk/reactos/base/shell/explorer/globals.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/global…
============================================================================== --- trunk/reactos/base/shell/explorer/globals.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/globals.h [iso-8859-1] Tue Oct 22 19:51:25 2013 @@ -279,9 +279,7 @@ FILE* _log; -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) DWORD(STDAPICALLTYPE* _SHRestricted)(RESTRICTIONS); -#endif FileTypeManager _ftype_mgr; IconCache _icon_cache; Modified: trunk/reactos/base/shell/explorer/shell/shellbrowser.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/shell/…
============================================================================== --- trunk/reactos/base/shell/explorer/shell/shellbrowser.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/shell/shellbrowser.cpp [iso-8859-1] Tue Oct 22 19:51:25 2013 @@ -39,11 +39,7 @@ ShellBrowser::ShellBrowser(HWND hwnd, HWND hwndFrame, HWND left_hwnd, WindowHandle& right_hwnd, ShellPathInfo& create_info, BrowserCallback* cb, CtxMenuInterfaces& cm_ifs) -#ifndef __MINGW32__ // IShellFolderViewCB missing in MinGW (as of 25.09.2005) : super(IID_IShellFolderViewCB), -#else - : -#endif _hwnd(hwnd), _hwndFrame(hwndFrame), _left_hwnd(left_hwnd), @@ -449,7 +445,6 @@ fs.fFlags = FWF_NOCLIENTEDGE|FWF_BESTFITWINDOW; } -#ifndef __MINGW32__ // IShellFolderViewCB missing in MinGW (as of 25.09.2005) SFV_CREATE sfv_create; sfv_create.cbSize = sizeof(SFV_CREATE); @@ -458,9 +453,6 @@ sfv_create.psfvcb = this; HRESULT hr = SHCreateShellFolderView(&sfv_create, &_pShellView); -#else - HRESULT hr = folder->CreateViewObject(_hwnd, IID_IShellView, (void**)&_pShellView); -#endif if (FAILED(hr)) { _pShellView = NULL; @@ -480,9 +472,6 @@ _pShellView->UIActivate(SVUIA_ACTIVATE_NOFOCUS); } - -#ifndef __MINGW32__ // IShellFolderViewCB missing in MinGW (as of 25.09.2005) - /// shell view callback HRESULT STDMETHODCALLTYPE ShellBrowser::MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -494,8 +483,6 @@ return E_NOTIMPL; } - -#endif HRESULT ShellBrowser::OnDefaultCommand(LPIDA pida) Modified: trunk/reactos/base/shell/explorer/shell/shellbrowser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/shell/…
============================================================================== --- trunk/reactos/base/shell/explorer/shell/shellbrowser.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/shell/shellbrowser.h [iso-8859-1] Tue Oct 22 19:51:25 2013 @@ -57,10 +57,8 @@ /// Implementation of IShellBrowserImpl interface in explorer child windows -struct ShellBrowser : public IShellBrowserImpl -#ifndef __MINGW32__ // IShellFolderViewCB missing in MinGW (as of 25.09.2005) - , public IComSrvBase<IShellFolderViewCB, ShellBrowser>, public SimpleComObject -#endif +struct ShellBrowser : public IShellBrowserImpl, + public IComSrvBase<IShellFolderViewCB, ShellBrowser>, public SimpleComObject { ShellBrowser(HWND hwnd, HWND hwndFrame, HWND left_hwnd, WindowHandle& right_hwnd, ShellPathInfo& create_info, BrowserCallback* cb, CtxMenuInterfaces& cm_ifs); @@ -168,12 +166,10 @@ void InitializeTree(); bool InitDragDrop(); -#ifndef __MINGW32__ // IShellFolderViewCB missing in MinGW (as of 25.09.2005) typedef IComSrvBase<IShellFolderViewCB, ShellBrowser> super; // IShellFolderViewCB virtual HRESULT STDMETHODCALLTYPE MessageSFVCB(UINT uMsg, WPARAM wParam, LPARAM lParam); -#endif map<int, int> _image_map; Modified: trunk/reactos/base/shell/explorer/taskbar/desktopbar.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/taskba…
============================================================================== --- trunk/reactos/base/shell/explorer/taskbar/desktopbar.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/taskbar/desktopbar.cpp [iso-8859-1] Tue Oct 22 19:51:25 2013 @@ -114,9 +114,7 @@ // create task bar _hwndTaskBar = TaskBar::Create(_hwnd); -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) if (!g_Globals._SHRestricted || !SHRestricted(REST_NOTRAYITEMSDISPLAY)) -#endif // create tray notification area _hwndNotify = NotifyArea::Create(_hwnd); Modified: trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/taskba…
============================================================================== --- trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/taskbar/startmenu.cpp [iso-8859-1] Tue Oct 22 19:51:25 2013 @@ -1560,9 +1560,7 @@ : super(hwnd, info._icon_size), _hwndStartButton(0) { -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCOMMONGROUPS)) -#endif try { // insert directory "All Users\Start Menu" ShellDirectory cmn_startmenu(GetDesktopFolder(), SpecialFolderPath(CSIDL_COMMON_STARTMENU, _hwnd), _hwnd); @@ -1706,34 +1704,12 @@ AddSeparator(); -#ifdef __MINGW32__ - HKEY hkey, hkeyAdv; - DWORD value, len; - - if (RegOpenKey(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer"), &hkey)) - hkey = 0; - - if (RegOpenKey(HKEY_CURRENT_USER, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"), &hkeyAdv)) - hkeyAdv = 0; - -#define IS_VALUE_ZERO(hk, name) \ - (!hk || (len=sizeof(value),RegQueryValueEx(hk, name, NULL, NULL, (LPBYTE)&value, &len) || !value)) - -#define IS_VALUE_NOT_ZERO(hk, name) \ - (!hk || (len=sizeof(value),RegQueryValueEx(hk, name, NULL, NULL, (LPBYTE)&value, &len) || value>0)) -#endif - - // insert hard coded start entries AddButton(ResString(IDS_PROGRAMS), ICID_APPS, true, IDC_PROGRAMS); AddButton(ResString(IDS_DOCUMENTS), ICID_DOCUMENTS, true, IDC_DOCUMENTS); -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) if (!g_Globals._SHRestricted || !SHRestricted(REST_NORECENTDOCSMENU)) -#else - if (IS_VALUE_ZERO(hkey, _T("NoRecentDocsMenu"))) -#endif AddButton(ResString(IDS_RECENT), ICID_RECENT, true, IDC_RECENT); AddButton(ResString(IDS_FAVORITES), ICID_FAVORITES, true, IDC_FAVORITES); @@ -1742,42 +1718,26 @@ AddButton(ResString(IDS_BROWSE), ICID_FOLDER, true, IDC_BROWSE); -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) if (!g_Globals._SHRestricted || !SHRestricted(REST_NOFIND)) -#else - if (IS_VALUE_ZERO(hkey, _T("NoFind"))) -#endif AddButton(ResString(IDS_SEARCH), ICID_SEARCH, true, IDC_SEARCH); AddButton(ResString(IDS_START_HELP), ICID_INFO, false, IDC_START_HELP); -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) if (!g_Globals._SHRestricted || !SHRestricted(REST_NORUN)) -#else - if (IS_VALUE_ZERO(hkey, _T("NoRun"))) -#endif AddButton(ResString(IDS_LAUNCH), ICID_ACTION, false, IDC_LAUNCH); AddSeparator(); -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) if (!g_Globals._SHRestricted || SHRestricted(REST_STARTMENULOGOFF) != 1) -#else - if (IS_VALUE_NOT_ZERO(hkeyAdv, _T("StartMenuLogoff"))) -#endif AddButton(ResString(IDS_LOGOFF), ICID_LOGOFF, false, IDC_LOGOFF); #ifdef __REACTOS__ AddButton(ResString(IDS_RESTART), ICID_RESTART, false, IDC_RESTART); #endif -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCLOSE)) -#else - if (IS_VALUE_ZERO(hkey, _T("NoClose"))) -#endif AddButton(ResString(IDS_SHUTDOWN), ICID_SHUTDOWN, false, IDC_SHUTDOWN); #ifndef __REACTOS__ @@ -1785,10 +1745,6 @@ #endif -#ifdef __MINGW32__ - RegCloseKey(hkeyAdv); - RegCloseKey(hkey); -#endif #ifdef _LIGHT_STARTMENU @@ -2205,18 +2161,14 @@ AddButton(ResString(IDS_ADMIN), ICID_ADMIN, true, IDC_ADMIN); -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCONTROLPANEL)) -#endif - AddButton(ResString(IDS_SETTINGS_MENU), ICID_CONFIG, true, IDC_SETTINGS_MENU); + AddButton(ResString(IDS_SETTINGS_MENU), ICID_CONFIG, true, IDC_SETTINGS_MENU); AddButton(ResString(IDS_DESKTOPBAR_SETTINGS), ICID_DESKSETTING, false, ID_DESKTOPBAR_SETTINGS); AddButton(ResString(IDS_PRINTERS), ICID_PRINTER, false, IDC_PRINTERS); -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCONTROLPANEL)) -#endif AddButton(ResString(IDS_CONTROL_PANEL), ICID_CONTROLPAN, false, IDC_CONTROL_PANEL); } @@ -2224,9 +2176,7 @@ { super::AddEntries(); -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) if (!g_Globals._SHRestricted || !SHRestricted(REST_NONETHOOD)) // or REST_NOENTIRENETWORK ? -#endif #if defined(ROSSHELL) || defined(__REACTOS__) // __REACTOS__ to be removed when printer/network will be implemented AddButton(ResString(IDS_NETWORK), ICID_NETWORK, false, IDC_NETWORK); #else @@ -2242,9 +2192,7 @@ AddButton(ResString(IDS_SEARCH_FILES), ICID_SEARCH_DOC, false, IDC_SEARCH_FILES); -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) if (!g_Globals._SHRestricted || !SHRestricted(REST_HASFINDCOMPUTERS)) -#endif AddButton(ResString(IDS_SEARCH_COMPUTER),ICID_COMPUTER, false, IDC_SEARCH_COMPUTER); AddButton(ResString(IDS_SEARCH_PRG), ICID_APPS, false, IDC_SEARCH_PROGRAM); Modified: trunk/reactos/base/shell/explorer/taskbar/taskbar.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/taskba…
============================================================================== --- trunk/reactos/base/shell/explorer/taskbar/taskbar.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/taskbar/taskbar.cpp [iso-8859-1] Tue Oct 22 19:51:25 2013 @@ -133,7 +133,6 @@ //SetWindowFont(_htoolbar, GetStockFont(ANSI_VAR_FONT), FALSE); //SendMessage(_htoolbar, TB_SETPADDING, 0, MAKELPARAM(8,8)); -#ifndef __MINGW32__ // TBMETRICS missing in MinGW (as of 20.09.2005) // set metrics for the Taskbar toolbar to enable button spacing TBMETRICS metrics; @@ -145,7 +144,6 @@ metrics.cyButtonSpacing = 3; SendMessage(_htoolbar, TB_SETMETRICS, 0, (LPARAM)&metrics); -#endif _next_id = IDC_FIRST_APP; @@ -264,11 +262,9 @@ ActivateApp(it, false, false); // don't restore minimized windows on right button click -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) static DynamicFct<DWORD(STDAPICALLTYPE*)(RESTRICTIONS)> pSHRestricted(TEXT("SHELL32"), "SHRestricted"); if (pSHRestricted && !(*pSHRestricted)(REST_NOTRAYCONTEXTMENU)) -#endif ShowAppSystemMenu(it); } break;} Modified: trunk/reactos/base/shell/explorer/taskbar/traynotify.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/taskba…
============================================================================== --- trunk/reactos/base/shell/explorer/taskbar/traynotify.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/taskbar/traynotify.cpp [iso-8859-1] Tue Oct 22 19:51:25 2013 @@ -133,7 +133,6 @@ changes = true; ///@todo compare icon } -#ifdef NIF_STATE // as of 21.08.2003 missing in MinGW headers if (pnid->uFlags & NIF_STATE) { DWORD new_state = (_dwState&~pnid->dwStateMask) | (pnid->dwState&pnid->dwStateMask); @@ -142,7 +141,6 @@ changes = true; } } -#endif // store tool tip text if (pnid->uFlags & NIF_TIP) { @@ -252,9 +250,7 @@ // read notification icon settings from XML configuration XMLPos cfg_pos = g_Globals.get_cfg(); -#ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) if (!g_Globals._SHRestricted || !SHRestricted(REST_HIDECLOCK)) -#endif { if (cfg_pos.go_down("desktopbar")) { clock_visible = XMLBoolRef(XMLPos(cfg_pos,"options"), "show-clock", !get_hide_clock_from_registry()); @@ -609,12 +605,10 @@ */ bool changes = entry.modify(pnid); -#if NOTIFYICON_VERSION>=3 // as of 21.08.2003 missing in MinGW headers if (DetermineHideState(entry) && entry._mode==NIM_HIDE) { entry._dwState |= NIS_HIDDEN; changes = true; } -#endif if (changes) UpdateIcons(); ///@todo call only if really changes occurred @@ -635,7 +629,6 @@ } break;} -#if NOTIFYICON_VERSION>=3 // as of 21.08.2003 missing in MinGW headers case NIM_SETFOCUS: SetForegroundWindow(_hwnd); return TRUE; @@ -648,7 +641,6 @@ return TRUE; } else return FALSE; -#endif } return FALSE; @@ -662,9 +654,7 @@ for(NotifyIconMap::const_iterator it=_icon_map.begin(); it!=_icon_map.end(); ++it) { const NotifyInfo& entry = it->second; -#ifdef NIF_STATE // as of 21.08.2003 missing in MinGW headers if (_show_hidden || !(entry._dwState & NIS_HIDDEN)) -#endif _sorted_icons.insert(entry); } @@ -830,8 +820,6 @@ } -#if NOTIFYICON_VERSION>=3 // as of 21.08.2003 missing in MinGW headers - bool NotifyIconConfig::match(const NotifyIconConfig& props) const { if (!_tipText.empty() && !props._tipText.empty()) @@ -873,7 +861,6 @@ return false; } -#endif String string_from_mode(NOTIFYICONMODE mode) Modified: trunk/reactos/base/shell/explorer/utility/shellclasses.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/utilit…
============================================================================== --- trunk/reactos/base/shell/explorer/utility/shellclasses.cpp [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/utility/shellclasses.cpp [iso-8859-1] Tue Oct 22 19:51:25 2013 @@ -483,20 +483,15 @@ void CtxMenuInterfaces::reset() { _pctxmenu2 = NULL; - -#ifndef __MINGW32__ // IContextMenu3 missing in MinGW (as of 6.2.2005) _pctxmenu3 = NULL; -#endif } bool CtxMenuInterfaces::HandleMenuMsg(UINT nmsg, WPARAM wparam, LPARAM lparam) { -#ifndef __MINGW32__ // IContextMenu3 missing in MinGW (as of 6.2.2005) if (_pctxmenu3) { if (SUCCEEDED(_pctxmenu3->HandleMenuMsg(nmsg, wparam, lparam))) return true; } -#endif if (_pctxmenu2) if (SUCCEEDED(_pctxmenu2->HandleMenuMsg(nmsg, wparam, lparam))) @@ -512,11 +507,9 @@ reset(); // Get the higher version context menu interfaces. -#ifndef __MINGW32__ // IContextMenu3 missing in MinGW (as of 6.2.2005) if (pcm1->QueryInterface(IID_IContextMenu3, (void**)&pcm) == NOERROR) _pctxmenu3 = (LPCONTEXTMENU3)pcm; else -#endif if (pcm1->QueryInterface(IID_IContextMenu2, (void**)&pcm) == NOERROR) _pctxmenu2 = (LPCONTEXTMENU2)pcm; Modified: trunk/reactos/base/shell/explorer/utility/shellclasses.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/utilit…
============================================================================== --- trunk/reactos/base/shell/explorer/utility/shellclasses.h [iso-8859-1] (original) +++ trunk/reactos/base/shell/explorer/utility/shellclasses.h [iso-8859-1] Tue Oct 22 19:51:25 2013 @@ -1114,9 +1114,7 @@ IContextMenu2* _pctxmenu2; -#ifndef __MINGW32__ // IContextMenu3 missing in MinGW (as of 6.2.2005) IContextMenu3* _pctxmenu3; -#endif }; template<typename BASE> struct ExtContextMenuHandlerT @@ -1151,7 +1149,6 @@ break; -#ifndef __MINGW32__ // IContextMenu3 missing in MinGW (as of 6.2.2005) case WM_MENUCHAR: // only supported by IContextMenu3 if (_cm_ifs._pctxmenu3) { LRESULT lResult = 0; @@ -1162,7 +1159,6 @@ } return 0; -#endif } return super::WndProc(nmsg, wparam, lparam);
11 years, 2 months
1
0
0
0
[tfaber] 60732: [SHELL32_WINETEST] - Add tests for SHCreateShellFolderView[Ex]. Already applied upstream. CORE-7334
by tfaber@svn.reactos.org
Author: tfaber Date: Tue Oct 22 19:09:45 2013 New Revision: 60732 URL:
http://svn.reactos.org/svn/reactos?rev=60732&view=rev
Log: [SHELL32_WINETEST] - Add tests for SHCreateShellFolderView[Ex]. Already applied upstream. CORE-7334 Modified: trunk/rostests/winetests/shell32/shlfolder.c Modified: trunk/rostests/winetests/shell32/shlfolder.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shell32/shlfold…
============================================================================== --- trunk/rostests/winetests/shell32/shlfolder.c [iso-8859-1] (original) +++ trunk/rostests/winetests/shell32/shlfolder.c [iso-8859-1] Tue Oct 22 19:09:45 2013 @@ -72,6 +72,8 @@ static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); static UINT (WINAPI *pGetSystemWow64DirectoryW)(LPWSTR, UINT); static HRESULT (WINAPI *pSHCreateDefaultContextMenu)(const DEFCONTEXTMENU*,REFIID,void**); +static HRESULT (WINAPI *pSHCreateShellFolderView)(const SFV_CREATE *pcsfv, IShellView **ppsv); +static HRESULT (WINAPI *pSHCreateShellFolderViewEx)(LPCSFV psvcbi, IShellView **ppv); static const char *debugstr_guid(REFIID riid) { @@ -140,6 +142,8 @@ MAKEFUNC(SHGetIDListFromObject); MAKEFUNC(SHGetItemFromObject); MAKEFUNC(SHCreateDefaultContextMenu); + MAKEFUNC(SHCreateShellFolderView); + MAKEFUNC(SHCreateShellFolderViewEx); #undef MAKEFUNC #define MAKEFUNC_ORD(f, ord) (p##f = (void*)GetProcAddress(hmod, (LPSTR)(ord))) @@ -4596,6 +4600,123 @@ Cleanup(); } +static void test_SHCreateShellFolderView(void) +{ + HRESULT hr; + IShellView *psv; + SFV_CREATE sfvc; + IShellFolder *desktop; + ULONG refCount; + + if (!pSHCreateShellFolderView) + { + win_skip("SHCreateShellFolderView missing.\n"); + return; + } + + hr = SHGetDesktopFolder(&desktop); + ok(hr == S_OK, "got (0x%08x)\n", hr); + + if (0) + { + /* crash on win7 */ + pSHCreateShellFolderView(NULL, NULL); + } + + psv = (void *)0xdeadbeef; + hr = pSHCreateShellFolderView(NULL, &psv); + ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr); + ok(psv == NULL, "psv = %p\n", psv); + + memset(&sfvc, 0, sizeof(sfvc)); + psv = (void *)0xdeadbeef; + hr = pSHCreateShellFolderView(&sfvc, &psv); + ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr); + ok(psv == NULL, "psv = %p\n", psv); + + memset(&sfvc, 0, sizeof(sfvc)); + sfvc.cbSize = sizeof(sfvc) - 1; + psv = (void *)0xdeadbeef; + hr = pSHCreateShellFolderView(&sfvc, &psv); + ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr); + ok(psv == NULL, "psv = %p\n", psv); + + memset(&sfvc, 0, sizeof(sfvc)); + sfvc.cbSize = sizeof(sfvc) + 1; + psv = (void *)0xdeadbeef; + hr = pSHCreateShellFolderView(&sfvc, &psv); + ok(hr == E_INVALIDARG, "Got 0x%08x\n", hr); + ok(psv == NULL, "psv = %p\n", psv); + + memset(&sfvc, 0, sizeof(sfvc)); + sfvc.cbSize = sizeof(sfvc); + sfvc.pshf = desktop; + psv = NULL; + hr = pSHCreateShellFolderView(&sfvc, &psv); + ok(hr == S_OK, "Got 0x%08x\n", hr); + ok(psv != NULL, "psv = %p\n", psv); + if (psv) + { + refCount = IShellView_Release(psv); + ok(refCount == 0, "refCount = %u\n", refCount); + } + + IShellFolder_Release(desktop); +} + +static void test_SHCreateShellFolderViewEx(void) +{ + HRESULT hr; + IShellView *psv; + CSFV csfv; + IShellFolder *desktop; + ULONG refCount; + + if (!pSHCreateShellFolderViewEx) + { + win_skip("SHCreateShellFolderViewEx missing.\n"); + return; + } + + hr = SHGetDesktopFolder(&desktop); + ok(hr == S_OK, "got (0x%08x)\n", hr); + + if (0) + { + /* crash on win7 */ + pSHCreateShellFolderViewEx(NULL, NULL); + pSHCreateShellFolderViewEx(NULL, &psv); + pSHCreateShellFolderViewEx(&csfv, NULL); + } + + memset(&csfv, 0, sizeof(csfv)); + csfv.pshf = desktop; + psv = NULL; + hr = pSHCreateShellFolderViewEx(&csfv, &psv); + ok(hr == S_OK, "Got 0x%08x\n", hr); + ok(psv != NULL, "psv = %p\n", psv); + if (psv) + { + refCount = IShellView_Release(psv); + ok(refCount == 0, "refCount = %u\n", refCount); + } + + memset(&csfv, 0, sizeof(csfv)); + csfv.cbSize = sizeof(csfv); + csfv.pshf = desktop; + psv = NULL; + hr = pSHCreateShellFolderViewEx(&csfv, &psv); + ok(hr == S_OK, "Got 0x%08x\n", hr); + ok(psv != NULL, "psv = %p\n", psv); + if (psv) + { + refCount = IShellView_Release(psv); + ok(refCount == 0, "refCount = %u\n", refCount); + } + + IShellFolder_Release(desktop); +} + START_TEST(shlfolder) { init_function_pointers(); @@ -4632,6 +4753,8 @@ test_ShellItemBindToHandler(); test_ShellItemGetAttributes(); test_SHCreateDefaultContextMenu(); + test_SHCreateShellFolderView(); + test_SHCreateShellFolderViewEx(); OleUninitialize(); }
11 years, 2 months
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
33
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
Results per page:
10
25
50
100
200