Commit graph

47290 commits

Author SHA1 Message Date
Dmitry Gorbachev a96df8f6f2 [Win32k]
DbgLogEvent: replace EVENT_TYPE by LOG_EVENT_TYPE (spotted by GCC 4.6).

svn path=/trunk/; revision=52839
2011-07-24 16:17:55 +00:00
Dmitry Gorbachev b91502ff16 Save the project from possession by evil spirits.
svn path=/trunk/; revision=52838
2011-07-24 16:17:32 +00:00
Jérôme Gardou a28b6b7837 [KERNEL32]
- release PEB lock for each code path

svn path=/trunk/; revision=52837
2011-07-24 14:57:14 +00:00
Jérôme Gardou d5534dc11d [MSVCRTEX]
- I say let msvcrt handle atexit registered functions.
Fix msvc build

svn path=/trunk/; revision=52836
2011-07-24 14:37:28 +00:00
Jérôme Gardou c81afef878 [MSVCRT40]
- static link to crt, correct base address qnd entry point, etc...
See change log of MSVCRT20 for details.

svn path=/trunk/; revision=52835
2011-07-24 13:31:11 +00:00
Jérôme Gardou 7b87ca19ec [MSVCRT20]
- being a full blown crt dll, msvcrt20 needs a correct dllmain entry point

svn path=/trunk/; revision=52834
2011-07-24 13:22:15 +00:00
Dmitry Gorbachev 33b1f742e6 [ATL]
Invoke the member function through "this->".

svn path=/trunk/; revision=52833
2011-07-24 11:54:56 +00:00
Jérôme Gardou 8664f01839 woops, sorry :-)
svn path=/trunk/; revision=52832
2011-07-24 10:41:32 +00:00
Jérôme Gardou 5dbb7bc48b [LIBWINE]
- new tentative to fix build : get rid of libwine's stricmp, we have it in our crt

svn path=/trunk/; revision=52831
2011-07-24 10:29:52 +00:00
Jérôme Gardou d5b88d327b [MSVCRT20]
- hopefully fix rbuild's build

svn path=/trunk/; revision=52830
2011-07-24 10:05:42 +00:00
Jérôme Gardou c4513e2457 [MSVCRTEX]
- aply 52828 as well

svn path=/trunk/; revision=52829
2011-07-24 09:05:47 +00:00
Jérôme Gardou 07913a767e [MINGW_COMMON]
- get rid of atexit handling, it's arlready handled by msvcrt.
The funny thing is that the only module using this is msvcrt_winetest, which tested the mingw implementation, not the msvcrt one.

svn path=/trunk/; revision=52828
2011-07-24 08:39:50 +00:00
Jérôme Gardou 1ebafc47ea [MSVCRT]
- being a stub doesn't allow you to be uninitialized

svn path=/trunk/; revision=52827
2011-07-23 22:52:04 +00:00
Jérôme Gardou 4b7b205f04 [MSVCRT20]
- link to static crt instead of forwarding function to msvcrt.
As msvcrt, msvcrt20 exports some variable, marked as DATA in the def file. Forwarding them is not a good idea, since msvcrt would be initialized only if one of the forwarded function is called. We must keep those variables in our module. And as the forwarded functions might use the said variables, we can't really forward them, as they would not know which instance they should reference.

svn path=/trunk/; revision=52826
2011-07-23 22:47:04 +00:00
Amine Khaldi 841762ca39 [CMAKE]
- *Temporarily* back out some rossym/kdbg features until bugs 6372 and 6373 are fixed.
- Traces should be reliable again.
See issue #6372 for more details.

svn path=/trunk/; revision=52825
2011-07-23 22:35:06 +00:00
Alex Ionescu 22cf74c595 [KERNEL32]: Ironically enough, the "unimplemented" SetMessageWAitingIndicator function, which failed with sTATUS_NOT_IMPLEMENTED.... is how Windows implements this API! Mark it as so.
svn path=/trunk/; revision=52824
2011-07-23 22:03:03 +00:00
Jérôme Gardou da30785e98 [CRT]
- fix stupid gcc warnings
patch by Igor Paliychuk

svn path=/trunk/; revision=52823
2011-07-23 20:43:14 +00:00
Jérôme Gardou c1175bec2b [CMAKE]
- no need to link msvcrt with pseh on msvc builds

