Commit graph

2955 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto 8e799e2d3e
[SDK:WINE] Some minor additions to wine/test.h (#6822)
- Add two missing debugstr_w* helpers. These will be needed for
  future winetest syncs.

Note that such change would be unnecessary, would wine/test.h and
wine/debug.h be also updated with latest Wine versions. Indeed,
wine/debug.h is now allowed to be included in wine tests since
wine commit:
```
include: Allow using debug.h in tests.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id c8f338369695d360e021f2cbd82a18b2c0eb1514 by Alexandre Julliard <julliard@winehq.org>
```

- Since our wine/test.h doesn't include wine/debug.h for now, include
  instead stdio.h for the time being, in order to get support for
  s(w)printf() in tests that don't include stdio.h
2024-05-04 23:04:21 +02:00
Hermès Bélusca-Maïto 30226f834d
[SDK:WINE] Improve wine/unicode.h (v)sprintfW defines, regarding the (v)swprintf functions (#6823)
These defines assumed that the (v)swprintf functions were the
non-conformant ones (that don't take a 'count' 2nd parameter).
Because of that, use instead the _(v)swprintf functions. However,
those exist only in NT6+. Therefore, redefine these locally
using the _(v)snprintf functions.

NOTE: wine/unicode.h has been removed in wine commit
348eebae872e90a735041a153635d00b01178cfa from July 13, 2022
2024-05-04 13:47:51 +02:00
Timo Kreuzer 6f83cdfdb3 [WINESYNC] Update kernel32.cfg and WINESYNC.txt to wine-3.3 2024-05-03 16:10:00 +02:00
Whindmar Saksit ef80b3dde4
[SDK] ReleaseCComPtrExpectZero should print the relevant file:line (#6772)
ReleaseCComPtrExpectZero currently always prints the same line from shellutils.h in the warning which is not very useful. A macro is required for __FILE__ to be correct.
2024-05-02 17:56:28 +02:00
Timo Kreuzer dc3b208625 [RTL/x64] Fix a bug in RtlRaiseException 2024-05-01 11:30:29 +02:00
Timo Kreuzer b388cb66de [CRT] Add mbrtowc (from wine) 2024-05-01 07:37:31 +02:00
Timo Kreuzer 76d33ee7f2 [CRT] Add wcrtomb (from wine) 2024-05-01 07:37:31 +02:00
Timo Kreuzer 06a35089eb [RTL] actctx.c: Reduce diff to wine
The changes are:
- Do not allocate an additional WCHAR for the terminating UNICODE_NULL, since we already have that accounted for by sizeof(manifest_dirW)
- Use strcpyW intead of memcpy / strlenW, which does the same thing
- Add a define for user_shared_data
2024-04-29 01:15:50 +02:00
Timo Kreuzer 6e277fc0c0 [RTL] actctx.c: Revert parameter change 2024-04-29 01:15:50 +02:00
Timo Kreuzer f9d3a50ee3 [RTL] actctx.c: Add some #ifdef __REACTOS__ 2024-04-29 01:15:50 +02:00
Timo Kreuzer ad5d8bb477 [RTL] actctx.c: Reduce diff to wine 2024-04-29 01:15:50 +02:00
Timo Kreuzer 55f4e2a581 [RTL] actctx.c: Revert RELATIVE_PATH change 2024-04-29 01:15:50 +02:00
Timo Kreuzer 1a6dc01f69 [RTL] actctx.c: Revert FILE_END_OF_FILE_INFORMATION changes
We still need to hack it, because FileEndOfFileInformation is not supported in user mode, neither in ReactOS, nor in Windows.
2024-04-29 01:15:50 +02:00
Timo Kreuzer 41ff75ce36 [RTL] actctx.c: Revert __TRY / __EXCEPT changes 2024-04-29 01:15:50 +02:00
Timo Kreuzer e46364314b [RTL] actctx.c: Revert casts 2024-04-29 01:15:50 +02:00
Timo Kreuzer 86e28b67ce [RTL] actctx.c: Remove unused stuff that isn't in wine 2024-04-29 01:15:50 +02:00
Timo Kreuzer be76eb7c91 [RTL] actctx.c: Revert ERR, WARN, TRACE changes 2024-04-29 01:15:50 +02:00
Timo Kreuzer 37b2e791ee [RTL] actctx.c: Revert pointless formatting changes 2024-04-29 01:15:50 +02:00
Timo Kreuzer 49ed915759 [RTL] actctx.c: Revert NtCurrentProcess() changes 2024-04-29 01:15:50 +02:00
Timo Kreuzer 3b9b26f912 [RTL] actctx.c: Revert GetProcessHeap -> RtlGetProcessHeap changes 2024-04-29 01:15:50 +02:00
Timo Kreuzer 9d8ea85398 [RTL] Disable an MSVC warning in wine source 2024-04-29 01:15:50 +02:00
Mark Jansen 24a56f89ab
Rework apisets to use a table
This removes all fake apiset forwarders,
and handles apisets inside ntdll.
This is not 100% compatible with how windows does it, but it should be good enough for us.
2024-04-27 22:51:34 +02:00
Timo Kreuzer 701b0a3f24
[MSVCRTEX] Only include _CrtDbgReport*, if we don't already export them (#6797)
* [MSVCRTEX] Only include _CrtDbgReport*, if we don't already export them

For some reason clang builds now want the ___chkstk_ms on x64 as well, so add it.
2024-04-27 14:59:06 +03:00
Timo Kreuzer 45aa8f8111 [CRT] Remove useless #undef abort from process.h 2024-04-26 15:16:31 +02:00
Timo Kreuzer 6beff505d7 [CRT] Add _Exit to process.h
This is already done this way in our stdlib.h. It is needed by GCC 13 C++ headers. The problem happens like this:
- telnet/precomp.h includes fstream from GCC
- fstream includes pthread.h from GCC
- pthread.h includes process.h from ReactOS
- process.h defines _CRT_TERMINATE_DEFINED, but doesn't declare _Exit
- fstream includes cstdlib from GCC
- cstdlib includes stdlib.h from GCC (#include_next)
- stdlib.h doesn't declare _Exit, because _CRT_TERMINATE_DEFINED is defined
- cstdlib uses _Exit
2024-04-26 15:16:31 +02:00
Timo Kreuzer 1f49173f82 [CRT] Massively improve performance of rand_s
Cache the pointer to RtlGenRandom instead of loading and unloading advapi32 every single time this function is called.
2024-04-25 05:25:12 +02:00
Timo Kreuzer f319538d98 [CRT] Move rand_s into it's own file 2024-04-25 05:25:12 +02:00
Timo Kreuzer 0ea48e79fc [CRT] Move _invalid_parameter into its own file
As the author of the code, I changed to license to MIT.
2024-04-25 05:25:12 +02:00
Timo Kreuzer 43beb913da [CRT] Move rand to stdlib, where it belongs 2024-04-25 05:25:12 +02:00
Oleg Dubinskiy 24e088daa8
[MMEBUDDY] Implement support for looped wave playback (#6761)
Fix playing wave header multiple times in case the caller requests to do it.
In Windows, it is supported by WHDR_BEGINLOOP and WHDR_ENDLOOP flags (specified together) and dwLoops member of WAVEHDR structure (ususally set to 0xFFFFFFFF (INFINITE constant)).
- Check whenther WHDR_BEGINLOOP | WHDR_ENDLOOP flags are set by the caller.
- If they are, get the amount of times to play the header from WAVEHDR.dwLoops.
- Perform wave header competion only when the loop count is equal to zero. Otherwise, don't do it.
- When the header is entirely committed, in case completion is not needed, reset committed bytes count to the starting value to allow the header play again.
- Decrement loop count in case it isn't set to INFINITE, to mark loop as played correctly. When this count becomes zero, then the playback is finished.
- Get rid from SOUND_OVERLAPPED.PerformCompletion member. Use SOUND_DEVICE_INSTANCE.LoopsRemaining == 0 condition instead.
- Do this only for WaveOut devices, since MSDN states it works only with output buffers. Hence, there is nothing changed for WaveIn.
- Update an appropriate statement about unimplemented functionality from mmebuddy notes.
TODO: handle the case when multiple headers are requested to be looped (WHDR_BEGINLOOP and WHDR_ENDLOOP are set separatedly: 1st flag - in the 1st header, and 2nd in the last header). Currently, only looping a single wave header is supported.
This fixes the playback in the apps those request looped wave playback of some audio data (e. g., BRD Demo app, which did play its sound only first 500 ms before, now it plays endlessly until closing it manually).
CORE-10118
2024-04-24 11:08:40 +02:00
Timo Kreuzer 9229709312 [NTOS:KE/x64] Implement processor freeze code 2024-04-23 15:50:06 +02:00
Timo Kreuzer a8ece7e81a [EVTLIB] Fix size of event log record
The size is 32bit, don't read a SIZE_T. Fixes crashes of advapi32_winetest eventlog on x64.
2024-04-22 16:42:02 +02:00
Oleg Dubinskiy 5949c20d97
[MMIXER] Fix additional data size initialization for different audio formats (#6753)
Calculate size of the additinal data based on the format tag specified by the caller.
For PCM wave format, it should be zero, and for all others,
it should be taken from cbSize member of WAVEFORMATEX structure.
- Initialize data size for each format appropriately.
- Append it to the total pin connect allocation size, to allocate enough memory for it.
- Use it as additional data size for requested wave format.
- Append it to the total size of data format.
- Add SAL2 annotations for MMixerInitializeDataFormat function.
Fixes two crashes in winmm:capture and winmm:wave winetests, which have been introduced by 12b3272d9e.
So this is an addendum to that commit.
CORE-19514
2024-04-18 23:19:35 +02:00
Justin Miller ad9c634efa
[SDK] Don't just infinitely spam the DbgPrint in the bootloader (#6763) 2024-04-18 12:08:00 -07:00
Mark Harmstone dd6c1c8843 [FREELDR] Allow Freeloader to boot Vista revamp of PR #1905 (#6479)
[FREELDR] Add "WindowsVista" boot type
[FREELDR] Set GDT correctly for Vista
[FREELDR] Map first page of memory, this is an observed behavior, and
also increases stability boot Checked windows 2003 SP2 ntoskrnl with
freeloader.
[SDK] Don't assert on big keys in bootloader

Co-authored-by: Justin Miller <justin.miller@reactos.org>
2024-04-18 09:28:54 -07:00
Timo Kreuzer 95bf896b10 [CRT] crtdefs.h: Wrap localeinfo_struct in ifdef
This prevents a redefinition error, when GCC 13 host headers are included when compiling c++ code.
2024-04-16 20:10:38 +02:00
Timo Kreuzer 8feb078692 [NTOS:KE/x64] Use movaps instead of movdqa
It does the same thing, but is one byte shorter.
2024-04-14 16:09:20 +02:00
Timo Kreuzer 8d459f2820 [NTOS:KE/x64] Clean up EnterTrap/ExitTrap
- Always save and restore all non-volatile registers, including xmm
- Remove the obsolete flags
2024-04-14 16:09:20 +02:00
Timo Kreuzer 05456808e8 [NTOS:KE/x64] Fix handling of non-volatiles in trap vs exception frame
The registers that are saved/restored in the trap / exception frame need to be consistent between all entry/exit points as well as the functions that convert between trap/exception frame and context. The trap frame contains only the non-volatile registers and rbp, the rest is saved in the exception frame.
The previous code didn't save rbp in the syscall handler, which led to it being clobbered when exiting though KiServiceExit2 rather than returning back to the syscall exit path. Also KeContextToTrapFrame would use rbx, rsi and rdi from the trap frame, which wouldn't be saved there by the syscall handler.
2024-04-14 16:09:20 +02:00
Timo Kreuzer 83e741c643 [RTL/x64] Implement RtlRaiseException in asm
This fixes invalid contexts being passed to RtlDispatchException. Also update the ExceptionAddress field in the EXCEPTION_FRAME, to match the Rip value in the CONTEXT, which is required for proper unwinding.
2024-04-14 14:12:35 +02:00
Timo Kreuzer fc6e23d6b8 [NDK/x64] Remove #pragma pack(push,4) around KPRCB/KPCR 2024-04-13 17:59:04 +02:00
Timo Kreuzer bb444b93d9 [RTL/x64] Handle STATUS_UNWIND_CONSOLIDATE in RtlRestoreContext
It's not entirely correct yet and will probably fail on recursive c++ exceptions, but it fixes basic c++ exception handling.
2024-04-13 14:34:23 +02:00
Ratin Gao f61e14f554 [NTDLL][ADVAPI32][ADVAPI32_APITEST][CRYPTLIB] Add hash API exports for NT6+ and apitests with small fixes
- For NT6.0+, NTDLL exports those hash APIs that ADVAPI32 thunks forward to
- Fix undocumented context structure layout and content
- Add apitests to verify both of hash result and structure content
2024-04-13 12:41:36 +02:00
Katayama Hirofumi MZ 31ce37da2a
[SHELL32][SHELL32_APITEST][SDK] Implement GUIDFromStringA (#6734)
Implementing missing features...
JIRA issue: CORE-19278
- Add GUIDFromString testcase.
- Implement GUIDFromStringA function.
- Add NULL check to GUIDFromStringW.
- Add GUIDFromStringA prototype to "undocshell.h".
2024-04-12 21:29:07 +09:00
Oleg Dubinskiy 12b3272d9e
[AUDIO] Implement support for WAVE_FORMAT_EXTENSIBLE audio format (#6686)
[MMIXER] Implement hadling WAVE_FORMAT_EXTENSIBLE audio format
Fix opening audio device error when trying to open it with WAVE_FORMAT_EXTENSIBLE format tag set in wFormatTag member of WAVEFORMATEX:
- Pass additional data size from WAVEFORMATEX.cbSize to pin data format.
- Append it to the whole size of pin data format (KSDATAFORMAT.FormatSize).
- Set additional fields in WAVEFORMATEXTENSIBLE structure (data format, BPS and channel mask) when WAVE_FORMAT_EXTENSIBLE is used. They are used by our inbuilt Intel AC97 miniport driver at least. It simply fails when these members are not set.
- Fix pin connect allocation size by appending an additional data size from WAVEFORMATEX.cbSize to KSPIN_CONNECT + KSDATAFORMAT + WAVEFORMATEX. This allows to proerly initialize additional extensible data and avoids kernel memory leakage when using extensible audio format.
- Remove format tag check which allowed WAVE_FORMAT_PCM to be opened correctly. So now all possible audio formats can be opened properly at least (although it does not mean they may work correctly).
This fixes the audio playback for all apps those are supporting extensible audio data and use it by default (e. g. AIMP 5.30, QMMP 0.12.17, all Chrome/Chromium-based browsers, GameDev Tycoon Demo game etc.).
CORE-10907, CORE-14783

* [KS] Allow passing additional extensible audio data when extensible audio format is used
- Append additional data size from WAVEFORMATEX.cbSize to pin connect size passed to KsCreatePin. If the tag is WAVE_FORMAT_PCM, then this member should always be zero. So in that case, no any additional data is passed to creation request, and the passed data size is correct for PCM too (KSDATAFORMAT + WAVEFORMATEX).
This fixes audio playback in several apps those are supporting extensibble audio and use it by default (e. g. AIMP 5.30, QMMP 0.12.17, all Chrome/Chromium based browsers, GameDev Tycoon Demo game etc.).
CORE-10907, CORE-14783.

* [WDMAUD.DRV] Pass the correct additional data size to I/O control request
Store a correct size of additional data in WAVEFORMATEX.cbSize when performing open of audio device, when WAVE_FORMAT_EXTENSIBLE audio format is used.
It allows to properly open audio device with Legacy APIs enabled too.
This fixes audio playback in several apps those are using extensible audio data (e. g. AIMP 5.30, QMMP 0.12.17, all Chrome/Chromium based browsers, GameDevTycoon Demo game etc.).
CORE-10907, CORE-14783
2024-04-11 11:59:14 +02:00
Whindmar Saksit 7a810c17e7
[SHELL32] Implement several ShellDispatch methods (#6145)
* Implement most of the methods

* Some suggested changes and better error handling (that I then mask like Windows)
2024-04-10 14:29:26 -07:00
Katayama Hirofumi MZ d05dcf6a02
[SHELL32][SDK] Fix ParseDisplayName Part 1 (#6721)
JIRA issue: CORE-19495
- Implement SHParseDisplayName and
  CDesktopFolder::ParseDisplayName.
- Add CStubFolderBase, CShellUrlStub, CFileUrlStub,
  CIDListUrlStub, and CHttpUrlStub helper classes.
- Add SHGetSpecialFolderID and
  Shell_ParseSpecialFolder helper functions.
- Add BindCtx_ContainsObject,
  BindCtx_GetUIWindow, 
  BindCtx_RegisterObjectParam, SHBindToObject,
  SHBindToObjectEx, SHCoInitializeAnyApartment,
  SHGetAttributes, SHGetNameAndFlagsW,
  SHIsFileSysBindCtx, SHSkipJunctionBinding,
  Shell_DisplayNameOf, and Shell_FailForceReturn
  helper functions.
- Modify CSIDL data.
2024-04-10 09:32:13 +09:00
Whindmar Saksit 9238a1762f
[SHELL32] Copy as path shell extension (#6701)
* Added Copy as path menu extension

---------

Co-authored-by: Thamatip Chitpong <weedgamer131@gmail.com>
2024-04-06 14:01:32 -07:00
Timo Kreuzer b6987d1463 [RTL/x64] Remove an ASSERT in RtlpTryToUnwindEpilog
This can fail on optimized builds, where functions can end after a noreturn function call without an epilog / ret, but with an int 3. We simply fail gracefully, which is the right thing to do.
2024-04-05 18:18:45 +02:00
Whindmar Saksit 8841e3d7ba
[SHELL32] Handle the Progman Folder options message and tab switching support (#5574)
* Handle the "OnShowOptionsDlg" message
* Support switching tabs
* Update dll/win32/shell32/dialogs/folder_options.cpp
* Update dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp
* ShowFolderOptionsDialog workaround
* Added Vista pages, define for magic message

---------

Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
Co-authored-by: Thamatip Chitpong <weedgamer131@gmail.com>
2024-04-04 18:53:57 -07:00