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
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
June 2009
----- 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
21 participants
496 discussions
Start a n
N
ew thread
[hyperion] 41374: modified ReactOS-generic.rbuild modified ReactOS-i386.rbuild modified tools/rbuild/backend/mingw/mingw.cpp Don't feed GCC options in MSC Minor detection fixes Support for the Microsoft compiler is now fully functional: now get off your grotesquely fat asses and start fixing code so that it compiles with it TODO: make it fully functional for real (PCH, full dependencies); Microsoft linker support
by hyperion@svn.reactos.org
Author: hyperion Date: Wed Jun 10 23:12:18 2009 New Revision: 41374 URL:
http://svn.reactos.org/svn/reactos?rev=41374&view=rev
Log: modified ReactOS-generic.rbuild modified ReactOS-i386.rbuild modified tools/rbuild/backend/mingw/mingw.cpp Don't feed GCC options in MSC Minor detection fixes Support for the Microsoft compiler is now fully functional: now get off your grotesquely fat asses and start fixing code so that it compiles with it TODO: make it fully functional for real (PCH, full dependencies); Microsoft linker support Modified: trunk/reactos/ReactOS-generic.rbuild trunk/reactos/ReactOS-i386.rbuild trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp Modified: trunk/reactos/ReactOS-generic.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ReactOS-generic.rbuild?rev…
============================================================================== --- trunk/reactos/ReactOS-generic.rbuild [iso-8859-1] (original) +++ trunk/reactos/ReactOS-generic.rbuild [iso-8859-1] Wed Jun 10 23:12:18 2009 @@ -121,5 +121,5 @@ <xi:include href="tools/tools.rbuild" /> </directory> - <compilerflag compiler="cxx">-Wno-non-virtual-dtor</compilerflag> + <compilerflag compiler="cxx" compilerset="gcc">-Wno-non-virtual-dtor</compilerflag> </group> Modified: trunk/reactos/ReactOS-i386.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ReactOS-i386.rbuild?rev=41…
============================================================================== --- trunk/reactos/ReactOS-i386.rbuild [iso-8859-1] (original) +++ trunk/reactos/ReactOS-i386.rbuild [iso-8859-1] Wed Jun 10 23:12:18 2009 @@ -19,30 +19,64 @@ <property name="NTOSKRNL_SHARED" value="-file-alignment=0x1000 -section-alignment=0x1000 -shared"/> <property name="PLATFORM" value="PC"/> - <if property="OPTIMIZE" value="1"> - <compilerflag>-Os</compilerflag> - <compilerflag>-ftracer</compilerflag> - <compilerflag>-momit-leaf-frame-pointer</compilerflag> - </if> - <if property="OPTIMIZE" value="2"> - <compilerflag>-Os</compilerflag> - </if> - <if property="OPTIMIZE" value="3"> - <compilerflag>-O1</compilerflag> - </if> - <if property="OPTIMIZE" value="4"> - <compilerflag>-O2</compilerflag> - </if> - <if property="OPTIMIZE" value="5"> - <compilerflag>-O3</compilerflag> - </if> + <group compilerset="gcc"> + <if property="OPTIMIZE" value="1"> + <compilerflag>-Os</compilerflag> + <compilerflag>-ftracer</compilerflag> + <compilerflag>-momit-leaf-frame-pointer</compilerflag> + </if> + <if property="OPTIMIZE" value="2"> + <compilerflag>-Os</compilerflag> + </if> + <if property="OPTIMIZE" value="3"> + <compilerflag>-O1</compilerflag> + </if> + <if property="OPTIMIZE" value="4"> + <compilerflag>-O2</compilerflag> + </if> + <if property="OPTIMIZE" value="5"> + <compilerflag>-O3</compilerflag> + </if> - <compilerflag>-mpreferred-stack-boundary=2</compilerflag> - <compilerflag>-fno-strict-aliasing</compilerflag> - <compilerflag>-Wno-strict-aliasing</compilerflag> - <compilerflag>-Wpointer-arith</compilerflag> - <compilerflag>-Wno-multichar</compilerflag> - <!-- compilerflag>-H</compilerflag> enable this for header traces --> - <linkerflag>-disable-stdcall-fixup</linkerflag> + <compilerflag>-mpreferred-stack-boundary=2</compilerflag> + <compilerflag>-fno-strict-aliasing</compilerflag> + <compilerflag>-Wno-strict-aliasing</compilerflag> + <compilerflag>-Wpointer-arith</compilerflag> + <compilerflag>-Wno-multichar</compilerflag> + <!-- compilerflag>-H</compilerflag> enable this for header traces --> + </group> + + <group compilerset="msc"> + <if property="OPTIMIZE" value="1"> + <compilerflag>/O1</compilerflag> + </if> + <if property="OPTIMIZE" value="2"> + <compilerflag>/O2</compilerflag> + </if> + <if property="OPTIMIZE" value="3"> + <compilerflag>/Ox /GS-</compilerflag> + <compilerflag>/Ot</compilerflag> + </if> + <if property="OPTIMIZE" value="4"> + <compilerflag>/Ox /GS-</compilerflag> + <compilerflag>/Os</compilerflag> + </if> + <if property="OPTIMIZE" value="5"> + <compilerflag>/Ox /GS-</compilerflag> + <compilerflag>/Os</compilerflag> + <compilerflag>/Ob2</compilerflag> + <compilerflag>/GF</compilerflag> + <compilerflag>/Gy</compilerflag> + </if> + + <compilerflag>/GS-</compilerflag> + <compilerflag>/Zl</compilerflag> + <compilerflag>/Zi</compilerflag> + <compilerflag>/Wall</compilerflag> + </group> + + <group linkerset="ld"> + <linkerflag>-disable-stdcall-fixup</linkerflag> + </group> </project> Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] Wed Jun 10 23:12:18 2009 @@ -453,38 +453,41 @@ GenerateGlobalProperties ( "=", ProjectNode.non_if_data ); - fprintf ( fMakefile, "PROJECT_CFLAGS += -Wall\n" ); - fprintf ( fMakefile, "PROJECT_CXXFLAGS += -Wall\n" ); - fprintf ( fMakefile, "ifneq ($(OARCH),)\n" ); - fprintf ( fMakefile, "PROJECT_CFLAGS += -march=$(OARCH)\n" ); - fprintf ( fMakefile, "PROJECT_CXXFLAGS += -march=$(OARCH)\n" ); - fprintf ( fMakefile, "endif\n" ); - fprintf ( fMakefile, "ifneq ($(TUNE),)\n" ); - fprintf ( fMakefile, "PROJECT_CFLAGS += -mtune=$(TUNE)\n" ); - fprintf ( fMakefile, "PROJECT_CXXFLAGS += -mtune=$(TUNE)\n" ); - fprintf ( fMakefile, "endif\n" ); - - fprintf ( fMakefile, "PROJECT_CFLAGS += -g%s\n", Environment::GetArch() == "amd64" ? "dwarf-2" : "stabs+" ); - fprintf ( fMakefile, "PROJECT_CXXFLAGS += -g%s\n", Environment::GetArch() == "amd64" ? "dwarf-2" : "stabs+" ); - fprintf ( fMakefile, "PROJECT_ASFLAGS += -g%s\n", Environment::GetArch() == "amd64" ? "dwarf-2" : "stabs+" ); + if ( ProjectNode.configuration.Compiler == GnuGcc ) + { + fprintf ( fMakefile, "PROJECT_CFLAGS += -Wall\n" ); + fprintf ( fMakefile, "PROJECT_CXXFLAGS += -Wall\n" ); + fprintf ( fMakefile, "ifneq ($(OARCH),)\n" ); + fprintf ( fMakefile, "PROJECT_CFLAGS += -march=$(OARCH)\n" ); + fprintf ( fMakefile, "PROJECT_CXXFLAGS += -march=$(OARCH)\n" ); + fprintf ( fMakefile, "endif\n" ); + fprintf ( fMakefile, "ifneq ($(TUNE),)\n" ); + fprintf ( fMakefile, "PROJECT_CFLAGS += -mtune=$(TUNE)\n" ); + fprintf ( fMakefile, "PROJECT_CXXFLAGS += -mtune=$(TUNE)\n" ); + fprintf ( fMakefile, "endif\n" ); + + fprintf ( fMakefile, "PROJECT_CFLAGS += -g%s\n", Environment::GetArch() == "amd64" ? "dwarf-2" : "stabs+" ); + fprintf ( fMakefile, "PROJECT_CXXFLAGS += -g%s\n", Environment::GetArch() == "amd64" ? "dwarf-2" : "stabs+" ); + fprintf ( fMakefile, "PROJECT_ASFLAGS += -g%s\n", Environment::GetArch() == "amd64" ? "dwarf-2" : "stabs+" ); + + if ( usePipe ) + { + fprintf ( fMakefile, "PROJECT_CFLAGS += -pipe\n" ); + fprintf ( fMakefile, "PROJECT_CXXFLAGS += -pipe\n" ); + fprintf ( fMakefile, "PROJECT_ASFLAGS += -pipe\n" ); + } + + // Because RosBE gcc is built to suck + fputs ( "BUILTIN_HOST_CINCLUDES+= $(HOST_CFLAGS)\n", fMakefile ); + fputs ( "BUILTIN_HOST_CPPINCLUDES+= $(HOST_CFLAGS)\n", fMakefile ); + fputs ( "BUILTIN_HOST_CXXINCLUDES+= $(HOST_CPPFLAGS)\n", fMakefile ); + + // Would be nice to have our own C++ runtime + fputs ( "BUILTIN_CXXINCLUDES+= $(TARGET_CPPFLAGS)\n", fMakefile ); + } MingwModuleHandler::GenerateParameters ( "PROJECT", "+=", ProjectNode.non_if_data ); MingwModuleHandler::GenerateParameters ( "PROJECT_HOST", "+=", ProjectNode.host_non_if_data ); - - if ( usePipe ) - { - fprintf ( fMakefile, "PROJECT_CFLAGS += -pipe\n" ); - fprintf ( fMakefile, "PROJECT_CXXFLAGS += -pipe\n" ); - fprintf ( fMakefile, "PROJECT_ASFLAGS += -pipe\n" ); - } - - // Because RosBE gcc is built to suck - fputs ( "BUILTIN_HOST_CINCLUDES+= $(HOST_CFLAGS)\n", fMakefile ); - fputs ( "BUILTIN_HOST_CPPINCLUDES+= $(HOST_CFLAGS)\n", fMakefile ); - fputs ( "BUILTIN_HOST_CXXINCLUDES+= $(HOST_CPPFLAGS)\n", fMakefile ); - - // Would be nice to have our own C++ runtime - fputs ( "BUILTIN_CXXINCLUDES+= $(TARGET_CPPFLAGS)\n", fMakefile ); // TODO: linker flags fprintf ( fMakefile, "PROJECT_LFLAGS := '$(shell ${TARGET_CC} -print-libgcc-file-name)' %s\n", GenerateProjectLFLAGS ().c_str () ); @@ -771,6 +774,7 @@ } else if ( ProjectNode.configuration.Compiler == MicrosoftC ) { + compilerCommand = "cl"; detectedCompiler = DetectMicrosoftCompiler ( compilerVersion, mscPath ); supportedCompiler = true; // TODO } @@ -1015,6 +1019,7 @@ } else if ( ProjectNode.configuration.Linker == MicrosoftLink ) { + compilerCommand = "link"; detectedBinutils = DetectMicrosoftLinker ( binutilsVersion, mslinkPath ); supportedBinutils = true; // TODO } @@ -1094,6 +1099,8 @@ else printf ( "not detected\n" ); } + else + usePipe = false; } void
15 years, 5 months
1
0
0
0
[dchapyshev] 41373: - Fix Firefox 1.0/1.5 minimisation to taskbar Patch by Mikhail Denisenko (denisenkom@gmail.com) See issue #2451 for more details.
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Jun 10 22:44:31 2009 New Revision: 41373 URL:
http://svn.reactos.org/svn/reactos?rev=41373&view=rev
Log: - Fix Firefox 1.0/1.5 minimisation to taskbar Patch by Mikhail Denisenko (denisenkom(a)gmail.com) See issue #2451 for more details. Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Wed Jun 10 22:44:31 2009 @@ -3997,14 +3997,15 @@ { Safepl.showCmd = SW_HIDE; } - else if (0 != (Window->Flags & WINDOWOBJECT_RESTOREMAX) || - 0 != (Wnd->Style & WS_MAXIMIZE)) - { - Safepl.showCmd = SW_MAXIMIZE; + else if ((0 != (Window->Flags & WINDOWOBJECT_RESTOREMAX) || + 0 != (Wnd->Style & WS_MAXIMIZE)) && + 0 == (Wnd->Style & WS_MINIMIZE)) + { + Safepl.showCmd = SW_SHOWMAXIMIZED; } else if (0 != (Wnd->Style & WS_MINIMIZE)) { - Safepl.showCmd = SW_MINIMIZE; + Safepl.showCmd = SW_SHOWMINIMIZED; } else if (0 != (Wnd->Style & WS_VISIBLE)) {
15 years, 5 months
1
0
0
0
[hyperion] 41372: Fix the cheerleader, fix the build
by hyperion@svn.reactos.org
Author: hyperion Date: Wed Jun 10 22:41:50 2009 New Revision: 41372 URL:
http://svn.reactos.org/svn/reactos?rev=41372&view=rev
Log: Fix the cheerleader, fix the build Modified: trunk/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak trunk/reactos/tools/rbuild/backend/mingw/compilers/msc.mak Modified: trunk/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak [iso-8859-1] Wed Jun 10 22:41:50 2009 @@ -15,7 +15,7 @@ #(module, source, dependencies, cflags, output) define RBUILD_DEPENDS -$(5): $(2) $(3) | ${call RBUILD_dir,$(2)} +$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} $$(ECHO_DEPENDS) $${gcc} -xc -MF $$@ $(4) -M -MP -MT $$@ $$< @@ -24,7 +24,7 @@ #(module, source, dependencies, cflags, output) define RBUILD_CXX_DEPENDS -$(5): $(2) $(3) | ${call RBUILD_dir,$(2)} +$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} $$(ECHO_DEPENDS) $${gpp} -MF $$@ $(4) -M -MP -MT $$@ $$< @@ -33,7 +33,7 @@ #(module, source, dependencies, cflags, output) define RBUILD_CPP -$(5): $(2) $(3) | ${call RBUILD_dir,$(2)} +$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} $$(ECHO_CPP) $${gcc} -xc -E $(4) $$< > $$@ @@ -42,7 +42,7 @@ #(module, source, dependencies, cflags, output) define RBUILD_CXX_CPP -$(5): $(2) $(3) | ${call RBUILD_dir,$(2)} +$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} $$(ECHO_CPP) $${gpp} -E $(4) $$< > $$@ Modified: trunk/reactos/tools/rbuild/backend/mingw/compilers/msc.mak URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/compilers/msc.mak [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/compilers/msc.mak [iso-8859-1] Wed Jun 10 22:41:50 2009 @@ -26,7 +26,7 @@ #(module, source, dependencies, cflags, output) define RBUILD_CL_CPP -$(5): $(2) $(3) $$(RBUILD_HELPER_TARGET) | ${call RBUILD_dir,$(2)} +$(5): $(2) $(3) $$(RBUILD_HELPER_TARGET) | ${call RBUILD_dir,$(5)} $$(ECHO_CPP) $${cl} /E $(4) $$< > $$@
15 years, 5 months
1
0
0
0
[janderwald] 41371: - Check in wdmaud if a pin with the specified filter id and pin id has been opened - Partly rewrite SysAudio as it is no longer required to store client specific information per connection since wdmaud just opens one connection - Verify all audio handles at incoming irp
by janderwald@svn.reactos.org
Author: janderwald Date: Wed Jun 10 22:28:15 2009 New Revision: 41371 URL:
http://svn.reactos.org/svn/reactos?rev=41371&view=rev
Log: - Check in wdmaud if a pin with the specified filter id and pin id has been opened - Partly rewrite SysAudio as it is no longer required to store client specific information per connection since wdmaud just opens one connection - Verify all audio handles at incoming irp Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h trunk/reactos/drivers/wdm/audio/sysaudio/control.c trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c trunk/reactos/drivers/wdm/audio/sysaudio/pin.c trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/w…
============================================================================== --- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c [iso-8859-1] Wed Jun 10 22:28:15 2009 @@ -165,6 +165,17 @@ return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); } + /* close pin handle which uses same virtual audio device id and pin id */ + for(Index = 0; Index < ClientInfo->NumPins; Index++) + { + if (ClientInfo->hPins[Index].FilterId == FilterId && ClientInfo->hPins[Index].PinId == PinId && ClientInfo->hPins[Index].Handle) + { + ZwClose(ClientInfo->hPins[Index].Handle); + ClientInfo->hPins[Index].Handle = NULL; + } + } + + Length = sizeof(KSDATAFORMAT_WAVEFORMATEX) + sizeof(KSPIN_CONNECT) + sizeof(SYSAUDIO_INSTANCE_INFO); InstanceInfo = ExAllocatePool(NonPagedPool, Length); if (!InstanceInfo) @@ -272,6 +283,8 @@ ClientInfo->hPins = Handels; ClientInfo->hPins[ClientInfo->NumPins].Handle = PinHandle; ClientInfo->hPins[ClientInfo->NumPins].Type = DeviceInfo->DeviceType; + ClientInfo->hPins[ClientInfo->NumPins].FilterId = FilterId; + ClientInfo->hPins[ClientInfo->NumPins].PinId = PinId; ClientInfo->NumPins++; } DeviceInfo->hDevice = PinHandle; Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/w…
============================================================================== --- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.h [iso-8859-1] Wed Jun 10 22:28:15 2009 @@ -16,6 +16,8 @@ { HANDLE Handle; SOUND_DEVICE_TYPE Type; + ULONG FilterId; + ULONG PinId; }WDMAUD_HANDLE, *PWDMAUD_HANDLE; Modified: trunk/reactos/drivers/wdm/audio/sysaudio/control.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/control.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/control.c [iso-8859-1] Wed Jun 10 22:28:15 2009 @@ -169,7 +169,6 @@ IN ULONG DeviceNumber, PSYSAUDIODEVEXT DeviceExtension) { - PSYSAUDIO_CLIENT ClientInfo; PKSAUDIO_SUBDEVICE_ENTRY Entry; PKSOBJECT_CREATE_ITEM CreateItem; @@ -178,19 +177,6 @@ ASSERT(CreateItem); if (DeviceNumber >= DeviceExtension->NumberOfKsAudioDevices) - { - /* invalid device index */ - return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); - } - - /* get client context */ - ClientInfo = (PSYSAUDIO_CLIENT)CreateItem->Context; - - /* sanity check */ - ASSERT(ClientInfo); - - /* check for valid device index */ - if (DeviceNumber >= ClientInfo->NumDevices) { /* invalid device index */ return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); @@ -249,8 +235,7 @@ IN KSPIN_CONNECT *PinConnect, IN PKSDATAFORMAT InputFormat, IN PKSDATAFORMAT OutputFormat, - OUT PHANDLE MixerPinHandle, - OUT PFILE_OBJECT *MixerFileObject) + OUT PHANDLE MixerPinHandle) { NTSTATUS Status; HANDLE PinHandle; @@ -281,8 +266,9 @@ ZwClose(PinHandle); } + ObDereferenceObject(FileObject); + *MixerPinHandle = PinHandle; - *MixerFileObject = FileObject; return Status; } @@ -294,11 +280,8 @@ IN PVOID Context) { NTSTATUS Status; - ULONG NumHandels; HANDLE RealPinHandle = NULL, VirtualPinHandle = NULL, Filter; - PFILE_OBJECT RealFileObject = NULL, VirtualFileObject = NULL; - PSYSAUDIO_CLIENT AudioClient; - PSYSAUDIO_PIN_HANDLE ClientPinHandle; + PFILE_OBJECT VirtualFileObject = NULL; PKSDATAFORMAT_WAVEFORMATEX InputFormat; PKSDATAFORMAT_WAVEFORMATEX OutputFormat = NULL; PKSPIN_CONNECT MixerPinConnect = NULL; @@ -374,28 +357,12 @@ } } - /* get pin file object */ - Status = ObReferenceObjectByHandle(RealPinHandle, - GENERIC_READ | GENERIC_WRITE, - IoFileObjectType, KernelMode, (PVOID*)&RealFileObject, NULL); - - if (!NT_SUCCESS(Status)) - { - DPRINT1("Failed to get file object with %x\n", Status); - goto cleanup; - } - - if (WorkerContext->Entry->Pins[WorkerContext->PinConnect->PinId].MaxPinInstanceCount == 1) - { - /* store the pin handle there if the pin can only be instantiated once*/ - WorkerContext->Entry->Pins[WorkerContext->PinConnect->PinId].PinHandle = RealPinHandle; - } + ASSERT(WorkerContext->Entry->Pins[WorkerContext->PinConnect->PinId].MaxPinInstanceCount); WorkerContext->Entry->Pins[WorkerContext->PinConnect->PinId].References = 0; WorkerContext->DispatchContext->Handle = RealPinHandle; WorkerContext->DispatchContext->PinId = WorkerContext->PinConnect->PinId; WorkerContext->DispatchContext->AudioEntry = WorkerContext->Entry; - WorkerContext->DispatchContext->FileObject = RealFileObject; /* Do we need to transform the audio stream */ if (OutputFormat != NULL) @@ -405,8 +372,7 @@ MixerPinConnect, (PKSDATAFORMAT)InputFormat, (PKSDATAFORMAT)OutputFormat, - &WorkerContext->DispatchContext->hMixerPin, - &WorkerContext->DispatchContext->MixerFileObject); + &WorkerContext->DispatchContext->hMixerPin); if (!NT_SUCCESS(Status)) @@ -438,60 +404,20 @@ goto cleanup; } - ASSERT(WorkerContext->AudioClient); - ASSERT(WorkerContext->AudioClient->NumDevices > 0); - ASSERT(WorkerContext->AudioClient->Devs != NULL); ASSERT(WorkerContext->Entry->Pins != NULL); - - AudioClient = WorkerContext->AudioClient; - NumHandels = AudioClient->Devs[AudioClient->NumDevices -1].ClientHandlesCount; - - ClientPinHandle = ExAllocatePool(NonPagedPool, sizeof(SYSAUDIO_PIN_HANDLE) * (NumHandels+1)); - if (ClientPinHandle) - { - if (NumHandels) - { - ASSERT(AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles != NULL); - RtlMoveMemory(ClientPinHandle, - AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles, - sizeof(SYSAUDIO_PIN_HANDLE) * NumHandels); - ExFreePool(AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles); - } - - AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles = ClientPinHandle; - - /// if the pin can be instantiated more than once - /// then store the real pin handle in the client context - /// otherwise just the pin id of the available pin - if (WorkerContext->Entry->Pins[WorkerContext->PinConnect->PinId].MaxPinInstanceCount > 1) - { - AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].bHandle = TRUE; - AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].hPin = RealPinHandle; - AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].PinId = WorkerContext->PinConnect->PinId; - AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].hMixer = WorkerContext->DispatchContext->hMixerPin; - AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].DispatchContext = WorkerContext->DispatchContext; - } - else - { - AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].bHandle = FALSE; - AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].hPin = VirtualPinHandle; - AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].PinId = WorkerContext->PinConnect->PinId; - AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].hMixer = WorkerContext->DispatchContext->hMixerPin; - AudioClient->Devs[AudioClient->NumDevices -1].ClientHandles[NumHandels].DispatchContext = WorkerContext->DispatchContext; - } - - /// increase reference count - AudioClient->Devs[AudioClient->NumDevices -1].ClientHandlesCount++; - WorkerContext->Entry->Pins[WorkerContext->PinConnect->PinId].References++; - } - else - { - /* no memory */ - goto cleanup; - } + ASSERT(WorkerContext->Entry->NumberOfPins > WorkerContext->PinConnect->PinId); + + /* increment reference count */ + WorkerContext->Entry->Pins[WorkerContext->PinConnect->PinId].References++; + + /* store the pin handle there if the pin can only be instantiated once*/ + WorkerContext->Entry->Pins[WorkerContext->PinConnect->PinId].PinHandle = VirtualPinHandle; /* store pin context */ VirtualFileObject->FsContext2 = (PVOID)WorkerContext->DispatchContext; + + /* release virtual file object */ + ObDereferenceObject(VirtualFileObject); DPRINT("Successfully created virtual pin %p\n", VirtualPinHandle); *((PHANDLE)WorkerContext->Irp->UserBuffer) = VirtualPinHandle; @@ -502,14 +428,8 @@ return; cleanup: - if (RealFileObject) - ObDereferenceObject(RealFileObject); - if (RealPinHandle) ZwClose(RealPinHandle); - - if (WorkerContext->DispatchContext->MixerFileObject) - ObDereferenceObject(WorkerContext->DispatchContext->MixerFileObject); if (WorkerContext->DispatchContext->hMixerPin) ZwClose(WorkerContext->DispatchContext->hMixerPin); @@ -767,51 +687,6 @@ } -VOID -CloseExistingPin( - PSYSAUDIO_CLIENT ClientInfo, - PSYSAUDIO_INSTANCE_INFO InstanceInfo, - PKSPIN_CONNECT PinConnect) -{ - ULONG Index, SubIndex; - PDISPATCH_CONTEXT DispatchContext; - - /* scan the clientinfo if the client has already opened device with the specified pin */ - for (Index = 0; Index < ClientInfo->NumDevices; Index++) - { - if (ClientInfo->Devs[Index].DeviceId == InstanceInfo->DeviceNumber) - { - if (ClientInfo->Devs[Index].ClientHandlesCount) - { - for(SubIndex = 0; SubIndex < ClientInfo->Devs[Index].ClientHandlesCount; SubIndex++) - { - if (ClientInfo->Devs[Index].ClientHandles[SubIndex].PinId == PinConnect->PinId) - { - /* the pin has been already opened by the client, re-use it */ - ASSERT(ClientInfo->Devs[Index].ClientHandles[SubIndex].bHandle == FALSE); - - DispatchContext = ClientInfo->Devs[Index].ClientHandles[SubIndex].DispatchContext; - - if (DispatchContext->MixerFileObject) - ObDereferenceObject(DispatchContext->MixerFileObject); - - if (DispatchContext->hMixerPin) - ZwClose(DispatchContext->hMixerPin); - - if (DispatchContext->FileObject) - ObDereferenceObject(DispatchContext->FileObject); - - if (DispatchContext->Handle) - ZwClose(DispatchContext->Handle); - ClientInfo->Devs[Index].ClientHandles[SubIndex].PinId = (ULONG)-1; - } - } - } - } - } - -} - NTSTATUS HandleSysAudioFilterPinCreation( PIRP Irp, @@ -824,7 +699,6 @@ KSPIN_CONNECT * PinConnect; PIO_STACK_LOCATION IoStack; PSYSAUDIO_INSTANCE_INFO InstanceInfo; - PSYSAUDIO_CLIENT ClientInfo; PKSOBJECT_CREATE_ITEM CreateItem; NTSTATUS Status; KSPIN_CINSTANCES PinInstances; @@ -853,14 +727,6 @@ return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); } - /* get client context */ - ClientInfo = (PSYSAUDIO_CLIENT)CreateItem->Context; - if (!ClientInfo || !ClientInfo->NumDevices || !ClientInfo->Devs) - { - /* we have a problem */ - KeBugCheckEx(0, 0, 0, 0, 0); - } - /* get sysaudio entry */ Entry = GetListEntry(&DeviceExtension->KsAudioDeviceList, InstanceInfo->DeviceNumber); if (!Entry) @@ -884,9 +750,6 @@ return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); } - /* close existing pin first */ - CloseExistingPin(ClientInfo, InstanceInfo, PinConnect); - /* query instance count */ Status = GetPinInstanceCount(Entry, &PinInstances, PinConnect); if (!NT_SUCCESS(Status)) @@ -905,14 +768,11 @@ { /* pin already exists */ ASSERT(Entry->Pins[PinConnect->PinId].PinHandle != NULL); - if (Entry->Pins[PinConnect->PinId].References) - { - /* FIXME need ksmixer */ - DPRINT1("Device %u Pin %u References %u is already occupied, try later\n", InstanceInfo->DeviceNumber, PinConnect->PinId, Entry->Pins[PinConnect->PinId].References); - return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); - } - } - + ASSERT(Entry->Pins[PinConnect->PinId].References); + + DPRINT1("Device %u Pin %u References %u is already occupied, try later\n", InstanceInfo->DeviceNumber, PinConnect->PinId, Entry->Pins[PinConnect->PinId].References); + return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); + } /* create dispatch pin context */ DispatchContext = ExAllocatePool(NonPagedPool, sizeof(DISPATCH_CONTEXT)); if (!DispatchContext) @@ -956,7 +816,6 @@ WorkerContext->Entry = Entry; WorkerContext->Irp = Irp; WorkerContext->PinConnect = PinConnect; - WorkerContext->AudioClient = ClientInfo; WorkerContext->DeviceExtension = DeviceExtension; WorkerContext->WorkItem = WorkItem; Modified: trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/dispatcher.c [iso-8859-1] Wed Jun 10 22:28:15 2009 @@ -73,79 +73,7 @@ PDEVICE_OBJECT DeviceObject, PIRP Irp) { - PSYSAUDIO_CLIENT Client; - PKSAUDIO_SUBDEVICE_ENTRY Entry; - PIO_STACK_LOCATION IoStatus; - ULONG Index, SubIndex; - PSYSAUDIODEVEXT DeviceExtension; - PDISPATCH_CONTEXT DispatchContext; - - - IoStatus = IoGetCurrentIrpStackLocation(Irp); - - Client = (PSYSAUDIO_CLIENT)IoStatus->FileObject->FsContext2; - DeviceExtension = (PSYSAUDIODEVEXT)DeviceObject->DeviceExtension; - - - DPRINT("Client %p NumDevices %u\n", Client, Client->NumDevices); - for(Index = 0; Index < Client->NumDevices; Index++) - { - DPRINT("Index %u Device %u Handels Count %u\n", Index, Client->Devs[Index].DeviceId, Client->Devs[Index].ClientHandlesCount); - if (Client->Devs[Index].ClientHandlesCount) - { - Entry = GetListEntry(&DeviceExtension->KsAudioDeviceList, Client->Devs[Index].DeviceId); - ASSERT(Entry != NULL); - - for(SubIndex = 0; SubIndex < Client->Devs[Index].ClientHandlesCount; SubIndex++) - { - if (Client->Devs[Index].ClientHandles[SubIndex].PinId == (ULONG)-1) - continue; - - if (Client->Devs[Index].ClientHandles[SubIndex].bHandle) - { - DPRINT("Closing handle %p\n", Client->Devs[Index].ClientHandles[SubIndex].hPin); - - ZwClose(Client->Devs[Index].ClientHandles[SubIndex].hPin); - Entry->Pins[Client->Devs[Index].ClientHandles[SubIndex].PinId].References--; - } - else - { - /* this is a pin which can only be instantiated once - * so we just need to release the reference count on that pin - */ - Entry->Pins[Client->Devs[Index].ClientHandles[SubIndex].PinId].References--; - - DispatchContext = (PDISPATCH_CONTEXT)Client->Devs[Index].ClientHandles[SubIndex].DispatchContext; - - if (DispatchContext->MixerFileObject) - ObDereferenceObject(DispatchContext->MixerFileObject); - - if (DispatchContext->hMixerPin) - ZwClose(DispatchContext->hMixerPin); - - if (DispatchContext->FileObject) - ObDereferenceObject(DispatchContext->FileObject); - - ExFreePool(DispatchContext); - - DPRINT("Index %u DeviceIndex %u Pin %u References %u\n", Index, Client->Devs[Index].DeviceId, SubIndex, Entry->Pins[Client->Devs[Index].ClientHandles[SubIndex].PinId].References); - if (!Entry->Pins[Client->Devs[Index].ClientHandles[SubIndex].PinId].References) - { - DPRINT("Closing pin %p\n", Entry->Pins[Client->Devs[Index].ClientHandles[SubIndex].PinId].PinHandle); - - ZwClose(Entry->Pins[Client->Devs[Index].ClientHandles[SubIndex].PinId].PinHandle); - Entry->Pins[Client->Devs[Index].ClientHandles[SubIndex].PinId].PinHandle = NULL; - } - } - } - ExFreePool(Client->Devs[Index].ClientHandles); - } - } - - if (Client->Devs) - ExFreePool(Client->Devs); - - ExFreePool(Client); + DPRINT("Dispatch_fnClose called DeviceObject %p Irp %p\n", DeviceObject); Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; @@ -259,13 +187,10 @@ { NTSTATUS Status; KSOBJECT_HEADER ObjectHeader; - PSYSAUDIO_CLIENT Client; PKSOBJECT_CREATE_ITEM CreateItem; PIO_STACK_LOCATION IoStatus; LPWSTR Buffer; PSYSAUDIODEVEXT DeviceExtension; - ULONG Index; - static LPWSTR KS_NAME_PIN = L"{146F1A80-4791-11D0-A5D6-28DB04C10000}"; IoStatus = IoGetCurrentIrpStackLocation(Irp); @@ -298,58 +223,14 @@ return STATUS_INSUFFICIENT_RESOURCES; } - Client = ExAllocatePool(NonPagedPool, sizeof(SYSAUDIO_CLIENT)); - if (!Client) - { - ExFreePool(CreateItem); - - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_INSUFFICIENT_RESOURCES; - } - /* get device extension */ DeviceExtension = (PSYSAUDIODEVEXT) DeviceObject->DeviceExtension; - Client->NumDevices = DeviceExtension->NumberOfKsAudioDevices; - /* has sysaudio found any devices */ - if (Client->NumDevices) - { - Client->Devs = ExAllocatePool(NonPagedPool, sizeof(SYSAUDIO_CLIENT_HANDELS) * Client->NumDevices); - if (!Client->Devs) - { - ExFreePool(CreateItem); - ExFreePool(Client); - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_INSUFFICIENT_RESOURCES; - } - } - else - { - /* no devices yet available */ - Client->Devs = NULL; - } - - /* Initialize devs array */ - for(Index = 0; Index < Client->NumDevices; Index++) - { - Client->Devs[Index].DeviceId = Index; - Client->Devs[Index].ClientHandles = NULL; - Client->Devs[Index].ClientHandlesCount = 0; - } - /* zero create struct */ RtlZeroMemory(CreateItem, sizeof(KSOBJECT_CREATE_ITEM)); /* store create context */ - CreateItem->Context = (PVOID)Client; RtlInitUnicodeString(&CreateItem->ObjectClass, L"SysAudio"); - - /* store the object in FsContext */ - IoStatus->FileObject->FsContext2 = (PVOID)Client; /* allocate object header */ Status = KsAllocateObjectHeader(&ObjectHeader, 1, CreateItem, Irp, &DispatchTable); Modified: trunk/reactos/drivers/wdm/audio/sysaudio/pin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/pin.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/pin.c [iso-8859-1] Wed Jun 10 22:28:15 2009 @@ -17,6 +17,7 @@ PDISPATCH_CONTEXT Context; NTSTATUS Status; ULONG BytesReturned; + PFILE_OBJECT FileObject; PIO_STACK_LOCATION IoStack; DPRINT("Pin_fnDeviceIoControl called DeviceObject %p Irp %p\n", DeviceObject); @@ -29,15 +30,27 @@ /* Sanity check */ ASSERT(Context); - ASSERT(Context->FileObject != NULL); + + /* acquire real pin file object */ + Status = ObReferenceObjectByHandle(Context->Handle, GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL); + if (!NT_SUCCESS(Status)) + { + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = Status; + /* Complete the irp */ + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } /* Re-dispatch the request to the real target pin */ - Status = KsSynchronousIoControlDevice(Context->FileObject, KernelMode, IoStack->Parameters.DeviceIoControl.IoControlCode, + Status = KsSynchronousIoControlDevice(FileObject, KernelMode, IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.Type3InputBuffer, IoStack->Parameters.DeviceIoControl.InputBufferLength, Irp->UserBuffer, IoStack->Parameters.DeviceIoControl.OutputBufferLength, &BytesReturned); + /* release file object */ + ObDereferenceObject(FileObject); /* Save status and information */ Irp->IoStatus.Information = BytesReturned; @@ -57,6 +70,7 @@ PDISPATCH_CONTEXT Context; PIO_STACK_LOCATION IoStack; ULONG BytesReturned; + PFILE_OBJECT FileObject; NTSTATUS Status; /* Get current stack location */ @@ -67,17 +81,30 @@ /* Sanity check */ ASSERT(Context); - ASSERT(Context->FileObject != NULL); + + /* acquire real pin file object */ + Status = ObReferenceObjectByHandle(Context->Handle, GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL); + if (!NT_SUCCESS(Status)) + { + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = Status; + /* Complete the irp */ + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } /* Re-dispatch the request to the real target pin */ - Status = KsSynchronousIoControlDevice(Context->FileObject, KernelMode, IOCTL_KS_READ_STREAM, + Status = KsSynchronousIoControlDevice(FileObject, KernelMode, IOCTL_KS_READ_STREAM, MmGetMdlVirtualAddress(Irp->MdlAddress), IoStack->Parameters.Read.Length, NULL, 0, &BytesReturned); - if (Context->hMixerPin && Context->MixerFileObject) + /* release file object */ + ObDereferenceObject(FileObject); + + if (Context->hMixerPin) { // FIXME // call kmixer to convert stream @@ -102,6 +129,7 @@ PDISPATCH_CONTEXT Context; PIO_STACK_LOCATION IoStack; ULONG BytesReturned; + PFILE_OBJECT FileObject; NTSTATUS Status; /* Get current stack location */ @@ -112,24 +140,36 @@ /* Sanity check */ ASSERT(Context); - ASSERT(Context->FileObject != NULL); - - if (Context->hMixerPin && Context->MixerFileObject) + + if (Context->hMixerPin) { // FIXME // call kmixer to convert stream UNIMPLEMENTED } + /* acquire real pin file object */ + Status = ObReferenceObjectByHandle(Context->Handle, GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL); + if (!NT_SUCCESS(Status)) + { + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = Status; + /* Complete the irp */ + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } /* Re-dispatch the request to the real target pin */ - Status = KsSynchronousIoControlDevice(Context->FileObject, KernelMode, IOCTL_KS_WRITE_STREAM, + Status = KsSynchronousIoControlDevice(FileObject, KernelMode, IOCTL_KS_WRITE_STREAM, MmGetMdlVirtualAddress(Irp->MdlAddress), IoStack->Parameters.Read.Length, NULL, 0, &BytesReturned); + /* release file object */ + ObDereferenceObject(FileObject); + /* Save status and information */ Irp->IoStatus.Status = Status; Irp->IoStatus.Information = 0; @@ -149,6 +189,7 @@ PIO_STACK_LOCATION IoStack; PDEVICE_OBJECT PinDeviceObject; PIRP PinIrp; + PFILE_OBJECT FileObject; IO_STATUS_BLOCK IoStatus; KEVENT Event; NTSTATUS Status = STATUS_UNSUCCESSFUL; @@ -161,10 +202,24 @@ /* Sanity check */ ASSERT(Context); - ASSERT(Context->FileObject != NULL); + + + /* acquire real pin file object */ + Status = ObReferenceObjectByHandle(Context->Handle, GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL); + if (!NT_SUCCESS(Status)) + { + Irp->IoStatus.Information = 0; + Irp->IoStatus.Status = Status; + /* Complete the irp */ + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return Status; + } /* Get Pin's device object */ - PinDeviceObject = IoGetRelatedDeviceObject(Context->FileObject); + PinDeviceObject = IoGetRelatedDeviceObject(FileObject); + + /* release file object */ + ObDereferenceObject(FileObject); /* Initialize notification event */ KeInitializeEvent(&Event, NotificationEvent, FALSE); @@ -177,7 +232,7 @@ /* Get the next stack location */ IoStack = IoGetNextIrpStackLocation(PinIrp); /* The file object must be present in the irp as it contains the KSOBJECT_HEADER */ - IoStack->FileObject = Context->FileObject; + IoStack->FileObject = FileObject; /* call the driver */ Status = IoCallDriver(PinDeviceObject, PinIrp); @@ -206,7 +261,24 @@ PDEVICE_OBJECT DeviceObject, PIRP Irp) { + PDISPATCH_CONTEXT Context; + PIO_STACK_LOCATION IoStack; + DPRINT("Pin_fnClose called DeviceObject %p Irp %p\n", DeviceObject); + + /* Get current stack location */ + IoStack = IoGetCurrentIrpStackLocation(Irp); + + /* The dispatch context is stored in the FsContext2 member */ + Context = (PDISPATCH_CONTEXT)IoStack->FileObject->FsContext2; + + if (Context->Handle) + { + ZwClose(Context->Handle); + } + ZwClose(Context->hMixerPin); + + ExFreePool(Context); Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; @@ -294,15 +366,22 @@ PDEVICE_OBJECT DeviceObject) { PDISPATCH_CONTEXT Context; + PFILE_OBJECT RealFileObject; NTSTATUS Status; DPRINT("Pin_fnFastWrite called DeviceObject %p Irp %p\n", DeviceObject); Context = (PDISPATCH_CONTEXT)FileObject->FsContext2; - if (Context->hMixerPin && Context->MixerFileObject) - { - Status = KsStreamIo(Context->MixerFileObject, NULL, NULL, NULL, NULL, 0, IoStatus, Buffer, Length, KSSTREAM_WRITE, KernelMode); + if (Context->hMixerPin) + { + Status = ObReferenceObjectByHandle(Context->hMixerPin, GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&RealFileObject, NULL); + if (NT_SUCCESS(Status)) + { + Status = KsStreamIo(RealFileObject, NULL, NULL, NULL, NULL, 0, IoStatus, Buffer, Length, KSSTREAM_WRITE, KernelMode); + ObDereferenceObject(RealFileObject); + } + if (!NT_SUCCESS(Status)) { DPRINT1("Mixing stream failed with %lx\n", Status); @@ -310,7 +389,14 @@ } } - Status = KsStreamIo(Context->FileObject, NULL, NULL, NULL, NULL, 0, IoStatus, Buffer, Length, KSSTREAM_WRITE, KernelMode); + Status = ObReferenceObjectByHandle(Context->Handle, GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&RealFileObject, NULL); + if (!NT_SUCCESS(Status)) + return FALSE; + + Status = KsStreamIo(RealFileObject, NULL, NULL, NULL, NULL, 0, IoStatus, Buffer, Length, KSSTREAM_WRITE, KernelMode); + + ObDereferenceObject(RealFileObject); + if (Status == STATUS_SUCCESS) return TRUE; else Modified: trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
============================================================================== --- trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.h [iso-8859-1] Wed Jun 10 22:28:15 2009 @@ -10,30 +10,6 @@ #define NDEBUG #include <debug.h> #include <stdio.h> - -typedef struct -{ - BOOL bHandle; // indicates if an audio pin can be instantated more than once - ULONG PinId; // specifies the pin id - HANDLE hPin; // handle to audio irp pin - HANDLE hMixer; // handle to mixer pin - PVOID DispatchContext; // pointer to dispatch context -}SYSAUDIO_PIN_HANDLE, *PSYSAUDIO_PIN_HANDLE; - - -typedef struct -{ - ULONG DeviceId; //specifies the device id - ULONG ClientHandlesCount; // number of client handles - PSYSAUDIO_PIN_HANDLE ClientHandles; // array of client handles -}SYSAUDIO_CLIENT_HANDELS, *PSYSAUDIO_CLIENT_HANDELS; - -typedef struct -{ - ULONG NumDevices; // number of devices in Devs array - PSYSAUDIO_CLIENT_HANDELS Devs; // array of client handles - -}SYSAUDIO_CLIENT, *PSYSAUDIO_CLIENT; typedef struct { @@ -94,12 +70,10 @@ typedef struct { HANDLE Handle; // audio irp pin handle - PFILE_OBJECT FileObject; // audio irp pin file object ULONG PinId; // pin id of device PKSAUDIO_SUBDEVICE_ENTRY AudioEntry; // pointer to audio device entry HANDLE hMixerPin; // handle to mixer pin - PFILE_OBJECT MixerFileObject; // mixer file object }DISPATCH_CONTEXT, *PDISPATCH_CONTEXT; // struct PIN_WORKER_CONTEXT @@ -115,7 +89,6 @@ PKSAUDIO_SUBDEVICE_ENTRY Entry; KSPIN_CONNECT * PinConnect; PDISPATCH_CONTEXT DispatchContext; - PSYSAUDIO_CLIENT AudioClient; PSYSAUDIODEVEXT DeviceExtension; PKSDATAFORMAT_WAVEFORMATEX MixerFormat; PIO_WORKITEM WorkItem;
15 years, 5 months
1
0
0
0
[hyperion] 41370: modified tools/rbuild/backend/mingw/compilers/msc.mak Fix definition of cl Fix definition of RBUILD_CXX modified tools/rbuild/backend/mingw/mingw.cpp modified tools/rbuild/backend/mingw/mingw.h modified tools/rbuild/backend/mingw/mstools_detection.cpp Actually set RBUILD_CL_PATH and RBUILD_LINK_PATH
by hyperion@svn.reactos.org
Author: hyperion Date: Wed Jun 10 22:24:33 2009 New Revision: 41370 URL:
http://svn.reactos.org/svn/reactos?rev=41370&view=rev
Log: modified tools/rbuild/backend/mingw/compilers/msc.mak Fix definition of cl Fix definition of RBUILD_CXX modified tools/rbuild/backend/mingw/mingw.cpp modified tools/rbuild/backend/mingw/mingw.h modified tools/rbuild/backend/mingw/mstools_detection.cpp Actually set RBUILD_CL_PATH and RBUILD_LINK_PATH Modified: trunk/reactos/tools/rbuild/backend/mingw/compilers/msc.mak trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp trunk/reactos/tools/rbuild/backend/mingw/mingw.h trunk/reactos/tools/rbuild/backend/mingw/mstools_detection.cpp Modified: trunk/reactos/tools/rbuild/backend/mingw/compilers/msc.mak URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/compilers/msc.mak [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/compilers/msc.mak [iso-8859-1] Wed Jun 10 22:24:33 2009 @@ -15,7 +15,7 @@ BUILTIN_CPPFLAGS+= /X -cl=$$(Q)$$(RBUILD_HELPER_TARGET) "RBUILD_CL_" "$(notdir $<<)" cl /nologo +cl=$(Q)$(RBUILD_HELPER_TARGET) "RBUILD_CL_" "$(notdir $<)" cl /nologo #(module, source, dependencies, cflags, output) #TODO @@ -79,6 +79,8 @@ $$(ECHO_CC) $${cl} /TP /Fo$$@ ${call RBUILD_cxxflags,$(1),$(4)} /c $$< +endif + endef #(module, source, dependencies, cflags) Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] Wed Jun 10 22:24:33 2009 @@ -70,6 +70,9 @@ { HostFalse, "", "", "" }, // MessageHeader }; +static std::string mscPath; +static std::string mslinkPath; + string MingwBackend::GetFullPath ( const FileLocation& file ) const { @@ -426,6 +429,12 @@ fprintf ( fMakefile, "include tools$(SEP)rbuild$(SEP)backend$(SEP)mingw$(SEP)linkers$(SEP)%s.mak\n", ProjectNode.GetLinkerSet ().c_str () ); fprintf ( fMakefile, "include tools$(SEP)rbuild$(SEP)backend$(SEP)mingw$(SEP)compilers$(SEP)%s.mak\n", ProjectNode.GetCompilerSet ().c_str () ); + if ( mscPath.length() ) + fprintf ( fMakefile, "export RBUILD_CL_PATH=%s\n", mscPath.c_str () ); + + if ( mslinkPath.length() ) + fprintf ( fMakefile, "export RBUILD_LINK_PATH=%s\n", mslinkPath.c_str () ); + if ( configuration.Dependencies == FullDependencies ) { fprintf ( fMakefile, @@ -762,7 +771,7 @@ } else if ( ProjectNode.configuration.Compiler == MicrosoftC ) { - detectedCompiler = DetectMicrosoftCompiler ( compilerVersion ); + detectedCompiler = DetectMicrosoftCompiler ( compilerVersion, mscPath ); supportedCompiler = true; // TODO } @@ -1006,7 +1015,7 @@ } else if ( ProjectNode.configuration.Linker == MicrosoftLink ) { - detectedBinutils = DetectMicrosoftLinker ( binutilsVersion ); + detectedBinutils = DetectMicrosoftLinker ( binutilsVersion, mslinkPath ); supportedBinutils = true; // TODO } Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/mingw.h [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/mingw.h [iso-8859-1] Wed Jun 10 22:24:33 2009 @@ -117,8 +117,8 @@ void GenerateDirectoryTargets (); FILE* fMakefile; bool use_pch; - bool DetectMicrosoftCompiler ( std::string& version ); - bool DetectMicrosoftLinker ( std::string& version ); + bool DetectMicrosoftCompiler ( std::string& version, std::string& path ); + bool DetectMicrosoftLinker ( std::string& version, std::string& path ); }; Modified: trunk/reactos/tools/rbuild/backend/mingw/mstools_detection.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/mstools_detection.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/mstools_detection.cpp [iso-8859-1] Wed Jun 10 22:24:33 2009 @@ -2216,7 +2216,7 @@ } bool -MingwBackend::DetectMicrosoftCompiler ( std::string& version ) +MingwBackend::DetectMicrosoftCompiler ( std::string& version, std::string& path ) { bool wantCompiler = ProjectNode.configuration.Compiler == MicrosoftC; bool wantLinker = ProjectNode.configuration.Linker == MicrosoftLink; @@ -2234,13 +2234,14 @@ std::ostringstream compilerVersion; compilerVersion << msCompilerVersion; version = compilerVersion.str(); + path = msCompilerPath; } return ret; } bool -MingwBackend::DetectMicrosoftLinker ( std::string& version ) +MingwBackend::DetectMicrosoftLinker ( std::string& version, std::string& path ) { bool wantCompiler = ProjectNode.configuration.Compiler == MicrosoftC; bool wantLinker = ProjectNode.configuration.Linker == MicrosoftLink; @@ -2258,6 +2259,7 @@ std::ostringstream linkerVersion; linkerVersion << msLinkerVersion; version = linkerVersion.str(); + path = msLinkerPath; } return ret; @@ -2273,13 +2275,13 @@ #include "mingw.h" bool -MingwBackend::DetectMicrosoftCompiler ( std::string& ) +MingwBackend::DetectMicrosoftCompiler ( std::string&, std::string& ) { return false; } bool -MingwBackend::DetectMicrosoftLinker ( std::string& ) +MingwBackend::DetectMicrosoftLinker ( std::string&, std::string& ) { return false; }
15 years, 5 months
1
0
0
0
[dchapyshev] 41369: - Fix typo
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Jun 10 22:09:15 2009 New Revision: 41369 URL:
http://svn.reactos.org/svn/reactos?rev=41369&view=rev
Log: - Fix typo Modified: trunk/reactos/ntoskrnl/ke/procobj.c Modified: trunk/reactos/ntoskrnl/ke/procobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/procobj.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ke/procobj.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/procobj.c [iso-8859-1] Wed Jun 10 22:09:15 2009 @@ -278,7 +278,7 @@ if (Process->BasePriority == Priority) return Process->BasePriority; /* If the caller gave priority 0, normalize to 1 */ - if (!LOW_PRIORITY) Priority = LOW_PRIORITY + 1; + if (!Priority) Priority = LOW_PRIORITY + 1; /* Lock the process */ KiAcquireProcessLock(Process, &ProcessLock);
15 years, 5 months
1
0
0
0
[hyperion] 41368: modified Makefile added tools/rbuild/backend/mingw/compilers added tools/rbuild/backend/mingw/compilers/gcc.mak added tools/rbuild/backend/mingw/compilers/msc.mak added tools/rbuild/backend/mingw/linkers added tools/rbuild/backend/mingw/linkers/ld.mak added tools/rbuild/backend/mingw/linkers/mslink.mak modified tools/rbuild/backend/mingw/mingw.cpp modified tools/rbuild/backend/mingw/modulehandler.cpp modified tools/rbuild/backend/mingw/rules.mak modified tools/rbuild/rbuild.h M
by hyperion@svn.reactos.org
Author: hyperion Date: Wed Jun 10 21:56:12 2009 New Revision: 41368 URL:
http://svn.reactos.org/svn/reactos?rev=41368&view=rev
Log: modified Makefile added tools/rbuild/backend/mingw/compilers added tools/rbuild/backend/mingw/compilers/gcc.mak added tools/rbuild/backend/mingw/compilers/msc.mak added tools/rbuild/backend/mingw/linkers added tools/rbuild/backend/mingw/linkers/ld.mak added tools/rbuild/backend/mingw/linkers/mslink.mak modified tools/rbuild/backend/mingw/mingw.cpp modified tools/rbuild/backend/mingw/modulehandler.cpp modified tools/rbuild/backend/mingw/rules.mak modified tools/rbuild/rbuild.h Moved linker and compiler rules in separate files Renamed compiler rules to more generic names New compiler rules for dependencies and preprocessor modes Rules for Microsoft C/C++ Compiler Linker rule file stubs modified tools/rbuild/module.cpp modified tools/rbuild/project.cpp All elements now support "compilerset" and "linkerset" conditional attributes Added: trunk/reactos/tools/rbuild/backend/mingw/compilers/ (with props) trunk/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak (with props) trunk/reactos/tools/rbuild/backend/mingw/compilers/msc.mak (with props) trunk/reactos/tools/rbuild/backend/mingw/linkers/ (with props) trunk/reactos/tools/rbuild/backend/mingw/linkers/ld.mak (with props) trunk/reactos/tools/rbuild/backend/mingw/linkers/mslink.mak (with props) Modified: trunk/reactos/Makefile trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp trunk/reactos/tools/rbuild/backend/mingw/rules.mak trunk/reactos/tools/rbuild/module.cpp trunk/reactos/tools/rbuild/project.cpp trunk/reactos/tools/rbuild/rbuild.h Modified: trunk/reactos/Makefile URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/Makefile?rev=41368&r1=4136…
============================================================================== --- trunk/reactos/Makefile [iso-8859-1] (original) +++ trunk/reactos/Makefile [iso-8859-1] Wed Jun 10 21:56:12 2009 @@ -328,8 +328,6 @@ dlltool = $(Q)$(PREFIX_)dlltool strip = $(Q)$(PREFIX_)strip windres = $(Q)$(PREFIX_)windres -cl = $(Q)cl -nologo -link = $(Q)link -nologo # Set utilities ifeq ($(OSTYPE),msys) Propchange: trunk/reactos/tools/rbuild/backend/mingw/compilers/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Wed Jun 10 21:56:12 2009 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/tools/rbuild/backend/mingw/compilers/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/tools/rbuild/backend/mingw/compilers/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/tools/rbuild/backend/mingw/compilers/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak (added) +++ trunk/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak [iso-8859-1] Wed Jun 10 21:56:12 2009 @@ -1,0 +1,156 @@ +CFLAG_WERROR:=-Werror +CFLAG_CRTDLL:=-D_DLL -D__USE_CRTIMP + +CXXFLAG_WERROR:=-Werror +CXXFLAG_CRTDLL:=-D_DLL -D__USE_CRTIMP + +CPPFLAG_WERROR:=-Werror +CPPFLAG_UNICODE:=-DUNICODE -D_UNICODE + +# FIXME: disabled until RosBE stops sucking +# BUILTIN_CPPFLAGS+= -nostdinc +BUILTIN_CFLAGS+= -fno-optimize-sibling-calls +BUILTIN_CXXFLAGS+= -fno-optimize-sibling-calls + +#(module, source, dependencies, cflags, output) +define RBUILD_DEPENDS + +$(5): $(2) $(3) | ${call RBUILD_dir,$(2)} + $$(ECHO_DEPENDS) + $${gcc} -xc -MF $$@ $(4) -M -MP -MT $$@ $$< + +endef + +#(module, source, dependencies, cflags, output) +define RBUILD_CXX_DEPENDS + +$(5): $(2) $(3) | ${call RBUILD_dir,$(2)} + $$(ECHO_DEPENDS) + $${gpp} -MF $$@ $(4) -M -MP -MT $$@ $$< + +endef + +#(module, source, dependencies, cflags, output) +define RBUILD_CPP + +$(5): $(2) $(3) | ${call RBUILD_dir,$(2)} + $$(ECHO_CPP) + $${gcc} -xc -E $(4) $$< > $$@ + +endef + +#(module, source, dependencies, cflags, output) +define RBUILD_CXX_CPP + +$(5): $(2) $(3) | ${call RBUILD_dir,$(2)} + $$(ECHO_CPP) + $${gpp} -E $(4) $$< > $$@ + +endef + +#(module, source, dependencies, cflags, output) +define RBUILD_CC + +$(2): $${$(1)_precondition} + +ifeq ($(ROS_BUILDDEPS),full) + +${call RBUILD_DEPENDS,$(1),$(2),,${call RBUILD_cflags,$(1),$(4)},$(5).d} +-include $(5).d + +$(5): $(2) $(5).d $(3) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${gcc} -o $$@ ${call RBUILD_cflags,$(1),$(4)} -c $$< + +else + +$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${gcc} -o $$@ ${call RBUILD_cflags,$(1),$(4)} -c $$< + +endif + +endef + +#(module, source, dependencies, cflags, output) +define RBUILD_CXX + +$(2): $${$(1)_precondition} + +ifeq ($(ROS_BUILDDEPS),full) + +${call RBUILD_CXX_DEPENDS,$(1),$(2),,${call RBUILD_cxxflags,$(1),$(4)},$(5).d} +-include $(5).d + +$(5): $(2) $(5).d $(3) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${gpp} -o $$@ ${call RBUILD_cxxflags,$(1),$(4)} -c $$< + +else + +$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${gpp} -o $$@ ${call RBUILD_cxxflags,$(1),$(4)} -c $$< + +endif + +endef + +#(module, source, dependencies, cflags) +RBUILD_CC_RULE=${call RBUILD_CC,$(1),$(2),$(3),$(4),${call RBUILD_intermediate_path_unique,$(1),$(2)}.o} +RBUILD_CXX_RULE=${call RBUILD_CXX,$(1),$(2),$(3),$(4),${call RBUILD_intermediate_path_unique,$(1),$(2)}.o} + +#(module, source, dependencies, cflags) +define RBUILD_CC_PCH_RULE + +$(2): $${$(1)_precondition} + +ifeq ($$(ROS_BUILDDEPS),full) + +${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d: $(2) | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_DEPENDS) + $${gcc} -MF $$@ ${call RBUILD_cflags,$(1),$(4)} -x c-header -M -MP -MT $$@ $$< + +-include $$(intermediate_dir)$$(SEP).gch_$$(module_name)$$(SEP)$(notdir $(2)).gch.d + +${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1) + $$(ECHO_PCH) + $${gcc} -MF $$@ ${call RBUILD_cflags,$(1),$(4)} -x c-header -M -MP -MT $$@ $$< + +else + +${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1) + $$(ECHO_PCH) + $${gcc} -MF $$@ ${call RBUILD_cflags,$(1),$(4)} -x c-header -M -MP -MT $$@ $$< + +endif + +endef + +#(module, source, dependencies, cflags) +define RBUILD_CXX_PCH_RULE + +$(2): $${$(1)_precondition} + +ifeq ($$(ROS_BUILDDEPS),full) + +${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d: $(2) | ${call RBUILD_intermediate_dir,$(2)} + $$(ECHO_DEPENDS) + $${gpp} -MF $$@ ${call RBUILD_cxxflags,$(1),$(4)} -x c++-header -M -MP -MT $$@ $$< + +-include $$(intermediate_dir)$$(SEP).gch_$$(module_name)$$(SEP)$(notdir $(2)).gch.d + +${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1) + $$(ECHO_PCH) + $${gpp} -MF $$@ ${call RBUILD_cxxflags,$(1),$(4)} -x c++-header -M -MP -MT $$@ $$< + +else + +${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1) + $$(ECHO_PCH) + $${gpp} -MF $$@ ${call RBUILD_cxxflags,$(1),$(4)} -x c++-header -M -MP -MT $$@ $$< + +endif + +endef + Propchange: trunk/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/tools/rbuild/backend/mingw/compilers/msc.mak URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/compilers/msc.mak (added) +++ trunk/reactos/tools/rbuild/backend/mingw/compilers/msc.mak [iso-8859-1] Wed Jun 10 21:56:12 2009 @@ -1,0 +1,94 @@ +CFLAGS+= $(_CL_) +_CL_= + +CINCLUDES:=$(INCLUDE) $(CINCLUDES) +INCLUDE= + +CFLAG_WERROR:=/WX +CFLAG_CRTDLL:=/D_DLL /D__USE_CRTIMP /MD + +CXXFLAG_WERROR:=/WX +CXXFLAG_CRTDLL:=/D_DLL /D__USE_CRTIMP /MD + +CPPFLAG_WERROR:=/WX +CPPFLAG_UNICODE:=/DUNICODE /D_UNICODE + +BUILTIN_CPPFLAGS+= /X + +cl=$$(Q)$$(RBUILD_HELPER_TARGET) "RBUILD_CL_" "$(notdir $<<)" cl /nologo + +#(module, source, dependencies, cflags, output) +#TODO +RBUILD_CL_DEPENDS=$$(error Full dependencies are not implemented for Microsoft C/C++ Compiler yet) +RBUILD_DEPENDS=${call RBUILD_CL_DEPENDS,$(1),$(2),$(3),$(4) /TC,$(5)} +RBUILD_CXX_DEPENDS=${call RBUILD_CL_DEPENDS,$(1),$(2),$(3),$(4) /TP,$(5)} + +#(module, source, dependencies, cflags, output) +define RBUILD_CL_CPP + +$(5): $(2) $(3) $$(RBUILD_HELPER_TARGET) | ${call RBUILD_dir,$(2)} + $$(ECHO_CPP) + $${cl} /E $(4) $$< > $$@ + +endef + +RBUILD_CPP=${call RBUILD_CL_CPP,$(1),$(2),$(3),$(4) /TC,$(5)} +RBUILD_CXX_CPP=${call RBUILD_CL_CPP,$(1),$(2),$(3),$(4) /TPP,$(5)} + +#(module, source, dependencies, cflags, output) +define RBUILD_CC + +$(2): $${$(1)_precondition} + +ifeq ($(ROS_BUILDDEPS),full) + +${call RBUILD_DEPENDS,$(1),$(2),,${call RBUILD_cflags,$(1),$(4)},$(5).d} +-include $(5).d + +$(5): $(2) $(5).d $(3) $$(RBUILD_HELPER_TARGET) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${cl} /TC /Fo$$@ ${call RBUILD_cflags,$(1),$(4)} /c $$< + +else + +$(5): $(2) $(3) $$(RBUILD_HELPER_TARGET) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${cl} /TC /Fo$$@ ${call RBUILD_cflags,$(1),$(4)} /c $$< + +endif + +endef + +#(module, source, dependencies, cflags, output) +define RBUILD_CXX + +$(2): $${$(1)_precondition} + +ifeq ($(ROS_BUILDDEPS),full) + +${call RBUILD_CXX_DEPENDS,$(1),$(2),,${call RBUILD_cflags,$(1),$(4)},$(5).d} +-include $(5).d + +$(5): $(2) $(5).d $(3) $$(RBUILD_HELPER_TARGET) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${cl} /TP /Fo$$@ ${call RBUILD_cxxflags,$(1),$(4)} /c $$< + +else + +$(5): $(2) $(3) $$(RBUILD_HELPER_TARGET) | ${call RBUILD_dir,$(5)} + $$(ECHO_CC) + $${cl} /TP /Fo$$@ ${call RBUILD_cxxflags,$(1),$(4)} /c $$< + +endef + +#(module, source, dependencies, cflags) +RBUILD_CC_RULE=${call RBUILD_CC,$(1),$(2),$(3),$(4),${call RBUILD_intermediate_path_unique,$(1),$(2)}.o} +RBUILD_CXX_RULE=${call RBUILD_CXX,$(1),$(2),$(3),$(4),${call RBUILD_intermediate_path_unique,$(1),$(2)}.o} + +#(module, source, dependencies, cflags) +#TODO +RBUILD_CC_PCH_RULE=$$(error Precompiled headers are not implemented for Microsoft C/C++ Compiler yet) + +#(module, source, dependencies, cflags) +#TODO +RBUILD_CXX_PCH_RULE=$$(error Precompiled headers are not implemented for Microsoft C/C++ Compiler yet) Propchange: trunk/reactos/tools/rbuild/backend/mingw/compilers/msc.mak ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/tools/rbuild/backend/mingw/linkers/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Wed Jun 10 21:56:12 2009 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/tools/rbuild/backend/mingw/linkers/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/tools/rbuild/backend/mingw/linkers/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/tools/rbuild/backend/mingw/linkers/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/tools/rbuild/backend/mingw/linkers/ld.mak URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/linkers/ld.mak (added) +++ trunk/reactos/tools/rbuild/backend/mingw/linkers/ld.mak [iso-8859-1] Wed Jun 10 21:56:12 2009 @@ -1,0 +1,1 @@ +# TODO Propchange: trunk/reactos/tools/rbuild/backend/mingw/linkers/ld.mak ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/tools/rbuild/backend/mingw/linkers/mslink.mak URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/linkers/mslink.mak (added) +++ trunk/reactos/tools/rbuild/backend/mingw/linkers/mslink.mak [iso-8859-1] Wed Jun 10 21:56:12 2009 @@ -1,0 +1,1 @@ +# TODO Propchange: trunk/reactos/tools/rbuild/backend/mingw/linkers/mslink.mak ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] Wed Jun 10 21:56:12 2009 @@ -423,6 +423,8 @@ MingwBackend::GenerateGlobalVariables () const { fputs ( "include tools$(SEP)rbuild$(SEP)backend$(SEP)mingw$(SEP)rules.mak\n", fMakefile ); + fprintf ( fMakefile, "include tools$(SEP)rbuild$(SEP)backend$(SEP)mingw$(SEP)linkers$(SEP)%s.mak\n", ProjectNode.GetLinkerSet ().c_str () ); + fprintf ( fMakefile, "include tools$(SEP)rbuild$(SEP)backend$(SEP)mingw$(SEP)compilers$(SEP)%s.mak\n", ProjectNode.GetCompilerSet ().c_str () ); if ( configuration.Dependencies == FullDependencies ) { Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] Wed Jun 10 21:56:12 2009 @@ -1080,12 +1080,12 @@ Rule gasRule ( "$(eval $(call RBUILD_GAS_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", "$(intermediate_path_unique).o", "$(intermediate_path_unique).o.d", NULL ); -Rule gccRule ( "$(eval $(call RBUILD_GCC_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", +Rule gccRule ( "$(eval $(call RBUILD_CC_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", "$(intermediate_path_unique).o", "$(intermediate_path_unique).o.d", NULL ); Rule gccHostRule ( "$(eval $(call RBUILD_HOST_GCC_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", "$(intermediate_path_unique).o", NULL ); -Rule gppRule ( "$(eval $(call RBUILD_GPP_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", +Rule gppRule ( "$(eval $(call RBUILD_CXX_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", "$(intermediate_path_unique).o", "$(intermediate_path_unique).o.d", NULL ); Rule gppHostRule ( "$(eval $(call RBUILD_HOST_GPP_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", @@ -1116,11 +1116,11 @@ "$(intermediate_path_noext).o", NULL ); Rule widlTlbRule ( "$(eval $(call RBUILD_WIDL_TLB_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", "$(intermediate_dir)$(SEP)", NULL ); -Rule pchRule ( "$(eval $(call RBUILD_GCC_PCH_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", +Rule pchRule ( "$(eval $(call RBUILD_CC_PCH_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch", "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch.d", "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)", NULL ); -Rule pchCxxRule ( "$(eval $(call RBUILD_GPP_PCH_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", +Rule pchCxxRule ( "$(eval $(call RBUILD_CXX_PCH_RULE,$(module_name),$(source),$(dependencies),$(compiler_flags)))\n", "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch", "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)$(source_name).gch.d", "$(intermediate_dir)$(SEP).gch_$(module_name)$(SEP)", NULL ); Modified: trunk/reactos/tools/rbuild/backend/mingw/rules.mak URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/rules.mak [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/rules.mak [iso-8859-1] Wed Jun 10 21:56:12 2009 @@ -96,54 +96,14 @@ RBUILD_host_cflags=${call RBUILD_compiler_flags_with_cpp,$(1),$(2),$(3),C,HOST_} RBUILD_host_cxxflags=${call RBUILD_compiler_flags_with_cpp,$(1),$(2),$(3),CXX,HOST_} -CFLAG_WERROR:=-Werror -CFLAG_CRTDLL:=-D_DLL -D__USE_CRTIMP - -CXXFLAG_WERROR:=-Werror -CXXFLAG_CRTDLL:=-D_DLL -D__USE_CRTIMP - -CPPFLAG_WERROR:=-Werror -CPPFLAG_UNICODE:=-DUNICODE -D_UNICODE - RCFLAG_UNICODE:=-DUNICODE -D_UNICODE BUILTIN_ASDEFINES+= -D__ASM__ -# FIXME: disabled until RosBE stops sucking -# BUILTIN_CPPFLAGS+= -nostdinc -BUILTIN_CFLAGS+= -fno-optimize-sibling-calls -BUILTIN_CXXFLAGS+= -fno-optimize-sibling-calls BUILTIN_RCFLAGS+= --nostdinc BUILTIN_RCDEFINES+= -DRC_INVOKED BUILTIN_NASMFLAGS+= -f win32 #(module, source, dependencies, cflags, output) -define RBUILD_GCC - -$(2): $${$(1)_precondition} - -ifeq ($(ROS_BUILDDEPS),full) - -$(5).d: $(2) | ${call RBUILD_dir,$(5)} - $$(ECHO_DEPENDS) - $${gcc} -MF $$@ ${call RBUILD_cflags,$(1),$(4)} -M -MP -MT $$@ $$< - --include $(5).d - -$(5): $(2) $(5).d $(3) | ${call RBUILD_dir,$(5)} - $$(ECHO_CC) - $${gcc} -o $$@ ${call RBUILD_cflags,$(1),$(4)} -c $$< - -else - -$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} - $$(ECHO_CC) - $${gcc} -o $$@ ${call RBUILD_cflags,$(1),$(4)} -c $$< - -endif - -endef - -#(module, source, dependencies, cflags, output) define RBUILD_GAS $(2): $${$(1)_precondition} @@ -170,118 +130,8 @@ endef -#(module, source, dependencies, cflags, output) -define RBUILD_GPP - -$(2): $${$(1)_precondition} - -ifeq ($(ROS_BUILDDEPS),full) - -$(5).d: $(2) | ${call RBUILD_dir,$(5)} - $$(ECHO_DEPENDS) - $${gpp} -MF $$@ ${call RBUILD_cxxflags,$(1),$(4)} -M -MP -MT $$@ $$< - --include $(5).d - -$(5): $(2) $(5).d $(3) | ${call RBUILD_dir,$(5)} - $$(ECHO_CC) - $${gpp} -o $$@ ${call RBUILD_cxxflags,$(1),$(4)} -c $$< - -else - -$(5): $(2) $(3) | ${call RBUILD_dir,$(5)} - $$(ECHO_CC) - $${gpp} -o $$@ ${call RBUILD_cxxflags,$(1),$(4)} -c $$< - -endif - -endef - -#(module, source, dependencies, cflags) -RBUILD_GCC_RULE=${call RBUILD_GCC,$(1),$(2),$(3),$(4),${call RBUILD_intermediate_path_unique,$(1),$(2)}.o} -RBUILD_GPP_RULE=${call RBUILD_GPP,$(1),$(2),$(3),$(4),${call RBUILD_intermediate_path_unique,$(1),$(2)}.o} +#(module, source, dependencies, cflags) RBUILD_GAS_RULE=${call RBUILD_GAS,$(1),$(2),$(3),$(4),${call RBUILD_intermediate_path_unique,$(1),$(2)}.o} - -#(module, source, dependencies, cflags) -define RBUILD_GPP_RULE - -$(2): $${$(1)_precondition} - -ifeq ($(ROS_BUILDDEPS),full) - -${call RBUILD_intermediate_path_unique,$(1),$(2)}.o.d: $(2) | ${call RBUILD_intermediate_dir,$(2)} - $$(ECHO_DEPENDS) - $${gpp} -MF $$@ ${call RBUILD_cxxflags,$(1),$(4)} -M -MP -MT $$@ $$< - --include ${call RBUILD_intermediate_path_unique,$(1),$(2)}.o.d - -${call RBUILD_intermediate_path_unique,$(1),$(2)}.o: $(2) ${call RBUILD_intermediate_path_unique,$(1),$(2)}.o.d $(3) | ${call RBUILD_intermediate_dir,$(2)} - $$(ECHO_CC) - $${gpp} -o $$@ ${call RBUILD_cxxflags,$(1),$(4)} -c $$< - -else - -${call RBUILD_intermediate_path_unique,$(1),$(2)}.o: $(2) $(3) | ${call RBUILD_intermediate_dir,$(2)} - $$(ECHO_CC) - $${gpp} -o $$@ ${call RBUILD_cxxflags,$(1),$(4)} -c $$< - -endif - -endef - -#(module, source, dependencies, cflags) -define RBUILD_GCC_PCH_RULE - -$(2): $${$(1)_precondition} - -ifeq ($$(ROS_BUILDDEPS),full) - -${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d: $(2) | ${call RBUILD_intermediate_dir,$(2)} - $$(ECHO_DEPENDS) - $${gcc} -MF $$@ ${call RBUILD_cflags,$(1),$(4)} -x c-header -M -MP -MT $$@ $$< - --include $$(intermediate_dir)$$(SEP).gch_$$(module_name)$$(SEP)$(notdir $(2)).gch.d - -${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1) - $$(ECHO_PCH) - $${gcc} -MF $$@ ${call RBUILD_cflags,$(1),$(4)} -x c-header -M -MP -MT $$@ $$< - -else - -${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1) - $$(ECHO_PCH) - $${gcc} -MF $$@ ${call RBUILD_cflags,$(1),$(4)} -x c-header -M -MP -MT $$@ $$< - -endif - -endef - -#(module, source, dependencies, cflags) -define RBUILD_GPP_PCH_RULE - -$(2): $${$(1)_precondition} - -ifeq ($$(ROS_BUILDDEPS),full) - -${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d: $(2) | ${call RBUILD_intermediate_dir,$(2)} - $$(ECHO_DEPENDS) - $${gpp} -MF $$@ ${call RBUILD_cxxflags,$(1),$(4)} -x c++-header -M -MP -MT $$@ $$< - --include $$(intermediate_dir)$$(SEP).gch_$$(module_name)$$(SEP)$(notdir $(2)).gch.d - -${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch.d $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1) - $$(ECHO_PCH) - $${gpp} -MF $$@ ${call RBUILD_cxxflags,$(1),$(4)} -x c++-header -M -MP -MT $$@ $$< - -else - -${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1)$$(SEP)$(notdir $(2)).gch: $(2) $(3) | ${call RBUILD_intermediate_dir,$(2)}$$(SEP).gch_$(1) - $$(ECHO_PCH) - $${gpp} -MF $$@ ${call RBUILD_cxxflags,$(1),$(4)} -x c++-header -M -MP -MT $$@ $$< - -endif - -endef #(module, source, dependencies, cflags, output) define RBUILD_NASM @@ -319,27 +169,20 @@ ifeq ($$(ROS_BUILDDEPS),full) -${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec.d: $(2) | ${call RBUILD_intermediate_dir,$(2)} - $$(ECHO_DEPENDS) - $${gcc} -xc -MF $$@ ${call RBUILD_spec_pp_flags,$(1),$(4)} -M -MP -MT $$@ $$< - +${call RBUILD_DEPENDS,$(1),$(2),,${call RBUILD_spec_pp_flags,$(1),$(4)},${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec.d} -include ${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec.d -${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec: $(2) ${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec.d $(3) | ${call RBUILD_intermediate_dir,$(2)} - $$(ECHO_CPP) - $${gcc} -xc -E ${call RBUILD_spec_pp_flags,$(1),$(4)} $$< > $$@ +${call RBUILD_CPP,$(1),$(2),${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec.d $(3),${call RBUILD_spec_pp_flags,$(1),$(4)},${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec} else -${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec: $(2) $(3) | ${call RBUILD_intermediate_dir,$(2)} - $$(ECHO_CPP) - $${gcc} -xc -E ${call RBUILD_spec_pp_flags,$(1),$(4)} $$< > $$@ +${call RBUILD_CPP,$(1),$(2),$(3),${call RBUILD_spec_pp_flags,$(1),$(4)},${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec} endif ${call RBUILD_WINEBUILD_DEF,$(1),${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec,,$(4),$(5),${call RBUILD_intermediate_path_unique,$(1),$(2)}.auto.def} ${call RBUILD_WINEBUILD_STUBS,$(1),${call RBUILD_intermediate_path_unique,$(1),$(2)}.spec,,$(4),$(5),${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.c} -${call RBUILD_GCC,$(1),${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.c,,,${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.o} +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.c,,,${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.o} endef @@ -348,7 +191,7 @@ ${call RBUILD_WINEBUILD_DEF,$(1),$(2),$(3),$(4),$(5),${call RBUILD_intermediate_path_unique,$(1),$(2)}.auto.def} ${call RBUILD_WINEBUILD_STUBS,$(1),$(2),$(3),$(4),$(5),${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.c} -${call RBUILD_GCC,$(1),${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.c,,,${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.o} +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.c,,,${call RBUILD_intermediate_path_unique,$(1),$(2)}.stubs.o} endef @@ -360,10 +203,7 @@ ifeq ($$(ROS_BUILDDEPS),full) -${call RBUILD_intermediate_path_unique,$(1),$(2)}.res.d: $(2) | ${call RBUILD_intermediate_dir,$(2)} $$(TEMPORARY) - $$(ECHO_DEPENDS) - $${gcc} -xc -MF $$@ ${call RBUILD_rc_pp_flags,$(1),$(4)} -M -MP -MT $$@ $$< - +${call RBUILD_DEPENDS,$(1),$(2),,${call RBUILD_rc_pp_flags,$(1),$(4)},${call RBUILD_intermediate_path_unique,$(1),$(2)}.res.d} -include ${call RBUILD_intermediate_path_unique,$(1),$(2)}.coff.d ${call RBUILD_intermediate_path_unique,$(1),$(2)}.res: $(2) ${call RBUILD_intermediate_path_unique,$(1),$(2)}.res.d $(3) $$(WRC_TARGET) | ${call RBUILD_intermediate_dir,$(2)} @@ -407,7 +247,7 @@ $$(ECHO_WIDL) $$(Q)$$(WIDL_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -h -H ${call RBUILD_intermediate_path_noext,$(2)}_c.h -c -C ${call RBUILD_intermediate_path_noext,$(2)}_c.c $(2) -${call RBUILD_GCC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_c.c,,-fno-unit-at-a-time,${call RBUILD_intermediate_path_noext,$(2)}_c.o} +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_c.c,,-fno-unit-at-a-time,${call RBUILD_intermediate_path_noext,$(2)}_c.o} endef @@ -420,7 +260,7 @@ $$(ECHO_WIDL) $$(Q)$$(WIDL_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -h -H ${call RBUILD_intermediate_path_noext,$(2)}_s.h -s -S ${call RBUILD_intermediate_path_noext,$(2)}_s.c $(2) -${call RBUILD_GCC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_s.c,,-fno-unit-at-a-time,${call RBUILD_intermediate_path_noext,$(2)}_s.o} +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_s.c,,-fno-unit-at-a-time,${call RBUILD_intermediate_path_noext,$(2)}_s.o} endef @@ -433,7 +273,7 @@ $$(ECHO_WIDL) $$(Q)$$(WIDL_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -h -H ${call RBUILD_intermediate_path_noext,$(2)}_p.h -p -P ${call RBUILD_intermediate_path_noext,$(2)}_p.c $(2) -${call RBUILD_GCC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_p.c,,-fno-unit-at-a-time,${call RBUILD_intermediate_path_noext,$(2)}_p.o} +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_p.c,,-fno-unit-at-a-time,${call RBUILD_intermediate_path_noext,$(2)}_p.o} endef @@ -446,7 +286,7 @@ $$(ECHO_WIDL) $$(Q)$$(WIDL_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -u -U $$@ $$< -${call RBUILD_GCC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_i.c,,-fno-unit-at-a-time,${call RBUILD_intermediate_path_noext,$(2)}_i.o} +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_i.c,,-fno-unit-at-a-time,${call RBUILD_intermediate_path_noext,$(2)}_i.o} endef @@ -458,7 +298,7 @@ $$(ECHO_WIDL) $$(Q)$$(WIDL_TARGET) ${call RBUILD_midlflags,$(1),$(4)} --dlldata-only --dlldata=$(2) $(5) -${call RBUILD_GCC,$(1),$(2),,,${call RBUILD_intermediate_path_noext,$(2)}.o} +${call RBUILD_CC,$(1),$(2),,,${call RBUILD_intermediate_path_noext,$(2)}.o} endef Modified: trunk/reactos/tools/rbuild/module.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/module.cpp?re…
============================================================================== --- trunk/reactos/tools/rbuild/module.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/module.cpp [iso-8859-1] Wed Jun 10 21:56:12 2009 @@ -601,6 +601,48 @@ const string& relative_path, ParseContext& parseContext ) { + const XMLAttribute* att; + + att = e.GetAttribute ( "compilerset", false ); + + if ( att ) + { + CompilerSet compilerSet; + + if ( att->value == "msc" ) + compilerSet = MicrosoftC; + else if ( att->value == "gcc" ) + compilerSet = GnuGcc; + else + throw InvalidAttributeValueException ( + e.location, + "compilerset", + att->value ); + + if ( compilerSet != project.configuration.Compiler ) + return; + } + + att = e.GetAttribute ( "linkerset", false ); + + if ( att ) + { + LinkerSet linkerSet; + + if ( att->value == "mslink" ) + linkerSet = MicrosoftLink; + else if ( att->value == "ld" ) + linkerSet = GnuLd; + else + throw InvalidAttributeValueException ( + e.location, + "linkerset", + att->value ); + + if ( linkerSet != project.configuration.Linker ) + return; + } + CompilationUnit* pOldCompilationUnit = parseContext.compilationUnit; bool subs_invalid = false; string subpath ( relative_path ); Modified: trunk/reactos/tools/rbuild/project.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/project.cpp?r…
============================================================================== --- trunk/reactos/tools/rbuild/project.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/project.cpp [iso-8859-1] Wed Jun 10 21:56:12 2009 @@ -330,6 +330,48 @@ const string& path, ParseContext& parseContext ) { + const XMLAttribute* att; + + att = e.GetAttribute ( "compilerset", false ); + + if ( att ) + { + CompilerSet compilerSet; + + if ( att->value == "msc" ) + compilerSet = MicrosoftC; + else if ( att->value == "gcc" ) + compilerSet = GnuGcc; + else + throw InvalidAttributeValueException ( + e.location, + "compilerset", + att->value ); + + if ( compilerSet != configuration.Compiler ) + return; + } + + att = e.GetAttribute ( "linkerset", false ); + + if ( att ) + { + LinkerSet linkerSet; + + if ( att->value == "mslink" ) + linkerSet = MicrosoftLink; + else if ( att->value == "ld" ) + linkerSet = GnuLd; + else + throw InvalidAttributeValueException ( + e.location, + "linkerset", + att->value ); + + if ( linkerSet != configuration.Linker ) + return; + } + bool subs_invalid = false; string subpath(path); @@ -475,3 +517,25 @@ { return xmlfile; } + +std::string +Project::GetCompilerSet () const +{ + switch ( configuration.Compiler ) + { + case GnuGcc: return "gcc"; + case MicrosoftC: return "msc"; + default: assert ( false ); + } +} + +std::string +Project::GetLinkerSet () const +{ + switch ( configuration.Linker ) + { + case GnuLd: return "ld"; + case MicrosoftLink: return "mslink"; + default: assert ( false ); + } +} Modified: trunk/reactos/tools/rbuild/rbuild.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.h?rev=…
============================================================================== --- trunk/reactos/tools/rbuild/rbuild.h [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/rbuild.h [iso-8859-1] Wed Jun 10 21:56:12 2009 @@ -274,6 +274,8 @@ const std::string& GetProjectFilename () const; std::string ResolveProperties ( const std::string& s ) const; const Property* LookupProperty ( const std::string& name ) const; + std::string GetCompilerSet () const; + std::string GetLinkerSet () const; private: std::string ResolveNextProperty ( const std::string& s ) const; void ReadXml (); @@ -443,23 +445,37 @@ bool default_value = false ); }; +class ToolsetDirective +{ +private: + bool enabled; + +protected: + void ParseToolsets ( const Project& project, const XMLElement& node ); + +public: + bool IsEnabled () const; +}; + class CompilerDirective { private: std::bitset<CompilerTypesCount> compilersSet; - -public: + bool enabled; + +protected: + void ParseCompilers ( const XMLElement& node, const std::string& defaultValue ); + +public: + CompilerDirective (): enabled ( true ) { } void SetCompiler ( CompilerType compiler ); void UnsetCompiler ( CompilerType compiler ); void SetAllCompilers (); void UnsetAllCompilers (); - - void ParseCompilers ( const XMLElement& node, const std::string& defaultValue ); - bool IsCompilerSet ( CompilerType compiler ) const; }; -class Include: public CompilerDirective +class Include: public CompilerDirective, public ToolsetDirective { public: FileLocation *directory; @@ -483,7 +499,7 @@ }; -class Define: public CompilerDirective +class Define: public CompilerDirective, public ToolsetDirective { public: const Project& project; @@ -647,7 +663,7 @@ }; -class CompilerFlag: public CompilerDirective +class CompilerFlag: public CompilerDirective, public ToolsetDirective { public: const Project& project; @@ -667,7 +683,7 @@ }; -class LinkerFlag +class LinkerFlag: public ToolsetDirective { public: const Project& project;
15 years, 5 months
1
0
0
0
[dchapyshev] 41367: - Set priority only if PriorityClass != PROCESS_PRIORITY_CLASS_INVALID
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Jun 10 21:11:36 2009 New Revision: 41367 URL:
http://svn.reactos.org/svn/reactos?rev=41367&view=rev
Log: - Set priority only if PriorityClass != PROCESS_PRIORITY_CLASS_INVALID Modified: trunk/reactos/dll/win32/kernel32/process/procsup.c Modified: trunk/reactos/dll/win32/kernel32/process/procsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/process…
============================================================================== --- trunk/reactos/dll/win32/kernel32/process/procsup.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/process/procsup.c [iso-8859-1] Wed Jun 10 21:11:36 2009 @@ -1179,16 +1179,19 @@ goto Cleanup; } - /* Set new class */ - Status = NtSetInformationProcess(hProcess, - ProcessPriorityClass, - &PriorityClass, - sizeof(PROCESS_PRIORITY_CLASS)); - if(!NT_SUCCESS(Status)) - { - DPRINT1("Unable to set new process priority, status 0x%x\n", Status); - SetLastErrorByStatus(Status); - goto Cleanup; + if (PriorityClass.PriorityClass != PROCESS_PRIORITY_CLASS_INVALID) + { + /* Set new class */ + Status = NtSetInformationProcess(hProcess, + ProcessPriorityClass, + &PriorityClass, + sizeof(PROCESS_PRIORITY_CLASS)); + if(!NT_SUCCESS(Status)) + { + DPRINT1("Unable to set new process priority, status 0x%x\n", Status); + SetLastErrorByStatus(Status); + goto Cleanup; + } } /* Set Error Mode */
15 years, 5 months
1
0
0
0
[hyperion] 41366: deleted tools/msc_helper deleted tools/msc_helper/msc_helper.cpp deleted tools/msc_helper/msc_helper.rbuild added tools/rbuild_helper deleted tools/rbuild_helper/msc_helper.cpp deleted tools/rbuild_helper/msc_helper.rbuild added tools/rbuild_helper/rbuild_helper.rbuild msc_helper renamed to rbuild_helper, because it could be useful to more than just Visual C++ added tools/rbuild_helper/rbuild_helper.cpp Allow rbuild_helper to override any environment variable, given an override
by hyperion@svn.reactos.org
Author: hyperion Date: Wed Jun 10 15:16:28 2009 New Revision: 41366 URL:
http://svn.reactos.org/svn/reactos?rev=41366&view=rev
Log: deleted tools/msc_helper deleted tools/msc_helper/msc_helper.cpp deleted tools/msc_helper/msc_helper.rbuild added tools/rbuild_helper deleted tools/rbuild_helper/msc_helper.cpp deleted tools/rbuild_helper/msc_helper.rbuild added tools/rbuild_helper/rbuild_helper.rbuild msc_helper renamed to rbuild_helper, because it could be useful to more than just Visual C++ added tools/rbuild_helper/rbuild_helper.cpp Allow rbuild_helper to override any environment variable, given an override prefix (e.g., %VAR% will be replaced by %<override prefix>VAR%) modified tools/tools.rbuild Build rbuild_helper by default Added: trunk/reactos/tools/rbuild_helper/ (props changed) - copied from r41235, trunk/reactos/tools/msc_helper/ trunk/reactos/tools/rbuild_helper/rbuild_helper.cpp (contents, props changed) - copied, changed from r41235, trunk/reactos/tools/msc_helper/msc_helper.cpp trunk/reactos/tools/rbuild_helper/rbuild_helper.rbuild (contents, props changed) - copied, changed from r41235, trunk/reactos/tools/msc_helper/msc_helper.rbuild Removed: trunk/reactos/tools/msc_helper/ trunk/reactos/tools/rbuild_helper/msc_helper.cpp trunk/reactos/tools/rbuild_helper/msc_helper.rbuild Modified: trunk/reactos/tools/tools.rbuild Propchange: trunk/reactos/tools/rbuild_helper/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Wed Jun 10 15:16:28 2009 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/tools/rbuild_helper/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/tools/rbuild_helper/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/tools/rbuild_helper/ ------------------------------------------------------------------------------ svn:mergeinfo = Propchange: trunk/reactos/tools/rbuild_helper/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Removed: trunk/reactos/tools/rbuild_helper/msc_helper.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/msc_helper/msc_helpe…
============================================================================== --- trunk/reactos/tools/rbuild_helper/msc_helper.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild_helper/msc_helper.cpp (removed) @@ -1,475 +1,0 @@ -/* - Copyright (c) 2009 KJK::Hyperion - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. -*/ - -#include <functional> -#include <iterator> - -#include <tchar.h> -#include <limits.h> - -#include <stdio.h> - -#define WIN32_LEAN_AND_MEAN -#define STRICT -#include <windows.h> - -#undef RtlMoveMemory -extern "C" DECLSPEC_IMPORT void NTAPI RtlMoveMemory(void UNALIGNED *, const void UNALIGNED *, SIZE_T); - -#ifndef ARRAYSIZE -#define ARRAYSIZE(X_) (sizeof(X_) / sizeof((X_)[0])) -#endif - -#include <kjk/argv_parser.h> -#include <kjk/stringz_iterator.h> - -using namespace kjk; - -namespace -{ - bool WriteAll(HANDLE hFile, const void * p, size_t cb) - { - const char * pb = static_cast<const char *>(p); - bool ret = cb == 0; - - while(cb) - { - DWORD cbToWrite; - - if(cb > MAXLONG) - cbToWrite = MAXLONG; - else - cbToWrite = static_cast<DWORD>(cb); - - DWORD cbWritten; - ret = !!WriteFile(hFile, pb, cbToWrite, &cbWritten, NULL); - - if(!ret) - break; - - cb -= cbWritten; - pb += cbWritten; - } - - return ret; - } - - DECLSPEC_NORETURN - void Exit(DWORD dwExitCode) - { - for(;;) TerminateProcess(GetCurrentProcess(), dwExitCode); - } - - DECLSPEC_NORETURN - void Die(DWORD dwExitCode, const char * pszFunction, DWORD dwErrCode) - { - DWORD_PTR args[] = { (DWORD_PTR)pszFunction, dwErrCode }; - - char * pszMessage; - DWORD cchMessage = FormatMessageA - ( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_ARGUMENT_ARRAY | FORMAT_MESSAGE_FROM_STRING, - "msc_helper: %1!s!() failed: error %2!lu!\n", - 0, - 0, - (LPSTR)&pszMessage, - 0, - (va_list *)args - ); - - if(cchMessage) - { - (void)WriteAll(GetStdHandle(STD_ERROR_HANDLE), pszMessage, cchMessage); - LocalFree((HLOCAL)pszMessage); - } - - Exit(dwExitCode); - } - - DECLSPEC_NORETURN - void Die(const char * pszFunction) - { - Die(1, pszFunction, GetLastError()); - } - - DECLSPEC_NORETURN - void Die(const char * pszFunction, DWORD dwExitCode) - { - Die(1, pszFunction, dwExitCode); - } - - template<size_t N> - DECLSPEC_NORETURN - void DieMessage(const char (& msg)[N]) - { - (void)WriteAll(GetStdHandle(STD_ERROR_HANDLE), msg, (N) - 1); - Exit(1); - } - - DECLSPEC_NORETURN - void OutOfMemory() - { - DieMessage("msc_helper: out of memory\n"); - } - - class store_argument - { - private: - char * m_arg; - size_t m_argLen; - - public: - // Pretend we are an STL container - typedef TCHAR value_type; - typedef TCHAR * pointer; - typedef TCHAR& reference; - typedef const TCHAR * const_pointer; - typedef const TCHAR& const_reference; - - void push_back(TCHAR x) - { -#ifdef UNICODE - if(x > CHAR_MAX) - DieMessage("msc_helper: invalid character in command line\n"); -#endif - m_arg = static_cast<char *>(HeapReAlloc(GetProcessHeap(), 0, m_arg, m_argLen + 1)); - - if(m_arg == NULL) - OutOfMemory(); - - m_arg[m_argLen] = static_cast<char>(x); - ++ m_argLen; - } - - public: - store_argument(): m_arg(static_cast<char *>(HeapAlloc(GetProcessHeap(), 0, 1))), m_argLen(0) - { - if(m_arg == NULL) - OutOfMemory(); - } - - const char * get_arg() const { return m_arg; } - size_t get_arg_len() const { return m_argLen; } - }; - - class filter_output - { - private: - const char * m_pFilterLine; - size_t m_cbFilterLine; - HANDLE m_hOutput; - bool& m_fDone; - - static DWORD s_cbDummy; - static DWORD s_pipeId; - - char m_buffer[1024]; - LPTSTR m_pszPipeName; - HANDLE m_hReadFrom; - OVERLAPPED m_asyncRead; - char * m_pLineBuffer; - size_t m_cbLineBuffer; - - bool begin_read() - { - bool bRet = !!ReadFile(m_hReadFrom, m_buffer, sizeof(m_buffer), &s_cbDummy, &m_asyncRead); - - if(!bRet) - { - bRet = GetLastError() != ERROR_BROKEN_PIPE; - - if(bRet) - { - bRet = GetLastError() == ERROR_IO_PENDING; - - if(!bRet) - Die("ReadFile"); - } - } - - return bRet; - } - - void push_input(size_t cbBufferValid) - { - if(m_fDone) - { - if(!WriteAll(m_hOutput, m_buffer, cbBufferValid)) - Die("WriteFile"); - - return; - } - - // Add the data read from output to the line buffer - size_t cbLineBufferNew = m_cbLineBuffer + cbBufferValid; - - if(m_pLineBuffer) - m_pLineBuffer = static_cast<char *>(HeapReAlloc(GetProcessHeap(), 0, m_pLineBuffer, cbLineBufferNew)); - else - m_pLineBuffer = static_cast<char *>(HeapAlloc(GetProcessHeap(), 0, cbLineBufferNew)); - - if(m_pLineBuffer == NULL) - OutOfMemory(); - - RtlMoveMemory(m_pLineBuffer + m_cbLineBuffer, m_buffer, cbBufferValid); - - // Parse all complete lines in the line buffer - size_t cbLineStart = 0; - - for(size_t i = m_cbLineBuffer; i < cbLineBufferNew; ++ i) - { - // We have a complete line - if(m_pLineBuffer[i] == '\n' || m_pLineBuffer[i] == '\r') - { - size_t cbLine = i - cbLineStart; - - ++ i; - - if(i < cbLineBufferNew && m_pLineBuffer[i - 1] == '\r' && m_pLineBuffer[i] == '\n') - ++ i; - - size_t cbLineFull = i - cbLineStart; - - bool fMatched = cbLine == m_cbFilterLine && memcmp(m_pLineBuffer + cbLineStart, m_pFilterLine, m_cbFilterLine) == 0; - - // The line doesn't match: dump it - if(!fMatched) - { - if(!WriteAll(m_hOutput, m_pLineBuffer + cbLineStart, cbLineFull)) - Die("WriteFile"); - } - // The line matches: we are done - else - m_fDone = fMatched; - - cbLineStart = i; - } - - // Filtering is complete: from now on, just dump everything - if(m_fDone) - { - if(!WriteAll(m_hOutput, m_buffer + i, cbLineBufferNew - i)) - Die("WriteFile"); - - HeapFree(GetProcessHeap(), 0, m_pLineBuffer); - return; - } - } - - // Re-buffer what's left - m_cbLineBuffer = cbLineBufferNew - cbLineStart; - RtlMoveMemory(m_pLineBuffer, m_pLineBuffer + cbLineStart, m_cbLineBuffer); - } - - public: - filter_output(const char * pFilterLine, size_t cbFilterLine, HANDLE hOutput, bool * pfDone): - m_pFilterLine(pFilterLine), - m_cbFilterLine(cbFilterLine), - m_hOutput(hOutput), - m_fDone(*pfDone), - m_asyncRead(), - m_pLineBuffer(0), - m_cbLineBuffer(0) - { - for(;;) - { - DWORD_PTR args[] = { GetCurrentProcessId(), s_pipeId }; - - DWORD cchPipeName = FormatMessage - ( - FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_ARGUMENT_ARRAY | FORMAT_MESSAGE_FROM_STRING, - TEXT("\\\\.\\pipe\\msc_helper-%1!08X!-%2!08X!"), - 0, - 0, - (LPTSTR)&m_pszPipeName, - 0, - (va_list *)args - ); - - if(cchPipeName == 0) - Die("FormatMessage"); - - m_hReadFrom = CreateNamedPipe(m_pszPipeName, PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE, 1, 0, 0, 0, NULL); - - ++ s_pipeId; - - if(m_hReadFrom != INVALID_HANDLE_VALUE) - break; - - if(GetLastError() != ERROR_PIPE_BUSY) - Die("CreateNamedPipe"); - } - - // Just in case - bool fEmptyFilter = m_cbFilterLine == 0; - - if(fEmptyFilter) - m_fDone = fEmptyFilter; - } - - HANDLE open_write_end(LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) - { - HANDLE hWritePipe = CreateFile(m_pszPipeName, GENERIC_WRITE, FILE_SHARE_READ, lpSecurityAttributes, OPEN_EXISTING, dwFlagsAndAttributes, hTemplateFile); - - if(hWritePipe == INVALID_HANDLE_VALUE) - Die("CreateFile"); - - (void)begin_read(); - return hWritePipe; - } - - HANDLE get_read_completion() const - { - return m_hReadFrom; - } - - bool operator()() - { - DWORD cbBufferValid; - - if(!GetOverlappedResult(m_hReadFrom, &m_asyncRead, &cbBufferValid, TRUE)) - { - bool b = GetLastError() != ERROR_BROKEN_PIPE; - - if(!b) - return b; - - Die("ReadFile"); - } - - push_input(cbBufferValid); - return begin_read(); - } - }; - - DWORD filter_output::s_cbDummy = 0; - DWORD filter_output::s_pipeId = 0; -} - -int main() -{ - DWORD dwExitCode = 1; - - // Parse the command line - LPCTSTR pszCommandLine = GetCommandLine(); - - // Skip argv[0] - pszCommandLine = skip_argument(stringz_begin(pszCommandLine), stringz_end(pszCommandLine)).base(); - - // Get argv[1]: the line that should be filtered out of the output - // argv[2..N] will become argv[0..N-2] of the compiler - store_argument filterLine; - pszCommandLine = copy_argument(stringz_begin(pszCommandLine), stringz_end(pszCommandLine), std::back_inserter(filterLine)).base(); - - // Initialize the output filters - bool fDone = false; - filter_output filterStdOutput(filterLine.get_arg(), filterLine.get_arg_len(), GetStdHandle(STD_OUTPUT_HANDLE), &fDone); - filter_output filterStdError(filterLine.get_arg(), filterLine.get_arg_len(), GetStdHandle(STD_ERROR_HANDLE), &fDone); - - // A handle that will never be signaled - HANDLE hNever; - - if(!DuplicateHandle(GetCurrentProcess(), GetCurrentProcess(), GetCurrentProcess(), &hNever, SYNCHRONIZE, FALSE, 0)) - Die("DuplicateHandle"); - - // Fix the environment - static TCHAR szPath[32768]; - DWORD cchPath = GetEnvironmentVariable(TEXT("MSC_HELPER_PATH"), szPath, ARRAYSIZE(szPath)); - - if(cchPath > ARRAYSIZE(szPath)) - DieMessage("msc_helper: %MSC_HELPER_PATH% variable too big\n"); - - if(cchPath > 0 && !SetEnvironmentVariable(TEXT("PATH"), szPath)) - Die("SetEnvironmentVariable"); - - // Run the sub-process - STARTUPINFO si; - GetStartupInfo(&si); - - si.dwFlags |= STARTF_USESTDHANDLES; - - si.hStdInput = GetStdHandle(STD_INPUT_HANDLE); - - SECURITY_ATTRIBUTES pipeAttributes = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE }; - si.hStdOutput = filterStdOutput.open_write_end(&pipeAttributes, 0, NULL); - si.hStdError = filterStdError.open_write_end(&pipeAttributes, 0, NULL); - - PROCESS_INFORMATION pi = {}; - - if(!CreateProcess(NULL, const_cast<LPTSTR>(pszCommandLine), NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) - Die("CreateProcess"); - - CloseHandle(pi.hThread); - CloseHandle(si.hStdOutput); - CloseHandle(si.hStdError); - - (void)SetProcessWorkingSetSize(GetCurrentProcess(), (SIZE_T)-1, (SIZE_T)-1); - - HANDLE waitHandles[3] = - { - pi.hProcess, - filterStdOutput.get_read_completion(), - filterStdError.get_read_completion() - }; - - unsigned done = 0; - - char * pLineBuffer = NULL; - size_t cbLineBuffer = 0; - - while(done < ARRAYSIZE(waitHandles)) - { - switch(WaitForMultipleObjects(ARRAYSIZE(waitHandles), waitHandles, FALSE, INFINITE)) - { - case WAIT_OBJECT_0: - GetExitCodeProcess(pi.hProcess, &dwExitCode); - waitHandles[WAIT_OBJECT_0] = hNever; - ++ done; - break; - - case WAIT_OBJECT_0 + 1: - if(!filterStdOutput()) - { - waitHandles[WAIT_OBJECT_0 + 1] = hNever; - ++ done; - } - - break; - - case WAIT_OBJECT_0 + 2: - if(!filterStdError()) - { - waitHandles[WAIT_OBJECT_0 + 2] = hNever; - ++ done; - } - - break; - - default: - Die("WaitForMultipleObjects"); - } - } - - Exit(dwExitCode); -} - -// EOF Removed: trunk/reactos/tools/rbuild_helper/msc_helper.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/msc_helper/msc_helpe…
============================================================================== --- trunk/reactos/tools/rbuild_helper/msc_helper.rbuild [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild_helper/msc_helper.rbuild (removed) @@ -1,6 +1,0 @@ -<?xml version="1.0"?> -<module name="msc_helper" type="buildtool"> - <define name="UNICODE" /> - <define name="_UNICODE" /> - <file>msc_helper.cpp</file> -</module> Copied: trunk/reactos/tools/rbuild_helper/rbuild_helper.cpp (from r41235, trunk/reactos/tools/msc_helper/msc_helper.cpp) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild_helper/rbuild…
============================================================================== --- trunk/reactos/tools/msc_helper/msc_helper.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild_helper/rbuild_helper.cpp [iso-8859-1] Wed Jun 10 15:16:28 2009 @@ -20,11 +20,18 @@ DEALINGS IN THE SOFTWARE. */ +#if !defined(WIN32) + +// TODO: needs a near rewrite for UNIX, but it's not required right now +int main() { return 1; } + +#else + #include <functional> #include <iterator> +#include <limits> #include <tchar.h> -#include <limits.h> #include <stdio.h> @@ -131,10 +138,11 @@ DieMessage("msc_helper: out of memory\n"); } + template<class CharT> class store_argument { private: - char * m_arg; + CharT * m_arg; size_t m_argLen; public: @@ -147,27 +155,26 @@ void push_back(TCHAR x) { -#ifdef UNICODE - if(x > CHAR_MAX) + if(x > std::numeric_limits<CharT>::max() || x < std::numeric_limits<CharT>::min()) DieMessage("msc_helper: invalid character in command line\n"); -#endif - m_arg = static_cast<char *>(HeapReAlloc(GetProcessHeap(), 0, m_arg, m_argLen + 1)); + + m_arg = static_cast<CharT *>(HeapReAlloc(GetProcessHeap(), 0, m_arg, (m_argLen + 1) * sizeof(CharT))); if(m_arg == NULL) OutOfMemory(); - m_arg[m_argLen] = static_cast<char>(x); - ++ m_argLen; + m_arg[m_argLen] = static_cast<CharT>(x); + ++ m_argLen; // TODO: better allocation strategy } public: - store_argument(): m_arg(static_cast<char *>(HeapAlloc(GetProcessHeap(), 0, 1))), m_argLen(0) + store_argument(): m_arg(static_cast<CharT *>(HeapAlloc(GetProcessHeap(), 0, 1))), m_argLen(0) { if(m_arg == NULL) OutOfMemory(); } - const char * get_arg() const { return m_arg; } + const CharT * get_arg() const { return m_arg; } size_t get_arg_len() const { return m_argLen; } }; @@ -363,6 +370,17 @@ DWORD filter_output::s_cbDummy = 0; DWORD filter_output::s_pipeId = 0; + + size_t LengthOfVersionStrings(const TCHAR * pszStrings) + { + size_t cchStrings = 0; + + do + cchStrings += lstrlen(pszStrings + cchStrings) + 1; + while(pszStrings[cchStrings]); + + return cchStrings + 1; + } } int main() @@ -375,10 +393,15 @@ // Skip argv[0] pszCommandLine = skip_argument(stringz_begin(pszCommandLine), stringz_end(pszCommandLine)).base(); - // Get argv[1]: the line that should be filtered out of the output - // argv[2..N] will become argv[0..N-2] of the compiler - store_argument filterLine; + // Get argv[1]: the prefix for environment variable replacement + store_argument<TCHAR> envPrefix; + pszCommandLine = copy_argument(stringz_begin(pszCommandLine), stringz_end(pszCommandLine), std::back_inserter(envPrefix)).base(); + + // Get argv[2]: the line that should be filtered out of the output + store_argument<char> filterLine; pszCommandLine = copy_argument(stringz_begin(pszCommandLine), stringz_end(pszCommandLine), std::back_inserter(filterLine)).base(); + + // argv[3..N] will become argv[0..N-3] of the compiler // Initialize the output filters bool fDone = false; @@ -392,14 +415,62 @@ Die("DuplicateHandle"); // Fix the environment - static TCHAR szPath[32768]; - DWORD cchPath = GetEnvironmentVariable(TEXT("MSC_HELPER_PATH"), szPath, ARRAYSIZE(szPath)); - - if(cchPath > ARRAYSIZE(szPath)) - DieMessage("msc_helper: %MSC_HELPER_PATH% variable too big\n"); - - if(cchPath > 0 && !SetEnvironmentVariable(TEXT("PATH"), szPath)) - Die("SetEnvironmentVariable"); + if(envPrefix.get_arg_len()) + { + LPTCH pEnv = GetEnvironmentStrings(); + + if(!pEnv) + OutOfMemory(); + + SIZE_T cbEnv = LengthOfVersionStrings(pEnv) * sizeof(TCHAR); + LPVOID pDupEnv = HeapAlloc(GetProcessHeap(), 0, cbEnv); + + if(!pDupEnv) + OutOfMemory(); + + RtlMoveMemory(pDupEnv, pEnv, cbEnv); + FreeEnvironmentStrings(pEnv); + pEnv = static_cast<TCHAR *>(pDupEnv); + + LPCTSTR pszEnvVar = pEnv; + + size_t cchPrefix = envPrefix.get_arg_len(); + const TCHAR * pszBeginPrefix = envPrefix.get_arg(); + const TCHAR * pszEndPrefix = pszBeginPrefix + cchPrefix; + + do + { + const TCHAR * pszBeginName = pszEnvVar; + const TCHAR * pszEndName = std::find(stringz_begin(pszEnvVar), stringz_end(pszEnvVar), TEXT('=')).base(); + const TCHAR * pszBeginValue = pszEndName; + + if(*pszEndName) + { + *const_cast<TCHAR *>(pszEndName) = 0; + ++ pszBeginValue; + } + + size_t cchName = pszEndName - pszBeginName; + + if(cchName >= cchPrefix && std::equal(pszBeginPrefix, pszEndPrefix, pszBeginName)) + { + SetEnvironmentVariable(pszBeginName, NULL); + + if(cchName > cchPrefix) + SetEnvironmentVariable(pszBeginName + cchPrefix, *pszBeginValue ? pszBeginValue : NULL); + } + + pszEnvVar = pszBeginValue; + + while(*pszEnvVar) + ++ pszEnvVar; + + ++ pszEnvVar; + } + while(*pszEnvVar); + + HeapFree(GetProcessHeap(), 0, pEnv); + } // Run the sub-process STARTUPINFO si; @@ -472,4 +543,6 @@ Exit(dwExitCode); } +#endif + // EOF Propchange: trunk/reactos/tools/rbuild_helper/rbuild_helper.cpp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/tools/rbuild_helper/rbuild_helper.cpp ------------------------------------------------------------------------------ svn:mergeinfo = Copied: trunk/reactos/tools/rbuild_helper/rbuild_helper.rbuild (from r41235, trunk/reactos/tools/msc_helper/msc_helper.rbuild) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild_helper/rbuild…
============================================================================== --- trunk/reactos/tools/msc_helper/msc_helper.rbuild [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild_helper/rbuild_helper.rbuild [iso-8859-1] Wed Jun 10 15:16:28 2009 @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<module name="msc_helper" type="buildtool"> +<module name="rbuild_helper" type="buildtool"> <define name="UNICODE" /> <define name="_UNICODE" /> - <file>msc_helper.cpp</file> + <file>rbuild_helper.cpp</file> </module> Propchange: trunk/reactos/tools/rbuild_helper/rbuild_helper.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/tools/rbuild_helper/rbuild_helper.rbuild ------------------------------------------------------------------------------ svn:mergeinfo = Modified: trunk/reactos/tools/tools.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/tools.rbuild?rev=413…
============================================================================== --- trunk/reactos/tools/tools.rbuild [iso-8859-1] (original) +++ trunk/reactos/tools/tools.rbuild [iso-8859-1] Wed Jun 10 15:16:28 2009 @@ -34,4 +34,7 @@ <directory name="utf16le"> <xi:include href="utf16le/utf16le.rbuild" /> </directory> +<directory name="rbuild_helper"> + <xi:include href="rbuild_helper/rbuild_helper.rbuild" /> +</directory> </group>
15 years, 5 months
1
0
0
0
[dchapyshev] 41365: - Fix ProcessPriorityClass case in NtQueryInformationProcess. Structure PROCESS_PRIORITY_CLASS should be returned. Tested in win vista
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Wed Jun 10 11:07:51 2009 New Revision: 41365 URL:
http://svn.reactos.org/svn/reactos?rev=41365&view=rev
Log: - Fix ProcessPriorityClass case in NtQueryInformationProcess. Structure PROCESS_PRIORITY_CLASS should be returned. Tested in win vista Modified: trunk/reactos/ntoskrnl/ps/query.c Modified: trunk/reactos/ntoskrnl/ps/query.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/query.c?rev=41…
============================================================================== --- trunk/reactos/ntoskrnl/ps/query.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ps/query.c [iso-8859-1] Wed Jun 10 11:07:51 2009 @@ -68,6 +68,7 @@ PPROCESS_BASIC_INFORMATION ProcessBasicInfo = (PPROCESS_BASIC_INFORMATION)ProcessInformation; PKERNEL_USER_TIMES ProcessTime = (PKERNEL_USER_TIMES)ProcessInformation; + PPROCESS_PRIORITY_CLASS PsPriorityClass = (PPROCESS_PRIORITY_CLASS)ProcessInformation; ULONG HandleCount; PPROCESS_SESSION_INFORMATION SessionInfo = (PPROCESS_SESSION_INFORMATION)ProcessInformation; @@ -559,7 +560,7 @@ case ProcessPriorityClass: /* Set the return length*/ - Length = sizeof(USHORT); + Length = sizeof(PROCESS_PRIORITY_CLASS); if (ProcessInformationLength != Length) { @@ -580,7 +581,8 @@ _SEH2_TRY { /* Return current priority class */ - *(PUSHORT)ProcessInformation = Process->PriorityClass; + PsPriorityClass->PriorityClass = Process->PriorityClass; + PsPriorityClass->Foreground = FALSE; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
15 years, 5 months
1
0
0
0
← Newer
1
...
33
34
35
36
37
38
39
...
50
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Results per page:
10
25
50
100
200