Merge pull request #1943 from matt335672/remove_tcutils

Remove tcutils (#1943)
This commit is contained in:
matt335672 2021-07-16 11:26:21 +01:00 committed by GitHub
commit efcd960748
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 0 additions and 1173 deletions

View File

@ -20,7 +20,6 @@ EXTRA_DIST = \
install.txt \ install.txt \
m4 \ m4 \
postinstall-pak \ postinstall-pak \
tcutils \
vrplayer vrplayer
if XRDP_NEUTRINORDP if XRDP_NEUTRINORDP

View File

@ -140,7 +140,6 @@ xrdp
|├── chansrv ···· channel server for xrdp |├── chansrv ···· channel server for xrdp
|├── libscp ····· authorization library |├── libscp ····· authorization library
|└── tools ······ session management tools for sys admins |└── tools ······ session management tools for sys admins
├── tcutils ····· QT based utility program for thin clients
├── tests ······· tests for the code ├── tests ······· tests for the code
├┬─ tools ······· tools ├┬─ tools ······· tools
|└┬─ devel ······ development tools |└┬─ devel ······ development tools

View File

@ -1,29 +0,0 @@
A QT based utility program for thin clients using xrdp and NeutrinoRDP
This program sends commands to NeutrinoRDP to do something
useful on the client end (such as unmounting a USB drive,
or powering down the client)
Required packages to build tcutils:
-----------------------------------
libqt4-gui
qt4-dev-tools
to build tcutils:
-----------------
qmake
make
To run tcutils:
---------------
include xrdpapi/.libs in your LD_LIBRARY_PATH
Example:
--------
export LD_LIBRARY_PATH=../xrdpapi/.libs
run tcutils inside the xfreerdp session
this is how we run xfreerdp:
----------------------------
./xfreerdp --sec rdp --plugin tcutils 192.168.2.149

View File

@ -1,11 +0,0 @@
#include <QtGui/QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}

View File

@ -1,234 +0,0 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
wtsChannel = NULL;
okToQuit = false;
savedGeometry = this->geometry();
/* setup tab to unmount drives */
ui->tabWidget->setTabText(0, "Unmount drives");
connect(ui->btnRefresh, SIGNAL(clicked()), this, SLOT(onBtnRefreshClicked()));
connect(ui->btnUnmount, SIGNAL(clicked()), this, SLOT(onBtnUnmountClicked()));
ui->tabWidget->setTabText(1, "");
if (initWtsChannel())
{
okToQuit = true;
QTimer::singleShot(10, qApp, SLOT(quit()));
return;
}
setupSystemTray();
/* set up status bar to display messages */
statusBar = new QStatusBar;
this->setStatusBar(statusBar);
setStatusMsg("Connected to client");
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::setupSystemTray()
{
trayMenu = new QMenu(this);
trayMenu->addAction("Launch Thinclient Utils", this, SLOT(onActionLaunch()));
trayMenu->addSeparator();
trayMenu->addAction("Quit", this, SLOT(onActionQuit()));
trayIcon = new QSystemTrayIcon;
trayIcon->setContextMenu(trayMenu);
trayIcon->setIcon(QIcon(":/images/resources/images/tools.gif"));
trayIcon->show();
trayIcon->showMessage("TCutils", "Click on the tcutils icon to launch tcutils",
QSystemTrayIcon::Information, 3000);
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
this, SLOT(onSystemTrayClicked(QSystemTrayIcon::ActivationReason)));
}
/**
*
*****************************************************************************/
int MainWindow::initWtsChannel()
{
/* init the channel just once */
if (wtsChannel)
return 0;
/* open a WTS channel and connect to remote client */
wtsChannel = WTSVirtualChannelOpenEx(WTS_CURRENT_SESSION, "tcutils", 0);
if (wtsChannel == NULL)
{
QMessageBox::information(this, "Open virtual channel", "Error "
"connecting to remote client. This program "
"can only be used when connected via "
"NeutrinoRDP.\n\nClick ok to close this "
"application");
return -1;
}
return 0;
}
/**
*
*****************************************************************************/
int MainWindow::deinitWtsChannel()
{
if (!wtsChannel)
return -1;
WTSVirtualChannelClose(wtsChannel);
return 0;
}
/**
* Display a msg on the status bar
*
* @param msg message to display in status bar
*****************************************************************************/
void MainWindow::setStatusMsg(QString msg)
{
statusBar->showMessage(msg, 30000);
}
/**
*
*****************************************************************************/
void MainWindow::closeEvent(QCloseEvent *event)
{
if (!okToQuit)
{
savedGeometry = this->geometry();
this->hide();
event->ignore();
return;
}
if (wtsChannel)
deinitWtsChannel();
event->accept();
}
/******************************************************************************
** **
** slots go here **
** **
******************************************************************************/
#if 1
void MainWindow::onBtnRefreshClicked()
{
int i;
/* clear drive list */
if (itemList.count())
{
for (i = 0; i < itemList.count(); i++)
ui->listWidget->removeItemWidget(itemList.at(i));
itemList.clear();
}
ui->listWidget->clear();
if (Utils::getMountList(wtsChannel, &itemList))
{
QMessageBox::information(this, "Get device list", "\nError getting "
"device list from client");
return;
}
if (itemList.count() == 0)
{
QMessageBox::information(this, "Get device list",
"\nNo devices found!");
return;
}
/* add mount point to list widget */
for (i = 0; i < itemList.count(); i++)
ui->listWidget->insertItem(i, itemList.at(i));
}
#else
void MainWindow::onBtnRefreshClicked()
{
QListWidgetItem *item;
int i;
int j;
/* clear drive list */
if (itemList.count())
{
for (i = 0; i < itemList.count(); i++)
ui->listWidget->removeItemWidget(itemList.at(i));
itemList.clear();
}
ui->listWidget->clear();
QDir dir(QDir::homePath() + "/xrdp_client");
QStringList sl = dir.entryList();
for (i = 0, j = 0; i < sl.count(); i++)
{
/* skip files starting with . */
if (sl.at(i).startsWith("."))
continue;
/* add mount point to list widget */
item = new QListWidgetItem;
item->setText(sl.at(i));
ui->listWidget->insertItem(j++, item);
itemList.append(item);
}
}
#endif
void MainWindow::onBtnUnmountClicked()
{
QListWidgetItem *item = ui->listWidget->currentItem();
if (!item)
{
QMessageBox::information(this, "Unmount device", "\nNo device selected. "
"You must select a device to unmount");
return;
}
if (Utils::unmountDevice(wtsChannel, item->text(), statusBar) == 0)
{
delete ui->listWidget->takeItem(itemList.indexOf(item));
itemList.removeOne(item);
}
}
void MainWindow::onActionQuit()
{
okToQuit = true;
this->close();
}
void MainWindow::onActionLaunch()
{
this->show();
this->setGeometry(savedGeometry);
}
void MainWindow::onSystemTrayClicked(QSystemTrayIcon::ActivationReason)
{
trayMenu->popup(QCursor::pos());
}

