From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id C8FB97EE36 for ; Wed, 30 Mar 2016 19:36:53 +0200 (CEST) IronPort-PHdr: 9a23:/xte3RZEkj656+gvdZymBY3/LSx+4OfEezUN459isYplN5qZpMi7bnLW6fgltlLVR4KTs6sC0LqG9fqwEjVZut6oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDivceDKFwR33KUWvBbElaflU3prM4YgI9veO4a6yDihT92QdlQ3n5iPlmJnhzxtY+a9Z9n9DlM6bp6r5YTGY2zRakzTKRZATI6KCh1oZSz7ViQBTeIszEkW2MZ1lJ3CgmNrDrTG7zQmGqw/r5C0SjcBcTwQpg/UHGp7q0tQxjt3mNPfTUw9WWSjs1rkIpapgigrlpx2cScNIqcMf47eqLGYfsbQ3BAV4BfTXoSLJm7at4hBuAbPO1V563w73UDtgC3AxXkUM3mwCVJjXKw+aAN3ek6CgjAwCQhGcgPuTLatoOmZ+8pTempwfyQnn34ZPRM1GK4sdCQfw== Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=Fabrice.Le_fessant@inria.fr; spf=Pass smtp.mailfrom=fabrissimo@gmail.com; spf=None smtp.helo=postmaster@mail-wm0-f46.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of Fabrice.Le_fessant@inria.fr) identity=pra; client-ip=74.125.82.46; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="fabrissimo@gmail.com"; x-sender="Fabrice.Le_fessant@inria.fr"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of fabrissimo@gmail.com designates 74.125.82.46 as permitted sender) identity=mailfrom; client-ip=74.125.82.46; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="fabrissimo@gmail.com"; x-sender="fabrissimo@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wm0-f46.google.com) identity=helo; client-ip=74.125.82.46; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="fabrissimo@gmail.com"; x-sender="postmaster@mail-wm0-f46.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CDAACjDfxWki5SfUpHFoJnH0s1fbYPhG8BDYIRhzs4FAEBAQEBAQEBEAEBAQEHCwsJIS+CLYIVAQEDARIRTwwLCQILIBcCAiISAQUBHAYBEhsHh30IDpMYj0GBMT4xizaRFAsBAQEBGwqKWYQDAwgKBAMBgx6CVgEEl26OB4FmhE2IWo1TL4EOHgEBgkYZgUo8MAGHAQkXgR0BAQE X-IPAS-Result: A0CDAACjDfxWki5SfUpHFoJnH0s1fbYPhG8BDYIRhzs4FAEBAQEBAQEBEAEBAQEHCwsJIS+CLYIVAQEDARIRTwwLCQILIBcCAiISAQUBHAYBEhsHh30IDpMYj0GBMT4xizaRFAsBAQEBGwqKWYQDAwgKBAMBgx6CVgEEl26OB4FmhE2IWo1TL4EOHgEBgkYZgUo8MAGHAQkXgR0BAQE X-IronPort-AV: E=Sophos;i="5.24,417,1454972400"; d="scan'208,217";a="171704821" Received: from mail-wm0-f46.google.com ([74.125.82.46]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 30 Mar 2016 19:36:52 +0200 Received: by mail-wm0-f46.google.com with SMTP id 127so106152305wmu.1 for ; Wed, 30 Mar 2016 10:36:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=3KCgKvgSC0J1u5ruOM9bjZvsjBQZcq/bsFVJ6Ntyr98=; b=At6NGD8qgZh1bpzWPvDV/KJM8HeMXuQQlgzgwJ2YXqK1GE1EfGmj1J48J5s6Px2RW2 wDEFquZQFZ0z75UuqFtPsBLJZGzWLQt1HQxacYw8E+HNu7wMCTnsmW8g1jDZjfrPlt4A 7xPMelgGYfBl9/uqXRlIOTVt98ybtgXDMt18eSpA1tMfjHh236mIxIrGKT4pwnm4O8f1 UjgzFbUTSH+su01MBYQWh6umQ1I/D4gfEZWaACr/fNfPhm7/HuMbZXtJ5UpPl5uOPZMh q+djeECLJ3nT0HyplAubRh6bsj/s2XsB13e4ylZKucCprhtKrOyx5WaQnobEqb8VaG3r IVgA== X-Gm-Message-State: AD7BkJKsCrJ+rmrhosC2b9o180AkYLmH15f8jnGlKRjjG+Mba0gwR4q/g5IHgPDOvsu3CN5TcPQcvS0xZW6bnw== X-Received: by 10.194.75.164 with SMTP id d4mr10861789wjw.15.1459359412196; Wed, 30 Mar 2016 10:36:52 -0700 (PDT) MIME-Version: 1.0 References: <8A030C723E87D24B90827AE8C57403011F2DEAD2@EMMXPA023.emea.cib> In-Reply-To: <8A030C723E87D24B90827AE8C57403011F2DEAD2@EMMXPA023.emea.cib> From: Fabrice Le Fessant Date: Wed, 30 Mar 2016 17:36:42 +0000 Message-ID: To: "Pang, Wai (CA-CIB)" , "caml-list@inria.fr" Content-Type: multipart/alternative; boundary=047d7bb04bbc5d35fa052f479739 Subject: Re: [Caml-list] FindLib loading dllunix.dll on vs2012 --047d7bb04bbc5d35fa052f479739 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Have you tried to use ocpwin ? --Fabrice On Wed, Mar 30, 2016 at 6:25 PM Pang, Wai (CA-CIB) wrote: > Has anyone tried compiling FindLib with the visual studio 2012 or later. > > > > This is ok with visual studio 2008 and an old version of ocaml 3.11. > > I have also tried the most recent release tar balls of ocaml and flex > without any success. > > > > FindLib package has a prebuild configuration to test loading dlls as: > > > > *ocaml unix.cma* - > fails with Reason: .\dllunix.dll: Invalid access to > memory location. > > > > (This command line routine has a dependency of ocamlrun.exe, pervasive.cma > and dllunix.dll > > which I have compiled all from src code using vs 2012. I have tried both > static and dynamic linkage to no avail.) > > > > This error originates from flexdll.c in the *FlexDLL* package. It tries > to call LoadLibraryEx and is returning null. > > > > *Further Testing * > > > > // A test to load dllunix dynamically =E2=80=A6. > > #include > > #include > > #include > > > > int main(int argc, char *argv[]) { > > void *handle; > > printf("Try open: %s\n", argv[1]); > > handle =3D flexdll_dlopen(argv[1], FLEXDLL_RTLD_GLOBAL); > > printf("Handle: %p\n", handle); > > if (handle =3D=3D NULL) { > > printf("Error code: %d\n", GetLastError()); > > printf("Error message: %s\n", flexdll_dlerror()); > > } > > return 0; > > } > > > > *cl -nologo -MD -I"D:\external\OCaml\FlexDLL_034" -c Testdll.c* > > *flexlink -v -merge-manifest -exe -o testdll Testdll.obj* > > > > *Direct test of dllunix.dll* > > > > *$./testdll dllunix.dll* > > > > *Try open:dllunix.dll* > > *Error code: 998* > > *Error message: Invalid access to memory location.* > > > > Instead of using dllunix.dll I have tried to compile a simple program for > testing > > > > *A simplified test* > > > > #include > > int x =3D 10; > > void dump_x(void) { > > printf("myplugin finds the value : \nx=3D%i\n", x); fflush( stdout ); > > } > > > > *cl -nologo -MD -I.. -c myplug.c* > > *flexlink.exe -chain msvc -merge-manifest -v -o myplug.dll myplug.obj > -link ws2_32.lib* > > > > *$./testdll myplug.dll* > > > > *Try open: myplug.dll* > > *Error code: 998* > > *Error message: Invalid access to memory location.* > > > > Note that the dump exe in flexdll fails in the same manner > > > > *In vs2008 build this is ok * > > > > > > *$./testdll myplug.dll* > > > > Try open: myplug.dll > > Handle: 01F6DB78 > > > > Even running the test/dump.exe from flexDLL is ok > > > > *$ ./dump myplug.dll * > > > > INIT > > Dynamic symbol at 00412000 (size =3D 12) > > [0] 00402227: __iob_func > > [1] 00401BA0: api > > [2] 00402E7C: fflush > > [3] 004017F0: flexdll_dlclose > > [4] 004018B0: flexdll_dlerror > > [5] 00401580: flexdll_dlopen > > [6] 00401860: flexdll_dlsym > > [7] 00401900: flexdll_dump_exports > > [8] 00401A60: flexdll_dump_relocations > > [9] 00401000: flexdll_relocate > > [10] 00401BC0: main > > [11] 00401D0E: printf > > OK > > ** Loading myplug.dll > > ** handle =3D 01FEDB78 > > Dynamic symbol at 004C0000 (size =3D 4) > > [0] 004B1000: FlexDLLiniter@12 > > [1] 004B1170: dump_x > > [2] 004B11A0: torun > > [3] 004BC014: x > > myplugin finds the value : > > x=3D10 > > > > > > > > > > This email does not create a legal relationship between any member of the > Cr=C3=A9dit Agricole group and the recipient or constitute investment adv= ice. > The content of this email (including any attachments) is intended solely > for the addressee and access by any other person is not authorised. It may > contain information which is confidential, privileged or otherwise > protected from disclosure. If you are not the intended recipient of this > email, (i) you should send it back to us and delete it from your system, > and (ii) you are prohibited from retaining, distributing, disclosing or > using (in whole or part) any of its content. Email communication may be > logged and archived, monitored and/or disclosed to third parties. > > > > Cr=C3=A9dit Agricole Corporate and Investment Bank is authorised by the > Autorit=C3=A9 de Contr=C3=B4le Prudentiel et de R=C3=A9solution (ACPR) an= d supervised by > the ACPR and the Autorit=C3=A9 des March=C3=A9s Financiers (AMF) in Franc= e and > subject to limited regulation by the Financial Conduct Authority and the > Prudential Regulation Authority. Details about the extent of our regulati= on > by the Financial Conduct Authority and the Prudential Regulation Authority > are available from us on request. Cr=C3=A9dit Agricole Corporate and > Investment Bank is incorporated in France with limited liability and > registered in England and Wales. Registration number: FC008194. Registered > office: Broadwalk House, 5 Appold Street, London, EC2A 2DA > > Please refer to > http://www.ca-cib.com/group-overview/dodd-frank-otc-derivatives.htm for > any Dodd-Frank Disclosure for U.S. Persons pursuant to CFTC Regulation > 23.431 > --047d7bb04bbc5d35fa052f479739 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Have you tried to use ocpwin ?

--Fabrice

On Wed, Mar 30= , 2016 at 6:25 PM Pang, Wai (CA-CIB) <Wai.Pang@ca-cib.com> wrote:

Has anyone tried compiling FindLib with the visual s= tudio 2012 or later.

=C2=A0

This is ok with visual studio 2008 and an old versio= n of ocaml 3.11.

I have also tried the most recent release tar balls = of ocaml and flex without any success.

=C2=A0

FindLib package has a prebuild configuration to test= loading dlls as: =C2=A0=C2=A0

=C2=A0

ocaml unix.cma=C2=A0 - > fails with Reason: .\dllunix.dll: Invalid access to memory location.<= /u>

=C2=A0

(This command line routine has a dependency of ocaml= run.exe, pervasive.cma and dllunix.dll

which I have compiled all from src code using vs 201= 2. I have tried both static and dynamic linkage to no avail.)=

=C2=A0

This error originates from=C2=A0 flexdll.c in the FlexDLL package. It tries to call LoadLibraryEx and is returning null.=

=C2=A0

Further Testing

= =C2=A0

// A test to load dllunix dynamically =E2=80=A6.<= /u>

#include <flexdll.h>

#include <stdio.h>

#include <windows.h>

=C2=A0

int main(int argc, char *argv[]) {

=C2=A0=C2=A0=C2=A0 void *handle;

=C2=A0=C2=A0=C2=A0 printf("Try open: %s\n"= , argv[1]);

=C2=A0=C2=A0=C2=A0 handle =3D flexdll_dlopen(argv[1]= , FLEXDLL_RTLD_GLOBAL);

=C2=A0=C2=A0=C2=A0 printf("Handle: %p\n", = handle);

=C2=A0=C2=A0=C2=A0 if (handle =3D=3D NULL) {<= u>

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 printf("Error code: %d\n", GetLastError());

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 printf("Error message: %s\n", flexdll_dlerror());=

=C2=A0=C2=A0=C2=A0 }

=C2=A0=C2=A0=C2=A0 return 0;

}

=C2=A0

cl -nologo -MD -I"D:\external\OCaml\FlexDLL_= 034" -c Testdll.c

flexlink -v -merge-manifest -exe -o testdll Testd= ll.obj

=C2=A0

Direct test of dllunix.dll

=C2=A0

$./testdll dllunix.dll

=C2=A0

Try open:dllunix.dl= l

Error code: 998<= /u>

Error message: Inva= lid access to memory location.

=C2=A0

Instead of using dllunix.dll I have tried to compile= a simple program for testing

=C2=A0

A simplified test

=C2=A0

#include <stdio.h>

int x =3D 10;=

void dump_x(void) {<= /span>

printf("myplugin finds the value : \nx=3D%i\n&q= uot;, x); fflush( stdout );

}

=C2=A0

cl -nologo -MD=C2=A0 -I.. -c myplug.c

flexlink.exe -chain msvc -merge-manifest=C2=A0 -v= -o myplug.dll=C2=A0 myplug.obj -link ws2_32.lib

=C2=A0

$./testdll =C2=A0myplug.dll

=C2=A0

Try open: myplug.dl= l

Error code: 998<= /u>

Error message: Inva= lid access to memory location.

=C2=A0

Note that =C2=A0=C2=A0the dump exe in flexdll fails = in the same manner

=C2=A0

In vs2008 build this is ok <= /b>

= =C2=A0

=C2=A0

$./testdll =C2=A0myplug.dll

=C2=A0

Try open: myplug.dll

Handle: 01F6DB78

=C2=A0

Even running the test/dump.exe from flexDLL is ok

=C2=A0

$ ./dump myplug.dll

=C2=A0

INIT

Dynamic symbol at 00412000 (size =3D 12)

[0]=C2=A0 00402227: __iob_func

[1]=C2=A0 00401BA0: api

[2]=C2=A0 00402E7C: fflush

[3]=C2=A0 004017F0: flexdll_dlclose

[4]=C2=A0 004018B0: flexdll_dlerror

[5]=C2=A0 00401580: flexdll_dlopen

[6]=C2=A0 00401860: flexdll_dlsym

[7]=C2=A0 00401900: flexdll_dump_exports

[8]=C2=A0 00401A60: flexdll_dump_relocations<= u>

[9]=C2=A0 00401000: flexdll_relocate

[10]=C2=A0 00401BC0: main

[11]=C2=A0 00401D0E: printf

OK

** Loading myplug.dll

** handle =3D 01FEDB78

Dynamic symbol at 004C0000 (size =3D 4)

[0]=C2=A0 004B1000: FlexDLLiniter@12

[1]=C2=A0 004B1170: dump_x

[2]=C2=A0 004B11A0: torun

[3]=C2=A0 004BC014: x

myplugin finds the value :

x=3D10

=C2=A0

=C2=A0

=C2=A0

=C2=A0

This email does = not create a legal relationship between any member of the Cr=C3=A9dit= Agricole group and the re= cipient or constitute investment advice. The content of this email (includi= ng any attachments) is intended solely for the addressee and access by any = other person is not authorised. It may contain information which is confide= ntial, privileged or otherwise protected from disclosure. If you are not th= e intended recipient of this email, (i) you should send it back to us and d= elete it from your system, and (ii) you are prohibited from retaining, dist= ributing, disclosing or using (in whole or part) any of its content. Email = communication may be logged and archived, monitored and/or disclosed to thi= rd parties.

=C2=A0<= /p>

Cr=C3=A9dit Agricole Corporate and Investment Bank is authorised by the Autorit=C3=A9 de Contr=C3=B4le Prudentiel et de R= =C3=A9solution (ACPR) and supervised by the ACPR and the Autorit=C3=A9 des = March=C3=A9s Financiers (AMF) in France and subject to limited regulation b= y the Financial Conduct Authority and the Prudential Regulation Authority. = Details about the extent of our regulation by the Financial Conduct Authori= ty and the Prudential Regulation Authority are available from us on request= . Cr=C3=A9dit Agricole Corporate and Investment Bank is incorporated = in France with limited liability and registered in England and Wales. Regis= tration number: FC008194. Registered office: Broadwalk House, 5 Appold Street, London, EC2A 2DA


Please refer to

http://www.ca-cib.com/group-overview/dodd-frank-otc-derivatives.= htm<= font face=3D"Arial" size=3D"2"> for any Dodd-Frank Disclo= sure for U.S. Persons pursuant to CFTC Regulation 23.431
--047d7bb04bbc5d35fa052f479739--