Skip to content

Commit

Permalink
devicelost: clean up arguments on stack
Browse files Browse the repository at this point in the history
D3D9, like most of the Microsoft APIs, uses stdcall calling convention.
In particular, this means that the callee must pop the arguments off the
stack (as opposed to letting caller clean them up afterwards).

Now everything should work.
  • Loading branch information
DankRank committed Jul 1, 2017
1 parent b613f71 commit dff9e86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions thcrap_tsa/src/devicelost.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ int BP_devicelost(x86_reg_t *regs, json_t *bp_info) {
case D3DERR_DRIVERINTERNALERROR:
MessageBox(0, "Unable to recover from Device Lost error.", "Error", MB_ICONERROR);
// panic and return (will probably result in crash)
// [[fallthrough]]
case D3D_OK:
regs->esp += 8; // simulate RETN 8
return 0;
}
}
Expand Down

0 comments on commit dff9e86

Please sign in to comment.