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
October 2005
----- 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
26 participants
737 discussions
Start a n
N
ew thread
[royce] 18759: added <linkerscript> and corrected some mistakes to the best of my understanding
by royce@svn.reactos.com
added <linkerscript> and corrected some mistakes to the best of my understanding can't figure out (based on current definition) how to define <module> as allowing only a single <linkerscript>, but allowing it anywhere within the sub-elements of <module> Modified: trunk/reactos/tools/rbuild/project.dtd _____ Modified: trunk/reactos/tools/rbuild/project.dtd --- trunk/reactos/tools/rbuild/project.dtd 2005-10-24 19:38:58 UTC (rev 18758) +++ trunk/reactos/tools/rbuild/project.dtd 2005-10-24 20:00:48 UTC (rev 18759) @@ -15,13 +15,13 @@ <!-- rbuild project DTD --> -<!ELEMENT bootstrap ANY> +<!ELEMENT bootstrap EMPTY> <!ATTLIST bootstrap base %Text; #IMPLIED nameoncd %Text; #IMPLIED > -<!ELEMENT cdfile ANY> +<!ELEMENT cdfile (#PCDATA)> <!ATTLIST cdfile base %Text; #IMPLIED nameoncd %Text; #IMPLIED @@ -45,7 +45,7 @@ first (true|false) "false" > -<!ELEMENT group (cdfile+|directory+|file+|property+)+> +<!ELEMENT group (cdfile*|directory*|file*|property*)+> <!ELEMENT if (compilerflag*|define*|directory*|file*|if*|group*|property*)+> <!ATTLIST if @@ -63,11 +63,16 @@ definition %Text; #REQUIRED > -<!ELEMENT library ANY> +<!ELEMENT library (#PCDATA)> -<!ELEMENT linkerflag ANY> +<!ELEMENT linkerflag (#PCDATA)> -<!ELEMENT module (bootstrap*|importlibrary*|define*|include*|library*|directory*|file*|li nkerflag*)*> +<!ELEMENT linkerscript (#PCDATA)> +<!ATTLIST linkerscript + base %Text; #IMPLIED +> + +<!ELEMENT module (bootstrap*|importlibrary*|define*|include*|library*|directory*|file*|li nkerflag*|linkerscript?)*> <!ATTLIST module if %Text; #IMPLIED ifnot %Text; #IMPLIED
19 years, 2 months
1
0
0
0
[chorns] 18758: Implement linkerscript element
by chorns@svn.reactos.com
Implement linkerscript element Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Modified: trunk/reactos/tools/rbuild/doc/rbuild.txt Added: trunk/reactos/tools/rbuild/linkerscript.cpp Modified: trunk/reactos/tools/rbuild/module.cpp Modified: trunk/reactos/tools/rbuild/rbuild.h Modified: trunk/reactos/tools/rbuild/rbuild.mak _____ Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp --- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp 2005-10-24 18:47:33 UTC (rev 18757) +++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp 2005-10-24 19:38:58 UTC (rev 18758) @@ -1417,12 +1417,18 @@ { string target ( GetTargetMacro ( module ) ); string target_folder ( GetDirectory ( GetTargetFilename ( module, NULL ) ) ); - string def_file = GetDefinitionFilename (); + string definitionFilename = GetDefinitionFilename (); + string linkerScriptArgument; + if ( module.linkerScript != NULL ) + linkerScriptArgument = ssprintf ( "-Wl,-T,%s", module.linkerScript->directory.c_str () ); + else + linkerScriptArgument = ""; + fprintf ( fMakefile, "%s: %s %s $(RSYM_TARGET) $(PEFIXUP_TARGET) | %s\n", target.c_str (), - def_file.c_str (), + definitionFilename.c_str (), dependencies.c_str (), target_folder.c_str () ); fprintf ( fMakefile, "\t$(ECHO_LD)\n" ); @@ -1432,19 +1438,20 @@ { string temp_exp = ros_temp + module.name + ".temp.exp"; CLEAN_FILE ( temp_exp ); - + string killAt = module.mangledSymbols ? "" : "--kill-at"; fprintf ( fMakefile, "\t${dlltool} --dllname %s --def %s --output-exp %s %s\n", targetName.c_str (), - def_file.c_str (), + definitionFilename.c_str (), temp_exp.c_str (), killAt.c_str () ); fprintf ( fMakefile, - "\t%s %s %s -o %s %s %s %s\n", + "\t%s %s %s -o %s %s %s %s %s\n", linker.c_str (), linkerParameters.c_str (), + linkerScriptArgument.c_str (), temp_exp.c_str (), target.c_str (), objectsMacro.c_str (), @@ -1463,9 +1470,10 @@ else { fprintf ( fMakefile, - "\t%s %s -o %s %s %s %s\n", + "\t%s %s -o %s %s %s %s %s\n", linker.c_str (), linkerParameters.c_str (), + linkerScriptArgument.c_str (), target.c_str (), objectsMacro.c_str (), libsMacro.c_str (), _____ Modified: trunk/reactos/tools/rbuild/doc/rbuild.txt --- trunk/reactos/tools/rbuild/doc/rbuild.txt 2005-10-24 18:47:33 UTC (rev 18757) +++ trunk/reactos/tools/rbuild/doc/rbuild.txt 2005-10-24 19:38:58 UTC (rev 18758) @@ -129,7 +129,7 @@ None. Elements: - bootstrap, component, define, dependency, directory, file, if, importlibrary, include, invoke, library, property. + bootstrap, component, define, dependency, directory, file, if, importlibrary, include, invoke, library, linkerscript, property. Module types @@ -466,6 +466,23 @@ None. +Linkerscript +------------ +A linkerscript element specifies the filename of a binutils linker script. + +Syntax: + <linkerscript base="mymodule">MyLinkerScript</linkerscript> + +Attributes: + base - Module which the value of this element is relative to. This attribute is optional. If left out, the linker script is relative to the position of the top-level xml build file. + +Value: + Relative linker script filename. + +Elements: + None. + + Property -------- A property element specifies the name and value of a property that can be used for conditional processing of the xml build file. _____ Added: trunk/reactos/tools/rbuild/linkerscript.cpp --- trunk/reactos/tools/rbuild/linkerscript.cpp 2005-10-24 18:47:33 UTC (rev 18757) +++ trunk/reactos/tools/rbuild/linkerscript.cpp 2005-10-24 19:38:58 UTC (rev 18758) @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2005 Casper S. Hornstrup + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include "pch.h" +#include <assert.h> + +#include "rbuild.h" + +using std::string; +using std::vector; + +LinkerScript::LinkerScript ( const Project& project, + const Module* module, + const XMLElement& node ) + : project ( project ), + module ( module ), + node ( node ), + baseModule ( NULL ) +{ +} + +LinkerScript::~LinkerScript () +{ +} + +void +LinkerScript::ProcessXML() +{ + const XMLAttribute* att; + att = node.GetAttribute ( "base", + false ); + if ( att ) + { + bool referenceResolved = false; + if ( att->value == project.name ) + { + basePath = "."; + referenceResolved = true; + } + else + { + const Module* base = project.LocateModule ( att->value ); + if ( base != NULL ) + { + baseModule = base; + basePath = base->GetBasePath (); + referenceResolved = true; + } + } + if ( !referenceResolved ) + throw InvalidBuildFileException ( + node.location, + "<linkerscript> attribute 'base' references non-existant project or module '%s'", + att->value.c_str() ); + directory = NormalizeFilename ( basePath + SSEP + node.value ); + } + else + directory = NormalizeFilename ( node.value ); +} Property changes on: trunk/reactos/tools/rbuild/linkerscript.cpp ___________________________________________________________________ Name: svn:eol-style + native _____ Modified: trunk/reactos/tools/rbuild/module.cpp --- trunk/reactos/tools/rbuild/module.cpp 2005-10-24 18:47:33 UTC (rev 18757) +++ trunk/reactos/tools/rbuild/module.cpp 2005-10-24 19:38:58 UTC (rev 18758) @@ -211,6 +211,7 @@ node (moduleNode), importLibrary (NULL), bootstrap (NULL), + linkerScript (NULL), pch (NULL), cplusplus (false), host (HostDefault) @@ -372,6 +373,8 @@ delete linkerFlags[i]; for ( i = 0; i < stubbedComponents.size(); i++ ) delete stubbedComponents[i]; + if ( linkerScript ) + delete linkerScript; if ( pch ) delete pch; } @@ -409,6 +412,8 @@ for ( i = 0; i < stubbedComponents.size(); i++ ) stubbedComponents[i]->ProcessXML(); non_if_data.ProcessXML(); + if ( linkerScript ) + linkerScript->ProcessXML(); if ( pch ) pch->ProcessXML(); } @@ -556,6 +561,15 @@ linkerFlags.push_back ( new LinkerFlag ( project, this, e ) ); subs_invalid = true; } + else if ( e.name == "linkerscript" ) + { + if ( linkerScript ) + throw InvalidBuildFileException ( + e.location, + "Only one <linkerscript> is valid per module" ); + linkerScript = new LinkerScript ( project, this, e ); + subs_invalid = true; + } else if ( e.name == "component" ) { stubbedComponents.push_back ( new StubbedComponent ( this, e ) ); _____ Modified: trunk/reactos/tools/rbuild/rbuild.h --- trunk/reactos/tools/rbuild/rbuild.h 2005-10-24 18:47:33 UTC (rev 18757) +++ trunk/reactos/tools/rbuild/rbuild.h 2005-10-24 19:38:58 UTC (rev 18758) @@ -73,6 +73,7 @@ class If; class CompilerFlag; class LinkerFlag; +class LinkerScript; class Property; class TestSupportCode; class WineResource; @@ -230,6 +231,7 @@ std::vector<CompilerFlag*> compilerFlags; std::vector<LinkerFlag*> linkerFlags; std::vector<StubbedComponent*> stubbedComponents; + LinkerScript* linkerScript; PchFile* pch; bool cplusplus; std::string prefix; @@ -476,6 +478,24 @@ }; +class LinkerScript +{ +public: + const Project& project; + const Module* module; + const XMLElement& node; + const Module* baseModule; + std::string directory; + std::string basePath; + + LinkerScript ( const Project& project, + const Module* module, + const XMLElement& node ); + ~LinkerScript (); + void ProcessXML(); +}; + + class Property { public: _____ Modified: trunk/reactos/tools/rbuild/rbuild.mak --- trunk/reactos/tools/rbuild/rbuild.mak 2005-10-24 18:47:33 UTC (rev 18757) +++ trunk/reactos/tools/rbuild/rbuild.mak 2005-10-24 19:38:58 UTC (rev 18758) @@ -163,6 +163,7 @@ include.cpp \ installfile.cpp \ linkerflag.cpp \ + linkerscript.cpp \ module.cpp \ project.cpp \ ssprintf.cpp \ @@ -299,6 +300,10 @@ $(ECHO_CC) ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ +$(RBUILD_INT_)linkerscript.o: $(RBUILD_BASE_)linkerscript.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) + $(ECHO_CC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + $(RBUILD_INT_)module.o: $(RBUILD_BASE_)module.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) $(ECHO_CC) ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
19 years, 2 months
1
0
0
0
[greatlrd] 18757: prepare the rest of directdraw syscall using cache info, that will make our ddraw.dll work evently in reactos.
by greatlrd@svn.reactos.com
prepare the rest of directdraw syscall using cache info, that will make our ddraw.dll work evently in reactos. left todo implemet the rest stub. Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c _____ Modified: trunk/reactos/subsys/win32k/ntddraw/ddraw.c --- trunk/reactos/subsys/win32k/ntddraw/ddraw.c 2005-10-24 18:03:57 UTC (rev 18756) +++ trunk/reactos/subsys/win32k/ntddraw/ddraw.c 2005-10-24 18:47:33 UTC (rev 18757) @@ -442,16 +442,27 @@ ) { DWORD ddRVal; + PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; + /* backup the orignal PDev and info */ + lgpl = puUnlockData->lpDD; + + /* use our cache version instead */ + puUnlockData->lpDD = &pDirectDraw->Global; + + /* make the call */ if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_UNLOCK)) ddRVal = DDHAL_DRIVER_NOTHANDLED; else ddRVal = pDirectDraw->Surf.Unlock(puUnlockData); + /* But back the orignal PDev */ + puUnlockData->lpDD = lgpl; + GDIOBJ_UnlockObjByPtr(pDirectDraw); return ddRVal; } @@ -463,16 +474,27 @@ ) { DWORD ddRVal; + PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceDest, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; + /* backup the orignal PDev and info */ + lgpl = puBltData->lpDD; + + /* use our cache version instead */ + puBltData->lpDD = &pDirectDraw->Global; + + /* make the call */ if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_BLT)) ddRVal = DDHAL_DRIVER_NOTHANDLED; else ddRVal = pDirectDraw->Surf.Blt(puBltData); + /* But back the orignal PDev */ + puBltData->lpDD = lgpl; + GDIOBJ_UnlockObjByPtr(pDirectDraw); return ddRVal; } @@ -483,16 +505,27 @@ ) { DWORD ddRVal; + PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; + /* backup the orignal PDev and info */ + lgpl = puSetColorKeyData->lpDD; + + /* use our cache version instead */ + puSetColorKeyData->lpDD = &pDirectDraw->Global; + + /* make the call */ if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_SETCOLORKEY)) ddRVal = DDHAL_DRIVER_NOTHANDLED; else ddRVal = pDirectDraw->Surf.SetColorKey(puSetColorKeyData); + /* But back the orignal PDev */ + puSetColorKeyData->lpDD = lgpl; + GDIOBJ_UnlockObjByPtr(pDirectDraw); return ddRVal; } @@ -505,16 +538,27 @@ ) { DWORD ddRVal; + PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceAttached, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; + /* backup the orignal PDev and info */ + lgpl = puAddAttachedSurfaceData->lpDD; + + /* use our cache version instead */ + puAddAttachedSurfaceData->lpDD = &pDirectDraw->Global; + + /* make the call */ if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_ADDATTACHEDSURFACE)) ddRVal = DDHAL_DRIVER_NOTHANDLED; else ddRVal = pDirectDraw->Surf.AddAttachedSurface(puAddAttachedSurfaceData); + /* But back the orignal PDev */ + puAddAttachedSurfaceData->lpDD = lgpl; + GDIOBJ_UnlockObjByPtr(pDirectDraw); return ddRVal; } @@ -525,16 +569,27 @@ ) { DWORD ddRVal; + PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; + /* backup the orignal PDev and info */ + lgpl = puGetBltStatusData->lpDD; + + /* use our cache version instead */ + puGetBltStatusData->lpDD = &pDirectDraw->Global; + + /* make the call */ if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_GETBLTSTATUS)) ddRVal = DDHAL_DRIVER_NOTHANDLED; else ddRVal = pDirectDraw->Surf.GetBltStatus(puGetBltStatusData); + /* But back the orignal PDev */ + puGetBltStatusData->lpDD = lgpl; + GDIOBJ_UnlockObjByPtr(pDirectDraw); return ddRVal; } @@ -545,16 +600,27 @@ ) { DWORD ddRVal; + PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurface, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; + /* backup the orignal PDev and info */ + lgpl = puGetFlipStatusData->lpDD; + + /* use our cache version instead */ + puGetFlipStatusData->lpDD = &pDirectDraw->Global; + + /* make the call */ if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_GETFLIPSTATUS)) ddRVal = DDHAL_DRIVER_NOTHANDLED; else ddRVal = pDirectDraw->Surf.GetFlipStatus(puGetFlipStatusData); + /* But back the orignal PDev */ + puGetFlipStatusData->lpDD = lgpl; + GDIOBJ_UnlockObjByPtr(pDirectDraw); return ddRVal; } @@ -566,16 +632,27 @@ ) { DWORD ddRVal; + PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceDestination, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; + /* backup the orignal PDev and info */ + lgpl = puUpdateOverlayData->lpDD; + + /* use our cache version instead */ + puUpdateOverlayData->lpDD = &pDirectDraw->Global; + + /* make the call */ if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_UPDATEOVERLAY)) ddRVal = DDHAL_DRIVER_NOTHANDLED; else ddRVal = pDirectDraw->Surf.UpdateOverlay(puUpdateOverlayData); + /* But back the orignal PDev */ + puUpdateOverlayData->lpDD = lgpl; + GDIOBJ_UnlockObjByPtr(pDirectDraw); return ddRVal; } @@ -587,16 +664,27 @@ ) { DWORD ddRVal; + PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hSurfaceDestination, GDI_OBJECT_TYPE_DIRECTDRAW); if (pDirectDraw == NULL) return DDHAL_DRIVER_NOTHANDLED; + /* backup the orignal PDev and info */ + lgpl = puSetOverlayPositionData->lpDD; + + /* use our cache version instead */ + puSetOverlayPositionData->lpDD = &pDirectDraw->Global; + + /* make the call */ if (!(pDirectDraw->Surf.dwFlags & DDHAL_SURFCB32_SETOVERLAYPOSITION)) ddRVal = DDHAL_DRIVER_NOTHANDLED; else ddRVal = pDirectDraw->Surf.SetOverlayPosition(puSetOverlayPositionData); + /* But back the orignal PDev */ + puSetOverlayPositionData->lpDD = lgpl; + GDIOBJ_UnlockObjByPtr(pDirectDraw); return ddRVal; } @@ -698,13 +786,25 @@ ) { DWORD ddRVal = DDHAL_DRIVER_NOTHANDLED; + PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDrawLocal, GDI_OBJECT_TYPE_DIRECTDRAW); + /* backup the orignal PDev and info */ + lgpl = puGetAvailDriverMemoryData->lpDD; + + /* use our cache version instead */ + puGetAvailDriverMemoryData->lpDD = &pDirectDraw->Global; + + /* make the call */ // ddRVal = pDirectDraw->DdGetAvailDriverMemory(puGetAvailDriverMemoryData); GDIOBJ_UnlockObjByPtr(pDirectDraw); + + /* But back the orignal PDev */ + puGetAvailDriverMemoryData->lpDD = lgpl; + return ddRVal; } @@ -717,12 +817,23 @@ ) { DWORD ddRVal; + PDD_DIRECTDRAW_GLOBAL lgpl; PDD_DIRECTDRAW pDirectDraw = GDIOBJ_LockObj(hDirectDraw, GDI_OBJECT_TYPE_DIRECTDRAW); + /* backup the orignal PDev and info */ + lgpl = puSetExclusiveModeData->lpDD; + + /* use our cache version instead */ + puSetExclusiveModeData->lpDD = &pDirectDraw->Global; + + /* make the call */ ddRVal = pDirectDraw->DdSetExclusiveMode(puSetExclusiveModeData); GDIOBJ_UnlockObjByPtr(pDirectDraw); + + /* But back the orignal PDev */ + puSetExclusiveModeData->lpDD = lgpl; return ddRVal; }
19 years, 2 months
1
0
0
0
[hbirr] 18756: Fixed the calculation of the hash for the process data.
by hbirr@svn.reactos.com
Fixed the calculation of the hash for the process data. Modified: trunk/reactos/subsys/csrss/api/process.c _____ Modified: trunk/reactos/subsys/csrss/api/process.c --- trunk/reactos/subsys/csrss/api/process.c 2005-10-24 18:00:46 UTC (rev 18755) +++ trunk/reactos/subsys/csrss/api/process.c 2005-10-24 18:03:57 UTC (rev 18756) @@ -37,7 +37,7 @@ ULONG hash; PCSRSS_PROCESS_DATA pProcessData; - hash = ((ULONG_PTR)ProcessId & ~0x3) % (sizeof(ProcessData) / sizeof(*ProcessData)); + hash = ((ULONG_PTR)ProcessId >> 2) % (sizeof(ProcessData) / sizeof(*ProcessData)); LOCK; @@ -59,7 +59,7 @@ CLIENT_ID ClientId; NTSTATUS Status; - hash = ((ULONG_PTR)ProcessId & ~0x3) % (sizeof(ProcessData) / sizeof(*ProcessData)); + hash = ((ULONG_PTR)ProcessId >> 2) % (sizeof(ProcessData) / sizeof(*ProcessData)); LOCK; @@ -100,7 +100,10 @@ RtlFreeHeap(CsrssApiHeap, 0, pProcessData); pProcessData = NULL; } - RtlInitializeCriticalSection(&pProcessData->HandleTableLock); + else + { + RtlInitializeCriticalSection(&pProcessData->HandleTableLock); + } } } else @@ -110,7 +113,7 @@ UNLOCK; if (pProcessData == NULL) { - DbgPrint("CSR: CsrGetProcessData() failed\n"); + DPRINT1("CsrCreateProcessData() failed\n"); } return pProcessData; } @@ -121,7 +124,7 @@ UINT c; PCSRSS_PROCESS_DATA pProcessData, pPrevProcessData = NULL; - hash = ((ULONG_PTR)Pid & ~0x3) % (sizeof(ProcessData) / sizeof(*ProcessData)); + hash = ((ULONG_PTR)Pid >> 2) % (sizeof(ProcessData) / sizeof(*ProcessData)); LOCK; @@ -142,9 +145,7 @@ } if (pProcessData->Console) { - RtlEnterCriticalSection(&ProcessDataLock); RemoveEntryList(&pProcessData->ProcessEntry); - RtlLeaveCriticalSection(&ProcessDataLock); } if (pProcessData->HandleTable) {
19 years, 2 months
1
0
0
0
[hbirr] 18755: Changed the indentation to a human readable format (no code change).
by hbirr@svn.reactos.com
Changed the indentation to a human readable format (no code change). Modified: trunk/reactos/ntoskrnl/mm/pe.c _____ Modified: trunk/reactos/ntoskrnl/mm/pe.c --- trunk/reactos/ntoskrnl/mm/pe.c 2005-10-24 17:55:50 UTC (rev 18754) +++ trunk/reactos/ntoskrnl/mm/pe.c 2005-10-24 18:00:46 UTC (rev 18755) @@ -23,91 +23,66 @@ static ULONG SectionCharacteristicsToProtect[16] = { - PAGE_NOACCESS, /* 0 = NONE */ - PAGE_NOACCESS, /* 1 = SHARED */ - PAGE_EXECUTE, /* 2 = EXECUTABLE */ - PAGE_EXECUTE, /* 3 = EXECUTABLE, SHARED */ - PAGE_READONLY, /* 4 = READABLE */ - PAGE_READONLY, /* 5 = READABLE, SHARED */ - PAGE_EXECUTE_READ, /* 6 = READABLE, EXECUTABLE */ - PAGE_EXECUTE_READ, /* 7 = READABLE, EXECUTABLE, SHARED */ - /* - * FIXME? do we really need the WriteCopy field in segments? can't we use - * PAGE_WRITECOPY here? - */ - PAGE_READWRITE, /* 8 = WRITABLE */ - PAGE_READWRITE, /* 9 = WRITABLE, SHARED */ - PAGE_EXECUTE_READWRITE, /* 10 = WRITABLE, EXECUTABLE */ - PAGE_EXECUTE_READWRITE, /* 11 = WRITABLE, EXECUTABLE, SHARED */ - PAGE_READWRITE, /* 12 = WRITABLE, READABLE */ - PAGE_READWRITE, /* 13 = WRITABLE, READABLE, SHARED */ - PAGE_EXECUTE_READWRITE, /* 14 = WRITABLE, READABLE, EXECUTABLE */ - PAGE_EXECUTE_READWRITE, /* 15 = WRITABLE, READABLE, EXECUTABLE, SHARED */ + PAGE_NOACCESS, /* 0 = NONE */ + PAGE_NOACCESS, /* 1 = SHARED */ + PAGE_EXECUTE, /* 2 = EXECUTABLE */ + PAGE_EXECUTE, /* 3 = EXECUTABLE, SHARED */ + PAGE_READONLY, /* 4 = READABLE */ + PAGE_READONLY, /* 5 = READABLE, SHARED */ + PAGE_EXECUTE_READ, /* 6 = READABLE, EXECUTABLE */ + PAGE_EXECUTE_READ, /* 7 = READABLE, EXECUTABLE, SHARED */ + /* + * FIXME? do we really need the WriteCopy field in segments? can't we use + * PAGE_WRITECOPY here? + */ + PAGE_READWRITE, /* 8 = WRITABLE */ + PAGE_READWRITE, /* 9 = WRITABLE, SHARED */ + PAGE_EXECUTE_READWRITE, /* 10 = WRITABLE, EXECUTABLE */ + PAGE_EXECUTE_READWRITE, /* 11 = WRITABLE, EXECUTABLE, SHARED */ + PAGE_READWRITE, /* 12 = WRITABLE, READABLE */ + PAGE_READWRITE, /* 13 = WRITABLE, READABLE, SHARED */ + PAGE_EXECUTE_READWRITE, /* 14 = WRITABLE, READABLE, EXECUTABLE */ + PAGE_EXECUTE_READWRITE, /* 15 = WRITABLE, READABLE, EXECUTABLE, SHARED */ }; /* TODO: Intsafe should be made into a library, as it's generally useful */ -static __inline BOOLEAN Intsafe_CanAddULongPtr -( - IN ULONG_PTR Addend1, - IN ULONG_PTR Addend2 -) +static __inline BOOLEAN Intsafe_CanAddULongPtr(IN ULONG_PTR Addend1, IN ULONG_PTR Addend2) { - return Addend1 <= (MAXULONG_PTR - Addend2); + return Addend1 <= (MAXULONG_PTR - Addend2); } #ifndef MAXLONGLONG #define MAXLONGLONG ((LONGLONG)((~((ULONGLONG)0)) >> 1)) #endif -static __inline BOOLEAN Intsafe_CanAddLong64 -( - IN LONG64 Addend1, - IN LONG64 Addend2 -) +static __inline BOOLEAN Intsafe_CanAddLong64(IN LONG64 Addend1, IN LONG64 Addend2) { - return Addend1 <= (MAXLONGLONG - Addend2); + return Addend1 <= (MAXLONGLONG - Addend2); } -static __inline BOOLEAN Intsafe_CanAddULong32 -( - IN ULONG Addend1, - IN ULONG Addend2 -) +static __inline BOOLEAN Intsafe_CanAddULong32(IN ULONG Addend1, IN ULONG Addend2) { - return Addend1 <= (MAXULONG - Addend2); + return Addend1 <= (MAXULONG - Addend2); } -static __inline BOOLEAN Intsafe_AddULong32 -( - OUT PULONG Result, - IN ULONG Addend1, - IN ULONG Addend2 -) +static __inline BOOLEAN Intsafe_AddULong32(OUT PULONG Result, IN ULONG Addend1, IN ULONG Addend2) { - if(!Intsafe_CanAddULong32(Addend1, Addend2)) - return FALSE; + if(!Intsafe_CanAddULong32(Addend1, Addend2)) + return FALSE; - *Result = Addend1 + Addend2; - return TRUE; + *Result = Addend1 + Addend2; + return TRUE; } -static __inline BOOLEAN Intsafe_CanMulULong32 -( - IN ULONG Factor1, - IN ULONG Factor2 -) +static __inline BOOLEAN Intsafe_CanMulULong32(IN ULONG Factor1, IN ULONG Factor2) { - return Factor1 <= (MAXULONG / Factor2); + return Factor1 <= (MAXULONG / Factor2); } -static __inline BOOLEAN Intsafe_CanOffsetPointer -( - IN CONST VOID * Pointer, - IN SIZE_T Offset -) +static __inline BOOLEAN Intsafe_CanOffsetPointer(IN CONST VOID * Pointer, IN SIZE_T Offset) { - /* FIXME: (PVOID)MAXULONG_PTR isn't necessarily a valid address */ - return Intsafe_CanAddULongPtr((ULONG_PTR)Pointer, Offset); + /* FIXME: (PVOID)MAXULONG_PTR isn't necessarily a valid address */ + return Intsafe_CanAddULongPtr((ULONG_PTR)Pointer, Offset); } /* TODO: these are standard DDK/PSDK macros */ @@ -127,42 +102,37 @@ static __inline BOOLEAN IsPowerOf2(IN ULONG Number) { - if(Number == 0) - return FALSE; + if(Number == 0) + return FALSE; - while((Number % 2) == 0) - Number /= 2; + while((Number % 2) == 0) + Number /= 2; - return Number == 1; + return Number == 1; } static __inline ULONG ModPow2(IN ULONG Address, IN ULONG Alignment) { - ASSERT(IsPowerOf2(Alignment)); - return Address & (Alignment - 1); + ASSERT(IsPowerOf2(Alignment)); + return Address & (Alignment - 1); } static __inline BOOLEAN IsAligned(IN ULONG Address, IN ULONG Alignment) { - return ModPow2(Address, Alignment) == 0; + return ModPow2(Address, Alignment) == 0; } -static __inline BOOLEAN AlignUp -( - OUT PULONG AlignedAddress, - IN ULONG Address, - IN ULONG Alignment -) +static __inline BOOLEAN AlignUp(OUT PULONG AlignedAddress, IN ULONG Address, IN ULONG Alignment) { - ULONG nExcess = ModPow2(Address, Alignment); + ULONG nExcess = ModPow2(Address, Alignment); - if(nExcess == 0) - { - *AlignedAddress = Address; - return nExcess == 0; - } - else - return Intsafe_AddULong32(AlignedAddress, Address, Alignment - nExcess); + if(nExcess == 0) + { + *AlignedAddress = Address; + return nExcess == 0; + } + else + return Intsafe_AddULong32(AlignedAddress, Address, Alignment - nExcess); } #define PEFMT_FIELDS_EQUAL(TYPE1_, TYPE2_, FIELD_) \ @@ -176,568 +146,539 @@ [1] Microsoft Corporation, "Microsoft Portable Executable and Common Object File Format Specification", revision 6.0 (February 1999) */ -NTSTATUS NTAPI PeFmtCreateSection -( - IN CONST VOID * FileHeader, - IN SIZE_T FileHeaderSize, - IN PVOID File, - OUT PMM_IMAGE_SECTION_OBJECT ImageSectionObject, - OUT PULONG Flags, - IN PEXEFMT_CB_READ_FILE ReadFileCb, - IN PEXEFMT_CB_ALLOCATE_SEGMENTS AllocateSegmentsCb -) +NTSTATUS NTAPI PeFmtCreateSection(IN CONST VOID * FileHeader, + IN SIZE_T FileHeaderSize, + IN PVOID File, + OUT PMM_IMAGE_SECTION_OBJECT ImageSectionObject, + OUT PULONG Flags, + IN PEXEFMT_CB_READ_FILE ReadFileCb, + IN PEXEFMT_CB_ALLOCATE_SEGMENTS AllocateSegmentsCb) { - NTSTATUS nStatus; - ULONG cbFileHeaderOffsetSize = 0; - ULONG cbSectionHeadersOffset = 0; - ULONG cbSectionHeadersSize; - ULONG cbSectionHeadersOffsetSize = 0; - ULONG cbOptHeaderSize; - ULONG cbHeadersSize = 0; - ULONG nSectionAlignment; - ULONG nFileAlignment; - const IMAGE_DOS_HEADER * pidhDosHeader; - const IMAGE_NT_HEADERS32 * pinhNtHeader; - const IMAGE_OPTIONAL_HEADER32 * piohOptHeader; - const IMAGE_SECTION_HEADER * pishSectionHeaders; - PMM_SECTION_SEGMENT pssSegments; - LARGE_INTEGER lnOffset; - PVOID pBuffer; - ULONG nPrevVirtualEndOfSegment = 0; - ULONG nFileSizeOfHeaders = 0; - ULONG i; + NTSTATUS nStatus; + ULONG cbFileHeaderOffsetSize = 0; + ULONG cbSectionHeadersOffset = 0; + ULONG cbSectionHeadersSize; + ULONG cbSectionHeadersOffsetSize = 0; + ULONG cbOptHeaderSize; + ULONG cbHeadersSize = 0; + ULONG nSectionAlignment; + ULONG nFileAlignment; + const IMAGE_DOS_HEADER * pidhDosHeader; + const IMAGE_NT_HEADERS32 * pinhNtHeader; + const IMAGE_OPTIONAL_HEADER32 * piohOptHeader; + const IMAGE_SECTION_HEADER * pishSectionHeaders; + PMM_SECTION_SEGMENT pssSegments; + LARGE_INTEGER lnOffset; + PVOID pBuffer; + ULONG nPrevVirtualEndOfSegment = 0; + ULONG nFileSizeOfHeaders = 0; + ULONG i; - ASSERT(FileHeader); - ASSERT(FileHeaderSize > 0); - ASSERT(File); - ASSERT(ImageSectionObject); - ASSERT(ReadFileCb); - ASSERT(AllocateSegmentsCb); + ASSERT(FileHeader); + ASSERT(FileHeaderSize > 0); + ASSERT(File); + ASSERT(ImageSectionObject); + ASSERT(ReadFileCb); + ASSERT(AllocateSegmentsCb); - ASSERT(Intsafe_CanOffsetPointer(FileHeader, FileHeaderSize)); + ASSERT(Intsafe_CanOffsetPointer(FileHeader, FileHeaderSize)); - ASSERT(EXEFMT_LOAD_HEADER_SIZE >= sizeof(IMAGE_DOS_HEADER)); - ASSERT(((UINT_PTR)FileHeader % TYPE_ALIGNMENT(IMAGE_DOS_HEADER)) == 0); + ASSERT(EXEFMT_LOAD_HEADER_SIZE >= sizeof(IMAGE_DOS_HEADER)); + ASSERT(((UINT_PTR)FileHeader % TYPE_ALIGNMENT(IMAGE_DOS_HEADER)) == 0); #define DIE(ARGS_) { DPRINT ARGS_; goto l_Return; } - pBuffer = NULL; - pidhDosHeader = FileHeader; + pBuffer = NULL; + pidhDosHeader = FileHeader; - /* DOS HEADER */ - nStatus = STATUS_ROS_EXEFMT_UNKNOWN_FORMAT; + /* DOS HEADER */ + nStatus = STATUS_ROS_EXEFMT_UNKNOWN_FORMAT; - /* image too small to be an MZ executable */ - if(FileHeaderSize < sizeof(IMAGE_DOS_HEADER)) - DIE(("Too small to be an MZ executable, size is %lu\n", FileHeaderSize)); + /* image too small to be an MZ executable */ + if(FileHeaderSize < sizeof(IMAGE_DOS_HEADER)) + DIE(("Too small to be an MZ executable, size is %lu\n", FileHeaderSize)); - /* no MZ signature */ - if(pidhDosHeader->e_magic != IMAGE_DOS_SIGNATURE) - DIE(("No MZ signature found, e_magic is %hX\n", pidhDosHeader->e_magic)); + /* no MZ signature */ + if(pidhDosHeader->e_magic != IMAGE_DOS_SIGNATURE) + DIE(("No MZ signature found, e_magic is %hX\n", pidhDosHeader->e_magic)); - /* not a Windows executable */ - if(pidhDosHeader->e_lfanew <= 0) - DIE(("Not a Windows executable, e_lfanew is %d\n", pidhDosHeader->e_lfanew)); + /* not a Windows executable */ + if(pidhDosHeader->e_lfanew <= 0) + DIE(("Not a Windows executable, e_lfanew is %d\n", pidhDosHeader->e_lfanew)); - /* NT HEADER */ - nStatus = STATUS_INVALID_IMAGE_FORMAT; + /* NT HEADER */ + nStatus = STATUS_INVALID_IMAGE_FORMAT; - if(!Intsafe_AddULong32(&cbFileHeaderOffsetSize, pidhDosHeader->e_lfanew, RTL_SIZEOF_THROUGH_FIELD(IMAGE_NT_HEADERS32, FileHeader))) - DIE(("The DOS stub is too large, e_lfanew is %X\n", pidhDosHeader->e_lfanew)); + if(!Intsafe_AddULong32(&cbFileHeaderOffsetSize, pidhDosHeader->e_lfanew, RTL_SIZEOF_THROUGH_FIELD(IMAGE_NT_HEADERS32, FileHeader))) + DIE(("The DOS stub is too large, e_lfanew is %X\n", pidhDosHeader->e_lfanew)); - if(FileHeaderSize < cbFileHeaderOffsetSize) - pinhNtHeader = NULL; - else - { - /* - we already know that Intsafe_CanOffsetPointer(FileHeader, FileHeaderSize), - and FileHeaderSize >= cbFileHeaderOffsetSize, so this holds true too - */ - ASSERT(Intsafe_CanOffsetPointer(FileHeader, pidhDosHeader->e_lfanew)); - pinhNtHeader = (PVOID)((UINT_PTR)FileHeader + pidhDosHeader->e_lfanew); - } + if(FileHeaderSize < cbFileHeaderOffsetSize) + pinhNtHeader = NULL; + else + { + /* + * we already know that Intsafe_CanOffsetPointer(FileHeader, FileHeaderSize), + * and FileHeaderSize >= cbFileHeaderOffsetSize, so this holds true too + */ + ASSERT(Intsafe_CanOffsetPointer(FileHeader, pidhDosHeader->e_lfanew)); + pinhNtHeader = (PVOID)((UINT_PTR)FileHeader + pidhDosHeader->e_lfanew); + } - ASSERT(sizeof(IMAGE_NT_HEADERS32) <= sizeof(IMAGE_NT_HEADERS64)); - ASSERT(TYPE_ALIGNMENT(IMAGE_NT_HEADERS32) == TYPE_ALIGNMENT(IMAGE_NT_HEADERS64)); - ASSERT(RTL_SIZEOF_THROUGH_FIELD(IMAGE_NT_HEADERS32, FileHeader) == RTL_SIZEOF_THROUGH_FIELD(IMAGE_NT_HEADERS64, FileHeader)); - ASSERT(FIELD_OFFSET(IMAGE_NT_HEADERS32, OptionalHeader) == FIELD_OFFSET(IMAGE_NT_HEADERS64, OptionalHeader)); + ASSERT(sizeof(IMAGE_NT_HEADERS32) <= sizeof(IMAGE_NT_HEADERS64)); + ASSERT(TYPE_ALIGNMENT(IMAGE_NT_HEADERS32) == TYPE_ALIGNMENT(IMAGE_NT_HEADERS64)); + ASSERT(RTL_SIZEOF_THROUGH_FIELD(IMAGE_NT_HEADERS32, FileHeader) == RTL_SIZEOF_THROUGH_FIELD(IMAGE_NT_HEADERS64, FileHeader)); + ASSERT(FIELD_OFFSET(IMAGE_NT_HEADERS32, OptionalHeader) == FIELD_OFFSET(IMAGE_NT_HEADERS64, OptionalHeader)); - /* - the buffer doesn't contain the NT file header, or the alignment is wrong: we - need to read the header from the file - */ - if - ( - FileHeaderSize < cbFileHeaderOffsetSize || - (UINT_PTR)pinhNtHeader % TYPE_ALIGNMENT(IMAGE_NT_HEADERS32) != 0 - ) - { - ULONG cbNtHeaderSize; - ULONG cbReadSize; - PVOID pData; + /* + * the buffer doesn't contain the NT file header, or the alignment is wrong: we + * need to read the header from the file + */ + if(FileHeaderSize < cbFileHeaderOffsetSize || + (UINT_PTR)pinhNtHeader % TYPE_ALIGNMENT(IMAGE_NT_HEADERS32) != 0) + { + ULONG cbNtHeaderSize; + ULONG cbReadSize; + PVOID pData; l_ReadHeaderFromFile: - cbNtHeaderSize = 0; - lnOffset.QuadPart = pidhDosHeader->e_lfanew; + cbNtHeaderSize = 0; + lnOffset.QuadPart = pidhDosHeader->e_lfanew; - /* read the header from the file */ - nStatus = ReadFileCb - ( - File, - &lnOffset, - sizeof(IMAGE_NT_HEADERS64), - &pData, - &pBuffer, - &cbReadSize - ); + /* read the header from the file */ + nStatus = ReadFileCb(File, &lnOffset, sizeof(IMAGE_NT_HEADERS64), &pData, &pBuffer, &cbReadSize); - if(!NT_SUCCESS(nStatus)) - DIE(("ReadFile failed, status %08X\n", nStatus)); + if(!NT_SUCCESS(nStatus)) + DIE(("ReadFile failed, status %08X\n", nStatus)); - ASSERT(pData); - ASSERT(pBuffer); - ASSERT(cbReadSize > 0); + ASSERT(pData); + ASSERT(pBuffer); + ASSERT(cbReadSize > 0); - nStatus = STATUS_INVALID_IMAGE_FORMAT; + nStatus = STATUS_INVALID_IMAGE_FORMAT; - /* the buffer doesn't contain the file header */ - if(cbReadSize < RTL_SIZEOF_THROUGH_FIELD(IMAGE_NT_HEADERS32, FileHeader)) - DIE(("The file doesn't contain the PE file header\n")); + /* the buffer doesn't contain the file header */ + if(cbReadSize < RTL_SIZEOF_THROUGH_FIELD(IMAGE_NT_HEADERS32, FileHeader)) + DIE(("The file doesn't contain the PE file header\n")); - pinhNtHeader = pData; + pinhNtHeader = pData; - /* object still not aligned: copy it to the beginning of the buffer */ - if((UINT_PTR)pinhNtHeader % TYPE_ALIGNMENT(IMAGE_NT_HEADERS32) != 0) - { - ASSERT((UINT_PTR)pBuffer % TYPE_ALIGNMENT(IMAGE_NT_HEADERS32) == 0); - RtlMoveMemory(pBuffer, pData, cbReadSize); - pinhNtHeader = pBuffer; - } + /* object still not aligned: copy it to the beginning of the buffer */ + if((UINT_PTR)pinhNtHeader % TYPE_ALIGNMENT(IMAGE_NT_HEADERS32) != 0) + { + ASSERT((UINT_PTR)pBuffer % TYPE_ALIGNMENT(IMAGE_NT_HEADERS32) == 0); + RtlMoveMemory(pBuffer, pData, cbReadSize); + pinhNtHeader = pBuffer; + } - /* invalid NT header */ - nStatus = STATUS_INVALID_IMAGE_PROTECT; + /* invalid NT header */ + nStatus = STATUS_INVALID_IMAGE_PROTECT; - if(pinhNtHeader->Signature != IMAGE_NT_SIGNATURE) - DIE(("The file isn't a PE executable, Signature is %X\n", pinhNtHeader->Signature)); + if(pinhNtHeader->Signature != IMAGE_NT_SIGNATURE) + DIE(("The file isn't a PE executable, Signature is %X\n", pinhNtHeader->Signature)); - nStatus = STATUS_INVALID_IMAGE_FORMAT; + nStatus = STATUS_INVALID_IMAGE_FORMAT; - if(!Intsafe_AddULong32(&cbNtHeaderSize, pinhNtHeader->FileHeader.SizeOfOptionalHeader, FIELD_OFFSET(IMAGE_NT_HEADERS32, OptionalHeader))) - DIE(("The full NT header is too large\n")); + if(!Intsafe_AddULong32(&cbNtHeaderSize, pinhNtHeader->FileHeader.SizeOfOptionalHeader, FIELD_OFFSET(IMAGE_NT_HEADERS32, OptionalHeader))) + DIE(("The full NT header is too large\n")); - /* the buffer doesn't contain the whole NT header */ - if(cbReadSize < cbNtHeaderSize) - DIE(("The file doesn't contain the full NT header\n")); - } - else - { - ULONG cbOptHeaderOffsetSize = 0; + /* the buffer doesn't contain the whole NT header */ + if(cbReadSize < cbNtHeaderSize) + DIE(("The file doesn't contain the full NT header\n")); + } + else + { + ULONG cbOptHeaderOffsetSize = 0; - nStatus = STATUS_INVALID_IMAGE_FORMAT; + nStatus = STATUS_INVALID_IMAGE_FORMAT; - /* don't trust an invalid NT header */ - if(pinhNtHeader->Signature != IMAGE_NT_SIGNATURE) - DIE(("The file isn't a PE executable, Signature is %X\n", pinhNtHeader->Signature)); + /* don't trust an invalid NT header */ + if(pinhNtHeader->Signature != IMAGE_NT_SIGNATURE) + DIE(("The file isn't a PE executable, Signature is %X\n", pinhNtHeader->Signature)); - if(!Intsafe_AddULong32(&cbOptHeaderOffsetSize, pidhDosHeader->e_lfanew, FIELD_OFFSET(IMAGE_NT_HEADERS32, OptionalHeader))) - DIE(("The DOS stub is too large, e_lfanew is %X\n", pidhDosHeader->e_lfanew)); + if(!Intsafe_AddULong32(&cbOptHeaderOffsetSize, pidhDosHeader->e_lfanew, FIELD_OFFSET(IMAGE_NT_HEADERS32, OptionalHeader))) + DIE(("The DOS stub is too large, e_lfanew is %X\n", pidhDosHeader->e_lfanew)); - if(!Intsafe_AddULong32(&cbOptHeaderOffsetSize, cbOptHeaderOffsetSize, pinhNtHeader->FileHeader.SizeOfOptionalHeader)) - DIE(("The NT header is too large, SizeOfOptionalHeader is %X\n", pinhNtHeader->FileHeader.SizeOfOptionalHeader)); + if(!Intsafe_AddULong32(&cbOptHeaderOffsetSize, cbOptHeaderOffsetSize, pinhNtHeader->FileHeader.SizeOfOptionalHeader)) + DIE(("The NT header is too large, SizeOfOptionalHeader is %X\n", pinhNtHeader->FileHeader.SizeOfOptionalHeader)); - /* the buffer doesn't contain the whole NT header: read it from the file */ - if(cbOptHeaderOffsetSize > FileHeaderSize) - goto l_ReadHeaderFromFile; - } + /* the buffer doesn't contain the whole NT header: read it from the file */ + if(cbOptHeaderOffsetSize > FileHeaderSize) + goto l_ReadHeaderFromFile; + } - /* read information from the NT header */ - piohOptHeader = &pinhNtHeader->OptionalHeader; - cbOptHeaderSize = pinhNtHeader->FileHeader.SizeOfOptionalHeader; + /* read information from the NT header */ + piohOptHeader = &pinhNtHeader->OptionalHeader; + cbOptHeaderSize = pinhNtHeader->FileHeader.SizeOfOptionalHeader; - nStatus = STATUS_INVALID_IMAGE_FORMAT; + nStatus = STATUS_INVALID_IMAGE_FORMAT; - ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, Magic)); + ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, Magic)); - if(!RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, Magic)) - DIE(("The optional header doesn't contain the Magic field, SizeOfOptionalHeader is %X\n", cbOptHeaderSize)); + if(!RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, Magic)) + DIE(("The optional header doesn't contain the Magic field, SizeOfOptionalHeader is %X\n", cbOptHeaderSize)); - /* ASSUME: RtlZeroMemory(ImageSectionObject, sizeof(*ImageSectionObject)); */ + /* ASSUME: RtlZeroMemory(ImageSectionObject, sizeof(*ImageSectionObject)); */ - switch(piohOptHeader->Magic) - { - case IMAGE_NT_OPTIONAL_HDR32_MAGIC: - case IMAGE_NT_OPTIONAL_HDR64_MAGIC: - break; + switch(piohOptHeader->Magic) + { + case IMAGE_NT_OPTIONAL_HDR32_MAGIC: + case IMAGE_NT_OPTIONAL_HDR64_MAGIC: + break; - default: - DIE(("Unrecognized optional header, Magic is %X\n", piohOptHeader->Magic)); - } + default: + DIE(("Unrecognized optional header, Magic is %X\n", piohOptHeader->Magic)); + } - ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, SectionAlignment)); - ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, FileAlignment)); + ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, SectionAlignment)); + ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, FileAlignment)); - if - ( - RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, SectionAlignment) && - RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, FileAlignment) - ) - { - /* See [1], section 3.4.2 */ - if(piohOptHeader->SectionAlignment < PAGE_SIZE) - { - if(piohOptHeader->FileAlignment != piohOptHeader->SectionAlignment) - DIE(("Sections aren't page-aligned and the file alignment isn't the same\n")); - } - else if(piohOptHeader->SectionAlignment < piohOptHeader->FileAlignment) - DIE(("The section alignment is smaller than the file alignment\n")); + if (RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, SectionAlignment) && + RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, FileAlignment)) + { + /* See [1], section 3.4.2 */ + if(piohOptHeader->SectionAlignment < PAGE_SIZE) + { + if(piohOptHeader->FileAlignment != piohOptHeader->SectionAlignment) + DIE(("Sections aren't page-aligned and the file alignment isn't the same\n")); + } + else if(piohOptHeader->SectionAlignment < piohOptHeader->FileAlignment) + DIE(("The section alignment is smaller than the file alignment\n")); - nSectionAlignment = piohOptHeader->SectionAlignment; - nFileAlignment = piohOptHeader->FileAlignment; + nSectionAlignment = piohOptHeader->SectionAlignment; + nFileAlignment = piohOptHeader->FileAlignment; - if(!IsPowerOf2(nSectionAlignment) || !IsPowerOf2(nFileAlignment)) - DIE(("The section alignment (%u) and file alignment (%u) aren't both powers of 2\n", nSectionAlignment, nFileAlignment)); - } - else - { - nSectionAlignment = PAGE_SIZE; - nFileAlignment = PAGE_SIZE; - } + if(!IsPowerOf2(nSectionAlignment) || !IsPowerOf2(nFileAlignment)) + DIE(("The section alignment (%u) and file alignment (%u) aren't both powers of 2\n", nSectionAlignment, nFileAlignment)); + } + else + { + nSectionAlignment = PAGE_SIZE; + nFileAlignment = PAGE_SIZE; + } - ASSERT(IsPowerOf2(nSectionAlignment)); - ASSERT(IsPowerOf2(nFileAlignment)); + ASSERT(IsPowerOf2(nSectionAlignment)); + ASSERT(IsPowerOf2(nFileAlignment)); - switch(piohOptHeader->Magic) - { - /* PE32 */ - case IMAGE_NT_OPTIONAL_HDR32_MAGIC: - { - if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, ImageBase)) - ImageSectionObject->ImageBase = piohOptHeader->ImageBase; + switch(piohOptHeader->Magic) + { + /* PE32 */ + case IMAGE_NT_OPTIONAL_HDR32_MAGIC: + { + if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, ImageBase)) + ImageSectionObject->ImageBase = piohOptHeader->ImageBase; - if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, SizeOfStackReserve)) - ImageSectionObject->StackReserve = piohOptHeader->SizeOfStackReserve; + if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, SizeOfStackReserve)) + ImageSectionObject->StackReserve = piohOptHeader->SizeOfStackReserve; - if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, SizeOfStackCommit)) - ImageSectionObject->StackCommit = piohOptHeader->SizeOfStackCommit; + if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, SizeOfStackCommit)) + ImageSectionObject->StackCommit = piohOptHeader->SizeOfStackCommit; - break; - } + break; + } - /* PE32+ */ - case IMAGE_NT_OPTIONAL_HDR64_MAGIC: - { - const IMAGE_OPTIONAL_HEADER64 * pioh64OptHeader; + /* PE32+ */ + case IMAGE_NT_OPTIONAL_HDR64_MAGIC: + { + const IMAGE_OPTIONAL_HEADER64 * pioh64OptHeader; - pioh64OptHeader = (const IMAGE_OPTIONAL_HEADER64 *)piohOptHeader; + pioh64OptHeader = (const IMAGE_OPTIONAL_HEADER64 *)piohOptHeader; - if(RTL_CONTAINS_FIELD(pioh64OptHeader, cbOptHeaderSize, ImageBase)) - { - if(pioh64OptHeader->ImageBase > MAXULONG_PTR) - DIE(("ImageBase exceeds the address space\n")); + if(RTL_CONTAINS_FIELD(pioh64OptHeader, cbOptHeaderSize, ImageBase)) + { + if(pioh64OptHeader->ImageBase > MAXULONG_PTR) + DIE(("ImageBase exceeds the address space\n")); - ImageSectionObject->ImageBase = pioh64OptHeader->ImageBase; - } + ImageSectionObject->ImageBase = pioh64OptHeader->ImageBase; + } - if(RTL_CONTAINS_FIELD(pioh64OptHeader, cbOptHeaderSize, SizeOfStackReserve)) - { - if(pioh64OptHeader->SizeOfStackReserve > MAXULONG_PTR) - DIE(("SizeOfStackReserve exceeds the address space\n")); + if(RTL_CONTAINS_FIELD(pioh64OptHeader, cbOptHeaderSize, SizeOfStackReserve)) + { + if(pioh64OptHeader->SizeOfStackReserve > MAXULONG_PTR) + DIE(("SizeOfStackReserve exceeds the address space\n")); - ImageSectionObject->StackReserve = pioh64OptHeader->SizeOfStackReserve; - } + ImageSectionObject->StackReserve = pioh64OptHeader->SizeOfStackReserve; + } - if(RTL_CONTAINS_FIELD(pioh64OptHeader, cbOptHeaderSize, SizeOfStackCommit)) - { - if(pioh64OptHeader->SizeOfStackCommit > MAXULONG_PTR) - DIE(("SizeOfStackCommit exceeds the address space\n")); + if(RTL_CONTAINS_FIELD(pioh64OptHeader, cbOptHeaderSize, SizeOfStackCommit)) + { + if(pioh64OptHeader->SizeOfStackCommit > MAXULONG_PTR) + DIE(("SizeOfStackCommit exceeds the address space\n")); - ImageSectionObject->StackCommit = pioh64OptHeader->SizeOfStackCommit; - } + ImageSectionObject->StackCommit = pioh64OptHeader->SizeOfStackCommit; + } - break; - } - } + break; + } + } - /* [1], section 3.4.2 */ - if((ULONG_PTR)ImageSectionObject->ImageBase % 0x10000) - DIE(("ImageBase is not aligned on a 64KB boundary")); + /* [1], section 3.4.2 */ + if((ULONG_PTR)ImageSectionObject->ImageBase % 0x10000) + DIE(("ImageBase is not aligned on a 64KB boundary")); - ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, Subsystem)); - ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion)); - ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion)); + ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, Subsystem)); + ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, MinorSubsystemVersion)); + ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, MajorSubsystemVersion)); - if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, Subsystem)) - { - ImageSectionObject->Subsystem = piohOptHeader->Subsystem; + if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, Subsystem)) + { + ImageSectionObject->Subsystem = piohOptHeader->Subsystem; - if - ( - RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, MinorSubsystemVersion) && - RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, MajorSubsystemVersion) - ) - { - ImageSectionObject->MinorSubsystemVersion = piohOptHeader->MinorSubsystemVersion; - ImageSectionObject->MajorSubsystemVersion = piohOptHeader->MajorSubsystemVersion; - } - } + if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, MinorSubsystemVersion) && + RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, MajorSubsystemVersion)) + { + ImageSectionObject->MinorSubsystemVersion = piohOptHeader->MinorSubsystemVersion; + ImageSectionObject->MajorSubsystemVersion = piohOptHeader->MajorSubsystemVersion; + } + } - ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint)); + ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, AddressOfEntryPoint)); - if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, AddressOfEntryPoint)) - { - ImageSectionObject->EntryPoint = piohOptHeader->ImageBase + - piohOptHeader->AddressOfEntryPoint; - } + if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, AddressOfEntryPoint)) + { + ImageSectionObject->EntryPoint = piohOptHeader->ImageBase + + piohOptHeader->AddressOfEntryPoint; + } - ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, SizeOfCode)); + ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, SizeOfCode)); - if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, SizeOfCode)) - ImageSectionObject->Executable = piohOptHeader->SizeOfCode != 0; - else - ImageSectionObject->Executable = TRUE; + if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, SizeOfCode)) + ImageSectionObject->Executable = piohOptHeader->SizeOfCode != 0; + else + ImageSectionObject->Executable = TRUE; - ImageSectionObject->ImageCharacteristics = pinhNtHeader->FileHeader.Characteristics; - ImageSectionObject->Machine = pinhNtHeader->FileHeader.Machine; + ImageSectionObject->ImageCharacteristics = pinhNtHeader->FileHeader.Characteristics; + ImageSectionObject->Machine = pinhNtHeader->FileHeader.Machine; - /* SECTION HEADERS */ - nStatus = STATUS_INVALID_IMAGE_FORMAT; + /* SECTION HEADERS */ + nStatus = STATUS_INVALID_IMAGE_FORMAT; - /* see [1], section 3.3 */ - if(pinhNtHeader->FileHeader.NumberOfSections > 96) - DIE(("Too many sections, NumberOfSections is %u\n", pinhNtHeader->FileHeader.NumberOfSections)); + /* see [1], section 3.3 */ + if(pinhNtHeader->FileHeader.NumberOfSections > 96) + DIE(("Too many sections, NumberOfSections is %u\n", pinhNtHeader->FileHeader.NumberOfSections)); - /* - the additional segment is for the file's headers. They need to be present for - the benefit of the dynamic loader (to locate exports, defaults for thread - parameters, resources, etc.) - */ - ImageSectionObject->NrSegments = pinhNtHeader->FileHeader.NumberOfSections + 1; + /* + * the additional segment is for the file's headers. They need to be present for + * the benefit of the dynamic loader (to locate exports, defaults for thread + * parameters, resources, etc.) + */ + ImageSectionObject->NrSegments = pinhNtHeader->FileHeader.NumberOfSections + 1; - /* file offset for the section headers */ - if(!Intsafe_AddULong32(&cbSectionHeadersOffset, pidhDosHeader->e_lfanew, FIELD_OFFSET(IMAGE_NT_HEADERS32, OptionalHeader))) - DIE(("Offset overflow\n")); + /* file offset for the section headers */ + if(!Intsafe_AddULong32(&cbSectionHeadersOffset, pidhDosHeader->e_lfanew, FIELD_OFFSET(IMAGE_NT_HEADERS32, OptionalHeader))) + DIE(("Offset overflow\n")); - if(!Intsafe_AddULong32(&cbSectionHeadersOffset, cbSectionHeadersOffset, pinhNtHeader->FileHeader.SizeOfOptionalHeader)) - DIE(("Offset overflow\n")); + if(!Intsafe_AddULong32(&cbSectionHeadersOffset, cbSectionHeadersOffset, pinhNtHeader->FileHeader.SizeOfOptionalHeader)) + DIE(("Offset overflow\n")); - /* size of the section headers */ - ASSERT(Intsafe_CanMulULong32(pinhNtHeader->FileHeader.NumberOfSections, sizeof(IMAGE_SECTION_HEADER))); - cbSectionHeadersSize = pinhNtHeader->FileHeader.NumberOfSections * sizeof(IMAGE_SECTION_HEADER); + /* size of the section headers */ + ASSERT(Intsafe_CanMulULong32(pinhNtHeader->FileHeader.NumberOfSections, sizeof(IMAGE_SECTION_HEADER))); + cbSectionHeadersSize = pinhNtHeader->FileHeader.NumberOfSections * sizeof(IMAGE_SECTION_HEADER); - if(!Intsafe_AddULong32(&cbSectionHeadersOffsetSize, cbSectionHeadersOffset, cbSectionHeadersSize)) - DIE(("Section headers too large\n")); + if(!Intsafe_AddULong32(&cbSectionHeadersOffsetSize, cbSectionHeadersOffset, cbSectionHeadersSize)) + DIE(("Section headers too large\n")); - ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, SizeOfHeaders)); + ASSERT(PEFMT_FIELDS_EQUAL(IMAGE_OPTIONAL_HEADER32, IMAGE_OPTIONAL_HEADER64, SizeOfHeaders)); - /* size of the executable's headers */ - if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, SizeOfHeaders)) - { - //if(!IsAligned(piohOptHeader->SizeOfHeaders, nFileAlignment)) - //DIE(("SizeOfHeaders is not aligned\n")); + /* size of the executable's headers */ + if(RTL_CONTAINS_FIELD(piohOptHeader, cbOptHeaderSize, SizeOfHeaders)) + { +// if(!IsAligned(piohOptHeader->SizeOfHeaders, nFileAlignment)) +// DIE(("SizeOfHeaders is not aligned\n")); - if(cbSectionHeadersSize > piohOptHeader->SizeOfHeaders) - DIE(("The section headers overflow SizeOfHeaders\n")); + if(cbSectionHeadersSize > piohOptHeader->SizeOfHeaders) + DIE(("The section headers overflow SizeOfHeaders\n")); - cbHeadersSize = piohOptHeader->SizeOfHeaders; - } - else if(!AlignUp(&cbHeadersSize, cbSectionHeadersOffsetSize, nFileAlignment)) - DIE(("Overflow aligning the size of headers\n")); + cbHeadersSize = piohOptHeader->SizeOfHeaders; + } + else if(!AlignUp(&cbHeadersSize, cbSectionHeadersOffsetSize, nFileAlignment)) + DIE(("Overflow aligning the size of headers\n")); - if(pBuffer) - { - ExFreePool(pBuffer); - pBuffer = NULL; - } - /* WARNING: pinhNtHeader IS NO LONGER USABLE */ - /* WARNING: piohOptHeader IS NO LONGER USABLE */ - /* WARNING: pioh64OptHeader IS NO LONGER USABLE */ + if(pBuffer) + { + ExFreePool(pBuffer); + pBuffer = NULL; + } + /* WARNING: pinhNtHeader IS NO LONGER USABLE */ + /* WARNING: piohOptHeader IS NO LONGER USABLE */ + /* WARNING: pioh64OptHeader IS NO LONGER USABLE */ - if(FileHeaderSize < cbSectionHeadersOffsetSize) - pishSectionHeaders = NULL; - else - { - /* - we already know that Intsafe_CanOffsetPointer(FileHeader, FileHeaderSize), - and FileHeaderSize >= cbSectionHeadersOffsetSize, so this holds true too - */ - ASSERT(Intsafe_CanOffsetPointer(FileHeader, cbSectionHeadersOffset)); - pishSectionHeaders = (PVOID)((UINT_PTR)FileHeader + cbSectionHeadersOffset); - } + if(FileHeaderSize < cbSectionHeadersOffsetSize) + pishSectionHeaders = NULL; + else + { + /* + * we already know that Intsafe_CanOffsetPointer(FileHeader, FileHeaderSize), + * and FileHeaderSize >= cbSectionHeadersOffsetSize, so this holds true too + */ + ASSERT(Intsafe_CanOffsetPointer(FileHeader, cbSectionHeadersOffset)); + pishSectionHeaders = (PVOID)((UINT_PTR)FileHeader + cbSectionHeadersOffset); + } - /* - the buffer doesn't contain the section headers, or the alignment is wrong: - read the headers from the file - */ - if - ( - FileHeaderSize < cbSectionHeadersOffsetSize || - (UINT_PTR)pishSectionHeaders % TYPE_ALIGNMENT(IMAGE_SECTION_HEADER) != 0 - ) - { - PVOID pData; - ULONG cbReadSize; + /* + * the buffer doesn't contain the section headers, or the alignment is wrong: + * read the headers from the file + */ + if(FileHeaderSize < cbSectionHeadersOffsetSize || + (UINT_PTR)pishSectionHeaders % TYPE_ALIGNMENT(IMAGE_SECTION_HEADER) != 0) + { + PVOID pData; + ULONG cbReadSize; - lnOffset.QuadPart = cbSectionHeadersOffset; + lnOffset.QuadPart = cbSectionHeadersOffset; - /* read the header from the file */ - nStatus = ReadFileCb - ( - File, - &lnOffset, - cbSectionHeadersSize, - &pData, - &pBuffer, - &cbReadSize - ); + /* read the header from the file */ + nStatus = ReadFileCb(File, &lnOffset, cbSectionHeadersSize, &pData, &pBuffer, &cbReadSize); - if(!NT_SUCCESS(nStatus)) - DIE(("ReadFile failed with status %08X\n", nStatus)); + if(!NT_SUCCESS(nStatus)) + DIE(("ReadFile failed with status %08X\n", nStatus)); - ASSERT(pData); - ASSERT(pBuffer); - ASSERT(cbReadSize > 0); + ASSERT(pData); + ASSERT(pBuffer); + ASSERT(cbReadSize > 0); - nStatus = STATUS_INVALID_IMAGE_FORMAT; + nStatus = STATUS_INVALID_IMAGE_FORMAT; - /* the buffer doesn't contain all the section headers */ - if(cbReadSize < cbSectionHeadersSize) - DIE(("The file doesn't contain all of the section headers\n")); + /* the buffer doesn't contain all the section headers */ + if(cbReadSize < cbSectionHeadersSize) + DIE(("The file doesn't contain all of the section headers\n")); - pishSectionHeaders = pData; + pishSectionHeaders = pData; - /* object still not aligned: copy it to the beginning of the buffer */ - if((UINT_PTR)pishSectionHeaders % TYPE_ALIGNMENT(IMAGE_SECTION_HEADER) != 0) - { - ASSERT((UINT_PTR)pBuffer % TYPE_ALIGNMENT(IMAGE_SECTION_HEADER) == 0); - RtlMoveMemory(pBuffer, pData, cbReadSize); - pishSectionHeaders = pBuffer; - } - } + /* object still not aligned: copy it to the beginning of the buffer */ + if((UINT_PTR)pishSectionHeaders % TYPE_ALIGNMENT(IMAGE_SECTION_HEADER) != 0) + { + ASSERT((UINT_PTR)pBuffer % TYPE_ALIGNMENT(IMAGE_SECTION_HEADER) == 0); + RtlMoveMemory(pBuffer, pData, cbReadSize); + pishSectionHeaders = pBuffer; + } + } - /* SEGMENTS */ - /* allocate the segments */ - nStatus = STATUS_INSUFFICIENT_RESOURCES; - ImageSectionObject->Segments = AllocateSegmentsCb(ImageSectionObject->NrSegments); + /* SEGMENTS */ + /* allocate the segments */ + nStatus = STATUS_INSUFFICIENT_RESOURCES; + ImageSectionObject->Segments = AllocateSegmentsCb(ImageSectionObject->NrSegments); - if(ImageSectionObject->Segments == NULL) - DIE(("AllocateSegments failed\n")); + if(ImageSectionObject->Segments == NULL) + DIE(("AllocateSegments failed\n")); - /* initialize the headers segment */ - pssSegments = ImageSectionObject->Segments; + /* initialize the headers segment */ + pssSegments = ImageSectionObject->Segments; - //ASSERT(IsAligned(cbHeadersSize, nFileAlignment)); +// ASSERT(IsAligned(cbHeadersSize, nFileAlignment)); - if(!AlignUp(&nFileSizeOfHeaders, cbHeadersSize, nFileAlignment)) - DIE(("Cannot align the size of the section headers\n")); + if(!AlignUp(&nFileSizeOfHeaders, cbHeadersSize, nFileAlignment)) + DIE(("Cannot align the size of the section headers\n")); - if(!AlignUp(&nPrevVirtualEndOfSegment, cbHeadersSize, nSectionAlignment)) - DIE(("Cannot align the size of the section headers\n")); + if(!AlignUp(&nPrevVirtualEndOfSegment, cbHeadersSize, nSectionAlignment)) + DIE(("Cannot align the size of the section headers\n")); - pssSegments[0].FileOffset = 0; - pssSegments[0].Protection = PAGE_READONLY; - pssSegments[0].Length = nPrevVirtualEndOfSegment; - pssSegments[0].RawLength = nFileSizeOfHeaders; - pssSegments[0].VirtualAddress = 0; - pssSegments[0].Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA; - pssSegments[0].WriteCopy = TRUE; + pssSegments[0].FileOffset = 0; + pssSegments[0].Protection = PAGE_READONLY; + pssSegments[0].Length = nPrevVirtualEndOfSegment; + pssSegments[0].RawLength = nFileSizeOfHeaders; + pssSegments[0].VirtualAddress = 0; + pssSegments[0].Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA; + pssSegments[0].WriteCopy = TRUE; - /* skip the headers segment */ - ++ pssSegments; + /* skip the headers segment */ + ++ pssSegments; [truncated at 1000 lines; 169 more skipped]
19 years, 2 months
1
0
0
0
[hbirr] 18754: - Removed the initialisation of the kernel map area.
by hbirr@svn.reactos.com
- Removed the initialisation of the kernel map area. - Allocate the region for the paged and non paged pool at a 4MB boundary. - Protect the local and i/o apic by a memory area. Modified: trunk/reactos/ntoskrnl/mm/mminit.c _____ Modified: trunk/reactos/ntoskrnl/mm/mminit.c --- trunk/reactos/ntoskrnl/mm/mminit.c 2005-10-24 17:54:55 UTC (rev 18753) +++ trunk/reactos/ntoskrnl/mm/mminit.c 2005-10-24 17:55:50 UTC (rev 18754) @@ -31,22 +31,10 @@ static BOOLEAN IsThisAnNtAsSystem = FALSE; static MM_SYSTEM_SIZE MmSystemSize = MmSmallSystem; -static MEMORY_AREA* kernel_text_desc = NULL; -static MEMORY_AREA* kernel_init_desc = NULL; -static MEMORY_AREA* kernel_kpcr_desc = NULL; -static MEMORY_AREA* kernel_data_desc = NULL; -static MEMORY_AREA* kernel_param_desc = NULL; -static MEMORY_AREA* kernel_pool_desc = NULL; -static MEMORY_AREA* kernel_shared_data_desc = NULL; -static MEMORY_AREA* kernel_mapped_vga_framebuffer_desc = NULL; -static MEMORY_AREA* MiKernelMapDescriptor = NULL; -static MEMORY_AREA* MiPagedPoolDescriptor = NULL; - PHYSICAL_ADDRESS MmSharedDataPagePhysicalAddress; PVOID MiNonPagedPoolStart; ULONG MiNonPagedPoolLength; -//PVOID MiKernelMapStart; extern ULONG init_stack; extern ULONG init_stack_top; @@ -92,6 +80,7 @@ NTSTATUS Status; PHYSICAL_ADDRESS BoundaryAddressMultiple; PFN_TYPE Pfn; + PMEMORY_AREA MArea; DPRINT("MmInitVirtualMemory(%x, %x)\n",LastKernelAddress, KernelLength); @@ -100,12 +89,16 @@ MmInitMemoryAreas(); - MiNonPagedPoolStart = (char*)LastKernelAddress + PAGE_SIZE; + /* Start the paged and nonpaged pool at a 4MB boundary. */ + MiNonPagedPoolStart = (PVOID)ROUND_UP((ULONG_PTR)LastKernelAddress + PAGE_SIZE, 0x400000); MiNonPagedPoolLength = MM_NONPAGED_POOL_SIZE; - MmPagedPoolBase = (char*)MiNonPagedPoolStart + MiNonPagedPoolLength + PAGE_SIZE; + MmPagedPoolBase = (PVOID)ROUND_UP((ULONG_PTR)MiNonPagedPoolStart + MiNonPagedPoolLength + PAGE_SIZE, 0x400000); MmPagedPoolSize = MM_PAGED_POOL_SIZE; + DPRINT("NonPagedPool %x - %x, PagedPool %x - %x\n", MiNonPagedPoolStart, (ULONG_PTR)MiNonPagedPoolStart + MiNonPagedPoolLength - 1, + MmPagedPoolBase, (ULONG_PTR)MmPagedPoolBase + MmPagedPoolSize - 1); + MiInitializeNonPagedPool(); /* @@ -120,11 +113,37 @@ &BaseAddress, PAGE_SIZE * MAXIMUM_PROCESSORS, 0, - &kernel_kpcr_desc, + &MArea, TRUE, FALSE, BoundaryAddressMultiple); + /* Local APIC base */ + BaseAddress = (PVOID)0xFEE00000; + MmCreateMemoryArea(NULL, + MmGetKernelAddressSpace(), + MEMORY_AREA_SYSTEM, + &BaseAddress, + PAGE_SIZE, + 0, + &MArea, + TRUE, + FALSE, + BoundaryAddressMultiple); + + /* i/o APIC base */ + BaseAddress = (PVOID)0xFEC00000; + MmCreateMemoryArea(NULL, + MmGetKernelAddressSpace(), + MEMORY_AREA_SYSTEM, + &BaseAddress, + PAGE_SIZE, + 0, + &MArea, + TRUE, + FALSE, + BoundaryAddressMultiple); + BaseAddress = (PVOID)0xFF3A0000; MmCreateMemoryArea(NULL, MmGetKernelAddressSpace(), @@ -132,7 +151,7 @@ &BaseAddress, 0x20000, 0, - &kernel_mapped_vga_framebuffer_desc, + &MArea, TRUE, FALSE, BoundaryAddressMultiple); @@ -151,7 +170,7 @@ &BaseAddress, Length, 0, - &kernel_text_desc, + &MArea, TRUE, FALSE, BoundaryAddressMultiple); @@ -168,7 +187,7 @@ &BaseAddress, Length, 0, - &kernel_init_desc, + &MArea, TRUE, FALSE, BoundaryAddressMultiple); @@ -190,7 +209,7 @@ &BaseAddress, Length, 0, - &kernel_data_desc, + &MArea, TRUE, FALSE, BoundaryAddressMultiple); @@ -203,7 +222,7 @@ &BaseAddress, Length, 0, - &kernel_param_desc, + &MArea, TRUE, FALSE, BoundaryAddressMultiple); @@ -215,23 +234,11 @@ &BaseAddress, MiNonPagedPoolLength, 0, - &kernel_pool_desc, + &MArea, TRUE, FALSE, BoundaryAddressMultiple); - BaseAddress = (PVOID)MM_KERNEL_MAP_BASE; - Status = MmCreateMemoryArea(NULL, - MmGetKernelAddressSpace(), - MEMORY_AREA_SYSTEM, - &BaseAddress, - MM_KERNEL_MAP_SIZE, - 0, - &MiKernelMapDescriptor, - TRUE, - FALSE, - BoundaryAddressMultiple); - BaseAddress = MmPagedPoolBase; Status = MmCreateMemoryArea(NULL, MmGetKernelAddressSpace(), @@ -239,7 +246,7 @@ &BaseAddress, MmPagedPoolSize, 0, - &MiPagedPoolDescriptor, + &MArea, TRUE, FALSE, BoundaryAddressMultiple); @@ -257,7 +264,7 @@ &BaseAddress, Length, 0, - &kernel_shared_data_desc, + &MArea, TRUE, FALSE, BoundaryAddressMultiple);
19 years, 2 months
1
0
0
0
[weiden] 18753: convert tabs to spaces to make it readable with tabs != 8 spaces
by weiden@svn.reactos.com
convert tabs to spaces to make it readable with tabs != 8 spaces Modified: trunk/reactos/lib/kernel32/mem/procmem.c _____ Modified: trunk/reactos/lib/kernel32/mem/procmem.c --- trunk/reactos/lib/kernel32/mem/procmem.c 2005-10-24 17:50:14 UTC (rev 18752) +++ trunk/reactos/lib/kernel32/mem/procmem.c 2005-10-24 17:54:55 UTC (rev 18753) @@ -22,26 +22,26 @@ BOOL STDCALL ReadProcessMemory ( - HANDLE hProcess, - LPCVOID lpBaseAddress, - LPVOID lpBuffer, - DWORD nSize, - LPDWORD lpNumberOfBytesRead - ) + HANDLE hProcess, + LPCVOID lpBaseAddress, + LPVOID lpBuffer, + DWORD nSize, + LPDWORD lpNumberOfBytesRead + ) { - NTSTATUS Status; + NTSTATUS Status; - Status = NtReadVirtualMemory( hProcess, (PVOID)lpBaseAddress,lpBuffer, nSize, - (PULONG)lpNumberOfBytesRead - ); + Status = NtReadVirtualMemory( hProcess, (PVOID)lpBaseAddress,lpBuffer, nSize, + (PULONG)lpNumberOfBytesRead + ); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus (Status); - return FALSE; - } - return TRUE; + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus (Status); + return FALSE; + } + return TRUE; } @@ -51,107 +51,107 @@ BOOL STDCALL WriteProcessMemory ( - HANDLE hProcess, - LPVOID lpBaseAddress, - LPCVOID lpBuffer, - SIZE_T nSize, - SIZE_T *lpNumberOfBytesWritten - ) + HANDLE hProcess, + LPVOID lpBaseAddress, + LPCVOID lpBuffer, + SIZE_T nSize, + SIZE_T *lpNumberOfBytesWritten + ) { - NTSTATUS Status, ProtectStatus = STATUS_SUCCESS; - MEMORY_BASIC_INFORMATION MemInfo; - ULONG Length; - BOOLEAN UnProtect; + NTSTATUS Status, ProtectStatus = STATUS_SUCCESS; + MEMORY_BASIC_INFORMATION MemInfo; + ULONG Length; + BOOLEAN UnProtect; - if (lpNumberOfBytesWritten) - { - *lpNumberOfBytesWritten = 0; - } + if (lpNumberOfBytesWritten) + { + *lpNumberOfBytesWritten = 0; + } - while (nSize) - { - Status = NtQueryVirtualMemory(hProcess, - lpBaseAddress, - MemoryBasicInformation, - &MemInfo, - sizeof(MEMORY_BASIC_INFORMATION), - NULL); + while (nSize) + { + Status = NtQueryVirtualMemory(hProcess, + lpBaseAddress, + MemoryBasicInformation, + &MemInfo, + sizeof(MEMORY_BASIC_INFORMATION), + NULL); - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); - return FALSE; - } - Length = MemInfo.RegionSize - ((ULONG_PTR)lpBaseAddress - (ULONG_PTR)MemInfo.BaseAddress); - if (Length > nSize) - { - Length = nSize; - } - UnProtect = MemInfo.Protect & (PAGE_READWRITE|PAGE_WRITECOPY|PAGE_EXECUTE_READWRITE|PAGE_EXECUTE_WRITE COPY) ? FALSE : TRUE; - if (UnProtect) - { - MemInfo.BaseAddress = lpBaseAddress; - MemInfo.RegionSize = Length; - if (MemInfo.Protect & (PAGE_EXECUTE|PAGE_EXECUTE_READ)) - { - MemInfo.Protect &= ~(PAGE_EXECUTE|PAGE_EXECUTE_READ); - MemInfo.Protect |= PAGE_EXECUTE_READWRITE; - } - else - { - MemInfo.Protect &= ~(PAGE_READONLY|PAGE_NOACCESS); - MemInfo.Protect |= PAGE_READWRITE; - } + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + Length = MemInfo.RegionSize - ((ULONG_PTR)lpBaseAddress - (ULONG_PTR)MemInfo.BaseAddress); + if (Length > nSize) + { + Length = nSize; + } + UnProtect = MemInfo.Protect & (PAGE_READWRITE|PAGE_WRITECOPY|PAGE_EXECUTE_READWRITE|PAGE_EXECUTE_WRITE COPY) ? FALSE : TRUE; + if (UnProtect) + { + MemInfo.BaseAddress = lpBaseAddress; + MemInfo.RegionSize = Length; + if (MemInfo.Protect & (PAGE_EXECUTE|PAGE_EXECUTE_READ)) + { + MemInfo.Protect &= ~(PAGE_EXECUTE|PAGE_EXECUTE_READ); + MemInfo.Protect |= PAGE_EXECUTE_READWRITE; + } + else + { + MemInfo.Protect &= ~(PAGE_READONLY|PAGE_NOACCESS); + MemInfo.Protect |= PAGE_READWRITE; + } - ProtectStatus = NtProtectVirtualMemory(hProcess, - &MemInfo.BaseAddress, - &MemInfo.RegionSize, - MemInfo.Protect, - &MemInfo.Protect); - if (!NT_SUCCESS(ProtectStatus)) - { - SetLastErrorByStatus(ProtectStatus); - return FALSE; - } - Length = MemInfo.RegionSize - ((ULONG_PTR)lpBaseAddress - (ULONG_PTR)MemInfo.BaseAddress); - if (Length > nSize) - { - Length = nSize; - } - } - - Status = NtWriteVirtualMemory(hProcess, - lpBaseAddress, - (LPVOID)lpBuffer, - Length, - &Length); - if (UnProtect) - { - ProtectStatus = NtProtectVirtualMemory(hProcess, - &MemInfo.BaseAddress, - &MemInfo.RegionSize, - MemInfo.Protect, - &MemInfo.Protect); - } - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus (Status); - return FALSE; - } - if (UnProtect && !NT_SUCCESS(ProtectStatus)) - { - SetLastErrorByStatus (ProtectStatus); - return FALSE; - } - lpBaseAddress = (LPVOID)((ULONG_PTR)lpBaseAddress + Length); - lpBuffer = (LPCVOID)((ULONG_PTR)lpBuffer + Length); - nSize -= Length; - if (lpNumberOfBytesWritten) - { - *lpNumberOfBytesWritten += Length; - } - } - return TRUE; + ProtectStatus = NtProtectVirtualMemory(hProcess, + &MemInfo.BaseAddress, + &MemInfo.RegionSize, + MemInfo.Protect, + &MemInfo.Protect); + if (!NT_SUCCESS(ProtectStatus)) + { + SetLastErrorByStatus(ProtectStatus); + return FALSE; + } + Length = MemInfo.RegionSize - ((ULONG_PTR)lpBaseAddress - (ULONG_PTR)MemInfo.BaseAddress); + if (Length > nSize) + { + Length = nSize; + } + } + + Status = NtWriteVirtualMemory(hProcess, + lpBaseAddress, + (LPVOID)lpBuffer, + Length, + &Length); + if (UnProtect) + { + ProtectStatus = NtProtectVirtualMemory(hProcess, + &MemInfo.BaseAddress, + &MemInfo.RegionSize, + MemInfo.Protect, + &MemInfo.Protect); + } + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus (Status); + return FALSE; + } + if (UnProtect && !NT_SUCCESS(ProtectStatus)) + { + SetLastErrorByStatus (ProtectStatus); + return FALSE; + } + lpBaseAddress = (LPVOID)((ULONG_PTR)lpBaseAddress + Length); + lpBuffer = (LPCVOID)((ULONG_PTR)lpBuffer + Length); + nSize -= Length; + if (lpNumberOfBytesWritten) + { + *lpNumberOfBytesWritten += Length; + } + } + return TRUE; } /* EOF */
19 years, 2 months
1
0
0
0
[weiden] 18752: fixed uninitialized variable warning
by weiden@svn.reactos.com
fixed uninitialized variable warning Modified: trunk/reactos/lib/kernel32/mem/procmem.c _____ Modified: trunk/reactos/lib/kernel32/mem/procmem.c --- trunk/reactos/lib/kernel32/mem/procmem.c 2005-10-24 17:45:37 UTC (rev 18751) +++ trunk/reactos/lib/kernel32/mem/procmem.c 2005-10-24 17:50:14 UTC (rev 18752) @@ -58,7 +58,7 @@ SIZE_T *lpNumberOfBytesWritten ) { - NTSTATUS Status, ProtectStatus; + NTSTATUS Status, ProtectStatus = STATUS_SUCCESS; MEMORY_BASIC_INFORMATION MemInfo; ULONG Length; BOOLEAN UnProtect;
19 years, 2 months
1
0
0
0
[hbirr] 18751: Fixed Ki386WriteFsByte.
by hbirr@svn.reactos.com
Fixed Ki386WriteFsByte. Modified: trunk/reactos/hal/halx86/include/halp.h _____ Modified: trunk/reactos/hal/halx86/include/halp.h --- trunk/reactos/hal/halx86/include/halp.h 2005-10-24 17:43:53 UTC (rev 18750) +++ trunk/reactos/hal/halx86/include/halp.h 2005-10-24 17:45:37 UTC (rev 18751) @@ -73,7 +73,7 @@ static inline VOID Ki386WriteFsByte(ULONG offset, BYTE value) { - __asm__ __volatile__("movb %0,%%fs:(%1)"::"r" (value), "r" (offset)); + __asm__ __volatile__("movb %0,%%fs:(%1)"::"q" (value), "r" (offset)); } #elif defined(_MSC_VER)
19 years, 2 months
1
0
0
0
[hbirr] 18750: Enabled some debug messages.
by hbirr@svn.reactos.com
Enabled some debug messages. Modified: trunk/reactos/lib/advapi32/sec/trustee.c _____ Modified: trunk/reactos/lib/advapi32/sec/trustee.c --- trunk/reactos/lib/advapi32/sec/trustee.c 2005-10-24 17:41:16 UTC (rev 18749) +++ trunk/reactos/lib/advapi32/sec/trustee.c 2005-10-24 17:43:53 UTC (rev 18750) @@ -198,10 +198,8 @@ SE_OBJECT_TYPE ObjectType, LPSTR ObjectTypeName, LPSTR InheritedObjectTypeName, LPSTR Name) { -#if 0 DPRINT("%p %p 0x%08x %p %p %s\n", pTrustee, pObjName, - ObjectType, ObjectTypeName, InheritedObjectTypeName, debugstr_a(Name)); -#endif + ObjectType, ObjectTypeName, InheritedObjectTypeName, Name); pTrustee->pMultipleTrustee = NULL; pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE; @@ -219,10 +217,8 @@ SE_OBJECT_TYPE ObjectType, LPWSTR ObjectTypeName, LPWSTR InheritedObjectTypeName, LPWSTR Name) { -#if 0 - DPRINT("%p %p 0x%08x %p %p %s\n", pTrustee, pObjName, - ObjectType, ObjectTypeName, InheritedObjectTypeName, debugstr_w(Name)); -#endif + DPRINT("%p %p 0x%08x %p %p %S\n", pTrustee, pObjName, + ObjectType, ObjectTypeName, InheritedObjectTypeName, Name); pTrustee->pMultipleTrustee = NULL; pTrustee->MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
19 years, 2 months
1
0
0
0
← Newer
1
...
14
15
16
17
18
19
20
...
74
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Results per page:
10
25
50
100
200