Skip to content
Permalink
Browse files

doscalls.dll: Different small fixes

- DosQuerySysInfo: return OS/2 version being 4.50
- DosSelToFlat and DosFlatToSel implementations
- doscalls makefile: Add comment about 16-bit DosIOpenL
- Add corect "unimplemented" stubs for DOS16GETINFOSEG and
DOS16SETSIGHANDLER
  • Loading branch information
valerius2k committed Apr 29, 2020
1 parent deb56c1 commit 906b724e14f1afcc4fb484ae1301f54d4f7e7183
@@ -55,12 +55,13 @@ int cmd_prntmsg(PCHAR *pTable, ULONG cTable, ULONG ulMsgID,PSZ pszFileName)
APIRET ulrc;

ulrc = DosGetMessage(pTable, cTable, pBuf, sizeof(pBuf), ulMsgID, pszFileName, &cbMsgL);

if (ulrc != NO_ERROR)
printf(all_GetSystemErrorMessage(ulrc));
else
printf("%s", pBuf);

printf("%s", pBuf);

return NO_ERROR;
return ulrc;
}


@@ -11,6 +11,7 @@ DESC = Displays System Version Number
srcfiles = $(p)ver$(e)
# defines additional options for C compiler
ADD_COPT = -i=$(MYDIR)..$(SEP)include
# ADD_LINKOPT = debug all
STUB=$(FILESDIR)$(SEP)os2$(SEP)mdos$(SEP)os2stub.exe
UNI2H = 1

@@ -79,12 +79,12 @@ DosQuerySysInfo(ULONG iStart, ULONG iLast,
break;
case QSV_VERSION_MAJOR:
{
*pul = 17;
*pul = 20;
}
break;
case QSV_VERSION_MINOR:
{
*pul = 1;
*pul = 45;
}
break;
case QSV_VERSION_REVISION:
@@ -71,10 +71,9 @@ APIRET APIENTRY DosScanEnv(PCSZ pszName,
}
}

log("not found\n");

if (rc)
{
log("not found\n");
rc = ERROR_ENVVAR_NOT_FOUND;
}

@@ -1280,3 +1280,12 @@ DEST = os2$(SEP)dll
# ¤¥« « ;-)
# <04:59> <[Pasha]> valeriusN: ­ã ⮣¤  ­ ¬®â © à®ªã襢㠭  ãá, çâ® íâ® ¦ ¡®áª¨¥ internal
# function ;-)


# <_dixie_> lys 64-bit file size is available only via (another) 32-bit open function ...
# <_dixie_> moveton ¤ , 16-¡¨â­®£® DosOpenL ¯®å®¤ã ­¥âã :)
# <moveton> _dixie_ ¨áç® ç¥£® ­¥ 墠⠫®. •¢ â¨â ⮣®, çâ® DosOpenL á HMA ­¥ ᮢ¬¥á⨬. ’®¦¥, ¬®¦­® ᪠§ âì, ®¤  16 ¡¨â
# <_dixie_> moveton ›› :) DOSIOPENL proc near
# <moveton> _dixie_   â ª-â® Dos32OpenL - íâ® ¢à ¯¯¥à ­  DOS32POPENL,   ®­ æ ­ª ­  16 ¡¨â DosIOpenL. ’.¥. ¯®§¢ âì íâ® ¢áñ ¨§ 16 ¡¨â ¬®¦­® ¨ ­ ¯àï¬ãî, ­® ¢áñ â ª¨ ®­® internal
# <_dixie_> moveton ­ã, 541 ORD_DOSIOPENL - ¯®å®¤ã â ª¨ äã­ªæ¨ï...
# <moveton> _dixie_ âãâ ¢ 䥭¨ªá¥ à¥ä ªâ®à¨«¨. …áâì ª ¬¥­â "DosIOpenL (567) ⥯¥àì íªá¯®àâ¨àã¥âáï ¨§ ï¤à ". “¦¥ ­¥ ᪠¦ã, ª ª ­  ¡¨¬¥à᪮¬. ® ¢ «î¡®¬ á«ãç ¥, íâ® internal. ’.¥. ¯®§¢ âì ¬®¦­®, ­® ⨯  ¯à¨«®¦¥­¨¥ â ª®¥ ¡ã¤¥â ®ç¥­ì ¥à¥â¨ç¥áª¨¬. Š ª ï ¢¨¤ã ¨á¯®«ì§®¢ ­¨¥, ¡¨¬¥àë íâ® ¢ëâ é¨«¨, ç⮡ë 16 ¡¨â CopyFile à ¡®â « ¨ á ¡®«ì訬¨ ä ©« ¬¨
@@ -4,18 +4,51 @@

#include "kal.h"

APIRET APIENTRY DosFlatToSel(ULONG x)
APIRET APIENTRY DosFlatToSel(ULONG addr)
{
USHORT sel;
USHORT offs;

log("%s enter\n", __FUNCTION__);
log("addr=%lx\n", x);
log("%s exit => %lx\n", __FUNCTION__, x);
return x;
log("addr=%lx\n", addr);

if (! addr)
{
addr = 0;
goto flat_to_sel_exit;
}

sel = addr >> 16;
sel = (sel << 3) | 7;
offs = addr & 0xffff;

addr = (sel << 16) | offs;

flat_to_sel_exit:
log("%s exit => %lx\n", __FUNCTION__, addr);
return addr;
}

APIRET APIENTRY DosSelToFlat(ULONG x)
APIRET APIENTRY DosSelToFlat(ULONG addr)
{
USHORT sel;
USHORT offs;

log("%s enter\n", __FUNCTION__);
log("addr=%lx\n", x);
log("%s exit => %lx\n", __FUNCTION__, x);
return x;
log("addr=%lx\n", addr);

sel = addr >> 19;
offs = addr & 0xffff;

if (! sel)
{
addr = 0;
goto sel_to_flat_exit;
}

addr = (sel << 16) | offs;

sel_to_flat_exit:
log("%s exit => %lx\n", __FUNCTION__, addr);
return addr;
}
@@ -241,7 +241,8 @@ USHORT __pascal DOS16EXITLIST(void)
}


USHORT __pascal DOS16GETINFOSEG(void)
USHORT _Far16 _Pascal DOS16GETINFOSEG(USHORT _Far16 *pGlobalSeg,
USHORT _Far16 *pLocalSeg)
{
return unimplemented(__FUNCTION__);
}
@@ -276,8 +277,10 @@ USHORT __pascal DOS16HOLDSIGNAL(void)
return unimplemented(__FUNCTION__);
}

typedef void _Far16 *PFNSIGHANDLER;

USHORT __pascal DOS16SETSIGHANDLER(void)
USHORT _Far16 _Pascal DOS16SETSIGHANDLER(PFNSIGHANDLER routine, PFNSIGHANDLER _Far16 *prevAddr,
PUSHORT prevAction, USHORT Action, USHORT sigNumber)
{
return unimplemented(__FUNCTION__);
}

0 comments on commit 906b724

Please sign in to comment.