svn path=/trunk/; revision=52822
2011-07-23 20:23:48 +00:00
Jérôme Gardou f5998a3361 [MSVCRT]
- more fixes to spec file

svn path=/trunk/; revision=52821
2011-07-23 19:27:00 +00:00
Alex Ionescu 7d31226ff4 [KERNEL32]: Implement three new APIs: CreateSocketHandle, GetHandleContext, and SetHandleContext. Please let this be my GSoC project. It was very hard to implement these APIs. I have full 6-week plan on how these APIs were implemented and tested. Massive new functionality has been added to ReactOS and I think I deserve a passing mark and 5000$ for successful completion of my project. Thank you.
svn path=/trunk/; revision=52820
2011-07-23 19:02:39 +00:00
Alex Ionescu 9520dab132 [KERNEL32]: Get rid of SetLastErrorByStatus and use BaseSetLastNTError instead. SetLastErrorByStatus was defined to forward to some Rtl function which I don't even think exists in Server 2003, and worse, bypassed the SetLastError behavior of allowing a g_dwLastErrorToBreakOn code to be set.
svn path=/trunk/; revision=52819
2011-07-23 18:54:29 +00:00
Alex Ionescu 163760d73a [KERNEL32]: Simplify QueryPerformanceCounter/Frequency and bring in line with ReactOS coding standards.
svn path=/trunk/; revision=52818
2011-07-23 18:51:32 +00:00
Alex Ionescu ab6e9909fe [KERNEL32]: Simplify CreateMemoryResourceNotification and bring up to ReactOS coding standards.
[KERNEL32]: Bug: QueryMemoryResourceNotification should set ERROR_INVALID_PARAMETER and fail if the Handle is NULL or INVALID_HANDLE_VALUE.
[KERNEL32]: Fix ULONG<->BOOL cast in QueryMemoryResourceNotification as well.

svn path=/trunk/; revision=52817
2011-07-23 18:50:20 +00:00
Alex Ionescu 3f6d71af42 [KERNEL32]: Get rid of RestoreLastError, it's a forward.
[KERNEL32]: SetLastError should only set the error code if it's different from the one already set. This is not about optimization: it's compatibility with hardware data breakpoint behavior.

svn path=/trunk/; revision=52816
2011-07-23 18:48:32 +00:00
Jérôme Gardou a2ed7524c7 [MSVCRT]
- export bessel's functions
- misc fixes to spec file

svn path=/trunk/; revision=52815
2011-07-23 18:45:01 +00:00
Alex Ionescu 89fc754845 [KERNEL32]: Fix RemoveHandles, CloseAllProcessHandles...again.
svn path=/trunk/; revision=52814
2011-07-23 18:43:49 +00:00
Alex Ionescu 90e2e1bad0 [KERNEL32]: User-mode Debugging fixes.
Bug: RemoveHandles was checking for process AND thread handle match, instead of OR.
Bug: CloseAllProcessHandles and RemoveHandles's processing loop was buggy with its unlinking and re-use of nested ThreadData.
Bug: ProcessIdToHandle was requesting more process rights than needed.
Bug: Some ULONG<->BOOL conversions were dirty (as in, could result in values of 2 or higher).
Bug: In WaitForDebugEvent, During CREATE_PROCESS_DEBUG_EVENT, the wrong handle was saved as the thread handle.
Bug: In WaitForDebugEvent, all events returned TRUE. Instead, only valid events should return TRUE, and non-existing events should return FALSE.
Add some asserts.
Simplify MarkThreadHandle and MarkProcessHandle.
Simplify OutputDebugStringW.

svn path=/trunk/; revision=52813
2011-07-23 18:28:55 +00:00
Jérôme Gardou 3459e1cb1d [CRT]
- import bessel's function j0, j1, jn, y0, y1, yn from glibc

svn path=/trunk/; revision=52812
2011-07-23 18:03:11 +00:00
Alex Ionescu 8a945ffbf3 [KERNEL32]: SleepEx forgot to de-activate the SxS frame.
svn path=/trunk/; revision=52811
2011-07-23 17:17:06 +00:00
Timo Kreuzer 1476736018 {KERNEL32]
- move BaseFiberStartup to fiber.S
- add FPO debug info for MSVC builds
- remove excessive END directives (fixes msvc build)
- add a stub for amd64

