Fix a serious bug in PSEH that could lead to stack corruption and was causing CSRSS to crash, when large amounts of text were output on the console.
Background: PSEH used __builtin_alloca to allocate an SEH registration frame on the stack on demand, ie only for the first try level. But there are some nasty things with __builtin_alloca: First it DOES NOT - as one might think - free the allocated memory, once the allocation "goes out of scope", like with local variables, but only on function exit. Therefore it cannot normally be used inside a loop. The trick that PSEH used to "fix" this problem, was to save the stack pointer and reset it back at the end. This is quite problematic, since the rest of the code might assume that the stack pointer is still where it was left off after the allocation. The other thing is that __builtin_alloca() can allocate the memory whenever it likes to. It can allocate everything on function entry or not allocate anything at all, when other stack variables that went out of scope have left enough space to be reused. In csrss it now happened that the allocation was done before the stack pointer was saved, so the memory could not be freed by restoring the old stack pointer value. That lead to slowly eating up the stack since the code was inside a loop.
The allocation is now replaced with a variable sized array. The variable stays in scope until the _SEH2_END and will be automaticall cleaned up by the compiler. This also makes saving and restoring the stack pointer obsolete.
Reliability++
svn path=/trunk/; revision=56442
Remove PAGEOPs and use the argument to pass relevant information where needed,
including generally a section page table entry or a PFN_NUMBER.
In its place, the code looks for an MM_WAIT_ENTRY in the appropriate place and
waits, returning STATUS_MM_RESTART_OPERATION. Rather than copying the pagein
and CoW operations in the PAGEOP contention case, we just punt back and restart
the operation, resulting in simpler code.
svn path=/trunk/; revision=56441
When a DC has the default palette selected, use the color value from PALETTERGB() directly instead of looking it up in the dc palette (just as the code was before). Fixes skipped bitmap winetests
svn path=/trunk/; revision=56440
- In NtGdiSetPixel, return the real RGB value, which is the target format color translated back to RGB, not the desired RGB value. Fixes a few bitmap winetest.
- Handle a too large index in PALETTE_ulGetRGBColorFromIndex
svn path=/trunk/; revision=56439
- Do not null terminate buffer before initializing its length in RtlDosSearchPath_Ustr. Use unicode string functions made for this purpose instead.
See issue #7010 for more details.
svn path=/trunk/; revision=56438
- Add a small RtlException test, mainly to check that a stack overflow really throws STATUS_STACK_OVERFLOW, not STATUS_ACCESS_VIOLATION.
svn path=/trunk/; revision=56434
- add missing DBG_DECREASE_LOCK_COUNT() when deleting an object that was exclusively locked. Fixes strange hang in comctl32_winetest.
The question is: why does changing a variable, which is never checked cause such trouble?
- Don't pass the DC's clip object to IntEngCopyBits, when querying a pixel
- make acExclusiveLockCount[] 0x20 bytes long, just to be really sure, that (x & 0x1F) does never overflow it.
svn path=/trunk/; revision=56433
- Do not rely on undefined behavior to get values easily accessible as constants.
- Quick build fix. Will be sent to Wine, possibly modified.
svn path=/trunk/; revision=56432
- Implement TranslateCOLORREF, based on IntHandleSpecialColorType, but now returning both the translated color and the resulting RGB color, correctly handling DIBINDEX, which will use the given value without translation.
- Rewrite NtGdiSetPixel using IntPatBlt
- Rewrite NtGdiGetPixel using IntEngCopyBits
- Fix EXLATEOBJ_iXlateTable to return 0, when the palette index is too big, instead of wrapping around
- Remove old debugcode
svn path=/trunk/; revision=56429
Pass EBRUSHOBJ to IntPatBlt instead of the BRUSH. This way we can use the DC's eboFill, instead of initializing a new EBRUSHOBJ.
svn path=/trunk/; revision=56427
- Accept NULL Buffer/Size in RtlGetFullPathName_Ustr
- Fix NULL dereference in RtlGetFullPathName_UstrEx if no StaticString was given
- Various other corrections to path functions. 17 test failures fixed overall.
svn path=/trunk/; revision=56426
- Make XFORMOBJ_iSetXform fail, when the XFORM is invalid (eM11 or eM22 are 0)
- Handle error in GreModifyWorldTransform
svn path=/trunk/; revision=56422
- Add a test for RtlDoesFileExists_U (and its three friends, if addresses are provided)
- Various small path test improvements
svn path=/trunk/; revision=56416
- Add a test for RtlGetFullPathName_Ustr (requires the function address to be known)
- Various improvements to the other path tests
svn path=/trunk/; revision=56413
- Add test for RtlGetLongestNtPathLength
- Add test for RtlDetermineDosPathNameType_U (and RtlDetermineDosPathNameType_Ustr, if address is known)
svn path=/trunk/; revision=56411
- Add missing mmtypes.h include in mmfuncs.h
- Remove RtlDetermineDosPathNameType_Ustr from rtlfuncs.h, move it up in path.c
- Add RtlGetLongestNtPathLength to rtlfuncs.h
svn path=/trunk/; revision=56410
- Fix a bug in the region code that could cause allocating 0 bytes
- Remove SetLastError()
- "flatten" IntGdiCombineRgn making it more readable
svn path=/trunk/; revision=56409
- Add forgotten storage of the LUN in the PDO extension which not only broke units beyond LUN 0 but also caused a BSOD due to reporting duplicate devices to the PnP manager
- Thanks to tower for reporting
svn path=/trunk/; revision=56406
- Desktop: Added code for server side switch over and some notes. Did not include desktopbg.c.
- Focus: Fixes wine Win tests for SetParent, Active, Focus and Foreground. Leaving the wine todos. Msg tests improved. Pop up menus are still broken see bug 6751. The tests reflect these pop up menu issues.
- WinPos: (WIP) Fixed MapWindowPoints. Arrange icons is still broken. SetWindowPos sets the foreground when it should.
- Implemented AllowSetForegroundWindow and LockSetForegroundWindow.
- Commit to reset base lines for RegTest ComCtl32 and related bugs.
- Coding credits and complements go out to the Wine team.
svn path=/trunk/; revision=56396