]> git.sesse.net Git - rdpsrv/blob - Xserver/programs/Xserver/include/dixstruct.h
Support RDP5 logon packets.
[rdpsrv] / Xserver / programs / Xserver / include / dixstruct.h
1 /***********************************************************
2 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
3
4                         All Rights Reserved
5
6 Permission to use, copy, modify, and distribute this software and its
7 documentation for any purpose and without fee is hereby granted,
8 provided that the above copyright notice appear in all copies and that
9 both that copyright notice and this permission notice appear in
10 supporting documentation, and that the name of Digital not be
11 used in advertising or publicity pertaining to distribution of the
12 software without specific, written prior permission.
13
14 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
20 SOFTWARE.
21
22 ******************************************************************/
23 /* $XConsortium: dixstruct.h /main/43 1996/12/15 21:25:06 rws $ */
24 /* $XFree86: xc/programs/Xserver/include/dixstruct.h,v 3.8 1996/12/24 02:27:28 dawes Exp $ */
25
26 #ifndef DIXSTRUCT_H
27 #define DIXSTRUCT_H
28
29 #include "dix.h"
30 #include "resource.h"
31 #include "cursor.h"
32 #include "gc.h"
33 #include "pixmap.h"
34 #include <X11/Xmd.h>
35
36 /*
37  *      direct-mapped hash table, used by resource manager to store
38  *      translation from client ids to server addresses.
39  */
40
41 #ifdef DEBUG
42 #define MAX_REQUEST_LOG 100
43 #endif
44
45 extern CallbackListPtr ClientStateCallback;
46
47 typedef struct {
48     ClientPtr           client;
49     xConnSetupPrefix    *prefix; 
50     xConnSetup          *setup;
51 } NewClientInfoRec;
52
53 typedef void (*ReplySwapPtr) (
54 #if NeedNestedPrototypes
55                 ClientPtr       /* pClient */,
56                 int             /* size */,
57                 void *          /* pbuf */
58 #endif
59 );
60
61 extern void ReplyNotSwappd (
62 #if NeedNestedPrototypes
63                 ClientPtr       /* pClient */,
64                 int             /* size */,
65                 void *          /* pbuf */
66 #endif
67 );
68
69 typedef enum {ClientStateInitial,
70               ClientStateAuthenticating,
71               ClientStateRunning,
72               ClientStateRetained,
73               ClientStateGone,
74               ClientStateCheckingSecurity,
75               ClientStateCheckedSecurity} ClientState;
76
77 typedef struct _Client {
78     int         index;
79     Mask        clientAsMask;
80     pointer     requestBuffer;
81     pointer     osPrivate;      /* for OS layer, including scheduler */
82     Bool        swapped;
83     ReplySwapPtr pSwapReplyFunc;
84     XID         errorValue;
85     int         sequence;
86     int         closeDownMode;
87     int         clientGone;
88     int         noClientException;      /* this client died or needs to be
89                                          * killed */
90     DrawablePtr lastDrawable;
91     Drawable    lastDrawableID;
92     GCPtr       lastGC;
93     GContext    lastGCID;
94     pointer    *saveSet;
95     int         numSaved;
96     pointer     screenPrivate[MAXSCREENS];
97     int         (**requestVector) (
98 #if NeedNestedPrototypes
99                 ClientPtr /* pClient */
100 #endif
101 );
102     CARD32      req_len;                /* length of current request */
103     Bool        big_requests;           /* supports large requests */
104     int         priority;
105     ClientState clientState;
106     DevUnion    *devPrivates;
107 #ifdef XKB
108     unsigned short      xkbClientFlags;
109     unsigned short      mapNotifyMask;
110     unsigned short      newKeyboardNotifyMask;
111     unsigned short      vMajor,vMinor;
112     KeyCode             minKC,maxKC;
113 #endif
114
115 #ifdef DEBUG
116     unsigned char requestLog[MAX_REQUEST_LOG];
117     int         requestLogIndex;
118 #endif
119 #ifdef LBX
120     int         (*readRequest)(
121 #if NeedNestedPrototypes
122         ClientPtr /*client*/
123 #endif
124 );
125 #endif
126     unsigned long replyBytesRemaining;
127 #ifdef XCSECURITY
128     XID         authId;
129     unsigned int trustLevel;
130     pointer (* CheckAccess)(
131 #if NeedNestedPrototypes
132             ClientPtr /*pClient*/,
133             XID /*id*/,
134             RESTYPE /*classes*/,
135             Mask /*access_mode*/,
136             pointer /*resourceval*/
137 #endif
138 );
139 #endif
140 #ifdef XAPPGROUP
141     struct _AppGroupRec*        appgroup;
142 #endif
143     struct _FontResolution * (*fontResFunc) (    /* no need for font.h */
144 #if NeedNestedPrototypes
145                 ClientPtr       /* pClient */,
146                 int *           /* num */
147 #endif
148 );
149 }           ClientRec;
150
151 /* This prototype is used pervasively in Xext, dix */
152 #if NeedFunctionPrototypes
153 #define DISPATCH_PROC(func) int func(ClientPtr /* client */)
154 #else
155 #define DISPATCH_PROC(func) int func(/* ClientPtr client */)
156 #endif
157
158 typedef struct _WorkQueue {
159     struct _WorkQueue *next;
160     Bool        (*function) (
161 #if NeedNestedPrototypes
162                 ClientPtr       /* pClient */,
163                 pointer         /* closure */
164 #endif
165 );
166     ClientPtr   client;
167     pointer     closure;
168 }           WorkQueueRec;
169
170 extern TimeStamp currentTime;
171 extern TimeStamp lastDeviceEventTime;
172
173 extern int CompareTimeStamps(
174 #if NeedFunctionPrototypes
175     TimeStamp /*a*/,
176     TimeStamp /*b*/
177 #endif
178 );
179
180 extern TimeStamp ClientTimeToServerTime(
181 #if NeedFunctionPrototypes
182     CARD32 /*c*/
183 #endif
184 );
185
186 typedef struct _CallbackRec {
187   CallbackProcPtr proc;
188   pointer data;
189   Bool deleted;
190   struct _CallbackRec *next;
191 } CallbackRec, *CallbackPtr;
192
193 typedef struct _CallbackList {
194   CallbackFuncsRec funcs;
195   int inCallback;
196   Bool deleted;
197   int numDeleted;
198   CallbackPtr list;
199 } CallbackListRec;
200
201 /* proc vectors */
202
203 extern int (* InitialVector[3]) (
204 #if NeedNestedPrototypes
205     ClientPtr /*client*/
206 #endif
207 );
208
209 extern int (* ProcVector[256]) (
210 #if NeedNestedPrototypes
211     ClientPtr /*client*/
212 #endif
213 );
214
215 extern int (* SwappedProcVector[256]) (
216 #if NeedNestedPrototypes
217     ClientPtr /*client*/
218 #endif
219 );
220
221 #ifdef K5AUTH
222 extern int (*k5_Vector[256])() =
223 #if NeedNestedPrototypes
224     ClientPtr /*client*/
225 #endif
226 );
227 #endif
228
229 extern void (* ReplySwapVector[256]) ();
230
231 extern int ProcBadRequest(
232 #if NeedFunctionPrototypes
233     ClientPtr /*client*/
234 #endif
235 );
236
237 #endif                          /* DIXSTRUCT_H */