summaryrefslogtreecommitdiff
path: root/testprogs/win32/spoolss
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-02-11 00:04:53 +0100
committerGünther Deschner <gd@samba.org>2010-02-11 13:24:41 +0100
commit490e1f84fede5585c6c611a5720b9f2362a9214f (patch)
tree155dc0d48be8895f1decffc75270636a6d0d6e6c /testprogs/win32/spoolss
parent7bd7194c2b319d260ef1d98f138b9dfcf59db8a7 (diff)
downloadsamba-490e1f84fede5585c6c611a5720b9f2362a9214f.tar.gz
samba-490e1f84fede5585c6c611a5720b9f2362a9214f.tar.bz2
samba-490e1f84fede5585c6c611a5720b9f2362a9214f.zip
testprogs: use ConvertSidToStringSid in order to print sids in spoolss test.
Guenther
Diffstat (limited to 'testprogs/win32/spoolss')
-rw-r--r--testprogs/win32/spoolss/printlib.c28
1 files changed, 16 insertions, 12 deletions
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 <windows.h>
#include <stdio.h>
#include <assert.h>
+#include <sddl.h>
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;
}