This is the mail archive of the cygwin-apps mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: setup-1.7 defaults to "Just me"

Corinna Vinschen wrote:

> I mean, token_info was an UCHAR array, so it's not aligned while
> the token_group information might require a 4 or 8 byte alignment
> which you now get by chance.  Probably you'd be better off not
> using `char buf[size]' but
>   PTOKEN_GROUPS groups = (PTOKEN_GROUPS) alloca (size);


#include <stdio.h>
#include <malloc.h>

int main (int argc, char **argv)
  char vla[argc * 250];
  char *alloca_array = (char *) alloca (argc * 250);
  char normal_array[1024];
  printf ("alignof(vla) = %d\n", __alignof__ (vla));
  printf ("alignof(alloca_array) = %d\n", __alignof__ (alloca_array));
  printf ("alignof(normal_array) = %d\n", __alignof__ (normal_array));
  return 0;


alignof(vla) = 1
alignof(alloca_array) = 4
alignof(normal_array) = 1

So, perhaps this is working now by accident?

> for the GetTokenInformation call.  However, it also didn't say anything
> about alignment requirements of ZwQueryDirectoryFile but it failed
> on W2K for that reason nevertheless.

Don't you love discovering these little pearls of joy inside the Win32
API?  They're like little rays of sunshine.  No wait, the opposite.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]