The following are all real problems that were encountered by virtual device developers:
push 0 ; flags
push nPages ; number of pages to lock
push page ; first page to lock
VMMCall _LinPageLock ; Lock them
; do stuff
VMMCall _LinPageUnlock ; Unlock them
add esp, 12
The LinPageLock service is allowed to damage the top three double-words on the stack, resulting in garbage being passed to LinPageUnlock. (The debugging version of Windows 95 often intentionally modifies input parameters, in an attempt to catch code that relies on this non-feature.)
Inside a hardware interrupt, you are restricted to the following operations:
A very common error is to violate the third rule and call a service that was not designed to be called during a hardware interrupt.