Hey, that would be too easy
You are accessing segment register to obtain the address of PEB and read process data. Since TEB (or TIB if you like) and PEB are well settled on WinNT clones but not on Win9x family, you have to be familiar with Win9x/WinNT kernels.
TEB is not a problem here because its field is the same on all Windows. The problematic topic in your example is PEB.
By using two additional APIs you will be able to add Win9x compatibility to the method you presented.
I made my homework. Who's next (to tell us which APIs I'm talking about or/and present another solution)?
Regards.