| Line | |
|---|
| 1 | ; $Id: myVR32AllocMem.asm,v 1.3 2001-01-21 07:52:46 bird Exp $
|
|---|
| 2 | ;
|
|---|
| 3 | ; VR32AllocMem over loader which adds the OBJ_ANY flag.
|
|---|
| 4 | ;
|
|---|
| 5 | ; Copyright (c) 2001 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
|
|---|
| 6 | ;
|
|---|
| 7 | ; Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 8 | ;
|
|---|
| 9 | .386p
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 | ;
|
|---|
| 13 | ; Defined Constants And Macros
|
|---|
| 14 | ;
|
|---|
| 15 | SEF_EIP EQU 3ch
|
|---|
| 16 | SEF_CS EQU 40h
|
|---|
| 17 |
|
|---|
| 18 | ARG_FLAGS EQU 50h
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | ;
|
|---|
| 22 | ; Include files
|
|---|
| 23 | ;
|
|---|
| 24 | include devsegdf.inc
|
|---|
| 25 | include api.inc
|
|---|
| 26 | include bsememf.inc
|
|---|
| 27 | ifndef OBJ_ANY
|
|---|
| 28 | OBJ_ANY EQU 00000400H
|
|---|
| 29 | endif
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 | ;
|
|---|
| 33 | ; Exported symbols
|
|---|
| 34 | ;
|
|---|
| 35 | public _myVR32AllocMem@50
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 | ;
|
|---|
| 39 | ; Externs
|
|---|
| 40 | ;
|
|---|
| 41 | extrn APIQueryEnabled:PROC
|
|---|
| 42 | extrn _VR32AllocMem@50:PROC
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 | CODE32 segment
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 | _myVR32AllocMem@50 proc near
|
|---|
| 49 | ASSUME ds:FLAT, es:NOTHING, ss:NOTHING
|
|---|
| 50 | ;
|
|---|
| 51 | ; Check if OBJ_ANY flag is allready set.
|
|---|
| 52 | ;
|
|---|
| 53 | mov edx, [esp + ARG_FLAGS]
|
|---|
| 54 | test edx, OBJ_ANY
|
|---|
| 55 | jnz FLAT:call_vr
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 | ;
|
|---|
| 59 | ; It was not - check if we're to set it for this calling module.
|
|---|
| 60 | ;
|
|---|
| 61 | movzx ecx, word ptr [esp + SEF_CS]
|
|---|
| 62 | mov edx, dword ptr [esp + SEF_EIP]
|
|---|
| 63 | push eax
|
|---|
| 64 | sub esp, 0ch
|
|---|
| 65 | mov eax, API_DOSALLOCMEM_ANY_OBJ
|
|---|
| 66 | call APIQueryEnabled
|
|---|
| 67 | add esp, 0ch
|
|---|
| 68 | test eax, eax
|
|---|
| 69 | pop eax
|
|---|
| 70 | jz FLAT:call_vr
|
|---|
| 71 |
|
|---|
| 72 | ; Apply the OBJ_ANY flag.
|
|---|
| 73 | or word ptr [esp + ARG_FLAGS], OBJ_ANY ; only need to update first word.
|
|---|
| 74 |
|
|---|
| 75 | ;
|
|---|
| 76 | ; Call the original verify/worker routine.
|
|---|
| 77 | ;
|
|---|
| 78 | call_vr:
|
|---|
| 79 | jmp FLAT:CALLTAB:_VR32AllocMem@50
|
|---|
| 80 | _myVR32AllocMem@50 endp
|
|---|
| 81 |
|
|---|
| 82 | CODE32 ends
|
|---|
| 83 |
|
|---|
| 84 | end
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.