list of structs with parameters (sizes and types)

Put simple Tips and Tricks that are not entire Tutorials in this forum
User avatar
jeeswg
Posts: 5402
Joined: 19 Dec 2016, 01:58
Location: UK

list of structs with parameters (sizes and types)

13 Apr 2017, 00:37

I am collecting structs with parameter types and sizes for quick reference. This list will expand in time (to at least 100), plus I will provide some code for generating these struct summaries. Do post any requests for structs that you would like to see on this list, or notify of any incorrect information.

The basic rules are the same for both x64 and x32. In general: an n-byte parameter must start at an n-byte offset, and the overall size of the struct must be divisible by the size of the biggest parameter. Note: because of these alignment rules can you actually get a fair number of gaps in a struct, including at the end of the struct.

Some items are misleading, a RECT has size 16, but is treated as 4 consecutive Ints, it starts at an offset divisible by 4.

Ints and UInts start at offsets divisible by 4.
In x32, Ptrs have size 4, so start at offsets divisible by 4.
In x64, Ptrs have size 8, so start at offsets divisible by 8.

notes:
- * - if an asterisk is present, then that normally means the parameter is a Ptr type
- []; - a parameter can have a value in square brackets, e.g. '[3]' means that parameter appears 3 times, e.g. '[MAX_PATH]' means that parameter appears 260 times, you get an 'array' of parameters
- union - 'A union is a user-defined type in which all members share the same memory location.'

Code: Select all

CHAR	1 byte (1 byte = 8 bits)
SHORT	2 bytes (2 bytes = 16 bits)
INT	4 bytes (4 bytes = 32 bits) (UINT has 4 letters, INT/UINT are 4 bytes in size)
INT64	8 bytes (8 bytes = 64 bits)

WORD	2 bytes (2 bytes = 16 bits) (WORD is UShort)
DWORD	4 bytes (4 bytes = 32 bits) (DWORD is UInt) (double word)
QWORD	8 bytes (8 bytes = 64 bits) (quadword)

LONG	4 bytes (4 bytes = 32 bits) (LONG is Int)

(SH*OR*T and W*OR*D are 2 bytes in size)

note: BOOLEAN is UChar, but BOOL is Int
note: most handles are Ptr, but HFILE and HRESULT are Int
Links:
Window Data Types (Compact 2013)
https://msdn.microsoft.com/en-us/library/ee504522.aspx
Hungarian Notation
https://msdn.microsoft.com/en-us/librar ... s.60).aspx

Note: around 20 of the structs have '[CHECK]' underneath them, which are ones I will add information to.

Note: some parameters/structs can differ depending on the operating system, architecture (x32/x64), or whether the program is ANSI/Unicode. E.g. TBYTE/TCHAR depend on whether the program is ANSI/Unicode.

Note: in the structs below we assume that TCHAR refers to a Unicode character, and is thus a UShort of size 2.

Note: if a struct refers to another type of struct, then that struct is also in the list below.

HELP: It would be useful if someone could confirm LVITEM (x64). I am not sure as to whether parameters can overlap an #endif.

The information is presented in the way it is, to do things like:

Code: Select all

vSize := (A_PtrSize=8?48:32)
MsgBox, % NumGet(MENUBARINFO, A_PtrSize=8?40:28, "Int") ;fBarFocused / fFocused
STRUCT=SizeInBytesX64:SizeInBytesX32

Code: Select all

;;ACCEL=6:6
;;ACCESSTIMEOUT=12:12
;;ANIMATIONINFO=8:8
;;API_VERSION=8:8
;;AUDIODESCRIPTION=12:12
;;BIND_OPTS=16:16
;;BITMAP=32:24
;;BITMAPINFO=44:44
;;BITMAPINFOHEADER=40:40
;;BLENDFUNCTION=4:4
;;CHARFORMAT2=116:116
;;CLIENTCREATESTRUCT=16:8
;;COMBOBOXINFO=64:52
;;COPYDATASTRUCT=24:12
;;COSERVERINFO=32:16
;;CREATESTRUCT=80:48
;;CURSORINFO=24:20
;;DEVMODE=220:220
;;DIBSECTION=104:84
;;DISPLAY_DEVICE=840:840
;;DISPPARAMS=24:16
;;DLLVERSIONINFO2=32:32
;;DLLVERSIONINFO=20:20
;;DRAWTEXTPARAMS=20:20
;;FILETIME=8:8
;;FILTERKEYS=24:24
;;GLYPHSET=20:20
;;GOPHER_FIND_DATA=1588:1588
;;GUID=16:16
;;GUITHREADINFO=72:48
;;HDITEM=72:48
;;HIGHCONTRAST=16:12
;;ICONINFO=32:20
;;ICONMETRICS=108:108
;;IMAGELISTDRAWPARAMS=88:68
;;IN6_ADDR=16:16
;;IN_ADDR=4:4
;;INITCOMMONCONTROLSEX=8:8
;;ITEMIDLIST=3:3
;;LIST_ENTRY=16:8
;;LOADED_IMAGE=88:48
;;LOGFONT=92:92
;;LOGFONTA=60:60
;;LOGFONTW=92:92
;;LOGPALETTE=8:8
;;LOGPEN=16:16
;;LVITEM=88:60
;;MDICREATESTRUCT=56:36
;;MEMORY_BASIC_INFORMATION=48:28
;;MENUBARINFO=48:32
;;MENUINFO=40:28
;;MENUITEMINFO=80:48
;;MINIMIZEDMETRICS=20:20
;;MODULEENTRY32=1080:1064
;;MONITORINFOEX=104:104
;;MOUSEKEYS=28:28
;;MSG=48:28
;;MULTI_QI=24:12
;;NONCLIENTMETRICS=504:504
;;NOTIFYICONDATA=976:956
;;OPENFILENAMEW=152:88
;;OSVERSIONINFOEX=284:284
;;OVERLAPPED=32:20
;;PALETTEENTRY=4:4
;;POINT=8:8
;;PROCESS_INFORMATION=24:16
;;RECT=16:16
;;RGBQUAD=4:4
;;SECURITY_ATTRIBUTES=24:12
;;SHARDAPPIDINFOLINK=16:8
;;SHELLEXECUTEINFO=112:60
;;SHFILEINFO=696:692
;;SHITEMID=3:3
;;SHQUERYRBINFO=24:20
;;SIZE=8:8
;;SOUNDSENTRY=56:48
;;STARTUPINFO=104:68
;;STARTUPINFOEX=112:72
;;STICKYKEYS=8:8
;;STRRET=272:264
;;SYSTEMTIME=16:16
;;TBBUTTON=32:20
;;TBBUTTONINFO=48:32
;;TCITEM=40:28
;;THREADENTRY32=28:28
;;TIME_ZONE_INFORMATION=172:172
;;TOGGLEKEYS=8:8
;;TOKEN_PRIVILEGES=16:16
;;TPMPARAMS=20:20
;;TVITEM=56:40
;;VARIANT=24:16
;;VS_FIXEDFILEINFO=52:52
;;WCRANGE=4:4
;;WIN32_FIND_DATA=592:592
;;WINDOWINFO=60:60
;;WNDCLASS=72:40
;;WNDCLASSEX=80:48
;;WSADATA=408:400

==================================================

;;ACCEL=6:6

		typedef struct tagACCEL {
0:0, "UChar"	  BYTE fVirt;
2:2, "UShort"	  WORD key;
4:4, "UShort"	  WORD cmd;
		} ACCEL, *LPACCEL;
6:6

==================================================

;;ACCESSTIMEOUT=12:12

		typedef struct tagACCESSTIMEOUT {
0:0, "UInt"	  UINT  cbSize;
4:4, "UInt"	  DWORD dwFlags;
8:8, "UInt"	  DWORD iTimeOutMSec;
		} ACCESSTIMEOUT, *LPACCESSTIMEOUT;
12:12, "UInt"

==================================================

;;ANIMATIONINFO=8:8

		typedef struct tagANIMATIONINFO {
0:0, "UInt"	  UINT cbSize;
4:4, "Int"	  int  iMinAnimate;
		} ANIMATIONINFO, *LPANIMATIONINFO;
8:8, "Int"

==================================================

;;API_VERSION=8:8

		typedef struct API_VERSION {
0:0, "UShort"	  USHORT MajorVersion;
2:2, "UShort"	  USHORT MinorVersion;
4:4, "UShort"	  USHORT Revision;
6:6, "UShort"	  USHORT Reserved;
		} API_VERSION, *LPAPI_VERSION;
8:8

==================================================

;;AUDIODESCRIPTION=12:12

		typedef struct tagAUDIODESCRIPTION {
0:0, "UInt"	  UINT cbSize;
4:4, "Int"	  BOOL Enabled;
8:8, "UInt"	  LCID Locale;
		} AUDIODESCRIPTION, *LPAUDIODESCRIPTION;
12:12

==================================================

;;BIND_OPTS=16:16

		typedef struct tagBIND_OPTS {
0:0, "UInt"	  DWORD cbStruct;
4:4, "UInt"	  DWORD grfFlags;
8:8, "UInt"	  DWORD grfMode;
12:12, "UInt"	  DWORD dwTickCountDeadline;
		} BIND_OPTS, *LPBIND_OPTS;
16:16

==================================================

;;BITMAP=32:24

		typedef struct tagBITMAP {
0:0, "Int"	  LONG   bmType;
4:4, "Int"	  LONG   bmWidth;
8:8, "Int"	  LONG   bmHeight;
12:12, "Int"	  LONG   bmWidthBytes;
16:16, "UShort"	  WORD   bmPlanes;
18:18, "UShort"	  WORD   bmBitsPixel;
24:20, "Ptr"	  LPVOID bmBits;
		} BITMAP, *PBITMAP;
