Forum > General

Compile IDE for non supported OS (actually could I modify source a bit)

(1/2) > >>

Azvareth:
Hi

Before anyone shout out that this OS is not supported and what not, actually what I am trying to do is to figure out if it is possible to remove some part in the source (or change it) to compile the IDE.

Background:
I tried to recompile the IDE 1.4.4 on a physical Windows 98SE, 512MB RAM, AMD Athlon 3200+ and all unofficial updates and patches that exists to this day (as far as I know). According to the documentation that exists it should work, but I came along some problem, a call to Process32FirstW in kernel32.dll I think (which came with XP?) that function name does not exist on W98:Kernel32.DLL, or if it does it throw an error when launching lazarus IDE. as far as I know it is named Process32First there.

So I run a search in the source files and found that the call was made from (pasted from agent ransack)
debugattachdialog.pas H:\DEV\lazarus\debugger\                                    2015-01-09 11:33:13 9 KB  Pascal Source Code 1   
jwatlhelp32.pas       H:\DEV\lazarus\fpc\2.6.4\source\packages\winunits-jedi\src\ 2010-04-30 15:01:55 19 KB Pascal Source Code 9
As you can see, there is two references, my question is (based on the names of the files) is it possible to remove those references (or files) and still get the IDE to work?

Or perhaps modify the reference to take the Win98 function

in debugattachdialog.pas the call is made like this

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  {$ifdef WIN9XPLATFORM}  Result := False;  {$else}  Result := True; // we can enumerate processes  if not Assigned(AList) then    Exit;   hShot := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);  if hShot = INVALID_HANDLE_VALUE then    Exit;   try    FillByte(pe, SizeOf(pe), 0);    pe.dwSize := SizeOf(pe);    if Process32FirstW(hShot, pe) then           //<------------ NOT CORRECT OR?    repeat      item := TRunningProcessInfo.Create(pe.th32ProcessID, pe.szExeFile);      AList.Add(item);    until not Process32NextW(hShot, pe);      //<------------- NOT CORRECT OR?   finally    CloseHandle(hShot);  end;  {$endif}

the function arguments for the Win98 seems similar to the latter OS versions (only the name differs) is it possible to change this without breaking something else or do you have other method to use when fixing stuff?

And btw, I am not a pro coder, more like a scriptie elderly - so I am not to familiar with deeper OS and system stuff, or how lazarus works behind the sceene...

I hope someone understand what I am trying to achieve here, and hopefully can give some advice. Thank you.

wp:
The only advice that you will get in such a border case is: Try it. What can go wrong? And it is free code, you can do on your machine whatever you want.

balazsszekely:
You should build the IDE with Process32First, Process32Next those functions are available in win98.

marcov:
Rule of thumb: if the system comes with FPC 3.0.x, it will be hard.

In your case it comes with 2.6.x, so at least you have a change. There are probably only two hands of places that might need fixing, maybe even less.

So it is just find place where missing call is used (and that is probably not jwatlhelp32, but some other places that USES those declarations), fix/replace it (internet is your friend) recompile everything, check what breaks next etc etc.

Or just try to go versions back in time till you find one that works.

Azvareth:

--- Quote from: wp on June 29, 2018, 02:12:56 pm ---The only advice that you will get in such a border case is: Try it. What can go wrong? And it is free code, you can do on your machine whatever you want.

--- End quote ---

->Thank you!


--- Quote from: GetMem on June 29, 2018, 02:13:53 pm ---You should build the IDE with Process32First, Process32Next those functions are available in win98.

--- End quote ---

-> I did exactly that in the source of debugattachdialog.pas


--- Quote from: marcov on June 29, 2018, 02:41:57 pm ---Rule of thumb: if the system comes with FPC 3.0.x, it will be hard.

In your case it comes with 2.6.x, so at least you have a change. There are probably only two hands of places that might need fixing, maybe even less.

So it is just find place where missing call is used (and that is probably not jwatlhelp32, but some other places that USES those declarations), fix/replace it (internet is your friend) recompile everything, check what breaks next etc etc.

Or just try to go versions back in time till you find one that works.

--- End quote ---

-> Actually I have also read, but I might be wrong that some IDE's that where shipped with 3.x of FPC could be made to compile with the FPC2.6.x



So it did work, I changed the function names in debugattachdialog.pas file and it compiled fine just as before, when I tried to launch the IDE it did work... I tested a Button and MessageBox "hello world" test and it compiled and did run just fine... Can't tell if more complex applications would fail.

Conclusion: The code inside the source is wrong, there is directive that IF it is compiled for Win9x use a library that is for XP and up. However noone has complained? I guess that noone has ever tried it with W9x so there is not much to say about it, just that if someone else "would" like to compile it for the same OS, this post provides information to fix that error...


//Thank you!

Navigation

[0] Message Index

[#] Next page

Go to full version