-- v4: secur32: Print also text name for EXTENDED_NAME_FORMAT argument. advapi32: Print also text name for POLICY_INFORMATION_CLASS argument.
From: Vitaly Lipatov lav@etersoft.ru
--- dlls/advapi32/lsa.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c index b63519c0299..66a15420f90 100644 --- a/dlls/advapi32/lsa.c +++ b/dlls/advapi32/lsa.c @@ -62,6 +62,35 @@ static void dumpLsaAttributes(const LSA_OBJECT_ATTRIBUTES *oa) } }
+static LPCSTR string_InformationClass[] = +{ + "(null)", + "PolicyAuditLogInformation", + "PolicyAuditEventsInformation", + "PolicyPrimaryDomainInformation", + "PolicyPdAccountInformation", + "PolicyAccountDomainInformation", + "PolicyLsaServerRoleInformation", + "PolicyReplicaSourceInformation", + "PolicyDefaultQuotaInformation", + "PolicyModificationInformation", + "PolicyAuditFullSetInformation", + "PolicyAuditFullQueryInformation", + "PolicyDnsDomainInformation", + "PolicyDnsDomainInformationInt", + "PolicyLocalAccountDomainInformation", + "PolicyMachineAccountInformation", + "PolicyMachineAccountInformation2", + "PolicyLastEntry" +}; + +static LPCSTR debugstr_InformationClass(IN POLICY_INFORMATION_CLASS InformationClass) +{ + if (InformationClass >= ARRAY_SIZE(string_InformationClass)) + return "(unknown)"; + return string_InformationClass[InformationClass]; +} + static void* ADVAPI_GetDomainName(unsigned sz, unsigned ofs) { HKEY key; @@ -779,7 +808,7 @@ NTSTATUS WINAPI LsaQueryInformationPolicy( IN POLICY_INFORMATION_CLASS InformationClass, OUT PVOID *Buffer) { - TRACE("(%p,0x%08x,%p)\n", PolicyHandle, InformationClass, Buffer); + TRACE("(%p,%s(0x%08x),%p)\n", PolicyHandle, debugstr_InformationClass(InformationClass), InformationClass, Buffer);
if(!Buffer) return STATUS_INVALID_PARAMETER; switch (InformationClass) @@ -1016,7 +1045,7 @@ NTSTATUS WINAPI LsaSetInformationPolicy( IN POLICY_INFORMATION_CLASS InformationClass, IN PVOID Buffer) { - FIXME("(%p,0x%08x,%p) stub\n", PolicyHandle, InformationClass, Buffer); + FIXME("(%p,%s(0x%08x),%p) stub\n", PolicyHandle, debugstr_InformationClass(InformationClass), InformationClass, Buffer);
return STATUS_UNSUCCESSFUL; }
From: Vitaly Lipatov lav@etersoft.ru
--- dlls/secur32/secur32.c | 44 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-)
diff --git a/dlls/secur32/secur32.c b/dlls/secur32/secur32.c index d703757bae7..1e02f81df1f 100644 --- a/dlls/secur32/secur32.c +++ b/dlls/secur32/secur32.c @@ -820,6 +820,34 @@ SECURITY_STATUS WINAPI EnumerateSecurityPackagesA(PULONG pcPackages, return ret; }
+ +static LPCSTR string_NameFormat[] = +{ + "NameUnknown", + "NameFullyQualifiedDN", + "NameSamCompatible", + "NameDisplay", + "(unknown)", + "(unknown)", + "NameUniqueId", + "NameCanonical", + "NameUserPrincipal", + "NameCanonicalEx", + "NameServicePrincipal", + "(unknown)", + "NameDnsDomain", + "NameGivenName", + "NameSurname" +}; + +static LPCSTR debugstr_NameFormat(IN EXTENDED_NAME_FORMAT NameFormat) +{ + if (NameFormat >= ARRAY_SIZE(string_NameFormat)) + return "(unknown)"; + return string_NameFormat[NameFormat]; +} + + /*********************************************************************** * GetComputerObjectNameA (SECUR32.@) * @@ -851,7 +879,7 @@ BOOLEAN WINAPI GetComputerObjectNameA( LPWSTR bufferW = NULL; ULONG sizeW = *nSize;
- TRACE("(%d %p %p)\n", NameFormat, lpNameBuffer, nSize); + TRACE("(%s(%d) %p %p)\n", debugstr_NameFormat(NameFormat), NameFormat, lpNameBuffer, nSize);
if (lpNameBuffer) { if (!(bufferW = malloc(sizeW * sizeof(WCHAR)))) { @@ -883,7 +911,7 @@ BOOLEAN WINAPI GetComputerObjectNameW( NTSTATUS ntStatus; BOOLEAN status;
- TRACE("(%d %p %p)\n", NameFormat, lpNameBuffer, nSize); + TRACE("(%s(%d) %p %p)\n", debugstr_NameFormat(NameFormat), NameFormat, lpNameBuffer, nSize);
if (NameFormat == NameUnknown) { @@ -1070,7 +1098,7 @@ BOOLEAN WINAPI GetUserNameExA( BOOLEAN rc; LPWSTR bufferW = NULL; ULONG sizeW = *nSize; - TRACE("(%d %p %p)\n", NameFormat, lpNameBuffer, nSize); + TRACE("(%s(%d) %p %p)\n", debugstr_NameFormat(NameFormat), NameFormat, lpNameBuffer, nSize); if (lpNameBuffer) { bufferW = malloc(sizeW * sizeof(WCHAR)); if (bufferW == NULL) { @@ -1102,7 +1130,7 @@ BOOLEAN WINAPI GetUserNameExA( BOOLEAN WINAPI GetUserNameExW( EXTENDED_NAME_FORMAT NameFormat, LPWSTR lpNameBuffer, PULONG nSize) { - TRACE("(%d %p %p)\n", NameFormat, lpNameBuffer, nSize); + TRACE("(%s(%d) %p %p)\n", debugstr_NameFormat(NameFormat), NameFormat, lpNameBuffer, nSize);
switch (NameFormat) { @@ -1158,8 +1186,8 @@ BOOLEAN WINAPI TranslateNameA( EXTENDED_NAME_FORMAT DesiredNameFormat, LPSTR lpTranslatedName, PULONG nSize) { - FIXME("%p %d %d %p %p\n", lpAccountName, AccountNameFormat, - DesiredNameFormat, lpTranslatedName, nSize); + FIXME("%p %s(%d) %s(%d) %p %p\n", lpAccountName, debugstr_NameFormat(AccountNameFormat), AccountNameFormat, + debugstr_NameFormat(DesiredNameFormat), DesiredNameFormat, lpTranslatedName, nSize); return FALSE; }
@@ -1168,8 +1196,8 @@ BOOLEAN WINAPI TranslateNameW( EXTENDED_NAME_FORMAT DesiredNameFormat, LPWSTR lpTranslatedName, PULONG nSize) { - FIXME("%p %d %d %p %p\n", lpAccountName, AccountNameFormat, - DesiredNameFormat, lpTranslatedName, nSize); + FIXME("%p %s(%d) %s(%d) %p %p\n", lpAccountName, debugstr_NameFormat(AccountNameFormat), AccountNameFormat, + debugstr_NameFormat(DesiredNameFormat), DesiredNameFormat, lpTranslatedName, nSize); return FALSE; }