From d89d2c81adbab049b8b04aafd59baae0ad2f28f2 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Fri, 29 Nov 2013 22:25:51 +0000 Subject: [PATCH] [DEVMGR] - fix warning & bug - patch by Thomas Faber CORE-7593 #resolve #comment fixed svn path=/trunk/; revision=61147 --- reactos/dll/win32/devmgr/hwresource.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/reactos/dll/win32/devmgr/hwresource.c b/reactos/dll/win32/devmgr/hwresource.c index c78696b2792..5b1c6f701d6 100644 --- a/reactos/dll/win32/devmgr/hwresource.c +++ b/reactos/dll/win32/devmgr/hwresource.c @@ -251,7 +251,7 @@ AddResourceItems( DWORD dwSize; PCM_RESOURCE_LIST ResourceList; LONG Result; - INT ItemCount = 0, Index = 0; + ULONG ItemCount = 0, Index; wsprintf(szBuffer, L"SYSTEM\\CurrentControlSet\\Enum\\%s\\LogConf", dap->szDeviceID); Result = RegOpenKeyExW(HKEY_LOCAL_MACHINE, szBuffer, 0, KEY_READ, &hKey); @@ -273,9 +273,9 @@ AddResourceItems( ResourceList = (PCM_RESOURCE_LIST)szData; - do + for (Index = 0; Index < ResourceList->List[0].PartialResourceList.Count; Index++) { - PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor = (PCM_PARTIAL_RESOURCE_DESCRIPTOR)&ResourceList->List[0].PartialResourceList.PartialDescriptors[ItemCount]; + PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[Index]; if (Descriptor->Type == CmResourceTypeInterrupt) { if (LoadString(hDllInstance, IDS_RESOURCE_INTERRUPT, szBuffer, sizeof(szBuffer) / sizeof(szBuffer[0]))) @@ -312,9 +312,7 @@ AddResourceItems( ItemCount++; } } - - Index++; - }while(Index <= ResourceList->List[0].PartialResourceList.Count); + } }