Module: wine Branch: master Commit: 6257da8b429e251637d32608f92c934c2e91ad5d URL: https://source.winehq.org/git/wine.git/?a=commit;h=6257da8b429e251637d32608f...
Author: Zebediah Figura z.figura12@gmail.com Date: Mon Oct 26 18:40:06 2020 -0500
ntdll: Don't check "info" for NULL in NtQuerySystemInformation(SystemModuleInformation).
Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/ntdll/unix/system.c | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-)
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index 6ff277c2d0c..7ac084a9899 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -2333,30 +2333,27 @@ NTSTATUS WINAPI NtQuerySystemInformation( SYSTEM_INFORMATION_CLASS class, "\SystemRoot\system32\drivers\mountmgr.sys" };
- if (!info) ret = STATUS_ACCESS_VIOLATION; - else - { - ULONG i; - SYSTEM_MODULE_INFORMATION *smi = info; + ULONG i; + SYSTEM_MODULE_INFORMATION *smi = info;
- len = offsetof( SYSTEM_MODULE_INFORMATION, Modules[ARRAY_SIZE(fake_modules)] ); - if (len <= size) + len = offsetof( SYSTEM_MODULE_INFORMATION, Modules[ARRAY_SIZE(fake_modules)] ); + if (len <= size) + { + memset( smi, 0, len ); + for (i = 0; i < ARRAY_SIZE(fake_modules); i++) { - memset( smi, 0, len ); - for (i = 0; i < ARRAY_SIZE(fake_modules); i++) - { - SYSTEM_MODULE *sm = &smi->Modules[i]; - sm->ImageBaseAddress = (char *)0x10000000 + 0x200000 * i; - sm->ImageSize = 0x200000; - sm->LoadOrderIndex = i; - sm->LoadCount = 1; - strcpy( (char *)sm->Name, fake_modules[i] ); - sm->NameOffset = strrchr( fake_modules[i], '\' ) - fake_modules[i] + 1; - } - smi->ModulesCount = i; + SYSTEM_MODULE *sm = &smi->Modules[i]; + sm->ImageBaseAddress = (char *)0x10000000 + 0x200000 * i; + sm->ImageSize = 0x200000; + sm->LoadOrderIndex = i; + sm->LoadCount = 1; + strcpy( (char *)sm->Name, fake_modules[i] ); + sm->NameOffset = strrchr( fake_modules[i], '\' ) - fake_modules[i] + 1; } - else ret = STATUS_INFO_LENGTH_MISMATCH; + smi->ModulesCount = i; } + else ret = STATUS_INFO_LENGTH_MISMATCH; + break; }