Author Topic: EDM/2 - The API Project - Undocumented  (Read 3467 times)

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5295
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
EDM/2 - The API Project - Undocumented
« on: April 08, 2025, 02:43:12 pm »
Hello

I want to ask a little help here. I found this undocumented functions and I want to see if we can document those on the EDM/2 wiki.

1) DrgQueryFormat
Ref: https://www.edm2.com/index.php/OS/2_DLL_Entry_Points_Cross_Reference
- PMCTLS.107

2) DrgGetClipPS
Ref: https://www.edm2.com/index.php/OS/2_DLL_Entry_Points_Cross_Reference
- PMCTLS.108    PMDRAG.76

I want to provide as close as possible a documentation like this function as sample, syntax, parameters, etc.. just what we can find out.

Thanks in advance.

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

Lars

  • Hero Member
  • *****
  • Posts: 1436
  • Karma: +72/-0
    • View Profile
Re: EDM/2 - The API Project - Undocumented
« Reply #1 on: April 09, 2025, 05:47:55 pm »
"DrgQueryFormat", as a starter: https://www.gladir.com/CODER/COS2/drgqueryformat.htm

ULONG DrgQueryFormat(PDRAGITEM dragItem, PCSZ a, ULONG b, PCSZ c, ULONG d);

Translation: "This function allows to query the data format of a drag operation."

The fun part will be to find out what "a", "b", "c", "d" stand for. I would suspect that "b" is the buffer size of string "a" and "d" is the buffer size of string "c".
My gut feeling is that this function is replaced by functions "DrgQueryNativeRMF" and "DrgQueryNativeRMFLen" plus possibly "DrgQueryTrueType" and "DrgQueryTrueTypeLen".


« Last Edit: April 09, 2025, 05:56:03 pm by Lars »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5295
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: EDM/2 - The API Project - Undocumented
« Reply #2 on: April 09, 2025, 07:01:02 pm »
Thanks Lars.

Here in spanish we say "something is something", which also means "everything counts".

I had created the page with the corresponding warning first:

- https://www.edm2.com/index.php/DrgQueryFormat

Regards
« Last Edit: April 09, 2025, 07:10:52 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5295
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: EDM/2 - The API Project - Undocumented
« Reply #3 on: April 09, 2025, 07:03:33 pm »
Hello

The github search can help me a little bit.

I found:
Quote
   ULONG APIENTRY DrgQueryFormat(PDRAGITEM pditem,
                                 PCSZ  pszAppMech,
                                 ULONG cbBuffer,
                                 PCSZ  pBuffer,
                                 ULONG ulFMTIndex);

Source.
« Last Edit: April 09, 2025, 07:16:18 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5295
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: EDM/2 - The API Project - Undocumented
« Reply #4 on: April 09, 2025, 07:10:28 pm »
2) DrgGetClipPS
Ref: https://www.edm2.com/index.php/OS/2_DLL_Entry_Points_Cross_Reference
- PMCTLS.108    PMDRAG.76

I only found this on the OS2World Github,
Quote
HPS   APIENTRY DrgGetClipPS(HWND hwnd,               // Not yet in PMWIN.H
                            HWND hwndClip,
                            ULONG fl);
Source.

-- https://www.edm2.com/index.php/DrgGetClipPS
« Last Edit: April 09, 2025, 07:14:12 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5295
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: EDM/2 - The API Project - Undocumented
« Reply #5 on: May 14, 2025, 05:03:33 pm »
Hello

I had finally republished (Courtesy of IBM) this two books on the EDM/2 (in wiki format) :
- Presentation Manager Programming Guide and Reference
- Graphics Programming Interface (GPI) Guide and Reference

Maybe there is no much interest because we already have online sources or the INF files, but it was useful also to have more information on the "The OS/2 API Project" inside the wiki.

There had been also interesting to find the "undocumented" API functions and try to find whatever information about it.

These last days I had been using AI (Gemini and Grok) to help me out create the wiki layout in a faster way from the IPF source.
So, a quality check will be also useful if someone cares.

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

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5295
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: EDM/2 - The API Project - Undocumented
« Reply #6 on: May 16, 2025, 04:15:20 am »
Hello

I was checking the "Programming Guide and Reference Addendum".

