wfreerdp: fix 64-bit build
This commit is contained in:
parent
ad86d3c333
commit
d64f86d52c
@ -183,17 +183,16 @@ endif()
|
||||
|
||||
if(MSVC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Gd")
|
||||
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MD")
|
||||
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /O2")
|
||||
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ob2")
|
||||
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W2")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3")
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_AMD64_")
|
||||
else()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_X86_")
|
||||
endif()
|
||||
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
|
||||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
|
||||
|
||||
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
|
||||
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
else()
|
||||
@ -461,12 +460,6 @@ if(TARGET_ARCH MATCHES "x86|x64")
|
||||
find_feature(NPP ${NPP_FEATURE_TYPE} ${NPP_FEATURE_PURPOSE} ${NPP_FEATURE_DESCRIPTION})
|
||||
endif()
|
||||
|
||||
# Installation Paths
|
||||
if(WIN32 AND NOT FREERDP_SDK)
|
||||
set(CMAKE_INSTALL_BINDIR ".")
|
||||
set(CMAKE_INSTALL_LIBDIR ".")
|
||||
endif()
|
||||
|
||||
# Path to put FreeRDP data
|
||||
set(FREERDP_DATA_PATH "${CMAKE_INSTALL_PREFIX}/share/freerdp")
|
||||
|
||||
|
@ -283,7 +283,7 @@ static LRESULT CALLBACK cliprdr_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
|
||||
break;
|
||||
}
|
||||
|
||||
if (SetClipboardData(wParam, cliprdr->hmem) == NULL)
|
||||
if (SetClipboardData((UINT) wParam, cliprdr->hmem) == NULL)
|
||||
{
|
||||
DEBUG_CLIPRDR("SetClipboardData failed with 0x%x", GetLastError());
|
||||
cliprdr->hmem = GlobalFree(cliprdr->hmem);
|
||||
@ -339,11 +339,10 @@ static int create_cliprdr_window(cliprdrContext *cliprdr)
|
||||
|
||||
static void *cliprdr_thread_func(void *arg)
|
||||
{
|
||||
cliprdrContext *cliprdr = (cliprdrContext *)arg;
|
||||
BOOL mcode;
|
||||
MSG msg;
|
||||
int ret;
|
||||
HRESULT result;
|
||||
MSG msg;
|
||||
BOOL mcode;
|
||||
cliprdrContext* cliprdr = (cliprdrContext*) arg;
|
||||
|
||||
if ((ret = create_cliprdr_window(cliprdr)) != 0)
|
||||
{
|
||||
@ -437,15 +436,15 @@ static void wf_cliprdr_process_cb_monitor_ready_event(wfContext *wfc, RDP_CB_MON
|
||||
cliprdr_send_format_list(wfc->cliprdr_context);
|
||||
}
|
||||
|
||||
static void wf_cliprdr_process_cb_data_request_event(wfContext *wfc, RDP_CB_DATA_REQUEST_EVENT *event)
|
||||
static void wf_cliprdr_process_cb_data_request_event(wfContext* wfc, RDP_CB_DATA_REQUEST_EVENT* event)
|
||||
{
|
||||
cliprdrContext *cliprdr = (cliprdrContext *)wfc->cliprdr_context;
|
||||
RDP_CB_DATA_RESPONSE_EVENT *responce_event;
|
||||
HANDLE hClipdata;
|
||||
int size = 0;
|
||||
char *buff = NULL;
|
||||
char *globlemem = NULL;
|
||||
char* buff = NULL;
|
||||
char* globlemem = NULL;
|
||||
UINT32 local_format;
|
||||
cliprdrContext* cliprdr = (cliprdrContext*) wfc->cliprdr_context;
|
||||
RDP_CB_DATA_RESPONSE_EVENT* response_event;
|
||||
|
||||
local_format = event->format;
|
||||
|
||||
@ -473,6 +472,7 @@ static void wf_cliprdr_process_cb_data_request_event(wfContext *wfc, RDP_CB_DATA
|
||||
}
|
||||
|
||||
hClipdata = GetClipboardData(event->format);
|
||||
|
||||
if (!hClipdata)
|
||||
{
|
||||
DEBUG_CLIPRDR("GetClipboardData failed.");
|
||||
@ -480,10 +480,10 @@ static void wf_cliprdr_process_cb_data_request_event(wfContext *wfc, RDP_CB_DATA
|
||||
return;
|
||||
}
|
||||
|
||||
globlemem = (char *)GlobalLock(hClipdata);
|
||||
size = GlobalSize(hClipdata);
|
||||
globlemem = (char*) GlobalLock(hClipdata);
|
||||
size = (int) GlobalSize(hClipdata);
|
||||
|
||||
buff = (char *)malloc(size);
|
||||
buff = (char*) malloc(size);
|
||||
memcpy(buff, globlemem, size);
|
||||
|
||||
GlobalUnlock(hClipdata);
|
||||
@ -491,15 +491,15 @@ static void wf_cliprdr_process_cb_data_request_event(wfContext *wfc, RDP_CB_DATA
|
||||
CloseClipboard();
|
||||
}
|
||||
|
||||
responce_event = (RDP_CB_DATA_RESPONSE_EVENT *)freerdp_event_new(CliprdrChannel_Class,
|
||||
response_event = (RDP_CB_DATA_RESPONSE_EVENT*) freerdp_event_new(CliprdrChannel_Class,
|
||||
CliprdrChannel_DataResponse, NULL, NULL);
|
||||
|
||||
responce_event->data = (BYTE *)buff;
|
||||
responce_event->size = size;
|
||||
response_event->data = (BYTE *)buff;
|
||||
response_event->size = size;
|
||||
|
||||
freerdp_channels_send_event(cliprdr->channels, (wMessage *) responce_event);
|
||||
freerdp_channels_send_event(cliprdr->channels, (wMessage*) response_event);
|
||||
|
||||
/* Note: don't free buff here. */
|
||||
/* Note: don't free buffer here. */
|
||||
}
|
||||
|
||||
static void wf_cliprdr_process_cb_format_list_event(wfContext *wfc, RDP_CB_FORMAT_LIST_EVENT *event)
|
||||
@ -560,12 +560,12 @@ static void wf_cliprdr_process_cb_format_list_event(wfContext *wfc, RDP_CB_FORMA
|
||||
}
|
||||
else
|
||||
{
|
||||
int k;
|
||||
UINT32 k;
|
||||
|
||||
for (k = 0; k < event->raw_format_data_size / 36; k++)
|
||||
{
|
||||
formatMapping *map;
|
||||
int name_len;
|
||||
formatMapping* map;
|
||||
|
||||
map = &cliprdr->format_mappings[i++];
|
||||
|
||||
|
@ -34,8 +34,8 @@
|
||||
|
||||
static HWND g_focus_hWnd;
|
||||
|
||||
#define X_POS(lParam) (lParam & 0xFFFF)
|
||||
#define Y_POS(lParam) ((lParam >> 16) & 0xFFFF)
|
||||
#define X_POS(lParam) ((UINT16) (lParam & 0xFFFF))
|
||||
#define Y_POS(lParam) ((UINT16) ((lParam >> 16) & 0xFFFF))
|
||||
|
||||
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);
|
||||
@ -189,14 +189,13 @@ void wf_sizing(wfContext* wfc, WPARAM wParam, LPARAM lParam)
|
||||
LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HDC hdc;
|
||||
LONG ptr;
|
||||
LONG_PTR ptr;
|
||||
wfContext* wfc;
|
||||
int x, y, w, h;
|
||||
PAINTSTRUCT ps;
|
||||
rdpInput* input;
|
||||
BOOL processed;
|
||||
RECT windowRect;
|
||||
RECT clientRect;
|
||||
MINMAXINFO* minmax;
|
||||
SCROLLINFO si;
|
||||
|
||||
@ -286,7 +285,7 @@ LRESULT CALLBACK wf_event_proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam
|
||||
break;
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
wf_scale_mouse_event(wfc, input,PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON1, X_POS(lParam) - wfc->offset_x, Y_POS(lParam) - wfc->offset_y);
|
||||
wf_scale_mouse_event(wfc, input, PTR_FLAGS_DOWN | PTR_FLAGS_BUTTON1, X_POS(lParam) - wfc->offset_x, Y_POS(lParam) - wfc->offset_y);
|
||||
break;
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
|
@ -279,9 +279,6 @@ void wf_resize_window(wfContext* wfc)
|
||||
}
|
||||
else if (!wfc->instance->settings->Decorations)
|
||||
{
|
||||
RECT rc_wnd;
|
||||
RECT rc_client;
|
||||
|
||||
SetWindowLongPtr(wfc->hwnd, GWL_STYLE, WS_CHILD);
|
||||
|
||||
/* Now resize to get full canvas size and room for caption and borders */
|
||||
@ -292,9 +289,6 @@ void wf_resize_window(wfContext* wfc)
|
||||
}
|
||||
else
|
||||
{
|
||||
RECT rc_wnd;
|
||||
RECT rc_client;
|
||||
|
||||
SetWindowLongPtr(wfc->hwnd, GWL_STYLE, WS_CAPTION | WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX | WS_SIZEBOX | WS_MAXIMIZEBOX);
|
||||
|
||||
if (!wfc->client_height)
|
||||
|
@ -59,8 +59,6 @@
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
void wf_size_scrollbars(wfContext* wfc, int client_width, int client_height);
|
||||
|
||||
int wf_create_console(void)
|
||||
{
|
||||
if (!AllocConsole())
|
||||
@ -312,7 +310,7 @@ void wf_add_system_menu(wfContext* wfc)
|
||||
item_info.wID = SYSCOMMAND_ID_SMARTSIZING;
|
||||
item_info.fType = MFT_STRING;
|
||||
item_info.dwTypeData = _wcsdup(_T("Smart sizing"));
|
||||
item_info.cch = _wcslen(_T("Smart sizing"));
|
||||
item_info.cch = (UINT) _wcslen(_T("Smart sizing"));
|
||||
item_info.dwItemData = (ULONG_PTR) wfc;
|
||||
|
||||
InsertMenuItem(hMenu, 6, TRUE, &item_info);
|
||||
@ -829,14 +827,10 @@ int freerdp_client_load_settings_from_rdp_file(wfContext* wfc, char* filename)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void wf_size_scrollbars(wfContext* wfc, int client_width, int client_height)
|
||||
void wf_size_scrollbars(wfContext* wfc, UINT32 client_width, UINT32 client_height)
|
||||
{
|
||||
BOOL rc;
|
||||
|
||||
if (wfc->disablewindowtracking == TRUE)
|
||||
{
|
||||
if (wfc->disablewindowtracking)
|
||||
return;
|
||||
}
|
||||
|
||||
// prevent infinite message loop
|
||||
wfc->disablewindowtracking = TRUE;
|
||||
|
@ -141,7 +141,7 @@ typedef struct wf_context wfContext;
|
||||
|
||||
FREERDP_API int RdpClientEntry(RDP_CLIENT_ENTRY_POINTS* pEntryPoints);
|
||||
FREERDP_API int freerdp_client_set_window_size(wfContext* wfc, int width, int height);
|
||||
|
||||
FREERDP_API void wf_size_scrollbars(wfContext* wfc, UINT32 client_width, UINT32 client_height);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -1012,7 +1012,7 @@ extern "C" {
|
||||
WINPR_API void sspi_GlobalInit(void);
|
||||
WINPR_API void sspi_GlobalFinish(void);
|
||||
|
||||
WINPR_API void sspi_SecBufferAlloc(PSecBuffer SecBuffer, size_t size);
|
||||
WINPR_API void sspi_SecBufferAlloc(PSecBuffer SecBuffer, ULONG size);
|
||||
WINPR_API void sspi_SecBufferFree(PSecBuffer SecBuffer);
|
||||
|
||||
WINPR_API void sspi_SetAuthIdentity(SEC_WINNT_AUTH_IDENTITY* identity, char* user, char* domain, char* password);
|
||||
|
@ -209,10 +209,12 @@ void sspi_CredentialsFree(CREDENTIALS* credentials)
|
||||
free(credentials);
|
||||
}
|
||||
|
||||
void sspi_SecBufferAlloc(PSecBuffer SecBuffer, size_t size)
|
||||
void sspi_SecBufferAlloc(PSecBuffer SecBuffer, ULONG size)
|
||||
{
|
||||
SecBuffer->cbBuffer = size;
|
||||
SecBuffer->pvBuffer = malloc(size);
|
||||
|
||||
if (SecBuffer->pvBuffer)
|
||||
ZeroMemory(SecBuffer->pvBuffer, SecBuffer->cbBuffer);
|
||||
}
|
||||
|
||||
@ -380,7 +382,7 @@ void sspi_CopyAuthIdentity(SEC_WINNT_AUTH_IDENTITY* identity, SEC_WINNT_AUTH_IDE
|
||||
|
||||
PSecBuffer sspi_FindSecBuffer(PSecBufferDesc pMessage, ULONG BufferType)
|
||||
{
|
||||
int index;
|
||||
ULONG index;
|
||||
PSecBuffer pSecBuffer = NULL;
|
||||
|
||||
for (index = 0; index < pMessage->cBuffers; index++)
|
||||
|
Loading…
Reference in New Issue
Block a user