Commit graph

843 commits

Author SHA1 Message Date
Sven Baars
31ee0b309b kernelbase: Always try to open the Wow6432Node in open_key(). 2023-03-15 16:12:31 +01:00
Sven Baars
0da843f082 kernelbase: Restructure the open_key() loop. 2023-03-15 16:12:31 +01:00
Sven Baars
e146c33351 kernelbase: Pass the key name to create_key(). 2023-03-15 16:12:31 +01:00
Sven Baars
076fb381a9 kernelbase: Pass the root key to create_key(). 2023-03-15 16:12:31 +01:00
Sven Baars
75aa00a557 kernelbase: Pass the key name to open_key(). 2023-03-15 16:12:31 +01:00
Sven Baars
a31d0e6c62 kernelbase: Pass the root key to open_key(). 2023-03-15 16:12:30 +01:00
Brendan Shanks
d7d94ed0df kernelbase: Implement DiscardVirtualMemory(). 2023-03-08 17:49:00 +01:00
Torge Matthies
2db94ca8f9 kernelbase: Fix WaitForThreadpoolIoCallbacks spec entry.
Signed-off-by: Torge Matthies <tmatthies@codeweavers.com>
2023-02-27 10:53:15 +01:00
Torge Matthies
4d0d7e49b9 kernelbase: Reuse the previous iteration's pos and sortkey state if possible in find_substring.
We don't have to reset pos and the sortkey state for every iteration of
the for-loop. In most cases the previous iteration's values are still
valid, and can be re-used, skipping a lot of duplicate work.

Signed-off-by: Torge Matthies <tmatthies@codeweavers.com>
2023-02-23 21:43:59 +01:00
Torge Matthies
01146582cc kernelbase: Break out of inner for-loop early in find_substring.
If I'm interpreting this code correctly, once either of these two
if-conditions are true once, they will also be true at some point
during all of the remaining iterations of the for-loop. Thus, we can
just stop the for-loop here.

Signed-off-by: Torge Matthies <tmatthies@codeweavers.com>
2023-02-23 21:43:06 +01:00
Alexandre Julliard
89bb2622d2 kernelbase: Set ERROR_ALREADY_EXISTS for existing pipe in CreateNamedPipeW().
Reported by Dávid Török.
2023-02-21 11:18:13 +01:00
Alexandre Julliard
d74b084e45 ntdll: Pass the NtCreateNamedPipeFile disposition to the server. 2023-02-21 10:48:16 +01:00
Eric Pouech
df5f6f66de kernelbase: Re-implement EnumProcessModules on top of EnumProcessModulesEx.
Note: this patch changes the results of EnumProcessModules for a wow64
target process called from a 64bit process.

It now returns:
- main module and all loaded 64bit modules (Wine multi-arch wow64 and
  Windows)
- main module only (Wine "old" wow64).
It used to return all the 32bit modules.
You now must use EnumProcessModulesEx(..., LIST_MODULES_32BIT) to get
that result.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-02-15 21:48:33 +01:00
Alex Henrie
9cbbcb409c kernelbase: Avoid calling RtlInitUnicodeString on a static constant. 2023-02-15 19:55:12 +01:00
Eric Pouech
115fbf632a kernelbase: Let GetModuleInformation succeed on 64bit modules in wow64.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-02-13 17:09:32 +01:00
Eric Pouech
c66e876037 kernelbase: Let GetModuleFileNameEx succeed on 64bit modules in wow64.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-02-13 17:09:31 +01:00
Eric Pouech
07efff4e9f kernelbase: Let GetModuleBaseName succeed on 64bit modules in wow64.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-02-13 17:09:31 +01:00
Eric Pouech
c56971ffbd kernelbase: Implement EnumProcessModulesEx.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
2023-02-13 17:09:31 +01:00
Gabriel Ivăncescu
8d02e4e2e9 kernelbase: Fix grouping repeat for number formatting.
Fixes a regression introduced by 56099a3124.

