home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l231 / 3.ddi / SAMPLES / WINDLL / DLL.IN$ / DLL
Encoding:
Text File  |  1992-11-12  |  2.1 KB  |  66 lines

  1. ; Include file for example DLL
  2.  
  3. DATA_BASE    EQU    400h        ; Base address of BIOS data area
  4. EQUIP        EQU    10h        ; Offset to equipment list
  5. KB        EQU    17h        ; Offset to keybord status word
  6. VIDMODE        EQU    49h        ; Offset to video mode byte
  7. DATA_LIM    EQU    VIDMODE        ; Read limit for BIOS data area
  8. ROM_BASE    EQU    0FFFF0h        ; Base address of ROM release date
  9. ROM_LIM        EQU    10h        ; Read limit for release date
  10. DATE_OFF    EQU    5        ; Release date offset from seg FFFFh
  11.  
  12. FRENCH        EQU    'RF'        ; Reverse 1st two letters (FRE)
  13. SPANISH        EQU    'SE'        ; (ESP)
  14. GERMAN        EQU    'ED'        ; (DEU)
  15. ITALIAN        EQU    'TI'        ; (ITA)
  16. SWEDISH        EQU    'VS'        ; (SVE)
  17.  
  18. STRZ        TYPEDEF    BYTE        ; Null-terminated string
  19. WINAPI        TEXTEQU    <FAR PASCAL>    ; For Win API prototypes
  20.  
  21. ; Prolog and epilog for DLL exported far functions
  22.  
  23. Prolog    MACRO
  24.     mov    ax, ds            ; Must be 1st, since Windows overwrites
  25.     nop                ; Placeholder for 3rd byte
  26.     inc    bp            ; Push odd BP.  Not required, but
  27.     push    bp            ;   allows CodeView to recognize stack
  28.     mov    bp, sp            ; Set up stack frame to access params
  29.     push    ds            ; Save DS
  30.     mov    ds, ax            ; Point DS to DLL's data segment
  31.     ENDM
  32.  
  33. Epilog    MACRO
  34.     pop    ds            ; Recover original DS
  35.     pop    bp            ;   and BP+1
  36.     dec    bp            ; Reset to original BP
  37.     ENDM
  38.  
  39. ; Exported routines
  40. GetSysTime    PROTO    FAR PASCAL
  41. GetSysDate    PROTO    FAR PASCAL
  42. GetSysInfo    PROTO    FAR PASCAL
  43.  
  44. ; Structures
  45. QUALTIME    STRUCT                ; Qualified time hh:mm:ss
  46.   wHour        WORD    ?            ; Hour
  47.   cSep1        BYTE    ?            ; Separator character
  48.   wMin        WORD    ?            ; Minute
  49.   cSep2        BYTE    ?            ; Separator character
  50.   wSec        WORD    ?            ; Seconds
  51.   cPad        BYTE    ' '            ; Padded space
  52.   szTail    BYTE    'xx'            ; '  ', 'am', or 'pm'
  53.   cZero        BYTE    0            ; Terminate with null
  54. QUALTIME    ENDS
  55.  
  56. SYSINFO        STRUCT                ; Current system information
  57.   szWinVer    STRZ    'xx.xx', 0        ; Windows version in ASCIIZ
  58.   szDOSVer    STRZ    'xx.xx', 0        ; DOS version in ASCIIZ
  59.   bCoproc    BYTE    ?            ; Math coprocessor installed?
  60.   cFloppy    BYTE    ?            ; Number of floppy disk drives
  61.   wKbStatus    WORD    ?            ; Keyboard status
  62.   cVidMode    BYTE    ?            ; Current video mode
  63.   cProcType    BYTE    ?            ; Processor type (0,1,2,3,etc.)
  64.   szROM        STRZ    9 DUP (0)        ; ROM release date
  65. SYSINFO        ENDS
  66.