News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Wireless Internet

Started by oex, July 23, 2010, 06:47:27 PM

Previous topic - Next topic

oex

Hi,

I'm adding a module for wireless access but have run into a type issue I cant work out:

How does "typedef enum" translate in MASM32?

http://msdn.microsoft.com/en-us/library/ms706001(v=VS.85).aspx

typedef enum _DOT11_BSS_TYPE {
  dot11_BSS_type_infrastructure   = 1,
  dot11_BSS_type_independent      = 2,
  dot11_BSS_type_any              = 3
} DOT11_BSS_TYPE, *PDOT11_BSS_TYPE;

Is it a DWORD union maybe?
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

Gunner

Too bad we don't have enums in MASM...  You could do it like this:
_DOT11_BSS_TYPE LABEL DWORD
  dot11_BSS_type_infrastructure   DD 1
  dot11_BSS_type_independent      DD 2
  dot11_BSS_type_any              DD 3

    mov     edi, offset _DOT11_BSS_TYPE
    xor ebx, ebx
GetNext:                           
    PrintDec    dword ptr [edi + 4 * ebx]
inc ebx
cmp ebx, 3
jne GetNext
~Rob (Gunner)
- IE Zone Editor
- Gunners File Type Editor
http://www.gunnerinc.com

MichaelW

eschew obfuscation

oex

oh ty guys :bg, :lol I was looking for a more complicated solution
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

clive

dot11_BSS_type_infrastructure   = 1
dot11_BSS_type_independent    = 2
dot11_BSS_type_any                 = 3

OR

dot11_BSS_type_infrastructure  EQU 1
dot11_BSS_type_independent   EQU 2
dot11_BSS_type_any                EQU 3

Typically used in C in place of #define so that the values will propagate into the debugger, etc and not just get eaten by the preprocessor.
It could be a random act of randomness. Those happen a lot as well.

Farabi

Quote from: clive on July 23, 2010, 08:39:12 PM
dot11_BSS_type_infrastructure   = 1
dot11_BSS_type_independent    = 2
dot11_BSS_type_any                 = 3

OR

dot11_BSS_type_infrastructure  EQU 1
dot11_BSS_type_independent   EQU 2
dot11_BSS_type_any                EQU 3

Typically used in C in place of #define so that the values will propagate into the debugger, etc and not just get eaten by the preprocessor.

I think it was start from 0 not 1.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

Twister

No, Farabi, that is correct. It starts at 1.

dot11_BSS_type_infrastructure  EQU 1
dot11_BSS_type_independent   EQU 2
dot11_BSS_type_any                EQU 3

Is what I would do. Just like what clive specified.