Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
e1075e2b4b
2
.gitignore
vendored
2
.gitignore
vendored
@ -53,6 +53,7 @@ DerivedData/
|
||||
*.suo
|
||||
*.ncb
|
||||
*.opensdf
|
||||
Thumbs.db
|
||||
ipch
|
||||
Debug
|
||||
RelWithDebInfo
|
||||
@ -78,6 +79,7 @@ xcode
|
||||
*.dir
|
||||
Release
|
||||
Win32
|
||||
build/
|
||||
|
||||
default.log
|
||||
*Amplifier XE*
|
||||
|
@ -79,6 +79,14 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED WITH_CLIENT_INTERFACE)
|
||||
set(WITH_CLIENT_INTERFACE ON)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED WITH_SERVER_INTERFACE)
|
||||
set(WITH_SERVER_INTERFACE ON)
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED BUILD_SHARED_LIBS)
|
||||
if(ANDROID OR IOS)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
|
@ -44,3 +44,5 @@ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
|
||||
if(NOT STATIC_CHANNELS)
|
||||
install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_ADDIN_PATH})
|
||||
endif()
|
||||
|
||||
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client/ALSA")
|
||||
|
@ -48,3 +48,5 @@ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
|
||||
if(NOT STATIC_CHANNELS)
|
||||
install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_ADDIN_PATH})
|
||||
endif()
|
||||
|
||||
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client/Mac")
|
||||
|
@ -39,3 +39,5 @@ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
|
||||
if(NOT STATIC_CHANNELS)
|
||||
install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_ADDIN_PATH})
|
||||
endif()
|
||||
|
||||
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client/Pulse")
|
||||
|
@ -43,3 +43,5 @@ target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
|
||||
if(NOT STATIC_CHANNELS)
|
||||
install(TARGETS ${MODULE_NAME} DESTINATION ${FREERDP_ADDIN_PATH})
|
||||
endif()
|
||||
|
||||
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Channels/${CHANNEL_NAME}/Client/WinMM")
|
||||
|
@ -44,3 +44,5 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
|
||||
|
||||
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} PARENT_SCOPE)
|
||||
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE)
|
||||
|
||||
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/Common")
|
||||
|
@ -216,6 +216,7 @@ public class KeyboardMapper
|
||||
final static int VK_PA1 = 0xFD;
|
||||
final static int VK_OEM_CLEAR = 0xFE;
|
||||
final static int VK_UNICODE = 0x80000000;
|
||||
final static int VK_EXT_KEY = 0x00000100;
|
||||
|
||||
// key codes to switch between custom keyboard
|
||||
private final static int EXTKEY_KBFUNCTIONKEYS = 0x1100;
|
||||
@ -337,12 +338,12 @@ public class KeyboardMapper
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_F12)] = VK_F12;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_tab)] = VK_TAB;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_print)] = VK_PRINT;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_insert)] = VK_INSERT;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_delete)] = VK_DELETE;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_home)] = VK_HOME;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_end)] = VK_END;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_pgup)] = VK_PRIOR;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_pgdn)] = VK_NEXT;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_insert)] = VK_INSERT | VK_EXT_KEY;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_delete)] = VK_DELETE | VK_EXT_KEY;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_home)] = VK_HOME | VK_EXT_KEY;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_end)] = VK_END | VK_EXT_KEY;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_pgup)] = VK_PRIOR | VK_EXT_KEY;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_pgdn)] = VK_NEXT | VK_EXT_KEY;
|
||||
|
||||
// numpad mapping
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_0)] = VK_NUMPAD0;
|
||||
@ -358,8 +359,8 @@ public class KeyboardMapper
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_numlock)] = VK_NUMLOCK;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_add)] = VK_ADD;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_comma)] = VK_DECIMAL;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_divide)] = VK_DIVIDE;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_enter)] = VK_RETURN;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_divide)] = VK_DIVIDE | VK_EXT_KEY;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_enter)] = VK_RETURN | VK_EXT_KEY;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_multiply)] = VK_MULTIPLY;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_subtract)] = VK_SUBTRACT;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_equals)] = (KEY_FLAG_UNICODE | 61);
|
||||
@ -367,16 +368,16 @@ public class KeyboardMapper
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_numpad_right_paren)] = (KEY_FLAG_UNICODE | 41);
|
||||
|
||||
// cursor key codes
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_up)] = VK_UP;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_down)] = VK_DOWN;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_left)] = VK_LEFT;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_right)] = VK_RIGHT;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_enter)] = VK_RETURN;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_up)] = VK_UP | VK_EXT_KEY;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_down)] = VK_DOWN | VK_EXT_KEY;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_left)] = VK_LEFT | VK_EXT_KEY;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_right)] = VK_RIGHT | VK_EXT_KEY;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_enter)] = VK_RETURN | VK_EXT_KEY;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_backspace)] = VK_BACK;
|
||||
|
||||
// shared keys
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_win)] = VK_LWIN;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_menu)] = VK_APPS;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_win)] = VK_LWIN | VK_EXT_KEY;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_menu)] = VK_APPS | VK_EXT_KEY;
|
||||
keymapExt[context.getResources().getInteger(R.integer.keycode_esc)] = VK_ESCAPE;
|
||||
|
||||
/* keymapExt[context.getResources().getInteger(R.integer.keycode_modifier_ctrl)] = VK_LCONTROL;
|
||||
@ -432,12 +433,12 @@ public class KeyboardMapper
|
||||
listener.processVirtualKey(vkcode, true);
|
||||
listener.processVirtualKey(vkcode, false);
|
||||
}
|
||||
else if(Character.isUpperCase((char)event.getUnicodeChar()))
|
||||
else if(event.isShiftPressed() && vkcode != 0)
|
||||
{
|
||||
listener.processVirtualKey(VK_SHIFT, true);
|
||||
listener.processVirtualKey(VK_LSHIFT, true);
|
||||
listener.processVirtualKey(vkcode, true);
|
||||
listener.processVirtualKey(vkcode, false);
|
||||
listener.processVirtualKey(VK_SHIFT, false);
|
||||
listener.processVirtualKey(VK_LSHIFT, false);
|
||||
}
|
||||
else if(event.getUnicodeChar() != 0)
|
||||
listener.processUnicodeKey(event.getUnicodeChar());
|
||||
@ -591,11 +592,11 @@ public class KeyboardMapper
|
||||
}
|
||||
case VK_LWIN:
|
||||
{
|
||||
if(!checkToggleModifierLock(VK_LMENU))
|
||||
if(!checkToggleModifierLock(VK_LWIN))
|
||||
{
|
||||
isWinLocked = false;
|
||||
winPressed = !winPressed;
|
||||
listener.processVirtualKey(VK_LWIN, winPressed);
|
||||
listener.processVirtualKey(VK_LWIN | VK_EXT_KEY, winPressed);
|
||||
}
|
||||
else
|
||||
isWinLocked = true;
|
||||
@ -628,7 +629,7 @@ public class KeyboardMapper
|
||||
}
|
||||
if(winPressed && (!isWinLocked || force))
|
||||
{
|
||||
listener.processVirtualKey(VK_LWIN, false);
|
||||
listener.processVirtualKey(VK_LWIN | VK_EXT_KEY, false);
|
||||
winPressed = false;
|
||||
}
|
||||
|
||||
|
@ -25,18 +25,11 @@
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data
|
||||
android:scheme="file"
|
||||
android:mimeType="application/x-rdp" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<data
|
||||
android:scheme="file"
|
||||
android:pathPattern=".*\\.rdp"
|
||||
android:mimeType="*/*" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="http" android:host="*" android:pathPattern=".*\\.rdp" />
|
||||
<data android:scheme="file" android:host="*" android:pathPattern=".*\\.rdp" />
|
||||
<data android:mimeType="*/*" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
@ -1181,6 +1181,8 @@ void mf_Pointer_Free(rdpContext* context, rdpPointer* pointer)
|
||||
void mf_Pointer_Set(rdpContext* context, rdpPointer* pointer)
|
||||
{
|
||||
NSMutableArray* ma = g_mrdpview->cursors;
|
||||
|
||||
return; /* disable pointer until it is fixed */
|
||||
|
||||
if (!g_mrdpview->mouseInClientArea)
|
||||
return;
|
||||
@ -1201,6 +1203,7 @@ void mf_Pointer_Set(rdpContext* context, rdpPointer* pointer)
|
||||
|
||||
void mf_Pointer_SetNull(rdpContext* context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/** *********************************************************************
|
||||
@ -1209,6 +1212,7 @@ void mf_Pointer_SetNull(rdpContext* context)
|
||||
|
||||
void mf_Pointer_SetDefault(rdpContext* context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/** *********************************************************************
|
||||
@ -1227,6 +1231,7 @@ void mac_context_new(freerdp* instance, rdpContext* context)
|
||||
|
||||
void mac_context_free(freerdp* instance, rdpContext* context)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/** *********************************************************************
|
||||
@ -1235,6 +1240,7 @@ void mac_context_free(freerdp* instance, rdpContext* context)
|
||||
|
||||
void mac_set_bounds(rdpContext* context, rdpBounds* bounds)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/** *********************************************************************
|
||||
@ -1243,6 +1249,7 @@ void mac_set_bounds(rdpContext* context, rdpBounds* bounds)
|
||||
|
||||
void mac_bitmap_update(rdpContext* context, BITMAP_UPDATE* bitmap)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/** *********************************************************************
|
||||
|
@ -15,8 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set(MODULE_NAME "wfreerdp")
|
||||
set(MODULE_PREFIX "FREERDP_CLIENT_WINDOWS")
|
||||
set(MODULE_NAME "wfreerdp-client")
|
||||
set(MODULE_PREFIX "FREERDP_CLIENT_WINDOWS_CONTROL")
|
||||
|
||||
set(${MODULE_PREFIX}_SRCS
|
||||
wf_gdi.c
|
||||
@ -31,10 +31,19 @@ set(${MODULE_PREFIX}_SRCS
|
||||
wf_window.h
|
||||
wf_rail.c
|
||||
wf_rail.h
|
||||
wfreerdp.c
|
||||
wfreerdp.h)
|
||||
wf_interface.c
|
||||
wf_interface.h
|
||||
wfreerdp.rc
|
||||
resource.h)
|
||||
|
||||
if(WITH_CLIENT_INTERFACE)
|
||||
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
|
||||
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION} PREFIX "lib")
|
||||
else()
|
||||
set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} cli/wfreerdp.c cli/wfreerdp.h)
|
||||
add_executable(${MODULE_NAME} WIN32 ${${MODULE_PREFIX}_SRCS})
|
||||
endif()
|
||||
|
||||
add_executable(${MODULE_NAME} WIN32 ${${MODULE_PREFIX}_SRCS})
|
||||
|
||||
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-client)
|
||||
|
||||
@ -50,6 +59,11 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
|
||||
|
||||
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
|
||||
|
||||
install(TARGETS ${MODULE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
|
||||
if(WITH_CLIENT_INTERFACE)
|
||||
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
|
||||
add_subdirectory(cli)
|
||||
else()
|
||||
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
|
||||
endif()
|
||||
|
||||
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Windows")
|
||||
|
BIN
client/Windows/FreeRDP.ico
Normal file
BIN
client/Windows/FreeRDP.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
36
client/Windows/cli/CMakeLists.txt
Normal file
36
client/Windows/cli/CMakeLists.txt
Normal file
@ -0,0 +1,36 @@
|
||||
# FreeRDP: A Remote Desktop Protocol Implementation
|
||||
# FreeRDP Windows cmake build script
|
||||
#
|
||||
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
set(MODULE_NAME "wfreerdp")
|
||||
set(MODULE_PREFIX "FREERDP_CLIENT_WINDOWS")
|
||||
|
||||
include_directories(..)
|
||||
|
||||
set(${MODULE_PREFIX}_SRCS
|
||||
wfreerdp.c
|
||||
wfreerdp.h
|
||||
../wfreerdp.rc)
|
||||
|
||||
add_executable(${MODULE_NAME} WIN32 ${${MODULE_PREFIX}_SRCS})
|
||||
|
||||
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} wfreerdp-client)
|
||||
|
||||
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
|
||||
|
||||
install(TARGETS ${MODULE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
|
||||
|
||||
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Windows")
|
70
client/Windows/cli/wfreerdp.c
Normal file
70
client/Windows/cli/wfreerdp.c
Normal file
@ -0,0 +1,70 @@
|
||||
/**
|
||||
* FreeRDP: A Remote Desktop Protocol Implementation
|
||||
* Windows Client
|
||||
*
|
||||
* Copyright 2009-2011 Jay Sorg
|
||||
* Copyright 2010-2011 Vic Lee
|
||||
* Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <winpr/windows.h>
|
||||
|
||||
#include <winpr/crt.h>
|
||||
#include <winpr/credui.h>
|
||||
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/constants.h>
|
||||
#include <freerdp/utils/event.h>
|
||||
#include <freerdp/utils/svc_plugin.h>
|
||||
|
||||
#include <freerdp/client/file.h>
|
||||
#include <freerdp/client/cmdline.h>
|
||||
#include <freerdp/client/channels.h>
|
||||
#include <freerdp/channels/channels.h>
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
#include "wf_interface.h"
|
||||
|
||||
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
{
|
||||
int status;
|
||||
wfInfo* wfi;
|
||||
|
||||
wf_global_init();
|
||||
|
||||
wfi = wf_new(hInstance, NULL, __argc, __argv);
|
||||
|
||||
status = wf_start(wfi);
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
MessageBox(GetConsoleWindow(),
|
||||
_T("Failed to start wfreerdp.\n\nPlease check the debug output."),
|
||||
_T("FreeRDP Error"), MB_ICONSTOP);
|
||||
}
|
||||
else
|
||||
{
|
||||
WaitForSingleObject(wfi->thread, INFINITE);
|
||||
}
|
||||
|
||||
wf_free(wfi);
|
||||
|
||||
return 0;
|
||||
}
|
27
client/Windows/cli/wfreerdp.h
Normal file
27
client/Windows/cli/wfreerdp.h
Normal file
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* FreeRDP: A Remote Desktop Protocol Implementation
|
||||
* Windows Client
|
||||
*
|
||||
* Copyright 2009-2011 Jay Sorg
|
||||
* Copyright 2010-2011 Vic Lee
|
||||
* Copyright 2010-2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __WFREERDP_H
|
||||
#define __WFREERDP_H
|
||||
|
||||
#include "wf_interface.h"
|
||||
|
||||
#endif
|
2
client/Windows/resource.h
Normal file
2
client/Windows/resource.h
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
#define IDI_ICON1 101
|
@ -19,7 +19,7 @@
|
||||
#ifndef __WF_CLIPRDR_H
|
||||
#define __WF_CLIPRDR_H
|
||||
|
||||
#include "wfreerdp.h"
|
||||
#include "wf_interface.h"
|
||||
|
||||
void wf_cliprdr_init(wfInfo* wfi, rdpChannels* chanman);
|
||||
void wf_cliprdr_uninit(wfInfo* wfi);
|
||||
|
@ -27,16 +27,15 @@
|
||||
|
||||
#include <freerdp/freerdp.h>
|
||||
|
||||
#include "wfreerdp.h"
|
||||
#include "wf_interface.h"
|
||||
|
||||
#include "wf_gdi.h"
|
||||
#include "wf_event.h"
|
||||
|
||||
static HWND g_focus_hWnd;
|
||||
extern HCURSOR g_default_cursor;
|
||||
|
||||
#define X_POS(lParam) (lParam & 0xffff)
|
||||
#define Y_POS(lParam) ((lParam >> 16) & 0xffff)
|
||||
#define X_POS(lParam) (lParam & 0xFFFF)
|
||||
#define Y_POS(lParam) ((lParam >> 16) & 0xFFFF)
|
||||
|
||||
LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
@ -57,8 +56,10 @@ LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
case WM_SYSKEYUP:
|
||||
wfi = (wfInfo*) GetWindowLongPtr(g_focus_hWnd, GWLP_USERDATA);
|
||||
p = (PKBDLLHOOKSTRUCT) lParam;
|
||||
|
||||
if (!wfi || !p)
|
||||
return 1;
|
||||
|
||||
input = wfi->instance->input;
|
||||
rdp_scancode = MAKE_RDP_SCANCODE((BYTE) p->scanCode, p->flags & LLKHF_EXTENDED);
|
||||
|
||||
@ -233,7 +234,7 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam
|
||||
|
||||
case WM_SETCURSOR:
|
||||
if (LOWORD(lParam) == HTCLIENT)
|
||||
SetCursor(g_default_cursor);
|
||||
SetCursor(wfi->hDefaultCursor);
|
||||
else
|
||||
DefWindowProc(hWnd, Msg, wParam, lParam);
|
||||
break;
|
||||
|
@ -22,7 +22,7 @@
|
||||
#ifndef __WF_EVENT_H
|
||||
#define __WF_EVENT_H
|
||||
|
||||
#include "wfreerdp.h"
|
||||
#include "wf_interface.h"
|
||||
|
||||
LRESULT CALLBACK wf_ll_kbd_proc(int nCode, WPARAM wParam, LPARAM lParam);
|
||||
LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include <freerdp/codec/rfx.h>
|
||||
#include <freerdp/codec/nsc.h>
|
||||
|
||||
#include "wfreerdp.h"
|
||||
#include "wf_interface.h"
|
||||
#include "wf_graphics.h"
|
||||
|
||||
const BYTE wf_rop2_table[] =
|
||||
|
@ -22,7 +22,7 @@
|
||||
#ifndef __WF_GDI_H
|
||||
#define __WF_GDI_H
|
||||
|
||||
#include "wfreerdp.h"
|
||||
#include "wf_interface.h"
|
||||
|
||||
void wf_invalidate_region(wfInfo* wfi, int x, int y, int width, int height);
|
||||
wfBitmap* wf_image_new(wfInfo* wfi, int width, int height, int bpp, BYTE* data);
|
||||
|
@ -26,8 +26,6 @@
|
||||
#include "wf_gdi.h"
|
||||
#include "wf_graphics.h"
|
||||
|
||||
extern HINSTANCE g_hInstance; /* in wfreerdp.c */
|
||||
|
||||
HBITMAP wf_create_dib(wfInfo* wfi, int width, int height, int bpp, BYTE* data, BYTE** pdata)
|
||||
{
|
||||
HDC hdc;
|
||||
|
@ -20,7 +20,7 @@
|
||||
#ifndef __WF_GRAPHICS_H
|
||||
#define __WF_GRAPHICS_H
|
||||
|
||||
#include "wfreerdp.h"
|
||||
#include "wf_interface.h"
|
||||
|
||||
HBITMAP wf_create_dib(wfInfo* wfi, int width, int height, int bpp, BYTE* data, BYTE** pdata);
|
||||
wfBitmap* wf_image_new(wfInfo* wfi, int width, int height, int bpp, BYTE* data);
|
||||
|
@ -53,29 +53,28 @@
|
||||
#include "wf_graphics.h"
|
||||
#include "wf_cliprdr.h"
|
||||
|
||||
#include "wfreerdp.h"
|
||||
#include "wf_interface.h"
|
||||
|
||||
struct _thread_data
|
||||
{
|
||||
freerdp* instance;
|
||||
};
|
||||
typedef struct _thread_data thread_data;
|
||||
|
||||
HANDLE g_done_event;
|
||||
HINSTANCE g_hInstance;
|
||||
HCURSOR g_default_cursor;
|
||||
volatile int g_thread_count = 0;
|
||||
LPCTSTR g_wnd_class_name = L"wfreerdp";
|
||||
#include "resource.h"
|
||||
|
||||
void wf_context_new(freerdp* instance, rdpContext* context)
|
||||
{
|
||||
wfInfo* wfi;
|
||||
|
||||
context->channels = freerdp_channels_new();
|
||||
|
||||
wfi = (wfInfo*) malloc(sizeof(wfInfo));
|
||||
ZeroMemory(wfi, sizeof(wfInfo));
|
||||
|
||||
((wfContext*) context)->wfi = wfi;
|
||||
wfi->instance = instance;
|
||||
}
|
||||
|
||||
void wf_context_free(freerdp* instance, rdpContext* context)
|
||||
{
|
||||
if (context->cache)
|
||||
cache_free(context->cache);
|
||||
|
||||
freerdp_channels_free(context->channels);
|
||||
}
|
||||
|
||||
@ -178,6 +177,7 @@ void wf_hw_desktop_resize(rdpContext* context)
|
||||
|
||||
wfi->width = settings->DesktopWidth;
|
||||
wfi->height = settings->DesktopHeight;
|
||||
|
||||
if (wfi->primary)
|
||||
{
|
||||
same = (wfi->primary == wfi->drawing) ? TRUE : FALSE;
|
||||
@ -189,6 +189,7 @@ void wf_hw_desktop_resize(rdpContext* context)
|
||||
if (same)
|
||||
wfi->drawing = wfi->primary;
|
||||
}
|
||||
|
||||
if (wfi->fullscreen != TRUE)
|
||||
{
|
||||
if (wfi->hwnd)
|
||||
@ -210,14 +211,10 @@ BOOL wf_pre_connect(freerdp* instance)
|
||||
wfContext* context;
|
||||
rdpSettings* settings;
|
||||
|
||||
wfi = (wfInfo*) malloc(sizeof(wfInfo));
|
||||
ZeroMemory(wfi, sizeof(wfInfo));
|
||||
|
||||
context = (wfContext*) instance->context;
|
||||
wfi->instance = instance;
|
||||
context->wfi = wfi;
|
||||
|
||||
settings = instance->settings;
|
||||
wfi = context->wfi;
|
||||
wfi->instance = instance;
|
||||
|
||||
settings = instance->settings;
|
||||
|
||||
@ -260,8 +257,6 @@ BOOL wf_pre_connect(freerdp* instance)
|
||||
|
||||
settings->GlyphSupportLevel = GLYPH_SUPPORT_NONE;
|
||||
|
||||
wfi->cursor = g_default_cursor;
|
||||
|
||||
wfi->fullscreen = settings->Fullscreen;
|
||||
wfi->fs_toggle = 1;
|
||||
wfi->sw_gdi = settings->SoftwareGdi;
|
||||
@ -312,7 +307,7 @@ BOOL wf_post_connect(freerdp* instance)
|
||||
wfInfo* wfi;
|
||||
rdpCache* cache;
|
||||
wfContext* context;
|
||||
wchar_t win_title[64];
|
||||
WCHAR lpWindowName[64];
|
||||
rdpSettings* settings;
|
||||
|
||||
settings = instance->settings;
|
||||
@ -359,20 +354,22 @@ BOOL wf_post_connect(freerdp* instance)
|
||||
}
|
||||
|
||||
if (settings->NSCodec)
|
||||
{
|
||||
wfi->nsc_context = nsc_context_new();
|
||||
}
|
||||
}
|
||||
|
||||
if (settings->WindowTitle != NULL)
|
||||
_snwprintf(win_title, ARRAYSIZE(win_title), L"%S", settings->WindowTitle);
|
||||
_snwprintf(lpWindowName, ARRAYSIZE(lpWindowName), L"%S", settings->WindowTitle);
|
||||
else if (settings->ServerPort == 3389)
|
||||
_snwprintf(win_title, ARRAYSIZE(win_title), L"FreeRDP: %S", settings->ServerHostname);
|
||||
_snwprintf(lpWindowName, ARRAYSIZE(lpWindowName), L"FreeRDP: %S", settings->ServerHostname);
|
||||
else
|
||||
_snwprintf(win_title, ARRAYSIZE(win_title), L"FreeRDP: %S:%d", settings->ServerHostname, settings->ServerPort);
|
||||
_snwprintf(lpWindowName, ARRAYSIZE(lpWindowName), L"FreeRDP: %S:%d", settings->ServerHostname, settings->ServerPort);
|
||||
|
||||
if (wfi->hwnd == 0)
|
||||
if (!wfi->hwnd)
|
||||
{
|
||||
wfi->hwnd = CreateWindowEx((DWORD) NULL, g_wnd_class_name, win_title,
|
||||
0, 0, 0, 0, 0, NULL, NULL, g_hInstance, NULL);
|
||||
wfi->hwnd = CreateWindowEx((DWORD) NULL, wfi->wndClassName, lpWindowName,
|
||||
0, 0, 0, 0, 0, wfi->hWndParent, NULL, wfi->hInstance, NULL);
|
||||
|
||||
SetWindowLongPtr(wfi->hwnd, GWLP_USERDATA, (LONG_PTR) wfi);
|
||||
}
|
||||
@ -525,7 +522,7 @@ BOOL wf_check_fds(freerdp* instance)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int wfreerdp_run(freerdp* instance)
|
||||
DWORD WINAPI wf_thread(LPVOID lpParam)
|
||||
{
|
||||
MSG msg;
|
||||
int index;
|
||||
@ -537,10 +534,13 @@ int wfreerdp_run(freerdp* instance)
|
||||
void* wfds[32];
|
||||
int fds_count;
|
||||
HANDLE fds[64];
|
||||
freerdp* instance;
|
||||
rdpChannels* channels;
|
||||
|
||||
memset(rfds, 0, sizeof(rfds));
|
||||
memset(wfds, 0, sizeof(wfds));
|
||||
instance = (freerdp*) lpParam;
|
||||
|
||||
ZeroMemory(rfds, sizeof(rfds));
|
||||
ZeroMemory(wfds, sizeof(wfds));
|
||||
|
||||
if (freerdp_connect(instance) != TRUE)
|
||||
return 0;
|
||||
@ -615,6 +615,7 @@ int wfreerdp_run(freerdp* instance)
|
||||
wf_process_channel_event(channels, instance);
|
||||
|
||||
quit_msg = FALSE;
|
||||
|
||||
while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
|
||||
{
|
||||
msg_ret = GetMessage(&msg, NULL, 0, 0);
|
||||
@ -641,42 +642,20 @@ int wfreerdp_run(freerdp* instance)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static DWORD WINAPI thread_func(LPVOID lpParam)
|
||||
{
|
||||
wfInfo* wfi;
|
||||
freerdp* instance;
|
||||
thread_data* data;
|
||||
|
||||
data = (thread_data*) lpParam;
|
||||
instance = data->instance;
|
||||
|
||||
wfi = (wfInfo*) malloc(sizeof(wfInfo));
|
||||
ZeroMemory(wfi, sizeof(wfInfo));
|
||||
|
||||
((wfContext*) instance->context)->wfi = wfi;
|
||||
wfi->instance = instance;
|
||||
|
||||
wfreerdp_run(instance);
|
||||
|
||||
g_thread_count--;
|
||||
|
||||
if (g_thread_count < 1)
|
||||
SetEvent(g_done_event);
|
||||
|
||||
return (DWORD) NULL;
|
||||
}
|
||||
|
||||
static DWORD WINAPI kbd_thread_func(LPVOID lpParam)
|
||||
DWORD WINAPI wf_keyboard_thread(LPVOID lpParam)
|
||||
{
|
||||
MSG msg;
|
||||
BOOL status;
|
||||
wfInfo* wfi;
|
||||
HHOOK hook_handle;
|
||||
|
||||
hook_handle = SetWindowsHookEx(WH_KEYBOARD_LL, wf_ll_kbd_proc, g_hInstance, 0);
|
||||
wfi = (wfInfo*) lpParam;
|
||||
|
||||
hook_handle = SetWindowsHookEx(WH_KEYBOARD_LL, wf_ll_kbd_proc, wfi->hInstance, 0);
|
||||
|
||||
if (hook_handle)
|
||||
{
|
||||
while ((status = GetMessage( &msg, NULL, 0, 0 )) != 0)
|
||||
while ((status = GetMessage(&msg, NULL, 0, 0)) != 0)
|
||||
{
|
||||
if (status == -1)
|
||||
{
|
||||
@ -689,23 +668,22 @@ static DWORD WINAPI kbd_thread_func(LPVOID lpParam)
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
UnhookWindowsHookEx(hook_handle);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("failed to install keyboard hook\n");
|
||||
}
|
||||
|
||||
return (DWORD) NULL;
|
||||
}
|
||||
|
||||
|
||||
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
|
||||
int wf_global_init()
|
||||
{
|
||||
freerdp* instance;
|
||||
thread_data* data;
|
||||
WSADATA wsa_data;
|
||||
WNDCLASSEX wnd_cls;
|
||||
WSADATA wsaData;
|
||||
|
||||
if (NULL == getenv("HOME"))
|
||||
if (!getenv("HOME"))
|
||||
{
|
||||
char home[MAX_PATH * 2] = "HOME=";
|
||||
strcat(home, getenv("HOMEDRIVE"));
|
||||
@ -713,34 +691,35 @@ INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
_putenv(home);
|
||||
}
|
||||
|
||||
if (WSAStartup(0x101, &wsa_data) != 0)
|
||||
if (WSAStartup(0x101, &wsaData) != 0)
|
||||
return 1;
|
||||
|
||||
g_done_event = CreateEvent(0, 1, 0, 0);
|
||||
|
||||
#if defined(WITH_DEBUG) || defined(_DEBUG)
|
||||
wf_create_console();
|
||||
#endif
|
||||
|
||||
g_default_cursor = LoadCursor(NULL, IDC_ARROW);
|
||||
|
||||
wnd_cls.cbSize = sizeof(WNDCLASSEX);
|
||||
wnd_cls.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wnd_cls.lpfnWndProc = wf_event_proc;
|
||||
wnd_cls.cbClsExtra = 0;
|
||||
wnd_cls.cbWndExtra = 0;
|
||||
wnd_cls.hIcon = LoadIcon(NULL, IDI_APPLICATION);
|
||||
wnd_cls.hCursor = g_default_cursor;
|
||||
wnd_cls.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
|
||||
wnd_cls.lpszMenuName = NULL;
|
||||
wnd_cls.lpszClassName = g_wnd_class_name;
|
||||
wnd_cls.hInstance = hInstance;
|
||||
wnd_cls.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
|
||||
RegisterClassEx(&wnd_cls);
|
||||
|
||||
g_hInstance = hInstance;
|
||||
freerdp_channels_global_init();
|
||||
|
||||
freerdp_register_addin_provider(freerdp_channels_load_static_addin_entry, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wf_global_uninit()
|
||||
{
|
||||
WSACleanup();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
wfInfo* wf_new(HINSTANCE hInstance, HWND hWndParent, int argc, char** argv)
|
||||
{
|
||||
wfInfo* wfi;
|
||||
freerdp* instance;
|
||||
|
||||
if (!hInstance)
|
||||
hInstance = GetModuleHandle(NULL);
|
||||
|
||||
instance = freerdp_new();
|
||||
instance->PreConnect = wf_pre_connect;
|
||||
instance->PostConnect = wf_post_connect;
|
||||
@ -753,55 +732,68 @@ INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
instance->ContextFree = wf_context_free;
|
||||
freerdp_context_new(instance);
|
||||
|
||||
instance->context->argc = __argc;
|
||||
instance->context->argv = __argv;
|
||||
wfi = ((wfContext*) (instance->context))->wfi;
|
||||
wfi->instance = instance;
|
||||
|
||||
if (!CreateThread(NULL, 0, kbd_thread_func, NULL, 0, NULL))
|
||||
printf("error creating keyboard handler thread");
|
||||
instance->context->argc = argc;
|
||||
instance->context->argv = argv;
|
||||
|
||||
//while (1)
|
||||
{
|
||||
int status;
|
||||
wfi->hWndParent = hWndParent;
|
||||
wfi->hInstance = hInstance;
|
||||
wfi->cursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wfi->icon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON1));
|
||||
wfi->wndClassName = _tcsdup(_T("FreeRDP"));
|
||||
|
||||
data = (thread_data*) malloc(sizeof(thread_data));
|
||||
ZeroMemory(data, sizeof(thread_data));
|
||||
wfi->wndClass.cbSize = sizeof(WNDCLASSEX);
|
||||
wfi->wndClass.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wfi->wndClass.lpfnWndProc = wf_event_proc;
|
||||
wfi->wndClass.cbClsExtra = 0;
|
||||
wfi->wndClass.cbWndExtra = 0;
|
||||
wfi->wndClass.hCursor = wfi->cursor;
|
||||
wfi->wndClass.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
|
||||
wfi->wndClass.lpszMenuName = NULL;
|
||||
wfi->wndClass.lpszClassName = wfi->wndClassName;
|
||||
wfi->wndClass.hInstance = hInstance;
|
||||
wfi->wndClass.hIcon = wfi->icon;
|
||||
wfi->wndClass.hIconSm = wfi->icon;
|
||||
RegisterClassEx(&(wfi->wndClass));
|
||||
|
||||
data->instance = instance;
|
||||
return wfi;
|
||||
}
|
||||
|
||||
freerdp_register_addin_provider(freerdp_channels_load_static_addin_entry, 0);
|
||||
int wf_start(wfInfo* wfi)
|
||||
{
|
||||
int status;
|
||||
freerdp* instance = wfi->instance;
|
||||
|
||||
status = freerdp_client_parse_command_line_arguments(__argc, __argv, instance->settings);
|
||||
wfi->keyboardThread = CreateThread(NULL, 0, wf_keyboard_thread, (void*) wfi, 0, NULL);
|
||||
|
||||
freerdp_client_load_addins(instance->context->channels, instance->settings);
|
||||
if (!wfi->keyboardThread)
|
||||
return -1;
|
||||
|
||||
if (status < 0)
|
||||
{
|
||||
printf("failed to parse arguments.\n");
|
||||
#ifdef _DEBUG
|
||||
system("pause");
|
||||
#endif
|
||||
exit(-1);
|
||||
}
|
||||
status = freerdp_client_parse_command_line_arguments(instance->context->argc, instance->context->argv, instance->settings);
|
||||
|
||||
if (CreateThread(NULL, 0, thread_func, data, 0, NULL) != 0)
|
||||
g_thread_count++;
|
||||
}
|
||||
freerdp_client_load_addins(instance->context->channels, instance->settings);
|
||||
|
||||
if (g_thread_count > 0)
|
||||
WaitForSingleObject(g_done_event, INFINITE);
|
||||
else
|
||||
MessageBox(GetConsoleWindow(),
|
||||
L"Failed to start wfreerdp.\n\nPlease check the debug output.",
|
||||
L"FreeRDP Error", MB_ICONSTOP);
|
||||
wfi->thread = CreateThread(NULL, 0, wf_thread, (void*) instance, 0, NULL);
|
||||
|
||||
if (!wfi->thread)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wf_stop(wfInfo* wfi)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int wf_free(wfInfo* wfi)
|
||||
{
|
||||
freerdp* instance = wfi->instance;
|
||||
|
||||
freerdp_context_free(instance);
|
||||
freerdp_free(instance);
|
||||
|
||||
WSACleanup();
|
||||
|
||||
#ifdef _DEBUG
|
||||
system("pause");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
@ -19,11 +19,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __WFREERDP_H
|
||||
#define __WFREERDP_H
|
||||
#ifndef __WF_INTERFACE_H
|
||||
#define __WF_INTERFACE_H
|
||||
|
||||
#include <winpr/windows.h>
|
||||
|
||||
#include <freerdp/api.h>
|
||||
#include <freerdp/freerdp.h>
|
||||
#include <freerdp/gdi/gdi.h>
|
||||
#include <freerdp/gdi/dc.h>
|
||||
@ -75,6 +76,16 @@ struct wf_info
|
||||
int percentscreen;
|
||||
char window_title[64];
|
||||
|
||||
HANDLE thread;
|
||||
HANDLE keyboardThread;
|
||||
|
||||
HICON icon;
|
||||
HWND hWndParent;
|
||||
HINSTANCE hInstance;
|
||||
WNDCLASSEX wndClass;
|
||||
LPCTSTR wndClassName;
|
||||
HCURSOR hDefaultCursor;
|
||||
|
||||
HWND hwnd;
|
||||
POINT diff;
|
||||
HGDI_DC hdc;
|
||||
@ -96,4 +107,13 @@ struct wf_info
|
||||
BOOL sw_gdi;
|
||||
};
|
||||
|
||||
FREERDP_API int wf_global_init();
|
||||
FREERDP_API int wf_global_uninit();
|
||||
|
||||
FREERDP_API int wf_start(wfInfo* wfi);
|
||||
FREERDP_API int wf_stop(wfInfo* wfi);
|
||||
|
||||
FREERDP_API wfInfo* wf_new(HINSTANCE hInstance, HWND hWndParent, int argc, char** argv);
|
||||
FREERDP_API int wf_free(wfInfo* wfi);
|
||||
|
||||
#endif
|
@ -19,7 +19,7 @@
|
||||
#ifndef __WF_RAIL_H
|
||||
#define __WF_RAIL_H
|
||||
|
||||
#include "wfreerdp.h"
|
||||
#include "wf_interface.h"
|
||||
|
||||
void wf_rail_paint(wfInfo* wfi, rdpRail* rail, INT32 uleft, INT32 utop, UINT32 uright, UINT32 ubottom);
|
||||
void wf_rail_register_callbacks(wfInfo* wfi, rdpRail* rail);
|
||||
|
@ -16,11 +16,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __WF_WINDOW_H
|
||||
#define __WF_WINDOW_H
|
||||
|
||||
#include <freerdp/freerdp.h>
|
||||
|
||||
#include "wfreerdp.h"
|
||||
#include "wf_interface.h"
|
||||
|
||||
#endif
|
||||
|
BIN
client/Windows/wfreerdp.aps
Normal file
BIN
client/Windows/wfreerdp.aps
Normal file
Binary file not shown.
BIN
client/Windows/wfreerdp.rc
Normal file
BIN
client/Windows/wfreerdp.rc
Normal file
Binary file not shown.
@ -986,7 +986,7 @@ int freerdp_client_parse_command_line_arguments(int argc, char** argv, rdpSettin
|
||||
|
||||
arg = CommandLineFindArgumentA(args, "v");
|
||||
|
||||
if (!(arg->Flags & COMMAND_LINE_VALUE_PRESENT))
|
||||
if (!settings->ConnectionFile && !(arg->Flags & COMMAND_LINE_VALUE_PRESENT))
|
||||
{
|
||||
printf("error: server hostname was not specified with /v:<server>[:port]\n");
|
||||
return COMMAND_LINE_ERROR_MISSING_ARGUMENT;
|
||||
|
@ -186,7 +186,10 @@ int freerdp_client_old_command_line_pre_filter(void* context, int index, int arg
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (_stricmp(&(argv[index])[strlen(argv[index])- 4], ".rdp") == 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
freerdp_client_old_parse_hostname((char*) argv[index], &settings->ServerHostname, &settings->ServerPort);
|
||||
}
|
||||
else
|
||||
|
@ -71,12 +71,8 @@
|
||||
// load default view and set background color and resizing mask
|
||||
[super loadView];
|
||||
|
||||
// init keyboard handling vars and register required notification handlers
|
||||
// init keyboard handling vars
|
||||
_keyboard_visible = NO;
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name: UIKeyboardWillShowNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name: UIKeyboardDidShowNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name: UIKeyboardWillHideNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name: UIKeyboardDidHideNotification object:nil];
|
||||
|
||||
// init keyboard toolbar
|
||||
_keyboard_toolbar = [[self keyboardToolbar] retain];
|
||||
@ -325,6 +321,12 @@
|
||||
|
||||
- (void)sessionDidConnect:(RDPSession*)session
|
||||
{
|
||||
// register keyboard notification handlers
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name: UIKeyboardWillShowNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name: UIKeyboardDidShowNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name: UIKeyboardWillHideNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name: UIKeyboardDidHideNotification object:nil];
|
||||
|
||||
// remove and release connecting view
|
||||
[_connecting_indicator_view stopAnimating];
|
||||
[_connecting_view removeFromSuperview];
|
||||
@ -383,7 +385,7 @@
|
||||
|
||||
- (void)session:(RDPSession*)session needsRedrawInRect:(CGRect)rect
|
||||
{
|
||||
[_session_view setNeedsDisplayInRect:rect];
|
||||
[_session_view setNeedsDisplayInRect:rect];
|
||||
}
|
||||
|
||||
- (void)session:(RDPSession *)session requestsAuthenticationWithParams:(NSMutableDictionary *)params
|
||||
|
@ -223,8 +223,7 @@ NSMutableArray* FilterHistory(NSArray* history, NSString* filterStr)
|
||||
#pragma mark Version Info
|
||||
NSString* TSXAppFullVersion()
|
||||
{
|
||||
NSDictionary* info_dict = [[NSBundle mainBundle] infoDictionary];
|
||||
return [NSString stringWithFormat:@"%@.%@ (%@)", [info_dict objectForKey:@"CFBundleShortVersionString"], [info_dict objectForKey:@"CFBundleVersion"], [NSString stringWithUTF8String:GIT_REVISION]];
|
||||
return [NSString stringWithUTF8String:GIT_REVISION];
|
||||
}
|
||||
|
||||
#pragma mark iPad/iPhone detection
|
||||
|
@ -204,7 +204,7 @@
|
||||
// toggle windows key, returns true if pressed, otherwise false
|
||||
- (void)toggleWinKey
|
||||
{
|
||||
[self sendVirtualKey:VK_LWIN up:_win_pressed];
|
||||
[self sendVirtualKey:(VK_LWIN | KBDEXT) up:_win_pressed];
|
||||
_win_pressed = !_win_pressed;
|
||||
[self notifyDelegateModifiersChanged];
|
||||
}
|
||||
@ -213,7 +213,7 @@
|
||||
|
||||
- (void)sendEnterKeyStroke
|
||||
{
|
||||
[self sendVirtualKeyCode:VK_RETURN];
|
||||
[self sendVirtualKeyCode:(VK_RETURN | KBDEXT)];
|
||||
}
|
||||
|
||||
- (void)sendEscapeKeyStroke
|
||||
|
@ -52,17 +52,17 @@ struct ButtonItem functionKeysItems[24] =
|
||||
|
||||
{ @"img:icon_key_arrows", KEY_SHOW_CURSORVIEW },
|
||||
{ @"Tab", VK_TAB },
|
||||
{ @"Ins", VK_INSERT },
|
||||
{ @"Home", VK_HOME },
|
||||
{ @"PgUp", VK_PRIOR },
|
||||
{ @"img:icon_key_win", VK_LWIN },
|
||||
{ @"Ins", VK_INSERT | KBDEXT },
|
||||
{ @"Home", VK_HOME | KBDEXT },
|
||||
{ @"PgUp", VK_PRIOR | KBDEXT },
|
||||
{ @"img:icon_key_win", VK_LWIN | KBDEXT },
|
||||
|
||||
{ @"123", KEY_SHOW_NUMPADVIEW },
|
||||
{ @"Print", VK_PRINT },
|
||||
{ @"Del", VK_DELETE },
|
||||
{ @"End", VK_END },
|
||||
{ @"PgDn", VK_NEXT },
|
||||
{ @"img:icon_key_menu", VK_APPS }
|
||||
{ @"Del", VK_DELETE | KBDEXT },
|
||||
{ @"End", VK_END | KBDEXT },
|
||||
{ @"PgDn", VK_NEXT | KBDEXT },
|
||||
{ @"img:icon_key_menu", VK_APPS | KBDEXT }
|
||||
};
|
||||
|
||||
|
||||
@ -75,7 +75,7 @@ struct ButtonItem numPadKeysItems[24] =
|
||||
{ @"9", VK_NUMPAD9 },
|
||||
{ @"-", VK_SUBTRACT },
|
||||
|
||||
{ @"/", VK_DIVIDE },
|
||||
{ @"/", VK_DIVIDE | KBDEXT },
|
||||
{ @"*", VK_MULTIPLY },
|
||||
{ @"4", VK_NUMPAD4 },
|
||||
{ @"5", VK_NUMPAD5 },
|
||||
@ -94,7 +94,7 @@ struct ButtonItem numPadKeysItems[24] =
|
||||
{ @"", KEY_MERGE_COLUMN },
|
||||
{ @"0", VK_NUMPAD0 },
|
||||
{ @".", VK_DECIMAL },
|
||||
{ @"img:icon_key_return", VK_RETURN }
|
||||
{ @"img:icon_key_return", VK_RETURN | KBDEXT }
|
||||
};
|
||||
|
||||
|
||||
@ -110,23 +110,23 @@ struct ButtonItem cursorKeysItems[24] =
|
||||
{ @"", KEY_SKIP },
|
||||
{ @"", KEY_SKIP },
|
||||
{ @"", KEY_SKIP },
|
||||
{ @"img:icon_key_arrow_up", VK_UP },
|
||||
{ @"img:icon_key_arrow_up", VK_UP | KBDEXT },
|
||||
{ @"", KEY_SKIP },
|
||||
{ @"", KEY_SKIP },
|
||||
|
||||
{ @"Fn", KEY_SHOW_FUNCVIEW },
|
||||
{ @"", KEY_SKIP },
|
||||
{ @"img:icon_key_arrow_left", VK_LEFT },
|
||||
{ @"img:icon_key_arrow_left", VK_LEFT | KBDEXT },
|
||||
{ @"", KEY_SKIP },
|
||||
{ @"img:icon_key_arrow_right", VK_RIGHT },
|
||||
{ @"img:icon_key_arrow_right", VK_RIGHT | KBDEXT },
|
||||
{ @"img:icon_key_backspace", VK_BACK },
|
||||
|
||||
{ @"123", KEY_SHOW_NUMPADVIEW },
|
||||
{ @"", KEY_SKIP },
|
||||
{ @"", KEY_SKIP },
|
||||
{ @"img:icon_key_arrow_down", VK_DOWN },
|
||||
{ @"img:icon_key_arrow_down", VK_DOWN | KBDEXT },
|
||||
{ @"", KEY_SKIP },
|
||||
{ @"img:icon_key_return", VK_RETURN }
|
||||
{ @"img:icon_key_return", VK_RETURN | KBDEXT }
|
||||
};
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
@ -751,7 +751,7 @@
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 3.2;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
PROVISIONING_PROFILE = "";
|
||||
SDKROOT = iphoneos;
|
||||
@ -775,7 +775,7 @@
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 3.2;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
|
||||
PROVISIONING_PROFILE = "";
|
||||
SDKROOT = iphoneos;
|
||||
@ -798,7 +798,7 @@
|
||||
"\"@FREERDP_IOS_EXTERNAL_SSL_PATH@/include\"",
|
||||
);
|
||||
INFOPLIST_FILE = "$(SRCROOT)/iFreeRDP.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 3.2;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"\"$(SRCROOT)/../../libfreerdp\"",
|
||||
"\"$(SRCROOT)/../../winpr/libwinpr\"",
|
||||
@ -824,7 +824,7 @@
|
||||
"\"@FREERDP_IOS_EXTERNAL_SSL_PATH@/include\"",
|
||||
);
|
||||
INFOPLIST_FILE = "$(SRCROOT)/iFreeRDP.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 3.2;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"\"$(SRCROOT)/../../libfreerdp\"",
|
||||
"\"$(SRCROOT)/../../winpr/libwinpr\"",
|
||||
|
@ -46,6 +46,10 @@ typedef enum _WTS_VIRTUAL_CLASS
|
||||
WTSVirtualChannelReady
|
||||
} WTS_VIRTUAL_CLASS;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* WTSVirtualChannelManager functions are FreeRDP extensions to the API.
|
||||
*/
|
||||
@ -127,4 +131,8 @@ FREERDP_API BOOL WTSVirtualChannelWrite(
|
||||
FREERDP_API BOOL WTSVirtualChannelClose(
|
||||
/* __in */ void* hChannelHandle);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FREERDP_WTSVC_H */
|
||||
|
@ -497,7 +497,6 @@ static void rfx_dwt_2d_encode_sse2(INT16* buffer, INT16* dwt_buffer)
|
||||
|
||||
void rfx_init_sse2(RFX_CONTEXT* context)
|
||||
{
|
||||
|
||||
if (!IsProcessorFeaturePresent(PF_XMMI64_INSTRUCTIONS_AVAILABLE))
|
||||
return;
|
||||
|
||||
|
@ -335,9 +335,10 @@ int rpc_in_write(rdpRpc* rpc, BYTE* data, int length)
|
||||
int status;
|
||||
|
||||
#ifdef WITH_DEBUG_TSG
|
||||
rpc_pdu_header_print((rpcconn_hdr_t*) data);
|
||||
printf("Sending PDU (length: %d)\n", length);
|
||||
rpc_pdu_header_print((rpcconn_hdr_t*) data);
|
||||
winpr_HexDump(data, length);
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
status = tls_write_all(rpc->TlsIn, data, length);
|
||||
|
@ -191,15 +191,16 @@ int rpc_client_on_fragment_received_event(rdpRpc* rpc)
|
||||
|
||||
if (header->response.alloc_hint == StubLength)
|
||||
{
|
||||
rpc->StubCallId = 0;
|
||||
rpc->StubFragCount = 0;
|
||||
|
||||
rpc->client->pdu->Flags = RPC_PDU_FLAG_STUB;
|
||||
rpc->client->pdu->CallId = rpc->StubCallId;
|
||||
|
||||
Stream_Length(rpc->client->pdu->s) = Stream_Position(rpc->client->pdu->s);
|
||||
|
||||
rpc->StubFragCount = 0;
|
||||
rpc->StubCallId = 0;
|
||||
|
||||
Queue_Enqueue(rpc->client->ReceiveQueue, rpc->client->pdu);
|
||||
|
||||
rpc->client->pdu = NULL;
|
||||
|
||||
return 0;
|
||||
@ -408,6 +409,16 @@ RPC_PDU* rpc_recv_dequeue_pdu(rdpRpc* rpc)
|
||||
if (WaitForSingleObject(Queue_Event(rpc->client->ReceiveQueue), dwMilliseconds) == WAIT_OBJECT_0)
|
||||
{
|
||||
pdu = (RPC_PDU*) Queue_Dequeue(rpc->client->ReceiveQueue);
|
||||
|
||||
#ifdef WITH_DEBUG_TSG
|
||||
if (pdu)
|
||||
{
|
||||
printf("Receiving PDU (length: %d, CallId: %d)\n", pdu->s->length, pdu->CallId);
|
||||
winpr_HexDump(pdu->s->buffer, pdu->s->length);
|
||||
printf("\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
return pdu;
|
||||
}
|
||||
|
||||
|
@ -684,6 +684,7 @@ BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
|
||||
UINT32 ActualCount;
|
||||
UINT32 SwitchValue;
|
||||
PTSG_PACKET packet;
|
||||
char* messageText = NULL;
|
||||
PTSG_PACKET_MSG_RESPONSE packetMsgResponse;
|
||||
PTSG_PACKET_STRING_MESSAGE packetStringMessage = NULL;
|
||||
PTSG_PACKET_REAUTH_MESSAGE packetReauthMessage = NULL;
|
||||
@ -740,7 +741,9 @@ BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
|
||||
/* Offset */
|
||||
ActualCount = *((UINT32*) &buffer[offset + 56]); /* ActualCount */
|
||||
|
||||
winpr_HexDump(&buffer[offset + 60], ActualCount * 2);
|
||||
ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) &buffer[offset + 60], ActualCount, &messageText, 0, NULL, NULL);
|
||||
printf("Consent Message: %s\n", messageText);
|
||||
free(messageText);
|
||||
|
||||
break;
|
||||
|
||||
@ -759,7 +762,9 @@ BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
|
||||
/* Offset */
|
||||
ActualCount = *((UINT32*) &buffer[offset + 56]); /* ActualCount */
|
||||
|
||||
winpr_HexDump(&buffer[offset + 60], ActualCount * 2);
|
||||
ConvertFromUnicode(CP_UTF8, 0, (WCHAR*) &buffer[offset + 60], ActualCount, &messageText, 0, NULL, NULL);
|
||||
printf("Service Message: %s\n", messageText);
|
||||
free(messageText);
|
||||
|
||||
break;
|
||||
|
||||
@ -777,8 +782,6 @@ BOOL TsProxyMakeTunnelCallReadResponse(rdpTsg* tsg, RPC_PDU* pdu)
|
||||
break;
|
||||
}
|
||||
|
||||
exit(0);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1130,6 +1133,7 @@ BOOL TsProxySetupReceivePipe(handle_t IDL_handle, BYTE* pRpcMessage)
|
||||
BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port)
|
||||
{
|
||||
RPC_PDU* pdu = NULL;
|
||||
RpcClientCall* call;
|
||||
rdpRpc* rpc = tsg->rpc;
|
||||
rdpSettings* settings = rpc->settings;
|
||||
|
||||
@ -1265,16 +1269,6 @@ BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port)
|
||||
if (!TsProxyMakeTunnelCall(tsg, &tsg->TunnelContext, TSG_TUNNEL_CALL_ASYNC_MSG_REQUEST, NULL, NULL))
|
||||
return FALSE;
|
||||
|
||||
#if 0
|
||||
pdu = rpc_recv_dequeue_pdu(rpc);
|
||||
|
||||
if (!TsProxyMakeTunnelCallReadResponse(tsg, pdu))
|
||||
{
|
||||
printf("TsProxyMakeTunnelCall: error reading response\n");
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Sequential processing rules for connection process (continued):
|
||||
*
|
||||
@ -1296,6 +1290,19 @@ BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port)
|
||||
|
||||
pdu = rpc_recv_dequeue_pdu(rpc);
|
||||
|
||||
call = rpc_client_call_find_by_id(rpc, pdu->CallId);
|
||||
|
||||
if (call->OpNum == TsProxyMakeTunnelCallOpnum)
|
||||
{
|
||||
if (!TsProxyMakeTunnelCallReadResponse(tsg, pdu))
|
||||
{
|
||||
printf("TsProxyMakeTunnelCall: error reading response\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pdu = rpc_recv_dequeue_pdu(rpc);
|
||||
}
|
||||
|
||||
if (!TsProxyCreateChannelReadResponse(tsg, pdu))
|
||||
{
|
||||
printf("TsProxyCreateChannel: error reading response\n");
|
||||
|
Loading…
Reference in New Issue
Block a user