From 29acee402001c0ca009c546432027f5ce5ea3584 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 16 Mar 2005 21:52:06 +0000 Subject: [PATCH] * fhandler_tape.cc (get_ll): This is a generally useful function so move it * winsup.h (get_ll): to here * security.cc (get_token_group_sidlist): Use get_ll to figure out the long long version of the luid since QuadPart is not part of the standard Windows API. --- winsup/cygwin/ChangeLog | 9 +++++++++ winsup/cygwin/fhandler_tape.cc | 3 --- winsup/cygwin/security.cc | 2 +- winsup/cygwin/winsup.h | 3 +++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b92fedb88..b3a7eb903 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,12 @@ +2005-03-16 Christopher Faylor + + * fhandler_tape.cc (get_ll): This is a generally useful function so + move it + * winsup.h (get_ll): to here + * security.cc (get_token_group_sidlist): Use get_ll to figure out the + long long version of the luid since QuadPart is not part of the + standard Windows API. + 2005-03-16 Christopher Faylor * dir.cc: Rename opendir_* to dirent_* throughout. diff --git a/winsup/cygwin/fhandler_tape.cc b/winsup/cygwin/fhandler_tape.cc index 5b7c69909..33850e329 100644 --- a/winsup/cygwin/fhandler_tape.cc +++ b/winsup/cygwin/fhandler_tape.cc @@ -36,9 +36,6 @@ details. */ part (partition)->initialize (0); \ } -/* Convert LARGE_INTEGER into long long */ -#define get_ll(pl) (((long long) (pl).HighPart << 32) | (pl).LowPart) - #define IS_BOT(err) ((err) == ERROR_BEGINNING_OF_MEDIA) #define IS_EOF(err) ((err) == ERROR_FILEMARK_DETECTED \ diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 14f401335..40914ff4a 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -534,7 +534,7 @@ get_token_group_sidlist (cygsidlist &grp_list, PTOKEN_GROUPS my_grps, grp_list += well_known_local_sid; grp_list += well_known_interactive_sid; } - if (auth_luid.QuadPart != 999) /* != SYSTEM_LUID */ + if (get_ll (auth_luid) != 999LL) /* != SYSTEM_LUID */ { char buf[64]; __small_sprintf (buf, "S-1-5-5-%u-%u", auth_luid.HighPart, diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h index 794fa720f..f8c060bd7 100644 --- a/winsup/cygwin/winsup.h +++ b/winsup/cygwin/winsup.h @@ -214,6 +214,9 @@ void uinfo_init (void); #define uid16touid32(u16) ((u16)==ILLEGAL_UID16?ILLEGAL_UID:(__uid32_t)(u16)) #define gid16togid32(g16) ((g16)==ILLEGAL_GID16?ILLEGAL_GID:(__gid32_t)(g16)) +/* Convert LARGE_INTEGER into long long */ +#define get_ll(pl) (((long long) (pl).HighPart << 32) | (pl).LowPart) + /* various events */ void events_init (void); void events_terminate (void);