svn path=/trunk/; revision=52810
2011-07-23 17:16:51 +00:00
Alex Ionescu 09a15b8b05 Thanks to Timo Kreuzer for discovering what led to these:
[KERNEL32]: BasepInitializeContext was not creating a correct CONTEXT record for fibers: the stack return address was not set (EIP was being used instead), and support for FPU-compatible Fibers was non-existent.
[KERNEL32]: CreateFiberEx was not passing the correct context flags to BasepInitializeContext to notify it that this is an FPU-fiber.
[KERNEL32]: SwitchToFiber was using some weird "FXSR" constant that maps to checking of PowerPC 64-bit Move instructions are available. We actually want to check for XMMI.

svn path=/trunk/; revision=52809
2011-07-23 16:26:03 +00:00
Amine Khaldi 5a85fe0145 [KERNEL32]
* Fix ConvertOpenWin32AnsiObjectApiToUnicodeApi and OpenNtObjectFromWin32Api macros always returning NULL. Spotted by Thomas Faber.

svn path=/trunk/; revision=52808
2011-07-23 14:07:17 +00:00
Alex Ionescu 7eda2f21b7 [KERNEL32]: Optimize SwitchToFiber to simply use "ret" to jump between fibers, instead of saving EIP and doing a JMP.
Bug #50: SwitchToFiber needs to check if FXSR is *NOT* present in order to skip using ldmxcsr/stmxcsr. Previously, it would check if it's unsupported, and jump past the instruction if it was (resulting in invalid opcode instructions on older systems)
50 bugs. Penance has been paid.

svn path=/trunk/; revision=52807
2011-07-23 12:08:36 +00:00
Alex Ionescu 8a06cf76c6 [KERNEL32]: Implement BaseFiberStartup in ASM, just like the thread/process thunks, so we get a "naked" thunk without any compiler-generated crap.
svn path=/trunk/; revision=52806
2011-07-23 12:05:38 +00:00
Alex Ionescu 84a32acb78 [KERNEL32]:
Bug #47: CreateFiberEx should return ERROR_INVALID_PARAMETER for invalid flags.
Bug #48: DeleteFiber should also check if HasFiberData is TRUE in TEB before calling ExitThread.
Bug #49: DeleteFiber should only delete the FIBER data structure after cleanup is complete, not before.
Also, enable the calls to RtlAllocateActivationContextStack since SxS kind-of exists now. However, we leak the context since RtlFreeActivationContextStack is not implemented.
Also, add a call to BaseRundownFls so we don't forget to cleanup FLS data once FLS is implemented.

svn path=/trunk/; revision=52805
2011-07-23 11:55:41 +00:00
Alex Ionescu 84022a4625 [KERNEL32]:
Bug #45: ConvertThreadToFiberEx should return ERROR_INVALID_PARAMETER if an invalid flag is passed.
Bug #46: ConvertThreadToFiberEx should return ERROR_ALREADY_FIBER if the thread is already a fiber, not return the current fiber data.

svn path=/trunk/; revision=52804
2011-07-23 11:48:42 +00:00
Alex Ionescu 01a08c5e47 [KERNEL32]
Bug #43: ConvertFiberToThread should return ERROR_ALREADY_THREAD, not ERROR_INVALID_PARAMETER in case of failure.
Bug #44: ConvertFiberToThread should set FiberData to NULL in the TEB, after doing the conversion.
Thanks, Winetests, for saying "0 failures", when this API was broken.

svn path=/trunk/; revision=52803
2011-07-23 11:46:57 +00:00
Alex Ionescu e6a3064cd7 [KERNEL32]: Bug #42: GetThreadPriority was only returning -2, -1, 0, 1, 2 or 15 and -15. For realtime threads, priorities of 3, 4, 5, 6, 7, and their negatives, are also valid. Also, GetThreadPriority was returning -15/15 for any priorty outside the -2/2 range, instead of just the special saturation values (I should count this as a separate bug, really...)
svn path=/trunk/; revision=52802
2011-07-23 11:43:57 +00:00
Alex Ionescu 0d4067e028 [KERNEL32]:
Bug #39: BaseThreadStartup needs to call CsrNewThread (which registers the termination port with CSRSS) for Win32 threads.
Bug #40: If a crash happens during thread execution, ExitProcess should be called instead of ExitThread (unless this is a CSR thread).
Bug #41: The ExitThread/Process APIs should be called still from within the context of the SEH frame, not outside of it.
Use BaseRunningInServerProcess global instead of local IsServer local when connecting to CSRSS. This is needed for things such as the above.

