Recent

Author Topic: Question regarding ToolHelp32  (Read 3089 times)

440bx

  • Hero Member
  • *****
  • Posts: 4023
Question regarding ToolHelp32
« on: February 14, 2019, 11:53:03 pm »
Hello,

While porting Delphi v2.0 code, FPC complains that TLHelp32 is not found.

To be certain, I searched the libraries included with Lazarus and only found TLHelp32 for WinCE.  I also found a TLHelp32 translation from the Jedi group but, the unit name is different (prefixed jwa.)

I just wanted to make sure that there is no TLHelp32 unit for desktop Windows that I may have missed.  Is this really the case ?

Thank you for your help.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Question regarding ToolHelp32
« Reply #1 on: February 15, 2019, 12:31:51 am »
I just wanted to make sure that there is no TLHelp32 unit for desktop Windows that I may have missed.  Is this really the case ?

Yes, there are no others than the WinCE and the JEDI ones:

Code: Bash  [Select][+][-]
  1. lucamar@selene:~/SoftDev/z/FPC source/3.0.4$ fgrep -iRl "CreateToolhelp32" *
  2. packages/winunits-jedi/src/jwatlhelp32.pas
  3. packages/winceunits/src/tlhelp32.pas
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

440bx

  • Hero Member
  • *****
  • Posts: 4023
Re: Question regarding ToolHelp32
« Reply #2 on: February 15, 2019, 12:44:08 am »
Yes, there are no others than the WinCE and the JEDI ones:

Code: Bash  [Select][+][-]
  1. lucamar@selene:~/SoftDev/z/FPC source/3.0.4$ fgrep -iRl "CreateToolhelp32" *
  2. packages/winunits-jedi/src/jwatlhelp32.pas
  3. packages/winceunits/src/tlhelp32.pas

Thank you Lucamar.  I suspected that but, I wanted confirmation I had not missed it.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

PascalDragon

  • Hero Member
  • *****
  • Posts: 5469
  • Compiler Developer
Re: Question regarding ToolHelp32
« Reply #3 on: February 15, 2019, 09:03:37 am »
Just using the Jedi unit should be enough. It's only an API import anyway (though there could be differences with pointer parameters (regarding var vs. no var), don't know what the Delphi unit used there in comparison to the Jedi one).

440bx

  • Hero Member
  • *****
  • Posts: 4023
Re: Question regarding ToolHelp32
« Reply #4 on: February 15, 2019, 12:05:48 pm »
Just using the Jedi unit should be enough. It's only an API import anyway (though there could be differences with pointer parameters (regarding var vs. no var), don't know what the Delphi unit used there in comparison to the Jedi one).
Yes, the Jedi unit would do fine.  My goal is to make Delphi 2 code compile with FPC in both 32bit and 64bit code with a _minimum_ of changes in the code.  Since Delphi has a TLHelp32 unit, I simply made a new TLHelp32 that works in 32bit, 64bit, Delphi and FPC.

(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018