Исправлены ошибки при подключении
This commit is contained in:
parent
a7249dc6e4
commit
ab513983d6
7
db.c
7
db.c
|
@ -368,18 +368,17 @@ bool dbSetUserNameCurrent(char *current)
|
|||
sqlite3_bind_int(res, 3, VALUE_USERNAME);
|
||||
}
|
||||
|
||||
|
||||
if (sqlite3_step(res) == SQLITE_BUSY)
|
||||
{
|
||||
fprintf(stderr, "[ЗАНЯТО] %s - \"%s\"\n", text ? "установлено" : "очищено", getParameter(VALUE_USERNAME)->key);
|
||||
fprintf(stderr, "[ЗАНЯТО] %s - \"%s\"\n", text ? "установлено" : "очищено", text ? getValue(VALUE_USERNAME)->current : "");
|
||||
}
|
||||
if (sqlite3_step(res) == SQLITE_ERROR)
|
||||
{
|
||||
fprintf(stderr, "[ОШИБКА] %s - \"%s\"\n", text ? "установлено" : "очищено", getParameter(VALUE_USERNAME)->key);
|
||||
fprintf(stderr, "[ОШИБКА] %s - \"%s\"\n", text ? "установлено" : "очищено", text ? getValue(VALUE_USERNAME)->current : "");
|
||||
}
|
||||
if (sqlite3_step(res) == SQLITE_DONE)
|
||||
{
|
||||
fprintf(stdout, "[УСПЕШНО] %s - \"%s\"\n", text ? "установлено" : "очищено", getParameter(VALUE_USERNAME)->key);
|
||||
fprintf(stdout, "[УСПЕШНО] %s - \"%s\"\n", text ? "установлено" : "очищено", text ? getValue(VALUE_USERNAME)->current : "");
|
||||
}
|
||||
|
||||
sqlite3_finalize(res);
|
||||
|
|
BIN
freerdp.db
BIN
freerdp.db
Binary file not shown.
14
gui.c
14
gui.c
|
@ -17,6 +17,7 @@
|
|||
#include "address.h"
|
||||
|
||||
#include "db.h"
|
||||
#include "xrdp.h"
|
||||
|
||||
static int guiExit(Ihandle *self)
|
||||
{
|
||||
|
@ -40,19 +41,18 @@ static int guiConnect(Ihandle *self)
|
|||
{
|
||||
printf("%s\n", args.argv[i]);
|
||||
}
|
||||
printf("\n");
|
||||
freeArguments(&args);
|
||||
|
||||
if (!dbAddServer(result, IupGetAttribute(IupGetDialogChild(self, "SERVER"), "VALUE")))
|
||||
{
|
||||
IupSetAttribute(IupGetDialogChild(self, "SERVER"), "APPENDITEM", IupGetAttribute(IupGetDialogChild(self, "SERVER"), "VALUE"));
|
||||
}
|
||||
// if (free_rdp_connect(args.argc, args.argv) != XF_EXIT_DNS_NAME_NOT_FOUND)
|
||||
// {
|
||||
// dbSetValueCurrent(VALUE_SERVER, IupGetAttribute(IupGetDialogChild(self, "SERVER"), "LINEVALUE"));
|
||||
if (!dbAddServer(result, IupGetAttribute(IupGetDialogChild(self, "SERVER"), "VALUE")))
|
||||
{
|
||||
IupSetAttribute(IupGetDialogChild(self, "SERVER"), "APPENDITEM", IupGetAttribute(IupGetDialogChild(self, "SERVER"), "VALUE"));
|
||||
}
|
||||
dbSetUserNameCurrent(IupGetAttribute(IupGetDialogChild(self, "USER"), "LINEVALUE"));
|
||||
// }
|
||||
|
||||
freeArguments(&args);
|
||||
|
||||
return IUP_DEFAULT;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
//#ifdef HAVE_CONFIG_H
|
||||
//#include "config.h"
|
||||
//#endif
|
||||
//
|
||||
//#include <winpr/crt.h>
|
||||
//#include <winpr/synch.h>
|
||||
//#include <winpr/thread.h>
|
||||
//
|
||||
//#include <freerdp/freerdp.h>
|
||||
//#include <freerdp/client/cmdline.h>
|
||||
//
|
||||
//#include "../xf_client.h"
|
||||
//#include "../xfreerdp.h"
|
||||
//
|
||||
//#include <stdlib.h>
|
||||
//#include <stdio.h>
|
||||
//#include <string.h>
|
||||
//#include <iup.h>
|
||||
//
|
||||
//#include "xrdp.h"
|
||||
//
|
||||
//int free_rdp_connect(int argc, char **argv)
|
||||
//{
|
||||
// int rc = 1;
|
||||
// int status;
|
||||
// HANDLE thread;
|
||||
// xfContext *xfc;
|
||||
// DWORD dwExitCode;
|
||||
// rdpContext *context;
|
||||
// rdpSettings *settings;
|
||||
// RDP_CLIENT_ENTRY_POINTS clientEntryPoints;
|
||||
//
|
||||
// ZeroMemory(&clientEntryPoints, sizeof(RDP_CLIENT_ENTRY_POINTS));
|
||||
// clientEntryPoints.Size = sizeof(RDP_CLIENT_ENTRY_POINTS);
|
||||
// clientEntryPoints.Version = RDP_CLIENT_INTERFACE_VERSION;
|
||||
//
|
||||
// RdpClientEntry(&clientEntryPoints);
|
||||
//
|
||||
// context = freerdp_client_context_new(&clientEntryPoints);
|
||||
// if (!context)
|
||||
// return 1;
|
||||
//
|
||||
// settings = context->settings;
|
||||
// xfc = (xfContext*) context;
|
||||
//
|
||||
// status = freerdp_client_settings_parse_command_line(context->settings, argc, argv, FALSE);
|
||||
// if (status)
|
||||
// {
|
||||
// rc = freerdp_client_settings_command_line_status_print(settings, status, argc, argv);
|
||||
//
|
||||
// if (settings->ListMonitors)
|
||||
// xf_list_monitors(xfc);
|
||||
//
|
||||
// goto out;
|
||||
// }
|
||||
//
|
||||
// if (freerdp_client_start(context) != 0)
|
||||
// goto out;
|
||||
//
|
||||
// thread = freerdp_client_get_thread(context);
|
||||
//
|
||||
// WaitForSingleObject(thread, INFINITE);
|
||||
// GetExitCodeThread(thread, &dwExitCode);
|
||||
// rc = xf_exit_code_from_disconnect_reason(dwExitCode);
|
||||
//
|
||||
// freerdp_client_stop(context);
|
||||
//
|
||||
// out: freerdp_client_context_free(context);
|
||||
//
|
||||
// return rc;
|
||||
//}
|
Loading…
Reference in New Issue