LOCALE_SGROUPING's string and the `Grouping` field in NUMBERFMTW are
confusingly different. The former, which is what is fixed here, treats a '0'
as a repeat of the previous grouping. But a 0 at the end of the `Grouping`
field prevents it from repeating (it repeats by default otherwise) so
it's the opposite. Note that without a '0' in the LOCALE_SGROUPING string,
it shouldn't even repeat in the first place.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
2023-02-07 17:58:52 +01:00
Mohamad Al-Jaf
e1f45229db kernelbase: Partially implement QueryUnbiasedInterruptTimePrecise.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54338
2023-02-07 17:46:44 +01:00
Brendan Shanks
99fc289b90 kernelbase: Partially implement QueryInterruptTimePrecise.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54338
2023-02-07 17:46:43 +01:00
Brendan Shanks
474e8e0dd2 kernelbase: Implement QueryInterruptTime. 2023-02-07 17:46:43 +01:00
Alexandre Julliard
a6451971a2 kernelbase: Report correct errors in GetModuleHandleExA(). 2023-02-02 19:09:23 +01:00
Brendan Shanks
edc479eea9 kernelbase: Implement and add tests for QueryProcessCycleTime. 2023-02-02 10:56:43 +01:00
Alexandre Julliard
448e68ab5b kernelbase: Fix FindNLSStringEx for strings with no primary weights.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53583
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53837
2023-01-09 16:44:08 +01:00
Alexandre Julliard
46e5dd3967 kernelbase/tests: Fix an uninitialized variable warning. 2022-12-08 18:12:18 +01:00
Alexandre Julliard
48aec00477 include: Use proper dllimports for shlwapi functions. 2022-12-07 13:51:37 +01:00
Alexandre Julliard
d92b59717d include: Use proper dllimports for user32 functions. 2022-12-07 13:51:37 +01:00
Alexandre Julliard
fcf5e8c45b include: Use proper dllimports for advapi32 functions. 2022-12-07 13:51:37 +01:00
Alexandre Julliard
a90df92a3c kernelbase: Update timezone data to version 2022g. 2022-12-06 17:04:50 +01:00
Rémi Bernon
4979ae5a94 kernelbase: Restore HEAP_REALLOC_IN_PLACE_ONLY usage in LocalReAlloc.
This effectively reverts 2be9b0ff4a, which
incorrectly removed the flag, when the reallocation failures the tests
showed were coming from an underlying LFH in-place reallocation failure.

