@@ -159,10 +159,10 @@ static UINT cliprdr_process_general_capability(cliprdrPlugin* cliprdr, wStream*
159
159
WLog_ERR (TAG , "cliprdr_get_client_interface failed!" );
160
160
return ERROR_INTERNAL_ERROR ;
161
161
}
162
-
162
+
163
163
Stream_Read_UINT32 (s , version ); /* version (4 bytes) */
164
164
Stream_Read_UINT32 (s , generalFlags ); /* generalFlags (4 bytes) */
165
-
165
+
166
166
DEBUG_CLIPRDR ("Version: %d" , version );
167
167
#ifdef WITH_DEBUG_CLIPRDR
168
168
cliprdr_print_general_capability_flags (generalFlags );
@@ -179,15 +179,15 @@ static UINT cliprdr_process_general_capability(cliprdrPlugin* cliprdr, wStream*
179
179
180
180
if (cliprdr -> canLockClipData )
181
181
cliprdr -> canLockClipData = (generalFlags & CB_CAN_LOCK_CLIPDATA ) ? TRUE : FALSE;
182
-
182
+
183
183
cliprdr -> capabilitiesReceived = TRUE;
184
184
185
185
if (!context -> custom )
186
186
{
187
187
WLog_ERR (TAG , "context->custom not set!" );
188
188
return ERROR_INTERNAL_ERROR ;
189
189
}
190
-
190
+
191
191
capabilities .cCapabilitiesSets = 1 ;
192
192
capabilities .capabilitySets = (CLIPRDR_CAPABILITY_SET * ) & (generalCapabilitySet );
193
193
generalCapabilitySet .capabilitySetType = CB_CAPSTYPE_GENERAL ;
@@ -215,7 +215,7 @@ static UINT cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, UINT16
215
215
UINT16 cCapabilitiesSets ;
216
216
UINT16 capabilitySetType ;
217
217
UINT error = CHANNEL_RC_OK ;
218
-
218
+
219
219
Stream_Read_UINT16 (s , cCapabilitiesSets ); /* cCapabilitiesSets (2 bytes) */
220
220
Stream_Seek_UINT16 (s ); /* pad1 (2 bytes) */
221
221
@@ -235,7 +235,7 @@ static UINT cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, wStream* s, UINT16
235
235
return error ;
236
236
}
237
237
break ;
238
-
238
+
239
239
default :
240
240
WLog_ERR (TAG , "unknown cliprdr capability set: %d" , capabilitySetType );
241
241
return CHANNEL_RC_BAD_PROC ;
@@ -273,13 +273,13 @@ static UINT cliprdr_process_monitor_ready(cliprdrPlugin* cliprdr, wStream* s, UI
273
273
* When the server capabilities pdu is not used, default capabilities
274
274
* corresponding to a generalFlags field set to zero are assumed.
275
275
*/
276
-
276
+
277
277
cliprdr -> useLongFormatNames = FALSE;
278
278
cliprdr -> streamFileClipEnabled = FALSE;
279
279
cliprdr -> fileClipNoFilePaths = TRUE;
280
280
cliprdr -> canLockClipData = FALSE;
281
281
}
282
-
282
+
283
283
monitorReady .msgType = CB_MONITOR_READY ;
284
284
monitorReady .msgFlags = flags ;
285
285
monitorReady .dataLen = length ;
@@ -354,7 +354,7 @@ static UINT cliprdr_process_filecontents_response(cliprdrPlugin* cliprdr, wStrea
354
354
WLog_ERR (TAG , "context->custom not set!" );
355
355
return ERROR_INTERNAL_ERROR ;
356
356
}
357
-
357
+
358
358
if (Stream_GetRemainingLength (s ) < 4 )
359
359
{
360
360
WLog_ERR (TAG , "not enought remaining data" );
@@ -366,7 +366,7 @@ static UINT cliprdr_process_filecontents_response(cliprdrPlugin* cliprdr, wStrea
366
366
response .dataLen = length ;
367
367
368
368
Stream_Read_UINT32 (s , response .streamId ); /* streamId (4 bytes) */
369
-
369
+
370
370
response .cbRequested = length - 4 ;
371
371
response .requestedData = Stream_Pointer (s ); /* requestedFileContentsData */
372
372
@@ -434,7 +434,7 @@ static UINT cliprdr_process_unlock_clipdata(cliprdrPlugin* cliprdr, wStream* s,
434
434
WLog_ERR (TAG , "context->custom not set!" );
435
435
return ERROR_INTERNAL_ERROR ;
436
436
}
437
-
437
+
438
438
if (Stream_GetRemainingLength (s ) < 4 )
439
439
{
440
440
WLog_ERR (TAG , "not enought remaining data" );
@@ -637,7 +637,7 @@ UINT cliprdr_client_format_list(CliprdrClientContext* context, CLIPRDR_FORMAT_LI
637
637
if (!cliprdr -> useLongFormatNames )
638
638
{
639
639
length = formatList -> numFormats * 36 ;
640
-
640
+
641
641
s = cliprdr_packet_new (CB_FORMAT_LIST , 0 , length );
642
642
643
643
if (!s )
@@ -649,40 +649,40 @@ UINT cliprdr_client_format_list(CliprdrClientContext* context, CLIPRDR_FORMAT_LI
649
649
for (index = 0 ; index < formatList -> numFormats ; index ++ )
650
650
{
651
651
format = (CLIPRDR_FORMAT * ) & (formatList -> formats [index ]);
652
-
652
+
653
653
Stream_Write_UINT32 (s , format -> formatId ); /* formatId (4 bytes) */
654
-
654
+
655
655
formatNameSize = 0 ;
656
656
formatNameLength = 0 ;
657
657
658
658
szFormatName = format -> formatName ;
659
-
659
+
660
660
if (asciiNames )
661
661
{
662
662
if (szFormatName )
663
663
formatNameLength = strlen (szFormatName );
664
-
664
+
665
665
if (formatNameLength > 31 )
666
666
formatNameLength = 31 ;
667
-
667
+
668
668
Stream_Write (s , szFormatName , formatNameLength );
669
669
Stream_Zero (s , 32 - formatNameLength );
670
670
}
671
671
else
672
672
{
673
673
wszFormatName = NULL ;
674
-
674
+
675
675
if (szFormatName )
676
676
formatNameSize = ConvertToUnicode (CP_UTF8 , 0 , szFormatName , -1 , & wszFormatName , 0 );
677
-
677
+
678
678
if (formatNameSize > 15 )
679
679
formatNameSize = 15 ;
680
-
681
- if (wszFormatName )
680
+
681
+ if (wszFormatName )
682
682
Stream_Write (s , wszFormatName , formatNameSize * 2 );
683
683
684
684
Stream_Zero (s , 32 - (formatNameSize * 2 ));
685
-
685
+
686
686
free (wszFormatName );
687
687
}
688
688
}
@@ -1218,9 +1218,9 @@ static UINT cliprdr_virtual_channel_event_disconnected(cliprdrPlugin* cliprdr)
1218
1218
1219
1219
if (MessageQueue_PostQuit (cliprdr -> queue , 0 ) && (WaitForSingleObject (cliprdr -> thread , INFINITE ) == WAIT_FAILED ))
1220
1220
{
1221
- rc = GetLastError ();
1222
- WLog_ERR (TAG , "WaitForSingleObject failed with error %lu" , rc );
1223
- return rc ;
1221
+ rc = GetLastError ();
1222
+ WLog_ERR (TAG , "WaitForSingleObject failed with error %lu" , rc );
1223
+ return rc ;
1224
1224
}
1225
1225
1226
1226
MessageQueue_Free (cliprdr -> queue );
@@ -1257,7 +1257,9 @@ static UINT cliprdr_virtual_channel_event_terminated(cliprdrPlugin* cliprdr)
1257
1257
return CHANNEL_RC_OK ;
1258
1258
}
1259
1259
1260
- static VOID VCAPITYPE cliprdr_virtual_channel_init_event (LPVOID pInitHandle , UINT event , LPVOID pData , UINT dataLength )
1260
+ static UINT VCAPITYPE cliprdr_virtual_channel_init_event (LPVOID pInitHandle ,
1261
+ UINT event , LPVOID pData ,
1262
+ UINT dataLength )
1261
1263
{
1262
1264
cliprdrPlugin * cliprdr ;
1263
1265
UINT error = CHANNEL_RC_OK ;
@@ -1267,7 +1269,7 @@ static VOID VCAPITYPE cliprdr_virtual_channel_init_event(LPVOID pInitHandle, UIN
1267
1269
if (!cliprdr )
1268
1270
{
1269
1271
WLog_ERR (TAG , "error no match" );
1270
- return ;
1272
+ return CHANNEL_RC_BAD_INIT_HANDLE ;
1271
1273
}
1272
1274
1273
1275
switch (event )
@@ -1290,7 +1292,7 @@ static VOID VCAPITYPE cliprdr_virtual_channel_init_event(LPVOID pInitHandle, UIN
1290
1292
if (error && cliprdr -> context -> rdpcontext )
1291
1293
setChannelError (cliprdr -> context -> rdpcontext , error , "cliprdr_virtual_channel_init_event reported an error" );
1292
1294
1293
- return ;
1295
+ return error ;
1294
1296
}
1295
1297
1296
1298
/* cliprdr is always built-in */
@@ -1358,14 +1360,14 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
1358
1360
cliprdr -> streamFileClipEnabled = FALSE;
1359
1361
cliprdr -> fileClipNoFilePaths = TRUE;
1360
1362
cliprdr -> canLockClipData = FALSE;
1361
-
1363
+
1362
1364
WLog_Print (cliprdr -> log , WLOG_DEBUG , "VirtualChannelEntry" );
1363
1365
1364
1366
CopyMemory (& (cliprdr -> channelEntryPoints ), pEntryPoints , sizeof (CHANNEL_ENTRY_POINTS_FREERDP ));
1365
1367
1366
1368
rc = cliprdr -> channelEntryPoints .pVirtualChannelInit (& cliprdr -> InitHandle ,
1367
1369
& cliprdr -> channelDef , 1 , VIRTUAL_CHANNEL_VERSION_WIN2000 , cliprdr_virtual_channel_init_event );
1368
-
1370
+
1369
1371
if (CHANNEL_RC_OK != rc )
1370
1372
{
1371
1373
WLog_ERR (TAG , "pVirtualChannelInit failed with %s [%08X]" ,
0 commit comments