39#include "blocxx/BLOCXX_config.h"
45#ifdef BLOCXX_HAVE_UNISTD_H
49#ifdef BLOCXX_HAVE_SYS_TYPES_H
53#ifdef BLOCXX_HAVE_PWD_H
66 HANDLE pToken = (HANDLE)0L;
67 DWORD bufLength = 256;
68 static int* tkUser[256];
70 if ( ::OpenProcessToken(::GetCurrentProcess(), TOKEN_QUERY, &pToken) )
72 ::GetTokenInformation(pToken, TokenUser, tkUser, bufLength, &bufLength);
73 sid = ((TOKEN_USER*)tkUser)->User.Sid;
74 TCHAR sName[MAX_PATH], sDName[MAX_PATH];
75 DWORD sNameLen, sDNameLen = sNameLen = MAX_PATH;
77 ::LookupAccountSid( NULL, sid, sName, &sNameLen, sDName, &sDNameLen, &eUse);
114 if ( (
psia->Value[0] != 0) || (
psia->Value[1] != 0) )
117 TEXT(
"0x%02hx%02hx%02hx%02hx%02hx%02hx"),
171#pragma message(Reminder "TODO: Implement for Win if you use getSysconfValue not only for _SC_GETPW_R_SIZE_MAX")
231#ifdef BLOCXX_HAVE_GETPWUID_R
234#ifdef _SC_GETPW_R_SIZE_MAX
290#ifdef BLOCXX_HAVE_GETPWNAM_R
292#ifdef _SC_GETPW_R_SIZE_MAX
306 buf.resize(
buf.size() * 2);
#define BLOCXX_GLOBAL_MUTEX_INIT()
This class can be used to store a global variable that is lazily initialized in a thread safe manner.
This String class is an abstract data type that represents as NULL terminated string of characters.
String getEffectiveUserId()
Get the effective user id.
const UserID INVALID_USERID
String getCurrentUserName()
UserID getUserId(const String &userName, bool &validUserName)
Convert a textual username into a platform native user type.
String getUserName(uid_t uid, bool &ok)
If the username is invalid, or if getUserName() fails for any other reason, 'success' will be set to ...
bool operator==(const Array< T > &x, const Array< T > &y)