本文整理汇总了C++中out_uint32_le函数的典型用法代码示例。如果您正苦于以下问题:C++ out_uint32_le函数的具体用法?C++ out_uint32_le怎么用?C++ out_uint32_le使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了out_uint32_le函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rdp_out_bitmapcache_rev2_capset
void rdp_out_bitmapcache_rev2_capset(rdpRdp * rdp, STREAM s)
{
capsetHeaderRef header;
uint16 flag;
header = rdp_skip_capset_header(s);
flag = ALLOW_CACHE_WAITING_LIST_FLAG;
if (rdp->settings->bitmap_cache_persist_enable)
flag |= PERSISTENT_KEYS_EXPECTED_FLAG;
out_uint16_le(s, flag); /* CacheFlags */
out_uint8s(s, 1); /* pad */
out_uint8(s, 3); /* numCellCaches */
/* max cell size for cache 0 is 16x16, 1 = 32x32, 2 = 64x64, etc */
out_uint32_le(s, BMPCACHE2_C0_CELLS);
out_uint32_le(s, BMPCACHE2_C1_CELLS);
if (pstcache_init(rdp->pcache, 2))
{
out_uint32_le(s, BMPCACHE2_NUM_PSTCELLS | BMPCACHE2_FLAG_PERSIST);
}
else
{
out_uint32_le(s, BMPCACHE2_C2_CELLS);
}
out_uint8s(s, 20); /* other bitmap caches not used */
rdp_out_capset_header(s, header, CAPSET_TYPE_BITMAPCACHE_REV2);
}
示例2: xrdp_orders_send_window_cached_icon
/* flags can contain WINDOW_ORDER_STATE_NEW and/or
WINDOW_ORDER_FIELD_ICON_BIG */
int
xrdp_orders_send_window_cached_icon(struct xrdp_orders *self,
int window_id, int cache_entry,
int cache_id, int flags)
{
int order_size;
int order_flags;
int field_present_flags;
order_size = 14;
if (xrdp_orders_check(self, order_size) != 0)
{
return 1;
}
self->order_count++;
order_flags = RDP_ORDER_SECONDARY;
order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */
out_uint8(self->out_s, order_flags);
/* orderSize (2 bytes) */
out_uint16_le(self->out_s, order_size);
/* FieldsPresentFlags (4 bytes) */
field_present_flags = flags | WINDOW_ORDER_TYPE_WINDOW |
WINDOW_ORDER_CACHED_ICON;
out_uint32_le(self->out_s, field_present_flags);
/* windowId (4 bytes) */
out_uint32_le(self->out_s, window_id);
/* CacheEntry (2 bytes) */
out_uint16_le(self->out_s, cache_entry);
/* CacheId (1 byte) */
out_uint8(self->out_s, cache_id);
return 0;
}
示例3: rdpdr_send_completion
void
rdpdr_send_completion(uint32 device, uint32 id, uint32 status, uint32 result, uint8 * buffer,
uint32 length)
{
uint8 magic[4] = "rDCI";
STREAM s;
#ifdef WITH_SCARD
scard_lock(SCARD_LOCK_RDPDR);
#endif
s = channel_init(rdpdr_channel, 20 + length);
out_uint8a(s, magic, 4);
out_uint32_le(s, device);
out_uint32_le(s, id);
out_uint32_le(s, status);
out_uint32_le(s, result);
out_uint8p(s, buffer, length);
s_mark_end(s);
/* JIF */
#ifdef WITH_DEBUG_RDP5
printf("--> rdpdr_send_completion\n");
/* hexdump(s->channel_hdr + 8, s->end - s->channel_hdr - 8); */
#endif
channel_send(s, rdpdr_channel);
#ifdef WITH_SCARD
scard_unlock(SCARD_LOCK_RDPDR);
#endif
}
示例4: rdp_send_client_window_status
/* Send a client window information PDU */
BOOL
rdp_send_client_window_status(RDPCLIENT * This, int status)
{
STREAM s;
if (This->rdp.current_status == status)
return True;
s = rdp_init_data(This, 12);
if(s == NULL)
return False;
out_uint32_le(s, status);
switch (status)
{
case 0: /* shut the server up */
break;
case 1: /* receive data again */
out_uint32_le(s, 0); /* unknown */
out_uint16_le(s, This->width);
out_uint16_le(s, This->height);
break;
}
s_mark_end(s);
This->rdp.current_status = status;
return rdp_send_data(This, s, RDP_DATA_PDU_CLIENT_WINDOW_STATUS);
}
示例5: xrdp_emt_send_result
bool APP_CC
xrdp_emt_send_result(struct xrdp_rdp* self, struct xrdp_emt* emt)
{
struct stream* s;
if (emt == NULL)
{
printf("emt is null\n");
return false;
}
make_stream(s);
init_stream(s, 40);
xrdp_sec_init(self->sec_layer, s);
out_uint8(s, SEC_AUTODETECT_REQ_LENGTH); // headerLength
out_uint8(s, TYPE_ID_AUTODETECT_REQUEST); // headerTypeId
out_uint16_le(s, emt->seq_number++); // sequenceNumber
out_uint16_le(s, field_all); // responseType
out_uint32_le(s, self->session->base_RTT);
out_uint32_le(s, self->session->bandwidth);
out_uint32_le(s, self->session->average_RTT);
s_mark_end(s);
xrdp_emt_send_packet(self, emt, s);
free_stream(s);
return true;
}
示例6: dev_redir_process_close_io_request
int APP_CC
dev_redir_process_close_io_request(int completion_id)
{
struct stream* s;
log_message(&log_conf, LOG_LEVEL_DEBUG, "chansrv[dev_redir_process_close_io_request]:"
"close file : %s",actions[completion_id].path);
make_stream(s);
init_stream(s,1100);
actions[completion_id].last_req = IRP_MJ_CLOSE;
out_uint16_le(s, RDPDR_CTYP_CORE);
out_uint16_le(s, PAKID_CORE_DEVICE_IOREQUEST);
out_uint32_le(s, actions[completion_id].device);
out_uint32_le(s, actions[completion_id].file_id);
out_uint32_le(s, completion_id);
out_uint32_le(s, IRP_MJ_CLOSE); /* major version */
out_uint32_le(s, 0); /* minor version */
out_uint8s(s,32);
s_mark_end(s);
dev_redir_send(s);
actions[completion_id].message_id++;
free_stream(s);
return 0;
free_stream(s);
}
示例7: cliprdr_send_capability
void cliprdr_send_capability()
{
/* this message is ignored by rdp applet */
struct stream* s;
make_stream(s);
init_stream(s,1024);
log_message(l_config, LOG_LEVEL_DEBUG, "vchannel_cliprdr[cliprdr_send_capability]:");
/* clip header */
out_uint16_le(s, CB_CLIP_CAPS); /* msg type */
out_uint16_le(s, 0x00); /* msg flag */
out_uint32_le(s, 0); /* msg size */
/* we only support one capability for now */
out_uint16_le(s, 1); /* cCapabilitiesSets */
out_uint8s(s, 16); /* pad */
/* CLIPRDR_CAPS_SET */
out_uint16_le(s, CB_CAPSTYPE_GENERAL); /* capabilitySetType */
out_uint16_le(s, 92); /* lengthCapability */
out_uint32_le(s, CB_CAPS_VERSION_1); /* version */
out_uint32_le(s, 0); /* general flags */
s_mark_end(s);
cliprdr_send(s);
free_stream(s);
}
示例8: xrdp_orders_send_monitored_desktop
/* used for both Non-Monitored Desktop and Actively Monitored Desktop */
int
xrdp_orders_send_monitored_desktop(struct xrdp_orders *self,
struct rail_monitored_desktop_order *mdo,
int flags)
{
int order_size;
int order_flags;
int field_present_flags;
int index;
order_size = 7;
field_present_flags = flags | WINDOW_ORDER_TYPE_DESKTOP;
if (field_present_flags & WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND)
{
/* ActiveWindowId (4 bytes) */
order_size += 4;
}
if (field_present_flags & WINDOW_ORDER_FIELD_DESKTOP_ZORDER)
{
/* NumWindowIds (1 byte) */
order_size += 1;
/* WindowIds (variable) */
order_size += mdo->num_window_ids * 4;
}
if (xrdp_orders_check(self, order_size) != 0)
{
return 1;
}
self->order_count++;
order_flags = RDP_ORDER_SECONDARY;
order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */
out_uint8(self->out_s, order_flags);
/* orderSize (2 bytes) */
out_uint16_le(self->out_s, order_size);
/* FieldsPresentFlags (4 bytes) */
out_uint32_le(self->out_s, field_present_flags);
if (field_present_flags & WINDOW_ORDER_FIELD_DESKTOP_ACTIVE_WND)
{
/* ActiveWindowId (4 bytes) */
out_uint32_le(self->out_s, mdo->active_window_id);
}
if (field_present_flags & WINDOW_ORDER_FIELD_DESKTOP_ZORDER)
{
/* NumWindowIds (1 byte) */
out_uint8(self->out_s, mdo->num_window_ids);
/* WindowIds (variable) */
for (index = 0; index < mdo->num_window_ids; index++)
{
out_uint32_le(self->out_s, mdo->window_ids[index]);
}
}
return 0;
}
示例9: xrdp_orders_send_notify_delete
/* returns error */
int
xrdp_orders_send_notify_delete(struct xrdp_orders *self, int window_id,
int notify_id)
{
int order_size;
int order_flags;
int field_present_flags;
order_size = 15;
if (xrdp_orders_check(self, order_size) != 0)
{
return 1;
}
self->order_count++;
order_flags = RDP_ORDER_SECONDARY;
order_flags |= 0xb << 2; /* type TS_ALTSEC_WINDOW */
out_uint8(self->out_s, order_flags);
/* orderSize (2 bytes) */
out_uint16_le(self->out_s, order_size);
/* FieldsPresentFlags (4 bytes) */
field_present_flags = WINDOW_ORDER_TYPE_NOTIFY | WINDOW_ORDER_STATE_DELETED;
out_uint32_le(self->out_s, field_present_flags);
/* windowId (4 bytes) */
out_uint32_le(self->out_s, window_id);
/* notifyIconId (4 bytes) */
out_uint32_le(self->out_s, notify_id);
return 0;
}
示例10: libxrdp_send_bell
int EXPORT_CC
libxrdp_send_bell(struct xrdp_session *session)
{
struct stream *s = (struct stream *)NULL;
DEBUG(("libxrdp_send_bell sending bell signal"));
/* see MS documentation: Server play sound PDU, TS_PLAY_SOUND_PDU_DATA */
make_stream(s);
init_stream(s, 8192);
if (xrdp_rdp_init_data((struct xrdp_rdp *)session->rdp, s) != 0)
{
free_stream(s);
return 1;
}
out_uint32_le(s, 440); /* frequency */
out_uint32_le(s, 100); /* duration (ms) */
s_mark_end(s);
if (xrdp_rdp_send_data((struct xrdp_rdp *)session->rdp, s, RDP_DATA_PDU_PLAY_SOUND) != 0)
{
free_stream(s);
return 1;
}
free_stream(s);
return 0;
}
示例11: rdp_send_client_window_status
/* Send a client window information PDU */
void
rdp_send_client_window_status(int status)
{
STREAM s;
static int current_status = 1;
if (current_status == status)
return;
s = rdp_init_data(12);
out_uint32_le(s, status);
switch (status)
{
case 0: /* shut the server up */
break;
case 1: /* receive data again */
out_uint32_le(s, 0); /* unknown */
out_uint16_le(s, g_width);
out_uint16_le(s, g_height);
break;
}
s_mark_end(s);
rdp_send_data(s, RDP_DATA_PDU_CLIENT_WINDOW_STATUS);
current_status = status;
}
示例12: sound_send_server_formats
static int APP_CC
sound_send_server_formats(void)
{
struct stream *s;
int bytes;
char *size_ptr;
print_got_here();
make_stream(s);
init_stream(s, 8182);
out_uint16_le(s, SNDC_FORMATS);
size_ptr = s->p;
out_uint16_le(s, 0); /* size, set later */
out_uint32_le(s, 0); /* dwFlags */
out_uint32_le(s, 0); /* dwVolume */
out_uint32_le(s, 0); /* dwPitch */
out_uint16_le(s, 0); /* wDGramPort */
out_uint16_le(s, 1); /* wNumberOfFormats */
out_uint8(s, g_cBlockNo); /* cLastBlockConfirmed */
out_uint16_le(s, 2); /* wVersion */
out_uint8(s, 0); /* bPad */
/* sndFormats */
/*
wFormatTag 2 byte offset 0
nChannels 2 byte offset 2
nSamplesPerSec 4 byte offset 4
nAvgBytesPerSec 4 byte offset 8
nBlockAlign 2 byte offset 12
wBitsPerSample 2 byte offset 14
cbSize 2 byte offset 16
data variable offset 18
*/
/* examples
01 00 02 00 44 ac 00 00 10 b1 02 00 04 00 10 00 ....D...........
00 00
01 00 02 00 22 56 00 00 88 58 01 00 04 00 10 00 ...."V...X......
00 00
*/
out_uint16_le(s, 1); // wFormatTag - WAVE_FORMAT_PCM
out_uint16_le(s, 2); // num of channels
out_uint32_le(s, 44100); // samples per sec
out_uint32_le(s, 176400); // avg bytes per sec
out_uint16_le(s, 4); // block align
out_uint16_le(s, 16); // bits per sample
out_uint16_le(s, 0); // size
s_mark_end(s);
bytes = (int)((s->end - s->data) - 4);
size_ptr[0] = bytes;
size_ptr[1] = bytes >> 8;
bytes = (int)(s->end - s->data);
send_channel_data(g_rdpsnd_chan_id, s->data, bytes);
free_stream(s);
return 0;
}
示例13: rdpdr_send_available
static void
rdpdr_send_available(RDPCLIENT * This)
{
uint8 magic[4] = "rDAD";
uint32 driverlen, printerlen, bloblen;
int i;
STREAM s;
PRINTER *printerinfo;
s = channel_init(This, This->rdpdr.channel, announcedata_size(This));
out_uint8a(s, magic, 4);
out_uint32_le(s, This->num_devices);
for (i = 0; i < This->num_devices; i++)
{
out_uint32_le(s, This->rdpdr_device[i].device_type);
out_uint32_le(s, i); /* RDP Device ID */
/* Is it possible to use share names longer than 8 chars?
/astrand */
out_uint8p(s, This->rdpdr_device[i].name, 8);
switch (This->rdpdr_device[i].device_type)
{
case DEVICE_TYPE_PRINTER:
printerinfo = (PRINTER *) This->rdpdr_device[i].pdevice_data;
driverlen = 2 * strlen(printerinfo->driver) + 2;
printerlen = 2 * strlen(printerinfo->printer) + 2;
bloblen = printerinfo->bloblen;
out_uint32_le(s, 24 + driverlen + printerlen + bloblen); /* length of extra info */
out_uint32_le(s, printerinfo->default_printer ? 2 : 0);
out_uint8s(s, 8); /* unknown */
out_uint32_le(s, driverlen);
out_uint32_le(s, printerlen);
out_uint32_le(s, bloblen);
rdp_out_unistr(This, s, printerinfo->driver, driverlen - 2);
rdp_out_unistr(This, s, printerinfo->printer, printerlen - 2);
out_uint8a(s, printerinfo->blob, bloblen);
if (printerinfo->blob)
xfree(printerinfo->blob); /* Blob is sent twice if reconnecting */
break;
default:
out_uint32(s, 0);
}
}
#if 0
out_uint32_le(s, 0x20); /* Device type 0x20 - smart card */
out_uint32_le(s, 0);
out_uint8p(s, "SCARD", 5);
out_uint8s(s, 3);
out_uint32(s, 0);
#endif
s_mark_end(s);
channel_send(This, s, This->rdpdr.channel);
}
示例14: channel_send
void
channel_send(STREAM s, VCHANNEL * channel)
{
uint32 length, flags;
uint32 thislength, remaining;
uint8 *data;
#ifdef WITH_SCARD
scard_lock(SCARD_LOCK_CHANNEL);
#endif
/* first fragment sent in-place */
s_pop_layer(s, channel_hdr);
length = s->end - s->p - 8;
DEBUG_CHANNEL(("channel_send, length = %d\n", length));
thislength = MIN(length, CHANNEL_CHUNK_LENGTH);
/* Note: In the original clipboard implementation, this number was
1592, not 1600. However, I don't remember the reason and 1600 seems
to work so.. This applies only to *this* length, not the length of
continuation or ending packets. */
remaining = length - thislength;
flags = (remaining == 0) ? CHANNEL_FLAG_FIRST | CHANNEL_FLAG_LAST : CHANNEL_FLAG_FIRST;
if (channel->flags & CHANNEL_OPTION_SHOW_PROTOCOL)
flags |= CHANNEL_FLAG_SHOW_PROTOCOL;
out_uint32_le(s, length);
out_uint32_le(s, flags);
data = s->end = s->p + thislength;
DEBUG_CHANNEL(("Sending %d bytes with FLAG_FIRST\n", thislength));
sec_send_to_channel(s, g_encryption ? SEC_ENCRYPT : 0, channel->mcs_id);
/* subsequent segments copied (otherwise would have to generate headers backwards) */
while (remaining > 0)
{
thislength = MIN(remaining, CHANNEL_CHUNK_LENGTH);
remaining -= thislength;
flags = (remaining == 0) ? CHANNEL_FLAG_LAST : 0;
if (channel->flags & CHANNEL_OPTION_SHOW_PROTOCOL)
flags |= CHANNEL_FLAG_SHOW_PROTOCOL;
DEBUG_CHANNEL(("Sending %d bytes with flags %d\n", thislength, flags));
s = sec_init(g_encryption ? SEC_ENCRYPT : 0, thislength + 8);
out_uint32_le(s, length);
out_uint32_le(s, flags);
out_uint8p(s, data, thislength);
s_mark_end(s);
sec_send_to_channel(s, g_encryption ? SEC_ENCRYPT : 0, channel->mcs_id);
data += thislength;
}
#ifdef WITH_SCARD
scard_unlock(SCARD_LOCK_CHANNEL);
#endif
}
示例15: clipboard_send_file_data
/* send a chunk of the file from server to client */
static int
clipboard_send_file_data(int streamId, int lindex,
int nPositionLow, int cbRequested)
{
struct stream *s;
int size;
int rv;
int fd;
char full_fn[256];
struct cb_file_info *cfi;
if (g_files_list == 0)
{
LLOGLN(10, ("clipboard_send_file_data: error g_files_list is nil"));
return 1;
}
cfi = (struct cb_file_info *)list_get_item(g_files_list, lindex);
if (cfi == 0)
{
LLOGLN(10, ("clipboard_send_file_data: error cfi is nil"));
return 1;
}
LLOGLN(10, ("clipboard_send_file_data: streamId %d lindex %d "
"nPositionLow %d cbRequested %d", streamId, lindex,
nPositionLow, cbRequested));
g_snprintf(full_fn, 255, "%s/%s", cfi->pathname, cfi->filename);
fd = g_file_open_ex(full_fn, 1, 0, 0, 0);
if (fd == -1)
{
LLOGLN(0, ("clipboard_send_file_data: file open [%s] failed",
full_fn));
return 1;
}
g_file_seek(fd, nPositionLow);
make_stream(s);
init_stream(s, cbRequested + 64);
size = g_file_read(fd, s->data + 12, cbRequested);
if (size < 1)
{
LLOGLN(0, ("clipboard_send_file_data: read error, want %d got %d",
cbRequested, size));
free_stream(s);
g_file_close(fd);
return 1;
}
out_uint16_le(s, CB_FILECONTENTS_RESPONSE); /* 9 */
out_uint16_le(s, CB_RESPONSE_OK); /* 1 status */
out_uint32_le(s, size + 4);
out_uint32_le(s, streamId);
s->p += size;
out_uint32_le(s, 0);
s_mark_end(s);
size = (int)(s->end - s->data);
rv = send_channel_data(g_cliprdr_chan_id, s->data, size);
free_stream(s);
g_file_close(fd);
return rv;
}