ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
February 2011
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
18 participants
352 discussions
Start a n
N
ew thread
[tkreuzer] 50826: [WIN32K] NtGdiStretchDIBitsInternal: don't call NtGdiGetDCObject and NtGdiCreateCompatibleDC with a dc locked. These cases are not harmful, but generally Nt* and Gre* should never...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Feb 19 22:29:31 2011 New Revision: 50826 URL:
http://svn.reactos.org/svn/reactos?rev=50826&view=rev
Log: [WIN32K] NtGdiStretchDIBitsInternal: don't call NtGdiGetDCObject and NtGdiCreateCompatibleDC with a dc locked. These cases are not harmful, but generally Nt* and Gre* should never be called with an exclusive gdi lock held. Also don't return in failure case with the dc still locked. Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] Sat Feb 19 22:29:31 2011 @@ -1043,13 +1043,6 @@ return 0; } - if (!(pdc = DC_LockDc(hDC))) - { - ExFreePoolWithTag(safeBits, TAG_DIB); - EngSetLastError(ERROR_INVALID_HANDLE); - return 0; - } - _SEH2_TRY { ProbeForRead(BitsInfo, cjMaxInfo, 1); @@ -1075,6 +1068,13 @@ } hBitmap = NtGdiGetDCObject(hDC, OBJ_BITMAP); + + if (!(pdc = DC_LockDc(hDC))) + { + ExFreePoolWithTag(safeBits, TAG_DIB); + EngSetLastError(ERROR_INVALID_HANDLE); + return 0; + } if (XDest == 0 && YDest == 0 && XSrc == 0 && XSrc == 0 && DestWidth == SrcWidth && DestHeight == SrcHeight && @@ -1091,14 +1091,17 @@ { /* fast path */ ret = IntSetDIBits(pdc, hBitmap, 0, height, safeBits, BitsInfo, Usage); + DC_UnlockDc(pdc); goto cleanup; } } /* slow path - need to use StretchBlt */ + hBitmap = DIB_CreateDIBSection(pdc, BitsInfo, Usage, &pvBits, NULL, 0, 0); + DC_UnlockDc(pdc); + hdcMem = NtGdiCreateCompatibleDC(hDC); - hBitmap = DIB_CreateDIBSection(pdc, BitsInfo, Usage, &pvBits, NULL, 0, 0); if(!hBitmap) { DPRINT1("Error, failed to create a DIB section\n"); @@ -1123,7 +1126,6 @@ cleanup: ExFreePoolWithTag(safeBits, TAG_DIB); - DC_UnlockDc(pdc); return ret; }
13 years, 10 months
1
0
0
0
[tkreuzer] 50825: [WIN32K] - add tracing of exclusive gdi locks - add some asserts
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Feb 19 22:03:34 2011 New Revision: 50825 URL:
http://svn.reactos.org/svn/reactos?rev=50825&view=rev
Log: [WIN32K] - add tracing of exclusive gdi locks - add some asserts Modified: trunk/reactos/subsystems/win32/win32k/include/gdiobj.h trunk/reactos/subsystems/win32/win32k/ntuser/ntuser.c trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c Modified: trunk/reactos/subsystems/win32/win32k/include/gdiobj.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/gdiobj.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/gdiobj.h [iso-8859-1] Sat Feb 19 22:03:34 2011 @@ -8,6 +8,9 @@ /* Public GDI Object/Handle definitions */ #include <win32k/ntgdihdl.h> #include "win32.h" + +/* apparently the first 10 entries are never used in windows as they are empty */ +#define RESERVE_ENTRIES_COUNT 10 typedef struct _GDI_HANDLE_TABLE { @@ -105,6 +108,19 @@ FORCEINLINE GDIOBJ_UnlockObjByPtr(POBJ Object) { +#if DBG + PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); + if (pti) + { + if (pti->cExclusiveLocks < 1) + { + DbgPrint("cExclusiveLocks = %ld, object: %ld\n", + pti->cExclusiveLocks, Object->cExclusiveLock); + ASSERT(FALSE); + } + pti->cExclusiveLocks--; + } +#endif INT cLocks = InterlockedDecrement((PLONG)&Object->cExclusiveLock); ASSERT(cLocks >= 0); return cLocks; @@ -120,6 +136,7 @@ ASSERT(cLocks >= 0); if ((flags & BASEFLAG_READY_TO_DIE) && (cLocks == 0)) { + ASSERT(Object->cExclusiveLock == 0); GDIOBJ_SetOwnership(hobj, PsGetCurrentProcess()); GDIOBJ_FreeObjByHandle(hobj, GDI_OBJECT_TYPE_DONTCARE); } Modified: trunk/reactos/subsystems/win32/win32k/ntuser/ntuser.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/ntuser.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/ntuser.c [iso-8859-1] Sat Feb 19 22:03:34 2011 @@ -38,7 +38,7 @@ gpsi->atomSysClass[ICLS_SWITCH] = 32771; gpsi->atomSysClass[ICLS_ICONTITLE] = 32772; gpsi->atomSysClass[ICLS_TOOLTIPS] = 32774; - + /* System Message Atom */ AtomMessage = IntAddGlobalAtom(L"Message", TRUE); gpsi->atomSysClass[ICLS_HWNDMESSAGE] = AtomMessage; @@ -112,7 +112,7 @@ // { GetW32ThreadInfo(); - + // Callback to User32 Client Thread Setup co_IntClientThreadSetup(); @@ -208,12 +208,14 @@ VOID FASTCALL UserEnterExclusive(VOID) { + ASSERT_NOGDILOCKS(); KeEnterCriticalRegion(); ExAcquireResourceExclusiveLite(&UserLock, TRUE); } VOID FASTCALL UserLeave(VOID) { + ASSERT_NOGDILOCKS(); ExReleaseResourceLite(&UserLock); KeLeaveCriticalRegion(); } Modified: trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/gdiobj.c [iso-8859-1] Sat Feb 19 22:03:34 2011 @@ -16,9 +16,6 @@ (((ULONG_PTR)(e) - (ULONG_PTR)&((ht)->Entries[0])) / sizeof(GDI_TABLE_ENTRY)) #define GDI_HANDLE_GET_ENTRY(HandleTable, h) \ (&(HandleTable)->Entries[GDI_HANDLE_GET_INDEX((h))]) - -/* apparently the first 10 entries are never used in windows as they are empty */ -#define RESERVE_ENTRIES_COUNT 10 #define BASE_OBJTYPE_COUNT 32 @@ -483,6 +480,9 @@ newObject->ulShareCount = 0; newObject->cExclusiveLock = 1; newObject->Tid = Thread; +#if DBG + if (Thread) Thread->cExclusiveLocks++; +#endif AllocTypeDataDump(TypeInfo); @@ -603,11 +603,11 @@ ((Entry->Type & GDI_ENTRY_BASETYPE_MASK) == (HandleUpper & GDI_ENTRY_BASETYPE_MASK)) ) { POBJ Object; + PTHREADINFO Thread = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); Object = Entry->KernelData; - if ((Object->cExclusiveLock == 0 || - Object->Tid == (PTHREADINFO)PsGetCurrentThreadWin32Thread()) && + if ((Object->cExclusiveLock == 0 || Object->Tid == Thread) && Object->ulShareCount == 0) { BOOL Ret; @@ -623,6 +623,18 @@ InterlockedPushFreeEntry(GDI_ENTRY_TO_INDEX(GdiHandleTable, Entry)); Object->hHmgr = NULL; +#if DBG + if (Thread) + { + if (Thread->cExclusiveLocks < Object->cExclusiveLock) + { + DPRINT1("cExclusiveLocks = %ld, object: %ld\n", + Thread->cExclusiveLocks, Object->cExclusiveLock); + ASSERT(FALSE); + } + Thread->cExclusiveLocks -= Object->cExclusiveLock; + } +#endif if (W32Process != NULL) { @@ -1056,6 +1068,9 @@ Object->Tid = Thread; Object->cExclusiveLock = 1; GDIDBG_CAPTURELOCKER(GDI_HANDLE_GET_INDEX(hObj)) +#if DBG + if (Thread) Thread->cExclusiveLocks++; +#endif } else { @@ -1068,6 +1083,9 @@ continue; } InterlockedIncrement((PLONG)&Object->cExclusiveLock); +#if DBG + if (Thread) Thread->cExclusiveLocks++; +#endif } } else
13 years, 10 months
1
0
0
0
[tkreuzer] 50824: [WIN32K] - Add ros specific member cExclusiveLocks to THREADINFO to track number of acquired locks - Add functions/macros to check lock count - Move some definitions into gdidebug...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Feb 19 21:56:43 2011 New Revision: 50824 URL:
http://svn.reactos.org/svn/reactos?rev=50824&view=rev
Log: [WIN32K] - Add ros specific member cExclusiveLocks to THREADINFO to track number of acquired locks - Add functions/macros to check lock count - Move some definitions into gdidebug.h for global use - Fix broken GdiDbgHTIntegrityCheck - Add pre and post syscall hook functions (unused yet) Modified: trunk/reactos/subsystems/win32/win32k/include/gdidebug.h trunk/reactos/subsystems/win32/win32k/include/win32.h trunk/reactos/subsystems/win32/win32k/objects/gdidbg.c Modified: trunk/reactos/subsystems/win32/win32k/include/gdidebug.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/gdidebug.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/gdidebug.h [iso-8859-1] Sat Feb 19 21:56:43 2011 @@ -1,6 +1,12 @@ #pragma once extern ULONG gulDebugChannels; + +#define GDI_STACK_LEVELS 20 +extern ULONG_PTR GDIHandleAllocator[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +extern ULONG_PTR GDIHandleLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +extern ULONG_PTR GDIHandleShareLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +extern ULONG_PTR GDIHandleDeleter[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; enum _DEBUGCHANNELS { @@ -10,6 +16,10 @@ DbgXlate = 8, DbgModeSwitch = 16, }; + +void IntDumpHandleTable(PGDI_HANDLE_TABLE HandleTable); +ULONG CaptureStackBackTace(PVOID* pFrames, ULONG nFramesToCapture); +BOOL GdiDbgHTIntegrityCheck(); #define DBGENABLE(ch) gulDebugChannels |= (ch); #define DBGDISABLE(ch) gulDebugChannels &= ~(ch); @@ -73,3 +83,31 @@ #endif /* GDI_DEBUG */ +#if DBG +void +NTAPI +DbgPreServiceHook(ULONG ulSyscallId, PULONG_PTR pulArguments); + +ULONG_PTR +NTAPI +DbgPostServiceHook(ULONG ulSyscallId, ULONG_PTR ulResult); + +#define ID_Win32PreServiceHook 'WSH0' +#define ID_Win32PostServiceHook 'WSH1' + +FORCEINLINE void +DbgAssertNoGdiLocks(char * pszFile, ULONG nLine) +{ + PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); + if (pti && pti->cExclusiveLocks != 0) + { + DbgPrint("(%s:%ld) There are %ld exclusive locks!\n", + pszFile, nLine, pti->cExclusiveLocks); + ASSERT(FALSE); + } +} +#define ASSERT_NOGDILOCKS() DbgAssertNoGdiLocks(__FILE__,__LINE__) +#else +#define ASSERT_NOGDILOCKS() +#endif + Modified: trunk/reactos/subsystems/win32/win32k/include/win32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] Sat Feb 19 21:56:43 2011 @@ -99,10 +99,13 @@ LIST_ENTRY aphkStart[NB_HOOKS]; CLIENTTHREADINFO cti; // Used only when no Desktop or pcti NULL. - /* ReactOS */ - LIST_ENTRY WindowListHead; - LIST_ENTRY W32CallbackListHead; - SINGLE_LIST_ENTRY ReferencesList; + + /* ReactOS */ + LIST_ENTRY WindowListHead; + LIST_ENTRY W32CallbackListHead; + SINGLE_LIST_ENTRY ReferencesList; + ULONG cExclusiveLocks; + } THREADINFO; #include <poppack.h> Modified: trunk/reactos/subsystems/win32/win32k/objects/gdidbg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/gdidbg.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/gdidbg.c [iso-8859-1] Sat Feb 19 21:56:43 2011 @@ -17,11 +17,10 @@ #ifdef GDI_DEBUG -#define GDI_STACK_LEVELS 20 -static ULONG_PTR GDIHandleAllocator[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -static ULONG_PTR GDIHandleLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -static ULONG_PTR GDIHandleShareLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; -static ULONG_PTR GDIHandleDeleter[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +ULONG_PTR GDIHandleAllocator[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +ULONG_PTR GDIHandleLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +ULONG_PTR GDIHandleShareLocker[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; +ULONG_PTR GDIHandleDeleter[GDI_HANDLE_COUNT][GDI_STACK_LEVELS+1]; struct DbgOpenGDIHandle { ULONG idx; @@ -172,44 +171,42 @@ /* FIXME: check reserved entries */ /* Now go through the deleted objects */ - i = GdiHandleTable->FirstFree; - if (i) + i = GdiHandleTable->FirstFree & 0xffff; + while (i) { pEntry = &GdiHandleTable->Entries[i]; - for (;;) - { - nDeleted++; - - /* Check the entry */ - if ((pEntry->Type & GDI_ENTRY_BASETYPE_MASK) != 0) - { - r = 0; - DPRINT1("Deleted Entry has a type != 0\n"); - } - if ((ULONG_PTR)pEntry->KernelData >= GDI_HANDLE_COUNT) - { - r = 0; - DPRINT1("Deleted entries KernelPointer too big\n"); - } - if (pEntry->UserData != NULL) - { - r = 0; - DPRINT1("Deleted entry has UserData != 0\n"); - } - if (pEntry->ProcessId != 0) - { - r = 0; - DPRINT1("Deleted entry has ProcessId != 0\n"); - } - - i = (ULONG_PTR)pEntry->KernelData; - if (!i) - { - break; - } - pEntry = &GdiHandleTable->Entries[i]; - } - } + if (i > GDI_HANDLE_COUNT) + { + DPRINT1("nDeleted=%ld\n", nDeleted); + ASSERT(FALSE); + } + + nDeleted++; + + /* Check the entry */ + if ((pEntry->Type & GDI_ENTRY_BASETYPE_MASK) != 0) + { + r = 0; + DPRINT1("Deleted Entry has a type != 0\n"); + } + if ((ULONG_PTR)pEntry->KernelData >= GDI_HANDLE_COUNT) + { + r = 0; + DPRINT1("Deleted entries KernelPointer too big\n"); + } + if (pEntry->UserData != NULL) + { + r = 0; + DPRINT1("Deleted entry has UserData != 0\n"); + } + if (pEntry->ProcessId != 0) + { + r = 0; + DPRINT1("Deleted entry has ProcessId != 0\n"); + } + + i = (ULONG_PTR)pEntry->KernelData & 0xffff; + }; for (i = GdiHandleTable->FirstUnused; i < GDI_HANDLE_COUNT; @@ -295,3 +292,31 @@ #endif /* GDI_DEBUG */ +void +NTAPI +DbgPreServiceHook(ULONG ulSyscallId, PULONG_PTR pulArguments) +{ + PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); + if (pti && pti->cExclusiveLocks != 0) + { + DbgPrint("FATAL: Win32DbgPreServiceHook(%ld): There are %ld exclusive locks!\n", + ulSyscallId, pti->cExclusiveLocks); + ASSERT(FALSE); + } + +} + +ULONG_PTR +NTAPI +DbgPostServiceHook(ULONG ulSyscallId, ULONG_PTR ulResult) +{ + PTHREADINFO pti = (PTHREADINFO)PsGetCurrentThreadWin32Thread(); + if (pti && pti->cExclusiveLocks != 0) + { + DbgPrint("FATAL: Win32DbgPostServiceHook(%ld): There are %ld exclusive locks!\n", + ulSyscallId, pti->cExclusiveLocks); + ASSERT(FALSE); + } + return ulResult; +} +
13 years, 10 months
1
0
0
0
[tkreuzer] 50823: [NTOSKRNL] Add support for debug pre/post syscall hooks, that can be registered from win32k. They only exist on DBG versions.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat Feb 19 21:50:11 2011 New Revision: 50823 URL:
http://svn.reactos.org/svn/reactos?rev=50823&view=rev
Log: [NTOSKRNL] Add support for debug pre/post syscall hooks, that can be registered from win32k. They only exist on DBG versions. Modified: trunk/reactos/ntoskrnl/include/internal/kd.h trunk/reactos/ntoskrnl/kd/kdmain.c trunk/reactos/ntoskrnl/ke/i386/traphdlr.c Modified: trunk/reactos/ntoskrnl/include/internal/kd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/kd.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/kd.h [iso-8859-1] Sat Feb 19 21:50:11 2011 @@ -363,3 +363,12 @@ extern ULONG Kd_WIN2000_Mask; #endif + +#if DBG +#define ID_Win32PreServiceHook 'WSH0' +#define ID_Win32PostServiceHook 'WSH1' +typedef void (NTAPI *PKDBG_PRESERVICEHOOK)(ULONG, PULONG_PTR); +typedef ULONG_PTR (NTAPI *PKDBG_POSTSERVICEHOOK)(ULONG, ULONG_PTR); +extern PKDBG_PRESERVICEHOOK KeWin32PreServiceHook; +extern PKDBG_POSTSERVICEHOOK KeWin32PostServiceHook; +#endif Modified: trunk/reactos/ntoskrnl/kd/kdmain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd/kdmain.c?rev=5…
============================================================================== --- trunk/reactos/ntoskrnl/kd/kdmain.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kd/kdmain.c [iso-8859-1] Sat Feb 19 21:50:11 2011 @@ -71,13 +71,30 @@ case EnterDebugger: DbgBreakPoint(); break; - + case KdSpare3: MmDumpArmPfnDatabase(FALSE); break; default: break; + } + break; + } + + /* Register a debug callback */ + case 'CsoR': + { + switch (Buffer1Length) + { + case ID_Win32PreServiceHook: + KeWin32PreServiceHook = Buffer1; + break; + + case ID_Win32PostServiceHook: + KeWin32PostServiceHook = Buffer1; + break; + } break; } Modified: trunk/reactos/ntoskrnl/ke/i386/traphdlr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/traphdlr.…
============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/i386/traphdlr.c [iso-8859-1] Sat Feb 19 21:50:11 2011 @@ -46,6 +46,10 @@ }; PFAST_SYSTEM_CALL_EXIT KiFastCallExitHandler; +#if DBG +PKDBG_PRESERVICEHOOK KeWin32PreServiceHook = NULL; +PKDBG_POSTSERVICEHOOK KeWin32PostServiceHook = NULL; +#endif /* TRAP EXIT CODE *************************************************************/ @@ -1443,6 +1447,28 @@ KiDebugHandler(TrapFrame, TrapFrame->Eax, TrapFrame->Ecx, TrapFrame->Edx); } + +FORCEINLINE +VOID +KiDbgPreServiceHook(ULONG SystemCallNumber, PULONG_PTR Arguments) +{ +#if DBG + if (SystemCallNumber >= 0x1000 && KeWin32PreServiceHook) + KeWin32PreServiceHook(SystemCallNumber, Arguments); +#endif +} + +FORCEINLINE +ULONG_PTR +KiDbgPostServiceHook(ULONG SystemCallNumber, ULONG_PTR Result) +{ +#if DBG + if (SystemCallNumber >= 0x1000 && KeWin32PostServiceHook) + return KeWin32PostServiceHook(SystemCallNumber, Result); +#endif + return Result; +} + DECLSPEC_NORETURN VOID FORCEINLINE @@ -1553,10 +1579,16 @@ while (TRUE); } + /* Call pre-service debug hook */ + KiDbgPreServiceHook(SystemCallNumber, Arguments); + /* Get the handler and make the system call */ Handler = (PVOID)DescriptorTable->Base[Id]; Result = KiSystemCallTrampoline(Handler, Arguments, StackBytes); + /* Call post-service debug hook */ + Result = KiDbgPostServiceHook(SystemCallNumber, Result); + /* Make sure we're exiting correctly */ KiExitSystemCallDebugChecks(Id, TrapFrame);
13 years, 10 months
1
0
0
0
[akhaldi] 50822: [EVENTVWR] - Fix handling of NULL lpComputerName. - Handle lpData conversion to a wide string and make sure it's NULL terminated. - Patch by Rafal Harabien, <rafalh1992 AT o2 DOT p...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sat Feb 19 21:24:47 2011 New Revision: 50822 URL:
http://svn.reactos.org/svn/reactos?rev=50822&view=rev
Log: [EVENTVWR] - Fix handling of NULL lpComputerName. - Handle lpData conversion to a wide string and make sure it's NULL terminated. - Patch by Rafal Harabien, <rafalh1992 AT o2 DOT pl> See issue #5926 for more details. Modified: trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c Modified: trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/mscutils…
============================================================================== --- trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/mscutils/eventvwr/eventvwr.c [iso-8859-1] Sat Feb 19 21:24:47 2011 @@ -503,11 +503,12 @@ HWND hwndDlg; HANDLE hEventLog; EVENTLOGRECORD *pevlr; - DWORD dwRead, dwNeeded, dwThisRecord, dwTotalRecords = 0, dwCurrentRecord = 1, dwRecordsToRead = 0, dwFlags; + DWORD dwRead, dwNeeded, dwThisRecord, dwTotalRecords = 0, dwCurrentRecord = 1, dwRecordsToRead = 0, dwFlags, dwMaxLength; LPWSTR lpSourceName; LPWSTR lpComputerName; - LPWSTR lpData; + LPSTR lpData; BOOL bResult = TRUE; /* Read succeeded. */ + int i; WCHAR szWindowTitle[MAX_PATH]; WCHAR szStatusText[MAX_PATH]; @@ -519,6 +520,7 @@ WCHAR szUsername[MAX_PATH]; WCHAR szEventText[EVENT_MESSAGE_FILE_BUFFER]; WCHAR szCategory[MAX_PATH]; + WCHAR szData[MAX_PATH]; SYSTEMTIME time; LVITEMW lviEventItem; @@ -606,7 +608,7 @@ lpComputerName = (LPWSTR)((LPBYTE)pevlr + sizeof(EVENTLOGRECORD) + (wcslen(lpSourceName) + 1) * sizeof(WCHAR)); // This ist the data section of the current event - lpData = (LPWSTR)((LPBYTE)pevlr + pevlr->DataOffset); + lpData = (LPSTR)((LPBYTE)pevlr + pevlr->DataOffset); // Compute the event type EventTimeToSystemTime(pevlr->TimeWritten, &time); @@ -665,7 +667,13 @@ ListView_SetItemText(hwndListView, lviEventItem.iItem, 5, szEventID); ListView_SetItemText(hwndListView, lviEventItem.iItem, 6, szUsername); //User ListView_SetItemText(hwndListView, lviEventItem.iItem, 7, lpComputerName); //Computer - ListView_SetItemText(hwndListView, lviEventItem.iItem, 8, lpData); //Event Text + MultiByteToWideChar(CP_ACP, + 0, + lpData, + pevlr->DataLength, + szData, + MAX_PATH); + ListView_SetItemText(hwndListView, lviEventItem.iItem, 8, szData); //Event Text dwRead -= pevlr->Length; pevlr = (EVENTLOGRECORD *)((LPBYTE) pevlr + pevlr->Length); @@ -678,7 +686,15 @@ // All events loaded EndDialog(hwndDlg, 0); - swprintf(szWindowTitle, L"%s - %s Log on \\\\%s", szTitle, lpLogName, lpComputerName); + + i = swprintf(szWindowTitle, L"%s - %s Log on \\\\", szTitle, lpLogName); /* i = number of characters written */ + /* lpComputerName can be NULL here if no records was read */ + dwMaxLength = sizeof(szWindowTitle)/sizeof(WCHAR)-i; + if(!lpComputerName) + GetComputerNameW(szWindowTitle+i, &dwMaxLength); + else + _snwprintf(szWindowTitle+i, dwMaxLength, L"%s", lpComputerName); + swprintf(szStatusText, L"%s has %d event(s)", lpLogName, dwTotalRecords); // Update the status bar
13 years, 10 months
1
0
0
0
[spetreolle] 50821: [NTOSKRNL] Fix typo.
by spetreolle@svn.reactos.org
Author: spetreolle Date: Sat Feb 19 18:43:54 2011 New Revision: 50821 URL:
http://svn.reactos.org/svn/reactos?rev=50821&view=rev
Log: [NTOSKRNL] Fix typo. Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.c [iso-8859-1] Sat Feb 19 18:43:54 2011 @@ -755,7 +755,7 @@ &DescriptorTranslated->u.Port.Start)) { Status = STATUS_UNSUCCESSFUL; - DPRINT1("Failed to translate port resource (Start: 0xI64x)\n", DescriptorRaw->u.Port.Start.QuadPart); + DPRINT1("Failed to translate port resource (Start: 0x%I64x)\n", DescriptorRaw->u.Port.Start.QuadPart); goto cleanup; } break;
13 years, 10 months
1
0
0
0
[ekohl] 50820: [SETUPAPI] - Implement CM_Get_Device_Interface_AliasA, CM_Get_Device_Interface_AliasW and CM_Get_Device_Interface_Alias_ExW. - Add a stub for CM_Get_Device_Interface_Alias_ExA. - Imp...
by ekohl@svn.reactos.org
Author: ekohl Date: Sat Feb 19 18:28:13 2011 New Revision: 50820 URL:
http://svn.reactos.org/svn/reactos?rev=50820&view=rev
Log: [SETUPAPI] - Implement CM_Get_Device_Interface_AliasA, CM_Get_Device_Interface_AliasW and CM_Get_Device_Interface_Alias_ExW. - Add a stub for CM_Get_Device_Interface_Alias_ExA. - Implement the obsolete functions CM_Query_Remove_SubTree[_Ex] and CM_Remove_SubTree[_Ex]. Modified: trunk/reactos/dll/win32/setupapi/cfgmgr.c trunk/reactos/dll/win32/setupapi/setupapi.spec Modified: trunk/reactos/dll/win32/setupapi/cfgmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/cfgmgr.…
============================================================================== --- trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] Sat Feb 19 18:28:13 2011 @@ -2285,6 +2285,109 @@ /*********************************************************************** + * CM_Get_Device_Interface_AliasA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Device_Interface_AliasA( + LPCSTR pszDeviceInterface, LPGUID AliasInterfaceGuid, + LPSTR pszAliasDeviceInterface, PULONG pulLength, ULONG ulFlags) +{ + TRACE("%p %p %p %p %lu\n", pszDeviceInterface, AliasInterfaceGuid, + pszAliasDeviceInterface, pulLength, ulFlags); + + return CM_Get_Device_Interface_Alias_ExA(pszDeviceInterface, + AliasInterfaceGuid, pszAliasDeviceInterface, pulLength, + ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Device_Interface_AliasW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Device_Interface_AliasW( + LPCWSTR pszDeviceInterface, LPGUID AliasInterfaceGuid, + LPWSTR pszAliasDeviceInterface, PULONG pulLength, ULONG ulFlags) +{ + TRACE("%p %p %p %p %lu\n", pszDeviceInterface, AliasInterfaceGuid, + pszAliasDeviceInterface, pulLength, ulFlags); + + return CM_Get_Device_Interface_Alias_ExW(pszDeviceInterface, + AliasInterfaceGuid, pszAliasDeviceInterface, pulLength, + ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Get_Device_Interface_Alias_ExA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Device_Interface_Alias_ExA( + LPCSTR pszDeviceInterface, LPGUID AliasInterfaceGuid, LPSTR pszAliasDeviceInterface, + PULONG pulLength, ULONG ulFlags, HMACHINE hMachine) +{ + FIXME("%p %p %p %p %lu %lx\n", pszDeviceInterface, AliasInterfaceGuid, + pszAliasDeviceInterface, pulLength, ulFlags, hMachine); + + return CR_CALL_NOT_IMPLEMENTED; +} + + +/*********************************************************************** + * CM_Get_Device_Interface_Alias_ExW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Get_Device_Interface_Alias_ExW( + LPCWSTR pszDeviceInterface, LPGUID AliasInterfaceGuid, LPWSTR pszAliasDeviceInterface, + PULONG pulLength, ULONG ulFlags, HMACHINE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + ULONG ulTransferLength; + CONFIGRET ret = CR_SUCCESS; + + TRACE("%p %p %p %p %lu %lx\n", pszDeviceInterface, AliasInterfaceGuid, + pszAliasDeviceInterface, pulLength, ulFlags, hMachine); + + if (pszDeviceInterface == NULL || + AliasInterfaceGuid == NULL || + pszAliasDeviceInterface == NULL || + pulLength == NULL) + return CR_INVALID_POINTER; + + if (ulFlags != 0) + return CR_INVALID_FLAG; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, NULL)) + return CR_FAILURE; + } + + ulTransferLength = *pulLength; + + RpcTryExcept + { + ret = PNP_GetInterfaceDeviceAlias(BindingHandle, + (LPWSTR)pszDeviceInterface, + AliasInterfaceGuid, + pszAliasDeviceInterface, + pulLength, + &ulTransferLength, + 0); + } + RpcExcept(EXCEPTION_EXECUTE_HANDLER) + { + ret = RpcStatusToCmStatus(RpcExceptionCode()); + } + RpcEndExcept; + + return ret; +} + + +/*********************************************************************** * CM_Get_First_Log_Conf [SETUPAPI.@] */ CONFIGRET WINAPI CM_Get_First_Log_Conf( @@ -3535,6 +3638,32 @@ /*********************************************************************** + * CM_Query_Remove_SubTree [SETUPAPI.@] + * + * This function is obsolete in Windows XP and above. + */ +CONFIGRET WINAPI CM_Query_Remove_SubTree( + DEVINST dnAncestor, ULONG ulFlags) +{ + TRACE("%lx %lx\n", dnAncestor, ulFlags); + return CR_CALL_NOT_IMPLEMENTED; +} + + +/*********************************************************************** + * CM_Query_Remove_SubTree_Ex [SETUPAPI.@] + * + * This function is obsolete in Windows XP and above. + */ +CONFIGRET WINAPI CM_Query_Remove_SubTree_Ex( + DEVINST dnAncestor, ULONG ulFlags, HMACHINE hMachine) +{ + TRACE("%lx %lx %lx\n", dnAncestor, ulFlags, hMachine); + return CR_CALL_NOT_IMPLEMENTED; +} + + +/*********************************************************************** * CM_Reenumerate_DevNode [SETUPAPI.@] */ CONFIGRET WINAPI CM_Reenumerate_DevNode( @@ -3600,6 +3729,32 @@ RpcEndExcept; return ret; +} + + +/*********************************************************************** + * CM_Remove_SubTree [SETUPAPI.@] + * + * This function is obsolete in Windows XP and above. + */ +CONFIGRET WINAPI CM_Remove_SubTree( + DEVINST dnAncestor, ULONG ulFlags) +{ + TRACE("%lx %lx\n", dnAncestor, ulFlags); + return CR_CALL_NOT_IMPLEMENTED; +} + + +/*********************************************************************** + * CM_Remove_SubTree_Ex [SETUPAPI.@] + * + * This function is obsolete in Windows XP and above. + */ +CONFIGRET WINAPI CM_Remove_SubTree_Ex( + DEVINST dnAncestor, ULONG ulFlags, HMACHINE hMachine) +{ + TRACE("%lx %lx %lx\n", dnAncestor, ulFlags, hMachine); + return CR_CALL_NOT_IMPLEMENTED; } Modified: trunk/reactos/dll/win32/setupapi/setupapi.spec URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/setupap…
============================================================================== --- trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] (original) +++ trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] Sat Feb 19 18:28:13 2011 @@ -90,10 +90,10 @@ @ stdcall CM_Get_Device_ID_List_Size_ExW(ptr wstr long long) @ stdcall CM_Get_Device_ID_Size(ptr long long) @ stdcall CM_Get_Device_ID_Size_Ex(ptr long long long) -@ stub CM_Get_Device_Interface_AliasA -@ stub CM_Get_Device_Interface_AliasW -@ stub CM_Get_Device_Interface_Alias_ExA -@ stub CM_Get_Device_Interface_Alias_ExW +@ stdcall CM_Get_Device_Interface_AliasA(str ptr str ptr long) +@ stdcall CM_Get_Device_Interface_AliasW(wstr ptr wstr ptr long) +@ stdcall CM_Get_Device_Interface_Alias_ExA(str ptr str ptr long long) +@ stdcall CM_Get_Device_Interface_Alias_ExW(wstr ptr wstr ptr long long) @ stub CM_Get_Device_Interface_ListA @ stub CM_Get_Device_Interface_ListW @ stub CM_Get_Device_Interface_List_ExA @@ -163,8 +163,8 @@ @ stub CM_Query_Arbitrator_Free_Data_Ex @ stub CM_Query_Arbitrator_Free_Size @ stub CM_Query_Arbitrator_Free_Size_Ex -@ stub CM_Query_Remove_SubTree -@ stub CM_Query_Remove_SubTree_Ex +@ stdcall CM_Query_Remove_SubTree(long long) +@ stdcall CM_Query_Remove_SubTree_Ex(long long long) @ stub CM_Query_Resource_Conflict_List @ stdcall CM_Reenumerate_DevNode(long long) @ stdcall CM_Reenumerate_DevNode_Ex(long long long) @@ -174,8 +174,8 @@ @ stub CM_Register_Device_InterfaceW @ stub CM_Register_Device_Interface_ExA @ stub CM_Register_Device_Interface_ExW -@ stub CM_Remove_SubTree -@ stub CM_Remove_SubTree_Ex +@ stdcall CM_Remove_SubTree(long long) +@ stdcall CM_Remove_SubTree_Ex(long long long) @ stub CM_Request_Device_EjectA @ stub CM_Request_Device_EjectW @ stub CM_Request_Device_Eject_ExA
13 years, 10 months
1
0
0
0
[janderwald] 50819: - Revert 49767 on Pierre's request, which reverted this: - Added real implementation of SetLastError() (instead of forwarding to NTDLL) - Implemented BaseSetLastNTError() - Rena...
by janderwald@svn.reactos.org
Author: janderwald Date: Sat Feb 19 17:00:08 2011 New Revision: 50819 URL:
http://svn.reactos.org/svn/reactos?rev=50819&view=rev
Log: - Revert 49767 on Pierre's request, which reverted this: - Added real implementation of SetLastError() (instead of forwarding to NTDLL) - Implemented BaseSetLastNTError() - Renamed Basep8BitStringToCachedUnicodeString() to Basep8BitStringToStaticUnicodeString() and sightly changed its implementation - Fixed implementation of LoadLibraryExA() & DisableThreadLibraryCalls() using those changes This is matching w2k3 implementation. This is of course a WIP. Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h trunk/reactos/dll/win32/kernel32/kernel32.def trunk/reactos/dll/win32/kernel32/misc/env.c trunk/reactos/dll/win32/kernel32/misc/error.c trunk/reactos/dll/win32/kernel32/misc/ldr.c trunk/reactos/dll/win32/kernel32/misc/utils.c trunk/reactos/dll/win32/kernel32/process/procsup.c Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include…
============================================================================== --- trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] Sat Feb 19 17:00:08 2011 @@ -69,7 +69,6 @@ #define SetLastErrorByStatus(x) RtlSetLastWin32ErrorAndNtStatusFromNtStatus((x)) #define GetLastError() NtCurrentTeb()->LastErrorValue -#define SetLastError(x) NtCurrentTeb()->LastErrorValue = (x) typedef struct _CODEPAGE_ENTRY { @@ -192,7 +191,7 @@ PUNICODE_STRING WINAPI -Basep8BitStringToCachedUnicodeString(IN LPCSTR String); +Basep8BitStringToStaticUnicodeString(IN LPCSTR AnsiString); NTSTATUS WINAPI @@ -225,3 +224,7 @@ VOID WINAPI InitCommandLines(VOID); + +VOID +WINAPI +BaseSetLastNTError(IN NTSTATUS Status); Modified: trunk/reactos/dll/win32/kernel32/kernel32.def URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
============================================================================== --- trunk/reactos/dll/win32/kernel32/kernel32.def [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/kernel32.def [iso-8859-1] Sat Feb 19 17:00:08 2011 @@ -46,7 +46,7 @@ @ stdcall BaseProcessInitPostImport() ; missing in Win 7 @ stdcall BaseQueryModuleData(str str ptr ptr ptr) ;check ;@ stdcall BaseThreadInitThunk ; Win 7 -;@ stdcall BaseSetLastNTError ; Win 7, not 64 bit +;@ stdcall BaseSetLastNTError ; Win 7, not 64 bit (present on w2k3 but not exported) @ stdcall BaseUpdateAppcompatCache(long long long) ;@ stdcall BaseVerifyUnicodeString ; Win 7 ;@ stdcall Basep8BitStringToDynamicUnicodeString ; Win 7 @@ -1211,7 +1211,7 @@ @ stdcall SetHandleInformation(long long long) @ stdcall SetInformationJobObject(long long ptr long) @ stub SetLastConsoleEventActive ; missing in XP SP3 -@ stdcall SetLastError(long) ntdll.RtlSetLastWin32Error +@ stdcall SetLastError(long) @ stub SetLocalPrimaryComputerNameA ; missing in XP SP3 @ stub SetLocalPrimaryComputerNameW ; missing in XP SP3 @ stdcall SetLocalTime(ptr) Modified: trunk/reactos/dll/win32/kernel32/misc/env.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/en…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/env.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/env.c [iso-8859-1] Sat Feb 19 17:00:08 2011 @@ -5,6 +5,8 @@ * FILE: lib/kernel32/misc/env.c * PURPOSE: Environment functions * PROGRAMMER: Ariadne ( ariadne(a)xs4all.nl) + * Emanuele Aliberti + * Thomas Weidenmueller * UPDATE HISTORY: * Created 01/11/98 */ @@ -16,6 +18,85 @@ /* FUNCTIONS ******************************************************************/ + +/* + * @implemented + */ +BOOL +WINAPI +Beep (DWORD dwFreq, DWORD dwDuration) +{ + HANDLE hBeep; + UNICODE_STRING BeepDevice; + OBJECT_ATTRIBUTES ObjectAttributes; + IO_STATUS_BLOCK IoStatusBlock; + BEEP_SET_PARAMETERS BeepSetParameters; + NTSTATUS Status; + + /* check the parameters */ + if ((dwFreq >= 0x25 && dwFreq <= 0x7FFF) || + (dwFreq == 0x0 && dwDuration == 0x0)) + { + /* open the device */ + RtlInitUnicodeString(&BeepDevice, + L"\\Device\\Beep"); + + InitializeObjectAttributes(&ObjectAttributes, + &BeepDevice, + 0, + NULL, + NULL); + + Status = NtCreateFile(&hBeep, + FILE_READ_DATA | FILE_WRITE_DATA, + &ObjectAttributes, + &IoStatusBlock, + NULL, + 0, + FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_OPEN_IF, + 0, + NULL, + 0); + if (NT_SUCCESS(Status)) + { + /* Set beep data */ + BeepSetParameters.Frequency = dwFreq; + BeepSetParameters.Duration = dwDuration; + + Status = NtDeviceIoControlFile(hBeep, + NULL, + NULL, + NULL, + &IoStatusBlock, + IOCTL_BEEP_SET, + &BeepSetParameters, + sizeof(BEEP_SET_PARAMETERS), + NULL, + 0); + + /* do an alertable wait if necessary */ + if (NT_SUCCESS(Status) && + (dwFreq != 0x0 || dwDuration != 0x0) && dwDuration != MAXDWORD) + { + SleepEx(dwDuration, + TRUE); + } + + NtClose(hBeep); + } + } + else + Status = STATUS_INVALID_PARAMETER; + + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus (Status); + return FALSE; + } + + return TRUE; +} /* * @implemented Modified: trunk/reactos/dll/win32/kernel32/misc/error.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/er…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/error.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/error.c [iso-8859-1] Sat Feb 19 17:00:08 2011 @@ -1,15 +1,10 @@ -/* $Id$ - * +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries * FILE: dll/win32/kernel32/misc/error.c - * PURPOSE: Environment functions - * PROGRAMMER: Emanuele Aliberti - * Thomas Weidenmueller - * UPDATE HISTORY: - * Created 05/10/98 + * PURPOSE: Error functions + * PROGRAMMER: Pierre Schweitzer (pierre.schweitzer(a)reactos.org) */ - #include <k32.h> @@ -17,83 +12,34 @@ #include <debug.h> -/* - * @implemented - */ -BOOL +DWORD g_dwLastErrorToBreakOn; + +/* FUNCTIONS ******************************************************************/ + +VOID WINAPI -Beep (DWORD dwFreq, DWORD dwDuration) +SetLastError( + IN DWORD dwErrCode) { - HANDLE hBeep; - UNICODE_STRING BeepDevice; - OBJECT_ATTRIBUTES ObjectAttributes; - IO_STATUS_BLOCK IoStatusBlock; - BEEP_SET_PARAMETERS BeepSetParameters; - NTSTATUS Status; - - /* check the parameters */ - if ((dwFreq >= 0x25 && dwFreq <= 0x7FFF) || - (dwFreq == 0x0 && dwDuration == 0x0)) + if (g_dwLastErrorToBreakOn) { - /* open the device */ - RtlInitUnicodeString(&BeepDevice, - L"\\Device\\Beep"); - - InitializeObjectAttributes(&ObjectAttributes, - &BeepDevice, - 0, - NULL, - NULL); - - Status = NtCreateFile(&hBeep, - FILE_READ_DATA | FILE_WRITE_DATA, - &ObjectAttributes, - &IoStatusBlock, - NULL, - 0, - FILE_SHARE_READ | FILE_SHARE_WRITE, - FILE_OPEN_IF, - 0, - NULL, - 0); - if (NT_SUCCESS(Status)) + /* If we have error to break on and if current matches, break */ + if (g_dwLastErrorToBreakOn == dwErrCode) { - /* Set beep data */ - BeepSetParameters.Frequency = dwFreq; - BeepSetParameters.Duration = dwDuration; - - Status = NtDeviceIoControlFile(hBeep, - NULL, - NULL, - NULL, - &IoStatusBlock, - IOCTL_BEEP_SET, - &BeepSetParameters, - sizeof(BEEP_SET_PARAMETERS), - NULL, - 0); - - /* do an alertable wait if necessary */ - if (NT_SUCCESS(Status) && - (dwFreq != 0x0 || dwDuration != 0x0) && dwDuration != MAXDWORD) - { - SleepEx(dwDuration, - TRUE); - } - - NtClose(hBeep); + DbgBreakPoint(); } } - else - Status = STATUS_INVALID_PARAMETER; - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus (Status); - return FALSE; - } + /* Set last error */ + NtCurrentTeb()->LastErrorValue = dwErrCode; +} - return TRUE; +VOID +WINAPI +BaseSetLastNTError( + IN NTSTATUS Status) +{ + SetLastError(RtlNtStatusToDosError(Status)); } /* EOF */ Modified: trunk/reactos/dll/win32/kernel32/misc/ldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/ld…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/ldr.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/ldr.c [iso-8859-1] Sat Feb 19 17:00:08 2011 @@ -102,19 +102,18 @@ */ BOOL WINAPI -DisableThreadLibraryCalls ( - HMODULE hLibModule - ) -{ - NTSTATUS Status; - - Status = LdrDisableThreadCalloutsForDll ((PVOID)hLibModule); - if (!NT_SUCCESS (Status)) - { - SetLastErrorByStatus (Status); - return FALSE; - } - return TRUE; +DisableThreadLibraryCalls( + IN HMODULE hLibModule) +{ + NTSTATUS Status; + + Status = LdrDisableThreadCalloutsForDll((PVOID)hLibModule); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); + return FALSE; + } + return TRUE; } @@ -136,18 +135,17 @@ */ HINSTANCE WINAPI -LoadLibraryExA ( - LPCSTR lpLibFileName, - HANDLE hFile, - DWORD dwFlags - ) -{ - PWCHAR FileNameW; - - if (!(FileNameW = FilenameA2W(lpLibFileName, FALSE))) - return FALSE; - - return LoadLibraryExW(FileNameW, hFile, dwFlags); +LoadLibraryExA( + LPCSTR lpLibFileName, + HANDLE hFile, + DWORD dwFlags) +{ + PUNICODE_STRING FileNameW; + + if (!(FileNameW = Basep8BitStringToStaticUnicodeString(lpLibFileName))) + return NULL; + + return LoadLibraryExW(FileNameW->Buffer, hFile, dwFlags); } Modified: trunk/reactos/dll/win32/kernel32/misc/utils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/ut…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/utils.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/utils.c [iso-8859-1] Sat Feb 19 17:00:08 2011 @@ -57,28 +57,27 @@ */ PUNICODE_STRING WINAPI -Basep8BitStringToCachedUnicodeString(IN LPCSTR String) -{ - PUNICODE_STRING StaticString = &NtCurrentTeb()->StaticUnicodeString; +Basep8BitStringToStaticUnicodeString(IN LPCSTR String) +{ + PUNICODE_STRING StaticString = &(NtCurrentTeb()->StaticUnicodeString); ANSI_STRING AnsiString; NTSTATUS Status; - - DPRINT("Basep8BitStringToCachedUnicodeString\n"); - + /* Initialize an ANSI String */ - RtlInitAnsiString(&AnsiString, String); - + if (!NT_SUCCESS(RtlInitAnsiStringEx(&AnsiString, String))) + { + SetLastError(ERROR_FILENAME_EXCED_RANGE); + return NULL; + } + /* Convert it */ Status = Basep8BitStringToUnicodeString(StaticString, &AnsiString, FALSE); - - /* Handle failure */ - if (!NT_SUCCESS(Status)) - { - SetLastErrorByStatus(Status); + if (!NT_SUCCESS(Status)) + { + BaseSetLastNTError(Status); return NULL; } - - /* Return pointer to the string */ + return StaticString; } Modified: trunk/reactos/dll/win32/kernel32/process/procsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/process…
============================================================================== --- trunk/reactos/dll/win32/kernel32/process/procsup.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/process/procsup.c [iso-8859-1] Sat Feb 19 17:00:08 2011 @@ -1558,7 +1558,7 @@ NtCurrentTeb()->StaticUnicodeString.MaximumLength) { /* Cache it in the TEB */ - CommandLine = Basep8BitStringToCachedUnicodeString(lpCommandLine); + CommandLine = Basep8BitStringToStaticUnicodeString(lpCommandLine); } else {
13 years, 10 months
1
0
0
0
[gadamopoulos] 50818: [win32k] - Fix combobox to show the drop down window correctly when the parent window is topmost See issue #5705 for more details.
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Sat Feb 19 16:09:59 2011 New Revision: 50818 URL:
http://svn.reactos.org/svn/reactos?rev=50818&view=rev
Log: [win32k] - Fix combobox to show the drop down window correctly when the parent window is topmost See issue #5705 for more details. Modified: trunk/reactos/dll/win32/user32/controls/combo.c Modified: trunk/reactos/dll/win32/user32/controls/combo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/…
============================================================================== --- trunk/reactos/dll/win32/user32/controls/combo.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/controls/combo.c [iso-8859-1] Sat Feb 19 16:09:59 2011 @@ -1119,7 +1119,7 @@ if( (rect.bottom + nDroppedHeight) >= mon_info.rcWork.bottom ) rect.bottom = rect.top - nDroppedHeight; - SetWindowPos( lphc->hWndLBox, HWND_TOP, rect.left, rect.bottom, + SetWindowPos( lphc->hWndLBox, HWND_TOPMOST, rect.left, rect.bottom, lphc->droppedRect.right - lphc->droppedRect.left, nDroppedHeight, SWP_NOACTIVATE | SWP_SHOWWINDOW);
13 years, 10 months
1
0
0
0
[pschweitzer] 50817: [NTOSKRNL] - No need to use ULONG when dealing with strings, USHORT is enough. This makes MSVC warnings silent. - Fix a really nasty bug in FsRtlIsHpfsDbcsLegal()
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sat Feb 19 13:58:55 2011 New Revision: 50817 URL:
http://svn.reactos.org/svn/reactos?rev=50817&view=rev
Log: [NTOSKRNL] - No need to use ULONG when dealing with strings, USHORT is enough. This makes MSVC warnings silent. - Fix a really nasty bug in FsRtlIsHpfsDbcsLegal() Modified: trunk/reactos/ntoskrnl/fsrtl/dbcsname.c trunk/reactos/ntoskrnl/fsrtl/name.c Modified: trunk/reactos/ntoskrnl/fsrtl/dbcsname.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/dbcsname.c?…
============================================================================== --- trunk/reactos/ntoskrnl/fsrtl/dbcsname.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fsrtl/dbcsname.c [iso-8859-1] Sat Feb 19 13:58:55 2011 @@ -46,8 +46,8 @@ OUT PANSI_STRING FirstPart, OUT PANSI_STRING RemainingPart) { - ULONG FirstPosition, i; - ULONG SkipFirstSlash = 0; + USHORT FirstPosition, i; + USHORT SkipFirstSlash = 0; PAGED_CODE(); /* Zero the strings before continuing */ @@ -116,7 +116,7 @@ NTAPI FsRtlDoesDbcsContainWildCards(IN PANSI_STRING Name) { - ULONG i; + USHORT i; PAGED_CODE(); /* Check every character */ @@ -300,7 +300,7 @@ { ANSI_STRING FirstPart, RemainingPart, Name; BOOLEAN LastDot; - ULONG i; + USHORT i; PAGED_CODE(); /* Just quit if the string is empty */ @@ -437,7 +437,7 @@ IN BOOLEAN LeadingBackslashPermissible) { ANSI_STRING FirstPart, RemainingPart, Name; - ULONG i; + USHORT i; PAGED_CODE(); /* Just quit if the string is empty */ @@ -490,7 +490,7 @@ i++; } /* Then check for bad characters */ - else if (!!FsRtlIsAnsiCharacterLegalHpfs(FirstPart.Buffer[i], WildCardsPermissible)) + else if (!FsRtlIsAnsiCharacterLegalHpfs(FirstPart.Buffer[i], WildCardsPermissible)) { return FALSE; } Modified: trunk/reactos/ntoskrnl/fsrtl/name.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/name.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/fsrtl/name.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fsrtl/name.c [iso-8859-1] Sat Feb 19 13:58:55 2011 @@ -163,7 +163,7 @@ UNICODE_STRING UpcaseName1; UNICODE_STRING UpcaseName2; BOOLEAN StringsAreEqual, MemoryAllocated = FALSE; - ULONG i; + USHORT i; NTSTATUS Status; PAGED_CODE(); @@ -255,8 +255,8 @@ OUT PUNICODE_STRING FirstPart, OUT PUNICODE_STRING RemainingPart) { - ULONG FirstPosition, i; - ULONG SkipFirstSlash = 0; + USHORT FirstPosition, i; + USHORT SkipFirstSlash = 0; PAGED_CODE(); /* Zero the strings before continuing */
13 years, 10 months
1
0
0
0
← Newer
1
...
9
10
11
12
13
14
15
...
36
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
Results per page:
10
25
50
100
200