32:24

==================================================

;;BITMAPINFO=44:44

		typedef struct tagBITMAPINFO {
0:0, "ERROR"	  BITMAPINFOHEADER bmiHeader;
40:40, "ERROR"	  RGBQUAD          bmiColors[1];
		} BITMAPINFO, *PBITMAPINFO;
48:44

==================================================

;;BITMAPINFOHEADER=40:40

		typedef struct tagBITMAPINFOHEADER {
0:0, "UInt"	  DWORD biSize;
4:4, "Int"	  LONG  biWidth;
8:8, "Int"	  LONG  biHeight;
12:12, "UShort"	  WORD  biPlanes;
14:14, "UShort"	  WORD  biBitCount;
16:16, "UInt"	  DWORD biCompression;
20:20, "UInt"	  DWORD biSizeImage;
24:24, "Int"	  LONG  biXPelsPerMeter;
28:28, "Int"	  LONG  biYPelsPerMeter;
32:32, "UInt"	  DWORD biClrUsed;
36:36, "UInt"	  DWORD biClrImportant;
		} BITMAPINFOHEADER, *PBITMAPINFOHEADER;
40:40

==================================================

;;BLENDFUNCTION=4:4

		typedef struct _BLENDFUNCTION {
0:0, "UChar"	  BYTE BlendOp;
1:1, "UChar"	  BYTE BlendFlags;
2:2, "UChar"	  BYTE SourceConstantAlpha;
3:3, "UChar"	  BYTE AlphaFormat;
		} BLENDFUNCTION, *PBLENDFUNCTION, *LPBLENDFUNCTION;
4:4

==================================================

;;CHARFORMAT2=116:116

typedef struct _charformat2 {
  UINT     cbSize;
  DWORD    dwMask;
  DWORD    dwEffects;
  LONG     yHeight;
  LONG     yOffset;
  COLORREF crTextColor;
  BYTE     bCharSet;
  BYTE     bPitchAndFamily;
  TCHAR    szFaceName[LF_FACESIZE];
  WORD     wWeight;
  SHORT    sSpacing;
  COLORREF crBackColor;
  LCID     lcid;
#if (_RICHEDIT_VER >= 0x0500)
  union {
    DWORD dwReserved;
    DWORD dwCookie;
  };
#else
  DWORD    dwReserved;
#endif
  SHORT    sStyle;
  WORD     wKerning;
  BYTE     bUnderlineType;
  BYTE     bAnimation;
  BYTE     bRevAuthor;
#if (_RICHEDIT_VER >= 0x0800)
  BYTE     bUnderlineColor;
#endif
} CHARFORMAT2;
[CHECK]

==================================================

;;CLIENTCREATESTRUCT=16:8

		typedef struct tagCLIENTCREATESTRUCT {
0:0, "Ptr"	  HANDLE hWindowMenu;
8:4, "UInt"	  UINT   idFirstChild;
		} CLIENTCREATESTRUCT, *LPCLIENTCREATESTRUCT;
16:8

==================================================

;;COMBOBOXINFO=64:52

		typedef struct tagCOMBOBOXINFO {
0:0, "UInt"	  DWORD cbSize;
4:4, "ERROR"	  RECT  rcItem;
20:20, "ERROR"	  RECT  rcButton;
36:36, "UInt"	  DWORD stateButton;
40:40, "Ptr"	  HWND  hwndCombo;
48:44, "Ptr"	  HWND  hwndItem;
56:48, "Ptr"	  HWND  hwndList;
		} COMBOBOXINFO, *PCOMBOBOXINFO, *LPCOMBOBOXINFO;
64:52

==================================================

;;COPYDATASTRUCT=24:12

		typedef struct tagCOPYDATASTRUCT {
0:0, "UPtr"	  ULONG_PTR dwData;
8:4, "UInt"	  DWORD     cbData;
16:8, "Ptr"	  PVOID     lpData;
		} COPYDATASTRUCT, *PCOPYDATASTRUCT;
24:12

==================================================

;;COSERVERINFO=32:16

		typedef struct _COSERVERINFO {
0:0, "UInt"	  DWORD      dwReserved1;
8:4, "Ptr"	  LPWSTR     pwszName;
16:8, "Ptr"	  COAUTHINFO *pAuthInfo;
24:12, "UInt"	  DWORD      dwReserved2;
		} COSERVERINFO;
32:16

==================================================

;;CREATESTRUCT=80:48

		typedef struct tagCREATESTRUCT {
0:0, "Ptr"	  LPVOID    lpCreateParams;
8:4, "Ptr"	  HINSTANCE hInstance;
16:8, "Ptr"	  HMENU     hMenu;
24:12, "Ptr"	  HWND      hwndParent;
32:16, "Int"	  int       cy;
36:20, "Int"	  int       cx;
40:24, "Int"	  int       y;
44:28, "Int"	  int       x;
48:32, "Int"	  LONG      style;
56:36, "Ptr"	  LPCTSTR   lpszName;
64:40, "Ptr"	  LPCTSTR   lpszClass;
72:44, "UInt"	  DWORD     dwExStyle;
		} CREATESTRUCT, *LPCREATESTRUCT;
80:48

==================================================

;;CURSORINFO=24:20

		typedef struct {
0:0, "UInt"	  DWORD   cbSize;
4:4, "UInt"	  DWORD   flags;
8:8, "Ptr"	  HCURSOR hCursor;
16:12, "ERROR"	  POINT   ptScreenPos;
		} CURSORINFO, *PCURSORINFO, *LPCURSORINFO;
24:20

==================================================

;;DEVMODE=220:220

typedef struct _devicemode {
  TCHAR dmDeviceName[CCHDEVICENAME];
  WORD  dmSpecVersion;
  WORD  dmDriverVersion;
  WORD  dmSize;
  WORD  dmDriverExtra;
  DWORD dmFields;
  union {
    struct {
      short dmOrientation;
      short dmPaperSize;
      short dmPaperLength;
      short dmPaperWidth;
      short dmScale;
      short dmCopies;
      short dmDefaultSource;
      short dmPrintQuality;
    };
    struct {
      POINTL dmPosition;
      DWORD  dmDisplayOrientation;
      DWORD  dmDisplayFixedOutput;
    };
  };
  short dmColor;
  short dmDuplex;
  short dmYResolution;
  short dmTTOption;
  short dmCollate;
  TCHAR dmFormName[CCHFORMNAME];
  WORD  dmLogPixels;
  DWORD dmBitsPerPel;
  DWORD dmPelsWidth;
  DWORD dmPelsHeight;
  union {
    DWORD dmDisplayFlags;
    DWORD dmNup;
  };
  DWORD dmDisplayFrequency;
#if (WINVER >= 0x0400)
  DWORD dmICMMethod;
  DWORD dmICMIntent;
  DWORD dmMediaType;
  DWORD dmDitherType;
  DWORD dmReserved1;
  DWORD dmReserved2;
#if (WINVER >= 0x0500) || (_WIN32_WINNT >= 0x0400)
  DWORD dmPanningWidth;
  DWORD dmPanningHeight;
#endif
#endif
} DEVMODE, *PDEVMODE, *LPDEVMODE;

==================================================

;;DIBSECTION=104:84

		typedef struct tagDIBSECTION {
0:0, "ERROR"	  BITMAP           dsBm;
32:24, "ERROR"	  BITMAPINFOHEADER dsBmih;
72:64, "ERROR"	  DWORD            dsBitfields[3];
88:76, "Ptr"	  HANDLE           dshSection;
96:80, "UInt"	  DWORD            dsOffset;
		} DIBSECTION, *PDIBSECTION;
104:84

==================================================

;;DISPLAY_DEVICE=840:840

		typedef struct _DISPLAY_DEVICE {
0:0, "UInt"	  DWORD cb;
4:4, "ERROR"	  TCHAR DeviceName[32];
68:68, "ERROR"	  TCHAR DeviceString[128];
324:324, "UInt"	  DWORD StateFlags;
328:328, "ERROR"	  TCHAR DeviceID[128];
584:584, "ERROR"	  TCHAR DeviceKey[128];
		} DISPLAY_DEVICE, *PDISPLAY_DEVICE;
840:840

==================================================

;;DISPPARAMS=24:16

		typedef struct tagDISPPARAMS {
0:0, "Ptr"	  VARIANTARG *rgvarg;
8:4, "Ptr"	  DISPID     *rgdispidNamedArgs;
16:8, "UInt"	  UINT       cArgs;
20:12, "UInt"	  UINT       cNamedArgs;
		} DISPPARAMS;
24:16

==================================================

;;DLLVERSIONINFO2=32:32

		typedef struct _DLLVERSIONINFO2 {
0:0, "ERROR"	  DLLVERSIONINFO info1;
20:20, "UInt"	  DWORD          dwFlags;
24:24, "Int64"	  ULONGLONG      ullVersion;
		} DLLVERSIONINFO2;
32:32

==================================================

;;DLLVERSIONINFO=20:20

		typedef struct _DllVersionInfo {
0:0, "UInt"	  DWORD cbSize;
4:4, "UInt"	  DWORD dwMajorVersion;
8:8, "UInt"	  DWORD dwMinorVersion;
12:12, "UInt"	  DWORD dwBuildNumber;
16:16, "UInt"	  DWORD dwPlatformID;
		} DLLVERSIONINFO;
20:20

==================================================

;;DRAWTEXTPARAMS=20:20

		typedef struct {
0:0, "UInt"	  UINT cbSize;
4:4, "Int"	  int  iTabLength;
8:8, "Int"	  int  iLeftMargin;
12:12, "Int"	  int  iRightMargin;
16:16, "UInt"	  UINT uiLengthDrawn;
		} DRAWTEXTPARAMS, *LPDRAWTEXTPARAMS;
