Seems to be a pure 16 bit API, it is in OW's os21x/pm.h if you want to compile a 16 bit version of the program. Calling it from 32 bit land means thunking and aligning and even then I'm not sure with GCC.
Surrounding it with a #if 0 #endif block allows the compilation to finish, making the stack bigger allows it to run.
As for the formatting, not sure. The original displays 16 bit addressing, the new one looks like 32 bit hex and changing the %p to %ld as GCC suggests results in decimal output with negative numbers. Looks better with %p.
--- WINTREE.C.bak 2023-05-07 09:07:52.000000000 -0700
+++ WINTREE.C 2023-05-07 09:19:26.000000000 -0700
@@ -126,9 +126,9 @@
{
/* Unlock the Window */
-
+#if 0
WinLockWindow(hwndNext,FALSE);
-
+#endif
/* Build the proper indentation string */
for(i = 0; (i < 89) & (i < sLevel); i++)
@@ -147,7 +147,7 @@
/* Append the handle to the window */
- sprintf(szLine,"%s%p...%s...%s",szLeader, hwndNext, szTitle, szClass);
+ sprintf(szLine,"%s%ld...%s...%s",szLeader, hwndNext, szTitle, szClass);
WinSendMsg(hwndList, LM_INSERTITEM, MPFROMSHORT(LIT_END), MPFROMP(szLine)
);