summaryrefslogtreecommitdiff
path: root/print/XPSDrvSmpl/src/inc/ipkfile.h
blob: 184b194c9c7cabf5316e2fe50929eb566d040cc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*++

Copyright (c) 2005 Microsoft Corporation

All rights reserved.

THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.

File Name:

   ipkfile.h

Abstract:

   Definition of the PK file interface supported by the PK archive handling module.

--*/

#pragma once

//
// All compression types added for completeness. Only CompNone and
// CompDeflated are correctly supported.
//
enum ECompressionType
{
    CompNone = 0,
    CompShrunk,
    CompFactor1,
    CompFactor2,
    CompFactor3,
    CompFactor4,
    CompImploded,
    CompTokenized,
    CompDeflated,
    CompDefalted64,
    CompPKImploded,
    CompPKReserved,
    CompBZIP2
};

class IPKFile
{
public:
    /*++

    Routine Name:

        GetCompressionMethod

    Routine Description:

        This method returns the current compression methof for the archive file

    Arguments:

        pCompType - Pointer to the ECompressionType enumeration that recieves the compression type

    Return Value:

        HRESULT
        S_OK - On success
        E_*  - On error

    --*/
    virtual HRESULT
    GetCompressionMethod(
        _Out_ ECompressionType* peCompType
        ) CONST = 0;

    /*++

    Routine Name:

        GetDecompressedSize

    Routine Description:

        This routine retrieves the size of the uncompressed archive file

    Arguments:

        pcbUnCompressed - Pointer to a ULONG that recieves the decompressed data size

    Return Value:

        HRESULT
        S_OK - On success
        E_*  - On error

    --*/
    virtual HRESULT
    GetDecompressedSize(
        _Out_ ULONG* pcbUnCompressed
        ) CONST = 0;

    /*++

    Routine Name:

        DecompressTo

    Routine Description:

        This routine decompresses the archive file data to the buffer passed

    Arguments:

        pDecompBuffer  - Pointer to the buffer to be filled with decompressed data
        cbDecompBuffer - Size of the decompresssion buffer passed

    Return Value:

        HRESULT
        S_OK - On success
        E_*  - On error

    --*/
    virtual HRESULT
    DecompressTo(
        _Out_writes_bytes_(cbDecompBuffer) PVOID pDecompBuffer,
                                     ULONG cbDecompBuffer
        ) CONST = 0;
};