20:20

==================================================

;;FILETIME=8:8

		typedef struct _FILETIME {
0:0, "UInt"	  DWORD dwLowDateTime;
4:4, "UInt"	  DWORD dwHighDateTime;
		} FILETIME, *PFILETIME;
8:8

==================================================

;;FILTERKEYS=24:24

		typedef struct tagFILTERKEYS {
0:0, "UInt"	  UINT  cbSize;
4:4, "UInt"	  DWORD dwFlags;
8:8, "UInt"	  DWORD iWaitMSec;
12:12, "UInt"	  DWORD iDelayMSec;
16:16, "UInt"	  DWORD iRepeatMSec;
20:20, "UInt"	  DWORD iBounceMSec;
		} FILTERKEYS, *LPFILTERKEYS;
24:24

==================================================

;;GLYPHSET=20:20

		typedef struct tagGLYPHSET {
0:0, "UInt"	  DWORD   cbThis;
4:4, "UInt"	  DWORD   flAccel;
8:8, "UInt"	  DWORD   cGlyphsSupported;
12:12, "UInt"	  DWORD   cRanges;
16:16, "ERROR"	  WCRANGE ranges[1];
		} GLYPHSET, *PGLYPHSET;
20:20

==================================================

;;GOPHER_FIND_DATA=1588:1588

typedef struct {
  TCHAR    DisplayString[MAX_GOPHER_DISPLAY_TEXT + 1];
  DWORD    GopherType;
  DWORD    SizeLow;
  DWORD    SizeHigh;
  FILETIME LastModificationTime;
  TCHAR    Locator[MAX_GOPHER_LOCATOR_LENGTH + 1];
} GOPHER_FIND_DATA, *LPGOPHER_FIND_DATA;
[CHECK]

==================================================

;;GUID=16:16

		typedef struct _GUID {
0:0, "UInt"	  DWORD Data1;
4:4, "UShort"	  WORD  Data2;
6:6, "UShort"	  WORD  Data3;
8:8, "ERROR"	  BYTE  Data4[8];
		} GUID;
16:16

==================================================

;;GUITHREADINFO=72:48

		typedef struct tagGUITHREADINFO {
0:0, "UInt"	  DWORD cbSize;
4:4, "UInt"	  DWORD flags;
8:8, "Ptr"	  HWND  hwndActive;
16:12, "Ptr"	  HWND  hwndFocus;
24:16, "Ptr"	  HWND  hwndCapture;
32:20, "Ptr"	  HWND  hwndMenuOwner;
40:24, "Ptr"	  HWND  hwndMoveSize;
48:28, "Ptr"	  HWND  hwndCaret;
56:32, "ERROR"	  RECT  rcCaret;
		} GUITHREADINFO, *PGUITHREADINFO;
72:48

==================================================

;;HDITEM=72:48

		typedef struct _HDITEM {
0:0, "UInt"	  UINT    mask;
4:4, "Int"	  int     cxy;
8:8, "Ptr"	  LPTSTR  pszText;
16:12, "Ptr"	  HBITMAP hbm;
24:16, "Int"	  int     cchTextMax;
28:20, "Int"	  int     fmt;
32:24, "Ptr"	  LPARAM  lParam;
		#if (_WIN32_IE >= 0x0300)
40:28, "Int"	  int     iImage;
44:32, "Int"	  int     iOrder;
		#endif
		#if (_WIN32_IE >= 0x0500)
48:36, "UInt"	  UINT    type;
56:40, "Ptr"	  void    *pvFilter;
		#endif
		#if (_WIN32_WINNT >= 0x0600)
64:44, "UInt"	  UINT    state;
		#endif
		} HDITEM, *LPHDITEM;
72:48

==================================================

;;HIGHCONTRAST=16:12

		typedef struct tagHIGHCONTRAST {
0:0, "UInt"	  UINT   cbSize;
4:4, "UInt"	  DWORD  dwFlags;
8:8, "Ptr"	  LPTSTR lpszDefaultScheme;
		} HIGHCONTRAST, *LPHIGHCONTRAST;
16:12

==================================================

;;ICONINFO=32:20

		typedef struct _ICONINFO {
0:0, "Int"	  BOOL    fIcon;
4:4, "UInt"	  DWORD   xHotspot;
8:8, "UInt"	  DWORD   yHotspot;
16:12, "Ptr"	  HBITMAP hbmMask;
24:16, "Ptr"	  HBITMAP hbmColor;
		} ICONINFO, *PICONINFO;
32:20

==================================================

;;ICONMETRICS=108:108

		typedef struct tagICONMETRICS {
0:0, "UInt"	  UINT    cbSize;
4:4, "Int"	  int     iHorzSpacing;
8:8, "Int"	  int     iVertSpacing;
12:12, "Int"	  int     iTitleWrap;
16:16, "ERROR"	  LOGFONT lfFont;
		} ICONMETRICS, *PICONMETRICS, *LPICONMETRICS;
108:108

==================================================

;;IMAGELISTDRAWPARAMS=88:68

		typedef struct _IMAGELISTDRAWPARAMS {
0:0, "UInt"	  DWORD      cbSize;
8:4, "Ptr"	  HIMAGELIST himl;
16:8, "Int"	  int        i;
24:12, "Ptr"	  HDC        hdcDst;
32:16, "Int"	  int        x;
36:20, "Int"	  int        y;
40:24, "Int"	  int        cx;
44:28, "Int"	  int        cy;
48:32, "Int"	  int        xBitmap;
52:36, "Int"	  int        yBitmap;
56:40, "UInt"	  COLORREF   rgbBk;
60:44, "UInt"	  COLORREF   rgbFg;
64:48, "UInt"	  UINT       fStyle;
68:52, "UInt"	  DWORD      dwRop;
72:56, "UInt"	  DWORD      fState;
76:60, "UInt"	  DWORD      Frame;
80:64, "UInt"	  DWORD      crEffect;
		} IMAGELISTDRAWPARAMS;
88:68

==================================================

;;IN6_ADDR=16:16
typedef struct in6_addr {
  union {
    u_char  Byte[16];
    u_short Word[8];
  } u;
} IN6_ADDR, *PIN6_ADDR, FAR *LPIN6_ADDR;
[CHECK]

==================================================

;;IN_ADDR=4:4

typedef struct in_addr {
  union {
    struct {
      u_char s_b1,s_b2,s_b3,s_b4;
    } S_un_b;
    struct {
      u_short s_w1,s_w2;
    } S_un_w;
    u_long S_addr;
  } S_un;
} IN_ADDR, *PIN_ADDR, FAR *LPIN_ADDR;
[CHECK]

==================================================

;;INITCOMMONCONTROLSEX=8:8

		typedef struct tagINITCOMMONCONTROLSEX {
0:0, "UInt"	  DWORD dwSize;
4:4, "UInt"	  DWORD dwICC;
		} INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
8:8

==================================================

;;ITEMIDLIST=3:3

		typedef struct _ITEMIDLIST {
0:0, "ERROR"	  SHITEMID mkid;
		} ITEMIDLIST;
3:3

==================================================

;;LIST_ENTRY=16:8

		typedef struct _LIST_ENTRY {
0:0, "Ptr"	  struct _LIST_ENTRY  *Flink;
8:4, "Ptr"	  struct _LIST_ENTRY  *Blink;
		} LIST_ENTRY, *PLIST_ENTRY;
16:8

==================================================

;;LOADED_IMAGE=88:48

		typedef struct _LOADED_IMAGE {
0:0, "Ptr"	  PSTR                  ModuleName;
8:4, "Ptr"	  HANDLE                hFile;
16:8, "Ptr"	  PUCHAR                MappedAddress;
24:12, "Ptr"	  PIMAGE_NT_HEADERS32   FileHeader;
32:16, "Ptr"	  PIMAGE_SECTION_HEADER LastRvaSection;
40:20, "UInt"	  ULONG                 NumberOfSections;
44:24, "Ptr"	  PIMAGE_SECTION_HEADER Sections;
52:28, "UInt"	  ULONG                 Characteristics;
56:32, "UChar"	  BOOLEAN               fSystemImage;
57:33, "UChar"	  BOOLEAN               fDOSImage;
58:34, "UChar"	  BOOLEAN               fReadOnly;
59:35, "UChar"	  UCHAR                 Version;
60:36, "ERROR"	  LIST_ENTRY            Links;
76:44, "UInt"	  ULONG                 SizeOfImage;
		} LOADED_IMAGE, *PLOADED_IMAGE;
80:48

==================================================

;;LOGFONT=92:92

		typedef struct tagLOGFONT {
0:0, "Int"	  LONG  lfHeight;
4:4, "Int"	  LONG  lfWidth;
8:8, "Int"	  LONG  lfEscapement;
12:12, "Int"	  LONG  lfOrientation;
16:16, "Int"	  LONG  lfWeight;
20:20, "UChar"	  BYTE  lfItalic;
21:21, "UChar"	  BYTE  lfUnderline;
22:22, "UChar"	  BYTE  lfStrikeOut;
23:23, "UChar"	  BYTE  lfCharSet;
24:24, "UChar"	  BYTE  lfOutPrecision;
25:25, "UChar"	  BYTE  lfClipPrecision;
26:26, "UChar"	  BYTE  lfQuality;
27:27, "UChar"	  BYTE  lfPitchAndFamily;
28:28, "ERROR"	  TCHAR lfFaceName[LF_FACESIZE];
		} LOGFONT, *PLOGFONT;
92:92

