Re: [python-win32] Still looking for a method to get CPUID info ...

2010-01-07 Thread Gertjan Klein
Tim Roberts wrote:

>Very interesting.  I tried this on Python 2.5.2 on my Windows 7 64
>system (using 32-bit Python).  The C version works fine, but the
>assembler version gets a "DLL initialization error".  I fixed that by
>adding "mov eax, 1" to the "start" routine.  See if that helps your issue.

It doesn't, I get the same error (either 0x1020800 or 0x20800, the
former the most often, which makes me wonder if the error contains bit
flags).

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?

Gertjan.


___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Still looking for a method to get CPUID info ...

2010-01-07 Thread Tim Roberts
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, t...@probo.com
Providenza & Boekelheide, Inc.

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] 'No such interface supported' question

2010-01-07 Thread Gareth Walters
Hi Nick,



I have done some python work before but I new to the COM stuff. I am trying to 
Create a MXD and layers to it from python. I have been looking at this 
PythonNet stuff and it is all getting a bit blurry.



I was wondering if you could give me some pointers to basically get python 
recognizing the ArcMap class or do you have any code that would help me get to 
that point?



Look forward to hearing from you.



Cheers,



Gareth

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Still looking for a method to get CPUID info ...

2010-01-07 Thread Gertjan Klein
Tim Roberts wrote:

>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.

That's it! Now, both Python 2.5 and 2.6 (and 3.1, if I change the print
statement) run this code successfully. Does that mean there is a
difference in calling sequence between Python 2.5 and 2.6? Or do they
have different expectations of which registers are left untouched?

Thanks for sticking with this. I often save little bits of code from
this newsgroup that I might want to use later, and now I have a little
project that shows me how to create a DLL from assembly code and call it
from Python.

Gertjan.


___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32