ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
June 2010
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
24 participants
407 discussions
Start a n
N
ew thread
[janderwald] 47512: [NPFS] - Check if MmGetSystemAddressForMdlSafe failed
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Jun 1 11:52:16 2010 New Revision: 47512 URL:
http://svn.reactos.org/svn/reactos?rev=47512&view=rev
Log: [NPFS] - Check if MmGetSystemAddressForMdlSafe failed Modified: trunk/reactos/drivers/filesystems/npfs/rw.c Modified: trunk/reactos/drivers/filesystems/npfs/rw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/r…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/rw.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/rw.c [iso-8859-1] Tue Jun 1 11:52:16 2010 @@ -781,7 +781,16 @@ } Status = STATUS_SUCCESS; - Buffer = MmGetSystemAddressForMdl (Irp->MdlAddress); + Buffer = MmGetSystemAddressForMdlSafe (Irp->MdlAddress, NormalPagePriority); + + if (!Buffer) + { + DPRINT("MmGetSystemAddressForMdlSafe failed\n"); + Status = STATUS_INSUFFICIENT_RESOURCES; + Length = 0; + goto done; + + } ExAcquireFastMutex(&ReaderCcb->DataListLock);
14 years, 6 months
1
0
0
0
[gadamopoulos] 47511: [rbuild] msvc backend: - Start implementing real support for vcxproj files - Fix generating sln files - Move msvc rules in a separate folder - Various fixes
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Tue Jun 1 11:31:24 2010 New Revision: 47511 URL:
http://svn.reactos.org/svn/reactos?rev=47511&view=rev
Log: [rbuild] msvc backend: - Start implementing real support for vcxproj files - Fix generating sln files - Move msvc rules in a separate folder - Various fixes Added: trunk/reactos/tools/rbuild/backend/msvc/propsmaker.cpp (with props) trunk/reactos/tools/rbuild/backend/msvc/rules/ (with props) trunk/reactos/tools/rbuild/backend/msvc/rules/reactos.defaults.props trunk/reactos/tools/rbuild/backend/msvc/rules/reactos.targets trunk/reactos/tools/rbuild/backend/msvc/rules/s_as_mscpp.props trunk/reactos/tools/rbuild/backend/msvc/rules/s_as_mscpp.rules - copied unchanged from r46847, trunk/reactos/tools/rbuild/backend/msvc/s_as_mscpp.rules trunk/reactos/tools/rbuild/backend/msvc/rules/s_as_mscpp.targets trunk/reactos/tools/rbuild/backend/msvc/rules/s_as_mscpp.xml (with props) trunk/reactos/tools/rbuild/backend/msvc/rules/spec.props trunk/reactos/tools/rbuild/backend/msvc/rules/spec.rules - copied unchanged from r46847, trunk/reactos/tools/rbuild/backend/msvc/spec.rules trunk/reactos/tools/rbuild/backend/msvc/rules/spec.targets trunk/reactos/tools/rbuild/backend/msvc/rules/spec.xml (with props) Removed: trunk/reactos/tools/rbuild/backend/msvc/s_as_mscpp.rules trunk/reactos/tools/rbuild/backend/msvc/spec.rules Modified: trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp trunk/reactos/tools/rbuild/backend/msvc/msvc.h trunk/reactos/tools/rbuild/backend/msvc/projmaker.cpp trunk/reactos/tools/rbuild/backend/msvc/slnmaker.cpp trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp trunk/reactos/tools/rbuild/backend/msvc/vcxprojmaker.cpp trunk/reactos/tools/rbuild/backend/msvc/vspropsmaker.cpp trunk/reactos/tools/rbuild/module.cpp trunk/reactos/tools/rbuild/rbuild.h trunk/reactos/tools/rbuild/rbuild.mak Modified: trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/msvc/msvc.cpp [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -83,8 +83,6 @@ void MSVCBackend::Process() { - bool only_msvc_headers = false; - while ( m_configurations.size () > 0 ) { const MSVCConfiguration* cfg = m_configurations.back(); @@ -92,17 +90,17 @@ delete cfg; } - m_configurations.push_back ( new MSVCConfiguration( Debug )); - m_configurations.push_back ( new MSVCConfiguration( Release )); -// m_configurations.push_back ( new MSVCConfiguration( Speed )); + //Don't generate configurations that require WDK if it can't be found + if(getenv ( "BASEDIR" ) != NULL) + { + m_configurations.push_back ( new MSVCConfiguration( Debug )); + m_configurations.push_back ( new MSVCConfiguration( Release )); + } m_configurations.push_back ( new MSVCConfiguration( RosBuild )); - - if (!only_msvc_headers) - { - m_configurations.push_back ( new MSVCConfiguration( Debug, ReactOSHeaders )); - m_configurations.push_back ( new MSVCConfiguration( Release, ReactOSHeaders )); -// m_configurations.push_back ( new MSVCConfiguration( Speed, ReactOSHeaders )); - } + m_configurations.push_back ( new MSVCConfiguration( Debug, ReactOSHeaders )); + m_configurations.push_back ( new MSVCConfiguration( Release, ReactOSHeaders )); + // m_configurations.push_back ( new MSVCConfiguration( Speed )); + // m_configurations.push_back ( new MSVCConfiguration( Speed, ReactOSHeaders )); if ( configuration.CleanAsYouGo ) { _clean_project_files(); @@ -117,34 +115,45 @@ filename_sln += "_auto.sln"; printf ( "Creating MSVC workspace: %s\n", filename_sln.c_str() ); - //Write a property page for each configuration - for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) - { - MSVCConfiguration* cfg = m_configurations[icfg]; - - //RosBuild doesn't need a property page - if(cfg->optimization == RosBuild) - continue; - - string filename_props( cfg->name ); - filename_props += ".vsprops"; - //Write the propery pages files - PropsMaker propsMaker( configuration, &ProjectNode, filename_props, cfg ); + if (configuration.VSProjectVersion == "10.00") + { + PropsMaker propsMaker( &ProjectNode, "reactos.props", m_configurations ); propsMaker._generate_props( _get_solution_version(), _get_studio_version() ); } - + else + { + //Write a property page for each configuration + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + MSVCConfiguration* cfg = m_configurations[icfg]; + + //RosBuild doesn't need a property page + if(cfg->optimization == RosBuild) + continue; + + //Write the propery pages files + string filename_props( cfg->name ); + + filename_props = filename_props + ".vsprops"; + VSPropsMaker propsMaker( configuration, &ProjectNode, filename_props, cfg ); + propsMaker._generate_props( _get_solution_version(), _get_studio_version() ); + } + } // Write out the project files ProcessModules(); + printf ( "Done.\n" ); +} + +void MSVCBackend::ProcessModules() +{ + string filename_sln ( ProjectNode.name ); + + filename_sln += "_auto.sln"; + // Write the solution file - SlnMaker slnMaker( configuration, ProjectNode, m_configurations, filename_sln ); - slnMaker._generate_sln ( _get_solution_version(), _get_studio_version() ); - - printf ( "Done.\n" ); -} - -void MSVCBackend::ProcessModules() -{ + SlnMaker slnMaker( configuration, m_configurations, filename_sln, _get_solution_version(), _get_studio_version() ); + for(std::map<std::string, Module*>::const_iterator p = ProjectNode.modules.begin(); p != ProjectNode.modules.end(); ++ p) { Module &module = *p->second; @@ -156,17 +165,21 @@ if (configuration.VSProjectVersion == "10.00") { string vcxproj_file = VcxprojFileName(module); - projMaker = new VCXProjMaker( configuration, m_configurations, vcxproj_file ); + projMaker = new VCXProjMaker( configuration, m_configurations, vcxproj_file, module ); } else { string vcproj_file = VcprojFileName(module); - projMaker = new VCProjMaker( configuration, m_configurations, vcproj_file ); + projMaker = new VCProjMaker( configuration, m_configurations, vcproj_file, module ); } projMaker->_generate_proj_file ( module ); + + slnMaker._add_project(*projMaker, module); + delete projMaker; } + } static bool FileExists(string &filename) @@ -260,6 +273,25 @@ m_devFile << m_folders[i]; } #endif +} + +std::string +MSVCBackend::UserFileName ( const Module& module, std::string vcproj_file ) const +{ + string computername; + string username; + + if (getenv ( "USERNAME" ) != NULL) + username = getenv ( "USERNAME" ); + if (getenv ( "COMPUTERNAME" ) != NULL) + computername = getenv ( "COMPUTERNAME" ); + else if (getenv ( "HOSTNAME" ) != NULL) + computername = getenv ( "HOSTNAME" ); + + if ((computername != "") && (username != "")) + return vcproj_file + "." + computername + "." + username + ".user"; + else + return ""; } std::string @@ -416,25 +448,10 @@ vector<string> out; printf("Cleaning project %s %s %s\n", module.name.c_str (), module.output->relative_path.c_str (), NcbFileName ( module ).c_str () ); - string basepath = module.output->relative_path; - remove ( NcbFileName ( module ).c_str () ); - remove ( SlnFileName ( module ).c_str () ); - remove ( SuoFileName ( module ).c_str () ); - - if ( configuration.VSProjectVersion == "10.00" ) - remove ( VcxprojFileName ( module ).c_str () ); - else - remove ( VcprojFileName ( module ).c_str () ); - - string username = getenv ( "USERNAME" ); - string computername = getenv ( "COMPUTERNAME" ); - string vcproj_file_user = ""; -#if 0 - if ((computername != "") && (username != "")) - vcproj_file_user = VcprojFileName ( module ) + "." + computername + "." + username + ".user"; - - remove ( vcproj_file_user.c_str () ); -#endif + string vcproj_file_user = UserFileName(module, VcprojFileName ( module )); + if(vcproj_file_user != "") + remove ( vcproj_file_user.c_str () ); + _get_object_files ( module, out ); _get_def_files ( module, out ); for ( size_t j = 0; j < out.size (); j++) Modified: trunk/reactos/tools/rbuild/backend/msvc/msvc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/msvc.h [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/msvc/msvc.h [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -106,6 +106,7 @@ std::string VcxprojFileName ( const Module& module ) const; std::string SlnFileName ( const Module& module ) const; std::string SuoFileName ( const Module& module ) const; + std::string UserFileName ( const Module& module, std::string vcproj_file ) const; std::string NcbFileName ( const Module& module ) const; std::vector<MSVCConfiguration*> m_configurations; @@ -141,6 +142,8 @@ virtual void _generate_proj_file ( const Module& module ) = 0; virtual void _generate_user_configuration (); + std::string VcprojFileName ( const Module& module ) const; + protected: Configuration configuration; std::vector<MSVCConfiguration*> m_configurations; @@ -148,20 +151,24 @@ FILE* OUT; std::vector<std::string> header_files; + std::vector<std::string> source_files; + std::vector<std::string> resource_files; + std::vector<std::string> generated_files; + std::vector<std::string> defines; std::vector<std::string> includes; - std::vector<std::string> includes_ros; std::vector<std::string> libraries; - std::set<std::string> common_defines; + std::string baseaddr; - - std::string VcprojFileName ( const Module& module ) const; + BinaryType binaryType; + std::string _get_vc_dir ( void ) const; - std::string _strip_gcc_deffile(std::string Filename, std::string sourcedir, std::string objdir); std::string _get_solution_version ( void ); std::string _get_studio_version ( void ); std::string _replace_str( std::string string1, const std::string &find_str, const std::string &replace_str); - + std::string _get_file_path( FileLocation* file, std::string relative_path); + + void _collect_files(const Module& module); void _generate_standard_configuration( const Module& module, const MSVCConfiguration& cfg, BinaryType binaryType ); void _generate_makefile_configuration( const Module& module, const MSVCConfiguration& cfg ); }; @@ -170,13 +177,14 @@ { public: VCProjMaker ( ); - VCProjMaker ( Configuration& buildConfig, const std::vector<MSVCConfiguration*>& msvc_configs, std::string filename ); + VCProjMaker ( Configuration& buildConfig, const std::vector<MSVCConfiguration*>& msvc_configs, std::string filename, const Module& module ); virtual ~VCProjMaker (); void _generate_proj_file ( const Module& module ); void _generate_user_configuration (); private: + void _generate_standard_configuration( const Module& module, const MSVCConfiguration& cfg, BinaryType binaryType ); void _generate_makefile_configuration( const Module& module, const MSVCConfiguration& cfg ); std::string _get_file_path( FileLocation* file, std::string relative_path); @@ -186,13 +194,15 @@ { public: VCXProjMaker ( ); - VCXProjMaker ( Configuration& buildConfig, const std::vector<MSVCConfiguration*>& msvc_configs, std::string filename ); + VCXProjMaker ( Configuration& buildConfig, const std::vector<MSVCConfiguration*>& msvc_configs, std::string filename, const Module& module ); virtual ~VCXProjMaker (); void _generate_proj_file ( const Module& module ); void _generate_user_configuration (); private: + std::string _get_configuration_type (); + void _generate_item_group (std::vector<std::string>); void _generate_standard_configuration( const Module& module, const MSVCConfiguration& cfg, BinaryType binaryType ); void _generate_makefile_configuration( const Module& module, const MSVCConfiguration& cfg ); }; @@ -200,38 +210,30 @@ class SlnMaker { public: - SlnMaker ( Configuration& buildConfig, Project& ProjectNode, const std::vector<MSVCConfiguration*>& configurations, std::string filename_sln ); + SlnMaker ( Configuration& buildConfig, const std::vector<MSVCConfiguration*>& configurations, std::string filename_sln, std::string solution_version, std::string studio_version); ~SlnMaker (); - void _generate_sln ( std::string solution_version, std::string studio_version ); - + void _add_project(ProjMaker &project, Module &module); private: Configuration m_configuration; - Project* m_ProjectNode; - std::vector<MSVCConfiguration*> m_configurations; - FILE* OUT; + std::vector<MSVCConfiguration*> m_configurations; + FILE* OUT; + std::vector<Module*> modules; void _generate_sln_header ( std::string solution_version, std::string studio_version ); void _generate_sln_footer ( ); - //void _generate_rules_file ( FILE* OUT ); - void _generate_sln_project ( - const Module& module, - std::string vcproj_file, - std::string sln_guid, - std::string vcproj_guid, - const std::vector<Library*>& libraries ); void _generate_sln_configurations ( std::string vcproj_guid ); }; -class PropsMaker -{ - public: - PropsMaker ( Configuration& buildConfig, +class VSPropsMaker +{ + public: + VSPropsMaker ( Configuration& buildConfig, Project* ProjectNode, std::string filename_props, MSVCConfiguration* msvc_configs); - ~PropsMaker (); + ~VSPropsMaker (); void _generate_props ( std::string solution_version, std::string studio_version ); @@ -253,3 +255,28 @@ void _generate_footer(); }; + + +class PropsMaker +{ + public: + PropsMaker ( Project* ProjectNode, + std::string filename_props, + std::vector<MSVCConfiguration*> configurations); + + ~PropsMaker (); + + void _generate_props ( std::string solution_version, std::string studio_version ); + + private: + Project* m_ProjectNode; + FILE* OUT; + std::vector<MSVCConfiguration*> m_configurations; + + void _generate_macro(std::string Name, std::string Value); + void _generate_global_includes(bool debug, bool use_ros_headers); + void _generate_global_definitions(bool debug, bool use_ros_headers); + void _generate_header(); + void _generate_footer(); + +}; Modified: trunk/reactos/tools/rbuild/backend/msvc/projmaker.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/projmaker.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/msvc/projmaker.cpp [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -238,3 +238,93 @@ return string1; } + + +std::string +ProjMaker::_get_file_path( FileLocation* file, std::string relative_path) +{ + if (file->directory == SourceDirectory) + { + // We want the full path here for directory support later on + return Path::RelativeFromDirectory (file->relative_path, relative_path ); + } + else if(file->directory == IntermediateDirectory) + { + return std::string("$(RootIntDir)\\") + file->relative_path; + } + else if(file->directory == OutputDirectory) + { + return std::string("$(RootOutDir)\\") + file->relative_path; + } + + return std::string(""); +} + +void +ProjMaker::_collect_files(const Module& module) +{ + size_t i; + const IfableData& data = module.non_if_data; + const vector<File*>& files = data.files; + for ( i = 0; i < files.size(); i++ ) + { + string path = _get_file_path(&files[i]->file, module.output->relative_path); + string file = path + std::string("\\") + files[i]->file.name; + + if (files[i]->file.directory != SourceDirectory) + generated_files.push_back ( file ); + else if ( !stricmp ( Right(file,3).c_str(), ".rc" ) ) + resource_files.push_back ( file ); + else if ( !stricmp ( Right(file,2).c_str(), ".h" ) ) + header_files.push_back ( file ); + else + source_files.push_back ( file ); + } + const vector<Include*>& incs = data.includes; + for ( i = 0; i < incs.size(); i++ ) + { + includes.push_back ( _get_file_path(incs[i]->directory, module.output->relative_path) ); + } + const vector<Library*>& libs = data.libraries; + for ( i = 0; i < libs.size(); i++ ) + { + string libpath = "$(RootOutDir)\\" + libs[i]->importedModule->output->relative_path + "\\" + _get_vc_dir() + "\\$(ConfigurationName)\\" + libs[i]->name + ".lib"; + libraries.push_back ( libpath ); + } + const vector<Define*>& defs = data.defines; + for ( i = 0; i < defs.size(); i++ ) + { + if ( defs[i]->backend != "" && defs[i]->backend != "msvc" ) + continue; + + if( module.isUnicode && (defs[i]->name == "UNICODE" || defs[i]->name == "_UNICODE")) + continue; + + if ( defs[i]->value != "" ) + defines.push_back( defs[i]->name + "=" + defs[i]->value ); + else + defines.push_back( defs[i]->name ); + } + for ( std::map<std::string, Property*>::const_iterator p = data.properties.begin(); p != data.properties.end(); ++ p ) + { + Property& prop = *p->second; + if ( strstr ( module.baseaddress.c_str(), prop.name.c_str() ) ) + baseaddr = prop.value; + } + + if(module.importLibrary) + { + std::string ImportLibraryPath = _get_file_path(module.importLibrary->source, module.output->relative_path); + + switch (module.IsSpecDefinitionFile()) + { + case PSpec: + generated_files.push_back("$(IntDir)\\" + ReplaceExtension(module.importLibrary->source->name,".spec")); + case Spec: + generated_files.push_back("$(IntDir)\\" + ReplaceExtension(module.importLibrary->source->name,".stubs.c")); + generated_files.push_back("$(IntDir)\\" + ReplaceExtension(module.importLibrary->source->name,".def")); + default: + source_files.push_back(ImportLibraryPath + std::string("\\") + module.importLibrary->source->name); + } + } +} Added: trunk/reactos/tools/rbuild/backend/msvc/propsmaker.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/propsmaker.cpp (added) +++ trunk/reactos/tools/rbuild/backend/msvc/propsmaker.cpp [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -1,0 +1,197 @@ +#ifdef _MSC_VER +#pragma warning ( disable : 4786 ) +#endif//_MSC_VER + +#include <string> +#include <vector> +#include <set> +#include <algorithm> +#include <fstream> +#include <iostream> + +#include <stdio.h> + +#include "msvc.h" + +using std::string; +using std::vector; +using std::set; + +typedef set<string> StringSet; + +#ifdef OUT +#undef OUT +#endif//OUT + + +PropsMaker::PropsMaker (Project* ProjectNode, + std::string filename_props, + std::vector<MSVCConfiguration*> configurations) +{ + m_ProjectNode = ProjectNode; + m_configurations = configurations; + + OUT = fopen ( filename_props.c_str(), "wb" ); + + if ( !OUT ) + { + printf ( "Could not create file '%s'.\n", filename_props.c_str() ); + } +} + +PropsMaker::~PropsMaker ( ) +{ + fclose ( OUT ); +} + +void +PropsMaker::_generate_header() +{ + fprintf ( OUT, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n"); + fprintf ( OUT, "<Project "); + fprintf ( OUT, "DefaultTargets=\"Build\" "); + fprintf ( OUT, "ToolsVersion=\"4.0\" "); + fprintf ( OUT, "xmlns=\"
http://schemas.microsoft.com/developer/msbuild/2003\
">\r\n"); +} + +void +PropsMaker::_generate_footer() +{ + fprintf ( OUT, "</Project>\r\n"); +} + +void +PropsMaker::_generate_macro(std::string Name, std::string Value) +{ + fprintf ( OUT, "\t\t<%s>%s</%s>\r\n", Name.c_str(), Value.c_str(), Name.c_str()); +} + +void +PropsMaker::_generate_global_includes(bool debug, bool use_ros_headers) +{ + fprintf ( OUT, "\t\t<globalIncludes>"); + + const IfableData& data = m_ProjectNode->non_if_data; + //const vector<File*>& files = data.files; + size_t i; + const vector<Include*>& incs = data.includes; + for ( i = 0; i < incs.size(); i++ ) + { + if ((incs[i]->directory->relative_path == "include\\crt" || + incs[i]->directory->relative_path == "include\\ddk" || + incs[i]->directory->relative_path == "include\\GL" || + incs[i]->directory->relative_path == "include\\psdk") && + ! use_ros_headers) + { + continue; + } + + if(incs[i]->directory->directory == SourceDirectory) + fprintf ( OUT, "\"$(RootSrcDir)\\"); + else if (incs[i]->directory->directory == IntermediateDirectory) + fprintf ( OUT, "\"$(RootIntDir)\\"); + else if (incs[i]->directory->directory == OutputDirectory) + fprintf ( OUT, "\"$(RootOutDir)\\"); + else + continue; + + fprintf ( OUT, incs[i]->directory->relative_path.c_str()); + fprintf ( OUT, "\" ; "); + } + + fprintf ( OUT, "\"$(RootIntDir)\\include\" ; "); + fprintf ( OUT, "\"$(RootIntDir)\\include\\reactos\" ; "); + + if ( !use_ros_headers ) + { + // Add WDK or PSDK paths, if user provides them + if (getenv ( "BASEDIR" ) != NULL) + { + string WdkBase = getenv ( "BASEDIR" ); + fprintf ( OUT, "\"%s\\inc\\api\" ; ", WdkBase.c_str()); + fprintf ( OUT, "\"%s\\inc\\crt\" ; ", WdkBase.c_str()); + fprintf ( OUT, "\"%s\\inc\\ddk\" ; ", WdkBase.c_str()); + } + } + fprintf ( OUT, "\t</globalIncludes>\r\n"); +} + +void +PropsMaker::_generate_global_definitions(bool debug, bool use_ros_headers) +{ + fprintf ( OUT, "\t\t<globalDefines>"); + + // Always add _CRT_SECURE_NO_WARNINGS to disable warnings about not + // using the safe functions introduced in MSVC8. + fprintf ( OUT, "_CRT_SECURE_NO_WARNINGS ; ") ; + + if ( debug ) + { + fprintf ( OUT, "_DEBUG ; "); + } + + if ( !use_ros_headers ) + { + // this is a define in MinGW w32api, but not Microsoft's headers + fprintf ( OUT, "STDCALL=__stdcall ; "); + } + + const IfableData& data = m_ProjectNode->non_if_data; + const vector<Define*>& defs = data.defines; + size_t i; + + for ( i = 0; i < defs.size(); i++ ) + { + if ( defs[i]->backend != "" && defs[i]->backend != "msvc" ) + continue; + + if ( defs[i]->value != "" ) + fprintf ( OUT, "%s=%s",defs[i]->name.c_str(), defs[i]->value.c_str()); + else + fprintf ( OUT, defs[i]->name.c_str()); + fprintf ( OUT, " ; "); + } + + fprintf ( OUT, "\t</globalDefines>\r\n"); +} + +void +PropsMaker::_generate_props ( std::string solution_version, std::string studio_version ) +{ + + string srcdir = Environment::GetSourcePath(); + string intdir = Environment::GetIntermediatePath (); + string outdir = Environment::GetOutputPath (); + string rosbedir = Environment::GetVariable("_ROSBE_BASEDIR"); + + if ( intdir == "obj-i386" ) + intdir = srcdir + "\\obj-i386"; /* append relative dir from project dir */ + + if ( outdir == "output-i386" ) + outdir = srcdir + "\\output-i386"; + + _generate_header(); + + fprintf ( OUT, "\t<PropertyGroup Label=\"UserMacros\">\r\n"); + _generate_macro("RootSrcDir", srcdir); + _generate_macro("RootOutDir", outdir); + _generate_macro("RootIntDir", intdir); + _generate_macro("Tools", "$(RootOutDir)\\tools"); + _generate_macro("RosBE", rosbedir); + fprintf ( OUT, "\t</PropertyGroup>\r\n"); + + for ( size_t icfg = 0; icfg < m_configurations.size(); icfg++ ) + { + MSVCConfiguration* cfg = m_configurations[icfg]; + + if(cfg->optimization == RosBuild) + continue; + + fprintf ( OUT, "\t<PropertyGroup Condition=\"'$(Configuration)'=='%s'\">\r\n", cfg->name.c_str() ); + _generate_global_includes(cfg->optimization == Debug, cfg->headers == ReactOSHeaders); + _generate_global_definitions(cfg->optimization == Debug, cfg->headers == ReactOSHeaders); + fprintf ( OUT, "\t</PropertyGroup>\r\n"); + } + + _generate_footer(); +} Propchange: trunk/reactos/tools/rbuild/backend/msvc/propsmaker.cpp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/tools/rbuild/backend/msvc/rules/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Tue Jun 1 11:31:24 2010 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/reactos/tools/rbuild/backend/msvc/rules/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/reactos/tools/rbuild/backend/msvc/rules/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/reactos/tools/rbuild/backend/msvc/rules/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/reactos/tools/rbuild/backend/msvc/rules/reactos.defaults.props URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/rules/reactos.defaults.props (added) +++ trunk/reactos/tools/rbuild/backend/msvc/rules/reactos.defaults.props [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -1,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="
http://schemas.microsoft.com/developer/msbuild/2003
"> + <Import Project=".\s_as_mscpp.props" /> + <Import Project=".\spec.props" /> + <PropertyGroup> + <IncludePath>$(globalIncludes);$(IncludePath)</IncludePath> + </PropertyGroup> + <ItemDefinitionGroup> + <ClCompile> + <AdditionalIncludeDirectories>$(globalIncludes);$(ProjectIncludes);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>$(ProjectDefines);$(globalDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions> + <IgnoreStandardIncludePath>true</IgnoreStandardIncludePath> + <CompileAs>CompileAsC</CompileAs> + <CallingConvention>Cdecl</CallingConvention> + </ClCompile> + <s_as_mscpp> + <sIncPaths>$(globalIncludes);$(ProjectIncludes)</sIncPaths> + <sPPDefs>__ASM__</sPPDefs> + </s_as_mscpp> + <Pspec> + <includes>$(globalIncludes);$(ProjectIncludes)</includes> + </Pspec> + <ResourceCompile> + <AdditionalIncludeDirectories>$(globalIncludes);$(ProjectIncludes);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + </ResourceCompile> + </ItemDefinitionGroup> +</Project> Added: trunk/reactos/tools/rbuild/backend/msvc/rules/reactos.targets URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/rules/reactos.targets (added) +++ trunk/reactos/tools/rbuild/backend/msvc/rules/reactos.targets [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -1,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="
http://schemas.microsoft.com/developer/msbuild/2003
"> + <Import Project=".\s_as_mscpp.targets" /> + <Import Project=".\spec.targets" /> +</Project> + Added: trunk/reactos/tools/rbuild/backend/msvc/rules/s_as_mscpp.props URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/rules/s_as_mscpp.props (added) +++ trunk/reactos/tools/rbuild/backend/msvc/rules/s_as_mscpp.props [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -1,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="
http://schemas.microsoft.com/developer/msbuild/2003
"> + <PropertyGroup + Condition="'$(s_as_mscppBeforeTargets)' == '' and '$(s_as_mscppAfterTargets)' == '' and '$(ConfigurationType)' != 'Makefile'"> + <s_as_mscppBeforeTargets>Midl</s_as_mscppBeforeTargets> + <s_as_mscppAfterTargets>CustomBuild</s_as_mscppAfterTargets> + </PropertyGroup> + <PropertyGroup> + <s_as_mscppDependsOn + Condition="'$(ConfigurationType)' != 'Makefile'">_SelectedFiles;$(s_as_mscppDependsOn)</s_as_mscppDependsOn> + </PropertyGroup> + <ItemDefinitionGroup> + <s_as_mscpp> + <sOutF>$(IntDir)%(Filename).obj</sOutF> + <sIncPaths>$(globalIncludes)</sIncPaths> + <CommandLineTemplate>cl /nologo /E [sIncPaths] [sPPDefs] "%(FullPath)" | "$(RosBE)\i386\bin\as" -o [sOutF]</CommandLineTemplate> + <Outputs>%(sOutF)</Outputs> + <ExecutionDescription>Assembling </ExecutionDescription> + </s_as_mscpp> + </ItemDefinitionGroup> +</Project> Added: trunk/reactos/tools/rbuild/backend/msvc/rules/s_as_mscpp.targets URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/rules/s_as_mscpp.targets (added) +++ trunk/reactos/tools/rbuild/backend/msvc/rules/s_as_mscpp.targets [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -1,0 +1,84 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="
http://schemas.microsoft.com/developer/msbuild/2003
"> + <ItemGroup> + <PropertyPageSchema + Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" /> + <AvailableItemName + Include="s_as_mscpp"> + <Targets>_s_as_mscpp</Targets> + </AvailableItemName> + </ItemGroup> + <UsingTask + TaskName="s_as_mscpp" + TaskFactory="XamlTaskFactory" + AssemblyName="Microsoft.Build.Tasks.v4.0"> + <Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task> + </UsingTask> + <Target + Name="_s_as_mscpp" + BeforeTargets="$(s_as_mscppBeforeTargets)" + AfterTargets="$(s_as_mscppAfterTargets)" + Condition="'@(s_as_mscpp)' != ''" + DependsOnTargets="$(s_as_mscppDependsOn);Computes_as_mscppOutput" + Outputs="@(s_as_mscpp->Metadata('Outputs')->Distinct())" + Inputs="@(s_as_mscpp);%(s_as_mscpp.AdditionalDependencies);$(MSBuildProjectFile)"> + <ItemGroup + Condition="'@(SelectedFiles)' != ''"> + <s_as_mscpp + Remove="@(s_as_mscpp)" + Condition="'%(Identity)' != '@(SelectedFiles)'" /> + </ItemGroup> + <ItemGroup> + <s_as_mscpp_tlog + Include="%(s_as_mscpp.Outputs)" + Condition="'%(s_as_mscpp.Outputs)' != '' and '%(s_as_mscpp.ExcludedFromBuild)' != 'true'"> + <Source>@(s_as_mscpp, '|')</Source> + </s_as_mscpp_tlog> + </ItemGroup> + <Message + Importance="High" + Text="%(s_as_mscpp.ExecutionDescription)" /> + <WriteLinesToFile + Condition="'@(s_as_mscpp_tlog)' != '' and '%(s_as_mscpp_tlog.ExcludedFromBuild)' != 'true'" + File="$(IntDir)$(ProjectName).write.1.tlog" + Lines="^%(s_as_mscpp_tlog.Source);@(s_as_mscpp_tlog->'%(Fullpath)')" /> + <s_as_mscpp + Condition="'@(s_as_mscpp)' != '' and '%(s_as_mscpp.ExcludedFromBuild)' != 'true'" + CommandLineTemplate="%(s_as_mscpp.CommandLineTemplate)" + sOutF="%(s_as_mscpp.sOutF)" + sIncPaths="%(s_as_mscpp.sIncPaths)" + sPPDefs="%(s_as_mscpp.sPPDefs)" + AdditionalOptions="%(s_as_mscpp.AdditionalOptions)" + Inputs="@(s_as_mscpp)" /> + </Target> + <PropertyGroup> + <ComputeLinkInputsTargets> + $(ComputeLinkInputsTargets); + Computes_as_mscppOutput; + </ComputeLinkInputsTargets> + <ComputeLibInputsTargets> + $(ComputeLibInputsTargets); + Computes_as_mscppOutput; + </ComputeLibInputsTargets> + </PropertyGroup> + <Target + Name="Computes_as_mscppOutput" + Condition="'@(s_as_mscpp)' != ''"> + <ItemGroup> + <s_as_mscppDirsToMake + Condition="'@(s_as_mscpp)' != '' and '%(s_as_mscpp.ExcludedFromBuild)' != 'true'" + Include="%(s_as_mscpp.Outputs)" /> + <Link + Include="%(s_as_mscppDirsToMake.Identity)" + Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" /> + <Lib + Include="%(s_as_mscppDirsToMake.Identity)" + Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" /> + <ImpLib + Include="%(s_as_mscppDirsToMake.Identity)" + Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" /> + </ItemGroup> + <MakeDir + Directories="@(s_as_mscppDirsToMake->'%(RootDir)%(Directory)')" /> + </Target> +</Project> Added: trunk/reactos/tools/rbuild/backend/msvc/rules/s_as_mscpp.xml URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/rules/s_as_mscpp.xml (added) +++ trunk/reactos/tools/rbuild/backend/msvc/rules/s_as_mscpp.xml [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -1,0 +1,145 @@ +<?xml version="1.0" encoding="utf-8"?> +<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework" xmlns:x="
http://schemas.microsoft.com/winfx/2006/xaml
" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:transformCallback="Microsoft.Cpp.Dev10.ConvertPropertyCallback"> + <Rule + Name="s_as_mscpp" + PageTemplate="tool" + DisplayName="s (gnu_as mscpp)" + Order="200"> + <Rule.DataSource> + <DataSource + Persistence="ProjectFile" + ItemType="s_as_mscpp" /> + </Rule.DataSource> + <Rule.Categories> + <Category + Name="General"> + <Category.DisplayName> + <sys:String>General</sys:String> + </Category.DisplayName> + </Category> + <Category + Name="Command Line" + Subtype="CommandLine"> + <Category.DisplayName> + <sys:String>Command Line</sys:String> + </Category.DisplayName> + </Category> + </Rule.Categories> + <StringListProperty + Name="Inputs" + Category="Command Line" + IsRequired="true" + Switch=" "> + <StringListProperty.DataSource> + <DataSource + Persistence="ProjectFile" + ItemType="s_as_mscpp" + SourceType="Item" /> + </StringListProperty.DataSource> + </StringListProperty> + <StringProperty + Name="sOutF" + HelpContext="0" + DisplayName="Obj File" + Description="Obj File (-o [file])" + Switch=""[value]"" /> + <StringListProperty + Name="sIncPaths" + HelpContext="0" + DisplayName="Inc Paths" + Description="Include serach paths (/I [path])" + Switch="/I "[value]"" /> + <StringListProperty + Name="sPPDefs" + HelpContext="0" + DisplayName="Preproc Defs" + Description="Preprocessor Definitions (/D [symbol])" + Switch="/D "[value]"" /> + <StringProperty + Name="CommandLineTemplate" + DisplayName="Command Line" + Visible="False" + IncludeInCommandLine="False" /> + <DynamicEnumProperty + Name="s_as_mscppBeforeTargets" + Category="General" + EnumProvider="Targets" + IncludeInCommandLine="False"> + <DynamicEnumProperty.DisplayName> + <sys:String>Execute Before</sys:String> + </DynamicEnumProperty.DisplayName> + <DynamicEnumProperty.Description> + <sys:String>Specifies the targets for the build customization to run before.</sys:String> + </DynamicEnumProperty.Description> + <DynamicEnumProperty.ProviderSettings> + <NameValuePair + Name="Exclude" + Value="^s_as_mscppBeforeTargets|^Compute" /> + </DynamicEnumProperty.ProviderSettings> + <DynamicEnumProperty.DataSource> + <DataSource + Persistence="ProjectFile" + HasConfigurationCondition="true" /> + </DynamicEnumProperty.DataSource> + </DynamicEnumProperty> + <DynamicEnumProperty + Name="s_as_mscppAfterTargets" + Category="General" + EnumProvider="Targets" + IncludeInCommandLine="False"> + <DynamicEnumProperty.DisplayName> + <sys:String>Execute After</sys:String> + </DynamicEnumProperty.DisplayName> + <DynamicEnumProperty.Description> + <sys:String>Specifies the targets for the build customization to run after.</sys:String> + </DynamicEnumProperty.Description> + <DynamicEnumProperty.ProviderSettings> + <NameValuePair + Name="Exclude" + Value="^s_as_mscppAfterTargets|^Compute" /> + </DynamicEnumProperty.ProviderSettings> + <DynamicEnumProperty.DataSource> + <DataSource + Persistence="ProjectFile" + ItemType="" + HasConfigurationCondition="true" /> + </DynamicEnumProperty.DataSource> + </DynamicEnumProperty> + <StringListProperty + Name="Outputs" + DisplayName="Outputs" + Visible="False" + IncludeInCommandLine="False" /> + <StringProperty + Name="ExecutionDescription" + DisplayName="Execution Description" + Visible="False" + IncludeInCommandLine="False" /> + <StringListProperty + Name="AdditionalDependencies" + DisplayName="Additional Dependencies" + IncludeInCommandLine="False" + Visible="false" /> + <StringProperty + Subtype="AdditionalOptions" + Name="AdditionalOptions" + Category="Command Line"> + <StringProperty.DisplayName> + <sys:String>Additional Options</sys:String> + </StringProperty.DisplayName> + <StringProperty.Description> + <sys:String>Additional Options</sys:String> + </StringProperty.Description> + </StringProperty> + </Rule> + <ItemType + Name="s_as_mscpp" + DisplayName="s (gnu_as mscpp)" /> + <FileExtension + Name="*.s" + ContentType="s_as_mscpp" /> + <ContentType + Name="s_as_mscpp" + DisplayName="s (gnu_as mscpp)" + ItemType="s_as_mscpp" /> +</ProjectSchemaDefinitions> Propchange: trunk/reactos/tools/rbuild/backend/msvc/rules/s_as_mscpp.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/tools/rbuild/backend/msvc/rules/spec.props URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/rules/spec.props (added) +++ trunk/reactos/tools/rbuild/backend/msvc/rules/spec.props [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -1,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="
http://schemas.microsoft.com/developer/msbuild/2003
"> + <PropertyGroup + Condition="'$(specBeforeTargets)' == '' and '$(specAfterTargets)' == '' and '$(ConfigurationType)' != 'Makefile'"> + <specBeforeTargets>Midl</specBeforeTargets> + <specAfterTargets>Pspec</specAfterTargets> + </PropertyGroup> + <PropertyGroup> + <specDependsOn + Condition="'$(ConfigurationType)' != 'Makefile'">_SelectedFiles;$(specDependsOn)</specDependsOn> + </PropertyGroup> + <ItemDefinitionGroup> + <spec> + <DefFile>$(IntDir)%(Filename).def</DefFile> + <StubsFile>$(IntDir)%(Filename).stubs.c</StubsFile> + <CommandLineTemplate>"$(Tools)\winebuild\winebuild.exe" -F $(TargetFileName) -o [DefFile] --def -k -E [inputs] | "$(Tools)\winebuild\winebuild.exe" -F $(TargetFileName) -o [StubsFile] --pedll -k -E [inputs]</CommandLineTemplate> + <Outputs>[DefFile]</Outputs> + <ExecutionDescription>Generating module definition file</ExecutionDescription> + </spec> + </ItemDefinitionGroup> + <PropertyGroup + Condition="'$(PspecBeforeTargets)' == '' and '$(PspecAfterTargets)' == '' and '$(ConfigurationType)' != 'Makefile'"> + <PspecBeforeTargets>spec</PspecBeforeTargets> + <PspecAfterTargets>CustomBuild</PspecAfterTargets> + </PropertyGroup> + <PropertyGroup> + <PspecDependsOn + Condition="'$(ConfigurationType)' != 'Makefile'">_SelectedFiles;$(PspecDependsOn)</PspecDependsOn> + </PropertyGroup> + <ItemDefinitionGroup> + <Pspec> + <Specfile>$(IntDir)%(Filename).spec</Specfile> + <CommandLineTemplate>cl /nologo /EP [includes] [inputs] > [Specfile]</CommandLineTemplate> + <Outputs>[Specfile]</Outputs> + <ExecutionDescription>Generating module definition file</ExecutionDescription> + </Pspec> + </ItemDefinitionGroup> +</Project> Added: trunk/reactos/tools/rbuild/backend/msvc/rules/spec.targets URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/rules/spec.targets (added) +++ trunk/reactos/tools/rbuild/backend/msvc/rules/spec.targets [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -1,0 +1,159 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="
http://schemas.microsoft.com/developer/msbuild/2003
"> + <ItemGroup> + <PropertyPageSchema + Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" /> + <AvailableItemName + Include="spec"> + <Targets>_spec</Targets> + </AvailableItemName> + <AvailableItemName + Include="Pspec"> + <Targets>_Pspec</Targets> + </AvailableItemName> + </ItemGroup> + <UsingTask + TaskName="spec" + TaskFactory="XamlTaskFactory" + AssemblyName="Microsoft.Build.Tasks.v4.0"> + <Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task> + </UsingTask> + <UsingTask + TaskName="Pspec" + TaskFactory="XamlTaskFactory" + AssemblyName="Microsoft.Build.Tasks.v4.0"> + <Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task> + </UsingTask> + <Target + Name="_spec" + BeforeTargets="$(specBeforeTargets)" + AfterTargets="$(specAfterTargets)" + Condition="'@(spec)' != ''" + DependsOnTargets="$(specDependsOn);ComputespecOutput" + Outputs="@(spec->Metadata('Outputs')->Distinct())" + Inputs="@(spec);%(spec.AdditionalDependencies);$(MSBuildProjectFile)"> + <ItemGroup + Condition="'@(SelectedFiles)' != ''"> + <spec + Remove="@(spec)" + Condition="'%(Identity)' != '@(SelectedFiles)'" /> + </ItemGroup> + <ItemGroup> + <spec_tlog + Include="%(spec.Outputs)" + Condition="'%(spec.Outputs)' != '' and '%(spec.ExcludedFromBuild)' != 'true'"> + <Source>@(spec, '|')</Source> + </spec_tlog> + </ItemGroup> + <Message + Importance="High" + Text="%(spec.ExecutionDescription)" /> + <WriteLinesToFile + Condition="'@(spec_tlog)' != '' and '%(spec_tlog.ExcludedFromBuild)' != 'true'" + File="$(IntDir)$(ProjectName).write.1.tlog" + Lines="^%(spec_tlog.Source);@(spec_tlog->'%(Fullpath)')" /> + <spec + Condition="'@(spec)' != '' and '%(spec.ExcludedFromBuild)' != 'true'" + CommandLineTemplate="%(spec.CommandLineTemplate)" + DefFile="%(spec.DefFile)" + StubsFile="%(spec.StubsFile)" + AdditionalOptions="%(spec.AdditionalOptions)" + Inputs="@(spec)" /> + </Target> + <PropertyGroup> + <ComputeLinkInputsTargets> + $(ComputeLinkInputsTargets); + ComputespecOutput; + </ComputeLinkInputsTargets> + <ComputeLibInputsTargets> + $(ComputeLibInputsTargets); + ComputespecOutput; + </ComputeLibInputsTargets> + </PropertyGroup> + <Target + Name="ComputespecOutput" + Condition="'@(spec)' != ''"> + <ItemGroup> + <specDirsToMake + Condition="'@(spec)' != '' and '%(spec.ExcludedFromBuild)' != 'true'" + Include="%(spec.Outputs)" /> + <Link + Include="%(specDirsToMake.Identity)" + Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" /> + <Lib + Include="%(specDirsToMake.Identity)" + Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" /> + <ImpLib + Include="%(specDirsToMake.Identity)" + Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" /> + </ItemGroup> + <MakeDir + Directories="@(specDirsToMake->'%(RootDir)%(Directory)')" /> + </Target> + <Target + Name="_Pspec" + BeforeTargets="$(PspecBeforeTargets)" + AfterTargets="$(PspecAfterTargets)" + Condition="'@(Pspec)' != ''" + DependsOnTargets="$(PspecDependsOn);ComputePspecOutput" + Outputs="@(Pspec->Metadata('Outputs')->Distinct())" + Inputs="@(Pspec);%(Pspec.AdditionalDependencies);$(MSBuildProjectFile)"> + <ItemGroup + Condition="'@(SelectedFiles)' != ''"> + <Pspec + Remove="@(Pspec)" + Condition="'%(Identity)' != '@(SelectedFiles)'" /> + </ItemGroup> + <ItemGroup> + <Pspec_tlog + Include="%(Pspec.Outputs)" + Condition="'%(Pspec.Outputs)' != '' and '%(Pspec.ExcludedFromBuild)' != 'true'"> + <Source>@(Pspec, '|')</Source> + </Pspec_tlog> + </ItemGroup> + <Message + Importance="High" + Text="%(Pspec.ExecutionDescription)" /> + <WriteLinesToFile + Condition="'@(Pspec_tlog)' != '' and '%(Pspec_tlog.ExcludedFromBuild)' != 'true'" + File="$(IntDir)$(ProjectName).write.1.tlog" + Lines="^%(Pspec_tlog.Source);@(Pspec_tlog->'%(Fullpath)')" /> + <Pspec + Condition="'@(Pspec)' != '' and '%(Pspec.ExcludedFromBuild)' != 'true'" + CommandLineTemplate="%(Pspec.CommandLineTemplate)" + includes="%(Pspec.includes)" + Specfile="%(Pspec.Specfile)" + AdditionalOptions="%(Pspec.AdditionalOptions)" + Inputs="@(Pspec)" /> + </Target> + <PropertyGroup> + <ComputeLinkInputsTargets> + $(ComputeLinkInputsTargets); + ComputePspecOutput; + </ComputeLinkInputsTargets> + <ComputeLibInputsTargets> + $(ComputeLibInputsTargets); + ComputePspecOutput; + </ComputeLibInputsTargets> + </PropertyGroup> + <Target + Name="ComputePspecOutput" + Condition="'@(Pspec)' != ''"> + <ItemGroup> + <PspecDirsToMake + Condition="'@(Pspec)' != '' and '%(Pspec.ExcludedFromBuild)' != 'true'" + Include="%(Pspec.Outputs)" /> + <Link + Include="%(PspecDirsToMake.Identity)" + Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" /> + <Lib + Include="%(PspecDirsToMake.Identity)" + Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" /> + <ImpLib + Include="%(PspecDirsToMake.Identity)" + Condition="'%(Extension)'=='.obj' or '%(Extension)'=='.res' or '%(Extension)'=='.rsc' or '%(Extension)'=='.lib'" /> + </ItemGroup> + <MakeDir + Directories="@(PspecDirsToMake->'%(RootDir)%(Directory)')" /> + </Target> +</Project> Added: trunk/reactos/tools/rbuild/backend/msvc/rules/spec.xml URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/rules/spec.xml (added) +++ trunk/reactos/tools/rbuild/backend/msvc/rules/spec.xml [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -1,0 +1,274 @@ +<?xml version="1.0" encoding="utf-8"?> +<ProjectSchemaDefinitions xmlns="clr-namespace:Microsoft.Build.Framework.XamlTypes;assembly=Microsoft.Build.Framework" xmlns:x="
http://schemas.microsoft.com/winfx/2006/xaml
" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:transformCallback="Microsoft.Cpp.Dev10.ConvertPropertyCallback"> + <Rule + Name="spec" + PageTemplate="tool" + DisplayName="Spec" + Order="200"> + <Rule.DataSource> + <DataSource + Persistence="ProjectFile" + ItemType="spec" /> + </Rule.DataSource> + <Rule.Categories> + <Category + Name="General"> + <Category.DisplayName> + <sys:String>General</sys:String> + </Category.DisplayName> + </Category> + <Category + Name="Command Line" + Subtype="CommandLine"> + <Category.DisplayName> + <sys:String>Command Line</sys:String> + </Category.DisplayName> + </Category> + </Rule.Categories> + <StringListProperty + Name="Inputs" + Category="Command Line" + IsRequired="true" + Switch=" "> + <StringListProperty.DataSource> + <DataSource + Persistence="ProjectFile" + ItemType="spec" + SourceType="Item" /> + </StringListProperty.DataSource> + </StringListProperty> + <StringProperty + Name="DefFile" + HelpContext="0" + DisplayName="DefFile" + Description="The path of the def file" + Switch=""[value]"" /> + <StringProperty + Name="StubsFile" + HelpContext="0" + DisplayName="StubsFile" + Description="The path of the spec file" + Switch=""[value]"" /> + <StringProperty + Name="CommandLineTemplate" + DisplayName="Command Line" + Visible="False" + IncludeInCommandLine="False" /> + <DynamicEnumProperty + Name="specBeforeTargets" + Category="General" + EnumProvider="Targets" + IncludeInCommandLine="False"> + <DynamicEnumProperty.DisplayName> + <sys:String>Execute Before</sys:String> + </DynamicEnumProperty.DisplayName> + <DynamicEnumProperty.Description> + <sys:String>Specifies the targets for the build customization to run before.</sys:String> + </DynamicEnumProperty.Description> + <DynamicEnumProperty.ProviderSettings> + <NameValuePair + Name="Exclude" + Value="^specBeforeTargets|^Compute" /> + </DynamicEnumProperty.ProviderSettings> + <DynamicEnumProperty.DataSource> + <DataSource + Persistence="ProjectFile" + HasConfigurationCondition="true" /> + </DynamicEnumProperty.DataSource> + </DynamicEnumProperty> + <DynamicEnumProperty + Name="specAfterTargets" + Category="General" + EnumProvider="Targets" + IncludeInCommandLine="False"> + <DynamicEnumProperty.DisplayName> + <sys:String>Execute After</sys:String> + </DynamicEnumProperty.DisplayName> + <DynamicEnumProperty.Description> + <sys:String>Specifies the targets for the build customization to run after.</sys:String> + </DynamicEnumProperty.Description> + <DynamicEnumProperty.ProviderSettings> + <NameValuePair + Name="Exclude" + Value="^specAfterTargets|^Compute" /> + </DynamicEnumProperty.ProviderSettings> + <DynamicEnumProperty.DataSource> + <DataSource + Persistence="ProjectFile" + ItemType="" + HasConfigurationCondition="true" /> + </DynamicEnumProperty.DataSource> + </DynamicEnumProperty> + <StringListProperty + Name="Outputs" + DisplayName="Outputs" + Visible="False" + IncludeInCommandLine="False" /> + <StringProperty + Name="ExecutionDescription" + DisplayName="Execution Description" + Visible="False" + IncludeInCommandLine="False" /> + <StringListProperty + Name="AdditionalDependencies" + DisplayName="Additional Dependencies" + IncludeInCommandLine="False" + Visible="false" /> + <StringProperty + Subtype="AdditionalOptions" + Name="AdditionalOptions" + Category="Command Line"> + <StringProperty.DisplayName> + <sys:String>Additional Options</sys:String> + </StringProperty.DisplayName> + <StringProperty.Description> + <sys:String>Additional Options</sys:String> + </StringProperty.Description> + </StringProperty> + </Rule> + <ItemType + Name="spec" + DisplayName="Spec" /> + <FileExtension + Name="*.spec" + ContentType="spec" /> + <ContentType + Name="spec" + DisplayName="Spec" + ItemType="spec" /> + <Rule + Name="Pspec" + PageTemplate="tool" + DisplayName="pspec" + Order="200"> + <Rule.DataSource> + <DataSource + Persistence="ProjectFile" + ItemType="Pspec" /> + </Rule.DataSource> + <Rule.Categories> + <Category + Name="General"> + <Category.DisplayName> + <sys:String>General</sys:String> + </Category.DisplayName> + </Category> + <Category + Name="Command Line" + Subtype="CommandLine"> + <Category.DisplayName> + <sys:String>Command Line</sys:String> + </Category.DisplayName> + </Category> + </Rule.Categories> + <StringListProperty + Name="Inputs" + Category="Command Line" + IsRequired="true" + Switch=" "> + <StringListProperty.DataSource> + <DataSource + Persistence="ProjectFile" + ItemType="Pspec" + SourceType="Item" /> + </StringListProperty.DataSource> + </StringListProperty> + <StringListProperty + Name="includes" + HelpContext="0" + DisplayName="includes" + Switch="/I "[value]"" /> + <StringProperty + Name="Specfile" + HelpContext="0" + DisplayName="Spec file" + Description="Spec file" + Switch=""[value]"" /> + <StringProperty + Name="CommandLineTemplate" + DisplayName="Command Line" + Visible="False" + IncludeInCommandLine="False" /> + <DynamicEnumProperty + Name="PspecBeforeTargets" + Category="General" + EnumProvider="Targets" + IncludeInCommandLine="False"> + <DynamicEnumProperty.DisplayName> + <sys:String>Execute Before</sys:String> + </DynamicEnumProperty.DisplayName> + <DynamicEnumProperty.Description> + <sys:String>Specifies the targets for the build customization to run before.</sys:String> + </DynamicEnumProperty.Description> + <DynamicEnumProperty.ProviderSettings> + <NameValuePair + Name="Exclude" + Value="^PspecBeforeTargets|^Compute" /> + </DynamicEnumProperty.ProviderSettings> + <DynamicEnumProperty.DataSource> + <DataSource + Persistence="ProjectFile" + HasConfigurationCondition="true" /> + </DynamicEnumProperty.DataSource> + </DynamicEnumProperty> + <DynamicEnumProperty + Name="PspecAfterTargets" + Category="General" + EnumProvider="Targets" + IncludeInCommandLine="False"> + <DynamicEnumProperty.DisplayName> + <sys:String>Execute After</sys:String> + </DynamicEnumProperty.DisplayName> + <DynamicEnumProperty.Description> + <sys:String>Specifies the targets for the build customization to run after.</sys:String> + </DynamicEnumProperty.Description> + <DynamicEnumProperty.ProviderSettings> + <NameValuePair + Name="Exclude" + Value="^PspecAfterTargets|^Compute" /> + </DynamicEnumProperty.ProviderSettings> + <DynamicEnumProperty.DataSource> + <DataSource + Persistence="ProjectFile" + ItemType="" + HasConfigurationCondition="true" /> + </DynamicEnumProperty.DataSource> + </DynamicEnumProperty> + <StringListProperty + Name="Outputs" + DisplayName="Outputs" + Visible="False" + IncludeInCommandLine="False" /> + <StringProperty + Name="ExecutionDescription" + DisplayName="Execution Description" + Visible="False" + IncludeInCommandLine="False" /> + <StringListProperty + Name="AdditionalDependencies" + DisplayName="Additional Dependencies" + IncludeInCommandLine="False" + Visible="false" /> + <StringProperty + Subtype="AdditionalOptions" + Name="AdditionalOptions" + Category="Command Line"> + <StringProperty.DisplayName> + <sys:String>Additional Options</sys:String> + </StringProperty.DisplayName> + <StringProperty.Description> + <sys:String>Additional Options</sys:String> + </StringProperty.Description> + </StringProperty> + </Rule> + <ItemType + Name="Pspec" + DisplayName="pspec" /> + <FileExtension + Name="*.pspec" + ContentType="Pspec" /> + <ContentType + Name="Pspec" + DisplayName="pspec" + ItemType="Pspec" /> +</ProjectSchemaDefinitions> Propchange: trunk/reactos/tools/rbuild/backend/msvc/rules/spec.xml ------------------------------------------------------------------------------ svn:eol-style = native Removed: trunk/reactos/tools/rbuild/backend/msvc/s_as_mscpp.rules URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/s_as_mscpp.rules [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/msvc/s_as_mscpp.rules (removed) @@ -1,44 +1,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<VisualStudioToolFile - Name="s as (gnu_as mscpp)" - Version="8,00" - > - <Rules> - <CustomBuildRule - Name="s_as_mscpp" - DisplayName="s (gnu_as mscpp)" - CommandLine="cl /nologo /E [sIncPaths] [sPPDefs] "$(InputPath)" | "$(RosBE)\i386\bin\as" -o [sOutF]" - Outputs="[$sOutF]" - FileExtensions="*.s" - ExecutionDescription="Assembling " - > - <Properties> - <StringProperty - Name="sOutF" - DisplayName="Obj File" - Description="Obj File (-o [file])" - Switch=""[value]"" - DefaultValue="$(IntDir)\$(InputName).obj" - /> - <StringProperty - Name="sIncPaths" - DisplayName="Inc Paths" - Description="Include serach paths (/I [path])" - Switch="/I "[value]"" - DefaultValue="$(globalIncludes)" - Delimited="true" - Inheritable="true" - /> - <StringProperty - Name="sPPDefs" - DisplayName="Preproc Defs" - Description="Preprocessor Definitions (/D [symbol])" - Switch="/D "[value]"" - Delimited="true" - Inheritable="true" - /> - </Properties> - </CustomBuildRule> - </Rules> -</VisualStudioToolFile> - Modified: trunk/reactos/tools/rbuild/backend/msvc/slnmaker.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/slnmaker.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/msvc/slnmaker.cpp [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -42,12 +42,12 @@ SlnMaker::SlnMaker ( Configuration& buildConfig, - Project& ProjectNode, const std::vector<MSVCConfiguration*>& configurations, - std::string filename_sln ) + std::string filename_sln, + std::string solution_version, + std::string studio_version) { m_configuration = buildConfig; - m_ProjectNode = &ProjectNode; m_configurations = configurations; OUT = fopen ( filename_sln.c_str(), "wb" ); @@ -56,10 +56,13 @@ { printf ( "Could not create file '%s'.\n", filename_sln.c_str() ); } + + _generate_sln_header( solution_version, studio_version); } SlnMaker::~SlnMaker() { + _generate_sln_footer ( ); fclose ( OUT ); } @@ -73,35 +76,6 @@ fprintf ( OUT, "\r\n" ); } - -void -SlnMaker::_generate_sln_project ( - const Module& module, - std::string vcproj_file, - std::string sln_guid, - std::string vcproj_guid, - const std::vector<Library*>& libraries ) -{ - vcproj_file = DosSeparator ( std::string(".\\") + vcproj_file ); - - fprintf ( OUT, "Project(\"%s\") = \"%s\", \"%s\", \"%s\"\r\n", sln_guid.c_str() , module.name.c_str(), vcproj_file.c_str(), vcproj_guid.c_str() ); -/* - //FIXME: only omit ProjectDependencies in VS 2005 when there are no dependencies - //NOTE: VS 2002 do not use ProjectSection; it uses GlobalSection instead - if ((configuration.VSProjectVersion == "7.10") || (libraries.size() > 0)) { - fprintf ( OUT, "\tProjectSection(ProjectDependencies) = postProject\r\n" ); - for ( size_t i = 0; i < libraries.size(); i++ ) - { - const Module& module = *libraries[i]->importedModule; - fprintf ( OUT, "\t\t%s = %s\r\n", module.guid.c_str(), module.guid.c_str() ); - } - fprintf ( OUT, "\tEndProjectSection\r\n" ); - } -*/ - fprintf ( OUT, "EndProject\r\n" ); -} - - void SlnMaker::_generate_sln_footer ( ) { @@ -112,11 +86,9 @@ fprintf ( OUT, "\tEndGlobalSection\r\n" ); fprintf ( OUT, "\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\r\n" ); - for( std::map<std::string, Module*>::const_iterator p = m_ProjectNode->modules.begin(); p != m_ProjectNode->modules.end(); ++ p ) + for ( size_t i = 0; i < modules.size (); i++) { - Module& module = *p->second; - std::string guid = module.guid; - _generate_sln_configurations ( guid.c_str() ); + _generate_sln_configurations ( modules[i]->guid.c_str() ); } fprintf ( OUT, "\tEndGlobalSection\r\n" ); /* @@ -153,20 +125,13 @@ } } -void -SlnMaker::_generate_sln ( std::string solution_version, std::string studio_version ) +void +SlnMaker::_add_project(ProjMaker &project, Module &module) { string sln_guid = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"; - vector<string> guids; - _generate_sln_header( solution_version, studio_version); - // TODO FIXME - is it necessary to sort them? - for( std::map<std::string, Module*>::const_iterator p = m_ProjectNode->modules.begin(); p != m_ProjectNode->modules.end(); ++ p ) - { - Module& module = *p->second; + fprintf ( OUT, "Project(\"%s\") = \"%s\", \".\\%s\",\"%s\"\n", sln_guid.c_str(), module.name.c_str() , project.VcprojFileName(module).c_str() , module.guid.c_str()); + fprintf ( OUT, "EndProject\r\n" ); - //std::string vcproj_file = - _generate_sln_project ( module, module.name, sln_guid, module.guid, module.non_if_data.libraries ); - } - _generate_sln_footer ( ); + modules.push_back(&module); } Removed: trunk/reactos/tools/rbuild/backend/msvc/spec.rules URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/spec.rules [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/msvc/spec.rules (removed) @@ -1,57 +1,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<VisualStudioToolFile - Name="Spec" - Version="8,00" - > - <Rules> - <CustomBuildRule - Name="spec" - DisplayName="Spec" - CommandLine=""$(Tools)\winebuild\winebuild.exe" -F $(TargetFileName) -o [DefFile] --def -k -E [inputs] | "$(Tools)\winebuild\winebuild.exe" -F $(TargetFileName) -o [StubsFile] --pedll -k -E [inputs]" - Outputs="[DefFile]" - FileExtensions="*.spec" - ExecutionDescription="Generating module definition file" - > - <Properties> - <StringProperty - Name="DefFile" - DisplayName="DefFile" - Description="The path of the def file" - Switch=""[value]"" - DefaultValue="$(IntDir)\$(InputName).def" - /> - <StringProperty - Name="StubsFile" - DisplayName="StubsFile" - Description="The path of the spec file" - Switch=""[value]"" - DefaultValue="$(IntDir)\$(InputName).stubs.c" - /> - </Properties> - </CustomBuildRule> - <CustomBuildRule - Name="Pspec" - DisplayName="pspec" - CommandLine="cl /nologo /EP [includes] [inputs] > [Specfile]" - Outputs="[Specfile]" - FileExtensions="*.pspec" - ExecutionDescription="Generating module definition file" - > - <Properties> - <StringProperty - Name="includes" - DisplayName="includes" - Switch="/I "[value]"" - Delimited="true" - /> - <StringProperty - Name="Specfile" - DisplayName="Spec file" - Description="Spec file" - Switch=""[value]"" - DefaultValue="$(IntDir)\$(InputName).spec" - /> - </Properties> - </CustomBuildRule> - </Rules> -</VisualStudioToolFile> Modified: trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -61,7 +61,8 @@ VCProjMaker::VCProjMaker ( Configuration& buildConfig, const std::vector<MSVCConfiguration*>& msvc_configs, - std::string filename ) + std::string filename, + const Module& module) { configuration = buildConfig; m_configurations = msvc_configs; @@ -73,154 +74,10 @@ { printf ( "Could not create file '%s'.\n", vcproj_file.c_str() ); } -} - -VCProjMaker::~VCProjMaker() -{ - fclose ( OUT ); -} - -std::string -VCProjMaker::_get_file_path( FileLocation* file, std::string relative_path) -{ - if (file->directory == SourceDirectory) - { - // We want the full path here for directory support later on - return Path::RelativeFromDirectory (file->relative_path, relative_path ); - } - else if(file->directory == IntermediateDirectory) - { - return std::string("$(RootIntDir)\\") + file->relative_path; - } - else if(file->directory == OutputDirectory) - { - return std::string("$(RootOutDir)\\") + file->relative_path; - } - - return std::string(""); -} - - - -void -VCProjMaker::_generate_proj_file ( const Module& module ) -{ - size_t i; - - // make sure the containers are empty - header_files.clear(); - includes.clear(); - libraries.clear(); - common_defines.clear(); - - printf ( "Creating MSVC project: '%s'\n", vcproj_file.c_str() ); - - string path_basedir = module.GetPathToBaseDir (); - - bool include_idl = false; - - vector<string> source_files, resource_files, generated_files; - - const IfableData& data = module.non_if_data; - const vector<File*>& files = data.files; - for ( i = 0; i < files.size(); i++ ) - { - string path = _get_file_path(&files[i]->file, module.output->relative_path); - string file = path + std::string("\\") + files[i]->file.name; - - if (files[i]->file.directory != SourceDirectory) - generated_files.push_back ( file ); - else if ( !stricmp ( Right(file,3).c_str(), ".rc" ) ) - resource_files.push_back ( file ); - else if ( !stricmp ( Right(file,2).c_str(), ".h" ) ) - header_files.push_back ( file ); - else - source_files.push_back ( file ); - } - const vector<Include*>& incs = data.includes; - for ( i = 0; i < incs.size(); i++ ) - { - string path = _get_file_path(incs[i]->directory, module.output->relative_path); - - if ( module.type != RpcServer && module.type != RpcClient ) - { - if ( path.find ("/include/reactos/idl") != string::npos) - { - include_idl = true; - continue; - } - } - includes.push_back ( path ); - } - const vector<Library*>& libs = data.libraries; - for ( i = 0; i < libs.size(); i++ ) - { - string libpath = "$(RootOutDir)\\" + libs[i]->importedModule->output->relative_path + "\\" + _get_vc_dir() + "\\$(ConfigurationName)\\" + libs[i]->name + ".lib"; - libraries.push_back ( libpath ); - } - const vector<Define*>& defs = data.defines; - for ( i = 0; i < defs.size(); i++ ) - { - if ( defs[i]->backend != "" && defs[i]->backend != "msvc" ) - continue; - - if ( defs[i]->value[0] ) - common_defines.insert( defs[i]->name + "=" + defs[i]->value ); - else - common_defines.insert( defs[i]->name ); - } - for ( std::map<std::string, Property*>::const_iterator p = data.properties.begin(); p != data.properties.end(); ++ p ) - { - Property& prop = *p->second; - if ( strstr ( module.baseaddress.c_str(), prop.name.c_str() ) ) - baseaddr = prop.value; - } - - if(module.importLibrary) - { - std::string ImportLibraryPath = _get_file_path(module.importLibrary->source, module.output->relative_path); - - switch (module.IsSpecDefinitionFile()) - { - case PSpec: - generated_files.push_back("$(IntDir)\\" + ReplaceExtension(module.importLibrary->source->name,".spec")); - case Spec: - generated_files.push_back("$(IntDir)\\" + ReplaceExtension(module.importLibrary->source->name,".stubs.c")); - generated_files.push_back("$(IntDir)\\" + ReplaceExtension(module.importLibrary->source->name,".def")); - default: - source_files.push_back(ImportLibraryPath + std::string("\\") + module.importLibrary->source->name); - } - } - - fprintf ( OUT, "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\r\n" ); - fprintf ( OUT, "<VisualStudioProject\r\n" ); - fprintf ( OUT, "\tProjectType=\"Visual C++\"\r\n" ); - - if (configuration.VSProjectVersion.empty()) - configuration.VSProjectVersion = MS_VS_DEF_VERSION; - - fprintf ( OUT, "\tVersion=\"%s\"\r\n", configuration.VSProjectVersion.c_str() ); - fprintf ( OUT, "\tName=\"%s\"\r\n", module.name.c_str() ); - fprintf ( OUT, "\tProjectGUID=\"%s\"\r\n", module.guid.c_str() ); - fprintf ( OUT, "\tKeyword=\"Win32Proj\">\r\n" ); - - fprintf ( OUT, "\t<Platforms>\r\n" ); - fprintf ( OUT, "\t\t<Platform\r\n" ); - fprintf ( OUT, "\t\t\tName=\"Win32\"/>\r\n" ); - fprintf ( OUT, "\t</Platforms>\r\n" ); - - fprintf ( OUT, "\t<ToolFiles>\r\n" ); - fprintf ( OUT, "\t\t<ToolFile\r\n" ); - fprintf ( OUT, "\t\t\tRelativePath=\"%s%s\"\r\n", path_basedir.c_str(), "tools\\rbuild\\backend\\msvc\\s_as_mscpp.rules" ); - fprintf ( OUT, "\t\t/>\r\n" ); - fprintf ( OUT, "\t\t<ToolFile\r\n" ); - fprintf ( OUT, "\t\t\tRelativePath=\"%s%s\"\r\n", path_basedir.c_str(), "tools\\rbuild\\backend\\msvc\\spec.rules" ); - fprintf ( OUT, "\t\t/>\r\n" ); - fprintf ( OUT, "\t</ToolFiles>\r\n" ); // Set the binary type string module_type = GetExtension(*module.output); - BinaryType binaryType; + if ((module.type == ObjectLibrary) || (module.type == RpcClient) ||(module.type == RpcServer) || (module_type == ".lib") || (module_type == ".a")) binaryType = Lib; else if ((module_type == ".dll") || (module_type == ".cpl")) @@ -231,6 +88,50 @@ binaryType = Sys; else binaryType = BinUnknown; + +} + +VCProjMaker::~VCProjMaker() +{ + fclose ( OUT ); +} + +void +VCProjMaker::_generate_proj_file ( const Module& module ) +{ + size_t i; + + printf ( "Creating MSVC project: '%s'\n", vcproj_file.c_str() ); + + string path_basedir = module.GetPathToBaseDir (); + + _collect_files(module); + + fprintf ( OUT, "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\r\n" ); + fprintf ( OUT, "<VisualStudioProject\r\n" ); + fprintf ( OUT, "\tProjectType=\"Visual C++\"\r\n" ); + + if (configuration.VSProjectVersion.empty()) + configuration.VSProjectVersion = MS_VS_DEF_VERSION; + + fprintf ( OUT, "\tVersion=\"%s\"\r\n", configuration.VSProjectVersion.c_str() ); + fprintf ( OUT, "\tName=\"%s\"\r\n", module.name.c_str() ); + fprintf ( OUT, "\tProjectGUID=\"%s\"\r\n", module.guid.c_str() ); + fprintf ( OUT, "\tKeyword=\"Win32Proj\">\r\n" ); + + fprintf ( OUT, "\t<Platforms>\r\n" ); + fprintf ( OUT, "\t\t<Platform\r\n" ); + fprintf ( OUT, "\t\t\tName=\"Win32\"/>\r\n" ); + fprintf ( OUT, "\t</Platforms>\r\n" ); + + fprintf ( OUT, "\t<ToolFiles>\r\n" ); + fprintf ( OUT, "\t\t<ToolFile\r\n" ); + fprintf ( OUT, "\t\t\tRelativePath=\"%s%s\"\r\n", path_basedir.c_str(), "tools\\rbuild\\backend\\msvc\\rules\\s_as_mscpp.rules" ); + fprintf ( OUT, "\t\t/>\r\n" ); + fprintf ( OUT, "\t\t<ToolFile\r\n" ); + fprintf ( OUT, "\t\t\tRelativePath=\"%s%s\"\r\n", path_basedir.c_str(), "tools\\rbuild\\backend\\msvc\\rules\\spec.rules" ); + fprintf ( OUT, "\t\t/>\r\n" ); + fprintf ( OUT, "\t</ToolFiles>\r\n" ); // Write out all the configurations fprintf ( OUT, "\t<Configurations>\r\n" ); @@ -389,9 +290,8 @@ fprintf ( OUT, "\t\t\tFilter=\"h;hpp;hxx;hm;inl\">\r\n" ); for ( i = 0; i < header_files.size(); i++ ) { - const string& header_file = header_files[i]; fprintf ( OUT, "\t\t\t<File\r\n" ); - fprintf ( OUT, "\t\t\t\tRelativePath=\"%s\">\r\n", header_file.c_str() ); + fprintf ( OUT, "\t\t\t\tRelativePath=\"%s\">\r\n", header_files[i].c_str() ); fprintf ( OUT, "\t\t\t</File>\r\n" ); } fprintf ( OUT, "\t\t</Filter>\r\n" ); @@ -402,9 +302,8 @@ fprintf ( OUT, "\t\t\tFilter=\"ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\">\r\n" ); for ( i = 0; i < resource_files.size(); i++ ) { - const string& resource_file = resource_files[i]; fprintf ( OUT, "\t\t\t<File\r\n" ); - fprintf ( OUT, "\t\t\t\tRelativePath=\"%s\">\r\n", resource_file.c_str() ); + fprintf ( OUT, "\t\t\t\tRelativePath=\"%s\">\r\n", resource_files[i].c_str() ); fprintf ( OUT, "\t\t\t</File>\r\n" ); } fprintf ( OUT, "\t\t</Filter>\r\n" ); @@ -481,8 +380,8 @@ fprintf ( OUT, "\t\t\tConfigurationType=\"%d\"\r\n", CfgType ); - fprintf ( OUT, "\t\t\tInheritedPropertySheets=\"%s%s.vsprops\"\r\n", path_basedir.c_str (), cfg.name.c_str ()); - fprintf ( OUT, "\t\t\tCharacterSet=\"2\"\r\n" ); + fprintf ( OUT, "\t\t\tInheritedPropertySheets=\"%s\\%s.vsprops\"\r\n", path_basedir.c_str (), cfg.name.c_str ()); + fprintf ( OUT, "\t\t\tCharacterSet=\"%s\"\r\n", module.isUnicode ? "1" : "2" ); fprintf ( OUT, "\t\t\t>\r\n" ); fprintf ( OUT, "\t\t\t<Tool\r\n" ); @@ -491,12 +390,7 @@ fprintf ( OUT, "./;" ); for ( i = 0; i < includes.size(); i++ ) { - const std::string& include = includes[i]; - if ( strcmp ( include.c_str(), "." ) ) - { - fprintf ( OUT, "%s", include.c_str() ); - fprintf ( OUT, ";" ); - } + fprintf ( OUT, "%s;", includes[i].c_str() ); } fprintf ( OUT, "$(globalIncludes);\"\r\n"); fprintf ( OUT, "\t\t\t\tsPPDefs=\"__ASM__\"\r\n" ); @@ -508,12 +402,7 @@ fprintf ( OUT, "./;" ); for ( i = 0; i < includes.size(); i++ ) { - const std::string& include = includes[i]; - if ( strcmp ( include.c_str(), "." ) ) - { - fprintf ( OUT, "%s", include.c_str() ); - fprintf ( OUT, ";" ); - } + fprintf ( OUT, "%s;", includes[i].c_str() ); } fprintf ( OUT, "$(globalIncludes);\"\r\n"); fprintf ( OUT, "\t\t\t\tsPPDefs=\"__ASM__\"\r\n" ); @@ -528,20 +417,10 @@ fprintf ( OUT, "./;" ); for ( i = 0; i < includes.size(); i++ ) { - const std::string& include = includes[i]; - if ( strcmp ( include.c_str(), "." ) ) - { - if ( multiple_includes ) - fprintf ( OUT, ";" ); - fprintf ( OUT, "%s", include.c_str() ); - multiple_includes = true; - } + fprintf ( OUT, "%s;", includes[i].c_str() ); } if ( include_idl ) { - if ( multiple_includes ) - fprintf ( OUT, ";" ); - if ( configuration.UseConfigurationInPath ) { fprintf ( OUT, "$(int)\\include\\reactos\\idl%s\\$(ConfigurationName)\r\n", vcdir.c_str ()); @@ -554,24 +433,17 @@ fprintf ( OUT, "\"\r\n" ); - StringSet defines = common_defines; + fprintf ( OUT, "\t\t\t\tPreprocessorDefinitions=\"" ); + for ( i = 0; i < defines.size(); i++ ) + { + fprintf ( OUT, "%s ; ", _replace_str(defines[i], "\"","").c_str() ); + } if ( binaryType == Lib || binaryType == Exe ) - { - defines.insert ( "_LIB" ); - } + fprintf ( OUT, "_LIB ; " ); else - { - defines.insert ( "_WINDOWS" ); - defines.insert ( "_USRDLL" ); - } - - fprintf ( OUT, "\t\t\t\tPreprocessorDefinitions=\"" ); - for ( StringSet::iterator it1=defines.begin(); it1!=defines.end(); it1++ ) - { - string unescaped = *it1; - fprintf ( OUT, "%s ; ", _replace_str(unescaped, "\"","").c_str() ); - } + fprintf ( OUT, "_WINDOWS ; _USRDLL ;" ); + fprintf ( OUT, "\"\r\n" ); //disable precompiled headers for now Modified: trunk/reactos/tools/rbuild/backend/msvc/vcxprojmaker.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/vcxprojmaker.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/msvc/vcxprojmaker.cpp [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -53,7 +53,8 @@ VCXProjMaker::VCXProjMaker ( Configuration& buildConfig, const std::vector<MSVCConfiguration*>& msvc_configs, - std::string filename ) + std::string filename, + const Module& module) { configuration = buildConfig; m_configurations = msvc_configs; @@ -65,157 +66,10 @@ { printf ( "Could not create file '%s'.\n", vcproj_file.c_str() ); } -} - -VCXProjMaker::~VCXProjMaker() -{ - fclose ( OUT ); -} - -void -VCXProjMaker::_generate_proj_file ( const Module& module ) -{ - size_t i; - - string computername; - string username; - - // make sure the containers are empty - header_files.clear(); - includes.clear(); - includes_ros.clear(); - libraries.clear(); - common_defines.clear(); - - if (getenv ( "USERNAME" ) != NULL) - username = getenv ( "USERNAME" ); - if (getenv ( "COMPUTERNAME" ) != NULL) - computername = getenv ( "COMPUTERNAME" ); - else if (getenv ( "HOSTNAME" ) != NULL) - computername = getenv ( "HOSTNAME" ); - - string vcproj_file_user = ""; - - if ((computername != "") && (username != "")) - vcproj_file_user = vcproj_file + "." + computername + "." + username + ".user"; - - printf ( "Creating MSVC project: '%s'\n", vcproj_file.c_str() ); - - string path_basedir = module.GetPathToBaseDir (); - string intenv = Environment::GetIntermediatePath (); - string outenv = Environment::GetOutputPath (); - string outdir; - string intdir; - string vcdir; - - if ( intenv == "obj-i386" ) - intdir = path_basedir + "obj-i386"; /* append relative dir from project dir */ - else - intdir = intenv; - - if ( outenv == "output-i386" ) - outdir = path_basedir + "output-i386"; - else - outdir = outenv; - - if ( configuration.UseVSVersionInPath ) - { - vcdir = DEF_SSEP + _get_vc_dir(); - } - - bool include_idl = false; - - vector<string> source_files, resource_files; - vector<const IfableData*> ifs_list; - ifs_list.push_back ( &module.project.non_if_data ); - ifs_list.push_back ( &module.non_if_data ); - - while ( ifs_list.size() ) - { - const IfableData& data = *ifs_list.back(); - ifs_list.pop_back(); - const vector<File*>& files = data.files; - for ( i = 0; i < files.size(); i++ ) - { - if (files[i]->file.directory != SourceDirectory) - continue; - - // We want the full path here for directory support later on - string path = Path::RelativeFromDirectory ( - files[i]->file.relative_path, - module.output->relative_path ); - string file = path + std::string("\\") + files[i]->file.name; - - if ( !stricmp ( Right(file,3).c_str(), ".rc" ) ) - resource_files.push_back ( file ); - else if ( !stricmp ( Right(file,2).c_str(), ".h" ) ) - header_files.push_back ( file ); - else - source_files.push_back ( file ); - } - const vector<Include*>& incs = data.includes; - for ( i = 0; i < incs.size(); i++ ) - { - string path = Path::RelativeFromDirectory ( - incs[i]->directory->relative_path, - module.output->relative_path ); - if ( module.type != RpcServer && module.type != RpcClient ) - { - if ( path.find ("/include/reactos/idl") != string::npos) - { - include_idl = true; - continue; - } - } - // switch between general headers and ros headers - if ( !strncmp(incs[i]->directory->relative_path.c_str(), "include\\crt", 11 ) || - !strncmp(incs[i]->directory->relative_path.c_str(), "include\\ddk", 11 ) || - !strncmp(incs[i]->directory->relative_path.c_str(), "include\\GL", 10 ) || - !strncmp(incs[i]->directory->relative_path.c_str(), "include\\psdk", 12 ) || - !strncmp(incs[i]->directory->relative_path.c_str(), "include\\reactos\\wine", 20 ) ) - { - if (strncmp(incs[i]->directory->relative_path.c_str(), "include\\crt", 11 )) - // not crt include - includes_ros.push_back ( path ); - } - else - { - includes.push_back ( path ); - } - } - const vector<Library*>& libs = data.libraries; - for ( i = 0; i < libs.size(); i++ ) - { - string libpath = outdir + "\\" + libs[i]->importedModule->output->relative_path + "\\" + _get_vc_dir() + "\\---\\" + libs[i]->name + ".lib"; - libraries.push_back ( libpath ); - } - const vector<Define*>& defs = data.defines; - for ( i = 0; i < defs.size(); i++ ) - { - if ( defs[i]->backend != "" && defs[i]->backend != "msvc" ) - continue; - - if ( defs[i]->value[0] ) - common_defines.insert( defs[i]->name + "=" + defs[i]->value ); - else - common_defines.insert( defs[i]->name ); - } - for ( std::map<std::string, Property*>::const_iterator p = data.properties.begin(); p != data.properties.end(); ++ p ) - { - Property& prop = *p->second; - if ( strstr ( module.baseaddress.c_str(), prop.name.c_str() ) ) - baseaddr = prop.value; - } - } - /* include intermediate path for reactos.rc */ - string version = intdir + "\\include"; - includes.push_back (version); - version += "\\reactos"; - includes.push_back (version); // Set the binary type string module_type = GetExtension(*module.output); - BinaryType binaryType; + if ((module.type == ObjectLibrary) || (module.type == RpcClient) ||(module.type == RpcServer) || (module_type == ".lib") || (module_type == ".a")) binaryType = Lib; else if ((module_type == ".dll") || (module_type == ".cpl")) @@ -226,13 +80,76 @@ binaryType = Sys; else binaryType = BinUnknown; - - string include_string; +} + +VCXProjMaker::~VCXProjMaker() +{ + fclose ( OUT ); +} + +void +VCXProjMaker::_generate_item_group (std::vector<std::string> files) +{ + size_t i; + + for( i = 0; i<files.size(); i++) + { + std::string extension = GetExtension(files[i]); + + if( extension == ".c" || extension == ".cpp") + fprintf ( OUT, "\t\t<ClCompile Include=\"%s\" />\r\n", files[i].c_str()); + else if( extension == ".s") + fprintf ( OUT, "\t\t<s_as_mscpp Include=\"%s\" />\r\n", files[i].c_str()); + else if( extension == ".spec") + fprintf ( OUT, "\t\t<spec Include=\"%s\" />\r\n", files[i].c_str()); + else if( extension == ".pspec") + fprintf ( OUT, "\t\t<pspec Include=\"%s\" />\r\n", files[i].c_str()); + else if( extension == ".rc") + fprintf ( OUT, "\t\t<ResourceCompile Include=\"%s\" />\r\n", files[i].c_str()); + else if( extension == ".h") + fprintf ( OUT, "\t\t<ClInclude Include=\"%s\" />\r\n", files[i].c_str()); + else + fprintf ( OUT, "\t\t<None Include=\"%s\" />\r\n", files[i].c_str()); + } +} + +string +VCXProjMaker::_get_configuration_type () +{ + switch (binaryType) + { + case Exe: + return "Application"; + case Dll: + case Sys: + return "DynamicLibrary"; + case Lib: + return "StaticLibrary"; + default: + return ""; + } +} + +void +VCXProjMaker::_generate_proj_file ( const Module& module ) +{ + string path_basedir = module.GetPathToBaseDir (); + size_t i; + string vcdir; + + if ( configuration.UseVSVersionInPath ) + { + vcdir = DEF_SSEP + _get_vc_dir(); + } + + printf ( "Creating MSVC project: '%s'\n", vcproj_file.c_str() ); + + _collect_files(module); fprintf ( OUT, "<?xml version=\"1.0\" encoding = \"utf-8\"?>\r\n" ); fprintf ( OUT, "<Project " ); fprintf ( OUT, "DefaultTargets=\"Build\" " ); //FIXME: what's Build?? - fprintf ( OUT, "ToolsVersion=\"4.0\" " ); //FIXME: Is it always 4.0?? + fprintf ( OUT, "ToolsVersion=\"4.0\" " ); //version 4 is the one bundled with .net framework 4 fprintf ( OUT, "xmlns=\"
http://schemas.microsoft.com/developer/msbuild/2003\
">\r\n" ); if (configuration.VSProjectVersion.empty()) @@ -245,15 +162,11 @@ const MSVCConfiguration& cfg = *m_configurations[icfg]; if ( cfg.optimization == RosBuild ) - { _generate_makefile_configuration( module, cfg ); - } else - { _generate_standard_configuration( module, cfg, binaryType ); - } - } - fprintf ( OUT, "\t</ItemGroup>\r\n" ); + } + fprintf ( OUT, "\t</ItemGroup>\r\n\r\n" ); // Write out the global info fprintf ( OUT, "\t<PropertyGroup Label=\"Globals\">\r\n" ); @@ -261,9 +174,88 @@ fprintf ( OUT, "\t\t<Keyword>%s</Keyword>\r\n", "Win32Proj" ); //FIXME: Win32Proj??? fprintf ( OUT, "\t\t<RootNamespace>%s</RootNamespace>\r\n", module.name.c_str() ); //FIXME: shouldn't this be the soltion name? fprintf ( OUT, "\t</PropertyGroup>\r\n" ); - fprintf ( OUT, "</Project>" ); - - + fprintf ( OUT, "\r\n" ); + + fprintf ( OUT, "\t<PropertyGroup Label=\"Configuration\">\r\n"); + if( binaryType != BinUnknown) + fprintf ( OUT, "\t\t<ConfigurationType>%s</ConfigurationType>\r\n" , _get_configuration_type().c_str()); + fprintf ( OUT, "\t\t<CharacterSet>%s</CharacterSet>\r\n", module.isUnicode ? "Unicode" : "MultiByte"); + fprintf ( OUT, "\t</PropertyGroup>\r\n"); + + fprintf ( OUT, "\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\r\n" ); + fprintf ( OUT, "\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.props\" />\r\n" ); + fprintf ( OUT, "\t<ImportGroup Label=\"PropertySheets\">\r\n"); + fprintf ( OUT, "\t\t<Import Project=\"%s\\reactos.props\" />\r\n", path_basedir.c_str()); + fprintf ( OUT, "\t\t<Import Project=\"%s\\tools\\rbuild\\backend\\msvc\\rules\\reactos.defaults.props\" />\r\n", path_basedir.c_str()); + fprintf ( OUT, "\t</ImportGroup>\r\n"); + + fprintf ( OUT, "\t<PropertyGroup>\r\n"); + fprintf ( OUT, "\t\t<OutDir>$(RootOutDir)\\%s%s\\$(Configuration)\\</OutDir>\r\n", module.output->relative_path.c_str (), vcdir.c_str ()); + fprintf ( OUT, "\t\t<IntDir>$(RootIntDir)\\%s%s\\$(Configuration)\\</IntDir>\r\n", module.output->relative_path.c_str (), vcdir.c_str ()); + + if( includes.size() != 0) + { + fprintf( OUT, "\t\t<ProjectIncludes>"); + for ( i = 0; i < includes.size(); i++ ) + fprintf ( OUT, "%s;", includes[i].c_str() ); + fprintf( OUT, "</ProjectIncludes>\r\n"); + } + + if(defines.size() != 0) + { + fprintf( OUT, "\t\t<ProjectDefines>"); + for ( i = 0; i < defines.size(); i++ ) + fprintf ( OUT, "%s;", defines[i].c_str() ); + fprintf( OUT, "</ProjectDefines>\r\n"); + } + + fprintf ( OUT, "\t</PropertyGroup>\r\n\r\n"); + + fprintf ( OUT, "\t<ItemDefinitionGroup>\r\n"); + fprintf ( OUT, "\t\t<ClCompile>\r\n"); + if ( module.cplusplus ) + fprintf ( OUT, "\t\t\t<CompileAs>CompileAsCpp</CompileAs>\r\n"); + fprintf ( OUT, "\t\t</ClCompile>\r\n"); + + fprintf ( OUT, "\t\t<Link>\r\n"); + if(libraries.size() != 0) + { + fprintf ( OUT, "\t\t\t<AdditionalDependencies>"); + for ( i = 0; i < libraries.size(); i++ ) + { + string libpath = libraries[i].c_str(); + libpath = libpath.erase (0, libpath.find_last_of ("\\") + 1 ); + fprintf ( OUT, "%s;", libpath.c_str() ); + } + fprintf ( OUT, "%%(AdditionalDependencies)</AdditionalDependencies>\r\n"); + + fprintf ( OUT, "\t\t\t<AdditionalLibraryDirectories>"); + for ( i = 0; i < libraries.size(); i++ ) + { + string libpath = libraries[i].c_str(); + libpath = libpath.substr (0, libpath.find_last_of ("\\") ); + fprintf ( OUT, "%s;", libpath.c_str() ); + } + fprintf ( OUT, "%%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r\n"); + } + + if( module.CRT != "msvcrt") + fprintf ( OUT, "\t\t\t<IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\r\n"); + + fprintf ( OUT, "\t\t</Link>\r\n"); + fprintf ( OUT, "\t</ItemDefinitionGroup>\r\n"); + + fprintf ( OUT, "\t<ItemGroup>\r\n"); + _generate_item_group(header_files); + _generate_item_group(source_files); + _generate_item_group(resource_files); + _generate_item_group(generated_files); + fprintf ( OUT, "\t</ItemGroup>\r\n\r\n"); + + fprintf ( OUT, "\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\r\n"); + fprintf ( OUT, "\t<Import Project=\"%s\\tools\\rbuild\\backend\\msvc\\rules\\reactos.targets\" />\r\n", path_basedir.c_str()); + + fprintf ( OUT, "</Project>\r\n"); } void Modified: trunk/reactos/tools/rbuild/backend/msvc/vspropsmaker.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/msvc/…
============================================================================== --- trunk/reactos/tools/rbuild/backend/msvc/vspropsmaker.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/msvc/vspropsmaker.cpp [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -23,7 +23,7 @@ #undef OUT #endif//OUT -PropsMaker::PropsMaker ( Configuration& buildConfig, +VSPropsMaker::VSPropsMaker ( Configuration& buildConfig, Project* ProjectNode, std::string filename_props, MSVCConfiguration* msvc_configs) @@ -46,13 +46,13 @@ } } -PropsMaker::~PropsMaker ( ) +VSPropsMaker::~VSPropsMaker ( ) { fclose ( OUT ); } void -PropsMaker::_generate_header() +VSPropsMaker::_generate_header() { fprintf ( OUT, "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\r\n" ); fprintf ( OUT, "<VisualStudioPropertySheet\r\n" ); @@ -64,7 +64,7 @@ } void -PropsMaker::_generate_tools_defaults() +VSPropsMaker::_generate_tools_defaults() { fprintf ( OUT, "\t<Tool\r\n"); fprintf ( OUT, "\t\tName=\"VCCLCompilerTool\"\r\n"); @@ -119,7 +119,7 @@ } void -PropsMaker::_generate_macro(std::string Name, +VSPropsMaker::_generate_macro(std::string Name, std::string Value, bool EvairomentVariable) { @@ -132,7 +132,7 @@ } void -PropsMaker::_generate_global_includes() +VSPropsMaker::_generate_global_includes() { //Generate global includes //they will be used by the c compiler, the resource compiler @@ -190,7 +190,7 @@ } void -PropsMaker::_generate_global_definitions() +VSPropsMaker::_generate_global_definitions() { fprintf ( OUT, "\t<UserMacro\r\n"); fprintf ( OUT, "\t\tName=\"globalDefines\"\r\n"); @@ -220,7 +220,7 @@ if ( defs[i]->backend != "" && defs[i]->backend != "msvc" ) continue; - if ( defs[i]->value[0] ) + if ( defs[i]->value != "" ) fprintf ( OUT, "%s=%s",defs[i]->name.c_str(), defs[i]->value.c_str()); else fprintf ( OUT, defs[i]->name.c_str()); @@ -233,14 +233,14 @@ } void -PropsMaker::_generate_footer() +VSPropsMaker::_generate_footer() { fprintf ( OUT, "</VisualStudioPropertySheet>\r\n"); } void -PropsMaker::_generate_props ( std::string solution_version, +VSPropsMaker::_generate_props ( std::string solution_version, std::string studio_version ) { _generate_header(); 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] Tue Jun 1 11:31:24 2010 @@ -138,7 +138,7 @@ return FixSeparator(path + cSep + att_value); } -static string +string GetExtension ( const string& filename ) { size_t index = filename.find_last_of ( '/' ); 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] Tue Jun 1 11:31:24 2010 @@ -1088,6 +1088,9 @@ const std::string& att_value ); extern std::string +GetExtension ( const std::string& filename ); + +extern std::string GetExtension ( const FileLocation& file ); extern std::string Modified: trunk/reactos/tools/rbuild/rbuild.mak URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.mak?re…
============================================================================== --- trunk/reactos/tools/rbuild/rbuild.mak [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/rbuild.mak [iso-8859-1] Tue Jun 1 11:31:24 2010 @@ -184,6 +184,7 @@ genguid.cpp \ msvc.cpp \ projmaker.cpp \ + propsmaker.cpp \ slnmaker.cpp \ vcprojmaker.cpp \ vcxprojmaker.cpp \ @@ -471,6 +472,10 @@ $(ECHO_HOSTCC) ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ +$(RBUILD_MSVC_INT_)propsmaker.o: $(RBUILD_MSVC_BASE_)propsmaker.cpp $(RBUILD_HEADERS) | $(RBUILD_MSVC_INT) + $(ECHO_HOSTCC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + $(RBUILD_MSVC_INT_)slnmaker.o: $(RBUILD_MSVC_BASE_)slnmaker.cpp $(RBUILD_HEADERS) | $(RBUILD_MSVC_INT) $(ECHO_HOSTCC) ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
14 years, 6 months
1
0
0
0
[arty] 47510: Add invariant checks and fix a bug: Copy+Paste error misusing OldFlink
by arty@svn.reactos.org
Author: arty Date: Tue Jun 1 11:22:10 2010 New Revision: 47510 URL:
http://svn.reactos.org/svn/reactos?rev=47510&view=rev
Log: Add invariant checks and fix a bug: Copy+Paste error misusing OldFlink Modified: trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c Modified: trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c [iso-8859-1] Tue Jun 1 11:22:10 2010 @@ -15,6 +15,16 @@ #line 15 "ARM³::PFNLIST" #define MODULE_INVOLVED_IN_ARM3 #include "../ARM3/miarm.h" + +#define ASSERT_LIST_INVARIANT(x) \ +do { \ + ASSERT(((x)->Total == 0 && \ + (x)->Flink == LIST_HEAD && \ + (x)->Blink == LIST_HEAD) || \ + ((x)->Total != 0 && \ + (x)->Flink != LIST_HEAD && \ + (x)->Blink != LIST_HEAD)); \ +} while (0) /* GLOBALS ********************************************************************/ @@ -49,6 +59,9 @@ { PFN_NUMBER OldBlink, EntryIndex = MiGetPfnEntryIndex(Entry); + ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL); + ASSERT_LIST_INVARIANT(ListHead); + /* Get the back link */ OldBlink = ListHead->Blink; if (OldBlink != LIST_HEAD) @@ -69,6 +82,7 @@ /* And now the head points back to us, since we are last */ ListHead->Blink = EntryIndex; ListHead->Total++; + ASSERT_LIST_INVARIANT(ListHead); } VOID @@ -97,6 +111,7 @@ /* Use the zero list */ ListHead = &MmZeroedPageListHead; + ASSERT_LIST_INVARIANT(ListHead); ListHead->Total++; /* Get the back link */ @@ -136,6 +151,9 @@ /* Otherwise check if we reached the high threshold and signal the event */ KeSetEvent(MiHighMemoryEvent, 0, FALSE); } + + ASSERT_LIST_INVARIANT(ListHead); + #if 0 /* Get the page color */ Color = EntryIndex & MmSecondaryColorMask; @@ -177,7 +195,7 @@ /* Make sure the PFN lock is held */ ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL); - + /* Make sure the PFN entry isn't in-use */ ASSERT(Entry->u3.e1.WriteInProgress == 0); ASSERT(Entry->u3.e1.ReadInProgress == 0); @@ -187,6 +205,7 @@ ListName = ListHead->ListName; ASSERT(ListHead != NULL); ASSERT(ListName <= FreePageList); + ASSERT_LIST_INVARIANT(ListHead); /* Remove one count */ ASSERT(ListHead->Total != 0); @@ -205,7 +224,7 @@ else { /* Set the list head's backlink instead */ - ListHead->Blink = OldFlink; + ListHead->Blink = OldBlink; } /* Check if the back entry is the list head */ @@ -222,6 +241,7 @@ /* We are not on a list anymore */ Entry->u1.Flink = Entry->u2.Blink = 0; + ASSERT_LIST_INVARIANT(ListHead); /* FIXME: Deal with color list */ @@ -272,6 +292,7 @@ /* Could be either on free or zero list */ ListHead = MmPageLocationList[Pfn1->u3.e1.PageLocation]; + ASSERT_LIST_INVARIANT(ListHead); ListName = ListHead->ListName; ASSERT(ListName <= FreePageList); @@ -313,6 +334,9 @@ Pfn1->u3.e2.ShortFlags = 0; Pfn1->u3.e1.PageColor = OldColor; Pfn1->u3.e1.CacheAttribute = OldCache; + + ASSERT_LIST_INVARIANT(ListHead); + #if 0 // When switching to ARM3 /* Get the first page on the color list */ ColorTable = &MmFreePagesByColor[ListName][Color]; @@ -379,12 +403,13 @@ { #endif /* Check the free list */ + ASSERT_LIST_INVARIANT(&MmFreePageListHead); PageIndex = MmFreePageListHead.Flink; Color = PageIndex & MmSecondaryColorMask; if (PageIndex == LIST_HEAD) { /* Check the zero list */ - ASSERT(MmFreePageListHead.Total == 0); + ASSERT_LIST_INVARIANT(&MmZeroedPageListHead); PageIndex = MmZeroedPageListHead.Flink; Color = PageIndex & MmSecondaryColorMask; ASSERT(PageIndex != LIST_HEAD); @@ -410,6 +435,9 @@ ASSERT(Pfn1->u2.ShareCount == 0); /* Return the page */ + ASSERT_LIST_INVARIANT(&MmFreePageListHead); + ASSERT_LIST_INVARIANT(&MmZeroedPageListHead); + return PageIndex; } @@ -420,6 +448,9 @@ PFN_NUMBER Entry, Flink; PMMPFN Pfn1; + ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL); + ASSERT_LIST_INVARIANT(ListHead); + /* Get the entry that's currently first on the list */ Entry = ListHead->Flink; Pfn1 = MiGetPfnEntry(Entry); @@ -444,6 +475,8 @@ Pfn1->u1.Flink = Pfn1->u2.Blink = 0; ListHead->Total--; + ASSERT_LIST_INVARIANT(ListHead); + /* Return the head element */ return Pfn1; } @@ -461,6 +494,7 @@ PMMCOLOR_TABLES ColorTable; #endif /* Make sure the page index is valid */ + ASSERT(KeGetCurrentIrql() >= DISPATCH_LEVEL); ASSERT((PageFrameIndex != 0) && (PageFrameIndex <= MmHighestPhysicalPage) && (PageFrameIndex >= MmLowestPhysicalPage)); @@ -477,6 +511,7 @@ /* Get the free page list and increment its count */ ListHead = &MmFreePageListHead; + ASSERT_LIST_INVARIANT(ListHead); ListHead->Total++; /* Get the last page on the list */ @@ -521,6 +556,8 @@ /* Otherwise check if we reached the high threshold and signal the event */ KeSetEvent(MiHighMemoryEvent, 0, FALSE); } + + ASSERT_LIST_INVARIANT(ListHead); #if 0 // When using ARM3 PFN /* Get the page color */ @@ -641,6 +678,8 @@ } /* Grab a page */ + ASSERT_LIST_INVARIANT(&MmFreePageListHead); + ASSERT_LIST_INVARIANT(&MmZeroedPageListHead); PageFrameIndex = MiRemoveAnyPage(0); /* Write the software PTE */ @@ -652,6 +691,8 @@ MiInitializePfn(PageFrameIndex, PointerPte, TRUE); /* Release the PFN lock and return the page */ + ASSERT_LIST_INVARIANT(&MmFreePageListHead); + ASSERT_LIST_INVARIANT(&MmZeroedPageListHead); KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); return PageFrameIndex; }
14 years, 6 months
1
0
0
0
[janderwald] 47509: [NPFS] - Add more buffer checks - Clear DO_DEVICE_INITIALIZING flag
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Jun 1 11:12:32 2010 New Revision: 47509 URL:
http://svn.reactos.org/svn/reactos?rev=47509&view=rev
Log: [NPFS] - Add more buffer checks - Clear DO_DEVICE_INITIALIZING flag Modified: trunk/reactos/drivers/filesystems/npfs/finfo.c trunk/reactos/drivers/filesystems/npfs/npfs.c Modified: trunk/reactos/drivers/filesystems/npfs/finfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/f…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/finfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/finfo.c [iso-8859-1] Tue Jun 1 11:12:32 2010 @@ -26,6 +26,13 @@ PFILE_PIPE_INFORMATION Request; DPRINT("NpfsSetPipeInformation()\n"); + if (*BufferLength < sizeof(FILE_PIPE_INFORMATION)) + { + /* Buffer too small */ + return STATUS_INFO_LENGTH_MISMATCH; + } + + /* Get the Pipe and data */ Fcb = Ccb->Fcb; Request = (PFILE_PIPE_INFORMATION)Info; @@ -63,6 +70,12 @@ PFILE_PIPE_REMOTE_INFORMATION Request; DPRINT("NpfsSetPipeRemoteInformation()\n"); + if (*BufferLength < sizeof(FILE_PIPE_REMOTE_INFORMATION)) + { + /* Buffer too small */ + return STATUS_INFO_LENGTH_MISMATCH; + } + /* Get the Pipe and data */ Fcb = Ccb->Fcb; Request = (PFILE_PIPE_REMOTE_INFORMATION)Info; @@ -86,6 +99,13 @@ ULONG ConnectionSideReadMode; DPRINT("NpfsQueryPipeInformation()\n"); + if (*BufferLength < sizeof(FILE_PIPE_INFORMATION)) + { + /* Buffer too small */ + *BufferLength = sizeof(FILE_PIPE_INFORMATION); + return STATUS_BUFFER_OVERFLOW; + } + /* Get the Pipe */ Fcb = Ccb->Fcb; @@ -100,7 +120,7 @@ Info->ReadMode = ConnectionSideReadMode; /* Return success */ - *BufferLength -= sizeof(FILE_PIPE_INFORMATION); + *BufferLength = sizeof(FILE_PIPE_INFORMATION); return STATUS_SUCCESS; } @@ -114,6 +134,13 @@ PNPFS_FCB Fcb; DPRINT("NpfsQueryPipeRemoteInformation()\n"); + if (*BufferLength < sizeof(FILE_PIPE_REMOTE_INFORMATION)) + { + /* Buffer too small */ + *BufferLength = sizeof(FILE_PIPE_REMOTE_INFORMATION); + return STATUS_BUFFER_OVERFLOW; + } + /* Get the Pipe */ Fcb = Ccb->Fcb; @@ -125,7 +152,7 @@ Info->CollectDataTime = Fcb->TimeOut; /* Return success */ - *BufferLength -= sizeof(FILE_PIPE_REMOTE_INFORMATION); + *BufferLength = sizeof(FILE_PIPE_REMOTE_INFORMATION); return STATUS_SUCCESS; } @@ -140,11 +167,21 @@ DPRINT("NpfsQueryLocalPipeInformation()\n"); - Fcb = Ccb->Fcb; - + if (*BufferLength < sizeof(FILE_PIPE_REMOTE_INFORMATION)) + { + /* Buffer too small */ + *BufferLength = sizeof(FILE_PIPE_REMOTE_INFORMATION); + return STATUS_BUFFER_OVERFLOW; + } + + /* Get the Pipe */ + Fcb = Ccb->Fcb; + + /* Clear Info */ RtlZeroMemory(Info, sizeof(FILE_PIPE_LOCAL_INFORMATION)); + /* Return Info */ Info->NamedPipeType = Fcb->PipeType; Info->NamedPipeConfiguration = Fcb->PipeConfiguration; Info->MaximumInstances = Fcb->MaximumInstances; @@ -165,7 +202,7 @@ Info->WriteQuotaAvailable = Ccb->OtherSide->WriteQuotaAvailable; } - *BufferLength -= sizeof(FILE_PIPE_LOCAL_INFORMATION); + *BufferLength = sizeof(FILE_PIPE_LOCAL_INFORMATION); return STATUS_SUCCESS; } @@ -226,14 +263,12 @@ default: Status = STATUS_NOT_SUPPORTED; + BufferLength = 0; } Irp->IoStatus.Status = Status; - if (NT_SUCCESS(Status)) - Irp->IoStatus.Information = - IoStack->Parameters.QueryFile.Length - BufferLength; - else - Irp->IoStatus.Information = 0; + Irp->IoStatus.Information = BufferLength; + IoCompleteRequest (Irp, IO_NO_INCREMENT); return Status; Modified: trunk/reactos/drivers/filesystems/npfs/npfs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/n…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/npfs.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/npfs.c [iso-8859-1] Tue Jun 1 11:12:32 2010 @@ -70,6 +70,7 @@ /* initialize the device object */ DeviceObject->Flags |= DO_DIRECT_IO; + DeviceObject->Flags &= ~DO_DEVICE_INITIALIZING; /* initialize the device extension */ DeviceExtension = DeviceObject->DeviceExtension;
14 years, 6 months
1
0
0
0
[janderwald] 47508: [NPFS] - Return buffer size if the buffer is too small
by janderwald@svn.reactos.org
Author: janderwald Date: Tue Jun 1 10:43:50 2010 New Revision: 47508 URL:
http://svn.reactos.org/svn/reactos?rev=47508&view=rev
Log: [NPFS] - Return buffer size if the buffer is too small Modified: trunk/reactos/drivers/filesystems/npfs/volume.c Modified: trunk/reactos/drivers/filesystems/npfs/volume.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/v…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/volume.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/volume.c [iso-8859-1] Tue Jun 1 10:43:50 2010 @@ -23,12 +23,15 @@ DPRINT("FsDeviceInfo = %p\n", FsDeviceInfo); if (*BufferLength < sizeof(FILE_FS_DEVICE_INFORMATION)) + { + *BufferLength = sizeof(FILE_FS_DEVICE_INFORMATION); return STATUS_BUFFER_OVERFLOW; + } FsDeviceInfo->DeviceType = FILE_DEVICE_NAMED_PIPE; FsDeviceInfo->Characteristics = 0; - *BufferLength -= sizeof(FILE_FS_DEVICE_INFORMATION); + *BufferLength = sizeof(FILE_FS_DEVICE_INFORMATION); DPRINT("NpfsQueryFsDeviceInformation() finished.\n"); @@ -44,7 +47,10 @@ DPRINT("FsAttributeInfo = %p\n", FsAttributeInfo); if (*BufferLength < sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 8) + { + *BufferLength = (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 8); return STATUS_BUFFER_OVERFLOW; + } FsAttributeInfo->FileSystemAttributes = FILE_CASE_PRESERVED_NAMES; FsAttributeInfo->MaximumComponentNameLength = 255; @@ -53,7 +59,7 @@ L"NPFS"); DPRINT("NpfsQueryFsAttributeInformation() finished.\n"); - *BufferLength -= (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 8); + *BufferLength = (sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 8); return STATUS_SUCCESS; } @@ -102,10 +108,8 @@ } Irp->IoStatus.Status = Status; - if (NT_SUCCESS(Status)) - Irp->IoStatus.Information = Stack->Parameters.QueryVolume.Length - BufferLength; - else - Irp->IoStatus.Information = 0; + Irp->IoStatus.Information = BufferLength; + IoCompleteRequest(Irp, IO_NO_INCREMENT);
14 years, 6 months
1
0
0
0
[dreimer] 47507: Add the non yet working FF 3.6 and AbiWord 2.8.5 to rapps to simplify testing. Sync the rest
by dreimer@svn.reactos.org
Author: dreimer Date: Tue Jun 1 08:43:47 2010 New Revision: 47507 URL:
http://svn.reactos.org/svn/reactos?rev=47507&view=rev
Log: Add the non yet working FF 3.6 and AbiWord 2.8.5 to rapps to simplify testing. Sync the rest Added: trunk/reactos/base/applications/rapps/rapps/abiword28x.txt (with props) trunk/reactos/base/applications/rapps/rapps/firefox36.txt (with props) Modified: trunk/reactos/base/applications/rapps/rapps/rosbe.txt trunk/reactos/base/applications/rapps/rapps/scite.txt Added: trunk/reactos/base/applications/rapps/rapps/abiword28x.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
============================================================================== --- trunk/reactos/base/applications/rapps/rapps/abiword28x.txt (added) +++ trunk/reactos/base/applications/rapps/rapps/abiword28x.txt [iso-8859-1] Tue Jun 1 08:43:47 2010 @@ -1,0 +1,21 @@ +; UTF-8 + +[Section] +Name = AbiWord +Version = 2.8.5 +Licence = GPL +Description = Word processor. +Size = 7.9MB +Category = 6 +URLSite =
http://www.abisource.com/
+URLDownload =
http://www.abisource.com/downloads/abiword/2.8.5/Windows/abiword-setup-2.8.…
+CDPath = none + +[Section.0407] +Description = Textverarbeitung. + +[Section.040a] +Description = Procesador de textos. + +[Section.0415] +Description = Edytor tekstu. Propchange: trunk/reactos/base/applications/rapps/rapps/abiword28x.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/reactos/base/applications/rapps/rapps/firefox36.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
============================================================================== --- trunk/reactos/base/applications/rapps/rapps/firefox36.txt (added) +++ trunk/reactos/base/applications/rapps/rapps/firefox36.txt [iso-8859-1] Tue Jun 1 08:43:47 2010 @@ -1,0 +1,42 @@ +; UTF-8 + +[Section] +Name = Mozilla Firefox 3.6 +Version = 3.6.3 +Licence = MPL/GPL/LGPL +Description = The most popular and one of the best free Web Browsers out there. +Size = 8.0M +Category = 5 +URLSite =
http://www.mozilla.com/en-US/
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6.3/win32/en…
+CDPath = none + +[Section.0407] +Description = Der populärste und einer der besten freien Webbrowser. +Size = 7.8M +URLSite =
http://www.mozilla-europe.org/de/
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6.3/win32/de…
+ +[Section.040a] +Description = El más popular y uno de los mejores navegadores web gratuitos que hay. +Size = 7.8M +URLSite =
http://www.mozilla-europe.org/es/
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6.3/win32/es…
+ +[Section.0414] +Description = Mest populære og best også gratis nettleserene der ute. +Size = 7.8M +URLSite =
http://www.mozilla-europe.org/no/
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6.3/win32/nb…
+ +[Section.0415] +Description = Najpopularniejsza i jedna z najlepszych darmowych przeglÄ darek internetowych. +Size = 8.6M +URLSite =
http://www.mozilla-europe.org/pl/
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6.3/win32/pl…
+ +[Section.0419] +Description = Ðдин из ÑамÑÑ Ð¿Ð¾Ð¿ÑлÑÑнÑÑ Ð¸ лÑÑÑÐ¸Ñ Ð±ÐµÑплаÑнÑÑ Ð±ÑаÑзеÑов. +Size = 8.2M +URLSite =
http://www.mozilla-europe.org/ru/
+URLDownload =
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/3.6.3/win32/ru…
Propchange: trunk/reactos/base/applications/rapps/rapps/firefox36.txt ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/rapps/rapps/rosbe.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
============================================================================== --- trunk/reactos/base/applications/rapps/rapps/rosbe.txt [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/rapps/rosbe.txt [iso-8859-1] Tue Jun 1 08:43:47 2010 @@ -2,13 +2,13 @@ [Section] Name = ReactOS Build Environment -Version = 1.5.1 +Version = 1.5.1.1 Licence = GPL Description = Allows you to build the ReactOS Source. For more instructions see ReactOS wiki. -Size = 13.5MB +Size = 13.8MB Category = 7 -URLSite =
http://reactos.org/wiki/Build_Environment/
-URLDownload =
http://ovh.dl.sourceforge.net/sourceforge/reactos/RosBE-1.5.1.exe
+URLSite =
http://reactos.org/wiki/Build_Environment
+URLDownload =
http://ovh.dl.sourceforge.net/sourceforge/reactos/RosBE-1.5.1.1.exe
CDPath = none [Section.0407] Modified: trunk/reactos/base/applications/rapps/rapps/scite.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/ra…
============================================================================== --- trunk/reactos/base/applications/rapps/rapps/scite.txt [iso-8859-1] (original) +++ trunk/reactos/base/applications/rapps/rapps/scite.txt [iso-8859-1] Tue Jun 1 08:43:47 2010 @@ -2,13 +2,13 @@ [Section] Name = SciTE -Version = 2.11 +Version = 2.12 Licence = Freeware Description = SciTE is a SCIntilla based Text Editor. Originally built to demonstrate Scintilla, it has grown to be a generally useful editor with facilities for building and running programs. Size = 0.6M Category = 7 URLSite =
http://www.scintilla.org/
-URLDownload =
http://ovh.dl.sourceforge.net/sourceforge/scintilla/Sc211.exe
+URLDownload =
http://ovh.dl.sourceforge.net/sourceforge/scintilla/Sc212.exe
CDPath = none [Section.0407]
14 years, 6 months
1
0
0
0
[cgutman] 47506: [NPFS] - Acquire the cancel spin lock before calling IoSetCancelRoutine - Remove the old cancellation code - Don't use the CCB stored in the IRP because it could be invalid depending on the state of the IRP - Simplify thread termination - Fixes random crash during rpcrt4:ndr_marshall test
by cgutman@svn.reactos.org
Author: cgutman Date: Tue Jun 1 04:44:15 2010 New Revision: 47506 URL:
http://svn.reactos.org/svn/reactos?rev=47506&view=rev
Log: [NPFS] - Acquire the cancel spin lock before calling IoSetCancelRoutine - Remove the old cancellation code - Don't use the CCB stored in the IRP because it could be invalid depending on the state of the IRP - Simplify thread termination - Fixes random crash during rpcrt4:ndr_marshall test Modified: trunk/reactos/drivers/filesystems/npfs/rw.c Modified: trunk/reactos/drivers/filesystems/npfs/rw.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/npfs/r…
============================================================================== --- trunk/reactos/drivers/filesystems/npfs/rw.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/npfs/rw.c [iso-8859-1] Tue Jun 1 04:44:15 2010 @@ -122,14 +122,9 @@ ULONG CurrentCount; ULONG Count = 0, i; PIRP Irp = NULL; - PIRP NextIrp; NTSTATUS Status; - BOOLEAN Terminate = FALSE; - BOOLEAN Cancel = FALSE; PIO_STACK_LOCATION IoStack = NULL; - PNPFS_CONTEXT Context; - PNPFS_CONTEXT NextContext; - PNPFS_CCB Ccb; + KIRQL OldIrql; KeLockMutex(&ThreadContext->DeviceExt->PipeListLock); @@ -137,29 +132,23 @@ { CurrentCount = ThreadContext->Count; KeUnlockMutex(&ThreadContext->DeviceExt->PipeListLock); - if (Irp) - { - if (Cancel) - { - Irp->IoStatus.Status = STATUS_CANCELLED; - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - } - else - { - switch (IoStack->MajorFunction) - { + IoAcquireCancelSpinLock(&OldIrql); + if (Irp && IoSetCancelRoutine(Irp, NULL) != NULL) + { + IoReleaseCancelSpinLock(OldIrql); + IoStack = IoGetCurrentIrpStackLocation(Irp); + switch (IoStack->MajorFunction) + { case IRP_MJ_READ: NpfsRead(IoStack->DeviceObject, Irp); break; default: ASSERT(FALSE); - } - } - } - if (Terminate) - { - break; + } + } + else + { + IoReleaseCancelSpinLock(OldIrql); } Status = KeWaitForMultipleObjects(CurrentCount, ThreadContext->WaitObjectArray, @@ -183,35 +172,6 @@ ThreadContext->DeviceExt->EmptyWaiterCount++; ThreadContext->WaitObjectArray[Count] = ThreadContext->WaitObjectArray[ThreadContext->Count]; ThreadContext->WaitIrpArray[Count] = ThreadContext->WaitIrpArray[ThreadContext->Count]; - - Cancel = (NULL == IoSetCancelRoutine(Irp, NULL)); - Context = (PNPFS_CONTEXT)&Irp->Tail.Overlay.DriverContext; - IoStack = IoGetCurrentIrpStackLocation(Irp); - - if (Cancel) - { - Ccb = IoStack->FileObject->FsContext2; - ExAcquireFastMutex(&Ccb->DataListLock); - RemoveEntryList(&Context->ListEntry); - switch (IoStack->MajorFunction) - { - case IRP_MJ_READ: - if (!IsListEmpty(&Ccb->ReadRequestListHead)) - { - /* put the next request on the wait list */ - NextContext = CONTAINING_RECORD(Ccb->ReadRequestListHead.Flink, NPFS_CONTEXT, ListEntry); - ThreadContext->WaitObjectArray[ThreadContext->Count] = NextContext->WaitEvent; - NextIrp = CONTAINING_RECORD(NextContext, IRP, Tail.Overlay.DriverContext); - ThreadContext->WaitIrpArray[ThreadContext->Count] = NextIrp; - ThreadContext->Count++; - ThreadContext->DeviceExt->EmptyWaiterCount--; - } - break; - default: - ASSERT(FALSE); - } - ExReleaseFastMutex(&Ccb->DataListLock); - } } else { @@ -235,7 +195,8 @@ /* it exist an other thread with empty wait slots, we can remove our thread from the list */ RemoveEntryList(&ThreadContext->ListEntry); ThreadContext->DeviceExt->EmptyWaiterCount -= MAXIMUM_WAIT_OBJECTS - 1; - Terminate = TRUE; + KeUnlockMutex(&ThreadContext->DeviceExt->PipeListLock); + break; } } ExFreePool(ThreadContext);
14 years, 6 months
1
0
0
0
← Newer
1
...
38
39
40
41
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
Results per page:
10
25
50
100
200