Add stubs for dir information handlers

This commit is contained in:
Michael Jumper 2013-07-31 15:13:11 -07:00
parent e238df9581
commit 1263d261f4
5 changed files with 191 additions and 2 deletions

View File

@ -66,6 +66,7 @@ guacsnd_sources = \
guacdr_sources = \ guacdr_sources = \
guac_rdpdr/rdpdr_fs.c \ guac_rdpdr/rdpdr_fs.c \
guac_rdpdr/rdpdr_fs_messages.c \ guac_rdpdr/rdpdr_fs_messages.c \
guac_rdpdr/rdpdr_fs_messages_dir_info.c \
guac_rdpdr/rdpdr_fs_messages_file_info.c \ guac_rdpdr/rdpdr_fs_messages_file_info.c \
guac_rdpdr/rdpdr_fs_messages_vol_info.c \ guac_rdpdr/rdpdr_fs_messages_vol_info.c \
guac_rdpdr/rdpdr_fs_service.c \ guac_rdpdr/rdpdr_fs_service.c \
@ -78,6 +79,7 @@ noinst_HEADERS = \
compat/client-cliprdr.h \ compat/client-cliprdr.h \
guac_rdpdr/rdpdr_fs.h \ guac_rdpdr/rdpdr_fs.h \
guac_rdpdr/rdpdr_fs_messages.h \ guac_rdpdr/rdpdr_fs_messages.h \
guac_rdpdr/rdpdr_fs_messages_dir_info.h \
guac_rdpdr/rdpdr_fs_messages_file_info.h \ guac_rdpdr/rdpdr_fs_messages_file_info.h \
guac_rdpdr/rdpdr_fs_messages_vol_info.h \ guac_rdpdr/rdpdr_fs_messages_vol_info.h \
guac_rdpdr/rdpdr_fs_service.h \ guac_rdpdr/rdpdr_fs_service.h \

View File

@ -47,6 +47,7 @@
#include "rdpdr_fs_messages.h" #include "rdpdr_fs_messages.h"
#include "rdpdr_fs_messages_vol_info.h" #include "rdpdr_fs_messages_vol_info.h"
#include "rdpdr_fs_messages_file_info.h" #include "rdpdr_fs_messages_file_info.h"
#include "rdpdr_fs_messages_dir_info.h"
#include "rdpdr_messages.h" #include "rdpdr_messages.h"
#include "rdpdr_service.h" #include "rdpdr_service.h"
#include "client.h" #include "client.h"
@ -268,8 +269,54 @@ void guac_rdpdr_fs_process_notify_change_directory(guac_rdpdr_device* device,
void guac_rdpdr_fs_process_query_directory(guac_rdpdr_device* device, wStream* input_stream, void guac_rdpdr_fs_process_query_directory(guac_rdpdr_device* device, wStream* input_stream,
int file_id, int completion_id) { int file_id, int completion_id) {
/* STUB */
guac_client_log_info(device->rdpdr->client, "STUB: %s", __func__); int fs_information_class, initial_query;
int path_length;
/* Read main header */
Stream_Read_UINT32(input_stream, fs_information_class);
Stream_Read_UINT8(input_stream, initial_query);
Stream_Read_UINT32(input_stream, path_length);
/* If this is the first query, the path is included after padding */
if (initial_query) {
Stream_Seek(input_stream, 23); /* Padding */
/* Path here */
}
guac_client_log_info(device->rdpdr->client,
"Received dir query - class=0x%x, path_length=%i",
fs_information_class, path_length);
/* Dispatch to appropriate class-specific handler */
switch (fs_information_class) {
case FileDirectoryInformation:
guac_rdpdr_fs_process_query_directory_info(device, input_stream,
file_id, completion_id);
break;
case FileFullDirectoryInformation:
guac_rdpdr_fs_process_query_full_directory_info(device, input_stream,
file_id, completion_id);
break;
case FileBothDirectoryInformation:
guac_rdpdr_fs_process_query_both_directory_info(device, input_stream,
file_id, completion_id);
break;
case FileNamesInformation:
guac_rdpdr_fs_process_query_names_info(device, input_stream,
file_id, completion_id);
break;
default:
guac_client_log_info(device->rdpdr->client,
"Unknown dir information class: 0x%x", fs_information_class);
}
} }
void guac_rdpdr_fs_process_lock_control(guac_rdpdr_device* device, wStream* input_stream, void guac_rdpdr_fs_process_lock_control(guac_rdpdr_device* device, wStream* input_stream,

View File

@ -0,0 +1,69 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifdef ENABLE_WINPR
#include <winpr/stream.h>
#else
#include "compat/winpr-stream.h"
#endif
#include "rdpdr_service.h"
void guac_rdpdr_fs_process_query_directory_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id) {
/* STUB */
guac_client_log_info(device->rdpdr->client, "STUB: %s", __func__);
}
void guac_rdpdr_fs_process_query_full_directory_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id) {
/* STUB */
guac_client_log_info(device->rdpdr->client, "STUB: %s", __func__);
}
void guac_rdpdr_fs_process_query_both_directory_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id) {
/* STUB */
guac_client_log_info(device->rdpdr->client, "STUB: %s", __func__);
}
void guac_rdpdr_fs_process_query_names_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id) {
/* STUB */
guac_client_log_info(device->rdpdr->client, "STUB: %s", __func__);
}

View File

@ -0,0 +1,62 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is libguac-client-rdp.
*
* The Initial Developer of the Original Code is
* Michael Jumper.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __GUAC_RDPDR_FS_MESSAGES_DIR_INFO_H
#define __GUAC_RDPDR_FS_MESSAGES_DIR_INFO_H
#ifdef ENABLE_WINPR
#include <winpr/stream.h>
#else
#include "compat/winpr-stream.h"
#endif
#include "rdpdr_service.h"
void guac_rdpdr_fs_process_query_directory_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id);
void guac_rdpdr_fs_process_query_full_directory_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id);
void guac_rdpdr_fs_process_query_both_directory_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id);
void guac_rdpdr_fs_process_query_names_info(guac_rdpdr_device* device,
wStream* input_stream, int file_id, int completion_id);
#endif

View File

@ -226,6 +226,15 @@
#define FileStandardInformation 0x00000005 #define FileStandardInformation 0x00000005
#define FileAttributeTagInformation 0x00000023 #define FileAttributeTagInformation 0x00000023
/*
* Directory information constants.
*/
#define FileDirectoryInformation 0x00000001
#define FileFullDirectoryInformation 0x00000002
#define FileBothDirectoryInformation 0x00000003
#define FileNamesInformation 0x0000000C
/* /*
* Message handlers. * Message handlers.
*/ */