25 |
#include <windows.h> |
#include <windows.h> |
26 |
#include <stdio.h> |
#include <stdio.h> |
27 |
|
|
28 |
|
#include "vchannel.h" |
29 |
|
|
30 |
#include "resource.h" |
#include "resource.h" |
31 |
|
|
32 |
#define APP_NAME "SeamlessRDP Shell" |
#define APP_NAME "SeamlessRDP Shell" |
44 |
MessageBox(GetDesktopWindow(), text, "SeamlessRDP Shell", MB_OK); |
MessageBox(GetDesktopWindow(), text, "SeamlessRDP Shell", MB_OK); |
45 |
} |
} |
46 |
|
|
47 |
|
static void |
48 |
|
process_cmds(void) |
49 |
|
{ |
50 |
|
char line[VCHANNEL_MAX_LINE]; |
51 |
|
int size; |
52 |
|
|
53 |
|
while ((size = vchannel_read(line, sizeof(line))) >= 0) { |
54 |
|
debug("Got: %s", line); |
55 |
|
} |
56 |
|
} |
57 |
|
|
58 |
int WINAPI |
int WINAPI |
59 |
WinMain(HINSTANCE instance, HINSTANCE prev_instance, LPSTR cmdline, int cmdshow) |
WinMain(HINSTANCE instance, HINSTANCE prev_instance, LPSTR cmdline, int cmdshow) |
60 |
{ |
{ |
92 |
return -1; |
return -1; |
93 |
} |
} |
94 |
|
|
95 |
|
vchannel_open(); |
96 |
|
|
97 |
set_hooks_fn(); |
set_hooks_fn(); |
98 |
|
|
99 |
if (strlen(cmdline) == 0) |
if (strlen(cmdline) == 0) |
118 |
{ |
{ |
119 |
do |
do |
120 |
{ |
{ |
121 |
Sleep(1000); |
process_cmds(); |
122 |
|
Sleep(100); |
123 |
GetExitCodeProcess(proc_info.hProcess, &exitcode); |
GetExitCodeProcess(proc_info.hProcess, &exitcode); |
124 |
} |
} |
125 |
while (exitcode == STILL_ACTIVE); |
while (exitcode == STILL_ACTIVE); |
142 |
|
|
143 |
FreeLibrary(hookdll); |
FreeLibrary(hookdll); |
144 |
|
|
145 |
|
vchannel_close(); |
146 |
|
|
147 |
return 1; |
return 1; |
148 |
} |
} |