Skip to content

Commit b325da5

Browse files
committed
myrtille version 2.7.0 (see changelog)
1 parent e2a1ca5 commit b325da5

6 files changed

Lines changed: 552 additions & 371 deletions

File tree

‎channels/printer/client/printer_win.c‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,7 @@ static void printer_win_close_printjob(rdpPrintJob* printjob)
122122
if (printjob->printer->rdpcontext->settings->MyrtilleSessionId != NULL && strcmp(printjob->printer->name, "Myrtille PDF") == 0)
123123
{
124124
RDP_CLIENT_ENTRY_POINTS* pEntryPoints = printjob->printer->rdpcontext->instance->pClientEntryPoints;
125-
126-
char* printJobName;
127-
if (ConvertFromUnicode(CP_UTF8, 0, win_printjob->di.pDocName, -1, &printJobName, 0, NULL, NULL) >= 1)
128-
{
129-
IFCALL(pEntryPoints->ClientPrint, printjob->printer->rdpcontext, printJobName);
130-
}
125+
IFCALL(pEntryPoints->ClientPrint, printjob->printer->rdpcontext, win_printjob->di.pDocName);
131126
}
132127

133128
#pragma endregion
@@ -165,8 +160,8 @@ static rdpPrintJob* printer_win_create_printjob(rdpPrinter* printer, UINT32 id)
165160
snprintf(pid, sizeof(pid), "%lu", GetCurrentProcessId());
166161
strcat(printJobName, pid);
167162

168-
char now[10];
169-
snprintf(now, sizeof(now), "%lu", GetTickCount());
163+
char now[19];
164+
snprintf(now, sizeof(now), "%llu", GetTickCount64());
170165
strcat(printJobName, now);
171166

172167
WCHAR* printJobNameW = NULL;

‎client/Windows/wf_client.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,7 @@ static int wfreerdp_client_stop(rdpContext* context)
12561256

12571257
#pragma region Myrtille
12581258

1259-
static void wfreerdp_client_print(rdpContext* context, char* printJobName)
1259+
static void wfreerdp_client_print(rdpContext* context, wchar_t* printJobName)
12601260
{
12611261
wfContext* wfc = (wfContext*)context;
12621262
wf_myrtille_send_printjob(wfc, printJobName);

‎client/Windows/wf_cliprdr.c‎

Lines changed: 51 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,12 +1982,12 @@ static UINT wf_cliprdr_server_format_list(CliprdrClientContext* context,
19821982
#pragma endregion
19831983
}
19841984

1985-
#pragma region Myrtille
1985+
//#pragma region Myrtille
19861986

1987-
if (context->rdpcontext->settings->MyrtilleSessionId == NULL)
1988-
{
1987+
//if (context->rdpcontext->settings->MyrtilleSessionId == NULL)
1988+
//{
19891989

1990-
#pragma endregion
1990+
//#pragma endregion
19911991

19921992
if (file_transferring(clipboard))
19931993
{
@@ -2013,19 +2013,21 @@ static UINT wf_cliprdr_server_format_list(CliprdrClientContext* context,
20132013

20142014
#pragma region Myrtille
20152015

2016-
}
2017-
else
2018-
{
2019-
wfContext* wfc = (wfContext*)context->rdpcontext;
2020-
2021-
// the remote clipboard content has changed (copy)
2022-
// invalidate it so that the next clipboard request (paste) will trigger a new content request then save the result
2023-
// as long as the remote clipboard doesn't change, every request will send the saved content
2024-
if (unicodeTextFormatMapping)
2025-
wf_myrtille_reset_clipboard(wfc);
2016+
//}
2017+
//else
2018+
//{
2019+
if (context->rdpcontext->settings->MyrtilleSessionId != NULL)
2020+
{
2021+
// the server clipboard content has changed (a copy action was triggered)
2022+
if (unicodeTextFormatMapping)
2023+
{
2024+
wfContext* wfc = (wfContext*)context->rdpcontext;
2025+
wf_myrtille_read_server_clipboard(wfc);
2026+
}
2027+
}
20262028

2027-
rc = CHANNEL_RC_OK;
2028-
}
2029+
//rc = CHANNEL_RC_OK;
2030+
//}
20292031

20302032
#pragma endregion
20312033

@@ -2254,6 +2256,13 @@ static UINT wf_cliprdr_server_format_data_request(CliprdrClientContext* context,
22542256
}
22552257
else
22562258
{
2259+
//#pragma region Myrtille
2260+
2261+
//if (context->rdpcontext->settings->MyrtilleSessionId == NULL)
2262+
//{
2263+
2264+
//#pragma endregion
2265+
22572266
if (!OpenClipboard(clipboard->hwnd))
22582267
return ERROR_INTERNAL_ERROR;
22592268

@@ -2271,6 +2280,29 @@ static UINT wf_cliprdr_server_format_data_request(CliprdrClientContext* context,
22712280
CopyMemory(buff, globlemem, size);
22722281
GlobalUnlock(hClipdata);
22732282
CloseClipboard();
2283+
2284+
//#pragma region Myrtille
2285+
2286+
//}
2287+
//// when using myrtille, don't retrieve the client clipboard from the local machine (gateway)
2288+
//// instead, retrieve the value previously received from the browser
2289+
//else
2290+
//{
2291+
// wfContext* wfc = (wfContext*)context->rdpcontext;
2292+
// wchar_t* text;
2293+
//
2294+
// // retrieve the client clipboard
2295+
// wf_myrtille_read_client_clipboard(wfc, &text, &size);
2296+
2297+
// // copy it into the buffer (including the null terminator!)
2298+
// buff = malloc(size);
2299+
// CopyMemory(buff, text, size);
2300+
//
2301+
// // set the response type (missing from original code, intentionally?)
2302+
// response.msgType = CB_FORMAT_DATA_RESPONSE;
2303+
//}
2304+
2305+
#pragma endregion
22742306
}
22752307

22762308
response.msgFlags = CB_RESPONSE_OK;
@@ -2335,11 +2367,11 @@ static UINT wf_cliprdr_server_format_data_response(CliprdrClientContext*
23352367

23362368
#pragma region Myrtille
23372369

2338-
wfContext* wfc = (wfContext*)context->rdpcontext;
2370+
// the server clipboard was requested; send it
23392371
if (context->rdpcontext->settings->MyrtilleSessionId != NULL)
23402372
{
2341-
// remote clipboard content was requested; send the response
2342-
wf_myrtille_send_clipboard(wfc, data, formatDataResponse->dataLen);
2373+
wfContext* wfc = (wfContext*)context->rdpcontext;
2374+
wf_myrtille_send_server_clipboard(wfc, data, formatDataResponse->dataLen);
23432375
}
23442376

23452377
#pragma endregion

0 commit comments

Comments
 (0)