Thus, it restores todo_wine where appropriate while removing other todos
for sizes outside of the LFH block size range.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53996
2022-11-30 20:38:27 +01:00
Nikolay Sivov
b544bf188c kernelbase: Forward GetThreadIdealProcessorEx() to ntdll.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-11-22 18:41:02 +01:00
Nikolay Sivov
cf6705a8ca kernelbase: Forward thread priority boost functions to ntdll.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-11-22 18:40:13 +01:00
Nikolay Sivov
421b3867e0 kernelbase: Forward SetThreadIdealProcessor() to ntdll.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-11-22 18:40:13 +01:00
Rémi Bernon
03ad947420 kernelbase: Only discard HLOCAL with LMEM_MOVEABLE and if not locked.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53474
2022-11-22 18:27:31 +01:00
Rémi Bernon
f43fc5121b kernelbase: Avoid moving locked HLOCAL pointer without LMEM_MOVEABLE.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53474
2022-11-22 18:27:31 +01:00
Rémi Bernon
c2c6536926 kernelbase: Handle LMEM_DISCARDABLE flag specifically in LocalReAlloc.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53474
2022-11-22 18:27:31 +01:00
Rémi Bernon
86d09091e6 kernelbase: Handle LMEM_MODIFY flag first in LocalReAlloc.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53474
2022-11-22 18:27:31 +01:00
Rémi Bernon
2be9b0ff4a kernelbase: Don't try in-place HeapReAlloc in LocalReAlloc.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53474
2022-11-22 18:27:31 +01:00
Santino Mazza
d5385c7177 kernelbase: Implement GetGeoInfoEx. 2022-11-22 18:27:30 +01:00
Santino Mazza
f51c752c43 kernelbase: Create GetGeoInfoEx stub. 2022-11-22 18:27:30 +01:00
Nikolay Sivov
ce91ef6426 kernelbase: Add SetProcessInformation().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53954
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-11-21 13:09:41 +01:00
Rémi Bernon
e0ea231892 kernelbase: Validate pointers before calling heap functions. 2022-11-15 18:05:07 +01:00
Jinoh Kang
282120a9c5 ntdll: Use an acquire/release pair on the IOSB status. 2022-11-14 13:17:31 +01:00
Rémi Bernon
0f6e908405 ntdll: Check block user flags in RtlSetUserValueHeap.
Adding the same user flags as native, for Global/Local allocs, and
returning the pointer from Global/LocalHandle by default.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53741
2022-11-10 22:00:35 +01:00
Alexandre Julliard
8f81273904 kernelbase: Update timezone data to version 2022f. 2022-11-08 20:07:51 +01:00
Nikolay Sivov
9cd5bc0d86 kernelbase: Add QueryVirtualMemoryInformation().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-10-31 20:41:44 +01:00
Nikolay Sivov
69cff16d69 kernelbase: Forward some more classes in GetFileInformationByHandleEx().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-10-31 12:11:55 +01:00
Nikolay Sivov
f054d2ab58 kernelbase: Make sure to provide a message for missing information classes in GetFileInformationByHandleEx().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-10-31 12:11:55 +01:00
Nikolay Sivov
404e590e06 kernelbase: Forward some directory info classes in GetFileInformationByHandleEx().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53590
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-10-31 12:11:55 +01:00
Nikolay Sivov
3b8508a539 kernelbase: Forward some of the security descriptor functions to ntdll.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-10-25 11:01:43 +02:00
Hugh McMaster
e58052d836 kernelbase: Avoid memory leaks in GetConsoleTitleW(). 2022-10-19 21:11:00 +02:00
Hugh McMaster
4951ab6436 kernelbase: Add stubs for GetConsoleOriginalTitleA/W(). 2022-10-17 18:13:54 +02:00
Daniel Lehman
f8dc38f9c2 kernelbase: Call NtCancelSynchronousIoFile in CancelSynchronousIo.
Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
2022-10-17 11:22:41 +02:00
Hugh McMaster
627f2b3557 kernelbase: Return full title length from GetConsoleTitle(). 2022-10-10 11:19:44 +02:00
Nikolay Sivov
1ceba3533e kernelbase: Add MapViewOfFileFromApp().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-09-19 20:11:37 +02:00
Nikolay Sivov
3ede82e2a8 kernelbase: Add CreateFileMappingFromApp().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-09-19 20:11:36 +02:00
Nikolay Sivov
40d0e55d4c kernelbase: Add OpenFileMappingFromApp().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-09-19 20:11:35 +02:00
Zhiyi Zhang
2375a6e5bd kernelbase: Return system error codes in the ReadDirectoryChangesW() completion callback.
Return system error codes instead of NT status codes in the ReadDirectoryChangesW() completion callback.
2022-09-15 13:47:45 +02:00
Alexandre Julliard
a8b007da58 kernelbase: Fix error value for PE files without resource.
Avoids spurious "dll is missing" messages from winetest.
2022-08-30 18:30:13 +02:00
Gijs Vermeulen
a9ed113347 kernel32: Add SetProcessDefaultCpuSets stub.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53589
2022-08-25 11:57:24 -05:00
Tim Clem
a7937e83b2 kernelbase: Don't assume the length of the process image name.
NtQueryInformationProcess(ProcessImageFileNameWin32) may return an
empty string in some circumstances, which leads
QueryFullProcessImageNameW to crash if called with flags including
PROCESS_NAME_NATIVE, as that path assumed the image name had a length
of at least 2.
2022-08-10 11:36:33 +02:00
Jinoh Kang
a9c357e5a9 kernelbase: Implement PrefetchVirtualMemory.
Signed-off-by: Jinoh Kang <jinoh.kang.kr@gmail.com>
2022-07-13 16:58:09 +02:00
Alexandre Julliard
3ec7c467cd make_unicode: Generate the time zone registry keys.
Based on a script written by Giovanni Mascellani.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-24 21:05:26 +02:00
Alexandre Julliard
630f605c26 make_unicode: Make support of registry values more generic.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-24 21:05:25 +02:00
Daniel Lehman
1714963a5f kernelbase: Pass va_list copy to internal RtlFormatMessage.
va_list passed to RtlFormatMessage is modified even on error in this
case, if the buffer is not large enough, STATUS_BUFFER_OVERFLOW is
returned and FormatMessage tries again, but the va_list pointer is now
moved to a later argument, so the next call reads off the end,
crashing.

