Hi, I made my mixer into an infinitive looping Windows thread. But for some strange reason, the index register (ESI) that I use to reference variables gets changed to some weird value in Windows 2000 SP3. But in WIn98SE the thread always runs properly without any errors. So I checked to see if there was any mistakes I was making by altering the index register and I found none. Does anyone know a register (other than EDI, because I'm using that as an index into the sound buffer) that will be preserved? Or anything I can do to force it to preserve the registers?
Posted on 2002-12-31 17:24:01 by x86asm
Don't expect any registers to be preserved in between threads.
Posted on 2002-12-31 17:40:53 by comrade
IS there anyway I can do something similar but with the registers preserved?!?!
Posted on 2002-12-31 17:41:42 by x86asm
Use GetThreadContext and SetThreadContext then.
Posted on 2002-12-31 23:42:02 by comrade
But when Windows switches Thread context isnt it supposed to save the register state?! I know the THREAD_SET_CONTEXT flags would I set those? The only registers I thought were preserved are the ones that go inbetween Win32API function calls. I'm only counting on the state of two registers to be preserved (ESI and EDI), EDI seems to be saved, but I tried both ESI and ECX as index into data and they both dont work. I will try and use EBX, but please help me.

I'm sorry Comrade but I'm really confused at the moment :confused: :confused:
Posted on 2003-01-01 16:23:54 by x86asm
Never mind I fixed it
Posted on 2003-01-01 17:37:17 by x86asm
I got same problem in Windows 2000. It seems like the only registers I can retreave are the control registers even though I'm using CONTEXT_FULL
Posted on 2003-01-10 11:40:47 by mrgone
hmm. Are you calling GetThreadContext from the target thread? The dox say not to, although I have working code that does this.
Posted on 2003-01-10 13:43:28 by Jan Wassenberg
When I have free time I play with it. Just in NT or Win2K the hThread handle dissapears. It first dissapears after EVENT_LOAD_DLL. I tried reloading the process information string with the previously saved values when CREAT_PROCESS first loaded them. Now when I go into SINGLE_STEP unstead of getting event code 80000004 I get 70. I see what's happening. I'm single stepping through a DLL. I wish I knew what 70 event code was. Hunche's Windows include file has several definitions. Two of them where ERROR_SHARING_PAUSED and CONVERSATIONTOPIC.
Posted on 2003-02-13 22:51:12 by mrgone