Author Topic: Table of similar API calls for OS/2 and Windows ?  (Read 8155 times)

Martin Vieregg

  • Sr. Member
  • ****
  • Posts: 278
  • Karma: +2/-0
    • View Profile
Table of similar API calls for OS/2 and Windows ?
« on: July 11, 2020, 11:13:01 pm »
Does a tutorial or list of corresponding API calls for OS/2 and Windows, like DosCreateNPipe (OS/2) and CreateNamedPipe (Windows) exist somewhere?

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Table of similar API calls for OS/2 and Windows ?
« Reply #1 on: July 12, 2020, 01:03:27 am »
Hi Martin

I don't understand exactly if you need the documentation of the OS/2 CPI API.
Here on the EDM/2 I had tried to consolidate as much as possible of OS/2 development related documentation.

- http://www.edm2.com/index.php/The_OS/2_API_Project
- http://www.edm2.com/index.php/Control_Program_Functions_List
- http://www.edm2.com/index.php/DosCreateNPipe
Or maybe the wiki search:
- http://www.edm2.com/index.php?title=Special%3ASearch&profile=default&search=DosCreateNPipe*&fulltext=Search

I hope this helps

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Neil Waldhauer

  • Hero Member
  • *****
  • Posts: 1024
  • Karma: +24/-0
    • View Profile
    • Blonde Guy
Re: Table of similar API calls for OS/2 and Windows ?
« Reply #2 on: July 12, 2020, 05:15:53 am »
The OS/2 API and the Win32 API are very similar as of 1999. After the Windows 2000 beta things really started to diverge. So the best document I can think of to use is 1999 MSDN. They printed 1000's of sets; I'm sure there are some still around.

The advantage of this over newer docs is that in 1999, Win32 contained little that wasn't in OS/2.

I have not seen a table comparing the API. There must have been one in the ODIN project.

The OS/2 API as described in the redbooks is better documented than Win32 in the MSDN. So the IBM OS/2 docs were actually useful to program Win32. Now you can just type a Windows API function name into google and get the documentation page.
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Table of similar API calls for OS/2 and Windows ?
« Reply #3 on: July 12, 2020, 05:38:52 am »
There's also Open32, which implemented lots of Win32 functions in OS/2. It is documented in the Toolkit, \os2tk45\book\open32.inf. It has mostly been super seeded by Odin but I assume the basic library is still there.
There are also some libc functions such as _beginthread() that are identical between Win32 and OS/2. Of course now Win32 uses _beginthreadex() for added security.
« Last Edit: July 12, 2020, 07:59:15 am by Dave Yeo »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4713
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Table of similar API calls for OS/2 and Windows ?
« Reply #4 on: July 12, 2020, 07:02:05 am »
. It is documented in the Toolkit, \os2tk45\book\open32.inf. ...

Just in case here it is a link to it: http://www.edm2.com/index.php/Open32

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Vieregg

  • Sr. Member
  • ****
  • Posts: 278
  • Karma: +2/-0
    • View Profile
Re: Table of similar API calls for OS/2 and Windows ?
« Reply #5 on: July 12, 2020, 09:02:49 am »
The purpose is porting the OS-specific parts of MeShell (pipes, semaphores, VIO buffer access, exceptions) from OS/2 to Windows. It is only a small percentage of the code (ME is already platform-independent), but they are very specific calls.
The Open32 docu only shows the Windows calls, but it is only a subset of the most common calls.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Table of similar API calls for OS/2 and Windows ?
« Reply #6 on: July 12, 2020, 07:05:02 pm »
I think you might run across the problem that Windows has evolved security wise so those calls, pipes, semaphores etc, have been updated with ownership properties. eg, _beginthread() vs _beginthreadex() so porting to modern NT is not as simple as porting to Win9x or older NT when so much just ran as administrator.

Martin Vieregg

  • Sr. Member
  • ****
  • Posts: 278
  • Karma: +2/-0
    • View Profile
Re: Table of similar API calls for OS/2 and Windows ?
« Reply #7 on: July 13, 2020, 11:25:10 am »
I have copied an old win32.hlp / win32.cnt from a Borland C 5.0 CD from 1996. There the pure Win32 API is described. It should fit my purpose better than current descriptions. Winhlp32.exe works fine with Odin.

Open32.inf has no description of the Win32 API calls included. Is the source code of Open32 available? There the translations (both OS/2 and Win32 API calls) should be shown.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Table of similar API calls for OS/2 and Windows ?
« Reply #8 on: July 13, 2020, 05:12:15 pm »
No source that I'm aware of, just os2win.h in the toolkit. Looking at the samples, recompiling is often as simple as changing windows.h to os2win.h, converting rc files, ptrs and such, creating a def file and recompiling. I'd guess the API is close to your '96 SDK.

Martin Vieregg

  • Sr. Member
  • ****
  • Posts: 278
  • Karma: +2/-0
    • View Profile
Re: Table of similar API calls for OS/2 and Windows ?
« Reply #9 on: July 15, 2020, 11:46:31 am »
Are there download links for the toolkit?
I could take a look at the h files, I hope I will see the direct API call correspondences.

I have got an OS/2 program and want to get a Windows program. (It is the reverse direction.)

Neil Waldhauer

  • Hero Member
  • *****
  • Posts: 1024
  • Karma: +24/-0
    • View Profile
    • Blonde Guy
Re: Table of similar API calls for OS/2 and Windows ?
« Reply #10 on: July 15, 2020, 03:15:15 pm »
Use RPM/YUM to install the toolkit. Or download from a Warez site.
Expert consulting for ArcaOS, OS/2 and eComStation
http://www.blondeguy.com

Doug Clark

  • Sr. Member
  • ****
  • Posts: 306
  • Karma: +7/-1
    • View Profile
Re: Table of similar API calls for OS/2 and Windows ?
« Reply #11 on: August 13, 2021, 02:57:00 pm »
Martin,

I have tried running winhlp32.exe from various sources (WinNT, WinXP, etc.) in Odin and I always get the message

"The winhelp32.exe binary in the Windows directory is corrupt, please reinstall."

update..
I installed BC v 5 and it does not have winhlp32.exe.  However I found two winhlp32.exe files on my WinNT machine: one in C:\WINNT and the other in C:\WINNT\SYSTEM32.   The one that runs correctly is in C:\WINNT - which is attached.  The one in C:\WINNT\SYSTEM32 produces the error message above.


I placed the correct WinHlp32.exe in e:\var\lib\odin where e: is my unixroot  (Odin installed via RPM - if you install Odin from WarpIn your directory will be different).  If you click on the HELP button of a Win32 app running in Odin it will start WinHlp32.exe - however WinHlp32.exe cannot find the help file.  It prompts you to locate the *.HLP file needed.  If I place WinHlp32.exe in the directory of the application and that directory also has the *.HLP file everything runs correctly.



« Last Edit: August 13, 2021, 10:10:26 pm by Doug Clark »