--------------------- PatchSet 10534 Date: 2008/05/03 09:15:08 Author: serassio Branch: nt Tag: (none) Log: Ran indent Members: helpers/external_acl/mswin_ad_group/mswin_check_ad_group.c:1.1.2.1->1.1.2.2 Index: squid/helpers/external_acl/mswin_ad_group/mswin_check_ad_group.c =================================================================== RCS file: /cvsroot/squid-sf//squid/helpers/external_acl/mswin_ad_group/Attic/mswin_check_ad_group.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- squid/helpers/external_acl/mswin_ad_group/mswin_check_ad_group.c 3 May 2008 08:58:26 -0000 1.1.2.1 +++ squid/helpers/external_acl/mswin_ad_group/mswin_check_ad_group.c 3 May 2008 09:15:08 -0000 1.1.2.2 @@ -88,42 +88,42 @@ GetDomainName(void) { static char *DomainName = NULL; - PDSROLE_PRIMARY_DOMAIN_INFO_BASIC pDSRoleInfo; + PDSROLE_PRIMARY_DOMAIN_INFO_BASIC pDSRoleInfo; DWORD netret; - - if ((netret = DsRoleGetPrimaryDomainInformation(NULL, DsRolePrimaryDomainInfoBasic, (PBYTE*)&pDSRoleInfo) == ERROR_SUCCESS)) { + + if ((netret = DsRoleGetPrimaryDomainInformation(NULL, DsRolePrimaryDomainInfoBasic, (PBYTE *) & pDSRoleInfo) == ERROR_SUCCESS)) { /* * Check the machine role. */ - if ((pDSRoleInfo->MachineRole == DsRole_RoleMemberWorkstation) || - (pDSRoleInfo->MachineRole == DsRole_RoleMemberServer) || - (pDSRoleInfo->MachineRole == DsRole_RoleBackupDomainController) || - (pDSRoleInfo->MachineRole == DsRole_RolePrimaryDomainController)) { - - size_t len = wcslen(pDSRoleInfo->DomainNameFlat); - - /* allocate buffer for str + null termination */ - safe_free(DomainName); - DomainName = (char *) xmalloc(len + 1); - if (DomainName == NULL) - return NULL; - - /* copy unicode buffer */ - WideCharToMultiByte(CP_ACP, 0, pDSRoleInfo->DomainNameFlat, -1, DomainName, len, NULL, NULL); - - /* add null termination */ - DomainName[len] = '\0'; - - /* + if ((pDSRoleInfo->MachineRole == DsRole_RoleMemberWorkstation) || + (pDSRoleInfo->MachineRole == DsRole_RoleMemberServer) || + (pDSRoleInfo->MachineRole == DsRole_RoleBackupDomainController) || + (pDSRoleInfo->MachineRole == DsRole_RolePrimaryDomainController)) { + + size_t len = wcslen(pDSRoleInfo->DomainNameFlat); + + /* allocate buffer for str + null termination */ + safe_free(DomainName); + DomainName = (char *) xmalloc(len + 1); + if (DomainName == NULL) + return NULL; + + /* copy unicode buffer */ + WideCharToMultiByte(CP_ACP, 0, pDSRoleInfo->DomainNameFlat, -1, DomainName, len, NULL, NULL); + + /* add null termination */ + DomainName[len] = '\0'; + + /* * Member of a domain. Display it in debug mode. */ debug("Member of Domain %s\n", DomainName); - debug("Into forest %S\n", pDSRoleInfo->DomainForestName); + debug("Into forest %S\n", pDSRoleInfo->DomainForestName); - } else { + } else { debug("Not a Domain member\n"); - } + } } else debug("DsRoleGetPrimaryDomainInformation Error: %ld\n", netret); @@ -131,7 +131,7 @@ * Free the allocated memory. */ if (pDSRoleInfo != NULL) - DsRoleFreeMemory(pDSRoleInfo); + DsRoleFreeMemory(pDSRoleInfo); return DomainName; } @@ -287,7 +287,6 @@ NetApiBufferFree(pDCInfo); return result; } - /* Convert ANSI Domain Controller Name to Unicode */ MultiByteToWideChar(CP_ACP, 0, pDCInfo->DomainControllerName,