[python-win32] Still looking for a method to get CPUID info ...
Tim Roberts
timr at probo.com
Thu Jan 7 18:36:09 CET 2010
Gertjan Klein wrote:
> Interestingly, if I place a ret after the mov eax, [style] instruction,
> or even comment out the cpuid instruction, I don't get an exception.
> This makes me wonder whether there is something permission-related that
> is different between Python 2.5 and 2.6 -- perhaps the 2.5 executable is
> not allowed to execute that instruction?
>
No, that doesn't make sense. I don't think CPUID is a privileged
instruction. Even if it were, that's talking about CPU privileges,
which do not vary from process to process.
However, I'll bet I know what it is. CPUID trashes ebx, and in the x86
calling sequence, that's supposed to be saved and restored. One of the
sets of code is probably storing an error code in ebx and assuming that
it survives the CPU cal. Try changing the two function headers to this:
GetCpuidEcx proc public uses ebx, style:DWORD
...
GetCpuidEdx proc public uses ebx, style:DWORD
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list