From 490e1f84fede5585c6c611a5720b9f2362a9214f Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 11 Feb 2010 00:04:53 +0100 Subject: testprogs: use ConvertSidToStringSid in order to print sids in spoolss test. Guenther --- testprogs/win32/spoolss/printlib.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'testprogs') diff --git a/testprogs/win32/spoolss/printlib.c b/testprogs/win32/spoolss/printlib.c index ff185170fc..30f4208c2f 100644 --- a/testprogs/win32/spoolss/printlib.c +++ b/testprogs/win32/spoolss/printlib.c @@ -22,6 +22,7 @@ #include #include #include +#include void print_devmode(DEVMODE *pDevModeIn) { @@ -125,24 +126,27 @@ void print_acl(const char* str, ACL *acl) return; } -void print_sid(const char* str, SID *sid) +void PrintLastError(); + +void print_sid(LPSTR str, PSID sid) { - DWORD i = 0; + LPSTR sid_string; printf("%s\n", str); - printf("0x%x\n", sid); - if (sid == NULL) + + if (sid == NULL) { + printf("(null sid)\n"); + return; + } + + if (!ConvertSidToStringSid(sid, &sid_string)) { + PrintLastError(); return; - printf("\t\tRevision\t\t0x%x\n", sid->Revision); - printf("\t\tSubAuthorityCount\t0x%x\n", sid->SubAuthorityCount); - printf("\t\tSubAuthority\n\t"); - while (i < sid->SubAuthorityCount) { - printf("\t0x%x", sid->SubAuthority[i]); - if (i%4 == 3) - printf("\n\t"); - i++; } + printf("%s\n", sid_string); + LocalFree(sid_string); + return; } -- cgit