fixed BaseAddress
authorChristoph von Wittich <christoph_vw@reactos.org>
Fri, 2 Dec 2005 12:47:42 +0000 (12:47 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Fri, 2 Dec 2005 12:47:42 +0000 (12:47 +0000)
svn path=/trunk/; revision=19826

reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp

index 534f600..d95a6c2 100644 (file)
@@ -90,6 +90,8 @@ MSVCBackend::_generate_vcproj ( const Module& module )
        defines.push_back ( "_CRT_NON_CONFORMING_SWPRINTFS" );\r
        defines.push_back ( "STDCALL=__stdcall" );\r
 \r
+       string baseaddr;\r
+\r
        while ( ifs_list.size() )\r
        {\r
                const IfableData& data = *ifs_list.back();\r
@@ -138,6 +140,12 @@ MSVCBackend::_generate_vcproj ( const Module& module )
                        else\r
                                defines.push_back ( defs[i]->name );\r
                }\r
+               for ( i = 0; i < data.properties.size(); i++ )\r
+               {\r
+                       Property& prop = *data.properties[i];\r
+                       if ( strstr ( module.baseaddress.c_str(), prop.name.c_str() ) )\r
+                               baseaddr = prop.value;\r
+               }\r
        }\r
 \r
        vector<string> header_files;\r
@@ -345,7 +353,7 @@ MSVCBackend::_generate_vcproj ( const Module& module )
                                fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /DRIVER /ALIGN:0x20 /SUBSYSTEM:NATIVE /SECTION:INIT,D /NODEFAULTLIB /IGNORE:4001,4037,4039,4065,4070,4078,4087,4089,4096\"\r\n" );\r
                                fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );\r
                                fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"%s\"\r\n", module.entrypoint == "" ? "DriverEntry" : module.entrypoint.c_str ());\r
-                               fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", module.baseaddress == "" ? "0x10000" : module.baseaddress.c_str ());   \r
+                               fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr == "" ? "0x10000" : baseaddr.c_str ());       \r
                        }\r
                        else if ( exe )\r
                        {\r
@@ -354,14 +362,14 @@ MSVCBackend::_generate_vcproj ( const Module& module )
                                        fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /SUBSYSTEM:NATIVE /NODEFAULTLIB /SECTION:INIT,D /ALIGN:0x80\"\r\n" );\r
                                        fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );\r
                                        fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"KiSystemStartup\"\r\n" );\r
-                                       fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", module.baseaddress.c_str ());  \r
+                                       fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr.c_str ());    \r
                                }\r
                                else if ( module.type == NativeCUI )\r
                                {\r
                                        fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /SUBSYSTEM:NATIVE /NODEFAULTLIB /ALIGN:0x20\"\r\n" );\r
                                        fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );\r
                                        fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"NtProcessStartup\"\r\n" );\r
-                                       fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", module.baseaddress.c_str ());  \r
+                                       fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr.c_str ());    \r
                                }\r
                                else if ( module.type == Win32CUI || module.type == Win32GUI )\r
                                {\r
@@ -371,7 +379,7 @@ MSVCBackend::_generate_vcproj ( const Module& module )
                        else if ( dll )\r
                        {\r
                                fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"%s\"\r\n", module.entrypoint == "" ? "DllMain" : module.entrypoint.c_str ());\r
-                               fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", module.baseaddress == "" ? "0x40000" : module.baseaddress.c_str ());\r
+                               fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr == "" ? "0x40000" : baseaddr.c_str ());\r
                        }\r
                        fprintf ( OUT, "\t\t\t\tTargetMachine=\"%d\"/>\r\n", 1 );\r
                }\r