On Sun, 5 Oct 2003, Bruce Momjian wrote:
>
> Can you tell me what Win32 compile environment can't handle a sizeof()
> as a function parameter?
>
> ! GetUserName(pw->pw_name, sizeof(pw->pw_name)-1);
>
> Does casting to DWORD help?
> > ! GetUserName(pw->pw_name, &pwname_size);
It looks like the second argument is supposed to be a pointer and probably
returns back the length actually used (if it follows the pattern of other
win32 calls)
It's something like:
BOOL GetUserName(
LPTSTR lpBuffer, // address of name buffer
LPDWORD nSize // address of size of name buffer
);