A solution to the MSVCRT vs MSVCR71 problem?

Gabriel Genellina gagsl-py at yahoo.com.ar
Sun Jan 21 09:30:47 CET 2007


At Sunday 21/1/2007 00:07, sturlamolden wrote:

>Solution to problem 1:
>
>Compile with your compiler or choice, never mind which CRT are used.
>Use a 'dumpbin' program, find all references to msvcrt in the binary
>DLL file. Create a dll with name "py_crt" that exports these functions
>but redirects them to msvcrt71. That is, in the file py_crt.def we put
>something like
>
>EXPORTS
>malloc=msvcr71.malloc
>free=msvcr71.free
>etc.
>
>Compile the DLL py_crt.dll and then open your pyd file in binary mode.
>Exchange all occurances of the string "msvcrt" (or any other CRT name)
>with "py_crt". Now your binary should work just fine. What you need to
>make sure is just that the name of the proxy has the same number of
>letters as the CRT your compiler linked. So if it is msvcrt81.dll, e.g.
>use something like py_crt81.dll instead of py_crt.dll.
>
>Solution to problem 2:
>[modify external references inside python25.dll to use a different runtime]

This would only work, if runtime dll's were compatibles between them, 
and they are not. You can't blindly redirect a call to msvcr71.__xyz 
to msvcr80.__xyz and expect that to work magically - it may have a 
different number of arguments, or different types, or even may not 
exist anymore.
(And what about any symbol exported by ordinal?)


-- 
Gabriel Genellina
Softlab SRL 


	

	
		
__________________________________________________ 
Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas, 
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas 




More information about the Python-list mailing list