==================================================

;;LOGFONTA=60:60

typedef struct {
            lfHeight;
            lfWidth;
            lfEscapement;
            lfOrientation;
            lfWeight;
  BYTE      lfItalic;
  BYTE      lfUnderline;
  BYTE      lfStrikeOut;
  BYTE      lfCharSet;
  BYTE      lfOutPrecision;
  BYTE      lfClipPrecision;
  BYTE      lfQuality;
  BYTE      lfPitchAndFamily;
  __wchar_t lfFaceName[LF_FACESIZE];
} LOGFONTA;
[CHECK]

==================================================

;;LOGFONTW=92:92

typedef struct {
        lfHeight;
        lfWidth;
        lfEscapement;
        lfOrientation;
        lfWeight;
  BYTE  lfItalic;
  BYTE  lfUnderline;
  BYTE  lfStrikeOut;
  BYTE  lfCharSet;
  BYTE  lfOutPrecision;
  BYTE  lfClipPrecision;
  BYTE  lfQuality;
  BYTE  lfPitchAndFamily;
  WCHAR lfFaceName[LF_FACESIZE];
} LOGFONTW;
[CHECK]

==================================================

;;LOGPALETTE=8:8

		typedef struct tagLOGPALETTE {
0:0, "UShort"	  WORD         palVersion;
2:2, "UShort"	  WORD         palNumEntries;
4:4, "ERROR"	  PALETTEENTRY palPalEntry[1];
		} LOGPALETTE;
8:8

==================================================

;;LOGPEN=16:16

		typedef struct tagLOGPEN {
0:0, "UInt"	  UINT     lopnStyle;
4:4, "ERROR"	  POINT    lopnWidth;
12:12, "UInt"	  COLORREF lopnColor;
		} LOGPEN, *PLOGPEN;
16:16

==================================================

;;LVITEM=88:60

		typedef struct {
0:0, "UInt"	  UINT   mask;
4:4, "Int"	  int    iItem;
8:8, "Int"	  int    iSubItem;
12:12, "UInt"	  UINT   state;
16:16, "UInt"	  UINT   stateMask;
24:20, "Ptr"	  LPTSTR pszText;
32:24, "Int"	  int    cchTextMax;
36:28, "Int"	  int    iImage;
40:32, "Ptr"	  LPARAM lParam;
		#if (_WIN32_IE >= 0x0300)
48:36, "Int"	  int    iIndent;
		#endif
		#if (_WIN32_WINNT >= 0x0501)
52:40, "Int"	  int    iGroupId;
56:44, "UInt"	  UINT   cColumns;
64:48, "Ptr"	  PUINT  puColumns;
		#endif
		#if (_WIN32_WINNT >= 0x0600)
72:52, "Ptr"	  int    *piColFmt;
80:56, "Int"	  int    iGroup;
		#endif
		} LVITEM, *LPLVITEM;
88:60

==================================================

;;MDICREATESTRUCT=56:36

		typedef struct tagMDICREATESTRUCT {
0:0, "Ptr"	  LPCTSTR szClass;
8:4, "Ptr"	  LPCTSTR szTitle;
16:8, "Ptr"	  HANDLE  hOwner;
24:12, "Int"	  int     x;
28:16, "Int"	  int     y;
32:20, "Int"	  int     cx;
36:24, "Int"	  int     cy;
40:28, "UInt"	  DWORD   style;
48:32, "Ptr"	  LPARAM  lParam;
		} MDICREATESTRUCT, *LPMDICREATESTRUCT;
56:36

==================================================

;;MEMORY_BASIC_INFORMATION=48:28

		typedef struct _MEMORY_BASIC_INFORMATION {
0:0, "Ptr"	  PVOID  BaseAddress;
8:4, "Ptr"	  PVOID  AllocationBase;
16:8, "UInt"	  DWORD  AllocationProtect;
24:12, "UPtr"	  SIZE_T RegionSize;
32:16, "UInt"	  DWORD  State;
36:20, "UInt"	  DWORD  Protect;
40:24, "UInt"	  DWORD  Type;
		} MEMORY_BASIC_INFORMATION, *PMEMORY_BASIC_INFORMATION;
48:28

==================================================

;;MENUBARINFO=48:32
;[note: the definition at MSDN is incorrect, the 2 BOOLs form 1 parameter]

		typedef struct tagMENUBARINFO {
0:0, "UInt"	  DWORD cbSize;
4:4, "ERROR"	  RECT  rcBar;
24:20, "Ptr"	  HMENU hMenu;
32:24, "Ptr"	  HWND  hwndMenu;
40:28, "Int"	  BOOL  fBarFocused;
		  BOOL  fFocused;
		} MENUBARINFO, *PMENUBARINFO;
48:32

==================================================

;;MENUINFO=40:28

		typedef struct tagMENUINFO {
0:0, "UInt"	  DWORD     cbSize;
4:4, "UInt"	  DWORD     fMask;
8:8, "UInt"	  DWORD     dwStyle;
12:12, "UInt"	  UINT      cyMax;
16:16, "Ptr"	  HBRUSH    hbrBack;
24:20, "UInt"	  DWORD     dwContextHelpID;
32:24, "UPtr"	  ULONG_PTR dwMenuData;
		} MENUINFO, *LPMENUINFO, const *LPCMENUINFO;
40:28

==================================================

;;MENUITEMINFO=80:48

		typedef struct tagMENUITEMINFO {
0:0, "UInt"	  UINT      cbSize;
4:4, "UInt"	  UINT      fMask;
8:8, "UInt"	  UINT      fType;
12:12, "UInt"	  UINT      fState;
16:16, "UInt"	  UINT      wID;
24:20, "Ptr"	  HMENU     hSubMenu;
32:24, "Ptr"	  HBITMAP   hbmpChecked;
40:28, "Ptr"	  HBITMAP   hbmpUnchecked;
48:32, "UPtr"	  ULONG_PTR dwItemData;
56:36, "Ptr"	  LPTSTR    dwTypeData;
64:40, "UInt"	  UINT      cch;
72:44, "Ptr"	  HBITMAP   hbmpItem;
		} MENUITEMINFO, *LPMENUITEMINFO;
80:48

==================================================

;;MINIMIZEDMETRICS=20:20

		typedef struct tagMINIMIZEDMETRICS {
0:0, "UInt"	  UINT cbSize;
4:4, "Int"	  int  iWidth;
8:8, "Int"	  int  iHorzGap;
12:12, "Int"	  int  iVertGap;
16:16, "Int"	  int  iArrange;
		} MINIMIZEDMETRICS, *PMINIMIZEDMETRICS, *LPMINIMIZEDMETRICS;
20:20

==================================================

;;MODULEENTRY32=1080:1064

typedef struct tagMODULEENTRY32 {
  DWORD   dwSize;
  DWORD   th32ModuleID;
  DWORD   th32ProcessID;
  DWORD   GlblcntUsage;
  DWORD   ProccntUsage;
  BYTE    *modBaseAddr;
  DWORD   modBaseSize;
  HMODULE hModule;
  TCHAR   szModule[MAX_MODULE_NAME32 + 1];
  TCHAR   szExePath[MAX_PATH];
} MODULEENTRY32, *PMODULEENTRY32;
[CHECK]

==================================================

;;MONITORINFOEX=104:104

typedef struct tagMONITORINFOEX {
  DWORD cbSize;
  RECT  rcMonitor;
  RECT  rcWork;
  DWORD dwFlags;
  TCHAR szDevice[CCHDEVICENAME];
} MONITORINFOEX, *LPMONITORINFOEX;
[CHECK]

==================================================

;;MOUSEKEYS=28:28

		typedef struct _MOUSEKEYS {
0:0, "UInt"	  DWORD cbSize;
4:4, "UInt"	  DWORD dwFlags;
8:8, "UInt"	  DWORD iMaxSpeed;
12:12, "UInt"	  DWORD iTimeToMaxSpeed;
16:16, "UInt"	  DWORD iCtrlSpeed;
20:20, "UInt"	  DWORD dwReserved1;
24:24, "UInt"	  DWORD dwReserved2;
		} MOUSEKEYS, *LPMOUSEKEYS;
28:28

==================================================

;;MSG=48:28

		typedef struct tagMSG {
0:0, "Ptr"	  HWND   hwnd;
8:4, "UInt"	  UINT   message;
16:8, "UPtr"	  WPARAM wParam;
24:12, "Ptr"	  LPARAM lParam;
32:16, "UInt"	  DWORD  time;
36:20, "ERROR"	  POINT  pt;
		} MSG, *PMSG, *LPMSG;
48:28

==================================================

;;MULTI_QI=24:12

		typedef struct tagMULTI_QI {
0:0, "Ptr"	  const IID *pIID;
8:4, "Ptr"	  IUnknown  *pItf;
16:8, "Int"	  HRESULT   hr;
		} MULTI_QI;
24:12

==================================================

;;NONCLIENTMETRICS=504:504

		typedef struct tagNONCLIENTMETRICS {
0:0, "UInt"	  UINT    cbSize;
4:4, "Int"	  int     iBorderWidth;
8:8, "Int"	  int     iScrollWidth;
12:12, "Int"	  int     iScrollHeight;
16:16, "Int"	  int     iCaptionWidth;
20:20, "Int"	  int     iCaptionHeight;
24:24, "ERROR"	  LOGFONT lfCaptionFont;
116:116, "Int"	  int     iSmCaptionWidth;
120:120, "Int"	  int     iSmCaptionHeight;
124:124, "ERROR"	  LOGFONT lfSmCaptionFont;
216:216, "Int"	  int     iMenuWidth;
220:220, "Int"	  int     iMenuHeight;
224:224, "ERROR"	  LOGFONT lfMenuFont;
316:316, "ERROR"	  LOGFONT lfStatusFont;
408:408, "ERROR"	  LOGFONT lfMessageFont;
		#if (WINVER >= 0x0600)
500:500, "Int"	  int     iPaddedBorderWidth;
		#endif
		} NONCLIENTMETRICS, *PNONCLIENTMETRICS, *LPNONCLIENTMETRICS;
