Henri Verbeet wrote: > 2009/9/22 Vitaliy Margolen <wine-de...@kievinfo.com>: >> It does dereference the pointer. Here is your simple test. Compile it and >> run it. See what happens. >> >> #include <stdio.h> >> >> typedef struct _s_test >> { >> void *pointer; >> } s_test; >> >> int main() >> { >> s_test *s = NULL; >> long diff = (const char*)s->pointer - (const char*)s; >> printf("diff=%ld\n", diff); >> >> return 0; >> } >> >> Vitaliy. >> > > That's not really what the code does. Try changing "void *pointer" to > "char pointer[32]". Right, haven't checked the definition of the DEVMODEW. Indeed it does work for an array, since it is part of the structure. So "s->pointer" will be (char *)s + FIELD_OFFSET(s,pointer).
Still it's a bad construct to use, for exactly the reason we are having this discussion. Vitaliy.