DXGL r25 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r24‎ | r25 | r26 >
Date:20:51, 11 December 2011
Author:admin
Status:new
Tags:
Comment:
emergency fix for 0.1.0 dxglcfg crash
Modified paths:
  • /dxglcfg/dxglcfg.cpp (modified) (history)

Diff [purge]

Index: dxglcfg/dxglcfg.cpp
@@ -581,17 +581,17 @@
582582 regbuffer[0] = regbuffer[1] = 0;
583583 error = RegQueryValueEx(hKey,_T("InstallPaths"),NULL,NULL,(LPBYTE)regbuffer,&buffersize);
584584 regbufferpos = 0;
585 - apps[i].regkey = new tstring(keyname);
586 - GetConfig(&apps[i].cfg,&apps[i].mask,keyname);
587 - apps[i].dirty = false;
 585+ apps[appcount-1].regkey = new tstring(keyname);
 586+ GetConfig(&apps[appcount-1].cfg,&apps[appcount-1].mask,keyname);
 587+ apps[appcount-1].dirty = false;
588588 while(1)
589589 {
590590 if((regbuffer[regbufferpos] == 0) || error != ERROR_SUCCESS)
591591 {
592592 // Default icon
593 - apps[i].icon = LoadIcon(NULL,IDI_APPLICATION);
594 - apps[i].icon_shared = true;
595 - apps[i].name = new tstring(subkey);
 593+ apps[appcount-1].icon = LoadIcon(NULL,IDI_APPLICATION);
 594+ apps[appcount-1].icon_shared = true;
 595+ apps[appcount-1].name = new tstring(subkey);
596596 break;
597597 }
598598 path = tstring(((LPTSTR)regbuffer+regbufferpos))+tstring(_T("\\"))+subkey;
@@ -602,8 +602,8 @@
603603 }
604604 // Get exe attributes
605605 error = SHGetFileInfo(path.c_str(),0,&fileinfo,sizeof(SHFILEINFO),SHGFI_ICON|SHGFI_SMALLICON|SHGFI_ADDOVERLAYS);
606 - apps[i].icon = fileinfo.hIcon;
607 - apps[i].icon_shared = false;
 606+ apps[appcount-1].icon = fileinfo.hIcon;
 607+ apps[appcount-1].icon_shared = false;
608608 verinfosize = GetFileVersionInfoSize(path.c_str(),NULL);
609609 verinfo = malloc(verinfosize);
610610 hasname = false;
@@ -616,7 +616,7 @@
617617 if(VerQueryValue(verinfo,verpath,(LPVOID*)&outbuffer,&outlen))
618618 {
619619 hasname = true;
620 - apps[i].name = new tstring(outbuffer);
 620+ apps[appcount-1].name = new tstring(outbuffer);
621621 }
622622 else
623623 {
@@ -624,7 +624,7 @@
625625 if(VerQueryValue(verinfo,verpath,(LPVOID*)&outbuffer,&outlen))
626626 {
627627 hasname = true;
628 - apps[i].name = new tstring(outbuffer);
 628+ apps[appcount-1].name = new tstring(outbuffer);
629629 }
630630 else
631631 {
@@ -632,13 +632,13 @@
633633 if(VerQueryValue(verinfo,verpath,(LPVOID*)&outbuffer,&outlen))
634634 {
635635 hasname = true;
636 - apps[i].name = new tstring(outbuffer);
 636+ apps[appcount-1].name = new tstring(outbuffer);
637637 }
638638 }
639639 }
640640 }
641641 }
642 - if(!hasname) apps[i].name = new tstring(subkey);
 642+ if(!hasname) apps[appcount-1].name = new tstring(subkey);
643643 free(verinfo);
644644 break;
645645 }