Make lzexpand use winedbg interface.

Merge latest changes with winehq CVS
reactos/subsys/system/expand should work now

svn path=/trunk/; revision=5777
This commit is contained in:
Steven Edwards 2003-08-22 23:35:28 +00:00
parent 62e998a88b
commit 9c1b0dcc9f
2 changed files with 24 additions and 4 deletions

View file

@ -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

View file

@ -21,15 +21,26 @@
* FIXME: return values might be wrong
*/
//#include "config.h"
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <stdio.h>
#include <stdarg.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#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.@)
*