2 * FreeRDP: A Remote Desktop Protocol Implementation
5 * Copyright 2011 Vic Lee
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
28 #include <winpr/crt.h>
29 #include <winpr/stream.h>
31 #include <freerdp/api.h>
32 #include <freerdp/crypto/per.h>
41 * Fast-Path packet format is defined in [MS-RDPBCGR] 2.2.9.1.2, which revises
42 * server output packets from the first byte with the goal of improving
45 * Slow-Path packet always starts with TPKT header, which has the first
46 * byte 0x03, while Fast-Path packet starts with 2 zero bits in the first
47 * two less significant bits of the first byte.
50 #define FASTPATH_MAX_PACKET_SIZE 0x3FFF
53 static const char* const FASTPATH_UPDATETYPE_STRINGS[] =
58 "Synchronize", /* 0x3 */
59 "Surface Commands", /* 0x4 */
60 "System Pointer Hidden", /* 0x5 */
61 "System Pointer Default", /* 0x6 */
63 "Pointer Position", /* 0x8 */
64 "Color Pointer", /* 0x9 */
65 "Cached Pointer", /* 0xA */
66 "New Pointer", /* 0xB */
71 * The fastpath header may be two or three bytes long.
72 * This function assumes that at least two bytes are available in the stream
73 * and doesn't touch third byte.
75 UINT16 fastpath_header_length(wStream* s)
80 stream_read_BYTE(s, length1);
83 return ((length1 & 0x80) != 0 ? 3 : 2);
87 * Read a Fast-Path packet header.\n
89 * @param encryptionFlags
92 UINT16 fastpath_read_header(rdpFastPath* fastpath, wStream* s)
97 stream_read_BYTE(s, header);
101 fastpath->encryptionFlags = (header & 0xC0) >> 6;
102 fastpath->numberEvents = (header & 0x3C) >> 2;
105 per_read_length(s, &length);
110 static INLINE void fastpath_read_update_header(wStream* s, BYTE* updateCode, BYTE* fragmentation, BYTE* compression)
114 stream_read_BYTE(s, updateHeader);
115 *updateCode = updateHeader & 0x0F;
116 *fragmentation = (updateHeader >> 4) & 0x03;
117 *compression = (updateHeader >> 6) & 0x03;
120 static INLINE void fastpath_write_update_header(wStream* s, BYTE updateCode, BYTE fragmentation, BYTE compression)
122 BYTE updateHeader = 0;
124 updateHeader |= updateCode & 0x0F;
125 updateHeader |= (fragmentation & 0x03) << 4;
126 updateHeader |= (compression & 0x03) << 6;
127 stream_write_BYTE(s, updateHeader);
130 BOOL fastpath_read_header_rdp(rdpFastPath* fastpath, wStream* s, UINT16 *length)
134 stream_read_BYTE(s, header);
138 fastpath->encryptionFlags = (header & 0xC0) >> 6;
139 fastpath->numberEvents = (header & 0x3C) >> 2;
142 if (!per_read_length(s, length))
145 *length = *length - Stream_GetPosition(s);
149 static BOOL fastpath_recv_orders(rdpFastPath* fastpath, wStream* s)
151 rdpUpdate* update = fastpath->rdp->update;
154 stream_read_UINT16(s, numberOrders); /* numberOrders (2 bytes) */
156 while (numberOrders > 0)
158 if (!update_recv_order(update, s))
167 static BOOL fastpath_recv_update_common(rdpFastPath* fastpath, wStream* s)
170 rdpUpdate* update = fastpath->rdp->update;
171 rdpContext* context = update->context;
173 if (Stream_GetRemainingLength(s) < 2)
176 stream_read_UINT16(s, updateType); /* updateType (2 bytes) */
180 case UPDATE_TYPE_BITMAP:
181 if (!update_read_bitmap(update, s, &update->bitmap_update))
183 IFCALL(update->BitmapUpdate, context, &update->bitmap_update);
186 case UPDATE_TYPE_PALETTE:
187 if (!update_read_palette(update, s, &update->palette_update))
189 IFCALL(update->Palette, context, &update->palette_update);
195 static BOOL fastpath_recv_update_synchronize(rdpFastPath* fastpath, wStream* s)
197 /* server 2008 can send invalid synchronize packet with missing padding,
198 so don't return FALSE even if the packet is invalid */
199 stream_skip(s, 2); /* size (2 bytes), MUST be set to zero */
203 static int fastpath_recv_update(rdpFastPath* fastpath, BYTE updateCode, UINT32 size, wStream* s)
206 rdpUpdate* update = fastpath->rdp->update;
207 rdpContext* context = fastpath->rdp->update->context;
208 rdpPointerUpdate* pointer = update->pointer;
210 #ifdef WITH_DEBUG_RDP
211 DEBUG_RDP("recv Fast-Path %s Update (0x%X), length:%d",
212 updateCode < ARRAYSIZE(FASTPATH_UPDATETYPE_STRINGS) ? FASTPATH_UPDATETYPE_STRINGS[updateCode] : "???", updateCode, capacity);
217 case FASTPATH_UPDATETYPE_ORDERS:
218 if (!fastpath_recv_orders(fastpath, s))
222 case FASTPATH_UPDATETYPE_BITMAP:
223 case FASTPATH_UPDATETYPE_PALETTE:
224 if (!fastpath_recv_update_common(fastpath, s))
228 case FASTPATH_UPDATETYPE_SYNCHRONIZE:
229 if (!fastpath_recv_update_synchronize(fastpath, s))
230 fprintf(stderr, "fastpath_recv_update_synchronize failure but we continue\n");
232 IFCALL(update->Synchronize, context);
235 case FASTPATH_UPDATETYPE_SURFCMDS:
236 status = update_recv_surfcmds(update, size, s);
239 case FASTPATH_UPDATETYPE_PTR_NULL:
240 pointer->pointer_system.type = SYSPTR_NULL;
241 IFCALL(pointer->PointerSystem, context, &pointer->pointer_system);
244 case FASTPATH_UPDATETYPE_PTR_DEFAULT:
245 update->pointer->pointer_system.type = SYSPTR_DEFAULT;
246 IFCALL(pointer->PointerSystem, context, &pointer->pointer_system);
250 case FASTPATH_UPDATETYPE_PTR_POSITION:
251 if (!update_read_pointer_position(s, &pointer->pointer_position))
253 IFCALL(pointer->PointerPosition, context, &pointer->pointer_position);
256 case FASTPATH_UPDATETYPE_COLOR:
257 if (!update_read_pointer_color(s, &pointer->pointer_color))
259 IFCALL(pointer->PointerColor, context, &pointer->pointer_color);
262 case FASTPATH_UPDATETYPE_CACHED:
263 if (!update_read_pointer_cached(s, &pointer->pointer_cached))
265 IFCALL(pointer->PointerCached, context, &pointer->pointer_cached);
268 case FASTPATH_UPDATETYPE_POINTER:
269 if (!update_read_pointer_new(s, &pointer->pointer_new))
271 IFCALL(pointer->PointerNew, context, &pointer->pointer_new);
275 DEBUG_WARN("unknown updateCode 0x%X", updateCode);
282 const char* fastpath_get_fragmentation_string(BYTE fragmentation)
284 if (fragmentation == FASTPATH_FRAGMENT_SINGLE)
285 return "FASTPATH_FRAGMENT_SINGLE";
286 else if (fragmentation == FASTPATH_FRAGMENT_LAST)
287 return "FASTPATH_FRAGMENT_LAST";
288 else if (fragmentation == FASTPATH_FRAGMENT_FIRST)
289 return "FASTPATH_FRAGMENT_FIRST";
290 else if (fragmentation == FASTPATH_FRAGMENT_NEXT)
291 return "FASTPATH_FRAGMENT_NEXT";
293 return "FASTPATH_FRAGMENT_UNKNOWN";
296 static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s)
310 BYTE compressionFlags;
311 rdpTransport* transport;
315 transport = fastpath->rdp->transport;
317 fastpath_read_update_header(s, &updateCode, &fragmentation, &compression);
319 if (compression == FASTPATH_OUTPUT_COMPRESSION_USED)
320 stream_read_BYTE(s, compressionFlags);
322 compressionFlags = 0;
324 stream_read_UINT16(s, size);
326 if (Stream_GetRemainingLength(s) < size)
330 next_pos = Stream_GetPosition(s) + size;
332 if (compressionFlags & PACKET_COMPRESSED)
334 if (decompress_rdp(rdp->mppc_dec, s->pointer, size, compressionFlags, &roff, &rlen))
337 buffer = rdp->mppc_dec->history_buf + roff;
339 cs = StreamPool_Take(transport->ReceivePool, size);
341 Stream_SetPosition(cs, 0);
342 Stream_Write(cs, buffer, size);
343 Stream_SealLength(cs);
344 Stream_SetPosition(cs, 0);
348 fprintf(stderr, "decompress_rdp() failed\n");
349 Stream_Seek(s, size);
353 if (fragmentation == FASTPATH_FRAGMENT_SINGLE)
355 if (fastpath->fragmentation != -1)
357 fprintf(stderr, "Unexpected FASTPATH_FRAGMENT_SINGLE\n");
362 status = fastpath_recv_update(fastpath, updateCode, totalSize, cs);
369 if (fragmentation == FASTPATH_FRAGMENT_FIRST)
371 if (fastpath->fragmentation != -1)
373 fprintf(stderr, "Unexpected FASTPATH_FRAGMENT_FIRST\n");
377 fastpath->fragmentation = FASTPATH_FRAGMENT_FIRST;
381 if (totalSize > transport->settings->MultifragMaxRequestSize)
383 fprintf(stderr, "Total size (%d) exceeds MultifragMaxRequestSize (%d)\n",
384 totalSize, transport->settings->MultifragMaxRequestSize);
388 fastpath->updateData = StreamPool_Take(transport->ReceivePool, size);
389 Stream_SetPosition(fastpath->updateData, 0);
391 Stream_Copy(fastpath->updateData, cs, size);
393 else if (fragmentation == FASTPATH_FRAGMENT_NEXT)
395 if ((fastpath->fragmentation != FASTPATH_FRAGMENT_FIRST) &&
396 (fastpath->fragmentation != FASTPATH_FRAGMENT_NEXT))
398 fprintf(stderr, "Unexpected FASTPATH_FRAGMENT_NEXT\n");
402 fastpath->fragmentation = FASTPATH_FRAGMENT_NEXT;
404 totalSize = Stream_GetPosition(fastpath->updateData) + size;
406 if (totalSize > transport->settings->MultifragMaxRequestSize)
408 fprintf(stderr, "Total size (%d) exceeds MultifragMaxRequestSize (%d)\n",
409 totalSize, transport->settings->MultifragMaxRequestSize);
413 Stream_EnsureCapacity(fastpath->updateData, totalSize);
415 Stream_Copy(fastpath->updateData, cs, size);
417 else if (fragmentation == FASTPATH_FRAGMENT_LAST)
419 if ((fastpath->fragmentation != FASTPATH_FRAGMENT_FIRST) &&
420 (fastpath->fragmentation != FASTPATH_FRAGMENT_NEXT))
422 fprintf(stderr, "Unexpected FASTPATH_FRAGMENT_LAST\n");
426 fastpath->fragmentation = -1;
428 totalSize = Stream_GetPosition(fastpath->updateData) + size;
430 if (totalSize > transport->settings->MultifragMaxRequestSize)
432 fprintf(stderr, "Total size (%d) exceeds MultifragMaxRequestSize (%d)\n",
433 totalSize, transport->settings->MultifragMaxRequestSize);
437 Stream_EnsureCapacity(fastpath->updateData, totalSize);
439 Stream_Copy(fastpath->updateData, cs, size);
441 Stream_SealLength(fastpath->updateData);
442 Stream_SetPosition(fastpath->updateData, 0);
444 status = fastpath_recv_update(fastpath, updateCode, totalSize, fastpath->updateData);
446 Stream_Release(fastpath->updateData);
453 Stream_SetPosition(s, next_pos);
461 int fastpath_recv_updates(rdpFastPath* fastpath, wStream* s)
464 rdpUpdate* update = fastpath->rdp->update;
466 IFCALL(update->BeginPaint, update->context);
468 while (Stream_GetRemainingLength(s) >= 3)
470 if (fastpath_recv_update_data(fastpath, s) < 0)
474 IFCALL(update->EndPaint, update->context);
479 static BOOL fastpath_read_input_event_header(wStream* s, BYTE* eventFlags, BYTE* eventCode)
483 if (Stream_GetRemainingLength(s) < 1)
486 stream_read_BYTE(s, eventHeader); /* eventHeader (1 byte) */
488 *eventFlags = (eventHeader & 0x1F);
489 *eventCode = (eventHeader >> 5);
494 static BOOL fastpath_recv_input_event_scancode(rdpFastPath* fastpath, wStream* s, BYTE eventFlags)
499 if (Stream_GetRemainingLength(s) < 1)
502 stream_read_BYTE(s, code); /* keyCode (1 byte) */
506 if ((eventFlags & FASTPATH_INPUT_KBDFLAGS_RELEASE))
507 flags |= KBD_FLAGS_RELEASE;
509 flags |= KBD_FLAGS_DOWN;
511 if ((eventFlags & FASTPATH_INPUT_KBDFLAGS_EXTENDED))
512 flags |= KBD_FLAGS_EXTENDED;
514 IFCALL(fastpath->rdp->input->KeyboardEvent, fastpath->rdp->input, flags, code);
519 static BOOL fastpath_recv_input_event_mouse(rdpFastPath* fastpath, wStream* s, BYTE eventFlags)
525 if (Stream_GetRemainingLength(s) < 6)
528 stream_read_UINT16(s, pointerFlags); /* pointerFlags (2 bytes) */
529 stream_read_UINT16(s, xPos); /* xPos (2 bytes) */
530 stream_read_UINT16(s, yPos); /* yPos (2 bytes) */
532 IFCALL(fastpath->rdp->input->MouseEvent, fastpath->rdp->input, pointerFlags, xPos, yPos);
537 static BOOL fastpath_recv_input_event_mousex(rdpFastPath* fastpath, wStream* s, BYTE eventFlags)
543 if (Stream_GetRemainingLength(s) < 6)
546 stream_read_UINT16(s, pointerFlags); /* pointerFlags (2 bytes) */
547 stream_read_UINT16(s, xPos); /* xPos (2 bytes) */
548 stream_read_UINT16(s, yPos); /* yPos (2 bytes) */
550 IFCALL(fastpath->rdp->input->ExtendedMouseEvent, fastpath->rdp->input, pointerFlags, xPos, yPos);
555 static BOOL fastpath_recv_input_event_sync(rdpFastPath* fastpath, wStream* s, BYTE eventFlags)
557 IFCALL(fastpath->rdp->input->SynchronizeEvent, fastpath->rdp->input, eventFlags);
562 static BOOL fastpath_recv_input_event_unicode(rdpFastPath* fastpath, wStream* s, BYTE eventFlags)
567 if (Stream_GetRemainingLength(s) < 2)
570 stream_read_UINT16(s, unicodeCode); /* unicodeCode (2 bytes) */
574 if ((eventFlags & FASTPATH_INPUT_KBDFLAGS_RELEASE))
575 flags |= KBD_FLAGS_RELEASE;
577 flags |= KBD_FLAGS_DOWN;
579 IFCALL(fastpath->rdp->input->UnicodeKeyboardEvent, fastpath->rdp->input, flags, unicodeCode);
584 static BOOL fastpath_recv_input_event(rdpFastPath* fastpath, wStream* s)
589 if (!fastpath_read_input_event_header(s, &eventFlags, &eventCode))
594 case FASTPATH_INPUT_EVENT_SCANCODE:
595 if (!fastpath_recv_input_event_scancode(fastpath, s, eventFlags))
599 case FASTPATH_INPUT_EVENT_MOUSE:
600 if (!fastpath_recv_input_event_mouse(fastpath, s, eventFlags))
604 case FASTPATH_INPUT_EVENT_MOUSEX:
605 if (!fastpath_recv_input_event_mousex(fastpath, s, eventFlags))
609 case FASTPATH_INPUT_EVENT_SYNC:
610 if (!fastpath_recv_input_event_sync(fastpath, s, eventFlags))
614 case FASTPATH_INPUT_EVENT_UNICODE:
615 if (!fastpath_recv_input_event_unicode(fastpath, s, eventFlags))
620 fprintf(stderr, "Unknown eventCode %d\n", eventCode);
627 int fastpath_recv_inputs(rdpFastPath* fastpath, wStream* s)
631 if (fastpath->numberEvents == 0)
634 * If numberEvents is not provided in fpInputHeader, it will be provided
635 * as one additional byte here.
638 if (Stream_GetRemainingLength(s) < 1)
641 stream_read_BYTE(s, fastpath->numberEvents); /* eventHeader (1 byte) */
644 for (i = 0; i < fastpath->numberEvents; i++)
646 if (!fastpath_recv_input_event(fastpath, s))
653 static UINT32 fastpath_get_sec_bytes(rdpRdp* rdp)
663 if (rdp->settings->EncryptionMethods == ENCRYPTION_METHOD_FIPS)
670 wStream* fastpath_input_pdu_init_header(rdpFastPath* fastpath)
677 s = transport_send_stream_init(rdp->transport, 256);
679 Stream_Seek(s, 3); /* fpInputHeader, length1 and length2 */
683 rdp->sec_flags |= SEC_ENCRYPT;
685 if (rdp->do_secure_checksum)
686 rdp->sec_flags |= SEC_SECURE_CHECKSUM;
689 Stream_Seek(s, fastpath_get_sec_bytes(rdp));
694 wStream* fastpath_input_pdu_init(rdpFastPath* fastpath, BYTE eventFlags, BYTE eventCode)
701 s = fastpath_input_pdu_init_header(fastpath);
702 stream_write_BYTE(s, eventFlags | (eventCode << 5)); /* eventHeader (1 byte) */
707 BOOL fastpath_send_multiple_input_pdu(rdpFastPath* fastpath, wStream* s, int iNumEvents)
716 length = Stream_GetPosition(s);
718 if (length >= (2 << 14))
720 fprintf(stderr, "Maximum FastPath PDU length is 32767\n");
724 eventHeader = FASTPATH_INPUT_ACTION_FASTPATH;
726 eventHeader |= (1 << 2); /* numberEvents */
729 eventHeader |= (iNumEvents << 2); /* numberEvents */
730 >>>>>>> f1672948ff0b5f6a9d3cda658a18104df3c3d1e4
731 if (rdp->sec_flags & SEC_ENCRYPT)
732 eventHeader |= (FASTPATH_INPUT_ENCRYPTED << 6);
733 if (rdp->sec_flags & SEC_SECURE_CHECKSUM)
734 eventHeader |= (FASTPATH_INPUT_SECURE_CHECKSUM << 6);
736 Stream_SetPosition(s, 0);
737 stream_write_BYTE(s, eventHeader);
738 sec_bytes = fastpath_get_sec_bytes(fastpath->rdp);
741 * We always encode length in two bytes, even though we could use
742 * only one byte if length <= 0x7F. It is just easier that way,
743 * because we can leave room for fixed-length header, store all
744 * the data first and then store the header.
746 stream_write_UINT16_be(s, 0x8000 | length);
751 UINT16 fpInputEvents_length;
753 fpInputEvents = Stream_Pointer(s) + sec_bytes;
754 fpInputEvents_length = length - 3 - sec_bytes;
756 if (rdp->sec_flags & SEC_SECURE_CHECKSUM)
757 security_salted_mac_signature(rdp, fpInputEvents, fpInputEvents_length, TRUE, Stream_Pointer(s));
759 security_mac_signature(rdp, fpInputEvents, fpInputEvents_length, Stream_Pointer(s));
761 security_encrypt(fpInputEvents, fpInputEvents_length, rdp);
766 Stream_SetPosition(s, length);
768 if (transport_write(fastpath->rdp->transport, s) < 0)
774 BOOL fastpath_send_input_pdu(rdpFastPath* fastpath, wStream* s)
776 return fastpath_send_multiple_input_pdu(fastpath, s, 1);
779 wStream* fastpath_update_pdu_init(rdpFastPath* fastpath)
783 s = transport_send_stream_init(fastpath->rdp->transport, FASTPATH_MAX_PACKET_SIZE);
785 Stream_Seek(s, 3); /* fpOutputHeader, length1 and length2 */
786 Stream_Seek(s, fastpath_get_sec_bytes(fastpath->rdp));
787 Stream_Seek(s, 3); /* updateHeader, size */
792 BOOL fastpath_send_update_pdu(rdpFastPath* fastpath, BYTE updateCode, wStream* s)
815 wStream* comp_update;
820 sec_bytes = fastpath_get_sec_bytes(rdp);
821 maxLength = FASTPATH_MAX_PACKET_SIZE - (6 + sec_bytes);
822 totalLength = Stream_GetPosition(s) - (6 + sec_bytes);
823 Stream_SetPosition(s, 0);
824 update = stream_new(0);
825 try_comp = rdp->settings->CompressionEnabled;
826 comp_update = stream_new(0);
828 for (fragment = 0; (totalLength > 0) || (fragment == 0); fragment++)
830 stream_get_mark(s, holdp);
832 dlen = MIN(maxLength, totalLength);
835 header_bytes = 6 + sec_bytes;
836 pdu_data_bytes = dlen;
840 if (compress_rdp(rdp->mppc_enc, ls->pointer + header_bytes, dlen))
842 if (rdp->mppc_enc->flags & PACKET_COMPRESSED)
844 cflags = rdp->mppc_enc->flags;
845 pdu_data_bytes = rdp->mppc_enc->bytes_in_opb;
846 comp_flags = FASTPATH_OUTPUT_COMPRESSION_USED;
847 header_bytes = 7 + sec_bytes;
848 bm = (BYTE*) (rdp->mppc_enc->outputBuffer - header_bytes);
849 stream_attach(comp_update, bm, pdu_data_bytes + header_bytes);
855 fprintf(stderr, "fastpath_send_update_pdu: mppc_encode failed\n");
860 pduLength = pdu_data_bytes + header_bytes;
862 if (totalLength == 0)
863 fragmentation = (fragment == 0) ? FASTPATH_FRAGMENT_SINGLE : FASTPATH_FRAGMENT_LAST;
865 fragmentation = (fragment == 0) ? FASTPATH_FRAGMENT_FIRST : FASTPATH_FRAGMENT_NEXT;
867 stream_get_mark(ls, bm);
871 header |= (FASTPATH_OUTPUT_ENCRYPTED << 6);
873 stream_write_BYTE(ls, header); /* fpOutputHeader (1 byte) */
874 stream_write_BYTE(ls, 0x80 | (pduLength >> 8)); /* length1 */
875 stream_write_BYTE(ls, pduLength & 0xFF); /* length2 */
878 Stream_Seek(ls, sec_bytes);
880 fastpath_write_update_header(ls, updateCode, fragmentation, comp_flags);
882 /* extra byte if compressed */
883 if (ls == comp_update)
885 stream_write_BYTE(ls, cflags);
886 bytes_to_crypt = pdu_data_bytes + 4;
890 bytes_to_crypt = pdu_data_bytes + 3;
893 stream_write_UINT16(ls, pdu_data_bytes);
895 stream_attach(update, bm, pduLength);
896 Stream_Seek(update, pduLength);
900 /* does this work ? */
901 ptr_to_crypt = bm + 3 + sec_bytes;
904 if (rdp->sec_flags & SEC_SECURE_CHECKSUM)
905 security_salted_mac_signature(rdp, ptr_to_crypt, bytes_to_crypt, TRUE, ptr_sig);
907 security_mac_signature(rdp, ptr_to_crypt, bytes_to_crypt, ptr_sig);
909 security_encrypt(ptr_to_crypt, bytes_to_crypt, rdp);
912 if (transport_write(fastpath->rdp->transport, update) < 0)
918 /* Reserve 6 + sec_bytes bytes for the next fragment header, if any. */
919 stream_set_mark(s, holdp + dlen);
922 stream_detach(update);
923 stream_detach(comp_update);
925 stream_free(comp_update);
930 rdpFastPath* fastpath_new(rdpRdp* rdp)
932 rdpFastPath* fastpath;
934 fastpath = (rdpFastPath*) malloc(sizeof(rdpFastPath));
938 ZeroMemory(fastpath, sizeof(rdpFastPath));
941 fastpath->fragmentation = -1;
947 void fastpath_free(rdpFastPath* fastpath)