=?UTF-8?Q?Lauri=20Kentt=C3=A4=20?=: kernel32: LZOpenFile should preserve cBytes on failure.
Alexandre Julliard
julliard at winehq.org
Wed Feb 1 15:26:10 CST 2017
Module: wine
Branch: master
Commit: ae147195384c19b20b2f399566f00a21b58f11b5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ae147195384c19b20b2f399566f00a21b58f11b5
Author: Lauri Kenttä <lauri.kentta at gmail.com>
Date: Tue Jan 31 23:38:08 2017 +0200
kernel32: LZOpenFile should preserve cBytes on failure.
Signed-off-by: Lauri Kenttä <lauri.kentta at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernel32/lzexpand.c | 3 +++
dlls/lz32/tests/lzexpand_main.c | 8 --------
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/dlls/kernel32/lzexpand.c b/dlls/kernel32/lzexpand.c
index 8f9b409..319c1c8 100644
--- a/dlls/kernel32/lzexpand.c
+++ b/dlls/kernel32/lzexpand.c
@@ -534,6 +534,7 @@ static LPSTR LZEXPAND_MangleName( LPCSTR fn )
HFILE WINAPI LZOpenFileA( LPSTR fn, LPOFSTRUCT ofs, WORD mode )
{
HFILE fd,cfd;
+ BYTE ofs_cBytes = ofs->cBytes;
TRACE("(%s,%p,%d)\n",fn,ofs,mode);
/* 0x70 represents all OF_SHARE_* flags, ignore them for the check */
@@ -544,6 +545,8 @@ HFILE WINAPI LZOpenFileA( LPSTR fn, LPOFSTRUCT ofs, WORD mode )
fd = OpenFile(mfn,ofs,mode);
HeapFree( GetProcessHeap(), 0, mfn );
}
+ if (fd==HFILE_ERROR)
+ ofs->cBytes = ofs_cBytes;
if ((mode&~0x70)!=OF_READ)
return fd;
if (fd==HFILE_ERROR)
diff --git a/dlls/lz32/tests/lzexpand_main.c b/dlls/lz32/tests/lzexpand_main.c
index 4980cf7..c37f3fa 100644
--- a/dlls/lz32/tests/lzexpand_main.c
+++ b/dlls/lz32/tests/lzexpand_main.c
@@ -229,7 +229,6 @@ static void test_LZOpenFileA_nonexisting_compressed(void)
"LZOpenFileA succeeded on nonexistent file\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"GetLastError() returns %d\n", GetLastError());
- todo_wine
ok(test.cBytes == 0xA5,
"LZOpenFileA set test.cBytes to %d\n", test.cBytes);
ok(test.nErrCode == ERROR_FILE_NOT_FOUND,
@@ -249,7 +248,6 @@ static void test_LZOpenFileA_nonexisting_compressed(void)
"LZOpenFileA succeeded on nonexistent file\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"GetLastError() returns %d\n", GetLastError());
- todo_wine
ok(test.cBytes == 0xA5,
"LZOpenFileA set test.cBytes to %d\n", test.cBytes);
ok(test.nErrCode == ERROR_FILE_NOT_FOUND,
@@ -269,7 +267,6 @@ static void test_LZOpenFileA_nonexisting_compressed(void)
"LZOpenFileA succeeded on nonexistent file\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"GetLastError() returns %d\n", GetLastError());
- todo_wine
ok(test.cBytes == 0xA5,
"LZOpenFileA set test.cBytes to %d\n", test.cBytes);
ok(test.nErrCode == ERROR_FILE_NOT_FOUND,
@@ -289,7 +286,6 @@ static void test_LZOpenFileA_nonexisting_compressed(void)
"LZOpenFileA succeeded on nonexistent file\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"GetLastError() returns %d\n", GetLastError());
- todo_wine
ok(test.cBytes == 0xA5,
"LZOpenFileA set test.cBytes to %d\n", test.cBytes);
ok(test.nErrCode == ERROR_FILE_NOT_FOUND,
@@ -633,7 +629,6 @@ static void test_LZOpenFileW_nonexisting_compressed(void)
"LZOpenFileW succeeded on nonexistent file\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"GetLastError() returns %d\n", GetLastError());
- todo_wine
ok(test.cBytes == 0xA5,
"LZOpenFileW set test.cBytes to %d\n", test.cBytes);
ok(test.nErrCode == ERROR_FILE_NOT_FOUND,
@@ -653,7 +648,6 @@ static void test_LZOpenFileW_nonexisting_compressed(void)
"LZOpenFileW succeeded on nonexistent file\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"GetLastError() returns %d\n", GetLastError());
- todo_wine
ok(test.cBytes == 0xA5,
"LZOpenFileW set test.cBytes to %d\n", test.cBytes);
ok(test.nErrCode == ERROR_FILE_NOT_FOUND,
@@ -673,7 +667,6 @@ static void test_LZOpenFileW_nonexisting_compressed(void)
"LZOpenFileW succeeded on nonexistent file\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"GetLastError() returns %d\n", GetLastError());
- todo_wine
ok(test.cBytes == 0xA5,
"LZOpenFileW set test.cBytes to %d\n", test.cBytes);
ok(test.nErrCode == ERROR_FILE_NOT_FOUND,
@@ -693,7 +686,6 @@ static void test_LZOpenFileW_nonexisting_compressed(void)
"LZOpenFileW succeeded on nonexistent file\n");
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"GetLastError() returns %d\n", GetLastError());
- todo_wine
ok(test.cBytes == 0xA5,
"LZOpenFileW set test.cBytes to %d\n", test.cBytes);
ok(test.nErrCode == ERROR_FILE_NOT_FOUND,
More information about the wine-cvs
mailing list