From 01c7ee2f45857d954a020d333d965e1537a3900e Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Tue, 26 Jan 1999 16:51:15 +0000 Subject: [PATCH] Allocate a DOS handle if we open a normal file with LZOpenFile16. --- misc/lzexpand.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/misc/lzexpand.c b/misc/lzexpand.c index 243607d404a..903743238d8 100644 --- a/misc/lzexpand.c +++ b/misc/lzexpand.c @@ -540,7 +540,14 @@ static LPSTR LZEXPAND_MangleName( LPCSTR fn ) */ HFILE16 WINAPI LZOpenFile16( LPCSTR fn, LPOFSTRUCT ofs, UINT16 mode ) { - return LZOpenFile32A( fn, ofs, mode ); + HFILE32 hfret; + + hfret = LZOpenFile32A( fn, ofs, mode ); + /* return errors and LZ handles unmodified */ + if (IS_LZ_HANDLE(hfret) || (hfret>=0xfff0) || (hfret<=0)) + return hfret; + /* but allocate a dos handle for 'normal' files */ + return FILE_AllocDosHandle(hfret); } -- 2.11.4.GIT