flat assembler
Message board for the users of flat assembler.
Index
> Windows > Process32First returns ERROR_BAD_LENGTH (only in 64bit) |
Author |
|
alkap 30 Jan 2018, 07:23
This post referenced below suggests defining dwFlags as ULONG_PTR, which is a 64 bit unsigned long type. See if that helps.
Quote:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/d63cc18c-f54d-4e5a-964f-dda789b1f318/createtoolhelp32snapshot-on-a-64-bit-machine?forum=vcgeneral |
|||
30 Jan 2018, 07:23 |
|
alkap 30 Jan 2018, 08:17
Just tried running your code with dwFlags declared as dq, but to no avail.
No answer for you at the moment. Sorry. |
|||
30 Jan 2018, 08:17 |
|
bitRAKE 30 Jan 2018, 09:25
Would also need to pad the DWORD before the ULONG_PTR as alignment is granular to the object size (i.e. quad words on eight byte boundary).
Code: struct PROCESSENTRY32 dwSize dd 0 cntUsage dd 0 th32ProcessID dd 0 rd 1 ; padding th32DefaultHeapID dq 0 ; PTR is quadword th32ModuleID dd 0 cntThreads dd 0 th32ParentProcessID dd 0 pcPriClassBase dd 0 dwFlags dd 0 szExeFile rb MAX_PATH ends _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
30 Jan 2018, 09:25 |
|
jochenvnltn 30 Jan 2018, 16:39
bitRAKE wrote: Would also need to pad the DWORD before the ULONG_PTR as alignment is granular to the object size (i.e. quad words on eight byte boundary). bitRAKE's fix with the padding in the struct finally fixed the problem. The code is working now as expected and i have learned something new. thank you bitRAKE !!! |
|||
30 Jan 2018, 16:39 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.