18#define wprintf(...) ConPrintf(StdOut, ##__VA_ARGS__)
98 if (pTokenInfo ==
NULL)
100 wprintf(
L"ERROR: not enough memory to allocate the token structure.\n");
123 #define RC_STRING_MAX_SIZE 850
165 wprintf(
L"ERROR: Not enough memory for displaying the table.\n");
208 wprintf(
L"ERROR: The table passed for display is empty.\n");
228 pTable->Content[
j][ThisLength++] =
L':';
231 ColLength[0] =
max(ThisLength, ColLength[0]);
241 ColLength[
j] =
max(ThisLength, ColLength[
j]);
280 for (CurRow = 1; CurRow <
pTable->Rows; CurRow++)
289 for (CurRow = 1; CurRow <
pTable->Rows; CurRow++)
299 for (CurCol = 0; CurCol <
pTable->Cols; CurCol++)
308 if (CurRow != FinalRow)
382 if (pGroupInfo ==
NULL)
386 for (dwIndex = 0; dwIndex < pGroupInfo->
GroupCount; dwIndex++)
397 wprintf(
L"ERROR: Couldn't find the logon SID.\n");
403 wprintf(
L"ERROR: Couldn't convert the logon SID to a string.\n");
426 if (pUserInfo ==
NULL)
432 if (pUserStr ==
NULL)
467 static WCHAR szGroupName[255] = {0};
468 static WCHAR szDomainName[255] = {0};
474 BYTE SidNameUseStr[12] =
493 if (pGroupInfo ==
NULL)
510 for (dwIndex = 0; dwIndex < pGroupInfo->
GroupCount; dwIndex++)
524 wchar_t tmpBuffer[666];
538 cchDomainName ?
L"\\" :
L"",
575 ZeroMemory(szDomainName,
sizeof(szDomainName));
592 DWORD dwResult = 0, dwIndex = 0;
595 if (pPrivInfo ==
NULL)
611 DWORD PrivNameSize = 0, DispNameSize = 0;
647 if (DispName !=
NULL)
667 #define WAM_USER 1<<0
668 #define WAM_GROUPS 1<<1
669 #define WAM_PRIV 1<<2
763 goto FoValueExpected;
#define ConInitStdStreams()
#define IDS_ATTR_GROUP_ENABLED
#define IDS_TP_WELL_KNOWN_GROUP
#define IDS_ERROR_NH_LIST
#define IDS_ATTR_GROUP_OWNER
#define IDS_ATTR_GROUP_ENABLED_BY_DEFAULT
#define IDS_STATE_ENABLED
#define IDS_COL_USER_NAME
#define IDS_ATTR_GROUP_MANDATORY
#define IDS_COL_PRIV_NAME
#define IDS_STATE_DISABLED
#define IDS_ERROR_INVALIDARG
#define IDS_ERROR_VALUEXPECTED
#define IDS_COL_GROUP_NAME
#define IDS_ERROR_INVALIDSYNTAX
#define IDS_ERROR_VALUENOTALLOWED
#define IDS_UNKNOWN_DESCRIPTION
#define IDS_COL_DESCRIPTION
#define ERROR_INSUFFICIENT_BUFFER
BOOL WINAPI LookupPrivilegeDisplayNameW(LPCWSTR lpSystemName, LPCWSTR lpName, LPWSTR lpDisplayName, LPDWORD cchDisplayName, LPDWORD lpLanguageId)
BOOL WINAPI LookupPrivilegeNameW(LPCWSTR lpSystemName, PLUID lpLuid, LPWSTR lpName, LPDWORD cchName)
BOOL WINAPI LookupAccountSidW(LPCWSTR pSystemName, PSID pSid, LPWSTR pAccountName, LPDWORD pdwAccountName, LPWSTR pDomainName, LPDWORD pdwDomainName, PSID_NAME_USE peUse)
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
BOOL WINAPI ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid)
#define GetCurrentProcess()
#define HeapFree(x, y, z)
static DWORD DWORD * dwLength
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
HLOCAL NTAPI LocalFree(HLOCAL hMem)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
enum _SID_NAME_USE SID_NAME_USE
int _snwprintf(wchar_t *buffer, size_t count, const wchar_t *format,...)
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ BOOLEAN _In_ TOKEN_TYPE TokenType
#define SE_GROUP_LOGON_ID
#define SE_GROUP_MANDATORY
#define SE_GROUP_ENABLED_BY_DEFAULT
_In_ ULONG _In_ ULONG _In_ ULONG Length
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOLEAN WINAPI GetUserNameExW(EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer, PULONG nSize)
base of all file and directory entries
SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY]
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
static const EHCI_PERIOD pTable[]
#define RC_STRING_MAX_SIZE
LPWSTR WhoamiLoadRcString(INT ResId)
void WhoamiPrintHeader(int HeaderId)
void WhoamiPrintTable(WhoamiTable *pTable)
VOID * WhoamiGetTokenInfo(TOKEN_INFORMATION_CLASS TokenType)
BOOL GetArgument(WCHAR *arg, int argc, WCHAR *argv[])
BOOL WhoamiFree(VOID *Buffer)
void WhoamiSetTable(WhoamiTable *pTable, WCHAR *Entry, UINT Row, UINT Col)
WhoamiTable * WhoamiAllocTable(UINT Rows, UINT Cols)
void WhoamiSetTableDyn(WhoamiTable *pTable, WCHAR *Entry, UINT Row, UINT Col)
void BlankArgument(int argc, WCHAR *argv[])
LPWSTR WhoamiGetUser(EXTENDED_NAME_FORMAT NameFormat)
DWORD WINAPI GetLastError(void)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
LPWSTR WINAPI CharLowerW(_Inout_ LPWSTR)
struct _TOKEN_GROUPS * PTOKEN_GROUPS
struct _TOKEN_USER * PTOKEN_USER
struct _TOKEN_PRIVILEGES * PTOKEN_PRIVILEGES
enum _TOKEN_INFORMATION_CLASS TOKEN_INFORMATION_CLASS
#define SE_PRIVILEGE_ENABLED