Signed-off-by: Daniel Lehman <dlehman25@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-13 16:54:30 +02:00
Rémi Bernon
a4966b6690 kernelbase: Cleanup and simplify (Global|Local)ReAlloc.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-10 18:24:35 +02:00
Rémi Bernon
660332326e kernelbase: Stop using an offset for HLOCAL pointers.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-10 18:24:35 +02:00
Rémi Bernon
64efaf26b7 kernelbase: Use RtlSetUserValueHeap to store HLOCAL.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-09 20:55:20 +02:00
Rémi Bernon
06b582e695 kernelbase: Use HEAP_ADD_USER_INFO for HLOCAL allocations.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-09 20:55:20 +02:00
Alexandre Julliard
5dee0ed755 kernelbase: Add NORM_IGNORENONSPACE support in LCMapStringEx().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36720
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-08 15:02:30 +02:00
Alexandre Julliard
1e52895ef7 kernelbase: Implement IsNLSDefinedString().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-07 16:57:26 +02:00
Alexandre Julliard
91cd073106 kernelbase: Add support for high Unicode planes in LCMapStringEx().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-06 14:38:47 +02:00
Nikolay Sivov
f98d4f3ef1 kernelbase/tests: Add some more tests for region splitting.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-06-06 12:16:33 +02:00
Nikolay Sivov
03fde5c002 kernelbase: Implement VirtualAlloc2FromApp().
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-06-06 12:16:33 +02:00
Nikolay Sivov
3dcb85f56d kernelbase/tests: Move VirtualAllocFromApp() tests.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
2022-06-06 12:16:33 +02:00
Alexandre Julliard
d1580fd209 kernelbase: Initialize all the compression tables the first time.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53094
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-03 12:50:41 +02:00
Rémi Bernon
9af87e2c64 kernelbase: Convert RtlWalkHeap structure on input too.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-06-02 17:24:49 +02:00
Alexandre Julliard
ef0eb994e6 kernelbase: Add a helper function to simplify flags checking in LCMapStringEx().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-02 10:54:02 +02:00
Alexandre Julliard
86941c44d9 kernelbase: Add a helper function to map an entire buffer to half width.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-02 10:10:44 +02:00
Alexandre Julliard
cd44979ce1 kernelbase: Add a helper function to map an entire buffer to full width.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-02 09:56:48 +02:00
Alexandre Julliard
9c98e96842 kernelbase: Add a helper function to case-map an entire buffer.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-02 09:56:39 +02:00
Alexandre Julliard
c2a455a20d kernelbase: Fix checks for valid locale in LCMapStringW/Ex.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-01 12:46:40 +02:00
Alexandre Julliard
9990dc11df kernelbase: Fix typo in null pointer check.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53080
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-01 10:26:56 +02:00
Alexandre Julliard
66fb3bf631 make_unicode: Get rid of the old collation table.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-31 11:43:28 +02:00
Alexandre Julliard
99cbbb8998 kernelbase: Remove no longer needed case table initialization.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-31 11:43:28 +02:00
Alexandre Julliard
e613d29450 kernelbase: Reimplement FindNLSStringEx/W using the sortkey generation code.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-30 22:40:23 +02:00
Alexandre Julliard
d8c973ad95 kernelbase: Reimplement CompareStringEx using the sortkey generation code.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-30 22:39:29 +02:00
Alexandre Julliard
bc440c9c6d kernelbase: Add support for SORT_DIGITSASNUMBERS in sortkeys.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-30 13:13:03 +02:00
Alexandre Julliard
b90f0be0e7 kernelbase: Add support for Kana extra weights in sortkeys.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-30 13:11:41 +02:00
Alexandre Julliard
abc93d0809 kernelbase: Add support for Hangul composition in sortkeys.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-30 13:09:26 +02:00
Alexandre Julliard
5c324cb8c9 kernelbase: Add support for character compression in sortkeys.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-30 13:06:26 +02:00
Alexandre Julliard
9605f5870a kernelbase: Add support for character expansion in sortkeys.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-30 13:02:09 +02:00
Alexandre Julliard
681489dbb6 kernelbase: Reimplement sortkey generation using the sortdefault.nls data.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-30 12:56:40 +02:00
Huw Davies
f27a77e593 kernelbase: Avoid relying on the exception handler to test that handle != NULL.
Fixes a regression in SlingPlayer 2 caused by commit
a76518c186.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52127
Signed-off-by: Huw Davies <huw@codeweavers.com>
2022-05-27 15:25:07 +02:00
Alexandre Julliard
a980fa0d78 kernelbase: Don't ignore the specified locale in CompareStringW.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-24 18:21:56 +02:00
Alexandre Julliard
2dced17876 kernelbase: Don't ignore the specified locale in LCMapStringA/W.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-24 18:21:56 +02:00
Brendan Shanks
509877743e kernelbase: Add RaiseFailFastException stub.
Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-23 20:54:46 +02:00
Rémi Bernon
1e11056256 kernelbase: Workaround Local(Alloc|Free) invalid access warnings.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
2022-05-23 18:58:25 +02:00
Nikolay Sivov
15aa8c6fb8 kernelbase: Add SetThreadInformation().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52956
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-20 14:36:44 +02:00