/* ** Noted.s ** ** Copyright(C) 1994 Microsoft Corporation. ** All Rights Reserved. ** ** HISTORY: ** Created: 01/27/94 - MarkRi ** */ #include "ksalpha.h" .data Module: .space 4 ModName: .ascii "WINSRV\0" .text .set noreorder ; .extern LogData ; .extern GetModuleHandleA ; .extern GetProcAddress ; .globl LogNote ; .ent LogNote ; LogNote: lda sp, -80(sp) // space for 4 quadwords // On entry: // t0 is base of NOTE // t1 is API NAME // t2 is ADDRESS // save addresses & ra stq t0, 0(sp) stq t1, 8(sp) stq t2, 16(sp) stq ra, 24(sp) stq a0, 32(sp) stq a1, 40(sp) stq a2, 48(sp) stq a3, 56(sp) stq a4, 64(sp) stq a5, 72(sp) ldl t2, 0(t2) // Do we already have the API addr? bne t2, Found // Yes, go use it. ldl t3, Module // Do we have our module handle? bne t3, Search // Yes, go use it for search // Get module handle lda a0, ModName jsr GetModuleHandleA // Get our module handle stl v0, Module // restore base ptr ldq t1, 8(sp) Search: // Get address of API ldl a0, Module mov t1, a1 jsr GetProcAddress ldq t2, 16(sp) stl v0, 0(t2) // v0 is the API address // restore base pointer & API Address ldq t0, 0(sp) Found: mov t0, a0 jsr LogData // restore pointer & API Address ldq a0, 32(sp) ldq a1, 40(sp) ldq a2, 48(sp) ldq a3, 56(sp) ldq a4, 64(sp) ldq a5, 72(sp) ldq t2, 16(sp) ldl t1, 0(t2) ldq ra, 24(sp) // restore RA lda sp, 80(sp) jmp (t1) // do it // Will not return to us... .end LogNote #define ZJMP(argName) \ .data ; \ s##argName: ; \ .ascii "NOTE:" #argName " \0" ; \ n##argName: ;\ .ascii #argName "\0" ; \ .align 2 ;\ a##argName: ; \ .space 4 ; \ .text ; \ .globl z##argName ; \ .ent z##argName ; \ z##argName: ; \ lda t0, s##argName ; \ lda t1, n##argName ; \ lda t2, a##argName ; \ jmp LogNote ; \ nop ; \ .end z##argName ; ZJMP(ConServerDllInitialization) ZJMP(GdiServerDllInitialization) ZJMP(UserServerDllInitialization) ZJMP(_UserCheckWindowStationAccess) .set reorder