Re: Structure Rupture aka eh?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



pigeonrandle@xxxxxxxxxxx wrote:
> Hello.
>
> Please can somebody tell me why this stucture definition is the 'way it
> is'?
>
> typedef struct BLOCK_CHECKSUM_STATE
> {
> ULONG Unknown;
> ULONG64 BaseAddress;
> ULONG BlockSize;
> ULONG Checksum;
> } BLOCK_CHECKSUM_STATE, *PBLOCK_CHECKSUM_STATE;
>
> i.e. the "*PBLOCK_CHECKSUM_STATE" being an extra argument than i am
> used to seeing. Is it just a way of aliasing a pointer to
> BLOCK_CHECKSUM_STATE as PBLOCK_CHECKSUM_STATE?
>

That's the C-way of saying:

struct BLOCK_CHECKSUM_STATE
{
ULONG Unknown;
ULONG64 BaseAddress;
ULONG BlockSize;
ULONG Checksum;
};
typedef BLOCK_CHECKSUM_STATE* PBLOCK_CHECKSUM_STATE;

/S
--
Stefan Naewe
naewe.s_AT_atlas_DOT_de
.



Relevant Pages

  • Drawstring chars
    ... I see a bunch of glyph handles (since pstro->flAccel has ... typedef struct _FD_GLYPHSET { ... ULONG cGlyphsSupported; ... typedef struct _WCRUN { ...
    (microsoft.public.development.device.drivers)
  • Re: Size of structs containing unions
    ... > typedef struct _WRITE_INPUT { ... > ULONG RegisterNumber; ... The compiler is free to add padding after any member of a structure. ... make the size of the structure a multiple of 4, so the ULONG members ...
    (comp.lang.c)
  • [PATCH 2.6.27-rc1 9/25] mdb: Merkeys Kernel Debugger 2.6.27-rc1
    ... Netware style debugger for Linux written by Jeffrey Vernon Merkey ... +typedef struct _StackFrame { ... ULONG *tCR3; ... +static inline void _cli ...
    (Linux-Kernel)
  • [PATCH 2.6.26 9/25] mdb: Merkeys Kernel Debugger
    ... Netware Style Debugger for Linux written by Jeffrey Vernon Merkey ... +typedef struct _StackFrame { ... ULONG *tCR3; ... +static inline void _cli ...
    (Linux-Kernel)
  • Structure Rupture aka eh?
    ... ULONG64 BaseAddress; ... ULONG BlockSize; ... ULONG Checksum; ...
    (microsoft.public.vc.language)