Description:
When flags does not include DT_CALCRECT, since len is calculated in the middle,
it will be reduced to zero. Resulting in the length of the processed string that
is finally returned to zero and the non-processing string length is unchanged.
But some application taking the non-processing string length to zero as the loop
end condition.
Log:
Signed-off-by: chenjiangyi <chenjiangyi(a)uniontech.com>
Change-Id: Icc0f250f5f4faba1bee8326fc911a4fc9cd7c012
--
v5: user32: Fix the number of characters processed by DrawTextExW.
user32/tests: Add tests for DrawTextExW.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4812
When League of Legends game released update 13.23 it stopped working in Wine.
Initially we didn't know why it stopped working and due to anti-cheat it was quite difficult to figure out what exactly is happening and so we were just trying to implement random things.
One of the differences when comparing previous version with this version was the addition of something like this to their anti-cheat:
```c
size_t size = 0x100000;
int finalClass = 0xef;
char *buffer = malloc(size * finalClass);
ULONG length;
for (int informationClass=0x00, informationClass < finalClass; informationClass++) {
NtQuerySystemInformation(informationClass, buffer + size * informationClass, size, &length);
}
// later use stuff from there, of course everything's highly obfuscated
```
Essentially this hides what exactly they need since it could be any of classes.
So we started to implement most likely classes that might be used to work like they do in Windows.
This MR contains improvement of `SystemModuleInformationEx` so result will match pretty much exactly how it would on Windows.
I only didn't include more modules but if anyone ever needs that it's very simple to add those.
Also one of the things I noticed is that on Windows even if you give smaller buffer size it will still fill it with data unlike current Wine implementation and this is true for most of classes.
Anyway in the end it turned out not to be issue/needed but I think it still could be useful.
--
v2: ntdll: Improve NtQuerySystemInformation(SystemModuleInformationEx)
https://gitlab.winehq.org/wine/wine/-/merge_requests/4832
When League of Legends game released update 13.23 it stopped working in Wine.
Initially we didn't know why it stopped working and due to anti-cheat it was quite difficult to figure out what exactly is happening and so we were just trying to implement random things.
One of the differences when comparing previous version with this version was the addition of something like this to their anti-cheat:
```c
size_t size = 0x100000;
int finalClass = 0xef;
char *buffer = malloc(size * finalClass);
ULONG length;
for (int informationClass=0x00, informationClass < finalClass; informationClass++) {
NtQuerySystemInformation(informationClass, buffer + size * informationClass, size, &length);
}
// later use stuff from there, of course everything's highly obfuscated
```
Essentially this hides what exactly they need since it could be any of classes.
So we started to implement most likely classes that might be used to work like they do in Windows.
This MR contains improvement of `SystemModuleInformationEx` so result will match pretty much exactly how it would on Windows.
I only didn't include more modules but if anyone ever needs that it's very simple to add those.
Also one of the things I noticed is that on Windows even if you give smaller buffer size it will still fill it with data unlike current Wine implementation and this is true for most of classes.
Anyway in the end it turned out not to be issue/needed but I think it still could be useful.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4832
This MR implements `NtContinueEx(PCONTEXT, PCONTINUE_OPTIONS)` which was added in Windows 10 20H1.
Also added basic test reusing existing `test_continue()` (included from !4720)
League of Legends game hooks `NtContinue()` and `NtContinueEx()` by putting `jmp` instruction in front of it.
Note that LoL doesn't actually use `NtContinueEx()` itself and game will work fine without it but if game doesn't find `NtContinueEx()` it will permanently ban your account due to detecting "scripting program"
--
v3: ntdll/tests: Add basic test for NtContinueEx()
ntdll: NtContinueEx() handle few error cases
ntdll: Implement NtContinueEx()
ntdll/tests: Implement test_continue() for amd64
https://gitlab.winehq.org/wine/wine/-/merge_requests/4761
Currently there is `NtContinue()` test only for `aarch64` so implement it for amd64 aswell.
This implementation is very similar to `aarch64` and it's very basic test.
It doesn't change/test `ContextFlags` so it won't catch https://bugs.winehq.org/show_bug.cgi?id=56050 but that can be implemented later on top of this.
--
v8: ntdll/tests: Implement test_continue() for amd64
https://gitlab.winehq.org/wine/wine/-/merge_requests/4720