Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/dlls/cabinet/compressapi.c
12343 views
1
/*
2
* Compression API
3
*
4
* Copyright 2026 Chris Kadar
5
*
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19
*/
20
21
#include "compressapi.h"
22
#include "wine/debug.h"
23
24
WINE_DEFAULT_DEBUG_CHANNEL(cabinet);
25
26
/***********************************************************************
27
* CreateCompressor (CABINET.30)
28
*/
29
BOOL WINAPI CreateCompressor( DWORD algorithm, COMPRESS_ALLOCATION_ROUTINES *routines, COMPRESSOR_HANDLE *handle )
30
{
31
FIXME("algo (%lu) stub\n", algorithm);
32
return TRUE;
33
}
34
35
/***********************************************************************
36
* Compress (CABINET.33)
37
*/
38
BOOL WINAPI Compress( COMPRESSOR_HANDLE handle, const VOID *data, SIZE_T data_size,
39
VOID *buffer, SIZE_T buffer_size, SIZE_T *compressed_data_size )
40
{
41
FIXME("stub\n");
42
43
*compressed_data_size = data_size;
44
45
if( buffer_size < data_size )
46
{
47
SetLastError( ERROR_INSUFFICIENT_BUFFER );
48
return FALSE;
49
}
50
memcpy(buffer, data, data_size);
51
return TRUE;
52
}
53
54
/***********************************************************************
55
* CloseCompressor (CABINET.35)
56
*/
57
BOOL WINAPI CloseCompressor( COMPRESSOR_HANDLE handle )
58
{
59
FIXME("stub\n");
60
return TRUE;
61
}
62
63
/***********************************************************************
64
* CreateDecompressor (CABINET.40)
65
*/
66
BOOL WINAPI CreateDecompressor( DWORD algorithm, COMPRESS_ALLOCATION_ROUTINES *routines, DECOMPRESSOR_HANDLE *handle )
67
{
68
FIXME("algo (%lu) stub\n", algorithm);
69
return TRUE;
70
}
71
72
/***********************************************************************
73
* Decompress (CABINET.43)
74
*/
75
BOOL WINAPI Decompress( DECOMPRESSOR_HANDLE handle, const VOID *data, SIZE_T data_size,
76
VOID *buffer, SIZE_T buffer_size, SIZE_T *decompressed_data_size)
77
{
78
FIXME("stub\n");
79
80
*decompressed_data_size = data_size;
81
82
if( buffer_size < data_size )
83
{
84
SetLastError( ERROR_INSUFFICIENT_BUFFER );
85
return FALSE;
86
}
87
memcpy(buffer, data, data_size);
88
return TRUE;
89
}
90
91
/***********************************************************************
92
* CloseCompressor (CABINET.45)
93
*/
94
BOOL WINAPI CloseDecompressor( DECOMPRESSOR_HANDLE handle )
95
{
96
FIXME("stub\n");
97
return TRUE;
98
}
99
100