flat assembler
Message board for the users of flat assembler.
Index
> Windows > Dealing with WM_NOTIFY |
Author |
|
vid 25 Nov 2010, 00:14
Try one of these:
Code: mov eax,[lparam] mov eax,[eax+NMHDR.code] cmp eax,LVN_* Code: mov eax,[lparam] cmp [eax+NMHDR.code],LVN_* FASM also has some "assume" macro (it does more/less what you want), but I never used it. Yours "label nm NMHDR at lparam" doesn't make much sense. "label" directive can only define label at specified address, nothing else (no structure, no members, etc.) What you probably want to do would be something like: Code: virtual at lparam nm NMHDR end virtual But that would be a bad mistake! "lparam" is defined as "label lparam at ebp+XX" (where XX is some constant number), but the NMHDR structure is not located at "ebp+XX". It is located at address pointed by dword at ebp+XX - eg. indirection. "lparam" is only a pointer to structure, not instance of structure. Becuase of that, you need to load address of NMHDR structure from "lparam" first ("mov eax, dword [lparam]"), and only then access memory at that address ("[eax + NMHDR.something]", "[eax + 4]", etc.). Both can't be done in single instruction. |
|||
25 Nov 2010, 00:14 |
|
revolution 25 Nov 2010, 00:27
vid wrote: Both can't be done in single instruction. Code: cmp [ [lparam] + NMHDR.something],LVN_* |
|||
25 Nov 2010, 00:27 |
|
MattDiesel 25 Nov 2010, 10:37
Thats a great help, and makes it much easier. It's still not as easy as it possibly could be, but it's a good step forward. It solved the problem of having to count up the bytes when using the extended versions of the structure.
Revolution, are you implying that other architectures may support double indirection? I figured it was not possible to nest at all in asm (which is a bit of a pain when you only have so many gprs). I'm not on my computer, so I'll have to run some tests when I get home. The main reason I want this is for using ptAction in NMITEMACTIVATE for NM_RCLICK, I want to use TrackPopupMenu with it (I tried it counting the bytes and ended up with the menu being in the bottom corner of the screen). Thanks again, Mat |
|||
25 Nov 2010, 10:37 |
|
revolution 25 Nov 2010, 10:45
MattDiesel wrote: Revolution, are you implying that other architectures may support double indirection? |
|||
25 Nov 2010, 10:45 |
|
MattDiesel 25 Nov 2010, 12:19
That's pretty interesting... Not that it's particularly relevant to me.
|
|||
25 Nov 2010, 12:19 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.