What would you say is the size of the MIXERCONTROLA structure (straight out of WINDOWS.INC)?

------cbStruct DWORD ?
------dwControlID DWORD ?
------dwControlType DWORD ?
------fdwControl DWORD ?
------cMultipleItems DWORD ?
------szShortName db MIXER_SHORT_NAME_CHARS dup(?)
------szName db MIXER_LONG_NAME_CHARS dup(?)
------union Bounds
--------------------------lMinimum dd ?
--------------------------lMaximum dd ?
--------------------------dwMinimum dd ?
--------------------------dwMaximum dd ?
-------------dwReserved dd 6 dup(?)
-----union Metrics
-------------cSteps dd ?
-------------cbCustomData dd ?
-------------dwReserved dd 6 dup(?)

What really throws me off are the dd 6 dup(?). How big are these?


P.S. Any ideas on how to get those spaces to show up? It would really help to have some alignment for this structure.
Posted on 2002-02-15 21:59:20 by Lysic
What really throws me off are the dd 6 dup(?). How big are these?

Posted on 2002-02-15 22:13:18 by The Svin
Hmmm... interesting.

So just like

db 6 dup (?)

You can use

dw 6 dup(?)
dd 6 dup(?)
dq 6 dup(?)

Makes sense... although I thought the dup only worked with db.

Thanks, Svin.
Posted on 2002-02-15 22:22:33 by Lysic
dup states for "duplicate"
for example
text1 db 6 dup ("Lysic")
will store 30 bytes containing 6 duplicate of your name.
used with ?: dup number (?) it reservse as much space
as data type size * number.
Posted on 2002-02-15 23:47:04 by The Svin
you can find the size from a compile quite ez..

Place this anywhere after the includes...

%echo The Struct Size is: ASize (bytes)

When compiled you will get a # above the standard Linking message:

Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.

Assembling: D:\masm32\JProject3\for\DOS.asm
[b]The Struct Size is: 15 (bytes)[/b]
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

Hope it helps...
Posted on 2002-02-15 23:47:51 by NaN
....it's a bird....it's a plane....it's a script language...no it's MASM! ;)
Posted on 2002-02-16 00:23:01 by bitRAKE
Thanks NaN, this is truly useful... I'll keep this in a safe place for future emergencies :) . I thought I found a problem with it, but it was all my imagination. It's late you see, and I need to go to sleep...
Posted on 2002-02-16 00:31:39 by Lysic


HLL Datatype Size ASM "Datatype" - Directive

char 1 DB
unsigned char 1 DB
int 2 DW
unsigned int 2 DW
long 4 DD
unsigned long 4 DD
float 4 REAL4
double 8 REAL8/DQ*
long double 10 DT

* if DQ, the value of initialization must be an integer - 0
else (REAL8) must be initialize by a real number(Decimals) - 0.0


I'm not sure if this is complete. It looks Ok to me.

Happy Coding!!!
Posted on 2002-02-16 00:47:39 by stryker