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));