[PATCH v3 0/3] MR10352: cabinet: Add stubs for compressor/decompressor
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59534 Signed-off-by: Chris Kadar fireslash@fireslash.net -- v3: cabinet: style: variable names cabinet: fix style, move to separate file https://gitlab.winehq.org/wine/wine/-/merge_requests/10352
From: Chris Kadar <fireslash@fireslash.net> Signed-off-by: Chris Kadar <fireslash@fireslash.net> --- dlls/cabinet/cabinet.spec | 6 ++++ dlls/cabinet/fci.c | 76 +++++++++++++++++++++++++++++++++++++++ dlls/cabinet/fdi.c | 76 +++++++++++++++++++++++++++++++++++++++ include/fci.h | 17 +++++++++ include/fdi.h | 17 +++++++++ 5 files changed, 192 insertions(+) diff --git a/dlls/cabinet/cabinet.spec b/dlls/cabinet/cabinet.spec index c3b12eaf8cb..970092b095c 100644 --- a/dlls/cabinet/cabinet.spec +++ b/dlls/cabinet/cabinet.spec @@ -12,3 +12,9 @@ 22 cdecl FDICopy(long ptr ptr long ptr ptr ptr) 23 cdecl FDIDestroy(long) 24 cdecl FDITruncateCabinet(long ptr long) +30 cdecl FCICompressorCreate() +33 cdecl FCICompressorCompress() +35 cdecl FCICompressorClose() +40 cdecl FDIDecompressorCreate() +43 cdecl FDIDecompressorDecompress() +45 cdecl FDIDecompressorClose() \ No newline at end of file diff --git a/dlls/cabinet/fci.c b/dlls/cabinet/fci.c index e62399db1ba..5ee2d9797ef 100644 --- a/dlls/cabinet/fci.c +++ b/dlls/cabinet/fci.c @@ -1728,3 +1728,79 @@ BOOL __cdecl FCIDestroy(HFCI hfci) p_fci_internal->free(hfci); return TRUE; } + +/*********************************************************************** + * FCICompressorCreate (CABINET.30) + * + * Create a compressor handle + * + * PARAMS + * algo [I] Compression algoritm to use + * settings [I] Optional settings struct (Unused) + * handle [IO] On success, handle. + * + * RETURNS + * TRUE for success + * FALSE for failure + */ +BOOL __cdecl FCICompressorCreate( COMPRESSIONALGORITHM algo, void *settings, HFCICOMPRESSOR handle ) +{ + FIXME("algo (%d) stub\n", algo); + return TRUE; +} + +/*********************************************************************** + * FCICompressorCompress (CABINET.33) + * + * Compress data + * + * PARAMS + * handle [I] Compressor handle + * data [I] Data to compress + * dataSize [I] Size of data to compress + * buff [IO] Output buffer + * buffSize [I] Output buffer size + * compDataSize [IO] Size of compressed data + * + * RETURNS + * TRUE for success + * FALSE for failure + */ +BOOL __cdecl FCICompressorCompress( + HFCICOMPRESSOR handle, + LPCVOID data, + SIZE_T dataSize, + PVOID buff, + SIZE_T buffSize, + PSIZE_T compDataSize) +{ + FIXME("stub\n"); + + *compDataSize = dataSize; + + if( buffSize < dataSize ) + { + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + return FALSE; + } + memcpy(buff, data, dataSize); + return TRUE; +} + +/*********************************************************************** + * FCICompressorClose (CABINET.35) + * + * Closes a compressor handle + * + * PARAMS + * handle [I] On success, handle. + * + * RETURNS + * TRUE for success + * FALSE for failure + */ +BOOL __cdecl FCICompressorClose( HFCICOMPRESSOR handle ) +{ + FIXME("stub\n"); + return TRUE; +} \ No newline at end of file diff --git a/dlls/cabinet/fdi.c b/dlls/cabinet/fdi.c index aae71d0e2a5..1a10c481379 100644 --- a/dlls/cabinet/fdi.c +++ b/dlls/cabinet/fdi.c @@ -2862,3 +2862,79 @@ BOOL __cdecl FDITruncateCabinet( SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } + +/*********************************************************************** + * FDIDecompressorCreate (CABINET.40) + * + * Create a decompressor handle + * + * PARAMS + * algo [I] Compression algoritm to use + * settings [I] Optional settings struct (Unused) + * handle [IO] On success, handle. + * + * RETURNS + * TRUE for success + * FALSE for failure + */ +BOOL __cdecl FDIDecompressorCreate( COMPRESSIONALGORITHM algo, void *settings, HFCICOMPRESSOR handle ) +{ + FIXME("algo (%d) stub\n", algo); + return TRUE; +} + +/*********************************************************************** + * FDIDecompressorDecompress (CABINET.43) + * + * Compress data + * + * PARAMS + * handle [I] Decompressor handle + * data [I] Data to compress + * dataSize [I] Size of data to compress + * buff [IO] Output buffer + * buffSize [I] Output buffer size + * compDataSize [IO] Size of compressed data + * + * RETURNS + * TRUE for success + * FALSE for failure + */ +BOOL __cdecl FDIDecompressorDecompress( + HFDIDECOMPRESSOR handle, + LPCVOID data, + SIZE_T dataSize, + PVOID buff, + SIZE_T buffSize, + PSIZE_T decompDataSize) +{ + FIXME("stub\n"); + + *decompDataSize = dataSize; + + if( buffSize < dataSize ) + { + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + return FALSE; + } + memcpy(buff, data, dataSize); + return TRUE; +} + +/*********************************************************************** + * FDIDecompressorClose (CABINET.45) + * + * Closes a decompressor handle + * + * PARAMS + * handle [I] On success, handle. + * + * RETURNS + * TRUE for success + * FALSE for failure + */ +BOOL __cdecl FDIDecompressorClose( HFDIDECOMPRESSOR handle ) +{ + FIXME("stub\n"); + return TRUE; +} \ No newline at end of file diff --git a/include/fci.h b/include/fci.h index dfaaf4678c6..8a5a4f431e8 100644 --- a/include/fci.h +++ b/include/fci.h @@ -109,6 +109,15 @@ typedef unsigned short TCOMP; (((w) << tcompSHIFT_LZX_WINDOW) | \ ( tcompTYPE_LZX )) +/**********************************************************************/ + +typedef enum { + ALGORITHM_MSZIP = 2, + ALGORITHM_XPRESS, + ALGORITHM_XPRESS_HUFF, + ALGORITHM_LZMS, +} COMPRESSIONALGORITHM; + #endif /* !defined(INCLUDED_TYPES_FCI_FDI) */ /*********************************************************************** @@ -165,6 +174,10 @@ typedef struct { /**********************************************************************/ +typedef void *HFCICOMPRESSOR; + +/**********************************************************************/ + typedef void * (__cdecl __WINE_ALLOC_SIZE(1) *PFNFCIALLOC)(ULONG cb); #define FNFCIALLOC(fn) void * __cdecl fn(ULONG cb) @@ -250,6 +263,10 @@ BOOL __cdecl FCIFlushCabinet(HFCI, BOOL, PFNFCIGETNEXTCABINET, PFNFCISTATUS); BOOL __cdecl FCIFlushFolder(HFCI, PFNFCIGETNEXTCABINET, PFNFCISTATUS); BOOL __cdecl FCIDestroy(HFCI hfci); +BOOL __cdecl FCICompressorCreate( COMPRESSIONALGORITHM, void *, HFCICOMPRESSOR ); +BOOL __cdecl FCICompressorCompress( HFCICOMPRESSOR, LPCVOID, SIZE_T, PVOID, SIZE_T, PSIZE_T ); +BOOL __cdecl FCICompressorClose( HFCICOMPRESSOR ); + /**********************************************************************/ #ifndef _WIN64 diff --git a/include/fdi.h b/include/fdi.h index dde4e468bc1..2ad4bc73f78 100644 --- a/include/fdi.h +++ b/include/fdi.h @@ -109,6 +109,15 @@ typedef unsigned short TCOMP; (((w) << tcompSHIFT_LZX_WINDOW) | \ ( tcompTYPE_LZX )) +/**********************************************************************/ + +typedef enum { + ALGORITHM_MSZIP = 2, + ALGORITHM_XPRESS, + ALGORITHM_XPRESS_HUFF, + ALGORITHM_LZMS, +} COMPRESSIONALGORITHM; + #endif /* !defined(INCLUDED_TYPES_FCI_FDI) */ /*********************************************************************** @@ -203,6 +212,10 @@ typedef struct { /**********************************************************************/ +typedef void *HFDIDECOMPRESSOR; + +/**********************************************************************/ + typedef void * (__WINE_ALLOC_SIZE(1) __cdecl *PFNALLOC)(ULONG cb); #define FNALLOC(fn) void * __WINE_ALLOC_SIZE(1) __cdecl fn(ULONG cb) @@ -288,6 +301,10 @@ BOOL __cdecl FDICopy(HFDI, char *, char *, int, PFNFDINOTIFY, BOOL __cdecl FDIDestroy(HFDI); BOOL __cdecl FDITruncateCabinet(HFDI, char *, USHORT); +BOOL __cdecl FDIDecompressorCreate( COMPRESSIONALGORITHM, void *, HFDIDECOMPRESSOR ); +BOOL __cdecl FDIDecompressorDecompress( HFDIDECOMPRESSOR, LPCVOID, SIZE_T, PVOID, SIZE_T, PSIZE_T ); +BOOL __cdecl FDIDecompressorClose( HFDIDECOMPRESSOR ); + /**********************************************************************/ #ifndef _WIN64 -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10352
From: Chris Kadar <fireslash@fireslash.net> Signed-off-by: Chris Kadar <fireslash@fireslash.net> --- dlls/cabinet/Makefile.in | 3 +- dlls/cabinet/cabinet.spec | 12 ++--- dlls/cabinet/compressapi.c | 108 +++++++++++++++++++++++++++++++++++++ dlls/cabinet/fci.c | 76 -------------------------- dlls/cabinet/fdi.c | 76 -------------------------- include/compressapi.h | 74 +++++++++++++++++++++++++ include/fci.h | 17 ------ include/fdi.h | 17 ------ 8 files changed, 190 insertions(+), 193 deletions(-) create mode 100644 dlls/cabinet/compressapi.c create mode 100644 include/compressapi.h diff --git a/dlls/cabinet/Makefile.in b/dlls/cabinet/Makefile.in index b5876e7c95c..67a9fd83754 100644 --- a/dlls/cabinet/Makefile.in +++ b/dlls/cabinet/Makefile.in @@ -9,4 +9,5 @@ VER_PRODUCTVERSION = 5,0,2147,1 SOURCES = \ cabinet_main.c \ fci.c \ - fdi.c + fdi.c \ + compressapi.c diff --git a/dlls/cabinet/cabinet.spec b/dlls/cabinet/cabinet.spec index 970092b095c..1a01eecac59 100644 --- a/dlls/cabinet/cabinet.spec +++ b/dlls/cabinet/cabinet.spec @@ -12,9 +12,9 @@ 22 cdecl FDICopy(long ptr ptr long ptr ptr ptr) 23 cdecl FDIDestroy(long) 24 cdecl FDITruncateCabinet(long ptr long) -30 cdecl FCICompressorCreate() -33 cdecl FCICompressorCompress() -35 cdecl FCICompressorClose() -40 cdecl FDIDecompressorCreate() -43 cdecl FDIDecompressorDecompress() -45 cdecl FDIDecompressorClose() \ No newline at end of file +30 stdcall CreateCompressor(long ptr ptr) +33 stdcall Compress(ptr ptr long ptr long ptr) +35 stdcall CloseCompressor(ptr) +40 stdcall CreateDecompressor(long ptr ptr) +43 stdcall Decompress(ptr ptr long ptr long ptr) +45 stdcall CloseDecompressor(ptr) \ No newline at end of file diff --git a/dlls/cabinet/compressapi.c b/dlls/cabinet/compressapi.c new file mode 100644 index 00000000000..aa58fd75b8e --- /dev/null +++ b/dlls/cabinet/compressapi.c @@ -0,0 +1,108 @@ +/* + * Compression API + * + * Copyright 2026 Chris Kadar + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "compressapi.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(cabinet); + +/*********************************************************************** + * CreateCompressor (CABINET.30) + */ +BOOL WINAPI CreateCompressor( DWORD algo, COMPRESS_ALLOCATION_ROUTINES *settings, COMPRESSOR_HANDLE *handle ) +{ + FIXME("algo (%lu) stub\n", algo); + return TRUE; +} + +/*********************************************************************** + * Compress (CABINET.33) + */ +BOOL WINAPI Compress( + COMPRESSOR_HANDLE handle, + const VOID *data, + SIZE_T dataSize, + VOID *buff, + SIZE_T buffSize, + SIZE_T *compDataSize ) +{ + FIXME("stub\n"); + + *compDataSize = dataSize; + + if( buffSize < dataSize ) + { + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + return FALSE; + } + memcpy(buff, data, dataSize); + return TRUE; +} + +/*********************************************************************** + * CloseCompressor (CABINET.35) + */ +BOOL WINAPI CloseCompressor( COMPRESSOR_HANDLE handle ) +{ + FIXME("stub\n"); + return TRUE; +} + +/*********************************************************************** + * CreateDecompressor (CABINET.40) + */ +BOOL WINAPI CreateDecompressor( DWORD algo, COMPRESS_ALLOCATION_ROUTINES *settings, DECOMPRESSOR_HANDLE *handle ) +{ + FIXME("algo (%lu) stub\n", algo); + return TRUE; +} + +/*********************************************************************** + * Decompress (CABINET.43) + */ +BOOL WINAPI Decompress( + DECOMPRESSOR_HANDLE handle, + const VOID *data, + SIZE_T dataSize, + VOID *buff, + SIZE_T buffSize, + SIZE_T *decompDataSize) +{ + FIXME("stub\n"); + + *decompDataSize = dataSize; + + if( buffSize < dataSize ) + { + SetLastError( ERROR_INSUFFICIENT_BUFFER ); + return FALSE; + } + memcpy(buff, data, dataSize); + return TRUE; +} + +/*********************************************************************** + * CloseCompressor (CABINET.45) + */ +BOOL WINAPI CloseDecompressor( DECOMPRESSOR_HANDLE handle ) +{ + FIXME("stub\n"); + return TRUE; +} \ No newline at end of file diff --git a/dlls/cabinet/fci.c b/dlls/cabinet/fci.c index 5ee2d9797ef..e62399db1ba 100644 --- a/dlls/cabinet/fci.c +++ b/dlls/cabinet/fci.c @@ -1728,79 +1728,3 @@ BOOL __cdecl FCIDestroy(HFCI hfci) p_fci_internal->free(hfci); return TRUE; } - -/*********************************************************************** - * FCICompressorCreate (CABINET.30) - * - * Create a compressor handle - * - * PARAMS - * algo [I] Compression algoritm to use - * settings [I] Optional settings struct (Unused) - * handle [IO] On success, handle. - * - * RETURNS - * TRUE for success - * FALSE for failure - */ -BOOL __cdecl FCICompressorCreate( COMPRESSIONALGORITHM algo, void *settings, HFCICOMPRESSOR handle ) -{ - FIXME("algo (%d) stub\n", algo); - return TRUE; -} - -/*********************************************************************** - * FCICompressorCompress (CABINET.33) - * - * Compress data - * - * PARAMS - * handle [I] Compressor handle - * data [I] Data to compress - * dataSize [I] Size of data to compress - * buff [IO] Output buffer - * buffSize [I] Output buffer size - * compDataSize [IO] Size of compressed data - * - * RETURNS - * TRUE for success - * FALSE for failure - */ -BOOL __cdecl FCICompressorCompress( - HFCICOMPRESSOR handle, - LPCVOID data, - SIZE_T dataSize, - PVOID buff, - SIZE_T buffSize, - PSIZE_T compDataSize) -{ - FIXME("stub\n"); - - *compDataSize = dataSize; - - if( buffSize < dataSize ) - { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); - return FALSE; - } - memcpy(buff, data, dataSize); - return TRUE; -} - -/*********************************************************************** - * FCICompressorClose (CABINET.35) - * - * Closes a compressor handle - * - * PARAMS - * handle [I] On success, handle. - * - * RETURNS - * TRUE for success - * FALSE for failure - */ -BOOL __cdecl FCICompressorClose( HFCICOMPRESSOR handle ) -{ - FIXME("stub\n"); - return TRUE; -} \ No newline at end of file diff --git a/dlls/cabinet/fdi.c b/dlls/cabinet/fdi.c index 1a10c481379..aae71d0e2a5 100644 --- a/dlls/cabinet/fdi.c +++ b/dlls/cabinet/fdi.c @@ -2862,79 +2862,3 @@ BOOL __cdecl FDITruncateCabinet( SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return FALSE; } - -/*********************************************************************** - * FDIDecompressorCreate (CABINET.40) - * - * Create a decompressor handle - * - * PARAMS - * algo [I] Compression algoritm to use - * settings [I] Optional settings struct (Unused) - * handle [IO] On success, handle. - * - * RETURNS - * TRUE for success - * FALSE for failure - */ -BOOL __cdecl FDIDecompressorCreate( COMPRESSIONALGORITHM algo, void *settings, HFCICOMPRESSOR handle ) -{ - FIXME("algo (%d) stub\n", algo); - return TRUE; -} - -/*********************************************************************** - * FDIDecompressorDecompress (CABINET.43) - * - * Compress data - * - * PARAMS - * handle [I] Decompressor handle - * data [I] Data to compress - * dataSize [I] Size of data to compress - * buff [IO] Output buffer - * buffSize [I] Output buffer size - * compDataSize [IO] Size of compressed data - * - * RETURNS - * TRUE for success - * FALSE for failure - */ -BOOL __cdecl FDIDecompressorDecompress( - HFDIDECOMPRESSOR handle, - LPCVOID data, - SIZE_T dataSize, - PVOID buff, - SIZE_T buffSize, - PSIZE_T decompDataSize) -{ - FIXME("stub\n"); - - *decompDataSize = dataSize; - - if( buffSize < dataSize ) - { - SetLastError( ERROR_INSUFFICIENT_BUFFER ); - return FALSE; - } - memcpy(buff, data, dataSize); - return TRUE; -} - -/*********************************************************************** - * FDIDecompressorClose (CABINET.45) - * - * Closes a decompressor handle - * - * PARAMS - * handle [I] On success, handle. - * - * RETURNS - * TRUE for success - * FALSE for failure - */ -BOOL __cdecl FDIDecompressorClose( HFDIDECOMPRESSOR handle ) -{ - FIXME("stub\n"); - return TRUE; -} \ No newline at end of file diff --git a/include/compressapi.h b/include/compressapi.h new file mode 100644 index 00000000000..fc36dd773f8 --- /dev/null +++ b/include/compressapi.h @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2026 Chris Kadar + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_COMPRESSAPI_H +#define __WINE_COMPRESSAPI_H + +#include "windef.h" + +#ifdef __cplusplus +extern "C" { +#endif /* defined(__cplusplus) */ + +/**********************************************************************/ + +typedef HANDLE COMPRESSOR_HANDLE; +typedef HANDLE DECOMPRESSOR_HANDLE; + +/**********************************************************************/ + +typedef VOID* (CALLBACK *PFN_COMPRESS_ALLOCATE)( + VOID *UserContext, + SIZE_T Size +); + +typedef VOID (CALLBACK *PFN_COMPRESS_FREE)( + VOID *UserContext, + VOID *Memory +); + +typedef struct { + PFN_COMPRESS_ALLOCATE Allocate; + PFN_COMPRESS_FREE Free; + VOID *UserContext; +} COMPRESS_ALLOCATION_ROUTINES; + +/**********************************************************************/ + +#define COMPRESS_ALGORITHM_NULL 0 +#define COMPRESS_ALGORITHM_INVALID 1 +#define COMPRESS_ALGORITHM_MSZIP 2 +#define COMPRESS_ALGORITHM_XPRESS 3 +#define COMPRESS_ALGORITHM_XPRESS_HUFF 4 +#define COMPRESS_ALGORITHM_LZMS 5 + +/**********************************************************************/ + +BOOL WINAPI CreateCompressor( DWORD, COMPRESS_ALLOCATION_ROUTINES*, COMPRESSOR_HANDLE* ); +BOOL WINAPI Compress( COMPRESSOR_HANDLE, const VOID*, SIZE_T, VOID*, SIZE_T, SIZE_T* ); +BOOL WINAPI CloseCompressor( COMPRESSOR_HANDLE ); + +BOOL WINAPI CreateDecompressor( DWORD, COMPRESS_ALLOCATION_ROUTINES*, DECOMPRESSOR_HANDLE* ); +BOOL WINAPI Decompress( DECOMPRESSOR_HANDLE, const VOID*, SIZE_T, VOID*, SIZE_T, SIZE_T* ); +BOOL WINAPI CloseDecompressor( DECOMPRESSOR_HANDLE ); + +#ifdef __cplusplus +} /* extern "C" */ +#endif /* defined(__cplusplus) */ + +#endif /* __WINE_COMPRESSAPI_H */ \ No newline at end of file diff --git a/include/fci.h b/include/fci.h index 8a5a4f431e8..dfaaf4678c6 100644 --- a/include/fci.h +++ b/include/fci.h @@ -109,15 +109,6 @@ typedef unsigned short TCOMP; (((w) << tcompSHIFT_LZX_WINDOW) | \ ( tcompTYPE_LZX )) -/**********************************************************************/ - -typedef enum { - ALGORITHM_MSZIP = 2, - ALGORITHM_XPRESS, - ALGORITHM_XPRESS_HUFF, - ALGORITHM_LZMS, -} COMPRESSIONALGORITHM; - #endif /* !defined(INCLUDED_TYPES_FCI_FDI) */ /*********************************************************************** @@ -174,10 +165,6 @@ typedef struct { /**********************************************************************/ -typedef void *HFCICOMPRESSOR; - -/**********************************************************************/ - typedef void * (__cdecl __WINE_ALLOC_SIZE(1) *PFNFCIALLOC)(ULONG cb); #define FNFCIALLOC(fn) void * __cdecl fn(ULONG cb) @@ -263,10 +250,6 @@ BOOL __cdecl FCIFlushCabinet(HFCI, BOOL, PFNFCIGETNEXTCABINET, PFNFCISTATUS); BOOL __cdecl FCIFlushFolder(HFCI, PFNFCIGETNEXTCABINET, PFNFCISTATUS); BOOL __cdecl FCIDestroy(HFCI hfci); -BOOL __cdecl FCICompressorCreate( COMPRESSIONALGORITHM, void *, HFCICOMPRESSOR ); -BOOL __cdecl FCICompressorCompress( HFCICOMPRESSOR, LPCVOID, SIZE_T, PVOID, SIZE_T, PSIZE_T ); -BOOL __cdecl FCICompressorClose( HFCICOMPRESSOR ); - /**********************************************************************/ #ifndef _WIN64 diff --git a/include/fdi.h b/include/fdi.h index 2ad4bc73f78..dde4e468bc1 100644 --- a/include/fdi.h +++ b/include/fdi.h @@ -109,15 +109,6 @@ typedef unsigned short TCOMP; (((w) << tcompSHIFT_LZX_WINDOW) | \ ( tcompTYPE_LZX )) -/**********************************************************************/ - -typedef enum { - ALGORITHM_MSZIP = 2, - ALGORITHM_XPRESS, - ALGORITHM_XPRESS_HUFF, - ALGORITHM_LZMS, -} COMPRESSIONALGORITHM; - #endif /* !defined(INCLUDED_TYPES_FCI_FDI) */ /*********************************************************************** @@ -212,10 +203,6 @@ typedef struct { /**********************************************************************/ -typedef void *HFDIDECOMPRESSOR; - -/**********************************************************************/ - typedef void * (__WINE_ALLOC_SIZE(1) __cdecl *PFNALLOC)(ULONG cb); #define FNALLOC(fn) void * __WINE_ALLOC_SIZE(1) __cdecl fn(ULONG cb) @@ -301,10 +288,6 @@ BOOL __cdecl FDICopy(HFDI, char *, char *, int, PFNFDINOTIFY, BOOL __cdecl FDIDestroy(HFDI); BOOL __cdecl FDITruncateCabinet(HFDI, char *, USHORT); -BOOL __cdecl FDIDecompressorCreate( COMPRESSIONALGORITHM, void *, HFDIDECOMPRESSOR ); -BOOL __cdecl FDIDecompressorDecompress( HFDIDECOMPRESSOR, LPCVOID, SIZE_T, PVOID, SIZE_T, PSIZE_T ); -BOOL __cdecl FDIDecompressorClose( HFDIDECOMPRESSOR ); - /**********************************************************************/ #ifndef _WIN64 -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10352
From: Chris Kadar <fireslash@fireslash.net> Signed-off-by: Chris Kadar <fireslash@fireslash.net> --- dlls/cabinet/compressapi.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/dlls/cabinet/compressapi.c b/dlls/cabinet/compressapi.c index aa58fd75b8e..cc02c154bda 100644 --- a/dlls/cabinet/compressapi.c +++ b/dlls/cabinet/compressapi.c @@ -26,9 +26,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(cabinet); /*********************************************************************** * CreateCompressor (CABINET.30) */ -BOOL WINAPI CreateCompressor( DWORD algo, COMPRESS_ALLOCATION_ROUTINES *settings, COMPRESSOR_HANDLE *handle ) +BOOL WINAPI CreateCompressor( DWORD algorithm, COMPRESS_ALLOCATION_ROUTINES *routines, COMPRESSOR_HANDLE *handle ) { - FIXME("algo (%lu) stub\n", algo); + FIXME("algo (%lu) stub\n", algorithm); return TRUE; } @@ -38,21 +38,21 @@ BOOL WINAPI CreateCompressor( DWORD algo, COMPRESS_ALLOCATION_ROUTINES *settings BOOL WINAPI Compress( COMPRESSOR_HANDLE handle, const VOID *data, - SIZE_T dataSize, - VOID *buff, - SIZE_T buffSize, - SIZE_T *compDataSize ) + SIZE_T data_size, + VOID *buffer, + SIZE_T buffer_size, + SIZE_T *compressed_data_size ) { FIXME("stub\n"); - *compDataSize = dataSize; + *compressed_data_size = data_size; - if( buffSize < dataSize ) + if( buffer_size < data_size ) { SetLastError( ERROR_INSUFFICIENT_BUFFER ); return FALSE; } - memcpy(buff, data, dataSize); + memcpy(buffer, data, data_size); return TRUE; } @@ -68,9 +68,9 @@ BOOL WINAPI CloseCompressor( COMPRESSOR_HANDLE handle ) /*********************************************************************** * CreateDecompressor (CABINET.40) */ -BOOL WINAPI CreateDecompressor( DWORD algo, COMPRESS_ALLOCATION_ROUTINES *settings, DECOMPRESSOR_HANDLE *handle ) +BOOL WINAPI CreateDecompressor( DWORD algorithm, COMPRESS_ALLOCATION_ROUTINES *routines, DECOMPRESSOR_HANDLE *handle ) { - FIXME("algo (%lu) stub\n", algo); + FIXME("algo (%lu) stub\n", algorithm); return TRUE; } @@ -80,21 +80,21 @@ BOOL WINAPI CreateDecompressor( DWORD algo, COMPRESS_ALLOCATION_ROUTINES *settin BOOL WINAPI Decompress( DECOMPRESSOR_HANDLE handle, const VOID *data, - SIZE_T dataSize, - VOID *buff, - SIZE_T buffSize, - SIZE_T *decompDataSize) + SIZE_T data_size, + VOID *buffer, + SIZE_T buffer_size, + SIZE_T *decompressed_data_size) { FIXME("stub\n"); - *decompDataSize = dataSize; + *decompressed_data_size = data_size; - if( buffSize < dataSize ) + if( buffer_size < data_size ) { SetLastError( ERROR_INSUFFICIENT_BUFFER ); return FALSE; } - memcpy(buff, data, dataSize); + memcpy(buffer, data, data_size); return TRUE; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10352
participants (2)
-
Chris Kadar -
Chris Kadar (@nspitko)