home *** CD-ROM | disk | FTP | other *** search
-
-
-
-
-
-
-
- ________________________
- \ \ \
- \ Tom \ \
- \ Donnelly \ \
- \ Computer \ \
- \ Software \ \
- \_____________________\_\
- \_____________________\_\
-
-
-
-
-
-
- Screen Saver
- Version 5.0
-
- Screen blanker and security software
-
- APPLICATION PROGRAMMING INTERFACE DESCRIPTION
-
-
-
- Tom Donnelly
- Computer Software
- P.O. Box 3856
- San Dimas, CA
- 91773
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Copyright (C) 1992 Tom R. Donnelly All Rights Reserved
-
- APPLICATION PROGRAMMING INTERFACE DESCRIPTION ...1
- ========================================================================
-
-
- This document describes the protocol required by a user application
- program to communicate with the resident copy of Screen Saver. Using
- this interface, it is possible to change various parameters of the
- resident program from within a user application.
-
- The information provided in this document is subject to change
- without notice.
-
- All communication between a user application and Screen Saver is
- performed through DOS Interrupt 54h. Using this interrupt, an
- application can interrogate whether Screen Saver is resident, which
- version is running and the segment address at which it was loaded.
- The application may also read and/or update the status byte, used to
- control certain Screen Saver options.
-
- Before issuing any calls to Screen Saver, you must insure that the
- vector for interrupt 54h is not zero. If it is zero, then Screen
- Saver is not resident. Issuing INT 54h when the vector is zero will
- send your computer into hyperspace, forcing a cold-boot.
-
- Mov AX,3554h ;Get interrupt vectors in ES:BX
- Int 21h ;Call DOS
- Or BX,BX ;Any offset?
- Jz Not_resident ;No - not resident
- Mov BX,ES ;Copy segment
- Or BX,BX ;Any segment?
- Jz Not_resident ;No - not resident
-
- After determining that the INT 54h vector points to something, the
- program is free to make function calls. All function calls require
- the function number in the AH register, the component code in AL
- register (Screen Saver's component code is 3) and the characters 'TD'
- in the CX register. Some functions, such as ReplaceStatusByte,
- require a new status byte in the BL register.
-
- If the function call was successful, CX will be returned containing
- zero (otherwise, CX will be non-zero). Byte parameters will usually
- be returned in the AL register. The GetLoadAddr function returns the
- segment address in the ES register.
-
- *** IMPORTANT ***
-
- Screen Saver is not the only program to use the INT 54h interface.
- It is important to check the success of the function call even when
- you find INT 54h to be non-zero. Screen Saver will only answer
- function calls containing the correct component code (3) in AL. In
- addition, there may be function calls which are not supported on
- older versions of Screen Saver. Issuing an unsupported function call
- will return a non-zero value in the CX register.
-
-
- APPLICATION PROGRAMMING INTERFACE DESCRIPTION ...2
- ========================================================================
-
-
- Function 0 - GetVersion
- Entry: AH=0 Function code
- AL=3 Component code (always 3)
- CX='TD' Literal
-
- Exit: CX=0 If Screen Saver is resident.
- AL=version Format is Major*10 + Minor, eg: Version 4.9
- is returned as 49 (decimal) or 31h.
-
- ---------------------------------------------------------------------
-
- Function 3 - GetState
- Entry: AH=3 Function code
- AL=3 Component code (always 3)
- CX='TD' Literal
-
- Exit: CX=0 If Screen Saver is resident.
- AL=1 If Screen Saver is ON or ON with LOCK.
- AL=0 If Screen Saver is OFF.
-
- ---------------------------------------------------------------------
-
- Function 4 - Disable (deactivate Screen Saver)
- Entry: AH=4 Function code
- AL=3 Component code (always 3)
- CX='TD' Literal
-
- Exit: CX=0 If Screen Saver is resident.
-
- ---------------------------------------------------------------------
-
- Function 5 - Enable (reactivate Screen Saver)
- Entry: AH=5 Function code
- AL=3 Component code (always 3)
- CX='TD' Literal
-
- Exit: CX=0 If Screen Saver is resident.
-
- ---------------------------------------------------------------------
-
- Function 7 - GetLoadAddr
- Entry: AH=7 Function code
- AL=3 Component code (always 3)
- CX='TD' Literal
-
- Exit: CX=0 If Screen Saver is resident.
- ES= Segment address of resident code.
-
-
- APPLICATION PROGRAMMING INTERFACE DESCRIPTION ...3
- ========================================================================
-
-
-
- Function 8 - GetStatusByte
- Entry: AH=8 Function code
- AL=3 Component code (always 3)
- CX='TD' Literal
-
- Exit: CX=0 If Screen Saver is resident.
- AL=76543210 Status byte from resident code.
- Bit 7: 1=EGA supported (do not change)
- Bit 6: 1=VGA supported (do not change)
- Bit 5: 1=MCGA supported (do not change)
- Bit 4: Reserved for future use (zero)
- Bit 3: 1=Invoke keyboard lock
- Bit 2: 1=Invoke screen blanker
- Bit 1: 1=Lock-mode active (LOCK or LOCKONLY)
- Bit 0: 1=Blanker active (ON or LOCK mode)
-
- ---------------------------------------------------------------------
-
- Function 9 - ReplaceStatusByte
- Entry: AH=9 Function code
- AL=3 Component code (always 3)
- BL=byte new status byte (See Function 8 for details)
- CX='TD' Literal
-
- Exit: CX=0 If Screen Saver is resident.
-
-
- APPLICATION PROGRAMMING INTERFACE DESCRIPTION ...4
- ========================================================================
-
-
- Example: Activate security lock from an application program.
-
- This code fragment performs the following:
- 1. Insures that vectors for INT 54h is not zero.
- 2. Requests the resident version to make sure that
- Screen Saver is resident and that it is at least
- version 5.0.
- 3. Requests the resident status byte.
- 4. Turns on the lock-request bit in the status byte.
- 5. Replaces the status byte in the resident code.
-
-
- Mov AX,3554h ;Get interrupt vectors in ES:BX
- Int 21h ;Call DOS
- Or BX,BX ;Any offset?
- Jz NotResident ;No - not resident
- Mov BX,ES ;Copy segment
- Or BX,BX ;Any segment?
- Jz NotResident ;No - not resident
-
- Mov AH,0 ;GetVersion function code
- Mov AL,3 ;Component code
- Mov CX,'TD' ;Literal
- Int 54h
- Jcxz GotVersion ;Got it ok
- Jmp NotResident
- GotVersion:
- Cmp AL,50 ;Version 5.0 or greater?
- Jb BadVersion ;No - skip the rest
-
- Mov AH,8 ;GetStatusByte function code
- Mov AL,3 ;Component code
- Mov CX,'TD' ;Literal
- Int 54h
- Jcxz GotStatus ;Got it ok
- <Handle error here>
- GotStatus:
- Or AL,00001010b ;Insure lock mode and activate lock
-
- Mov BL,AL ;copy to BL for Replace function
- Mov AH,9 ;ReplaceStatusByte function code
- Mov AL,3 ;Component code
- Mov CX,'TD' ;Literal
- Int 54h
- Jcxz AllDone
- <Handle error here>
- AllDone: