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

Martin Vieregg

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 8
  • Posts: 226
    • 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
  • *****
  • Thank You
  • -Given: 503
  • -Receive: 100
  • Posts: 2750
  • 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
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 48
  • Posts: 593
    • 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
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 186
  • Posts: 2537
    • 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
  • *****
  • Thank You
  • -Given: 503
  • -Receive: 100
  • Posts: 2750
  • 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

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 8
  • Posts: 226
    • 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
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 186
  • Posts: 2537
    • 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

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 8
  • Posts: 226
    • 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
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 186
  • Posts: 2537
    • 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

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 8
  • Posts: 226
    • 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
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 48
  • Posts: 593
    • 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