News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

soft_interupt_driver.vxd & Loader.asm experiment.

Started by marco1974, March 09, 2005, 09:16:35 PM

Previous topic - Next topic

marco1974

Hello,

a while ago i started to experiment with win98 ddk.

I had the files:
console_loader.asm    loads driver in console window and beeps
wingui_loader.asm    loads driver in a custom dialog window with a button.....

driver.asm  ; the driver that can`t receive arguments so i can call SOFTWARE INTERUPTS.


here is some calling sample code:

.data?
myregs Client_Word_Reg_Struc <> ; copy of client_regs structure
                                                  ; i filled it with client_ax=4c00h
                                                  ; dos exit code
.code

push offset myregs
mov ax,4c00h
mov myregs.Client_Word_Reg_Struc.Client_AX,ax  ;mov ax into structure

;mov eax,offset Client_Word_Reg_Struc        ;.Client_AX,4C00H

;mov eax, offset

invoke DeviceIoControl,hVxD,1, offset  myregs, sizeof(Client_Word_Reg_Struc),NULL,NULL,NULL,NULL
pop myregs

OK WE CALLED THE DRIVER@ lets show the driver source: :-)
; ------------- driver source ---------------


VXD_PAGEABLE_CODE_SEG
BeginProc OnDeviceIoControl
        assume esi:ptr Client_Word_Reg_Struc ;DIOCParams
.if [esi].dwIoControlCode==1
       
               Push_Client_State
      VMMCall Begin_Nest_V86_Exec
                assume ebp: ptr Client_Word_Reg_Struc
mov [ebp].Client_DL,PTR esi
mov [ebp].Client_AL,PTR esi

                mov eax,21h

           VMMCall Exec_Int
      VMMCall End_Nest_Exec
      Pop_Client_State

endI:
.endif

       xor eax,eax
   ret
EndProc OnDeviceIoControl




VXD_PAGEABLE_CODE_ENDS


; its a BIG NONO passing a STRUCT and executing SOFTWARE interupts like int 21h

I have 2 idea`s :
1 Map every interupt+ function in exported functions like 1,2,3
wich can be called by deviceio,hvxd,x where x is the vxdfunction tobe called.


idea 2::

write 3 functions that can pass the client_reg Word,Byte and dword structures to the vxd
functions.

Its hard to get data from the loader INSIDE the VXD :-(


any idea`s or links?