flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > How can I make one macros based ,I think, on "match&quo |
Author |
|
madmatt 02 Feb 2006, 11:01
First, you'll need to include the 'kernel32.inc' include
second, in your '.data' section you'll need: myosversion OSVERSIONINFO now you should be able to: Code: hMainModule = GetModuleHandle(0) OSVERSIONINFO_.dwOSVersionInfoSize = sizeof.OSVERSIONINFO eax = GetVersionEx(OSVERSIONINFO_) ----------- invoke GetModuleHandle, 0 mov [myosversion.dwOSVersionInfoSize], sizeof.OSVERSIONINFO invoke GetVersion, myosversion To use 'GetVersionEx' you'll need the new and improved OSVERSIONINFOEX, not defined in the original fasmw incudes, so here it is: Code: struct OSVERSIONINFOEXA dwOSVersionInfoSize dd ? dwMajorVersion dd ? dwMinorVersion dd ? dwBuildNumber dd ? dwPlatformId dd ? szCSDVersion db 128 dup(?) wServicePackMajor dw ? wServicePackMinor dw ? wSuiteMask dw ? wProductType db ? wReserved db ? ends |
|||
02 Feb 2006, 11:01 |
|
dead_body 03 Feb 2006, 17:36
to madmatt
I don't meen that. I did the code that I wrote.The cod work normal. But I don't know how to do "OSVERSIONINFO_.dwOSVersionInfoSize = sizeof.OSVERSIONINFO" I would like to make a macros, and with that macros I would like to write that. I made something like that: Code: macro Add_C_SyntaxToVars [var] { macro var param \{ define status 0 match =0 ==src,status param \\{ mov [var],param define status 1 \\} match =0 any,status param \\{ unknown syntax \\} \} } but when I do Code: Add_C_SyntaxToVars OSVERSIONINFO_ fasm think that OSVERSIONINFO_.dwOSVersionInfoSize is not a macro. fasm think that a mascro is only OSVERSIONINFO_ . what can I do? |
|||
03 Feb 2006, 17:36 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.