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