504:504

==================================================

;;NOTIFYICONDATA=976:956

typedef struct _NOTIFYICONDATA {
  DWORD cbSize;
  HWND  hWnd;
  UINT  uID;
  UINT  uFlags;
  UINT  uCallbackMessage;
  HICON hIcon;
  TCHAR szTip[64];
  DWORD dwState;
  DWORD dwStateMask;
  TCHAR szInfo[256];
  union {
    UINT uTimeout;
    UINT uVersion;
  };
  TCHAR szInfoTitle[64];
  DWORD dwInfoFlags;
  GUID  guidItem;
  HICON hBalloonIcon;
} NOTIFYICONDATA, *PNOTIFYICONDATA;
[CHECK]

==================================================

;;OPENFILENAMEW=152:88

		typedef struct tagOFN {
0:0, "UInt"	  DWORD         lStructSize;
8:4, "Ptr"	  HWND          hwndOwner;
16:8, "Ptr"	  HINSTANCE     hInstance;
24:12, "Ptr"	  LPCTSTR       lpstrFilter;
32:16, "Ptr"	  LPTSTR        lpstrCustomFilter;
40:20, "UInt"	  DWORD         nMaxCustFilter;
44:24, "UInt"	  DWORD         nFilterIndex;
48:28, "Ptr"	  LPTSTR        lpstrFile;
56:32, "UInt"	  DWORD         nMaxFile;
64:36, "Ptr"	  LPTSTR        lpstrFileTitle;
72:40, "UInt"	  DWORD         nMaxFileTitle;
80:44, "Ptr"	  LPCTSTR       lpstrInitialDir;
88:48, "Ptr"	  LPCTSTR       lpstrTitle;
96:52, "UInt"	  DWORD         Flags;
100:56, "UShort"	  WORD          nFileOffset;
102:58, "UShort"	  WORD          nFileExtension;
104:60, "Ptr"	  LPCTSTR       lpstrDefExt;
112:64, "Ptr"	  LPARAM        lCustData;
120:68, "Ptr"	  LPOFNHOOKPROC lpfnHook;
128:72, "Ptr"	  LPCTSTR       lpTemplateName;
		#if (_WIN32_WINNT >= 0x0500)
136:76, "Ptr"	  void          *pvReserved;
144:80, "UInt"	  DWORD         dwReserved;
148:84, "UInt"	  DWORD         FlagsEx;
		#endif
		} OPENFILENAME, *LPOPENFILENAME;
152:88

==================================================

;;OSVERSIONINFOEX=284:284

		typedef struct _OSVERSIONINFOEX {
0:0, "UInt"	  DWORD dwOSVersionInfoSize;
4:4, "UInt"	  DWORD dwMajorVersion;
8:8, "UInt"	  DWORD dwMinorVersion;
12:12, "UInt"	  DWORD dwBuildNumber;
16:16, "UInt"	  DWORD dwPlatformId;
20:20, "ERROR"	  TCHAR szCSDVersion[128];
276:276, "UShort"	  WORD  wServicePackMajor;
278:278, "UShort"	  WORD  wServicePackMinor;
280:280, "UShort"	  WORD  wSuiteMask;
282:282, "UChar"	  BYTE  wProductType;
283:283, "UChar"	  BYTE  wReserved;
		} OSVERSIONINFOEX, *POSVERSIONINFOEX, *LPOSVERSIONINFOEX;
284:284

==================================================

;;OVERLAPPED=32:20

typedef struct _OVERLAPPED {
  ULONG_PTR Internal;
  ULONG_PTR InternalHigh;
  union {
    struct {
      DWORD Offset;
      DWORD OffsetHigh;
    };
    PVOID  Pointer;
  };
  HANDLE    hEvent;
} OVERLAPPED, *LPOVERLAPPED;
[CHECK]

==================================================

;;PALETTEENTRY=4:4

		typedef struct tagPALETTEENTRY {
0:0, "UChar"	  BYTE peRed;
1:1, "UChar"	  BYTE peGreen;
2:2, "UChar"	  BYTE peBlue;
3:3, "UChar"	  BYTE peFlags;
		} PALETTEENTRY;
4:4

==================================================

;;POINT=8:8

		typedef struct tagPOINT {
0:0, "Int"	  LONG x;
4:4, "Int"	  LONG y;
		} POINT, *PPOINT;
8:8

==================================================

;;PROCESS_INFORMATION=24:16

		typedef struct _PROCESS_INFORMATION {
0:0, "Ptr"	  HANDLE hProcess;
8:4, "Ptr"	  HANDLE hThread;
16:8, "UInt"	  DWORD  dwProcessId;
20:12, "UInt"	  DWORD  dwThreadId;
		} PROCESS_INFORMATION, *LPPROCESS_INFORMATION;
24:16

==================================================

;;RECT=16:16

		typedef struct _RECT {
0:0, "Int"	  LONG left;
4:4, "Int"	  LONG top;
8:8, "Int"	  LONG right;
12:12, "Int"	  LONG bottom;
		} RECT, *PRECT;
16:16

==================================================

;;RGBQUAD=4:4

		typedef struct tagRGBQUAD {
0:0, "UChar"	  BYTE rgbBlue;
1:1, "UChar"	  BYTE rgbGreen;
2:2, "UChar"	  BYTE rgbRed;
3:3, "UChar"	  BYTE rgbReserved;
		} RGBQUAD;
4:4

==================================================

;;SECURITY_ATTRIBUTES=24:12

		typedef struct _SECURITY_ATTRIBUTES {
0:0, "UInt"	  DWORD  nLength;
8:4, "Ptr"	  LPVOID lpSecurityDescriptor;
16:8, "Int"	  BOOL   bInheritHandle;
		} SECURITY_ATTRIBUTES, *PSECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
24:12

==================================================

;;SHARDAPPIDINFOLINK=16:8

		typedef struct SHARDAPPIDINFOLINK {
0:0, "Ptr"	  IShellLink *psl;
8:4, "Ptr"	  PCWSTR     pszAppID;
		} SHARDAPPIDINFOLINK;
16:8

==================================================

;;SHELLEXECUTEINFO=112:60

typedef struct _SHELLEXECUTEINFO {
  DWORD     cbSize;
  ULONG     fMask;
  HWND      hwnd;
  LPCTSTR   lpVerb;
  LPCTSTR   lpFile;
  LPCTSTR   lpParameters;
  LPCTSTR   lpDirectory;
  int       nShow;
  HINSTANCE hInstApp;
  LPVOID    lpIDList;
  LPCTSTR   lpClass;
  HKEY      hkeyClass;
  DWORD     dwHotKey;
  union {
    HANDLE hIcon;
    HANDLE hMonitor;
  } DUMMYUNIONNAME;
  HANDLE    hProcess;
} SHELLEXECUTEINFO, *LPSHELLEXECUTEINFO;
[CHECK]

==================================================

;;SHFILEINFO=696:692

		typedef struct _SHFILEINFO {
0:0, "Ptr"	  HICON hIcon;
8:4, "Int"	  int   iIcon;
12:8, "UInt"	  DWORD dwAttributes;
16:12, "ERROR"	  TCHAR szDisplayName[MAX_PATH];
536:532, "ERROR"	  TCHAR szTypeName[80];
		} SHFILEINFO;
696:692

==================================================

;;SHITEMID=3:3

typedef struct _SHITEMID {
  USHORT cb;
  BYTE   abID[1];
} SHITEMID;
[CHECK]

==================================================

;;SHQUERYRBINFO=24:20

typedef struct {
  DWORD   cbSize;
  __int64 i64Size;
  __int64 i64NumItems;
} SHQUERYRBINFO, *LPSHQUERYRBINFO;
[CHECK]

==================================================

;;SIZE=8:8

		typedef struct tagSIZE {
0:0, "Int"	  LONG cx;
4:4, "Int"	  LONG cy;
		} SIZE, *PSIZE;
8:8

==================================================

;;SOUNDSENTRY=56:48

		typedef struct tagSOUNDSENTRY {
0:0, "UInt"	  UINT   cbSize;
4:4, "UInt"	  DWORD  dwFlags;
8:8, "UInt"	  DWORD  iFSTextEffect;
12:12, "UInt"	  DWORD  iFSTextEffectMSec;
16:16, "UInt"	  DWORD  iFSTextEffectColorBits;
20:20, "UInt"	  DWORD  iFSGrafEffect;
24:24, "UInt"	  DWORD  iFSGrafEffectMSec;
28:28, "UInt"	  DWORD  iFSGrafEffectColor;
32:32, "UInt"	  DWORD  iWindowsEffect;
36:36, "UInt"	  DWORD  iWindowsEffectMSec;
40:40, "Ptr"	  LPTSTR lpszWindowsEffectDLL;
48:44, "UInt"	  DWORD  iWindowsEffectOrdinal;
		} SOUNDSENTRY, *LPSOUNDSENTRY;
56:48

==================================================

