mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2024-11-27 11:54:44 +08:00
wfreerdp: fix basic connectivity
This commit is contained in:
parent
c76efec345
commit
b55725487f
@ -44,6 +44,7 @@
|
||||
|
||||
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
int index;
|
||||
int status;
|
||||
HANDLE thread;
|
||||
wfContext* wfc;
|
||||
@ -63,9 +64,15 @@ INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
settings = context->settings;
|
||||
wfc = (wfContext*) context;
|
||||
|
||||
status = freerdp_client_parse_command_line(context, __argc, __argv);
|
||||
context->argc = __argc;
|
||||
context->argv = (char**) malloc(sizeof(char*) * __argc);
|
||||
|
||||
status = freerdp_client_command_line_status_print(__argc, __argv, settings, status);
|
||||
for (index = 0; index < context->argc; index++)
|
||||
context->argv[index] = _strdup(__argv[index]);
|
||||
|
||||
status = freerdp_client_parse_command_line(context, context->argc, context->argv);
|
||||
|
||||
status = freerdp_client_command_line_status_print(context->argc, context->argv, settings, status);
|
||||
|
||||
if (status)
|
||||
{
|
||||
|
@ -37,8 +37,8 @@ static HWND g_focus_hWnd;
|
||||
#define X_POS(lParam) (lParam & 0xFFFF)
|
||||
#define Y_POS(lParam) ((lParam >> 16) & 0xFFFF)
|
||||
|
||||
BOOL wf_scale_blt(rdpContext* context, HDC hdc, int x, int y, int w, int h, HDC hdcSrc, int x1, int y1, DWORD rop);
|
||||
void wf_scale_mouse_event(rdpContext* context, rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
|
||||
BOOL wf_scale_blt(wfContext* wfc, HDC hdc, int x, int y, int w, int h, HDC hdcSrc, int x1, int y1, DWORD rop);
|
||||
void wf_scale_mouse_event(wfContext* wfc, rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
|
||||
|
||||
LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -651,11 +651,12 @@ void wf_gdi_surface_frame_marker(wfContext* wfc, SURFACE_FRAME_MARKER* surface_f
|
||||
rdpContext* context;
|
||||
rdpSettings* settings;
|
||||
|
||||
context = (rdpContext*) wfc;
|
||||
settings = wfc->instance->settings;
|
||||
|
||||
if (surface_frame_marker->frameAction == SURFACECMD_FRAMEACTION_END && settings->FrameAcknowledge > 0)
|
||||
{
|
||||
IFCALL(wfc->instance->update->SurfaceFrameAcknowledge, context, surface_frame_marker->frameId);
|
||||
IFCALL(context->instance->update->SurfaceFrameAcknowledge, context, surface_frame_marker->frameId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -666,19 +667,19 @@ void wf_gdi_register_update_callbacks(rdpUpdate* update)
|
||||
update->Palette = wf_gdi_palette_update;
|
||||
update->SetBounds = wf_gdi_set_bounds;
|
||||
|
||||
primary->DstBlt = wf_gdi_dstblt;
|
||||
primary->PatBlt = wf_gdi_patblt;
|
||||
primary->ScrBlt = wf_gdi_scrblt;
|
||||
primary->OpaqueRect = wf_gdi_opaque_rect;
|
||||
primary->DstBlt = (pDstBlt) wf_gdi_dstblt;
|
||||
primary->PatBlt = (pPatBlt) wf_gdi_patblt;
|
||||
primary->ScrBlt = (pScrBlt) wf_gdi_scrblt;
|
||||
primary->OpaqueRect = (pOpaqueRect) wf_gdi_opaque_rect;
|
||||
primary->DrawNineGrid = NULL;
|
||||
primary->MultiDstBlt = NULL;
|
||||
primary->MultiPatBlt = NULL;
|
||||
primary->MultiScrBlt = NULL;
|
||||
primary->MultiOpaqueRect = wf_gdi_multi_opaque_rect;
|
||||
primary->MultiOpaqueRect = (pMultiOpaqueRect) wf_gdi_multi_opaque_rect;
|
||||
primary->MultiDrawNineGrid = NULL;
|
||||
primary->LineTo = wf_gdi_line_to;
|
||||
primary->Polyline = wf_gdi_polyline;
|
||||
primary->MemBlt = wf_gdi_memblt;
|
||||
primary->LineTo = (pLineTo) wf_gdi_line_to;
|
||||
primary->Polyline = (pPolyline) wf_gdi_polyline;
|
||||
primary->MemBlt = (pMemBlt) wf_gdi_memblt;
|
||||
primary->Mem3Blt = NULL;
|
||||
primary->SaveBitmap = NULL;
|
||||
primary->GlyphIndex = NULL;
|
||||
|
@ -117,7 +117,7 @@ void wf_sw_desktop_resize(wfContext* wfc)
|
||||
rdpContext* context;
|
||||
rdpSettings* settings;
|
||||
|
||||
context = (rdpContext*) context;
|
||||
context = (rdpContext*) wfc;
|
||||
settings = wfc->instance->settings;
|
||||
gdi = context->gdi;
|
||||
|
||||
@ -550,7 +550,7 @@ BOOL wf_check_fds(freerdp* instance)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
DWORD WINAPI wf_thread(LPVOID lpParam)
|
||||
DWORD WINAPI wf_client_thread(LPVOID lpParam)
|
||||
{
|
||||
MSG msg;
|
||||
int index;
|
||||
@ -695,6 +695,8 @@ DWORD WINAPI wf_thread(LPVOID lpParam)
|
||||
freerdp_channels_close(channels, instance);
|
||||
freerdp_disconnect(instance);
|
||||
|
||||
printf("Main thread exited.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -734,6 +736,7 @@ DWORD WINAPI wf_keyboard_thread(LPVOID lpParam)
|
||||
|
||||
wfc->keyboardThreadId = 0;
|
||||
printf("Keyboard thread exited.\n");
|
||||
|
||||
return (DWORD) NULL;
|
||||
}
|
||||
|
||||
@ -971,7 +974,7 @@ void wf_size_scrollbars(wfContext* wfc, int client_width, int client_height)
|
||||
wf_update_canvas_diff(wfc);
|
||||
}
|
||||
|
||||
void wfreerdp_client_global_init()
|
||||
void wfreerdp_client_global_init(void)
|
||||
{
|
||||
WSADATA wsaData;
|
||||
|
||||
@ -994,7 +997,7 @@ void wfreerdp_client_global_init()
|
||||
freerdp_register_addin_provider(freerdp_channels_load_static_addin_entry, 0);
|
||||
}
|
||||
|
||||
void wfreerdp_client_global_uninit()
|
||||
void wfreerdp_client_global_uninit(void)
|
||||
{
|
||||
WSACleanup();
|
||||
}
|
||||
@ -1003,6 +1006,8 @@ int wfreerdp_client_new(freerdp* instance, rdpContext* context)
|
||||
{
|
||||
wfContext* wfc = (wfContext*) context;
|
||||
|
||||
wfreerdp_client_global_init();
|
||||
|
||||
instance->PreConnect = wf_pre_connect;
|
||||
instance->PostConnect = wf_post_connect;
|
||||
instance->Authenticate = wf_authenticate;
|
||||
@ -1012,14 +1017,6 @@ int wfreerdp_client_new(freerdp* instance, rdpContext* context)
|
||||
wfc->instance = instance;
|
||||
context->channels = freerdp_channels_new();
|
||||
|
||||
//instance->context->argc = argc;
|
||||
//instance->context->argv = (char**) malloc(sizeof(char*) * argc);
|
||||
|
||||
//for (index = 0; index < argc; index++)
|
||||
// instance->context->argv[index] = _strdup(argv[index]);
|
||||
|
||||
//status = freerdp_client_parse_command_line_arguments(instance->context->argc, instance->context->argv, instance->settings);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1067,14 +1064,13 @@ int wfreerdp_client_start(rdpContext* context)
|
||||
if (!wfc->keyboardThread)
|
||||
return -1;
|
||||
|
||||
freerdp_client_load_addins(instance->context->channels, instance->settings);
|
||||
freerdp_client_load_addins(context->channels, instance->settings);
|
||||
|
||||
wfc->thread = CreateThread(NULL, 0, wf_thread, (void*) instance, 0, &wfc->mainThreadId);
|
||||
wfc->thread = CreateThread(NULL, 0, wf_client_thread, (void*) instance, 0, &wfc->mainThreadId);
|
||||
|
||||
if (!wfc->thread)
|
||||
return -1;
|
||||
|
||||
printf("Main thread exited.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user