version: LZCopy return value is LONG.

This commit is contained in:
Marcus Meissner 2008-03-24 12:37:33 +01:00 committed by Alexandre Julliard
parent fbdf05aad1
commit 0aecedf281
1 changed files with 10 additions and 8 deletions

View File

@ -367,7 +367,8 @@ DWORD WINAPI VerInstallFileA(
LPCSTR pdest; LPCSTR pdest;
char destfn[260],tmpfn[260],srcfn[260]; char destfn[260],tmpfn[260],srcfn[260];
HFILE hfsrc,hfdst; HFILE hfsrc,hfdst;
DWORD attr,ret,xret,tmplast; DWORD attr,xret,tmplast;
LONG ret;
LPBYTE buf1,buf2; LPBYTE buf1,buf2;
OFSTRUCT ofs; OFSTRUCT ofs;
@ -419,30 +420,31 @@ DWORD WINAPI VerInstallFileA(
} }
ret = LZCopy(hfsrc,hfdst); ret = LZCopy(hfsrc,hfdst);
_lclose(hfdst); _lclose(hfdst);
if (((LONG)ret) < 0) { if (ret < 0) {
/* translate LZ errors into VIF_xxx */ /* translate LZ errors into VIF_xxx */
switch (ret) { switch (ret) {
case LZERROR_BADINHANDLE: case LZERROR_BADINHANDLE:
case LZERROR_READ: case LZERROR_READ:
case LZERROR_BADVALUE: case LZERROR_BADVALUE:
case LZERROR_UNKNOWNALG: case LZERROR_UNKNOWNALG:
ret = VIF_CANNOTREADSRC; xret = VIF_CANNOTREADSRC;
break; break;
case LZERROR_BADOUTHANDLE: case LZERROR_BADOUTHANDLE:
case LZERROR_WRITE: case LZERROR_WRITE:
ret = VIF_OUTOFSPACE; xret = VIF_OUTOFSPACE;
break; break;
case LZERROR_GLOBALLOC: case LZERROR_GLOBALLOC:
case LZERROR_GLOBLOCK: case LZERROR_GLOBLOCK:
ret = VIF_OUTOFMEMORY; xret = VIF_OUTOFMEMORY;
break; break;
default: /* unknown error, should not happen */ default: /* unknown error, should not happen */
ret = 0; FIXME("Unknown LZCopy error %d, ignoring.\n", ret);
xret = 0;
break; break;
} }
if (ret) { if (xret) {
LZClose(hfsrc); LZClose(hfsrc);
return ret; return xret;
} }
} }
} }