summaryrefslogtreecommitdiffstats
path: root/private/nw/svcdlls/nwwks/client/bind.c
blob: c87aa7f7db8db1d2cb58c845cb10cd9609a50a78 (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
183
184
185
186
187
188
189
/*++

Copyright (c) 1991-1993 Microsoft Corporation

Module Name:

    bind.c

Abstract:

    Contains the client-side RPC bind and unbind routines for Workstation
    service.

Author:

    Rita Wong    (ritaw)    12-Feb-1993

Environment:

    User Mode -Win32

Revision History:

--*/

//
// INCLUDES
//
#include <nwclient.h>
#include <rpcutil.h>    // RpcUtils for binding
#include <svcs.h>       // For the common pipe name to bind to



handle_t
NWWKSTA_IMPERSONATE_HANDLE_bind(
    NWWKSTA_IMPERSONATE_HANDLE Reserved
    )

/*++

Routine Description:

    This routine is called from the Workstation service client when
    it is necessary create an RPC binding to the server end with
    impersonation level of impersonation.

Arguments:


Return Value:

    The binding handle is returned to the stub routine.  If the bind is
    unsuccessful, a NULL will be returned.

--*/
{
    handle_t BindHandle = 0;
    RPC_STATUS RpcStatus;


    UNREFERENCED_PARAMETER(Reserved);

    RpcStatus = NetpBindRpc(
                    NULL,
                    SVCS_RPC_PIPE,
                    L"Security=Impersonation Dynamic False",
                    &BindHandle
                    );

    if (RpcStatus != RPC_S_OK) {
        KdPrint((
            "NWWORKSTATION: Client NWWKSTA_IMPERSONATE_HANDLE_bind failed: %lu\n",
            RpcStatus
            ));
    }

    return BindHandle;
}



handle_t
NWWKSTA_IDENTIFY_HANDLE_bind(
    NWWKSTA_IDENTIFY_HANDLE Reserved
    )

/*++

Routine Description:

    This routine is called from the Workstation service client stubs when
    it is necessary create an RPC binding to the server end with
    identification level of impersonation.

Arguments:


Return Value:

    The binding handle is returned to the stub routine.  If the bind is
    unsuccessful, a NULL will be returned.

--*/
{
    handle_t BindHandle = 0;
    RPC_STATUS RpcStatus;


    UNREFERENCED_PARAMETER(Reserved);

    RpcStatus = NetpBindRpc(
                    NULL,
                    SVCS_RPC_PIPE,
                    L"Security=Identification Dynamic False",
                    &BindHandle
                    );

    if (RpcStatus != RPC_S_OK) {
        KdPrint((
            "NWWORKSTATION: Client NWWKSTA_IDENTIFY_HANDLE_bind failed: %lu\n",
            RpcStatus
            ));
    }

    return BindHandle;
}



void
NWWKSTA_IMPERSONATE_HANDLE_unbind(
    NWWKSTA_IMPERSONATE_HANDLE Reserved,
    handle_t BindHandle
    )

/*++

Routine Description:

    This routine unbinds the impersonation generic handle.

Arguments:

    Reserved -

    BindingHandle - This is the binding handle that is to be closed.

Return Value:

    None.

--*/
{
    UNREFERENCED_PARAMETER(Reserved);

    NetpUnbindRpc(BindHandle);
}



void
NWWKSTA_IDENTIFY_HANDLE_unbind(
    NWWKSTA_IDENTIFY_HANDLE Reserved,
    handle_t BindHandle
    )

/*++

Routine Description:

    This routine unbinds the identification generic handle.

Arguments:

    Reserved -

    BindingHandle - This is the binding handle that is to be closed.

Return Value:

    None.

--*/
{
    UNREFERENCED_PARAMETER(Reserved);

    NetpUnbindRpc(BindHandle);
}