_Call_On_My_Stack


include vmm.inc

VMMCall _Call_On_My_Stack, <<OFFSET32 pfnCallback>, dwLParam, 
    <OFFSET32 pStack>, dwStackSize> 

Temporarily switches a ring 0 stack to a different locked block of memory. A VxD can use this service to perform an operation that requires more than 4K bytes of stack space (each thread is limited to 4K bytes of ring 0 stack space.) This service switches to the new stack and then calls the given callback function with the LParam parameter pushed on the new stack. When the callback function returns, the service switches back to the original ring 0 stack, and then returns control to the caller. This service can handle nested calls. Uses the C calling convention. Uses EAX, ECX, EDX, and Flags.

pfnCallback

Address of callback function. This function must be declared using the C calling convention.

dwLParam

Double-word parameter to push on the new stack before calling the callback function.

pStack

Stack pointer (value of ESP register). The stack can be as many pages as needed as long as they are all locked. Because the stack grows towards smaller addresses, this parameter should be the upper limit of the stack, not the lower limit.

dwStackSize

The size, in bytes, of the temporary stack.