summaryrefslogtreecommitdiffstats
path: root/private/ole32/ih/rothint.hxx
blob: 6ce287b0d41fe520d07276f9424d714652792455 (plain) (blame)
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
//+-------------------------------------------------------------------------
//
//  Microsoft Windows
//  Copyright (C) Microsoft Corporation, 1992 - 1993.
//
//  File:       rothint.hxx
//
//  Contents:   Base class for ROT hint table used in NT
//
//  History:    24-Jan-95 Ricksa    Created
//
//--------------------------------------------------------------------------
#ifndef __ROTHINT_HXX__
#define __ROTHINT_HXX__

// Size of the hint table and size of the SCM's hash table for the ROT.
#define SCM_HASH_SIZE 251

// Name of hint table for non-NT1X
#define ROTHINT_NAME L"RotHintTable"

#ifndef _CHICAGO_

//+-------------------------------------------------------------------------
//
//  Class:	CRotHintTable (rht)
//
//  Purpose:    Base class for hint table shared between SCM and OLE32.
//              It is designed to abstract what is fundamental an array
//              of on/off switches.
//
//  Interface:	SetIndicator - set indicator byte
//              ClearIndicator - clear indicator byte
//              GetIndicator - get indicator byte.
//
//  History:	24-Jan-93 Ricksa    Created
//
//  Notes:	
//
//--------------------------------------------------------------------------
class CRotHintTable
{
public:
                        CRotHintTable(void);

    void                SetIndicator(DWORD dwOffset);

    void                ClearIndicator(DWORD dwOffset);

    BOOL                GetIndicator(DWORD dwOffset);

protected:

                        // This memory is allocated by the derived class.
                        // The SCM actually creates the memory while the
                        // client just opens the memory.
    BYTE *              _pbHintArray;
};



//+-------------------------------------------------------------------------
//
//  Member:     CRotHintTable::CRotHintTable
//
//  Synopsis:   Initialize object
//
//  History:	24-Jan-95 Ricksa    Created
//
//--------------------------------------------------------------------------
inline CRotHintTable::CRotHintTable(void) : _pbHintArray(NULL)
{
    // Header does all the work
}


//+-------------------------------------------------------------------------
//
//  Member:     CRotHintTable::SetIndicator
//
//  Synopsis:   Turn switch on
//
//  History:	24-Jan-95 Ricksa    Created
//
//--------------------------------------------------------------------------
inline void CRotHintTable::SetIndicator(DWORD dwOffset)
{
    _pbHintArray[dwOffset] = TRUE;
}

//+-------------------------------------------------------------------------
//
//  Member:     CRotHintTable::ClearIndicator
//
//  Synopsis:   Turn switch off
//
//  History:	24-Jan-95 Ricksa    Created
//
//--------------------------------------------------------------------------
inline void CRotHintTable::ClearIndicator(DWORD dwOffset)
{
    _pbHintArray[dwOffset] = FALSE;
}


//+-------------------------------------------------------------------------
//
//  Member:     CRotHintTable::GetIndicator
//
//  Synopsis:   Get the state of the switch
//
//  History:	24-Jan-95 Ricksa    Created
//
//--------------------------------------------------------------------------
inline BOOL CRotHintTable::GetIndicator(DWORD dwOffset)
{
    return _pbHintArray[dwOffset];
}



#endif // !_CHICAGO_

#endif // __ROTHINT_HXX__