;;STARTUPINFO=104:68

		typedef struct _STARTUPINFO {
0:0, "UInt"	  DWORD  cb;
8:4, "Ptr"	  LPTSTR lpReserved;
16:8, "Ptr"	  LPTSTR lpDesktop;
24:12, "Ptr"	  LPTSTR lpTitle;
32:16, "UInt"	  DWORD  dwX;
36:20, "UInt"	  DWORD  dwY;
40:24, "UInt"	  DWORD  dwXSize;
44:28, "UInt"	  DWORD  dwYSize;
48:32, "UInt"	  DWORD  dwXCountChars;
52:36, "UInt"	  DWORD  dwYCountChars;
56:40, "UInt"	  DWORD  dwFillAttribute;
60:44, "UInt"	  DWORD  dwFlags;
64:48, "UShort"	  WORD   wShowWindow;
66:50, "UShort"	  WORD   cbReserved2;
72:52, "Ptr"	  LPBYTE lpReserved2;
80:56, "Ptr"	  HANDLE hStdInput;
88:60, "Ptr"	  HANDLE hStdOutput;
96:64, "Ptr"	  HANDLE hStdError;
		} STARTUPINFO, *LPSTARTUPINFO;
104:68

==================================================

;;STARTUPINFOEX=112:72

		typedef struct _STARTUPINFOEX {
0:0, "ERROR"	  STARTUPINFO                 StartupInfo;
104:68, "Ptr"	  PPROC_THREAD_ATTRIBUTE_LIST lpAttributeList;
		} STARTUPINFOEX, *LPSTARTUPINFOEX;
112:72

==================================================

;;STICKYKEYS=8:8

		typedef struct tagSTICKYKEYS {
0:0, "UInt"	  DWORD cbSize;
4:4, "UInt"	  DWORD dwFlags;
		} STICKYKEYS, *LPSTICKYKEYS;
8:8

==================================================

;;STRRET=272:264

typedef struct _STRRET {
  UINT  uType;
  union {
    LPWSTR pOleStr;
    UINT   uOffset;
    CHAR   cStr[MAX_PATH];
  };
} STRRET, *LPSTRRET;
[CHECK]

==================================================

;;SYSTEMTIME=16:16

		typedef struct _SYSTEMTIME {
0:0, "UShort"	  WORD wYear;
2:2, "UShort"	  WORD wMonth;
4:4, "UShort"	  WORD wDayOfWeek;
6:6, "UShort"	  WORD wDay;
8:8, "UShort"	  WORD wHour;
10:10, "UShort"	  WORD wMinute;
12:12, "UShort"	  WORD wSecond;
14:14, "UShort"	  WORD wMilliseconds;
		} SYSTEMTIME, *PSYSTEMTIME;
16:16

==================================================

;;TBBUTTON=32:20

		typedef struct {
0:0, "Int"	  int       iBitmap;
4:4, "Int"	  int       idCommand;
8:8, "UChar"	  BYTE      fsState;
9:9, "UChar"	  BYTE      fsStyle;
		#ifdef _WIN64
10:_, "ERROR"	  BYTE      bReserved[6];
		#else
		#if defined(_WIN32)
_:10, "ERROR"	  BYTE      bReserved[2];
		#endif
		#endif
16:12, "UPtr"	  DWORD_PTR dwData;
24:16, "Ptr"	  INT_PTR   iString;
		} TBBUTTON, *PTBBUTTON, *LPTBBUTTON;
32:20

==================================================

;;TBBUTTONINFO=48:32

		typedef struct {
0:0, "UInt"	  UINT      cbSize;
4:4, "UInt"	  DWORD     dwMask;
8:8, "Int"	  int       idCommand;
12:12, "Int"	  int       iImage;
16:16, "UChar"	  BYTE      fsState;
17:17, "UChar"	  BYTE      fsStyle;
18:18, "UShort"	  WORD      cx;
24:20, "UPtr"	  DWORD_PTR lParam;
32:24, "Ptr"	  LPTSTR    pszText;
40:28, "Int"	  int       cchText;
		} TBBUTTONINFO, *LPTBBUTTONINFO;
48:32

==================================================

;;TCITEM=40:28

		typedef struct {
0:0, "UInt"	  UINT   mask;
		#if (_WIN32_IE >= 0x0300)
4:4, "UInt"	  DWORD  dwState;
8:8, "UInt"	  DWORD  dwStateMask;
		#else
		  UINT   lpReserved1;
		  UINT   lpReserved2;
		#endif
16:12, "Ptr"	  LPTSTR pszText;
24:16, "Int"	  int    cchTextMax;
28:20, "Int"	  int    iImage;
32:24, "Ptr"	  LPARAM lParam;
		} TCITEM, *LPTCITEM;
40:28

==================================================

;;THREADENTRY32=28:28

		typedef struct tagTHREADENTRY32 {
0:0, "UInt"	  DWORD dwSize;
4:4, "UInt"	  DWORD cntUsage;
8:8, "UInt"	  DWORD th32ThreadID;
12:12, "UInt"	  DWORD th32OwnerProcessID;
16:16, "Int"	  LONG  tpBasePri;
20:20, "Int"	  LONG  tpDeltaPri;
24:24, "UInt"	  DWORD dwFlags;
		} THREADENTRY32, *PTHREADENTRY32;
28:28

==================================================

;;TIME_ZONE_INFORMATION=172:172

		typedef struct _TIME_ZONE_INFORMATION {
0:0, "Int"	  LONG       Bias;
4:4, "ERROR"	  WCHAR      StandardName[32];
68:68, "ERROR"	  SYSTEMTIME StandardDate;
84:84, "Int"	  LONG       StandardBias;
88:88, "ERROR"	  WCHAR      DaylightName[32];
152:152, "ERROR"	  SYSTEMTIME DaylightDate;
168:168, "Int"	  LONG       DaylightBias;
		} TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION;
172:172

==================================================

;;TOGGLEKEYS=8:8

		typedef struct tagTOGGLEKEYS {
0:0, "UInt"	  DWORD cbSize;
4:4, "UInt"	  DWORD dwFlags;
		} TOGGLEKEYS, *LPTOGGLEKEYS;
8:8

==================================================

;;TOKEN_PRIVILEGES=16:16

typedef struct _TOKEN_PRIVILEGES {
  DWORD               PrivilegeCount;
  LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY];
} TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES;
[CHECK]

==================================================

;;TPMPARAMS=20:20

		typedef struct tagTPMPARAMS {
0:0, "UInt"	  UINT cbSize;
4:4, "ERROR"	  RECT rcExclude;
		} TPMPARAMS, *LPTPMPARAMS;
20:20

==================================================

;;TVITEM=56:40

		typedef struct tagTVITEM {
0:0, "UInt"	  UINT      mask;
8:4, "Ptr"	  HTREEITEM hItem;
16:8, "UInt"	  UINT      state;
20:12, "UInt"	  UINT      stateMask;
24:16, "Ptr"	  LPTSTR    pszText;
32:20, "Int"	  int       cchTextMax;
36:24, "Int"	  int       iImage;
40:28, "Int"	  int       iSelectedImage;
44:32, "Int"	  int       cChildren;
48:36, "Ptr"	  LPARAM    lParam;
		} TVITEM, *LPTVITEM;
56:40

==================================================

;;VARIANT=24:16

typedef struct tagVARIANT {
  union {
    struct __tagVARIANT {
      VARTYPE vt;
      WORD    wReserved1;
      WORD    wReserved2;
      WORD    wReserved3;
      union {
        LONGLONG            llVal;
        LONG                lVal;
        BYTE                bVal;
        SHORT               iVal;
        FLOAT               fltVal;
        DOUBLE              dblVal;
        VARIANT_BOOL        boolVal;
        _VARIANT_BOOL       bool;
        SCODE               scode;
        CY                  cyVal;
        DATE                date;
        BSTR                bstrVal;
        IUnknown            *punkVal;
        IDispatch           *pdispVal;
        SAFEARRAY           *parray;
        BYTE                *pbVal;
        SHORT               *piVal;
        LONG                *plVal;
        LONGLONG            *pllVal;
        FLOAT               *pfltVal;
        DOUBLE              *pdblVal;
        VARIANT_BOOL        *pboolVal;
        _VARIANT_BOOL       *pbool;
        SCODE               *pscode;
        CY                  *pcyVal;
        DATE                *pdate;
        BSTR                *pbstrVal;
        IUnknown            **ppunkVal;
        IDispatch           **ppdispVal;
        SAFEARRAY           **pparray;
        VARIANT             *pvarVal;
        PVOID               byref;
        CHAR                cVal;
        USHORT              uiVal;
        ULONG               ulVal;
        ULONGLONG           ullVal;
        INT                 intVal;
        UINT                uintVal;
        DECIMAL             *pdecVal;
        CHAR                *pcVal;
        USHORT              *puiVal;
        ULONG               *pulVal;
        ULONGLONG           *pullVal;
        INT                 *pintVal;
        UINT                *puintVal;
        struct __tagBRECORD {
          PVOID       pvRecord;
          IRecordInfo *pRecInfo;
        } __VARIANT_NAME_4;
      } __VARIANT_NAME_3;
    } __VARIANT_NAME_2;
    DECIMAL             decVal;
  } __VARIANT_NAME_1;
} VARIANT, *LPVARIANT, VARIANTARG, *LPVARIANTARG;
[CHECK]

==================================================

;;VS_FIXEDFILEINFO=52:52

		typedef struct tagVS_FIXEDFILEINFO {
0:0, "UInt"	  DWORD dwSignature;
4:4, "UInt"	  DWORD dwStrucVersion;
8:8, "UInt"	  DWORD dwFileVersionMS;
12:12, "UInt"	  DWORD dwFileVersionLS;
16:16, "UInt"	  DWORD dwProductVersionMS;
20:20, "UInt"	  DWORD dwProductVersionLS;
24:24, "UInt"	  DWORD dwFileFlagsMask;
28:28, "UInt"	  DWORD dwFileFlags;
32:32, "UInt"	  DWORD dwFileOS;
36:36, "UInt"	  DWORD dwFileType;
40:40, "UInt"	  DWORD dwFileSubtype;
44:44, "UInt"	  DWORD dwFileDateMS;
48:48, "UInt"	  DWORD dwFileDateLS;
		} VS_FIXEDFILEINFO;
