Initial commit - from Precise source
[freerdp-ubuntu-pcb-backport.git] / channels / rdpdr / rdpdr_types.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol client.
3  * File System Virtual Channel
4  *
5  * Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
6  * Copyright 2010-2011 Vic Lee
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *     http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20
21 #ifndef __RDPDR_TYPES_H
22 #define __RDPDR_TYPES_H
23
24 #include "config.h"
25 #include <freerdp/utils/stream.h>
26 #include <freerdp/utils/list.h>
27 #include <freerdp/utils/svc_plugin.h>
28
29 typedef struct _DEVICE DEVICE;
30 typedef struct _IRP IRP;
31 typedef struct _DEVMAN DEVMAN;
32
33
34 typedef void (*pcIRPRequest)(DEVICE* device, IRP* irp);
35 typedef void (*pcFreeDevice)(DEVICE* device);
36
37 struct _DEVICE
38 {
39         uint32 id;
40
41         uint32 type;
42         char* name;
43         STREAM* data;
44
45         pcIRPRequest IRPRequest;
46         pcFreeDevice Free;
47 };
48
49 typedef void (*pcIRPResponse)(IRP* irp);
50
51 struct _IRP
52 {
53         DEVICE* device;
54         DEVMAN* devman;
55         uint32 FileId;
56         uint32 CompletionId;
57         uint32 MajorFunction;
58         uint32 MinorFunction;
59         STREAM* input;
60
61         uint32 IoStatus;
62         STREAM* output;
63
64         pcIRPResponse Complete;
65         pcIRPResponse Discard;
66 };
67
68 struct _DEVMAN
69 {
70         rdpSvcPlugin* plugin;
71         uint32 id_sequence; /* generate unique device id */
72         LIST* devices;
73 };
74
75 typedef void (*pcRegisterDevice)(DEVMAN* devman, DEVICE* device);
76
77 struct _DEVICE_SERVICE_ENTRY_POINTS
78 {
79         DEVMAN* devman;
80
81         pcRegisterDevice RegisterDevice;
82         pcRegisterDevice UnregisterDevice;
83         RDP_PLUGIN_DATA* plugin_data;
84 };
85 typedef struct _DEVICE_SERVICE_ENTRY_POINTS DEVICE_SERVICE_ENTRY_POINTS;
86 typedef DEVICE_SERVICE_ENTRY_POINTS* PDEVICE_SERVICE_ENTRY_POINTS;
87
88 typedef int (*PDEVICE_SERVICE_ENTRY)(PDEVICE_SERVICE_ENTRY_POINTS);
89
90 #endif /* __RDPDR_TYPES_H */