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
[royce] 13154: require attributes to have values
by royce@svn.reactos.com
require attributes to have values Modified: branches/xmlbuildsystem/reactos/ntoskrnl/ntoskrnl.xml Modified: branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp _____ Modified: branches/xmlbuildsystem/reactos/ntoskrnl/ntoskrnl.xml --- branches/xmlbuildsystem/reactos/ntoskrnl/ntoskrnl.xml 2005-01-20 06:29:08 UTC (rev 13153) +++ branches/xmlbuildsystem/reactos/ntoskrnl/ntoskrnl.xml 2005-01-20 06:36:37 UTC (rev 13154) @@ -29,7 +29,7 @@ <directory name="ke"> <if property="ARCH" value="i386"> <directory name="i386"> - <file first>multiboot.S</file> + <file first="1">multiboot.S</file> <file>bios.c</file> <file>brkpoint.c</file> <file>bthread.S</file> _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp 2005-01-20 06:29:08 UTC (rev 13153) +++ branches/xmlbuildsystem/reactos/tools/rbuild/XML.cpp 2005-01-20 06:36:37 UTC (rev 13154) @@ -444,6 +444,11 @@ p++; p += strspn ( p, WS ); } + else if ( name[0] != '!' ) + { + throw XMLSyntaxErrorException ( location, + "attributes must have values" ); + } attributes.push_back ( new XMLAttribute ( attribute, value ) ); } return !( *p == '/' ) && !end_tag; _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-20 06:29:08 UTC (rev 13153) +++ branches/xmlbuildsystem/reactos/tools/rbuild/module.cpp 2005-01-20 06:36:37 UTC (rev 13154) @@ -104,7 +104,7 @@ { const XMLAttribute* att = e.GetAttribute ( "first", false ); File* pFile = new File ( FixSeparator ( path + CSEP + e.value ), - att != NULL ); + att && atoi(att->value.c_str()) != 0 ); if ( pIf ) pIf->files.push_back ( pFile ); else
19 years, 11 months
1
0
0
0
[ros-diffs] [sedwards] 13153: hard code mingw32-* for cross-compile, this is bad.
by sedwards@svn.reactos.com
hard code mingw32-* for cross-compile, this is bad. Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-20 06:09:07 UTC (rev 13152) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-20 06:29:08 UTC (rev 13153) @@ -168,14 +168,22 @@ fprintf ( fMakefile, "gcc = gcc\n" ); fprintf ( fMakefile, "ld = ld\n" ); fprintf ( fMakefile, "ar = ar\n" ); - fprintf ( fMakefile, "mkdir = tools%crmkdir\n", CSEP ); fprintf ( fMakefile, "dlltool = dlltool\n" ); fprintf ( fMakefile, "windres = windres\n" ); +#else + fprintf ( fMakefile, "host_gcc = gcc\n" ); + fprintf ( fMakefile, "host_ar = ar\n" ); + fprintf ( fMakefile, "host_ld = ld\n" ); + fprintf ( fMakefile, "rm = rm -f\n" ); + fprintf ( fMakefile, "gcc = mingw32-gcc\n" ); + fprintf ( fMakefile, "ld = mingw32-ld\n" ); + fprintf ( fMakefile, "ar = mingw32-ar\n" ); + fprintf ( fMakefile, "dlltool = mingw32-dlltool\n" ); + fprintf ( fMakefile, "windres = mingw32-windres\n" ); +#endif + fprintf ( fMakefile, "mkdir = tools%crmkdir\n", CSEP ); fprintf ( fMakefile, "NUL=NUL\n" ); fprintf ( fMakefile, "winebuild = tools" SSEP "winebuild" SSEP "winebuild\n" ); -#else -#error still need to generate tool macros for UNIX -#endif fprintf ( fMakefile, "\n" ); GenerateGlobalCFlagsAndProperties ( "=",
19 years, 11 months
1
0
0
0
[royce] 13152: mark off area where variables need to differ for *nix
by royce@svn.reactos.com
mark off area where variables need to differ for *nix Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp _____ Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp --- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-20 02:14:20 UTC (rev 13151) +++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-01-20 06:09:07 UTC (rev 13152) @@ -160,6 +160,7 @@ void MingwBackend::GenerateGlobalVariables () { +#ifdef WIN32 fprintf ( fMakefile, "host_gcc = gcc\n" ); fprintf ( fMakefile, "host_ar = ar\n" ); fprintf ( fMakefile, "host_ld = ld\n" ); @@ -167,11 +168,14 @@ fprintf ( fMakefile, "gcc = gcc\n" ); fprintf ( fMakefile, "ld = ld\n" ); fprintf ( fMakefile, "ar = ar\n" ); - fprintf ( fMakefile, "mkdir = tools%crmkdir\n", CSEP ); + fprintf ( fMakefile, "mkdir = tools%crmkdir\n", CSEP ); fprintf ( fMakefile, "dlltool = dlltool\n" ); fprintf ( fMakefile, "windres = windres\n" ); - fprintf ( fMakefile, "NUL=NUL\n" ); + fprintf ( fMakefile, "NUL=NUL\n" ); fprintf ( fMakefile, "winebuild = tools" SSEP "winebuild" SSEP "winebuild\n" ); +#else +#error still need to generate tool macros for UNIX +#endif fprintf ( fMakefile, "\n" ); GenerateGlobalCFlagsAndProperties ( "=",
19 years, 11 months
1
0
0
0
[weiden] 13147: wrap access to foreign Peb with SEH
by weiden@svn.reactos.com
wrap access to foreign Peb with SEH Modified: trunk/reactos/ntoskrnl/ps/process.c _____ Modified: trunk/reactos/ntoskrnl/ps/process.c --- trunk/reactos/ntoskrnl/ps/process.c 2005-01-20 00:14:50 UTC (rev 13146) +++ trunk/reactos/ntoskrnl/ps/process.c 2005-01-20 00:31:52 UTC (rev 13147) @@ -1720,7 +1720,15 @@ process so we're sure we're in the right context! */ KeAttachProcess(&Process->Pcb); - Process->Peb->BeingDebugged = TRUE; + _SEH_TRY + { + Process->Peb->BeingDebugged = TRUE; + } + _SEH_HANDLE + { + DPRINT1("Trying to set the Peb->BeingDebugged field of process 0x%x failed, exception: 0x%x\n", Process, _SEH_GetExceptionCode()); + } + _SEH_END; KeDetachProcess(); } Status = STATUS_SUCCESS;
19 years, 11 months
2
1
0
0
[weiden] 13151: fixed copying buffers in the ProcessImageFileName class in NtQueryInformationProcess() when copying the image name from a process other than the current one
by weiden@svn.reactos.com
fixed copying buffers in the ProcessImageFileName class in NtQueryInformationProcess() when copying the image name from a process other than the current one Modified: trunk/reactos/ntoskrnl/ps/process.c _____ Modified: trunk/reactos/ntoskrnl/ps/process.c --- trunk/reactos/ntoskrnl/ps/process.c 2005-01-20 02:09:33 UTC (rev 13150) +++ trunk/reactos/ntoskrnl/ps/process.c 2005-01-20 02:14:20 UTC (rev 13151) @@ -1497,40 +1497,106 @@ if(Process->Peb != NULL) { PRTL_USER_PROCESS_PARAMETERS ProcParams; + UNICODE_STRING LocalDest; + ULONG ImagePathLen; + PUNICODE_STRING DstPath = (PUNICODE_STRING)ProcessInformation; /* we need to attach to the process to make sure we're in the right context! */ KeAttachProcess(&Process->Pcb); - ASSERT(Process->Peb->ProcessParameters); /* FIXME - must ProcessParameters be really != NULL? */ - - ProcParams = Process->Peb->ProcessParameters; - if(ProcessInformationLength < sizeof(UNICODE_STRING) + ProcParams->ImagePathName.Length + sizeof(WCHAR)) + _SEH_TRY { - Status = STATUS_INFO_LENGTH_MISMATCH; + ProcParams = Process->Peb->ProcessParameters; + ImagePathLen = ProcParams->ImagePathName.Length; } - else + _SEH_HANDLE { - PUNICODE_STRING DstPath = (PUNICODE_STRING)ProcessInformation; - - _SEH_TRY + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + + if(NT_SUCCESS(Status)) + { + if(ProcessInformationLength < sizeof(UNICODE_STRING) + ImagePathLen + sizeof(WCHAR)) { - DstPath->Length = ProcParams->ImagePathName.Length; - DstPath->MaximumLength = ProcParams->ImagePathName.Length + sizeof(WCHAR); - DstPath->Buffer = (PWSTR)(DstPath + 1); + Status = STATUS_INFO_LENGTH_MISMATCH; + } + else + { + PWSTR StrSource = NULL; - RtlCopyMemory(DstPath->Buffer, ProcParams->ImagePathName.Buffer, ProcParams->ImagePathName.Length); - DstPath->Buffer[DstPath->Length / sizeof(WCHAR)] = L'\0'; - - if (ReturnLength) + /* create a DstPath structure on the stack */ + _SEH_TRY { - *ReturnLength = sizeof(UNICODE_STRING) + ProcParams->ImagePathName.Length + sizeof(WCHAR); + LocalDest.Length = ImagePathLen; + LocalDest.MaximumLength = ImagePathLen + sizeof(WCHAR); + LocalDest.Buffer = (PWSTR)(DstPath + 1); + + /* save a copy of the pointer to the source buffer */ + StrSource = ProcParams->ImagePathName.Buffer; } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + + if(NT_SUCCESS(Status)) + { + /* now, let's allocate some anonymous memory to copy the string to. + we can't just copy it to the buffer the caller pointed as it might + be user memory in another context */ + PWSTR PathCopy = ExAllocatePool(PagedPool, LocalDest.Length + sizeof(WCHAR)); + if(PathCopy != NULL) + { + /* make a copy of the buffer to the temporary buffer */ + _SEH_TRY + { + RtlCopyMemory(PathCopy, StrSource, LocalDest.Length); + PathCopy[LocalDest.Length / sizeof(WCHAR)] = L'\0'; + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + + /* detach from the process */ + KeDetachProcess(); + + /* only copy the string back to the caller if we were able to + copy it into the temporary buffer! */ + if(NT_SUCCESS(Status)) + { + /* now let's copy the buffer back to the caller */ + _SEH_TRY + { + *DstPath = LocalDest; + RtlCopyMemory(LocalDest.Buffer, PathCopy, LocalDest.Length + sizeof(WCHAR)); + if (ReturnLength) + { + *ReturnLength = sizeof(UNICODE_STRING) + LocalDest.Length + sizeof(WCHAR); + } + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + } + + /* we're done with the copy operation, free the temporary kernel buffer */ + ExFreePool(PathCopy); + + /* we need to bail because we're already detached from the process */ + break; + } + else + { + Status = STATUS_INSUFFICIENT_RESOURCES; + } + } } - _SEH_HANDLE - { - Status = _SEH_GetExceptionCode(); - } - _SEH_END; } KeDetachProcess();
19 years, 11 months
1
0
0
0
[arty] 13150: Extras for enabling ext2 in reactos.
by arty@svn.reactos.com
Extras for enabling ext2 in reactos. Modified: branches/ext2/reactos/Makefile Modified: branches/ext2/reactos/boot/freeldr/freeldr/reactos/setupldr.c Modified: branches/ext2/reactos/subsys/system/usetup/bootsup.c _____ Modified: branches/ext2/reactos/Makefile --- branches/ext2/reactos/Makefile 2005-01-20 01:19:52 UTC (rev 13149) +++ branches/ext2/reactos/Makefile 2005-01-20 02:09:33 UTC (rev 13150) @@ -39,7 +39,7 @@ # Filesystem libraries # vfatlib -LIB_FSLIB = vfatlib +LIB_FSLIB = vfatlib ext2lib # Static libraries LIB_STATIC = string rosrtl epsapi uuid libwine zlib rtl tgetopt pseh adns dxguid strmiids @@ -84,7 +84,7 @@ # Kernel mode file system drivers # cdfs ext2 fs_rec ms np vfat -FS_DRIVERS = cdfs fs_rec ms np vfat mup ntfs +FS_DRIVERS = cdfs fs_rec ms np vfat ext2 mup ntfs # Kernel mode networking drivers # afd ndis npf tcpip tdi wshtcpip _____ Modified: branches/ext2/reactos/boot/freeldr/freeldr/reactos/setupldr.c --- branches/ext2/reactos/boot/freeldr/freeldr/reactos/setupldr.c 2005-01-20 01:19:52 UTC (rev 13149) +++ branches/ext2/reactos/boot/freeldr/freeldr/reactos/setupldr.c 2005-01-20 02:09:33 UTC (rev 13150) @@ -556,6 +556,9 @@ if (!LoadDriver(SourcePath, "vfatfs.sys")) return; + /* Load ext2.sys (could be loaded by the setup prog!) */ + if (!LoadDriver(SourcePath, "ext2.sys")) + return; /* Load keyboard driver */ if (!LoadDriver(SourcePath, "keyboard.sys")) _____ Modified: branches/ext2/reactos/subsys/system/usetup/bootsup.c --- branches/ext2/reactos/subsys/system/usetup/bootsup.c 2005-01-20 01:19:52 UTC (rev 13149) +++ branches/ext2/reactos/subsys/system/usetup/bootsup.c 2005-01-20 02:09:33 UTC (rev 13150) @@ -1541,7 +1541,6 @@ return(Status); } - NTSTATUS InstallExt2BootCodeToDisk(PWSTR SrcPath, PWSTR RootPath) @@ -1751,215 +1750,6 @@ } -NTSTATUS -InstallExt2BootCodeToDisk(PWSTR SrcPath, - PWSTR RootPath) -{ - OBJECT_ATTRIBUTES ObjectAttributes; - IO_STATUS_BLOCK IoStatusBlock; - UNICODE_STRING Name; - HANDLE FileHandle; - NTSTATUS Status; - PUCHAR OrigBootSector; - PUCHAR NewBootSector; - LARGE_INTEGER FileOffset; - USHORT BackupBootSector; - - /* Allocate buffer for original bootsector */ - OrigBootSector = (PUCHAR)RtlAllocateHeap(ProcessHeap, - 0, - SECTORSIZE); - if (OrigBootSector == NULL) - return(STATUS_INSUFFICIENT_RESOURCES); - - /* Read current boot sector into buffer */ - RtlInitUnicodeString(&Name, - RootPath); - - InitializeObjectAttributes(&ObjectAttributes, - &Name, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); - - Status = NtOpenFile(&FileHandle, - FILE_READ_ACCESS, - &ObjectAttributes, - &IoStatusBlock, - 0, - FILE_SYNCHRONOUS_IO_NONALERT); - if (!NT_SUCCESS(Status)) - { - RtlFreeHeap(ProcessHeap, 0, OrigBootSector); - return(Status); - } - - Status = NtReadFile(FileHandle, - NULL, - NULL, - NULL, - &IoStatusBlock, - OrigBootSector, - SECTORSIZE, - NULL, - NULL); - NtClose(FileHandle); - if (!NT_SUCCESS(Status)) - { - RtlFreeHeap(ProcessHeap, 0, OrigBootSector); - return(Status); - } - - - /* Allocate buffer for new bootsector (2 sectors) */ - NewBootSector = (PUCHAR)RtlAllocateHeap(ProcessHeap, - 0, - 2 * SECTORSIZE); - if (NewBootSector == NULL) - { - RtlFreeHeap(ProcessHeap, 0, OrigBootSector); - return(STATUS_INSUFFICIENT_RESOURCES); - } - - /* Read new bootsector from SrcPath */ - RtlInitUnicodeString(&Name, - SrcPath); - - InitializeObjectAttributes(&ObjectAttributes, - &Name, - OBJ_CASE_INSENSITIVE, - NULL, - NULL); - - Status = NtOpenFile(&FileHandle, - FILE_READ_ACCESS, - &ObjectAttributes, - &IoStatusBlock, - 0, - FILE_SYNCHRONOUS_IO_NONALERT); - if (!NT_SUCCESS(Status)) - { - RtlFreeHeap(ProcessHeap, 0, OrigBootSector); - RtlFreeHeap(ProcessHeap, 0, NewBootSector); - return(Status); - } - - Status = NtReadFile(FileHandle, - NULL, - NULL, - NULL, - &IoStatusBlock, - NewBootSector, - 2 * SECTORSIZE, - NULL, - NULL); - NtClose(FileHandle); - if (!NT_SUCCESS(Status)) - { - RtlFreeHeap(ProcessHeap, 0, OrigBootSector); - RtlFreeHeap(ProcessHeap, 0, NewBootSector); - return(Status); - } - - /* Adjust bootsector (copy a part of the FAT32 BPB) */ - memcpy((NewBootSector + 3), - (OrigBootSector + 3), - 87); /* FAT32 BPB length */ - - /* Get the location of the backup boot sector */ - BackupBootSector = (OrigBootSector[0x33] << 8) + OrigBootSector[0x32]; - - /* Free the original boot sector */ - RtlFreeHeap(ProcessHeap, 0, OrigBootSector); - - /* Write the first sector of the new bootcode to DstPath */ - RtlInitUnicodeString(&Name, - RootPath); - - InitializeObjectAttributes(&ObjectAttributes, - &Name, - 0, - NULL, - NULL); - - Status = NtOpenFile(&FileHandle, - FILE_WRITE_ACCESS | FILE_WRITE_ATTRIBUTES, - &ObjectAttributes, - &IoStatusBlock, - 0, - FILE_SYNCHRONOUS_IO_NONALERT | FILE_SEQUENTIAL_ONLY); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtOpenFile() failed (Status %lx)\n", Status); - RtlFreeHeap(ProcessHeap, 0, NewBootSector); - return(Status); - } - - /* Write sector 0 */ - FileOffset.QuadPart = 0ULL; - Status = NtWriteFile(FileHandle, - NULL, - NULL, - NULL, - &IoStatusBlock, - NewBootSector, - SECTORSIZE, - &FileOffset, - NULL); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtWriteFile() failed (Status %lx)\n", Status); - NtClose(FileHandle); - RtlFreeHeap(ProcessHeap, 0, NewBootSector); - return(Status); - } - - /* Write backup boot sector */ - if ((BackupBootSector != 0x0000) && (BackupBootSector != 0xFFFF)) - { - FileOffset.QuadPart = (ULONGLONG)((ULONG)BackupBootSector * SECTORSIZE); - Status = NtWriteFile(FileHandle, - NULL, - NULL, - NULL, - &IoStatusBlock, - NewBootSector, - SECTORSIZE, - &FileOffset, - NULL); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtWriteFile() failed (Status %lx)\n", Status); - NtClose(FileHandle); - RtlFreeHeap(ProcessHeap, 0, NewBootSector); - return(Status); - } - } - - /* Write sector 14 */ - FileOffset.QuadPart = (ULONGLONG)(14 * SECTORSIZE); - Status = NtWriteFile(FileHandle, - NULL, - NULL, - NULL, - &IoStatusBlock, - (NewBootSector + SECTORSIZE), - SECTORSIZE, - &FileOffset, - NULL); - if (!NT_SUCCESS(Status)) - { - DPRINT1("NtWriteFile() failed (Status %lx)\n", Status); - } - NtClose(FileHandle); - - /* Free the new boot sector */ - RtlFreeHeap(ProcessHeap, 0, NewBootSector); - - return(Status); -} - - static NTSTATUS UnprotectBootIni(PWSTR FileName, PULONG Attributes)
19 years, 11 months
1
0
0
0
[weiden] 13149: fixed ProbeForWrite() for optimized builds
by weiden@svn.reactos.com
fixed ProbeForWrite() for optimized builds Modified: trunk/reactos/ntoskrnl/mm/virtual.c _____ Modified: trunk/reactos/ntoskrnl/mm/virtual.c --- trunk/reactos/ntoskrnl/mm/virtual.c 2005-01-20 00:44:55 UTC (rev 13148) +++ trunk/reactos/ntoskrnl/mm/virtual.c 2005-01-20 01:19:52 UTC (rev 13149) @@ -820,8 +820,7 @@ IN ULONG Length, IN ULONG Alignment) { - PULONG Ptr; - ULONG x; + volatile PCHAR Ptr; ULONG i; ASSERT(Alignment ==1 || Alignment == 2 || Alignment == 4 || Alignment == 8); @@ -842,9 +841,8 @@ /* Check for accessible pages */ for (i = 0; i < Length; i += PAGE_SIZE) { - Ptr = (PULONG)(((ULONG_PTR)Address & ~(PAGE_SIZE - 1)) + i); - x = *Ptr; - *Ptr = x; + Ptr = (PCHAR)(((ULONG_PTR)Address & ~(PAGE_SIZE - 1)) + i); + *Ptr = *Ptr; } }
19 years, 11 months
1
0
0
0
[weiden] 13148: move implementation of NtOpenProcessToken() to NtOpenProcessTokenEx()
by weiden@svn.reactos.com
move implementation of NtOpenProcessToken() to NtOpenProcessTokenEx() Modified: trunk/reactos/ntoskrnl/ps/process.c _____ Modified: trunk/reactos/ntoskrnl/ps/process.c --- trunk/reactos/ntoskrnl/ps/process.c 2005-01-20 00:31:52 UTC (rev 13147) +++ trunk/reactos/ntoskrnl/ps/process.c 2005-01-20 00:44:55 UTC (rev 13148) @@ -133,6 +133,25 @@ IN ACCESS_MASK DesiredAccess, OUT PHANDLE TokenHandle) { + return NtOpenProcessTokenEx(ProcessHandle, + DesiredAccess, + 0, + TokenHandle); +} + + +/* + * @unimplemented + */ +NTSTATUS +STDCALL +NtOpenProcessTokenEx( + IN HANDLE ProcessHandle, + IN ACCESS_MASK DesiredAccess, + IN ULONG HandleAttributes, + OUT PHANDLE TokenHandle + ) +{ PACCESS_TOKEN Token; HANDLE hToken; NTSTATUS Status; @@ -149,7 +168,7 @@ FALSE, &hToken); ObDereferenceObject(Token); - + if(NT_SUCCESS(Status)) { Status = MmCopyToCaller(TokenHandle, &hToken, sizeof(HANDLE)); @@ -159,23 +178,6 @@ /* - * @unimplemented - */ -NTSTATUS -STDCALL -NtOpenProcessTokenEx( - IN HANDLE ProcessHandle, - IN ACCESS_MASK DesiredAccess, - IN ULONG HandleAttributes, - OUT PHANDLE TokenHandle - ) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - - -/* * @implemented */ PACCESS_TOKEN STDCALL
19 years, 11 months
1
0
0
0
[weiden] 13146: fixed typo
by weiden@svn.reactos.com
fixed typo Modified: trunk/reactos/ntoskrnl/ps/process.c _____ Modified: trunk/reactos/ntoskrnl/ps/process.c --- trunk/reactos/ntoskrnl/ps/process.c 2005-01-20 00:12:38 UTC (rev 13145) +++ trunk/reactos/ntoskrnl/ps/process.c 2005-01-20 00:14:50 UTC (rev 13146) @@ -1254,7 +1254,7 @@ case ProcessDebugPort: { - if (ProcessInformationLength != sizeof(ULONG)) + if (ProcessInformationLength != sizeof(HANDLE)) { Status = STATUS_INFO_LENGTH_MISMATCH; }
19 years, 11 months
1
0
0
0
[weiden] 13145: implemented the ProcessDebugPort class for NtSetInformationProcess()
by weiden@svn.reactos.com
implemented the ProcessDebugPort class for NtSetInformationProcess() Modified: trunk/reactos/ntoskrnl/ps/process.c _____ Modified: trunk/reactos/ntoskrnl/ps/process.c --- trunk/reactos/ntoskrnl/ps/process.c 2005-01-19 23:38:06 UTC (rev 13144) +++ trunk/reactos/ntoskrnl/ps/process.c 2005-01-20 00:12:38 UTC (rev 13145) @@ -1603,6 +1603,7 @@ PEPROCESS Process; NTSTATUS Status; KPROCESSOR_MODE PreviousMode; + ACCESS_MASK Access; PreviousMode = ExGetPreviousMode(); @@ -1613,8 +1614,8 @@ { /* probe with 32bit alignment */ ProbeForRead(ProcessInformation, - ProcessInformationLength, - sizeof(ULONG)); + ProcessInformationLength, + sizeof(ULONG)); Status = STATUS_SUCCESS; } _SEH_HANDLE @@ -1629,8 +1630,21 @@ } } + Access = PROCESS_SET_INFORMATION; + + switch(ProcessInformationClass) + { + case ProcessSessionInformation: + Access |= PROCESS_SET_SESSIONID; + break; + case ProcessExceptionPort: + case ProcessDebugPort: + Access |= PROCESS_SET_PORT; + break; + } + Status = ObReferenceObjectByHandle(ProcessHandle, - PROCESS_SET_INFORMATION, + Access, PsProcessType, PreviousMode, (PVOID*)&Process, @@ -1645,13 +1659,92 @@ case ProcessQuotaLimits: case ProcessBasePriority: case ProcessRaisePriority: - case ProcessDebugPort: Status = STATUS_NOT_IMPLEMENTED; break; + case ProcessDebugPort: + { + if(ProcessInformationLength != sizeof(HANDLE)) + { + Status = STATUS_INFO_LENGTH_MISMATCH; + } + else + { + HANDLE PortHandle; + + /* make a safe copy of the buffer on the stack */ + _SEH_TRY + { + PortHandle = *(PHANDLE)ProcessInformation; + Status = (PortHandle != NULL ? STATUS_SUCCESS : STATUS_INVALID_PARAMETER); + } + _SEH_HANDLE + { + Status = _SEH_GetExceptionCode(); + } + _SEH_END; + + if(NT_SUCCESS(Status)) + { + PEPORT DebugPort; + + /* in case we had success reading from the buffer, verify the provided + * LPC port handle + */ + Status = ObReferenceObjectByHandle(PortHandle, + 0, + LpcPortObjectType, + PreviousMode, + (PVOID)&DebugPort, + NULL); + if(NT_SUCCESS(Status)) + { + /* lock the process to be thread-safe! */ + + Status = PsLockProcess(Process, FALSE); + if(NT_SUCCESS(Status)) + { + /* + * according to "NT Native API" documentation, setting the debug + * port is only permitted once! + */ + if(Process->DebugPort == NULL) + { + /* keep the reference to the handle! */ + Process->DebugPort = DebugPort; + + if(Process->Peb) + { + /* we're now debugging the process, so set the flag in the PEB + structure. However, to access it we need to attach to the + process so we're sure we're in the right context! */ + + KeAttachProcess(&Process->Pcb); + Process->Peb->BeingDebugged = TRUE; + KeDetachProcess(); + } + Status = STATUS_SUCCESS; + } + else + { + ObDereferenceObject(DebugPort); + Status = STATUS_PORT_ALREADY_SET; + } + PsUnlockProcess(Process); + } + else + { + ObDereferenceObject(DebugPort); + } + } + } + } + break; + } + case ProcessExceptionPort: { - if(ProcessInformationLength != sizeof(PROCESS_ACCESS_TOKEN)) + if(ProcessInformationLength != sizeof(HANDLE)) { Status = STATUS_INFO_LENGTH_MISMATCH; } @@ -1697,17 +1790,21 @@ */ if(Process->ExceptionPort == NULL) { + /* keep the reference to the handle! */ Process->ExceptionPort = ExceptionPort; Status = STATUS_SUCCESS; } else { + ObDereferenceObject(ExceptionPort); Status = STATUS_PORT_ALREADY_SET; } PsUnlockProcess(Process); } - - ObDereferenceObject(ExceptionPort); + else + { + ObDereferenceObject(ExceptionPort); + } } } } @@ -1792,7 +1889,6 @@ if(NT_SUCCESS(Status)) { - PEPROCESS Process2; /* we successfully copied the structure to the stack, continue processing */ /* @@ -1806,26 +1902,6 @@ break; } - /* - * ntinternals documents a PROCESS_SET_SESSIONID flag for NtOpenProcess, - * so we need to open the handle again with this access flag to make - * sure the handle has the required permissions to change the session id! - */ - Status = ObReferenceObjectByHandle(ProcessHandle, - PROCESS_SET_INFORMATION | PROCESS_SET_SESSIONID, - PsProcessType, - PreviousMode, - (PVOID*)&Process2, - NULL); - if(!NT_SUCCESS(Status)) - { - /* the handle doesn't have the access rights */ - break; - } - - /* SANITY check, Process2 MUST be the same as Process as it's the same handle! */ - ASSERT(Process2 == Process); - /* FIXME - update the session id for the process token */ Status = PsLockProcess(Process, FALSE); @@ -1857,8 +1933,6 @@ PsUnlockProcess(Process); } - - ObDereferenceObject(Process2); } } break;
19 years, 11 months
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
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