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
November 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
27 participants
875 discussions
Start a n
N
ew thread
[blight] 18984: Import Mesa-6.2 sources.
by blight@svn.reactos.com
Import Mesa-6.2 sources. Added: vendor/Mesa3D/ Added: vendor/Mesa3D/current/ Added: vendor/Mesa3D/current/Makefile Added: vendor/Mesa3D/current/Makefile.DJ Added: vendor/Mesa3D/current/Makefile.mgw Added: vendor/Mesa3D/current/Mesa.dsw Added: vendor/Mesa3D/current/bin/ Added: vendor/Mesa3D/current/bin/installmesa Added: vendor/Mesa3D/current/bin/mklib Added: vendor/Mesa3D/current/configs/ Added: vendor/Mesa3D/current/configs/CVS/ Added: vendor/Mesa3D/current/configs/CVS/Entries Added: vendor/Mesa3D/current/configs/CVS/Repository Added: vendor/Mesa3D/current/configs/CVS/Root Added: vendor/Mesa3D/current/configs/CVS/Template Added: vendor/Mesa3D/current/configs/aix Added: vendor/Mesa3D/current/configs/aix-64 Added: vendor/Mesa3D/current/configs/aix-gcc Added: vendor/Mesa3D/current/configs/aix-static Added: vendor/Mesa3D/current/configs/beos Added: vendor/Mesa3D/current/configs/darwin Added: vendor/Mesa3D/current/configs/darwin-static Added: vendor/Mesa3D/current/configs/default Added: vendor/Mesa3D/current/configs/freebsd Added: vendor/Mesa3D/current/configs/hpux10 Added: vendor/Mesa3D/current/configs/hpux10-gcc Added: vendor/Mesa3D/current/configs/hpux10-static Added: vendor/Mesa3D/current/configs/hpux11-32 Added: vendor/Mesa3D/current/configs/hpux11-32-static Added: vendor/Mesa3D/current/configs/hpux11-32-static-nothreads Added: vendor/Mesa3D/current/configs/hpux11-64 Added: vendor/Mesa3D/current/configs/hpux11-64-static Added: vendor/Mesa3D/current/configs/hpux9 Added: vendor/Mesa3D/current/configs/hpux9-gcc Added: vendor/Mesa3D/current/configs/irix6-64 Added: vendor/Mesa3D/current/configs/irix6-64-static Added: vendor/Mesa3D/current/configs/irix6-n32 Added: vendor/Mesa3D/current/configs/irix6-n32-static Added: vendor/Mesa3D/current/configs/irix6-o32 Added: vendor/Mesa3D/current/configs/irix6-o32-static Added: vendor/Mesa3D/current/configs/linux Added: vendor/Mesa3D/current/configs/linux-alpha Added: vendor/Mesa3D/current/configs/linux-alpha-static Added: vendor/Mesa3D/current/configs/linux-debug Added: vendor/Mesa3D/current/configs/linux-dri Added: vendor/Mesa3D/current/configs/linux-dri-x86 Added: vendor/Mesa3D/current/configs/linux-dri-x86-64 Added: vendor/Mesa3D/current/configs/linux-glide Added: vendor/Mesa3D/current/configs/linux-icc Added: vendor/Mesa3D/current/configs/linux-icc-static Added: vendor/Mesa3D/current/configs/linux-osmesa16 Added: vendor/Mesa3D/current/configs/linux-osmesa16-static Added: vendor/Mesa3D/current/configs/linux-osmesa32 Added: vendor/Mesa3D/current/configs/linux-ppc Added: vendor/Mesa3D/current/configs/linux-ppc-static Added: vendor/Mesa3D/current/configs/linux-solo Added: vendor/Mesa3D/current/configs/linux-solo-ia64 Added: vendor/Mesa3D/current/configs/linux-solo-x86 Added: vendor/Mesa3D/current/configs/linux-sparc Added: vendor/Mesa3D/current/configs/linux-sparc5 Added: vendor/Mesa3D/current/configs/linux-static Added: vendor/Mesa3D/current/configs/linux-tcc Added: vendor/Mesa3D/current/configs/linux-ultrasparc Added: vendor/Mesa3D/current/configs/linux-x86 Added: vendor/Mesa3D/current/configs/linux-x86-64 Added: vendor/Mesa3D/current/configs/linux-x86-64-static Added: vendor/Mesa3D/current/configs/linux-x86-debug Added: vendor/Mesa3D/current/configs/linux-x86-glide Added: vendor/Mesa3D/current/configs/linux-x86-static Added: vendor/Mesa3D/current/configs/netbsd Added: vendor/Mesa3D/current/configs/openbsd Added: vendor/Mesa3D/current/configs/osf1 Added: vendor/Mesa3D/current/configs/solaris-x86 Added: vendor/Mesa3D/current/configs/solaris-x86-gcc Added: vendor/Mesa3D/current/configs/sunos4 Added: vendor/Mesa3D/current/configs/sunos4-gcc Added: vendor/Mesa3D/current/configs/sunos4-static Added: vendor/Mesa3D/current/configs/sunos5 Added: vendor/Mesa3D/current/configs/sunos5-gcc Added: vendor/Mesa3D/current/configs/sunos5-smp Added: vendor/Mesa3D/current/configs/ultrix-gcc Added: vendor/Mesa3D/current/descrip.mms Added: vendor/Mesa3D/current/docs/ Added: vendor/Mesa3D/current/docs/COPYING Added: vendor/Mesa3D/current/docs/INSTALL.GNU Added: vendor/Mesa3D/current/docs/MESA_agp_offset.spec Added: vendor/Mesa3D/current/docs/MESA_copy_sub_buffer.spec Added: vendor/Mesa3D/current/docs/MESA_pack_invert.spec Added: vendor/Mesa3D/current/docs/MESA_packed_depth_stencil.spec Added: vendor/Mesa3D/current/docs/MESA_pixmap_colormap.spec Added: vendor/Mesa3D/current/docs/MESA_program_debug.spec Added: vendor/Mesa3D/current/docs/MESA_release_buffers.spec Added: vendor/Mesa3D/current/docs/MESA_resize_buffers.spec Added: vendor/Mesa3D/current/docs/MESA_set_3dfx_mode.spec Added: vendor/Mesa3D/current/docs/MESA_sprite_point.spec Added: vendor/Mesa3D/current/docs/MESA_swap_control.spec Added: vendor/Mesa3D/current/docs/MESA_swap_frame_usage.spec Added: vendor/Mesa3D/current/docs/MESA_trace.spec Added: vendor/Mesa3D/current/docs/MESA_window_pos.spec Added: vendor/Mesa3D/current/docs/MESA_ycbcr_texture.spec [truncated at 100 lines; 919 more skipped] _____ Added: vendor/Mesa3D/current/Makefile --- vendor/Mesa3D/current/Makefile 2005-11-04 00:21:12 UTC (rev 18983) +++ vendor/Mesa3D/current/Makefile 2005-11-04 13:35:54 UTC (rev 18984) @@ -0,0 +1,376 @@ +# Top-level Mesa makefile + +TOP = . + +SUBDIRS = src progs + + +default: $(TOP)/configs/current + @for dir in $(SUBDIRS) ; do \ + (cd $$dir ; $(MAKE)) || exit 1 ; \ + done + + +doxygen: + (cd doxygen ; make) ; \ + +clean: + @for dir in $(SUBDIRS) ; do \ + (cd $$dir ; $(MAKE) clean) ; \ + done + + +realclean: + touch $(TOP)/configs/current + $(MAKE) clean + -rm -rf lib* + -rm -f $(TOP)/configs/current + + +install: + @echo "Installing" + $(TOP)/bin/installmesa + +# If there's no current configuration file +$(TOP)/configs/current: + @echo + @echo + @echo "Please choose a configuration from the following list:" + @ls -1 $(TOP)/configs | grep -v "current\|default\|CVS" + @echo + @echo "Then type 'make <config>' (ex: 'make linux-x86')" + @echo "(ignore the following error message)" + @exit 1 + + +# Rules to set/install a specific build configuration +aix \ +aix-64 \ +aix-gcc \ +aix-static \ +beos \ +darwin \ +darwin-static \ +freebsd \ +hpux10 \ +hpux10-gcc \ +hpux10-static \ +hpux11-32 \ +hpux11-32-static \ +hpux11-32-static-nothreads \ +hpux11-64 \ +hpux11-64-static \ +hpux9 \ +hpux9-gcc \ +irix6-64 \ +irix6-64-static \ +irix6-n32 \ +irix6-n32-static \ +irix6-o32 \ +irix6-o32-static \ +linux \ +linux-alpha \ +linux-alpha-static \ +linux-debug \ +linux-dri \ +linux-dri-x86 \ +linux-dri-x86-64 \ +linux-glide \ +linux-icc \ +linux-icc-static \ +linux-osmesa16 \ +linux-osmesa16-static \ +linux-osmesa32 \ +linux-ppc \ +linux-ppc-static \ +linux-solo \ +linux-solo-x86 \ +linux-solo-ia64 \ +linux-sparc \ +linux-sparc5 \ +linux-static \ +linux-ultrasparc \ +linux-tcc \ +linux-x86 \ +linux-x86-debug \ +linux-x86-64 \ +linux-x86-64-static \ +linux-x86-glide \ +linux-x86-static \ +netbsd \ +openbsd \ +osf1 \ +solaris-x86 \ +solaris-x86-gcc \ +sunos4 \ +sunos4-gcc \ +sunos4-static \ +sunos5 \ +sunos5-gcc \ +sunos5-smp \ +ultrix-gcc: + (cd configs && rm -f current && ln -s $@ current) + $(MAKE) default + + +# Rules for making release tarballs + +DIRECTORY = Mesa-6.2 +LIB_NAME = MesaLib-6.2 +DEMO_NAME = MesaDemos-6.2 + +LIB_FILES = \ + $(DIRECTORY)/Makefile* \ + $(DIRECTORY)/descrip.mms \ + $(DIRECTORY)/mms-config. \ + $(DIRECTORY)/Mesa.dsw \ + $(DIRECTORY)/bin/mklib \ + $(DIRECTORY)/bin/installmesa \ + $(DIRECTORY)/configs/[a-z]* \ + $(DIRECTORY)/docs/*.html \ + $(DIRECTORY)/docs/COPYING \ + $(DIRECTORY)/docs/INSTALL.GNU \ + $(DIRECTORY)/docs/README.* \ + $(DIRECTORY)/docs/RELNOTES* \ + $(DIRECTORY)/docs/VERSIONS \ + $(DIRECTORY)/docs/*.spec \ + $(DIRECTORY)/include/GL/internal/glcore.h \ + $(DIRECTORY)/include/GL/dmesa.h \ + $(DIRECTORY)/include/GL/amesa.h \ + $(DIRECTORY)/include/GL/fxmesa.h \ + $(DIRECTORY)/include/GL/ggimesa.h \ + $(DIRECTORY)/include/GL/gl.h \ + $(DIRECTORY)/include/GL/glext.h \ + $(DIRECTORY)/include/GL/gl_mangle.h \ + $(DIRECTORY)/include/GL/glu.h \ + $(DIRECTORY)/include/GL/glu_mangle.h \ + $(DIRECTORY)/include/GL/glx.h \ + $(DIRECTORY)/include/GL/glxext.h \ + $(DIRECTORY)/include/GL/glx_mangle.h \ + $(DIRECTORY)/include/GL/mesa_wgl.h \ + $(DIRECTORY)/include/GL/mglmesa.h \ + $(DIRECTORY)/include/GL/osmesa.h \ + $(DIRECTORY)/include/GL/svgamesa.h \ + $(DIRECTORY)/include/GL/ugl*.h \ + $(DIRECTORY)/include/GL/vms_x_fix.h \ + $(DIRECTORY)/include/GL/wmesa.h \ + $(DIRECTORY)/include/GL/xmesa.h \ + $(DIRECTORY)/include/GL/xmesa_x.h \ + $(DIRECTORY)/include/GL/xmesa_xf86.h \ + $(DIRECTORY)/src/Makefile \ + $(DIRECTORY)/src/descrip.mms \ + $(DIRECTORY)/src/mesa/Makefile* \ + $(DIRECTORY)/src/mesa/sources \ + $(DIRECTORY)/src/mesa/descrip.mms \ + $(DIRECTORY)/src/mesa/depend \ + $(DIRECTORY)/src/mesa/main/*.[chS] \ + $(DIRECTORY)/src/mesa/main/main.dsp \ + $(DIRECTORY)/src/mesa/main/descrip.mms \ + $(DIRECTORY)/src/mesa/glapi/*.[chS] \ + $(DIRECTORY)/src/mesa/glapi/glapi.dsp \ + $(DIRECTORY)/src/mesa/glapi/descrip.mms \ + $(DIRECTORY)/src/mesa/array_cache/*.[ch] \ + $(DIRECTORY)/src/mesa/array_cache/array_cache.dsp \ + $(DIRECTORY)/src/mesa/array_cache/descrip.mms \ + $(DIRECTORY)/src/mesa/math/*.[ch] \ + $(DIRECTORY)/src/mesa/math/math.dsp \ + $(DIRECTORY)/src/mesa/math/descrip.mms \ + $(DIRECTORY)/src/mesa/shader/*.[ch] \ + $(DIRECTORY)/src/mesa/shader/shader.dsp \ + $(DIRECTORY)/src/mesa/shader/descrip.mms \ + $(DIRECTORY)/src/mesa/swrast/*.[ch] \ + $(DIRECTORY)/src/mesa/swrast/swrast.dsp \ + $(DIRECTORY)/src/mesa/swrast/descrip.mms \ + $(DIRECTORY)/src/mesa/swrast_setup/*.[ch] \ + $(DIRECTORY)/src/mesa/swrast_setup/swrast_setup.dsp \ + $(DIRECTORY)/src/mesa/swrast_setup/descrip.mms \ + $(DIRECTORY)/src/mesa/tnl/*.[chS] \ + $(DIRECTORY)/src/mesa/tnl/tnl.dsp \ + $(DIRECTORY)/src/mesa/tnl/descrip.mms \ + $(DIRECTORY)/src/mesa/tnl_dd/*.[ch] \ + $(DIRECTORY)/src/mesa/tnl_dd/imm/*.[ch] \ + $(DIRECTORY)/src/mesa/tnl_dd/imm/NOTES.imm \ + $(DIRECTORY)/src/mesa/drivers/beos/*.cpp \ + $(DIRECTORY)/src/mesa/drivers/beos/Makefile \ + $(DIRECTORY)/src/mesa/drivers/common/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/common/descrip.mms \ + $(DIRECTORY)/src/mesa/drivers/dos/*.[chS] \ + $(DIRECTORY)/src/mesa/drivers/dri/common/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/fbdev/glfbdev.c \ + $(DIRECTORY)/src/mesa/drivers/glide/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/glide/*.def \ + $(DIRECTORY)/src/mesa/drivers/ggi/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/ggi/ggimesa.conf.in \ + $(DIRECTORY)/src/mesa/drivers/ggi/default/*.c \ + $(DIRECTORY)/src/mesa/drivers/ggi/default/genkgi.conf.in \ + $(DIRECTORY)/src/mesa/drivers/ggi/display/*.c \ + $(DIRECTORY)/src/mesa/drivers/ggi/display/fbdev.conf.in \ + $(DIRECTORY)/src/mesa/drivers/ggi/include/ggi/mesa/*.h \ + $(DIRECTORY)/src/mesa/drivers/osmesa/Makefile.win \ + $(DIRECTORY)/src/mesa/drivers/osmesa/descrip.mms \ + $(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.def \ + $(DIRECTORY)/src/mesa/drivers/osmesa/osmesa.dsp \ + $(DIRECTORY)/src/mesa/drivers/osmesa/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/svga/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/windows/*/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/windows/*/*.def \ + $(DIRECTORY)/src/mesa/drivers/windows/*/*.dsp \ + $(DIRECTORY)/src/mesa/drivers/x11/descrip.mms \ + $(DIRECTORY)/src/mesa/drivers/x11/*.[ch] \ + $(DIRECTORY)/src/mesa/sparc/*.[chS] \ + $(DIRECTORY)/src/mesa/x86/Makefile \ + $(DIRECTORY)/src/mesa/x86/*.[ch] \ + $(DIRECTORY)/src/mesa/x86/*.S \ + $(DIRECTORY)/src/glu/Makefile \ + $(DIRECTORY)/src/glu/descrip.mms \ + $(DIRECTORY)/src/glu/sgi/Makefile \ + $(DIRECTORY)/src/glu/sgi/Makefile.win \ + $(DIRECTORY)/src/glu/sgi/Makefile.DJ \ + $(DIRECTORY)/src/glu/sgi/cc*.txt \ + $(DIRECTORY)/src/glu/sgi/glu.def \ + $(DIRECTORY)/src/glu/sgi/glu.dsp \ + $(DIRECTORY)/src/glu/sgi/dummy.cc \ + $(DIRECTORY)/src/glu/sgi/descrip.mms \ + $(DIRECTORY)/src/glu/sgi/mesaglu.opt \ + $(DIRECTORY)/src/glu/sgi/include/gluos.h \ + $(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.h \ + $(DIRECTORY)/src/glu/sgi/libnurbs/interface/*.cc \ + $(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.h \ + $(DIRECTORY)/src/glu/sgi/libnurbs/internals/*.cc \ + $(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.h \ + $(DIRECTORY)/src/glu/sgi/libnurbs/nurbtess/*.cc \ + $(DIRECTORY)/src/glu/sgi/libtess/README \ + $(DIRECTORY)/src/glu/sgi/libtess/alg-outline \ + $(DIRECTORY)/src/glu/sgi/libtess/*.[ch] \ + $(DIRECTORY)/src/glu/sgi/libutil/*.[ch] \ + $(DIRECTORY)/src/glu/mesa/README[12] \ + $(DIRECTORY)/src/glu/mesa/Makefile* \ + $(DIRECTORY)/src/glu/mesa/descrip.mms \ + $(DIRECTORY)/src/glu/mesa/mms_depend \ + $(DIRECTORY)/src/glu/mesa/*.def \ + $(DIRECTORY)/src/glu/mesa/depend \ + $(DIRECTORY)/src/glu/mesa/*.[ch] \ + $(DIRECTORY)/src/glw/*.[ch] \ + $(DIRECTORY)/src/glw/Makefile* \ + $(DIRECTORY)/src/glw/README \ + $(DIRECTORY)/src/glw/depend \ + $(DIRECTORY)/progs/Makefile \ + $(DIRECTORY)/progs/util/README \ + $(DIRECTORY)/progs/util/*.[ch] \ + $(DIRECTORY)/progs/util/sampleMakefile \ + $(DIRECTORY)/vms/analyze_map.com \ + $(DIRECTORY)/vms/xlib.opt \ + $(DIRECTORY)/vms/xlib_share.opt + + +DEMO_FILES = \ + $(DIRECTORY)/include/GL/glut.h \ + $(DIRECTORY)/include/GL/glutf90.h \ + $(DIRECTORY)/src/glut/glx/Makefile* \ + $(DIRECTORY)/src/glut/glx/depend \ + $(DIRECTORY)/src/glut/glx/*def \ + $(DIRECTORY)/src/glut/glx/descrip.mms \ + $(DIRECTORY)/src/glut/glx/mms_depend \ + $(DIRECTORY)/src/glut/glx/glut.dsp \ + $(DIRECTORY)/src/glut/glx/*.[ch] \ + $(DIRECTORY)/src/glut/beos/*.[ch] \ + $(DIRECTORY)/src/glut/beos/*.cpp \ + $(DIRECTORY)/src/glut/beos/Makefile \ + $(DIRECTORY)/src/glut/dos/*.[ch] \ + $(DIRECTORY)/src/glut/dos/Makefile.DJ \ + $(DIRECTORY)/src/glut/dos/PC_HW/*.[chS] \ + $(DIRECTORY)/src/glut/ggi/*.[ch] \ + $(DIRECTORY)/src/glut/ggi/Makefile \ + $(DIRECTORY)/progs/beos/*.cpp \ + $(DIRECTORY)/progs/beos/Makefile \ + $(DIRECTORY)/progs/images/*.rgb \ + $(DIRECTORY)/progs/images/*.rgba \ + $(DIRECTORY)/progs/demos/Makefile* \ + $(DIRECTORY)/progs/demos/descrip.mms \ + $(DIRECTORY)/progs/demos/*.[ch] \ + $(DIRECTORY)/progs/demos/*.cxx \ + $(DIRECTORY)/progs/demos/*.dat \ + $(DIRECTORY)/progs/demos/README \ + $(DIRECTORY)/progs/demos/Windows/*.dsp \ + $(DIRECTORY)/progs/demos/Windows/*.dsw \ + $(DIRECTORY)/progs/xdemos/Makefile* \ + $(DIRECTORY)/progs/xdemos/descrip.mms \ + $(DIRECTORY)/progs/xdemos/*.[chf] \ + $(DIRECTORY)/progs/redbook/Makefile* \ + $(DIRECTORY)/progs/redbook/README \ + $(DIRECTORY)/progs/redbook/*.[ch] \ + $(DIRECTORY)/progs/samples/Makefile* \ + $(DIRECTORY)/progs/samples/README \ + $(DIRECTORY)/progs/samples/*.c \ + $(DIRECTORY)/progs/windml/Makefile.ugl \ + $(DIRECTORY)/progs/windml/*.c \ + $(DIRECTORY)/progs/windml/*.bmp \ + $(DIRECTORY)/progs/ggi/*.c + + +DRI_FILES = \ + $(DIRECTORY)/src/glx/Makefile \ + $(DIRECTORY)/src/glx/mini/*.[ch] \ + $(DIRECTORY)/src/glx/mini/example.miniglx.conf \ + $(DIRECTORY)/src/glx/mini/NOTES \ + $(DIRECTORY)/src/mesa/drivers/dri/Makefile \ + $(DIRECTORY)/src/mesa/drivers/dri/Makefile.template \ + $(DIRECTORY)/src/mesa/drivers/dri/common/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/dri/dri_client/imports/*.h \ + $(DIRECTORY)/src/mesa/drivers/dri/*/*.[ch] \ + $(DIRECTORY)/src/mesa/drivers/dri/*/depend \ + $(DIRECTORY)/src/mesa/drivers/dri/*/Makefile \ + $(DIRECTORY)/src/mesa/drivers/dri/*/Doxyfile \ + $(DIRECTORY)/src/mesa/drivers/dri/*/server/*.[ch] + + +# Everything for new a Mesa release: +tarballs: lib_gz demo_gz lib_bz2 demo_bz2 lib_zip demo_zip md5 + + +lib_gz: + rm -f configs/current ; \ + cd .. ; \ + tar -cvf $(LIB_NAME).tar $(LIB_FILES) ; \ + gzip $(LIB_NAME).tar ; \ + mv $(LIB_NAME).tar.gz $(DIRECTORY) + +demo_gz: + cd .. ; \ + tar -cvf $(DEMO_NAME).tar $(DEMO_FILES) ; \ + gzip $(DEMO_NAME).tar ; \ + mv $(DEMO_NAME).tar.gz $(DIRECTORY) + +lib_bz2: + rm -f configs/current ; \ + cd .. ; \ + tar -cvf $(LIB_NAME).tar $(LIB_FILES) ; \ + bzip2 $(LIB_NAME).tar ; \ + mv $(LIB_NAME).tar.bz2 $(DIRECTORY) + +demo_bz2: + cd .. ; \ + tar -cvf $(DEMO_NAME).tar $(DEMO_FILES) ; \ + bzip2 $(DEMO_NAME).tar ; \ + mv $(DEMO_NAME).tar.bz2 $(DIRECTORY) + +lib_zip: + rm -f configs/current ; \ + -rm $(LIB_NAME).zip ; \ + cd .. ; \ + zip -r $(LIB_NAME).zip $(LIB_FILES) ; \ + mv $(LIB_NAME).zip $(DIRECTORY) + +demo_zip: + -rm $(DEMO_NAME).zip ; \ + cd .. ; \ + zip -r $(DEMO_NAME).zip $(DEMO_FILES) ; \ + mv $(DEMO_NAME).zip $(DIRECTORY) + +md5: + @-md5sum $(LIB_NAME).tar.gz + @-md5sum $(LIB_NAME).tar.bz2 + @-md5sum $(LIB_NAME).zip + @-md5sum $(DEMO_NAME).tar.gz + @-md5sum $(DEMO_NAME).tar.bz2 + @-md5sum $(DEMO_NAME).zip Property changes on: vendor/Mesa3D/current/Makefile ___________________________________________________________________ Name: svn:eol-style + native _____ Added: vendor/Mesa3D/current/Makefile.DJ --- vendor/Mesa3D/current/Makefile.DJ 2005-11-04 00:21:12 UTC (rev 18983) +++ vendor/Mesa3D/current/Makefile.DJ 2005-11-04 13:35:54 UTC (rev 18984) @@ -0,0 +1,97 @@ +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# DOS/DJGPP makefile v1.5 for Mesa +# +# Copyright (C) 2002 - Borca Daniel +# Email : dborca(a)users.sourceforge.net +# Web :
http://www.geocities.com/dborca
+ + +# +# Available options: +# +# Environment variables: +# CPU optimize for the given processor. +# default = pentium +# GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++) +# or `mesa'. +# default = mesa +# GLIDE path to Glide3 SDK; used with FX. +# default = $(TOP)/glide3 +# FX=1 build for 3dfx Glide3. Note that this disables +# compilation of most DMesa code and requires fxMesa. +# As a consequence, you'll need the DJGPP Glide3 +# library to build any application. +# default = no +# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow). +# default = no +# +# Targets: +# all: build everything +# libgl: build GL +# libglu: build GLU +# libglut: build GLUT +# clean: remove object files +# realclean: remove all generated files +# + + + +.PHONY : all libgl libglu libglut clean realclean + +CPU ?= pentium + +GLU ?= mesa + +CFLAGS = -Wall -W -pedantic +CFLAGS += -O2 -ffast-math -mcpu=$(CPU) + +export CFLAGS + +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif + +all: libgl libglu libglut + +libgl: lib + $(MAKE) -f Makefile.DJ -C src/mesa +libglu: lib + $(MAKE) -f Makefile.DJ -C src/glu/$(GLU) +libglut: lib + $(MAKE) -f Makefile.DJ -C src/glut/dos + +lib: + mkdir lib + +clean: + $(MAKE) -f Makefile.DJ clean -C src/mesa + $(MAKE) -f Makefile.DJ clean -C src/glu/mesa + $(MAKE) -f Makefile.DJ clean -C src/glu/sgi + $(MAKE) -f Makefile.DJ clean -C src/glut/dos + +realclean: clean + -$(call UNLINK,lib/*.a) + -$(call UNLINK,lib/*.dxe) _____ Added: vendor/Mesa3D/current/Makefile.mgw --- vendor/Mesa3D/current/Makefile.mgw 2005-11-04 00:21:12 UTC (rev 18983) +++ vendor/Mesa3D/current/Makefile.mgw 2005-11-04 13:35:54 UTC (rev 18984) @@ -0,0 +1,92 @@ +# Mesa 3-D graphics library +# Version: 4.0 +# +# Copyright (C) 1999 Brian Paul All Rights Reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# MinGW makefile v1.1 for Mesa +# +# Copyright (C) 2002 - Borca Daniel +# Email : dborca(a)users.sourceforge.net +# Web :
http://www.geocities.com/dborca
+ + +# +# Available options: +# +# Environment variables: +# CPU optimize for the given processor. +# default = pentium +# GLIDE path to Glide3 SDK; used with FX. +# default = $(TOP)/glide3 +# FX=1 build for 3dfx Glide3. Note that this disables +# compilation of most WMesa code and requires fxMesa. +# As a consequence, you'll need the Win32 Glide3 +# library to build any application. +# default = no +# ICD=1 build the installable client driver interface +# (windows opengl driver interface) +# default = no +# X86=1 optimize for x86 (if possible, use MMX, SSE, 3DNow). +# default = no +# +# Targets: +# all: build everything +# libgl: build GL +# clean: remove object files +# realclean: remove all generated files +# + + + +.PHONY : all libgl clean realclean + +CPU ?= pentium + +ifeq ($(ICD),1) + # when -std=c99 mingw will not define WIN32 + CFLAGS = -Wall -W -Werror +else + # I love c89 + CFLAGS = -Wall -W -pedantic +endif +CFLAGS += -O2 -ffast-math -mcpu=$(CPU) + +export CFLAGS + +ifeq ($(wildcard $(addsuffix /rm.exe,$(subst ;, ,$(PATH)))),) +UNLINK = del $(subst /,\,$(1)) +else +UNLINK = $(RM) $(1) +endif + +all: libgl + +libgl: lib + $(MAKE) -f Makefile.mgw -C src/mesa + +lib: + mkdir lib + +clean: + $(MAKE) -f Makefile.mgw clean -C src/mesa + +realclean: clean + -$(call UNLINK,lib/*.a) + -$(call UNLINK,lib/*.dll) _____ Added: vendor/Mesa3D/current/Mesa.dsw --- vendor/Mesa3D/current/Mesa.dsw 2005-11-04 00:21:12 UTC (rev 18983) +++ vendor/Mesa3D/current/Mesa.dsw 2005-11-04 13:35:54 UTC (rev 18984) @@ -0,0 +1,179 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +####################################################################### ######## + +Project: "array_cache"=".\SRC\MESA\array_cache\array_cache.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +####################################################################### ######## + +Project: "gdi"=".\src\mesa\drivers\windows\gdi\gdi.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name array_cache + End Project Dependency + Begin Project Dependency + Project_Dep_Name main + End Project Dependency + Begin Project Dependency + Project_Dep_Name math + End Project Dependency + Begin Project Dependency + Project_Dep_Name swrast_setup + End Project Dependency + Begin Project Dependency + Project_Dep_Name swrast + End Project Dependency + Begin Project Dependency + Project_Dep_Name tnl + End Project Dependency + Begin Project Dependency + Project_Dep_Name glapi + End Project Dependency + Begin Project Dependency + Project_Dep_Name shader + End Project Dependency +}}} + +####################################################################### ######## + +Project: "glapi"=".\SRC\MESA\glapi\glapi.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +####################################################################### ######## + +Project: "glu"=".\src\glu\sgi\glu.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name gdi + End Project Dependency +}}} + +####################################################################### ######## + +Project: "main"=".\SRC\MESA\main\main.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +####################################################################### ######## + +Project: "math"=".\SRC\MESA\math\math.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +####################################################################### ######## + +Project: "osmesa"=".\SRC\MESA\DRIVERS\osmesa\osmesa.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name gdi + End Project Dependency +}}} + +####################################################################### ######## + +Project: "shader"=".\SRC\MESA\shader\shader.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +####################################################################### ######## + +Project: "swrast"=".\SRC\MESA\swrast\swrast.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +####################################################################### ######## + +Project: "swrast_setup"=".\SRC\MESA\swrast_setup\swrast_setup.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +####################################################################### ######## + +Project: "tnl"=".\SRC\MESA\tnl\tnl.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +####################################################################### ######## + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +####################################################################### ######## + Property changes on: vendor/Mesa3D/current/Mesa.dsw ___________________________________________________________________ Name: svn:eol-style + CRLF _____ Added: vendor/Mesa3D/current/bin/installmesa --- vendor/Mesa3D/current/bin/installmesa 2005-11-04 00:21:12 UTC (rev 18983) +++ vendor/Mesa3D/current/bin/installmesa 2005-11-04 13:35:54 UTC (rev 18984) @@ -0,0 +1,57 @@ +#!/bin/sh + +# +# Simple shell script for installing Mesa's header and library files. +# If the copy commands below don't work on a particular system (i.e. the +# -f or -d flags), we may need to branch on `uname` to do the right thing. +# + + +TOP=. + +INCLUDE_DIR="/usr/local/include" +LIB_DIR="/usr/local/lib" + + +echo +echo "***** Mesa installation - You may need root privileges to do this *****" +echo +echo "Default directory for header files is:" ${INCLUDE_DIR} +echo "Enter new directory or press <Enter> to accept this default." + +read INPUT +if [ x${INPUT} != "x" ] ; then + INCLUDE_DIR=${INPUT} +fi + +echo +echo "Default directory for library files is:" ${LIB_DIR} +echo "Enter new directory or press <Enter> to accept this default." + +read INPUT +if [ x${INPUT} != "x" ] ; then + LIB_DIR=${INPUT} +fi + + +echo +echo "About to install Mesa header files (GL/*.h) in: " ${INCLUDE_DIR}/GL +echo "and Mesa library files (libGL.*, etc) in: " ${LIB_DIR} +echo "Press <Enter> to continue, or <ctrl>-C to abort." + +read INPUT + + +# flags: +# -f = force +# -d = preserve symlinks + +set -v + +mkdir ${INCLUDE_DIR} +mkdir ${INCLUDE_DIR}/GL +mkdir ${LIB_DIR} +cp -f ${TOP}/include/GL/*.h ${INCLUDE_DIR}/GL +cp -fd ${TOP}/lib*/lib* ${LIB_DIR} + +echo "Done." Property changes on: vendor/Mesa3D/current/bin/installmesa ___________________________________________________________________ Name: svn:executable + _____ Added: vendor/Mesa3D/current/bin/mklib --- vendor/Mesa3D/current/bin/mklib 2005-11-04 00:21:12 UTC (rev 18983) +++ vendor/Mesa3D/current/bin/mklib 2005-11-04 13:35:54 UTC (rev 18984) @@ -0,0 +1,625 @@ +#!/bin/sh + +# Make a shared library. +# Basically do a switch/case depending on the OS and make a shared (or static) +# library conforming to that OS. + + +# Usage: +# mklib [options] objects ... +# Options: +# -o LIBRARY specifies the name of resulting library +# ("-o GL" for example, might result in "libGL.so" being made) +# -major N specifies major version number (default is 1) +# -minor N specifies minor version number (default is 0) +# -patch N specifies patch version number (default is 0) +# -lLIBRARY specifies a dependency on LIBRARY +# -LDIR search in DIR for library dependencies +# -cplusplus link with C++ runtime +# -static make a static library (default is dynamic/shared) +# -install DIR move resulting library file(s) to DIR +# -arch ARCH override using `uname` to determine architecture +# -archopt OPT specify an extra achitecture-specific option OPT +# -noprefix don't prefix library name with "lib" or any suffix +# +# The library name should just be "GL" or "GLU", etc. The 'lib' prefix +# will be added here if needed, as well as the ".so" or ".a" suffix, +# etc (unless the -noprefix option is used). +# +# objects should be: foo.o bar.o etc.o +# +# Environment variables recognized: +# CC C compiler command +# CXX C++ compiler command +# + + +# +# Option defaults +# +LIBNAME="" +MAJOR=1 +MINOR=0 +PATCH="" +DEPS="" +CPLUSPLUS=0 +STATIC=0 +INSTALLDIR="." +ARCH="auto" +ARCHOPT="" +NOPREFIX=0 + + +# +# Parse arguments +# +while true +do + case $1 in + '-o') shift 1; LIBNAME=$1;; + '-major') shift 1; MAJOR=$1;; + '-minor') shift 1; MINOR=$1;; + '-patch') shift 1; PATCH=$1;; + -l*) DEPS="$DEPS $1";; + -L*) DEPS="$DEPS $1";; + '-cplusplus') CPLUSPLUS=1;; + '-static') STATIC=1;; + '-install') shift 1; INSTALLDIR=$1;; + '-arch') shift 1; ARCH=$1;; + '-archopt') shift 1; ARCHOPT=$1;; + '-noprefix') NOPREFIX=1;; + -*) echo "mklib: Unknown option: " $1 ; exit 1;; + *) break + esac + shift 1 +done +OBJECTS=$@ + +if [ ${ARCH} = "auto" ] ; then + ARCH=`uname` +fi + + +# +# Error checking +# +if [ "x${LIBNAME}" = "x" ] ; then + echo "mklib: Error: no library name specified" + exit 1 +fi +if [ "x${OBJECTS}" = "x" ] ; then + echo "mklib: Error: no object files specified" + exit 1 +fi + + +# +# Debugging info +# +if [ ] ; then + echo "-----------------" + echo ARCH is $ARCH + echo LIBNAME is $LIBNAME + echo MAJOR is $MAJOR + echo MINOR is $MINOR + echo PATCH is $PATCH + echo DEPS are $DEPS + echo "-----------------" +fi + + +# +# OK, make the library now +# +case $ARCH in + + 'Linux' | 'OpenBSD') + # GCC-based environment + + if [ $NOPREFIX = 1 ] ; then + # No "lib" or ".so" part + echo "mklib: Making" $ARCH "shared library: " ${LIBNAME} + #OPTS="-shared -Wl,-soname,${LIBNAME}" # soname??? + OPTS="-shared" + if [ $CPLUSPLUS = 1 ] ; then + LINK=$CXX + else + LINK=$CC + fi + rm -f ${LIBNAME} + + # make lib + ${LINK} ${OPTS} -o ${LIBNAME} ${OBJECTS} ${DEPS} + # finish up + FINAL_LIBS="${LIBNAME}" + elif [ $STATIC = 1 ] ; then + LIBNAME="lib${LIBNAME}" # prefix with "lib" + echo "mklib: Making" $ARCH "static library: " ${LIBNAME}.a + LINK="ar" + OPTS="-ru" + # make lib + ${LINK} ${OPTS} ${LIBNAME}.a ${OBJECTS} + ranlib ${LIBNAME}.a + # finish up + FINAL_LIBS=${LIBNAME}.a + else + LIBNAME="lib${LIBNAME}" # prefix with "lib" + if [ $ARCH = 'Linux' ] ; then + OPTS="-Xlinker -Bsymbolic -shared -Wl,-soname,${LIBNAME}.so.${MAJOR}" + else + OPTS="-shared -Wl,-soname,${LIBNAME}.so.${MAJOR}" + fi + if [ x${PATCH} = "x" ] ; then + VERSION="${MAJOR}.${MINOR}" + else + VERSION="${MAJOR}.${MINOR}.${PATCH}" + fi + [truncated at 1000 lines; 390381 more skipped]
19 years, 1 month
1
0
0
0
[mf] 18983: test version of startmenu root with big icons
by mf@svn.reactos.com
test version of startmenu root with big icons Modified: trunk/reactos/subsys/system/explorer/dialogs/searchprogram.cpp Modified: trunk/reactos/subsys/system/explorer/doc/changes.txt Modified: trunk/reactos/subsys/system/explorer/explorer.cpp Modified: trunk/reactos/subsys/system/explorer/globals.h Modified: trunk/reactos/subsys/system/explorer/res/arrow.ico Modified: trunk/reactos/subsys/system/explorer/res/arrow_dwn.ico Modified: trunk/reactos/subsys/system/explorer/res/arrow_up.ico Modified: trunk/reactos/subsys/system/explorer/res/arrowsel.ico Modified: trunk/reactos/subsys/system/explorer/shell/entries.cpp Modified: trunk/reactos/subsys/system/explorer/shell/entries.h Modified: trunk/reactos/subsys/system/explorer/shell/mainframe.cpp Modified: trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp Modified: trunk/reactos/subsys/system/explorer/shell/shellfs.cpp Modified: trunk/reactos/subsys/system/explorer/shell/shellfs.h Modified: trunk/reactos/subsys/system/explorer/taskbar/desktopbar.cpp Modified: trunk/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp Modified: trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp Modified: trunk/reactos/subsys/system/explorer/taskbar/startmenu.h _____ Modified: trunk/reactos/subsys/system/explorer/dialogs/searchprogram.cpp --- trunk/reactos/subsys/system/explorer/dialogs/searchprogram.cpp 2005-11-04 00:20:17 UTC (rev 18982) +++ trunk/reactos/subsys/system/explorer/dialogs/searchprogram.cpp 2005-11-04 00:21:12 UTC (rev 18983) @@ -344,7 +344,7 @@ Entry* entry = cache_entry._entry; if (entry->_icon_id == ICID_UNKNOWN) - entry->extract_icon(); + entry->extract_icon(false); pDispInfo->item.iImage = g_Globals._icon_cache.get_icon(entry->_icon_id).get_sysiml_idx(); pDispInfo->item.mask |= LVIF_DI_SETITEM; _____ Modified: trunk/reactos/subsys/system/explorer/doc/changes.txt --- trunk/reactos/subsys/system/explorer/doc/changes.txt 2005-11-04 00:20:17 UTC (rev 18982) +++ trunk/reactos/subsys/system/explorer/doc/changes.txt 2005-11-04 00:21:12 UTC (rev 18983) @@ -164,3 +164,4 @@ 06.10.2005 m. fuchs implemented command line parser for Explorer 09.10.2005 m. fuchs Fix for Bugzilla Entry 330: Correctly handle WM_COMMAND messages in web windows without web control m. fuchs replace "search computer" start menu entry by a "not yet implemented" message +01.11.2005 m. fuchs String::str(), String::toLower() to allow conventient and WINE compatible string conversions _____ Modified: trunk/reactos/subsys/system/explorer/explorer.cpp --- trunk/reactos/subsys/system/explorer/explorer.cpp 2005-11-04 00:20:17 UTC (rev 18982) +++ trunk/reactos/subsys/system/explorer/explorer.cpp 2005-11-04 00:21:12 UTC (rev 18983) @@ -246,10 +246,10 @@ { } -Icon::Icon(ICON_ID id, UINT nid) +Icon::Icon(ICON_ID id, UINT nid) //, int cx, int cy : _id(id), _itype(IT_STATIC), - _hicon(SmallIcon(nid)) + _hicon(ResIcon(nid)) // ResIconEx(nid, cx, cy) { } @@ -322,8 +322,25 @@ return ret; } -HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd) +HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd/*, bool big_icons*/) { + int cx = GetSystemMetrics(SM_CXSMICON); //ICON_SIZE_X; + int cy = GetSystemMetrics(SM_CYSMICON); //ICON_SIZE_Y; + HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy); + + MemCanvas canvas; + BitmapSelection sel(canvas, hbmp); + + RECT rect = {0, 0, cx, cy}; + FillRect(canvas, &rect, hbrush_bkgnd); + + DrawIconEx(canvas, 0, 0, hIcon, cx, cy, 0, hbrush_bkgnd, DI_NORMAL); + + return hbmp; +} + +HBITMAP create_small_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd) +{ int cx = GetSystemMetrics(SM_CXSMICON); int cy = GetSystemMetrics(SM_CYSMICON); HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy); @@ -379,7 +396,7 @@ } -const Icon& IconCache::extract(const String& path) +const Icon& IconCache::extract(LPCTSTR path, bool big_icons) { PathMap::iterator found = _pathMap.find(path); @@ -388,24 +405,32 @@ SHFILEINFO sfi; -#if 1 // use system image list - the "search program dialog" needs it - HIMAGELIST himlSys = (HIMAGELIST) SHGetFileInfo(path, 0, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX|SHGFI_SMALLICON); + if (big_icons) { + if (SHGetFileInfo(path, 0, &sfi, sizeof(sfi), SHGFI_ICON)) { + const Icon& icon = add(sfi.hIcon, IT_CACHED); - if (himlSys) { - _himlSys = himlSys; + ///@todo limit cache size + _pathMap[path] = icon; - const Icon& icon = add(sfi.iIcon/*, IT_SYSCACHE*/); -#else - if (SHGetFileInfo(path, 0, &sfi, sizeof(sfi), SHGFI_ICON|SHGFI_SMALLICON)) { - const Icon& icon = add(sfi.hIcon, IT_CACHED); -#endif + return icon; + } + } else { + // use system image list - the "search program dialog" needs it + HIMAGELIST himlSys_small = (HIMAGELIST) SHGetFileInfo(path, 0, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX|SHGFI_SMALLICON); - ///@todo limit cache size - _pathMap[path] = icon; + if (himlSys_small) { + _himlSys_small = himlSys_small; - return icon; - } else - return _icons[ICID_NONE]; + const Icon& icon = add(sfi.iIcon/*, IT_SYSCACHE*/); + + ///@todo limit cache size + _pathMap[path] = icon; + + return icon; + } + } + + return _icons[ICID_NONE]; } const Icon& IconCache::extract(LPCTSTR path, int idx) @@ -435,17 +460,24 @@ } } -const Icon& IconCache::extract(IExtractIcon* pExtract, LPCTSTR path, int idx) +const Icon& IconCache::extract(IExtractIcon* pExtract, LPCTSTR path, int idx, bool big_icons) { HICON hIconLarge = 0; HICON hIcon; - HRESULT hr = pExtract->Extract(path, idx, &hIconLarge, &hIcon, MAKELONG(0/*GetSystemMetrics(SM_CXICON)*/,GetSystemMetrics(SM_CXSMICON)) ); + HRESULT hr = pExtract->Extract(path, idx, &hIconLarge, &hIcon, MAKELONG(GetSystemMetrics(SM_CXICON), ICON_SIZE_X)); if (hr == NOERROR) { //@@ oder SUCCEEDED(hr) ? - if (hIconLarge) - DestroyIcon(hIconLarge); + if (big_icons) { //@@ OK? + if (hIcon) + DestroyIcon(hIcon); + hIcon = hIconLarge; + } else { + if (hIconLarge) + DestroyIcon(hIconLarge); + } + if (hIcon) return add(hIcon); } _____ Modified: trunk/reactos/subsys/system/explorer/globals.h --- trunk/reactos/subsys/system/explorer/globals.h 2005-11-04 00:20:17 UTC (rev 18982) +++ trunk/reactos/subsys/system/explorer/globals.h 2005-11-04 00:21:12 UTC (rev 18983) @@ -114,20 +114,21 @@ }; struct IconCache { - IconCache() : _himlSys(0) {} + IconCache() : _himlSys_small(0) {} void init(); - const Icon& extract(const String& path); + const Icon& extract(LPCTSTR path, bool big_icons); const Icon& extract(LPCTSTR path, int idx); - const Icon& extract(IExtractIcon* pExtract, LPCTSTR path, int idx); + const Icon& extract(IExtractIcon* pExtract, LPCTSTR path, int idx, bool big_icons); const Icon& add(HICON hIcon, ICON_TYPE type=IT_DYNAMIC); const Icon& add(int sys_idx/*, ICON_TYPE type=IT_SYSCACHE*/); const Icon& get_icon(int icon_id); - HIMAGELIST get_sys_imagelist() const {return _himlSys;} + HIMAGELIST get_sys_imagelist() const {return _himlSys_small;} + void free_icon(int icon_id); protected: @@ -143,12 +144,16 @@ typedef map<CachePair, ICON_ID> PathIdxMap; PathIdxMap _pathIdxMap; - HIMAGELIST _himlSys; + HIMAGELIST _himlSys_small; }; +#define ICON_SIZE_X GetSystemMetrics(big_icons? SM_CXICON: SM_CXSMICON) +#define ICON_SIZE_Y GetSystemMetrics(big_icons? SM_CYICON: SM_CYSMICON) + + /// create a bitmap from an icon -extern HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd); +extern HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd/*, bool big_icons*/); /// add icon with alpha channel to imagelist using the specified background color extern int ImageList_AddAlphaIcon(HIMAGELIST himl, HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd); _____ Modified: trunk/reactos/subsys/system/explorer/res/arrow.ico (Binary files differ) _____ Modified: trunk/reactos/subsys/system/explorer/res/arrow_dwn.ico (Binary files differ) _____ Modified: trunk/reactos/subsys/system/explorer/res/arrow_up.ico (Binary files differ) _____ Modified: trunk/reactos/subsys/system/explorer/res/arrowsel.ico (Binary files differ) _____ Modified: trunk/reactos/subsys/system/explorer/shell/entries.cpp --- trunk/reactos/subsys/system/explorer/shell/entries.cpp 2005-11-04 00:20:17 UTC (rev 18982) +++ trunk/reactos/subsys/system/explorer/shell/entries.cpp 2005-11-04 00:21:12 UTC (rev 18983) @@ -319,14 +319,14 @@ } -void Entry::extract_icon() +void Entry::extract_icon(bool big_icons) { TCHAR path[MAX_PATH]; ICON_ID icon_id = ICID_NONE; if (get_path(path, COUNTOF(path)) && _tcsncmp(path,TEXT("::{"),3)) - icon_id = g_Globals._icon_cache.extract(path); + icon_id = g_Globals._icon_cache.extract(path, big_icons); if (icon_id == ICID_NONE) { IExtractIcon* pExtract; @@ -336,7 +336,7 @@ if (SUCCEEDED(pExtract->GetIconLocation(GIL_FORSHELL, path, MAX_PATH, &idx, &flags))) { if (flags & GIL_NOTFILENAME) - icon_id = g_Globals._icon_cache.extract(pExtract, path, idx); + icon_id = g_Globals._icon_cache.extract(pExtract, path, idx, big_icons); else { if (idx == -1) idx = 0; // special case for some control panel applications ("System") @@ -374,11 +374,11 @@ const ShellPath& pidl_abs = create_absolute_pidl(); LPCITEMIDLIST pidl = pidl_abs; - HIMAGELIST himlSys = (HIMAGELIST) SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX|SHGFI_PIDL|SHGFI_SMALLICON); + HIMAGELIST himlSys = (HIMAGELIST) SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX|SHGFI_PIDL|(big_icons? SHGFI_SMALLICON: 0)); if (himlSys) icon_id = g_Globals._icon_cache.add(sfi.iIcon); /* - if (SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_ICON|SHGFI_SMALLICON)) + if (SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_ICON|(g_Globals._big_icons? SHGFI_SMALLICON: 0))) icon_id = g_Globals._icon_cache.add(sfi.hIcon)._id; */ } _____ Modified: trunk/reactos/subsys/system/explorer/shell/entries.h --- trunk/reactos/subsys/system/explorer/shell/entries.h 2005-11-04 00:20:17 UTC (rev 18982) +++ trunk/reactos/subsys/system/explorer/shell/entries.h 2005-11-04 00:21:12 UTC (rev 18983) @@ -48,7 +48,7 @@ }; enum SCAN_FLAGS { - SCAN_EXTRACT_ICONS = 1, +// SCAN_EXTRACT_ICONS = 1, SCAN_DO_ACCESS = 2, SCAN_ALL = 3, @@ -103,7 +103,7 @@ Entry* read_tree(const void* path, SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL); void sort_directory(SORT_ORDER sortOrder); void smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=SCAN_ALL); - void extract_icon(); + void extract_icon(bool big_icons); virtual void read_directory(int scan_flags=SCAN_ALL) {} virtual const void* get_next_path_component(const void*) const {return NULL;} @@ -115,7 +115,7 @@ virtual HRESULT do_context_menu(HWND hwnd, const POINT& pos, CtxMenuInterfaces& cm_ifs); protected: - bool get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const; + bool get_path_base(PTSTR path, size_t path_count, ENTRY_TYPE etype) const; }; _____ Modified: trunk/reactos/subsys/system/explorer/shell/mainframe.cpp --- trunk/reactos/subsys/system/explorer/shell/mainframe.cpp 2005-11-04 00:20:17 UTC (rev 18982) +++ trunk/reactos/subsys/system/explorer/shell/mainframe.cpp 2005-11-04 00:21:12 UTC (rev 18983) @@ -149,9 +149,10 @@ MainFrameBase::MainFrameBase(HWND hwnd) - : super(hwnd), - _himl(ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK|ILC_COLOR24, 2, 0)) + : super(hwnd) { + _himl = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK|ILC_COLOR24, 2, 0); + _hMenuFrame = GetMenu(hwnd); _hMenuWindow = GetSubMenu(_hMenuFrame, GetMenuItemCount(_hMenuFrame)-3); _____ Modified: trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp --- trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp 2005-11-04 00:20:17 UTC (rev 18982) +++ trunk/reactos/subsys/system/explorer/shell/shellbrowser.cpp 2005-11-04 00:21:12 UTC (rev 18983) @@ -252,13 +252,13 @@ lpdi->item.pszText = entry->_data.cFileName; */ if (lpdi->item.mask & TVIF_IMAGE) - if ((HIMAGELIST)SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_LINKOVERLAY) == _himl) + if ((HIMAGELIST)SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_SYSICONINDEX|SHGFI_LINKOVERLAY|SHGFI_SMALLICON) == _himl) lpdi->item.iImage = sfi.iIcon; else lpdi->item.iImage = -1; if (lpdi->item.mask & TVIF_SELECTEDIMAGE) - if ((HIMAGELIST)SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_SYSICONINDEX|SHGFI_SMALLICON|SHGFI_OPENICON) == _himl) + if ((HIMAGELIST)SHGetFileInfo((LPCTSTR)pidl, 0, &sfi, sizeof(sfi), SHGFI_PIDL|SHGFI_SYSICONINDEX|SHGFI_OPENICON|SHGFI_SMALLICON) == _himl) lpdi->item.iSelectedImage = sfi.iIcon; else lpdi->item.iSelectedImage = -1; _____ Modified: trunk/reactos/subsys/system/explorer/shell/shellfs.cpp --- trunk/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-11-04 00:20:17 UTC (rev 18982) +++ trunk/reactos/subsys/system/explorer/shell/shellfs.cpp 2005-11-04 00:21:12 UTC (rev 18983) @@ -58,38 +58,40 @@ if (SUCCEEDED(hr)) { LPCTSTR path = (LPCTSTR)GlobalLock(medium.UNION_MEMBER(hGlobal)); - // fill with drive names "C:", ... - assert(_tcslen(path) < GlobalSize(medium.UNION_MEMBER(hGlobal))); - _tcscpy(pw32fdata->cFileName, path); + if (path) { + // fill with drive names "C:", ... + assert(_tcslen(path) < GlobalSize(medium.UNION_MEMBER(hGlobal))); + _tcscpy(pw32fdata->cFileName, path); - UINT sem_org = SetErrorMode(SEM_FAILCRITICALERRORS); + UINT sem_org = SetErrorMode(SEM_FAILCRITICALERRORS); - if (GetFileAttributesEx(path, GetFileExInfoStandard, &fad)) { - pw32fdata->dwFileAttributes = fad.dwFileAttributes; - pw32fdata->ftCreationTime = fad.ftCreationTime; - pw32fdata->ftLastAccessTime = fad.ftLastAccessTime; - pw32fdata->ftLastWriteTime = fad.ftLastWriteTime; + if (GetFileAttributesEx(path, GetFileExInfoStandard, &fad)) { + pw32fdata->dwFileAttributes = fad.dwFileAttributes; + pw32fdata->ftCreationTime = fad.ftCreationTime; + pw32fdata->ftLastAccessTime = fad.ftLastAccessTime; + pw32fdata->ftLastWriteTime = fad.ftLastWriteTime; - if (!(fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { - pw32fdata->nFileSizeLow = fad.nFileSizeLow; - pw32fdata->nFileSizeHigh = fad.nFileSizeHigh; + if (!(fad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { + pw32fdata->nFileSizeLow = fad.nFileSizeLow; + pw32fdata->nFileSizeHigh = fad.nFileSizeHigh; + } } - } - HANDLE hFile = CreateFile(path, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, - 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); + HANDLE hFile = CreateFile(path, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, + 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); - if (hFile != INVALID_HANDLE_VALUE) { - if (GetFileInformationByHandle(hFile, pbhfi)) - bhfi_valid = true; + if (hFile != INVALID_HANDLE_VALUE) { + if (GetFileInformationByHandle(hFile, pbhfi)) + bhfi_valid = true; - CloseHandle(hFile); - } + CloseHandle(hFile); + } - SetErrorMode(sem_org); + SetErrorMode(sem_org); - GlobalUnlock(medium.UNION_MEMBER(hGlobal)); - GlobalFree(medium.UNION_MEMBER(hGlobal)); + GlobalUnlock(medium.UNION_MEMBER(hGlobal)); + GlobalFree(medium.UNION_MEMBER(hGlobal)); + } } } } @@ -322,13 +324,13 @@ if (w32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) entry->_icon_id = ICID_FOLDER; - else if (scan_flags & SCAN_EXTRACT_ICONS) +/* else if (scan_flags & SCAN_EXTRACT_ICONS) try { - entry->extract_icon(); + entry->extract_icon(big_icons); } catch(COMException&) { // ignore unexpected exceptions while extracting icons } - +*/ last = entry; } while(FindNextFile(hFind, &w32fd)); @@ -428,13 +430,13 @@ // get icons for files and virtual objects if (!(entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || !(attribs & SFGAO_FILESYSTEM)) { - if (scan_flags & SCAN_EXTRACT_ICONS) +/* if (scan_flags & SCAN_EXTRACT_ICONS) try { - entry->extract_icon(); + entry->extract_icon(big_icons); } catch(COMException&) { // ignore unexpected exceptions while extracting icons } - } else if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) +*/ } else if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) entry->_icon_id = ICID_FOLDER; else entry->_icon_id = ICID_NONE; // don't try again later @@ -486,13 +488,13 @@ return NULL; } -int ShellDirectory::extract_icons() +int ShellDirectory::extract_icons(bool big_icons) { int cnt = 0; for(Entry*entry=_down; entry; entry=entry->_next) if (entry->_icon_id == ICID_UNKNOWN) { - entry->extract_icon(); + entry->extract_icon(big_icons); if (entry->_icon_id != ICID_NONE) ++cnt; _____ Modified: trunk/reactos/subsys/system/explorer/shell/shellfs.h --- trunk/reactos/subsys/system/explorer/shell/shellfs.h 2005-11-04 00:20:17 UTC (rev 18982) +++ trunk/reactos/subsys/system/explorer/shell/shellfs.h 2005-11-04 00:21:12 UTC (rev 18983) @@ -105,7 +105,7 @@ virtual bool get_path(PTSTR path, size_t path_count) const; - int extract_icons(); + int extract_icons(bool big_icons); ShellFolder _folder; HWND _hwnd; _____ Modified: trunk/reactos/subsys/system/explorer/taskbar/desktopbar.cpp --- trunk/reactos/subsys/system/explorer/taskbar/desktopbar.cpp 2005-11-04 00:20:17 UTC (rev 18982) +++ trunk/reactos/subsys/system/explorer/taskbar/desktopbar.cpp 2005-11-04 00:21:12 UTC (rev 18983) @@ -161,7 +161,7 @@ RegisterHotkeys(); // prepare Startmenu, but hide it for now - _startMenuRoot = GET_WINDOW(StartMenuRoot, StartMenuRoot::Create(_hwnd)); + _startMenuRoot = GET_WINDOW(StartMenuRoot, StartMenuRoot::Create(_hwnd, true)); //@@ _big_icons return 0; } _____ Modified: trunk/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp --- trunk/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp 2005-11-04 00:20:17 UTC (rev 18982) +++ trunk/reactos/subsys/system/explorer/taskbar/quicklaunch.cpp 2005-11-04 00:21:12 UTC (rev 18983) @@ -105,7 +105,15 @@ RecursiveCreateDirectory(path); _dir = new ShellDirectory(GetDesktopFolder(), path, _hwnd); - _dir->smart_scan(SORT_NAME, SCAN_EXTRACT_ICONS|SCAN_FILESYSTEM); + _dir->smart_scan(SORT_NAME, /*SCAN_EXTRACT_ICONS|*/SCAN_FILESYSTEM); + + // immediatelly extract the shortcut icons + for(Entry*entry=_dir->_down; entry; entry=entry->_next) + try { + entry->extract_icon(false); + } catch(COMException&) { + // ignore unexpected exceptions while extracting icons + } } catch(COMException&) { return; } _____ Modified: trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp --- trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp 2005-11-04 00:20:17 UTC (rev 18982) +++ trunk/reactos/subsys/system/explorer/taskbar/startmenu.cpp 2005-11-04 00:21:12 UTC (rev 18983) @@ -46,8 +46,9 @@ #define SHELLPATH_NET_CONNECTIONS TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2 DD-08002B30309D}\\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}") -StartMenu::StartMenu(HWND hwnd) - : super(hwnd) +StartMenu::StartMenu(HWND hwnd, bool big_icons) + : super(hwnd), + _big_icons(big_icons) { _next_id = IDC_FIRST_MENU; _submenu_id = 0; @@ -69,9 +70,10 @@ #endif } -StartMenu::StartMenu(HWND hwnd, const StartMenuCreateInfo& create_info) +StartMenu::StartMenu(HWND hwnd, const StartMenuCreateInfo& create_info, bool big_icons) : super(hwnd), - _create_info(create_info) + _create_info(create_info), + _big_icons(big_icons) { for(StartMenuFolders::const_iterator it=create_info._folders.begin(); it!=create_info._folders.end(); ++it) if (*it) @@ -115,7 +117,8 @@ Window::CREATORFUNC_INFO StartMenu::s_def_creator = STARTMENU_CREATOR(StartMenu); -HWND StartMenu::Create(int x, int y, const StartMenuFolders& folders, HWND hwndParent, LPCTSTR title, CREATORFUNC_INFO creator, void* info, const String& filter) +HWND StartMenu::Create(int x, int y, const StartMenuFolders& folders, HWND hwndParent, LPCTSTR title, bool parent_big_icons, + CREATORFUNC_INFO creator, void* info, const String& filter) { UINT style, ex_style; int top_height; @@ -130,6 +133,7 @@ top_height = 0; } + bool big_icons = false; RECT rect = {x, y-STARTMENU_LINE_HEIGHT-top_height, x+STARTMENU_WIDTH_MIN, y}; #ifndef _LIGHT_STARTMENU @@ -344,7 +348,7 @@ WindowRect pos(_hwnd); ///@todo do something similar to StartMenuRoot::TrackStartmenu() in order to automatically close submenus when clicking on the desktop background - StartMenu::Create(pos.left+3, pos.bottom-3, _create_info._folders, 0, _create_info._title, _create_info._creator, _create_info._info); + StartMenu::Create(pos.left+3, pos.bottom-3, _create_info._folders, 0, _create_info._title, _big_icons, _create_info._creator, _create_info._info); CloseStartMenu(); } @@ -511,6 +515,7 @@ int StartMenu::ButtonHitTest(POINT pt) { ClientRect clnt(_hwnd); + const bool big_icons = _big_icons; RECT rect = {_border_left, _border_top, clnt.right, STARTMENU_LINE_HEIGHT}; if (pt.x<rect.left || pt.x>rect.right) @@ -542,6 +547,7 @@ return; ClientRect clnt(_hwnd); + const bool big_icons = _big_icons; RECT rect = {_border_left, _border_top, clnt.right, STARTMENU_LINE_HEIGHT}; for(SMBtnVector::const_iterator it=_buttons.begin()+_scroll_pos; it!=_buttons.end(); ++it) { @@ -767,6 +773,7 @@ { #ifdef _LIGHT_STARTMENU ClientRect clnt(_hwnd); + const bool big_icons = _big_icons; RECT rect = {_border_left, _border_top, clnt.right, STARTMENU_LINE_HEIGHT}; for(SMBtnVector::const_iterator it=_buttons.begin()+_scroll_pos; it!=_buttons.end(); ++it) { @@ -816,15 +823,18 @@ } -void StartMenu::DrawArrows(HDC hdc) +void StartMenu::DrawArrows(HDC hdc, bool big_icons) { - static ResIconEx arrowUpIcon(IDI_ARROW_UP, 8, 4); - static ResIconEx arrowDownIcon(IDI_ARROW_DOWN, 8, 4); + int cx = big_icons? 16: 8; + int cy = big_icons? 8: 4; + ResIconEx arrowUpIcon(IDI_ARROW_UP, cx, cy); + ResIconEx arrowDownIcon(IDI_ARROW_DOWN, cx, cy); + ClientRect clnt(_hwnd); - DrawIconEx(hdc, clnt.right/2-4, _floating_btn?3:1, arrowUpIcon, 8, 4, 0, 0, DI_NORMAL); - DrawIconEx(hdc, clnt.right/2-4, clnt.bottom-5, arrowDownIcon, 8, 4, 0, 0, DI_NORMAL); + DrawIconEx(hdc, clnt.right/2-cx/2, _floating_btn?3:1, arrowUpIcon, cx, cy, 0, 0, DI_NORMAL); + DrawIconEx(hdc, clnt.right/2-cx/2, clnt.bottom-cy-1, arrowDownIcon, cx, cy, 0, 0, DI_NORMAL); } void StartMenu::GetArrowButtonRects(LPRECT prect_up, LPRECT prect_down) @@ -852,9 +862,10 @@ #ifdef _LIGHT_STARTMENU if (_arrow_btns) - DrawArrows(canvas); + DrawArrows(canvas, _big_icons); ClientRect clnt(_hwnd); + const bool big_icons = _big_icons; RECT rect = {_border_left, _border_top, clnt.right, STARTMENU_LINE_HEIGHT}; int sep_width = rect.right-rect.left - 4; @@ -886,7 +897,7 @@ break; if (rect.top >= canvas.rcPaint.top) - DrawStartMenuButton(canvas, rect, btn._title, btn, btn._id==_selected_id, false); + DrawStartMenuButton(canvas, rect, btn._title, btn, btn._id==_selected_id, false, _big_icons); } rect.top = rect.bottom; @@ -917,7 +928,7 @@ if (entry->_icon_id == ICID_UNKNOWN) try { - entry->extract_icon(); + entry->extract_icon(_big_icons); } catch(COMException&) { // ignore unexpected exceptions while extracting icons } @@ -933,7 +944,7 @@ break; WindowCanvas canvas(_hwnd); - DrawStartMenuButton(canvas, rect, NULL, btn, btn._id==_selected_id, false); + DrawStartMenuButton(canvas, rect, NULL, btn, btn._id==_selected_id, false, _big_icons); //InvalidateRect(_hwnd, &rect, FALSE); //UpdateWindow(_hwnd); @@ -1134,7 +1145,7 @@ FontSelection font(canvas, GetStockFont(DEFAULT_GUI_FONT)); // widen window, if it is too small - int text_width = GetStartMenuBtnTextWidth(canvas, title, _hwnd) + 16/*icon*/ + 10/*placeholder*/ + 16/*arrow*/; + int text_width = GetStartMenuBtnTextWidth(canvas, title, _hwnd) + ICON_SIZE_X + 10/*placeholder*/ + 16/*arrow*/; int cx = clnt.right - _border_left; if (text_width > cx) @@ -1252,6 +1263,7 @@ ClientToScreen(_hwnd, &rect); x = rect.right; // Submenus should overlap their parent a bit. + const bool big_icons = _big_icons; y = rect.top+STARTMENU_LINE_HEIGHT +_border_top/*own border*/ -STARTMENU_TOP_BTN_SPACE/*border of new submenu*/; } else { WindowRect pos(_hwnd); @@ -1261,7 +1273,7 @@ } _submenu_id = id; - _submenu = StartMenu::Create(x, y, new_folders, _hwnd, title, creator, info, _create_info._filter); + _submenu = StartMenu::Create(x, y, new_folders, _hwnd, title, _big_icons, creator, info, _create_info._filter); } @@ -1353,10 +1365,10 @@ } #ifdef _LIGHT_STARTMENU -void DrawStartMenuButton(HDC hdc, const RECT& rect, LPCTSTR title, const SMBtnInfo& btn, bool has_focus, bool pushed) +void DrawStartMenuButton(HDC hdc, const RECT& rect, LPCTSTR title, const SMBtnInfo& btn, bool has_focus, bool pushed, bool big_icons) #else void DrawStartMenuButton(HDC hdc, const RECT& rect, LPCTSTR title, HICON hIcon, - bool hasSubmenu, bool enabled, bool has_focus, bool pushed); + bool hasSubmenu, bool enabled, bool has_focus, bool pushed, bool big_icons); #endif { UINT style = DFCS_BUTTONPUSH; @@ -1364,8 +1376,8 @@ if (!btn._enabled) style |= DFCS_INACTIVE; - POINT iconPos = {rect.left+2, (rect.top+rect.bottom-16)/2}; - RECT textRect = {rect.left+16+4, rect.top+2, rect.right-4, rect.bottom-4}; + POINT iconPos = {rect.left+2, (rect.top+rect.bottom-ICON_SIZE_Y)/2}; + RECT textRect = {rect.left+ICON_SIZE_X+4, rect.top+2, rect.right-4, rect.bottom-4}; if (pushed) { style |= DFCS_PUSHED; @@ -1389,16 +1401,16 @@ FillRect(hdc, &rect, bk_brush); if (btn._icon_id > ICID_NONE) - g_Globals._icon_cache.get_icon(btn._icon_id).draw(hdc, iconPos.x, iconPos.y, 16, 16, bk_color, bk_brush); + g_Globals._icon_cache.get_icon(btn._icon_id).draw(hdc, iconPos.x, iconPos.y, ICON_SIZE_X, ICON_SIZE_Y, bk_color, bk_brush/*, big_icons*/); // draw submenu arrow at the right if (btn._hasSubmenu) { - static SmallIcon arrowIcon(IDI_ARROW); - static SmallIcon selArrowIcon(IDI_ARROW_SELECTED); + ResIconEx arrowIcon(IDI_ARROW, ICON_SIZE_X, ICON_SIZE_Y); + ResIconEx selArrowIcon(IDI_ARROW_SELECTED, ICON_SIZE_X, ICON_SIZE_Y); - DrawIconEx(hdc, rect.right-16, iconPos.y, + DrawIconEx(hdc, rect.right-ICON_SIZE_X, iconPos.y, has_focus? selArrowIcon: arrowIcon, - 16, 16, 0, bk_brush, DI_NORMAL); + ICON_SIZE_X, ICON_SIZE_Y, 0, bk_brush, DI_NORMAL); } if (title) { @@ -1423,6 +1435,8 @@ WindowCanvas canvas(_hwnd); FontSelection font(canvas, GetStockFont(DEFAULT_GUI_FONT)); + const bool big_icons = _big_icons; + int max_width = STARTMENU_WIDTH_MIN; int height = 0; @@ -1439,7 +1453,7 @@ } // calculate new window size - int text_width = max_width + 16/*icon*/ + 10/*placeholder*/ + 16/*arrow*/; + int text_width = max_width + ICON_SIZE_X + 10/*placeholder*/ + 16/*arrow*/; RECT rt_hgt = {rect.left, rect.bottom-_border_top-height, rect.left+_border_left+text_width, rect.bottom}; AdjustWindowRectEx(&rt_hgt, GetWindowStyle(_hwnd), FALSE, GetWindowExStyle(_hwnd)); @@ -1529,7 +1543,7 @@ StartMenuRoot::StartMenuRoot(HWND hwnd) - : super(hwnd) + : super(hwnd, true) ///@todo big icons in start menu root { #ifndef __MINGW32__ // SHRestricted() missing in MinGW (as of 29.10.2003) if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCOMMONGROUPS)) @@ -1566,7 +1580,7 @@ } -static void CalculateStartPos(HWND hwndOwner, RECT& rect) +static void CalculateStartPos(HWND hwndOwner, RECT& rect, bool big_icons) { WindowRect pos(hwndOwner); @@ -1582,11 +1596,11 @@ AdjustWindowRectEx(&rect, WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN|WS_VISIBLE, FALSE, 0); } -HWND StartMenuRoot::Create(HWND hwndOwner) +HWND StartMenuRoot::Create(HWND hwndOwner, bool big_icons) { RECT rect; - CalculateStartPos(hwndOwner, rect); + CalculateStartPos(hwndOwner, rect, big_icons); return Window::Create(WINDOW_CREATOR(StartMenuRoot), 0, GetWndClasss(), TITLE_STARTMENU, WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN, @@ -1607,7 +1621,7 @@ // recalculate start menu root position RECT rect; - CalculateStartPos(GetParent(hwnd), rect); + CalculateStartPos(GetParent(hwnd), rect, _big_icons); SetWindowPos(hwnd, 0, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, 0); _____ Modified: trunk/reactos/subsys/system/explorer/taskbar/startmenu.h --- trunk/reactos/subsys/system/explorer/taskbar/startmenu.h 2005-11-04 00:20:17 UTC (rev 18982) +++ trunk/reactos/subsys/system/explorer/taskbar/startmenu.h 2005-11-04 00:21:12 UTC (rev 18983) @@ -36,7 +36,7 @@ #define STARTMENU_WIDTH_MIN 120 -#define STARTMENU_LINE_HEIGHT 20 +#define STARTMENU_LINE_HEIGHT (ICON_SIZE_X+4) #define STARTMENU_SEP_HEIGHT (STARTMENU_LINE_HEIGHT/2) #define STARTMENU_TOP_BTN_SPACE 8 @@ -187,12 +187,12 @@ typedef vector<SMBtnInfo> SMBtnVector; -extern void DrawStartMenuButton(HDC hdc, const RECT& rect, LPCTSTR title, const SMBtnInfo& btn, bool has_focus, bool pushed); +extern void DrawStartMenuButton(HDC hdc, const RECT& rect, LPCTSTR title, const SMBtnInfo& btn, bool has_focus, bool pushed, bool big_icons); #else extern void DrawStartMenuButton(HDC hdc, const RECT& rect, LPCTSTR title, HICON hIcon, - bool hasSubmenu, bool enabled, bool has_focus, bool pushed); + bool hasSubmenu, bool enabled, bool has_focus, bool pushed, bool big_icons); #endif @@ -214,11 +214,11 @@ typedef ExtContextMenuHandlerT<OwnerDrawParent<DialogWindow> > super; #endif - StartMenu(HWND hwnd); - StartMenu(HWND hwnd, const StartMenuCreateInfo& create_info); + StartMenu(HWND hwnd, bool big_icons=false); + StartMenu(HWND hwnd, const StartMenuCreateInfo& create_info, bool big_icons=false); ~StartMenu(); - static HWND Create(int x, int y, const StartMenuFolders&, HWND hwndParent, LPCTSTR title, + static HWND Create(int x, int y, const StartMenuFolders&, HWND hwndParent, LPCTSTR title, bool parent_big_icons, CREATORFUNC_INFO creator=s_def_creator, void* info=NULL, const String& filter=""); static CREATORFUNC_INFO s_def_creator; @@ -253,6 +253,8 @@ StartMenuCreateInfo _create_info; // copy of the original create info + bool _big_icons; + #ifdef _LIGHT_STARTMENU SMBtnVector _buttons; int _selected_id; @@ -301,7 +303,7 @@ void GetFloatingButtonRect(LPRECT prect); void GetArrowButtonRects(LPRECT prect_up, LPRECT prect_down); - void DrawArrows(HDC hdc); + void DrawArrows(HDC hdc, bool big_icons); void Paint(PaintCanvas& canvas); void UpdateIcons(/*int idx*/); @@ -336,13 +338,13 @@ { typedef StartMenu super; - StartMenuHandler(HWND hwnd) - : super(hwnd) + StartMenuHandler(HWND hwnd, bool big_icons=false) + : super(hwnd, big_icons) { } - StartMenuHandler(HWND hwnd, const StartMenuCreateInfo& create_info) - : super(hwnd, create_info) + StartMenuHandler(HWND hwnd, const StartMenuCreateInfo& create_info, bool big_icons=false) + : super(hwnd, create_info, big_icons) { } @@ -363,7 +365,7 @@ StartMenuRoot(HWND hwnd); - static HWND Create(HWND hwndDesktopBar); + static HWND Create(HWND hwndDesktopBar, bool big_icons); void TrackStartmenu(); protected:
19 years, 1 month
1
0
0
0
[gedmurphy] 18982: Started testing. Couple of code mods to get 'sc start ...' working.
by gedmurphy@svn.reactos.com
Started testing. Couple of code mods to get 'sc start ...' working. Modified: trunk/reactos/subsys/system/sc/sc.c Modified: trunk/reactos/subsys/system/sc/start.c _____ Modified: trunk/reactos/subsys/system/sc/sc.c --- trunk/reactos/subsys/system/sc/sc.c 2005-11-04 00:10:39 UTC (rev 18981) +++ trunk/reactos/subsys/system/sc/sc.c 2005-11-04 00:20:17 UTC (rev 18982) @@ -52,7 +52,7 @@ _tprintf(_T("Remote service control is not yet implemented\n")); return 2; } -/* + hSCManager = OpenSCManager(MachineName, NULL, SC_MANAGER_ALL_ACCESS); if (hSCManager == NULL) { @@ -60,8 +60,8 @@ ReportLastError(); return -1; } -*/ + if (_tcsicmp(Command, _T("query")) == 0) Query(Args, FALSE); @@ -71,7 +71,7 @@ else if (_tcsicmp(Command, _T("start")) == 0) { if (*Args) - Start(3, Args); + Start(0, Args); else StartUsage(); } _____ Modified: trunk/reactos/subsys/system/sc/start.c --- trunk/reactos/subsys/system/sc/start.c 2005-11-04 00:10:39 UTC (rev 18981) +++ trunk/reactos/subsys/system/sc/start.c 2005-11-04 00:20:17 UTC (rev 18982) @@ -21,13 +21,15 @@ /* testing */ - printf("service to start - %s\n\n", ServiceName); - printf("Arguments :\n"); + _tprintf(_T("service to start - %s\n\n"), ServiceName); + _tprintf(_T("Arguments :\n")); while (*ServiceArgs) { printf("%s\n", *ServiceArgs); ServiceArgs++; } + if (! *ServiceArgs) + ServiceArgs = NULL; /* get a handle to the service requested for starting */ hSc = OpenService(hSCManager, ServiceName, SERVICE_ALL_ACCESS);
19 years, 1 month
1
0
0
0
[royce] 18981: fix uninitialized variable
by royce@svn.reactos.com
fix uninitialized variable Modified: trunk/reactos/drivers/fs/vfat/create.c _____ Modified: trunk/reactos/drivers/fs/vfat/create.c --- trunk/reactos/drivers/fs/vfat/create.c 2005-11-04 00:07:47 UTC (rev 18980) +++ trunk/reactos/drivers/fs/vfat/create.c 2005-11-04 00:10:39 UTC (rev 18981) @@ -37,22 +37,22 @@ OEM_STRING StringA; USHORT Length; CHAR cString[12]; - + RtlCopyMemory(cString, pEntry->ShortName, 11); cString[11] = 0; if (cString[0] == 0x05) { cString[0] = 0xe5; } - + StringA.Buffer = cString; for (StringA.Length = 0; StringA.Length < 8 && StringA.Buffer[StringA.Length] != ' '; StringA.Length++); StringA.MaximumLength = StringA.Length; - + RtlOemStringToUnicodeString(NameU, &StringA, FALSE); - + if (pEntry->lCase & VFAT_CASE_LOWER_BASE) { RtlDowncaseUnicodeString(NameU, NameU, FALSE); @@ -69,7 +69,7 @@ } NameU->Length = 0; NameU->MaximumLength -= Length; - + StringA.Buffer = &cString[8]; for (StringA.Length = 0; StringA.Length < 3 && StringA.Buffer[StringA.Length] != ' '; @@ -103,13 +103,13 @@ ULONG SizeDirEntry; ULONG EntriesPerPage; OEM_STRING StringO; - + NameU.Buffer = Vpb->VolumeLabel; NameU.Length = 0; NameU.MaximumLength = sizeof(Vpb->VolumeLabel); *(Vpb->VolumeLabel) = 0; Vpb->VolumeLabelLength = 0; - + if (DeviceExt->Flags & VCB_IS_FATX) { SizeDirEntry = sizeof(FATX_DIR_ENTRY); @@ -120,11 +120,11 @@ SizeDirEntry = sizeof(FAT_DIR_ENTRY); EntriesPerPage = FAT_ENTRIES_PER_PAGE; } - + ExAcquireResourceExclusiveLite (&DeviceExt->DirResource, TRUE); pFcb = vfatOpenRootFCB (DeviceExt); ExReleaseResourceLite (&DeviceExt->DirResource); - + FileOffset.QuadPart = 0; if (CcMapData(pFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, &Context, (PVOID*)&Entry)) { @@ -171,7 +171,7 @@ ExAcquireResourceExclusiveLite (&DeviceExt->DirResource, TRUE); vfatReleaseFCB (DeviceExt, pFcb); ExReleaseResourceLite (&DeviceExt->DirResource); - + return STATUS_SUCCESS; } @@ -196,11 +196,11 @@ UNICODE_STRING PathNameU; UNICODE_STRING FileToFindUpcase; BOOLEAN WildCard; - + DPRINT ("FindFile(Parent %x, FileToFind '%wZ', DirIndex: %d)\n", Parent, FileToFindU, DirContext->DirIndex); DPRINT ("FindFile: Path %wZ)\n",&Parent->PathNameU); - + PathNameBufferLength = LONGNAME_MAX_LENGTH * sizeof(WCHAR); PathNameBuffer = ExAllocatePool(NonPagedPool, PathNameBufferLength + sizeof(WCHAR)); if (!PathNameBuffer) @@ -208,16 +208,16 @@ CHECKPOINT1; return STATUS_INSUFFICIENT_RESOURCES; } - + PathNameU.Buffer = PathNameBuffer; PathNameU.Length = 0; PathNameU.MaximumLength = PathNameBufferLength; - + DirContext->LongNameU.Length = 0; DirContext->ShortNameU.Length = 0; - + WildCard = FsRtlDoesNameContainWildCards(FileToFindU); - + if (WildCard == FALSE) { /* if there is no '*?' in the search name, than look first for an existing fcb */ @@ -258,7 +258,7 @@ return Status; } } - + /* FsRtlIsNameInExpression need the searched string to be upcase, * even if IgnoreCase is specified */ Status = RtlUpcaseUnicodeString(&FileToFindUpcase, FileToFindU, TRUE); @@ -268,7 +268,7 @@ ExFreePool(PathNameBuffer); return Status; } - + while(TRUE) { Status = DeviceExt->GetNextDirEntry(&Context, &Page, Parent, DirContext, First); @@ -292,7 +292,7 @@ Found = FsRtlAreNamesEqual(&DirContext->LongNameU, FileToFindU, TRUE, NULL) || FsRtlAreNamesEqual(&DirContext->ShortNameU, FileToFindU, TRUE, NULL); } - + if (Found) { if (WildCard) @@ -315,7 +315,7 @@ DPRINT("%d\n", DirContext->LongNameU.Length); DPRINT("FindFile: new Name %wZ, DirIndex %d\n", &DirContext->LongNameU, DirContext->DirIndex); - + if (Context) { CcUnpinData(Context); @@ -326,12 +326,12 @@ } DirContext->DirIndex++; } - + if (Context) { CcUnpinData(Context); } - + RtlFreeUnicodeString(&FileToFindUpcase); ExFreePool(PathNameBuffer); return Status; @@ -350,13 +350,13 @@ NTSTATUS Status; UNICODE_STRING PathNameU; WCHAR Buffer[260]; - + DPRINT ("VfatOpenFile(%08lx, %08lx, '%wZ')\n", DeviceExt, FileObject, &FileObject->FileName); - + if (FileObject->RelatedFileObject) { DPRINT ("'%wZ'\n", &FileObject->RelatedFileObject->FileName); - + *ParentFcb = FileObject->RelatedFileObject->FsContext; (*ParentFcb)->RefCount++; } @@ -364,7 +364,7 @@ { *ParentFcb = NULL; } - + if (!DeviceExt->FatInfo.FixedMedia) { Status = VfatBlockDeviceIoControl (DeviceExt->StorageDevice, @@ -374,17 +374,17 @@ NULL, 0, FALSE); - + if (Status == STATUS_VERIFY_REQUIRED) - + { PDEVICE_OBJECT DeviceToVerify; - + DPRINT ("Media change detected!\n"); DPRINT ("Device %p\n", DeviceExt->StorageDevice); - + DeviceToVerify = IoGetDeviceToVerify (PsGetCurrentThread ()); - + IoSetDeviceToVerify (PsGetCurrentThread (), NULL); Status = IoVerifyVolume (DeviceExt->StorageDevice, @@ -397,12 +397,12 @@ return Status; } } - + if (*ParentFcb) { (*ParentFcb)->RefCount++; } - + PathNameU.Buffer = Buffer; PathNameU.Length = 0; PathNameU.MaximumLength = sizeof(Buffer); @@ -413,10 +413,10 @@ PathNameU.Length -= sizeof(WCHAR); } PathNameU.Buffer[PathNameU.Length / sizeof(WCHAR)] = 0; - + /* try first to find an existing FCB in memory */ DPRINT ("Checking for existing FCB in memory\n"); - + Status = vfatGetFCBForFile (DeviceExt, ParentFcb, &Fcb, &PathNameU); if (!NT_SUCCESS (Status)) { @@ -449,14 +449,14 @@ PDEVICE_EXTENSION DeviceExt; ULONG RequestedDisposition, RequestedOptions; PVFATCCB pCcb; - PVFATFCB pFcb; + PVFATFCB pFcb = NULL; PVFATFCB ParentFcb; PWCHAR c, last; BOOLEAN PagingFileCreate = FALSE; LARGE_INTEGER AllocationSize; BOOLEAN Dots; UNICODE_STRING FileNameU; - + /* Unpack the various parameters. */ Stack = IoGetCurrentIrpStackLocation (Irp); RequestedDisposition = ((Stack->Parameters.Create.Options >> 24) & 0xff); @@ -465,14 +465,14 @@ PagingFileCreate = (Stack->Flags & SL_OPEN_PAGING_FILE) ? TRUE : FALSE; FileObject = Stack->FileObject; DeviceExt = DeviceObject->DeviceExtension; - + /* Check their validity. */ if (RequestedOptions & FILE_DIRECTORY_FILE && RequestedDisposition == FILE_SUPERSEDE) { return(STATUS_INVALID_PARAMETER); } - + /* This a open operation for the volume itself */ if (FileObject->FileName.Length == 0 && FileObject->RelatedFileObject == NULL) @@ -498,11 +498,11 @@ FileObject->FsContext = pFcb; FileObject->FsContext2 = pCcb; pFcb->RefCount++; - + Irp->IoStatus.Information = FILE_OPENED; return(STATUS_SUCCESS); } - + /* * Check for illegal characters and illegale dot sequences in the file name */ @@ -524,16 +524,16 @@ { Dots = FALSE; } - + if (*c != '\\' && vfatIsLongIllegal(*c)) { return(STATUS_OBJECT_NAME_INVALID); } } - + /* Try opening the file. */ Status = VfatOpenFile (DeviceExt, FileObject, &ParentFcb); - + /* * If the directory containing the file to open doesn't exist then * fail immediately @@ -548,7 +548,7 @@ } return(Status); } - + /* * If the file open failed then create the required file */ @@ -561,7 +561,7 @@ { ULONG Attributes; Attributes = Stack->Parameters.Create.FileAttributes; - + vfatSplitPathName(&FileObject->FileName, NULL, &FileNameU); Status = VfatAddEntry (DeviceExt, &FileNameU, &pFcb, ParentFcb, RequestedOptions, (UCHAR)(Attributes & FILE_ATTRIBUTE_VALID_FLAGS)); @@ -574,9 +574,9 @@ vfatReleaseFCB (DeviceExt, pFcb); return Status; } - + Irp->IoStatus.Information = FILE_CREATED; - + VfatSetAllocationSizeInformation(FileObject, pFcb, DeviceExt, @@ -584,7 +584,7 @@ VfatSetExtendedAttributes(FileObject, Irp->AssociatedIrp.SystemBuffer, Stack->Parameters.Create.EaLength); - + if (PagingFileCreate) { pFcb->Flags |= FCB_IS_PAGE_FILE; @@ -614,9 +614,9 @@ VfatCloseFile (DeviceExt, FileObject); return(STATUS_OBJECT_NAME_COLLISION); } - + pFcb = FileObject->FsContext; - + if (pFcb->OpenHandleCount != 0) { Status = IoCheckShareAccess(Stack->Parameters.Create.SecurityContext->DesiredAcce ss, @@ -630,7 +630,7 @@ return(Status); } } - + /* * Check the file has the requested attributes */ @@ -646,7 +646,7 @@ VfatCloseFile (DeviceExt, FileObject); return(STATUS_NOT_A_DIRECTORY); } - + if (PagingFileCreate) { /* FIXME: @@ -678,8 +678,8 @@ return(STATUS_INVALID_PARAMETER); } } - - + + if (RequestedDisposition == FILE_OVERWRITE || RequestedDisposition == FILE_OVERWRITE_IF) { @@ -694,8 +694,8 @@ return(Status); } } - - + + /* Supersede the file */ if (RequestedDisposition == FILE_SUPERSEDE) { @@ -712,7 +712,7 @@ Irp->IoStatus.Information = FILE_OPENED; } } - + if (pFcb->OpenHandleCount == 0) { IoSetShareAccess(Stack->Parameters.Create.SecurityContext->DesiredAccess , @@ -726,13 +726,13 @@ FileObject, &pFcb->FCBShareAccess ); - + } - + pFcb->OpenHandleCount++; - + /* FIXME : test write access if requested */ - + return(Status); } @@ -744,9 +744,9 @@ */ { NTSTATUS Status; - + ASSERT(IrpContext); - + if (IrpContext->DeviceObject == VfatGlobalData->DeviceObject) { /* DeviceObject represents FileSystem instead of logical volume */ @@ -757,17 +757,17 @@ VfatFreeIrpContext(IrpContext); return(STATUS_SUCCESS); } - + if (!(IrpContext->Flags & IRPCONTEXT_CANWAIT)) { return(VfatQueueRequest (IrpContext)); } - + IrpContext->Irp->IoStatus.Information = 0; ExAcquireResourceExclusiveLite (&IrpContext->DeviceExt->DirResource, TRUE); Status = VfatCreateFile (IrpContext->DeviceObject, IrpContext->Irp); ExReleaseResourceLite (&IrpContext->DeviceExt->DirResource); - + IrpContext->Irp->IoStatus.Status = Status; IoCompleteRequest (IrpContext->Irp, (CCHAR)(NT_SUCCESS(Status) ? IO_DISK_INCREMENT : IO_NO_INCREMENT));
19 years, 1 month
1
0
0
0
[royce] 18980: fix indentation
by royce@svn.reactos.com
fix indentation Modified: trunk/reactos/drivers/fs/vfat/create.c _____ Modified: trunk/reactos/drivers/fs/vfat/create.c --- trunk/reactos/drivers/fs/vfat/create.c 2005-11-04 00:03:34 UTC (rev 18979) +++ trunk/reactos/drivers/fs/vfat/create.c 2005-11-04 00:07:47 UTC (rev 18980) @@ -31,60 +31,61 @@ /* FUNCTIONS *****************************************************************/ -void vfat8Dot3ToString (PFAT_DIR_ENTRY pEntry, PUNICODE_STRING NameU) +void +vfat8Dot3ToString (PFAT_DIR_ENTRY pEntry, PUNICODE_STRING NameU) { - OEM_STRING StringA; - USHORT Length; - CHAR cString[12]; - - RtlCopyMemory(cString, pEntry->ShortName, 11); - cString[11] = 0; - if (cString[0] == 0x05) - { - cString[0] = 0xe5; - } - - StringA.Buffer = cString; - for (StringA.Length = 0; - StringA.Length < 8 && StringA.Buffer[StringA.Length] != ' '; - StringA.Length++); - StringA.MaximumLength = StringA.Length; - - RtlOemStringToUnicodeString(NameU, &StringA, FALSE); - - if (pEntry->lCase & VFAT_CASE_LOWER_BASE) - { - RtlDowncaseUnicodeString(NameU, NameU, FALSE); - } - if (cString[8] != ' ') - { - Length = NameU->Length; - NameU->Buffer += Length / sizeof(WCHAR); - if (!FAT_ENTRY_VOLUME(pEntry)) - { - Length += sizeof(WCHAR); - NameU->Buffer[0] = L'.'; - NameU->Buffer++; + OEM_STRING StringA; + USHORT Length; + CHAR cString[12]; + + RtlCopyMemory(cString, pEntry->ShortName, 11); + cString[11] = 0; + if (cString[0] == 0x05) + { + cString[0] = 0xe5; } - NameU->Length = 0; - NameU->MaximumLength -= Length; - - StringA.Buffer = &cString[8]; - for (StringA.Length = 0; - StringA.Length < 3 && StringA.Buffer[StringA.Length] != ' '; - StringA.Length++); - StringA.MaximumLength = StringA.Length; - RtlOemStringToUnicodeString(NameU, &StringA, FALSE); - if (pEntry->lCase & VFAT_CASE_LOWER_EXT) - { - RtlDowncaseUnicodeString(NameU, NameU, FALSE); - } - NameU->Buffer -= Length / sizeof(WCHAR); - NameU->Length += Length; - NameU->MaximumLength += Length; - } - NameU->Buffer[NameU->Length / sizeof(WCHAR)] = 0; - DPRINT("'%wZ'\n", NameU); + + StringA.Buffer = cString; + for (StringA.Length = 0; + StringA.Length < 8 && StringA.Buffer[StringA.Length] != ' '; + StringA.Length++); + StringA.MaximumLength = StringA.Length; + + RtlOemStringToUnicodeString(NameU, &StringA, FALSE); + + if (pEntry->lCase & VFAT_CASE_LOWER_BASE) + { + RtlDowncaseUnicodeString(NameU, NameU, FALSE); + } + if (cString[8] != ' ') + { + Length = NameU->Length; + NameU->Buffer += Length / sizeof(WCHAR); + if (!FAT_ENTRY_VOLUME(pEntry)) + { + Length += sizeof(WCHAR); + NameU->Buffer[0] = L'.'; + NameU->Buffer++; + } + NameU->Length = 0; + NameU->MaximumLength -= Length; + + StringA.Buffer = &cString[8]; + for (StringA.Length = 0; + StringA.Length < 3 && StringA.Buffer[StringA.Length] != ' '; + StringA.Length++); + StringA.MaximumLength = StringA.Length; + RtlOemStringToUnicodeString(NameU, &StringA, FALSE); + if (pEntry->lCase & VFAT_CASE_LOWER_EXT) + { + RtlDowncaseUnicodeString(NameU, NameU, FALSE); + } + NameU->Buffer -= Length / sizeof(WCHAR); + NameU->Length += Length; + NameU->MaximumLength += Length; + } + NameU->Buffer[NameU->Length / sizeof(WCHAR)] = 0; + DPRINT("'%wZ'\n", NameU); } NTSTATUS @@ -93,680 +94,685 @@ * FUNCTION: Read the volume label */ { - PVOID Context = NULL; - ULONG DirIndex = 0; - PDIR_ENTRY Entry; - PVFATFCB pFcb; - LARGE_INTEGER FileOffset; - UNICODE_STRING NameU; - ULONG SizeDirEntry; - ULONG EntriesPerPage; - OEM_STRING StringO; - - NameU.Buffer = Vpb->VolumeLabel; - NameU.Length = 0; - NameU.MaximumLength = sizeof(Vpb->VolumeLabel); - *(Vpb->VolumeLabel) = 0; - Vpb->VolumeLabelLength = 0; - - if (DeviceExt->Flags & VCB_IS_FATX) - { - SizeDirEntry = sizeof(FATX_DIR_ENTRY); - EntriesPerPage = FATX_ENTRIES_PER_PAGE; - } - else - { - SizeDirEntry = sizeof(FAT_DIR_ENTRY); - EntriesPerPage = FAT_ENTRIES_PER_PAGE; - } - - ExAcquireResourceExclusiveLite (&DeviceExt->DirResource, TRUE); - pFcb = vfatOpenRootFCB (DeviceExt); - ExReleaseResourceLite (&DeviceExt->DirResource); - - FileOffset.QuadPart = 0; - if (CcMapData(pFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, &Context, (PVOID*)&Entry)) - { - while (TRUE) - { - if (ENTRY_VOLUME(DeviceExt, Entry)) - { - /* copy volume label */ - if (DeviceExt->Flags & VCB_IS_FATX) - { - StringO.Buffer = (PCHAR)Entry->FatX.Filename; - StringO.MaximumLength = StringO.Length = Entry->FatX.FilenameLength; - RtlOemStringToUnicodeString(&NameU, &StringO, FALSE); - } - else - { - vfat8Dot3ToString (&Entry->Fat, &NameU); - } - Vpb->VolumeLabelLength = NameU.Length; - break; - } - if (ENTRY_END(DeviceExt, Entry)) - { - break; - } - DirIndex++; - Entry = (PDIR_ENTRY)((ULONG_PTR)Entry + SizeDirEntry); - if ((DirIndex % EntriesPerPage) == 0) - { - CcUnpinData(Context); - FileOffset.u.LowPart += PAGE_SIZE; - if (!CcMapData(pFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, &Context, (PVOID*)&Entry)) - { - Context = NULL; - break; - } - } - } - if (Context) - { - CcUnpinData(Context); - } - } - ExAcquireResourceExclusiveLite (&DeviceExt->DirResource, TRUE); - vfatReleaseFCB (DeviceExt, pFcb); - ExReleaseResourceLite (&DeviceExt->DirResource); - - return STATUS_SUCCESS; + PVOID Context = NULL; + ULONG DirIndex = 0; + PDIR_ENTRY Entry; + PVFATFCB pFcb; + LARGE_INTEGER FileOffset; + UNICODE_STRING NameU; + ULONG SizeDirEntry; + ULONG EntriesPerPage; + OEM_STRING StringO; + + NameU.Buffer = Vpb->VolumeLabel; + NameU.Length = 0; + NameU.MaximumLength = sizeof(Vpb->VolumeLabel); + *(Vpb->VolumeLabel) = 0; + Vpb->VolumeLabelLength = 0; + + if (DeviceExt->Flags & VCB_IS_FATX) + { + SizeDirEntry = sizeof(FATX_DIR_ENTRY); + EntriesPerPage = FATX_ENTRIES_PER_PAGE; + } + else + { + SizeDirEntry = sizeof(FAT_DIR_ENTRY); + EntriesPerPage = FAT_ENTRIES_PER_PAGE; + } + + ExAcquireResourceExclusiveLite (&DeviceExt->DirResource, TRUE); + pFcb = vfatOpenRootFCB (DeviceExt); + ExReleaseResourceLite (&DeviceExt->DirResource); + + FileOffset.QuadPart = 0; + if (CcMapData(pFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, &Context, (PVOID*)&Entry)) + { + while (TRUE) + { + if (ENTRY_VOLUME(DeviceExt, Entry)) + { + /* copy volume label */ + if (DeviceExt->Flags & VCB_IS_FATX) + { + StringO.Buffer = (PCHAR)Entry->FatX.Filename; + StringO.MaximumLength = StringO.Length = Entry->FatX.FilenameLength; + RtlOemStringToUnicodeString(&NameU, &StringO, FALSE); + } + else + { + vfat8Dot3ToString (&Entry->Fat, &NameU); + } + Vpb->VolumeLabelLength = NameU.Length; + break; + } + if (ENTRY_END(DeviceExt, Entry)) + { + break; + } + DirIndex++; + Entry = (PDIR_ENTRY)((ULONG_PTR)Entry + SizeDirEntry); + if ((DirIndex % EntriesPerPage) == 0) + { + CcUnpinData(Context); + FileOffset.u.LowPart += PAGE_SIZE; + if (!CcMapData(pFcb->FileObject, &FileOffset, PAGE_SIZE, TRUE, &Context, (PVOID*)&Entry)) + { + Context = NULL; + break; + } + } + } + if (Context) + { + CcUnpinData(Context); + } + } + ExAcquireResourceExclusiveLite (&DeviceExt->DirResource, TRUE); + vfatReleaseFCB (DeviceExt, pFcb); + ExReleaseResourceLite (&DeviceExt->DirResource); + + return STATUS_SUCCESS; } NTSTATUS -FindFile (PDEVICE_EXTENSION DeviceExt, - PVFATFCB Parent, - PUNICODE_STRING FileToFindU, - PVFAT_DIRENTRY_CONTEXT DirContext, - BOOLEAN First) +FindFile ( + PDEVICE_EXTENSION DeviceExt, + PVFATFCB Parent, + PUNICODE_STRING FileToFindU, + PVFAT_DIRENTRY_CONTEXT DirContext, + BOOLEAN First) /* * FUNCTION: Find a file */ { - PWCHAR PathNameBuffer; - USHORT PathNameBufferLength; - NTSTATUS Status; - PVOID Context = NULL; - PVOID Page; - PVFATFCB rcFcb; - BOOLEAN Found; - UNICODE_STRING PathNameU; - UNICODE_STRING FileToFindUpcase; - BOOLEAN WildCard; - - DPRINT ("FindFile(Parent %x, FileToFind '%wZ', DirIndex: %d)\n", - Parent, FileToFindU, DirContext->DirIndex); - DPRINT ("FindFile: Path %wZ)\n",&Parent->PathNameU); - - PathNameBufferLength = LONGNAME_MAX_LENGTH * sizeof(WCHAR); - PathNameBuffer = ExAllocatePool(NonPagedPool, PathNameBufferLength + sizeof(WCHAR)); - if (!PathNameBuffer) - { - CHECKPOINT1; - return STATUS_INSUFFICIENT_RESOURCES; - } - - PathNameU.Buffer = PathNameBuffer; - PathNameU.Length = 0; - PathNameU.MaximumLength = PathNameBufferLength; - - DirContext->LongNameU.Length = 0; - DirContext->ShortNameU.Length = 0; - - WildCard = FsRtlDoesNameContainWildCards(FileToFindU); - - if (WildCard == FALSE) - { - /* if there is no '*?' in the search name, than look first for an existing fcb */ - RtlCopyUnicodeString(&PathNameU, &Parent->PathNameU); - if (!vfatFCBIsRoot(Parent)) - { - PathNameU.Buffer[PathNameU.Length / sizeof(WCHAR)] = L'\\'; - PathNameU.Length += sizeof(WCHAR); - } - RtlAppendUnicodeStringToString(&PathNameU, FileToFindU); - PathNameU.Buffer[PathNameU.Length / sizeof(WCHAR)] = 0; - rcFcb = vfatGrabFCBFromTable(DeviceExt, &PathNameU); - if (rcFcb) - { - ULONG startIndex = rcFcb->startIndex; - if ((rcFcb->Flags & FCB_IS_FATX_ENTRY) && !vfatFCBIsRoot(Parent)) - { - startIndex += 2; - } - if(startIndex >= DirContext->DirIndex) - { - RtlCopyUnicodeString(&DirContext->LongNameU, &rcFcb->LongNameU); - RtlCopyUnicodeString(&DirContext->ShortNameU, &rcFcb->ShortNameU); - RtlCopyMemory(&DirContext->DirEntry, &rcFcb->entry, sizeof(DIR_ENTRY)); - DirContext->StartIndex = rcFcb->startIndex; - DirContext->DirIndex = rcFcb->dirIndex; - DPRINT("FindFile: new Name %wZ, DirIndex %d (%d)\n", - &DirContext->LongNameU, DirContext->DirIndex, DirContext->StartIndex); - Status = STATUS_SUCCESS; - } - else - { - CHECKPOINT1; - Status = STATUS_UNSUCCESSFUL; - } - vfatReleaseFCB(DeviceExt, rcFcb); - ExFreePool(PathNameBuffer); - return Status; + PWCHAR PathNameBuffer; + USHORT PathNameBufferLength; + NTSTATUS Status; + PVOID Context = NULL; + PVOID Page; + PVFATFCB rcFcb; + BOOLEAN Found; + UNICODE_STRING PathNameU; + UNICODE_STRING FileToFindUpcase; + BOOLEAN WildCard; + + DPRINT ("FindFile(Parent %x, FileToFind '%wZ', DirIndex: %d)\n", + Parent, FileToFindU, DirContext->DirIndex); + DPRINT ("FindFile: Path %wZ)\n",&Parent->PathNameU); + + PathNameBufferLength = LONGNAME_MAX_LENGTH * sizeof(WCHAR); + PathNameBuffer = ExAllocatePool(NonPagedPool, PathNameBufferLength + sizeof(WCHAR)); + if (!PathNameBuffer) + { + CHECKPOINT1; + return STATUS_INSUFFICIENT_RESOURCES; } - } - - /* FsRtlIsNameInExpression need the searched string to be upcase, - * even if IgnoreCase is specified */ - Status = RtlUpcaseUnicodeString(&FileToFindUpcase, FileToFindU, TRUE); - if (!NT_SUCCESS(Status)) - { - CHECKPOINT; - ExFreePool(PathNameBuffer); - return Status; - } - - while(TRUE) - { - Status = DeviceExt->GetNextDirEntry(&Context, &Page, Parent, DirContext, First); - First = FALSE; - if (Status == STATUS_NO_MORE_ENTRIES) - { - break; - } - if (ENTRY_VOLUME(DeviceExt, &DirContext->DirEntry)) - { - DirContext->DirIndex++; - continue; - } - if (WildCard) - { - Found = FsRtlIsNameInExpression(&FileToFindUpcase, &DirContext->LongNameU, TRUE, NULL) || - FsRtlIsNameInExpression(&FileToFindUpcase, &DirContext->ShortNameU, TRUE, NULL); + + PathNameU.Buffer = PathNameBuffer; + PathNameU.Length = 0; + PathNameU.MaximumLength = PathNameBufferLength; + + DirContext->LongNameU.Length = 0; + DirContext->ShortNameU.Length = 0; + + WildCard = FsRtlDoesNameContainWildCards(FileToFindU); + + if (WildCard == FALSE) + { + /* if there is no '*?' in the search name, than look first for an existing fcb */ + RtlCopyUnicodeString(&PathNameU, &Parent->PathNameU); + if (!vfatFCBIsRoot(Parent)) + { + PathNameU.Buffer[PathNameU.Length / sizeof(WCHAR)] = L'\\'; + PathNameU.Length += sizeof(WCHAR); + } + RtlAppendUnicodeStringToString(&PathNameU, FileToFindU); + PathNameU.Buffer[PathNameU.Length / sizeof(WCHAR)] = 0; + rcFcb = vfatGrabFCBFromTable(DeviceExt, &PathNameU); + if (rcFcb) + { + ULONG startIndex = rcFcb->startIndex; + if ((rcFcb->Flags & FCB_IS_FATX_ENTRY) && !vfatFCBIsRoot(Parent)) + { + startIndex += 2; + } + if(startIndex >= DirContext->DirIndex) + { + RtlCopyUnicodeString(&DirContext->LongNameU, &rcFcb->LongNameU); + RtlCopyUnicodeString(&DirContext->ShortNameU, &rcFcb->ShortNameU); + RtlCopyMemory(&DirContext->DirEntry, &rcFcb->entry, sizeof(DIR_ENTRY)); + DirContext->StartIndex = rcFcb->startIndex; + DirContext->DirIndex = rcFcb->dirIndex; + DPRINT("FindFile: new Name %wZ, DirIndex %d (%d)\n", + &DirContext->LongNameU, DirContext->DirIndex, DirContext->StartIndex); + Status = STATUS_SUCCESS; + } + else + { + CHECKPOINT1; + Status = STATUS_UNSUCCESSFUL; + } + vfatReleaseFCB(DeviceExt, rcFcb); + ExFreePool(PathNameBuffer); + return Status; + } } - else - { - Found = FsRtlAreNamesEqual(&DirContext->LongNameU, FileToFindU, TRUE, NULL) || - FsRtlAreNamesEqual(&DirContext->ShortNameU, FileToFindU, TRUE, NULL); + + /* FsRtlIsNameInExpression need the searched string to be upcase, + * even if IgnoreCase is specified */ + Status = RtlUpcaseUnicodeString(&FileToFindUpcase, FileToFindU, TRUE); + if (!NT_SUCCESS(Status)) + { + CHECKPOINT; + ExFreePool(PathNameBuffer); + return Status; } - - if (Found) - { - if (WildCard) - { - RtlCopyUnicodeString(&PathNameU, &Parent->PathNameU); - if (!vfatFCBIsRoot(Parent)) - { - PathNameU.Buffer[PathNameU.Length / sizeof(WCHAR)] = L'\\'; - PathNameU.Length += sizeof(WCHAR); - } - RtlAppendUnicodeStringToString(&PathNameU, &DirContext->LongNameU); - PathNameU.Buffer[PathNameU.Length / sizeof(WCHAR)] = 0; - rcFcb = vfatGrabFCBFromTable(DeviceExt, &PathNameU); - if (rcFcb != NULL) - { - RtlCopyMemory(&DirContext->DirEntry, &rcFcb->entry, sizeof(DIR_ENTRY)); - vfatReleaseFCB(DeviceExt, rcFcb); + + while(TRUE) + { + Status = DeviceExt->GetNextDirEntry(&Context, &Page, Parent, DirContext, First); + First = FALSE; + if (Status == STATUS_NO_MORE_ENTRIES) + { + break; } - } - DPRINT("%d\n", DirContext->LongNameU.Length); - DPRINT("FindFile: new Name %wZ, DirIndex %d\n", - &DirContext->LongNameU, DirContext->DirIndex); - - if (Context) - { - CcUnpinData(Context); - } - RtlFreeUnicodeString(&FileToFindUpcase); - ExFreePool(PathNameBuffer); - return STATUS_SUCCESS; + if (ENTRY_VOLUME(DeviceExt, &DirContext->DirEntry)) + { + DirContext->DirIndex++; + continue; + } + if (WildCard) + { + Found = FsRtlIsNameInExpression(&FileToFindUpcase, &DirContext->LongNameU, TRUE, NULL) || + FsRtlIsNameInExpression(&FileToFindUpcase, &DirContext->ShortNameU, TRUE, NULL); + } + else + { + Found = FsRtlAreNamesEqual(&DirContext->LongNameU, FileToFindU, TRUE, NULL) || + FsRtlAreNamesEqual(&DirContext->ShortNameU, FileToFindU, TRUE, NULL); + } + + if (Found) + { + if (WildCard) + { + RtlCopyUnicodeString(&PathNameU, &Parent->PathNameU); + if (!vfatFCBIsRoot(Parent)) + { + PathNameU.Buffer[PathNameU.Length / sizeof(WCHAR)] = L'\\'; + PathNameU.Length += sizeof(WCHAR); + } + RtlAppendUnicodeStringToString(&PathNameU, &DirContext->LongNameU); + PathNameU.Buffer[PathNameU.Length / sizeof(WCHAR)] = 0; + rcFcb = vfatGrabFCBFromTable(DeviceExt, &PathNameU); + if (rcFcb != NULL) + { + RtlCopyMemory(&DirContext->DirEntry, &rcFcb->entry, sizeof(DIR_ENTRY)); + vfatReleaseFCB(DeviceExt, rcFcb); + } + } + DPRINT("%d\n", DirContext->LongNameU.Length); + DPRINT("FindFile: new Name %wZ, DirIndex %d\n", + &DirContext->LongNameU, DirContext->DirIndex); + + if (Context) + { + CcUnpinData(Context); + } + RtlFreeUnicodeString(&FileToFindUpcase); + ExFreePool(PathNameBuffer); + return STATUS_SUCCESS; + } + DirContext->DirIndex++; } - DirContext->DirIndex++; - } - - if (Context) - { - CcUnpinData(Context); - } - - RtlFreeUnicodeString(&FileToFindUpcase); - ExFreePool(PathNameBuffer); - return Status; + + if (Context) + { + CcUnpinData(Context); + } + + RtlFreeUnicodeString(&FileToFindUpcase); + ExFreePool(PathNameBuffer); + return Status; } NTSTATUS -VfatOpenFile (PDEVICE_EXTENSION DeviceExt, PFILE_OBJECT FileObject, PVFATFCB* ParentFcb) +VfatOpenFile ( + PDEVICE_EXTENSION DeviceExt, + PFILE_OBJECT FileObject, + PVFATFCB* ParentFcb ) /* * FUNCTION: Opens a file */ { - PVFATFCB Fcb; - NTSTATUS Status; - UNICODE_STRING PathNameU; - WCHAR Buffer[260]; - - DPRINT ("VfatOpenFile(%08lx, %08lx, '%wZ')\n", DeviceExt, FileObject, &FileObject->FileName); - - if (FileObject->RelatedFileObject) - { - DPRINT ("'%wZ'\n", &FileObject->RelatedFileObject->FileName); - - *ParentFcb = FileObject->RelatedFileObject->FsContext; - (*ParentFcb)->RefCount++; - } - else - { - *ParentFcb = NULL; - } - - if (!DeviceExt->FatInfo.FixedMedia) - { - Status = VfatBlockDeviceIoControl (DeviceExt->StorageDevice, - IOCTL_DISK_CHECK_VERIFY, - NULL, - 0, - NULL, - 0, - FALSE); - - if (Status == STATUS_VERIFY_REQUIRED) - - { - PDEVICE_OBJECT DeviceToVerify; - - DPRINT ("Media change detected!\n"); - DPRINT ("Device %p\n", DeviceExt->StorageDevice); - - DeviceToVerify = IoGetDeviceToVerify (PsGetCurrentThread ()); - - IoSetDeviceToVerify (PsGetCurrentThread (), - NULL); - Status = IoVerifyVolume (DeviceExt->StorageDevice, - FALSE); + PVFATFCB Fcb; + NTSTATUS Status; + UNICODE_STRING PathNameU; + WCHAR Buffer[260]; + + DPRINT ("VfatOpenFile(%08lx, %08lx, '%wZ')\n", DeviceExt, FileObject, &FileObject->FileName); + + if (FileObject->RelatedFileObject) + { + DPRINT ("'%wZ'\n", &FileObject->RelatedFileObject->FileName); + + *ParentFcb = FileObject->RelatedFileObject->FsContext; + (*ParentFcb)->RefCount++; } - if (!NT_SUCCESS(Status)) + else { - DPRINT ("Status %lx\n", Status); - *ParentFcb = NULL; - return Status; + *ParentFcb = NULL; } - } - - if (*ParentFcb) - { - (*ParentFcb)->RefCount++; - } - - PathNameU.Buffer = Buffer; - PathNameU.Length = 0; - PathNameU.MaximumLength = sizeof(Buffer); - RtlCopyUnicodeString(&PathNameU, &FileObject->FileName); - if (PathNameU.Length > sizeof(WCHAR) && - PathNameU.Buffer[PathNameU.Length / sizeof(WCHAR) - 1] == L'\\') - { - PathNameU.Length -= sizeof(WCHAR); - } - PathNameU.Buffer[PathNameU.Length / sizeof(WCHAR)] = 0; - - /* try first to find an existing FCB in memory */ - DPRINT ("Checking for existing FCB in memory\n"); - - Status = vfatGetFCBForFile (DeviceExt, ParentFcb, &Fcb, &PathNameU); - if (!NT_SUCCESS (Status)) - { - DPRINT ("Could not make a new FCB, status: %x\n", Status); - return Status; - } - if (Fcb->Flags & FCB_DELETE_PENDING) - { - vfatReleaseFCB (DeviceExt, Fcb); - return STATUS_DELETE_PENDING; - } - DPRINT ("Attaching FCB to fileObject\n"); - Status = vfatAttachFCBToFileObject (DeviceExt, Fcb, FileObject); - if (!NT_SUCCESS(Status)) - { - vfatReleaseFCB (DeviceExt, Fcb); - } - return Status; -} - -static NTSTATUS -VfatCreateFile (PDEVICE_OBJECT DeviceObject, PIRP Irp) -/* - * FUNCTION: Create or open a file - */ -{ - PIO_STACK_LOCATION Stack; - PFILE_OBJECT FileObject; - NTSTATUS Status = STATUS_SUCCESS; - PDEVICE_EXTENSION DeviceExt; - ULONG RequestedDisposition, RequestedOptions; - PVFATCCB pCcb; - PVFATFCB pFcb; - PVFATFCB ParentFcb; - PWCHAR c, last; - BOOLEAN PagingFileCreate = FALSE; - LARGE_INTEGER AllocationSize; - BOOLEAN Dots; - UNICODE_STRING FileNameU; - - /* Unpack the various parameters. */ - Stack = IoGetCurrentIrpStackLocation (Irp); - RequestedDisposition = ((Stack->Parameters.Create.Options >> 24) & 0xff); - RequestedOptions = - Stack->Parameters.Create.Options & FILE_VALID_OPTION_FLAGS; - PagingFileCreate = (Stack->Flags & SL_OPEN_PAGING_FILE) ? TRUE : FALSE; - FileObject = Stack->FileObject; - DeviceExt = DeviceObject->DeviceExtension; - - /* Check their validity. */ - if (RequestedOptions & FILE_DIRECTORY_FILE && - RequestedDisposition == FILE_SUPERSEDE) - { - return(STATUS_INVALID_PARAMETER); - } - - /* This a open operation for the volume itself */ - if (FileObject->FileName.Length == 0 && - FileObject->RelatedFileObject == NULL) - { - if (RequestedDisposition == FILE_CREATE || - RequestedDisposition == FILE_OVERWRITE_IF || - RequestedDisposition == FILE_SUPERSEDE) + + if (!DeviceExt->FatInfo.FixedMedia) { - return(STATUS_ACCESS_DENIED); + Status = VfatBlockDeviceIoControl (DeviceExt->StorageDevice, + IOCTL_DISK_CHECK_VERIFY, + NULL, + 0, + NULL, + 0, + FALSE); + + if (Status == STATUS_VERIFY_REQUIRED) + + { + PDEVICE_OBJECT DeviceToVerify; + + DPRINT ("Media change detected!\n"); + DPRINT ("Device %p\n", DeviceExt->StorageDevice); + + DeviceToVerify = IoGetDeviceToVerify (PsGetCurrentThread ()); + + IoSetDeviceToVerify (PsGetCurrentThread (), + NULL); + Status = IoVerifyVolume (DeviceExt->StorageDevice, + FALSE); + } + if (!NT_SUCCESS(Status)) + { + DPRINT ("Status %lx\n", Status); + *ParentFcb = NULL; + return Status; + } } - if (RequestedOptions & FILE_DIRECTORY_FILE) + + if (*ParentFcb) { - return(STATUS_NOT_A_DIRECTORY); + (*ParentFcb)->RefCount++; } - pFcb = DeviceExt->VolumeFcb; - pCcb = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList); - if (pCcb == NULL) + + PathNameU.Buffer = Buffer; + PathNameU.Length = 0; + PathNameU.MaximumLength = sizeof(Buffer); + RtlCopyUnicodeString(&PathNameU, &FileObject->FileName); + if (PathNameU.Length > sizeof(WCHAR) && + PathNameU.Buffer[PathNameU.Length / sizeof(WCHAR) - 1] == L'\\') { - return (STATUS_INSUFFICIENT_RESOURCES); + PathNameU.Length -= sizeof(WCHAR); } - RtlZeroMemory(pCcb, sizeof(VFATCCB)); - FileObject->SectionObjectPointer = &pFcb->SectionObjectPointers; - FileObject->FsContext = pFcb; - FileObject->FsContext2 = pCcb; - pFcb->RefCount++; - - Irp->IoStatus.Information = FILE_OPENED; - return(STATUS_SUCCESS); - } - - /* - * Check for illegal characters and illegale dot sequences in the file name - */ - c = FileObject->FileName.Buffer + FileObject->FileName.Length / sizeof(WCHAR); - last = c - 1; - Dots = TRUE; - while (c-- > FileObject->FileName.Buffer) - { - if (*c == L'\\' || c == FileObject->FileName.Buffer) - { - if (Dots && last > c) - { - return(STATUS_OBJECT_NAME_INVALID); - } - last = c - 1; - Dots = TRUE; + PathNameU.Buffer[PathNameU.Length / sizeof(WCHAR)] = 0; + + /* try first to find an existing FCB in memory */ + DPRINT ("Checking for existing FCB in memory\n"); + + Status = vfatGetFCBForFile (DeviceExt, ParentFcb, &Fcb, &PathNameU); + if (!NT_SUCCESS (Status)) + { + DPRINT ("Could not make a new FCB, status: %x\n", Status); + return Status; } - else if (*c != L'.') - { - Dots = FALSE; + if (Fcb->Flags & FCB_DELETE_PENDING) + { + vfatReleaseFCB (DeviceExt, Fcb); + return STATUS_DELETE_PENDING; } - - if (*c != '\\' && vfatIsLongIllegal(*c)) - { - return(STATUS_OBJECT_NAME_INVALID); + DPRINT ("Attaching FCB to fileObject\n"); + Status = vfatAttachFCBToFileObject (DeviceExt, Fcb, FileObject); + if (!NT_SUCCESS(Status)) + { + vfatReleaseFCB (DeviceExt, Fcb); } - } + return Status; +} - /* Try opening the file. */ - Status = VfatOpenFile (DeviceExt, FileObject, &ParentFcb); - - /* - * If the directory containing the file to open doesn't exist then - * fail immediately - */ - if (Status == STATUS_OBJECT_PATH_NOT_FOUND || - Status == STATUS_INVALID_PARAMETER || - Status == STATUS_DELETE_PENDING) - { - if (ParentFcb) - { - vfatReleaseFCB (DeviceExt, ParentFcb); - } - return(Status); - } - - /* - * If the file open failed then create the required file - */ - if (!NT_SUCCESS (Status)) - { - if (RequestedDisposition == FILE_CREATE || - RequestedDisposition == FILE_OPEN_IF || - RequestedDisposition == FILE_OVERWRITE_IF || - RequestedDisposition == FILE_SUPERSEDE) +static NTSTATUS +VfatCreateFile ( PDEVICE_OBJECT DeviceObject, PIRP Irp ) +/* + * FUNCTION: Create or open a file + */ +{ + PIO_STACK_LOCATION Stack; + PFILE_OBJECT FileObject; + NTSTATUS Status = STATUS_SUCCESS; + PDEVICE_EXTENSION DeviceExt; + ULONG RequestedDisposition, RequestedOptions; + PVFATCCB pCcb; + PVFATFCB pFcb; + PVFATFCB ParentFcb; + PWCHAR c, last; + BOOLEAN PagingFileCreate = FALSE; + LARGE_INTEGER AllocationSize; + BOOLEAN Dots; + UNICODE_STRING FileNameU; + + /* Unpack the various parameters. */ + Stack = IoGetCurrentIrpStackLocation (Irp); + RequestedDisposition = ((Stack->Parameters.Create.Options >> 24) & 0xff); + RequestedOptions = + Stack->Parameters.Create.Options & FILE_VALID_OPTION_FLAGS; + PagingFileCreate = (Stack->Flags & SL_OPEN_PAGING_FILE) ? TRUE : FALSE; + FileObject = Stack->FileObject; + DeviceExt = DeviceObject->DeviceExtension; + + /* Check their validity. */ + if (RequestedOptions & FILE_DIRECTORY_FILE && + RequestedDisposition == FILE_SUPERSEDE) { - ULONG Attributes; - Attributes = Stack->Parameters.Create.FileAttributes; - - vfatSplitPathName(&FileObject->FileName, NULL, &FileNameU); - Status = VfatAddEntry (DeviceExt, &FileNameU, &pFcb, ParentFcb, RequestedOptions, - (UCHAR)(Attributes & FILE_ATTRIBUTE_VALID_FLAGS)); - vfatReleaseFCB (DeviceExt, ParentFcb); - if (NT_SUCCESS (Status)) - { - Status = vfatAttachFCBToFileObject (DeviceExt, pFcb, FileObject); - if ( !NT_SUCCESS(Status) ) - { - vfatReleaseFCB (DeviceExt, pFcb); - return Status; - } - - Irp->IoStatus.Information = FILE_CREATED; - - VfatSetAllocationSizeInformation(FileObject, - pFcb, - DeviceExt, - &Irp->Overlay.AllocationSize); - VfatSetExtendedAttributes(FileObject, - Irp->AssociatedIrp.SystemBuffer, - Stack->Parameters.Create.EaLength); - - if (PagingFileCreate) - { - pFcb->Flags |= FCB_IS_PAGE_FILE; - } - } - else - { - return(Status); - } + return(STATUS_INVALID_PARAMETER); } - else + + /* This a open operation for the volume itself */ + if (FileObject->FileName.Length == 0 && + FileObject->RelatedFileObject == NULL) { - vfatReleaseFCB (DeviceExt, ParentFcb); - return(Status); + if (RequestedDisposition == FILE_CREATE || + RequestedDisposition == FILE_OVERWRITE_IF || + RequestedDisposition == FILE_SUPERSEDE) + { + return(STATUS_ACCESS_DENIED); + } + if (RequestedOptions & FILE_DIRECTORY_FILE) + { + return(STATUS_NOT_A_DIRECTORY); + } + pFcb = DeviceExt->VolumeFcb; + pCcb = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList); + if (pCcb == NULL) + { + return (STATUS_INSUFFICIENT_RESOURCES); + } + RtlZeroMemory(pCcb, sizeof(VFATCCB)); + FileObject->SectionObjectPointer = &pFcb->SectionObjectPointers; + FileObject->FsContext = pFcb; + FileObject->FsContext2 = pCcb; + pFcb->RefCount++; + + Irp->IoStatus.Information = FILE_OPENED; + return(STATUS_SUCCESS); } - } - else - { - if (ParentFcb) [truncated at 1000 lines; 423 more skipped]
19 years, 1 month
1
0
0
0
[royce] 18979: fix indentation
by royce@svn.reactos.com
fix indentation Modified: trunk/reactos/drivers/fs/vfat/fcb.c _____ Modified: trunk/reactos/drivers/fs/vfat/fcb.c --- trunk/reactos/drivers/fs/vfat/fcb.c 2005-11-03 22:20:29 UTC (rev 18978) +++ trunk/reactos/drivers/fs/vfat/fcb.c 2005-11-04 00:03:34 UTC (rev 18979) @@ -1,13 +1,13 @@ /* - * FILE: drivers/fs/vfat/fcb.c - * PURPOSE: Routines to manipulate FCBs. - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PROGRAMMER: Jason Filby (jasonfilby(a)yahoo.com) - * Rex Jolliff (rex(a)lvcablemodem.com) - * Hartmut Birr - * Herve Poussineau (reactos(a)poussine.freesurf.fr) - */ +* FILE: drivers/fs/vfat/fcb.c +* PURPOSE: Routines to manipulate FCBs. +* COPYRIGHT: See COPYING in the top level directory +* PROJECT: ReactOS kernel +* PROGRAMMER: Jason Filby (jasonfilby(a)yahoo.com) +* Rex Jolliff (rex(a)lvcablemodem.com) +* Hartmut Birr +* Herve Poussineau (reactos(a)poussine.freesurf.fr) +*/ /* ------------------------------------------------------- INCLUDES */ @@ -24,808 +24,812 @@ static ULONG vfatNameHash(ULONG hash, PUNICODE_STRING NameU) { - PWCHAR last; - PWCHAR curr; - register WCHAR c; - - ASSERT(NameU->Buffer[0] != L'.'); - curr = NameU->Buffer; - last = NameU->Buffer + NameU->Length / sizeof(WCHAR); - - while(curr < last) - { - c = towlower(*curr++); - hash = (hash + (c << 4) + (c >> 4)) * 11; - } - return hash; + PWCHAR last; + PWCHAR curr; + register WCHAR c; + + ASSERT(NameU->Buffer[0] != L'.'); + curr = NameU->Buffer; + last = NameU->Buffer + NameU->Length / sizeof(WCHAR); + + while(curr < last) + { + c = towlower(*curr++); + hash = (hash + (c << 4) + (c >> 4)) * 11; + } + return hash; } VOID vfatSplitPathName(PUNICODE_STRING PathNameU, PUNICODE_STRING DirNameU, PUNICODE_STRING FileNameU) { - PWCHAR pName; - USHORT Length = 0; - pName = PathNameU->Buffer + PathNameU->Length / sizeof(WCHAR) - 1; - while (*pName != L'\\' && pName >= PathNameU->Buffer) - { - pName--; - Length++; - } - ASSERT(*pName == L'\\' || pName < PathNameU->Buffer); - if (FileNameU) - { - FileNameU->Buffer = pName + 1; - FileNameU->Length = FileNameU->MaximumLength = Length * sizeof(WCHAR); - } - if (DirNameU) - { - DirNameU->Buffer = PathNameU->Buffer; - DirNameU->Length = (pName + 1 - PathNameU->Buffer) * sizeof(WCHAR); - DirNameU->MaximumLength = DirNameU->Length; - } + PWCHAR pName; + USHORT Length = 0; + pName = PathNameU->Buffer + PathNameU->Length / sizeof(WCHAR) - 1; + while (*pName != L'\\' && pName >= PathNameU->Buffer) + { + pName--; + Length++; + } + ASSERT(*pName == L'\\' || pName < PathNameU->Buffer); + if (FileNameU) + { + FileNameU->Buffer = pName + 1; + FileNameU->Length = FileNameU->MaximumLength = Length * sizeof(WCHAR); + } + if (DirNameU) + { + DirNameU->Buffer = PathNameU->Buffer; + DirNameU->Length = (pName + 1 - PathNameU->Buffer) * sizeof(WCHAR); + DirNameU->MaximumLength = DirNameU->Length; + } } static VOID vfatInitFcb(PVFATFCB Fcb, PUNICODE_STRING NameU) { - USHORT PathNameBufferLength; - - if (NameU) - PathNameBufferLength = NameU->Length + sizeof(WCHAR); - else - PathNameBufferLength = 0; - - Fcb->PathNameBuffer = ExAllocatePool(NonPagedPool, PathNameBufferLength); - if (!Fcb->PathNameBuffer) - { - /* FIXME: what to do if no more memory? */ - DPRINT1("Unable to initialize FCB for filename '%wZ'\n", NameU); - KEBUGCHECKEX(0, (ULONG_PTR)Fcb, (ULONG_PTR)NameU, 0, 0); - } - - Fcb->PathNameU.Length = 0; - Fcb->PathNameU.Buffer = Fcb->PathNameBuffer; - Fcb->PathNameU.MaximumLength = PathNameBufferLength; - Fcb->ShortNameU.Length = 0; - Fcb->ShortNameU.Buffer = Fcb->ShortNameBuffer; - Fcb->ShortNameU.MaximumLength = sizeof(Fcb->ShortNameBuffer); - Fcb->DirNameU.Buffer = Fcb->PathNameU.Buffer; - if (NameU && NameU->Length) - { - RtlCopyUnicodeString(&Fcb->PathNameU, NameU); - vfatSplitPathName(&Fcb->PathNameU, &Fcb->DirNameU, &Fcb->LongNameU); - } - else - { - Fcb->DirNameU.Buffer = Fcb->LongNameU.Buffer = NULL; - Fcb->DirNameU.MaximumLength = Fcb->DirNameU.Length = 0; - Fcb->LongNameU.MaximumLength = Fcb->LongNameU.Length = 0; - } - RtlZeroMemory(&Fcb->FCBShareAccess, sizeof(SHARE_ACCESS)); - Fcb->OpenHandleCount = 0; + USHORT PathNameBufferLength; + + if (NameU) + PathNameBufferLength = NameU->Length + sizeof(WCHAR); + else + PathNameBufferLength = 0; + + Fcb->PathNameBuffer = ExAllocatePool(NonPagedPool, PathNameBufferLength); + if (!Fcb->PathNameBuffer) + { + /* FIXME: what to do if no more memory? */ + DPRINT1("Unable to initialize FCB for filename '%wZ'\n", NameU); + KEBUGCHECKEX(0, (ULONG_PTR)Fcb, (ULONG_PTR)NameU, 0, 0); + } + + Fcb->PathNameU.Length = 0; + Fcb->PathNameU.Buffer = Fcb->PathNameBuffer; + Fcb->PathNameU.MaximumLength = PathNameBufferLength; + Fcb->ShortNameU.Length = 0; + Fcb->ShortNameU.Buffer = Fcb->ShortNameBuffer; + Fcb->ShortNameU.MaximumLength = sizeof(Fcb->ShortNameBuffer); + Fcb->DirNameU.Buffer = Fcb->PathNameU.Buffer; + if (NameU && NameU->Length) + { + RtlCopyUnicodeString(&Fcb->PathNameU, NameU); + vfatSplitPathName(&Fcb->PathNameU, &Fcb->DirNameU, &Fcb->LongNameU); + } + else + { + Fcb->DirNameU.Buffer = Fcb->LongNameU.Buffer = NULL; + Fcb->DirNameU.MaximumLength = Fcb->DirNameU.Length = 0; + Fcb->LongNameU.MaximumLength = Fcb->LongNameU.Length = 0; + } + RtlZeroMemory(&Fcb->FCBShareAccess, sizeof(SHARE_ACCESS)); + Fcb->OpenHandleCount = 0; } PVFATFCB vfatNewFCB(PDEVICE_EXTENSION pVCB, PUNICODE_STRING pFileNameU) { - PVFATFCB rcFCB; - - DPRINT("'%wZ'\n", pFileNameU); - - rcFCB = ExAllocateFromNPagedLookasideList(&VfatGlobalData->FcbLookasideList); - if (rcFCB == NULL) - { - return NULL; - } - RtlZeroMemory(rcFCB, sizeof(VFATFCB)); - vfatInitFcb(rcFCB, pFileNameU); - if (pVCB->Flags & VCB_IS_FATX) - { - rcFCB->Flags |= FCB_IS_FATX_ENTRY; - rcFCB->Attributes = &rcFCB->entry.FatX.Attrib; - } - else - rcFCB->Attributes = &rcFCB->entry.Fat.Attrib; - rcFCB->Hash.Hash = vfatNameHash(0, &rcFCB->PathNameU); - rcFCB->Hash.self = rcFCB; - rcFCB->ShortHash.self = rcFCB; - ExInitializeResourceLite(&rcFCB->PagingIoResource); - ExInitializeResourceLite(&rcFCB->MainResource); - FsRtlInitializeFileLock(&rcFCB->FileLock, NULL, NULL); - ExInitializeFastMutex(&rcFCB->LastMutex); - rcFCB->RFCB.PagingIoResource = &rcFCB->PagingIoResource; - rcFCB->RFCB.Resource = &rcFCB->MainResource; - rcFCB->RFCB.IsFastIoPossible = FastIoIsNotPossible; - - return rcFCB; + PVFATFCB rcFCB; + + DPRINT("'%wZ'\n", pFileNameU); + + rcFCB = ExAllocateFromNPagedLookasideList(&VfatGlobalData->FcbLookasideList); + if (rcFCB == NULL) + { + return NULL; + } + RtlZeroMemory(rcFCB, sizeof(VFATFCB)); + vfatInitFcb(rcFCB, pFileNameU); + if (pVCB->Flags & VCB_IS_FATX) + { + rcFCB->Flags |= FCB_IS_FATX_ENTRY; + rcFCB->Attributes = &rcFCB->entry.FatX.Attrib; + } + else + rcFCB->Attributes = &rcFCB->entry.Fat.Attrib; + rcFCB->Hash.Hash = vfatNameHash(0, &rcFCB->PathNameU); + rcFCB->Hash.self = rcFCB; + rcFCB->ShortHash.self = rcFCB; + ExInitializeResourceLite(&rcFCB->PagingIoResource); + ExInitializeResourceLite(&rcFCB->MainResource); + FsRtlInitializeFileLock(&rcFCB->FileLock, NULL, NULL); + ExInitializeFastMutex(&rcFCB->LastMutex); + rcFCB->RFCB.PagingIoResource = &rcFCB->PagingIoResource; + rcFCB->RFCB.Resource = &rcFCB->MainResource; + rcFCB->RFCB.IsFastIoPossible = FastIoIsNotPossible; + + return rcFCB; } VOID vfatDestroyCCB(PVFATCCB pCcb) { - if (pCcb->SearchPattern.Buffer) - { - ExFreePool(pCcb->SearchPattern.Buffer); - } - ExFreeToNPagedLookasideList(&VfatGlobalData->CcbLookasideList, pCcb); + if (pCcb->SearchPattern.Buffer) + { + ExFreePool(pCcb->SearchPattern.Buffer); + } + ExFreeToNPagedLookasideList(&VfatGlobalData->CcbLookasideList, pCcb); } VOID vfatDestroyFCB(PVFATFCB pFCB) { - FsRtlUninitializeFileLock(&pFCB->FileLock); - ExFreePool(pFCB->PathNameBuffer); - ExDeleteResourceLite(&pFCB->PagingIoResource); - ExDeleteResourceLite(&pFCB->MainResource); - ExFreeToNPagedLookasideList(&VfatGlobalData->FcbLookasideList, pFCB); + FsRtlUninitializeFileLock(&pFCB->FileLock); + ExFreePool(pFCB->PathNameBuffer); + ExDeleteResourceLite(&pFCB->PagingIoResource); + ExDeleteResourceLite(&pFCB->MainResource); + ExFreeToNPagedLookasideList(&VfatGlobalData->FcbLookasideList, pFCB); } BOOLEAN vfatFCBIsDirectory(PVFATFCB FCB) { - return *FCB->Attributes & FILE_ATTRIBUTE_DIRECTORY; + return *FCB->Attributes & FILE_ATTRIBUTE_DIRECTORY; } BOOLEAN vfatFCBIsRoot(PVFATFCB FCB) { - return FCB->PathNameU.Length == sizeof(WCHAR) && FCB->PathNameU.Buffer[0] == L'\\' ? TRUE : FALSE; + return FCB->PathNameU.Length == sizeof(WCHAR) && FCB->PathNameU.Buffer[0] == L'\\' ? TRUE : FALSE; } VOID vfatReleaseFCB(PDEVICE_EXTENSION pVCB, PVFATFCB pFCB) { - HASHENTRY* entry; - ULONG Index; - ULONG ShortIndex; - PVFATFCB tmpFcb; - - DPRINT ("releasing FCB at %x: %wZ, refCount:%d\n", - pFCB, - &pFCB->PathNameU, - pFCB->RefCount); - - while (pFCB) - { - Index = pFCB->Hash.Hash % pVCB->HashTableSize; - ShortIndex = pFCB->ShortHash.Hash % pVCB->HashTableSize; - pFCB->RefCount--; - if (pFCB->RefCount == 0) - { - tmpFcb = pFCB->parentFcb; - RemoveEntryList (&pFCB->FcbListEntry); - if (pFCB->Hash.Hash != pFCB->ShortHash.Hash) - { - entry = pVCB->FcbHashTable[ShortIndex]; - if (entry->self == pFCB) - { - pVCB->FcbHashTable[ShortIndex] = entry->next; - } - else - { - while (entry->next->self != pFCB) - { - entry = entry->next; - } - entry->next = pFCB->ShortHash.next; - } - } - entry = pVCB->FcbHashTable[Index]; - if (entry->self == pFCB) - { - pVCB->FcbHashTable[Index] = entry->next; - } - else - { - while (entry->next->self != pFCB) - { - entry = entry->next; - } - entry->next = pFCB->Hash.next; - } - vfatDestroyFCB (pFCB); - } - else - { - tmpFcb = NULL; - } - pFCB = tmpFcb; - } + HASHENTRY* entry; + ULONG Index; + ULONG ShortIndex; + PVFATFCB tmpFcb; + + DPRINT ("releasing FCB at %x: %wZ, refCount:%d\n", + pFCB, + &pFCB->PathNameU, + pFCB->RefCount); + + while (pFCB) + { + Index = pFCB->Hash.Hash % pVCB->HashTableSize; + ShortIndex = pFCB->ShortHash.Hash % pVCB->HashTableSize; + pFCB->RefCount--; + if (pFCB->RefCount == 0) + { + tmpFcb = pFCB->parentFcb; + RemoveEntryList (&pFCB->FcbListEntry); + if (pFCB->Hash.Hash != pFCB->ShortHash.Hash) + { + entry = pVCB->FcbHashTable[ShortIndex]; + if (entry->self == pFCB) + { + pVCB->FcbHashTable[ShortIndex] = entry->next; + } + else + { + while (entry->next->self != pFCB) + { + entry = entry->next; + } + entry->next = pFCB->ShortHash.next; + } + } + entry = pVCB->FcbHashTable[Index]; + if (entry->self == pFCB) + { + pVCB->FcbHashTable[Index] = entry->next; + } + else + { + while (entry->next->self != pFCB) + { + entry = entry->next; + } + entry->next = pFCB->Hash.next; + } + vfatDestroyFCB (pFCB); + } + else + { + tmpFcb = NULL; + } + pFCB = tmpFcb; + } } VOID vfatAddFCBToTable(PDEVICE_EXTENSION pVCB, PVFATFCB pFCB) { - ULONG Index; - ULONG ShortIndex; - - Index = pFCB->Hash.Hash % pVCB->HashTableSize; - ShortIndex = pFCB->ShortHash.Hash % pVCB->HashTableSize; - - InsertTailList (&pVCB->FcbListHead, &pFCB->FcbListEntry); - - pFCB->Hash.next = pVCB->FcbHashTable[Index]; - pVCB->FcbHashTable[Index] = &pFCB->Hash; - if (pFCB->Hash.Hash != pFCB->ShortHash.Hash) - { - pFCB->ShortHash.next = pVCB->FcbHashTable[ShortIndex]; - pVCB->FcbHashTable[ShortIndex] = &pFCB->ShortHash; - } - if (pFCB->parentFcb) - { - pFCB->parentFcb->RefCount++; - } + ULONG Index; + ULONG ShortIndex; + + Index = pFCB->Hash.Hash % pVCB->HashTableSize; + ShortIndex = pFCB->ShortHash.Hash % pVCB->HashTableSize; + + InsertTailList (&pVCB->FcbListHead, &pFCB->FcbListEntry); + + pFCB->Hash.next = pVCB->FcbHashTable[Index]; + pVCB->FcbHashTable[Index] = &pFCB->Hash; + if (pFCB->Hash.Hash != pFCB->ShortHash.Hash) + { + pFCB->ShortHash.next = pVCB->FcbHashTable[ShortIndex]; + pVCB->FcbHashTable[ShortIndex] = &pFCB->ShortHash; + } + if (pFCB->parentFcb) + { + pFCB->parentFcb->RefCount++; + } } PVFATFCB vfatGrabFCBFromTable(PDEVICE_EXTENSION pVCB, PUNICODE_STRING PathNameU) { - PVFATFCB rcFCB; - ULONG Hash; - UNICODE_STRING DirNameU; - UNICODE_STRING FileNameU; - PUNICODE_STRING FcbNameU; - - HASHENTRY* entry; - - DPRINT("'%wZ'\n", PathNameU); - - Hash = vfatNameHash(0, PathNameU); - - entry = pVCB->FcbHashTable[Hash % pVCB->HashTableSize]; - if (entry) - { - vfatSplitPathName(PathNameU, &DirNameU, &FileNameU); - } - - while (entry) - { - if (entry->Hash == Hash) - { - rcFCB = entry->self; - DPRINT("'%wZ' '%wZ'\n", &DirNameU, &rcFCB->DirNameU); - if (RtlEqualUnicodeString(&DirNameU, &rcFCB->DirNameU, TRUE)) - { - if (rcFCB->Hash.Hash == Hash) - { - FcbNameU = &rcFCB->LongNameU; - } - else - { - FcbNameU = &rcFCB->ShortNameU; - } - /* compare the file name */ - DPRINT("'%wZ' '%wZ'\n", &FileNameU, FcbNameU); - if (RtlEqualUnicodeString(&FileNameU, FcbNameU, TRUE)) - { - rcFCB->RefCount++; - CHECKPOINT; - return rcFCB; - } - } + PVFATFCB rcFCB; + ULONG Hash; + UNICODE_STRING DirNameU; + UNICODE_STRING FileNameU; + PUNICODE_STRING FcbNameU; + + HASHENTRY* entry; + + DPRINT("'%wZ'\n", PathNameU); + + Hash = vfatNameHash(0, PathNameU); + + entry = pVCB->FcbHashTable[Hash % pVCB->HashTableSize]; + if (entry) + { + vfatSplitPathName(PathNameU, &DirNameU, &FileNameU); } - entry = entry->next; - } - CHECKPOINT; - return NULL; + + while (entry) + { + if (entry->Hash == Hash) + { + rcFCB = entry->self; + DPRINT("'%wZ' '%wZ'\n", &DirNameU, &rcFCB->DirNameU); + if (RtlEqualUnicodeString(&DirNameU, &rcFCB->DirNameU, TRUE)) + { + if (rcFCB->Hash.Hash == Hash) + { + FcbNameU = &rcFCB->LongNameU; + } + else + { + FcbNameU = &rcFCB->ShortNameU; + } + /* compare the file name */ + DPRINT("'%wZ' '%wZ'\n", &FileNameU, FcbNameU); + if (RtlEqualUnicodeString(&FileNameU, FcbNameU, TRUE)) + { + rcFCB->RefCount++; + CHECKPOINT; + return rcFCB; + } + } + } + entry = entry->next; + } + CHECKPOINT; + return NULL; } static NTSTATUS vfatFCBInitializeCacheFromVolume (PVCB vcb, PVFATFCB fcb) { #ifdef USE_ROS_CC_AND_FS - NTSTATUS status; - ULONG fileCacheQuantum; + NTSTATUS status; + ULONG fileCacheQuantum; #endif - PFILE_OBJECT fileObject; - PVFATCCB newCCB; - - fileObject = IoCreateStreamFileObject (NULL, vcb->StorageDevice); - - newCCB = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList); - if (newCCB == NULL) - { - return STATUS_INSUFFICIENT_RESOURCES; - } - RtlZeroMemory(newCCB, sizeof (VFATCCB)); - - fileObject->SectionObjectPointer = &fcb->SectionObjectPointers; - fileObject->FsContext = fcb; - fileObject->FsContext2 = newCCB; - fcb->FileObject = fileObject; - fcb->RefCount++; - + PFILE_OBJECT fileObject; + PVFATCCB newCCB; + + fileObject = IoCreateStreamFileObject (NULL, vcb->StorageDevice); + + newCCB = ExAllocateFromNPagedLookasideList(&VfatGlobalData->CcbLookasideList); + if (newCCB == NULL) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + RtlZeroMemory(newCCB, sizeof (VFATCCB)); + + fileObject->SectionObjectPointer = &fcb->SectionObjectPointers; + fileObject->FsContext = fcb; + fileObject->FsContext2 = newCCB; + fcb->FileObject = fileObject; + fcb->RefCount++; + #ifdef USE_ROS_CC_AND_FS - fileCacheQuantum = (vcb->FatInfo.BytesPerCluster >= PAGE_SIZE) ? - vcb->FatInfo.BytesPerCluster : PAGE_SIZE; - - status = CcRosInitializeFileCache (fileObject, - fileCacheQuantum); - if (!NT_SUCCESS (status)) - { - DbgPrint ("CcRosInitializeFileCache failed\n"); - KEBUGCHECK (0); - } + fileCacheQuantum = (vcb->FatInfo.BytesPerCluster >= PAGE_SIZE) ? + vcb->FatInfo.BytesPerCluster : PAGE_SIZE; + + status = CcRosInitializeFileCache (fileObject, + fileCacheQuantum); + if (!NT_SUCCESS (status)) + { + DbgPrint ("CcRosInitializeFileCache failed\n"); + KEBUGCHECK (0); + } #else - /* FIXME: Guard by SEH. */ - CcInitializeCacheMap(fileObject, - (PCC_FILE_SIZES)(&fcb->RFCB.AllocationSize), - FALSE, - &VfatGlobalData->CacheMgrCallbacks, - fcb); + /* FIXME: Guard by SEH. */ + CcInitializeCacheMap(fileObject, + (PCC_FILE_SIZES)(&fcb->RFCB.AllocationSize), + FALSE, + &VfatGlobalData->CacheMgrCallbacks, + fcb); #endif - - fcb->Flags |= FCB_CACHE_INITIALIZED; - return STATUS_SUCCESS; + + fcb->Flags |= FCB_CACHE_INITIALIZED; + return STATUS_SUCCESS; } PVFATFCB vfatMakeRootFCB(PDEVICE_EXTENSION pVCB) { - PVFATFCB FCB; - ULONG FirstCluster, CurrentCluster, Size = 0; - NTSTATUS Status = STATUS_SUCCESS; - UNICODE_STRING NameU = RTL_CONSTANT_STRING(L"\\"); - - FCB = vfatNewFCB(pVCB, &NameU); - if (FCB->Flags & FCB_IS_FATX_ENTRY) - { - memset(FCB->entry.FatX.Filename, ' ', 42); - FCB->entry.FatX.FileSize = pVCB->FatInfo.rootDirectorySectors * pVCB->FatInfo.BytesPerSector; - FCB->entry.FatX.Attrib = FILE_ATTRIBUTE_DIRECTORY; - FCB->entry.FatX.FirstCluster = 1; - Size = pVCB->FatInfo.rootDirectorySectors * pVCB->FatInfo.BytesPerSector; - } - else - { - memset(FCB->entry.Fat.ShortName, ' ', 11); - FCB->entry.Fat.FileSize = pVCB->FatInfo.rootDirectorySectors * pVCB->FatInfo.BytesPerSector; - FCB->entry.Fat.Attrib = FILE_ATTRIBUTE_DIRECTORY; - if (pVCB->FatInfo.FatType == FAT32) - { - CurrentCluster = FirstCluster = pVCB->FatInfo.RootCluster; - FCB->entry.Fat.FirstCluster = (unsigned short)(FirstCluster & 0xffff); - FCB->entry.Fat.FirstClusterHigh = (unsigned short)(FirstCluster >> 16); - - while (CurrentCluster != 0xffffffff && NT_SUCCESS(Status)) - { - Size += pVCB->FatInfo.BytesPerCluster; - Status = NextCluster (pVCB, FirstCluster, &CurrentCluster, FALSE); - } - } - else - { - FCB->entry.Fat.FirstCluster = 1; - Size = pVCB->FatInfo.rootDirectorySectors * pVCB->FatInfo.BytesPerSector; - } - } - FCB->ShortHash.Hash = FCB->Hash.Hash; - FCB->RefCount = 2; - FCB->dirIndex = 0; - FCB->RFCB.FileSize.QuadPart = Size; - FCB->RFCB.ValidDataLength.QuadPart = Size; - FCB->RFCB.AllocationSize.QuadPart = Size; - FCB->RFCB.IsFastIoPossible = FastIoIsNotPossible; - - vfatFCBInitializeCacheFromVolume(pVCB, FCB); - vfatAddFCBToTable(pVCB, FCB); - - return(FCB); + PVFATFCB FCB; + ULONG FirstCluster, CurrentCluster, Size = 0; + NTSTATUS Status = STATUS_SUCCESS; + UNICODE_STRING NameU = RTL_CONSTANT_STRING(L"\\"); + + FCB = vfatNewFCB(pVCB, &NameU); + if (FCB->Flags & FCB_IS_FATX_ENTRY) + { + memset(FCB->entry.FatX.Filename, ' ', 42); + FCB->entry.FatX.FileSize = pVCB->FatInfo.rootDirectorySectors * pVCB->FatInfo.BytesPerSector; + FCB->entry.FatX.Attrib = FILE_ATTRIBUTE_DIRECTORY; + FCB->entry.FatX.FirstCluster = 1; + Size = pVCB->FatInfo.rootDirectorySectors * pVCB->FatInfo.BytesPerSector; + } + else + { + memset(FCB->entry.Fat.ShortName, ' ', 11); + FCB->entry.Fat.FileSize = pVCB->FatInfo.rootDirectorySectors * pVCB->FatInfo.BytesPerSector; + FCB->entry.Fat.Attrib = FILE_ATTRIBUTE_DIRECTORY; + if (pVCB->FatInfo.FatType == FAT32) + { + CurrentCluster = FirstCluster = pVCB->FatInfo.RootCluster; + FCB->entry.Fat.FirstCluster = (unsigned short)(FirstCluster & 0xffff); + FCB->entry.Fat.FirstClusterHigh = (unsigned short)(FirstCluster >> 16); + + while (CurrentCluster != 0xffffffff && NT_SUCCESS(Status)) + { + Size += pVCB->FatInfo.BytesPerCluster; + Status = NextCluster (pVCB, FirstCluster, &CurrentCluster, FALSE); + } + } + else + { + FCB->entry.Fat.FirstCluster = 1; + Size = pVCB->FatInfo.rootDirectorySectors * pVCB->FatInfo.BytesPerSector; + } + } + FCB->ShortHash.Hash = FCB->Hash.Hash; + FCB->RefCount = 2; + FCB->dirIndex = 0; + FCB->RFCB.FileSize.QuadPart = Size; + FCB->RFCB.ValidDataLength.QuadPart = Size; + FCB->RFCB.AllocationSize.QuadPart = Size; + FCB->RFCB.IsFastIoPossible = FastIoIsNotPossible; + + vfatFCBInitializeCacheFromVolume(pVCB, FCB); + vfatAddFCBToTable(pVCB, FCB); + + return(FCB); } PVFATFCB vfatOpenRootFCB(PDEVICE_EXTENSION pVCB) { - PVFATFCB FCB; - UNICODE_STRING NameU = RTL_CONSTANT_STRING(L"\\"); - - FCB = vfatGrabFCBFromTable (pVCB, &NameU); - if (FCB == NULL) - { - FCB = vfatMakeRootFCB (pVCB); - } - - return FCB; + PVFATFCB FCB; + UNICODE_STRING NameU = RTL_CONSTANT_STRING(L"\\"); + + FCB = vfatGrabFCBFromTable (pVCB, &NameU); + if (FCB == NULL) + { + FCB = vfatMakeRootFCB (pVCB); + } + + return FCB; } NTSTATUS -vfatMakeFCBFromDirEntry(PVCB vcb, - PVFATFCB directoryFCB, - PVFAT_DIRENTRY_CONTEXT DirContext, - PVFATFCB* fileFCB) +vfatMakeFCBFromDirEntry( + PVCB vcb, + PVFATFCB directoryFCB, + PVFAT_DIRENTRY_CONTEXT DirContext, + PVFATFCB* fileFCB) { - PVFATFCB rcFCB; - PWCHAR PathNameBuffer; - USHORT PathNameLength; - ULONG Size; - ULONG hash; - - UNICODE_STRING NameU; - - PathNameLength = directoryFCB->PathNameU.Length + max(DirContext->LongNameU.Length, DirContext->ShortNameU.Length); - if (!vfatFCBIsRoot (directoryFCB)) - { - PathNameLength += sizeof(WCHAR); - } - - if (PathNameLength > LONGNAME_MAX_LENGTH * sizeof(WCHAR)) - { - return STATUS_OBJECT_NAME_INVALID; - } - PathNameBuffer = ExAllocatePool(NonPagedPool, PathNameLength + sizeof(WCHAR)); - if (!PathNameBuffer) - { - return STATUS_INSUFFICIENT_RESOURCES; - } - NameU.Buffer = PathNameBuffer; - NameU.Length = 0; - NameU.MaximumLength = PathNameLength; - - RtlCopyUnicodeString(&NameU, &directoryFCB->PathNameU); - if (!vfatFCBIsRoot (directoryFCB)) - { - RtlAppendUnicodeToString(&NameU, L"\\"); - } - hash = vfatNameHash(0, &NameU); - if (DirContext->LongNameU.Length > 0) - { - RtlAppendUnicodeStringToString(&NameU, &DirContext->LongNameU); - } - else - { - RtlAppendUnicodeStringToString(&NameU, &DirContext->ShortNameU); - } - NameU.Buffer[NameU.Length / sizeof(WCHAR)] = 0; - - rcFCB = vfatNewFCB (vcb, &NameU); - RtlCopyMemory (&rcFCB->entry, &DirContext->DirEntry, sizeof (DIR_ENTRY)); - RtlCopyUnicodeString(&rcFCB->ShortNameU, &DirContext->ShortNameU); - if (vcb->Flags & VCB_IS_FATX) - { - rcFCB->ShortHash.Hash = rcFCB->Hash.Hash; - } - else - { - rcFCB->ShortHash.Hash = vfatNameHash(hash, &rcFCB->ShortNameU); - } - - if (vfatFCBIsDirectory(rcFCB)) - { - ULONG FirstCluster, CurrentCluster; - NTSTATUS Status; - Size = 0; - FirstCluster = vfatDirEntryGetFirstCluster (vcb, &rcFCB->entry); - if (FirstCluster == 1) - { - Size = vcb->FatInfo.rootDirectorySectors * vcb->FatInfo.BytesPerSector; - } - else if (FirstCluster != 0) - { - CurrentCluster = FirstCluster; - while (CurrentCluster != 0xffffffff) - { - Size += vcb->FatInfo.BytesPerCluster; - Status = NextCluster (vcb, FirstCluster, &CurrentCluster, FALSE); - } - } - } - else if (rcFCB->Flags & FCB_IS_FATX_ENTRY) - { - Size = rcFCB->entry.FatX.FileSize; - } - else - { - Size = rcFCB->entry.Fat.FileSize; - } - rcFCB->dirIndex = DirContext->DirIndex; - rcFCB->startIndex = DirContext->StartIndex; - if ((rcFCB->Flags & FCB_IS_FATX_ENTRY) && !vfatFCBIsRoot (directoryFCB)) - { - ASSERT(DirContext->DirIndex >= 2 && DirContext->StartIndex >= 2); - rcFCB->dirIndex = DirContext->DirIndex-2; - rcFCB->startIndex = DirContext->StartIndex-2; - } - rcFCB->RFCB.FileSize.QuadPart = Size; - rcFCB->RFCB.ValidDataLength.QuadPart = Size; - rcFCB->RFCB.AllocationSize.QuadPart = ROUND_UP(Size, vcb->FatInfo.BytesPerCluster); - rcFCB->RefCount++; - if (vfatFCBIsDirectory(rcFCB)) - { - vfatFCBInitializeCacheFromVolume(vcb, rcFCB); - } - rcFCB->parentFcb = directoryFCB; - vfatAddFCBToTable (vcb, rcFCB); - *fileFCB = rcFCB; - - ExFreePool(PathNameBuffer); - return STATUS_SUCCESS; + PVFATFCB rcFCB; + PWCHAR PathNameBuffer; + USHORT PathNameLength; + ULONG Size; + ULONG hash; + + UNICODE_STRING NameU; + + PathNameLength = directoryFCB->PathNameU.Length + max(DirContext->LongNameU.Length, DirContext->ShortNameU.Length); + if (!vfatFCBIsRoot (directoryFCB)) + { + PathNameLength += sizeof(WCHAR); + } + + if (PathNameLength > LONGNAME_MAX_LENGTH * sizeof(WCHAR)) + { + return STATUS_OBJECT_NAME_INVALID; + } + PathNameBuffer = ExAllocatePool(NonPagedPool, PathNameLength + sizeof(WCHAR)); + if (!PathNameBuffer) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + NameU.Buffer = PathNameBuffer; + NameU.Length = 0; + NameU.MaximumLength = PathNameLength; + + RtlCopyUnicodeString(&NameU, &directoryFCB->PathNameU); + if (!vfatFCBIsRoot (directoryFCB)) + { + RtlAppendUnicodeToString(&NameU, L"\\"); + } + hash = vfatNameHash(0, &NameU); + if (DirContext->LongNameU.Length > 0) + { + RtlAppendUnicodeStringToString(&NameU, &DirContext->LongNameU); + } + else + { + RtlAppendUnicodeStringToString(&NameU, &DirContext->ShortNameU); + } + NameU.Buffer[NameU.Length / sizeof(WCHAR)] = 0; + + rcFCB = vfatNewFCB (vcb, &NameU); + RtlCopyMemory (&rcFCB->entry, &DirContext->DirEntry, sizeof (DIR_ENTRY)); + RtlCopyUnicodeString(&rcFCB->ShortNameU, &DirContext->ShortNameU); + if (vcb->Flags & VCB_IS_FATX) + { + rcFCB->ShortHash.Hash = rcFCB->Hash.Hash; + } + else + { + rcFCB->ShortHash.Hash = vfatNameHash(hash, &rcFCB->ShortNameU); + } + + if (vfatFCBIsDirectory(rcFCB)) + { + ULONG FirstCluster, CurrentCluster; + NTSTATUS Status; + Size = 0; + FirstCluster = vfatDirEntryGetFirstCluster (vcb, &rcFCB->entry); + if (FirstCluster == 1) + { + Size = vcb->FatInfo.rootDirectorySectors * vcb->FatInfo.BytesPerSector; + } + else if (FirstCluster != 0) + { + CurrentCluster = FirstCluster; + while (CurrentCluster != 0xffffffff) + { + Size += vcb->FatInfo.BytesPerCluster; + Status = NextCluster (vcb, FirstCluster, &CurrentCluster, FALSE); + } + } + } + else if (rcFCB->Flags & FCB_IS_FATX_ENTRY) + { + Size = rcFCB->entry.FatX.FileSize; + } + else + { + Size = rcFCB->entry.Fat.FileSize; + } + rcFCB->dirIndex = DirContext->DirIndex; + rcFCB->startIndex = DirContext->StartIndex; + if ((rcFCB->Flags & FCB_IS_FATX_ENTRY) && !vfatFCBIsRoot (directoryFCB)) + { + ASSERT(DirContext->DirIndex >= 2 && DirContext->StartIndex >= 2); + rcFCB->dirIndex = DirContext->DirIndex-2; + rcFCB->startIndex = DirContext->StartIndex-2; + } + rcFCB->RFCB.FileSize.QuadPart = Size; + rcFCB->RFCB.ValidDataLength.QuadPart = Size; + rcFCB->RFCB.AllocationSize.QuadPart = ROUND_UP(Size, vcb->FatInfo.BytesPerCluster); + rcFCB->RefCount++; + if (vfatFCBIsDirectory(rcFCB)) + { + vfatFCBInitializeCacheFromVolume(vcb, rcFCB); + } + rcFCB->parentFcb = directoryFCB; + vfatAddFCBToTable (vcb, rcFCB); + *fileFCB = rcFCB; + + ExFreePool(PathNameBuffer); + return STATUS_SUCCESS; } NTSTATUS -vfatAttachFCBToFileObject (PDEVICE_EXTENSION vcb, - PVFATFCB fcb, - PFILE_OBJECT fileObject) +vfatAttachFCBToFileObject ( + PDEVICE_EXTENSION vcb, + PVFATFCB fcb, + PFILE_OBJECT fileObject) { - PVFATCCB newCCB; - [truncated at 1000 lines; 550 more skipped]
19 years, 1 month
1
0
0
0
[gvg] 18978: Revert r18836, it breaks the explorer start menu (bug 952)
by gvg@svn.reactos.com
Revert r18836, it breaks the explorer start menu (bug 952) Modified: trunk/reactos/subsys/win32k/ntuser/focus.c _____ Modified: trunk/reactos/subsys/win32k/ntuser/focus.c --- trunk/reactos/subsys/win32k/ntuser/focus.c 2005-11-03 16:58:43 UTC (rev 18977) +++ trunk/reactos/subsys/win32k/ntuser/focus.c 2005-11-03 22:20:29 UTC (rev 18978) @@ -200,8 +200,8 @@ /* FIXME: Send WM_ACTIVATEAPP to all thread windows. */ } + co_IntSendSetFocusMessages(hWndFocusPrev, hWndFocus); co_IntSendActivateMessages(hWndPrev, hWnd, MouseActivate); - co_IntSendSetFocusMessages(hWndFocusPrev, hWndFocus); return TRUE; }
19 years, 1 month
1
0
0
0
[ion] 18977: - Rename KiCheckForKernelApcDelivery
by ion@svn.reactos.com
- Rename KiCheckForKernelApcDelivery Modified: trunk/reactos/ntoskrnl/include/internal/ke.h Modified: trunk/reactos/ntoskrnl/ke/apc.c Modified: trunk/reactos/ntoskrnl/ke/gmutex.c Modified: trunk/reactos/ntoskrnl/ntoskrnl.def _____ Modified: trunk/reactos/ntoskrnl/include/internal/ke.h --- trunk/reactos/ntoskrnl/include/internal/ke.h 2005-11-03 14:38:29 UTC (rev 18976) +++ trunk/reactos/ntoskrnl/include/internal/ke.h 2005-11-03 16:58:43 UTC (rev 18977) @@ -58,7 +58,7 @@ if (!IsListEmpty(&_Thread->ApcState.ApcListHead[KernelMode]) && \ (_Thread->SpecialApcDisable == 0)) \ { \ - KiKernelApcDeliveryCheck(); \ + KiCheckForKernelApcDelivery(); \ } \ } \ } @@ -413,7 +413,7 @@ VOID STDCALL -KiKernelApcDeliveryCheck(VOID); +KiCheckForKernelApcDelivery(VOID); LONG STDCALL _____ Modified: trunk/reactos/ntoskrnl/ke/apc.c --- trunk/reactos/ntoskrnl/ke/apc.c 2005-11-03 14:38:29 UTC (rev 18976) +++ trunk/reactos/ntoskrnl/ke/apc.c 2005-11-03 16:58:43 UTC (rev 18977) @@ -17,10 +17,10 @@ /* FUNCTIONS *****************************************************************/ /*++ - * KiKernelApcDeliveryCheck + * KiCheckForKernelApcDelivery * @implemented NT 5.2 * - * The KiKernelApcDeliveryCheck routine is called whenever APCs have just + * The KiCheckForKernelApcDelivery routine is called whenever APCs have just * been re-enabled in Kernel Mode, such as after leaving a Critical or * Guarded Region. It delivers APCs if the environment is right. * @@ -38,7 +38,7 @@ *--*/ VOID STDCALL -KiKernelApcDeliveryCheck(VOID) +KiCheckForKernelApcDelivery(VOID) { /* We should only deliver at passive */ if (KeGetCurrentIrql() == PASSIVE_LEVEL) @@ -127,7 +127,7 @@ (Thread->SpecialApcDisable == 0)) { /* Check for the right environment */ - KiKernelApcDeliveryCheck(); + KiCheckForKernelApcDelivery(); } } } _____ Modified: trunk/reactos/ntoskrnl/ke/gmutex.c --- trunk/reactos/ntoskrnl/ke/gmutex.c 2005-11-03 14:38:29 UTC (rev 18976) +++ trunk/reactos/ntoskrnl/ke/gmutex.c 2005-11-03 16:58:43 UTC (rev 18977) @@ -59,7 +59,7 @@ if (!IsListEmpty(&Thread->ApcState.ApcListHead[KernelMode])) { /* Check for APC Delivery */ - KiKernelApcDeliveryCheck(); + KiCheckForKernelApcDelivery(); } } } _____ Modified: trunk/reactos/ntoskrnl/ntoskrnl.def --- trunk/reactos/ntoskrnl/ntoskrnl.def 2005-11-03 14:38:29 UTC (rev 18976) +++ trunk/reactos/ntoskrnl/ntoskrnl.def 2005-11-03 16:58:43 UTC (rev 18977) @@ -653,8 +653,8 @@ @KiAcquireSpinLock@4 ;KiBugCheckData DATA KiCoprocessorError@0 +KiCheckForKernelApcDelivery@0 KiDeliverApc@12 -KiKernelApcDeliveryCheck@0 KiDispatchInterrupt@0 KiEnableTimerWatchdog KiInterruptDispatch2@8
19 years, 1 month
1
0
0
0
[gvg] 18976: Clean up release branches
by gvg@svn.reactos.com
Clean up release branches Deleted: branches/ros-branch-0_2_7/ Deleted: branches/ros-branch-0_2_8/
19 years, 1 month
1
0
0
0
[gvg] 18975: Tag ReactOS release 0.2.8
by gvg@svn.reactos.com
Tag ReactOS release 0.2.8 Added: tags/ReactOS-0.2.8/ _____ Copied: tags/ReactOS-0.2.8 (from rev 18974, branches/ros-branch-0_2_8)
19 years, 1 month
1
0
0
0
← Newer
1
...
79
80
81
82
83
84
85
...
88
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Results per page:
10
25
50
100
200