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
June 2011
----- 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
25 participants
460 discussions
Start a n
N
ew thread
[cgutman] 52224: [AFD] - Only indicate that receive is possible if there are no pending receive IRPs waiting for data - Don't attempt to receive on a connection which has been closed in the receive...
by cgutman@svn.reactos.org
Author: cgutman Date: Tue Jun 14 02:18:20 2011 New Revision: 52224 URL:
http://svn.reactos.org/svn/reactos?rev=52224&view=rev
Log: [AFD] - Only indicate that receive is possible if there are no pending receive IRPs waiting for data - Don't attempt to receive on a connection which has been closed in the receive direction Modified: trunk/reactos/drivers/network/afd/afd/read.c Modified: trunk/reactos/drivers/network/afd/afd/read.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/re…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] Tue Jun 14 02:18:20 2011 @@ -49,7 +49,8 @@ static VOID RefillSocketBuffer( PAFD_FCB FCB ) { NTSTATUS Status; - if( !FCB->ReceiveIrp.InFlightRequest ) { + if( !FCB->ReceiveIrp.InFlightRequest && + !(FCB->PollState & (AFD_EVENT_CLOSE | AFD_EVENT_ABORT)) ) { AFD_DbgPrint(MID_TRACE,("Replenishing buffer\n")); Status = TdiReceive( &FCB->ReceiveIrp.InFlightRequest, @@ -216,7 +217,8 @@ } } - if( FCB->Recv.Content - FCB->Recv.BytesUsed ) { + if( FCB->Recv.Content - FCB->Recv.BytesUsed && + IsListEmpty(&FCB->PendingIrpList[FUNCTION_RECV]) ) { FCB->PollState |= AFD_EVENT_RECEIVE; FCB->PollStatus[FD_READ_BIT] = STATUS_SUCCESS; PollReeval( FCB->DeviceExt, FCB->FileObject ); @@ -576,7 +578,7 @@ } } - if( !IsListEmpty( &FCB->DatagramList ) ) { + if( !IsListEmpty( &FCB->DatagramList ) && IsListEmpty(&FCB->PendingIrpList[FUNCTION_RECV]) ) { AFD_DbgPrint(MID_TRACE,("Signalling\n")); FCB->PollState |= AFD_EVENT_RECEIVE; FCB->PollStatus[FD_READ_BIT] = STATUS_SUCCESS;
13 years, 6 months
1
0
0
0
[cgutman] 52223: [AFD] - FD_CLOSE is only for remote disconnects so don't send it when the app closes its own socket - Validate the user-mode event handle properly
by cgutman@svn.reactos.org
Author: cgutman Date: Tue Jun 14 00:56:49 2011 New Revision: 52223 URL:
http://svn.reactos.org/svn/reactos?rev=52223&view=rev
Log: [AFD] - FD_CLOSE is only for remote disconnects so don't send it when the app closes its own socket - Validate the user-mode event handle properly Modified: trunk/reactos/drivers/network/afd/afd/main.c trunk/reactos/drivers/network/afd/afd/select.c Modified: trunk/reactos/drivers/network/afd/afd/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/ma…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/main.c [iso-8859-1] Tue Jun 14 00:56:49 2011 @@ -419,9 +419,6 @@ if( !SocketAcquireStateLock( FCB ) ) return STATUS_FILE_CLOSED; FCB->State = SOCKET_STATE_CLOSED; - FCB->PollState = AFD_EVENT_CLOSE; - FCB->PollStatus[FD_CLOSE_BIT] = STATUS_SUCCESS; //I think we can return success here - PollReeval( FCB->DeviceExt, FCB->FileObject ); InFlightRequest[0] = &FCB->ListenIrp; InFlightRequest[1] = &FCB->ReceiveIrp; Modified: trunk/reactos/drivers/network/afd/afd/select.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/se…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/select.c [iso-8859-1] Tue Jun 14 00:56:49 2011 @@ -287,8 +287,8 @@ Status = ObReferenceObjectByHandle( (PVOID)EventSelectInfo-> EventObject, FILE_ALL_ACCESS, - NULL, - KernelMode, + ExEventObjectType, + UserMode, (PVOID *)&FCB->EventSelect, NULL );
13 years, 6 months
1
0
0
0
[ilardig] 52222: update README.WINE
by ilardig@svn.reactos.org
Author: ilardig Date: Mon Jun 13 20:36:46 2011 New Revision: 52222 URL:
http://svn.reactos.org/svn/reactos?rev=52222&view=rev
Log: update README.WINE Modified: trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Mon Jun 13 20:36:46 2011 @@ -187,6 +187,8 @@ reactos/dll/win32/xinput9_1_0 # Autosync reactos/dll/win32/xmllite # Autosync +reactos/dll/cpl/inetcpl # Synced to Wine-1.3.21 + ReactOS shares the following programs with Winehq. reactos/base/applications/cmdutils/xcopy # Autosync
13 years, 6 months
1
0
0
0
[tkreuzer] 52221: [FREELDR] Start moving the 16 bit code into the raw binary chunk. We now switch to protected mode before jumping to the PE entry point
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Jun 13 20:03:55 2011 New Revision: 52221 URL:
http://svn.reactos.org/svn/reactos?rev=52221&view=rev
Log: [FREELDR] Start moving the 16 bit code into the raw binary chunk. We now switch to protected mode before jumping to the PE entry point Added: trunk/reactos/boot/freeldr/freeldr/arch/i386/entry.S - copied, changed from r52207, trunk/reactos/boot/freeldr/freeldr/arch/i386/arch.S Modified: trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt trunk/reactos/boot/freeldr/freeldr/arch/realmode/i386.S trunk/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h Modified: trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/CMake…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/CMakeLists.txt [iso-8859-1] Mon Jun 13 20:03:55 2011 @@ -9,26 +9,9 @@ endif() if(ARCH MATCHES i386) - if(MSVC) - list(APPEND FREELDR_BASE64K_SOURCE - arch/i386/realmode.S) - else() - list(APPEND FREELDR_STARTUP_SOURCE - arch/i386/arch.S) - endif() -elseif(ARCH MATCHES amd64) - if(MSVC) - list(APPEND FREELDR_BASE64K_SOURCE - arch/amd64/stubs.S) - else() - list(APPEND FREELDR_STARTUP_SOURCE - arch/amd64/arch.S) - endif() -endif() - -if(ARCH MATCHES i386) if(NOT MSVC) list(APPEND FREELDR_BASE64K_SOURCE + arch/i386/entry.S arch/i386/boot.S arch/i386/drvmap.S arch/i386/i386cpu.S @@ -40,15 +23,21 @@ arch/i386/linux.S arch/i386/mb.S arch/i386/i386bug.c) + else() + list(APPEND FREELDR_BASE64K_SOURCE + arch/i386/realmode.S) endif() elseif(ARCH MATCHES amd64) if(NOT MSVC) - list(APPEND FREELDR_BASE64K_SOURCE - arch/i386/drvmap.S - arch/i386/i386cpu.S - arch/i386/i386idt.S - arch/i386/i386trap.S - arch/amd64/mb.S) + list(APPEND FREELDR_BASE64K_SOURCE + arch/i386/drvmap.S + arch/i386/i386cpu.S + arch/i386/i386idt.S + arch/i386/i386trap.S + arch/amd64/mb.S) + else() + list(APPEND FREELDR_BASE64K_SOURCE + arch/amd64/stubs.S) endif() endif() @@ -187,7 +176,6 @@ list(APPEND FREELDR_SOURCE bootmgr.c - ${FREELDR_STARTUP_SOURCE} ${FREELDR_BASE64K_SOURCE} ${FREELDR_BASE_SOURCE} ) @@ -242,7 +230,6 @@ endif() list(APPEND SETUPLDR_SOURCE - ${FREELDR_STARTUP_SOURCE} ${FREELDR_BASE64K_SOURCE} ${FREELDR_BASE_SOURCE} ${SETUPLDR_MAIN_SOURCE}) Copied: trunk/reactos/boot/freeldr/freeldr/arch/i386/entry.S (from r52207, trunk/reactos/boot/freeldr/freeldr/arch/i386/arch.S) URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/arch.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/entry.S [iso-8859-1] Mon Jun 13 20:03:55 2011 @@ -20,52 +20,49 @@ .intel_syntax noprefix #define HEX(y) 0x##y +#include <asm.inc> #include <arch/pc/x86common.h> #include <multiboot.h> - .code16 - -EXTERN(_RealEntryPoint) - - cli - - /* Setup segment registers */ - xor ax, ax +.code32 + +PUBLIC _RealEntryPoint +_RealEntryPoint: + + /* Setup segment selectors */ + mov ax, PMODE_DS mov ds, ax mov es, ax mov fs, ax mov gs, ax mov ss, ax - /* Setup a stack */ - mov sp, word ptr ds:stack16 - - sti - - /* Init pmode */ - call switch_to_prot - - .code32 - - /* Zero BootDrive and BootPartition */ + /* Setup protected mode stack */ + mov esp, dword ptr [stack32] + + /* Load the IDT */ + lidt i386idtptr + + /* Continue execution */ + jmp dword ptr [_ContinueAddress] + +_ContinueAddress: + .long _FrldrStartup + + +_FrldrStartup: + + /* Store BootDrive and BootPartition */ + xor eax, eax + mov al, dl + mov dword ptr [_FrldrBootDrive], eax + mov al, dh + mov dword ptr [_FrldrBootPartition], eax + + /* GO! */ xor eax, eax - mov dword ptr [_FrldrBootDrive], eax - mov dword ptr [_FrldrBootPartition], eax - - /* Store the boot drive */ - mov byte ptr [_FrldrBootDrive], dl - - /* Store the boot partition */ - mov byte ptr [_FrldrBootPartition], dh - - /* GO! */ push eax - call _BootMain - - call switch_to_real - .code16 - - int HEX(19) + call _BootMain /* We should never get here */ stop: @@ -399,12 +396,12 @@ mov eax, [ebx + MB_INFO_BOOT_DEVICE_OFFSET] shr eax, 16 inc al - mov byte ptr _FrldrBootPartition, al - mov byte ptr _FrldrBootDrive, ah + mov byte ptr [_FrldrBootPartition], al + mov byte ptr [_FrldrBootDrive], ah jmp mb6 mb5: /* No boot device known, assume first partition of first harddisk */ - mov byte ptr _FrldrBootDrive, HEX(80) - mov byte ptr _FrldrBootPartition, 1 + mov byte ptr [_FrldrBootDrive], HEX(80) + mov byte ptr [_FrldrBootPartition], 1 mb6: /* Check for command line */ mov eax, offset cmdline @@ -495,8 +492,12 @@ cmdline: .fill CMDLINE_SIZE, 1, 0 -EXTERN(_FrldrBootDrive) +PUBLIC _FrldrBootDrive +_FrldrBootDrive: .long 0 -EXTERN(_FrldrBootPartition) +PUBLIC _FrldrBootPartition +_FrldrBootPartition: .long 0 + +END Modified: trunk/reactos/boot/freeldr/freeldr/arch/realmode/i386.S URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/realmode/i386.S [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/realmode/i386.S [iso-8859-1] Mon Jun 13 20:03:55 2011 @@ -12,17 +12,101 @@ #include "fathelp.inc" .org 512 -RealEntryPoint: +RealModeEntryPoint: + + cli + + /* Setup segment registers */ + xor ax, ax + mov ds, ax + mov es, ax + mov fs, ax + mov gs, ax + mov ss, ax + + /* Setup the stack */ + mov sp, word ptr ds:stack16 /* Get address of optional header */ mov eax, dword ptr ds:[FREELDR_PE_BASE + IMAGE_DOS_HEADER_e_lfanew] add eax, FREELDR_PE_BASE + 4 + IMAGE_FILE_HEADER_SIZE - /* Jump to address of entry point */ + /* Get address of entry point */ mov eax, dword ptr ds:[eax + IMAGE_OPTIONAL_HEADER_AddressOfEntryPoint] add eax, FREELDR_PE_BASE - jmp ax + /* Safe the entry point */ + mov dword ptr [BSS_EntryPoint], eax + + /* Patch the long jump instruction */ + mov word ptr [pm_offset], ax + +/* + * Switches the processor to protected mode + * it destroys eax + */ +switch_to_prot: + + /* Load the GDT */ + lgdt gdtptr + + /* Enable Protected Mode */ + mov eax, cr0 + or eax, CR0_PE_SET + mov cr0, eax + + /* Clear prefetch queue & correct CS */ + .byte HEX(0ea) // jmp far PMODE_CS:entry_point +pm_offset: + .word 0 // receives address of PE entry point + .word PMODE_CS + nop + + + + /* 16-bit stack pointer */ +stack16: + .word STACK16ADDR + + +.align 4 /* force 4-byte alignment */ +gdt: + /* NULL Descriptor */ + .word HEX(0000) + .word HEX(0000) + .word HEX(0000) + .word HEX(0000) + + /* 32-bit flat CS */ + .word HEX(FFFF) + .word HEX(0000) + .word HEX(9A00) + .word HEX(00CF) + + /* 32-bit flat DS */ + .word HEX(FFFF) + .word HEX(0000) + .word HEX(9200) + .word HEX(00CF) + + /* 16-bit real mode CS */ + .word HEX(FFFF) + .word HEX(0000) + .word HEX(9E00) + .word HEX(0000) + + /* 16-bit real mode DS */ + .word HEX(FFFF) + .word HEX(0000) + .word HEX(9200) + .word HEX(0000) + +/* GDT table pointer */ +gdtptr: + .word HEX(27) /* Limit */ + .long gdt /* Base Address */ + +.org 1024 #include "helpers.inc" Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h [iso-8859-1] (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/pc/x86common.h [iso-8859-1] Mon Jun 13 20:03:55 2011 @@ -4,8 +4,8 @@ #endif /* Memory layout */ -#define STACK16ADDR HEX(7000) /* The 16-bit stack top will be at 0000:7000 */ -#define BSS_START HEX(7000) +#define STACK16ADDR HEX(6F00) /* The 16-bit stack top will be at 0000:6F00 */ +#define BSS_START HEX(6F00) #define FREELDR_BASE HEX(8000) #define FREELDR_PE_BASE HEX(9000) #define STACK32ADDR HEX(78000) /* The 32-bit stack top will be at 7000:8000, or 0x78000 */ @@ -17,15 +17,12 @@ #define DISKREADBUFFER_SIZE 512 /* These addresses specify the realmode "BSS section" layout */ -#define BSS_CallbackAddress BSS_START + 0 -#define BSS_CallbackReturn BSS_START + 8 -#define BSS_BootDrive BSS_START + 16 -#define BSS_BootPartition BSS_START + 20 +#define BSS_EntryPoint (BSS_START + 0) +#define BSS_CallbackAddress (BSS_START + 4) +#define BSS_CallbackReturn (BSS_START + 8) +#define BSS_BootDrive (BSS_START + 12) +#define BSS_BootPartition (BSS_START + 16) -#ifdef _M_AMD64 -#define FrldrBootDrive *((PULONG)BSS_BootDrive) -#define FrldrBootPartition *((PULONG)BSS_BootPartition) -#endif // Flag Masks #define I386FLAG_CF HEX(0001) // Carry Flag @@ -45,13 +42,13 @@ #define CR0_PE_CLR HEX(FFFFFFFE) /* AND this value with CR0 to disable pmode */ /* Defines needed for switching between real and protected mode */ -#ifdef _M_IX86 +//#ifdef _M_IX86 #define NULL_DESC HEX(00) /* NULL descriptor */ #define PMODE_CS HEX(08) /* PMode code selector, base 0 limit 4g */ #define PMODE_DS HEX(10) /* PMode data selector, base 0 limit 4g */ #define RMODE_CS HEX(18) /* RMode code selector, base 0 limit 64k */ #define RMODE_DS HEX(20) /* RMode data selector, base 0 limit 64k */ -#endif +//#endif /* Makes "x" a global variable or label */ #define EXTERN(x) .global x; x:
13 years, 6 months
1
0
0
0
[tkreuzer] 52220: forgot a pecoff.h update
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Jun 13 19:54:35 2011 New Revision: 52220 URL:
http://svn.reactos.org/svn/reactos?rev=52220&view=rev
Log: forgot a pecoff.h update Modified: trunk/reactos/tools/pecoff.h Modified: trunk/reactos/tools/pecoff.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/pecoff.h?rev=52220&r…
============================================================================== --- trunk/reactos/tools/pecoff.h [iso-8859-1] (original) +++ trunk/reactos/tools/pecoff.h [iso-8859-1] Mon Jun 13 19:54:35 2011 @@ -42,6 +42,7 @@ #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 #define IMAGE_REL_I386_ABSOLUTE 0x0001 +#define IMAGE_REL_I386_DIR32 0x0006 typedef unsigned char BYTE; typedef unsigned char UCHAR;
13 years, 6 months
1
0
0
0
[gadamopoulos] 52219: [user32] - Fix several compilation issues with msvc
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Mon Jun 13 19:49:46 2011 New Revision: 52219 URL:
http://svn.reactos.org/svn/reactos?rev=52219&view=rev
Log: [user32] - Fix several compilation issues with msvc Modified: trunk/reactos/dll/win32/user32/controls/icontitle.c trunk/reactos/dll/win32/user32/controls/scrollbar.c trunk/reactos/dll/win32/user32/windows/defwnd.c trunk/reactos/dll/win32/user32/windows/menu.c Modified: trunk/reactos/dll/win32/user32/controls/icontitle.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/…
============================================================================== --- trunk/reactos/dll/win32/user32/controls/icontitle.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/controls/icontitle.c [iso-8859-1] Mon Jun 13 19:49:46 2011 @@ -188,7 +188,6 @@ { HWND owner = GetWindow( hWnd, GW_OWNER ); - if (!IsWindow(hWnd)) return 0; #ifdef __REACTOS__ // Do this now, remove after Server side is fixed. PWND pWnd; @@ -201,6 +200,8 @@ } } #endif + + if (!IsWindow(hWnd)) return 0; switch( msg ) { Modified: trunk/reactos/dll/win32/user32/controls/scrollbar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/…
============================================================================== --- trunk/reactos/dll/win32/user32/controls/scrollbar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/controls/scrollbar.c [iso-8859-1] Mon Jun 13 19:49:46 2011 @@ -1243,11 +1243,6 @@ LRESULT WINAPI ScrollBarWndProc(WNDPROC DefWindowProc, HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam) { - if (! IsWindow(Wnd)) - { - return 0; - } - #ifdef __REACTOS__ // Do this now, remove after Server side is fixed. PWND pWnd; @@ -1260,6 +1255,11 @@ } } #endif + + if (! IsWindow(Wnd)) + { + return 0; + } switch (Msg) { Modified: trunk/reactos/dll/win32/user32/windows/defwnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/d…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/defwnd.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/defwnd.c [iso-8859-1] Mon Jun 13 19:49:46 2011 @@ -753,6 +753,7 @@ ScrollTrackScrollBar(Wnd, ScrollBar, Pt ); } +LRESULT WINAPI DoAppSwitch( WPARAM wParam, LPARAM lParam); LRESULT DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) @@ -824,7 +825,7 @@ case SC_SCREENSAVE: NtUserMessageCall( hWnd, WM_SYSCOMMAND, wParam, lParam, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, FALSE); break; -LRESULT WINAPI DoAppSwitch( WPARAM wParam, LPARAM lParam); + case SC_NEXTWINDOW: case SC_PREVWINDOW: DoAppSwitch( wParam, lParam); @@ -833,9 +834,10 @@ case SC_HOTKEY: { HWND hwnd, hWndLastActive; + PWND pWnd; hwnd = (HWND)lParam; - PWND pWnd = ValidateHwnd(hwnd); + pWnd = ValidateHwnd(hwnd); if (pWnd) { hWndLastActive = GetLastActivePopup(hwnd); Modified: trunk/reactos/dll/win32/user32/windows/menu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
============================================================================== --- trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] Mon Jun 13 19:49:46 2011 @@ -1791,7 +1791,6 @@ // LRESULT WINAPI PopupMenuWndProcA(HWND Wnd, UINT Message, WPARAM wParam, LPARAM lParam) { - TRACE("YES! hwnd=%x msg=0x%04x wp=0x%04lx lp=0x%08lx\n", Wnd, Message, wParam, lParam); #ifdef __REACTOS__ PWND pWnd; @@ -1805,6 +1804,8 @@ } #endif + TRACE("YES! hwnd=%x msg=0x%04x wp=0x%04lx lp=0x%08lx\n", Wnd, Message, wParam, lParam); + switch(Message) { case WM_CREATE: @@ -1879,7 +1880,6 @@ LRESULT WINAPI PopupMenuWndProcW(HWND Wnd, UINT Message, WPARAM wParam, LPARAM lParam) { - TRACE("hwnd=%x msg=0x%04x wp=0x%04lx lp=0x%08lx\n", Wnd, Message, wParam, lParam); #ifdef __REACTOS__ // Do this now, remove after Server side is fixed. PWND pWnd; @@ -1892,6 +1892,8 @@ } } #endif + + TRACE("hwnd=%x msg=0x%04x wp=0x%04lx lp=0x%08lx\n", Wnd, Message, wParam, lParam); switch(Message) {
13 years, 6 months
1
0
0
0
[gadamopoulos] 52218: [browseui] - Fix some compilation errors with msvc
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Mon Jun 13 19:34:06 2011 New Revision: 52218 URL:
http://svn.reactos.org/svn/reactos?rev=52218&view=rev
Log: [browseui] - Fix some compilation errors with msvc Modified: trunk/reactos/lib/atl/atlwin.h Modified: trunk/reactos/lib/atl/atlwin.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlwin.h?rev=52218…
============================================================================== --- trunk/reactos/lib/atl/atlwin.h [iso-8859-1] (original) +++ trunk/reactos/lib/atl/atlwin.h [iso-8859-1] Mon Jun 13 19:34:06 2011 @@ -24,7 +24,7 @@ #define GCCU(x) x __attribute__((unused)) #define Unused(x) #else -#define GCCU(x) +#define GCCU(x) (x) #define Unused(x) (x); #endif // __GNUC__
13 years, 6 months
1
0
0
0
[tkreuzer] 52217: [OBJ2BIN] - Rewrite large parts of the tool - Support IMAGE_REL_I386_DIR32
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon Jun 13 19:23:51 2011 New Revision: 52217 URL:
http://svn.reactos.org/svn/reactos?rev=52217&view=rev
Log: [OBJ2BIN] - Rewrite large parts of the tool - Support IMAGE_REL_I386_DIR32 Modified: trunk/reactos/tools/obj2bin/obj2bin.c Modified: trunk/reactos/tools/obj2bin/obj2bin.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/obj2bin/obj2bin.c?re…
============================================================================== --- trunk/reactos/tools/obj2bin/obj2bin.c [iso-8859-1] (original) +++ trunk/reactos/tools/obj2bin/obj2bin.c [iso-8859-1] Mon Jun 13 19:23:51 2011 @@ -13,27 +13,41 @@ static void -RelocateImage( +RelocateSection( char *pData, - unsigned int nSize, - PIMAGE_RELOCATION pReloc, - unsigned int cNumRelocs, + IMAGE_SECTION_HEADER *pSectionHeader, PIMAGE_SYMBOL pSymbols, unsigned int iOffset) { - unsigned int i; + unsigned int i, nOffset; + PIMAGE_RELOCATION pReloc; + char *pSection; WORD *p16; + DWORD *p32; - for (i = 0; i < cNumRelocs; i++) + pSection = pData + pSectionHeader->PointerToRawData; + + /* Calculate pointer to relocation table */ + pReloc = (PIMAGE_RELOCATION)(pData + pSectionHeader->PointerToRelocations); + + /* Loop all relocations */ + for (i = 0; i < pSectionHeader->NumberOfRelocations; i++) { - if (pReloc->VirtualAddress > nSize) continue; + nOffset = pReloc->VirtualAddress - pSectionHeader->VirtualAddress; + + if (nOffset > pSectionHeader->SizeOfRawData) continue; switch (pReloc->Type) { case IMAGE_REL_I386_ABSOLUTE: case 16: - p16 = (void*)(pData + pReloc->VirtualAddress); + p16 = (void*)(pSection + nOffset); *p16 += (WORD)(pSymbols[pReloc->SymbolTableIndex].Value + iOffset); + break; + + case IMAGE_REL_I386_DIR32: + p32 = (void*)(pSection + nOffset); + *p32 += (DWORD)(pSymbols[pReloc->SymbolTableIndex].Value + iOffset); break; default: @@ -49,13 +63,13 @@ { char *pszSourceFile; char *pszDestFile; - unsigned long iOffset; + unsigned long nFileSize, nBaseAddress, nOffsetSectionHeaders; FILE *pSourceFile, *pDestFile; - IMAGE_FILE_HEADER FileHeader; - IMAGE_SECTION_HEADER SectionHeader; + IMAGE_FILE_HEADER *pFileHeader; + IMAGE_SECTION_HEADER *pSectionHeader; unsigned int i; size_t nSize; - void *pData; + char *pData; PIMAGE_RELOCATION pReloc; PIMAGE_SYMBOL pSymbols; @@ -67,144 +81,81 @@ pszSourceFile = argv[1]; pszDestFile = argv[2]; + nBaseAddress = strtol(argv[3], 0, 16); pSourceFile = fopen(pszSourceFile, "rb"); if (!pSourceFile) { fprintf(stderr, "Couldn't open source file '%s'\n", pszSourceFile); - return -1; + return -2; } + /* Get file size */ + fseek(pSourceFile, 0, SEEK_END); + nFileSize = ftell(pSourceFile); + rewind(pSourceFile); + + /* Allocate memory for the file */ + pData = malloc(nFileSize); + if (!pData) + { + fprintf(stderr, "Failed to allocate %ld bytes\n", nFileSize); + return -3; + } + + /* Read the whole source file */ + if (!fread(pData, nFileSize, 1, pSourceFile)) + { + fprintf(stderr, "Failed to read source file: %ld\n", nFileSize); + return -4; + } + + /* Close source file */ + fclose(pSourceFile); + + /* Open the destination file */ pDestFile = fopen(pszDestFile, "wb"); if (!pszDestFile) { fprintf(stderr, "Couldn't open dest file '%s'\n", pszDestFile); - return -2; + return -5; } - iOffset = strtol(argv[3], 0, 16); - - /* Load the coff header */ - nSize = fread(&FileHeader, 1, sizeof(FileHeader), pSourceFile); - if (nSize != sizeof(FileHeader)) - { - fprintf(stderr, "Failed to read source file\n"); - return -3; - } - - /* Jump to section headers (skip optional header) */ - if (fseek(pSourceFile, FileHeader.SizeOfOptionalHeader, SEEK_CUR)) - { - fprintf(stderr, "Failed to set file pointer\n"); - return -4; - } + /* Calculate table pointers */ + pFileHeader = (IMAGE_FILE_HEADER*)pData; + pSymbols = (void*)(pData + pFileHeader->PointerToSymbolTable); + pSectionHeader = (void*)(((char*)(pFileHeader + 1)) + pFileHeader->SizeOfOptionalHeader); /* Loop all sections */ - for (i = 0; i < FileHeader.NumberOfSections; i++) + for (i = 0; i < pFileHeader->NumberOfSections; i++) { - /* Read section header */ - nSize = fread(&SectionHeader, 1, sizeof(SectionHeader), pSourceFile); - if (nSize != sizeof(SectionHeader)) + /* Skip empty sections */ + if (pSectionHeader->SizeOfRawData == 0) continue; + + /* Check if this is '.text' section */ + if (strcmp(pSectionHeader->Name, ".text") == 0) { - fprintf(stderr, "Failed to read section %ld file\n", i); - return -5; + RelocateSection(pData, + pSectionHeader, + pSymbols, + nBaseAddress); + + /* Write the section to the destination file */ + if (!fwrite(pData + pSectionHeader->PointerToRawData, + pSectionHeader->SizeOfRawData, 1, pDestFile)) + { + fprintf(stderr, "Failed to write data %ld\n", + pSectionHeader->SizeOfRawData); + return -6; + } + + nBaseAddress += pSectionHeader->SizeOfRawData; } - /* Skip empty sections */ - if (SectionHeader.SizeOfRawData == 0) continue; - - /* Check if this is '.text' section */ - if (strcmp(SectionHeader.Name, ".text") == 0) break; - } - - if (i == FileHeader.NumberOfSections) - { - fprintf(stderr, "No .text section found\n"); - return -6; - } - - /* Move file pointer to the symbol table */ - if (fseek(pSourceFile, FileHeader.PointerToSymbolTable, SEEK_SET)) - { - fprintf(stderr, "Failed to set file pointer\n"); - return -7; - } - - /* Allocate memory for the symbols */ - nSize = FileHeader.NumberOfSymbols * sizeof(IMAGE_SYMBOL); - pSymbols = malloc(nSize); - if (!pSymbols) - { - fprintf(stderr, "Failed to allocate %ld bytes\n", nSize); - return -8; - } - - /* Read symbol data */ - if (!fread(pSymbols, nSize, 1, pSourceFile)) - { - fprintf(stderr, "Failed to read symbols: %ld\n", nSize); - return -9; - } - - /* Move file pointer to the start of the section */ - if (fseek(pSourceFile, SectionHeader.PointerToRawData, SEEK_SET)) - { - fprintf(stderr, "Failed to set file pointer\n"); - return -10; - } - - /* Allocate memory for the section */ - pData = malloc(SectionHeader.SizeOfRawData); - if (!pData) - { - fprintf(stderr, "Failed to allocate %ld bytes\n", SectionHeader.SizeOfRawData); - return -11; - } - - /* Read section data */ - if (!fread(pData, SectionHeader.SizeOfRawData, 1, pSourceFile)) - { - fprintf(stderr, "Failed to read section %ld, at 0x%lx size=0x%lx \n", - i, SectionHeader.PointerToRawData, SectionHeader.SizeOfRawData); - return -12; - } - - /* Allocate memory for the relocation */ - nSize = SectionHeader.NumberOfRelocations * sizeof(IMAGE_RELOCATION); - pReloc = malloc(nSize); - if (!pReloc) - { - fprintf(stderr, "Failed to allocate %ld bytes\n", nSize); - return -13; - } - - /* Move file pointer to the relocation table */ - if (fseek(pSourceFile, SectionHeader.PointerToRelocations, SEEK_SET)) - { - fprintf(stderr, "Failed to set file pointer\n"); - return -14; - } - - /* Read relocation data */ - if (!fread(pReloc, nSize, 1, pSourceFile)) - { - fprintf(stderr, "Failed to read section %ld file\n", i); - return -15; - } - - RelocateImage(pData, SectionHeader.SizeOfRawData, - pReloc, SectionHeader.NumberOfRelocations, pSymbols, iOffset); - - /* Write the section to the destination file */ - if (!fwrite(pData, SectionHeader.SizeOfRawData, 1, pDestFile)) - { - fprintf(stderr, "Failed to write data %ld\n", - SectionHeader.SizeOfRawData); - return -16; + pSectionHeader++; } fclose(pDestFile); - fclose(pSourceFile); return 0; }
13 years, 6 months
1
0
0
0
[tfaber] 52216: [KMTESTS] - use a shared memory buffer for storing test results to provide seamless communication between all test parts - Now user mode code can easily add messages to the buffer
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Jun 13 17:50:07 2011 New Revision: 52216 URL:
http://svn.reactos.org/svn/reactos?rev=52216&view=rev
Log: [KMTESTS] - use a shared memory buffer for storing test results to provide seamless communication between all test parts - Now user mode code can easily add messages to the buffer Modified: branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt branches/GSoC_2011/KMTestSuite/kmtests/include/kmt_public.h branches/GSoC_2011/KMTestSuite/kmtests/include/kmt_test.h branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/kmtest_drv.c branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/log.c branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c Modified: branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/C…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt [iso-8859-1] Mon Jun 13 17:50:07 2011 @@ -23,6 +23,7 @@ set_module_type(kmtest_drv kernelmodedriver) target_link_libraries(kmtest_drv ${PSEH_LIB}) add_importlibs(kmtest_drv ntoskrnl hal) +set_property(TARGET kmtest_drv PROPERTY COMPILE_DEFINITIONS KMT_KERNEL_MODE) add_cd_file(TARGET kmtest_drv DESTINATION reactos/system32/drivers FOR all) @@ -39,5 +40,6 @@ add_executable(kmtest ${KMTEST_SOURCE}) set_module_type(kmtest win32cui) add_importlibs(kmtest advapi32 msvcrt kernel32) +set_property(TARGET kmtest PROPERTY COMPILE_DEFINITIONS KMT_USER_MODE) add_cd_file(TARGET kmtest DESTINATION reactos/bin FOR all) Modified: branches/GSoC_2011/KMTestSuite/kmtests/include/kmt_public.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/i…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/include/kmt_public.h [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/include/kmt_public.h [iso-8859-1] Mon Jun 13 17:50:07 2011 @@ -14,6 +14,9 @@ #define IOCTL_KMTEST_RUN_TEST \ CTL_CODE(FILE_DEVICE_UNKNOWN, 0x801, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA) +#define IOCTL_KMTEST_SET_RESULTBUFFER \ + CTL_CODE(FILE_DEVICE_UNKNOWN, 0x802, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA) + #define KMTEST_DEVICE_NAME L"Kmtest" #define KMTEST_DEVICE_PATH (L"\\\\.\\Global\\GLOBALROOT\\Device\\" KMTEST_DEVICE_NAME) Modified: branches/GSoC_2011/KMTestSuite/kmtests/include/kmt_test.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/i…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/include/kmt_test.h [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/include/kmt_test.h [iso-8859-1] Mon Jun 13 17:50:07 2011 @@ -7,8 +7,6 @@ #ifndef _KMTEST_TEST_H_ #define _KMTEST_TEST_H_ - -#include <kmt_log.h> typedef void KMT_TESTFUNC(void); @@ -22,4 +20,60 @@ extern const KMT_TEST TestList[]; +typedef struct { + volatile LONG Successes; + volatile LONG Failures; + volatile LONG LogBufferLength; + LONG LogBufferMaxLength; + CHAR LogBuffer[ANYSIZE_ARRAY]; +} KMT_RESULTBUFFER, *PKMT_RESULTBUFFER; + +extern PKMT_RESULTBUFFER ResultBuffer; + +#if defined KMT_DEFINE_TEST_FUNCTIONS +PKMT_RESULTBUFFER ResultBuffer = NULL; + +#if defined KMT_USER_MODE +static PKMT_RESULTBUFFER KmtAllocateResultBuffer(SIZE_T LogBufferMaxLength) +{ + PKMT_RESULTBUFFER Buffer = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(KMT_RESULTBUFFER, LogBuffer[LogBufferMaxLength])); + + Buffer->Successes = 0; + Buffer->Failures = 0; + Buffer->LogBufferLength = 0; + Buffer->LogBufferMaxLength = LogBufferMaxLength; + + return Buffer; +} + +static VOID KmtFreeResultBuffer(PKMT_RESULTBUFFER Buffer) +{ + HeapFree(GetProcessHeap(), 0, Buffer); +} +#endif /* defined KMT_USER_MODE */ + +#define KmtMemCpy memcpy + +static VOID KmtAddToLogBuffer(PKMT_RESULTBUFFER Buffer, PCSTR String, SIZE_T Length) +{ + LONG OldLength; + LONG NewLength; + + do + { + OldLength = Buffer->LogBufferLength; + NewLength = OldLength + Length; + if (NewLength > Buffer->LogBufferMaxLength) + { + /* TODO: indicate failure somehow */ + __debugbreak(); + return; + } + } while (InterlockedCompareExchange(&Buffer->LogBufferLength, NewLength, OldLength) != OldLength); + + KmtMemCpy(&Buffer->LogBuffer[OldLength], String, Length); +} + +#endif /* defined KMT_DEFINE_TEST_FUNCTIONS */ + #endif /* !defined _KMTEST_TEST_H_ */ Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest.rbuild [iso-8859-1] Mon Jun 13 17:50:07 2011 @@ -1,6 +1,7 @@ <module name="kmtest" type="win32cui" installbase="system32" installname="kmtest.exe"> <include base="kmtest">include</include> <library>advapi32</library> + <define name="KMT_USER_MODE" /> <directory name="kmtest"> <file>kmtest.c</file> <file>service.c</file> Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest/kmtest.c [iso-8859-1] Mon Jun 13 17:50:07 2011 @@ -16,6 +16,10 @@ #include "kmtest.h" #include <winioctl.h> #include <kmt_public.h> +#define KMT_DEFINE_TEST_FUNCTIONS +#include <kmt_test.h> + +#define LOGBUFFER_SIZE 65000 static void OutputError(FILE *fp, DWORD error); static DWORD RunTest(char *testName); @@ -40,9 +44,14 @@ { DWORD error = ERROR_SUCCESS; HANDLE hDevice = INVALID_HANDLE_VALUE; - DWORD bytesRead; - char buffer[1024]; - BOOL ret; + DWORD bytesRead, bytesWritten; + + ResultBuffer = KmtAllocateResultBuffer(LOGBUFFER_SIZE); + if (!ResultBuffer) + { + error = GetLastError(); + goto cleanup; + } hDevice = CreateFile(KMTEST_DEVICE_PATH, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); @@ -53,23 +62,19 @@ goto cleanup; } + if (!DeviceIoControl(hDevice, IOCTL_KMTEST_SET_RESULTBUFFER, ResultBuffer, FIELD_OFFSET(KMT_RESULTBUFFER, LogBuffer[LOGBUFFER_SIZE]), NULL, 0, &bytesRead, NULL)) + { + error = GetLastError(); + goto cleanup; + } + if (!DeviceIoControl(hDevice, IOCTL_KMTEST_RUN_TEST, testName, strlen(testName), NULL, 0, &bytesRead, NULL)) { error = GetLastError(); goto cleanup; } - while ((ret = ReadFile(hDevice, buffer, sizeof buffer - 1, &bytesRead, NULL)) != 0) - { - if (!bytesRead) - break; - - assert(bytesRead < sizeof buffer); - buffer[bytesRead] = '\0'; - - fputs(buffer, stdout); - } - if (!ret) + if (!WriteConsoleA(GetStdHandle(STD_OUTPUT_HANDLE), ResultBuffer->LogBuffer, ResultBuffer->LogBufferLength, &bytesWritten, NULL)) { error = GetLastError(); goto cleanup; @@ -78,6 +83,9 @@ cleanup: if (hDevice != INVALID_HANDLE_VALUE) CloseHandle(hDevice); + + if (ResultBuffer) + KmtFreeResultBuffer(ResultBuffer); return error; } @@ -89,7 +97,7 @@ DWORD bytesRead; PSTR buffer = NULL; DWORD bufferSize; - + if (!testList) { error = ERROR_INVALID_PARAMETER; @@ -104,7 +112,7 @@ error = GetLastError(); goto cleanup; } - + bufferSize = 1024; buffer = HeapAlloc(GetProcessHeap(), 0, bufferSize); if (!buffer) @@ -125,10 +133,10 @@ HeapFree(GetProcessHeap(), 0, buffer); buffer = NULL; } - + if (hDevice != INVALID_HANDLE_VALUE) CloseHandle(hDevice); - + if (testList) *testList = buffer; @@ -162,7 +170,7 @@ printf(" %s\n", testName); testName += len + 1; } - + /* TODO: user-mode test parts */ if (error) @@ -171,7 +179,7 @@ else { char *testName = argv[1]; - + if (argc > 2) fputs("Excess arguments ignored\n", stderr); Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild [iso-8859-1] Mon Jun 13 17:50:07 2011 @@ -4,6 +4,7 @@ <library>ntdll</library> <library>hal</library> <library>pseh</library> + <define name="KMT_KERNEL_MODE" /> <directory name="kmtest_drv"> <file>kmtest_drv.c</file> <file>log.c</file> Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/kmtest_drv.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/kmtest_drv.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/kmtest_drv.c [iso-8859-1] Mon Jun 13 17:50:07 2011 @@ -8,6 +8,7 @@ #include <ntddk.h> #include <ntstrsafe.h> #include <limits.h> +#include <pseh/pseh2.h> //#define NDEBUG #include <debug.h> @@ -19,9 +20,16 @@ /* Prototypes */ DRIVER_INITIALIZE DriverEntry; static DRIVER_UNLOAD DriverUnload; -static DRIVER_DISPATCH DriverCreateClose; +static DRIVER_DISPATCH DriverCreate; +static DRIVER_DISPATCH DriverClose; static DRIVER_DISPATCH DriverIoControl; -static DRIVER_DISPATCH DriverRead; + +/* Device Extension layout */ +typedef struct +{ + PKMT_RESULTBUFFER ResultBuffer; + PMDL Mdl; +} DEVICE_EXTENSION, *PDEVICE_EXTENSION; /* Globals */ static PDEVICE_OBJECT MainDeviceObject; @@ -43,6 +51,8 @@ { NTSTATUS Status = STATUS_SUCCESS; UNICODE_STRING DeviceName; + PDEVICE_EXTENSION DeviceExtension; + PAGED_CODE(); UNREFERENCED_PARAMETER(RegistryPath); @@ -55,7 +65,8 @@ goto cleanup; RtlInitUnicodeString(&DeviceName, L"\\Device\\Kmtest"); - Status = IoCreateDevice(DriverObject, 0, &DeviceName, FILE_DEVICE_UNKNOWN, + Status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION), &DeviceName, + FILE_DEVICE_UNKNOWN, FILE_DEVICE_SECURE_OPEN | FILE_READ_ONLY_DEVICE, TRUE, &MainDeviceObject); @@ -64,13 +75,14 @@ DPRINT("DriverEntry. Created DeviceObject %p\n", MainDeviceObject); - MainDeviceObject->Flags |= DO_DIRECT_IO; + DeviceExtension = MainDeviceObject->DeviceExtension; + DeviceExtension->ResultBuffer = NULL; + DeviceExtension->Mdl = NULL; DriverObject->DriverUnload = DriverUnload; - DriverObject->MajorFunction[IRP_MJ_CREATE] = DriverCreateClose; - DriverObject->MajorFunction[IRP_MJ_CLOSE] = DriverCreateClose; + DriverObject->MajorFunction[IRP_MJ_CREATE] = DriverCreate; + DriverObject->MajorFunction[IRP_MJ_CLOSE] = DriverClose; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = DriverIoControl; - DriverObject->MajorFunction[IRP_MJ_READ] = DriverRead; cleanup: if (MainDeviceObject && !NT_SUCCESS(Status)) @@ -100,15 +112,21 @@ DPRINT("DriverUnload\n"); if (MainDeviceObject) + { + PDEVICE_EXTENSION DeviceExtension = MainDeviceObject->DeviceExtension; + ASSERT(!DeviceExtension->Mdl); + ASSERT(!DeviceExtension->ResultBuffer); + ASSERT(!ResultBuffer); IoDeleteDevice(MainDeviceObject); + } LogFree(); } /** - * @name DriverCreateClose - * - * Driver Dispatch function for CreateFile/CloseHandle. + * @name DriverCreate + * + * Driver Dispatch function for CreateFile * * @param DeviceObject * Device Object @@ -117,18 +135,65 @@ * * @return Status */ -static NTSTATUS NTAPI DriverCreateClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) +static NTSTATUS NTAPI DriverCreate(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { NTSTATUS Status = STATUS_SUCCESS; PIO_STACK_LOCATION IoStackLocation; + PDEVICE_EXTENSION DeviceExtension; PAGED_CODE(); IoStackLocation = IoGetCurrentIrpStackLocation(Irp); - DPRINT("DriverCreateClose. Function=%s, DeviceObject=%p\n", - IoStackLocation->MajorFunction == IRP_MJ_CREATE ? "Create" : "Close", + DPRINT("DriverCreate. DeviceObject=%p\n", DeviceObject); + + DeviceExtension = DeviceObject->DeviceExtension; + ASSERT(!DeviceExtension->Mdl); + ASSERT(!DeviceExtension->ResultBuffer); + ASSERT(!ResultBuffer); + + Irp->IoStatus.Status = Status; + Irp->IoStatus.Information = 0; + + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return Status; +} + +/** + * @name DriverClose + * + * Driver Dispatch function for CloseHandle. + * + * @param DeviceObject + * Device Object + * @param Irp + * I/O request packet + * + * @return Status + */ +static NTSTATUS NTAPI DriverClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) +{ + NTSTATUS Status = STATUS_SUCCESS; + PIO_STACK_LOCATION IoStackLocation; + PDEVICE_EXTENSION DeviceExtension; + + PAGED_CODE(); + + IoStackLocation = IoGetCurrentIrpStackLocation(Irp); + + DPRINT("DriverClose. DeviceObject=%p\n", + DeviceObject); + + DeviceExtension = DeviceObject->DeviceExtension; + if (DeviceExtension->Mdl) + { + MmUnlockPages(DeviceExtension->Mdl); + IoFreeMdl(DeviceExtension->Mdl); + DeviceExtension->Mdl = NULL; + ResultBuffer = DeviceExtension->ResultBuffer = NULL; + } Irp->IoStatus.Status = Status; Irp->IoStatus.Information = 0; @@ -221,6 +286,48 @@ if (!TestEntry->TestName) Status = STATUS_OBJECT_NAME_INVALID; + break; + } + case IOCTL_KMTEST_SET_RESULTBUFFER: + { + PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension; + + DPRINT("DriverIoControl. IOCTL_KMTEST_SET_RESULTBUFFER, inlen=%lu, outlen=%lu\n", + IoStackLocation->Parameters.DeviceIoControl.InputBufferLength, + IoStackLocation->Parameters.DeviceIoControl.OutputBufferLength); + + if (DeviceExtension->Mdl) + { + MmUnlockPages(DeviceExtension->Mdl); + IoFreeMdl(DeviceExtension->Mdl); + } + + DeviceExtension->Mdl = IoAllocateMdl(IoStackLocation->Parameters.DeviceIoControl.Type3InputBuffer, + IoStackLocation->Parameters.DeviceIoControl.InputBufferLength, + FALSE, FALSE, NULL); + if (!DeviceExtension->Mdl) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + break; + } + + _SEH2_TRY + { + MmProbeAndLockPages(DeviceExtension->Mdl, KernelMode, IoModifyAccess); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + IoFreeMdl(DeviceExtension->Mdl); + DeviceExtension->Mdl = NULL; + break; + } _SEH2_END; + + ResultBuffer = DeviceExtension->ResultBuffer = MmGetSystemAddressForMdlSafe(DeviceExtension->Mdl, NormalPagePriority); + + DPRINT("DriverIoControl. ResultBuffer: %ld %ld %ld %ld\n", + ResultBuffer->Successes, ResultBuffer->Failures, + ResultBuffer->LogBufferLength, ResultBuffer->LogBufferMaxLength); break; } default: @@ -237,46 +344,3 @@ return Status; } - -/** - * @name DriverRead - * - * Driver Dispatch function for ReadFile. - * - * @param DeviceObject - * Device Object - * @param Irp - * I/O request packet - * - * @return Status - */ -static NTSTATUS NTAPI DriverRead(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) -{ - NTSTATUS Status = STATUS_SUCCESS; - PIO_STACK_LOCATION IoStackLocation; - PVOID ReadBuffer; - SIZE_T Length; - - PAGED_CODE(); - - IoStackLocation = IoGetCurrentIrpStackLocation(Irp); - - DPRINT("DriverRead. Offset=%I64u, Length=%lu, DeviceObject=%p\n", - IoStackLocation->Parameters.Read.ByteOffset.QuadPart, - IoStackLocation->Parameters.Read.Length, - DeviceObject); - - ReadBuffer = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority); - - Length = LogRead(ReadBuffer, IoStackLocation->Parameters.Read.Length); - - DPRINT("DriverRead. Length of data read: %lu\n", - Length); - - Irp->IoStatus.Status = Status; - Irp->IoStatus.Information = Length; - - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return Status; -} Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/log.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/log.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/log.c [iso-8859-1] Mon Jun 13 17:50:07 2011 @@ -9,14 +9,8 @@ #include <ntstrsafe.h> #include <kmt_log.h> - -#define LOGBUFFER_MAX (1024UL * 1024) -static PCHAR LogBuffer; -static SIZE_T LogOffset; - -#define LOG_TAG 'LtmK' - -/* TODO: allow concurrent log buffer access */ +#define KMT_DEFINE_TEST_FUNCTIONS +#include <kmt_test.h> /** * @name LogInit @@ -29,11 +23,6 @@ { NTSTATUS Status = STATUS_SUCCESS; PAGED_CODE(); - - LogBuffer = ExAllocatePoolWithTag(NonPagedPool, LOGBUFFER_MAX, LOG_TAG); - - if (!LogBuffer) - Status = STATUS_INSUFFICIENT_RESOURCES; return Status; } @@ -48,8 +37,6 @@ VOID LogFree(VOID) { PAGED_CODE(); - - ExFreePoolWithTag(LogBuffer, LOG_TAG); } /** @@ -64,10 +51,10 @@ */ VOID LogPrint(IN PCSTR Message) { - SIZE_T MessageLength = strlen(Message); - ASSERT(LogOffset + MessageLength + 1 < LOGBUFFER_MAX); - RtlCopyMemory(&LogBuffer[LogOffset], Message, MessageLength + 1); - LogOffset += MessageLength; + size_t MessageLength; + ASSERT(NT_SUCCESS(RtlStringCbLengthA(Message, 512, &MessageLength))); + + KmtAddToLogBuffer(ResultBuffer, Message, MessageLength); } /** @@ -105,47 +92,11 @@ */ VOID LogVPrintF(IN PCSTR Format, va_list Arguments) { - CHAR Buffer[1024]; - SIZE_T BufferLength; + CHAR Buffer[512]; /* TODO: make this work from any IRQL */ PAGED_CODE(); RtlStringCbVPrintfA(Buffer, sizeof Buffer, Format, Arguments); - BufferLength = strlen(Buffer); - ASSERT(LogOffset + BufferLength + 1 < LOGBUFFER_MAX); - RtlCopyMemory(&LogBuffer[LogOffset], Buffer, BufferLength + 1); - LogOffset += BufferLength; + LogPrint(Buffer); } - -/** - * @name LogRead - * - * Retrieve data from the log buffer. - * - * @param Buffer - * Buffer to copy log data to - * @param BufferSize - * Maximum number of bytes to copy - * - * @return Number of bytes copied - */ -SIZE_T LogRead(OUT PVOID Buffer, IN SIZE_T BufferSize) -{ - SIZE_T Size; - PAGED_CODE(); - - Size = min(BufferSize, LogOffset); - RtlCopyMemory(Buffer, LogBuffer, Size); - - if (BufferSize < LogOffset) - { - SIZE_T SizeLeft = LogOffset - BufferSize; - RtlMoveMemory(LogBuffer, &LogBuffer[LogOffset], SizeLeft); - LogOffset = SizeLeft; - } - else - LogOffset = 0; - - return Size; -} Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c [iso-8859-1] Mon Jun 13 17:50:07 2011 @@ -5,7 +5,7 @@ * PROGRAMMER: Thomas Faber <thfabba(a)gmx.de> */ -#include <stddef.h> +#include <ntddk.h> #include <kmt_test.h> KMT_TESTFUNC Test_Example;
13 years, 6 months
1
0
0
0
[tfaber] 52215: [KMTESTS] - add a minimal example test so there's something to see when running kmtest - remove _DLL and __USE_CRTIMP in accordance with r52213
by tfaber@svn.reactos.org
Author: tfaber Date: Mon Jun 13 17:29:02 2011 New Revision: 52215 URL:
http://svn.reactos.org/svn/reactos?rev=52215&view=rev
Log: [KMTESTS] - add a minimal example test so there's something to see when running kmtest - remove _DLL and __USE_CRTIMP in accordance with r52213 Added: branches/GSoC_2011/KMTestSuite/kmtests/example/ (with props) branches/GSoC_2011/KMTestSuite/kmtests/example/Example.c (with props) Modified: branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c Modified: branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/C…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/CMakeLists.txt [iso-8859-1] Mon Jun 13 17:29:02 2011 @@ -14,6 +14,8 @@ kmtest_drv/log.c kmtest_drv/testlist.c + example/Example.c + kmtest_drv/kmtest_drv.rc) add_library(kmtest_drv SHARED ${KMTEST_DRV_SOURCE}) @@ -29,8 +31,6 @@ # set_rc_compiler() -add_definitions(-D_DLL -D__USE_CRTIMP) - list(APPEND KMTEST_SOURCE kmtest/kmtest.c kmtest/service.c Propchange: branches/GSoC_2011/KMTestSuite/kmtests/example/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Mon Jun 13 17:29:02 2011 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: branches/GSoC_2011/KMTestSuite/kmtests/example/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: branches/GSoC_2011/KMTestSuite/kmtests/example/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: branches/GSoC_2011/KMTestSuite/kmtests/example/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: branches/GSoC_2011/KMTestSuite/kmtests/example/Example.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/e…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/example/Example.c (added) +++ branches/GSoC_2011/KMTestSuite/kmtests/example/Example.c [iso-8859-1] Mon Jun 13 17:29:02 2011 @@ -1,0 +1,16 @@ +/* + * PROJECT: ReactOS kernel-mode tests + * LICENSE: GPLv2+ - See COPYING in the top level directory + * PURPOSE: Kernel-Mode Test Suite Example Test kernel-mode part + * PROGRAMMER: Thomas Faber <thfabba(a)gmx.de> + */ + +#include <ntddk.h> +#include <kmt_test.h> +#include <kmt_log.h> + +VOID Test_Example(VOID) +{ + /* TODO: this should be trace(), as in winetests */ + LogPrint("Message from kernel\n"); +} Propchange: branches/GSoC_2011/KMTestSuite/kmtests/example/Example.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv.rbuild [iso-8859-1] Mon Jun 13 17:29:02 2011 @@ -9,4 +9,7 @@ <file>log.c</file> <file>testlist.c</file> </directory> + <directory name="example"> + <file>Example.c</file> + </directory> </module> Modified: branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/KMTestSuite/kmtests/k…
============================================================================== --- branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c [iso-8859-1] (original) +++ branches/GSoC_2011/KMTestSuite/kmtests/kmtest_drv/testlist.c [iso-8859-1] Mon Jun 13 17:29:02 2011 @@ -8,7 +8,10 @@ #include <stddef.h> #include <kmt_test.h> +KMT_TESTFUNC Test_Example; + const KMT_TEST TestList[] = { + { "Example", Test_Example }, { NULL, NULL } };
13 years, 6 months
1
0
0
0
← Newer
1
...
25
26
27
28
29
30
31
...
46
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
Results per page:
10
25
50
100
200