Re: New release of Phix
- Posted by petelomax Aug 05, 2015
- 1674 views
Hi there,
With the brand new Windows 10 64 bits, there is a crash during installation.
C:\Program Files (x86)\Phix\demo\arwendemo\pgui\pgsetup.ew:265 in function KeyValue2() attempt to divide by 0 key = "HKEY_CURRENT_USER\\" key_id = 2147483649.0 SubKey = "Environment" Value = 39807340 RRF_TYPE = 2 res = 234'ê' data_len = 36'$' lpData = 34655248 data = 0
HKEY_CURRENT_USER\Environment contains following:
... Name: PATH Type : REG_EXPAND_SZ Data : c:\Euphoria4\bin;C:\gtk+_win32\bin; 123456789012345678901234567890123456
Hmm. So as below I've asked RegGetValueA how much space I need and it says 36, which seems to match what is in PATH, but when I actually ask for it, it slings back an ERROR_MORE_DATA...
I might have more luck and less trouble if I started using the WideString versions of these routines I suppose... but that's a fair bit more work.
Perhaps you could try the following? (insert the "if 0 then", the "else..end if", and the final re-peek4u, obviously in C:\Program Files (x86)\Phix\demo\arwendemo\pgui\pgsetup.ew line 265)
res = c_func(RegGetValueA,{key_id,allocate_StringZ(SubKey),Value,RRF_TYPE,NULL,NULL,lpcbData}) if res=0 then -- then get actual data data_len = peek4u(lpcbData) if 0 then -- replaced 5/8/15 lpData = allocate(data_len) -- res = c_func(RegGetValueA,{key_id,SubKey,Value,RRF_TYPE,NULL,lpData,lpcbData}) res = c_func(RegGetValueA,{key_id,allocate_StringZ(SubKey),Value,RRF_TYPE,NULL,lpData,lpcbData}) else while 1 do lpData = allocate(data_len) res = c_func(RegGetValueA,{key_id,allocate_StringZ(SubKey),Value,RRF_TYPE,NULL,lpData,lpcbData}) if res!=ERROR_MORE_DATA then exit end if free(lpData) data_len += 100 poke4(lpcbData,data_len) end while end if if res!=0 then ?9/0 end if -- (it failed on this) data_len = peek4u(lpcbData)
I've only given it a quick test here, on Windows 7.
I assume it crashed before the window appeared and hence before you could read the help. I can assure you it will not do anything until you decide to hit the OK button.
If this ran as part of installation, you'll need to run pw pgui and select the Settings tab.
Thanks, Pete
EDIT: sorry, I somehow omitted the poke4