Can anybody help me write the function for Linux :
__declspec(naked) BOOL WINAPI _InitCommonControlsEx(INITCOMMONCONTROLSEX* lpInitCtrls) { if(!dwLPA_InitCommonControlsEx) { __asm mov eax, 0 __asm ret 4 } else { __asm jmp dwLPA_InitCommonControlsEx } }
May be : __declspec(naked) BOOL WINAPI _InitCommonControlsEx(WINGS_INITCOMMONCONTROLSEX* lpInitCtrls) { if(!dwLPA_InitCommonControlsEx) { __asm__ __volatile__("movl 0, %eax"); __asm__ __volatile__("ret"); } else { __asm__ __volatile__("jmp %0" : : "q"(dwLPA_InitCommonControlsEx)); } }
On Tue, Nov 11, 2003 at 04:51:12PM +0300, flyker wrote:
Can anybody help me write the function for Linux :
__declspec(naked) BOOL WINAPI _InitCommonControlsEx(INITCOMMONCONTROLSEX* lpInitCtrls) { if(!dwLPA_InitCommonControlsEx) { __asm mov eax, 0 __asm ret 4 } else { __asm jmp dwLPA_InitCommonControlsEx } }
May be : __declspec(naked) BOOL WINAPI _InitCommonControlsEx(WINGS_INITCOMMONCONTROLSEX* lpInitCtrls) { if(!dwLPA_InitCommonControlsEx) { __asm__ __volatile__("movl 0, %eax"); __asm__ __volatile__("ret"); } else { __asm__ __volatile__("jmp %0" : : "q"(dwLPA_InitCommonControlsEx)); } }
Would be something like:
BOOL WINAPI _InitCommonControlsEx(WINGS_INITCOMMONCONTROLSEX* lpInitCtrls) { if(!dwLPA_InitCommonControlsEx) { return FALSE; } else { return dwLPA_InitCommonControlsEx(); } }
But you shouldn't use reverse engineering like this for WINE development.
Ciao, Marcus
Marcus Meissner wrote:
On Tue, Nov 11, 2003 at 04:51:12PM +0300, flyker wrote:
Can anybody help me write the function for Linux :
__declspec(naked) BOOL WINAPI _InitCommonControlsEx(INITCOMMONCONTROLSEX* lpInitCtrls) { if(!dwLPA_InitCommonControlsEx) { __asm mov eax, 0 __asm ret 4 } else { __asm jmp dwLPA_InitCommonControlsEx } }
Would be something like:
BOOL WINAPI _InitCommonControlsEx(WINGS_INITCOMMONCONTROLSEX* lpInitCtrls) { if(!dwLPA_InitCommonControlsEx) { return FALSE; } else { return dwLPA_InitCommonControlsEx(); } }
But you shouldn't use reverse engineering like this for WINE development.
Ciao, Marcus
Actually, it would be:
BOOL WINAPI _InitCommonControlsEx(WINGS_INITCOMMONCONTROLSEX* lpInitCtrls) { if(!dwLPA_InitCommonControlsEx) { return FALSE; } else { return dwLPA_InitCommonControlsEx(lpInitCtrls); } }
The "jmp" is an optimization step, where the new function is called with the same parameters as the old one. I do agree with you about not using direct ASM->C conversions like this.
BOOL WINAPI _InitCommonControlsEx(WINGS_INITCOMMONCONTROLSEX* lpInitCtrls) { if(!dwLPA_InitCommonControlsEx) { return FALSE; } else { return dwLPA_InitCommonControlsEx(lpInitCtrls); } }
The "jmp" is an optimization step, where the new function is called with the same parameters as the old one. I do agree with you about not using direct ASM->C conversions like this.
-- Shachar Shemesh Open Source integration consultant Home page & resume - http://www.shemesh.biz/
Ok, i understand, i got Access violation in dwLPA_InitCommonControlsEx(lpInitCtrls);