View File

@ -1,58 +0,0 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <xrdpapi.h>
#include <QSystemTrayIcon>
#include <QMenu>
#include <QCloseEvent>
#include <QFileDialog>
#include <QDir>
#include <QListWidgetItem>
#include <QList>
#include <QMessageBox>
#include <QTimer>
#include <QStatusBar>
//#include <QDebug>
#include "utils.h"
namespace Ui
{
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
void *wtsChannel;
QSystemTrayIcon *trayIcon;
QMenu *trayMenu;
bool okToQuit;
QRect savedGeometry;
QStatusBar *statusBar;
QList<QListWidgetItem *> itemList;
void setupSystemTray();
int initWtsChannel();
int deinitWtsChannel();
void setStatusMsg(QString msg);
void closeEvent(QCloseEvent *event);
private slots:
void onBtnRefreshClicked();
void onBtnUnmountClicked();
void onActionQuit();
void onActionLaunch();
void onSystemTrayClicked(QSystemTrayIcon::ActivationReason);
};
#endif // MAINWINDOW_H

View File

@ -1,100 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>541</width>
<height>355</height>
</rect>
</property>
<property name="windowTitle">
<string>TC Utils</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QTabWidget" name="tabWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>511</width>
<height>291</height>
</rect>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tabUnmount">
<attribute name="title">
<string>Tab 1</string>
</attribute>
<widget class="QListWidget" name="listWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>321</width>
<height>221</height>
</rect>
</property>
</widget>
<widget class="QPushButton" name="btnUnmount">
<property name="geometry">
<rect>
<x>350</x>
<y>60</y>
<width>141</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>Unmount device</string>
</property>
</widget>
<widget class="QPushButton" name="btnRefresh">
<property name="geometry">
<rect>
<x>350</x>
<y>10</y>
<width>141</width>
<height>27</height>
</rect>
</property>
<property name="text">
<string>Get device list</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Tab 2</string>
</attribute>
</widget>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>541</width>
<height>25</height>
</rect>
</property>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>

