summaryrefslogtreecommitdiffstats
path: root/private/ntos/mailslot/verfysup.c
blob: 79bd0c792cc627a3edd1b2f2d0a7e4a64c63b3a6 (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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/*++

Copyright (c) 1989  Microsoft Corporation

Module Name:

    verfysup.c

Abstract:

    This module implements the verify functions for MSFS.

Author:

    Manny Weiser (mannyw)    23-Jan-1991

Revision History:

--*/

#include "mailslot.h"

//
//  The debug trace level
//

#define Dbg                              (DEBUG_TRACE_VERIFY)

#ifdef ALLOC_PRAGMA
#pragma alloc_text( PAGE, MsVerifyCcb )
#pragma alloc_text( PAGE, MsVerifyFcb )
#pragma alloc_text( PAGE, MsVerifyRootDcb )
#pragma alloc_text( PAGE, MsVerifyVcb )
#endif


VOID
MsVerifyFcb (
    IN PFCB Fcb
    )

/*++

Routine Description:

    This function verifies that an FCB is still active.  If it is active,
    the function  does nothing.  If it is inactive an error status is raised.

Arguments:

    PFCB - A pointer to the FCB to verify.

Return Value:

    None.

--*/

{
    PAGED_CODE();
    DebugTrace(+1, Dbg, "MsVerifyFcb, Fcb = %08lx\n", (ULONG)Fcb);
    if ( Fcb->Header.NodeState != NodeStateActive ) {

        DebugTrace( 0, Dbg, "Fcb is not active\n", 0);
        ExRaiseStatus( STATUS_FILE_INVALID );

    }

    DebugTrace(-1, Dbg, "MsVerifyFcb -> VOID\n", 0);
    return;
}


VOID
MsVerifyCcb (
    IN PCCB Ccb
    )

/*++

Routine Description:

    This function verifies that a CCB is still active.  If it is active,
    the function  does nothing.  If it is inactive an error status is raised.

Arguments:

    PCCB - A pointer to the CCB to verify.

Return Value:

    None.

--*/

{
    PAGED_CODE();
    DebugTrace(+1, Dbg, "MsVerifyCcb, Ccb = %08lx\n", (ULONG)Ccb);
    if ( Ccb->Header.NodeState != NodeStateActive ) {

        DebugTrace( 0, Dbg, "Ccb is not active\n", 0);
        ExRaiseStatus( STATUS_FILE_INVALID );

    }

    DebugTrace(-1, Dbg, "MsVerifyCcb -> VOID\n", 0);
    return;
}


VOID
MsVerifyRootDcb (
    IN PROOT_DCB RootDcb
    )

/*++

Routine Description:

    This function verifies that a root DCB is still active.  If it is active,
    the function  does nothing.  If it is inactive an error status is raised.

Arguments:

    PROOT_DCB - A pointer to the ROOT_DCB to verify.

Return Value:

    None.

--*/

{
    PAGED_CODE();
    DebugTrace(+1, Dbg, "MsVerifyRootDcb, RootDcb = %08lx\n", (ULONG)RootDcb);
    if ( RootDcb->Header.NodeState != NodeStateActive ) {

        DebugTrace( 0, Dbg, "RootDcb is not active\n", 0);
        ExRaiseStatus( STATUS_FILE_INVALID );

    }

    DebugTrace(-1, Dbg, "MsVerifyRootDcb -> VOID\n", 0);
    return;
}


VOID
MsVerifyVcb (
    IN PVCB Vcb
    )

/*++

Routine Description:

    This function verifies that a VCB is still active.  If it is active,
    the function  does nothing.  If it is inactive an error status is raised.

Arguments:

    PVCB - A pointer to the VCB to verify.

Return Value:

    None.

--*/

{
    PAGED_CODE();
    DebugTrace(+1, Dbg, "MsVerifyVcb, Vcb = %08lx\n", (ULONG)Vcb);
    if ( Vcb->Header.NodeState != NodeStateActive ) {

        DebugTrace( 0, Dbg, "Vcb is not active\n", 0);
        ExRaiseStatus( STATUS_FILE_INVALID );

    }

    DebugTrace(-1, Dbg, "MsVerifyVcb -> VOID\n", 0);
    return;
}