diff --git a/reactos/lib/lzexpand/Makefile b/reactos/lib/lzexpand/Makefile index 8682db04af5..c38112c201f 100644 --- a/reactos/lib/lzexpand/Makefile +++ b/reactos/lib/lzexpand/Makefile @@ -8,9 +8,9 @@ TARGET_NAME = lz32 TARGET_BASE=0x76380000 # require os code to explicitly request A/W version of structs/functions -TARGET_CFLAGS += -D_DISABLE_TIDENTS +TARGET_CFLAGS += -D_DISABLE_TIDENTS -D__USE_W32API -TARGET_SDKLIBS = ntdll.a +TARGET_SDKLIBS = ntdll.a winedbgc.a TARGET_OBJECTS = lzexpand_main.o diff --git a/reactos/lib/lzexpand/lzexpand_main.c b/reactos/lib/lzexpand/lzexpand_main.c index 93a91dd3f4c..366bbe9b0f2 100644 --- a/reactos/lib/lzexpand/lzexpand_main.c +++ b/reactos/lib/lzexpand/lzexpand_main.c @@ -21,15 +21,26 @@ * FIXME: return values might be wrong */ +//#include "config.h" + #include #include #include #include +#include +#ifdef HAVE_UNISTD_H +# include +#endif #include "windows.h" #include "lzexpand.h" + +#include "wine/unicode.h" +#include "wine/debug.h" #include "wine/port.h" +WINE_DEFAULT_DEBUG_CHANNEL(file); + /* The readahead length of the decompressor. Reading single bytes * using _lread() would be SLOW. */ @@ -445,7 +456,10 @@ LONG WINAPI LZCopy( HFILE src, HFILE dest ) { int usedlzinit=0,ret,wret; LONG len; - HFILE oldsrc = src; + HFILE oldsrc = src, srcfd; + FILETIME filetime; + struct lzstate *lzs; + #define BUFLEN 1000 BYTE buf[BUFLEN]; /* we need that weird typedef, for i can't seem to get function pointer @@ -482,6 +496,13 @@ LONG WINAPI LZCopy( HFILE src, HFILE dest ) if (wret!=ret) return LZERROR_WRITE; } + + /* Maintain the timestamp of source file to destination file */ + srcfd = (!(lzs = GET_LZ_STATE(src))) ? src : lzs->realfd; + GetFileTime((HANDLE)srcfd, NULL, NULL, &filetime); + SetFileTime((HANDLE)dest, NULL, NULL, &filetime); + + /* close handle */ if (usedlzinit) LZClose(src); return len; @@ -507,7 +528,6 @@ static LPSTR LZEXPAND_MangleName( LPCSTR fn ) return mfn; } - /*********************************************************************** * LZOpenFileA (LZ32.@) *