Commit graph

47166 commits

Author SHA1 Message Date
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
Alex Ionescu d06e82af03 [KERNEL32]: Add ConvertOpenWin32AnsiObjectApiToUnicodeApi macro.
[KERNEL32]: Fix bugs #11, #12, #13: OpenJobObjectA did not correctly set the error code in case the string was too long, nor did it use the TEB's static unicode cache, nor did it enforce a 260 character object name limit. Fixed by using the new macro.

svn path=/trunk/; revision=52789
2011-07-23 09:28:15 +00:00
Alex Ionescu 5496adb4bc [KERNEL32]: Fix the object macros to be MSVC/C99 compatible. Also allow for the variadic part to contain no arguments.
[KERNEL32]: Fix bugs #7, #8, #9, #10: CreateJobObjectW did not add OBJ_OPENIF to named jobs, it did not add named objects in the BaseNamedObjects directory, it did not correctly set ERROR_ALREADY_EXISTS when collisions happened, and it did not set ERROR_SUCCESS when the object was created. All this was fixed by using the new CreateNtObjectFromWin32Api macro.

svn path=/trunk/; revision=52788
2011-07-23 02:17:26 +00:00
Alex Ionescu 19366d1781 [KERNEL32]: Fix bugs #4, #5, #6. CreateJobObjectA was building a dynamic string isntead of using the TEB. It was also not returning the right error code in case of error. It was also allowing jobs to have names past 260 characters. Fixed by using the ConvertWin32AnsiObjectApiToUnicodeApi macro from 5-6 revisions ago.
svn path=/trunk/; revision=52787
2011-07-23 00:30:56 +00:00
Alex Ionescu 59a6314a13 [KERNEL32]: Reformat (of my own code).
svn path=/trunk/; revision=52786
2011-07-23 00:29:00 +00:00
Alex Ionescu f185a728a7 [KERNEL32]: New macro, not yet used. This one implements the CreateXxxW APIs (or rather, will).
svn path=/trunk/; revision=52785
2011-07-23 00:28:33 +00:00
Cameron Gutman acd4c15b61 [AFD]
- Fix (hopefully) the final disconnect bugs

svn path=/trunk/; revision=52783
2011-07-22 15:11:01 +00:00
Alex Ionescu 2374f5b1aa [KERNEL32]: Clarify the difference between the macro and Basep8BitStringToStaticUnicodeString.
svn path=/trunk/; revision=52779
2011-07-22 10:10:15 +00:00
Alex Ionescu 278fb2f2b6 [KERNEL32]: Fix Bug #3. Make CreateNamedPipeA use our new macro. Fixes the fact it wasn't checking for success when doing the ANSI->Unicode translation, and just assumed things would work.
svn path=/trunk/; revision=52778
2011-07-22 09:50:33 +00:00
Alex Ionescu 45f4cd3964 [KERNEL32]: Fix Bug #2: FindFirstChangeNotificationA actually returns FALSE instead of INVALID_HANDLE_VALUE if the name conversion failed. In fact, up until Win7, all the *A object APIs do so, even though MSDN has always claimed the APIs return INVALID_HANDLE_VALUE. Since we don't have the Shim Database Microsoft has to unbreak apps on Win7 that probably depend on the old behavior, we'll keep the old behavior (especially since we target NT 5.2 -- and even Vista does it this way).
[KERNEL32]: Bug was fixed by using the new macros implemented last commit.

svn path=/trunk/; revision=52777
2011-07-22 09:09:05 +00:00
Alex Ionescu d19dfaa93c [KERNEL32]: Add a macro function that automatically takes care of A->W conversion for Win32->NT Object Create APIs, and does AllTheRightStuff.
[KERNEL32]: Fix bug #1: CreateFileMappingA was not returning the right error if the file mapping name was too long. By making it use the new ConvertWin32AnsiObjectApiToUnicodeApi macro, it now does.

svn path=/trunk/; revision=52776
2011-07-22 08:59:27 +00:00
Cameron Gutman cb26a7762f [AFD]
- Only trigger the close event if the pending receive list is empty

svn path=/trunk/; revision=52775
2011-07-22 04:31:33 +00:00
Cameron Gutman 2e54713de3 [AFD]
- Wait to signal a graceful receive shutdown until all buffered transport data is read by the application

svn path=/trunk/; revision=52774
2011-07-22 04:11:50 +00:00
Alex Ionescu 5965cf4895 NO CODE CHANGE:
[KERNEL32]: Rename "misc" to "wine" since this is what this is now.

svn path=/trunk/; revision=52773
2011-07-22 03:26:28 +00:00
Alex Ionescu c4e918f7a9 NO CODE CHANGE
[KERNEL32]: And at last, the final stroke. Move toolhelp.c into client, and split time.c into timezone.c (wineisms) and time.c (incorrect/buggy ntisms), which goes into client. Now "misc" truly only contains Wine-code (along with winnls), and the true NT base API that needs to be focused on is in "client".

svn path=/trunk/; revision=52772
2011-07-22 03:21:17 +00:00
Alex Ionescu 2780d189fc [KERNEL32]: We lost an API. Rbuild didn't care.
svn path=/trunk/; revision=52771
2011-07-22 02:43:12 +00:00
Alex Ionescu 222e577a94 [KERNEL32]: Remove stubs.c and instead distribute stubs in their appropriate files.
[KERNEL32]: Create vdm.c and appcache.c since no files existed for these kinds of APIs.

svn path=/trunk/; revision=52770
2011-07-22 02:13:57 +00:00
Sylvain Petreolle e18ef1f5a7 [ROSTESTS]
Add 3 missing tests to rbuild testcd.
Thanks to Caemyr and Testman.

svn path=/trunk/; revision=52769
2011-07-21 23:14:57 +00:00
Jérôme Gardou 39b9815f2e [SPEC2DEF]
- fix forward name export for c++ mangled functions.

svn path=/trunk/; revision=52768
2011-07-21 21:13:28 +00:00
Timo Kreuzer fe6c036e04 [CMAKE]
Add msvcrt20 and msvcrt40 to build

svn path=/trunk/; revision=52766
2011-07-21 18:40:41 +00:00
Timo Kreuzer 59f0449d2a [SPEC2DEF]
Fix creation of stubs for c++ mangled names

svn path=/trunk/; revision=52765
2011-07-21 18:39:24 +00:00
Sylvain Petreolle c5dc599680 [HIVES]
Fix Nls registry keys casing.
Tested by Alex.

svn path=/trunk/; revision=52764
2011-07-21 17:33:38 +00:00
Alex Ionescu cb35516e05 [KERNEL32]: Don't know how to fix this without breaking the synch... but this should fix CMAKE.
svn path=/trunk/; revision=52763
2011-07-21 17:28:21 +00:00
Alex Ionescu 1d0de632fd [KERNEL32]: C'mon cmake..you can do it!
svn path=/trunk/; revision=52762
2011-07-21 17:21:43 +00:00
Alex Ionescu 7d27bafbd7 [KERNEL32]: Add the #defines only to Winesynched code. Should fix CMAKE build...
[KERNEL32]: Move more Vista APIs out of the way and un-export some functions. Reset the WINNT_VERSION to 0x502 instead of 0x600, except for synch.c (TBD).
[KERNEL32]: Fix casts and math in GetTickCount and GetTickCount64. GetTickCount64 is Vista, but Wine-synched DLLs need it, so leave it exported.

svn path=/trunk/; revision=52761
2011-07-21 17:02:48 +00:00