Announcement

Collapse
No announcement yet.

Will this work on Windows 2000

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Will this work on Windows 2000

    I made a little DLL thanks to code on this forum in PB. It talks to a custom ISA card we made.

    Will this code work? IF not how can I do it in NT/2000?

    Thanks,

    Ryan

    $COMPILE DLL

    DECLARE SUB pbOut(BYVAL PORT AS INTEGER, BYVAL value AS INTEGER)
    DECLARE FUNCTION pbInp(BYVAL PORT AS INTEGER) AS INTEGER
    GLOBAL i AS INTEGER

    SUB pbOut(BYVAL PORT AS INTEGER, BYVAL value AS INTEGER)
    ! mov AX, value
    ! mov DX, port
    ! out DX, AL
    END SUB

    FUNCTION pbInp(BYVAL PORT AS INTEGER) AS INTEGER
    ! mov DX, port
    ! in AL, DX
    ! mov FUNCTION[0], AL
    END FUNCTION


    ------------------

  • #2
    It won't work... apps cannot directly access hardware at Ring-3 (application) level.

    The only way is to install and use a Kernal-mode driver (these are the NT equivalent of a Win9x VxD).

    Wander over to www.lvr.com for information on NT-based drivers for this sort of purpose.


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Hi, You can use that code under NT/Win 2000....There's an
      undocumented API called the I/O premmissions map that allows you
      to set a what port addresses can be 'unprotected' by windows
      I need to dig up the details and I'll get back to you.

      ------------------
      Doug McDonald
      KD5NWK
      www.redforksoftware.com

      Comment

      Working...
      X