On "Device Helper (DevHlp) Services and Function Codes" there is this one that I can not find:
- DevHlp_FileOpen
The strange thing is that is list the same code, 7Fh, than "DevHlp_OpenFile" that is on the same page.  Does this "DevHlp_FileOpen" exists or it is a mistake?

On " APIs Supporting High Memory Objects" there are two functions I can not find:
- DosQueryPageUsage
- DosOpenMutexWaitSem
Are those mistakes or the documentation is available somewhere else ?

Thanks in advance for any tip or info.

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

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5406
  • Karma: +128/-1
    • View Profile
Re: EDM/2 - The API Project - Undocumented
« Reply #7 on: May 16, 2025, 07:25:58 am »
Out of curiosity, I grepped x:\os2 for all 4 functions, nothing seems to use them. Or they're called by ordinal.
I also grepped \os2tk45. Found DosQueryPageUsage() only in os2386.lib, so a real function not prototyped. Also found DevHlp_OpenFile() in inc\devhlp.inc. Take a look at the inc for cardinal(?) and comment.
All but DevHlp_FileOpen are also in addendum.inf. I'd assume DevHlp_FileOpen is a typo with OpenFile reversed, a typo I could see making.

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 405
  • Karma: +30/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: EDM/2 - The API Project - Undocumented
« Reply #8 on: May 16, 2025, 05:53:28 pm »
- DosOpenMutexWaitSem

DosOpenMuxWaitSem

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5295
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: EDM/2 - The API Project - Undocumented
« Reply #9 on: May 16, 2025, 08:06:07 pm »
Thanks for the feedback.

What I understand is that:
1) DosQueryPageUsage - Exists, but it is undocumented.
2) DevHlp_FileOpen is a typo for "DevHlp_OpenFile"
3) DosOpenMutexWaitSem is typo for "DosOpenMuxWaitSem"

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

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5406
  • Karma: +128/-1
    • View Profile
Re: EDM/2 - The API Project - Undocumented
« Reply #10 on: May 17, 2025, 04:59:22 am »
DosOpenMutexWaitSem is the one in the Programming Guide and Reference Addendum, under Additional APIs Supported in Warp Serever for e-business, so not a typo.

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 405
  • Karma: +30/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: EDM/2 - The API Project - Undocumented
« Reply #11 on: May 17, 2025, 08:28:26 am »
DosOpenMutexWaitSem is the one in the Programming Guide and Reference Addendum, under Additional APIs Supported in Warp Serever for e-business, so not a typo.

??? That item _is_ the typo in question.

Compare the sequence of functions in that listing with those in the Control Program Guide and Reference. Where the Addendum has DosOpenMutexWaitSem, the more authoritative CP Ref has DosOpenMuxWaitSem.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5406
  • Karma: +128/-1
    • View Profile
Re: EDM/2 - The API Project - Undocumented
« Reply #12 on: May 17, 2025, 05:39:12 pm »
DosOpenMutexWaitSem is the one in the Programming Guide and Reference Addendum, under Additional APIs Supported in Warp Serever for e-business, so not a typo.

??? That item _is_ the typo in question.

Compare the sequence of functions in that listing with those in the Control Program Guide and Reference. Where the Addendum has DosOpenMutexWaitSem, the more authoritative CP Ref has DosOpenMuxWaitSem.

OK, I made a typo when grepping for DosOpenMuxWaitSem. Now I see it in 3 inf's and prototyped in bsedos.h.
Thanks for the correction

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5295
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: EDM/2 - The API Project - Undocumented
« Reply #13 on: May 17, 2025, 07:17:43 pm »
Hello. Thanks for the feedback.

For the moment I'm creating this page as draft to remember this conversation.
-- https://www.edm2.com/index.php/IBM_SDK/TK_Errata_Sheet

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

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5295
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: EDM/2 - The API Project - Undocumented
« Reply #14 on: May 17, 2025, 07:37:45 pm »
Hello

Andreas made a correction on the EDM/2 wiki, but I don't think it is right. He changed that "WinHSWITCHfromHAPP" should be "WinHSwitchFromHapp"  (case change).
I personally do not think it is right. The references that I have is that when OSFree tries to clone the files it uses  "WinHSWITCHfromHAPP", the PMSHAPI.DLL entry points, and the "Programming Guide and Reference Addendum" guide.

Can you help me to find out which is the correct case?

Regards
« Last Edit: May 17, 2025, 07:39:43 pm by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.