View File

@ -1,5 +0,0 @@
<RCC>
<qresource prefix="/images">
<file>resources/images/tools.gif</file>
</qresource>
</RCC>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@ -1,365 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by Qt Creator 2.4.1, 2013-08-25T13:35:29. -->
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QString" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">System</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">true</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">2</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.DesktopTarget</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-32bit./usr/bin/gdb</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.1 in PATH (System) Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/home/lk/projects/jtech/nlabs_xrdp_tcutils/tcutils-build-desktop-Qt_4_8_1_in_PATH__System__Release</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-32bit./usr/bin/gdb</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.1 in PATH (System) Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
<value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/home/lk/projects/jtech/nlabs_xrdp_tcutils/tcutils-build-desktop-Qt_4_8_1_in_PATH__System__Debug</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-32bit./usr/bin/gdb</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.1 (System) Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/home/lk/projects/jtech/nlabs_xrdp_tcutils/tcutils-build-desktop-Qt_4_8_1__System__Release</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">2</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
<value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-32bit./usr/bin/gdb</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.1 (System) Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
<value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/home/lk/projects/jtech/nlabs_xrdp_tcutils/tcutils-build-desktop-Qt_4_8_1__System__Debug</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">2</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">4</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.Project.UseGlobal">true</value>
<value type="bool" key="Analyzer.Project.UseGlobal">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">tcutils</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase">2</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">tcutils.pro</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
<value type="QString">{9a0d9632-2baf-44e0-864a-a12692180779}</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">10</value>
</data>
</qtcreator>

View File

