Projects > MASM32
A pair of bugs in Kernel32.lib and kernlp.lib (solved)
rsala:
Hi All,
As you probably know, the latest release of MASM32 has a pair of bugs in the kernel32 library referred to Module32First / Module32Next and Process32First / Process32Next API functions. According to Microsoft MSDN, the ANSI versions are not Module32FirstA / Module32NextA nor Process32FirstA / Process32NextA, but Module32First / Module32Next and Process32First / Process32Next. So when you call Module32First, even if the __UNICODE__ constant is set, you are calling the ANSI version, which is Module32First, and the same happens for Module32Next, Process32First and Process32Next (no problem with Unicode versions as they are Module32FirstW, Module32NextW, etc.). These bugs cause serious problems when you are using the ANSI versions of any of those functions.
I have fixed the problem modifying the kernel32.inc file (lines 1582 to 1586 and 1712 to 1716) and rebuilding the kernel32.lib. Now everything works fine, so I attach both files for those who want to fix them. Just replace kernel32.inc (in MASM32 include folder) and kernel32.lib (in MAMS32 lib folder) with the ones attached to this post.
Regards,
Ramon
Vortex:
Hi rsala,
You are right, thanks. Here is how it looks :
--- Code: ---dumpbin /EXPORTS C:\WINDOWS\system32\kernel32.dll >exports.txt
--- End code ---
--- Code: --- 605 25C 000653A0 Module32First
606 25D 000652E7 Module32FirstW
607 25E 00065525 Module32Next
608 25F 00065484 Module32NextW
--- End code ---
Tested on a XP SP3 system.
rsala:
Hi Vortex,
Thank you very much for testing it.
Regards,
Ramon
dedndave:
as i recall, there were a few other kernel32 functions that had the same issue
also - the same issues occur in kernl32p.inc/lib
rsala:
Hi,
Sorry, but I was not aware of the same problem in kernl32p.inc/lib files. Anyway, I've just fixed the bug and the new (and fixed) files are attached.
Ramon
Navigation
[0] Message Index
[#] Next page
Go to full version