Thu Mar 28 17:11:32 2013: Request 84268 was acted upon.
Transaction: Correspondence added by rkeuc...@allgeier.com
       Queue: Win32-API
     Subject: RE: [rt.cpan.org #84268] Win32::API: Bug/Exception in 
call_asm_x86_msvc.asm
   Broken in: (no value)
    Severity: (no value)
       Owner: Nobody
  Requestors: rkeuc...@allgeier.com
      Status: open
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=84268 >


It's really stdcall. Sorry, I should have checked this..

Maybe I was biased because it worked in my old 5.14 ActiveState-Perl, which
probably used the C version of "call" or an old asm version.

I recompiled Win32::API for getting WriteMemory(), which was missing in the AS 
build.

And others also use the DLL from C# so I thought it would be stdcall..


unsigned int __cdecl svapi_connect(...)

push    ebp
mov     ebp, esp
push    0FFFFFFFEh
push    offset stru_1006F560
push    offset __except_handler4
mov     eax, large fs:0
push    eax
add     esp, 0FFFFFF68h
mov     eax, ___security_cookie
xor     [ebp+ms_exc.registration.ScopeTable], eax
xor     eax, ebp
mov     [ebp+var_24], eax
push    ebx
push    esi
push    edi
push    eax
lea     eax, [ebp+ms_exc.registration]
mov     large fs:0, eax
mov     [ebp+ms_exc.old_esp], esp

...

mov     ecx, [ebp+ms_exc.registration.Next]
mov     large fs:0, ecx
pop     ecx
pop     edi
pop     esi
pop     ebx
mov     ecx, [ebp+var_24]
xor     ecx, ebp        ; cookie
call    @__security_check_cookie@4 ; __security_check_cookie(x)
mov     esp, ebp
pop     ebp
retn


> I plan to change the RaiseException to a Perl catchable croak based on the 
> opinions in http://perlmonks.org/?node_id=1024423 in a future  0.76_02. Also 
> > I might switch the RaiseException to a DebugBreak since RaiseException uses 
> alot of C autos and changes esp/ebp alot (but ebp sort of points to the
> incoming args to RaiseException from Call_asm).

> Do you have another opinion of what to do when there is a prototype mistake?

Yes, a DebugBreak() woud be nice to find the reg mismatch, but most people i.e. 
using an ActiveState-Build of Perl
would not have debug syms.

Maybe do the DebugBreak() when IsDebuggerPresent() is true, else use croak.
You could call IsDebuggerPresent() when api.dll is loaded.

Thanks for your help and your work!






Rainer Keuchel
Entwicklungsleiter
Enterprise Content Management

Allgeier IT Solutions GmbH
Hans-Bredow-Str. 60
28307 Bremen

Tel: +49 (421) 43841294
Fax: +49 (421) 438419294
E-Mail: rkeuc...@allgeier.com
Internet: www.allgeier-it.de

ALLGEIER IT SOLUTIONS GmbH
Amtsgericht Bremen | HRB 20924
Geschäftsführer: Hubert Rohrer, Johannes Häringslack, Ralf Nitzgen
St.-Nr. 803/11449 | USt.-ID-Nr. DE114397847

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. 
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail sind nicht 
gestattet.

This message (and any associated files) is intended only for the use
of bug-win32-...@rt.cpan.org and may contain information that is confidential, 
subject to copyright or constitutes a trade secret. If you are not 
bug-win32-...@rt.cpan.org you are hereby notified that any dissemination, 
copying or distribution of this message, or files associated with this message, 
is strictly prohibited. If you have received this message in error, please 
notify us immediately by replying to the message and deleting it from your 
computer. Any
views or opinions presented are solely those of the author 
rkeuc...@allgeier.com and do not necessarily represent those of the
company.



Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to