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
March 2005
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
609 discussions
Start a n
N
ew thread
[jimtabor] 13795: Clean up.
by jimtabor@svn.reactos.com
Clean up. Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c _____ Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c --- trunk/reactos/ntoskrnl/ex/sysinfo.c 2005-03-02 03:09:37 UTC (rev 13794) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c 2005-03-02 07:11:26 UTC (rev 13795) @@ -820,7 +820,6 @@ /* Class 16 - Handle Information */ QSI_DEF(SystemHandleInformation) { - PSYSTEM_HANDLE_INFORMATION Shi = (PSYSTEM_HANDLE_INFORMATION) Buffer; @@ -845,35 +844,31 @@ do { hCount = hCount + ObpGetHandleCountByHandleTable(&pr->HandleTable); + pr = PsGetNextProcess(pr); - curSize = sizeof(SYSTEM_HANDLE_INFORMATION)+ - ( (sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO) * hCount) - - (sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO) )); - - Shi->NumberOfHandles = hCount; - - if (curSize > Size) - { - DPRINT1("SystemHandleInformation 2\n"); - *ReqSize = curSize; - if (pr != NULL) - { - ObDereferenceObject(pr); - } - return (STATUS_INFO_LENGTH_MISMATCH); - } - - pr = PsGetNextProcess(pr); - if ((pr == syspr) || (pr == NULL)) break; } while ((pr != syspr) && (pr != NULL)); + DPRINT("SystemHandleInformation 2\n"); + if (pr != NULL) { ObDereferenceObject(pr); } + curSize = sizeof(SYSTEM_HANDLE_INFORMATION)+ + ( (sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO) * hCount) - + (sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO) )); + + Shi->NumberOfHandles = hCount; + + if (curSize > Size) + { + *ReqSize = curSize; + return (STATUS_INFO_LENGTH_MISMATCH); + } + DPRINT("SystemHandleInformation 3\n"); /* Now get Handles from all processs. */
19 years, 9 months
1
0
0
0
[ion] 13794: Random fixes
by ion@svn.reactos.com
Random fixes Modified: branches/alex_devel_branch/reactos/config Modified: branches/alex_devel_branch/reactos/ntoskrnl/include/internal/ke.h Modified: branches/alex_devel_branch/reactos/ntoskrnl/io/iomgr.c Modified: branches/alex_devel_branch/reactos/ntoskrnl/ke/bug.c _____ Modified: branches/alex_devel_branch/reactos/config --- branches/alex_devel_branch/reactos/config 2005-03-02 02:55:16 UTC (rev 13793) +++ branches/alex_devel_branch/reactos/config 2005-03-02 03:09:37 UTC (rev 13794) @@ -25,7 +25,7 @@ # # Whether to compile for debugging # -DBG := 0 +DBG := 1 # # Whether to compile with optimizations _____ Modified: branches/alex_devel_branch/reactos/ntoskrnl/include/internal/ke.h --- branches/alex_devel_branch/reactos/ntoskrnl/include/internal/ke.h 2005-03-02 02:55:16 UTC (rev 13793) +++ branches/alex_devel_branch/reactos/ntoskrnl/include/internal/ke.h 2005-03-02 03:09:37 UTC (rev 13794) @@ -46,6 +46,7 @@ #define IPI_REQUEST_FUNCTIONCALL 0 #define IPI_REQUEST_APC 1 #define IPI_REQUEST_DPC 2 +#define IPI_REQUEST_FREEZE 4 /* ipi.c ********************************************************************/ _____ Modified: branches/alex_devel_branch/reactos/ntoskrnl/io/iomgr.c --- branches/alex_devel_branch/reactos/ntoskrnl/io/iomgr.c 2005-03-02 02:55:16 UTC (rev 13793) +++ branches/alex_devel_branch/reactos/ntoskrnl/io/iomgr.c 2005-03-02 03:09:37 UTC (rev 13794) @@ -11,6 +11,7 @@ /* INCLUDES ****************************************************************/ #include <ntoskrnl.h> +#include <internal/kdb.h> #define NDEBUG #include <internal/debug.h> _____ Modified: branches/alex_devel_branch/reactos/ntoskrnl/ke/bug.c --- branches/alex_devel_branch/reactos/ntoskrnl/ke/bug.c 2005-03-02 02:55:16 UTC (rev 13793) +++ branches/alex_devel_branch/reactos/ntoskrnl/ke/bug.c 2005-03-02 03:09:37 UTC (rev 13794) @@ -354,8 +354,8 @@ if (i != KeGetCurrentProcessorNumber()) { /* Send the IPI and give them one second to catch up */ - KiIpiSendRequest(1 << i, IPI_FREEZE); - KeStallExecutionProcessor(1000000) + KiIpiSendRequest(1 << i, IPI_REQUEST_FREEZE); + KeStallExecutionProcessor(1000000); } } #endif
19 years, 9 months
1
0
0
0
[ion] 13793: Fix bugcheck code and make debugging easier for unhandled exceptions/spinlocks. fixg a race condition with tab+b, fix irql to be high_level, fix calling unsafe function by caching bugcode data, fix support for smp by using IPI, fix not-breakpointing when no debugger is there, implement KeBugCheck callbacks with Reason, fix callbacks not being called, fix proper breakpoint during bugcheck, fix errenous assert, merge with 13774.
by ion@svn.reactos.com
Fix bugcheck code and make debugging easier for unhandled exceptions/spinlocks. fixg a race condition with tab+b, fix irql to be high_level, fix calling unsafe function by caching bugcode data, fix support for smp by using IPI, fix not-breakpointing when no debugger is there, implement KeBugCheck callbacks with Reason, fix callbacks not being called, fix proper breakpoint during bugcheck, fix errenous assert, merge with 13774. Modified: branches/alex_devel_branch/reactos/Makefile Modified: branches/alex_devel_branch/reactos/boot/freeldr/bootsect/Makefile Modified: branches/alex_devel_branch/reactos/boot/freeldr/fdebug/Makefile Modified: branches/alex_devel_branch/reactos/boot/freeldr/freeldr/Makefile Modified: branches/alex_devel_branch/reactos/boot/freeldr/install/Makefile Modified: branches/alex_devel_branch/reactos/boot/freeldr/tools/Makefile Modified: branches/alex_devel_branch/reactos/bootdata/hivesys.inf Modified: branches/alex_devel_branch/reactos/bootdata/packages/reactos.dff Modified: branches/alex_devel_branch/reactos/drivers/video/videoprt/videoprt.c Modified: branches/alex_devel_branch/reactos/hal/halx86/generic/display.c Modified: branches/alex_devel_branch/reactos/include/ddk/fsfuncs.h Modified: branches/alex_devel_branch/reactos/include/ntos/zwtypes.h Modified: branches/alex_devel_branch/reactos/lib/cpl/desk/de.rc Modified: branches/alex_devel_branch/reactos/lib/crt/conio/ungetch.c Modified: branches/alex_devel_branch/reactos/lib/crt/makefile Modified: branches/alex_devel_branch/reactos/lib/crt/stdio/fopen.c Modified: branches/alex_devel_branch/reactos/lib/crt/stdio/fprintf.c Added: branches/alex_devel_branch/reactos/lib/crt/stdio/fwprintf.c Added: branches/alex_devel_branch/reactos/lib/crt/stdio/wfopen.c Modified: branches/alex_devel_branch/reactos/ntoskrnl/ex/init.c Modified: branches/alex_devel_branch/reactos/ntoskrnl/ex/sysinfo.c Modified: branches/alex_devel_branch/reactos/ntoskrnl/fs/notify.c Modified: branches/alex_devel_branch/reactos/ntoskrnl/include/internal/ifs.h Modified: branches/alex_devel_branch/reactos/ntoskrnl/include/internal/ke.h Modified: branches/alex_devel_branch/reactos/ntoskrnl/io/iomgr.c Modified: branches/alex_devel_branch/reactos/ntoskrnl/kd/kdebug.c Modified: branches/alex_devel_branch/reactos/ntoskrnl/ke/apc.c Modified: branches/alex_devel_branch/reactos/ntoskrnl/ke/bug.c Modified: branches/alex_devel_branch/reactos/ntoskrnl/ke/catch.c Modified: branches/alex_devel_branch/reactos/ntoskrnl/ke/i386/brkpoint.c Modified: branches/alex_devel_branch/reactos/ntoskrnl/ke/i386/kernel.c Modified: branches/alex_devel_branch/reactos/ntoskrnl/ke/spinlock.c Modified: branches/alex_devel_branch/reactos/ntoskrnl/ke/wait.c Modified: branches/alex_devel_branch/reactos/ntoskrnl/ntoskrnl.mc Modified: branches/alex_devel_branch/reactos/ntoskrnl/ob/handle.c Deleted: branches/alex_devel_branch/reactos/subsys/system/regedt32/ Added: branches/alex_devel_branch/reactos/subsys/system/sndvol32/De.rc Modified: branches/alex_devel_branch/reactos/subsys/system/sndvol32/sndvol32.rc Modified: branches/alex_devel_branch/reactos/subsys/system/taskmgr/De.rc Modified: branches/alex_devel_branch/reactos/subsys/system/vmwinst/De.rc Modified: branches/alex_devel_branch/reactos/subsys/system/winlogon/De.rc _____ Modified: branches/alex_devel_branch/reactos/Makefile --- branches/alex_devel_branch/reactos/Makefile 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/Makefile 2005-03-02 02:55:16 UTC (rev 13793) @@ -103,7 +103,7 @@ # System applications # autochk cmd format services setup usetup welcome winlogon msiexec -SYS_APPS = autochk calc cmd explorer expand format ibrowser msiexec regedt32 regsvr32 \ +SYS_APPS = autochk calc cmd explorer expand format ibrowser msiexec regsvr32 \ reporterror services setup taskmgr userinit usetup welcome vmwinst rundll32 \ winlogon regedit winefile notepad reactos lsass _____ Modified: branches/alex_devel_branch/reactos/boot/freeldr/bootsect/Makefile --- branches/alex_devel_branch/reactos/boot/freeldr/bootsect/Makefile 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/boot/freeldr/bootsect/Makefile 2005-03-02 02:55:16 UTC (rev 13793) @@ -32,26 +32,26 @@ @$(MAKE) --no-print-directory -C $(FREELDR_TOOLS_PATH) dosmbr.bin : dosmbr.asm - @echo ===================================================== Assembling dosmbr + @echo freeldr: Assembling dosmbr @$(NASM_CMD) $(NFLAGS) -o dosmbr.bin -f bin dosmbr.asm fat.bin : fat.asm $(BIN2C) - @echo ===================================================== Assembling fat + @echo freeldr: Assembling fat @$(NASM_CMD) $(NFLAGS) -o fat.bin -f bin fat.asm @$(BIN2C) fat.bin fat.h fat_data fat32.bin : fat32.asm $(BIN2C) - @echo ===================================================== Assembling fat32 + @echo freeldr: Assembling fat32 @$(NASM_CMD) $(NFLAGS) -o fat32.bin -f bin fat32.asm @$(BIN2C) fat32.bin fat32.h fat32_data isoboot.bin : isoboot.asm - @echo ===================================================== Assembling isoboot + @echo freeldr: Assembling isoboot @$(NASM_CMD) $(NFLAGS) -o isoboot.bin -f bin isoboot.asm ext2.bin : ext2.asm - @echo ===================================================== Assembling ext2 + @echo freeldr: Assembling ext2 @$(NASM_CMD) $(NFLAGS) -o ext2.bin -f bin ext2.asm @$(BIN2C) ext2.bin ext2.h ext2_data @@ -77,4 +77,4 @@ clean: @-$(RM) *.bin @-$(RM) *.h - @echo Clean ALL done. + @echo freeldr: Clean ALL done. _____ Modified: branches/alex_devel_branch/reactos/boot/freeldr/fdebug/Makefile --- branches/alex_devel_branch/reactos/boot/freeldr/fdebug/Makefile 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/boot/freeldr/fdebug/Makefile 2005-03-02 02:55:16 UTC (rev 13793) @@ -30,23 +30,23 @@ all: fdebug.exe fdebug.exe: $(OBJS) - @echo ===================================================== LINKING fdebug + @echo freeldr: LINKING fdebug $(CC) $(FLAGS) -o fdebug.exe $(OBJS) -lgdi32 -lcomdlg32 -Wl,--subsystem,windows fdebug.res: fdebug.rc resource.h - @echo ===================================================== Compiling $* + @echo freeldr: Compiling $* $(RC) -o fdebug.res fdebug.rc -O coff fdebug.o: fdebug.c rs232.h - @echo ===================================================== Compiling $* + @echo freeldr: Compiling $* $(CC) $(FLAGS) -o fdebug.o -c fdebug.c rs232.o: rs232.c rs232.h - @echo ===================================================== Compiling $* + @echo freeldr: Compiling $* $(CC) $(FLAGS) -o rs232.o -c rs232.c clean: @-$(RM) *.o @-$(RM) *.res @-$(RM) *.exe - @echo Clean ALL done. + @echo freeldr: Clean ALL done. _____ Modified: branches/alex_devel_branch/reactos/boot/freeldr/freeldr/Makefile --- branches/alex_devel_branch/reactos/boot/freeldr/freeldr/Makefile 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/boot/freeldr/freeldr/Makefile 2005-03-02 02:55:16 UTC (rev 13793) @@ -57,7 +57,7 @@ @-$(RM) setupldr.sys @-$(RM) setupldr.map @$(MAKE) --no-print-directory -C $(FREELDR_TOOLS_PATH) - @echo Clean ALL done. + @echo freeldr: Clean ALL done. ############################################# @@ -259,11 +259,11 @@ all : freeldr.sys setupldr.sys - @echo Make ALL done. + @echo freeldr: Make ALL done. freeldr.sys : $(ALL_OBJS) $(PATH_TO_TOP)/dk/w32/lib/librossym.a - @echo ===================================================== LINKING $@ + @echo freeldr: LINKING $@ @$(LD) $(LFLAGS) -o freeldr.exe $(F_OBJS) $(PATH_TO_TOP)/dk/w32/lib/librossym.a ifeq ($(FULL_MAP),yes) @$(OBJDUMP) -d -S freeldr.exe > freeldr.map @@ -274,7 +274,7 @@ setupldr.sys : $(ALL_OBJS) - @echo ===================================================== LINKING $@ + @echo freeldr: LINKING $@ @$(LD) $(LFLAGS) -Map setupldr.map -o setupldr.exe $(S_OBJS) ifeq ($(FULL_MAP),yes) @$(OBJDUMP) -d -S setupldr.exe > setupldr.map @@ -285,15 +285,15 @@ %.o :: %.c - @echo ===================================================== Compiling $* + @echo freeldr: Compiling $* @$(CC) $(CFLAGS) -o $@ -c $< @$(DEPTOOL) $*.d %.o :: %.S - @echo ===================================================== Assembling $* + @echo freeldr: Assembling $* @$(CC) $(CFLAGS) -o $@ -c $< @$(DEPTOOL) $*.d %.o :: %.asm - @echo ===================================================== Assembling $* + @echo freeldr: Assembling $* @$(NASM_CMD) $(NASMFLAGS) -o $@ $< _____ Modified: branches/alex_devel_branch/reactos/boot/freeldr/install/Makefile --- branches/alex_devel_branch/reactos/boot/freeldr/install/Makefile 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/boot/freeldr/install/Makefile 2005-03-02 02:55:16 UTC (rev 13793) @@ -35,18 +35,18 @@ @$(MAKE) --no-print-directory -C ../bootsect install.exe: $(OBJS) - @echo ===================================================== LINKING install + @echo freeldr: LINKING install $(CC) $(FLAGS) -o install.exe $(OBJS) install.o: install.c install.h volume.h - @echo ===================================================== Compiling $* + @echo freeldr: Compiling $* $(CC) $(FLAGS) -o install.o -c install.c volume.o: volume.c volume.h install.h - @echo ===================================================== Compiling $* + @echo freeldr: Compiling $* $(CC) $(FLAGS) -o volume.o -c volume.c clean: @-$(RM) *.o @-$(RM) *.exe - @echo Clean ALL done. + @echo freeldr: Clean ALL done. _____ Modified: branches/alex_devel_branch/reactos/boot/freeldr/tools/Makefile --- branches/alex_devel_branch/reactos/boot/freeldr/tools/Makefile 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/boot/freeldr/tools/Makefile 2005-03-02 02:55:16 UTC (rev 13793) @@ -25,16 +25,16 @@ bin2c$(EXE_POSTFIX) all : $(TOOLS) - @echo Tools are up to date. + @echo freeldr: Tools are up to date. % :: all %$(EXE_POSTFIX): %.c - @echo ===================================================== Compiling $* + @echo freeldr: Compiling $* @$(HOST_CC) -Wall -O3 -o $@ $< .PHONY : clean clean: @-$(RM) $(TOOLS) - @echo Clean ALL done. + @echo freeldr: Clean ALL done. _____ Modified: branches/alex_devel_branch/reactos/bootdata/hivesys.inf --- branches/alex_devel_branch/reactos/bootdata/hivesys.inf 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/bootdata/hivesys.inf 2005-03-02 02:55:16 UTC (rev 13793) @@ -257,10 +257,10 @@ ; Subsystems HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Debug",0x00020000,"" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Kmode",0x00020000,"%SystemRoot%\system32\win32k.sys " -HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Optional",0x00070000,"Posix Os2" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Optional",0x00070001,50,00,6f,00,73,00,69,00,78,00, 00,00,4f,00,73,00,32,00,00,00,00,00 HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Os2",0x00020000,"%SystemRoot%\system32\os2ss.exe" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Posix",0x00020000,"%SystemRoot%\system32\psxss.exe" -HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Required",0x00070000,"Debug Windows" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Required",0x00070001,44,00,65,00,62,00,75,00,67,00, 00,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,00,00,00,00 HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Windows",0x00020000,"%SystemRoot%\system32\csrss.ex e" ; 3Com 3c905 Driver _____ Modified: branches/alex_devel_branch/reactos/bootdata/packages/reactos.dff --- branches/alex_devel_branch/reactos/bootdata/packages/reactos.dff 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/bootdata/packages/reactos.dff 2005-03-02 02:55:16 UTC (rev 13793) @@ -149,7 +149,6 @@ subsys\system\format\format.exe 1 subsys\system\notepad\notepad.exe 1 subsys\system\regedit\regedit.exe 4 -subsys\system\regedt32\regedt32.exe 1 subsys\system\regsvr32\regsvr32.exe 1 subsys\system\reporterror\reporterror.exe 1 subsys\system\rundll32\rundll32.exe 1 _____ Modified: branches/alex_devel_branch/reactos/drivers/video/videoprt/videoprt.c --- branches/alex_devel_branch/reactos/drivers/video/videoprt/videoprt.c 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/drivers/video/videoprt/videoprt.c 2005-03-02 02:55:16 UTC (rev 13793) @@ -492,7 +492,7 @@ VOID FASTCALL IntAttachToCSRSS(PEPROCESS *CallingProcess, PEPROCESS *PrevAttachedProcess) -{ +{ *CallingProcess = PsGetCurrentProcess(); if (*CallingProcess != Csrss) { _____ Modified: branches/alex_devel_branch/reactos/hal/halx86/generic/display.c --- branches/alex_devel_branch/reactos/hal/halx86/generic/display.c 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/hal/halx86/generic/display.c 2005-03-02 02:55:16 UTC (rev 13793) @@ -502,7 +502,7 @@ HalWriteGc(0x05, 0x00); /* Write mode 0; read mode 0. */ HalWriteGc(0x06, 0x05); /* Set graphics. */ memcpy(GraphVideoBuffer, SavedTextFont[i], FONT_AMOUNT); - } + } HalBlankScreen(TRUE); @@ -519,6 +519,7 @@ HalWriteSeq(0x04, Seq4); } + VOID STATIC HalRestoreMode(VOID) { @@ -628,7 +629,6 @@ } } - /* PUBLIC FUNCTIONS *********************************************************/ VOID STDCALL @@ -637,6 +637,7 @@ * FUNCTION: Release ownership of display back to HAL */ { + if (HalResetDisplayParameters == NULL) return; @@ -645,12 +646,14 @@ if (!HalResetDisplayParameters(SizeX, SizeY)) { + HalRestoreMode(); HalRestoreFont(); - HalRestorePalette(); + HalRestorePalette(); } HalOwnsDisplay = TRUE; HalClearDisplay(CHAR_ATTRIBUTE); + } _____ Modified: branches/alex_devel_branch/reactos/include/ddk/fsfuncs.h --- branches/alex_devel_branch/reactos/include/ddk/fsfuncs.h 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/include/ddk/fsfuncs.h 2005-03-02 02:55:16 UTC (rev 13793) @@ -617,7 +617,7 @@ ); VOID STDCALL -FsRtlNotifyInitializeSync(IN OUT PNOTIFY_SYNC NotifySync); +FsRtlNotifyInitializeSync(IN OUT PNOTIFY_SYNC *NotifySync); NTSTATUS STDCALL FsRtlNotifyVolumeEvent(IN PFILE_OBJECT FileObject, _____ Modified: branches/alex_devel_branch/reactos/include/ntos/zwtypes.h --- branches/alex_devel_branch/reactos/include/ntos/zwtypes.h 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/include/ntos/zwtypes.h 2005-03-02 02:55:16 UTC (rev 13793) @@ -1102,10 +1102,11 @@ */ typedef struct _FILE_NOTIFY_INFORMATION { - ULONG Action; - ULONG FileNameLength; - WCHAR FileName[0]; -} FILE_NOTIFY_INFORMATION; + ULONG NextEntryOffset; + ULONG Action; + ULONG NameLength; + WCHAR Name[1]; +} FILE_NOTIFY_INFORMATION, *PFILE_NOTIFY_INFORMATION; #define FSCTL_GET_VOLUME_BITMAP 0x9006F #define FSCTL_GET_RETRIEVAL_POINTERS 0x90073 _____ Modified: branches/alex_devel_branch/reactos/lib/cpl/desk/de.rc --- branches/alex_devel_branch/reactos/lib/cpl/desk/de.rc 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/lib/cpl/desk/de.rc 2005-03-02 02:55:16 UTC (rev 13793) @@ -49,10 +49,10 @@ STRINGTABLE BEGIN IDS_CPLNAME "Anzeige" - IDS_CPLDESCRIPTION "Passt die Darstellung des Hintergrundbildes und des Bildschrimschoners an." + IDS_CPLDESCRIPTION "Passt die Darstellung des Hintergrundbildes und des Bildschirmschoners an." IDS_NONE "(Keine)" IDS_CENTER "Zentriert" IDS_STRETCH "Gestreckt" - IDS_TILE "Nebeneinnander" + IDS_TILE "Nebeneinander" END _____ Modified: branches/alex_devel_branch/reactos/lib/crt/conio/ungetch.c --- branches/alex_devel_branch/reactos/lib/crt/conio/ungetch.c 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/lib/crt/conio/ungetch.c 2005-03-02 02:55:16 UTC (rev 13793) @@ -10,11 +10,12 @@ * 28/12/98: Created */ +#include <stdio.h> #include <conio.h> #include <internal/console.h> -#define EOF -1 + int char_avail = 0; int ungot_char = 0; _____ Modified: branches/alex_devel_branch/reactos/lib/crt/makefile --- branches/alex_devel_branch/reactos/lib/crt/makefile 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/lib/crt/makefile 2005-03-02 02:55:16 UTC (rev 13793) @@ -274,7 +274,9 @@ stdio/fileno.o \ stdio/flsbuf.o \ stdio/fopen.o \ + stdio/wfopen.o \ stdio/fprintf.o \ + stdio/fwprintf.o \ stdio/fputc.o \ stdio/fputchar.o \ stdio/fputs.o \ _____ Modified: branches/alex_devel_branch/reactos/lib/crt/stdio/fopen.c --- branches/alex_devel_branch/reactos/lib/crt/stdio/fopen.c 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/lib/crt/stdio/fopen.c 2005-03-02 02:55:16 UTC (rev 13793) @@ -30,13 +30,14 @@ #include <string.h> #include <io.h> #include <fcntl.h> +#include <tchar.h> #include <internal/file.h> //might change fopen(file,mode) -> fsopen(file,mode,_SH_DENYNO); -FILE* fopen(const char *file, const char *mode) +FILE* _tfopen(const _TCHAR *file, const _TCHAR *mode) { FILE *f; int fd, rw, oflags = 0; @@ -50,28 +51,28 @@ if (f == NULL) return NULL; - rw = (strchr(mode, '+') == NULL) ? 0 : 1; - if (strchr(mode, 'a')) + rw = (_tcschr(mode, '+') == NULL) ? 0 : 1; + if (_tcschr(mode, 'a')) oflags = O_CREAT | (rw ? O_RDWR : O_WRONLY); - if (strchr(mode, 'r')) + if (_tcschr(mode, 'r')) oflags = rw ? O_RDWR : O_RDONLY; - if (strchr(mode, 'w')) + if (_tcschr(mode, 'w')) oflags = O_TRUNC | O_CREAT | (rw ? O_RDWR : O_WRONLY); - if (strchr(mode, 't')) + if (_tcschr(mode, 't')) oflags |= O_TEXT; - else if (strchr(mode, 'b')) + else if (_tcschr(mode, 'b')) oflags |= O_BINARY; else oflags |= (_fmode& (O_TEXT|O_BINARY)); - fd = _open(file, oflags, 0); + fd = _topen(file, oflags, 0); if (fd < 0) return NULL; // msvcrt ensures that writes will end up at the end of file in append mode // we just move the file pointer to the end of file initially - if (strchr(mode, 'a')) + if (_tcschr(mode, 'a')) _lseek(fd, 0, SEEK_END); f->_cnt = 0; @@ -79,14 +80,14 @@ f->_bufsiz = 0; if (rw) f->_flag = _IOREAD | _IOWRT; - else if (strchr(mode, 'r')) + else if (_tcschr(mode, 'r')) f->_flag = _IOREAD; else f->_flag = _IOWRT; - if (strchr(mode, 't')) + if (_tcschr(mode, 't')) f->_flag |= _IOTEXT; - else if (strchr(mode, 'b')) + else if (_tcschr(mode, 'b')) f->_flag |= _IOBINARY; else if (_fmode& O_BINARY) f->_flag |= _IOBINARY; @@ -94,64 +95,3 @@ f->_base = f->_ptr = NULL; return f; } - -/* - * @implemented - */ -FILE* _wfopen(const wchar_t *file, const wchar_t *mode) -{ - FILE *f; - int fd, rw, oflags = 0; - - if (file == 0) - return 0; - if (mode == 0) - return 0; - - f = __alloc_file(); - if (f == NULL) - return NULL; - - rw = (wcschr(mode, L'+') == NULL) ? 0 : 1; - if (wcschr(mode, L'a')) - oflags = O_CREAT | (rw ? O_RDWR : O_WRONLY); - if (wcschr(mode, L'r')) - oflags = rw ? O_RDWR : O_RDONLY; - if (wcschr(mode, L'w')) - oflags = O_TRUNC | O_CREAT | (rw ? O_RDWR : O_WRONLY); - if (wcschr(mode, L't')) - oflags |= O_TEXT; - else if (wcschr(mode, L'b')) - oflags |= O_BINARY; - else - oflags |= (_fmode& (O_TEXT|O_BINARY)); - - fd = _wopen(file, oflags, 0); - if (fd < 0) - return NULL; - -// msvcrt ensures that writes will end up at the end of file in append mode -// we just move the file pointer to the end of file initially - if (wcschr(mode, 'a')) - _lseek(fd, 0, SEEK_END); - - f->_cnt = 0; - f->_file = fd; - f->_bufsiz = 0; - if (rw) - f->_flag = _IOREAD | _IOWRT; - else if (wcschr(mode, L'r')) - f->_flag = _IOREAD; - else - f->_flag = _IOWRT; - - if (wcschr(mode, L't')) - f->_flag |= _IOTEXT; - else if (wcschr(mode, L'b')) - f->_flag |= _IOBINARY; - else if (_fmode& O_BINARY) - f->_flag |= _IOBINARY; - - f->_base = f->_ptr = NULL; - return f; -} _____ Modified: branches/alex_devel_branch/reactos/lib/crt/stdio/fprintf.c --- branches/alex_devel_branch/reactos/lib/crt/stdio/fprintf.c 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/lib/crt/stdio/fprintf.c 2005-03-02 02:55:16 UTC (rev 13793) @@ -1,16 +1,17 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ #include <stdio.h> #include <wchar.h> +#include <tchar.h> #include <internal/file.h> /* * @implemented */ int -fprintf(register FILE *iop, const char *fmt, ...) +_ftprintf(register FILE *iop, const _TCHAR *fmt, ...) { int len; - char localbuf[BUFSIZ]; + _TCHAR localbuf[BUFSIZ]; va_list a=0; @@ -18,38 +19,9 @@ if (iop->_flag & _IONBF) { iop->_flag &= ~_IONBF; - iop->_ptr = iop->_base = localbuf; - iop->_bufsiz = BUFSIZ; - len = vfprintf(iop,fmt,a); - fflush(iop); - iop->_flag |= _IONBF; - iop->_base = NULL; - iop->_bufsiz = 0; - iop->_cnt = 0; - } - else - len = vfprintf(iop, fmt, a); - return ferror(iop) ? EOF : len; -} - -/* - * @implemented - */ -int -fwprintf(register FILE *iop, const wchar_t *fmt, ...) -{ - int len; - wchar_t localbuf[BUFSIZ]; - va_list a=0; - - - va_start( a, fmt ); - if (iop->_flag & _IONBF) - { - iop->_flag &= ~_IONBF; iop->_ptr = iop->_base = (char *)localbuf; iop->_bufsiz = BUFSIZ; - len = vfwprintf(iop,fmt,a); + len = _vftprintf(iop,fmt,a); fflush(iop); iop->_flag |= _IONBF; iop->_base = NULL; @@ -57,6 +29,6 @@ iop->_cnt = 0; } else - len = vfwprintf(iop, fmt, a); - return ferror(iop) ? EOF : len; + len = _vftprintf(iop, fmt, a); + return ferror(iop) ? -1 : len; } _____ Copied: branches/alex_devel_branch/reactos/lib/crt/stdio/fwprintf.c (from rev 13792, trunk/reactos/lib/crt/stdio/fwprintf.c) _____ Copied: branches/alex_devel_branch/reactos/lib/crt/stdio/wfopen.c (from rev 13792, trunk/reactos/lib/crt/stdio/wfopen.c) _____ Modified: branches/alex_devel_branch/reactos/ntoskrnl/ex/init.c --- branches/alex_devel_branch/reactos/ntoskrnl/ex/init.c 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/ntoskrnl/ex/init.c 2005-03-02 02:55:16 UTC (rev 13793) @@ -25,6 +25,7 @@ extern ULONG_PTR LastKrnlPhysAddr; extern ULONG_PTR LastKernelAddress; extern LOADER_MODULE KeLoaderModules[64]; +extern PRTL_MESSAGE_RESOURCE_DATA KiBugCodeMessages; /* FUNCTIONS ****************************************************************/ @@ -119,7 +120,7 @@ &ObjectAttributes); /* Free the String */ - RtlFreeUnicodeString (&ArcName); + RtlFreeUnicodeString(&ArcName); /* Check for Success */ if (!NT_SUCCESS(Status)) { @@ -373,6 +374,9 @@ LARGE_INTEGER Timeout; HANDLE ProcessHandle; HANDLE ThreadHandle; + PRTL_MESSAGE_RESOURCE_DATA BugCheckData; + LDR_RESOURCE_INFO ResourceInfo; + PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry; NTSTATUS Status; /* Check if the structures match the ASM offset constants */ @@ -410,6 +414,36 @@ /* Bring back the IRQL to Passive */ KeLowerIrql(PASSIVE_LEVEL); + /* Cache the Bugcheck Message Strings. Prepare the Lookup Data */ + ResourceInfo.Type = 11; + ResourceInfo.Name = 1; + ResourceInfo.Language = 9; + + /* Do the lookup. Note that NTOSKRNL must be the first module! */ + Status = LdrFindResource_U((PVOID)KeLoaderModules[0].ModStart, + &ResourceInfo, + RESOURCE_DATA_LEVEL, + &ResourceDataEntry); + + /* Make sure it worked */ + if (NT_SUCCESS(Status)) { + + DPRINT1("Found Bugcheck Resource Data!\n"); + + /* Now actually get a pointer to it */ + Status = LdrAccessResource((PVOID)KeLoaderModules[0].ModStart, + ResourceDataEntry, + (PVOID*)&BugCheckData, + NULL); + + /* Make sure it worked */ + if (NT_SUCCESS(Status)) { + + DPRINT1("Got Pointer to Bugcheck Resource Data!\n"); + KiBugCodeMessages = BugCheckData; + } + } + /* Load basic Security for other Managers */ if (!SeInit1()) KEBUGCHECK(SECURITY_INITIALIZATION_FAILED); _____ Modified: branches/alex_devel_branch/reactos/ntoskrnl/ex/sysinfo.c --- branches/alex_devel_branch/reactos/ntoskrnl/ex/sysinfo.c 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/ntoskrnl/ex/sysinfo.c 2005-03-02 02:55:16 UTC (rev 13793) @@ -825,13 +825,111 @@ return (STATUS_NOT_IMPLEMENTED); } + +VOID +ObpGetNextHandleByProcessCount(PSYSTEM_HANDLE_TABLE_ENTRY_INFO pshi, + PEPROCESS Process, + int Count); + /* Class 16 - Handle Information */ QSI_DEF(SystemHandleInformation) { - /* FIXME */ - DPRINT1("NtQuerySystemInformation - SystemHandleInformation not implemented\n"); - return (STATUS_NOT_IMPLEMENTED); + + PSYSTEM_HANDLE_INFORMATION Shi = + (PSYSTEM_HANDLE_INFORMATION) Buffer; + + DPRINT("NtQuerySystemInformation - SystemHandleInformation\n"); + + if (Size < sizeof (SYSTEM_HANDLE_INFORMATION)) + { + * ReqSize = sizeof (SYSTEM_HANDLE_INFORMATION); + return (STATUS_INFO_LENGTH_MISMATCH); + } + + DPRINT("SystemHandleInformation 1\n"); + + PEPROCESS pr, syspr; + int curSize, i = 0; + ULONG hCount = 0; + + /* First Calc Size from Count. */ + syspr = PsGetNextProcess(NULL); + pr = syspr; + + do + { + hCount = hCount + ObpGetHandleCountByHandleTable(&pr->HandleTable); + + curSize = sizeof(SYSTEM_HANDLE_INFORMATION)+ + ( (sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO) * hCount) - + (sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO) )); + + Shi->NumberOfHandles = hCount; + + if (curSize > Size) + { + DPRINT1("SystemHandleInformation 2\n"); + *ReqSize = curSize; + if (pr != NULL) + { + ObDereferenceObject(pr); + } + return (STATUS_INFO_LENGTH_MISMATCH); + } + + pr = PsGetNextProcess(pr); + + if ((pr == syspr) || (pr == NULL)) + break; + } while ((pr != syspr) && (pr != NULL)); + + if (pr != NULL) + { + ObDereferenceObject(pr); + } + + DPRINT("SystemHandleInformation 3\n"); + + /* Now get Handles from all processs. */ + syspr = PsGetNextProcess(NULL); + pr = syspr; + + do + { + int Count = 0, HandleCount = 0; + + HandleCount = ObpGetHandleCountByHandleTable(&pr->HandleTable); + + for (Count = 0; HandleCount > 0 ; HandleCount--) + { + ObpGetNextHandleByProcessCount( &Shi->Handles[i], pr, Count); + Count++; + i++; + } + + pr = PsGetNextProcess(pr); + + if ((pr == syspr) || (pr == NULL)) + break; + } while ((pr != syspr) && (pr != NULL)); + + + if (pr != NULL) + { + ObDereferenceObject(pr); + } + + DPRINT("SystemHandleInformation 4\n"); + return (STATUS_SUCCESS); + } +/* +SSI_DEF(SystemHandleInformation) +{ + + return (STATUS_SUCCESS); +} +*/ /* Class 17 - Information */ QSI_DEF(SystemObjectInformation) _____ Modified: branches/alex_devel_branch/reactos/ntoskrnl/fs/notify.c --- branches/alex_devel_branch/reactos/ntoskrnl/fs/notify.c 2005-03-01 22:56:51 UTC (rev 13792) +++ branches/alex_devel_branch/reactos/ntoskrnl/fs/notify.c 2005-03-02 02:55:16 UTC (rev 13793) @@ -5,14 +5,141 @@ * FILE: ntoskrnl/fs/notify.c * PURPOSE: No purpose listed. * - * PROGRAMMERS: No programmer listed. + * PROGRAMMERS: Gunnar Dalsnes */ #include <ntoskrnl.h> -#define NDEBUG + +//#define NDEBUG #include <internal/debug.h> + +PAGED_LOOKASIDE_LIST NotifyEntryLookaside; + +#define FSRTL_NOTIFY_TAG TAG('N','O','T','I') + +typedef struct _NOTIFY_ENTRY +{ + LIST_ENTRY ListEntry; + PSTRING FullDirectoryName; + BOOLEAN WatchTree; + BOOLEAN IgnoreBuffer; + BOOLEAN PendingChanges; + ULONG CompletionFilter; + LIST_ENTRY IrpQueue; + PVOID Fcb; + PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback; + PSECURITY_SUBJECT_CONTEXT SubjectContext; + PVOID FsContext; + BOOLEAN Unicode; + BOOLEAN BufferExhausted; + PVOID Buffer; /* Buffer == NULL equals IgnoreBuffer == TRUE */ + ULONG BufferSize; + ULONG NextEntryOffset; + PFILE_NOTIFY_INFORMATION PrevEntry; +} NOTIFY_ENTRY, *PNOTIFY_ENTRY; + + /********************************************************************** + * NAME PRIVATE + * FsRtlpInitNotifyImplementation + * + */ +VOID +STDCALL INIT_FUNCTION +FsRtlpInitNotifyImplementation(VOID) +{ + ExInitializePagedLookasideList( &NotifyEntryLookaside, + NULL, + NULL, + 0, + sizeof(NOTIFY_ENTRY), + FSRTL_NOTIFY_TAG, + 0 + ); + + +} + + + +static +inline +BOOLEAN +FsRtlpIsUnicodePath( + PSTRING Path + ) +{ + ASSERT(Path->Length); + + if (Path->Length == 1) return FALSE; + + if (*(WCHAR*)Path->Buffer == '\\') return TRUE; + + return FALSE; +} + + +/********************************************************************** + * NAME PRIVATE + * FsRtlpNotifyCancelRoutine + * + */ +static +VOID +STDCALL +FsRtlpNotifyCancelRoutine( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp + ) +{ + PFAST_MUTEX Lock; + + //don't need this since we have our own sync. protecting irp cancellation + IoReleaseCancelSpinLock(Irp->CancelIrql); + + Lock = (PFAST_MUTEX)Irp->Tail.Overlay.DriverContext[3]; + + ExAcquireFastMutex(Lock ); + + RemoveEntryList(&Irp->Tail.Overlay.ListEntry); + + ExReleaseFastMutex(Lock); + + Irp->IoStatus.Status = STATUS_CANCELLED; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + +} + + + +static +PNOTIFY_ENTRY +FASTCALL +FsRtlpFindNotifyEntry( + PLIST_ENTRY NotifyList, + PVOID FsContext + ) +{ + PLIST_ENTRY EnumEntry; + PNOTIFY_ENTRY NotifyEntry; + + LIST_FOR_EACH(EnumEntry, NotifyList) + { + NotifyEntry = CONTAINING_RECORD(EnumEntry, NOTIFY_ENTRY, ListEntry); + + if (NotifyEntry->FsContext == FsContext) + { + return NotifyEntry; + } + } + + return NULL; +} + +/********************************************************************** * NAME EXPORTED * FsRtlNotifyChangeDirectory@28 * @@ -57,7 +184,8 @@ * FsRtlNotifyCleanup@12 * * DESCRIPTION - * + * Called by FSD when all handles to FileObject (identified by FsContext) are closed + * * ARGUMENTS * * RETURN VALUE @@ -72,6 +200,61 @@ IN PVOID FsContext ) { + PNOTIFY_ENTRY NotifyEntry; + LIST_ENTRY CompletedListHead; + PLIST_ENTRY TmpEntry; + PIRP Irp; + + InitializeListHead(&CompletedListHead); + + ExAcquireFastMutex((PFAST_MUTEX)NotifySync); + + NotifyEntry = FsRtlpFindNotifyEntry(NotifyList, FsContext); + + if (NotifyEntry) + { + /* free buffered changes */ + if (NotifyEntry->Buffer) + { + ExFreePool(NotifyEntry->Buffer); + } + + /* cancel(?) pending irps */ + while (!IsListEmpty(&NotifyEntry->IrpQueue)) + { + TmpEntry = RemoveHeadList(&NotifyEntry->IrpQueue); + Irp = CONTAINING_RECORD(TmpEntry , IRP, Tail.Overlay.ListEntry); + + /* irp cancelation bolilerplate */ + if (!IoSetCancelRoutine(Irp, NULL)) + { + //The cancel routine will be called. When we release the lock it will complete the irp. + InitializeListHead(&Irp->Tail.Overlay.ListEntry); + continue; + } + + Irp->IoStatus.Status = STATUS_NOTIFY_CLEANUP; /* FIXME: correct status? */ + Irp->IoStatus.Information = 0; + + /* avoid holding lock while completing irp */ + InsertTailList(&CompletedListHead, &Irp->Tail.Overlay.ListEntry); + } + + /* Unlink and free the NotifyStruct */ + RemoveEntryList(&NotifyEntry->ListEntry); + ExFreeToPagedLookasideList(&NotifyEntryLookaside, NotifyEntry); + } + + ExReleaseFastMutex((PFAST_MUTEX)NotifySync); + + /* complete defered irps */ + while (!IsListEmpty(&CompletedListHead)) + { + TmpEntry = RemoveHeadList(&CompletedListHead); + Irp = CONTAINING_RECORD(TmpEntry , IRP, Tail.Overlay.ListEntry); + IoCompleteRequest(Irp, IO_NO_INCREMENT); + } + } @@ -119,6 +302,77 @@ } + +static +VOID [truncated at 1000 lines; 1657 more skipped]
19 years, 9 months
1
0
0
0
[ea] 13792: Fix SM\Subsystems\Required and SM\Subsystems\Optional.
by ea@svn.reactos.com
Fix SM\Subsystems\Required and SM\Subsystems\Optional. Modified: trunk/reactos/bootdata/hivesys.inf _____ Modified: trunk/reactos/bootdata/hivesys.inf --- trunk/reactos/bootdata/hivesys.inf 2005-03-01 22:22:56 UTC (rev 13791) +++ trunk/reactos/bootdata/hivesys.inf 2005-03-01 22:56:51 UTC (rev 13792) @@ -257,10 +257,10 @@ ; Subsystems HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Debug",0x00020000,"" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Kmode",0x00020000,"%SystemRoot%\system32\win32k.sys " -HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Optional",0x00070000,"Posix Os2" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Optional",0x00070001,50,00,6f,00,73,00,69,00,78,00, 00,00,4f,00,73,00,32,00,00,00,00,00 HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Os2",0x00020000,"%SystemRoot%\system32\os2ss.exe" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Posix",0x00020000,"%SystemRoot%\system32\psxss.exe" -HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Required",0x00070000,"Debug Windows" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Required",0x00070001,44,00,65,00,62,00,75,00,67,00, 00,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,00,00,00,00 HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Subsystems","Windows",0x00020000,"%SystemRoot%\system32\csrss.ex e" ; 3Com 3c905 Driver
19 years, 9 months
1
0
0
0
[gdalsnes] 13791: tcharize a couple of routines
by gdalsnes@svn.reactos.com
tcharize a couple of routines Modified: trunk/reactos/lib/crt/makefile Modified: trunk/reactos/lib/crt/stdio/fopen.c Modified: trunk/reactos/lib/crt/stdio/fprintf.c Added: trunk/reactos/lib/crt/stdio/fwprintf.c Added: trunk/reactos/lib/crt/stdio/wfopen.c _____ Modified: trunk/reactos/lib/crt/makefile --- trunk/reactos/lib/crt/makefile 2005-03-01 22:13:40 UTC (rev 13790) +++ trunk/reactos/lib/crt/makefile 2005-03-01 22:22:56 UTC (rev 13791) @@ -274,7 +274,9 @@ stdio/fileno.o \ stdio/flsbuf.o \ stdio/fopen.o \ + stdio/wfopen.o \ stdio/fprintf.o \ + stdio/fwprintf.o \ stdio/fputc.o \ stdio/fputchar.o \ stdio/fputs.o \ _____ Modified: trunk/reactos/lib/crt/stdio/fopen.c --- trunk/reactos/lib/crt/stdio/fopen.c 2005-03-01 22:13:40 UTC (rev 13790) +++ trunk/reactos/lib/crt/stdio/fopen.c 2005-03-01 22:22:56 UTC (rev 13791) @@ -30,13 +30,14 @@ #include <string.h> #include <io.h> #include <fcntl.h> +#include <tchar.h> #include <internal/file.h> //might change fopen(file,mode) -> fsopen(file,mode,_SH_DENYNO); -FILE* fopen(const char *file, const char *mode) +FILE* _tfopen(const _TCHAR *file, const _TCHAR *mode) { FILE *f; int fd, rw, oflags = 0; @@ -50,28 +51,28 @@ if (f == NULL) return NULL; - rw = (strchr(mode, '+') == NULL) ? 0 : 1; - if (strchr(mode, 'a')) + rw = (_tcschr(mode, '+') == NULL) ? 0 : 1; + if (_tcschr(mode, 'a')) oflags = O_CREAT | (rw ? O_RDWR : O_WRONLY); - if (strchr(mode, 'r')) + if (_tcschr(mode, 'r')) oflags = rw ? O_RDWR : O_RDONLY; - if (strchr(mode, 'w')) + if (_tcschr(mode, 'w')) oflags = O_TRUNC | O_CREAT | (rw ? O_RDWR : O_WRONLY); - if (strchr(mode, 't')) + if (_tcschr(mode, 't')) oflags |= O_TEXT; - else if (strchr(mode, 'b')) + else if (_tcschr(mode, 'b')) oflags |= O_BINARY; else oflags |= (_fmode& (O_TEXT|O_BINARY)); - fd = _open(file, oflags, 0); + fd = _topen(file, oflags, 0); if (fd < 0) return NULL; // msvcrt ensures that writes will end up at the end of file in append mode // we just move the file pointer to the end of file initially - if (strchr(mode, 'a')) + if (_tcschr(mode, 'a')) _lseek(fd, 0, SEEK_END); f->_cnt = 0; @@ -79,14 +80,14 @@ f->_bufsiz = 0; if (rw) f->_flag = _IOREAD | _IOWRT; - else if (strchr(mode, 'r')) + else if (_tcschr(mode, 'r')) f->_flag = _IOREAD; else f->_flag = _IOWRT; - if (strchr(mode, 't')) + if (_tcschr(mode, 't')) f->_flag |= _IOTEXT; - else if (strchr(mode, 'b')) + else if (_tcschr(mode, 'b')) f->_flag |= _IOBINARY; else if (_fmode& O_BINARY) f->_flag |= _IOBINARY; @@ -94,64 +95,3 @@ f->_base = f->_ptr = NULL; return f; } - -/* - * @implemented - */ -FILE* _wfopen(const wchar_t *file, const wchar_t *mode) -{ - FILE *f; - int fd, rw, oflags = 0; - - if (file == 0) - return 0; - if (mode == 0) - return 0; - - f = __alloc_file(); - if (f == NULL) - return NULL; - - rw = (wcschr(mode, L'+') == NULL) ? 0 : 1; - if (wcschr(mode, L'a')) - oflags = O_CREAT | (rw ? O_RDWR : O_WRONLY); - if (wcschr(mode, L'r')) - oflags = rw ? O_RDWR : O_RDONLY; - if (wcschr(mode, L'w')) - oflags = O_TRUNC | O_CREAT | (rw ? O_RDWR : O_WRONLY); - if (wcschr(mode, L't')) - oflags |= O_TEXT; - else if (wcschr(mode, L'b')) - oflags |= O_BINARY; - else - oflags |= (_fmode& (O_TEXT|O_BINARY)); - - fd = _wopen(file, oflags, 0); - if (fd < 0) - return NULL; - -// msvcrt ensures that writes will end up at the end of file in append mode -// we just move the file pointer to the end of file initially - if (wcschr(mode, 'a')) - _lseek(fd, 0, SEEK_END); - - f->_cnt = 0; - f->_file = fd; - f->_bufsiz = 0; - if (rw) - f->_flag = _IOREAD | _IOWRT; - else if (wcschr(mode, L'r')) - f->_flag = _IOREAD; - else - f->_flag = _IOWRT; - - if (wcschr(mode, L't')) - f->_flag |= _IOTEXT; - else if (wcschr(mode, L'b')) - f->_flag |= _IOBINARY; - else if (_fmode& O_BINARY) - f->_flag |= _IOBINARY; - - f->_base = f->_ptr = NULL; - return f; -} _____ Modified: trunk/reactos/lib/crt/stdio/fprintf.c --- trunk/reactos/lib/crt/stdio/fprintf.c 2005-03-01 22:13:40 UTC (rev 13790) +++ trunk/reactos/lib/crt/stdio/fprintf.c 2005-03-01 22:22:56 UTC (rev 13791) @@ -1,16 +1,17 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ #include <stdio.h> #include <wchar.h> +#include <tchar.h> #include <internal/file.h> /* * @implemented */ int -fprintf(register FILE *iop, const char *fmt, ...) +_ftprintf(register FILE *iop, const _TCHAR *fmt, ...) { int len; - char localbuf[BUFSIZ]; + _TCHAR localbuf[BUFSIZ]; va_list a=0; @@ -18,38 +19,9 @@ if (iop->_flag & _IONBF) { iop->_flag &= ~_IONBF; - iop->_ptr = iop->_base = localbuf; - iop->_bufsiz = BUFSIZ; - len = vfprintf(iop,fmt,a); - fflush(iop); - iop->_flag |= _IONBF; - iop->_base = NULL; - iop->_bufsiz = 0; - iop->_cnt = 0; - } - else - len = vfprintf(iop, fmt, a); - return ferror(iop) ? EOF : len; -} - -/* - * @implemented - */ -int -fwprintf(register FILE *iop, const wchar_t *fmt, ...) -{ - int len; - wchar_t localbuf[BUFSIZ]; - va_list a=0; - - - va_start( a, fmt ); - if (iop->_flag & _IONBF) - { - iop->_flag &= ~_IONBF; iop->_ptr = iop->_base = (char *)localbuf; iop->_bufsiz = BUFSIZ; - len = vfwprintf(iop,fmt,a); + len = _vftprintf(iop,fmt,a); fflush(iop); iop->_flag |= _IONBF; iop->_base = NULL; @@ -57,6 +29,6 @@ iop->_cnt = 0; } else - len = vfwprintf(iop, fmt, a); - return ferror(iop) ? EOF : len; + len = _vftprintf(iop, fmt, a); + return ferror(iop) ? -1 : len; } _____ Added: trunk/reactos/lib/crt/stdio/fwprintf.c --- trunk/reactos/lib/crt/stdio/fwprintf.c 2005-03-01 22:13:40 UTC (rev 13790) +++ trunk/reactos/lib/crt/stdio/fwprintf.c 2005-03-01 22:22:56 UTC (rev 13791) @@ -0,0 +1,4 @@ +#define UNICODE +#define _UNICODE + +#include "fprintf.c" _____ Added: trunk/reactos/lib/crt/stdio/wfopen.c --- trunk/reactos/lib/crt/stdio/wfopen.c 2005-03-01 22:13:40 UTC (rev 13790) +++ trunk/reactos/lib/crt/stdio/wfopen.c 2005-03-01 22:22:56 UTC (rev 13791) @@ -0,0 +1,4 @@ +#define UNICODE +#define _UNICODE + +#include "fopen.c"
19 years, 9 months
1
0
0
0
[gdalsnes] 13790: init. work on a notify-directory impl.
by gdalsnes@svn.reactos.com
init. work on a notify-directory impl. Modified: trunk/reactos/include/ntos/zwtypes.h Modified: trunk/reactos/ntoskrnl/fs/notify.c Modified: trunk/reactos/ntoskrnl/include/internal/ifs.h _____ Modified: trunk/reactos/include/ntos/zwtypes.h --- trunk/reactos/include/ntos/zwtypes.h 2005-03-01 13:53:32 UTC (rev 13789) +++ trunk/reactos/include/ntos/zwtypes.h 2005-03-01 22:13:40 UTC (rev 13790) @@ -1102,10 +1102,11 @@ */ typedef struct _FILE_NOTIFY_INFORMATION { - ULONG Action; - ULONG FileNameLength; - WCHAR FileName[0]; -} FILE_NOTIFY_INFORMATION; + ULONG NextEntryOffset; + ULONG Action; + ULONG NameLength; + WCHAR Name[1]; +} FILE_NOTIFY_INFORMATION, *PFILE_NOTIFY_INFORMATION; #define FSCTL_GET_VOLUME_BITMAP 0x9006F #define FSCTL_GET_RETRIEVAL_POINTERS 0x90073 _____ Modified: trunk/reactos/ntoskrnl/fs/notify.c --- trunk/reactos/ntoskrnl/fs/notify.c 2005-03-01 13:53:32 UTC (rev 13789) +++ trunk/reactos/ntoskrnl/fs/notify.c 2005-03-01 22:13:40 UTC (rev 13790) @@ -9,37 +9,37 @@ */ #include <ntoskrnl.h> -#define NDEBUG + +//#define NDEBUG #include <internal/debug.h> PAGED_LOOKASIDE_LIST NotifyEntryLookaside; +#define FSRTL_NOTIFY_TAG TAG('N','O','T','I') + typedef struct _NOTIFY_ENTRY { LIST_ENTRY ListEntry; PSTRING FullDirectoryName; BOOLEAN WatchTree; BOOLEAN IgnoreBuffer; + BOOLEAN PendingChanges; ULONG CompletionFilter; LIST_ENTRY IrpQueue; PVOID Fcb; PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback; PSECURITY_SUBJECT_CONTEXT SubjectContext; PVOID FsContext; - LIST_ENTRY BufferedChangesList; + BOOLEAN Unicode; + BOOLEAN BufferExhausted; + PVOID Buffer; /* Buffer == NULL equals IgnoreBuffer == TRUE */ + ULONG BufferSize; + ULONG NextEntryOffset; + PFILE_NOTIFY_INFORMATION PrevEntry; } NOTIFY_ENTRY, *PNOTIFY_ENTRY; -typedef struct _BUFFERED_CHANGE -{ - LIST_ENTRY ListEntry; - ULONG Action; - USHORT NameLen; - WCHAR RelativeName[1]; - -} BUFFERED_CHANGE, *PBUFFERED_CHANGE; - /********************************************************************** * NAME PRIVATE * FsRtlpInitNotifyImplementation @@ -54,7 +54,7 @@ NULL, 0, sizeof(NOTIFY_ENTRY), - 0 /* FSRTL_NOTIFY_TAG*/, + FSRTL_NOTIFY_TAG, 0 ); @@ -63,6 +63,21 @@ +static +inline +BOOLEAN +FsRtlpIsUnicodePath( + PSTRING Path + ) +{ + ASSERT(Path->Length); + + if (Path->Length == 1) return FALSE; + + if (*(WCHAR*)Path->Buffer == '\\') return TRUE; + + return FALSE; +} /********************************************************************** @@ -188,7 +203,6 @@ PNOTIFY_ENTRY NotifyEntry; LIST_ENTRY CompletedListHead; PLIST_ENTRY TmpEntry; - PBUFFERED_CHANGE BufferedChange; PIRP Irp; InitializeListHead(&CompletedListHead); @@ -200,11 +214,9 @@ if (NotifyEntry) { /* free buffered changes */ - while (!IsListEmpty(&NotifyEntry->BufferedChangesList)) + if (NotifyEntry->Buffer) { - TmpEntry = RemoveHeadList(&NotifyEntry->BufferedChangesList); - BufferedChange = CONTAINING_RECORD(TmpEntry , BUFFERED_CHANGE, ListEntry); - ExFreePool(BufferedChange); + ExFreePool(NotifyEntry->Buffer); } /* cancel(?) pending irps */ @@ -303,7 +315,6 @@ LIST_ENTRY CompletedListHead; PLIST_ENTRY EnumEntry, TmpEntry; PNOTIFY_ENTRY NotifyEntry; - PBUFFERED_CHANGE BufferedChange; PIRP Irp; InitializeListHead(&CompletedListHead); @@ -317,14 +328,12 @@ RemoveEntryList(&NotifyEntry->ListEntry); /* free buffered changes */ - while (!IsListEmpty(&NotifyEntry->BufferedChangesList)) + if (NotifyEntry->Buffer) { - TmpEntry = RemoveHeadList(&NotifyEntry->BufferedChangesList); - BufferedChange = CONTAINING_RECORD(TmpEntry , BUFFERED_CHANGE, ListEntry); - ExFreePool(BufferedChange); + ExFreePool(NotifyEntry->Buffer); } - /* cancel(?) pending irps */ + /* cleanup pending irps */ while (!IsListEmpty(&NotifyEntry->IrpQueue)) { TmpEntry = RemoveHeadList(&NotifyEntry->IrpQueue); @@ -338,7 +347,7 @@ continue; } - Irp->IoStatus.Status = STATUS_NOTIFY_CLEANUP; /* FIXME: correct status? */ + Irp->IoStatus.Status = STATUS_DELETE_PENDING; Irp->IoStatus.Information = 0; /* avoid holding lock while completing irp */ @@ -359,6 +368,11 @@ } + + + + + /********************************************************************** * NAME EXPORTED * FsRtlNotifyFullChangeDirectory@40 @@ -388,8 +402,7 @@ { PIO_STACK_LOCATION IrpStack; PNOTIFY_ENTRY NotifyEntry; - PBUFFERED_CHANGE BufferedChange; - PLIST_ENTRY TmpEntry; + ULONG IrpBuffLen; if (!NotifyIrp) { @@ -398,6 +411,8 @@ return; } + DPRINT("FullDirectoryName: %wZ\n", FullDirectoryName); + ExAcquireFastMutex((PFAST_MUTEX)NotifySync); IrpStack = IoGetCurrentIrpStackLocation(NotifyIrp); @@ -411,39 +426,61 @@ return; } + IrpBuffLen = IrpStack->Parameters.NotifyDirectory.Length; + NotifyEntry = FsRtlpFindNotifyEntry(NotifyList, FsContext); if (!NotifyEntry) { /* No NotifyStruct for this FileObject existed */ + /* The first request for this FileObject set the standards. + * For subsequent requests, these params will be ignored. + * Ref: Windows NT File System Internals page 516 + */ + NotifyEntry = ExAllocateFromPagedLookasideList(&NotifyEntryLookaside); + RtlZeroMemory(NotifyEntry, sizeof(NOTIFY_ENTRY)); + NotifyEntry->FsContext = FsContext; NotifyEntry->FullDirectoryName = FullDirectoryName; NotifyEntry->WatchTree = WatchTree; - NotifyEntry->IgnoreBuffer = IgnoreBuffer; NotifyEntry->CompletionFilter = CompletionFilter; NotifyEntry->TraverseCallback = TraverseCallback; NotifyEntry->SubjectContext = SubjectContext; NotifyEntry->Fcb = IrpStack->FileObject->FsContext; + NotifyEntry->Unicode = FsRtlpIsUnicodePath(FullDirectoryName); + + /* Init. buffer */ + if (IrpBuffLen && !IgnoreBuffer) + { + _SEH_TRY + { + NotifyEntry->Buffer = ExAllocatePoolWithQuotaTag( + PagedPool, + IrpBuffLen, + FSRTL_NOTIFY_TAG + ); + + NotifyEntry->PrevEntry = NotifyEntry->Buffer; + NotifyEntry->BufferSize = IrpBuffLen; + } + _SEH_HANDLE + { + /* ExAllocatePoolWithQuotaTag raised exception */ + } + _SEH_END; + } + InitializeListHead(&NotifyEntry->IrpQueue); - InitializeListHead(&NotifyEntry->BufferedChangesList); InsertTailList(NotifyList, &NotifyEntry->ListEntry); } - /* - * FIXME: this NotifyStruct allready have values for WatchTree, CompletionFilter etc. - * What if the WatchTree, CompletionFilter etc. params are different from - * those in the NotifyStruct? Should the params be ignored or should the params overwrite - * the "old" values in the NotifyStruct?? - * STATUS: Currently we ignore these params for subsequesnt request. - * - * -Gunnar - */ - - if (IsListEmpty(&NotifyEntry->BufferedChangesList)) + + + if (!NotifyEntry->PendingChanges) { /* No changes are pending. Queue the irp */ @@ -472,48 +509,46 @@ ExReleaseFastMutex((PFAST_MUTEX)NotifySync); return; } - - - - /* - typedef struct _FILE_NOTIFY_INFORMATION { - ULONG NextEntryOffset; - ULONG Action; - ULONG NameLength; - WCHAR Name[1]; - } FILE_NOTIFY_INFORMATION, *PFILE_NOTIFY_INFORMATION; - */ - /* Buffered changes exist */ + /* Pending changes exist */ - - /* Copy as much buffered data as available/the buffer can hold */ - while (!IsListEmpty(&NotifyEntry->BufferedChangesList)) + if (NotifyEntry->Buffer == NULL || + NotifyEntry->BufferExhausted || + IrpBuffLen < NotifyEntry->NextEntryOffset) { - TmpEntry = RemoveHeadList(&NotifyEntry->BufferedChangesList); - BufferedChange = CONTAINING_RECORD(TmpEntry, BUFFERED_CHANGE, ListEntry); + /* + Can't return detailed changes to user cause: + -No buffer exist, OR + -Buffer were overflowed, OR + -Current irp buff was not large enough + */ + + NotifyIrp->IoStatus.Information = 0; + NotifyIrp->IoStatus.Status = STATUS_NOTIFY_ENUM_DIR; - /* FIXME: - Fill user-buffer with recorded events until full. If user buffer is too small to hold even - a single record or can only hold some of the events, what should we do???????????? - */ - - /* FIXME: implement this (copy data to user) */ + } + else + { + /* terminate last entry */ + NotifyEntry->PrevEntry->NextEntryOffset = 0; + + //FIXME: copy data correctly to user + memcpy(NotifyIrp->UserBuffer, NotifyEntry->Buffer, NotifyEntry->NextEntryOffset); -// BufferedChange->Action = Action; -// RecordedChange->Name -// RecordedChange->NameLength - - ExFreePool(BufferedChange); - - + NotifyIrp->IoStatus.Information = NotifyEntry->NextEntryOffset; + NotifyIrp->IoStatus.Status = STATUS_SUCCESS; } + + /* reset buffer */ + NotifyEntry->PrevEntry = NotifyEntry->Buffer; + NotifyEntry->NextEntryOffset = 0; + NotifyEntry->BufferExhausted = FALSE; + + NotifyEntry->PendingChanges = FALSE; ExReleaseFastMutex((PFAST_MUTEX)NotifySync); - NotifyIrp->IoStatus.Information = 0; //<- FIXME - NotifyIrp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(NotifyIrp, IO_NO_INCREMENT); } @@ -530,8 +565,8 @@ /* Loop to get a non-canceled irp */ while (!IsListEmpty(&NotifyEntry->IrpQueue)) { - /* If we have queued irp(s) we can't possibly have buffered changes too */ - ASSERT(IsListEmpty(&NotifyEntry->BufferedChangesList)); + /* If we have queued irp(s) we can't possibly have pending changes too */ + ASSERT(!NotifyEntry->PendingChanges); TmpEntry = RemoveHeadList(&NotifyEntry->IrpQueue); Irp = CONTAINING_RECORD(TmpEntry , IRP, Tail.Overlay.ListEntry); @@ -552,10 +587,37 @@ } - - +static +inline +VOID +FsRtlpCopyName( + PFILE_NOTIFY_INFORMATION CurrentEntry, + BOOLEAN Unicode, + PSTRING RelativeName, + PSTRING StreamName + ) +{ + /* Buffer size is allready probed, so just copy the data */ + if (Unicode) + { + memcpy(CurrentEntry->Name, RelativeName->Buffer, RelativeName->Length); + if (StreamName) + { + CurrentEntry->Name[RelativeName->Length/sizeof(WCHAR)] = ':'; + memcpy(&CurrentEntry ->Name[(RelativeName->Length/sizeof(WCHAR))+1], + StreamName->Buffer, + StreamName->Length); + } + } + else + { + //FIXME: convert to unicode etc. + DPRINT1("FIXME: ansi strings in notify impl. not supported yet\n"); + } +} + /********************************************************************** * NAME EXPORTED * FsRtlNotifyFullReportChange@36 @@ -573,75 +635,188 @@ FsRtlNotifyFullReportChange ( IN PNOTIFY_SYNC NotifySync, IN PLIST_ENTRY NotifyList, - IN PSTRING FullTargetName, + IN PSTRING FullTargetName, /* can include short names! */ IN USHORT TargetNameOffset, /* in bytes */ IN PSTRING StreamName OPTIONAL, - IN PSTRING NormalizedParentName OPTIONAL, + IN PSTRING NormalizedParentName OPTIONAL, /* same as FullTargetName, but with long names */ IN ULONG FilterMatch, IN ULONG Action, IN PVOID TargetContext ) { - UNICODE_STRING FullDirName; - UNICODE_STRING TargetName; + USHORT FullDirLen; + STRING RelativeName; PLIST_ENTRY EnumEntry; PNOTIFY_ENTRY NotifyEntry; - PBUFFERED_CHANGE BufferedChange; PIRP Irp; LIST_ENTRY CompletedListHead; + USHORT NameLenU; + ULONG RecordLen; + PFILE_NOTIFY_INFORMATION CurrentEntry; InitializeListHead(&CompletedListHead); + + DPRINT("FullTargetName: %wZ\n", FullTargetName); + + /* + I think FullTargetName can include/be a short file name! What the heck do i do with this? + Dont think this apply to FsRtlNotifyFullChangeDirectory's FullDirectoryName. + */ - FullDirName.Buffer = (WCHAR*)FullTargetName->Buffer; - FullDirName.MaximumLength = FullDirName.Length = TargetNameOffset - sizeof(WCHAR); + - TargetName.Buffer = (WCHAR*)(FullTargetName->Buffer + TargetNameOffset); - TargetName.MaximumLength = TargetName.Length = FullTargetName->Length - TargetNameOffset; - ExAcquireFastMutex((PFAST_MUTEX)NotifySync); LIST_FOR_EACH_SAFE(EnumEntry, NotifyList, NotifyEntry, NOTIFY_ENTRY, ListEntry ) { + ASSERT(NotifyEntry->Unicode == FsRtlpIsUnicodePath(FullTargetName)); + /* rule out some easy cases */ /* FIXME: short vs. long names??? */ - if (FilterMatch != NotifyEntry->CompletionFilter) continue; + if (!(FilterMatch & NotifyEntry->CompletionFilter)) continue; - if (FullDirName.Length < NotifyEntry->FullDirectoryName->Length) continue; + FullDirLen = TargetNameOffset - (NotifyEntry->Unicode?sizeof(WCHAR):sizeof(char)); - if (!NotifyEntry->WatchTree && FullDirName.Length != NotifyEntry->FullDirectoryName->Length) continue; + + if (FullDirLen < NotifyEntry->FullDirectoryName->Length) continue; + + if (!NotifyEntry->WatchTree && FullDirLen != NotifyEntry->FullDirectoryName->Length) continue; - if (wcsncmp((WCHAR*)NotifyEntry->FullDirectoryName->Buffer, - FullDirName.Buffer, - NotifyEntry->FullDirectoryName->Length/sizeof(WCHAR)) != 0) continue; + DPRINT("NotifyEntry->FullDirectoryName: %wZ\n", NotifyEntry->FullDirectoryName); + if (memcmp(NotifyEntry->FullDirectoryName->Buffer, + FullTargetName->Buffer, + NotifyEntry->FullDirectoryName->Length) != 0) continue; + + + if (NotifyEntry->WatchTree && + NotifyEntry->TraverseCallback && + FullDirLen != NotifyEntry->FullDirectoryName->Length) + { + /* change happend in a subdir. ask caller if we are allowed in here */ + NTSTATUS Status = NotifyEntry->TraverseCallback(NotifyEntry->FsContext, + TargetContext, + NotifyEntry->SubjectContext); + + if (!NT_SUCCESS(Status)) continue; + + /* + FIXME: notify-dir impl. should release and free the SubjectContext + */ + } + + DPRINT("Found match\n"); + /* Found a valid change */ + + RelativeName.Buffer = FullTargetName->Buffer + TargetNameOffset; + RelativeName.MaximumLength = + RelativeName.Length = + FullTargetName->Length - TargetNameOffset; + DPRINT("RelativeName: %wZ\n",&RelativeName); + + /* calculate unicode bytes of relative-name + stream-name */ + if (NotifyEntry->Unicode) + { + NameLenU = RelativeName.Length + (StreamName ? (StreamName->Length + sizeof(WCHAR)) : 0); + } + else + { + NameLenU = RelativeName.Length * sizeof(WCHAR) + + (StreamName ? ((StreamName->Length * sizeof(WCHAR)) + sizeof(WCHAR)) : 0); + } + + RecordLen = FIELD_OFFSET(FILE_NOTIFY_INFORMATION, Name) + NameLenU; + if ((Irp = FsRtlpGetNextIrp(NotifyEntry))) { - //FIXME: copy data to user + PIO_STACK_LOCATION IrpStack; + ULONG IrpBuffLen; - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; + IrpStack = IoGetCurrentIrpStackLocation(Irp); + IrpBuffLen = IrpStack->Parameters.NotifyDirectory.Length; + DPRINT("Got pending irp\n"); + + ASSERT(!NotifyEntry->PendingChanges); + + if (NotifyEntry->Buffer == NULL || /* aka. IgnoreBuffer */ + RecordLen > IrpBuffLen) + { + /* ignore buffer / buffer not large enough */ + Irp->IoStatus.Status = STATUS_NOTIFY_ENUM_DIR; + Irp->IoStatus.Information = 0; + } + else + { + //FIXME: copy data to user correctly + CurrentEntry = (PFILE_NOTIFY_INFORMATION)Irp->UserBuffer; + + CurrentEntry->Action = Action; + CurrentEntry->NameLength = NameLenU; + CurrentEntry->NextEntryOffset = 0; + + FsRtlpCopyName( + CurrentEntry, + NotifyEntry->Unicode, + &RelativeName, + StreamName + ); + + Irp->IoStatus.Status = STATUS_SUCCESS; + Irp->IoStatus.Information = RecordLen; + } + /* avoid holding lock while completing irp */ InsertTailList(&CompletedListHead, &Irp->Tail.Overlay.ListEntry); } else { - /* No irp in queue. Buffer changes */ - /* FIXME: how much stuff should we buffer? - -Should we alloc with quotas? - -Should we use a hardcoded limit? - -Should we use a time-out? (drop changes if they are not retrieved in x seconds? - */ - BufferedChange = ExAllocatePool(PagedPool, FIELD_OFFSET(BUFFERED_CHANGE, RelativeName) + TargetName.Length); + DPRINT("No irp\n"); - BufferedChange->Action = Action; - BufferedChange->NameLen = TargetName.Length; - memcpy(BufferedChange->RelativeName, TargetName.Buffer, TargetName.Length); + NotifyEntry->PendingChanges = TRUE; + + if (NotifyEntry->Buffer == NULL || NotifyEntry->BufferExhausted) continue; - InsertTailList(&NotifyEntry->BufferedChangesList, &BufferedChange->ListEntry); + if (RecordLen > NotifyEntry->BufferSize - NotifyEntry->NextEntryOffset) + { + /* overflow. drop these changes and stop buffering any other changes too */ + NotifyEntry->BufferExhausted = TRUE; + continue; + } + + /* The buffer has enough room for the changes. + * Copy data to buffer. + */ + + CurrentEntry = (PFILE_NOTIFY_INFORMATION)NotifyEntry->Buffer; + + CurrentEntry->Action = Action; + CurrentEntry->NameLength = NameLenU; + CurrentEntry->NextEntryOffset = 0; + + FsRtlpCopyName(CurrentEntry, + NotifyEntry->Unicode, + &RelativeName, + StreamName + ); + + /* adjust buffer */ + NotifyEntry->PrevEntry->NextEntryOffset = (char*)CurrentEntry - (char*)NotifyEntry->PrevEntry; + NotifyEntry->PrevEntry = CurrentEntry; + NotifyEntry->NextEntryOffset += RecordLen; + + +// { +// UNICODE_STRING TmpStr; +// TmpStr.Buffer = BufferedChange->RelativeName; +// TmpStr.MaximumLength = TmpStr.Length = BufferedChange->NameLen; +// DPRINT("BufferedChange->RelativeName: %wZ\n", &TmpStr); +// } + + } } @@ -677,7 +852,7 @@ IN PNOTIFY_SYNC *NotifySync ) { - *NotifySync = ExAllocatePoolWithTag(NonPagedPool, sizeof(FAST_MUTEX), 0/*FSRTL_NOTIFY_TAG*/ ); + *NotifySync = ExAllocatePoolWithTag(NonPagedPool, sizeof(FAST_MUTEX), FSRTL_NOTIFY_TAG ); ExInitializeFastMutex((PFAST_MUTEX)*NotifySync); } _____ Modified: trunk/reactos/ntoskrnl/include/internal/ifs.h --- trunk/reactos/ntoskrnl/include/internal/ifs.h 2005-03-01 13:53:32 UTC (rev 13789) +++ trunk/reactos/ntoskrnl/include/internal/ifs.h 2005-03-01 22:13:40 UTC (rev 13790) @@ -8,6 +8,11 @@ /* Look for "FSrt" in mem view */ #define IFS_POOL_TAG 0x74725346 +VOID +STDCALL INIT_FUNCTION +FsRtlpInitNotifyImplementation(VOID); + + VOID STDCALL FsRtlpInitFileLockingImplementation(VOID);
19 years, 9 months
1
0
0
0
[gdalsnes] 13789: remove local EOF define
by gdalsnes@svn.reactos.com
remove local EOF define Modified: trunk/reactos/lib/crt/conio/ungetch.c _____ Modified: trunk/reactos/lib/crt/conio/ungetch.c --- trunk/reactos/lib/crt/conio/ungetch.c 2005-03-01 06:34:16 UTC (rev 13788) +++ trunk/reactos/lib/crt/conio/ungetch.c 2005-03-01 13:53:32 UTC (rev 13789) @@ -10,11 +10,12 @@ * 28/12/98: Created */ +#include <stdio.h> #include <conio.h> #include <internal/console.h> -#define EOF -1 + int char_avail = 0; int ungot_char = 0;
19 years, 9 months
1
0
0
0
[jimtabor] 13788: Dereference process object.
by jimtabor@svn.reactos.com
Dereference process object. Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c _____ Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c --- trunk/reactos/ntoskrnl/ex/sysinfo.c 2005-03-01 02:32:09 UTC (rev 13787) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c 2005-03-01 06:34:16 UTC (rev 13788) @@ -854,8 +854,12 @@ if (curSize > Size) { + DPRINT1("SystemHandleInformation 2\n"); *ReqSize = curSize; - DPRINT1("SystemHandleInformation 2\n"); + if (pr != NULL) + { + ObDereferenceObject(pr); + } return (STATUS_INFO_LENGTH_MISMATCH); }
19 years, 9 months
1
0
0
0
[jimtabor] 13787: Partial implementation of SystemHandleInformation and ObpGetNextHandleByProcessCount (Name will change very soon). Fix GetHandleCountByHandleTable return real number of open handles.
by jimtabor@svn.reactos.com
Partial implementation of SystemHandleInformation and ObpGetNextHandleByProcessCount (Name will change very soon). Fix GetHandleCountByHandleTable return real number of open handles. Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c Modified: trunk/reactos/ntoskrnl/ob/handle.c _____ Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c --- trunk/reactos/ntoskrnl/ex/sysinfo.c 2005-02-28 22:03:10 UTC (rev 13786) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c 2005-03-01 02:32:09 UTC (rev 13787) @@ -811,13 +811,107 @@ return (STATUS_NOT_IMPLEMENTED); } + +VOID +ObpGetNextHandleByProcessCount(PSYSTEM_HANDLE_TABLE_ENTRY_INFO pshi, + PEPROCESS Process, + int Count); + /* Class 16 - Handle Information */ QSI_DEF(SystemHandleInformation) { - /* FIXME */ - DPRINT1("NtQuerySystemInformation - SystemHandleInformation not implemented\n"); - return (STATUS_NOT_IMPLEMENTED); + + PSYSTEM_HANDLE_INFORMATION Shi = + (PSYSTEM_HANDLE_INFORMATION) Buffer; + + DPRINT("NtQuerySystemInformation - SystemHandleInformation\n"); + + if (Size < sizeof (SYSTEM_HANDLE_INFORMATION)) + { + * ReqSize = sizeof (SYSTEM_HANDLE_INFORMATION); + return (STATUS_INFO_LENGTH_MISMATCH); + } + + DPRINT("SystemHandleInformation 1\n"); + + PEPROCESS pr, syspr; + int curSize, i = 0; + ULONG hCount = 0; + + /* First Calc Size from Count. */ + syspr = PsGetNextProcess(NULL); + pr = syspr; + + do + { + hCount = hCount + ObpGetHandleCountByHandleTable(&pr->HandleTable); + + curSize = sizeof(SYSTEM_HANDLE_INFORMATION)+ + ( (sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO) * hCount) - + (sizeof(SYSTEM_HANDLE_TABLE_ENTRY_INFO) )); + + Shi->NumberOfHandles = hCount; + + if (curSize > Size) + { + *ReqSize = curSize; + DPRINT1("SystemHandleInformation 2\n"); + return (STATUS_INFO_LENGTH_MISMATCH); + } + + pr = PsGetNextProcess(pr); + + if ((pr == syspr) || (pr == NULL)) + break; + } while ((pr != syspr) && (pr != NULL)); + + if (pr != NULL) + { + ObDereferenceObject(pr); + } + + DPRINT("SystemHandleInformation 3\n"); + + /* Now get Handles from all processs. */ + syspr = PsGetNextProcess(NULL); + pr = syspr; + + do + { + int Count = 0, HandleCount = 0; + + HandleCount = ObpGetHandleCountByHandleTable(&pr->HandleTable); + + for (Count = 0; HandleCount > 0 ; HandleCount--) + { + ObpGetNextHandleByProcessCount( &Shi->Handles[i], pr, Count); + Count++; + i++; + } + + pr = PsGetNextProcess(pr); + + if ((pr == syspr) || (pr == NULL)) + break; + } while ((pr != syspr) && (pr != NULL)); + + + if (pr != NULL) + { + ObDereferenceObject(pr); + } + + DPRINT("SystemHandleInformation 4\n"); + return (STATUS_SUCCESS); + } +/* +SSI_DEF(SystemHandleInformation) +{ + + return (STATUS_SUCCESS); +} +*/ /* Class 17 - Information */ QSI_DEF(SystemObjectInformation) _____ Modified: trunk/reactos/ntoskrnl/ob/handle.c --- trunk/reactos/ntoskrnl/ob/handle.c 2005-02-28 22:03:10 UTC (rev 13786) +++ trunk/reactos/ntoskrnl/ob/handle.c 2005-03-01 02:32:09 UTC (rev 13787) @@ -1014,8 +1014,9 @@ { Header = BODY_TO_HEADER(ObjectBody); - /* Make sure this is real. */ - if (Header->ObjectType != NULL) + /* Make sure this is real. Okay! For real!*/ + if ((Header->ObjectType != NULL) && + (Header->ObjectType->Close != NULL)) Count++; } } @@ -1078,4 +1079,31 @@ return STATUS_UNSUCCESSFUL; } +VOID +ObpGetNextHandleByProcessCount(PSYSTEM_HANDLE_TABLE_ENTRY_INFO pshi, + PEPROCESS Process, + int Count) +{ + ULONG P; + KIRQL oldIrql; + +// pshi->HandleValue; + + P = (ULONG) Process->UniqueProcessId; + pshi->UniqueProcessId = (USHORT) P; + + KeAcquireSpinLock( &Process->HandleTable.ListLock, &oldIrql ); + +// pshi->GrantedAccess; +// pshi->Object; +// pshi->ObjectTypeIndex; +// pshi->HandleAttributes; + + KeReleaseSpinLock( &Process->HandleTable.ListLock, oldIrql ); + + return; +} + + + /* EOF */
19 years, 9 months
1
0
0
0
← Newer
1
...
58
59
60
61
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
Results per page:
10
25
50
100
200