From e426e9a785af77f8d5ae47c9c9e30af8b77c7011 Mon Sep 17 00:00:00 2001 From: Steven Edwards Date: Wed, 30 Apr 2003 17:15:06 +0000 Subject: [PATCH] Fix for building lzexpand with Mingw or MS_VC++ includes --- dlls/lzexpand/lzexpand16.c | 4 ++-- dlls/lzexpand/lzexpand_main.c | 10 +++++----- dlls/version/resource.c | 12 ++++++------ include/lzexpand.h | 10 +++++----- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/dlls/lzexpand/lzexpand16.c b/dlls/lzexpand/lzexpand16.c index 03e6fae8d43..791a7b19823 100644 --- a/dlls/lzexpand/lzexpand16.c +++ b/dlls/lzexpand/lzexpand16.c @@ -57,7 +57,7 @@ HFILE16 WINAPI LZInit16( HFILE16 hfSrc ) /*********************************************************************** * GetExpandedName (LZEXPAND.10) */ -INT16 WINAPI GetExpandedName16( LPCSTR in, LPSTR out ) +INT16 WINAPI GetExpandedName16( LPSTR in, LPSTR out ) { return (INT16)GetExpandedNameA( in, out ); } @@ -109,7 +109,7 @@ LONG WINAPI LZCopy16( HFILE16 src, HFILE16 dest ) /*********************************************************************** * LZOpenFile (LZEXPAND.2) */ -HFILE16 WINAPI LZOpenFile16( LPCSTR fn, LPOFSTRUCT ofs, UINT16 mode ) +HFILE16 WINAPI LZOpenFile16( LPSTR fn, LPOFSTRUCT ofs, UINT16 mode ) { HFILE hfret = LZOpenFileA( fn, ofs, mode ); /* return errors and LZ handles unmodified */ diff --git a/dlls/lzexpand/lzexpand_main.c b/dlls/lzexpand/lzexpand_main.c index 1d183d7f2fd..2e6dd881869 100644 --- a/dlls/lzexpand/lzexpand_main.c +++ b/dlls/lzexpand/lzexpand_main.c @@ -220,7 +220,7 @@ void WINAPI LZDone(void) * "FILE.BL_" (with lastchar 'a') is being translated to "FILE.BLA" */ -INT WINAPI GetExpandedNameA( LPCSTR in, LPSTR out ) +INT WINAPI GetExpandedNameA( LPSTR in, LPSTR out ) { struct lzfileheader head; HFILE fd; @@ -290,7 +290,7 @@ INT WINAPI GetExpandedNameA( LPCSTR in, LPSTR out ) /*********************************************************************** * GetExpandedNameW (LZ32.@) */ -INT WINAPI GetExpandedNameW( LPCWSTR in, LPWSTR out ) +INT WINAPI GetExpandedNameW( LPWSTR in, LPWSTR out ) { INT ret; DWORD len = WideCharToMultiByte( CP_ACP, 0, in, -1, NULL, 0, NULL, NULL ); @@ -308,7 +308,7 @@ INT WINAPI GetExpandedNameW( LPCWSTR in, LPWSTR out ) /*********************************************************************** * LZRead (LZ32.@) */ -INT WINAPI LZRead( HFILE fd, LPVOID vbuf, UINT toread ) +INT WINAPI LZRead( HFILE fd, LPSTR vbuf, INT toread ) { int howmuch; BYTE b,*buf; @@ -507,7 +507,7 @@ static LPSTR LZEXPAND_MangleName( LPCSTR fn ) * * Opens a file. If not compressed, open it as a normal file. */ -HFILE WINAPI LZOpenFileA( LPCSTR fn, LPOFSTRUCT ofs, UINT mode ) +HFILE WINAPI LZOpenFileA( LPSTR fn, LPOFSTRUCT ofs, WORD mode ) { HFILE fd,cfd; @@ -533,7 +533,7 @@ HFILE WINAPI LZOpenFileA( LPCSTR fn, LPOFSTRUCT ofs, UINT mode ) /*********************************************************************** * LZOpenFileW (LZ32.@) */ -HFILE WINAPI LZOpenFileW( LPCWSTR fn, LPOFSTRUCT ofs, UINT mode ) +HFILE WINAPI LZOpenFileW( LPWSTR fn, LPOFSTRUCT ofs, WORD mode ) { HFILE ret; DWORD len = WideCharToMultiByte( CP_ACP, 0, fn, -1, NULL, 0, NULL, NULL ); diff --git a/dlls/version/resource.c b/dlls/version/resource.c index 1c7b6bf6547..e6db3459b73 100644 --- a/dlls/version/resource.c +++ b/dlls/version/resource.c @@ -146,7 +146,7 @@ static int read_xx_header( HFILE lzfd ) char magic[3]; LZSeek( lzfd, 0, SEEK_SET ); - if ( sizeof(mzh) != LZRead( lzfd, &mzh, sizeof(mzh) ) ) + if ( sizeof(mzh) != LZRead( lzfd, (LPSTR)&mzh, sizeof(mzh) ) ) return 0; if ( mzh.e_magic != IMAGE_DOS_SIGNATURE ) return 0; @@ -183,7 +183,7 @@ static BOOL find_ne_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid, /* Read in NE header */ nehdoffset = LZSeek( lzfd, 0, SEEK_CUR ); - if ( sizeof(nehd) != LZRead( lzfd, &nehd, sizeof(nehd) ) ) return 0; + if ( sizeof(nehd) != LZRead( lzfd, (LPSTR)&nehd, sizeof(nehd) ) ) return 0; resTabSize = nehd.ne_restab - nehd.ne_rsrctab; if ( !resTabSize ) @@ -286,7 +286,7 @@ static BOOL find_pe_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid, /* Read in PE header */ pehdoffset = LZSeek( lzfd, 0, SEEK_CUR ); - if ( sizeof(pehd) != LZRead( lzfd, &pehd, sizeof(pehd) ) ) return 0; + if ( sizeof(pehd) != LZRead( lzfd, (LPSTR)&pehd, sizeof(pehd) ) ) return 0; resDataDir = pehd.OptionalHeader.DataDirectory+IMAGE_FILE_RESOURCE_DIRECTORY; if ( !resDataDir->Size ) @@ -307,7 +307,7 @@ static BOOL find_pe_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid, pehd.FileHeader.SizeOfOptionalHeader, SEEK_SET ); if ( nSections * sizeof(IMAGE_SECTION_HEADER) != - LZRead( lzfd, sections, nSections * sizeof(IMAGE_SECTION_HEADER) ) ) + LZRead( lzfd, (LPSTR)sections, nSections * sizeof(IMAGE_SECTION_HEADER) ) ) { HeapFree( GetProcessHeap(), 0, sections ); return FALSE; @@ -404,7 +404,7 @@ DWORD WINAPI GetFileResourceSize16( LPCSTR lpszFileName, LPCSTR lpszResType, debugstr_a(lpszFileName), (LONG)lpszResType, (LONG)lpszResId, lpszResId ); - lzfd = LZOpenFileA( lpszFileName, &ofs, OF_READ ); + lzfd = LZOpenFileA( (LPSTR)lpszFileName, &ofs, OF_READ ); if ( lzfd < 0 ) return 0; switch ( read_xx_header( lzfd ) ) @@ -441,7 +441,7 @@ DWORD WINAPI GetFileResource16( LPCSTR lpszFileName, LPCSTR lpszResType, debugstr_a(lpszFileName), (LONG)lpszResType, (LONG)lpszResId, dwFileOffset, dwResLen, lpvData ); - lzfd = LZOpenFileA( lpszFileName, &ofs, OF_READ ); + lzfd = LZOpenFileA( (LPSTR)lpszFileName, &ofs, OF_READ ); if ( lzfd < 0 ) return 0; if ( !dwFileOffset ) diff --git a/include/lzexpand.h b/include/lzexpand.h index ffca935b33f..450f92db437 100644 --- a/include/lzexpand.h +++ b/include/lzexpand.h @@ -37,17 +37,17 @@ extern "C" { VOID WINAPI LZDone(void); LONG WINAPI CopyLZFile(HFILE,HFILE); -HFILE WINAPI LZOpenFileA(LPCSTR,LPOFSTRUCT,UINT); -HFILE WINAPI LZOpenFileW(LPCWSTR,LPOFSTRUCT,UINT); +HFILE WINAPI LZOpenFileA(LPSTR,LPOFSTRUCT,WORD); +HFILE WINAPI LZOpenFileW(LPWSTR,LPOFSTRUCT,WORD); #define LZOpenFile WINELIB_NAME_AW(LZOpenFile) -INT WINAPI LZRead(HFILE,LPVOID,UINT); +INT WINAPI LZRead(INT,LPSTR,INT); INT WINAPI LZStart(void); void WINAPI LZClose(HFILE); LONG WINAPI LZCopy(HFILE,HFILE); HFILE WINAPI LZInit(HFILE); LONG WINAPI LZSeek(HFILE,LONG,INT); -INT WINAPI GetExpandedNameA(LPCSTR,LPSTR); -INT WINAPI GetExpandedNameW(LPCWSTR,LPWSTR); +INT WINAPI GetExpandedNameA(LPSTR,LPSTR); +INT WINAPI GetExpandedNameW(LPWSTR,LPWSTR); #define GetExpandedName WINELIB_NAME_AW(GetExpandedName) #ifdef __cplusplus