From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, SUBJ_ALL_CAPS autolearn=no autolearn_force=no version=3.4.4 X-Received: by 10.52.75.164 with SMTP id d4mr44093912vdw.13.1434455790158; Tue, 16 Jun 2015 04:56:30 -0700 (PDT) X-Received: by 10.140.94.103 with SMTP id f94mr110349qge.13.1434455790084; Tue, 16 Jun 2015 04:56:30 -0700 (PDT) Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!z60no1512320qgd.1!news-out.google.com!k20ni2017qgd.0!nntp.google.com!q107no1513841qgd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 16 Jun 2015 04:56:29 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=57.79.21.1; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG NNTP-Posting-Host: 57.79.21.1 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: GNAT GPL 2015 From: gautier_niouzes@hotmail.com Injection-Date: Tue, 16 Jun 2015 11:56:30 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: number.nntp.giganews.com comp.lang.ada:193644 Date: 2015-06-16T04:56:29-07:00 List-Id: Looks good! The only serious hiccup encountered so far (apart of performance loss and t= he need to remove the -flto switch on a project) is on a subtle Windows DLL= version query, which has worked in all versions so far but issues a segmen= tation fault in GDB, and a STORAGE_ERROR in a standalone run, after ~10 sec= onds on the function call marked below with ****. function Get_Comctl_Version return natural is function Getmodulehandle(LpModulname: in Lptstr) return Gwindows.Type= s.Handle; pragma Import(Stdcall, Getmodulehandle, "GetModuleHandle" & Character= _Mode_Identifier); type Dllversioninfo is record Cbsize: Interfaces.C.Long :=3D 0; majorversion: Interfaces.C.long :=3D 0; minorversion: Interfaces.C.long :=3D 0; buildnumber: Interfaces.C.long :=3D 0; platformid: Interfaces.C.long :=3D 0; end record; type Dllversioninfo_Pointer is access all Dllversioninfo; type Dll_Get_Version_func is access function (Versioninfo: in dllversioninfo_pointer) return Interfaces= .C.Unsigned_long; pragma Convention(C, Dll_Get_Version_func); use Interfaces.C; function getprocaddress(hmodule: in Gwindows.Types.Handle; Lpprocname: in Char_array) return dll_get_version_func; pragma Import(Stdcall, getprocaddress, "GetProcAddress"); libname: Gstring_C :=3D Gwindows.Gstrings.To_Gstring_C("comctl32"); Procname: aliased constant Char_Array :=3D To_C("DllGetVersion"); ModHandle: Gwindows.Types.Handle; FuncPtr: Dll_Get_Version_Func; Info: aliased Dllversioninfo; Ret_Func: Interfaces.C.Unsigned_long; pragma Unreferenced (Ret_Func); begin -- get dll modhandle :=3D Getmodulehandle(Lpmodulname =3D> Libname(0)'Unchecked_= Access); -- get dllgetversion funcPtr :=3D Getprocaddress(Hmodule =3D> Modhandle, Lpprocname =3D> procname); -- call dllgetversion Info.Cbsize :=3D Info'Size / 8; Ret_Func :=3D FuncPtr(Info'unchecked_access) ; -- **** Put_Line("Major version...." & Info.majorversion'Img); Put_Line("Minor version...." & Info.minorversion'Img); Put_Line("Build............" & Info.buildnumber'Img); Put_Line("Platform........." & Info.platformid'Img); return Natural(Info.MajorVersion); exception when others =3D> return 0; end get_comctl_version; Any clue, just looking at it ? Full package around the function is here: gwindows-common_controls-ex_list_view.adb hosted here: http://sf.net/p/gnavi/code/HEAD/tree/gwindows/contrib/ It is an extended ListView package. TIA _________________________=20 Gautier's Ada programming=20 http://gautiersblog.blogspot.com/search/label/Ada=20 NB: follow the above link for a valid e-mail address=20