summaryrefslogtreecommitdiffstats
path: root/private/mvdm/vdmredir/vrmisc.c
blob: 46426900bcdf6fb5f58efd332d76e3786c1e4b0f (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
/*++

Copyright (c) 1991  Microsoft Corporation

Module Name:

    vrmisc.c

Abstract:

    Contains miscellaneous VdmRedir (Vr) functions:

        VrTerminateDosProcess
        VrUnsupportedFunction

Author:

    Richard L Firth (rfirth) 01-Oct-1991

Environment:

    Flat 32-bit

Revision History:

    01-Oct-1991 rfirth
        Created

--*/

#include <nt.h>
#include <ntrtl.h>      // ASSERT, DbgPrint
#include <nturtl.h>
#include <windows.h>
#include <softpc.h>     // x86 virtual machine definitions
#include <vrdlctab.h>
#include <vdmredir.h>   // common Vdm Redir stuff
#include <vrmisc.h>     // Vr miscellaneous prototypes
#include <vrmslot.h>    // Vr mailslot prototypes
#include <vrnmpipe.h>   // Vr named pipe prototypes
#include "vrdebug.h"    // debugging stuff


VOID
VrTerminateDosProcess(
    VOID
    )

/*++

Routine Description:

    When a Dos app terminates a NetResetEnvironment is sent to the redir so
    that it can clean up any state info left by the closing application. In
    our case control is passed here and we perform common cleanup operations
    like deleting any outstanding mailslots

Arguments:

    AX = PDB of terminating DOS process

Return Value:

    None.

--*/

{
    WORD DosPdb = getAX();

#if DBG

    IF_DEBUG(NETAPI) {
        DbgPrint("VrTerminateDosProcess. PDB=%04x\n", DosPdb);
    }

#endif

    VrTerminateMailslots(DosPdb);
    VrTerminateNamedPipes(DosPdb);
}


VOID
VrUnsupportedFunction(
    VOID
    )

/*++

Routine Description:

    Default error routine for unsupported/not-yet-implemented functions

Arguments:

    None.

Return Value:

    None.
    Sets CF=1 in x86 context image and AX=ERROR_NOT_SUPPORTED (50)

--*/

{

#if DBG

    DbgPrint("VrUnsupportedFunction\n");
    VrDumpRealMode16BitRegisters(TRUE);

#endif

    SET_ERROR(ERROR_NOT_SUPPORTED);
}