Commit graph

2961 commits

Author SHA1 Message Date
Katayama Hirofumi MZ ac0bcf4a90
[SHLWAPI][SHLWAPI_APITEST][SDK] PathFileExistsDefExtAndAttributesW (#6879)
Implementing missing features...
JIRA issue: CORE-19278
- Implement PathFileExistsDefExtAndAttributesW function.
- Add its prototype to <shlwapi_undoc.h>.
- Modify shlwapi.spec.
- Add PathFileExistsDefExtAndAttributesW testcase.
2024-05-15 07:42:43 +09:00
Whindmar Saksit 9e8214fa13
[BROWSEUI] GetControlWindow must support FCW_TREE for DefView usage (#6781)
Support GetControlWindow, ShowControlWindow and IsControlWindowShown for TREE and STATUS in the Shell Browser so DefView can set CMF_EXPLORE correctly.
2024-05-09 18:56:19 +02:00
Joe Mason d234dc2d52
[AVRT] Import Audio/Video Runtime module from Wine 9.7 (#6826)
Enhance compatibility with future programs, including browsers.
AVRT is an acronym for "Audio/Video Multimedia Realtime Runtime" and is NT6.
2024-05-07 15:40:27 +03:00
Oleg Dubinskiy d1b8feb690
[AUDIO] Implement retreiving audio playback position (#6817)
Implement GetWavePosition API for both Legacy and MMixer modes.
[WDMAUD.DRV]
- Fix wrong I/O control code passed to DeviceIoControl for Legacy mode. Use IOCTL_GETPOS instead of IOCTL_OPEN_WDMAUD, to use the correct routine.
- Implement WdmAudGetWavePosition for MMixer mode, as it was completely unimplemented there. Call an appropiate MMixer routine and return back resulting wave position.
[WDMAUD]
- Implement WdmAudGetPostion routine, which is used by Legacy mode, and call the same MMixer routine from it too.
- Handle it in IOCTL_GETPOS I/O control request of dispatch routine.
[MMIXER]
- Implement MMixerGetWavePosition internal routine, which is called by both Legacy and MMixer modes, and does the actual work of retrieving playback position.
- Call an apporpriate KSPROPERTY_AUDIO_POSITION property from it, and return in the output resulting KSAUDIO_POSITION.PlayOffset member, which contains the current playback position offset, to be returned to the caller.
This fixes a failure retreiving the current audio playback position snd subsequent playing the audio data by several 3rd-party applications which are using this API (for example, some Gecko based browsers by @roytam1: Basilisk (Serpent) 52.9.0 IA-32 build, NewMoon 28.10.7 IA-32 build and KMeleon 76.5.3 Goanna engine).
CORE-19542
2024-05-06 20:07:47 +02:00
Timo Kreuzer 67c28b723e [PSEH/x64] Fix our GCC-SEH-plugin hack
The change is needed, because the previous version emitted multiple ".seh_handlerdata" blocks and GAS isn't able to merge them into one, but will instead only include the first one. This is fixed by generating "asm defines" in the code and pass the line number to the "REACTOS seh" pragma, which is then used to create all handler data by referring to the predefined symbols, that include the line number.
Also the EstablisherFrame parameter passed to the filter/finally function is the original stack pointer, not the frame pointer! Take this into account by passing __builtin_frame_address(0) from the filter context to the global wrapper function, which includes the frame-offset, and use that to recalculate the frame-pointer from the passed in stack pointer.
2024-05-06 14:23:48 +02:00
Timo Kreuzer f4a9f9cde3 [CRT][NTDLL][MSVCRT] Add _swprintf implementation 2024-05-06 14:08:31 +02:00
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