Improved the selector get/set functions.
Support ANSI-compatible inline asm (with the help of Patrik Stridvall).
diff --git a/if1632/snoop.c b/if1632/snoop.c
index c49667a..0558b51 100644
--- a/if1632/snoop.c
+++ b/if1632/snoop.c
@@ -100,7 +100,7 @@
snr[0].realfun = (DWORD)SNOOP16_Entry;
snr[0].lcall = 0x9a;
snr[0].callfromregs = (DWORD)CallFrom16Register;
- GET_CS(snr[0].seg);
+ snr[0].seg = __get_cs();
snr[0].lret = 0xcb66;
snr[1].pushbp = 0x5566;
@@ -110,7 +110,7 @@
snr[1].realfun = (DWORD)SNOOP16_Return;
snr[1].lcall = 0x9a;
snr[1].callfromregs = (DWORD)CallFrom16Register;
- GET_CS(snr[1].seg);
+ snr[1].seg = __get_cs();
snr[1].lret = 0xcb66;
}
while (*dll) {
diff --git a/if1632/thunk.c b/if1632/thunk.c
index 60da112..c4004ae 100644
--- a/if1632/thunk.c
+++ b/if1632/thunk.c
@@ -19,6 +19,7 @@
#include "win.h"
#include "flatthunk.h"
#include "mouse.h"
+#include "selectors.h"
#include "keyboard.h"
#include "debugtools.h"
@@ -498,9 +499,8 @@
void WINAPI C16ThkSL(CONTEXT86 *context)
{
LPBYTE stub = PTR_SEG_TO_LIN(EAX_reg(context)), x = stub;
- WORD cs, ds;
- GET_CS(cs);
- GET_DS(ds);
+ WORD cs = __get_cs();
+ WORD ds = __get_ds();
/* We produce the following code:
*
@@ -551,8 +551,7 @@
struct ThunkDataSL *td = SL16->fpData;
DWORD procAddress = (DWORD)GetProcAddress16(GetModuleHandle16("KERNEL"), 631);
- WORD cs;
- GET_CS(cs);
+ WORD cs = __get_cs();
if (!td)
{