Index: dxglcfg/dxglcfg.cpp |
— | — | @@ -581,17 +581,17 @@ |
582 | 582 | regbuffer[0] = regbuffer[1] = 0;
|
583 | 583 | error = RegQueryValueEx(hKey,_T("InstallPaths"),NULL,NULL,(LPBYTE)regbuffer,&buffersize);
|
584 | 584 | 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;
|
588 | 588 | while(1)
|
589 | 589 | {
|
590 | 590 | if((regbuffer[regbufferpos] == 0) || error != ERROR_SUCCESS)
|
591 | 591 | {
|
592 | 592 | // 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);
|
596 | 596 | break;
|
597 | 597 | }
|
598 | 598 | path = tstring(((LPTSTR)regbuffer+regbufferpos))+tstring(_T("\\"))+subkey;
|
— | — | @@ -602,8 +602,8 @@ |
603 | 603 | }
|
604 | 604 | // Get exe attributes
|
605 | 605 | 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;
|
608 | 608 | verinfosize = GetFileVersionInfoSize(path.c_str(),NULL);
|
609 | 609 | verinfo = malloc(verinfosize);
|
610 | 610 | hasname = false;
|
— | — | @@ -616,7 +616,7 @@ |
617 | 617 | if(VerQueryValue(verinfo,verpath,(LPVOID*)&outbuffer,&outlen))
|
618 | 618 | {
|
619 | 619 | hasname = true;
|
620 | | - apps[i].name = new tstring(outbuffer);
|
| 620 | + apps[appcount-1].name = new tstring(outbuffer);
|
621 | 621 | }
|
622 | 622 | else
|
623 | 623 | {
|
— | — | @@ -624,7 +624,7 @@ |
625 | 625 | if(VerQueryValue(verinfo,verpath,(LPVOID*)&outbuffer,&outlen))
|
626 | 626 | {
|
627 | 627 | hasname = true;
|
628 | | - apps[i].name = new tstring(outbuffer);
|
| 628 | + apps[appcount-1].name = new tstring(outbuffer);
|
629 | 629 | }
|
630 | 630 | else
|
631 | 631 | {
|
— | — | @@ -632,13 +632,13 @@ |
633 | 633 | if(VerQueryValue(verinfo,verpath,(LPVOID*)&outbuffer,&outlen))
|
634 | 634 | {
|
635 | 635 | hasname = true;
|
636 | | - apps[i].name = new tstring(outbuffer);
|
| 636 | + apps[appcount-1].name = new tstring(outbuffer);
|
637 | 637 | }
|
638 | 638 | }
|
639 | 639 | }
|
640 | 640 | }
|
641 | 641 | }
|
642 | | - if(!hasname) apps[i].name = new tstring(subkey);
|
| 642 | + if(!hasname) apps[appcount-1].name = new tstring(subkey);
|
643 | 643 | free(verinfo);
|
644 | 644 | break;
|
645 | 645 | }
|