Skip Menu |

This queue is for tickets about the Win32-Registry CPAN distribution.

Report information
The Basics
Id: 75671
Status: open
Priority: 0/
Queue: Win32-Registry

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.10
Fixed in: (no value)



Subject: Does not compile anymore because of typemap problems
It seems that the module does not compile anymore. See http://www.cpantesters.org/cpan/report/c6f173c2-e918-11e0-bbec-9aeec8b7ec30 for a sample fail report. It looks like a typemap problem: Could not find a typemap for C type 'FILETIME' in Registry.xs, line 548 Regards, Slaven
On 2012-03-10 10:30:01, SREZIC wrote: Show quoted text
> It seems that the module does not compile anymore. See >
http://www.cpantesters.org/cpan/report/c6f173c2-e918-11e0-bbec-9aeec8b7ec30 Show quoted text
> for a sample fail report. It looks like a typemap problem: > > Could not find a typemap for C type 'FILETIME' in Registry.xs,
line 548 Show quoted text
>
A patch is available at: http://cpan.perl.org/authors/id/S/SR/SREZIC/patches/Win32-Registry-0.10-SREZIC-03.patch Regards, Slaven
On Sat Mar 10 12:11:21 2012, SREZIC wrote: Show quoted text
> On 2012-03-10 10:30:01, SREZIC wrote:
> > It seems that the module does not compile anymore. See > >
> http://www.cpantesters.org/cpan/report/c6f173c2-e918-11e0-bbec- > 9aeec8b7ec30
> > for a sample fail report. It looks like a typemap problem: > > > > Could not find a typemap for C type 'FILETIME' in Registry.xs,
> line 548
> >
> > A patch is available at: > > http://cpan.perl.org/authors/id/S/SR/SREZIC/patches/Win32-Registry- > 0.10-SREZIC-03.patch > > Regards, > Slaven
I've just encountered the same problem when rebuilding things with perl-5.16.0 and solved it in much the same way. (I actually put FILETIME T_HANDLE in the typemap; I don't know if that's better or worse than T_PTROBJ.)
On Tue May 22 04:14:23 2012, SHAY wrote: Show quoted text
> > I've just encountered the same problem when rebuilding things with > perl-5.16.0 and solved it in much the same way. (I actually put FILETIME > T_HANDLE in the typemap; I don't know if that's better or worse than > T_PTROBJ.)
It doesn't matter what you specify - specifying T_CRAP will work just as well. The problem is that there's some shonkiness in Registry.xs. Earlier versions of EU::ParseXS didn't worry about it, but more recent versions do. I've been using the following patch to Registry.xs: ############################################# --- Registry.xs 2012-05-22 19:19:27 +1000 +++ Registry.xs_fixed 2012-05-22 19:15:18 +1000 @@ -545,7 +545,7 @@ DWORD idx char *subkey = NO_INIT char *classname = NO_INIT - FILETIME lastwritetime = NO_INIT + SV * lastwritetime = NO_INIT CODE: char keybuffer[TMPBUFSZ]; DWORD keybuffersz = TMPBUFSZ; @@ -775,7 +775,7 @@ DWORD maxvalnamelen = NO_INIT DWORD maxvaldatalen = NO_INIT DWORD secdesclen = NO_INIT - FILETIME lastwritetime = NO_INIT + SV * lastwritetime = NO_INIT CODE: char keyclass[TMPBUFSZ]; FILETIME ft; ############################################# I don't remember if I came up with that myself, or whether it was someone else. (If it was me that wrote it, then it might still be shonky.) Anyway, with that patch applied the idiotic 'no typemap entry' error goes away. Cheers, Rob
From: max_vohlken [...] hotmail.com
Here is a more accurate patch. This will correctly return the lastwritetime as an integer. I changed it to use the typemap to convert the FILETIME value to a time_t and then return it as a perl integer. *** Registry.xs.orig Fri May 09 16:41:22 2008 --- Registry.xs Thu Nov 29 00:28:01 2012 *************** *** 551,559 **** DWORD keybuffersz = TMPBUFSZ; char classbuffer[TMPBUFSZ]; DWORD classbuffersz = TMPBUFSZ; - FILETIME ft; LONG result = RegEnumKeyEx(hkey, idx, keybuffer, &keybuffersz, ! 0, classbuffer, &classbuffersz, &ft); /* supress unreferenced variable warning */ (void)subkey; (void)classname; --- 551,558 ---- DWORD keybuffersz = TMPBUFSZ; char classbuffer[TMPBUFSZ]; DWORD classbuffersz = TMPBUFSZ; LONG result = RegEnumKeyEx(hkey, idx, keybuffer, &keybuffersz, ! 0, classbuffer, &classbuffersz, &lastwritetime); /* supress unreferenced variable warning */ (void)subkey; (void)classname; *************** *** 565,571 **** RETVAL subkey if (RETVAL) { SETPV(2, keybuffer); } classname if (RETVAL) { SETPV(3, classbuffer); } ! lastwritetime if (RETVAL) { SETNV(4, ft2timet(&ft)); } bool RegEnumValue(hkey,idx,name,reserved,type,value) --- 564,570 ---- RETVAL subkey if (RETVAL) { SETPV(2, keybuffer); } classname if (RETVAL) { SETPV(3, classbuffer); } ! lastwritetime bool RegEnumValue(hkey,idx,name,reserved,type,value) *************** *** 778,784 **** FILETIME lastwritetime = NO_INIT CODE: char keyclass[TMPBUFSZ]; - FILETIME ft; LONG result; /* supress unreferenced variable warning */ (void)kclass; --- 777,782 ---- *************** *** 789,795 **** &numsubkeys, &maxsubkeylen, &maxclasslen, &numvalues, &maxvalnamelen, &maxvaldatalen, ! &secdesclen, &ft); RETVAL = SUCCESS(result); if (!RETVAL) SetLastError(result); --- 787,793 ---- &numsubkeys, &maxsubkeylen, &maxclasslen, &numvalues, &maxvalnamelen, &maxvaldatalen, ! &secdesclen, &lastwritetime); RETVAL = SUCCESS(result); if (!RETVAL) SetLastError(result); *************** *** 803,809 **** maxvalnamelen maxvaldatalen secdesclen ! lastwritetime if (RETVAL) { ft2timet(&ft); } bool --- 801,807 ---- maxvalnamelen maxvaldatalen secdesclen ! lastwritetime bool *** typemap.orig Wed Feb 13 19:59:25 2008 --- typemap Thu Nov 29 00:30:24 2012 *************** *** 2,7 **** --- 2,8 ---- REGSAM T_HANDLE HKEY T_HANDLE HANDLE T_HANDLE + FILETIME T_FILETIME ############################################################################# INPUT *************** *** 11,16 **** --- 12,20 ---- ############################################################################# OUTPUT + + T_FILETIME + sv_setiv($arg, ft2timet(&$var)); T_HANDLE sv_setiv($arg, PTR2IV($var));