xrdp/sesman/chansrv/devredir.h

99 lines
3.0 KiB
C
Raw Normal View History

2012-07-25 06:16:00 +04:00
/**
* xrdp: A Remote Desktop Protocol server.
*
* xrdp device redirection - we mainly use it for drive redirection
*
* 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
#include "irp.h"
#include "ms-rdpefs.h"
int devredir_init(void);
int devredir_deinit(void);
2021-05-08 19:58:11 +03:00
int devredir_data_in(struct stream *s, int chan_id, int chan_flags,
int length, int total_length);
2021-05-08 19:58:11 +03:00
int devredir_get_wait_objs(tbus *objs, int *count, int *timeout);
int devredir_check_wait_objs(void);
/* misc stuff */
void devredir_insert_DeviceIoRequest(struct stream *s,
tui32 DeviceId,
tui32 FileId,
tui32 CompletionId,
enum IRP_MJ MajorFunction,
enum IRP_MN MinorFunction);
/* State pointer types (opaque outside this module), used for
* callback data
*/
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;
/* called from FUSE module */
int devredir_get_dir_listing(struct state_dirscan *fusep, tui32 device_id,
2021-05-08 19:58:11 +03:00
const char *path);
int devredir_lookup_entry(struct state_lookup *fusep, tui32 device_id,
2021-05-08 19:58:11 +03:00
const char *path);
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);
int devredir_file_create(
2021-05-08 19:58:11 +03:00
struct state_create *fusep, tui32 device_id,
const char *path, int mode);
int devredir_file_open(struct state_open *fusep, tui32 device_id,
2021-05-08 19:58:11 +03:00
const char *path, int flags);
int devredir_file_close(struct state_close *fusep, tui32 device_id,
tui32 file_id);
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);
2020-03-03 13:02:32 +03:00
void
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
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
int
devredir_rmdir_or_file(struct state_remove *fusep, tui32 device_id,
const char *path);
2009-04-22 08:34:45 +04:00
#endif