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
July 2016
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
18 participants
358 discussions
Start a n
N
ew thread
[hbelusca] 71926: [MAGNIFY] Missing break. CID 1363532 CORE-11593 #resolve
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed Jul 13 16:27:39 2016 New Revision: 71926 URL:
http://svn.reactos.org/svn/reactos?rev=71926&view=rev
Log: [MAGNIFY] Missing break. CID 1363532 CORE-11593 #resolve Modified: trunk/reactos/base/applications/magnify/magnifier.c Modified: trunk/reactos/base/applications/magnify/magnifier.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/magnify/…
============================================================================== --- trunk/reactos/base/applications/magnify/magnifier.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/magnify/magnifier.c [iso-8859-1] Wed Jul 13 16:27:39 2016 @@ -726,6 +726,7 @@ SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); ReleaseCapture(); } + break; case WM_SIZE: if(AppBarConfig.uEdge>=0) DoAppBarStuff(ABM_SETPOS); @@ -814,6 +815,7 @@ ShowWindow(hMainWnd, SW_HIDE); else ShowWindow(hMainWnd, SW_SHOW); + break; } return 0; }
8 years, 5 months
1
0
0
0
[hbelusca] 71925: [MKHIVE] - Fix usage of the 'Status' variable. CID 1363689 - Fix some DPRINTs. CORE-11595 #resolve
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed Jul 13 16:23:12 2016 New Revision: 71925 URL:
http://svn.reactos.org/svn/reactos?rev=71925&view=rev
Log: [MKHIVE] - Fix usage of the 'Status' variable. CID 1363689 - Fix some DPRINTs. CORE-11595 #resolve Modified: trunk/reactos/sdk/tools/mkhive/registry.c Modified: trunk/reactos/sdk/tools/mkhive/registry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/tools/mkhive/registry.…
============================================================================== --- trunk/reactos/sdk/tools/mkhive/registry.c [iso-8859-1] (original) +++ trunk/reactos/sdk/tools/mkhive/registry.c [iso-8859-1] Wed Jul 13 16:23:12 2016 @@ -582,6 +582,7 @@ /* The value already exists, use it. Get the value cell. */ ValueCell = HvGetCell(&Key->RegistryHive->Hive, CellIndex); ASSERT(ValueCell != NULL); + Status = STATUS_SUCCESS; } // /**/HvReleaseCell(Hive, CellIndex);/**/ @@ -629,7 +630,7 @@ NewOffset = HvAllocateCell(Hive, cbData, Stable, HCELL_NIL); if (NewOffset == HCELL_NIL) { - DPRINT("HvAllocateCell() failed with status 0x%08x\n", Status); + DPRINT("HvAllocateCell() has failed!\n"); return ERROR_UNSUCCESSFUL; } @@ -660,8 +661,7 @@ /* Save the write time */ KeQuerySystemTime(&KeyNode->LastWriteTime); - DPRINT("Return status 0x%08x\n", Status); - return Status; + return ERROR_SUCCESS; }
8 years, 5 months
1
0
0
0
[hbelusca] 71924: [CHARMAP] Don't overrun FillGrid() when accessing the last elements. Rewrite the code using 'for' loops, in the same style as what is done elsewhere in the code. CID 1363552 CORE-...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed Jul 13 15:50:44 2016 New Revision: 71924 URL:
http://svn.reactos.org/svn/reactos?rev=71924&view=rev
Log: [CHARMAP] Don't overrun FillGrid() when accessing the last elements. Rewrite the code using 'for' loops, in the same style as what is done elsewhere in the code. CID 1363552 CORE-11597 #resolve Modified: trunk/reactos/base/applications/charmap/map.c Modified: trunk/reactos/base/applications/charmap/map.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/charmap/…
============================================================================== --- trunk/reactos/base/applications/charmap/map.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/charmap/map.c [iso-8859-1] Wed Jul 13 15:50:44 2016 @@ -107,8 +107,9 @@ i = XCELLS * infoPtr->iYStart; added = 0; - x = y = 0; - while ((y <= YCELLS) && (x <= XCELLS)) + + for (y = 0; y < YCELLS; y++) + for (x = 0; x < XCELLS; x++) { ch = (WCHAR)infoPtr->ValidGlyphs[i]; @@ -131,14 +132,6 @@ i++; ch = (WCHAR)i; - - // move to the next cell - x++; - if (x > XCELLS - 1) - { - x = 0; - y++; - } } SelectObject(ps->hdc, hOldFont);
8 years, 5 months
1
0
0
0
[hbelusca] 71923: [BOOTLIB] - BiOpenKey is being feed with the wrong ElementHandle, it should be feed with ElementsHandle one. CID 1363670 . By Victor Martinez Calvo. CORE-11600 #resolve [BOOTMGR] ...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Wed Jul 13 15:43:08 2016 New Revision: 71923 URL:
http://svn.reactos.org/svn/reactos?rev=71923&view=rev
Log: [BOOTLIB] - BiOpenKey is being feed with the wrong ElementHandle, it should be feed with ElementsHandle one. CID 1363670 . By Victor Martinez Calvo. CORE-11600 #resolve [BOOTMGR] - Fix an Assign vs Compare issue. CID 1363558 . By Victor Martinez Calvo. CORE-11592 #resolve Modified: trunk/reactos/boot/environ/app/bootmgr/bootmgr.c trunk/reactos/boot/environ/lib/misc/bcd.c Modified: trunk/reactos/boot/environ/app/bootmgr/bootmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/app/bootmgr/b…
============================================================================== --- trunk/reactos/boot/environ/app/bootmgr/bootmgr.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/app/bootmgr/bootmgr.c [iso-8859-1] Wed Jul 13 15:43:08 2016 @@ -1403,7 +1403,7 @@ /* Check if this is a real mode
startup.com
*/ if ((ObjectType.Application.ObjectCode == BCD_OBJECT_TYPE_APPLICATION) && - (ObjectType.Application.ImageCode = BCD_IMAGE_TYPE_REAL_MODE) && + (ObjectType.Application.ImageCode == BCD_IMAGE_TYPE_REAL_MODE) && (ObjectType.Application.ApplicationCode == BCD_APPLICATION_TYPE_STARTUPCOM)) { /* Check if PXE soft reboot will occur */ Modified: trunk/reactos/boot/environ/lib/misc/bcd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/misc/bcd.…
============================================================================== --- trunk/reactos/boot/environ/lib/misc/bcd.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/misc/bcd.c [iso-8859-1] Wed Jul 13 15:43:08 2016 @@ -579,7 +579,7 @@ else { /* Open the element specifically */ - Status = BiOpenKey(ElementHandle, TypeString, &ElementHandle); + Status = BiOpenKey(ElementsHandle, TypeString, &ElementHandle); if (NT_SUCCESS(Status)) { /* Delete it */ @@ -874,7 +874,7 @@ { EfiPrintf(L"Value invalid\r\n"); BiCloseKey(ElementHandle); - ElementHandle = 0; + ElementHandle = NULL; continue; }
8 years, 5 months
1
0
0
0
[tthompson] 71922: [NTFS] Various minor changes to fix GCC build.
by tthompson@svn.reactos.org
Author: tthompson Date: Wed Jul 13 14:49:46 2016 New Revision: 71922 URL:
http://svn.reactos.org/svn/reactos?rev=71922&view=rev
Log: [NTFS] Various minor changes to fix GCC build. Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
============================================================================== --- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c [iso-8859-1] (original) +++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c [iso-8859-1] Wed Jul 13 14:49:46 2016 @@ -202,7 +202,7 @@ } // advance Destination to the final "attribute" and write the end type - (ULONG_PTR)Destination += Destination->Length; + Destination = (PNTFS_ATTR_RECORD)((ULONG_PTR)Destination + Destination->Length); Destination->Type = AttributeEnd; // write the final marker (which shares the same offset and type as the Length field) @@ -245,7 +245,7 @@ ULONG NextAssignedCluster; ULONG AssignedClusters; - NTSTATUS Status = GetLastClusterInDataRun(Fcb->Vcb, &AttrContext->Record, &LastClusterInDataRun.QuadPart); + NTSTATUS Status = GetLastClusterInDataRun(Fcb->Vcb, &AttrContext->Record, (PULONGLONG)&LastClusterInDataRun.QuadPart); DPRINT1("GetLastClusterInDataRun returned: %I64u\n", LastClusterInDataRun.QuadPart); DPRINT1("Highest VCN of record: %I64u\n", AttrContext->Record.NonResident.HighestVCN); Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
============================================================================== --- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c [iso-8859-1] (original) +++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c [iso-8859-1] Wed Jul 13 14:49:46 2016 @@ -114,9 +114,11 @@ PFILE_RECORD_HEADER BitmapRecord; PNTFS_ATTR_CONTEXT DataContext; ULONGLONG BitmapDataSize; - PCHAR BitmapData; + PUCHAR BitmapData; ULONGLONG FreeClusters = 0; RTL_BITMAP Bitmap; + ULONG AssignedRun; + ULONG LengthWritten; DPRINT1("NtfsAllocateClusters(%p, %lu, %lu, %p, %p)\n", DeviceExt, FirstDesiredCluster, DesiredClusters, FirstAssignedCluster, AssignedClusters); @@ -174,8 +176,7 @@ // TODO: Observe MFT reservation zone // Can we get one contiguous run? - ULONG AssignedRun = RtlFindClearBitsAndSet(&Bitmap, DesiredClusters, FirstDesiredCluster); - ULONG LengthWritten; + AssignedRun = RtlFindClearBitsAndSet(&Bitmap, DesiredClusters, FirstDesiredCluster); if (AssignedRun != 0xFFFFFFFF) {
8 years, 5 months
1
0
0
0
[tthompson] 71921: [NTFS] Add support functions, fix warning from previous commit. +NtfsDumpDataRuns(), +NtfsDumpDataRunData() - Provide diagnostic output. +GetPackedByteCount() - Used to encode da...
by tthompson@svn.reactos.org
Author: tthompson Date: Wed Jul 13 11:51:16 2016 New Revision: 71921 URL:
http://svn.reactos.org/svn/reactos?rev=71921&view=rev
Log: [NTFS] Add support functions, fix warning from previous commit. +NtfsDumpDataRuns(), +NtfsDumpDataRunData() - Provide diagnostic output. +GetPackedByteCount() - Used to encode data runs. Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
============================================================================== --- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c [iso-8859-1] (original) +++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/attrib.c [iso-8859-1] Wed Jul 13 11:51:16 2016 @@ -523,6 +523,72 @@ } +VOID NtfsDumpDataRunData(PUCHAR DataRun) +{ + UCHAR DataRunOffsetSize; + UCHAR DataRunLengthSize; + CHAR i; + + DbgPrint("%02x ", *DataRun); + + if (*DataRun == 0) + return; + + DataRunOffsetSize = (*DataRun >> 4) & 0xF; + DataRunLengthSize = *DataRun & 0xF; + + DataRun++; + for (i = 0; i < DataRunLengthSize; i++) + { + DbgPrint("%02x ", *DataRun); + DataRun++; + } + + for (i = 0; i < DataRunOffsetSize; i++) + { + DbgPrint("%02x ", *DataRun); + DataRun++; + } + + NtfsDumpDataRunData(DataRun); +} + + +VOID +NtfsDumpDataRuns(PVOID StartOfRun, + ULONGLONG CurrentLCN) +{ + PUCHAR DataRun = StartOfRun; + LONGLONG DataRunOffset; + ULONGLONG DataRunLength; + + if (CurrentLCN == 0) + { + DPRINT1("Dumping data runs.\n\tData:\n\t\t"); + NtfsDumpDataRunData(StartOfRun); + DbgPrint("\n\tRuns:\n\t\tOff\t\tLCN\t\tLength\n"); + } + + DataRun = DecodeRun(DataRun, &DataRunOffset, &DataRunLength); + + if (DataRunOffset != -1) + CurrentLCN += DataRunOffset; + + DbgPrint("\t\t%I64d\t", DataRunOffset); + if (DataRunOffset < 99999) + DbgPrint("\t"); + DbgPrint("%I64u\t", CurrentLCN); + if (CurrentLCN < 99999) + DbgPrint("\t"); + DbgPrint("%I64u\n", DataRunLength); + + if (*DataRun == 0) + DbgPrint("\t\t00\n"); + else + NtfsDumpDataRuns(DataRun, CurrentLCN); +} + + VOID NtfsDumpFileAttributes(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecord) @@ -574,6 +640,76 @@ return NULL; } +/** +* GetPackedByteCount +* Returns the minimum number of bytes needed to represent the value of a +* 64-bit number. Used to encode data runs. +*/ +UCHAR +GetPackedByteCount(LONGLONG NumberToPack, + BOOLEAN IsSigned) +{ + int bytes = 0; + if (!IsSigned) + { + if (NumberToPack >= 0x0100000000000000) + return 8; + if (NumberToPack >= 0x0001000000000000) + return 7; + if (NumberToPack >= 0x0000010000000000) + return 6; + if (NumberToPack >= 0x0000000100000000) + return 5; + if (NumberToPack >= 0x0000000001000000) + return 4; + if (NumberToPack >= 0x0000000000010000) + return 3; + if (NumberToPack >= 0x0000000000000100) + return 2; + return 1; + } + + if (NumberToPack > 0) + { + // we have to make sure the number that gets encoded won't be interpreted as negative + if (NumberToPack >= 0x0080000000000000) + return 8; + if (NumberToPack >= 0x0000800000000000) + return 7; + if (NumberToPack >= 0x0000008000000000) + return 6; + if (NumberToPack >= 0x0000000080000000) + return 5; + if (NumberToPack >= 0x0000000000800000) + return 4; + if (NumberToPack >= 0x0000000000008000) + return 3; + if (NumberToPack >= 0x0000000000000080) + return 2; + return 1; + } + else + { + // negative number + if (NumberToPack <= 0xff80000000000000) + return 8; + if (NumberToPack <= 0xffff800000000000) + return 7; + if (NumberToPack <= 0xffffff8000000000) + return 6; + if (NumberToPack <= 0xffffffff80000000) + return 5; + if (NumberToPack <= 0xffffffffff800000) + return 4; + if (NumberToPack <= 0xffffffffffff8000) + return 3; + if (NumberToPack <= 0xffffffffffffff80) + return 2; + return 1; + } + return bytes; +} + NTSTATUS GetLastClusterInDataRun(PDEVICE_EXTENSION Vcb, PNTFS_ATTR_RECORD Attribute, PULONGLONG LastCluster) { Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
============================================================================== --- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c [iso-8859-1] (original) +++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c [iso-8859-1] Wed Jul 13 11:51:16 2016 @@ -1085,7 +1085,7 @@ } // remove the fixup array (so the file record pointer can still be used) - FixupUpdateSequenceArray(Vcb, file); + FixupUpdateSequenceArray(Vcb, &file->Ntfs); return Status; } Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
============================================================================== --- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] (original) +++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/ntfs.h [iso-8859-1] Wed Jul 13 11:51:16 2016 @@ -527,6 +527,10 @@ ULONGLONG *DataRunLength); VOID +NtfsDumpDataRuns(PVOID StartOfRun, + ULONGLONG CurrentLCN); + +VOID NtfsDumpFileAttributes(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecord); @@ -538,6 +542,10 @@ GetFileNameFromRecord(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecord, UCHAR NameType); + +UCHAR +GetPackedByteCount(LONGLONG NumberToPack, + BOOLEAN IsSigned); NTSTATUS GetLastClusterInDataRun(PDEVICE_EXTENSION Vcb,
8 years, 5 months
1
0
0
0
[tthompson] 71920: [NTFS] UpdateFileRecord() - Remove fixup array before returning.
by tthompson@svn.reactos.org
Author: tthompson Date: Wed Jul 13 09:26:04 2016 New Revision: 71920 URL:
http://svn.reactos.org/svn/reactos?rev=71920&view=rev
Log: [NTFS] UpdateFileRecord() - Remove fixup array before returning. Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
============================================================================== --- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c [iso-8859-1] (original) +++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/mft.c [iso-8859-1] Wed Jul 13 09:26:04 2016 @@ -1084,6 +1084,9 @@ DPRINT1("UpdateFileRecord failed: %I64u written, %u expected\n", BytesWritten, Vcb->NtfsInfo.BytesPerFileRecord); } + // remove the fixup array (so the file record pointer can still be used) + FixupUpdateSequenceArray(Vcb, file); + return Status; }
8 years, 5 months
1
0
0
0
[akhaldi] 71919: [BOOTLIB] Remove stray semicolon from a condition in ConsoleCreateLocalInputConsole(). Patch by Victor for CID 1363701. CORE-11588
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jul 13 09:08:34 2016 New Revision: 71919 URL:
http://svn.reactos.org/svn/reactos?rev=71919&view=rev
Log: [BOOTLIB] Remove stray semicolon from a condition in ConsoleCreateLocalInputConsole(). Patch by Victor for CID 1363701. CORE-11588 Modified: trunk/reactos/boot/environ/lib/io/display/textcons.c Modified: trunk/reactos/boot/environ/lib/io/display/textcons.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/environ/lib/io/displa…
============================================================================== --- trunk/reactos/boot/environ/lib/io/display/textcons.c [iso-8859-1] (original) +++ trunk/reactos/boot/environ/lib/io/display/textcons.c [iso-8859-1] Wed Jul 13 09:08:34 2016 @@ -256,7 +256,7 @@ /* Construct it */ Status = ConsoleInputBaseConstruct(InputConsole); - if (!NT_SUCCESS(Status)); + if (!NT_SUCCESS(Status)) { /* Tear down on failure */ BlMmFreeHeap(InputConsole); @@ -267,4 +267,4 @@ InputConsole->Callbacks = &ConsoleInputLocalVtbl; DspLocalInputConsole = InputConsole; return STATUS_SUCCESS; -} +}
8 years, 5 months
1
0
0
0
[jimtabor] 71918: [USER32_WINETEST] Sync with Wine Staging 1.9.11 Part 4. CORE-11368
by jimtabor@svn.reactos.org
Author: jimtabor Date: Wed Jul 13 03:16:00 2016 New Revision: 71918 URL:
http://svn.reactos.org/svn/reactos?rev=71918&view=rev
Log: [USER32_WINETEST] Sync with Wine Staging 1.9.11 Part 4. CORE-11368 Modified: trunk/rostests/winetests/user32/win.c Modified: trunk/rostests/winetests/user32/win.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/user32/win.c?re…
============================================================================== --- trunk/rostests/winetests/user32/win.c [iso-8859-1] (original) +++ trunk/rostests/winetests/user32/win.c [iso-8859-1] Wed Jul 13 03:16:00 2016 @@ -652,6 +652,31 @@ DestroyWindow( child ); DestroyWindow( test ); DestroyWindow( owner ); + + /* Test that owner window takes into account WS_CHILD flag even if parent is set by SetParent. */ + owner = create_tool_window( WS_VISIBLE | WS_OVERLAPPEDWINDOW, desktop ); + SetParent(owner, hwndMain); + check_parents( owner, hwndMain, hwndMain, NULL, NULL, hwndMain, owner ); + test = create_tool_window( WS_VISIBLE | WS_OVERLAPPEDWINDOW, owner ); + check_parents( test, desktop, owner, NULL, owner, test, test ); + DestroyWindow( owner ); + DestroyWindow( test ); + + owner = create_tool_window( WS_VISIBLE | WS_CHILD, desktop ); + SetParent(owner, hwndMain); + check_parents( owner, hwndMain, hwndMain, hwndMain, NULL, hwndMain, hwndMain ); + test = create_tool_window( WS_VISIBLE | WS_OVERLAPPEDWINDOW, owner ); + check_parents( test, desktop, hwndMain, NULL, hwndMain, test, test ); + DestroyWindow( owner ); + DestroyWindow( test ); + + owner = create_tool_window( WS_VISIBLE | WS_POPUP | WS_CHILD, desktop ); + SetParent(owner, hwndMain); + check_parents( owner, hwndMain, hwndMain, NULL, NULL, hwndMain, owner ); + test = create_tool_window( WS_VISIBLE | WS_OVERLAPPEDWINDOW, owner ); + check_parents( test, desktop, owner, NULL, owner, test, test ); + DestroyWindow( owner ); + DestroyWindow( test ); } static BOOL CALLBACK enum_proc( HWND hwnd, LPARAM lParam) @@ -1386,7 +1411,6 @@ id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); -todo_wine ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -1403,7 +1427,6 @@ id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); -todo_wine ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -1459,7 +1482,6 @@ id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); -todo_wine ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -1480,7 +1502,6 @@ id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); -todo_wine ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -1537,7 +1558,6 @@ id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); -todo_wine ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -1558,7 +1578,6 @@ id = GetWindowLongPtrA(mdi_child, GWLP_ID); ok(id == first_id, "wrong child id %ld\n", id); hwnd = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); -todo_wine ok(!hwnd, "WM_MDIGETACTIVE should return 0, got %p\n", hwnd); SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child, 0); ok(!IsWindow(mdi_child), "WM_MDIDESTROY failed\n"); @@ -4177,10 +4196,8 @@ dwExStyleOut = dwExStyleIn & ~WS_EX_WINDOWEDGE; ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle); /* FIXME: Remove the condition below once Wine is fixed */ - if (dwActualExStyle != dwExStyleOut) - todo_wine ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle); - else - ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle); + todo_wine_if (dwActualExStyle != dwExStyleOut) + ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle); DestroyWindow(hwnd); if (hwndParent) DestroyWindow(hwndParent); @@ -4239,6 +4256,74 @@ return 0; } +static INT_PTR WINAPI empty_dlg_proc3(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if (msg == WM_INITDIALOG) + EndDialog(hwnd, 0); + + return 0; +} + +struct dialog_param +{ + HWND parent, grand_parent; + DLGTEMPLATE *dlg_data; +}; + +static INT_PTR WINAPI empty_dlg_proc2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if (msg == WM_INITDIALOG) + { + DWORD style = GetWindowLongA(hwnd, GWL_STYLE); + struct dialog_param *param = (struct dialog_param *)lparam; + BOOL parent_is_child; + HWND disabled_hwnd; + + parent_is_child = (GetWindowLongA(param->parent, GWL_STYLE) & (WS_POPUP | WS_CHILD)) == WS_CHILD; + + ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd); + if (parent_is_child) + { + ok(IsWindowEnabled(param->parent), "wrong state for %08x\n", style); + disabled_hwnd = param->grand_parent; + } + else + { + ok(!IsWindowEnabled(param->parent), "wrong state for %08x\n", style); + disabled_hwnd = param->parent; + } + + if (param->grand_parent) + { + if (parent_is_child) + ok(!IsWindowEnabled(param->grand_parent), "wrong state for %08x\n", style); + else + ok(IsWindowEnabled(param->grand_parent), "wrong state for %08x\n", style); + } + + DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, disabled_hwnd, empty_dlg_proc3, 0); + ok(IsWindowEnabled(disabled_hwnd), "wrong state for %08x\n", style); + + ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd); + ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent); + if (param->grand_parent) + ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style); + + DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, hwnd, empty_dlg_proc3, 0); + ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd); + ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent); + if (param->grand_parent) + ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style); + + param->dlg_data->style |= WS_CHILD; + DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, hwnd, empty_dlg_proc3, 0); + ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style); + + EndDialog(hwnd, 0); + } + return 0; +} + static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_out, DWORD ex_style_out) { struct @@ -4250,11 +4335,19 @@ WCHAR caption[1]; } dlg_data; DWORD style, ex_style; - HWND hwnd, parent = 0; + HWND hwnd, grand_parent = 0, parent = 0; + struct dialog_param param; if (style_in & WS_CHILD) - parent = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW, + { + grand_parent = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, NULL, NULL); + ok(grand_parent != 0, "grand_parent creation failed\n"); + } + + parent = CreateWindowExA(0, "static", NULL, style_in, + 0, 0, 0, 0, grand_parent, NULL, NULL, NULL); + ok(parent != 0, "parent creation failed, style %#x\n", style_in); dlg_data.dt.style = style_in; dlg_data.dt.dwExtendedStyle = ex_style_in; @@ -4277,6 +4370,8 @@ ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE); ok(style == (style_out | DS_3DLOOK), "got %#x\n", style); ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style); + + ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#x)\n", style_in); /* try setting the styles explicitly */ SetWindowLongA(hwnd, GWL_EXSTYLE, ex_style_in); @@ -4307,13 +4402,22 @@ else ex_style_out = ex_style_in & ~WS_EX_WINDOWEDGE; /* FIXME: Remove the condition below once Wine is fixed */ - if (ex_style != ex_style_out) - todo_wine ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style); - else - ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style); + todo_wine_if (ex_style != ex_style_out) + ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style); DestroyWindow(hwnd); + + param.parent = parent; + param.grand_parent = grand_parent; + param.dlg_data = &dlg_data.dt; + DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, parent, empty_dlg_proc2, (LPARAM)¶m); + + ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#x)\n", style_in); + if (grand_parent) + ok(IsWindowEnabled(grand_parent), "wrong grand parent state (dialog style %#x)\n", style_in); + DestroyWindow(parent); + DestroyWindow(grand_parent); } static void test_dialog_styles(void) @@ -4403,6 +4507,233 @@ } } +struct dlg_parent_param +{ + HWND ga_parent; + HWND gwl_parent; + HWND get_parent; + HWND owner; + HWND root; + HWND ga_root_owner; +}; + +static INT_PTR WINAPI parent_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if (msg == WM_INITDIALOG) { + struct dlg_parent_param *param = (void*)lparam; + check_parents(hwnd, param->ga_parent, param->gwl_parent, param->get_parent, param->owner, + param->root ? param->root : hwnd, param->ga_root_owner ? param->ga_root_owner : hwnd); + + ok(!IsWindowEnabled(param->gwl_parent), "parent is not disabled\n"); + EndDialog(hwnd, 2); + ok(IsWindowEnabled(param->gwl_parent), "parent is not enabled\n"); + } + + return 0; +} + +static INT_PTR WINAPI reparent_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if (msg == WM_INITDIALOG) { + ok(!IsWindowEnabled(GetParent(hwnd)), "parent is not disabled\n"); + SetParent(hwnd, (HWND)lparam); + } + + return 0; +} + +static INT_PTR WINAPI reparent_owned_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if (msg == WM_INITDIALOG) { + HWND new_parent = (HWND)lparam; + HWND owner = GetWindow(hwnd, GW_OWNER); + ok(!IsWindowEnabled(owner), "owner is not disabled\n"); + SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) | WS_CHILD); + SetParent(hwnd, new_parent); + ok(GetParent(hwnd) == new_parent, "GetParent(hwnd) = %p, expected %p\n", GetParent(hwnd), new_parent); + PostMessageA(hwnd, WM_QUIT, 0, 0); + } + + return 0; +} + +static LRESULT WINAPI reparent_dialog_owner_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if (msg == WM_ENTERIDLE) { + HWND dialog = (HWND)lparam; + HWND owner = GetParent(dialog); + /* EndDialog will enable owner */ + EnableWindow(owner, FALSE); + EndDialog(dialog, 2); + ok(IsWindowEnabled(owner), "owner is not enabled\n"); + /* ...but it won't be enabled on dialog exit */ + EnableWindow(owner, FALSE); + } + return DefWindowProcA( hwnd, msg, wparam, lparam ); +} + +static LRESULT WINAPI post_quit_dialog_owner_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if (msg == WM_ENTERIDLE) { + HWND dialog = (HWND)lparam; + PostMessageA(dialog, WM_QUIT, 0, 0); + } + return DefWindowProcA( hwnd, msg, wparam, lparam ); +} + +static LRESULT WINAPI destroy_dialog_owner_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if (msg == WM_ENTERIDLE) { + HWND dialog = (HWND)lparam; + DestroyWindow(dialog); + } + return DefWindowProcA( hwnd, msg, wparam, lparam ); +} + +static void test_dialog_parent(void) +{ + HWND dialog, parent, child, child2, other, desktop = GetDesktopWindow(); + struct dlg_parent_param param; + INT_PTR ret; + struct + { + DLGTEMPLATE dt; + WORD menu_name; + WORD class_id; + WORD class_atom; + WCHAR caption[1]; + } dlg_data; + + dlg_data.dt.dwExtendedStyle = 0; + dlg_data.dt.cdit = 0; + dlg_data.dt.x = 0; + dlg_data.dt.y = 0; + dlg_data.dt.cx = 100; + dlg_data.dt.cy = 100; + dlg_data.menu_name = 0; + dlg_data.class_id = 0; + dlg_data.class_atom = 0; + dlg_data.caption[0] = 0; + + parent = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, NULL, NULL); + /* Create a child without WS_CHILD flag. It's a valid owner window. */ + child = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, NULL, NULL); + SetParent(child, parent); + /* Regular child. If passed as an owner, its parent will be true owner window. */ + child2 = CreateWindowExA(0, "static", NULL, WS_CHILD, 0, 0, 0, 0, child, NULL, NULL, NULL); + + trace("parent %p child %p child2 %p desktop %p\n", parent, child, child2, desktop); + + /* When dialog is created with WS_CHILD style, its parent depends on function used to create it. */ + dlg_data.dt.style = WS_CHILD; + + /* CreateDialogIndirectParam uses passed parent as dialog parent. */ + dialog = CreateDialogIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, empty_dlg_proc, 0); + ok(dialog != 0, "dialog creation failed\n"); + check_parents(dialog, child2, child2, child2, NULL, parent, child); + + ok(IsWindowEnabled(child2), "child2 is disabled\n"); + EnableWindow(child2, FALSE); + EndDialog(dialog, 0); + ok(IsWindowEnabled(child2), "child2 is not enabled\n"); + DestroyWindow(dialog); + + /* DialogBoxIndirectParam uses the first parent of passed owner that's not a child window as dialog + * parent (like in case of dialog with owner). */ + param.ga_parent = param.gwl_parent = param.get_parent = child; + param.owner = NULL; + param.root = parent; + param.ga_root_owner = child; + ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, parent_dlg_proc, (LPARAM)¶m); + ok(ret == 2, "DialogBoxIndirectParam returned %ld\n", ret); + + /* Dialogs without WS_CHILD behave as expected, they use passed owner just like CreateWindow does. */ + dlg_data.dt.style = WS_OVERLAPPEDWINDOW; + + dialog = CreateDialogIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, empty_dlg_proc, 0); + ok(dialog != 0, "dialog creation failed\n"); + check_parents(dialog, desktop, child, NULL, child, dialog, dialog); + + ok(IsWindowEnabled(child), "child is disabled\n"); + EnableWindow(child, FALSE); + EndDialog(dialog, 0); + ok(IsWindowEnabled(child), "child is not enabled\n"); + DestroyWindow(dialog); + + param.ga_parent = desktop; + param.gwl_parent = child; + param.get_parent = NULL; + param.owner = child; + param.root = param.ga_root_owner = NULL; + ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, parent_dlg_proc, (LPARAM)¶m); + ok(ret == 2, "DialogBoxIndirectParam returned %ld\n", ret); + + other = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, NULL, NULL); + SetWindowLongPtrA(child, GWLP_WNDPROC, (ULONG_PTR)reparent_dialog_owner_proc); + + /* When dialog is created with WS_CHILD|WS_POPUP style, we have an owner. */ + dlg_data.dt.style = WS_CHILD|WS_POPUP; + + dialog = CreateDialogIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, empty_dlg_proc, 0); + ok(dialog != 0, "dialog creation failed\n"); + check_parents(dialog, desktop, child, child, child, dialog, child); + + ok(IsWindowEnabled(child), "child is disabled\n"); + EnableWindow(child, FALSE); + EndDialog(dialog, 0); + ok(IsWindowEnabled(child), "child is not enabled\n"); + DestroyWindow(dialog); + + param.ga_parent = desktop; + param.gwl_parent = param.get_parent = child; + param.owner = child; + param.root = NULL; + param.ga_root_owner = child; + ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, parent_dlg_proc, (LPARAM)¶m); + ok(ret == 2, "DialogBoxIndirectParam returned %ld\n", ret); + + /* If we change parent in WM_INITDIALOG for WS_CHILD dialog WM_ENTERIDLE is still sent to the original + * parent. EndDialog will enable the new parent. */ + EnableWindow(child, TRUE); + EnableWindow(other, FALSE); + dlg_data.dt.style = WS_CHILD; + ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, reparent_dlg_proc, (LPARAM)other); + ok(ret == 2, "DialogBoxIndirectParam returned %ld\n", ret); + ok(!IsWindowEnabled(other), "other is not disabled\n"); + ok(!IsWindowEnabled(child), "child is not disabled\n"); + ok(IsWindowEnabled(child2), "child2 is not enabled\n"); + EnableWindow(child, TRUE); + + /* If we change parent and style in WM_INITDIALOG for dialog with an owner to make it true child + * (thus GetParent() will return the new parent instead of an owner), WM_ENTERIDLE is still sent + * to the original parent. EndDialog will enable the new parent. */ + EnableWindow(other, FALSE); + dlg_data.dt.style = WS_OVERLAPPED; + ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, child2, reparent_owned_dlg_proc, (LPARAM)other); + ok(ret == 1, "DialogBoxIndirectParam returned %ld\n", ret); + ok(!IsWindowEnabled(other), "other is not disabled\n"); + ok(!IsWindowEnabled(child), "child is not disabled\n"); + ok(IsWindowEnabled(child2), "child2 is not enabled\n"); + EnableWindow(child, TRUE); + EnableWindow(other, TRUE); + + /* Quit dialog message loop by sending WM_QUIT message. Dialog owner is not enabled. */ + SetWindowLongPtrA(child, GWLP_WNDPROC, (ULONG_PTR)post_quit_dialog_owner_proc); + ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, other, empty_dlg_proc, 0); + ok(ret == 1, "DialogBoxIndirectParam returned %ld\n", ret); + ok(!IsWindowEnabled(other), "other is enabled\n"); + EnableWindow(other, TRUE); + + /* Quit dialog message loop by destroying the window. Dialog owner is not enabled. */ + SetWindowLongPtrA(child, GWLP_WNDPROC, (ULONG_PTR)destroy_dialog_owner_proc); + ret = DialogBoxIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, other, empty_dlg_proc, 0); + ok(ret == 1, "DialogBoxIndirectParam returned %ld\n", ret); + ok(!IsWindowEnabled(other), "other is enabled\n"); + EnableWindow(other, TRUE); + + DestroyWindow(parent); +} + static void test_scrollwindow( HWND hwnd) { HDC hdc; @@ -4510,8 +4841,22 @@ rcu.left,rcu.top,rcu.right,rcu.bottom); ReleaseDC( hwnd1, hdc); + /* test scrolling a rect by more than its size */ + DestroyWindow( hwnd2); + ValidateRect( hwnd1, NULL); + SetRect( &rc, 40,40, 50,50); + InvalidateRect( hwnd1, &rc, 1); + ScrollWindowEx( hwnd1, -20, 0, &rc, NULL, hrgn, &rcu, + SW_SCROLLCHILDREN | SW_INVALIDATE); + if (winetest_debug > 0) dump_region(hrgn); + SetRectRgn( exprgn, 20, 40, 30, 50); + SetRectRgn( tmprgn, 40, 40, 50, 50); + CombineRgn( exprgn, exprgn, tmprgn, RGN_OR); + ok( EqualRgn( exprgn, hrgn), "wrong update region\n"); + ok( rcu.left == 20 && rcu.top == 40 && rcu.right == 50 && rcu.bottom == 50, + "unexpected update rect: %d,%d - %d,%d\n", rcu.left,rcu.top,rcu.right,rcu.bottom); + /* test scrolling a window with an update region */ - DestroyWindow( hwnd2); ValidateRect( hwnd1, NULL); SetRect( &rc, 40,40, 50,50); InvalidateRect( hwnd1, &rc, 1); @@ -4999,8 +5344,8 @@ t.w.r.f, got.w.r.f) #define parentdc_todo_field_ok(t, w, r, f, got) \ - if (t.w##_todo.r.f) todo_wine { parentdc_field_ok(t, w, r, f, got); } \ - else parentdc_field_ok(t, w, r, f, got) + todo_wine_if (t.w##_todo.r.f) \ + parentdc_field_ok(t, w, r, f, got); #define parentdc_rect_ok(t, w, r, got) \ parentdc_todo_field_ok(t, w, r, left, got); \ @@ -5670,7 +6015,7 @@ DestroyWindow(hwnd); expected_cx = expected_cy = -10; - SetRect( &expected_rect, 0, 0, 0, 0 ); + SetRectEmpty(&expected_rect); SetRect( &broken_rect, 0, 0, -10, -10 ); hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, -20, -20, -10, -10, parent, 0, 0, NULL); ok( hwnd != 0, "creation failed err %u\n", GetLastError()); @@ -5680,7 +6025,7 @@ DestroyWindow(hwnd); expected_cx = expected_cy = -200000; - SetRect( &expected_rect, 0, 0, 0, 0 ); + SetRectEmpty(&expected_rect); SetRect( &broken_rect, 0, 0, -200000, -200000 ); hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, -300000, -300000, -200000, -200000, parent, 0, 0, NULL); ok( hwnd != 0, "creation failed err %u\n", GetLastError()); @@ -6232,7 +6577,7 @@ flush_events( TRUE ); ShowWindow(hchild, SW_HIDE); - SetRect(&rc2, 0, 0, 0, 0); + SetRectEmpty(&rc2); ret = GetUpdateRect(hgrandparent, &rc1, FALSE); ok(!ret, "GetUpdateRect returned not empty region\n"); ok(EqualRect(&rc1, &rc2), "rects do not match (%d,%d,%d,%d) / (%d,%d,%d,%d)\n", @@ -6296,7 +6641,7 @@ ShowWindow(hchild, SW_HIDE); - SetRect(&rc2, 0, 0, 0, 0); + SetRectEmpty(&rc2); ret = GetUpdateRect(hgrandparent, &rc1, FALSE); ok(!ret, "GetUpdateRect returned not empty region\n"); ok(EqualRect(&rc1, &rc2), "rects do not match (%d,%d,%d,%d) / (%d,%d,%d,%d)\n", @@ -6421,9 +6766,7 @@ DispatchMessageA(&msg); MsgWaitForMultipleObjects(0, NULL, FALSE, 100, QS_ALLINPUT); } - if (flags == (RDW_INVALIDATE | RDW_FRAME)) - todo_wine ok(loopcount < 100, "Detected infinite WM_PAINT loop (%x).\n", flags); - else + todo_wine_if (flags == (RDW_INVALIDATE | RDW_FRAME)) ok(loopcount < 100, "Detected infinite WM_PAINT loop (%x).\n", flags); DestroyWindow(hwnd); } @@ -7247,7 +7590,7 @@ ok( ret == ERROR, "Expected ERROR, got %d\n", ret); ok( GetLastError() == 0xdeadbeef, "Expected , got %d\n", GetLastError()); - r.left = r.top = r.right = r.bottom = 0; + SetRectEmpty(&r); ret = pGetWindowRgnBox(hwnd, &r); ok( ret == SIMPLEREGION, "Expected SIMPLEREGION, got %d\n", ret); ok( r.left == 2 && r.top == 3 && r.right == 10 && r.bottom == 15, @@ -7258,10 +7601,10 @@ hrgn = CreateRectRgn(2, 3, 10, 15); ret = pMirrorRgn( hwnd, hrgn ); ok( ret == TRUE, "MirrorRgn failed %u\n", ret ); - r.left = r.top = r.right = r.bottom = 0; + SetRectEmpty(&r); GetWindowRect( hwnd, &r ); width = r.right - r.left; - r.left = r.top = r.right = r.bottom = 0; + SetRectEmpty(&r); ret = GetRgnBox( hrgn, &r ); ok( ret == SIMPLEREGION, "GetRgnBox failed %u\n", ret ); ok( r.left == width - 10 && r.top == 3 && r.right == width - 2 && r.bottom == 15, @@ -8662,6 +9005,186 @@ DestroyWindow(window2); } +static LRESULT WINAPI winproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if(!hwnd) { + int *count = (int*)lparam; + (*count)++; + } + return 0; +} + +static LRESULT WINAPI winproc_convA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if(msg == WM_SETTEXT) + { + const char *text = (const char*)lparam; + + ok(!wparam, "wparam = %08lx\n", wparam); + ok(!strcmp(text, "text"), "WM_SETTEXT lparam = %s\n", text); + return 1; + } + return 0; +} + +static const WCHAR textW[] = {'t','e','x','t',0}; +static LRESULT WINAPI winproc_convW(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + if(msg == WM_SETTEXT) + { + const WCHAR *text = (const WCHAR*)lparam; + + ok(!wparam, "wparam = %08lx\n", wparam); + ok(!lstrcmpW(text, textW), "WM_SETTEXT lparam = %s\n", wine_dbgstr_w(text)); + return 1; + } + return 0; +} + +static void test_winproc_handles(const char *argv0) +{ + static const WCHAR winproc_testW[] = {'w','i','n','p','r','o','c','_','t','e','s','t',0}; + + HINSTANCE hinst = GetModuleHandleA(NULL); + WNDCLASSA wnd_classA; + WNDCLASSW wnd_classW; + int count, ret; + PROCESS_INFORMATION info; + STARTUPINFOA startup; + char cmd[MAX_PATH]; + + memset(&wnd_classA, 0, sizeof(wnd_classA)); + wnd_classA.lpszClassName = "winproc_test"; + wnd_classA.lpfnWndProc = winproc; + ret = RegisterClassA(&wnd_classA); + ok(ret, "RegisterClass failed with error %d\n", GetLastError()); + + ret = GetClassInfoW(hinst, winproc_testW, &wnd_classW); + ok(ret, "GetClassInfoW failed with error %d\n", GetLastError()); + ok(wnd_classA.lpfnWndProc != wnd_classW.lpfnWndProc, + "winproc pointers should not be identical\n"); + + count = 0; + CallWindowProcA(wnd_classW.lpfnWndProc, 0, 0, 0, (LPARAM)&count); + ok(count == 1, "winproc should be called once (%d)\n", count); + count = 0; + CallWindowProcW(wnd_classW.lpfnWndProc, 0, 0, 0, (LPARAM)&count); + ok(count == 1, "winproc should be called once (%d)\n", count); + + ret = UnregisterClassW(winproc_testW, hinst); + ok(ret, "UnregisterClass failed with error %d\n", GetLastError()); + + /* crashes on 64-bit windows because lpfnWndProc handle is already freed */ + if (sizeof(void*) == 4) + { + count = 0; + CallWindowProcA(wnd_classW.lpfnWndProc, 0, 0, 0, (LPARAM)&count); + todo_wine ok(!count, "winproc should not be called (%d)\n", count); + CallWindowProcW(wnd_classW.lpfnWndProc, 0, 0, 0, (LPARAM)&count); + todo_wine ok(!count, "winproc should not be called (%d)\n", count); + } + + sprintf(cmd, "%s win winproc_limit", argv0); + memset(&startup, 0, sizeof(startup)); + startup.cb = sizeof(startup); + ok(CreateProcessA(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, + &startup, &info), "CreateProcess failed.\n"); + winetest_wait_child_process(info.hProcess); + CloseHandle(info.hProcess); + CloseHandle(info.hThread); +} + +static void test_winproc_limit(void) +{ + WNDPROC winproc_handle; + LONG_PTR ret; + HWND hwnd; + int i; + + hwnd = CreateWindowExA(0, "static", "test", WS_POPUP, 0, 0, 0, 0, 0, 0, 0, 0); + ok(hwnd != 0, "CreateWindowEx failed\n"); + + ok(SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)winproc), + "SetWindowLongPtr failed\n"); + winproc_handle = (WNDPROC)GetWindowLongPtrW(hwnd, GWLP_WNDPROC); + ok(winproc_handle != winproc, "winproc pointers should not be identical\n"); + + /* run out of winproc slots */ + for(i = 2; i<0xffff; i++) + { + ok(SetWindowLongPtrA(hwnd, GWLP_WNDPROC, i), "SetWindowLongPtr failed (%d)\n", i); + if(GetWindowLongPtrW(hwnd, GWLP_WNDPROC) == i) + break; + } + ok(i != 0xffff, "unable to run out of winproc slots\n"); + + ret = SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)winproc_convA); + ok(ret, "SetWindowLongPtr failed with error %d\n", GetLastError()); + ok(SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)"text"), "WM_SETTEXT failed\n"); + ok(SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)textW), "WM_SETTEXT with conversion failed\n"); + + ret = SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR)winproc_convW); + ok(ret, "SetWindowLongPtr failed with error %d\n", GetLastError()); + ok(SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)"text"), "WM_SETTEXT failed\n"); + ok(SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)textW), "WM_SETTEXT with conversion failed\n"); + + /* Show that there's no message conversion when CallWindowProc is used */ + ok(CallWindowProcA(winproc_convW, hwnd, WM_SETTEXT, 0, (LPARAM)textW) == 1, + "winproc_convW returned error\n"); + ok(CallWindowProcW(winproc_convW, hwnd, WM_SETTEXT, 0, (LPARAM)textW) == 1, + "winproc_convW returned error\n"); + + i = 0; + CallWindowProcA(winproc_handle, 0, 0, 0, (LPARAM)&i); + ok(i == 1, "winproc should be called once (%d)\n", i); + i = 0; + CallWindowProcW(winproc_handle, 0, 0, 0, (LPARAM)&i); + ok(i == 1, "winproc should be called once (%d)\n", i); + + DestroyWindow(hwnd); + + i = 0; + CallWindowProcA(winproc_handle, 0, 0, 0, (LPARAM)&i); + ok(i == 1, "winproc should be called once (%d)\n", i); + i = 0; + CallWindowProcW(winproc_handle, 0, 0, 0, (LPARAM)&i); + ok(i == 1, "winproc should be called once (%d)\n", i); +} + +static void test_deferwindowpos(void) +{ + HDWP hdwp, hdwp2; + BOOL ret; + + hdwp = BeginDeferWindowPos(0); + ok(hdwp != NULL, "got %p\n", hdwp); + + ret = EndDeferWindowPos(NULL); + ok(!ret, "got %d\n", ret); + + hdwp2 = DeferWindowPos(NULL, NULL, NULL, 0, 0, 10, 10, 0); +todo_wine + ok(hdwp2 == NULL && ((GetLastError() == ERROR_INVALID_DWP_HANDLE) || + broken(GetLastError() == ERROR_INVALID_WINDOW_HANDLE) /* before win8 */), "got %p, error %d\n", hdwp2, GetLastError()); + + hdwp2 = DeferWindowPos((HDWP)0xdead, GetDesktopWindow(), NULL, 0, 0, 10, 10, 0); +todo_wine + ok(hdwp2 == NULL && ((GetLastError() == ERROR_INVALID_DWP_HANDLE) || + broken(GetLastError() == ERROR_INVALID_WINDOW_HANDLE) /* before win8 */), "got %p, error %d\n", hdwp2, GetLastError()); + + hdwp2 = DeferWindowPos(hdwp, NULL, NULL, 0, 0, 10, 10, 0); + ok(hdwp2 == NULL && GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got %p, error %d\n", hdwp2, GetLastError()); + + hdwp2 = DeferWindowPos(hdwp, GetDesktopWindow(), NULL, 0, 0, 10, 10, 0); + ok(hdwp2 == NULL && GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got %p, error %d\n", hdwp2, GetLastError()); + + hdwp2 = DeferWindowPos(hdwp, (HWND)0xdead, NULL, 0, 0, 10, 10, 0); + ok(hdwp2 == NULL && GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "got %p, error %d\n", hdwp2, GetLastError()); + + ret = EndDeferWindowPos(hdwp); + ok(ret, "got %d\n", ret); +} + START_TEST(win) { char **argv; @@ -8696,6 +9219,12 @@ return; } + if (argc==3 && !strcmp(argv[2], "winproc_limit")) + { + test_winproc_limit(); + return; + } + if (!RegisterWindowClasses()) assert(0); hwndMain = CreateWindowExA(/*WS_EX_TOOLWINDOW*/ 0, "MainWindowClass", "Main window", @@ -8778,6 +9307,7 @@ test_AdjustWindowRect(); test_window_styles(); test_dialog_styles(); + test_dialog_parent(); test_redrawnow(); test_csparentdc(); test_SetWindowLong(); @@ -8801,6 +9331,8 @@ skip("ROSTESTS-208: Skipping test_activateapp(hwndMain).\n"); else test_activateapp(hwndMain); + test_winproc_handles(argv[0]); + test_deferwindowpos(); /* add the tests above this line */ if (hhook) UnhookWindowsHookEx(hhook);
8 years, 5 months
1
0
0
0
[jimtabor] 71917: [User32] - Sync/port up to Wine Staging 1.9.11 or current. See CORE-11368.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Wed Jul 13 03:09:01 2016 New Revision: 71917 URL:
http://svn.reactos.org/svn/reactos?rev=71917&view=rev
Log: [User32] - Sync/port up to Wine Staging 1.9.11 or current. See CORE-11368. Modified: trunk/reactos/win32ss/user/user32/windows/dialog.c Modified: trunk/reactos/win32ss/user/user32/windows/dialog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
============================================================================== --- trunk/reactos/win32ss/user/user32/windows/dialog.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/dialog.c [iso-8859-1] Wed Jul 13 03:09:01 2016 @@ -38,7 +38,6 @@ /* MACROS/DEFINITIONS ********************************************************/ #define DF_END 0x0001 -#define DF_OWNERENABLED 0x0002 #define DF_DIALOGACTIVE 0x4000 // ReactOS #define DWLP_ROS_DIALOGINFO (DWLP_USER+sizeof(ULONG_PTR)) #define GETDLGINFO(hwnd) DIALOG_get_info(hwnd, FALSE) @@ -170,43 +169,6 @@ } } return dlgInfo; -} - -/*********************************************************************** - * DIALOG_EnableOwner - * - * Helper function for modal dialogs to enable again the - * owner of the dialog box. - */ -void DIALOG_EnableOwner( HWND hOwner ) -{ - /* Owner must be a top-level window */ - if (hOwner) - hOwner = GetAncestor( hOwner, GA_ROOT ); - if (!hOwner) return; - EnableWindow( hOwner, TRUE ); -} - - -/*********************************************************************** - * DIALOG_DisableOwner - * - * Helper function for modal dialogs to disable the - * owner of the dialog box. Returns TRUE if owner was enabled. - */ -BOOL DIALOG_DisableOwner( HWND hOwner ) -{ - /* Owner must be a top-level window */ - if (hOwner) - hOwner = GetAncestor( hOwner, GA_ROOT ); - if (!hOwner) return FALSE; - if (IsWindowEnabled( hOwner )) - { - EnableWindow( hOwner, FALSE ); - return TRUE; - } - else - return FALSE; } /*********************************************************************** @@ -546,7 +508,6 @@ DIALOGINFO * dlgInfo; MSG msg; INT retval; - HWND ownerMsg = GetAncestor( owner, GA_ROOT ); BOOL bFirstEmpty; PWND pWnd; @@ -571,7 +532,7 @@ if (!(GetWindowLongPtrW( hwnd, GWL_STYLE ) & DS_NOIDLEMSG)) { /* No message present -> send ENTERIDLE and wait */ - if (ownerMsg) SendMessageW( ownerMsg, WM_ENTERIDLE, MSGF_DIALOGBOX, (LPARAM)hwnd ); + if (owner) SendMessageW( owner, WM_ENTERIDLE, MSGF_DIALOGBOX, (LPARAM)hwnd ); } GetMessageW( &msg, 0, 0, 0 ); } @@ -611,7 +572,6 @@ } } } - if (dlgInfo->flags & DF_OWNERENABLED) DIALOG_EnableOwner( owner ); retval = dlgInfo->idResult; DestroyWindow( hwnd ); return retval; @@ -815,7 +775,7 @@ */ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate, HWND owner, DLGPROC dlgProc, LPARAM param, - BOOL unicode, BOOL modal ) + BOOL unicode, HWND *modal_owner ) { HWND hwnd; RECT rect; @@ -824,7 +784,7 @@ DLG_TEMPLATE template; DIALOGINFO * dlgInfo = NULL; DWORD units = GetDialogBaseUnits(); - BOOL ownerEnabled = TRUE; + HWND disabled_owner = NULL; HMENU hMenu = 0; HFONT hUserFont = 0; UINT flags = 0; @@ -957,10 +917,27 @@ } } - if (modal) - { - ownerEnabled = DIALOG_DisableOwner( owner ); - if (ownerEnabled) flags |= DF_OWNERENABLED; + if (modal_owner && owner) + { + HWND parent; + /* + * Owner needs to be top level window. We need to duplicate the logic from server, + * because we need to disable it before creating dialog window. Note that we do that + * even if dialog has WS_CHILD, but only for modal dialogs, which matched what + * Windows does. + */ + while ((GetWindowLongW( owner, GWL_STYLE ) & (WS_POPUP|WS_CHILD)) == WS_CHILD) + { + parent = GetParent( owner ); + if (!parent || parent == GetDesktopWindow()) break; + owner = parent; + } + *modal_owner = owner; + if (IsWindowEnabled( owner )) + { + disabled_owner = owner; + EnableWindow( disabled_owner, FALSE ); + } } if (unicode) @@ -1001,7 +978,7 @@ { if (hUserFont) DeleteObject( hUserFont ); if (hMenu) DestroyMenu( hMenu ); - if (modal && (flags & DF_OWNERENABLED)) DIALOG_EnableOwner(owner); + if (disabled_owner) EnableWindow( disabled_owner, TRUE ); return 0; } @@ -1014,7 +991,7 @@ { if (hUserFont) DeleteObject( hUserFont ); if (hMenu) DestroyMenu( hMenu ); - if (modal && (flags & DF_OWNERENABLED)) DIALOG_EnableOwner(owner); + if (disabled_owner) EnableWindow( disabled_owner, TRUE ); return 0; } // @@ -1075,7 +1052,8 @@ } return hwnd; } - if (modal && ownerEnabled) DIALOG_EnableOwner(owner); + //if (modal && ownerEnabled) DIALOG_EnableOwner(owner); + if (disabled_owner) EnableWindow( disabled_owner, TRUE ); IntNotifyWinEvent(EVENT_SYSTEM_DIALOGEND, hwnd, OBJID_WINDOW, CHILDID_SELF, 0); if( IsWindow(hwnd) ) { @@ -1584,7 +1562,7 @@ * Also wine has one more parameter identifying weather it should call * the function with unicode or not */ - return DIALOG_CreateIndirect( hInstance, lpTemplate, hWndParent, lpDialogFunc, lParamInit , Flags == DLG_ISANSI ? FALSE : TRUE, FALSE ); + return DIALOG_CreateIndirect( hInstance, lpTemplate, hWndParent, lpDialogFunc, lParamInit , Flags == DLG_ISANSI ? FALSE : TRUE, NULL ); } @@ -1800,7 +1778,7 @@ * Also wine has one more parameter identifying weather it should call * the function with unicode or not */ - HWND hWnd = DIALOG_CreateIndirect( hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam, Flags == DLG_ISANSI ? FALSE : TRUE, TRUE ); + HWND hWnd = DIALOG_CreateIndirect( hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam, Flags == DLG_ISANSI ? FALSE : TRUE, &hWndParent ); if (hWnd) return DIALOG_DoDialogBox( hWnd, hWndParent ); return -1; } @@ -1865,7 +1843,7 @@ SetLastError(ERROR_INVALID_WINDOW_HANDLE); return 0; } - hwnd = DIALOG_CreateIndirect(hInstance, ptr, hWndParent, lpDialogFunc, dwInitParam, FALSE, TRUE); + hwnd = DIALOG_CreateIndirect(hInstance, ptr, hWndParent, lpDialogFunc, dwInitParam, FALSE, &hWndParent ); if (hwnd) return DIALOG_DoDialogBox(hwnd, hWndParent); return -1; } @@ -1898,7 +1876,7 @@ SetLastError(ERROR_INVALID_WINDOW_HANDLE); return 0; } - hwnd = DIALOG_CreateIndirect(hInstance, ptr, hWndParent, lpDialogFunc, dwInitParam, TRUE, TRUE); + hwnd = DIALOG_CreateIndirect(hInstance, ptr, hWndParent, lpDialogFunc, dwInitParam, TRUE, &hWndParent ); if (hwnd) return DIALOG_DoDialogBox(hwnd, hWndParent); return -1; } @@ -2037,7 +2015,6 @@ HWND hwnd, INT_PTR retval) { - BOOL wasEnabled = TRUE; DIALOGINFO * dlgInfo; HWND owner; BOOL wasActive; @@ -2052,11 +2029,15 @@ wasActive = (hwnd == GetActiveWindow()); dlgInfo->idResult = retval; dlgInfo->flags |= DF_END; - wasEnabled = (dlgInfo->flags & DF_OWNERENABLED); - - owner = GetWindow( hwnd, GW_OWNER ); - if (wasEnabled && owner) - DIALOG_EnableOwner( owner ); + + if ((GetWindowLongW( hwnd, GWL_STYLE ) & (WS_POPUP|WS_CHILD)) == WS_CHILD) + { + owner = GetAncestor( hwnd, GA_PARENT); + } + else + owner = GetWindow( hwnd, GW_OWNER ); + if (owner) + EnableWindow( owner, TRUE ); /* Windows sets the focus to the dialog itself in EndDialog */ @@ -2071,9 +2052,7 @@ if (wasActive && owner) { - /* If this dialog was given an owner then set the focus to that owner - even when the owner is disabled (normally when a window closes any - disabled windows cannot receive the focus). */ + /* If this dialog was given an owner then set the focus to that owner. */ SetActiveWindow(owner); } else if (hwnd == GetActiveWindow()) // Check it again!
8 years, 5 months
1
0
0
0
← Newer
1
...
12
13
14
15
16
17
18
...
36
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Results per page:
10
25
50
100
200