advapi32: Sign-compare warnings fix.

This commit is contained in:
Andrew Talbot 2008-07-21 22:12:04 +01:00 committed by Alexandre Julliard
parent eb612fd4dc
commit 414cdc0475
3 changed files with 17 additions and 17 deletions

View File

@ -470,8 +470,8 @@ LSTATUS WINAPI RegEnumKeyExW( HKEY hkey, DWORD index, LPWSTR name, LPDWORD name_
KEY_NODE_INFORMATION *info = (KEY_NODE_INFORMATION *)buffer;
DWORD total_size;
TRACE( "(%p,%d,%p,%p(%d),%p,%p,%p,%p)\n", hkey, index, name, name_len,
name_len ? *name_len : -1, reserved, class, class_len, ft );
TRACE( "(%p,%d,%p,%p(%u),%p,%p,%p,%p)\n", hkey, index, name, name_len,
name_len ? *name_len : 0, reserved, class, class_len, ft );
if (reserved) return ERROR_INVALID_PARAMETER;
if (!(hkey = get_special_root_hkey( hkey ))) return ERROR_INVALID_HANDLE;
@ -534,8 +534,8 @@ LSTATUS WINAPI RegEnumKeyExA( HKEY hkey, DWORD index, LPSTR name, LPDWORD name_l
KEY_NODE_INFORMATION *info = (KEY_NODE_INFORMATION *)buffer;
DWORD total_size;
TRACE( "(%p,%d,%p,%p(%d),%p,%p,%p,%p)\n", hkey, index, name, name_len,
name_len ? *name_len : -1, reserved, class, class_len, ft );
TRACE( "(%p,%d,%p,%p(%u),%p,%p,%p,%p)\n", hkey, index, name, name_len,
name_len ? *name_len : 0, reserved, class, class_len, ft );
if (reserved) return ERROR_INVALID_PARAMETER;
if (!(hkey = get_special_root_hkey( hkey ))) return ERROR_INVALID_HANDLE;

View File

@ -2119,28 +2119,31 @@ LookupAccountSidW(
}
if (dm) {
DWORD ac_len = lstrlenW(ac);
DWORD dm_len = lstrlenW(dm);
BOOL status = TRUE;
if (*accountSize > lstrlenW(ac)) {
if (*accountSize > ac_len) {
if (account)
lstrcpyW(account, ac);
}
if (*domainSize > lstrlenW(dm)) {
if (*domainSize > dm_len) {
if (domain)
lstrcpyW(domain, dm);
}
if (((*accountSize != 0) && (*accountSize < strlenW(ac))) ||
((*domainSize != 0) && (*domainSize < strlenW(dm)))) {
if (((*accountSize != 0) && (*accountSize < ac_len)) ||
((*domainSize != 0) && (*domainSize < dm_len))) {
SetLastError(ERROR_INSUFFICIENT_BUFFER);
status = FALSE;
}
if (*domainSize)
*domainSize = strlenW(dm);
*domainSize = dm_len;
else
*domainSize = strlenW(dm) + 1;
*domainSize = dm_len + 1;
if (*accountSize)
*accountSize = strlenW(ac);
*accountSize = ac_len;
else
*accountSize = strlenW(ac) + 1;
*accountSize = ac_len + 1;
*name_use = use;
HeapFree(GetProcessHeap(), 0, computer_name);
return status;
@ -4050,7 +4053,7 @@ static BOOL DumpSidNumeric(PSID psid, WCHAR **pwptr, ULONG *plen)
static BOOL DumpSid(PSID psid, WCHAR **pwptr, ULONG *plen)
{
int i;
size_t i;
for (i = 0; i < sizeof(WellKnownSids) / sizeof(WellKnownSids[0]); i++)
{
if (WellKnownSids[i].wstr[0] && EqualSid(psid, (PSID)&(WellKnownSids[i].Sid.Revision)))
@ -4102,7 +4105,7 @@ static void DumpRights(DWORD mask, WCHAR **pwptr, ULONG *plen)
{
static const WCHAR fmtW[] = {'0','x','%','x',0};
WCHAR buf[15];
int i;
size_t i;
if (mask == 0)
return;

View File

@ -1599,9 +1599,6 @@ QueryServiceConfigW( SC_HANDLE hService,
move_string_to_buffer(&bufpos, &lpServiceConfig->lpServiceStartName);
move_string_to_buffer(&bufpos, &lpServiceConfig->lpDisplayName);
if (bufpos - (LPBYTE)lpServiceConfig > cbBufSize)
ERR("Buffer overflow!\n");
TRACE("Image path = %s\n", debugstr_w(lpServiceConfig->lpBinaryPathName) );
TRACE("Group = %s\n", debugstr_w(lpServiceConfig->lpLoadOrderGroup) );
TRACE("Dependencies = %s\n", debugstr_w(lpServiceConfig->lpDependencies) );