52:52

==================================================

;;WCRANGE=4:4

		typedef struct tagWCRANGE {
0:0, "UShort"	  WCHAR  wcLow;
2:2, "UShort"	  USHORT cGlyphs;
		} WCRANGE, *PWCRANGE;
4:4

==================================================

;;WIN32_FIND_DATA=592:592

		typedef struct _WIN32_FIND_DATA {
0:0, "UInt"	  DWORD    dwFileAttributes;
4:4, "ERROR"	  FILETIME ftCreationTime;
12:12, "ERROR"	  FILETIME ftLastAccessTime;
20:20, "ERROR"	  FILETIME ftLastWriteTime;
28:28, "UInt"	  DWORD    nFileSizeHigh;
32:32, "UInt"	  DWORD    nFileSizeLow;
36:36, "UInt"	  DWORD    dwReserved0;
40:40, "UInt"	  DWORD    dwReserved1;
44:44, "ERROR"	  TCHAR    cFileName[MAX_PATH];
564:564, "ERROR"	  TCHAR    cAlternateFileName[14];
		} WIN32_FIND_DATA, *PWIN32_FIND_DATA, *LPWIN32_FIND_DATA;
592:592

==================================================

;;WINDOWINFO=60:60

		typedef struct tagWINDOWINFO {
0:0, "UInt"	  DWORD cbSize;
4:4, "ERROR"	  RECT  rcWindow;
20:20, "ERROR"	  RECT  rcClient;
36:36, "UInt"	  DWORD dwStyle;
40:40, "UInt"	  DWORD dwExStyle;
44:44, "UInt"	  DWORD dwWindowStatus;
48:48, "UInt"	  UINT  cxWindowBorders;
52:52, "UInt"	  UINT  cyWindowBorders;
56:56, "UShort"	  ATOM  atomWindowType;
58:58, "UShort"	  WORD  wCreatorVersion;
		} WINDOWINFO, *PWINDOWINFO, *LPWINDOWINFO;
60:60

==================================================

;;WNDCLASS=72:40

		typedef struct tagWNDCLASS {
0:0, "UInt"	  UINT      style;
8:4, "ERROR"	  WNDPROC   lpfnWndProc;
16:8, "Int"	  int       cbClsExtra;
20:12, "Int"	  int       cbWndExtra;
24:16, "Ptr"	  HINSTANCE hInstance;
32:20, "Ptr"	  HICON     hIcon;
40:24, "Ptr"	  HCURSOR   hCursor;
48:28, "Ptr"	  HBRUSH    hbrBackground;
56:32, "Ptr"	  LPCTSTR   lpszMenuName;
64:36, "Ptr"	  LPCTSTR   lpszClassName;
		} WNDCLASS, *PWNDCLASS;
72:40

==================================================

;;WNDCLASSEX=80:48

		typedef struct tagWNDCLASSEX {
0:0, "UInt"	  UINT      cbSize;
4:4, "UInt"	  UINT      style;
8:8, "ERROR"	  WNDPROC   lpfnWndProc;
16:12, "Int"	  int       cbClsExtra;
20:16, "Int"	  int       cbWndExtra;
24:20, "Ptr"	  HINSTANCE hInstance;
32:24, "Ptr"	  HICON     hIcon;
40:28, "Ptr"	  HCURSOR   hCursor;
48:32, "Ptr"	  HBRUSH    hbrBackground;
56:36, "Ptr"	  LPCTSTR   lpszMenuName;
64:40, "Ptr"	  LPCTSTR   lpszClassName;
72:44, "Ptr"	  HICON     hIconSm;
		} WNDCLASSEX, *PWNDCLASSEX;
80:48

==================================================

;;WSADATA=408:400

typedef struct WSAData {
  WORD           wVersion;
  WORD           wHighVersion;
  char           szDescription[WSADESCRIPTION_LEN+1];
  char           szSystemStatus[WSASYS_STATUS_LEN+1];
  unsigned short iMaxSockets;
  unsigned short iMaxUdpDg;
  char FAR       *lpVendorInfo;
} WSADATA, *LPWSADATA;
[CHECK]

==================================================
I struct gold.
Last edited by jeeswg on 18 Apr 2017, 16:26, edited 22 times in total.
User avatar
Drugwash
Posts: 639
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania

Re: list of structs with parameters (sizes and types)

13 Apr 2017, 04:00

For a long time now my dream has been a fully fledged struct parser that would have its own (complete) database of structures retrieved from old and new MSDN versions, so that it would provide the user with a struct list and by choosing the desired item it would return any and all possible information and code (usable in both AHK 1.0 and 1.1+) about it.
That combined with a user defined-struct builder would be an excellent tool for those that make extensive use of DllCall() and not only.
EDIT:
Of good help could be the WinStructs project together with _Struct() and Ahk-SizeOf-Checker, and maybe useful additions would make these scripts for GUID/UUID manipulation here and here.
/EDIT
Until recently I had no knowledge about structure alignment so some of my scripts may be buggy in this regard, most certainly in an x64 environment.

I know someone here might jump in with a "do it yourself!" statement so to make it clear: I'm not asking for things to be done - just speaking my mind. And maybe the scripts I pointed to could be useful for the current task.
I've deleted my CloudMe account because of GDPR - the now legal base for privacy invasion and data theft.
just me
Posts: 5637
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: list of structs with parameters (sizes and types)

13 Apr 2017, 09:07

AFAIK, AHK_H Struct() doesn't have built-in support for
  • non-default alignment
  • creating 32-bit structures on AHK x64 and vice versa.
User avatar
jeeswg
Posts: 5402
Joined: 19 Dec 2016, 01:58
Location: UK

Re: list of structs with parameters (sizes and types)

13 Apr 2017, 10:11

@Drugwash
Haha 'do it yourself'. I think people should ask a lot, and give a lot, simples.

Also, I know if I'm expert in something I can save someone else a lot of time, when learning something new, and vice versa. A bit like 'comparative advantage'. A bit of help at the beginning is really useful, just to get a foothold.

I think that struct parsers/builders would be good too, although even if we did get one, I think it's important to have some hardcoded lists to confirm that the parsers/builders work, and to guarantee accuracy for common structures. Some attempts that I know of are: _Struct.ahk and sizeof.ahk.

Actually, also of use would be a (fairly) comprehensive list of parameter types and parameter/struct sizes, I have been working on those, and used them to make this list, and will be sharing these in due course.

I will also do some lists for DllCall.

I've basically done all the structs I intended to do. If ever I come across a new one, I might add it in. If there are any other structs that people think should be added to the list just post all the ones that *theoretically* you would like added to the list, and I might get round to adding some/all of them in. Don't be shy about posting a very long list, and don't worry about removing items from your list that overlap with the list above.

==================================================

@guest3456 and just me
Interesting re. AHK_H.

Nice list of data types here:
Built-in Structure types
https://hotkeyit.github.io/v2/docs/StructTypes.htm
User avatar
nnnik
Posts: 3526
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: list of structs with parameters (sizes and types)

13 Apr 2017, 10:53

Actually, also of use would be a (fairly) comprehensive list of parameter types and parameter/struct sizes, I have been working on those, and used them to make this list, and will be sharing these in due course.
That one already exists. Bentschi did one once.
Recommends AHK Studio
guest3456
Posts: 2464
Joined: 09 Oct 2013, 10:31

Re: list of structs with parameters (sizes and types)

13 Apr 2017, 10:57

just me wrote:AFAIK, AHK_H Struct() doesn't have built-in support for
  • non-default alignment
  • creating 32-bit structures on AHK x64 and vice versa.
i dont know...
HotKeyIt wrote: ping

HotKeyIt
Posts: 1709
Joined: 29 Sep 2013, 18:35
Contact:

Re: list of structs with parameters (sizes and types)

13 Apr 2017, 15:30

just me wrote:AFAIK, AHK_H Struct() doesn't have built-in support for
  • non-default alignment
  • creating 32-bit structures on AHK x64 and vice versa.
  • I think you should be able to use Bit Fields for non default alignment. Do we have an example where it would be required?
  • Of course one would need 32-bit exe for 32-bit and 64-bit for 64-bit structures. Why would you need that? It would be easy to implement but I don't think it makes sense, it would just lead to errors and confusion.
just me
Posts: 5637
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: list of structs with parameters (sizes and types)

14 Apr 2017, 01:50

  • Code: Select all

    #ifdef _WIN32
    #include <pshpack1.h>
    #endif
    
    typedef struct tagLVKEYDOWN
    {
        NMHDR hdr;
        WORD wVKey;
        UINT flags;
    } NMLVKEYDOWN, *LPNMLVKEYDOWN;
    
    #ifdef _WIN32
    #include <poppack.h>
    #endif
    
  • Inter-process communication.
User avatar
nnnik
Posts: 3526
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: list of structs with parameters (sizes and types)

14 Apr 2017, 01:53

HotKeyIt wrote:
just me wrote:AFAIK, AHK_H Struct() doesn't have built-in support for
  • non-default alignment
  • creating 32-bit structures on AHK x64 and vice versa.
  • I think you should be able to use Bit Fields for non default alignment. Do we have an example where it would be required?
  • Of course one would need 32-bit exe for 32-bit and 64-bit for 64-bit structures. Why would you need that? It would be easy to implement but I don't think it makes sense, it would just lead to errors and confusion.
