[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
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
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
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
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
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
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
[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
[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
[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
[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
[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
[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
[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
[KERNEL32]: Remove GetLocaleInfoEx again.
[KERNEL32]: It seems CMAKE build doesn't like kernel32 code calling "HeapAlloc" because HeapAlloc doesn't exist -- it's a forward to RtlAllocateHeap. As a hack, add compiler defines to do the forwarding in C code as well.
svn path=/trunk/; revision=52760
Add GetLocaleInfoEx back to the exports, idndl needs it.
Should fix default (rbuild) build. No idea (and don't care) about the cmake build, the cmake boys will have to deal with that if it breaks.
svn path=/trunk/; revision=52757