diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index af4f4d3b067..f134da18aa1 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -1349,7 +1349,8 @@ BOOL WINAPI SetupDiCreateDeviceInfoA( static DWORD SETUPDI_DevNameToDevID(LPCWSTR devName) { LPCWSTR ptr; - DWORD devNameLen = lstrlenW(devName), devInst = 0; + int devNameLen = lstrlenW(devName); + DWORD devInst = 0; BOOL valid = TRUE; TRACE("%s\n", debugstr_w(devName)); @@ -1704,7 +1705,7 @@ BOOL WINAPI SetupDiGetDeviceInstanceIdW( return FALSE; } TRACE("instance ID: %s\n", debugstr_w(devInfo->instanceId)); - if (DeviceInstanceIdSize < lstrlenW(devInfo->instanceId) + 1) + if (DeviceInstanceIdSize < strlenW(devInfo->instanceId) + 1) { SetLastError(ERROR_INSUFFICIENT_BUFFER); if (RequiredSize) diff --git a/dlls/setupapi/parser.c b/dlls/setupapi/parser.c index 8c8a5184fbc..c2bd84cd668 100644 --- a/dlls/setupapi/parser.c +++ b/dlls/setupapi/parser.c @@ -199,7 +199,7 @@ static struct line *find_line( struct inf_file *file, int section_index, const W { struct section *section; struct line *line; - int i; + unsigned int i; if (section_index < 0 || section_index >= file->nb_sections) return NULL; section = file->sections[section_index]; diff --git a/dlls/setupapi/query.c b/dlls/setupapi/query.c index c5dce78319a..f44826d54b6 100644 --- a/dlls/setupapi/query.c +++ b/dlls/setupapi/query.c @@ -580,7 +580,7 @@ BOOL WINAPI SetupGetTargetPathW( HINF hinf, PINFCONTEXT context, PCWSTR section, INFCONTEXT ctx; WCHAR *dir; - INT size; + unsigned int size; TRACE("%p, %p, %s, %p, 0x%08x, %p\n", hinf, context, debugstr_w(section), buffer, buffer_size, required_size); @@ -591,7 +591,7 @@ BOOL WINAPI SetupGetTargetPathW( HINF hinf, PINFCONTEXT context, PCWSTR section, if (!(dir = PARSER_get_dest_dir( context ? context : &ctx ))) return FALSE; - size = lstrlenW( dir ) + 1; + size = strlenW( dir ) + 1; if (required_size) *required_size = size; if (buffer)