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
January 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
28 participants
703 discussions
Start a n
N
ew thread
[gvg] 13245: Sylvain Petreolle <spetreolle@yahoo.fr>:
by gvg@svn.reactos.com
Sylvain Petreolle <spetreolle(a)yahoo.fr>: Add makefile for "polytest" test & enable it. Fix compile warnings for diskspeed & zwcontinue tests Modified: trunk/rosapps/tests/Makefile Modified: trunk/rosapps/tests/diskspeed/diskspeed.c Added: trunk/rosapps/tests/polytest/Makefile Modified: trunk/rosapps/tests/zwcontinue/zwcontinue.c _____ Modified: trunk/rosapps/tests/Makefile --- trunk/rosapps/tests/Makefile 2005-01-24 09:31:42 UTC (rev 13244) +++ trunk/rosapps/tests/Makefile 2005-01-24 09:33:21 UTC (rev 13245) @@ -8,7 +8,6 @@ # Broken tests # dnsapi iptest lan regdump subclass -# polytest - Needs a mingw makefile TEST_APPS = \ accelerator \ @@ -66,6 +65,7 @@ p_dup_handle \ palbitblt \ patblt \ +polytest \ popupmenu \ primitives \ pteb \ _____ Modified: trunk/rosapps/tests/diskspeed/diskspeed.c --- trunk/rosapps/tests/diskspeed/diskspeed.c 2005-01-24 09:31:42 UTC (rev 13244) +++ trunk/rosapps/tests/diskspeed/diskspeed.c 2005-01-24 09:33:21 UTC (rev 13245) @@ -81,7 +81,7 @@ HANDLE hDevice; OVERLAPPED ov; - PBYTE Buffer; + PBYTE Buffer = NULL ; DWORD Start; DWORD dwReturned; DWORD dwReadTotal; _____ Added: trunk/rosapps/tests/polytest/Makefile --- trunk/rosapps/tests/polytest/Makefile 2005-01-24 09:31:42 UTC (rev 13244) +++ trunk/rosapps/tests/polytest/Makefile 2005-01-24 09:33:21 UTC (rev 13245) @@ -0,0 +1,22 @@ + +PATH_TO_TOP = ../../../reactos + +TARGET_NORC = yes + +TARGET_TYPE = program + +TARGET_APPTYPE = windows + +TARGET_NAME = polytest + +TARGET_SDKLIBS = kernel32.a gdi32.a + +TARGET_OBJECTS = polytest.o + +TARGET_CFLAGS = -Wall -Werror + +include $(PATH_TO_TOP)/rules.mak + +include $(TOOLS_PATH)/helper.mk + +# EOF _____ Modified: trunk/rosapps/tests/zwcontinue/zwcontinue.c --- trunk/rosapps/tests/zwcontinue/zwcontinue.c 2005-01-24 09:31:42 UTC (rev 13244) +++ trunk/rosapps/tests/zwcontinue/zwcontinue.c 2005-01-24 09:33:21 UTC (rev 13245) @@ -35,7 +35,7 @@ { unsigned char * b; size_t i; - int r; + int r = rand(); b = (unsigned char *)p;
19 years, 11 months
1
0
0
0
[gvg] 13244: Fix compilation
by gvg@svn.reactos.com
Fix compilation Modified: trunk/rosapps/tests/tokentest/tokentest.c _____ Modified: trunk/rosapps/tests/tokentest/tokentest.c --- trunk/rosapps/tests/tokentest/tokentest.c 2005-01-24 05:12:15 UTC (rev 13243) +++ trunk/rosapps/tests/tokentest/tokentest.c 2005-01-24 09:31:42 UTC (rev 13244) @@ -356,7 +356,11 @@ LARGE_INTEGER tkExpiration; +#if 0 /* FIXME */ LUID authId = SYSTEM_LUID; +#else + LUID authId = { 0x3E7, 0x0 }; +#endif TOKEN_SOURCE source = {
19 years, 11 months
1
0
0
0
[sedwards] 13243: Correct location of a few stubs. Getting ready to sync in a day or so.
by sedwards@svn.reactos.com
Correct location of a few stubs. Getting ready to sync in a day or so. Modified: trunk/reactos/lib/setupapi/devinst.c Modified: trunk/reactos/lib/setupapi/setupapi.spec _____ Modified: trunk/reactos/lib/setupapi/devinst.c --- trunk/reactos/lib/setupapi/devinst.c 2005-01-24 02:08:25 UTC (rev 13242) +++ trunk/reactos/lib/setupapi/devinst.c 2005-01-24 05:12:15 UTC (rev 13243) @@ -1104,3 +1104,32 @@ return hClassKey; } + + +/********************************************************************** * + * SetupDiOpenDeviceInterfaceA (SETUPAPI.@) + */ +BOOL WINAPI SetupDiOpenDeviceInterfaceW( + HDEVINFO DeviceInfoSet, + PCWSTR DevicePath, + DWORD OpenFlags, + PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData) +{ + FIXME("%p %s %08lx %p\n", + DeviceInfoSet, debugstr_w(DevicePath), OpenFlags, DeviceInterfaceData); + return FALSE; +} + +/********************************************************************** * + * SetupDiOpenDeviceInterfaceA (SETUPAPI.@) + */ +BOOL WINAPI SetupDiOpenDeviceInterfaceA( + HDEVINFO DeviceInfoSet, + PCSTR DevicePath, + DWORD OpenFlags, + PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData) +{ + FIXME("%p %s %08lx %p\n", DeviceInfoSet, + debugstr_a(DevicePath), OpenFlags, DeviceInterfaceData); + return FALSE; +} _____ Modified: trunk/reactos/lib/setupapi/setupapi.spec --- trunk/reactos/lib/setupapi/setupapi.spec 2005-01-24 02:08:25 UTC (rev 13242) +++ trunk/reactos/lib/setupapi/setupapi.spec 2005-01-24 05:12:15 UTC (rev 13243) @@ -258,9 +258,10 @@ @ stub SetupQueryFileLogW @ stub SetupQueryInfFileInformationA @ stub SetupQueryInfFileInformationW +@ stub SetupQueryInfOriginalFileInformationA +@ stub SetupQueryInfOriginalFileInformationW @ stub SetupQueryInfVersionInformationA @ stub SetupQueryInfVersionInformationW -@ stub SetupQueryInfOriginalFileInformationW @ stub SetupQuerySourceListA @ stub SetupQuerySourceListW @ stdcall SetupQuerySpaceRequiredOnDriveA(long str ptr ptr long)
19 years, 11 months
1
0
0
0
[ion] 13242: Proper support for vfatlib and allow -j2 to work (as long as make tools && make implib && make -j2 is used).
by ion@svn.reactos.com
Proper support for vfatlib and allow -j2 to work (as long as make tools && make implib && make -j2 is used). Modified: trunk/reactos/Makefile Added: trunk/reactos/lib/fslib/Makefile _____ Modified: trunk/reactos/Makefile --- trunk/reactos/Makefile 2005-01-24 00:44:21 UTC (rev 13241) +++ trunk/reactos/Makefile 2005-01-24 02:08:25 UTC (rev 13242) @@ -136,7 +136,7 @@ $(SUBSYS:%=%_depends) $(SYS_SVC:%=%_depends) \ $(EXT_MODULES:%=%_depends) $(POSIX_LIBS:%=%_depends) -implib: hallib $(LIB_STATIC) $(COMPONENTS:%=%_implib) $(HALS:%=%_implib) \ +implib: hallib $(LIB_STATIC) $(LIB_FSLIB) $(COMPONENTS:%=%_implib) $(HALS:%=%_implib) \ $(BUS:%=%_implib) $(LIB_STATIC:%=%_implib) $(LIB_FSLIB:%=%_implib) \ msvcrt_implib $(DLLS:%=%_implib) $(KERNEL_DRIVERS:%=%_implib) \ $(SUBSYS:%=%_implib) $(SYS_APPS:%=%_implib) $(SYS_SVC:%=%_implib) \ _____ Added: trunk/reactos/lib/fslib/Makefile --- trunk/reactos/lib/fslib/Makefile 2005-01-24 00:44:21 UTC (rev 13241) +++ trunk/reactos/lib/fslib/Makefile 2005-01-24 02:08:25 UTC (rev 13242) @@ -0,0 +1,48 @@ +# +# ReactOS Driver Support Libraries +# + +PATH_TO_TOP = ../.. + +include $(PATH_TO_TOP)/rules.mak + +FSLIBS = vfatlib + +all: $(FSLIBS) + +depends: + +implib: $(FSLIBS:%=%_implib) + +clean: $(FSLIBS:%=%_clean) + +install: $(FSLIBS:%=%_install) + +bootcd: $(FSLIBS:%=%_bootcd) + +.PHONY: all depends implib clean install bootcd + + +# +# FILE SYSTEM LIBRARIES +# +$(FSLIBS): %: + $(MAKE) -C $* + +$(FSLIBS:%=%_implib): %_implib: + $(MAKE) -C $* implib + +$(FSLIBS:%=%_clean): %_clean: + $(MAKE) -C $* clean + +$(FSLIBS:%=%_install): %_install: + $(MAKE) -C $* install + +$(FSLIBS:%=%_bootcd): %_bootcd: + $(MAKE) -C $* bootcd + +.PHONY: $(FSLIBS) $(FSLIBS:%=%_implib) $(FSLIBS:%=%_clean) $(FSLIBS:%=%_install) $(FSLIBS:%=%_bootcd) + +etags: + find . -name "*.[ch]" -print | etags --language=c - +# EOF
19 years, 11 months
1
0
0
0
[weiden] 13241: fixed prototype of ZwOpenSemaphore
by weiden@svn.reactos.com
fixed prototype of ZwOpenSemaphore Modified: trunk/reactos/include/ntos/zw.h _____ Modified: trunk/reactos/include/ntos/zw.h --- trunk/reactos/include/ntos/zw.h 2005-01-24 00:43:39 UTC (rev 13240) +++ trunk/reactos/include/ntos/zw.h 2005-01-24 00:44:21 UTC (rev 13241) @@ -2212,7 +2212,7 @@ NTSTATUS STDCALL ZwOpenSemaphore( - IN HANDLE SemaphoreHandle, + OUT PHANDLE SemaphoreHandle, IN ACCESS_MASK DesiredAcces, IN POBJECT_ATTRIBUTES ObjectAttributes );
19 years, 11 months
1
0
0
0
[weiden] 13240: minor fixes
by weiden@svn.reactos.com
minor fixes Modified: trunk/reactos/ntoskrnl/ex/time.c Modified: trunk/reactos/ntoskrnl/mm/pagefile.c _____ Modified: trunk/reactos/ntoskrnl/ex/time.c --- trunk/reactos/ntoskrnl/ex/time.c 2005-01-24 00:18:57 UTC (rev 13239) +++ trunk/reactos/ntoskrnl/ex/time.c 2005-01-24 00:43:39 UTC (rev 13240) @@ -180,6 +180,10 @@ return Status; } } + else + { + NewSystemTime = *SystemTime; + } if(!SeSinglePrivilegeCheck(SeSystemtimePrivilege, PreviousMode)) _____ Modified: trunk/reactos/ntoskrnl/mm/pagefile.c --- trunk/reactos/ntoskrnl/mm/pagefile.c 2005-01-24 00:18:57 UTC (rev 13239) +++ trunk/reactos/ntoskrnl/mm/pagefile.c 2005-01-24 00:43:39 UTC (rev 13240) @@ -739,9 +739,9 @@ } NTSTATUS STDCALL -NtCreatePagingFile(IN PUNICODE_STRING FileNameUnsafe, - IN PLARGE_INTEGER InitialSizeUnsafe, - IN PLARGE_INTEGER MaximumSizeUnsafe, +NtCreatePagingFile(IN PUNICODE_STRING FileName, + IN PLARGE_INTEGER InitialSize, + IN PLARGE_INTEGER MaximumSize, IN ULONG Reserved) { NTSTATUS Status; @@ -763,8 +763,8 @@ ULONG Count; ULONG Size; KPROCESSOR_MODE PreviousMode; - UNICODE_STRING FileName; - LARGE_INTEGER InitialSize, MaximumSize; + UNICODE_STRING CapturedFileName; + LARGE_INTEGER SafeInitialSize, SafeMaximumSize; DPRINT("NtCreatePagingFile(FileName %wZ, InitialSize %I64d)\n", FileName, InitialSize->QuadPart); @@ -775,11 +775,11 @@ } PreviousMode = ExGetPreviousMode(); - Status = RtlCaptureUnicodeString(&FileName, + Status = RtlCaptureUnicodeString(&CapturedFileName, PreviousMode, PagedPool, FALSE, - FileNameUnsafe); + FileName); if (!NT_SUCCESS(Status)) { return(Status); @@ -788,14 +788,14 @@ { _SEH_TRY { - ProbeForRead(InitialSizeUnsafe, + ProbeForRead(InitialSize, sizeof(LARGE_INTEGER), sizeof(ULONG)); - InitialSize = *InitialSizeUnsafe; - ProbeForRead(MaximumSizeUnsafe, + SafeInitialSize = *InitialSize; + ProbeForRead(MaximumSize, sizeof(LARGE_INTEGER), sizeof(ULONG)); - MaximumSize = *MaximumSizeUnsafe; + SafeMaximumSize = *MaximumSize; } _SEH_HANDLE { @@ -810,12 +810,12 @@ } else { - InitialSize = *InitialSizeUnsafe; - MaximumSize = *MaximumSizeUnsafe; + SafeInitialSize = *InitialSize; + SafeMaximumSize = *MaximumSize; } InitializeObjectAttributes(&ObjectAttributes, - &FileName, + &CapturedFileName, 0, NULL, NULL); @@ -834,7 +834,7 @@ CreateFileTypeNone, NULL, SL_OPEN_PAGING_FILE); - RtlReleaseCapturedUnicodeString(&FileName, + RtlReleaseCapturedUnicodeString(&CapturedFileName, PreviousMode, FALSE); if (!NT_SUCCESS(Status)) @@ -862,7 +862,7 @@ Status = ZwSetInformationFile(FileHandle, &IoStatus, - &InitialSize, + &SafeInitialSize, sizeof(LARGE_INTEGER), FileAllocationInformation); if (!NT_SUCCESS(Status)) @@ -874,7 +874,7 @@ Status = ObReferenceObjectByHandle(FileHandle, FILE_ALL_ACCESS, IoFileObjectType, - UserMode, + PreviousMode, (PVOID*)&FileObject, NULL); if (!NT_SUCCESS(Status)) @@ -900,7 +900,7 @@ #endif ExtentCount = 0; - MaxVcn = (ULONG)((InitialSize.QuadPart + BytesPerAllocationUnit - 1) / BytesPerAllocationUnit); + MaxVcn = (ULONG)((SafeInitialSize.QuadPart + BytesPerAllocationUnit - 1) / BytesPerAllocationUnit); while(1) { Status = ZwFsControlFile(FileHandle, @@ -967,9 +967,9 @@ RtlZeroMemory(PagingFile, sizeof(*PagingFile)); PagingFile->FileObject = FileObject; - PagingFile->MaximumSize.QuadPart = MaximumSize.QuadPart; - PagingFile->CurrentSize.QuadPart = InitialSize.QuadPart; - PagingFile->FreePages = (ULONG)(InitialSize.QuadPart / PAGE_SIZE); + PagingFile->MaximumSize.QuadPart = SafeMaximumSize.QuadPart; + PagingFile->CurrentSize.QuadPart = SafeInitialSize.QuadPart; + PagingFile->FreePages = (ULONG)(SafeInitialSize.QuadPart / PAGE_SIZE); PagingFile->UsedPages = 0; KeInitializeSpinLock(&PagingFile->AllocMapLock);
19 years, 11 months
1
0
0
0
[gvg] 13239: Nt -> Zw
by gvg@svn.reactos.com
Nt -> Zw Modified: trunk/reactos/ntoskrnl/mm/pagefile.c _____ Modified: trunk/reactos/ntoskrnl/mm/pagefile.c --- trunk/reactos/ntoskrnl/mm/pagefile.c 2005-01-24 00:15:29 UTC (rev 13238) +++ trunk/reactos/ntoskrnl/mm/pagefile.c 2005-01-24 00:18:57 UTC (rev 13239) @@ -739,9 +739,9 @@ } NTSTATUS STDCALL -NtCreatePagingFile(IN PUNICODE_STRING FileName, - IN PLARGE_INTEGER InitialSize, - IN PLARGE_INTEGER MaximumSize, +NtCreatePagingFile(IN PUNICODE_STRING FileNameUnsafe, + IN PLARGE_INTEGER InitialSizeUnsafe, + IN PLARGE_INTEGER MaximumSizeUnsafe, IN ULONG Reserved) { NTSTATUS Status; @@ -762,6 +762,9 @@ ULONG MaxVcn; ULONG Count; ULONG Size; + KPROCESSOR_MODE PreviousMode; + UNICODE_STRING FileName; + LARGE_INTEGER InitialSize, MaximumSize; DPRINT("NtCreatePagingFile(FileName %wZ, InitialSize %I64d)\n", FileName, InitialSize->QuadPart); @@ -771,8 +774,48 @@ return(STATUS_TOO_MANY_PAGING_FILES); } + PreviousMode = ExGetPreviousMode(); + Status = RtlCaptureUnicodeString(&FileName, + PreviousMode, + PagedPool, + FALSE, + FileNameUnsafe); + if (!NT_SUCCESS(Status)) + { + return(Status); + } + if (PreviousMode == UserMode) + { + _SEH_TRY + { + ProbeForRead(InitialSizeUnsafe, + sizeof(LARGE_INTEGER), + sizeof(ULONG)); + InitialSize = *InitialSizeUnsafe; + ProbeForRead(MaximumSizeUnsafe, + sizeof(LARGE_INTEGER), + sizeof(ULONG)); + MaximumSize = *MaximumSizeUnsafe; + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + + if (!NT_SUCCESS(Status)) + { + return Status; + } + } + else + { + InitialSize = *InitialSizeUnsafe; + MaximumSize = *MaximumSizeUnsafe; + } + InitializeObjectAttributes(&ObjectAttributes, - FileName, + &FileName, 0, NULL, NULL); @@ -791,37 +834,40 @@ CreateFileTypeNone, NULL, SL_OPEN_PAGING_FILE); + RtlReleaseCapturedUnicodeString(&FileName, + PreviousMode, + FALSE); if (!NT_SUCCESS(Status)) { return(Status); } - Status = NtQueryVolumeInformationFile(FileHandle, + Status = ZwQueryVolumeInformationFile(FileHandle, &IoStatus, &FsSizeInformation, sizeof(FILE_FS_SIZE_INFORMATION), FileFsSizeInformation); if (!NT_SUCCESS(Status)) { - NtClose(FileHandle); + ZwClose(FileHandle); return Status; } BytesPerAllocationUnit = FsSizeInformation.SectorsPerAllocationUnit * FsSizeInformation.BytesPerSector; if (BytesPerAllocationUnit % PAGE_SIZE) { - NtClose(FileHandle); + ZwClose(FileHandle); return STATUS_UNSUCCESSFUL; } - Status = NtSetInformationFile(FileHandle, + Status = ZwSetInformationFile(FileHandle, &IoStatus, - InitialSize, + &InitialSize, sizeof(LARGE_INTEGER), FileAllocationInformation); if (!NT_SUCCESS(Status)) { - NtClose(FileHandle); + ZwClose(FileHandle); return(Status); } @@ -833,7 +879,7 @@ NULL); if (!NT_SUCCESS(Status)) { - NtClose(FileHandle); + ZwClose(FileHandle); return(Status); } @@ -842,7 +888,7 @@ if (CurrentRetDescList == NULL) { ObDereferenceObject(FileObject); - NtClose(FileHandle); + ZwClose(FileHandle); return(STATUS_NO_MEMORY); } @@ -854,10 +900,10 @@ #endif ExtentCount = 0; - MaxVcn = (ULONG)((InitialSize->QuadPart + BytesPerAllocationUnit - 1) / BytesPerAllocationUnit); + MaxVcn = (ULONG)((InitialSize.QuadPart + BytesPerAllocationUnit - 1) / BytesPerAllocationUnit); while(1) { - Status = NtFsControlFile(FileHandle, + Status = ZwFsControlFile(FileHandle, 0, NULL, NULL, @@ -876,7 +922,7 @@ ExFreePool(CurrentRetDescList); } ObDereferenceObject(FileObject); - NtClose(FileHandle); + ZwClose(FileHandle); return(Status); } ExtentCount += CurrentRetDescList->RetrievalPointers.NumberOfPairs; @@ -892,7 +938,7 @@ ExFreePool(CurrentRetDescList); } ObDereferenceObject(FileObject); - NtClose(FileHandle); + ZwClose(FileHandle); return(STATUS_NO_MEMORY); } Vcn.QuadPart = CurrentRetDescList->RetrievalPointers.Pair[CurrentRetDescList->Retrieval Pointers.NumberOfPairs-1].Vcn; @@ -914,16 +960,16 @@ ExFreePool(CurrentRetDescList); } ObDereferenceObject(FileObject); - NtClose(FileHandle); + ZwClose(FileHandle); return(STATUS_NO_MEMORY); } RtlZeroMemory(PagingFile, sizeof(*PagingFile)); PagingFile->FileObject = FileObject; - PagingFile->MaximumSize.QuadPart = MaximumSize->QuadPart; - PagingFile->CurrentSize.QuadPart = InitialSize->QuadPart; - PagingFile->FreePages = (ULONG)(InitialSize->QuadPart / PAGE_SIZE); + PagingFile->MaximumSize.QuadPart = MaximumSize.QuadPart; + PagingFile->CurrentSize.QuadPart = InitialSize.QuadPart; + PagingFile->FreePages = (ULONG)(InitialSize.QuadPart / PAGE_SIZE); PagingFile->UsedPages = 0; KeInitializeSpinLock(&PagingFile->AllocMapLock); @@ -959,7 +1005,7 @@ ExFreePool(PagingFile->AllocMap); ExFreePool(PagingFile); ObDereferenceObject(FileObject); - NtClose(FileHandle); + ZwClose(FileHandle); return(STATUS_NO_MEMORY); } @@ -988,7 +1034,7 @@ ExFreePool(PagingFile->AllocMap); ExFreePool(PagingFile); ObDereferenceObject(FileObject); - NtClose(FileHandle); + ZwClose(FileHandle); return(STATUS_UNSUCCESSFUL); } @@ -1022,7 +1068,7 @@ { MmInitializeCrashDump(FileHandle, i); } - NtClose(FileHandle); + ZwClose(FileHandle); MmSwapSpaceMessage = FALSE;
19 years, 11 months
1
0
0
0
[gvg] 13238: Make memory layout of GET_RETRIEVAL_DESCRIPTOR match RETRIEVAL_POINTERS_BUFFER
by gvg@svn.reactos.com
Make memory layout of GET_RETRIEVAL_DESCRIPTOR match RETRIEVAL_POINTERS_BUFFER Modified: trunk/reactos/include/ntos/zwtypes.h _____ Modified: trunk/reactos/include/ntos/zwtypes.h --- trunk/reactos/include/ntos/zwtypes.h 2005-01-24 00:09:04 UTC (rev 13237) +++ trunk/reactos/include/ntos/zwtypes.h 2005-01-24 00:15:29 UTC (rev 13238) @@ -1117,12 +1117,15 @@ ULONGLONG Lcn; } MAPPING_PAIR, *PMAPPING_PAIR; +/* Must match RETRIEVAL_POINTERS_BUFFER (ntifs.h) */ +#include <pshpack4.h> typedef struct _GET_RETRIEVAL_DESCRIPTOR { ULONG NumberOfPairs; ULONGLONG StartVcn; MAPPING_PAIR Pair[0]; // variable size } GET_RETRIEVAL_DESCRIPTOR, *PGET_RETRIEVAL_DESCRIPTOR; +#include <poppack.h> typedef struct _MOVEFILE_DESCRIPTOR {
19 years, 11 months
1
0
0
0
[weiden] 13237: don't copy the entire security descriptor to the stack in SeCaptureSecurityDescriptor() when previous mode is kernel mode and capturing for kernel mode is undesired
by weiden@svn.reactos.com
don't copy the entire security descriptor to the stack in SeCaptureSecurityDescriptor() when previous mode is kernel mode and capturing for kernel mode is undesired Modified: trunk/reactos/ntoskrnl/se/sd.c _____ Modified: trunk/reactos/ntoskrnl/se/sd.c --- trunk/reactos/ntoskrnl/se/sd.c 2005-01-23 23:51:40 UTC (rev 13236) +++ trunk/reactos/ntoskrnl/se/sd.c 2005-01-24 00:09:04 UTC (rev 13237) @@ -154,18 +154,22 @@ return Status; } } + else if(!CaptureIfKernel) + { + if(OriginalSecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1) + { + return STATUS_UNKNOWN_REVISION; + } + + *CapturedSecurityDescriptor = OriginalSecurityDescriptor; + return STATUS_SUCCESS; + } else { /* make a copy on the stack */ DescriptorCopy = *OriginalSecurityDescriptor; } - if(CurrentMode == KernelMode && !CaptureIfKernel) - { - *CapturedSecurityDescriptor = OriginalSecurityDescriptor; - return STATUS_SUCCESS; - } - if(DescriptorCopy.Revision != SECURITY_DESCRIPTOR_REVISION1) { return STATUS_UNKNOWN_REVISION;
19 years, 11 months
1
0
0
0
[weiden] 13236: 1. fixed the timer functions to securely access buffers
by weiden@svn.reactos.com
1. fixed the timer functions to securely access buffers 2. minor fixes due to copy+paste Modified: trunk/reactos/ntoskrnl/ex/sem.c Modified: trunk/reactos/ntoskrnl/ex/timer.c _____ Modified: trunk/reactos/ntoskrnl/ex/sem.c --- trunk/reactos/ntoskrnl/ex/sem.c 2005-01-23 23:02:19 UTC (rev 13235) +++ trunk/reactos/ntoskrnl/ex/sem.c 2005-01-23 23:51:40 UTC (rev 13236) @@ -240,12 +240,12 @@ &Status); if(!NT_SUCCESS(Status)) { - DPRINT1("NtQueryEvent() failed, Status: 0x%x\n", Status); + DPRINT1("NtQuerySemaphore() failed, Status: 0x%x\n", Status); return Status; } Status = ObReferenceObjectByHandle(SemaphoreHandle, - EVENT_QUERY_STATE, + SEMAPHORE_QUERY_STATE, ExSemaphoreObjectType, PreviousMode, (PVOID*)&Semaphore, _____ Modified: trunk/reactos/ntoskrnl/ex/timer.c --- trunk/reactos/ntoskrnl/ex/timer.c 2005-01-23 23:02:19 UTC (rev 13235) +++ trunk/reactos/ntoskrnl/ex/timer.c 2005-01-23 23:51:40 UTC (rev 13236) @@ -36,6 +36,10 @@ STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE, TIMER_ALL_ACCESS}; +static const INFORMATION_CLASS_INFO ExTimerInfoClass[] = +{ + ICI_SQ_SAME( sizeof(TIMER_BASIC_INFORMATION), sizeof(ULONG), ICIF_QUERY ), /* TimerBasicInformation */ +}; /* FUNCTIONS *****************************************************************/ @@ -146,36 +150,67 @@ OUT PBOOLEAN CurrentState OPTIONAL) { PNTTIMER Timer; - NTSTATUS Status; - BOOLEAN State; - KIRQL OldIrql; + KPROCESSOR_MODE PreviousMode; + NTSTATUS Status = STATUS_SUCCESS; + + PreviousMode = ExGetPreviousMode(); + + DPRINT("NtCancelTimer(0x%x, 0x%x)\n", TimerHandle, CurrentState); + + if(CurrentState != NULL && PreviousMode != KernelMode) + { + _SEH_TRY + { + ProbeForWrite(CurrentState, + sizeof(BOOLEAN), + sizeof(BOOLEAN)); + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + + if(!NT_SUCCESS(Status)) + { + return Status; + } + } - DPRINT("NtCancelTimer()\n"); Status = ObReferenceObjectByHandle(TimerHandle, TIMER_ALL_ACCESS, ExTimerType, - UserMode, + PreviousMode, (PVOID*)&Timer, NULL); - if (!NT_SUCCESS(Status)) - return Status; + if(NT_SUCCESS(Status)) + { + BOOLEAN State; + KIRQL OldIrql = KeRaiseIrqlToDpcLevel(); - OldIrql = KeRaiseIrqlToDpcLevel(); + State = KeCancelTimer(&Timer->Timer); + KeRemoveQueueDpc(&Timer->Dpc); + KeRemoveQueueApc(&Timer->Apc); + Timer->Running = FALSE; - State = KeCancelTimer(&Timer->Timer); - KeRemoveQueueDpc(&Timer->Dpc); - KeRemoveQueueApc(&Timer->Apc); - Timer->Running = FALSE; + KeLowerIrql(OldIrql); + ObDereferenceObject(Timer); - KeLowerIrql(OldIrql); - ObDereferenceObject(Timer); - - if (CurrentState != NULL) + if(CurrentState != NULL) { - *CurrentState = State; + _SEH_TRY + { + *CurrentState = State; + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; } + } - return STATUS_SUCCESS; + return Status; } @@ -186,39 +221,76 @@ IN TIMER_TYPE TimerType) { PNTTIMER Timer; - NTSTATUS Status; + HANDLE hTimer; + KPROCESSOR_MODE PreviousMode; + NTSTATUS Status = STATUS_SUCCESS; + + DPRINT("NtCreateTimer()\n"); + + PreviousMode = ExGetPreviousMode(); + + if(PreviousMode != KernelMode) + { + _SEH_TRY + { + ProbeForWrite(TimerHandle, + sizeof(HANDLE), + sizeof(ULONG)); + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; - DPRINT("NtCreateTimer()\n"); - Status = ObCreateObject(ExGetPreviousMode(), + if(!NT_SUCCESS(Status)) + { + return Status; + } + } + + Status = ObCreateObject(PreviousMode, ExTimerType, ObjectAttributes, - ExGetPreviousMode(), + PreviousMode, NULL, sizeof(NTTIMER), 0, 0, (PVOID*)&Timer); - if (!NT_SUCCESS(Status)) - return Status; + if(NT_SUCCESS(Status)) + { + KeInitializeTimerEx(&Timer->Timer, + TimerType); - KeInitializeTimerEx(&Timer->Timer, - TimerType); + KeInitializeDpc(&Timer->Dpc, + &ExpTimerDpcRoutine, + Timer); - KeInitializeDpc(&Timer->Dpc, - &ExpTimerDpcRoutine, - Timer); + Timer->Running = FALSE; - Timer->Running = FALSE; + Status = ObInsertObject ((PVOID)Timer, + NULL, + DesiredAccess, + 0, + NULL, + &hTimer); + ObDereferenceObject(Timer); + + if(NT_SUCCESS(Status)) + { + _SEH_TRY + { + *TimerHandle = hTimer; + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + } + } - Status = ObInsertObject ((PVOID)Timer, - NULL, - DesiredAccess, - 0, - NULL, - TimerHandle); - - ObDereferenceObject(Timer); - return Status; } @@ -228,15 +300,54 @@ IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes) { - NTSTATUS Status; + HANDLE hTimer; + KPROCESSOR_MODE PreviousMode; + NTSTATUS Status = STATUS_SUCCESS; + DPRINT("NtOpenTimer()\n"); + + PreviousMode = ExGetPreviousMode(); + + if(PreviousMode != KernelMode) + { + _SEH_TRY + { + ProbeForWrite(TimerHandle, + sizeof(HANDLE), + sizeof(ULONG)); + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + + if(!NT_SUCCESS(Status)) + { + return Status; + } + } + Status = ObOpenObjectByName(ObjectAttributes, ExTimerType, NULL, - UserMode, + PreviousMode, DesiredAccess, NULL, - TimerHandle); + &hTimer); + if(NT_SUCCESS(Status)) + { + _SEH_TRY + { + *TimerHandle = hTimer; + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + } + return Status; } @@ -248,58 +359,67 @@ IN ULONG TimerInformationLength, OUT PULONG ReturnLength OPTIONAL) { - PNTTIMER Timer; - TIMER_BASIC_INFORMATION SafeTimerInformation; - ULONG ResultLength; - NTSTATUS Status; + PNTTIMER Timer; + KPROCESSOR_MODE PreviousMode; + NTSTATUS Status = STATUS_SUCCESS; - Status = ObReferenceObjectByHandle(TimerHandle, - TIMER_QUERY_STATE, - ExTimerType, - (KPROCESSOR_MODE)KeGetPreviousMode(), - (PVOID*)&Timer, - NULL); - if (!NT_SUCCESS(Status)) - { - return(Status); - } + PreviousMode = ExGetPreviousMode(); - if (TimerInformationClass != TimerBasicInformation) - { - ObDereferenceObject(Timer); - return(STATUS_INVALID_INFO_CLASS); - } - if (TimerInformationLength < sizeof(TIMER_BASIC_INFORMATION)) - { - ObDereferenceObject(Timer); - return(STATUS_INFO_LENGTH_MISMATCH); - } + DefaultQueryInfoBufferCheck(TimerInformationClass, + ExTimerInfoClass, + TimerInformation, + TimerInformationLength, + ReturnLength, + PreviousMode, + &Status); + if(!NT_SUCCESS(Status)) + { + DPRINT1("NtQueryTimer() failed, Status: 0x%x\n", Status); + return Status; + } - memcpy(&SafeTimerInformation.TimeRemaining, &Timer->Timer.DueTime, - sizeof(LARGE_INTEGER)); - SafeTimerInformation.SignalState = (BOOLEAN)Timer->Timer.Header.SignalState; - ResultLength = sizeof(TIMER_BASIC_INFORMATION); + Status = ObReferenceObjectByHandle(TimerHandle, + TIMER_QUERY_STATE, + ExTimerType, + PreviousMode, + (PVOID*)&Timer, + NULL); + if(NT_SUCCESS(Status)) + { + switch(TimerInformationClass) + { + case TimerBasicInformation: + { + PTIMER_BASIC_INFORMATION BasicInfo = (PTIMER_BASIC_INFORMATION)TimerInformation; - Status = MmCopyToCaller(TimerInformation, &SafeTimerInformation, - sizeof(TIMER_BASIC_INFORMATION)); - if (!NT_SUCCESS(Status)) - { - ObDereferenceObject(Timer); - return(Status); - } + _SEH_TRY + { + /* FIXME - interrupt correction */ + BasicInfo->TimeRemaining.QuadPart = Timer->Timer.DueTime.QuadPart; + BasicInfo->SignalState = (BOOLEAN)Timer->Timer.Header.SignalState; - if (ReturnLength != NULL) - { - Status = MmCopyToCaller(ReturnLength, &ResultLength, - sizeof(ULONG)); - if (!NT_SUCCESS(Status)) - { - ObDereferenceObject(Timer); - return(Status); - } - } - ObDereferenceObject(Timer); - return(STATUS_SUCCESS); + if(ReturnLength != NULL) + { + *ReturnLength = sizeof(TIMER_BASIC_INFORMATION); + } + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + break; + } + + default: + Status = STATUS_NOT_IMPLEMENTED; + break; + } + + ObDereferenceObject(Timer); + } + + return Status; } @@ -313,16 +433,48 @@ OUT PBOOLEAN PreviousState OPTIONAL) { PNTTIMER Timer; - NTSTATUS Status; BOOLEAN Result; BOOLEAN State; + LARGE_INTEGER TimerDueTime; + KPROCESSOR_MODE PreviousMode; + NTSTATUS Status = STATUS_SUCCESS; DPRINT("NtSetTimer()\n"); + PreviousMode = ExGetPreviousMode(); + + if(PreviousMode != KernelMode) + { + _SEH_TRY + { + ProbeForRead(DueTime, + sizeof(LARGE_INTEGER), + sizeof(ULONG)); + TimerDueTime = *DueTime; + + if(PreviousState != NULL) + { + ProbeForWrite(PreviousState, + sizeof(BOOLEAN), + sizeof(BOOLEAN)); + } + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + + if(!NT_SUCCESS(Status)) + { + return Status; + } + } + Status = ObReferenceObjectByHandle(TimerHandle, TIMER_ALL_ACCESS, ExTimerType, - (KPROCESSOR_MODE)KeGetPreviousMode(), + PreviousMode, (PVOID*)&Timer, NULL); if (!NT_SUCCESS(Status)) @@ -351,15 +503,15 @@ &ExpTimerApcKernelRoutine, (PKRUNDOWN_ROUTINE)NULL, (PKNORMAL_ROUTINE)TimerApcRoutine, - (KPROCESSOR_MODE)KeGetPreviousMode(), + PreviousMode, TimerContext); } Result = KeSetTimerEx(&Timer->Timer, - *DueTime, + TimerDueTime, Period, TimerApcRoutine ? &Timer->Dpc : 0 ); - if (Result == TRUE) + if (Result) { ObDereferenceObject(Timer); DPRINT1( "KeSetTimer says the timer was already running, this shouldn't be\n" ); @@ -371,11 +523,19 @@ ObDereferenceObject(Timer); if (PreviousState != NULL) + { + _SEH_TRY { - *PreviousState = State; + *PreviousState = State; } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + } - return STATUS_SUCCESS; + return Status; } /* EOF */
19 years, 11 months
1
0
0
0
← Newer
1
...
11
12
13
14
15
16
17
...
71
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
Results per page:
10
25
50
100
200