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
January 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
13 participants
192 discussions
Start a n
N
ew thread
[akhaldi] 70599: [0.4.0] * Apply the wordpad related hack from CORE-5823 by Jared Smudde.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jan 16 10:46:37 2016 New Revision: 70599 URL:
http://svn.reactos.org/svn/reactos?rev=70599&view=rev
Log: [0.4.0] * Apply the wordpad related hack from CORE-5823 by Jared Smudde. Modified: branches/ros-branch-0_4_0/reactos/base/applications/wordpad/res/formatbar.bmp branches/ros-branch-0_4_0/reactos/base/applications/wordpad/res/toolbar.bmp Modified: branches/ros-branch-0_4_0/reactos/base/applications/wordpad/res/formatbar.bmp URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/reactos/base/a…
============================================================================== Binary files - no diff available. Modified: branches/ros-branch-0_4_0/reactos/base/applications/wordpad/res/toolbar.bmp URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/reactos/base/a…
============================================================================== Binary files - no diff available.
8 years, 11 months
1
0
0
0
[akhaldi] 70598: [0.4.0] * Merge the MCI Extensions fixes by Hermès in r70597.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Jan 16 10:11:58 2016 New Revision: 70598 URL:
http://svn.reactos.org/svn/reactos?rev=70598&view=rev
Log: [0.4.0] * Merge the MCI Extensions fixes by Hermès in r70597. Modified: branches/ros-branch-0_4_0/ (props changed) branches/ros-branch-0_4_0/reactos/ (props changed) branches/ros-branch-0_4_0/reactos/boot/bootdata/hivesft.inf Propchange: branches/ros-branch-0_4_0/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Jan 16 10:11:58 2016 @@ -1 +1 @@ -/trunk:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70480,70497,70499-70501,70507-70510,70512-70513,70523,70527-70530,70536-70537,70545-70548,70552-70554,70557-70558,70576-70578,70583 +/trunk:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70480,70497,70499-70501,70507-70510,70512-70513,70523,70527-70530,70536-70537,70545-70548,70552-70554,70557-70558,70576-70578,70583,70597 Propchange: branches/ros-branch-0_4_0/reactos/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Sat Jan 16 10:11:58 2016 @@ -20,4 +20,4 @@ /branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 /branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567 /branches/wlan-bringup:54809-54998 -/trunk/reactos:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70480,70497,70501,70507-70510,70523,70527-70530,70536-70537,70545-70548,70552-70554,70557-70558,70576-70578,70583 +/trunk/reactos:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70480,70497,70501,70507-70510,70523,70527-70530,70536-70537,70545-70548,70552-70554,70557-70558,70576-70578,70583,70597 Modified: branches/ros-branch-0_4_0/reactos/boot/bootdata/hivesft.inf URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/reactos/boot/b…
============================================================================== --- branches/ros-branch-0_4_0/reactos/boot/bootdata/hivesft.inf [iso-8859-1] (original) +++ branches/ros-branch-0_4_0/reactos/boot/bootdata/hivesft.inf [iso-8859-1] Sat Jan 16 10:11:58 2016 @@ -225,7 +225,9 @@ HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI32","Sequencer",0x00000002,"mciseq.dll" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI32","WaveAudio",0x00000002,"mciwave.dll" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","aif",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","aifc",0x00000002,"MPEGVideo" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","aiff",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","asf",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","asx",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","au",0x00000002,"MPEGVideo" @@ -246,7 +248,6 @@ HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","mpg",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","mpv",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","mpv2",0x00000002,"MPEGVideo" -HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","rmi",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","rmi",0x00000002,"Sequencer" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","snd",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","wav",0x00000002,"WaveAudio"
8 years, 11 months
1
0
0
0
[hbelusca] 70597: [BOOTDATA] - Add "aif" and "aiff" to the supported MCI Extensions. - Remove an extra erroneous "rmi" entry that was wrongly marked as being of type "MPEGVideo".
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sat Jan 16 00:30:01 2016 New Revision: 70597 URL:
http://svn.reactos.org/svn/reactos?rev=70597&view=rev
Log: [BOOTDATA] - Add "aif" and "aiff" to the supported MCI Extensions. - Remove an extra erroneous "rmi" entry that was wrongly marked as being of type "MPEGVideo". Modified: trunk/reactos/boot/bootdata/hivesft.inf Modified: trunk/reactos/boot/bootdata/hivesft.inf URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesft.inf?…
============================================================================== --- trunk/reactos/boot/bootdata/hivesft.inf [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/hivesft.inf [iso-8859-1] Sat Jan 16 00:30:01 2016 @@ -225,7 +225,9 @@ HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI32","Sequencer",0x00000002,"mciseq.dll" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI32","WaveAudio",0x00000002,"mciwave.dll" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","aif",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","aifc",0x00000002,"MPEGVideo" +HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","aiff",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","asf",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","asx",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","au",0x00000002,"MPEGVideo" @@ -246,7 +248,6 @@ HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","mpg",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","mpv",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","mpv2",0x00000002,"MPEGVideo" -HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","rmi",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","rmi",0x00000002,"Sequencer" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","snd",0x00000002,"MPEGVideo" HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\MCI Extensions","wav",0x00000002,"WaveAudio"
8 years, 11 months
1
0
0
0
[pschweitzer] 70596: [MOUNTMGR] Warn when stubling upon Winism.
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Fri Jan 15 21:12:57 2016 New Revision: 70596 URL:
http://svn.reactos.org/svn/reactos?rev=70596&view=rev
Log: [MOUNTMGR] Warn when stubling upon Winism. Modified: trunk/reactos/drivers/filters/mountmgr/device.c Modified: trunk/reactos/drivers/filters/mountmgr/device.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filters/mountmgr/d…
============================================================================== --- trunk/reactos/drivers/filters/mountmgr/device.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filters/mountmgr/device.c [iso-8859-1] Fri Jan 15 21:12:57 2016 @@ -2788,6 +2788,9 @@ Status = MountMgrSetAutoMount(DeviceExtension, Irp); break; + case IOCTL_MOUNTMGR_DEFINE_UNIX_DRIVE: + case IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE: + DPRINT1("Winism! Rewrite the caller!\n"); default: Status = STATUS_INVALID_DEVICE_REQUEST; }
8 years, 11 months
1
0
0
0
[cfinck] 70595: [WINSPOOL] Additional tests show that IsValidDevmodeA/W actually does a lot more than I previously thought. Implement the missing known features and test this little function to dea...
by cfinck@svn.reactos.org
Author: cfinck Date: Fri Jan 15 04:36:31 2016 New Revision: 70595 URL:
http://svn.reactos.org/svn/reactos?rev=70595&view=rev
Log: [WINSPOOL] Additional tests show that IsValidDevmodeA/W actually does a lot more than I previously thought. Implement the missing known features and test this little function to death in winspool_apitest to cover each and every possible call. They pass on ReactOS, Windows Server 2003 and Windows 8.1. Credits and many thanks go to Mark Jansen for the additional tests! Modified: branches/colins-printing-for-freedom/reactos/win32ss/printing/base/winspool/devmode.c branches/colins-printing-for-freedom/rostests/apitests/winspool/IsValidDevmode.c Modified: branches/colins-printing-for-freedom/reactos/win32ss/printing/base/winspool/devmode.c URL:
http://svn.reactos.org/svn/reactos/branches/colins-printing-for-freedom/rea…
============================================================================== --- branches/colins-printing-for-freedom/reactos/win32ss/printing/base/winspool/devmode.c [iso-8859-1] (original) +++ branches/colins-printing-for-freedom/reactos/win32ss/printing/base/winspool/devmode.c [iso-8859-1] Fri Jan 15 04:36:31 2016 @@ -7,36 +7,225 @@ #include "precomp.h" +typedef struct _MINIMUM_SIZE_TABLE +{ + DWORD dwField; + WORD wSize; +} +MINIMUM_SIZE_TABLE, *PMINIMUM_SIZE_TABLE; + +/** + * Minimum required DEVMODEA structure size based on the used fields. Must be in descending order! + */ +static MINIMUM_SIZE_TABLE MinimumSizeA[] = { + { DM_PANNINGHEIGHT, FIELD_OFFSET(DEVMODEA, dmPanningHeight) + RTL_FIELD_SIZE(DEVMODEA, dmPanningHeight) }, + { DM_PANNINGWIDTH, FIELD_OFFSET(DEVMODEA, dmPanningWidth) + RTL_FIELD_SIZE(DEVMODEA, dmPanningWidth) }, + { DM_DITHERTYPE, FIELD_OFFSET(DEVMODEA, dmDitherType) + RTL_FIELD_SIZE(DEVMODEA, dmDitherType) }, + { DM_MEDIATYPE, FIELD_OFFSET(DEVMODEA, dmMediaType) + RTL_FIELD_SIZE(DEVMODEA, dmMediaType) }, + { DM_ICMINTENT, FIELD_OFFSET(DEVMODEA, dmICMIntent) + RTL_FIELD_SIZE(DEVMODEA, dmICMIntent) }, + { DM_ICMMETHOD, FIELD_OFFSET(DEVMODEA, dmICMMethod) + RTL_FIELD_SIZE(DEVMODEA, dmICMMethod) }, + { DM_DISPLAYFREQUENCY, FIELD_OFFSET(DEVMODEA, dmDisplayFrequency) + RTL_FIELD_SIZE(DEVMODEA, dmDisplayFrequency) }, + { DM_NUP, FIELD_OFFSET(DEVMODEA, dmNup) + RTL_FIELD_SIZE(DEVMODEA, dmNup) }, + { DM_DISPLAYFLAGS, FIELD_OFFSET(DEVMODEA, dmDisplayFlags) + RTL_FIELD_SIZE(DEVMODEA, dmDisplayFlags) }, + { DM_PELSHEIGHT, FIELD_OFFSET(DEVMODEA, dmPelsHeight) + RTL_FIELD_SIZE(DEVMODEA, dmPelsHeight) }, + { DM_PELSWIDTH, FIELD_OFFSET(DEVMODEA, dmPelsWidth) + RTL_FIELD_SIZE(DEVMODEA, dmPelsWidth) }, + { DM_BITSPERPEL, FIELD_OFFSET(DEVMODEA, dmBitsPerPel) + RTL_FIELD_SIZE(DEVMODEA, dmBitsPerPel) }, + { DM_LOGPIXELS, FIELD_OFFSET(DEVMODEA, dmLogPixels) + RTL_FIELD_SIZE(DEVMODEA, dmLogPixels) }, + { DM_FORMNAME, FIELD_OFFSET(DEVMODEA, dmFormName) + RTL_FIELD_SIZE(DEVMODEA, dmFormName) }, + { DM_COLLATE, FIELD_OFFSET(DEVMODEA, dmCollate) + RTL_FIELD_SIZE(DEVMODEA, dmCollate) }, + { DM_TTOPTION, FIELD_OFFSET(DEVMODEA, dmTTOption) + RTL_FIELD_SIZE(DEVMODEA, dmTTOption) }, + { DM_YRESOLUTION, FIELD_OFFSET(DEVMODEA, dmYResolution) + RTL_FIELD_SIZE(DEVMODEA, dmYResolution) }, + { DM_DUPLEX, FIELD_OFFSET(DEVMODEA, dmDuplex) + RTL_FIELD_SIZE(DEVMODEA, dmDuplex) }, + { DM_COLOR, FIELD_OFFSET(DEVMODEA, dmColor) + RTL_FIELD_SIZE(DEVMODEA, dmColor) }, + { DM_DISPLAYFIXEDOUTPUT, FIELD_OFFSET(DEVMODEA, dmDisplayFixedOutput) + RTL_FIELD_SIZE(DEVMODEA, dmDisplayFixedOutput) }, + { DM_DISPLAYORIENTATION, FIELD_OFFSET(DEVMODEA, dmDisplayOrientation) + RTL_FIELD_SIZE(DEVMODEA, dmDisplayOrientation) }, + { DM_POSITION, FIELD_OFFSET(DEVMODEA, dmPosition) + RTL_FIELD_SIZE(DEVMODEA, dmPosition) }, + { DM_PRINTQUALITY, FIELD_OFFSET(DEVMODEA, dmPrintQuality) + RTL_FIELD_SIZE(DEVMODEA, dmPrintQuality) }, + { DM_DEFAULTSOURCE, FIELD_OFFSET(DEVMODEA, dmDefaultSource) + RTL_FIELD_SIZE(DEVMODEA, dmDefaultSource) }, + { DM_COPIES, FIELD_OFFSET(DEVMODEA, dmCopies) + RTL_FIELD_SIZE(DEVMODEA, dmCopies) }, + { DM_SCALE, FIELD_OFFSET(DEVMODEA, dmScale) + RTL_FIELD_SIZE(DEVMODEA, dmScale) }, + { DM_PAPERWIDTH, FIELD_OFFSET(DEVMODEA, dmPaperWidth) + RTL_FIELD_SIZE(DEVMODEA, dmPaperWidth) }, + { DM_PAPERLENGTH, FIELD_OFFSET(DEVMODEA, dmPaperLength) + RTL_FIELD_SIZE(DEVMODEA, dmPaperLength) }, + { DM_PAPERSIZE, FIELD_OFFSET(DEVMODEA, dmPaperSize) + RTL_FIELD_SIZE(DEVMODEA, dmPaperSize) }, + { DM_ORIENTATION, FIELD_OFFSET(DEVMODEA, dmOrientation) + RTL_FIELD_SIZE(DEVMODEA, dmOrientation) }, + { 0, 0 } +}; + +/** + * Minimum required DEVMODEW structure size based on the used fields. Must be in descending order! + */ +static MINIMUM_SIZE_TABLE MinimumSizeW[] = { + { DM_PANNINGHEIGHT, FIELD_OFFSET(DEVMODEW, dmPanningHeight) + RTL_FIELD_SIZE(DEVMODEW, dmPanningHeight) }, + { DM_PANNINGWIDTH, FIELD_OFFSET(DEVMODEW, dmPanningWidth) + RTL_FIELD_SIZE(DEVMODEW, dmPanningWidth) }, + { DM_DITHERTYPE, FIELD_OFFSET(DEVMODEW, dmDitherType) + RTL_FIELD_SIZE(DEVMODEW, dmDitherType) }, + { DM_MEDIATYPE, FIELD_OFFSET(DEVMODEW, dmMediaType) + RTL_FIELD_SIZE(DEVMODEW, dmMediaType) }, + { DM_ICMINTENT, FIELD_OFFSET(DEVMODEW, dmICMIntent) + RTL_FIELD_SIZE(DEVMODEW, dmICMIntent) }, + { DM_ICMMETHOD, FIELD_OFFSET(DEVMODEW, dmICMMethod) + RTL_FIELD_SIZE(DEVMODEW, dmICMMethod) }, + { DM_DISPLAYFREQUENCY, FIELD_OFFSET(DEVMODEW, dmDisplayFrequency) + RTL_FIELD_SIZE(DEVMODEW, dmDisplayFrequency) }, + { DM_NUP, FIELD_OFFSET(DEVMODEW, dmNup) + RTL_FIELD_SIZE(DEVMODEW, dmNup) }, + { DM_DISPLAYFLAGS, FIELD_OFFSET(DEVMODEW, dmDisplayFlags) + RTL_FIELD_SIZE(DEVMODEW, dmDisplayFlags) }, + { DM_PELSHEIGHT, FIELD_OFFSET(DEVMODEW, dmPelsHeight) + RTL_FIELD_SIZE(DEVMODEW, dmPelsHeight) }, + { DM_PELSWIDTH, FIELD_OFFSET(DEVMODEW, dmPelsWidth) + RTL_FIELD_SIZE(DEVMODEW, dmPelsWidth) }, + { DM_BITSPERPEL, FIELD_OFFSET(DEVMODEW, dmBitsPerPel) + RTL_FIELD_SIZE(DEVMODEW, dmBitsPerPel) }, + { DM_LOGPIXELS, FIELD_OFFSET(DEVMODEW, dmLogPixels) + RTL_FIELD_SIZE(DEVMODEW, dmLogPixels) }, + { DM_FORMNAME, FIELD_OFFSET(DEVMODEW, dmFormName) + RTL_FIELD_SIZE(DEVMODEW, dmFormName) }, + { DM_COLLATE, FIELD_OFFSET(DEVMODEW, dmCollate) + RTL_FIELD_SIZE(DEVMODEW, dmCollate) }, + { DM_TTOPTION, FIELD_OFFSET(DEVMODEW, dmTTOption) + RTL_FIELD_SIZE(DEVMODEW, dmTTOption) }, + { DM_YRESOLUTION, FIELD_OFFSET(DEVMODEW, dmYResolution) + RTL_FIELD_SIZE(DEVMODEW, dmYResolution) }, + { DM_DUPLEX, FIELD_OFFSET(DEVMODEW, dmDuplex) + RTL_FIELD_SIZE(DEVMODEW, dmDuplex) }, + { DM_COLOR, FIELD_OFFSET(DEVMODEW, dmColor) + RTL_FIELD_SIZE(DEVMODEW, dmColor) }, + { DM_DISPLAYFIXEDOUTPUT, FIELD_OFFSET(DEVMODEW, dmDisplayFixedOutput) + RTL_FIELD_SIZE(DEVMODEW, dmDisplayFixedOutput) }, + { DM_DISPLAYORIENTATION, FIELD_OFFSET(DEVMODEW, dmDisplayOrientation) + RTL_FIELD_SIZE(DEVMODEW, dmDisplayOrientation) }, + { DM_POSITION, FIELD_OFFSET(DEVMODEW, dmPosition) + RTL_FIELD_SIZE(DEVMODEW, dmPosition) }, + { DM_PRINTQUALITY, FIELD_OFFSET(DEVMODEW, dmPrintQuality) + RTL_FIELD_SIZE(DEVMODEW, dmPrintQuality) }, + { DM_DEFAULTSOURCE, FIELD_OFFSET(DEVMODEW, dmDefaultSource) + RTL_FIELD_SIZE(DEVMODEW, dmDefaultSource) }, + { DM_COPIES, FIELD_OFFSET(DEVMODEW, dmCopies) + RTL_FIELD_SIZE(DEVMODEW, dmCopies) }, + { DM_SCALE, FIELD_OFFSET(DEVMODEW, dmScale) + RTL_FIELD_SIZE(DEVMODEW, dmScale) }, + { DM_PAPERWIDTH, FIELD_OFFSET(DEVMODEW, dmPaperWidth) + RTL_FIELD_SIZE(DEVMODEW, dmPaperWidth) }, + { DM_PAPERLENGTH, FIELD_OFFSET(DEVMODEW, dmPaperLength) + RTL_FIELD_SIZE(DEVMODEW, dmPaperLength) }, + { DM_PAPERSIZE, FIELD_OFFSET(DEVMODEW, dmPaperSize) + RTL_FIELD_SIZE(DEVMODEW, dmPaperSize) }, + { DM_ORIENTATION, FIELD_OFFSET(DEVMODEW, dmOrientation) + RTL_FIELD_SIZE(DEVMODEW, dmOrientation) }, + { 0, 0 } +}; + +/** + * Replace the last character by a null terminator if the given ANSI string is not null-terminated. + */ +static __inline void +_FixStringA(PBYTE String, DWORD cbString) +{ + const PBYTE pLastCharacter = &String[cbString / sizeof(BYTE) - 1]; + PBYTE p = String; + + while (*p) + { + if (p == pLastCharacter) + { + *p = 0; + break; + } + + p++; + } +} + +/** + * Replace the last character by a null terminator if the given Unicode string is not null-terminated. + */ +static __inline void +_FixStringW(PWSTR String, DWORD cbString) +{ + const PWSTR pLastCharacter = &String[cbString / sizeof(WCHAR) - 1]; + PWSTR p = String; + + while (*p) + { + if (p == pLastCharacter) + { + *p = 0; + break; + } + + p++; + } +} + BOOL WINAPI IsValidDevmodeA(PDEVMODEA pDevmode, size_t DevmodeSize) { - // Check if a Devmode was given, its dmSize member is at least as big as the DEVMODEA structure - // and DevmodeSize is large enough for the public and private members of the structure. - if (!pDevmode || - pDevmode->dmSize < sizeof(DEVMODEA) || - DevmodeSize < pDevmode->dmSize + pDevmode->dmDriverExtra) - { - SetLastError(ERROR_INVALID_DATA); - return FALSE; - } + PMINIMUM_SIZE_TABLE pTable = MinimumSizeA; + WORD wRequiredSize; + + // Check if a Devmode was given at all. + if (!pDevmode) + goto Failure; + + // Verify that DevmodeSize is large enough to hold the public and private members of the structure. + if (DevmodeSize < pDevmode->dmSize + pDevmode->dmDriverExtra) + goto Failure; + + // If the structure has private members, the public structure must be 32-bit packed. + if (pDevmode->dmDriverExtra && pDevmode->dmSize % 4) + goto Failure; + + // Now determine the minimum possible dmSize based on the given fields in dmFields. + wRequiredSize = FIELD_OFFSET(DEVMODEA, dmFields) + RTL_FIELD_SIZE(DEVMODEA, dmFields); + + while (pTable->dwField) + { + if (pDevmode->dmFields & pTable->dwField) + { + wRequiredSize = pTable->wSize; + break; + } + + pTable++; + } + + // Verify that the value in dmSize is big enough for the used fields. + if (pDevmode->dmSize < wRequiredSize) + goto Failure; + + // Check if dmDeviceName and (if used) dmFormName are null-terminated. + // Fix this if they aren't. + _FixStringA(pDevmode->dmDeviceName, sizeof(pDevmode->dmDeviceName)); + if (pDevmode->dmFields & DM_FORMNAME) + _FixStringA(pDevmode->dmFormName, sizeof(pDevmode->dmFormName)); // Return success without setting the error code. return TRUE; + +Failure: + SetLastError(ERROR_INVALID_DATA); + return FALSE; } BOOL WINAPI IsValidDevmodeW(PDEVMODEW pDevmode, size_t DevmodeSize) { - // Check if a Devmode was given, its dmSize member is at least as big as the DEVMODEW structure - // and DevmodeSize is large enough for the public and private members of the structure. - if (!pDevmode || - pDevmode->dmSize < sizeof(DEVMODEW) || - DevmodeSize < pDevmode->dmSize + pDevmode->dmDriverExtra) - { - SetLastError(ERROR_INVALID_DATA); - return FALSE; - } + PMINIMUM_SIZE_TABLE pTable = MinimumSizeW; + WORD wRequiredSize; + + // Check if a Devmode was given at all. + if (!pDevmode) + goto Failure; + + // Verify that DevmodeSize is large enough to hold the public and private members of the structure. + if (DevmodeSize < pDevmode->dmSize + pDevmode->dmDriverExtra) + goto Failure; + + // If the structure has private members, the public structure must be 32-bit packed. + if (pDevmode->dmDriverExtra && pDevmode->dmSize % 4) + goto Failure; + + // Now determine the minimum possible dmSize based on the given fields in dmFields. + wRequiredSize = FIELD_OFFSET(DEVMODEW, dmFields) + RTL_FIELD_SIZE(DEVMODEW, dmFields); + + while (pTable->dwField) + { + if (pDevmode->dmFields & pTable->dwField) + { + wRequiredSize = pTable->wSize; + break; + } + + pTable++; + } + + // Verify that the value in dmSize is big enough for the used fields. + if (pDevmode->dmSize < wRequiredSize) + goto Failure; + + // Check if dmDeviceName and (if used) dmFormName are null-terminated. + // Fix this if they aren't. + _FixStringW(pDevmode->dmDeviceName, sizeof(pDevmode->dmDeviceName)); + if (pDevmode->dmFields & DM_FORMNAME) + _FixStringW(pDevmode->dmFormName, sizeof(pDevmode->dmFormName)); // Return success without setting the error code. return TRUE; -} + +Failure: + SetLastError(ERROR_INVALID_DATA); + return FALSE; +} Modified: branches/colins-printing-for-freedom/rostests/apitests/winspool/IsValidDevmode.c URL:
http://svn.reactos.org/svn/reactos/branches/colins-printing-for-freedom/ros…
============================================================================== --- branches/colins-printing-for-freedom/rostests/apitests/winspool/IsValidDevmode.c [iso-8859-1] (original) +++ branches/colins-printing-for-freedom/rostests/apitests/winspool/IsValidDevmode.c [iso-8859-1] Fri Jan 15 04:36:31 2016 @@ -12,16 +12,89 @@ #include <winbase.h> #include <wingdi.h> #include <winspool.h> - -// With very high probability, this is everything you can test for IsValidDevmode. -// For your own testing, you can fill a DevMode structure with random bytes multiple times, -// always set dmSize and dmDriverExtra appropriately and feed it to IsValidDevmode. -// The function will always succeed. -// I'm not doing that here, because I don't want to introduce randomness. +#include <wchar.h> + +typedef struct _MINIMUM_SIZE_TABLE +{ + DWORD dwField; + WORD wSize; +} +MINIMUM_SIZE_TABLE, *PMINIMUM_SIZE_TABLE; + +static MINIMUM_SIZE_TABLE MinimumSizeA[] = { + { DM_PANNINGHEIGHT, FIELD_OFFSET(DEVMODEA, dmPanningHeight) + RTL_FIELD_SIZE(DEVMODEA, dmPanningHeight) }, + { DM_PANNINGWIDTH, FIELD_OFFSET(DEVMODEA, dmPanningWidth) + RTL_FIELD_SIZE(DEVMODEA, dmPanningWidth) }, + { DM_DITHERTYPE, FIELD_OFFSET(DEVMODEA, dmDitherType) + RTL_FIELD_SIZE(DEVMODEA, dmDitherType) }, + { DM_MEDIATYPE, FIELD_OFFSET(DEVMODEA, dmMediaType) + RTL_FIELD_SIZE(DEVMODEA, dmMediaType) }, + { DM_ICMINTENT, FIELD_OFFSET(DEVMODEA, dmICMIntent) + RTL_FIELD_SIZE(DEVMODEA, dmICMIntent) }, + { DM_ICMMETHOD, FIELD_OFFSET(DEVMODEA, dmICMMethod) + RTL_FIELD_SIZE(DEVMODEA, dmICMMethod) }, + { DM_DISPLAYFREQUENCY, FIELD_OFFSET(DEVMODEA, dmDisplayFrequency) + RTL_FIELD_SIZE(DEVMODEA, dmDisplayFrequency) }, + { DM_NUP, FIELD_OFFSET(DEVMODEA, dmNup) + RTL_FIELD_SIZE(DEVMODEA, dmNup) }, + { DM_DISPLAYFLAGS, FIELD_OFFSET(DEVMODEA, dmDisplayFlags) + RTL_FIELD_SIZE(DEVMODEA, dmDisplayFlags) }, + { DM_PELSHEIGHT, FIELD_OFFSET(DEVMODEA, dmPelsHeight) + RTL_FIELD_SIZE(DEVMODEA, dmPelsHeight) }, + { DM_PELSWIDTH, FIELD_OFFSET(DEVMODEA, dmPelsWidth) + RTL_FIELD_SIZE(DEVMODEA, dmPelsWidth) }, + { DM_BITSPERPEL, FIELD_OFFSET(DEVMODEA, dmBitsPerPel) + RTL_FIELD_SIZE(DEVMODEA, dmBitsPerPel) }, + { DM_LOGPIXELS, FIELD_OFFSET(DEVMODEA, dmLogPixels) + RTL_FIELD_SIZE(DEVMODEA, dmLogPixels) }, + { DM_FORMNAME, FIELD_OFFSET(DEVMODEA, dmFormName) + RTL_FIELD_SIZE(DEVMODEA, dmFormName) }, + { DM_COLLATE, FIELD_OFFSET(DEVMODEA, dmCollate) + RTL_FIELD_SIZE(DEVMODEA, dmCollate) }, + { DM_TTOPTION, FIELD_OFFSET(DEVMODEA, dmTTOption) + RTL_FIELD_SIZE(DEVMODEA, dmTTOption) }, + { DM_YRESOLUTION, FIELD_OFFSET(DEVMODEA, dmYResolution) + RTL_FIELD_SIZE(DEVMODEA, dmYResolution) }, + { DM_DUPLEX, FIELD_OFFSET(DEVMODEA, dmDuplex) + RTL_FIELD_SIZE(DEVMODEA, dmDuplex) }, + { DM_COLOR, FIELD_OFFSET(DEVMODEA, dmColor) + RTL_FIELD_SIZE(DEVMODEA, dmColor) }, + { DM_DISPLAYFIXEDOUTPUT, FIELD_OFFSET(DEVMODEA, dmDisplayFixedOutput) + RTL_FIELD_SIZE(DEVMODEA, dmDisplayFixedOutput) }, + { DM_DISPLAYORIENTATION, FIELD_OFFSET(DEVMODEA, dmDisplayOrientation) + RTL_FIELD_SIZE(DEVMODEA, dmDisplayOrientation) }, + { DM_POSITION, FIELD_OFFSET(DEVMODEA, dmPosition) + RTL_FIELD_SIZE(DEVMODEA, dmPosition) }, + { DM_PRINTQUALITY, FIELD_OFFSET(DEVMODEA, dmPrintQuality) + RTL_FIELD_SIZE(DEVMODEA, dmPrintQuality) }, + { DM_DEFAULTSOURCE, FIELD_OFFSET(DEVMODEA, dmDefaultSource) + RTL_FIELD_SIZE(DEVMODEA, dmDefaultSource) }, + { DM_COPIES, FIELD_OFFSET(DEVMODEA, dmCopies) + RTL_FIELD_SIZE(DEVMODEA, dmCopies) }, + { DM_SCALE, FIELD_OFFSET(DEVMODEA, dmScale) + RTL_FIELD_SIZE(DEVMODEA, dmScale) }, + { DM_PAPERWIDTH, FIELD_OFFSET(DEVMODEA, dmPaperWidth) + RTL_FIELD_SIZE(DEVMODEA, dmPaperWidth) }, + { DM_PAPERLENGTH, FIELD_OFFSET(DEVMODEA, dmPaperLength) + RTL_FIELD_SIZE(DEVMODEA, dmPaperLength) }, + { DM_PAPERSIZE, FIELD_OFFSET(DEVMODEA, dmPaperSize) + RTL_FIELD_SIZE(DEVMODEA, dmPaperSize) }, + { DM_ORIENTATION, FIELD_OFFSET(DEVMODEA, dmOrientation) + RTL_FIELD_SIZE(DEVMODEA, dmOrientation) }, + { 0, FIELD_OFFSET(DEVMODEA, dmFields) + RTL_FIELD_SIZE(DEVMODEA, dmFields) } +}; + +static MINIMUM_SIZE_TABLE MinimumSizeW[] = { + { DM_PANNINGHEIGHT, FIELD_OFFSET(DEVMODEW, dmPanningHeight) + RTL_FIELD_SIZE(DEVMODEW, dmPanningHeight) }, + { DM_PANNINGWIDTH, FIELD_OFFSET(DEVMODEW, dmPanningWidth) + RTL_FIELD_SIZE(DEVMODEW, dmPanningWidth) }, + { DM_DITHERTYPE, FIELD_OFFSET(DEVMODEW, dmDitherType) + RTL_FIELD_SIZE(DEVMODEW, dmDitherType) }, + { DM_MEDIATYPE, FIELD_OFFSET(DEVMODEW, dmMediaType) + RTL_FIELD_SIZE(DEVMODEW, dmMediaType) }, + { DM_ICMINTENT, FIELD_OFFSET(DEVMODEW, dmICMIntent) + RTL_FIELD_SIZE(DEVMODEW, dmICMIntent) }, + { DM_ICMMETHOD, FIELD_OFFSET(DEVMODEW, dmICMMethod) + RTL_FIELD_SIZE(DEVMODEW, dmICMMethod) }, + { DM_DISPLAYFREQUENCY, FIELD_OFFSET(DEVMODEW, dmDisplayFrequency) + RTL_FIELD_SIZE(DEVMODEW, dmDisplayFrequency) }, + { DM_NUP, FIELD_OFFSET(DEVMODEW, dmNup) + RTL_FIELD_SIZE(DEVMODEW, dmNup) }, + { DM_DISPLAYFLAGS, FIELD_OFFSET(DEVMODEW, dmDisplayFlags) + RTL_FIELD_SIZE(DEVMODEW, dmDisplayFlags) }, + { DM_PELSHEIGHT, FIELD_OFFSET(DEVMODEW, dmPelsHeight) + RTL_FIELD_SIZE(DEVMODEW, dmPelsHeight) }, + { DM_PELSWIDTH, FIELD_OFFSET(DEVMODEW, dmPelsWidth) + RTL_FIELD_SIZE(DEVMODEW, dmPelsWidth) }, + { DM_BITSPERPEL, FIELD_OFFSET(DEVMODEW, dmBitsPerPel) + RTL_FIELD_SIZE(DEVMODEW, dmBitsPerPel) }, + { DM_LOGPIXELS, FIELD_OFFSET(DEVMODEW, dmLogPixels) + RTL_FIELD_SIZE(DEVMODEW, dmLogPixels) }, + { DM_FORMNAME, FIELD_OFFSET(DEVMODEW, dmFormName) + RTL_FIELD_SIZE(DEVMODEW, dmFormName) }, + { DM_COLLATE, FIELD_OFFSET(DEVMODEW, dmCollate) + RTL_FIELD_SIZE(DEVMODEW, dmCollate) }, + { DM_TTOPTION, FIELD_OFFSET(DEVMODEW, dmTTOption) + RTL_FIELD_SIZE(DEVMODEW, dmTTOption) }, + { DM_YRESOLUTION, FIELD_OFFSET(DEVMODEW, dmYResolution) + RTL_FIELD_SIZE(DEVMODEW, dmYResolution) }, + { DM_DUPLEX, FIELD_OFFSET(DEVMODEW, dmDuplex) + RTL_FIELD_SIZE(DEVMODEW, dmDuplex) }, + { DM_COLOR, FIELD_OFFSET(DEVMODEW, dmColor) + RTL_FIELD_SIZE(DEVMODEW, dmColor) }, + { DM_DISPLAYFIXEDOUTPUT, FIELD_OFFSET(DEVMODEW, dmDisplayFixedOutput) + RTL_FIELD_SIZE(DEVMODEW, dmDisplayFixedOutput) }, + { DM_DISPLAYORIENTATION, FIELD_OFFSET(DEVMODEW, dmDisplayOrientation) + RTL_FIELD_SIZE(DEVMODEW, dmDisplayOrientation) }, + { DM_POSITION, FIELD_OFFSET(DEVMODEW, dmPosition) + RTL_FIELD_SIZE(DEVMODEW, dmPosition) }, + { DM_PRINTQUALITY, FIELD_OFFSET(DEVMODEW, dmPrintQuality) + RTL_FIELD_SIZE(DEVMODEW, dmPrintQuality) }, + { DM_DEFAULTSOURCE, FIELD_OFFSET(DEVMODEW, dmDefaultSource) + RTL_FIELD_SIZE(DEVMODEW, dmDefaultSource) }, + { DM_COPIES, FIELD_OFFSET(DEVMODEW, dmCopies) + RTL_FIELD_SIZE(DEVMODEW, dmCopies) }, + { DM_SCALE, FIELD_OFFSET(DEVMODEW, dmScale) + RTL_FIELD_SIZE(DEVMODEW, dmScale) }, + { DM_PAPERWIDTH, FIELD_OFFSET(DEVMODEW, dmPaperWidth) + RTL_FIELD_SIZE(DEVMODEW, dmPaperWidth) }, + { DM_PAPERLENGTH, FIELD_OFFSET(DEVMODEW, dmPaperLength) + RTL_FIELD_SIZE(DEVMODEW, dmPaperLength) }, + { DM_PAPERSIZE, FIELD_OFFSET(DEVMODEW, dmPaperSize) + RTL_FIELD_SIZE(DEVMODEW, dmPaperSize) }, + { DM_ORIENTATION, FIELD_OFFSET(DEVMODEW, dmOrientation) + RTL_FIELD_SIZE(DEVMODEW, dmOrientation) }, + { 0, FIELD_OFFSET(DEVMODEW, dmFields) + RTL_FIELD_SIZE(DEVMODEW, dmFields) } +}; + + START_TEST(IsValidDevmodeA) { DEVMODEA DevMode; + PMINIMUM_SIZE_TABLE pTable = MinimumSizeA; // Give no Devmode at all, this has to fail without crashing. SetLastError(0xDEADBEEF); @@ -72,11 +145,63 @@ SetLastError(0xDEADBEEF); ok(IsValidDevmodeA(&DevMode, sizeof(DEVMODEA) + 1), "IsValidDevmodeA returns FALSE!\n"); ok(GetLastError() == 0xDEADBEEF, "IsValidDevmodeA returns error %lu!\n", GetLastError()); + + // dmSize must be a multiple of 4 if any dmDriverExtra is given. + for (DevMode.dmDriverExtra = 1; DevMode.dmDriverExtra <= 4; DevMode.dmDriverExtra++) + { + for (DevMode.dmSize = sizeof(DEVMODEA); DevMode.dmSize < sizeof(DEVMODEA) + 4; DevMode.dmSize++) + { + BOOL bExpected = (DevMode.dmSize % 4 == 0); + DWORD dwExpectedError = (bExpected ? 0xDEADBEEF : ERROR_INVALID_DATA); + + SetLastError(0xDEADBEEF); + ok(IsValidDevmodeA(&DevMode, DevMode.dmSize + DevMode.dmDriverExtra) == bExpected, "IsValidDevmodeA returns %d!\n", !bExpected); + ok(GetLastError() == dwExpectedError, "IsValidDevmodeA returns error %lu!\n", GetLastError()); + } + } + + // IsValidDevmodeA also fixes missing null-terminations if the corresponding fields are used. + ZeroMemory(&DevMode, sizeof(DEVMODEA)); + DevMode.dmSize = sizeof(DEVMODEA); + memset(DevMode.dmDeviceName, 'A', 32); + memset(DevMode.dmFormName, 'A', 32); + ok(IsValidDevmodeA(&DevMode, DevMode.dmSize), "IsValidDevmodeA returns FALSE!\n"); + ok(DevMode.dmDeviceName[31] == '\0', "Expected dmDeviceName to be '\\0', but is '%c'\n", DevMode.dmDeviceName[31]); + ok(DevMode.dmFormName[31] == 'A', "Expected dmFormName to be 'A', but is '%c'\n", DevMode.dmDeviceName[31]); + + ZeroMemory(&DevMode, sizeof(DEVMODEA)); + DevMode.dmSize = sizeof(DEVMODEA); + DevMode.dmFields = DM_FORMNAME; + memset(DevMode.dmDeviceName, 'A', 32); + memset(DevMode.dmFormName, 'A', 32); + ok(IsValidDevmodeA(&DevMode, DevMode.dmSize), "IsValidDevmodeA returns FALSE!\n"); + ok(DevMode.dmDeviceName[31] == '\0', "Expected dmDeviceName to be '\\0', but is '%c'\n", DevMode.dmDeviceName[31]); + ok(DevMode.dmFormName[31] == '\0', "Expected dmFormName to be '\\0', but is '%c'\n", DevMode.dmDeviceName[31]); + + // Depending on which fields are given in dmFields, the minimum value for dmSize is different. + ZeroMemory(&DevMode, sizeof(DEVMODEA)); + + do + { + DevMode.dmFields = pTable->dwField; + DevMode.dmSize = pTable->wSize; + + // This size should succeed! + ok(IsValidDevmodeA(&DevMode, DevMode.dmSize), "IsValidDevmodeA returns FALSE!\n"); + + // One byte less should not succeed! + DevMode.dmSize--; + ok(!IsValidDevmodeA(&DevMode, DevMode.dmSize), "IsValidDevmodeA returns TRUE!\n"); + + pTable++; + } + while (pTable->dwField); } START_TEST(IsValidDevmodeW) { DEVMODEW DevMode; + PMINIMUM_SIZE_TABLE pTable = MinimumSizeW; // Give no Devmode at all, this has to fail without crashing. SetLastError(0xDEADBEEF); @@ -127,4 +252,55 @@ SetLastError(0xDEADBEEF); ok(IsValidDevmodeW(&DevMode, sizeof(DEVMODEW) + 1), "IsValidDevmodeW returns FALSE!\n"); ok(GetLastError() == 0xDEADBEEF, "IsValidDevmodeW returns error %lu!\n", GetLastError()); + + // dmSize must be a multiple of 4 if any dmDriverExtra is given. + for (DevMode.dmDriverExtra = 1; DevMode.dmDriverExtra <= 4; DevMode.dmDriverExtra++) + { + for (DevMode.dmSize = sizeof(DEVMODEW); DevMode.dmSize < sizeof(DEVMODEW) + 4; DevMode.dmSize++) + { + BOOL bExpected = (DevMode.dmSize % 4 == 0); + DWORD dwExpectedError = (bExpected ? 0xDEADBEEF : ERROR_INVALID_DATA); + + SetLastError(0xDEADBEEF); + ok(IsValidDevmodeW(&DevMode, DevMode.dmSize + DevMode.dmDriverExtra) == bExpected, "IsValidDevmodeW returns %d!\n", !bExpected); + ok(GetLastError() == dwExpectedError, "IsValidDevmodeW returns error %lu!\n", GetLastError()); + } + } + + // IsValidDevmodeW also fixes missing null-terminations if the corresponding fields are used. + ZeroMemory(&DevMode, sizeof(DEVMODEW)); + DevMode.dmSize = sizeof(DEVMODEW); + wmemset(DevMode.dmDeviceName, L'A', 32); + wmemset(DevMode.dmFormName, L'A', 32); + ok(IsValidDevmodeW(&DevMode, DevMode.dmSize), "IsValidDevmodeW returns FALSE!\n"); + ok(DevMode.dmDeviceName[31] == L'\0', "Expected dmDeviceName to be '\\0', but is '%C'\n", DevMode.dmDeviceName[31]); + ok(DevMode.dmFormName[31] == L'A', "Expected dmFormName to be 'A', but is '%C'\n", DevMode.dmDeviceName[31]); + + ZeroMemory(&DevMode, sizeof(DEVMODEW)); + DevMode.dmSize = sizeof(DEVMODEW); + DevMode.dmFields = DM_FORMNAME; + wmemset(DevMode.dmDeviceName, L'A', 32); + wmemset(DevMode.dmFormName, L'A', 32); + ok(IsValidDevmodeW(&DevMode, DevMode.dmSize), "IsValidDevmodeW returns FALSE!\n"); + ok(DevMode.dmDeviceName[31] == L'\0', "Expected dmDeviceName to be '\\0', but is '%C'\n", DevMode.dmDeviceName[31]); + ok(DevMode.dmFormName[31] == L'\0', "Expected dmFormName to be '\\0', but is '%C'\n", DevMode.dmDeviceName[31]); + + // Depending on which fields are given in dmFields, the minimum value for dmSize is different. + ZeroMemory(&DevMode, sizeof(DEVMODEW)); + + do + { + DevMode.dmFields = pTable->dwField; + DevMode.dmSize = pTable->wSize; + + // This size should succeed! + ok(IsValidDevmodeW(&DevMode, DevMode.dmSize), "IsValidDevmodeW returns FALSE!\n"); + + // One byte less should not succeed! + DevMode.dmSize--; + ok(!IsValidDevmodeW(&DevMode, DevMode.dmSize), "IsValidDevmodeW returns TRUE!\n"); + + pTable++; + } + while (pTable->dwField); }
8 years, 11 months
1
0
0
0
[hbelusca] 70594: [FREELDR] - Since the registry handling rewrite of Timo in r61595 all the freeldr-specific registry structures got deprecated. Remove them, as well as few other prototypes of non-...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Thu Jan 14 20:00:18 2016 New Revision: 70594 URL:
http://svn.reactos.org/svn/reactos?rev=70594&view=rev
Log: [FREELDR] - Since the registry handling rewrite of Timo in r61595 all the freeldr-specific registry structures got deprecated. Remove them, as well as few other prototypes of non-existing functions. - Use the CMLIB registry flags instead of some (already-removed) flags --> fix build. Modified: trunk/reactos/boot/freeldr/freeldr/windows/registry.c trunk/reactos/boot/freeldr/freeldr/windows/registry.h trunk/reactos/boot/freeldr/freeldr/windows/winldr.c trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c Modified: trunk/reactos/boot/freeldr/freeldr/windows/registry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/registry.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/registry.c [iso-8859-1] Thu Jan 14 20:00:18 2016 @@ -27,7 +27,7 @@ static PCMHIVE CmHive; static PCM_KEY_NODE RootKeyNode; -static FRLDRHKEY CurrentControlSetKey; +static HKEY CurrentControlSetKey; BOOLEAN RegImportBinaryHive( @@ -77,8 +77,8 @@ _In_ BOOLEAN LastKnownGood) { WCHAR ControlSetKeyName[80]; - FRLDRHKEY SelectKey; - FRLDRHKEY SystemKey; + HKEY SelectKey; + HKEY SystemKey; ULONG CurrentSet = 0; ULONG DefaultSet = 0; ULONG LastKnownGoodSet = 0; @@ -261,11 +261,11 @@ LONG RegEnumKey( - _In_ FRLDRHKEY Key, + _In_ HKEY Key, _In_ ULONG Index, _Out_ PWCHAR Name, _Inout_ ULONG* NameSize, - _Out_opt_ FRLDRHKEY *SubKey) + _Out_opt_ PHKEY SubKey) { PHHIVE Hive = &CmHive->Hive; PCM_KEY_NODE KeyNode, SubKeyNode; @@ -307,7 +307,7 @@ if (SubKey != NULL) { - *SubKey = (FRLDRHKEY)SubKeyNode; + *SubKey = (HKEY)SubKeyNode; } TRACE("RegEnumKey done -> %u, '%.*s'\n", *NameSize, *NameSize, Name); @@ -316,9 +316,9 @@ LONG RegOpenKey( - _In_ FRLDRHKEY ParentKey, + _In_ HKEY ParentKey, _In_z_ PCWSTR KeyName, - _Out_ PFRLDRHKEY Key) + _Out_ PHKEY Key) { UNICODE_STRING RemainingPath, SubKeyName; UNICODE_STRING CurrentControlSet = RTL_CONSTANT_STRING(L"CurrentControlSet"); @@ -420,7 +420,7 @@ } TRACE("RegOpenKey done\n"); - *Key = (FRLDRHKEY)KeyNode; + *Key = (HKEY)KeyNode; return ERROR_SUCCESS; } @@ -445,14 +445,14 @@ if (DataSize != NULL) { /* Get the data length */ - DataLength = ValueCell->DataLength & REG_DATA_SIZE_MASK; + DataLength = ValueCell->DataLength & ~CM_KEY_VALUE_SPECIAL_SIZE; /* Does the caller want the data? */ if ((Data != NULL) && (*DataSize != 0)) { /* Check where the data is stored */ if ((DataLength <= sizeof(HCELL_INDEX)) && - (ValueCell->DataLength & REG_DATA_IN_OFFSET)) + (ValueCell->DataLength & CM_KEY_VALUE_SPECIAL_SIZE)) { /* The data member contains the data */ RtlCopyMemory(Data, @@ -477,7 +477,7 @@ LONG RegQueryValue( - _In_ FRLDRHKEY Key, + _In_ HKEY Key, _In_z_ PCWSTR ValueName, _Out_opt_ ULONG* Type, _Out_opt_ PUCHAR Data, @@ -532,7 +532,7 @@ LONG RegEnumValue( - _In_ FRLDRHKEY Key, + _In_ HKEY Key, _In_ ULONG Index, _Out_ PWCHAR ValueName, _Inout_ ULONG* NameSize, Modified: trunk/reactos/boot/freeldr/freeldr/windows/registry.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/registry.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/registry.h [iso-8859-1] Thu Jan 14 20:00:18 2016 @@ -21,43 +21,7 @@ #ifndef __REGISTRY_H #define __REGISTRY_H -#define TAG_REG_NAME 'NgeR' -#define TAG_REG_KEY 'KgeR' -#define TAG_REG_KEY_DATA 'DgeR' -#define TAG_REG_VALUE 'VgeR' - -typedef struct _REG_KEY -{ - LIST_ENTRY KeyList; - LIST_ENTRY SubKeyList; - LIST_ENTRY ValueList; - - ULONG SubKeyCount; - ULONG ValueCount; - - ULONG NameSize; - PWCHAR Name; - - /* Default data */ - ULONG DataType; - ULONG DataSize; - PCHAR Data; -} KEY, *FRLDRHKEY, **PFRLDRHKEY; - - -typedef struct _REG_VALUE -{ - LIST_ENTRY ValueList; - - /* Value name */ - ULONG NameSize; - PWCHAR Name; - - /* Value data */ - ULONG DataType; - ULONG DataSize; - PCHAR Data; -} VALUE, *PVALUE; +typedef HANDLE HKEY, *PHKEY; VOID RegInitializeRegistry(VOID); @@ -67,37 +31,33 @@ LONG RegEnumKey( - _In_ FRLDRHKEY Key, + _In_ HKEY Key, _In_ ULONG Index, _Out_ PWCHAR Name, _Inout_ ULONG* NameSize, - _Out_opt_ FRLDRHKEY *SubKey); + _Out_opt_ PHKEY SubKey); LONG -RegOpenKey(FRLDRHKEY ParentKey, +RegOpenKey(HKEY ParentKey, PCWSTR KeyName, - PFRLDRHKEY Key); + PHKEY Key); LONG -RegSetValue(FRLDRHKEY Key, +RegSetValue(HKEY Key, PCWSTR ValueName, ULONG Type, PCSTR Data, ULONG DataSize); LONG -RegQueryValue(FRLDRHKEY Key, +RegQueryValue(HKEY Key, PCWSTR ValueName, ULONG* Type, PUCHAR Data, ULONG* DataSize); LONG -RegDeleteValue(FRLDRHKEY Key, - PCWSTR ValueName); - -LONG -RegEnumValue(FRLDRHKEY Key, +RegEnumValue(HKEY Key, ULONG Index, PWCHAR ValueName, ULONG* NameSize, @@ -105,22 +65,9 @@ PUCHAR Data, ULONG* DataSize); -ULONG -RegGetSubKeyCount (FRLDRHKEY Key); - -ULONG -RegGetValueCount (FRLDRHKEY Key); - - BOOLEAN -RegImportBinaryHive (PCHAR ChunkBase, +RegImportBinaryHive(PCHAR ChunkBase, ULONG ChunkSize); - -BOOLEAN -RegExportBinaryHive (PCWSTR KeyName, - PCHAR ChunkBase, - ULONG* ChunkSize); - #endif /* __REGISTRY_H */ Modified: trunk/reactos/boot/freeldr/freeldr/windows/winldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/winldr.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/winldr.c [iso-8859-1] Thu Jan 14 20:00:18 2016 @@ -411,7 +411,7 @@ WinLdrDetectVersion(VOID) { LONG rc; - FRLDRHKEY hKey; + HKEY hKey; rc = RegOpenKey( NULL, Modified: trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/windo…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/windows/wlregistry.c [iso-8859-1] Thu Jan 14 20:00:18 2016 @@ -196,7 +196,7 @@ LPSTR LangName) { LONG rc = ERROR_SUCCESS; - FRLDRHKEY hKey; + HKEY hKey; WCHAR szIdBuffer[80]; WCHAR NameBuffer[80]; ULONG BufferSize; @@ -446,7 +446,7 @@ IN LPCSTR DirectoryPath) { LONG rc = 0; - FRLDRHKEY hGroupKey, hOrderKey, hServiceKey, hDriverKey; + HKEY hGroupKey, hOrderKey, hServiceKey, hDriverKey; LPWSTR GroupNameBuffer; WCHAR ServiceName[256]; ULONG OrderList[128];
8 years, 11 months
1
0
0
0
[hbelusca] 70593: [CMLIB] - Do not define _NTOSKRNL_ at compilation time, keep only the _NTSYSTEM_ define (and NASSERT). - Remove deprecated unused private flags. - Modify CmCreateRootNode to make ...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Thu Jan 14 18:03:35 2016 New Revision: 70593 URL:
http://svn.reactos.org/svn/reactos?rev=70593&view=rev
Log: [CMLIB] - Do not define _NTOSKRNL_ at compilation time, keep only the _NTSYSTEM_ define (and NASSERT). - Remove deprecated unused private flags. - Modify CmCreateRootNode to make it look more similar to the CmpCreateRootNode function of ntoskrnl/config/cmsysini.c, to ease future code adaptation in cmlib & mkhive and then deprecate CmCreateRootNode in favour of CmpCreateRootNode. Modified: trunk/reactos/lib/cmlib/CMakeLists.txt trunk/reactos/lib/cmlib/cmdata.h trunk/reactos/lib/cmlib/cminit.c Modified: trunk/reactos/lib/cmlib/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/CMakeLists.txt?r…
============================================================================== --- trunk/reactos/lib/cmlib/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/lib/cmlib/CMakeLists.txt [iso-8859-1] Thu Jan 14 18:03:35 2016 @@ -1,6 +1,5 @@ add_definitions( - -D_NTOSKRNL_ -D_NTSYSTEM_ -DNASSERT) Modified: trunk/reactos/lib/cmlib/cmdata.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cmdata.h?rev=705…
============================================================================== --- trunk/reactos/lib/cmlib/cmdata.h [iso-8859-1] (original) +++ trunk/reactos/lib/cmlib/cmdata.h [iso-8859-1] Thu Jan 14 18:03:35 2016 @@ -6,13 +6,6 @@ */ #pragma once - -#define REG_INIT_BLOCK_LIST_SIZE 32 -#define REG_INIT_HASH_TABLE_SIZE 3 -#define REG_EXTEND_HASH_TABLE_SIZE 4 -#define REG_VALUE_LIST_CELL_MULTIPLE 4 -#define REG_DATA_SIZE_MASK 0x7FFFFFFF -#define REG_DATA_IN_OFFSET 0x80000000 // // Key Types Modified: trunk/reactos/lib/cmlib/cminit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/cminit.c?rev=705…
============================================================================== --- trunk/reactos/lib/cmlib/cminit.c [iso-8859-1] (original) +++ trunk/reactos/lib/cmlib/cminit.c [iso-8859-1] Thu Jan 14 18:03:35 2016 @@ -11,19 +11,22 @@ ULONG CmlibTraceLevel = 0; +// FIXME: This function must be replaced by CmpCreateRootNode from ntoskrnl/config/cmsysini.c +// (and CmpCreateRootNode be moved there). BOOLEAN CMAPI CmCreateRootNode( PHHIVE Hive, PCWSTR Name) { + UNICODE_STRING KeyName; PCM_KEY_NODE KeyCell; HCELL_INDEX RootCellIndex; - ULONG NameSize; - /* Allocate the cell */ - NameSize = (ULONG)strlenW(Name) * sizeof(WCHAR); + /* Initialize the node name and allocate it */ + RtlInitUnicodeString(&KeyName, Name); RootCellIndex = HvAllocateCell(Hive, - FIELD_OFFSET(CM_KEY_NODE, Name) + NameSize, + FIELD_OFFSET(CM_KEY_NODE, Name) + + CmpNameSize(Hive, &KeyName), Stable, HCELL_NIL); if (RootCellIndex == HCELL_NIL) return FALSE; @@ -37,9 +40,10 @@ if (!KeyCell) return FALSE; /* Setup the cell */ - KeyCell->Signature = (USHORT)CM_KEY_NODE_SIGNATURE; + KeyCell->Signature = CM_KEY_NODE_SIGNATURE; KeyCell->Flags = KEY_HIVE_ENTRY | KEY_NO_DELETE; - KeyCell->LastWriteTime.QuadPart = 0; + // KeQuerySystemTime(&KeyCell->LastWriteTime); + KeyCell->LastWriteTime.QuadPart = 0ULL; KeyCell->Parent = HCELL_NIL; KeyCell->SubKeyCounts[Stable] = 0; KeyCell->SubKeyCounts[Volatile] = 0; @@ -54,10 +58,8 @@ KeyCell->MaxClassLen = 0; KeyCell->MaxValueNameLen = 0; KeyCell->MaxValueDataLen = 0; - - /* Write the name */ - KeyCell->NameLength = (USHORT)NameSize; - RtlCopyMemory(KeyCell->Name, Name, NameSize); + KeyCell->NameLength = CmpCopyName(Hive, KeyCell->Name, &KeyName); + if (KeyCell->NameLength < KeyName.Length) KeyCell->Flags |= KEY_COMP_NAME; /* Return success */ HvReleaseCell(Hive, RootCellIndex);
8 years, 11 months
1
0
0
0
[akhaldi] 70592: [0.4.0] * Merge desk.cpl fixes by Mark Jansen in r70577. CORE-10786
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jan 13 18:07:32 2016 New Revision: 70592 URL:
http://svn.reactos.org/svn/reactos?rev=70592&view=rev
Log: [0.4.0] * Merge desk.cpl fixes by Mark Jansen in r70577. CORE-10786 Modified: branches/ros-branch-0_4_0/ (props changed) branches/ros-branch-0_4_0/reactos/ (props changed) branches/ros-branch-0_4_0/reactos/dll/cpl/desk/monslctl.c branches/ros-branch-0_4_0/reactos/dll/cpl/desk/settings.c Propchange: branches/ros-branch-0_4_0/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Jan 13 18:07:32 2016 @@ -1 +1 @@ -/trunk:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70480,70497,70499-70501,70507-70510,70512-70513,70523,70527-70530,70536-70537,70545-70548,70552-70554,70557-70558,70576,70578,70583 +/trunk:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70480,70497,70499-70501,70507-70510,70512-70513,70523,70527-70530,70536-70537,70545-70548,70552-70554,70557-70558,70576-70578,70583 Propchange: branches/ros-branch-0_4_0/reactos/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Jan 13 18:07:32 2016 @@ -20,4 +20,4 @@ /branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 /branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567 /branches/wlan-bringup:54809-54998 -/trunk/reactos:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70480,70497,70501,70507-70510,70523,70527-70530,70536-70537,70545-70548,70552-70554,70557-70558,70576,70578,70583 +/trunk/reactos:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70480,70497,70501,70507-70510,70523,70527-70530,70536-70537,70545-70548,70552-70554,70557-70558,70576-70578,70583 Modified: branches/ros-branch-0_4_0/reactos/dll/cpl/desk/monslctl.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/reactos/dll/cp…
============================================================================== --- branches/ros-branch-0_4_0/reactos/dll/cpl/desk/monslctl.c [iso-8859-1] (original) +++ branches/ros-branch-0_4_0/reactos/dll/cpl/desk/monslctl.c [iso-8859-1] Wed Jan 13 18:07:32 2016 @@ -39,6 +39,7 @@ PMONSL_MON Monitors; RECT rcExtent; RECT rcMonitors; + RECT rcOldMonitors; POINT ScrollPos; SIZE Margin; SIZE SelectionFrame; @@ -261,6 +262,14 @@ InvalidateRect(infoPtr->hSelf, &rc, TRUE); + + if (!EqualRect(&infoPtr->rcMonitors, &infoPtr->rcOldMonitors) && + infoPtr->rcOldMonitors.right != infoPtr->rcOldMonitors.left) + { + MonSelRectToScreen(infoPtr, &infoPtr->rcOldMonitors, &rc); + InvalidateRect(infoPtr->hSelf, &rc, TRUE); + infoPtr->rcOldMonitors = infoPtr->rcMonitors; + } } static VOID @@ -355,6 +364,7 @@ ScaleRectSizeFit(&rcExtSurface, &rcExtDisplay); + infoPtr->rcOldMonitors = infoPtr->rcMonitors; infoPtr->rcMonitors = rcExtDisplay; /* Now that we know in which area all monitors are located, Modified: branches/ros-branch-0_4_0/reactos/dll/cpl/desk/settings.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/reactos/dll/cp…
============================================================================== --- branches/ros-branch-0_4_0/reactos/dll/cpl/desk/settings.c [iso-8859-1] (original) +++ branches/ros-branch-0_4_0/reactos/dll/cpl/desk/settings.c [iso-8859-1] Wed Jan 13 18:07:32 2016 @@ -26,6 +26,8 @@ TCHAR Buffer[64]; TCHAR Pixel[64]; DWORD index; + HWND hwndMonSel; + MONSL_MONINFO info; LoadString(hApplet, IDS_PIXEL, Pixel, sizeof(Pixel) / sizeof(TCHAR)); _stprintf(Buffer, Pixel, pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth, pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight, Pixel); @@ -43,6 +45,15 @@ } if (LoadString(hApplet, (2900 + pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel), Buffer, sizeof(Buffer) / sizeof(TCHAR))) SendDlgItemMessage(hwndDlg, IDC_SETTINGS_BPP, CB_SELECTSTRING, (WPARAM)-1, (LPARAM)Buffer); + + hwndMonSel = GetDlgItem(hwndDlg, IDC_SETTINGS_MONSEL); + index = (INT)SendMessage(hwndMonSel, MSLM_GETCURSEL, 0, 0); + if (index != (DWORD)-1 && SendMessage(hwndMonSel, MSLM_GETMONITORINFO, index, (LPARAM)&info)) + { + info.Size.cx = pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth; + info.Size.cy = pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight; + SendMessage(hwndMonSel, MSLM_SETMONITORINFO, index, (LPARAM)&info); + } } static PSETTINGS_ENTRY @@ -165,8 +176,8 @@ for (Current = newEntry->Settings; Current != NULL; Current = Current->Flink) { if (Current->Flink != NULL && - ((Current->dmPelsWidth != Current->Flink->dmPelsWidth) && - (Current->dmPelsHeight != Current->Flink->dmPelsHeight))) + ((Current->dmPelsWidth != Current->Flink->dmPelsWidth) || + (Current->dmPelsHeight != Current->Flink->dmPelsHeight))) { ResolutionsCount++; } @@ -182,8 +193,8 @@ { if (Current->Flink == NULL || (Current->Flink != NULL && - ((Current->dmPelsWidth != Current->Flink->dmPelsWidth) && - (Current->dmPelsHeight != Current->Flink->dmPelsHeight)))) + ((Current->dmPelsWidth != Current->Flink->dmPelsWidth) || + (Current->dmPelsHeight != Current->Flink->dmPelsHeight)))) { newEntry->Resolutions[i].dmPelsWidth = Current->dmPelsWidth; newEntry->Resolutions[i].dmPelsHeight = Current->dmPelsHeight;
8 years, 11 months
1
0
0
0
[akhaldi] 70591: [ROSVBOXMGMT] Enable auto starting rosvboxmgmt so that VBox shared folders are assigned drive letters. CORE-10032 ROSAPPS-303
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jan 13 16:24:59 2016 New Revision: 70591 URL:
http://svn.reactos.org/svn/reactos?rev=70591&view=rev
Log: [ROSVBOXMGMT] Enable auto starting rosvboxmgmt so that VBox shared folders are assigned drive letters. CORE-10032 ROSAPPS-303 Modified: branches/ros-branch-0_4_0/reactos/boot/bootdata/hivesft.inf Modified: branches/ros-branch-0_4_0/reactos/boot/bootdata/hivesft.inf URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/reactos/boot/b…
============================================================================== --- branches/ros-branch-0_4_0/reactos/boot/bootdata/hivesft.inf [iso-8859-1] (original) +++ branches/ros-branch-0_4_0/reactos/boot/bootdata/hivesft.inf [iso-8859-1] Wed Jan 13 16:24:59 2016 @@ -143,7 +143,7 @@ ; HACK - Start rosvboxmgmt - ROSAPPS-303 ;HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Run","Handle VBox SF",0x00000000,"%windir%\bin\rosvboxmgmt autolink" -;HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Run","Handle VBox SF",0x00000000,"%windir%\bin\rosvboxmgmt autoassign" +HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Run","Handle VBox SF",0x00000000,"%windir%\bin\rosvboxmgmt autoassign" HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons",,0x00000012 HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu",,0x00000012
8 years, 11 months
1
0
0
0
[akhaldi] 70590: [0.4.0] * Merge rosvboxmgmt work by Pierre in revisions 70536, 70537 and 70578. This reverts r70520 (shortcuts creation for VBox shared folders). CORE-10032 ROSAPPS-303
by akhaldi@svn.reactos.org
Author: akhaldi Date: Wed Jan 13 16:23:21 2016 New Revision: 70590 URL:
http://svn.reactos.org/svn/reactos?rev=70590&view=rev
Log: [0.4.0] * Merge rosvboxmgmt work by Pierre in revisions 70536, 70537 and 70578. This reverts r70520 (shortcuts creation for VBox shared folders). CORE-10032 ROSAPPS-303 Modified: branches/ros-branch-0_4_0/ (props changed) branches/ros-branch-0_4_0/reactos/ (props changed) branches/ros-branch-0_4_0/reactos/boot/bootdata/hivesft.inf branches/ros-branch-0_4_0/rosapps/applications/cmdutils/rosvboxmgmt/rosvboxmgmt.c Propchange: branches/ros-branch-0_4_0/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Jan 13 16:23:21 2016 @@ -1 +1 @@ -/trunk:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70480,70497,70499-70501,70507-70510,70512-70513,70523,70527-70530,70545-70548,70552-70554,70557-70558,70576,70583 +/trunk:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70480,70497,70499-70501,70507-70510,70512-70513,70523,70527-70530,70536-70537,70545-70548,70552-70554,70557-70558,70576,70578,70583 Propchange: branches/ros-branch-0_4_0/reactos/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Jan 13 16:23:21 2016 @@ -20,4 +20,4 @@ /branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 /branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567 /branches/wlan-bringup:54809-54998 -/trunk/reactos:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70480,70497,70501,70507-70510,70523,70527-70530,70545-70548,70552-70554,70557-70558,70576,70583 +/trunk/reactos:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70433-70437,70443,70445-70449,70454,70464,70468,70470,70480,70497,70501,70507-70510,70523,70527-70530,70536-70537,70545-70548,70552-70554,70557-70558,70576,70578,70583 Modified: branches/ros-branch-0_4_0/reactos/boot/bootdata/hivesft.inf URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/reactos/boot/b…
============================================================================== --- branches/ros-branch-0_4_0/reactos/boot/bootdata/hivesft.inf [iso-8859-1] (original) +++ branches/ros-branch-0_4_0/reactos/boot/bootdata/hivesft.inf [iso-8859-1] Wed Jan 13 16:23:21 2016 @@ -142,7 +142,8 @@ HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce","
InstallRoot.NET
",0x00000000,"cmd /c reg add HKLM\SOFTWARE\Microsoft\.NETFramework /v InstallRoot /t REG_SZ /d %SystemRoot%\Microsoft.NET\Framework\" ; HACK - Start rosvboxmgmt - ROSAPPS-303 -HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Run","Handle VBox SF",0x00000000,"%windir%\bin\rosvboxmgmt auto" +;HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Run","Handle VBox SF",0x00000000,"%windir%\bin\rosvboxmgmt autolink" +;HKLM,"SOFTWARE\Microsoft\Windows\CurrentVersion\Run","Handle VBox SF",0x00000000,"%windir%\bin\rosvboxmgmt autoassign" HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons",,0x00000012 HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu",,0x00000012 Modified: branches/ros-branch-0_4_0/rosapps/applications/cmdutils/rosvboxmgmt/rosvboxmgmt.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/rosapps/applic…
============================================================================== --- branches/ros-branch-0_4_0/rosapps/applications/cmdutils/rosvboxmgmt/rosvboxmgmt.c [iso-8859-1] (original) +++ branches/ros-branch-0_4_0/rosapps/applications/cmdutils/rosvboxmgmt/rosvboxmgmt.c [iso-8859-1] Wed Jan 13 16:23:21 2016 @@ -177,7 +177,7 @@ return 0; } -BOOL CreateUNCShortcut(PCWSTR share) +BOOL createUNCShortcut(PCWSTR share) { HRESULT res; IShellLink *link; @@ -219,12 +219,68 @@ return SUCCEEDED(res); } -int autoStart(void) +BOOL assignDriveLetter(PCWSTR share) +{ + DWORD driveMap; + char drive; + wchar_t cmdLine[MAX_PATH]; + STARTUPINFOW startupInfo; + PROCESS_INFORMATION processInformation; + BOOL ok = FALSE; + + driveMap = GetLogicalDrives(); + + for (drive = _MRX_MAX_DRIVE_LETTERS - 1; drive >= 0; ++drive) + { + if (!(driveMap & (1 << drive))) + { + break; + } + } + + if (drive < 0) + { + wprintf(L"Failed finding an appropriate drive for shared folder\n"); + return 1; + } + + drive += 'A'; + + wsprintf(cmdLine, L"hackssign_client.exe assign %c %s", drive, share); + RtlZeroMemory(&startupInfo, sizeof(startupInfo)); + startupInfo.cb = sizeof(STARTUPINFOW); + + if (!CreateProcessW(NULL, + (PVOID)cmdLine, + NULL, + NULL, + FALSE, + 0, + NULL, + NULL, + &startupInfo, + &processInformation)) + { + wprintf(L"Failed starting hackssign_client.exe\n"); + return 1; + } + + ok = (WaitForSingleObject(processInformation.hProcess, -1) == WAIT_OBJECT_0); + CloseHandle(processInformation.hProcess); + CloseHandle(processInformation.hThread); + + wprintf(L"%c assigned to %s\n", drive, share); + + return ok; +} + +int autoStart(BOOL assign) { short i; BOOL ret; DWORD outputBufferSize; char outputBuffer[_MRX_MAX_DRIVE_LETTERS]; + OFSTRUCT ofs; if (startVBoxSrv() != 0) { @@ -239,7 +295,28 @@ return 1; } - CoInitialize(NULL); + if (assign) + { + wchar_t path[MAX_PATH]; + if (GetModuleFileName(NULL, path, ARRAYSIZE(path)) != 0) + { + *(wcsrchr(path, '\\')) = 0; + wprintf(L"Switching to %s\n", path); + SetCurrentDirectory(path); + } + + if (OpenFile("hackssign_client.exe", &ofs, OF_EXIST) != 1) + { + wprintf(L"hackssign_client.exe not found, falling back to links\n"); + assign = FALSE; + } + } + + if (!assign) + { + CoInitialize(NULL); + } + for (i = 0; i < _MRX_MAX_DRIVE_LETTERS; ++i) { CHAR id = outputBuffer[i]; @@ -255,7 +332,14 @@ continue; } - CreateUNCShortcut(name); + if (!assign) + { + createUNCShortcut(name); + } + else + { + assignDriveLetter(name); + } } return 0; @@ -268,7 +352,8 @@ wprintf(L"\taddconn <letter> <share name>: add a connection\n"); wprintf(L"\tgetlist: list connections\n"); wprintf(L"\tgetgloballist: list available shares\n"); - wprintf(L"\tauto: automagically configure the VBox Shared folders and creates desktop folders\n"); + wprintf(L"\tautolink: automagically configure the VBox Shared folders and creates desktop folders\n"); + wprintf(L"\tautoassign: automagically configure the VBox Shared folders and assigns drive letters\n"); } int wmain(int argc, wchar_t *argv[]) @@ -305,9 +390,13 @@ { return getGlobalList(); } - else if (_wcsicmp(cmd, L"auto") == 0) - { - return autoStart(); + else if (_wcsicmp(cmd, L"autolink") == 0) + { + return autoStart(FALSE); + } + else if (_wcsicmp(cmd, L"autoassign") == 0) + { + return autoStart(TRUE); } else {
8 years, 11 months
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
20
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Results per page:
10
25
50
100
200