Author: janderwald Date: Fri Nov 29 22:25:51 2013 New Revision: 61147
URL: http://svn.reactos.org/svn/reactos?rev=61147&view=rev Log: [DEVMGR] - fix warning & bug - patch by Thomas Faber CORE-7593 #resolve #comment fixed
Modified: trunk/reactos/dll/win32/devmgr/hwresource.c
Modified: trunk/reactos/dll/win32/devmgr/hwresource.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/devmgr/hwresource... ============================================================================== --- trunk/reactos/dll/win32/devmgr/hwresource.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/devmgr/hwresource.c [iso-8859-1] Fri Nov 29 22:25:51 2013 @@ -251,7 +251,7 @@ 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 @@
ResourceList = (PCM_RESOURCE_LIST)szData;
- do - { - PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor = (PCM_PARTIAL_RESOURCE_DESCRIPTOR)&ResourceList->List[0].PartialResourceList.PartialDescriptors[ItemCount]; + for (Index = 0; Index < ResourceList->List[0].PartialResourceList.Count; Index++) + { + 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 @@ ItemCount++; } } - - Index++; - }while(Index <= ResourceList->List[0].PartialResourceList.Count); + } }