Category : OS/2 Files
Archive   : RUNDLL.ZIP
Filename : CALLDLL.MOD

 
Output of file : CALLDLL.MOD contained in archive : RUNDLL.ZIP
MODULE calldll;
(* JPI TopSpeed Modula-2 for OS/2 *)
(* run-time dynamic linking to Estes's ALIAS.DLL *)

FROM InOut IMPORT WriteString, WriteLn;
IMPORT Dos;

PROCEDURE fail (msg : ARRAY OF CHAR);
BEGIN
WriteString(msg); WriteLn; HALT;
END fail;

VAR
addsyn : PROCEDURE (ADDRESS) : CARDINAL;
listsyn : PROCEDURE () : CARDINAL;
alias : CARDINAL;
ret : CARDINAL; (* ignored retval *)

BEGIN
IF (Dos.LoadModule(NIL, 0, "ALIAS", alias) # 0) THEN
fail("can't find ALIAS");
END;
ret := Dos.GetProcAddr(alias, "ADDSYN", PROC(addsyn));
ret := Dos.GetProcAddr(alias, "LIST_SYN", PROC(listsyn));

(* In the next line, the string _must_ be passed as an
ADDRESS, not as an ARRAY OF CHAR: Modula-2 passes open
arrays as _six_ bytes on the stack -- two bytes for the
length, followed by the address of the array itself --
but OS/2 DLL's generally expect only the string itself
(zero-terminated of course). *)

ret := addsyn(ADR("ep \os2\eps\epsilon"));
ret := listsyn();
ret := Dos.FreeModule(alias);
END calldll.




  3 Responses to “Category : OS/2 Files
Archive   : RUNDLL.ZIP
Filename : CALLDLL.MOD

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/