flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Bugs in structure MEMORYSTATUS in kernel32 and kernel64

Thread Post new topic Reply to topic
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 20170
Location: In your JS exploiting you and your system
revolution 05 Jan 2015, 06:37
The MEMORYSTATUS structure in kernel32.inc has a typo: dwiLength should be dwLength (without the extra 'i').

The same structure in kernel64.inc has the same typo, and also incorrectly defines the last six members as 32-bit only where they need to be 64-bit DQs.

I find it somewhat disturbing the MS named these as dw* and then defines the size as SIZE_T.
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;
Post 05 Jan 2015, 06:37
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.