svn path=/trunk/; revision=52801
2011-07-23 11:38:58 +00:00
Alex Ionescu d66140d475 [KERNEL32]:
Bug #35: TlsSetValue should allocate the TlsExpansionSlots under the PEB Lock.
Bug #36: TlsGetValue needs to set the last error to ERROR_SUCCESS when the index is valid (amd even if no expansion slots exist!).
Bug #37: TlsFree did not check the return of NtSetInformationThread(ThreadZeroTlsCell).
Bug #38: TlsAlloc was setting error to ERROR_NO_MORE_ITEMS instead of STATUS_NO_MEMORY. In principle the former is more accurate, but that's not how API compatibility works.
Optimize TLS functions not to call NtQueryTeb/Peb all the time. Cache the TEB/PEB value instead.


svn path=/trunk/; revision=52800
2011-07-23 11:28:35 +00:00
Alex Ionescu 2179ae0c5e [KERNEL32]: Fix Bugs #30, #31, #32, #33: WaitForSingleObjectEx, WaitForMultipleObjectsEx, SignalObjectAndWait, SleepEx need to set the default activation context active so that APCs can execute under it in the case of alertable wait.
[KERNEL32]: Fix Bug #34: WaitForMultipleObjectsEx was leaking the wait block array in case of a wait failure.

svn path=/trunk/; revision=52799
2011-07-23 11:17:36 +00:00
Alex Ionescu 72e42d63b1 [KERNEL32]: Implement a BaseFormatTimeOut helper function to take care of dwMillisecond->LARGE_INTEGER timeout conversion instead of duplicating 3 different versions of the code required to do so.
svn path=/trunk/; revision=52798
2011-07-23 11:05:00 +00:00
Alex Ionescu 293d54ec7e [KERNEL32]: Fix bugs #22, #23, #24, #25: (Un)RegisterWait(Ex) APIs were not checking for an invalid wait handle.
[KERNEL32]: Fix bugs #26, #27: RegisterWait(Ex) was not calling GetConsoleInputWaitHandle, so waits on console handles were given straight to the kernel (which obvioulsy doesn't grok them).
[KERNEL32]: Fix bugs #28, #29: UnRegisterWait(Ex) was not checking for STATUS_PENDING, which is a "warning" in NT, but an error as far as this API is concerned, so FALSE should be returned.

svn path=/trunk/; revision=52797
2011-07-23 10:16:10 +00:00
Alex Ionescu 89a3b49840 [KERNEL32]: And finally, the timer APIs and bugs #20 and #21.
svn path=/trunk/; revision=52796
2011-07-23 10:08:57 +00:00
Alex Ionescu 5e0d0909a0 [KERNEL32]: Apply macros to Semaphore APIs. Fix bugs #18/#19 (same as before).
svn path=/trunk/; revision=52795
2011-07-23 10:05:02 +00:00
Alex Ionescu d99b2bd865 [KERNEL32]: Arch, next time hit "Save" before comitting.
svn path=/trunk/; revision=52794
2011-07-23 10:03:10 +00:00
Alex Ionescu fd601c6a41 [KERNEL32]: Make Mutex APIs use the macros too. Fixes bugs #16/#17, same as #14/#15.
svn path=/trunk/; revision=52793
2011-07-23 10:00:32 +00:00
Alex Ionescu 9560a7dff9 [KERNEL32]: Forgot this, sorry.
svn path=/trunk/; revision=52792
2011-07-23 09:58:48 +00:00
Alex Ionescu defe10424f [KERNEL32]: Small fix to the macros (not functional, just for compiler's sake).
[KERNEL32]: Update Event APIs to use the new macros. Fixes bugs #14, #15: the create/open ANSI APIs were not returning the right error in case of object names that were too large.

svn path=/trunk/; revision=52791
2011-07-23 09:58:33 +00:00
Alex Ionescu 761add0ea0 [KERNEL32]: Create OpenNtObjectFromWin32Api macro (last one).
[KERNEL32]: Make OpenJobObjectW use this macro (nothing fixed, it was already doing the right thing).

svn path=/trunk/; revision=52790
2011-07-23 09:40:34 +00:00