@ -1,217 +0,0 @@
#include "utils.h"
Utils::Utils()
{
}
int Utils::getMountList(void *wtsChannel, QList<QListWidgetItem *> *itemList)
{
QListWidgetItem *item;
STREAM s;
quint32 bytesToSend;
quint32 bytesWritten;
quint32 bytesRead;
quint32 cmdLen;
quint32 cmd;
int rv;
int i;
int nentries;
char buf[2048];
if (!wtsChannel)
return -1;
qstream_new(s, 1024 * 8);
/*
* command format:
* 4 bytes cmd_len length of this command
* 1 byte cmd TCU_CMD_GET_MOUNT_LIST
*/
/* setup command */
qstream_wr_u32(&s, 1);
qstream_wr_u8(&s, TCU_CMD_GET_MOUNT_LIST);
bytesToSend = 5;
/* send command */
rv = WTSVirtualChannelWrite(wtsChannel, s.data, bytesToSend, &bytesWritten);
if (rv == 0)
{
QMessageBox::information(NULL, "Get device list", "\nError sending "
"command to client");
return -1;
}
qstream_set_pos(&s, 0); /* reuse stream */
/* get response */
/*
* response format
* 4 bytes cmd_len length of this command
* 4 bytes cmd TCU_CMD_GET_MOUNT_LIST
* 1 byte nentries number of entries in this pkt
* n bytes entry_list nentries null terminated strings
*/
rv = WTSVirtualChannelRead(wtsChannel, 1000 * 5, s.data, 1024 * 8, &bytesRead);
if (rv == 0 || bytesRead == 0)
goto error;
/* did we get the entire cmd? */
qstream_rd_u32(&s, cmdLen);
if (cmdLen != bytesRead - 4)
goto error;
/* did we get the right response? */
qstream_rd_u32(&s, cmd);
if (cmd != TCU_CMD_GET_MOUNT_LIST)
goto error;
qstream_rd_u8(&s, nentries);
if (nentries == 0)
goto done;
for (i = 0; i < nentries; i++)
{
strcpy(buf, s.pos);
qstream_inc_pos(&s, strlen(buf) + 1);
item = new QListWidgetItem;
item->setText(QString(buf));
itemList->append(item);
}
done:
qstream_free(&s);
return 0;
error:
qstream_free(&s);
return -1;
}
int Utils::unmountDevice(void *wtsChannel, QString device, QStatusBar *statusBar)
{
STREAM s;
quint32 bytesRead;
quint32 cmdLen;
quint32 cmd;
quint32 bytesWritten;
int bytesToSend;
int rv;
int seconds = 0;
char status;
char* buf;
if (!wtsChannel)
return -1;
qstream_new(s, 1024);
buf = device.toAscii().data();
/*
* command format:
* 4 bytes cmd_len length of this command
* 4 bytes cmd TCU_CMD_UNMOUNT_DEVICE
* n bytes device null terminated device name
*/
/* setup command */
bytesToSend = 4 + 4 + device.count() + 1;
qstream_wr_u32(&s, bytesToSend - 4);
qstream_wr_u32(&s, TCU_CMD_UNMOUNT_DEVICE);
strcpy(s.pos, buf);
/* send command */
rv = WTSVirtualChannelWrite(wtsChannel, s.data, bytesToSend, &bytesWritten);
if (rv == 0)
{
QMessageBox::information(NULL, "Unmount device", "\nError sending "
"command to client");
return -1;
}
qstream_set_pos(&s, 0); /* reuse stream */
/* get response */
/*
* command format
* 4 bytes cmd_len number of bytes in this pkt
* 4 bytes cmd TCU_CMD_UNMOUNT_DEVICE
* 1 byte status operation status code
*/
while (1)
{
rv = WTSVirtualChannelRead(wtsChannel, 1000 * 1, s.data, 1024, &bytesRead);
if (rv == 0)
goto error;
if (bytesRead)
break;
statusBar->showMessage("Waiting for client to unmount device: " +
QString::number(++seconds) + " seconds", 30000);
}
statusBar->showMessage("");
/* did we get the entire pkt? */
qstream_rd_u32(&s, cmdLen);
if (cmdLen != bytesRead - 4)
goto error;
/* did we get the right response? */
qstream_rd_u32(&s, cmd);
if (cmd != TCU_CMD_UNMOUNT_DEVICE)
goto error;
/* get status */
qstream_rd_u8(&s, status);
switch(status)
{
case UMOUNT_SUCCESS:
goto done;
break;
case UMOUNT_BUSY:
QMessageBox::information(NULL, "Unmount error", "\nCannot unmount device "
"because it is in use");
break;
case UMOUNT_NOT_MOUNTED:
QMessageBox::information(NULL, "Unmount error", "\nCannot unmount device "
"because it is not mounted");
break;
case UMOUNT_OP_NOT_PERMITTED:
QMessageBox::information(NULL, "Unmount error", "\nOperation not "
"permitted. The device may be in use");
break;
case UMOUNT_PERMISSION_DENIED:
QMessageBox::information(NULL, "Unmount error", "\nYou don't have "
"permission to unmount this device");
break;
case UMOUNT_UNKNOWN:
QMessageBox::information(NULL, "Unmount error", "Cannot unmount "
"device, an unknown error has occurred. The "
"drive may be in use or you do not have "
"permission to unmount it");
break;
}
goto error;
done:
qstream_free(&s);
return 0;
error:
qstream_free(&s);
return -1;
}

View File

