[comp.windows.ms] Windows 3 ISR. Help Please!!!!

taco@cs-sun-fsa.cpsc.ucalgary.ca (Taco Vanieperen) (10/11/90)

Does anyone out there know how to write ISRs for windows 3???

I am trying to write software which uses a custom hardware board.
This involves writing interrupt service code.  The only way to
keep the code in memory where I need it is to include it in a
dynamic link library.

The problem is that DLL's only export functions with a PASCAL calling
convention.  Since PASCAL trashes registers this can cause chaos.  I
can not get the function address with GetProcAddress() unless the
function is exported from the DLL.  This makes it rather tough to set
the interrupt vector.

I am not too concerned if some inline assembly language code is needed,
but I desperately need to find a way around this problem without writing
an entire DLL in assembler.  The following ideas come to mind, so anyone
who knows about these things, please mail me a solution.

  1)  Microsoft seems to handle this problem by allocating a large amount of
      stack space and copying their interrupt driver onto that.  They then
      call some function which marks the data space as being used by code.
      (At least this is what I make of the source code I have from them.  It
      is all tremendously complex and involves 5 or 6 pages of code).

  2)  I understand there are some utilities that allow DOS memory to be allocated
      while windows is running.  Has anyone heard of these?  How can I find them?

  3)  I could attempt to write a pascal function which has an interrupt driver
      included as inline assembly.  The function could calculate it's own address
      and the offset to the start of the interrupt function, and then return the
      interrupt driver's address as a parameter.

If anyone has any suggestions, please let me know.

Thanks in advance,

Taco van Ieperen                      mail to     taco@cpsc.ucalgary.ca