Saving to files/ sending acorss the internet in a format that requires that requires it's structures to be aligned in a certain way that follows the 64/32 bit norm.
Recommends AHK Studio
HotKeyIt
Posts: 1709
Joined: 29 Sep 2013, 18:35
Contact:

Re: list of structs with parameters (sizes and types)

14 Apr 2017, 02:16

nnnik wrote:aligned in a certain way that follows the 64/32 bit norm.
With certain you mean non-default, right? Do you have an example?
User avatar
nnnik
Posts: 3526
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: list of structs with parameters (sizes and types)

14 Apr 2017, 02:55

HotKeyIt wrote:
nnnik wrote:aligned in a certain way that follows the 64/32 bit norm.
With certain you mean non-default, right? Do you have an example?
Yeah I was using your Struct lib to send some data over a Socket but didn't get any good results ( the binaries were encoded in base64 then send as text ). That was because I was sending from a 64-bit Version to a non 64 bit Version of AutoHotkey.
And yes with certain I mean default.
Recommends AHK Studio
just me
Posts: 5637
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: list of structs with parameters (sizes and types)

14 Apr 2017, 05:15

Another interesting structure:

Code: Select all

typedef struct _SHFILEOPSTRUCTA
{
    HWND            hwnd;
    UINT            wFunc;
    PCZZSTR         pFrom;
    PCZZSTR         pTo;
    FILEOP_FLAGS    fFlags;
    BOOL            fAnyOperationsAborted;
    LPVOID          hNameMappings;
    PCSTR           lpszProgressTitle; // only used if FOF_SIMPLEPROGRESS
} SHFILEOPSTRUCTA, *LPSHFILEOPSTRUCTA;
typedef struct _SHFILEOPSTRUCTW
{
    HWND            hwnd;
    UINT            wFunc;
    PCZZWSTR        pFrom;
    PCZZWSTR        pTo;
    FILEOP_FLAGS    fFlags;
    BOOL            fAnyOperationsAborted;
    LPVOID          hNameMappings;
    PCWSTR          lpszProgressTitle; // only used if FOF_SIMPLEPROGRESS
} SHFILEOPSTRUCTW, *LPSHFILEOPSTRUCTW;
Note:

Code: Select all

// line 48 ff
#if !defined(_WIN64)
#include <pshpack1.h>
#endif
// line 255
typedef WORD FILEOP_FLAGS;
User avatar
Drugwash
Posts: 639
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania

Re: list of structs with parameters (sizes and types)

14 Apr 2017, 08:05

Working with structures is not that simple.
While some of the structures are simple buffers that may have been allocated (in AHK) a size larger than required, others require that the exact size of the buffer be entered in a special field (usually first field of the structure).
This size may depend on the OS version, OS type, API version and/or other criteria. And while some API versions may (?) accept a wrong struct size, most would error out.

Therefore it all depends on the target OS range of the script. Simply choosing largest size according to the #if directives in the original MS headers and separating by ANSI/Unicode won't always cut it for older systems like 2000/XP, not to mention the 9x and NT4 line. Since I'm primarily a 9x user I know how this goes. I've tried hard for some recent scripts to be compatible with at least 98/ME and XP - nothing else to test on, currently - and it took a lot of work. First OS version has to be determined and ideally certain API versions too, such as those in common controls for Toolbar/Rebar/etc and maybe RichEdit too, then use the appropriate struct sizes according to that info. Something new coders wouldn't bother with - "either you use Win10 or you're toast", they say.

So, how do we stand…?
I've deleted my CloudMe account because of GDPR - the now legal base for privacy invasion and data theft.
User avatar
jeeswg
Posts: 5402
Joined: 19 Dec 2016, 01:58
Location: UK

Re: list of structs with parameters (sizes and types)

14 Apr 2017, 08:35

I have been writing some functions which I hope to post soon, that get/set the text for various control types on internal/external GUI windows. AHK might be x32/x64, the external program might be x32/x64, if a struct is required, such as LVITEM or TVITEM, we usually have to prepare it in the same 'bitness' as the external program.
User avatar
Drugwash
Posts: 639
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania

Re: list of structs with parameters (sizes and types)

20 Apr 2017, 04:17

Yes, a combination of 32bit application on 64bit Windows can be misleading so a proper detection system should be created and used.
I've built some helper functions that retrieve OS version or compare current version to a given one (see func_GetOSver.ahk and func_OStest.ahk in my LLB's lib folder) and used them in building the REBARBANDINFO structure, for example in the Rebar wrapper func_Rebar.ahk, which I believe is still not x64-safe due to (mis)alignment.

Structures like i.e. TBBUTTON or TBBUTTONINFO are tricky. Current MSDN information is worthless when dealing with 2000/XP (or older) so messages like TB_SETBUTTONINFO or TB_GETBUTTONINFO would fail on those systems because struct size for TBBUTTONINFO is different for pre/post-Vista OS. (just noticed that in func_Toolbar.ahk --> TB_BtnSet() where the comparison is buggy because it doesn't do "is Vista or later" but only "is Vista")

Structures like those in iphlpapi.dll (see my NetMeterEx) may be much trickier since they may have variable sizes and certain fields may hold different contents according to OS version (I've noticed differences betweeen 98SE and XP) such as APIs returning ANSI string although MSDN states it should return Unicode or some DWORD index field returning either one or two WORDs depending on OS version.

Therefore not only calculating correct structure size may be a problem but also the commands/functions used to retrieve info from the struct fields should be adjusted according to all those criteria. Yeah, working out structures in a flawless way is an extremely difficult task.
I've deleted my CloudMe account because of GDPR - the now legal base for privacy invasion and data theft.
User avatar
jeeswg
Posts: 5402
Joined: 19 Dec 2016, 01:58
Location: UK

Re: list of structs with parameters (sizes and types)

24 Nov 2018, 18:38

MENUBARINFO

The definition for MENUBARINFO on MSDN has been corrected, ': 1' has been added to the two BOOLs. Has anyone seen this notation before?
tagMENUBARINFO | Microsoft Docs
https://docs.microsoft.com/en-us/window ... enubarinfo

I get the correct sizes when ': 1' is added to the BOOLs (C++ code):

Code: Select all

	//MENUBARINFO
	struct TestMBI1
	{
		DWORD cbSize;
		RECT  rcBar;
		HMENU hMenu;
		HWND  hwndMenu;
		BOOL  fBarFocused; //without ':1'
		BOOL  fFocused; //without ':1'
	};
	struct TestMBI2
	{
		DWORD cbSize;
		RECT  rcBar;
		HMENU hMenu;
		HWND  hwndMenu;
		BOOL  fBarFocused : 1;
		BOOL  fFocused : 1;
	};

	std::cout << sizeof(TestMBI1) << std::endl; //48:36 (64-bit:32-bit)
	std::cout << sizeof(TestMBI2) << std::endl; //48:32
	std::cout << sizeof(MENUBARINFO) << std::endl; //48:32
SHFILEOPSTRUCT

@just me: SHFILEOPSTRUCT is indeed an interesting structure, e.g. useful for file/folder move/copy/recycle operations. Oddly, when I do sizeof directly, I get a different value to when I build the struct myself. Calculating by hand, I would expect 32 bytes, not 30.

Code: Select all

	//SHFILEOPSTRUCT
	struct TestSFOS1
	{
		HWND         hwnd;
		UINT         wFunc;
		PCZZSTR      pFrom;
		PCZZSTR      pTo;
		FILEOP_FLAGS fFlags;
		BOOL         fAnyOperationsAborted;
		LPVOID       hNameMappings;
		PCSTR        lpszProgressTitle;
	};

	std::cout << sizeof(TestSFOS1) << std::endl; //56:32 (64-bit:32-bit)
	std::cout << sizeof(_SHFILEOPSTRUCTA) << std::endl; //56:30
	std::cout << sizeof(_SHFILEOPSTRUCTW) << std::endl; //56:30
	//std::cout << sizeof(_SHFILEOPSTRUCT) << std::endl; //error
	std::cout << sizeof(SHFILEOPSTRUCTA) << std::endl; //56:30
	std::cout << sizeof(SHFILEOPSTRUCTW) << std::endl; //56:30
	std::cout << sizeof(SHFILEOPSTRUCT) << std::endl; //56:30
Helgef
Posts: 3294
Joined: 17 Jul 2016, 01:02
Contact:

Re: list of structs with parameters (sizes and types)

25 Nov 2018, 03:37

Has anyone seen this notation before?
That is the notation for declaring bitfields, that is, the members fBarFocused and fFocused are bitfields, each reserved 1 bit of memory. Their total size is size of BOOL though, that is 32 bits. But you could add up to 30 more one bit wide members without the affecting the total struct size. But if you add 31 more, the size increases with size of BOOL. You could also add other bit widths (up 32 bit since that is the size of BOOL), eg, BOOL x : 7; makes a 7 bit wide member. Zero width members is a special case, some times added for alignment purposes, such members are left unnamed, eg, BOOL : 0;. To write correctly to these members you do,

Code: Select all

numput ((bifField0Value << (bifField0pos-1)) | ((bifField1Value << (bifField1pos-1)), offsetOfFirstBitField, type
or in this example,

Code: Select all

numput fBarFocused | (fFocused << 1), TestMBI2, a_ptrsize == 8 40 :  28, 'int'
You have to ensure the values of fBarFocused and fFocused are 0 or 1. If you add the member BOOL x:7, you do fBarFocused | (fFocused << 1) | (x << 2), and here x needs to be in the range 0...127.

Reading the values of these members is left as an exercise for the interested reader.

Cheers.

Return to “Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 4 guests