flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
asmfan 24 Jun 2009, 08:16
1. Wrong sizes of members of structure
2. Wrong names of members of structure sample definition: Code: typedef struct _MEMORYSTATUS { DWORD dwLength; DWORD dwMemoryLoad; SIZE_T dwTotalPhys; SIZE_T dwAvailPhys; SIZE_T dwTotalPageFile; SIZE_T dwAvailPageFile; SIZE_T dwTotalVirtual; SIZE_T dwAvailVirtual; }MEMORYSTATUS, *LPMEMORYSTATUS; http://msdn.microsoft.com/en-us/library/aa366772 Who knows how many more structures are broken this way. Are they ported automatically from up-to-date header files? _________________ Any offers? |
|||
![]() |
|
bitRAKE 04 Jul 2009, 07:03
Code: struc MEMORYSTATUS { .: .dwLength rd 1 .dwMemoryLoad rd 1 .dwTotalPhys rq 1 ; SIZE_T .dwAvailPhys rq 1 ; SIZE_T .dwTotalPageFile rq 1 ; SIZE_T .dwAvailPageFile rq 1 ; SIZE_T .dwTotalVirtual rq 1 ; SIZE_T .dwAvailVirtual rq 1 ; SIZE_T .. = $ - . macro .GlobalMemoryStatus \{ lea rcx,[.] call [GlobalMemoryStatus] \} } mstat MEMORYSTATUS mstat.GlobalMemoryStatus cmp [mstat.dwLength],mstat.. jnz .err |
|||
![]() |
|
bitRAKE 09 Jul 2009, 16:23
Code: struc MSG { .: .hwnd rq 1 .message rd 2 .wParam rq 1 .lParam rq 1 .time rd 2 .pt POINT .. = $ - . } |
|||
![]() |
|
madmatt 21 Jul 2009, 01:19
I read further down and it says:
Quote: On computers with more than 4 GB of memory, the MEMORYSTATUS structure can return incorrect information, reporting a value of –1 to indicate an overflow. If your application is at risk for this behavior, use the GlobalMemoryStatusEx function instead of the GlobalMemoryStatus function. So I would guess that If your developing a 64bit program you would use 'GlobalMemoryStatusEX' only. |
|||
![]() |
|
bitRAKE 21 Jul 2009, 02:29
My interpretation was that that is only applicable to 32-bit programs on systems with more than 4GB of memory. Because there is sufficient space to report correct values in 64-bit programs. Which also matches my experience.
|
|||
![]() |
|
bitRAKE 23 Sep 2010, 04:12
Maybe this should be moved to Windows sub-forum?
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.