flat assembler
Message board for the users of flat assembler.

Index > Windows > Why the driver is not loaded if to remove lines

Author
Thread Post new topic Reply to topic
pas



Joined: 16 Aug 2003
Posts: 17
Location: Russia
pas
Why the driver is not loaded if to remove lines:
Code:
push 0 
call [imp_HalMakeBeep]
Source:
format PE DLL  native at 10000h 
entry main 
include 'C:\FASM135\fasmw152\INCLUDE\win32a.inc' 
section '.code' code readable executable notpageable 
proc MakeBeep1,dwPitch 
        enter 
        cli 
        mov     al,0B6h 
        out     43h,al 
        mov     eax,[dwPitch] 
        out     42h,al 
        mov     al,ah 
        out     42h,al 
        in      al,61h 
        or      al,3 
        out     61h,al 
        sti 
        mov     eax,1800000h 
     .delay_loop: 
        dec     eax 
        or      eax,eax 
        jnz     .delay_loop 
        cli 
        in      al,61h 
        and     al,0FCh 
        out     61h,al 
        sti 
        return 
proc main,pDriverObject,pDriverPath 
        enter 
        push    474h 
        call    MakeBeep1 
        push    389h 
        call    MakeBeep1 
        push    620h 
        call    MakeBeep1  
        mov     eax,1800000h 
.delay_loop: 
        dec     eax 
        or      eax,eax 
        jnz     .delay_loop 
        ;push    0 
        ;call    [imp_HalMakeBeep]
        mov     eax,0C0000182h 
        return 
section '.rdata' readable notpageable 
data 12 
  ImportLookup: 
        dd rva szRead_port_uc 
        dd rva szWrite_port_uc 
        dd rva szHalmakebeep 
        dd 0 
end data 
section 'INIT' import readable notpageable ;
        dd rva ImportLookup 
        dd 0 
        dd 0 
        dd rva szHal_dll 
        dd rva ImportAddress 
        times 5 dd 0 
 ImportAddress: 
       imp_READ_PORT_UCHAR         dd rva szRead_port_uc 
       imp_WRITE_PORT_UCHAR        dd rva szWrite_port_uc 
       imp_HalMakeBeep             dd rva szHalmakebeep 
  szHalmakebeep     dw 0 
                    db 'HalMakeBeep',0 
  szRead_port_uc    dw 0 
                    db 'READ_PORT_UCHAR',0 
  szWrite_port_uc   dw 0 
                    db 'WRITE_PORT_UCHAR',0 ;
  szHal_dll db 'HAL.dll',0 
section '.reloc' data fixups readable discardable    

Error: It fails to load the driver. Code 0c0000018
In archive files:
bad.sys - Does not work
work.sys - Works

[edit by moderator (scientica) @ 004-07-29 21:40]you should encapsulate code in [ code ] blocks [ /code ] (without the spaces between [ and ]) - it makes it easier to read and it perserves intendation[/edit]
Post 26 Jul 2004, 16:30
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
Are you sure it is because of that? I had problems with drivers not loaded because a driver under the same filename crashed and left a hanging entry in the registry, which prevented any other driver under the same filename from being loaded again. You have to find and remove that entry in the registry.

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 26 Jul 2004, 19:40
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
pas



Joined: 16 Aug 2003
Posts: 17
Location: Russia
pas
Yes I am sure. If not to clean(remove) lines:
push 0
call [imp_HalMakeBeep]
The driver is loaded and works.
I apologize. I have not attached archive.
Post 27 Jul 2004, 00:09
View user's profile Send private message Reply with quote
pas



Joined: 16 Aug 2003
Posts: 17
Location: Russia
pas
My example works in XP prof + SP1, but does not work in Win2000
Post 27 Jul 2004, 14:51
View user's profile Send private message Reply with quote
pas



Joined: 16 Aug 2003
Posts: 17
Location: Russia
pas
The question is closed.
Post 29 Jul 2004, 15:14
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.