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
2025
January
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
April 2007
----- 2025 -----
January 2025
----- 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
19 participants
380 discussions
Start a n
N
ew thread
[tretiakov] 26233: Implement NtUserUnloadKeyboardLayout()
by tretiakov@svn.reactos.org
Author: tretiakov Date: Sun Apr 1 21:30:44 2007 New Revision: 26233 URL:
http://svn.reactos.org/svn/reactos?rev=26233&view=rev
Log: Implement NtUserUnloadKeyboardLayout() Modified: trunk/reactos/include/reactos/win32k/ntuser.h trunk/reactos/subsystems/win32/win32k/include/input.h trunk/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c Modified: trunk/reactos/include/reactos/win32k/ntuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
============================================================================== --- trunk/reactos/include/reactos/win32k/ntuser.h (original) +++ trunk/reactos/include/reactos/win32k/ntuser.h Sun Apr 1 21:30:44 2007 @@ -1923,10 +1923,10 @@ NtUserUnhookWinEvent( DWORD Unknown0); -DWORD +BOOL NTAPI NtUserUnloadKeyboardLayout( - DWORD Unknown0); + HKL hKl); BOOL NTAPI Modified: trunk/reactos/subsystems/win32/win32k/include/input.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/input.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/input.h Sun Apr 1 21:30:44 2007 @@ -15,8 +15,9 @@ DWORD klid; // Low word - language id. High word - device id. } KBL, *PKBL; -#define KBL_UNLOADED 0x20000000 -#define KBL_RESET 0x40000000 +#define KBL_UNLOAD 1 +#define KBL_PRELOAD 2 +#define KBL_RESET 4 NTSTATUS FASTCALL InitInputImpl(VOID); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/kbdlayout.c Sun Apr 1 21:30:44 2007 @@ -156,7 +156,7 @@ RtlFreeUnicodeString(&LayoutFile); *phModule = EngLoadImage(FullLayoutPath.Buffer); - + if(*phModule) { DPRINT("Loaded %wZ\n", &FullLayoutPath); @@ -262,6 +262,8 @@ } } + KBLList->Flags |= KBL_PRELOAD; + InitializeListHead(&KBLList->List); return TRUE; } @@ -318,17 +320,56 @@ return NULL; } -static PKBL co_UserActivateKbl(PW32THREAD Thread, PKBL pKbl) +BOOL UserUnloadKbl(PKBL pKbl) +{ + /* According to msdn, UnloadKeyboardLayout can fail + if the keyboard layout identifier was preloaded. */ + + if(pKbl->Flags & KBL_PRELOAD) + { + DPRINT1("Attempted to unload preloaded keyboard layout.\n"); + return FALSE; + } + + if(pKbl->RefCount > 0) + { + /* Layout is used by other threads. + Mark it as unloaded and don't do anything else. */ + pKbl->Flags |= KBL_UNLOAD; + } + else + { + //Unload the layout + EngUnloadImage(pKbl->hModule); + RemoveEntryList(&pKbl->List); + ExFreePool(pKbl); + } + + return TRUE; +} + +static PKBL co_UserActivateKbl(PW32THREAD w32Thread, PKBL pKbl, UINT Flags) { PKBL Prev; - Prev = Thread->KeyboardLayout; + Prev = w32Thread->KeyboardLayout; Prev->RefCount--; - Thread->KeyboardLayout = pKbl; + w32Thread->KeyboardLayout = pKbl; pKbl->RefCount++; + if(Flags & KLF_SETFORPROCESS) + { + //FIXME + + } + + if(Prev->Flags & KBL_UNLOAD && Prev->RefCount == 0) + { + UserUnloadKbl(Prev); + } + // Send WM_INPUTLANGCHANGE to thread's focus window - co_IntSendMessage(Thread->MessageQueue->FocusWindow, + co_IntSendMessage(w32Thread->MessageQueue->FocusWindow, WM_INPUTLANGCHANGE, 0, // FIXME: put charset here (what is this?) (LPARAM)pKbl->hkl); //klid @@ -394,10 +435,13 @@ while(Ret < nItems) { - pHklBuff[Ret] = pKbl->hkl; - Ret++; - pKbl = (PKBL) pKbl->List.Flink; - if(pKbl == KBLList) break; + if(!(pKbl->Flags & KBL_UNLOAD)) + { + pHklBuff[Ret] = pKbl->hkl; + Ret++; + pKbl = (PKBL) pKbl->List.Flink; + if(pKbl == KBLList) break; + } } } @@ -457,18 +501,21 @@ UserEnterExclusive(); + //Let's see if layout was already loaded. Cur = KBLList; do { if(Cur->klid == dwKLID) { pKbl = Cur; + pKbl->Flags &= ~KBL_UNLOAD; break; } Cur = (PKBL) Cur->List.Flink; } while(Cur != KBLList); + //It wasn't, so load it. if(!pKbl) { pKbl = UserLoadDllAndCreateKbl(dwKLID); @@ -485,14 +532,14 @@ if(Flags & KLF_ACTIVATE) { - co_UserActivateKbl(PsGetCurrentThreadWin32Thread(), pKbl); + co_UserActivateKbl(PsGetCurrentThreadWin32Thread(), pKbl, Flags); } Ret = pKbl->hkl; - //FIXME: Respect Flags! - // KLF_NOTELLSHELL KLF_SETFORPROCESS - // KLF_REPLACELANG KLF_SUBSTITUTE_OK + //FIXME: KLF_NOTELLSHELL + // KLF_REPLACELANG + // KLF_SUBSTITUTE_OK the_end: UserLeave(); @@ -530,7 +577,6 @@ else pKbl = UserHklToKbl(hKl); //FIXME: KLF_RESET, KLF_SHIFTLOCK - //FIXME: KLF_SETFORPROCESS if(pKbl) { @@ -543,9 +589,13 @@ } else { - pKbl = co_UserActivateKbl(pWThread, pKbl); + pKbl = co_UserActivateKbl(pWThread, pKbl, Flags); Ret = pKbl->hkl; } + } + else + { + DPRINT1("%s: Invalid HKL %x!\n", __FUNCTION__, hKl); } the_end: @@ -553,5 +603,27 @@ return Ret; } +BOOL +STDCALL +NtUserUnloadKeyboardLayout( + HKL hKl) +{ + PKBL pKbl; + BOOL Ret = FALSE; + + UserEnterExclusive(); + + if((pKbl = UserHklToKbl(hKl))) + { + Ret = UserUnloadKbl(pKbl); + } + else + { + DPRINT1("%s: Invalid HKL %x!\n", __FUNCTION__, hKl); + } + + UserLeave(); + return Ret; +} /* EOF */ Modified: trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c Sun Apr 1 21:30:44 2007 @@ -616,16 +616,6 @@ return 0; } -DWORD -STDCALL -NtUserUnloadKeyboardLayout( - DWORD Unknown0) -{ - UNIMPLEMENTED - - return 0; -} - DWORD STDCALL
17 years, 9 months
1
0
0
0
[tretiakov] 26232: Add missing check
by tretiakov@svn.reactos.org
Author: tretiakov Date: Sun Apr 1 21:27:59 2007 New Revision: 26232 URL:
http://svn.reactos.org/svn/reactos?rev=26232&view=rev
Log: Add missing check Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ex/sysinfo.c (original) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c Sun Apr 1 21:27:59 2007 @@ -1322,6 +1322,9 @@ if(Size != sizeof(PVOID)) return STATUS_INFO_LENGTH_MISMATCH; + if(KeGetPreviousMode() != KernelMode) + return STATUS_PRIVILEGE_NOT_HELD; + // Scan the module list NextEntry = PsLoadedModuleList.Flink; while(NextEntry != &PsLoadedModuleList)
17 years, 9 months
1
0
0
0
[tretiakov] 26231: Implement EngUnloadImage
by tretiakov@svn.reactos.org
Author: tretiakov Date: Sun Apr 1 21:20:50 2007 New Revision: 26231 URL:
http://svn.reactos.org/svn/reactos?rev=26231&view=rev
Log: Implement EngUnloadImage Modified: trunk/reactos/subsystems/win32/win32k/ldr/loader.c Modified: trunk/reactos/subsystems/win32/win32k/ldr/loader.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ld…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ldr/loader.c (original) +++ trunk/reactos/subsystems/win32/win32k/ldr/loader.c Sun Apr 1 21:20:50 2007 @@ -213,10 +213,28 @@ // FIXME: should load as readonly RtlInitUnicodeString (&GdiDriverInfo.DriverName, ModuleName); - Status = ZwSetSystemInformation (SystemLoadGdiDriverInformation, &GdiDriverInfo, sizeof(SYSTEM_GDI_DRIVER_INFORMATION)); + Status = ZwSetSystemInformation (SystemLoadGdiDriverInformation, + &GdiDriverInfo, sizeof(SYSTEM_GDI_DRIVER_INFORMATION)); if (!NT_SUCCESS(Status)) return NULL; return (HANDLE)GdiDriverInfo.ImageAddress; } +VOID +STDCALL +EngUnloadImage ( IN HANDLE hModule ) +{ + NTSTATUS Status; + + DPRINT1("hModule=%x\n", hModule); + Status = ZwSetSystemInformation(SystemUnloadGdiDriverInformation, + &hModule, sizeof(HANDLE)); + + if(!NT_SUCCESS(Status)) + { + DPRINT1("%s: ZwSetSystemInformation failed with status %x.", + __FUNCTION__, Status); + } +} + /* EOF */
17 years, 9 months
1
0
0
0
[tretiakov] 26230: Implement EngUnloadImage()
by tretiakov@svn.reactos.org
Author: tretiakov Date: Sun Apr 1 21:15:58 2007 New Revision: 26230 URL:
http://svn.reactos.org/svn/reactos?rev=26230&view=rev
Log: Implement EngUnloadImage() Modified: trunk/reactos/subsystems/win32/win32k/stubs/stubs.c Modified: trunk/reactos/subsystems/win32/win32k/stubs/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/st…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/stubs/stubs.c (original) +++ trunk/reactos/subsystems/win32/win32k/stubs/stubs.c Sun Apr 1 21:15:58 2007 @@ -491,13 +491,6 @@ return FALSE; } -VOID -STDCALL -EngUnloadImage ( IN HANDLE hModule ) -{ - //
www.osr.com/ddk/graphics/gdifncs_586f.htm
- UNIMPLEMENTED; -} INT STDCALL
17 years, 9 months
1
0
0
0
[tretiakov] 26229: Implement SystemUnloadGdiDriverInformation
by tretiakov@svn.reactos.org
Author: tretiakov Date: Sun Apr 1 21:15:08 2007 New Revision: 26229 URL:
http://svn.reactos.org/svn/reactos?rev=26229&view=rev
Log: Implement SystemUnloadGdiDriverInformation Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/ex/sysinfo.c (original) +++ trunk/reactos/ntoskrnl/ex/sysinfo.c Sun Apr 1 21:15:08 2007 @@ -1314,10 +1314,42 @@ /* Class 27 - Unload Image */ SSI_DEF(SystemUnloadGdiDriverInformation) -{ - /* FIXME: TODO */ - if (Size != sizeof(PVOID)) return STATUS_INFO_LENGTH_MISMATCH; - return STATUS_NOT_IMPLEMENTED; +{ + PLDR_DATA_TABLE_ENTRY LdrEntry; + PLIST_ENTRY NextEntry; + PVOID BaseAddr = *((PVOID*)Buffer); + + if(Size != sizeof(PVOID)) + return STATUS_INFO_LENGTH_MISMATCH; + + // Scan the module list + NextEntry = PsLoadedModuleList.Flink; + while(NextEntry != &PsLoadedModuleList) + { + LdrEntry = CONTAINING_RECORD(NextEntry, + LDR_DATA_TABLE_ENTRY, + InLoadOrderLinks); + + if (LdrEntry->DllBase == BaseAddr) + { + // Found it. + break; + } + + NextEntry = NextEntry->Flink; + } + + // Check if we found the image + if(NextEntry != &PsLoadedModuleList) + { + return MmUnloadSystemImage(LdrEntry); + } + else + { + DPRINT1("Image 0x%x not found.\n", BaseAddr); + return STATUS_DLL_NOT_FOUND; + } + } /* Class 28 - Time Adjustment Information */
17 years, 9 months
1
0
0
0
[tretiakov] 26228: Fix build
by tretiakov@svn.reactos.org
Author: tretiakov Date: Sun Apr 1 21:14:24 2007 New Revision: 26228 URL:
http://svn.reactos.org/svn/reactos?rev=26228&view=rev
Log: Fix build Modified: trunk/rostests/tests/D3DParseUnknownCommand_show/D3DParseUnknownCommand_show.rbuild trunk/rostests/win32/kernel32/tests/kernel32.rbuild Modified: trunk/rostests/tests/D3DParseUnknownCommand_show/D3DParseUnknownCommand_show.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/tests/D3DParseUnknownComm…
============================================================================== --- trunk/rostests/tests/D3DParseUnknownCommand_show/D3DParseUnknownCommand_show.rbuild (original) +++ trunk/rostests/tests/D3DParseUnknownCommand_show/D3DParseUnknownCommand_show.rbuild Sun Apr 1 21:14:24 2007 @@ -5,7 +5,7 @@ <library>kernel32</library> <library>gdi32</library> <library>ddraw</library> - <library>string</library> + <library>libcntpr</library> <library>user32</library> <file>main.c</file> </module> Modified: trunk/rostests/win32/kernel32/tests/kernel32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/win32/kernel32/tests/kern…
============================================================================== --- trunk/rostests/win32/kernel32/tests/kernel32.rbuild (original) +++ trunk/rostests/win32/kernel32/tests/kernel32.rbuild Sun Apr 1 21:14:24 2007 @@ -11,7 +11,7 @@ <library>regtests</library> <library>kernel32_base</library> <library>pseh</library> - <library>intrlck</library> + <library>libcntpr</library> <library>msvcrt</library> <linkerflag>-lgcc</linkerflag> <linkerflag>-nostartfiles</linkerflag>
17 years, 9 months
1
0
0
0
[fireball] 26227: - Remove audit brake / svn:needs-lock property, since these drivers are going to become svn history soon.
by fireball@svn.reactos.org
Author: fireball Date: Sun Apr 1 20:29:16 2007 New Revision: 26227 URL:
http://svn.reactos.org/svn/reactos?rev=26227&view=rev
Log: - Remove audit brake / svn:needs-lock property, since these drivers are going to become svn history soon. Modified: trunk/reactos/drivers/storage/atapi/atapi.c (props changed) trunk/reactos/drivers/storage/atapi/atapi.h (props changed) trunk/reactos/drivers/storage/atapi/atapi.rc (props changed) trunk/reactos/drivers/storage/cdrom/cdrom.c (props changed) trunk/reactos/drivers/storage/cdrom/cdrom.rc (props changed) trunk/reactos/drivers/storage/class2/class2.c (props changed) trunk/reactos/drivers/storage/class2/class2.def (props changed) trunk/reactos/drivers/storage/class2/class2.rc (props changed) trunk/reactos/drivers/storage/include/class2.h (props changed) Propchange: trunk/reactos/drivers/storage/atapi/atapi.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/storage/atapi/atapi.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/storage/atapi/atapi.rc ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/storage/cdrom/cdrom.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/storage/cdrom/cdrom.rc ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/storage/class2/class2.c ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/storage/class2/class2.def ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/storage/class2/class2.rc ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -* Propchange: trunk/reactos/drivers/storage/include/class2.h ------------------------------------------------------------------------------ --- svn:needs-lock (original) +++ svn:needs-lock (removed) @@ -1,1 +1,0 @@ -*
17 years, 9 months
1
0
0
0
[fireball] 26226: - Move handlers of SRB_FUNCTION_ATTACH and RELEASE to a standalone function, and don't do reference/dereference of the DeviceObject - Implement RELEASE_QUEUE and FLUSH_QUEUE srb functions - Turn off DPRINTs, since scsiport seems to finally work (without advanced features, but enough to install and boot using ATAPI and DISK drivers)!
by fireball@svn.reactos.org
Author: fireball Date: Sun Apr 1 16:13:55 2007 New Revision: 26226 URL:
http://svn.reactos.org/svn/reactos?rev=26226&view=rev
Log: - Move handlers of SRB_FUNCTION_ATTACH and RELEASE to a standalone function, and don't do reference/dereference of the DeviceObject - Implement RELEASE_QUEUE and FLUSH_QUEUE srb functions - Turn off DPRINTs, since scsiport seems to finally work (without advanced features, but enough to install and boot using ATAPI and DISK drivers)! Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport-n…
============================================================================== --- trunk/reactos/drivers/storage/scsiport-new/scsiport.c (original) +++ trunk/reactos/drivers/storage/scsiport-new/scsiport.c Sun Apr 1 16:13:55 2007 @@ -37,17 +37,14 @@ #include <stdio.h> #include <stdarg.h> -//#define NDEBUG +#define NDEBUG #include <debug.h> #include "scsiport_int.h" +ULONG InternalDebugLevel = 0; + /* TYPES *********************************************************************/ - -#define IRP_FLAG_COMPLETE 0x00000001 -#define IRP_FLAG_NEXT 0x00000002 -#define IRP_FLAG_NEXT_LU 0x00000004 - /* GLOBALS *******************************************************************/ @@ -200,6 +197,10 @@ static VOID SpiCleanupAfterInit(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension); + +static NTSTATUS +SpiHandleAttachRelease(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, + PIRP Irp); /* FUNCTIONS *****************************************************************/ @@ -265,19 +266,17 @@ IN PCHAR DebugMessage, ...) { - char Buffer[256]; - va_list ap; - -#if 0 - if (DebugPrintLevel > InternalDebugLevel) - return; -#endif - - va_start(ap, DebugMessage); - vsprintf(Buffer, DebugMessage, ap); - va_end(ap); - - DbgPrint(Buffer); + char Buffer[256]; + va_list ap; + + if (DebugPrintLevel > InternalDebugLevel) + return; + + va_start(ap, DebugMessage); + vsprintf(Buffer, DebugMessage, ap); + va_end(ap); + + DbgPrint(Buffer); } @@ -1726,12 +1725,13 @@ DPRINT1 ("Notify: NextLuRequest(PathId %u TargetId %u Lun %u)\n", PathId, TargetId, Lun); /* FIXME: Implement it! */ - - DeviceExtension->IrpFlags |= IRP_FLAG_NEXT; + ASSERT(FALSE); + +// DeviceExtension->IrpFlags |= IRP_FLAG_NEXT; // DeviceExtension->IrpFlags |= IRP_FLAG_NEXT_LU; /* Hack! */ - DeviceExtension->IrpFlags |= IRP_FLAG_NEXT; +// DeviceExtension->IrpFlags |= IRP_FLAG_NEXT; } break; @@ -2186,6 +2186,88 @@ return(STATUS_SUCCESS); } +static NTSTATUS +SpiHandleAttachRelease(PSCSI_PORT_DEVICE_EXTENSION DeviceExtension, + PIRP Irp) +{ + PSCSI_LUN_INFO LunInfo; + PIO_STACK_LOCATION IrpStack; + PDEVICE_OBJECT DeviceObject; + PSCSI_REQUEST_BLOCK Srb; + KIRQL Irql; + + /* Get pointer to the SRB */ + IrpStack = IoGetCurrentIrpStackLocation(Irp); + Srb = (PSCSI_REQUEST_BLOCK)IrpStack->Parameters.Others.Argument1; + + /* Check if PathId matches number of buses */ + if (DeviceExtension->BusesConfig == NULL || + DeviceExtension->BusesConfig->NumberOfBuses <= Srb->PathId) + { + Srb->SrbStatus = SRB_STATUS_NO_DEVICE; + return STATUS_DEVICE_DOES_NOT_EXIST; + } + + /* Get pointer to LunInfo */ + LunInfo = DeviceExtension->BusesConfig->BusScanInfo[Srb->PathId]->LunInfo; + + /* Find matching LunInfo */ + while (LunInfo) + { + if (LunInfo->PathId == Srb->PathId && + LunInfo->TargetId == Srb->TargetId && + LunInfo->Lun == Srb->Lun) + { + break; + } + + LunInfo = LunInfo->Next; + } + + /* If we couldn't find it - exit */ + if (LunInfo == NULL) + return STATUS_DEVICE_DOES_NOT_EXIST; + + + /* Get spinlock */ + KeAcquireSpinLock(&DeviceExtension->SpinLock, &Irql); + + /* Release, if asked */ + if (Srb->Function == SRB_FUNCTION_RELEASE_DEVICE) + { + LunInfo->DeviceClaimed = FALSE; + KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql); + Srb->SrbStatus = SRB_STATUS_SUCCESS; + + return STATUS_SUCCESS; + } + + /* Attach, if not already claimed */ + if (LunInfo->DeviceClaimed) + { + KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql); + Srb->SrbStatus = SRB_STATUS_BUSY; + + return STATUS_DEVICE_BUSY; + } + + /* Save the device object */ + DeviceObject = LunInfo->DeviceObject; + + if (Srb->Function == SRB_FUNCTION_CLAIM_DEVICE) + LunInfo->DeviceClaimed = TRUE; + + if (Srb->Function == SRB_FUNCTION_ATTACH_DEVICE) + LunInfo->DeviceObject = Srb->DataBuffer; + + Srb->DataBuffer = DeviceObject; + + KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql); + Srb->SrbStatus = SRB_STATUS_SUCCESS; + + return STATUS_SUCCESS; +} + /********************************************************************** * NAME INTERNAL @@ -2212,7 +2294,10 @@ PSCSI_PORT_LUN_EXTENSION LunExtension; PIO_STACK_LOCATION Stack; PSCSI_REQUEST_BLOCK Srb; + KIRQL Irql; NTSTATUS Status = STATUS_SUCCESS; + PIRP NextIrp, IrpList; + PKDEVICE_QUEUE_ENTRY Entry; DPRINT("ScsiPortDispatchScsi(DeviceObject %p Irp %p)\n", DeviceObject, Irp); @@ -2239,9 +2324,9 @@ DPRINT("PathId: %lu TargetId: %lu Lun: %lu\n", Srb->PathId, Srb->TargetId, Srb->Lun); LunExtension = SpiGetLunExtension(DeviceExtension, - Srb->PathId, - Srb->TargetId, - Srb->Lun); + Srb->PathId, + Srb->TargetId, + Srb->Lun); if (LunExtension == NULL) { DPRINT("ScsiPortDispatchScsi() called with an invalid LUN\n"); @@ -2261,7 +2346,7 @@ case SRB_FUNCTION_SHUTDOWN: case SRB_FUNCTION_FLUSH: DPRINT (" SRB_FUNCTION_SHUTDOWN or FLUSH\n"); - if (DeviceExtension->PortConfig->CachesData == FALSE) + if (DeviceExtension->CachesData == FALSE) { /* All success here */ Srb->SrbStatus = SRB_STATUS_SUCCESS; @@ -2289,11 +2374,11 @@ KeRaiseIrql (DISPATCH_LEVEL, &oldIrql); /* Insert IRP into the queue */ - if (!KeInsertByKeyDeviceQueue (&LunExtension->DeviceQueue, + if (!KeInsertByKeyDeviceQueue(&LunExtension->DeviceQueue, &Irp->Tail.Overlay.DeviceQueueEntry, Srb->QueueSortKey)) { - /* It means queue is empty, and we just start this request */ + /* It means the queue is empty, and we just start this request */ IoStartPacket(DeviceObject, Irp, NULL, NULL); } @@ -2307,23 +2392,106 @@ DPRINT (" SRB_FUNCTION_CLAIM_DEVICE or ATTACH\n"); /* Reference device object and keep the device object */ - /* TODO: Check if it's OK */ - ObReferenceObject(DeviceObject); - LunExtension->DeviceObject = DeviceObject; - LunExtension->DeviceClaimed = TRUE; - Srb->DataBuffer = DeviceObject; + Status = SpiHandleAttachRelease(DeviceExtension, Irp); break; case SRB_FUNCTION_RELEASE_DEVICE: DPRINT (" SRB_FUNCTION_RELEASE_DEVICE\n"); - /* TODO: Check if it's OK */ - DPRINT ("PathId: %lu TargetId: %lu Lun: %lu\n", - Srb->PathId, Srb->TargetId, Srb->Lun); /* Dereference device object and clear the device object */ - ObDereferenceObject(LunExtension->DeviceObject); - LunExtension->DeviceObject = NULL; - LunExtension->DeviceClaimed = FALSE; + Status = SpiHandleAttachRelease(DeviceExtension, Irp); + break; + + case SRB_FUNCTION_RELEASE_QUEUE: + DPRINT(" SRB_FUNCTION_RELEASE_QUEUE\n"); + + /* Guard with the spinlock */ + KeAcquireSpinLock(&DeviceExtension->SpinLock, &Irql); + + if (!(LunExtension->Flags & LUNEX_FROZEN_QUEUE)) + { + DPRINT("Queue is not frozen really\n"); + + KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql); + Srb->SrbStatus = SRB_STATUS_SUCCESS; + Status = STATUS_SUCCESS; + break; + + } + + /* Unfreeze the queue */ + LunExtension->Flags &= ~LUNEX_FROZEN_QUEUE; + + if (LunExtension->SrbInfo.Srb == NULL) + { + /* Get next logical unit request */ + SpiGetNextRequestFromLun(DeviceExtension, LunExtension); + KeLowerIrql(Irql); + } + else + { + DPRINT("The queue has active request\n"); + KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql); + } + + + Srb->SrbStatus = SRB_STATUS_SUCCESS; + Status = STATUS_SUCCESS; + break; + + case SRB_FUNCTION_FLUSH_QUEUE: + DPRINT(" SRB_FUNCTION_FLUSH_QUEUE\n"); + + /* Guard with the spinlock */ + KeAcquireSpinLock(&DeviceExtension->SpinLock, &Irql); + + if (!(LunExtension->Flags & LUNEX_FROZEN_QUEUE)) + { + DPRINT("Queue is not frozen really\n"); + + KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql); + Status = STATUS_INVALID_DEVICE_REQUEST; + break; + } + + /* Make sure there is no active request */ + ASSERT(LunExtension->SrbInfo.Srb == NULL); + + /* Compile a list from the device queue */ + IrpList = NULL; + while ((Entry = KeRemoveDeviceQueue(&LunExtension->DeviceQueue)) != NULL) + { + NextIrp = CONTAINING_RECORD(Entry, IRP, Tail.Overlay.DeviceQueueEntry); + + /* Get the Srb */ + Stack = IoGetCurrentIrpStackLocation(NextIrp); + Srb = Stack->Parameters.Scsi.Srb; + + /* Set statuse */ + Srb->SrbStatus = SRB_STATUS_REQUEST_FLUSHED; + NextIrp->IoStatus.Status = STATUS_UNSUCCESSFUL; + + /* Add then to the list */ + NextIrp->Tail.Overlay.ListEntry.Flink = (PLIST_ENTRY)IrpList; + IrpList = NextIrp; + } + + /* Unfreeze the queue */ + LunExtension->Flags &= ~LUNEX_FROZEN_QUEUE; + + /* Release the spinlock */ + KeReleaseSpinLock(&DeviceExtension->SpinLock, Irql); + + /* Complete those requests */ + while (IrpList) + { + NextIrp = IrpList; + IrpList = (PIRP)NextIrp->Tail.Overlay.ListEntry.Flink; + + IoCompleteRequest(NextIrp, 0); + } + + Status = STATUS_SUCCESS; break; default:
17 years, 9 months
1
0
0
0
[fireball] 26225: - More DPRINTs added to ease debugging - Bugfixes: IOCTL_SCSI_GET_CAPABILITIES fixed, setting inquiry operation in CDB fixed, storing information about bus scanning fixed
by fireball@svn.reactos.org
Author: fireball Date: Sun Apr 1 15:17:48 2007 New Revision: 26225 URL:
http://svn.reactos.org/svn/reactos?rev=26225&view=rev
Log: - More DPRINTs added to ease debugging - Bugfixes: IOCTL_SCSI_GET_CAPABILITIES fixed, setting inquiry operation in CDB fixed, storing information about bus scanning fixed Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c Modified: trunk/reactos/drivers/storage/scsiport-new/scsiport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport-n…
============================================================================== --- trunk/reactos/drivers/storage/scsiport-new/scsiport.c (original) +++ trunk/reactos/drivers/storage/scsiport-new/scsiport.c Sun Apr 1 15:17:48 2007 @@ -839,6 +839,7 @@ DriverObject->MajorFunction[IRP_MJ_CREATE] = ScsiPortCreateClose; DriverObject->MajorFunction[IRP_MJ_CLOSE] = ScsiPortCreateClose; DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = ScsiPortDeviceControl; + DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = ScsiPortDeviceControl; DriverObject->MajorFunction[IRP_MJ_SCSI] = ScsiPortDispatchScsi; /* Obtain configuration information */ @@ -1421,10 +1422,10 @@ + sizeof(ULONG)); /* Store number of buses there */ - DeviceExtension->BusesConfig->NumberOfBuses = DeviceExtension->PortConfig->NumberOfBuses; + DeviceExtension->BusesConfig->NumberOfBuses = DeviceExtension->BusNum; /* Scan the adapter for devices */ - SpiScanAdapter (DeviceExtension); + SpiScanAdapter(DeviceExtension); /* Build the registry device map */ SpiBuildDeviceMap(DeviceExtension, @@ -1572,6 +1573,7 @@ } /* Finally delete the device object */ + DPRINT("Deleting device %p\n", DeviceExtension->DeviceObject); IoDeleteDevice(DeviceExtension->DeviceObject); } @@ -2359,19 +2361,18 @@ ScsiPortDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { - PIO_STACK_LOCATION Stack; - PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; - - DPRINT("ScsiPortDeviceControl()\n"); - - Irp->IoStatus.Status = STATUS_SUCCESS; - Irp->IoStatus.Information = 0; - - - Stack = IoGetCurrentIrpStackLocation(Irp); - DeviceExtension = DeviceObject->DeviceExtension; - - switch (Stack->Parameters.DeviceIoControl.IoControlCode) + PIO_STACK_LOCATION Stack; + PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; + NTSTATUS Status = STATUS_SUCCESS;; + + DPRINT("ScsiPortDeviceControl()\n"); + + Irp->IoStatus.Information = 0; + + Stack = IoGetCurrentIrpStackLocation(Irp); + DeviceExtension = DeviceObject->DeviceExtension; + + switch (Stack->Parameters.DeviceIoControl.IoControlCode) { case IOCTL_SCSI_GET_DUMP_POINTERS: { @@ -2385,24 +2386,36 @@ break; case IOCTL_SCSI_GET_CAPABILITIES: - { - DPRINT(" IOCTL_SCSI_GET_CAPABILITIES\n"); - - *((PIO_SCSI_CAPABILITIES *)Irp->AssociatedIrp.SystemBuffer) = - &DeviceExtension->PortCapabilities; - - Irp->IoStatus.Information = sizeof(PIO_SCSI_CAPABILITIES); - } - break; + DPRINT(" IOCTL_SCSI_GET_CAPABILITIES\n"); + if (Stack->Parameters.DeviceIoControl.OutputBufferLength == sizeof(PVOID)) + { + *((PVOID *)Irp->AssociatedIrp.SystemBuffer) = &DeviceExtension->PortCapabilities; + + Irp->IoStatus.Information = sizeof(PVOID); + Status = STATUS_SUCCESS; + break; + } + + if (Stack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(IO_SCSI_CAPABILITIES)) + { + Status = STATUS_BUFFER_TOO_SMALL; + break; + } + + RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer, + &DeviceExtension->PortCapabilities, + sizeof(IO_SCSI_CAPABILITIES)); + + Irp->IoStatus.Information = sizeof(IO_SCSI_CAPABILITIES); + Status = STATUS_SUCCESS; + break; case IOCTL_SCSI_GET_INQUIRY_DATA: - { - DPRINT(" IOCTL_SCSI_GET_INQUIRY_DATA\n"); - - /* Copy inquiry data to the port device extension */ - Irp->IoStatus.Status = SpiGetInquiryData(DeviceExtension, Irp); - } - break; + DPRINT(" IOCTL_SCSI_GET_INQUIRY_DATA\n"); + + /* Copy inquiry data to the port device extension */ + Status = SpiGetInquiryData(DeviceExtension, Irp); + break; default: DPRINT1(" unknown ioctl code: 0x%lX\n", @@ -2410,9 +2423,11 @@ break; } - IoCompleteRequest(Irp, IO_NO_INCREMENT); - - return(STATUS_SUCCESS); + /* Complete the request with the given status */ + Irp->IoStatus.Status = Status; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + + return Status; } @@ -2832,6 +2847,7 @@ /* Fill in CDB */ Cdb = (PCDB)Srb.Cdb; + Cdb->CDB6INQUIRY.OperationCode = SCSIOP_INQUIRY; Cdb->CDB6INQUIRY.LogicalUnitNumber = LunInfo->Lun; Cdb->CDB6INQUIRY.AllocationLength = INQUIRYDATABUFFERSIZE; @@ -2864,6 +2880,7 @@ } else { + DPRINT("Inquiry SRB failed with SrbStatus 0x%08X\n", Srb.SrbStatus); /* Check if the queue is frozen */ if (Srb.SrbStatus & SRB_STATUS_QUEUE_FROZEN) { @@ -2893,6 +2910,7 @@ /* Check if data overrun happened */ if (SRB_STATUS(Srb.SrbStatus) == SRB_STATUS_DATA_OVERRUN) { + DPRINT("Data overrun at TargetId %d\n", LunInfo->TargetId); /* Nothing dramatic, just copy data, but limiting the size */ RtlCopyMemory(LunInfo->InquiryData, InquiryBuffer, @@ -2945,7 +2963,7 @@ ExFreePool(InquiryBuffer); ExFreePool(SenseBuffer); - DPRINT("SpiSendInquiry() done\n"); + DPRINT("SpiSendInquiry() done with Status 0x%08X\n", Status); return Status; } @@ -2966,11 +2984,12 @@ NTSTATUS Status; ULONG DevicesFound; - DPRINT ("SpiScanAdapter() called\n"); + DPRINT("SpiScanAdapter() called\n"); /* Scan all buses */ - for (Bus = 0; Bus < DeviceExtension->PortConfig->NumberOfBuses; Bus++) - { + for (Bus = 0; Bus < DeviceExtension->BusNum; Bus++) + { + DPRINT(" Scanning bus %d\n", Bus); DevicesFound = 0; /* Get pointer to the scan information */ @@ -2998,6 +3017,9 @@ DPRINT1("Out of resources!\n"); return; } + + /* Store the pointer in the BusScanInfo array */ + DeviceExtension->BusesConfig->BusScanInfo[Bus] = BusScanInfo; /* Fill this struct (length and bus ids for now) */ BusScanInfo->Length = sizeof(SCSI_BUS_SCAN_INFO); @@ -3155,6 +3177,7 @@ /* Sum what we found */ BusScanInfo->LogicalUnitsCount += DevicesFound; + DPRINT(" Found %d devices on bus %d\n", DevicesFound, Bus); } DPRINT ("SpiScanAdapter() done\n");
17 years, 9 months
1
0
0
0
[hyperion] 26224: !!! ATTENTION EVERYONE - do a make clean after getting this revision !!! !!! ATTENTION PSEH USERS - new features & a change in rules !!! modified include/reactos/libs/pseh/framebased.h modified include/reactos/libs/pseh/framebased/internal.h deleted include/reactos/libs/pseh/setjmp.h modified lib/pseh/framebased.c deleted lib/pseh/i386/setjmp.asm modified lib/pseh/pseh.rbuild Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever !!! RULE CHA
by hyperion@svn.reactos.org
Author: hyperion Date: Sun Apr 1 04:07:25 2007 New Revision: 26224 URL:
http://svn.reactos.org/svn/reactos?rev=26224&view=rev
Log: !!! ATTENTION EVERYONE - do a make clean after getting this revision !!! !!! ATTENTION PSEH USERS - new features & a change in rules !!! modified include/reactos/libs/pseh/framebased.h modified include/reactos/libs/pseh/framebased/internal.h deleted include/reactos/libs/pseh/setjmp.h modified lib/pseh/framebased.c deleted lib/pseh/i386/setjmp.asm modified lib/pseh/pseh.rbuild Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever !!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors !!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision !!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs Use inline code to enter/leave trylevels; yields much better binary code Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements Removed bitrotten old syntax, because it wasn't being used nor maintained modified dll/3rdparty/freetype/freetype.rbuild modified dll/win32/kernel32/kernel32.rbuild modified drivers/network/tcpip/tcpip.rbuild modified lib/drivers/ip/ip.rbuild modified lib/rtl/rtl.rbuild modified ntoskrnl/ntoskrnl.rbuild modified subsystems/win32/win32k/win32k.rbuild Removed obsolete _SEH_NO_NATIVE_NLG define modified drivers/network/afd/afd/lock.c modified drivers/network/afd/afd/tdi.c modified subsystems/csr/csrsrv/api.c modified subsystems/win32/win32k/ntuser/clipboard.c modified subsystems/win32/win32k/ntuser/window.c Use the new _SEH_YIELD macro to return/goto from SEH blocks modified tools/rbuild/backend/mingw/modulehandler.cpp modified tools/rbuild/backend/mingw/modulehandler.h modified tools/rbuild/module.cpp modified tools/rbuild/project.dtd modified tools/rbuild/rbuild.h Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing modified lib/3rdparty/mingw/mingw.rbuild Build with underscoresymbols="true" Removed: trunk/reactos/include/reactos/libs/pseh/setjmp.h trunk/reactos/lib/pseh/i386/setjmp.asm Modified: trunk/reactos/dll/3rdparty/freetype/freetype.rbuild trunk/reactos/dll/win32/kernel32/kernel32.rbuild trunk/reactos/drivers/network/afd/afd/lock.c trunk/reactos/drivers/network/afd/afd/tdi.c trunk/reactos/drivers/network/tcpip/tcpip.rbuild trunk/reactos/include/reactos/libs/pseh/framebased.h trunk/reactos/include/reactos/libs/pseh/framebased/internal.h trunk/reactos/lib/3rdparty/mingw/mingw.rbuild trunk/reactos/lib/drivers/ip/ip.rbuild trunk/reactos/lib/pseh/framebased.c trunk/reactos/lib/pseh/pseh.rbuild trunk/reactos/lib/rtl/rtl.rbuild trunk/reactos/ntoskrnl/ntoskrnl.rbuild trunk/reactos/subsystems/csr/csrsrv/api.c trunk/reactos/subsystems/win32/win32k/ntuser/clipboard.c trunk/reactos/subsystems/win32/win32k/ntuser/window.c trunk/reactos/subsystems/win32/win32k/win32k.rbuild trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h trunk/reactos/tools/rbuild/module.cpp trunk/reactos/tools/rbuild/project.dtd trunk/reactos/tools/rbuild/rbuild.h Modified: trunk/reactos/dll/3rdparty/freetype/freetype.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/3rdparty/freetype/free…
============================================================================== --- trunk/reactos/dll/3rdparty/freetype/freetype.rbuild (original) +++ trunk/reactos/dll/3rdparty/freetype/freetype.rbuild Sun Apr 1 04:07:25 2007 @@ -2,7 +2,6 @@ <importlibrary definition="freetype.def" /> <include base="freetype">include</include> <define name="_DISABLE_TIDENTS" /> - <define name="_SEH_NO_NATIVE_NLG" /> <define name="__NTDRIVER__" /> <define name="__NO_CTYPE_INLINES" /> <define name="__USE_W32API" /> Modified: trunk/reactos/dll/win32/kernel32/kernel32.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
============================================================================== --- trunk/reactos/dll/win32/kernel32/kernel32.rbuild (original) +++ trunk/reactos/dll/win32/kernel32/kernel32.rbuild Sun Apr 1 04:07:25 2007 @@ -3,7 +3,6 @@ <include base="kernel32_base">include</include> <include base="ReactOS">include/reactos/subsys</include> <define name="_DISABLE_TIDENTS" /> - <define name="_SEH_NO_NATIVE_NLG" /> <define name="__USE_W32API" /> <define name="_WIN32_WINNT">0x0600</define> <define name="__NO_CTYPE_INLINES" /> @@ -120,7 +119,6 @@ <include base="kernel32">.</include> <include base="kernel32">include</include> <define name="_DISABLE_TIDENTS" /> - <define name="_SEH_NO_NATIVE_NLG" /> <define name="__USE_W32API" /> <define name="WINVER">0x0500</define> <library>kernel32_base</library> @@ -130,4 +128,4 @@ <linkerflag>-nostartfiles</linkerflag> <linkerflag>-nostdlib</linkerflag> <file>kernel32.rc</file> -</module> +</module> Modified: trunk/reactos/drivers/network/afd/afd/lock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/lo…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/lock.c (original) +++ trunk/reactos/drivers/network/afd/afd/lock.c Sun Apr 1 04:07:25 2007 @@ -71,7 +71,7 @@ "from userland (%x %x)\n", Buf, AddressLen)); ExFreePool( NewBuf ); - return NULL; + _SEH_YIELD(return NULL); } _SEH_END; for( i = 0; i < Count; i++ ) { Modified: trunk/reactos/drivers/network/afd/afd/tdi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/td…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/tdi.c (original) +++ trunk/reactos/drivers/network/afd/afd/tdi.c Sun Apr 1 04:07:25 2007 @@ -977,7 +977,7 @@ } _SEH_HANDLE { AFD_DbgPrint(MIN_TRACE, ("MmProbeAndLockPages() failed.\n")); IoFreeIrp(*Irp); - return STATUS_INSUFFICIENT_RESOURCES; + _SEH_YIELD(return STATUS_INSUFFICIENT_RESOURCES); } _SEH_END; AFD_DbgPrint(MID_TRACE,("AFD>>> Got an MDL: %x\n", Mdl)); @@ -1066,7 +1066,7 @@ } _SEH_HANDLE { AFD_DbgPrint(MIN_TRACE, ("MmProbeAndLockPages() failed.\n")); IoFreeIrp(*Irp); - return STATUS_INSUFFICIENT_RESOURCES; + _SEH_YIELD(return STATUS_INSUFFICIENT_RESOURCES); } _SEH_END; AFD_DbgPrint(MID_TRACE,("AFD>>> Got an MDL: %x\n", Mdl)); Modified: trunk/reactos/drivers/network/tcpip/tcpip.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip.rbuild (original) +++ trunk/reactos/drivers/network/tcpip/tcpip.rbuild Sun Apr 1 04:07:25 2007 @@ -2,7 +2,6 @@ <importlibrary definition="tcpip.def"></importlibrary> <include base="tcpip">include</include> <include base="oskittcp">include</include> - <define name="_SEH_NO_NATIVE_NLG" /> <define name="NDIS40" /> <define name="__USE_W32API" /> <define name="_NTDRIVER_" /> Modified: trunk/reactos/include/reactos/libs/pseh/framebased.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/pseh/…
============================================================================== --- trunk/reactos/include/reactos/libs/pseh/framebased.h (original) +++ trunk/reactos/include/reactos/libs/pseh/framebased.h Sun Apr 1 04:07:25 2007 @@ -30,15 +30,14 @@ # include <stddef.h> #endif -/* - Fall back to non-optimal, non-native NLG implementation for environments - without their own (e.g., currently, kernel-mode ReactOS/Windows). THIS IS NOT - RECOMMENDED AND IT WILL BE DROPPED IN A FUTURE VERSION BECAUSE IT MAY CAUSE - SEVERE STACK CORRUPTION. REIMPLEMENT OR PORT YOUR COMPILER'S NATIVE NLG - IMPLEMENTATION INSTEAD. -*/ -#ifdef _SEH_NO_NATIVE_NLG -# include <pseh/setjmp.h> +#if defined(_SEH_NO_NATIVE_NLG) +# error PSEH setjmp/longjmp fallback is no longer supported +#endif + +#if defined(__GNUC__) +# define _SEHLongJmp __builtin_longjmp +# define _SEHSetJmp __builtin_setjmp + typedef void * _SEHJmpBuf_t[5]; #else # include <setjmp.h> # define _SEHLongJmp longjmp @@ -55,7 +54,7 @@ typedef struct __SEHFrame { _SEHPortableFrame_t SEH_Header; - void * SEH_Locals; + void * volatile SEH_Locals; } _SEHFrame_t; @@ -78,6 +77,7 @@ static const int _SEHScopeKind = 1; static _SEHPortableFrame_t * const _SEHPortableFrame = 0; +static _SEHPortableTryLevel_t * const _SEHPortableTryLevel = 0; /* SHARED LOCALS */ /* Access the locals for the current frame */ @@ -139,28 +139,6 @@ } /* SAFE BLOCKS */ -#define _SEHX_TRY_FINALLY(FINALLY_) \ - _SEH_TRY_FILTER_FINALLY \ - ( \ - _SEH_STATIC_FILTER(_SEH_CONTINUE_SEARCH), \ - (FINALLY_) \ - ) - -#define _SEHX_END_FINALLY _SEH_HANDLE _SEH_END - -#define _SEHX_TRY_FILTER(FILTER_) \ - _SEH_TRY_FILTER_FINALLY((FILTER_), 0) - -#define _SEHX_TRY_HANDLE_FINALLY(FINALLY_) \ - _SEH_TRY_FILTER_FINALLY \ - ( \ - _SEH_STATIC_FILTER(_SEH_EXECUTE_HANDLER), \ - (FINALLY_) \ - ) - -#define _SEHX_TRY \ - _SEH_TRY_HANDLE_FINALLY(0) - #ifdef __cplusplus # define _SEH_DECLARE_HANDLERS(FILTER_, FINALLY_) \ static const _SEHHandlers_t _SEHHandlers = { (FILTER_), (FINALLY_) }; @@ -171,79 +149,30 @@ _SEHHandlers.SH_Finally = (FINALLY_); #endif -#define _SEHX_TRY_FILTER_FINALLY(FILTER_, FINALLY_) \ - { \ - _SEHPortableFrame_t * const _SEHCurPortableFrame = _SEHPortableFrame; \ - \ - { \ - _SEHFrame_t _SEHFrame; \ - _SEHTryLevel_t _SEHTryLevel; \ - _SEHPortableFrame_t * const _SEHPortableFrame = \ - _SEHScopeKind ? &_SEHFrame.SEH_Header : _SEHCurPortableFrame; \ - \ - (void)_SEHPortableFrame; \ - \ - _SEH_DECLARE_HANDLERS((FILTER_), (FINALLY_)); \ - \ - _SEHTryLevel.ST_Header.SPT_Handlers = &_SEHHandlers; \ - \ - if(_SEHScopeKind) \ - { \ - if(&_SEHLocals != _SEHDummyLocals) \ - _SEHFrame.SEH_Locals = &_SEHLocals; \ - \ - _SEHFrame.SEH_Header.SPF_Handler = _SEHCompilerSpecificHandler; \ - _SEHEnterFrame(&_SEHFrame.SEH_Header, &_SEHTryLevel.ST_Header); \ - } \ - else \ - _SEHEnterTry(&_SEHTryLevel.ST_Header); \ - \ - { \ - _SEH_INIT_CONST int _SEHScopeKind = 0; \ - (void)_SEHScopeKind; \ - \ - if(_SEHSetJmp(_SEHTryLevel.ST_JmpBuf) == 0) \ - { \ - for(;;) \ - { - -#define _SEHX_HANDLE \ - \ - break; \ - } \ - \ - _SEHLeave(); \ - } \ - else \ - { \ - _SEHLeave(); - -#define _SEHX_END \ - } \ - \ - if(_SEHHandlers.SH_Finally) \ - _SEHHandlers.SH_Finally(_SEHPortableFrame); \ - } \ - } \ - } - -#define _SEHX_LEAVE break - -#define _SEHX_GetExceptionCode() (unsigned long)(_SEHPortableFrame->SPF_Code) - -#define _SEHX_GetExceptionPointers() \ +#define _SEH_GetExceptionCode() (unsigned long)(_SEHPortableFrame->SPF_Code) + +#define _SEH_GetExceptionPointers() \ ((struct _EXCEPTION_POINTERS *)_SEHExceptionPointers) -#define _SEHX_AbnormalTermination() (_SEHPortableFrame->SPF_Code != 0) - -/* New syntax */ +#define _SEH_AbnormalTermination() (_SEHPortableFrame->SPF_Code != 0) #define _SEH_LEAVE break +#define _SEH_YIELD(STMT_) \ + for(;;) \ + { \ + if(!_SEHScopeKind) \ + _SEHReturn(); \ + \ + STMT_; \ + } + #define _SEH_TRY \ + for(;;) \ { \ _SEH_INIT_CONST int _SEHTopTryLevel = (_SEHScopeKind != 0); \ _SEHPortableFrame_t * const _SEHCurPortableFrame = _SEHPortableFrame; \ + _SEHPortableTryLevel_t * const _SEHPrevPortableTryLevel = _SEHPortableTryLevel; \ \ { \ _SEH_INIT_CONST int _SEHScopeKind = 0; \ @@ -253,9 +182,11 @@ _SEHTryLevel_t _SEHTryLevel; \ _SEHPortableFrame_t * const _SEHPortableFrame = \ _SEHTopTryLevel ? &_SEHFrame.SEH_Header : _SEHCurPortableFrame; \ + _SEHPortableTryLevel_t * const _SEHPortableTryLevel = &_SEHTryLevel.ST_Header; \ \ (void)_SEHScopeKind; \ (void)_SEHPortableFrame; \ + (void)_SEHPortableTryLevel; \ (void)_SEHHandle; \ \ for(;;) \ @@ -276,9 +207,57 @@ } \ else \ { \ - _SEH_DECLARE_HANDLERS((FILTER_), 0); \ - \ - _SEHTryLevel.ST_Header.SPT_Handlers = &_SEHHandlers; \ + if((_SEHHandle = _SEHSetJmp(_SEHTryLevel.ST_JmpBuf)) == 0) \ + { \ + _SEHTryLevel.ST_Header.SPT_Handlers.SH_Filter = (FILTER_); \ + _SEHTryLevel.ST_Header.SPT_Handlers.SH_Finally = 0; \ + \ + _SEHTryLevel.ST_Header.SPT_Next = _SEHPrevPortableTryLevel; \ + _SEHFrame.SEH_Header.SPF_TopTryLevel = &_SEHTryLevel.ST_Header; \ + \ + if(_SEHTopTryLevel) \ + { \ + if(&_SEHLocals != _SEHDummyLocals) \ + _SEHFrame.SEH_Locals = &_SEHLocals; \ + \ + _SEH_EnableTracing(_SEH_DO_DEFAULT_TRACING); \ + _SEHFrame.SEH_Header.SPF_Handler = _SEHCompilerSpecificHandler; \ + _SEHEnterFrame(&_SEHFrame.SEH_Header); \ + } \ + \ + ++ _SEHState; \ + continue; \ + } \ + else \ + { \ + break; \ + } \ + } \ + \ + break; \ + } \ + \ + _SEHPortableFrame->SPF_TopTryLevel = _SEHPrevPortableTryLevel; \ + \ + if(_SEHHandle) \ + { + +#define _SEH_FINALLY(FINALLY_) \ + } \ + \ + break; \ + } \ + \ + _SEHPortableFrame->SPF_TopTryLevel = _SEHPrevPortableTryLevel; \ + break; \ + } \ + else \ + { \ + _SEHTryLevel.ST_Header.SPT_Handlers.SH_Filter = 0; \ + _SEHTryLevel.ST_Header.SPT_Handlers.SH_Finally = (FINALLY_); \ + \ + _SEHTryLevel.ST_Header.SPT_Next = _SEHPrevPortableTryLevel; \ + _SEHFrame.SEH_Header.SPF_TopTryLevel = &_SEHTryLevel.ST_Header; \ \ if(_SEHTopTryLevel) \ { \ @@ -287,56 +266,8 @@ \ _SEH_EnableTracing(_SEH_DO_DEFAULT_TRACING); \ _SEHFrame.SEH_Header.SPF_Handler = _SEHCompilerSpecificHandler; \ - _SEHEnterFrame(&_SEHFrame.SEH_Header, &_SEHTryLevel.ST_Header); \ - } \ - else \ - _SEHEnterTry(&_SEHTryLevel.ST_Header); \ - \ - if((_SEHHandle = _SEHSetJmp(_SEHTryLevel.ST_JmpBuf)) == 0) \ - { \ - ++ _SEHState; \ - continue; \ - } \ - else \ - { \ - break; \ - } \ - } \ - \ - break; \ - } \ - \ - _SEHLeave(); \ - \ - if(_SEHHandle) \ - { - -#define _SEH_FINALLY(FINALLY_) \ - } \ - \ - break; \ - } \ - \ - _SEHLeave(); \ - break; \ - } \ - else \ - { \ - _SEH_DECLARE_HANDLERS(0, (FINALLY_)); \ - \ - _SEHTryLevel.ST_Header.SPT_Handlers = &_SEHHandlers; \ - \ - if(_SEHTopTryLevel) \ - { \ - if(&_SEHLocals != _SEHDummyLocals) \ - _SEHFrame.SEH_Locals = &_SEHLocals; \ - \ - _SEH_EnableTracing(_SEH_DO_DEFAULT_TRACING); \ - _SEHFrame.SEH_Header.SPF_Handler = 0; \ - _SEHEnterFrame(&_SEHFrame.SEH_Header, &_SEHTryLevel.ST_Header); \ - } \ - else \ - _SEHEnterTry(&_SEHTryLevel.ST_Header); \ + _SEHEnterFrame(&_SEHFrame.SEH_Header); \ + } \ \ ++ _SEHState; \ continue; \ @@ -353,13 +284,14 @@ #define _SEH_END \ } \ } \ + \ + if(_SEHTopTryLevel) \ + _SEHLeaveFrame(); \ + \ + break; \ } #define _SEH_HANDLE _SEH_EXCEPT(_SEH_STATIC_FILTER(_SEH_EXECUTE_HANDLER)) - -#define _SEH_GetExceptionCode _SEHX_GetExceptionCode -#define _SEH_GetExceptionPointers _SEHX_GetExceptionPointers -#define _SEH_AbnormalTermination _SEHX_AbnormalTermination #define _SEH_EnableTracing(LEVEL_) ((void)(_SEHPortableFrame->SPF_Tracing = (LEVEL_))) #define _SEH_DisableTracing() ((void)(_SEHPortableFrame->SPF_Tracing = _SEH_DO_TRACE_NONE)) Modified: trunk/reactos/include/reactos/libs/pseh/framebased/internal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/pseh/…
============================================================================== --- trunk/reactos/include/reactos/libs/pseh/framebased/internal.h (original) +++ trunk/reactos/include/reactos/libs/pseh/framebased/internal.h Sun Apr 1 04:07:25 2007 @@ -87,8 +87,8 @@ typedef struct __SEHPortableTryLevel { - struct __SEHPortableTryLevel * SPT_Next; - const _SEHHandlers_t * SPT_Handlers; + struct __SEHPortableTryLevel * volatile SPT_Next; + volatile _SEHHandlers_t SPT_Handlers; } _SEHPortableTryLevel_t; @@ -96,9 +96,9 @@ { _SEHRegistration_t SPF_Registration; unsigned long SPF_Code; - _SEHHandler_t SPF_Handler; - _SEHPortableTryLevel_t * SPF_TopTryLevel; - int SPF_Tracing; + volatile _SEHHandler_t SPF_Handler; + _SEHPortableTryLevel_t * volatile SPF_TopTryLevel; + volatile int SPF_Tracing; } _SEHPortableFrame_t; @@ -107,14 +107,9 @@ { #endif -extern void __stdcall _SEHEnterFrame_s -( - _SEHPortableFrame_t *, - _SEHPortableTryLevel_t * -); - -extern void __stdcall _SEHEnterTry_s(_SEHPortableTryLevel_t *); -extern void __stdcall _SEHLeave_s(void); +extern void __stdcall _SEHEnterFrame_s(_SEHPortableFrame_t *); +extern void __stdcall _SEHLeaveFrame_s(void); +extern void __stdcall _SEHReturn_s(void); #if !defined(_SEH_NO_FASTCALL) # ifdef _M_IX86 @@ -123,22 +118,17 @@ # define _SEH_FASTCALL __stdcall # endif -extern void _SEH_FASTCALL _SEHEnterFrame_f -( - _SEHPortableFrame_t *, - _SEHPortableTryLevel_t * -); - -extern void _SEH_FASTCALL _SEHEnterTry_f(_SEHPortableTryLevel_t *); -extern void _SEH_FASTCALL _SEHLeave_f(void); +extern void _SEH_FASTCALL _SEHEnterFrame_f(_SEHPortableFrame_t *); +extern void _SEH_FASTCALL _SEHLeaveFrame_f(void); +extern void _SEH_FASTCALL _SEHReturn_f(void); # define _SEHEnterFrame _SEHEnterFrame_f -# define _SEHEnterTry _SEHEnterTry_f -# define _SEHLeave _SEHLeave_f +# define _SEHLeaveFrame _SEHLeaveFrame_f +# define _SEHReturn _SEHReturn_f #else # define _SEHEnterFrame _SEHEnterFrame_s -# define _SEHEnterTry _SEHEnterTry_s -# define _SEHLeave _SEHLeave_s +# define _SEHLeaveFrame _SEHLeaveFrame_s +# define _SEHReturn _SEHReturn_s #endif #ifdef __cplusplus Removed: trunk/reactos/include/reactos/libs/pseh/setjmp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/pseh/…
============================================================================== --- trunk/reactos/include/reactos/libs/pseh/setjmp.h (original) +++ trunk/reactos/include/reactos/libs/pseh/setjmp.h (removed) @@ -1,54 +1,0 @@ -/* - Copyright (c) 2004/2005 KJK::Hyperion - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. -*/ - -#ifndef KJK_PSEH_SETJMP_H_ -#define KJK_PSEH_SETJMP_H_ - -#ifdef _M_IX86 -typedef struct __SEHJmpBuf -{ - unsigned long JB_Ebp; - unsigned long JB_Esp; - unsigned long JB_Eip; - unsigned long JB_Ebx; - unsigned long JB_Esi; - unsigned long JB_Edi; -} -_SEHJmpBuf_t[1]; -#endif - -#ifdef __cplusplus -extern "C" -{ -#endif - -extern __declspec(noreturn) void __stdcall _SEHLongJmp(_SEHJmpBuf_t, int); -extern __declspec(noreturn) void __stdcall _SEHLongJmp_KeepEsp(_SEHJmpBuf_t, int); -extern int __stdcall _SEHSetJmp(_SEHJmpBuf_t); - -#ifdef __cplusplus -} -#endif - -#endif - -/* EOF */ Modified: trunk/reactos/lib/3rdparty/mingw/mingw.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/3rdparty/mingw/mingw.r…
============================================================================== --- trunk/reactos/lib/3rdparty/mingw/mingw.rbuild (original) +++ trunk/reactos/lib/3rdparty/mingw/mingw.rbuild Sun Apr 1 04:07:25 2007 @@ -1,7 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE project SYSTEM "tools/rbuild/project.dtd"> <group> -<module name="mingw_common" type="staticlibrary" isstartuplib="true"> +<module name="mingw_common" type="staticlibrary" isstartuplib="true" underscoresymbols="true"> <importlibrary definition="moldname-msvcrt.def" dllname="msvcrt.dll" /> <include base="ReactOS">include/crt</include> <include base="ReactOS">include/psdk</include> Modified: trunk/reactos/lib/drivers/ip/ip.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/ip/ip.rbuild?r…
============================================================================== --- trunk/reactos/lib/drivers/ip/ip.rbuild (original) +++ trunk/reactos/lib/drivers/ip/ip.rbuild Sun Apr 1 04:07:25 2007 @@ -1,6 +1,5 @@ <module name="ip" type="staticlibrary" allowwarnings="true"> <define name="__NTDRIVER__"/> - <define name="_SEH_NO_NATIVE_NLG"/> <define name="__USE_W32API"/> <include base="tcpip">include</include> <include base="oskittcp">include</include> Modified: trunk/reactos/lib/pseh/framebased.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/pseh/framebased.c?rev=…
============================================================================== --- trunk/reactos/lib/pseh/framebased.c (original) +++ trunk/reactos/lib/pseh/framebased.c Sun Apr 1 04:07:25 2007 @@ -164,7 +164,7 @@ { \ if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_TRYLEVEL) \ { \ - _SEH_TRACE_LINE_((FRAME_), ("trylevel %p, filter %p", (TRYLEVEL_), (TRYLEVEL_)->SPT_Handlers->SH_Filter)); \ + _SEH_TRACE_LINE_((FRAME_), ("trylevel %p, filter %p", (TRYLEVEL_), (TRYLEVEL_)->SPT_Handlers.SH_Filter)); \ } \ } @@ -178,7 +178,7 @@ ( \ "trylevel %p, calling filter %p, ExceptionCode %08X", \ (TRYLEVEL_), \ - (TRYLEVEL_)->SPT_Handlers->SH_Filter, \ + (TRYLEVEL_)->SPT_Handlers.SH_Filter, \ (ER_)->ExceptionCode \ ) \ ); \ @@ -195,7 +195,7 @@ ( \ "trylevel %p, filter %p => %s", \ (TRYLEVEL_), \ - (TRYLEVEL_)->SPT_Handlers->SH_Filter, \ + (TRYLEVEL_)->SPT_Handlers.SH_Filter, \ _SEH_FILTER_RET_STRING_(RET_) \ ) \ ); \ @@ -236,7 +236,7 @@ ( \ "trylevel %p, calling exit routine %p", \ (TRYLEVEL_), \ - (TRYLEVEL_)->SPT_Handlers->SH_Finally \ + (TRYLEVEL_)->SPT_Handlers.SH_Finally \ ) \ ); \ } \ @@ -252,7 +252,7 @@ ( \ "trylevel %p, exit routine %p returned", \ (TRYLEVEL_), \ - (TRYLEVEL_)->SPT_Handlers->SH_Finally \ + (TRYLEVEL_)->SPT_Handlers.SH_Finally \ ) \ ); \ } \ @@ -305,7 +305,7 @@ /* ASSERT(trylevel); */ - pfnFinally = trylevel->SPT_Handlers->SH_Finally; + pfnFinally = trylevel->SPT_Handlers.SH_Finally; if(pfnFinally) { @@ -386,7 +386,7 @@ trylevel = trylevel->SPT_Next ) { - _SEHFilter_t pfnFilter = trylevel->SPT_Handlers->SH_Filter; + _SEHFilter_t pfnFilter = trylevel->SPT_Handlers.SH_Filter; _SEH_TRACE_TRYLEVEL(frame, trylevel); @@ -402,7 +402,7 @@ default: { - if(trylevel->SPT_Handlers->SH_Filter) + if(trylevel->SPT_Handlers.SH_Filter) { EXCEPTION_POINTERS ep; @@ -443,41 +443,31 @@ return ExceptionContinueSearch; } -void __stdcall _SEHEnterFrame_s -( - _SEHPortableFrame_t * frame, - _SEHPortableTryLevel_t * trylevel -) -{ - _SEHEnterFrame_f(frame, trylevel); -} - -void __stdcall _SEHEnterTry_s(_SEHPortableTryLevel_t * trylevel) -{ - _SEHEnterTry_f(trylevel); -} - -void __stdcall _SEHLeave_s(void) -{ - _SEHLeave_f(); -} - -void _SEH_FASTCALL _SEHEnterFrame_f -( - _SEHPortableFrame_t * frame, - _SEHPortableTryLevel_t * trylevel -) +void __stdcall _SEHEnterFrame_s(_SEHPortableFrame_t * frame) +{ + _SEHEnterFrame_f(frame); +} + +void __stdcall _SEHLeaveFrame_s(void) +{ + _SEHLeaveFrame_f(); +} + +void __stdcall _SEHReturn_s(void) +{ + _SEHReturn_f(); +} + +void _SEH_FASTCALL _SEHEnterFrame_f(_SEHPortableFrame_t * frame) { /* ASSERT(frame); */ /* ASSERT(trylevel); */ frame->SPF_Registration.SER_Handler = _SEHFrameHandler; frame->SPF_Code = 0; - frame->SPF_TopTryLevel = trylevel; - trylevel->SPT_Next = NULL; _SEHRegisterFrame(&frame->SPF_Registration); } -void _SEH_FASTCALL _SEHEnterTry_f(_SEHPortableTryLevel_t * trylevel) +void _SEH_FASTCALL _SEHLeaveFrame_f(void) { _SEHPortableFrame_t * frame; @@ -488,14 +478,15 @@ SPF_Registration ); - trylevel->SPT_Next = frame->SPF_TopTryLevel; - frame->SPF_TopTryLevel = trylevel; -} - -void _SEH_FASTCALL _SEHLeave_f(void) + /* ASSERT(frame); */ + /* ASSERT(frame->SPF_TopTryLevel == NULL) */ + + _SEHUnregisterFrame(); +} + +void _SEH_FASTCALL _SEHReturn_f(void) { _SEHPortableFrame_t * frame; - _SEHPortableTryLevel_t * trylevel; frame = _SEH_CONTAINING_RECORD ( @@ -504,16 +495,8 @@ SPF_Registration ); - /* ASSERT(frame); */ - - trylevel = frame->SPF_TopTryLevel; - - /* ASSERT(trylevel); */ - - if(trylevel->SPT_Next) - frame->SPF_TopTryLevel = trylevel->SPT_Next; - else - _SEHUnregisterFrame(); + _SEHLocalUnwind(frame, NULL); + _SEHUnregisterFrame(); } /* EOF */ Removed: trunk/reactos/lib/pseh/i386/setjmp.asm URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/pseh/i386/setjmp.asm?r…
============================================================================== --- trunk/reactos/lib/pseh/i386/setjmp.asm (original) +++ trunk/reactos/lib/pseh/i386/setjmp.asm (removed) @@ -1,88 +1,0 @@ -; Copyright (c) 2004/2005 KJK::Hyperion - -; Permission is hereby granted, free of charge, to any person obtaining a copy -; of this software and associated documentation files (the "Software"), to deal -; in the Software without restriction, including without limitation the rights -; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -; copies of the Software, and to permit persons to whom the Software is -; furnished to dos so, subject to the following conditions: - -; The above copyright notice and this permission notice shall be included in all -; copies or substantial portions of the Software. - -; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -; SOFTWARE. - -segment .text use32 - -; Note: the undecorated names are for Borland C++ (and possibly other compilers -; using the OMF format) -global _SEHSetJmp -global __SEHSetJmp@4 -_SEHSetJmp: -__SEHSetJmp@4: - ; jump buffer - mov eax, [esp+4] - - ; program counter - mov ecx, [esp+0] - - ; stack pointer - lea edx, [esp+8] - - ; fill the jump buffer - mov [eax+0], ebp - mov [eax+4], edx - mov [eax+8], ecx - mov [eax+12], ebx - mov [eax+16], esi - mov [eax+20], edi - - xor eax, eax - ret 4 - -global _SEHLongJmp -global __SEHLongJmp@8 -_SEHLongJmp: -__SEHLongJmp@8: - ; return value - mov eax, [esp+8] - - ; jump buffer - mov ecx, [esp+4] - - ; restore the saved context - mov ebp, [ecx+0] - mov esp, [ecx+4] - mov edx, [ecx+8] - mov ebx, [ecx+12] - mov esi, [ecx+16] - mov edi, [ecx+20] - jmp edx - -global _SEHLongJmp_KeepEsp -global __SEHLongJmp_KeepEsp@8 -_SEHLongJmp_KeepEsp: -__SEHLongJmp_KeepEsp@8: - ; return value - mov eax, [esp+8] - - ; jump buffer - mov ecx, [esp+4] - - ; restore the saved context - mov ebp, [ecx+0] -; don't restore esp -; mov esp, [ecx+4] - mov edx, [ecx+8] - mov ebx, [ecx+12] - mov esi, [ecx+16] - mov edi, [ecx+20] - jmp edx - -; EOF Modified: trunk/reactos/lib/pseh/pseh.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/pseh/pseh.rbuild?rev=2…
============================================================================== --- trunk/reactos/lib/pseh/pseh.rbuild (original) +++ trunk/reactos/lib/pseh/pseh.rbuild Sun Apr 1 04:07:25 2007 @@ -3,7 +3,6 @@ <if property="ARCH" value="i386"> <directory name="i386"> <file>framebased.asm</file> - <file>setjmp.asm</file> </directory> </if> <file>framebased.c</file> Modified: trunk/reactos/lib/rtl/rtl.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/rtl.rbuild?rev=262…
============================================================================== --- trunk/reactos/lib/rtl/rtl.rbuild (original) +++ trunk/reactos/lib/rtl/rtl.rbuild Sun Apr 1 04:07:25 2007 @@ -5,7 +5,6 @@ <define name="NO_RTL_INLINES" /> <define name="_NTSYSTEM_" /> <define name="_NTDLLBUILD_" /> - <define name="_SEH_NO_NATIVE_NLG" /> <include base="rtl">.</include> <if property="ARCH" value="i386"> <directory name="i386"> Modified: trunk/reactos/ntoskrnl/ntoskrnl.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.rbuild?r…
============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl.rbuild (original) +++ trunk/reactos/ntoskrnl/ntoskrnl.rbuild Sun Apr 1 04:07:25 2007 @@ -1,7 +1,6 @@ <module name="ntoskrnl" type="kernel" installbase="system32" installname="ntoskrnl.exe"> <bootstrap base="$(CDOUTPUT)" /> <importlibrary definition="ntoskrnl.def" /> - <define name="_SEH_NO_NATIVE_NLG" /> <define name="_DISABLE_TIDENTS" /> <define name="__NTOSKRNL__" /> <define name="_NTOSKRNL_" /> Modified: trunk/reactos/subsystems/csr/csrsrv/api.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/csr/csrsrv/api.…
============================================================================== --- trunk/reactos/subsystems/csr/csrsrv/api.c (original) +++ trunk/reactos/subsystems/csr/csrsrv/api.c Sun Apr 1 04:07:25 2007 @@ -109,7 +109,7 @@ * communications with the Session Manager (SM) and initializes the static * thread that will handle connection requests and APIs. * - * @param None + * @param None * * @return STATUS_SUCCESS in case of success, STATUS_UNSUCCESSFUL * othwerwise. @@ -192,7 +192,7 @@ * communications with the Client/Server Runtime (CSR) and initializes the * static thread that will handle connection requests and APIs. * - * @param None + * @param None * * @return STATUS_SUCCESS in case of success, STATUS_UNSUCCESSFUL * othwerwise. @@ -311,7 +311,7 @@ * requests on the CSR API LPC Port. * * @param Parameter - * System-default user-defined parameter. Unused. + * System-default user-defined parameter. Unused. * * @return The thread exit code, if the thread is terminated. * @@ -462,7 +462,7 @@ } } } - + /* Increase the thread count */ InterlockedIncrement(&CsrpStaticThreadCount); @@ -625,7 +625,7 @@ } } } - + /* Increase the thread count */ InterlockedIncrement(&CsrpStaticThreadCount); @@ -791,7 +791,7 @@ * requests on the SM API LPC Port. * * @param Parameter - * System-default user-defined parameter. Unused. + * System-default user-defined parameter. Unused. * * @return The thread exit code, if the thread is terminated. * @@ -848,7 +848,7 @@ { /* Close the handle if we have one */ if (PortContext) NtClose((HANDLE)PortContext); - + /* Client died, start over */ ReplyMsg = NULL; continue; @@ -1026,7 +1026,7 @@ * * The CsrConnectToUser connects to the User subsystem. * - * @param None + * @param None * * @return A pointer to the CSR Thread * @@ -1145,7 +1145,7 @@ { /* Return failure */ ApiMessage->Status = STATUS_INVALID_PARAMETER; - return FALSE; + _SEH_YIELD(return FALSE); } /* Check if the Length is valid */ @@ -1154,14 +1154,14 @@ { /* Return failure */ ApiMessage->Status = STATUS_INVALID_PARAMETER; - return FALSE; + _SEH_YIELD(return FALSE); } } _SEH_HANDLE { /* Return failure */ ApiMessage->Status = STATUS_INVALID_PARAMETER; - return FALSE; + _SEH_YIELD(return FALSE); } _SEH_END; /* We validated the incoming buffer, now allocate the remote one */ @@ -1226,7 +1226,7 @@ RemoteCaptureBuffer->PreviousCaptureBuffer = LocalCaptureBuffer; ApiMessage->CsrCaptureData = RemoteCaptureBuffer; } - + /* Success */ return TRUE; } @@ -1267,7 +1267,7 @@ /* Find out the difference between the two buffers */ BufferDistance = (ULONG_PTR)LocalCaptureBuffer - (ULONG_PTR)RemoteCaptureBuffer; - + /* Save the pointer count and offset pointer */ PointerCount = RemoteCaptureBuffer->PointerCount; PointerOffsets = (ULONG_PTR**)(RemoteCaptureBuffer + 1); @@ -1284,7 +1284,7 @@ /* Modify the pointer to take into account its new position */ *CurrentPointer += BufferDistance; } - + /* Move to the next Pointer */ PointerCount--; } Modified: trunk/reactos/subsystems/win32/win32k/ntuser/clipboard.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/clipboard.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/clipboard.c Sun Apr 1 04:07:25 2007 @@ -17,7 +17,7 @@ #define USE_WINSTA \ PWINSTATION_OBJECT WinStaObj; \ - WinStaObj = PsGetCurrentThreadWin32Thread()->Desktop->WindowStation; + WinStaObj = PsGetCurrentThreadWin32Thread()->Desktop->WindowStation; #define WINSTA_ClipboardThread WinStaObj->Clipboard->ClipboardThread #define WINSTA_ClipboardOwnerThread WinStaObj->Clipboard->ClipboardOwnerThread @@ -54,13 +54,13 @@ /*==============================================================*/ -/* return the pointer to the prev window of the finded window, +/* return the pointer to the prev window of the finded window, if NULL does not exists in the chain */ PCLIPBOARDCHAINELEMENT FASTCALL IntIsWindowInChain(PWINDOW_OBJECT window) { PCLIPBOARDCHAINELEMENT wce = WindowsChain; - + while (wce) { if (wce->window == window) @@ -68,8 +68,8 @@ break; } wce = wce->next; - } - + } + return wce; } @@ -81,7 +81,7 @@ { DPRINT1("chain: %p\n", wce2->window->hSelf); wce2 = wce2->next; - } + } } /* the new window always have to be the first in the chain */ @@ -89,27 +89,27 @@ IntAddWindowToChain(PWINDOW_OBJECT window) { PCLIPBOARDCHAINELEMENT wce = NULL; - + if (!IntIsWindowInChain(window)) { wce = WindowsChain; - + wce = ExAllocatePool(PagedPool, sizeof(CLIPBOARDCHAINELEMENT)); if (wce == NULL) { SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); goto exit_addChain; - } - + } + wce->window = window; wce->next = WindowsChain; - + WindowsChain = wce; //printChain(); } -exit_addChain: - +exit_addChain: + /* return the next window to beremoved later */ return wce; } @@ -133,17 +133,17 @@ link = &wce->next; wce = wce->next; } - - //printChain(); - + + //printChain(); + return wce; - } + } else { return NULL; } } - + /*==============================================================*/ /* if format exists, returns a non zero value (pointing to format object) */ @@ -152,7 +152,7 @@ { PCLIPBOARDELEMENT ret = NULL; PCLIPBOARDELEMENT ce = ClipboardData; - + while(ce) { if (ce->format == format) @@ -171,7 +171,7 @@ { DWORD ret = 0; PCLIPBOARDELEMENT ce = ClipboardData; - + while(ce) { ret++; @@ -190,19 +190,19 @@ if (ce == NULL) { SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); - } + } else - { + { ce->format = format; ce->size = size; ce->hData = hData; ce->next = ClipboardData; - + ClipboardData = ce; - + IntIncrementSequenceNumber(); } - + return ce; } @@ -211,9 +211,9 @@ intRemoveFormatedData(UINT format) { BOOL ret = FALSE; - PCLIPBOARDELEMENT ce = ClipboardData; + PCLIPBOARDELEMENT ce = ClipboardData; PCLIPBOARDELEMENT *link = &ClipboardData; - + if (intIsFormatAvailable(format)) { while (ce != NULL) @@ -223,19 +223,19 @@ *link = ce->next; break; } - + link = &ce->next; ce = ce->next; } - + if (ce->hData) { ExFreePool(ce->hData); } - ExFreePool(ce); + ExFreePool(ce); ret = TRUE; } - + return ret; } @@ -244,7 +244,7 @@ { PCLIPBOARDELEMENT ce = ClipboardData; PCLIPBOARDELEMENT tmp; - + while(ce) { tmp = ce->next; @@ -252,13 +252,13 @@ ExFreePool(ce); ce = tmp; } - + ClipboardData = NULL; } /*==============================================================*/ -HANDLE FASTCALL +HANDLE FASTCALL renderBITMAPfromDIB(LPBYTE hDIB) { HDC hdc; @@ -268,7 +268,7 @@ //hdc = UserGetDCEx(NULL, NULL, DCX_USESTYLE); hdc = UserGetDCEx(ClipboardWindow, NULL, DCX_USESTYLE); - + ih = (BITMAPINFOHEADER *)hDIB; offset = sizeof(BITMAPINFOHEADER) + ((ih->biBitCount <= 8) ? (sizeof(RGBQUAD) * (1 << ih->biBitCount)) : 0); @@ -279,56 +279,56 @@ UserReleaseDC(ClipboardWindow, hdc, FALSE); return hbitmap; -} +} BOOL FASTCALL canSinthesize(UINT format) { BOOL ret = FALSE; - + switch(format) { case CF_BITMAP: case CF_METAFILEPICT: ret = TRUE; } - + return ret; } /* returns the size of the sinthesized data */ -DWORD FASTCALL +DWORD FASTCALL synthesizeData(UINT format) { DWORD ret = 0; - + synthesizedData = NULL; synthesizedDataSize = 0; - + if (!canSinthesize(format)) { return 0; } - + switch (format) { case CF_BITMAP: { - break; - } - + break; + } + case CF_METAFILEPICT: { - break; - } - } - + break; + } + } + ret = 1; - - return ret; -} - -VOID FASTCALL + + return ret; +} + +VOID FASTCALL freeSynthesizedData() { ExFreePool(synthesizedData); @@ -336,7 +336,7 @@ /*==============================================================*/ -BOOL FASTCALL +BOOL FASTCALL intIsClipboardOpenByMe() { /* check if we open the clipboard */ @@ -347,11 +347,11 @@ } /* will fail if not thread (closed) or not open by me*/ - return FALSE; -} + return FALSE; +} /* IntClipboardFreeWindow it's called when a window was destroyed */ -VOID FASTCALL +VOID FASTCALL IntClipboardFreeWindow(PWINDOW_OBJECT window) { /* called from co_UserFreeWindow in window.c */ @@ -375,8 +375,8 @@ PCLIPBOARDCHAINELEMENT w = IntRemoveWindowFromChain(window); if (w) { - ExFreePool(w); - } + ExFreePool(w); + } } } @@ -388,10 +388,10 @@ BOOL ret = FALSE; UserEnterExclusive(); - + sendDrawClipboardMsg = FALSE; recentlySetClipboard = FALSE; - + if (ClipboardThread) { /* clipboard is already open */ @@ -415,17 +415,17 @@ } else { - + if (hWnd != NULL) { Window = UserGetWindowObject(hWnd); - + if (Window != NULL) { ClipboardWindow = Window; ClipboardThread = PsGetCurrentThreadWin32Thread(); - ret = TRUE; - } + ret = TRUE; + } else { ClipboardWindow = NULL; @@ -438,12 +438,12 @@ { ClipboardWindow = NULL; ClipboardThread = PsGetCurrentThreadWin32Thread(); - ret = TRUE; - } - } - - UserLeave(); - + ret = TRUE; + } + } + + UserLeave(); + return ret; } @@ -451,50 +451,50 @@ NtUserCloseClipboard(VOID) { BOOL ret = FALSE; - + UserEnterExclusive(); - + if (intIsClipboardOpenByMe()) { ClipboardWindow = NULL; ClipboardThread = NULL; - ret = TRUE; + ret = TRUE; } else { SetLastWin32Error(ERROR_CLIPBOARD_NOT_OPEN); } - + recentlySetClipboard = FALSE; - - UserLeave(); - + + UserLeave(); + if (sendDrawClipboardMsg && WindowsChain) { /* only send message to the first window in the chain, then they'll do the chain */ - /* commented because it makes a crash in co_MsqSendMessage + /* commented because it makes a crash in co_MsqSendMessage ASSERT(WindowsChain->window); ASSERT(WindowsChain->window->hSelf); DPRINT1("Clipboard: sending WM_DRAWCLIPBOARD to %p\n", WindowsChain->window->hSelf); co_IntSendMessage(WindowsChain->window->hSelf, WM_DRAWCLIPBOARD, 0, 0); */ } - + return ret; } HWND STDCALL NtUserGetOpenClipboardWindow(VOID) { - HWND ret = NULL; + HWND ret = NULL; UserEnterShared(); - + if (ClipboardWindow) { ret = ClipboardWindow->hSelf; } - + UserLeave(); return ret; @@ -505,11 +505,11 @@ { BOOL ret = FALSE; PCLIPBOARDCHAINELEMENT w = NULL; - + UserEnterExclusive(); - - PWINDOW_OBJECT removeWindow = UserGetWindowObject(hWndRemove); - + + PWINDOW_OBJECT removeWindow = UserGetWindowObject(hWndRemove); + if (removeWindow) { if ((ret = !!IntIsWindowInChain(removeWindow))) @@ -517,21 +517,21 @@ w = IntRemoveWindowFromChain(removeWindow); if (w) { - ExFreePool(w); + ExFreePool(w); } } } - + if (ret && WindowsChain) { - // only send message to the first window in the chain, - // then they do the chain + // only send message to the first window in the chain, + // then they do the chain DPRINT1("Message: WM_CHANGECBCHAIN to %p", WindowsChain->window->hSelf); /* WindowsChain->window may be NULL */ LPARAM lparam = WindowsChain->window == NULL ? 0 : (LPARAM)WindowsChain->window->hSelf; co_IntSendMessage(WindowsChain->window->hSelf, WM_CHANGECBCHAIN, (WPARAM)hWndRemove, lparam); - } - + } + UserLeave(); return ret; @@ -540,8 +540,8 @@ DWORD STDCALL NtUserCountClipboardFormats(VOID) { - DWORD ret = 0; - + DWORD ret = 0; + if (ClipboardData) { ret = IntCountClipboardFormats(); @@ -554,36 +554,36 @@ NtUserEmptyClipboard(VOID) { BOOL ret = FALSE; - + UserEnterExclusive(); - + if (intIsClipboardOpenByMe()) { if (ClipboardData) { IntEmptyClipboardData(); } - + ClipboardOwnerWindow = ClipboardWindow; ClipboardOwnerThread = ClipboardThread; - + IntIncrementSequenceNumber(); - + ret = TRUE; } else { SetLastWin32Error(ERROR_CLIPBOARD_NOT_OPEN); - } - + } + if (ret && ClipboardOwnerWindow) { DPRINT1("Clipboard: WM_DESTROYCLIPBOARD to %p", ClipboardOwnerWindow->hSelf); - co_IntSendMessage( ClipboardOwnerWindow->hSelf, WM_DESTROYCLIPBOARD, 0, 0); - } - - UserLeave(); - + co_IntSendMessage( ClipboardOwnerWindow->hSelf, WM_DESTROYCLIPBOARD, 0, 0); + } + + UserLeave(); + return ret; } @@ -592,16 +592,16 @@ { HANDLE ret = NULL; PCHAR buffer; - + UserEnterShared(); - + if (intIsClipboardOpenByMe()) { /* when Unknown1 is zero, we returns to user32 the data size */ if (Unknown1 == 0) { PCLIPBOARDELEMENT data = intIsFormatAvailable(uFormat); - + if (data) { /* format exists in clipboard */ @@ -611,19 +611,19 @@ if (ClipboardOwnerWindow) { ASSERT(ClipboardOwnerWindow->hSelf); - co_IntSendMessage(ClipboardOwnerWindow->hSelf, WM_RENDERFORMAT, (WPARAM)uFormat, 0); + co_IntSendMessage(ClipboardOwnerWindow->hSelf, WM_RENDERFORMAT, (WPARAM)uFormat, 0); data = intIsFormatAvailable(uFormat); ASSERT(data->size); ret = (HANDLE)data->size; } } else - { + { if (data->size == DATA_SYNTHESIZED_RENDER) { data->size = synthesizeData(uFormat); } - + } ret = (HANDLE)data->size; } @@ -636,7 +636,7 @@ else { PCLIPBOARDELEMENT data = intIsFormatAvailable(uFormat); - + if (data) { if (data->size == DATA_DELAYED_RENDER) @@ -659,18 +659,18 @@ else { buffer = (PCHAR)Unknown1; - memcpy(buffer, (PCHAR)synthesizedData, synthesizedDataSize); - + memcpy(buffer, (PCHAR)synthesizedData, synthesizedDataSize); + freeSynthesizedData(); - + ret = (HANDLE)Unknown1; } } else { buffer = (PCHAR)Unknown1; - memcpy(buffer, (PCHAR)data->hData, data->size); - + memcpy(buffer, (PCHAR)data->hData, data->size); + ret = (HANDLE)Unknown1; } } @@ -682,10 +682,10 @@ else { SetLastWin32Error(ERROR_CLIPBOARD_NOT_OPEN); - } - - UserLeave(); - + } + + UserLeave(); + return ret; } @@ -695,28 +695,28 @@ { UNICODE_STRING sFormatName; INT ret = 0; - + /* if the format is built-in we fail */ if (format < 0xc000) { /* registetrated formats are >= 0xc000 */ return 0; } - + if((cchMaxCount < 1) || !FormatName) { SetLastWin32Error(ERROR_INVALID_PARAMETER); return 0; } - + _SEH_TRY { ProbeForWriteUnicodeString(FormatName); sFormatName = *(volatile UNICODE_STRING *)FormatName; ProbeForWrite(sFormatName.Buffer, sFormatName.MaximumLength, 1); - + ret = IntGetAtomName((RTL_ATOM)format, sFormatName.Buffer, cchMaxCount * sizeof(WCHAR)); - + if (ret >= 0) { ret = ret / sizeof(WCHAR); @@ -732,7 +732,7 @@ SetLastNtError(_SEH_GetExceptionCode()); } _SEH_END; - + return ret; } @@ -741,20 +741,20 @@ { UINT ret = 0; UNICODE_STRING cFormatName = {0}; - + if (FormatName == NULL) { SetLastWin32Error(ERROR_INVALID_PARAMETER); return ret; } - + UserEnterExclusive(); - + _SEH_TRY { - cFormatName = ProbeForReadUnicodeString(FormatName); - - if (cFormatName.Length > 0) + cFormatName = ProbeForReadUnicodeString(FormatName); + + if (cFormatName.Length > 0) { ret = (UINT)IntAddAtom(cFormatName.Buffer); //RtlFreeUnicodeString(&cFormatName); @@ -762,9 +762,9 @@ else { SetLastWin32Error(ERROR_INVALID_NAME); - _SEH_LEAVE; - } - + _SEH_LEAVE; + } + } _SEH_HANDLE { @@ -773,42 +773,42 @@ _SEH_END; UserLeave(); - - return ret; -} - + + return ret; +} + HWND STDCALL NtUserGetClipboardOwner(VOID) { - HWND ret = NULL; - + HWND ret = NULL; + UserEnterShared(); - + if (ClipboardOwnerWindow) { ret = ClipboardOwnerWindow->hSelf; } - - UserLeave(); - + + UserLeave(); + return ret; } HWND STDCALL NtUserGetClipboardViewer(VOID) { - HWND ret = NULL; - + HWND ret = NULL; + UserEnterShared(); - + if (WindowsChain) { ret = WindowsChain->window->hSelf; } - - UserLeave(); - + + UserLeave(); + return ret; } @@ -823,18 +823,18 @@ _SEH_TRY { - if (IntCountClipboardFormats() == 0) + if (IntCountClipboardFormats() == 0) { ret = 0; } else { ProbeForRead(paFormatPriorityList, cFormats, sizeof(UINT)); - + priorityList = paFormatPriorityList; - + ret = -1; - + for (i = 0; i < cFormats; i++) { if (intIsFormatAvailable(priorityList[i])) @@ -843,7 +843,7 @@ break; } } - + } } _SEH_HANDLE @@ -855,20 +855,20 @@ UserLeave(); return ret; - + } BOOL STDCALL NtUserIsClipboardFormatAvailable(UINT format) { BOOL ret = FALSE; - + UserEnterShared(); - + ret = (intIsFormatAvailable(format) != NULL); - - UserLeave(); - + + UserLeave(); + return ret; } @@ -881,16 +881,16 @@ UNICODE_STRING unicodeString; OEM_STRING oemString; ANSI_STRING ansiString; - + UserEnterExclusive(); - + /* to place data here the we need to be the owner */ if (ClipboardOwnerThread == PsGetCurrentThreadWin32Thread()) { PCLIPBOARDELEMENT data = intIsFormatAvailable(uFormat); if (data) { - + if (data->size == DATA_DELAYED_RENDER) { intRemoveFormatedData(uFormat); @@ -901,7 +901,7 @@ goto exit_setCB; } } - + if (hMem) { _SEH_TRY @@ -911,19 +911,19 @@ _SEH_HANDLE { SetLastNtError(_SEH_GetExceptionCode()); - goto exit_setCB; + _SEH_YIELD(goto exit_setCB); } _SEH_END; - + if (intIsClipboardOpenByMe()) { - delayedRender = FALSE; + delayedRender = FALSE; } if (!canSinthesize(uFormat)) { hCBData = ExAllocatePool(PagedPool, size); - memcpy(hCBData, hMem, size); + memcpy(hCBData, hMem, size); intAddFormatedData(uFormat, hCBData, size); DPRINT1("Data stored\n"); } @@ -931,13 +931,13 @@ sendDrawClipboardMsg = TRUE; recentlySetClipboard = TRUE; lastEnumClipboardFormats = uFormat; - + /* conversions */ switch (uFormat) { - case CF_TEXT: + case CF_TEXT: { - //TODO : sinthesize CF_UNICODETEXT & CF_OEMTEXT + //TODO : sinthesize CF_UNICODETEXT & CF_OEMTEXT // CF_TEXT -> CF_UNICODETEXT RtlAnsiStringToUnicodeString(&unicodeString, hCBData, TRUE); intAddFormatedData(CF_UNICODETEXT, unicodeString.Buffer, unicodeString.Length * sizeof(WCHAR)); @@ -976,16 +976,16 @@ } case CF_BITMAP: { - // we need to render the DIB or DIBV5 format as soon as possible + // we need to render the DIB or DIBV5 format as soon as possible // because pallette information may change - + HDC hdc; INT ret; BITMAP bm; BITMAPINFO bi; - + hdc = UserGetDCEx(NULL, NULL, DCX_USESTYLE); - + BITMAPOBJ *BitmapObj; BitmapObj = BITMAPOBJ_LockBitmap(hMem); BITMAP_GetObject(BitmapObj, sizeof(BITMAP), (LPSTR)&bm); @@ -993,7 +993,7 @@ { BITMAPOBJ_UnlockBitmap(BitmapObj); } - + bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); bi.bmiHeader.biWidth = bm.bmWidth; bi.bmiHeader.biHeight = bm.bmHeight; @@ -1003,24 +1003,24 @@ bi.bmiHeader.biSizeImage = 0; bi.bmiHeader.biXPelsPerMeter = 0; bi.bmiHeader.biYPelsPerMeter = 0; - bi.bmiHeader.biClrUsed = 0; - + bi.bmiHeader.biClrUsed = 0; + ret = NtGdiGetDIBits(hdc, hMem, 0, bm.bmHeight, NULL, &bi, DIB_RGB_COLORS); - + size = bi.bmiHeader.biSizeImage + sizeof(BITMAPINFOHEADER); - + hCBData = ExAllocatePool(PagedPool, size); - memcpy(hCBData, &bi, sizeof(BITMAPINFOHEADER)); - + memcpy(hCBData, &bi, sizeof(BITMAPINFOHEADER)); + ret = NtGdiGetDIBits(hdc, hMem, 0, bm.bmHeight, (LPBYTE)hCBData + sizeof(BITMAPINFOHEADER), &bi, DIB_RGB_COLORS); - + UserReleaseDC(NULL, hdc, FALSE); - + intAddFormatedData(CF_DIB, hCBData, size); intAddFormatedData(CF_BITMAP, 0, DATA_SYNTHESIZED_RENDER); // intAddFormatedData(CF_DIBV5, hCBData, size); - - break; + + break; } case CF_DIB: { @@ -1028,21 +1028,21 @@ // intAddFormatedData(CF_DIBV5, hCBData, size); /* investigate */ // intAddFormatedData(CF_PALETTE, hCBData, size); - break; + break; } case CF_DIBV5: // intAddFormatedData(CF_BITMAP, hCBData, size); // intAddFormatedData(CF_PALETTE, hCBData, size); // intAddFormatedData(CF_DIB, hCBData, size); - break; + break; case CF_ENHMETAFILE: // intAddFormatedData(CF_METAFILEPICT, hCBData, size); - break; + break; case CF_METAFILEPICT: // intAddFormatedData(CF_ENHMETAFILE, hCBData, size); - break; - } - + break; + } + } else { @@ -1052,14 +1052,14 @@ intAddFormatedData(uFormat, NULL, 0); DPRINT1("SetClipboardData delayed format: %d\n", uFormat); } - - - } - -exit_setCB: - - UserLeave(); - + + + } + +exit_setCB: + + UserLeave(); + return hMem; } @@ -1068,21 +1068,21 @@ { HWND ret = NULL; PCLIPBOARDCHAINELEMENT newWC = NULL; - + UserEnterExclusive(); - PWINDOW_OBJECT window = UserGetWindowObject(hWndNewViewer); - + PWINDOW_OBJECT window = UserGetWindowObject(hWndNewViewer); + if (window) { if ((newWC = IntAddWindowToChain(window))) { if (newWC) { - // newWC->next may be NULL if we are the first window in the chain + // newWC->next may be NULL if we are the first window in the chain if (newWC->next) { - // return the next HWND available window in the chain + // return the next HWND available window in the chain ret = newWC->next->window->hSelf; } } @@ -1098,9 +1098,9 @@ NtUserEnumClipboardFormats(UINT uFormat) { UINT ret = 0; - + UserEnterShared(); - + if (intIsClipboardOpenByMe()) { if (uFormat == 0) @@ -1131,7 +1131,7 @@ if (data) { - if (data->next) + if (data->next) { ret = data->next->format; } @@ -1142,29 +1142,29 @@ } } } - + } } else { - SetLastWin32Error(ERROR_CLIPBOARD_NOT_OPEN); - } - - UserLeave(); - - return ret; -} - -// This number is incremented whenever the contents of the clipboard change + SetLastWin32Error(ERROR_CLIPBOARD_NOT_OPEN); + } + + UserLeave(); + + return ret; +} + +// This number is incremented whenever the contents of the clipboard change // or the clipboard is emptied. -// If clipboard rendering is delayed, +// If clipboard rendering is delayed, // the sequence number is not incremented until the changes are rendered. VOID FASTCALL IntIncrementSequenceNumber(VOID) { USE_WINSTA - + WINSTA_ClipboardSequenceNumber++; } @@ -1173,16 +1173,16 @@ NtUserGetClipboardSequenceNumber(VOID) { //windowstation sequence number - //if no WINSTA_ACCESSCLIPBOARD access to the window station, + //if no WINSTA_ACCESSCLIPBOARD access to the window station, //the function returns zero. - DWORD sn; - + DWORD sn; + HWINSTA WinSta; PWINSTATION_OBJECT WinStaObj; NTSTATUS Status; - + WinSta = UserGetProcessWindowStation(); - + Status = IntValidateWindowStationHandle(WinSta, UserMode, WINSTA_ACCESSCLIPBOARD, &WinStaObj); if (!NT_SUCCESS(Status)) @@ -1191,14 +1191,14 @@ SetLastNtError(Status); return 0; } - + sn = WinStaObj->ClipboardSequenceNumber; - + ObDereferenceObject(WinStaObj); - + //local copy //sn = ClipboardSequenceNumber; - + return sn; } @@ -1213,7 +1213,7 @@ return FALSE; } -BOOL STDCALL NtUserRemoveClipboardFormatListener( +BOOL STDCALL NtUserRemoveClipboardFormatListener( HWND hwnd ) { @@ -1221,7 +1221,7 @@ return FALSE; } -BOOL STDCALL NtUserGetUpdatedClipboardFormats( +BOOL STDCALL NtUserGetUpdatedClipboardFormats( PUINT lpuiFormats, UINT cFormats, PUINT pcFormatsOut Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c Sun Apr 1 04:07:25 2007 @@ -70,7 +70,7 @@ PWINDOW_OBJECT FASTCALL IntGetWindowObject(HWND hWnd) { PWINDOW_OBJECT Window; - + if (!hWnd) return NULL; Window = UserGetWindowObject(hWnd); @@ -100,11 +100,11 @@ } if (!hWnd) - { + { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); return NULL; } - + Window = (PWINDOW_OBJECT)UserGetObject(gHandleTable, hWnd, otWindow); if (!Window || 0 != (Window->Status & WINDOWSTATUS_DESTROYED)) { @@ -146,7 +146,7 @@ -/* +/* Caller must NOT dereference retval! But if caller want the returned value to persist spanning a co_ call, it must reference the value (because the owner is not garanteed to @@ -168,7 +168,7 @@ } -/* +/* Caller must NOT dereference retval! But if caller want the returned value to persist spanning a co_ call, it must reference the value (because the owner is not garanteed to @@ -243,7 +243,7 @@ { // USER_REFERENCE_ENTRY Ref; // UserRefObjectCo(Window, &Ref); - + if (!IntGetOwner(Window) && !IntGetParent(Window)) { co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (LPARAM) hWnd); @@ -299,7 +299,7 @@ * * This is the "functional" DestroyWindows function ei. all stuff * done in CreateWindow is undone here and not in DestroyWindow:-P - + */ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window, PW32PROCESS ProcessData, @@ -351,7 +351,7 @@ } else co_UserFreeWindow(Child, ProcessData, ThreadData, SendMessages); - + UserDerefObject(Child); } } @@ -461,7 +461,7 @@ UserDerefObject(Window); - IntClipboardFreeWindow(Window); + IntClipboardFreeWindow(Window); return 0; } @@ -641,7 +641,7 @@ PWINDOW_OBJECT Wnd; USER_REFERENCE_ENTRY Ref; WThread = (PW32THREAD)Thread->Tcb.Win32Thread; - + while (!IsListEmpty(&WThread->WindowListHead)) { Current = WThread->WindowListHead.Flink; @@ -650,14 +650,14 @@ DPRINT("thread cleanup: while destroy wnds, wnd=0x%x\n",Wnd); /* window removes itself from the list */ - + /* fixme: it is critical that the window removes itself! if now, we will loop here forever... */ - + //ASSERT(co_UserDestroyWindow(Wnd)); - + UserRefObjectCo(Wnd, &Ref);//faxme: temp hack?? if (!co_UserDestroyWindow(Wnd)) { @@ -973,9 +973,9 @@ return NULL; WndOldParent = Wnd->Parent; - + if (WndOldParent) UserRefObject(WndOldParent); /* caller must deref */ - + if (WndNewParent != WndOldParent) { IntUnlinkWindow(Wnd); @@ -1032,7 +1032,7 @@ of IntSetParent() */ // return WndOldParent; // } - + return WndOldParent;//NULL; } @@ -1583,7 +1583,7 @@ Window->MessageQueue = PsGetCurrentThreadWin32Thread()->MessageQueue; IntReferenceMessageQueue(Window->MessageQueue); Window->Parent = ParentWindow; - + if((OwnerWindow = UserGetWindowObject(OwnerWindowHandle))) { Window->hOwner = OwnerWindowHandle; @@ -1594,7 +1594,7 @@ Window->hOwner = NULL; HasOwner = FALSE; } - + Window->UserData = 0; Window->IsSystem = Window->Class->System; @@ -1755,11 +1755,11 @@ Pos.y = rc.top; } -/* +/* According to wine, the ShowMode is set to y if x == CW_USEDEFAULT(16) and y is something else. and Quote! */ - + /* Never believe Microsoft's documentation... CreateWindowEx doc says * that if an overlapped window is created with WS_VISIBLE style bit * set and the x parameter is set to CW_USEDEFAULT, the system ignores @@ -1891,7 +1891,7 @@ MaxPos.x = Window->WindowRect.left; MaxPos.y = Window->WindowRect.top; - + DPRINT("IntCreateWindowEx(): About to get non-client size.\n"); /* WinPosGetNonClientSize SENDS THE WM_NCCALCSIZE message */ Result = co_WinPosGetNonClientSize(Window, @@ -1909,9 +1909,9 @@ if ((dwStyle & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD) { PWINDOW_OBJECT PrevSibling; - + PrevSibling = ParentWindow->LastChild; - + /* link window as bottom sibling */ IntLinkWindow(Window, ParentWindow, PrevSibling /*prev sibling*/); } @@ -1933,7 +1933,7 @@ { InsertAfter = NULL; } - + IntLinkWindow(Window, ParentWindow, InsertAfter /* prev sibling */); } @@ -1943,7 +1943,7 @@ DPRINT("IntCreateWindowEx(): about to send CREATE message.\n"); Result = co_IntSendMessage(Window->hSelf, WM_CREATE, 0, (LPARAM) &Cs); - + if (Result == (LRESULT)-1) { /* FIXME: Cleanup. */ @@ -1987,14 +1987,14 @@ Window->ClientRect.top); } - + co_IntSendMessage(Window->hSelf, WM_MOVE, 0, lParam); /* Call WNDOBJ change procs */ IntEngWindowChanged(Window, WOC_RGN_CLIENT); - + } /* Show or maybe minimize or maximize the window. */ @@ -2329,7 +2329,7 @@ UserDerefObjectCo(Window);//faxme: dunno if win should be reffed during destroy.. RETURN(ret); - + CLEANUP: DPRINT("Leave NtUserDestroyWindow, ret=%i\n",_ret_); UserLeave(); @@ -2513,7 +2513,7 @@ _SEH_HANDLE { SetLastNtError(_SEH_GetExceptionCode()); - RETURN(NULL); + _SEH_YIELD(RETURN(NULL)); } _SEH_END; @@ -2710,7 +2710,7 @@ for (;;) { PWINDOW_OBJECT Parent, Old; - + Old = WndAncestor; Parent = IntGetParent(WndAncestor); @@ -2718,10 +2718,10 @@ { break; } - + //temp hack // UserDerefObject(Parent); - + WndAncestor = Parent; } break; @@ -2749,7 +2749,7 @@ DPRINT("Enter NtUserGetAncestor\n"); UserEnterExclusive(); - + if (!(Window = UserGetWindowObject(hWnd))) { RETURN(NULL); @@ -2757,7 +2757,7 @@ Ancestor = UserGetAncestor(Window, Type); /* faxme: can UserGetAncestor ever return NULL for a valid window? */ - + RETURN(Ancestor ? Ancestor->hSelf : NULL); CLEANUP: @@ -2956,9 +2956,9 @@ UserRefObjectCo(Wnd, &Ref); UserRefObjectCo(WndParent, &ParentRef); - + WndOldParent = co_IntSetParent(Wnd, WndParent); - + UserDerefObjectCo(WndParent); UserDerefObjectCo(Wnd); @@ -3931,12 +3931,12 @@ /* QueryWindow based on KJK::Hyperion and James Tabor. - + 0 = QWUniqueProcessId 1 = QWUniqueThreadId 4 = QWIsHung Implements IsHungAppWindow found by KJK::Hyperion. - + 9 = QWKillWindow When I called this with hWnd == DesktopWindow, it shutdown the system and rebooted. @@ -4475,13 +4475,13 @@ //hmm... threads live on desktops thus we have a reference on the desktop and indirectly the desktop window //its possible this referencing is useless, thou it shouldnt hurt... UserRefObjectCo(DesktopWindow, &Ref); - + Hit = co_WinPosWindowFromPoint(DesktopWindow, PsGetCurrentThreadWin32Thread()->MessageQueue, &pt, &Window); - + if(Window) { Ret = Window->hSelf; - + RETURN( Ret); } } Modified: trunk/reactos/subsystems/win32/win32k/win32k.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/wi…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/win32k.rbuild (original) +++ trunk/reactos/subsystems/win32/win32k/win32k.rbuild Sun Apr 1 04:07:25 2007 @@ -1,7 +1,7 @@ <module name="win32k_base" type="objectlibrary"> <include base="win32k">.</include> <include base="win32k">include</include> - <include base="ntoskrnl">include</include> + <include base="ntoskrnl">include</include> <include base="freetype">include</include> <include base="ReactOS">include/reactos/subsys</include> <include base="ReactOS">include/reactos/drivers</include> @@ -9,7 +9,6 @@ <define name="__USE_W32API" /> <define name="_WIN32_WINNT">0x0501</define> <define name="WINVER">0x600</define> - <define name="_SEH_NO_NATIVE_NLG" /> <define name="_WIN32K_" /> <pch>w32k.h</pch> @@ -33,14 +32,14 @@ </directory> </if> - <ifnot property="ARCH" value="i386"> + <ifnot property="ARCH" value="i386"> <file>dib24bppc.c</file> <file>dib32bppc.c</file> - </ifnot> + </ifnot> </directory> - + <directory name="eng"> @@ -93,7 +92,7 @@ <file>floor_asm.s</file> <file>ceil_asm.s</file> </directory> - </if> + </if> </directory> <directory name="ntddraw"> <compilationunit name="ntddraw.c"> @@ -127,7 +126,7 @@ <file>misc.c</file> <file>monitor.c</file> <file>msgqueue.c</file> - <file>ntuser.c</file> + <file>ntuser.c</file> <file>painting.c</file> <file>prop.c</file> <file>scrollbar.c</file> Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp (original) +++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Sun Apr 1 04:07:25 2007 @@ -1556,19 +1556,18 @@ fprintf ( fMakefile, "\t$(ECHO_LD)\n" ); string targetName ( module.GetTargetName () ); - string killAt = module.mangledSymbols ? "" : "--kill-at"; - if ( module.IsDLL () ) { string temp_exp = ros_temp + module.name + ".temp.exp"; CLEAN_FILE ( temp_exp ); fprintf ( fMakefile, - "\t${dlltool} --dllname %s --def %s --output-exp %s %s\n", + "\t${dlltool} --dllname %s --def %s --output-exp %s %s %s\n", targetName.c_str (), definitionFilename.c_str (), temp_exp.c_str (), - killAt.c_str () ); + module.mangledSymbols ? "" : "--kill-at", + module.underscoreSymbols ? "--add-underscore" : "" ); fprintf ( fMakefile, "\t%s %s %s %s -o %s %s %s %s\n", @@ -1741,10 +1740,11 @@ string definitionFilename ( GetDefinitionFilename () ); fprintf ( fMakefile, - "\t${dlltool} --dllname %s --def %s --output-lib $@ %s -U\n", + "\t${dlltool} --dllname %s --def %s --output-lib $@ %s %s\n", module.importLibrary->dllname.c_str (), definitionFilename.c_str (), - module.mangledSymbols ? "" : "--kill-at" ); + module.mangledSymbols ? "" : "--kill-at", + module.underscoreSymbols ? "--add-underscore" : "" ); } fprintf ( fMakefile, "\t$(ECHO_AR)\n" ); @@ -2199,13 +2199,13 @@ fprintf ( fMakefile, "\t$(ECHO_DLLTOOL)\n" ); - string killAt = module.mangledSymbols ? "" : "--kill-at"; fprintf ( fMakefile, - "\t${dlltool} --dllname %s --def %s --output-lib %s %s\n\n", + "\t${dlltool} --dllname %s --def %s --output-lib %s %s %s\n\n", module.GetTargetName ().c_str (), defFilename.c_str (), library_target.c_str (), - killAt.c_str () ); + module.mangledSymbols ? "" : "--kill-at", + module.underscoreSymbols ? "--add-underscore" : "" ); } } Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h (original) +++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h Sun Apr 1 04:07:25 2007 @@ -244,7 +244,6 @@ MingwKernelModuleHandler ( const Module& module ); virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); - std::string TypeSpecificCFlags() { return "-D_SEH_NO_NATIVE_NLG"; } private: void GenerateKernelModuleTarget (); }; @@ -278,7 +277,6 @@ MingwKernelModeDLLModuleHandler ( const Module& module ); virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); - std::string TypeSpecificCFlags() { return "-D_SEH_NO_NATIVE_NLG"; } std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; } void AddImplicitLibraries ( Module& module ); private: @@ -292,7 +290,7 @@ MingwKernelModeDriverModuleHandler ( const Module& module ); virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); - std::string TypeSpecificCFlags() { return "-D__NTDRIVER__ -D_SEH_NO_NATIVE_NLG"; } + std::string TypeSpecificCFlags() { return "-D__NTDRIVER__"; } std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; } void AddImplicitLibraries ( Module& module ); private: @@ -306,7 +304,6 @@ MingwNativeDLLModuleHandler ( const Module& module ); virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); - std::string TypeSpecificCFlags() { return "-D_SEH_NO_NATIVE_NLG"; } std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; } void AddImplicitLibraries ( Module& module ); private: @@ -320,7 +317,7 @@ MingwNativeCUIModuleHandler ( const Module& module ); virtual HostType DefaultHost() { return HostFalse; } virtual void Process (); - std::string TypeSpecificCFlags() { return "-D__NTAPP__ -D_SEH_NO_NATIVE_NLG"; } + std::string TypeSpecificCFlags() { return "-D__NTAPP__"; } std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; } void AddImplicitLibraries ( Module& module ); private: Modified: trunk/reactos/tools/rbuild/module.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/module.cpp?re…
============================================================================== --- trunk/reactos/tools/rbuild/module.cpp (original) +++ trunk/reactos/tools/rbuild/module.cpp Sun Apr 1 04:07:25 2007 @@ -142,7 +142,7 @@ if (index == string::npos) index = 0; string tmp = filename.substr( index, filename.size() - index ); size_t ext_index = tmp.find_last_of( '.' ); - if (ext_index != string::npos) + if (ext_index != string::npos) return filename.substr ( index + ext_index, filename.size() ); return ""; } @@ -373,6 +373,12 @@ else mangledSymbols = false; + att = moduleNode.GetAttribute ( "underscoresymbols", false ); + if ( att != NULL ) + underscoreSymbols = att->value == "true"; + else + underscoreSymbols = false; + att = moduleNode.GetAttribute ( "host", false ); if ( att != NULL ) { @@ -424,7 +430,7 @@ installName = att->value; else installName = ""; - + att = moduleNode.GetAttribute ( "usewrc", false ); if ( att != NULL ) useWRC = att->value == "true"; @@ -1451,7 +1457,7 @@ void If::ProcessXML() { - + } Modified: trunk/reactos/tools/rbuild/project.dtd URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/project.dtd?r…
============================================================================== --- trunk/reactos/tools/rbuild/project.dtd (original) +++ trunk/reactos/tools/rbuild/project.dtd Sun Apr 1 04:07:25 2007 @@ -82,6 +82,7 @@ entrypoint %CIdentifier; #IMPLIED baseaddress %CIdentifier; #IMPLIED mangledsymbols %Text; #IMPLIED + underscoresymbols (true|false) "false" installbase %Text; #IMPLIED installname %Text; #IMPLIED usewrc %Text; #IMPLIED Modified: trunk/reactos/tools/rbuild/rbuild.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.h?rev=…
============================================================================== --- trunk/reactos/tools/rbuild/rbuild.h (original) +++ trunk/reactos/tools/rbuild/rbuild.h Sun Apr 1 04:07:25 2007 @@ -296,6 +296,7 @@ ModuleType type; ImportLibrary* importLibrary; bool mangledSymbols; + bool underscoreSymbols; bool isUnicode; bool isDefaultEntryPoint; Bootstrap* bootstrap;
17 years, 9 months
1
0
0
0
← Newer
1
...
35
36
37
38
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
Results per page:
10
25
50
100
200