@ -1,152 +0,0 @@
#ifndef UTILS_H
#define UTILS_H
#include <QDebug>
#include <QListWidgetItem>
#include <QMessageBox>
#include <QStatusBar>
#include <xrdpapi.h>
/*
* stream definition and macros to access them;
* all definitions default to little endian
*/
typedef struct stream
{
char *data; /* holds stream data */
char *pos; /* current read/write position */
int size; /* number of bytes in data */
stream() : data(0), pos(0), size(0) {}
} STREAM;
#define qstream_new(_s, _size) \
do \
{ \
(_s).data = (char *) malloc(_size); \
(_s).pos = (_s).data; \
(_s).size = (_size); \
} \
while (0)
#define qstream_new_zero(_s, _size) \
do \
{ \
(_s).data = (char *) calloc((_size), 1); \
(_s).pos = (_s).data; \
(_s).size = (_size); \
} \
while (0)
#define qstream_free(_s) \
do \
{ \
if ((_s)->data) \
free((_s)->data); \
} \
while (0)
#define qstream_set_pos(_s, _p) \
do \
{ \
(_s)->pos = (_s)->data + (_p); \
} \
while (0)
#define qstream_inc_pos(_s, _v) \
do \
{ \
(_s)->pos += (_v); \
} \
while (0)
#define qstream_rd_u8(_s, _v) \
do \
{ \
(_v) = *((unsigned char *) ((_s)->pos)); \
(_s)->pos++; \
} \
while (0)
#define qstream_rd_u16(_s, _v) \
do \
{ \
(_v) = (unsigned short) \
( \
(*((unsigned char *) ((_s)->pos + 0)) << 0) | \
(*((unsigned char *) ((_s)->pos + 1)) << 8) \
); \
(_s)->pos += 2; \
} while (0)
#define qstream_rd_u32(_s, _v) \
do \
{ \
(_v) = (unsigned int) \
( \
(*((unsigned char *) ((_s)->pos + 0)) << 0) | \
(*((unsigned char *) ((_s)->pos + 1)) << 8) | \
(*((unsigned char *) ((_s)->pos + 2)) << 16) | \
(*((unsigned char *) ((_s)->pos + 3)) << 24) \
); \
(_s)->pos += 4; \
} while (0)
#define qstream_wr_u8(_s, _v) \
do \
{ \
*((_s)->pos) = (unsigned char) (_v); \
(_s)->pos++; \
} while (0)
#define qstream_wr_u16(_s, _v) \
do \
{ \
*((_s)->pos) = (unsigned char) ((_v) >> 0); \
(_s)->pos++; \
*((_s)->pos) = (unsigned char) ((_v) >> 8); \
(_s)->pos++; \
} while (0)
#define qstream_wr_u32(_s, _v) \
do \
{ \
*((_s)->pos) = (unsigned char) ((_v) >> 0); \
(_s)->pos++; \
*((_s)->pos) = (unsigned char) ((_v) >> 8); \
(_s)->pos++; \
*((_s)->pos) = (unsigned char) ((_v) >> 16); \
(_s)->pos++; \
*((_s)->pos) = (unsigned char) ((_v) >> 24); \
(_s)->pos++; \
} while (0)
/* list of commands we support; this list should match the one in */
/* NeutrinoRDP channels/tcutils/tcutils_main.h */
enum TCU_COMMANDS
{
TCU_CMD_GET_MOUNT_LIST = 1,
TCU_CMD_UNMOUNT_DEVICE
};
/* umount error codes */
enum TCU_UMOUNT_ERROR
{
UMOUNT_SUCCESS = 0,
UMOUNT_BUSY,
UMOUNT_NOT_MOUNTED,
UMOUNT_OP_NOT_PERMITTED,
UMOUNT_PERMISSION_DENIED,
UMOUNT_UNKNOWN
};
class Utils
{
public:
Utils();
static int getMountList(void *wtsChannel, QList<QListWidgetItem *> *itemList);
static int unmountDevice(void *wtsChannel, QString device, QStatusBar *statusBar);
};
#endif // UTILS_H