bagajjal 8addc04e87 Terminalissues (#89)
#576 - fix the EVENT_CONSOLE_CARET issue.. Wrongly read the X, Y coordinates
#575 - when backspace key is pressed then screen is not refreshed correctly
#574 - when delete key is pressed then screen is not refreshed correctly (the last character is repeated in the end)
#573 - while using up/down arrows, screen is not refreshed correctly (there are some left over characters of bigger command)
#572 - clear screen is not clearing the whole console
#571 - Move the cursor to top of visible window so that nothing will be erased on the console.
#570 - code cleanup for console related logic
#569 - wrong implementation of TIOCGWINSZ. This is causing lot of issues when windows open ssh client is connecting to linux ssh server.
#568 - Scrolling issue when the cursor is at the last line of the visible window.
#567 - Logic to pass the raw buffer to console is wrong.
2017-03-13 14:53:58 -07:00

48 lines
1022 B
C

#include <Windows.h>
#include <stdio.h>
#define MAX_MESSAGE_SIZE 256 * 1024
#define SSH_ROOT L"SOFTWARE\\SSH"
#define SSH_AGENT_ROOT SSH_ROOT L"\\Agent"
#define SSH_KEYS_KEY L"Keys"
#define SSH_KEYS_ROOT SSH_ROOT L"\\" SSH_KEYS_KEY
#define HEADER_SIZE 4
struct agent_connection {
OVERLAPPED ol;
HANDLE connection;
struct {
DWORD num_bytes;
DWORD transferred;
char buf[MAX_MESSAGE_SIZE];
DWORD buf_size;
} io_buf;
enum {
LISTENING = 0,
READING_HEADER,
READING,
WRITING,
DONE
} state;
enum {
UNKNOWN = 0,
OTHER,
LOCAL_SYSTEM,
SSHD,
NETWORK_SERVICE
} client_process;
HANDLE auth_token;
HANDLE hProfile;
};
void agent_connection_on_io(struct agent_connection*, DWORD, OVERLAPPED*);
void agent_connection_on_error(struct agent_connection* , DWORD);
void agent_connection_disconnect(struct agent_connection*);
void agent_start(BOOL, BOOL, HANDLE);
void agent_shutdown();
void agent_cleanup_connection(struct agent_connection*);
int load_config();
int config_log_level();