2012-07-25 06:16:00 +04:00
|
|
|
/**
|
|
|
|
* xrdp: A Remote Desktop Protocol server.
|
|
|
|
*
|
2013-03-09 03:37:30 +04:00
|
|
|
* xrdp device redirection - we mainly use it for drive redirection
|
|
|
|
*
|
2013-03-24 23:08:55 +04:00
|
|
|
* Copyright (C) Laxmikant Rashinkar 2013 LK.Rashinkar@gmail.com
|
2012-07-25 06:16:00 +04:00
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2009-04-22 08:34:45 +04:00
|
|
|
|
|
|
|
#if !defined(DEVREDIR_H)
|
|
|
|
#define DEVREDIR_H
|
|
|
|
|
2013-05-16 04:06:05 +04:00
|
|
|
#include "irp.h"
|
2019-11-14 17:43:57 +03:00
|
|
|
#include "ms-rdpefs.h"
|
2013-03-09 03:37:30 +04:00
|
|
|
|
2019-11-14 17:43:57 +03:00
|
|
|
int devredir_init(void);
|
|
|
|
int devredir_deinit(void);
|
2013-03-09 03:37:30 +04:00
|
|
|
|
2021-05-08 19:58:11 +03:00
|
|
|
int devredir_data_in(struct stream *s, int chan_id, int chan_flags,
|
2019-11-14 17:43:57 +03:00
|
|
|
int length, int total_length);
|
2013-03-09 03:37:30 +04:00
|
|
|
|
2021-05-08 19:58:11 +03:00
|
|
|
int devredir_get_wait_objs(tbus *objs, int *count, int *timeout);
|
2019-11-14 17:43:57 +03:00
|
|
|
int devredir_check_wait_objs(void);
|
2013-03-09 03:37:30 +04:00
|
|
|
|
|
|
|
/* misc stuff */
|
2013-05-16 04:06:05 +04:00
|
|
|
void devredir_insert_DeviceIoRequest(struct stream *s,
|
|
|
|
tui32 DeviceId,
|
|
|
|
tui32 FileId,
|
|
|
|
tui32 CompletionId,
|
2019-11-14 17:43:57 +03:00
|
|
|
enum IRP_MJ MajorFunction,
|
|
|
|
enum IRP_MN MinorFunction);
|
2013-03-09 03:37:30 +04:00
|
|
|
|
2019-11-14 17:43:57 +03:00
|
|
|
/* State pointer types (opaque outside this module), used for
|
|
|
|
* callback data
|
2013-03-09 03:37:30 +04:00
|
|
|
*/
|
2019-11-14 17:43:57 +03:00
|
|
|
struct state_dirscan;
|
|
|
|
struct state_lookup;
|
|
|
|
struct state_setattr;
|
|
|
|
struct state_open;
|
|
|
|
struct state_create;
|
|
|
|
struct state_read;
|
|
|
|
struct state_write;
|
|
|
|
struct state_remove;
|
|
|
|
struct state_close;
|
2013-03-09 03:37:30 +04:00
|
|
|
|
2019-11-14 17:43:57 +03:00
|
|
|
/* called from FUSE module */
|
2013-03-09 03:37:30 +04:00
|
|
|
|
2019-11-14 17:43:57 +03:00
|
|
|
int devredir_get_dir_listing(struct state_dirscan *fusep, tui32 device_id,
|
2021-05-08 19:58:11 +03:00
|
|
|
const char *path);
|
2013-03-09 03:37:30 +04:00
|
|
|
|
2019-11-14 17:43:57 +03:00
|
|
|
int devredir_lookup_entry(struct state_lookup *fusep, tui32 device_id,
|
2021-05-08 19:58:11 +03:00
|
|
|
const char *path);
|
2013-03-09 03:37:30 +04:00
|
|
|
|
2019-11-14 17:43:57 +03:00
|
|
|
int devredir_setattr_for_entry(
|
2021-05-08 19:58:11 +03:00
|
|
|
struct state_setattr *fusep, tui32 device_id,
|
|
|
|
const char *filename,
|
|
|
|
const struct file_attr *fattr,
|
|
|
|
tui32 to_set);
|
2013-03-09 03:37:30 +04:00
|
|
|
|
2019-11-14 17:43:57 +03:00
|
|
|
int devredir_file_create(
|
2021-05-08 19:58:11 +03:00
|
|
|
struct state_create *fusep, tui32 device_id,
|
|
|
|
const char *path, int mode);
|
2013-03-09 03:37:30 +04:00
|
|
|
|
2019-11-14 17:43:57 +03:00
|
|
|
int devredir_file_open(struct state_open *fusep, tui32 device_id,
|
2021-05-08 19:58:11 +03:00
|
|
|
const char *path, int flags);
|
2013-03-09 03:37:30 +04:00
|
|
|
|
2019-11-14 17:43:57 +03:00
|
|
|
int devredir_file_close(struct state_close *fusep, tui32 device_id,
|
|
|
|
tui32 file_id);
|
2013-03-09 03:37:30 +04:00
|
|
|
|
2020-03-03 13:02:32 +03:00
|
|
|
void
|
|
|
|
devredir_file_read(struct state_read *fusep, tui32 device_id, tui32 FileId,
|
|
|
|
tui32 Length, tui64 Offset);
|
2013-03-09 03:37:30 +04:00
|
|
|
|
2020-03-03 13:02:32 +03:00
|
|
|
void
|
2019-11-14 17:43:57 +03:00
|
|
|
devredir_file_write(struct state_write *fusep, tui32 DeviceId, tui32 FileId,
|
2020-03-03 13:02:32 +03:00
|
|
|
const char *buf, int Length, tui64 Offset);
|
2009-04-22 08:34:45 +04:00
|
|
|
|
2019-11-14 17:43:57 +03:00
|
|
|
int devredir_file_rename(
|
2021-05-08 19:58:11 +03:00
|
|
|
struct state_rename *fusep, tui32 device_id,
|
|
|
|
const char *old_name,
|
|
|
|
const char *new_name);
|
2009-04-22 08:34:45 +04:00
|
|
|
|
2019-11-14 17:43:57 +03:00
|
|
|
int
|
|
|
|
devredir_rmdir_or_file(struct state_remove *fusep, tui32 device_id,
|
|
|
|
const char *path);
|
2013-03-24 23:08:55 +04:00
|
|
|
|
2009-04-22 08:34:45 +04:00
|
|
|
#endif
|