home *** CD-ROM | disk | FTP | other *** search
-
- code segment public
-
- assume cs:code, ds:code
- org 100h
-
- start: jmp begin
-
- vxd_api dd 0
-
- ; this test program demonstrates the getting of the VxD V86 Entry point
- ; and the calling of a service in that entry point.
- ; On entry
- ; AX = the function to call.
- ; where ax = 0 = get version number
- ; where ax = 1 = put up message box.
- ; where ax = 2 = get edos error code
- ; where ax = 3 = execute windows application
-
- begin:
- ;int 3
-
-
- ; ShowWindow() Commands
- ;SW_HIDE = 0
- ;SW_SHOWNORMAL = 1
- ;SW_NORMAL = 1
- ;SW_SHOWMINIMIZED = 2
- ;SW_SHOWMAXIMIZED = 3
- ;SW_MAXIMIZE = 3
- ;SW_SHOWNOACTIVATE = 4
- ;SW_SHOW = 5
- ;SW_MINIMIZE = 6
- ;SW_SHOWMINNOACTIVE = 7
- ;SW_SHOWNA = 8
- ;SW_RESTORE = 9
-
-
- ;int 3
- mov dx, offset Show_msg
- mov ah,9
- int 21h
-
- mov ah,1 ; get char, echo
- int 21h
- cmp al, 031h
- jl not_en
- cmp al, 38h
- jg not_en
- mov ah,0
- sub al,30h
- mov [shownum],ax
- jmp ok_char
- not_en:
- mov [shownum], 1 ; SW_NORMAL
- jmp ok_char
-
- ok_char:
-
- mov dx, offset Prog_msg
- mov ah,9
- int 21h
-
- mov dx, offset Prog_line
- mov ah,0ah
- int 21h
-
- mov bx, offset Prog_line
- inc bx
- mov cx,0
- mov cl, [bx]
- add bx,cx
- mov byte ptr [bx+1],0
-
-
-
-
- mov dx, offset Arg_msg
- mov ah,9
- int 21h
-
- mov dx, offset Arg_line
- mov ah,0ah
- int 21h
- mov bx, offset Arg_line
- inc bx
- mov cx,0
- mov cl, [bx]
- add bx,cx
- mov byte ptr [bx+2],0
-
-
-
-
- push es
- push ds
- mov ax,0
- mov es,ax
- mov di,ax
-
- mov ax, 1684h ; get entry point for vxd device
- mov bx, 2925h ; VxD ID of EDOS, can not be changed
- int 2fh
- mov ax,es
- or ax,di
- jz novxd
- mov word ptr [vxd_api], di
- mov word ptr [vxd_api+2],es
-
- mov cx,0 ; cx should be zero
- mov ax,cs
- mov [tseg],ax
- mov ax,cs
- mov ds,ax ; ds = segment of message to use
- mov es,ax
- ;int 3
- mov bx, offset parm
- mov dx,offset Prog_line+2 ; dx = offset of msg to use
- mov ax,3 ; exec windows app function call
- mov cx, [Shownum]
- call vxd_api
- cmp ax, -1
- jne badexec
-
- cmp bx, 32
- jg exitnow
- mov dx, offset badexec_msg
- mov ah,9
- int 21h
- ;int 3
- exitnow:
- pop ds
- pop es
-
- mov ax,4c00h ; program exit
- int 21h
-
- ret ; never returns to here
-
- badexec:
- mov ax,cs
- mov ds,ax
- mov dx, offset badexec_msg
- mov ah,9
- int 21h
-
- jmp exitnow
-
- novxd:
- mov ax,cs
- mov ds,ax
- mov dx, offset dumbo_msg
- mov ah,9
- int 21h
-
- jmp exitnow
-
-
-
- badexec_msg db 13,10,'TSTWINEX: failed to load windows application',13,10,'$'
-
- ; Test of V86 Exec Windows App from DOS
- msg db 'g:\win31\WRITE.EXE',0 ; full path to windows app
- Show_msg db 13,10,'Enter a number from 0-7 for SW_NORMAL, etc ',13,10, '$'
- Prog_msg db 13,10,'Enter the file to execute, with extension(CLOCK.EXE) ',13,10,'$'
- Arg_msg db 13,10,'Enter the arguments ',13,10, '$'
-
- Prog_line db 128
- db 135 dup (32)
- Arg_line db 128
- db 135 dup (32)
-
-
-
- tail db TAIL_LEN
- db 'G:\WIN31\EDOS\EDOS.WRI'
- TAIL_LEN equ $-tail
- db 13 ; carriage return
- db 0
-
- db 126 dup (0)
-
- parm label byte
- dw 0 ; segment of environment
-
- dw offset Arg_line+1
- tseg dw 0
- shownum dw 0 ; offset of fcb; used for SW_NORMAL, etc
- dw 0 ; seg of fcb
- dd 0
-
- dumbo_msg db 'Test Executing a Windows Application failed, Windows not running',13,10,'$'
-
- ends
-
- END start
-
-
-
-
-
-
-
-
-
-
-
-