Details
Description
While implementing service tag support in advapi32 I felt on something really weird.
I set service tag that way:
/* Set service tag */
|
Teb = NtCurrentTeb();
|
Teb->SubProcessTag = (PVOID)ThreadParams->dwServiceTag;
|
Then, in advapi32_apitest, I read it that way:
Teb = NtCurrentTeb();
|
service_ok(Teb->SubProcessTag != 0, "SubProcessTag is not defined!\n");
|
The test works fine in W2K3 SP2, but fails in ReactOS, in spite of my code properly setting it.
Reversing both advapi32 and advapi32_apitest built with GCC Lin shows that:
advapi32 modifies:
7c47be64 mov esi, dword [fs:0x18]
|
7c47be6b mov edi, dword [ebx+0xc]
|
7c47be6e mov dword [esi+0xf60], edi
|
advapi32_apitest reads:
0040f828 mov ebx, dword [fs:0x18]
|
0040f82f mov esi, dword [ebx+0xf64]
|
|
Either we have a major build issue, or, we rather have a TEB definition issue.
Whatever the reason, advapi32_apitest is right. SubProcessTag is at offset 0xf64, hence the fact the test works on W2K3 SP2.