freerdp_thread* thread;
- uint8* buffer;
+ BYTE* buffer;
int buffer_frames;
AudinReceive receive;
return TRUE;
}
-static BOOL audin_alsa_thread_receive(AudinALSADevice* alsa, uint8* src, int size)
+static BOOL audin_alsa_thread_receive(AudinALSADevice* alsa, BYTE* src, int size)
{
int frames;
int cframes;
int ret = 0;
int encoded_size;
- uint8* encoded_data;
+ BYTE* encoded_data;
int rbytes_per_frame;
int tbytes_per_frame;
static void* audin_alsa_thread_func(void* arg)
{
int error;
- uint8* buffer;
+ BYTE* buffer;
int rbytes_per_frame;
int tbytes_per_frame;
snd_pcm_t* capture_handle = NULL;
rbytes_per_frame = alsa->actual_channels * alsa->bytes_per_channel;
tbytes_per_frame = alsa->target_channels * alsa->bytes_per_channel;
- alsa->buffer = (uint8*) xzalloc(tbytes_per_frame * alsa->frames_per_packet);
+ alsa->buffer = (BYTE*) xzalloc(tbytes_per_frame * alsa->frames_per_packet);
alsa->buffer_frames = 0;
- buffer = (uint8*) xzalloc(rbytes_per_frame * alsa->frames_per_packet);
+ buffer = (BYTE*) xzalloc(rbytes_per_frame * alsa->frames_per_packet);
freerdp_dsp_context_reset_adpcm(alsa->dsp_context);
do
{
AUDIN_LISTENER_CALLBACK* listener_callback;
/* Parsed plugin data */
- uint16 fixed_format;
- uint16 fixed_channel;
+ UINT16 fixed_format;
+ UINT16 fixed_channel;
uint32 fixed_rate;
/* Device interface */
DEBUG_DVC("Version=%d", Version);
out = stream_new(5);
- stream_write_uint8(out, MSG_SNDIN_VERSION);
+ stream_write_BYTE(out, MSG_SNDIN_VERSION);
stream_write_uint32(out, Version);
error = callback->channel->Write(callback->channel, stream_get_length(s), stream_get_head(s), NULL);
stream_free(out);
static int audin_send_incoming_data_pdu(IWTSVirtualChannelCallback* pChannelCallback)
{
- uint8 out_data[1];
+ BYTE out_data[1];
AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback;
out_data[0] = MSG_SNDIN_DATA_INCOMING;
AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback;
AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) callback->plugin;
uint32 i;
- uint8* fm;
+ BYTE* fm;
int error;
STREAM* out;
uint32 NumFormats;
for (i = 0; i < NumFormats; i++)
{
stream_get_mark(s, fm);
- stream_read_uint16(s, format.wFormatTag);
- stream_read_uint16(s, format.nChannels);
+ stream_read_UINT16(s, format.wFormatTag);
+ stream_read_UINT16(s, format.nChannels);
stream_read_uint32(s, format.nSamplesPerSec);
stream_seek_uint32(s); /* nAvgBytesPerSec */
- stream_read_uint16(s, format.nBlockAlign);
- stream_read_uint16(s, format.wBitsPerSample);
- stream_read_uint16(s, format.cbSize);
+ stream_read_UINT16(s, format.nBlockAlign);
+ stream_read_UINT16(s, format.wBitsPerSample);
+ stream_read_UINT16(s, format.cbSize);
format.data = stream_get_tail(s);
stream_seek(s, format.cbSize);
cbSizeFormatsPacket = stream_get_pos(out);
stream_set_pos(out, 0);
- stream_write_uint8(out, MSG_SNDIN_FORMATS); /* Header (1 byte) */
+ stream_write_BYTE(out, MSG_SNDIN_FORMATS); /* Header (1 byte) */
stream_write_uint32(out, callback->formats_count); /* NumFormats (4 bytes) */
stream_write_uint32(out, cbSizeFormatsPacket); /* cbSizeFormatsPacket (4 bytes) */
AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback;
out = stream_new(5);
- stream_write_uint8(out, MSG_SNDIN_FORMATCHANGE);
+ stream_write_BYTE(out, MSG_SNDIN_FORMATCHANGE);
stream_write_uint32(out, NewFormat);
error = callback->channel->Write(callback->channel, 5, stream_get_head(out), NULL);
stream_free(out);
AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback;
out = stream_new(5);
- stream_write_uint8(out, MSG_SNDIN_OPEN_REPLY);
+ stream_write_BYTE(out, MSG_SNDIN_OPEN_REPLY);
stream_write_uint32(out, Result);
error = callback->channel->Write(callback->channel, 5, stream_get_head(out), NULL);
stream_free(out);
return error;
}
-static BOOL audin_receive_wave_data(uint8* data, int size, void* user_data)
+static BOOL audin_receive_wave_data(BYTE* data, int size, void* user_data)
{
int error;
STREAM* out;
return FALSE;
out = stream_new(size + 1);
- stream_write_uint8(out, MSG_SNDIN_DATA);
+ stream_write_BYTE(out, MSG_SNDIN_DATA);
stream_write(out, data, size);
error = callback->channel->Write(callback->channel, stream_get_length(out), stream_get_head(out), NULL);
stream_free(out);
return 0;
}
-static int audin_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, uint32 cbSize, uint8* pBuffer)
+static int audin_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, uint32 cbSize, BYTE* pBuffer)
{
int error;
STREAM* s;
- uint8 MessageId;
+ BYTE MessageId;
s = stream_new(0);
stream_attach(s, pBuffer, cbSize);
- stream_read_uint8(s, MessageId);
+ stream_read_BYTE(s, MessageId);
DEBUG_DVC("MessageId=0x%x", MessageId);
}
static int audin_on_new_channel_connection(IWTSListenerCallback* pListenerCallback,
- IWTSVirtualChannel* pChannel, uint8* Data, int* pbAccept,
+ IWTSVirtualChannel* pChannel, BYTE* Data, int* pbAccept,
IWTSVirtualChannelCallback** ppCallback)
{
AUDIN_CHANNEL_CALLBACK* callback;
#define DEBUG_DVC(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
#endif
-typedef BOOL (*AudinReceive) (uint8* data, int size, void* user_data);
+typedef BOOL (*AudinReceive) (BYTE* data, int size, void* user_data);
typedef struct audin_format audinFormat;
struct audin_format
{
- uint16 wFormatTag;
- uint16 nChannels;
+ UINT16 wFormatTag;
+ UINT16 nChannels;
uint32 nSamplesPerSec;
- uint16 nBlockAlign;
- uint16 wBitsPerSample;
- uint16 cbSize;
- uint8* data;
+ UINT16 nBlockAlign;
+ UINT16 wBitsPerSample;
+ UINT16 cbSize;
+ BYTE* data;
};
typedef struct _IAudinDevice IAudinDevice;
FREERDP_DSP_CONTEXT* dsp_context;
int bytes_per_frame;
- uint8* buffer;
+ BYTE* buffer;
int buffer_frames;
AudinReceive receive;
int cframes;
BOOL ret;
const void* data;
- const uint8* src;
+ const BYTE* src;
int encoded_size;
- uint8* encoded_data;
+ BYTE* encoded_data;
AudinPulseDevice* pulse = (AudinPulseDevice*) userdata;
pa_stream_peek(stream, &data, &length);
DEBUG_DVC("length %d frames %d", (int) length, frames);
- src = (const uint8*) data;
+ src = (const BYTE*) data;
while (frames > 0)
{
cframes = pulse->frames_per_packet - pulse->buffer_frames;
static void audin_server_send_version(audin_server* audin, STREAM* s)
{
- stream_write_uint8(s, MSG_SNDIN_VERSION);
+ stream_write_BYTE(s, MSG_SNDIN_VERSION);
stream_write_uint32(s, 1); /* Version (4 bytes) */
WTSVirtualChannelWrite(audin->audin_channel, stream_get_head(s), stream_get_length(s), NULL);
}
uint32 nAvgBytesPerSec;
stream_set_pos(s, 0);
- stream_write_uint8(s, MSG_SNDIN_FORMATS);
+ stream_write_BYTE(s, MSG_SNDIN_FORMATS);
stream_write_uint32(s, audin->context.num_server_formats); /* NumFormats (4 bytes) */
stream_write_uint32(s, 0); /* cbSizeFormatsPacket (4 bytes), client-to-server only */
audin->context.server_formats[i].nChannels *
audin->context.server_formats[i].wBitsPerSample / 8;
stream_check_size(s, 18);
- stream_write_uint16(s, audin->context.server_formats[i].wFormatTag);
- stream_write_uint16(s, audin->context.server_formats[i].nChannels);
+ stream_write_UINT16(s, audin->context.server_formats[i].wFormatTag);
+ stream_write_UINT16(s, audin->context.server_formats[i].nChannels);
stream_write_uint32(s, audin->context.server_formats[i].nSamplesPerSec);
stream_write_uint32(s, nAvgBytesPerSec);
- stream_write_uint16(s, audin->context.server_formats[i].nBlockAlign);
- stream_write_uint16(s, audin->context.server_formats[i].wBitsPerSample);
- stream_write_uint16(s, audin->context.server_formats[i].cbSize);
+ stream_write_UINT16(s, audin->context.server_formats[i].nBlockAlign);
+ stream_write_UINT16(s, audin->context.server_formats[i].wBitsPerSample);
+ stream_write_UINT16(s, audin->context.server_formats[i].cbSize);
if (audin->context.server_formats[i].cbSize)
{
stream_check_size(s, audin->context.server_formats[i].cbSize);
return FALSE;
}
- stream_read_uint16(s, audin->context.client_formats[i].wFormatTag);
- stream_read_uint16(s, audin->context.client_formats[i].nChannels);
+ stream_read_UINT16(s, audin->context.client_formats[i].wFormatTag);
+ stream_read_UINT16(s, audin->context.client_formats[i].nChannels);
stream_read_uint32(s, audin->context.client_formats[i].nSamplesPerSec);
stream_seek_uint32(s); /* nAvgBytesPerSec */
- stream_read_uint16(s, audin->context.client_formats[i].nBlockAlign);
- stream_read_uint16(s, audin->context.client_formats[i].wBitsPerSample);
- stream_read_uint16(s, audin->context.client_formats[i].cbSize);
+ stream_read_UINT16(s, audin->context.client_formats[i].nBlockAlign);
+ stream_read_UINT16(s, audin->context.client_formats[i].wBitsPerSample);
+ stream_read_UINT16(s, audin->context.client_formats[i].cbSize);
if (audin->context.client_formats[i].cbSize > 0)
{
stream_seek(s, audin->context.client_formats[i].cbSize);
audin->opened = TRUE;
stream_set_pos(s, 0);
- stream_write_uint8(s, MSG_SNDIN_OPEN);
+ stream_write_BYTE(s, MSG_SNDIN_OPEN);
stream_write_uint32(s, audin->context.frames_per_packet); /* FramesPerPacket (4 bytes) */
stream_write_uint32(s, audin->context.selected_client_format); /* initialFormat (4 bytes) */
/*
* The second format specify the format that SHOULD be used to capture data from
* the actual audio input device.
*/
- stream_write_uint16(s, 1); /* wFormatTag = PCM */
- stream_write_uint16(s, 2); /* nChannels */
+ stream_write_UINT16(s, 1); /* wFormatTag = PCM */
+ stream_write_UINT16(s, 2); /* nChannels */
stream_write_uint32(s, 44100); /* nSamplesPerSec */
stream_write_uint32(s, 44100 * 2 * 2); /* nAvgBytesPerSec */
- stream_write_uint16(s, 4); /* nBlockAlign */
- stream_write_uint16(s, 16); /* wBitsPerSample */
- stream_write_uint16(s, 0); /* cbSize */
+ stream_write_UINT16(s, 4); /* nBlockAlign */
+ stream_write_UINT16(s, 16); /* wBitsPerSample */
+ stream_write_UINT16(s, 0); /* cbSize */
WTSVirtualChannelWrite(audin->audin_channel, stream_get_head(s), stream_get_length(s), NULL);
}
rdpsndFormat* format;
int sbytes_per_sample;
int sbytes_per_frame;
- uint8* src;
+ BYTE* src;
int size;
int frames;
void* fd;
STREAM* s;
void* buffer;
- uint8 MessageId;
+ BYTE MessageId;
BOOL ready = FALSE;
uint32 bytes_returned = 0;
audin_server* audin = (audin_server*) arg;
if (bytes_returned < 1)
continue;
- stream_read_uint8(s, MessageId);
+ stream_read_BYTE(s, MessageId);
bytes_returned--;
switch (MessageId)
{
cliprdr_packet_send(cliprdr, s);
}
-void cliprdr_process_short_format_names(cliprdrPlugin* cliprdr, STREAM* s, uint32 length, uint16 flags)
+void cliprdr_process_short_format_names(cliprdrPlugin* cliprdr, STREAM* s, uint32 length, UINT16 flags)
{
int i;
BOOL ascii;
}
}
-void cliprdr_process_long_format_names(cliprdrPlugin* cliprdr, STREAM* s, uint32 length, uint16 flags)
+void cliprdr_process_long_format_names(cliprdrPlugin* cliprdr, STREAM* s, uint32 length, UINT16 flags)
{
int allocated_formats = 8;
- uint8* end_mark;
+ BYTE* end_mark;
CLIPRDR_FORMAT_NAME* format_name;
stream_get_mark(s, end_mark);
while (stream_get_left(s) >= 6)
{
- uint8* p;
+ BYTE* p;
int name_len;
if (cliprdr->num_format_names >= allocated_formats)
}
}
-void cliprdr_process_format_list(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, uint16 msgFlags)
+void cliprdr_process_format_list(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, UINT16 msgFlags)
{
int i;
uint32 format;
if (dataLen > 0)
{
- cb_event->raw_format_data = (uint8*) malloc(dataLen);
+ cb_event->raw_format_data = (BYTE*) malloc(dataLen);
memcpy(cb_event->raw_format_data, stream_get_tail(s), dataLen);
cb_event->raw_format_data_size = dataLen;
}
cliprdr_send_format_list_response(cliprdr);
}
-void cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, uint16 msgFlags)
+void cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, UINT16 msgFlags)
{
/* where is this documented? */
#if 0
#endif
}
-void cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, uint16 msgFlags)
+void cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, UINT16 msgFlags)
{
RDP_CB_DATA_REQUEST_EVENT* cb_event;
cliprdr_packet_send(cliprdr, s);
}
-void cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, uint16 msgFlags)
+void cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, UINT16 msgFlags)
{
RDP_CB_DATA_RESPONSE_EVENT* cb_event;
if (dataLen > 0)
{
cb_event->size = dataLen;
- cb_event->data = (uint8*) malloc(dataLen);
+ cb_event->data = (BYTE*) malloc(dataLen);
memcpy(cb_event->data, stream_get_tail(s), dataLen);
}
#define __CLIPRDR_FORMAT_H
void cliprdr_process_format_list_event(cliprdrPlugin* cliprdr, RDP_CB_FORMAT_LIST_EVENT* cb_event);
-void cliprdr_process_format_list(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, uint16 msgFlags);
-void cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, uint16 msgFlags);
+void cliprdr_process_format_list(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, UINT16 msgFlags);
+void cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, UINT16 msgFlags);
-void cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, uint16 msgFlags);
+void cliprdr_process_format_data_request(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, UINT16 msgFlags);
void cliprdr_process_format_data_response_event(cliprdrPlugin* cliprdr, RDP_CB_DATA_RESPONSE_EVENT* cb_event);
void cliprdr_process_format_data_request_event(cliprdrPlugin* cliprdr, RDP_CB_DATA_REQUEST_EVENT* cb_event);
-void cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, uint16 msgFlags);
+void cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataLen, UINT16 msgFlags);
#endif /* __CLIPRDR_FORMAT_H */
"CB_UNLOCK_CLIPDATA"
};
-STREAM* cliprdr_packet_new(uint16 msgType, uint16 msgFlags, uint32 dataLen)
+STREAM* cliprdr_packet_new(UINT16 msgType, UINT16 msgFlags, uint32 dataLen)
{
STREAM* s;
s = stream_new(dataLen + 8);
- stream_write_uint16(s, msgType);
- stream_write_uint16(s, msgFlags);
+ stream_write_UINT16(s, msgType);
+ stream_write_UINT16(s, msgFlags);
/* Write actual length after the entire packet has been constructed. */
stream_seek(s, 4);
cliprdr->received_caps = TRUE;
}
-static void cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, STREAM* s, uint16 length, uint16 flags)
+static void cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, STREAM* s, UINT16 length, UINT16 flags)
{
int i;
- uint16 lengthCapability;
- uint16 cCapabilitiesSets;
- uint16 capabilitySetType;
+ UINT16 lengthCapability;
+ UINT16 cCapabilitiesSets;
+ UINT16 capabilitySetType;
- stream_read_uint16(s, cCapabilitiesSets); /* cCapabilitiesSets (2 bytes) */
- stream_seek_uint16(s); /* pad1 (2 bytes) */
+ stream_read_UINT16(s, cCapabilitiesSets); /* cCapabilitiesSets (2 bytes) */
+ stream_seek_UINT16(s); /* pad1 (2 bytes) */
DEBUG_CLIPRDR("cCapabilitiesSets %d", cCapabilitiesSets);
for (i = 0; i < cCapabilitiesSets; i++)
{
- stream_read_uint16(s, capabilitySetType); /* capabilitySetType (2 bytes) */
- stream_read_uint16(s, lengthCapability); /* lengthCapability (2 bytes) */
+ stream_read_UINT16(s, capabilitySetType); /* capabilitySetType (2 bytes) */
+ stream_read_UINT16(s, lengthCapability); /* lengthCapability (2 bytes) */
switch (capabilitySetType)
{
flags = CB_USE_LONG_FORMAT_NAMES;
- stream_write_uint16(s, 1); /* cCapabilitiesSets */
- stream_write_uint16(s, 0); /* pad1 */
- stream_write_uint16(s, CB_CAPSTYPE_GENERAL); /* capabilitySetType */
- stream_write_uint16(s, CB_CAPSTYPE_GENERAL_LEN); /* lengthCapability */
+ stream_write_UINT16(s, 1); /* cCapabilitiesSets */
+ stream_write_UINT16(s, 0); /* pad1 */
+ stream_write_UINT16(s, CB_CAPSTYPE_GENERAL); /* capabilitySetType */
+ stream_write_UINT16(s, CB_CAPSTYPE_GENERAL_LEN); /* lengthCapability */
stream_write_uint32(s, CB_CAPS_VERSION_2); /* version */
stream_write_uint32(s, flags); /* generalFlags */
cliprdr_packet_send(cliprdr, s);
}
-static void cliprdr_process_monitor_ready(cliprdrPlugin* cliprdr, STREAM* s, uint16 length, uint16 flags)
+static void cliprdr_process_monitor_ready(cliprdrPlugin* cliprdr, STREAM* s, UINT16 length, UINT16 flags)
{
RDP_EVENT* event;
static void cliprdr_process_receive(rdpSvcPlugin* plugin, STREAM* s)
{
- uint16 msgType;
- uint16 msgFlags;
+ UINT16 msgType;
+ UINT16 msgFlags;
uint32 dataLen;
cliprdrPlugin* cliprdr = (cliprdrPlugin*) plugin;
- stream_read_uint16(s, msgType);
- stream_read_uint16(s, msgFlags);
+ stream_read_UINT16(s, msgType);
+ stream_read_UINT16(s, msgFlags);
stream_read_uint32(s, dataLen);
DEBUG_CLIPRDR("msgType: %s (%d), msgFlags: %d dataLen: %d",
};
typedef struct cliprdr_plugin cliprdrPlugin;
-STREAM* cliprdr_packet_new(uint16 msgType, uint16 msgFlags, uint32 dataLen);
+STREAM* cliprdr_packet_new(UINT16 msgType, UINT16 msgFlags, uint32 dataLen);
void cliprdr_packet_send(cliprdrPlugin* cliprdr, STREAM* data_out);
#ifdef WITH_DEBUG_CLIPRDR
return TRUE;
}
-BOOL disk_file_read(DISK_FILE* file, uint8* buffer, uint32* Length)
+BOOL disk_file_read(DISK_FILE* file, BYTE* buffer, uint32* Length)
{
ssize_t r;
return TRUE;
}
-BOOL disk_file_write(DISK_FILE* file, uint8* buffer, uint32 Length)
+BOOL disk_file_write(DISK_FILE* file, BYTE* buffer, uint32 Length)
{
ssize_t r;
stream_write_uint64(output, st.st_size); /* AllocationSize */
stream_write_uint64(output, st.st_size); /* EndOfFile */
stream_write_uint32(output, st.st_nlink); /* NumberOfLinks */
- stream_write_uint8(output, file->delete_pending ? 1 : 0); /* DeletePending */
- stream_write_uint8(output, file->is_dir ? 1 : 0); /* Directory */
+ stream_write_BYTE(output, file->delete_pending ? 1 : 0); /* DeletePending */
+ stream_write_BYTE(output, file->is_dir ? 1 : 0); /* Directory */
/* Reserved(2), MUST NOT be added! */
break;
/* http://msdn.microsoft.com/en-us/library/cc232098.aspx */
/* http://msdn.microsoft.com/en-us/library/cc241371.aspx */
if (Length)
- stream_read_uint8(input, file->delete_pending);
+ stream_read_BYTE(input, file->delete_pending);
else
file->delete_pending = 1;
break;
case FileRenameInformation:
/* http://msdn.microsoft.com/en-us/library/cc232085.aspx */
- stream_seek_uint8(input); /* ReplaceIfExists */
- stream_seek_uint8(input); /* RootDirectory */
+ stream_seek_BYTE(input); /* ReplaceIfExists */
+ stream_seek_BYTE(input); /* RootDirectory */
stream_read_uint32(input, FileNameLength);
freerdp_UnicodeToAsciiAlloc((WCHAR*) stream_get_tail(input), &s, FileNameLength / 2);
return TRUE;
}
-BOOL disk_file_query_directory(DISK_FILE* file, uint32 FsInformationClass, uint8 InitialQuery,
+BOOL disk_file_query_directory(DISK_FILE* file, uint32 FsInformationClass, BYTE InitialQuery,
const char* path, STREAM* output)
{
int length;
if (!file->dir)
{
stream_write_uint32(output, 0); /* Length */
- stream_write_uint8(output, 0); /* Padding */
+ stream_write_BYTE(output, 0); /* Padding */
return FALSE;
}
{
DEBUG_SVC(" pattern %s not found.", file->pattern);
stream_write_uint32(output, 0); /* Length */
- stream_write_uint8(output, 0); /* Padding */
+ stream_write_BYTE(output, 0); /* Padding */
return FALSE;
}
stream_write_uint32(output, FILE_ATTR_SYSTEM_TO_RDP(file, st)); /* FileAttributes */
stream_write_uint32(output, length); /* FileNameLength */
stream_write_uint32(output, 0); /* EaSize */
- stream_write_uint8(output, 0); /* ShortNameLength */
+ stream_write_BYTE(output, 0); /* ShortNameLength */
/* Reserved(1), MUST NOT be added! */
stream_write_zero(output, 24); /* ShortName */
stream_write(output, ent_path, length);
default:
stream_write_uint32(output, 0); /* Length */
- stream_write_uint8(output, 0); /* Padding */
+ stream_write_BYTE(output, 0); /* Padding */
DEBUG_WARN("invalid FsInformationClass %d", FsInformationClass);
ret = FALSE;
break;
void disk_file_free(DISK_FILE* file);
BOOL disk_file_seek(DISK_FILE* file, uint64 Offset);
-BOOL disk_file_read(DISK_FILE* file, uint8* buffer, uint32* Length);
-BOOL disk_file_write(DISK_FILE* file, uint8* buffer, uint32 Length);
+BOOL disk_file_read(DISK_FILE* file, BYTE* buffer, uint32* Length);
+BOOL disk_file_write(DISK_FILE* file, BYTE* buffer, uint32 Length);
BOOL disk_file_query_information(DISK_FILE* file, uint32 FsInformationClass, STREAM* output);
BOOL disk_file_set_information(DISK_FILE* file, uint32 FsInformationClass, uint32 Length, STREAM* input);
-BOOL disk_file_query_directory(DISK_FILE* file, uint32 FsInformationClass, uint8 InitialQuery,
+BOOL disk_file_query_directory(DISK_FILE* file, uint32 FsInformationClass, BYTE InitialQuery,
const char* path, STREAM* output);
#endif /* __DISK_FILE_H */
char* path;
uint32 FileId;
DISK_FILE* file;
- uint8 Information;
+ BYTE Information;
uint32 DesiredAccess;
uint32 CreateDisposition;
uint32 CreateOptions;
}
stream_write_uint32(irp->output, FileId);
- stream_write_uint8(irp->output, Information);
+ stream_write_BYTE(irp->output, Information);
free(path);
DISK_FILE* file;
uint32 Length;
uint64 Offset;
- uint8* buffer = NULL;
+ BYTE* buffer = NULL;
stream_read_uint32(irp->input, Length);
stream_read_uint64(irp->input, Offset);
}
else
{
- buffer = (uint8*) malloc(Length);
+ buffer = (BYTE*) malloc(Length);
if (!disk_file_read(file, buffer, &Length))
{
irp->IoStatus = STATUS_UNSUCCESSFUL;
}
stream_write_uint32(irp->output, Length);
- stream_write_uint8(irp->output, 0); /* Padding */
+ stream_write_BYTE(irp->output, 0); /* Padding */
irp->Complete(irp);
}
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_ctime)); /* VolumeCreationTime */
stream_write_uint32(output, svfst.f_fsid); /* VolumeSerialNumber */
stream_write_uint32(output, length); /* VolumeLabelLength */
- stream_write_uint8(output, 0); /* SupportsObjects */
+ stream_write_BYTE(output, 0); /* SupportsObjects */
/* Reserved(1), MUST NOT be added! */
stream_write(output, outStr, length); /* VolumeLabel (Unicode) */
free(outStr);
{
char* path;
DISK_FILE* file;
- uint8 InitialQuery;
+ BYTE InitialQuery;
uint32 PathLength;
uint32 FsInformationClass;
stream_read_uint32(irp->input, FsInformationClass);
- stream_read_uint8(irp->input, InitialQuery);
+ stream_read_BYTE(irp->input, InitialQuery);
stream_read_uint32(irp->input, PathLength);
stream_seek(irp->input, 23); /* Padding */
disk->device.data = stream_new(length + 1);
for (i = 0; i <= length; i++)
- stream_write_uint8(disk->device.data, name[i] < 0 ? '_' : name[i]);
+ stream_write_BYTE(disk->device.data, name[i] < 0 ? '_' : name[i]);
disk->path = path;
disk->files = list_new();
if (val <= 0xFF)
{
cb = 0;
- stream_write_uint8(stream, val);
+ stream_write_BYTE(stream, val);
}
else if (val <= 0xFFFF)
{
cb = 1;
- stream_write_uint16(stream, val);
+ stream_write_UINT16(stream, val);
}
else
{
return cb;
}
-int drdynvc_write_data(drdynvcPlugin* drdynvc, uint32 ChannelId, uint8* data, uint32 data_size)
+int drdynvc_write_data(drdynvcPlugin* drdynvc, uint32 ChannelId, BYTE* data, uint32 data_size)
{
STREAM* data_out;
uint32 pos = 0;
{
pos = stream_get_pos(data_out);
stream_set_pos(data_out, 0);
- stream_write_uint8(data_out, 0x40 | cbChId);
+ stream_write_BYTE(data_out, 0x40 | cbChId);
stream_set_pos(data_out, pos);
error = svc_plugin_send((rdpSvcPlugin*)drdynvc, data_out);
}
{
pos = stream_get_pos(data_out);
stream_set_pos(data_out, 0);
- stream_write_uint8(data_out, 0x30 | cbChId);
+ stream_write_BYTE(data_out, 0x30 | cbChId);
stream_set_pos(data_out, pos);
stream_write(data_out, data, data_size);
error = svc_plugin_send((rdpSvcPlugin*)drdynvc, data_out);
cbLen = drdynvc_write_variable_uint(data_out, data_size);
pos = stream_get_pos(data_out);
stream_set_pos(data_out, 0);
- stream_write_uint8(data_out, 0x20 | cbChId | (cbLen << 2));
+ stream_write_BYTE(data_out, 0x20 | cbChId | (cbLen << 2));
stream_set_pos(data_out, pos);
chunk_len = CHANNEL_CHUNK_LENGTH - pos;
stream_write(data_out, data, chunk_len);
pos = stream_get_pos(data_out);
stream_set_pos(data_out, 0);
- stream_write_uint8(data_out, 0x30 | cbChId);
+ stream_write_BYTE(data_out, 0x30 | cbChId);
stream_set_pos(data_out, pos);
chunk_len = data_size;
DEBUG_DVC("Sp=%d cbChId=%d", Sp, cbChId);
stream_seek(s, 1); /* pad */
- stream_read_uint16(s, drdynvc->version);
+ stream_read_UINT16(s, drdynvc->version);
if (drdynvc->version == 2)
{
- stream_read_uint16(s, drdynvc->PriorityCharge0);
- stream_read_uint16(s, drdynvc->PriorityCharge1);
- stream_read_uint16(s, drdynvc->PriorityCharge2);
- stream_read_uint16(s, drdynvc->PriorityCharge3);
+ stream_read_UINT16(s, drdynvc->PriorityCharge0);
+ stream_read_UINT16(s, drdynvc->PriorityCharge1);
+ stream_read_UINT16(s, drdynvc->PriorityCharge2);
+ stream_read_UINT16(s, drdynvc->PriorityCharge3);
}
data_out = stream_new(4);
- stream_write_uint16(data_out, 0x0050); /* Cmd+Sp+cbChId+Pad. Note: MSTSC sends 0x005c */
- stream_write_uint16(data_out, drdynvc->version);
+ stream_write_UINT16(data_out, 0x0050); /* Cmd+Sp+cbChId+Pad. Note: MSTSC sends 0x005c */
+ stream_write_UINT16(data_out, drdynvc->version);
error = svc_plugin_send((rdpSvcPlugin*)drdynvc, data_out);
if (error != CHANNEL_RC_OK)
{
switch (cbLen)
{
case 0:
- stream_read_uint8(stream, val);
+ stream_read_BYTE(stream, val);
break;
case 1:
- stream_read_uint16(stream, val);
+ stream_read_UINT16(stream, val);
break;
default:
stream_read_uint32(stream, val);
error = dvcman_create_channel(drdynvc->channel_mgr, ChannelId, (char*)stream_get_tail(s));
data_out = stream_new(pos + 4);
- stream_write_uint8(data_out, 0x10 | cbChId);
+ stream_write_BYTE(data_out, 0x10 | cbChId);
stream_set_pos(s, 1);
stream_copy(data_out, s, pos - 1);
int Sp;
int cbChId;
- stream_read_uint8(s, value);
+ stream_read_BYTE(s, value);
Cmd = (value & 0xf0) >> 4;
Sp = (value & 0x0c) >> 2;
cbChId = (value & 0x03) >> 0;
typedef struct drdynvc_plugin drdynvcPlugin;
-int drdynvc_write_data(drdynvcPlugin* plugin, uint32 ChannelId, uint8* data, uint32 data_size);
+int drdynvc_write_data(drdynvcPlugin* plugin, uint32 ChannelId, BYTE* data, uint32 data_size);
int drdynvc_push_event(drdynvcPlugin* plugin, RDP_EVENT* event);
#endif
pDVCPluginEntry((IDRDYNVC_ENTRY_POINTS*) &entryPoints);
}
- data = (RDP_PLUGIN_DATA*)(((uint8*) data) + data->size);
+ data = (RDP_PLUGIN_DATA*)(((BYTE*) data) + data->size);
}
return 0;
return 0;
}
-static int dvcman_write_channel(IWTSVirtualChannel* pChannel, uint32 cbSize, uint8* pBuffer, void* pReserved)
+static int dvcman_write_channel(IWTSVirtualChannel* pChannel, uint32 cbSize, BYTE* pBuffer, void* pReserved)
{
int status;
DVCMAN_CHANNEL* channel = (DVCMAN_CHANNEL*) pChannel;
return 0;
}
-int dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, uint32 ChannelId, uint8* data, uint32 data_size)
+int dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, uint32 ChannelId, BYTE* data, uint32 data_size)
{
int error = 0;
DVCMAN_CHANNEL* channel;
int dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, uint32 ChannelId, const char* ChannelName);
int dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, uint32 ChannelId);
int dvcman_receive_channel_data_first(IWTSVirtualChannelManager* pChannelMgr, uint32 ChannelId, uint32 length);
-int dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, uint32 ChannelId, uint8* data, uint32 data_size);
+int dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, uint32 ChannelId, BYTE* data, uint32 data_size);
#endif
}
stream_write_uint32(irp->output, parallel->id);
- stream_write_uint8(irp->output, 0);
+ stream_write_BYTE(irp->output, 0);
free(path);
uint32 Length;
uint64 Offset;
ssize_t status;
- uint8* buffer = NULL;
+ BYTE* buffer = NULL;
stream_read_uint32(irp->input, Length);
stream_read_uint64(irp->input, Offset);
- buffer = (uint8*) malloc(Length);
+ buffer = (BYTE*) malloc(Length);
status = read(parallel->file, irp->output->p, Length);
}
stream_write_uint32(irp->output, Length);
- stream_write_uint8(irp->output, 0); /* Padding */
+ stream_write_BYTE(irp->output, 0); /* Padding */
irp->Complete(irp);
}
parallel->device.data = stream_new(length + 1);
for (i = 0; i <= length; i++)
- stream_write_uint8(parallel->device.data, name[i] < 0 ? '_' : name[i]);
+ stream_write_BYTE(parallel->device.data, name[i] < 0 ? '_' : name[i]);
parallel->path = path;
t->tm_hour, t->tm_min, t->tm_sec);
}
-static void printer_cups_write_printjob(rdpPrintJob* printjob, uint8* data, int size)
+static void printer_cups_write_printjob(rdpPrintJob* printjob, BYTE* data, int size)
{
rdpCupsPrintJob* cups_printjob = (rdpCupsPrintJob*)printjob;
}
stream_write_uint32(irp->output, Length);
- stream_write_uint8(irp->output, 0); /* Padding */
+ stream_write_BYTE(irp->output, 0); /* Padding */
irp->Complete(irp);
}
int PrintNameLen;
WCHAR* PrintName;
uint32 CachedFieldsLen;
- uint8* CachedPrinterConfigData;
+ BYTE* CachedPrinterConfigData;
PRINTER_DEVICE* printer_dev;
port = malloc(10);
stream_write_uint32(printer_dev->device.data, PrintNameLen + 2);
stream_write_uint32(printer_dev->device.data, CachedFieldsLen);
stream_write(printer_dev->device.data, DriverName, DriverNameLen);
- stream_write_uint16(printer_dev->device.data, 0);
+ stream_write_UINT16(printer_dev->device.data, 0);
stream_write(printer_dev->device.data, PrintName, PrintNameLen);
- stream_write_uint16(printer_dev->device.data, 0);
+ stream_write_UINT16(printer_dev->device.data, 0);
if (CachedFieldsLen > 0)
{
pcFreePrinter Free;
};
-typedef void (*pcWritePrintJob) (rdpPrintJob* printjob, uint8* data, int size);
+typedef void (*pcWritePrintJob) (rdpPrintJob* printjob, BYTE* data, int size);
typedef void (*pcClosePrintJob) (rdpPrintJob* printjob);
struct rdp_print_job
}
-static void printer_win_write_printjob(rdpPrintJob* printjob, uint8* data, int size)
+static void printer_win_write_printjob(rdpPrintJob* printjob, BYTE* data, int size)
{
rdpWinPrintJob* win_printjob = (rdpWinPrintJob*)printjob;
}
}
-void rail_send_channel_event(void* rail_object, uint16 event_type, void* param)
+void rail_send_channel_event(void* rail_object, UINT16 event_type, void* param)
{
void * payload = NULL;
RDP_EVENT* out_event = NULL;
};
typedef struct rail_plugin railPlugin;
-void rail_send_channel_event(void* rail_object, uint16 event_type, void* param);
+void rail_send_channel_event(void* rail_object, UINT16 event_type, void* param);
void rail_send_channel_data(void* rail_object, void* data, size_t length);
#ifdef WITH_DEBUG_RAIL
length = freerdp_AsciiToUnicodeAlloc(string, &buffer, 0) * 2;
- unicode_string->string = (uint8*) buffer;
- unicode_string->length = (uint16) length;
+ unicode_string->string = (BYTE*) buffer;
+ unicode_string->length = (UINT16) length;
}
-void rail_read_pdu_header(STREAM* s, uint16* orderType, uint16* orderLength)
+void rail_read_pdu_header(STREAM* s, UINT16* orderType, UINT16* orderLength)
{
- stream_read_uint16(s, *orderType); /* orderType (2 bytes) */
- stream_read_uint16(s, *orderLength); /* orderLength (2 bytes) */
+ stream_read_UINT16(s, *orderType); /* orderType (2 bytes) */
+ stream_read_UINT16(s, *orderLength); /* orderLength (2 bytes) */
}
-void rail_write_pdu_header(STREAM* s, uint16 orderType, uint16 orderLength)
+void rail_write_pdu_header(STREAM* s, UINT16 orderType, UINT16 orderLength)
{
- stream_write_uint16(s, orderType); /* orderType (2 bytes) */
- stream_write_uint16(s, orderLength); /* orderLength (2 bytes) */
+ stream_write_UINT16(s, orderType); /* orderType (2 bytes) */
+ stream_write_UINT16(s, orderLength); /* orderLength (2 bytes) */
}
STREAM* rail_pdu_init(int length)
return s;
}
-void rail_send_pdu(rdpRailOrder* rail_order, STREAM* s, uint16 orderType)
+void rail_send_pdu(rdpRailOrder* rail_order, STREAM* s, UINT16 orderType)
{
- uint16 orderLength;
+ UINT16 orderLength;
orderLength = stream_get_length(s);
stream_set_pos(s, 0);
void rail_read_server_exec_result_order(STREAM* s, RAIL_EXEC_RESULT_ORDER* exec_result)
{
- stream_read_uint16(s, exec_result->flags); /* flags (2 bytes) */
- stream_read_uint16(s, exec_result->execResult); /* execResult (2 bytes) */
+ stream_read_UINT16(s, exec_result->flags); /* flags (2 bytes) */
+ stream_read_UINT16(s, exec_result->execResult); /* execResult (2 bytes) */
stream_read_uint32(s, exec_result->rawResult); /* rawResult (4 bytes) */
- stream_seek_uint16(s); /* padding (2 bytes) */
+ stream_seek_UINT16(s); /* padding (2 bytes) */
rail_read_unicode_string(s, &exec_result->exeOrFile); /* exeOrFile */
}
void rail_read_server_sysparam_order(STREAM* s, RAIL_SYSPARAM_ORDER* sysparam)
{
- uint8 body;
+ BYTE body;
stream_read_uint32(s, sysparam->param); /* systemParam (4 bytes) */
- stream_read_uint8(s, body); /* body (1 byte) */
+ stream_read_BYTE(s, body); /* body (1 byte) */
switch (sysparam->param)
{
void rail_read_server_minmaxinfo_order(STREAM* s, RAIL_MINMAXINFO_ORDER* minmaxinfo)
{
stream_read_uint32(s, minmaxinfo->windowId); /* windowId (4 bytes) */
- stream_read_uint16(s, minmaxinfo->maxWidth); /* maxWidth (2 bytes) */
- stream_read_uint16(s, minmaxinfo->maxHeight); /* maxHeight (2 bytes) */
- stream_read_uint16(s, minmaxinfo->maxPosX); /* maxPosX (2 bytes) */
- stream_read_uint16(s, minmaxinfo->maxPosY); /* maxPosY (2 bytes) */
- stream_read_uint16(s, minmaxinfo->minTrackWidth); /* minTrackWidth (2 bytes) */
- stream_read_uint16(s, minmaxinfo->minTrackHeight); /* minTrackHeight (2 bytes) */
- stream_read_uint16(s, minmaxinfo->maxTrackWidth); /* maxTrackWidth (2 bytes) */
- stream_read_uint16(s, minmaxinfo->maxTrackHeight); /* maxTrackHeight (2 bytes) */
+ stream_read_UINT16(s, minmaxinfo->maxWidth); /* maxWidth (2 bytes) */
+ stream_read_UINT16(s, minmaxinfo->maxHeight); /* maxHeight (2 bytes) */
+ stream_read_UINT16(s, minmaxinfo->maxPosX); /* maxPosX (2 bytes) */
+ stream_read_UINT16(s, minmaxinfo->maxPosY); /* maxPosY (2 bytes) */
+ stream_read_UINT16(s, minmaxinfo->minTrackWidth); /* minTrackWidth (2 bytes) */
+ stream_read_UINT16(s, minmaxinfo->minTrackHeight); /* minTrackHeight (2 bytes) */
+ stream_read_UINT16(s, minmaxinfo->maxTrackWidth); /* maxTrackWidth (2 bytes) */
+ stream_read_UINT16(s, minmaxinfo->maxTrackHeight); /* maxTrackHeight (2 bytes) */
}
void rail_read_server_localmovesize_order(STREAM* s, RAIL_LOCALMOVESIZE_ORDER* localmovesize)
{
- uint16 isMoveSizeStart;
+ UINT16 isMoveSizeStart;
stream_read_uint32(s, localmovesize->windowId); /* windowId (4 bytes) */
- stream_read_uint16(s, isMoveSizeStart); /* isMoveSizeStart (2 bytes) */
+ stream_read_UINT16(s, isMoveSizeStart); /* isMoveSizeStart (2 bytes) */
localmovesize->isMoveSizeStart = (isMoveSizeStart != 0) ? TRUE : FALSE;
- stream_read_uint16(s, localmovesize->moveSizeType); /* moveSizeType (2 bytes) */
- stream_read_uint16(s, localmovesize->posX); /* posX (2 bytes) */
- stream_read_uint16(s, localmovesize->posY); /* posY (2 bytes) */
+ stream_read_UINT16(s, localmovesize->moveSizeType); /* moveSizeType (2 bytes) */
+ stream_read_UINT16(s, localmovesize->posX); /* posX (2 bytes) */
+ stream_read_UINT16(s, localmovesize->posY); /* posY (2 bytes) */
}
void rail_read_server_get_appid_resp_order(STREAM* s, RAIL_GET_APPID_RESP_ORDER* get_appid_resp)
void rail_write_client_exec_order(STREAM* s, RAIL_EXEC_ORDER* exec)
{
- stream_write_uint16(s, exec->flags); /* flags (2 bytes) */
- stream_write_uint16(s, exec->exeOrFile.length); /* exeOrFileLength (2 bytes) */
- stream_write_uint16(s, exec->workingDir.length); /* workingDirLength (2 bytes) */
- stream_write_uint16(s, exec->arguments.length); /* argumentsLength (2 bytes) */
+ stream_write_UINT16(s, exec->flags); /* flags (2 bytes) */
+ stream_write_UINT16(s, exec->exeOrFile.length); /* exeOrFileLength (2 bytes) */
+ stream_write_UINT16(s, exec->workingDir.length); /* workingDirLength (2 bytes) */
+ stream_write_UINT16(s, exec->arguments.length); /* argumentsLength (2 bytes) */
rail_write_unicode_string_value(s, &exec->exeOrFile); /* exeOrFile */
rail_write_unicode_string_value(s, &exec->workingDir); /* workingDir */
rail_write_unicode_string_value(s, &exec->arguments); /* arguments */
void rail_write_client_sysparam_order(STREAM* s, RAIL_SYSPARAM_ORDER* sysparam)
{
- uint8 body;
+ BYTE body;
stream_write_uint32(s, sysparam->param); /* systemParam (4 bytes) */
switch (sysparam->param)
{
case SPI_SET_DRAG_FULL_WINDOWS:
body = sysparam->dragFullWindows;
- stream_write_uint8(s, body);
+ stream_write_BYTE(s, body);
break;
case SPI_SET_KEYBOARD_CUES:
body = sysparam->keyboardCues;
- stream_write_uint8(s, body);
+ stream_write_BYTE(s, body);
break;
case SPI_SET_KEYBOARD_PREF:
body = sysparam->keyboardPref;
- stream_write_uint8(s, body);
+ stream_write_BYTE(s, body);
break;
case SPI_SET_MOUSE_BUTTON_SWAP:
body = sysparam->mouseButtonSwap;
- stream_write_uint8(s, body);
+ stream_write_BYTE(s, body);
break;
case SPI_SET_WORK_AREA:
- stream_write_uint16(s, sysparam->workArea.left); /* left (2 bytes) */
- stream_write_uint16(s, sysparam->workArea.top); /* top (2 bytes) */
- stream_write_uint16(s, sysparam->workArea.right); /* right (2 bytes) */
- stream_write_uint16(s, sysparam->workArea.bottom); /* bottom (2 bytes) */
+ stream_write_UINT16(s, sysparam->workArea.left); /* left (2 bytes) */
+ stream_write_UINT16(s, sysparam->workArea.top); /* top (2 bytes) */
+ stream_write_UINT16(s, sysparam->workArea.right); /* right (2 bytes) */
+ stream_write_UINT16(s, sysparam->workArea.bottom); /* bottom (2 bytes) */
break;
case SPI_DISPLAY_CHANGE:
- stream_write_uint16(s, sysparam->displayChange.left); /* left (2 bytes) */
- stream_write_uint16(s, sysparam->displayChange.top); /* top (2 bytes) */
- stream_write_uint16(s, sysparam->displayChange.right); /* right (2 bytes) */
- stream_write_uint16(s, sysparam->displayChange.bottom); /* bottom (2 bytes) */
+ stream_write_UINT16(s, sysparam->displayChange.left); /* left (2 bytes) */
+ stream_write_UINT16(s, sysparam->displayChange.top); /* top (2 bytes) */
+ stream_write_UINT16(s, sysparam->displayChange.right); /* right (2 bytes) */
+ stream_write_UINT16(s, sysparam->displayChange.bottom); /* bottom (2 bytes) */
break;
case SPI_TASKBAR_POS:
- stream_write_uint16(s, sysparam->taskbarPos.left); /* left (2 bytes) */
- stream_write_uint16(s, sysparam->taskbarPos.top); /* top (2 bytes) */
- stream_write_uint16(s, sysparam->taskbarPos.right); /* right (2 bytes) */
- stream_write_uint16(s, sysparam->taskbarPos.bottom); /* bottom (2 bytes) */
+ stream_write_UINT16(s, sysparam->taskbarPos.left); /* left (2 bytes) */
+ stream_write_UINT16(s, sysparam->taskbarPos.top); /* top (2 bytes) */
+ stream_write_UINT16(s, sysparam->taskbarPos.right); /* right (2 bytes) */
+ stream_write_UINT16(s, sysparam->taskbarPos.bottom); /* bottom (2 bytes) */
break;
case SPI_SET_HIGH_CONTRAST:
void rail_write_client_activate_order(STREAM* s, RAIL_ACTIVATE_ORDER* activate)
{
- uint8 enabled;
+ BYTE enabled;
stream_write_uint32(s, activate->windowId); /* windowId (4 bytes) */
enabled = activate->enabled;
- stream_write_uint8(s, enabled); /* enabled (1 byte) */
+ stream_write_BYTE(s, enabled); /* enabled (1 byte) */
}
void rail_write_client_sysmenu_order(STREAM* s, RAIL_SYSMENU_ORDER* sysmenu)
{
stream_write_uint32(s, sysmenu->windowId); /* windowId (4 bytes) */
- stream_write_uint16(s, sysmenu->left); /* left (2 bytes) */
- stream_write_uint16(s, sysmenu->top); /* top (2 bytes) */
+ stream_write_UINT16(s, sysmenu->left); /* left (2 bytes) */
+ stream_write_UINT16(s, sysmenu->top); /* top (2 bytes) */
}
void rail_write_client_syscommand_order(STREAM* s, RAIL_SYSCOMMAND_ORDER* syscommand)
{
stream_write_uint32(s, syscommand->windowId); /* windowId (4 bytes) */
- stream_write_uint16(s, syscommand->command); /* command (2 bytes) */
+ stream_write_UINT16(s, syscommand->command); /* command (2 bytes) */
}
void rail_write_client_notify_event_order(STREAM* s, RAIL_NOTIFY_EVENT_ORDER* notify_event)
void rail_write_client_window_move_order(STREAM* s, RAIL_WINDOW_MOVE_ORDER* window_move)
{
stream_write_uint32(s, window_move->windowId); /* windowId (4 bytes) */
- stream_write_uint16(s, window_move->left); /* left (2 bytes) */
- stream_write_uint16(s, window_move->top); /* top (2 bytes) */
- stream_write_uint16(s, window_move->right); /* right (2 bytes) */
- stream_write_uint16(s, window_move->bottom); /* bottom (2 bytes) */
+ stream_write_UINT16(s, window_move->left); /* left (2 bytes) */
+ stream_write_UINT16(s, window_move->top); /* top (2 bytes) */
+ stream_write_UINT16(s, window_move->right); /* right (2 bytes) */
+ stream_write_UINT16(s, window_move->bottom); /* bottom (2 bytes) */
}
void rail_write_client_get_appid_req_order(STREAM* s, RAIL_GET_APPID_REQ_ORDER* get_appid_req)
void rail_order_recv(rdpRailOrder* rail_order, STREAM* s)
{
- uint16 orderType;
- uint16 orderLength;
+ UINT16 orderType;
+ UINT16 orderLength;
rail_read_pdu_header(s, &orderType, &orderLength);
irp->input = data_in;
irp->output = stream_new(256);
- stream_write_uint16(irp->output, RDPDR_CTYP_CORE);
- stream_write_uint16(irp->output, PAKID_CORE_DEVICE_IOCOMPLETION);
+ stream_write_UINT16(irp->output, RDPDR_CTYP_CORE);
+ stream_write_UINT16(irp->output, PAKID_CORE_DEVICE_IOCOMPLETION);
stream_write_uint32(irp->output, DeviceId);
stream_write_uint32(irp->output, irp->CompletionId);
stream_seek_uint32(irp->output); /* IoStatus */
#include "rdpdr_capabilities.h"
/* Output device redirection capability set header */
-static void rdpdr_write_capset_header(STREAM* data_out, uint16 capabilityType, uint16 capabilityLength, uint32 version)
+static void rdpdr_write_capset_header(STREAM* data_out, UINT16 capabilityType, UINT16 capabilityLength, uint32 version)
{
- stream_write_uint16(data_out, capabilityType);
- stream_write_uint16(data_out, capabilityLength);
+ stream_write_UINT16(data_out, capabilityType);
+ stream_write_UINT16(data_out, capabilityLength);
stream_write_uint32(data_out, version);
}
stream_write_uint32(data_out, 0); /* osType, ignored on receipt */
stream_write_uint32(data_out, 0); /* osVersion, unused and must be set to zero */
- stream_write_uint16(data_out, 1); /* protocolMajorVersion, must be set to 1 */
- stream_write_uint16(data_out, RDPDR_MINOR_RDP_VERSION_5_2); /* protocolMinorVersion */
+ stream_write_UINT16(data_out, 1); /* protocolMajorVersion, must be set to 1 */
+ stream_write_UINT16(data_out, RDPDR_MINOR_RDP_VERSION_5_2); /* protocolMinorVersion */
stream_write_uint32(data_out, 0x0000FFFF); /* ioCode1 */
stream_write_uint32(data_out, 0); /* ioCode2, must be set to zero, reserved for future use */
stream_write_uint32(data_out, RDPDR_DEVICE_REMOVE_PDUS | RDPDR_CLIENT_DISPLAY_NAME_PDU | RDPDR_USER_LOGGEDON_PDU); /* extendedPDU */
/* Process device direction general capability set */
static void rdpdr_process_general_capset(rdpdrPlugin* rdpdr, STREAM* data_in)
{
- uint16 capabilityLength;
+ UINT16 capabilityLength;
- stream_read_uint16(data_in, capabilityLength);
+ stream_read_UINT16(data_in, capabilityLength);
stream_seek(data_in, capabilityLength - 4);
}
/* Process printer direction capability set */
static void rdpdr_process_printer_capset(rdpdrPlugin* rdpdr, STREAM* data_in)
{
- uint16 capabilityLength;
+ UINT16 capabilityLength;
- stream_read_uint16(data_in, capabilityLength);
+ stream_read_UINT16(data_in, capabilityLength);
stream_seek(data_in, capabilityLength - 4);
}
/* Process port redirection capability set */
static void rdpdr_process_port_capset(rdpdrPlugin* rdpdr, STREAM* data_in)
{
- uint16 capabilityLength;
+ UINT16 capabilityLength;
- stream_read_uint16(data_in, capabilityLength);
+ stream_read_UINT16(data_in, capabilityLength);
stream_seek(data_in, capabilityLength - 4);
}
/* Process drive redirection capability set */
static void rdpdr_process_drive_capset(rdpdrPlugin* rdpdr, STREAM* data_in)
{
- uint16 capabilityLength;
+ UINT16 capabilityLength;
- stream_read_uint16(data_in, capabilityLength);
+ stream_read_UINT16(data_in, capabilityLength);
stream_seek(data_in, capabilityLength - 4);
}
/* Process smartcard redirection capability set */
static void rdpdr_process_smartcard_capset(rdpdrPlugin* rdpdr, STREAM* data_in)
{
- uint16 capabilityLength;
+ UINT16 capabilityLength;
- stream_read_uint16(data_in, capabilityLength);
+ stream_read_UINT16(data_in, capabilityLength);
stream_seek(data_in, capabilityLength - 4);
}
void rdpdr_process_capability_request(rdpdrPlugin* rdpdr, STREAM* data_in)
{
- uint16 i;
- uint16 numCapabilities;
- uint16 capabilityType;
+ UINT16 i;
+ UINT16 numCapabilities;
+ UINT16 capabilityType;
- stream_read_uint16(data_in, numCapabilities);
+ stream_read_UINT16(data_in, numCapabilities);
stream_seek(data_in, 2); /* pad (2 bytes) */
for(i = 0; i < numCapabilities; i++)
{
- stream_read_uint16(data_in, capabilityType);
+ stream_read_UINT16(data_in, capabilityType);
switch (capabilityType)
{
data_out = stream_new(256);
- stream_write_uint16(data_out, RDPDR_CTYP_CORE);
- stream_write_uint16(data_out, PAKID_CORE_CLIENT_CAPABILITY);
+ stream_write_UINT16(data_out, RDPDR_CTYP_CORE);
+ stream_write_UINT16(data_out, PAKID_CORE_CLIENT_CAPABILITY);
- stream_write_uint16(data_out, 5); /* numCapabilities */
- stream_write_uint16(data_out, 0); /* pad */
+ stream_write_UINT16(data_out, 5); /* numCapabilities */
+ stream_write_UINT16(data_out, 0); /* pad */
rdpdr_write_general_capset(rdpdr, data_out);
rdpdr_write_printer_capset(rdpdr, data_out);
devman_load_device_service(rdpdr->devman, data);
}
- data = (RDP_PLUGIN_DATA*) (((uint8*) data) + data->size);
+ data = (RDP_PLUGIN_DATA*) (((BYTE*) data) + data->size);
}
}
static void rdpdr_process_server_announce_request(rdpdrPlugin* rdpdr, STREAM* data_in)
{
- stream_read_uint16(data_in, rdpdr->versionMajor);
- stream_read_uint16(data_in, rdpdr->versionMinor);
+ stream_read_UINT16(data_in, rdpdr->versionMajor);
+ stream_read_UINT16(data_in, rdpdr->versionMinor);
stream_read_uint32(data_in, rdpdr->clientID);
DEBUG_SVC("version %d.%d clientID %d", rdpdr->versionMajor, rdpdr->versionMinor, rdpdr->clientID);
data_out = stream_new(12);
- stream_write_uint16(data_out, RDPDR_CTYP_CORE);
- stream_write_uint16(data_out, PAKID_CORE_CLIENTID_CONFIRM);
+ stream_write_UINT16(data_out, RDPDR_CTYP_CORE);
+ stream_write_UINT16(data_out, PAKID_CORE_CLIENTID_CONFIRM);
- stream_write_uint16(data_out, rdpdr->versionMajor);
- stream_write_uint16(data_out, rdpdr->versionMinor);
+ stream_write_UINT16(data_out, rdpdr->versionMajor);
+ stream_write_UINT16(data_out, rdpdr->versionMinor);
stream_write_uint32(data_out, (uint32) rdpdr->clientID);
svc_plugin_send((rdpSvcPlugin*) rdpdr, data_out);
data_out = stream_new(16 + computerNameLenW + 2);
- stream_write_uint16(data_out, RDPDR_CTYP_CORE);
- stream_write_uint16(data_out, PAKID_CORE_CLIENT_NAME);
+ stream_write_UINT16(data_out, RDPDR_CTYP_CORE);
+ stream_write_UINT16(data_out, PAKID_CORE_CLIENT_NAME);
stream_write_uint32(data_out, 1); /* unicodeFlag, 0 for ASCII and 1 for Unicode */
stream_write_uint32(data_out, 0); /* codePage, must be set to zero */
stream_write_uint32(data_out, computerNameLenW + 2); /* computerNameLen, including null terminator */
stream_write(data_out, computerNameW, computerNameLenW);
- stream_write_uint16(data_out, 0); /* null terminator */
+ stream_write_UINT16(data_out, 0); /* null terminator */
free(computerNameW);
static void rdpdr_process_server_clientid_confirm(rdpdrPlugin* rdpdr, STREAM* data_in)
{
- uint16 versionMajor;
- uint16 versionMinor;
+ UINT16 versionMajor;
+ UINT16 versionMinor;
uint32 clientID;
- stream_read_uint16(data_in, versionMajor);
- stream_read_uint16(data_in, versionMinor);
+ stream_read_UINT16(data_in, versionMajor);
+ stream_read_UINT16(data_in, versionMinor);
stream_read_uint32(data_in, clientID);
if (versionMajor != rdpdr->versionMajor || versionMinor != rdpdr->versionMinor)
{
int i;
int pos;
- uint8 c;
+ BYTE c;
uint32 count;
int data_len;
int count_pos;
data_out = stream_new(256);
- stream_write_uint16(data_out, RDPDR_CTYP_CORE);
- stream_write_uint16(data_out, PAKID_CORE_DEVICELIST_ANNOUNCE);
+ stream_write_UINT16(data_out, RDPDR_CTYP_CORE);
+ stream_write_UINT16(data_out, PAKID_CORE_DEVICELIST_ANNOUNCE);
count_pos = stream_get_pos(data_out);
count = 0;
for (i = 0; i < 8; i++)
{
- stream_peek_uint8(data_out, c);
+ stream_peek_BYTE(data_out, c);
if (c > 0x7F)
- stream_write_uint8(data_out, '_');
+ stream_write_BYTE(data_out, '_');
else
- stream_seek_uint8(data_out);
+ stream_seek_BYTE(data_out);
}
stream_write_uint32(data_out, data_len);
static void rdpdr_process_receive(rdpSvcPlugin* plugin, STREAM* data_in)
{
- uint16 component;
- uint16 packetID;
+ UINT16 component;
+ UINT16 packetID;
uint32 deviceID;
uint32 status;
rdpdrPlugin* rdpdr = (rdpdrPlugin*) plugin;
- stream_read_uint16(data_in, component);
- stream_read_uint16(data_in, packetID);
+ stream_read_UINT16(data_in, component);
+ stream_read_UINT16(data_in, packetID);
if (component == RDPDR_CTYP_CORE)
{
DEVMAN* devman;
- uint16 versionMajor;
- uint16 versionMinor;
- uint16 clientID;
+ UINT16 versionMajor;
+ UINT16 versionMinor;
+ UINT16 clientID;
char computerName[256];
};
{
}
-static void rdpsnd_audio_play(rdpsndDevicePlugin* device, uint8* data, int size)
+static void rdpsnd_audio_play(rdpsndDevicePlugin* device, BYTE* data, int size)
{
rdpsndAudioQPlugin* aq_plugin_p = (rdpsndAudioQPlugin *) device;
AudioQueueBufferRef aq_buf_ref;
}
}
-static void rdpsnd_alsa_play(rdpsndDevicePlugin* device, uint8* data, int size)
+static void rdpsnd_alsa_play(rdpsndDevicePlugin* device, BYTE* data, int size)
{
- uint8* src;
+ BYTE* src;
int len;
int status;
int frames;
int rbytes_per_frame;
int sbytes_per_frame;
- uint8* pindex;
- uint8* end;
+ BYTE* pindex;
+ BYTE* end;
rdpsndAlsaPlugin* alsa = (rdpsndAlsaPlugin*) device;
if (alsa->out_handle == 0)
pa_threaded_mainloop_unlock(pulse->mainloop);
}
-static void rdpsnd_pulse_play(rdpsndDevicePlugin* device, uint8* data, int size)
+static void rdpsnd_pulse_play(rdpsndDevicePlugin* device, BYTE* data, int size)
{
int len;
int ret;
- uint8* src;
+ BYTE* src;
rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*) device;
if (!pulse->stream)
LIST* data_out_list;
- uint8 cBlockNo;
+ BYTE cBlockNo;
rdpsndFormat* supported_formats;
int n_supported_formats;
int current_format;
BOOL expectingWave;
- uint8 waveData[4];
- uint16 waveDataSize;
+ BYTE waveData[4];
+ UINT16 waveDataSize;
uint32 wTimeStamp; /* server timestamp */
uint32 wave_timestamp; /* client timestamp */
BOOL is_open;
uint32 close_timestamp;
- uint16 fixed_format;
- uint16 fixed_channel;
+ UINT16 fixed_format;
+ UINT16 fixed_channel;
uint32 fixed_rate;
int latency;
static void rdpsnd_free_supported_formats(rdpsndPlugin* rdpsnd)
{
- uint16 i;
+ UINT16 i;
for (i = 0; i < rdpsnd->n_supported_formats; i++)
free(rdpsnd->supported_formats[i].data);
of client supported formats */
static void rdpsnd_process_message_formats(rdpsndPlugin* rdpsnd, STREAM* data_in)
{
- uint16 wNumberOfFormats;
- uint16 nFormat;
- uint16 wVersion;
+ UINT16 wNumberOfFormats;
+ UINT16 nFormat;
+ UINT16 wVersion;
STREAM* data_out;
rdpsndFormat* out_formats;
- uint16 n_out_formats;
+ UINT16 n_out_formats;
rdpsndFormat* format;
- uint8* format_mark;
- uint8* data_mark;
+ BYTE* format_mark;
+ BYTE* data_mark;
int pos;
rdpsnd_free_supported_formats(rdpsnd);
stream_seek_uint32(data_in); /* dwFlags */
stream_seek_uint32(data_in); /* dwVolume */
stream_seek_uint32(data_in); /* dwPitch */
- stream_seek_uint16(data_in); /* wDGramPort */
- stream_read_uint16(data_in, wNumberOfFormats);
- stream_read_uint8(data_in, rdpsnd->cBlockNo); /* cLastBlockConfirmed */
- stream_read_uint16(data_in, wVersion);
- stream_seek_uint8(data_in); /* bPad */
+ stream_seek_UINT16(data_in); /* wDGramPort */
+ stream_read_UINT16(data_in, wNumberOfFormats);
+ stream_read_BYTE(data_in, rdpsnd->cBlockNo); /* cLastBlockConfirmed */
+ stream_read_UINT16(data_in, wVersion);
+ stream_seek_BYTE(data_in); /* bPad */
DEBUG_SVC("wNumberOfFormats %d wVersion %d", wNumberOfFormats, wVersion);
if (wNumberOfFormats < 1)
n_out_formats = 0;
data_out = stream_new(24);
- stream_write_uint8(data_out, SNDC_FORMATS); /* msgType */
- stream_write_uint8(data_out, 0); /* bPad */
- stream_seek_uint16(data_out); /* BodySize */
+ stream_write_BYTE(data_out, SNDC_FORMATS); /* msgType */
+ stream_write_BYTE(data_out, 0); /* bPad */
+ stream_seek_UINT16(data_out); /* BodySize */
stream_write_uint32(data_out, TSSNDCAPS_ALIVE | TSSNDCAPS_VOLUME); /* dwFlags */
stream_write_uint32(data_out, 0xFFFFFFFF); /* dwVolume */
stream_write_uint32(data_out, 0); /* dwPitch */
- stream_write_uint16_be(data_out, 0); /* wDGramPort */
- stream_seek_uint16(data_out); /* wNumberOfFormats */
- stream_write_uint8(data_out, 0); /* cLastBlockConfirmed */
- stream_write_uint16(data_out, 6); /* wVersion */
- stream_write_uint8(data_out, 0); /* bPad */
+ stream_write_UINT16_be(data_out, 0); /* wDGramPort */
+ stream_seek_UINT16(data_out); /* wNumberOfFormats */
+ stream_write_BYTE(data_out, 0); /* cLastBlockConfirmed */
+ stream_write_UINT16(data_out, 6); /* wVersion */
+ stream_write_BYTE(data_out, 0); /* bPad */
for (nFormat = 0; nFormat < wNumberOfFormats; nFormat++)
{
stream_get_mark(data_in, format_mark);
format = &out_formats[n_out_formats];
- stream_read_uint16(data_in, format->wFormatTag);
- stream_read_uint16(data_in, format->nChannels);
+ stream_read_UINT16(data_in, format->wFormatTag);
+ stream_read_UINT16(data_in, format->nChannels);
stream_read_uint32(data_in, format->nSamplesPerSec);
stream_seek_uint32(data_in); /* nAvgBytesPerSec */
- stream_read_uint16(data_in, format->nBlockAlign);
- stream_read_uint16(data_in, format->wBitsPerSample);
- stream_read_uint16(data_in, format->cbSize);
+ stream_read_UINT16(data_in, format->nBlockAlign);
+ stream_read_UINT16(data_in, format->wBitsPerSample);
+ stream_read_UINT16(data_in, format->cbSize);
stream_get_mark(data_in, data_mark);
stream_seek(data_in, format->cbSize);
format->data = NULL;
pos = stream_get_pos(data_out);
stream_set_pos(data_out, 2);
- stream_write_uint16(data_out, pos - 4);
+ stream_write_UINT16(data_out, pos - 4);
stream_set_pos(data_out, 18);
- stream_write_uint16(data_out, n_out_formats);
+ stream_write_UINT16(data_out, n_out_formats);
stream_set_pos(data_out, pos);
svc_plugin_send((rdpSvcPlugin*)rdpsnd, data_out);
if (wVersion >= 6)
{
data_out = stream_new(8);
- stream_write_uint8(data_out, SNDC_QUALITYMODE); /* msgType */
- stream_write_uint8(data_out, 0); /* bPad */
- stream_write_uint16(data_out, 4); /* BodySize */
- stream_write_uint16(data_out, HIGH_QUALITY); /* wQualityMode */
- stream_write_uint16(data_out, 0); /* Reserved */
+ stream_write_BYTE(data_out, SNDC_QUALITYMODE); /* msgType */
+ stream_write_BYTE(data_out, 0); /* bPad */
+ stream_write_UINT16(data_out, 4); /* BodySize */
+ stream_write_UINT16(data_out, HIGH_QUALITY); /* wQualityMode */
+ stream_write_UINT16(data_out, 0); /* Reserved */
svc_plugin_send((rdpSvcPlugin*)rdpsnd, data_out);
}
/* server is getting a feel of the round trip time */
static void rdpsnd_process_message_training(rdpsndPlugin* rdpsnd, STREAM* data_in)
{
- uint16 wTimeStamp;
- uint16 wPackSize;
+ UINT16 wTimeStamp;
+ UINT16 wPackSize;
STREAM* data_out;
- stream_read_uint16(data_in, wTimeStamp);
- stream_read_uint16(data_in, wPackSize);
+ stream_read_UINT16(data_in, wTimeStamp);
+ stream_read_UINT16(data_in, wPackSize);
data_out = stream_new(8);
- stream_write_uint8(data_out, SNDC_TRAINING); /* msgType */
- stream_write_uint8(data_out, 0); /* bPad */
- stream_write_uint16(data_out, 4); /* BodySize */
- stream_write_uint16(data_out, wTimeStamp);
- stream_write_uint16(data_out, wPackSize);
+ stream_write_BYTE(data_out, SNDC_TRAINING); /* msgType */
+ stream_write_BYTE(data_out, 0); /* bPad */
+ stream_write_UINT16(data_out, 4); /* BodySize */
+ stream_write_UINT16(data_out, wTimeStamp);
+ stream_write_UINT16(data_out, wPackSize);
svc_plugin_send((rdpSvcPlugin*)rdpsnd, data_out);
}
-static void rdpsnd_process_message_wave_info(rdpsndPlugin* rdpsnd, STREAM* data_in, uint16 BodySize)
+static void rdpsnd_process_message_wave_info(rdpsndPlugin* rdpsnd, STREAM* data_in, UINT16 BodySize)
{
- uint16 wFormatNo;
+ UINT16 wFormatNo;
- stream_read_uint16(data_in, rdpsnd->wTimeStamp);
- stream_read_uint16(data_in, wFormatNo);
- stream_read_uint8(data_in, rdpsnd->cBlockNo);
+ stream_read_UINT16(data_in, rdpsnd->wTimeStamp);
+ stream_read_UINT16(data_in, wFormatNo);
+ stream_read_BYTE(data_in, rdpsnd->cBlockNo);
stream_seek(data_in, 3); /* bPad */
stream_read(data_in, rdpsnd->waveData, 4);
rdpsnd->waveDataSize = BodySize - 8;
/* header is not removed from data in this function */
static void rdpsnd_process_message_wave(rdpsndPlugin* rdpsnd, STREAM* data_in)
{
- uint16 wTimeStamp;
+ UINT16 wTimeStamp;
uint32 delay_ms;
uint32 process_ms;
struct data_out_item* item;
item = xnew(struct data_out_item);
item->data_out = stream_new(8);
- stream_write_uint8(item->data_out, SNDC_WAVECONFIRM);
- stream_write_uint8(item->data_out, 0);
- stream_write_uint16(item->data_out, 4);
- stream_write_uint16(item->data_out, wTimeStamp);
- stream_write_uint8(item->data_out, rdpsnd->cBlockNo); /* cConfirmedBlockNo */
- stream_write_uint8(item->data_out, 0); /* bPad */
+ stream_write_BYTE(item->data_out, SNDC_WAVECONFIRM);
+ stream_write_BYTE(item->data_out, 0);
+ stream_write_UINT16(item->data_out, 4);
+ stream_write_UINT16(item->data_out, wTimeStamp);
+ stream_write_BYTE(item->data_out, rdpsnd->cBlockNo); /* cConfirmedBlockNo */
+ stream_write_BYTE(item->data_out, 0); /* bPad */
item->out_timestamp = rdpsnd->wave_timestamp + delay_ms;
list_enqueue(rdpsnd->data_out_list, item);
static void rdpsnd_process_receive(rdpSvcPlugin* plugin, STREAM* data_in)
{
rdpsndPlugin* rdpsnd = (rdpsndPlugin*)plugin;
- uint8 msgType;
- uint16 BodySize;
+ BYTE msgType;
+ UINT16 BodySize;
if (rdpsnd->expectingWave)
{
return;
}
- stream_read_uint8(data_in, msgType); /* msgType */
- stream_seek_uint8(data_in); /* bPad */
- stream_read_uint16(data_in, BodySize);
+ stream_read_BYTE(data_in, msgType); /* msgType */
+ stream_seek_BYTE(data_in); /* bPad */
+ stream_read_UINT16(data_in, BodySize);
DEBUG_SVC("msgType %d BodySize %d", msgType, BodySize);
while (data && data->size > 0)
{
rdpsnd_process_plugin_data(rdpsnd, data);
- data = (RDP_PLUGIN_DATA*) (((uint8*) data) + data->size);
+ data = (RDP_PLUGIN_DATA*) (((BYTE*) data) + data->size);
}
if (rdpsnd->device == NULL)
typedef void (*pcOpen) (rdpsndDevicePlugin* device, rdpsndFormat* format, int latency);
typedef void (*pcSetFormat) (rdpsndDevicePlugin* device, rdpsndFormat* format, int latency);
typedef void (*pcSetVolume) (rdpsndDevicePlugin* device, uint32 value);
-typedef void (*pcPlay) (rdpsndDevicePlugin* device, uint8* data, int size);
+typedef void (*pcPlay) (rdpsndDevicePlugin* device, BYTE* data, int size);
typedef void (*pcStart) (rdpsndDevicePlugin* device);
typedef void (*pcClose) (rdpsndDevicePlugin* device);
typedef void (*pcFree) (rdpsndDevicePlugin* device);
STREAM* rdpsnd_pdu;
FREERDP_DSP_CONTEXT* dsp_context;
- uint8* out_buffer;
+ BYTE* out_buffer;
int out_buffer_size;
int out_frames;
int out_pending_frames;
#define RDPSND_PDU_INIT(_s, _msgType) \
{ \
- stream_write_uint8(_s, _msgType); \
- stream_write_uint8(_s, 0); \
- stream_seek_uint16(_s); \
+ stream_write_BYTE(_s, _msgType); \
+ stream_write_BYTE(_s, 0); \
+ stream_seek_UINT16(_s); \
}
#define RDPSND_PDU_FINISH(_s) \
int _pos; \
_pos = stream_get_pos(_s); \
stream_set_pos(_s, 2); \
- stream_write_uint16(_s, _pos - 4); \
+ stream_write_UINT16(_s, _pos - 4); \
stream_set_pos(_s, _pos); \
_r = WTSVirtualChannelWrite(rdpsnd->rdpsnd_channel, stream_get_head(_s), stream_get_length(_s), NULL); \
stream_set_pos(_s, 0); \
static BOOL rdpsnd_server_send_formats(rdpsnd_server* rdpsnd, STREAM* s)
{
- uint16 i;
+ UINT16 i;
RDPSND_PDU_INIT(s, SNDC_FORMATS);
stream_write_uint32(s, 0); /* dwFlags */
stream_write_uint32(s, 0); /* dwVolume */
stream_write_uint32(s, 0); /* dwPitch */
- stream_write_uint16(s, 0); /* wDGramPort */
- stream_write_uint16(s, rdpsnd->context.num_server_formats); /* wNumberOfFormats */
- stream_write_uint8(s, rdpsnd->context.block_no); /* cLastBlockConfirmed */
- stream_write_uint16(s, 0x06); /* wVersion */
- stream_write_uint8(s, 0); /* bPad */
+ stream_write_UINT16(s, 0); /* wDGramPort */
+ stream_write_UINT16(s, rdpsnd->context.num_server_formats); /* wNumberOfFormats */
+ stream_write_BYTE(s, rdpsnd->context.block_no); /* cLastBlockConfirmed */
+ stream_write_UINT16(s, 0x06); /* wVersion */
+ stream_write_BYTE(s, 0); /* bPad */
for (i = 0; i < rdpsnd->context.num_server_formats; i++)
{
- stream_write_uint16(s, rdpsnd->context.server_formats[i].wFormatTag); /* wFormatTag (WAVE_FORMAT_PCM) */
- stream_write_uint16(s, rdpsnd->context.server_formats[i].nChannels); /* nChannels */
+ stream_write_UINT16(s, rdpsnd->context.server_formats[i].wFormatTag); /* wFormatTag (WAVE_FORMAT_PCM) */
+ stream_write_UINT16(s, rdpsnd->context.server_formats[i].nChannels); /* nChannels */
stream_write_uint32(s, rdpsnd->context.server_formats[i].nSamplesPerSec); /* nSamplesPerSec */
stream_write_uint32(s, rdpsnd->context.server_formats[i].nSamplesPerSec *
rdpsnd->context.server_formats[i].nChannels *
rdpsnd->context.server_formats[i].wBitsPerSample / 8); /* nAvgBytesPerSec */
- stream_write_uint16(s, rdpsnd->context.server_formats[i].nBlockAlign); /* nBlockAlign */
- stream_write_uint16(s, rdpsnd->context.server_formats[i].wBitsPerSample); /* wBitsPerSample */
- stream_write_uint16(s, rdpsnd->context.server_formats[i].cbSize); /* cbSize */
+ stream_write_UINT16(s, rdpsnd->context.server_formats[i].nBlockAlign); /* nBlockAlign */
+ stream_write_UINT16(s, rdpsnd->context.server_formats[i].wBitsPerSample); /* wBitsPerSample */
+ stream_write_UINT16(s, rdpsnd->context.server_formats[i].cbSize); /* cbSize */
if (rdpsnd->context.server_formats[i].cbSize > 0)
{
stream_seek_uint32(s); /* dwFlags */
stream_seek_uint32(s); /* dwVolume */
stream_seek_uint32(s); /* dwPitch */
- stream_seek_uint16(s); /* wDGramPort */
- stream_read_uint16(s, rdpsnd->context.num_client_formats); /* wNumberOfFormats */
- stream_seek_uint8(s); /* cLastBlockConfirmed */
- stream_seek_uint16(s); /* wVersion */
- stream_seek_uint8(s); /* bPad */
+ stream_seek_UINT16(s); /* wDGramPort */
+ stream_read_UINT16(s, rdpsnd->context.num_client_formats); /* wNumberOfFormats */
+ stream_seek_BYTE(s); /* cLastBlockConfirmed */
+ stream_seek_UINT16(s); /* wVersion */
+ stream_seek_BYTE(s); /* bPad */
if (rdpsnd->context.num_client_formats > 0)
{
return FALSE;
}
- stream_read_uint16(s, rdpsnd->context.client_formats[i].wFormatTag);
- stream_read_uint16(s, rdpsnd->context.client_formats[i].nChannels);
+ stream_read_UINT16(s, rdpsnd->context.client_formats[i].wFormatTag);
+ stream_read_UINT16(s, rdpsnd->context.client_formats[i].nChannels);
stream_read_uint32(s, rdpsnd->context.client_formats[i].nSamplesPerSec);
stream_seek_uint32(s); /* nAvgBytesPerSec */
- stream_read_uint16(s, rdpsnd->context.client_formats[i].nBlockAlign);
- stream_read_uint16(s, rdpsnd->context.client_formats[i].wBitsPerSample);
- stream_read_uint16(s, rdpsnd->context.client_formats[i].cbSize);
+ stream_read_UINT16(s, rdpsnd->context.client_formats[i].nBlockAlign);
+ stream_read_UINT16(s, rdpsnd->context.client_formats[i].wBitsPerSample);
+ stream_read_UINT16(s, rdpsnd->context.client_formats[i].cbSize);
if (rdpsnd->context.client_formats[i].cbSize > 0)
{
void* fd;
STREAM* s;
void* buffer;
- uint8 msgType;
- uint16 BodySize;
+ BYTE msgType;
+ UINT16 BodySize;
uint32 bytes_returned = 0;
rdpsnd_server* rdpsnd = (rdpsnd_server*) arg;
freerdp_thread* thread = rdpsnd->rdpsnd_channel_thread;
break;
}
- stream_read_uint8(s, msgType);
- stream_seek_uint8(s); /* bPad */
- stream_read_uint16(s, BodySize);
+ stream_read_BYTE(s, msgType);
+ stream_seek_BYTE(s); /* bPad */
+ stream_read_UINT16(s, BodySize);
if (BodySize + 4 > (int) bytes_returned)
continue;
{
int size;
BOOL r;
- uint8* src;
+ BYTE* src;
int frames;
int fill_size;
rdpsndFormat* format;
/* WaveInfo PDU */
stream_set_pos(s, 0);
- stream_write_uint8(s, SNDC_WAVE); /* msgType */
- stream_write_uint8(s, 0); /* bPad */
- stream_write_uint16(s, size + fill_size + 8); /* BodySize */
+ stream_write_BYTE(s, SNDC_WAVE); /* msgType */
+ stream_write_BYTE(s, 0); /* bPad */
+ stream_write_UINT16(s, size + fill_size + 8); /* BodySize */
- stream_write_uint16(s, 0); /* wTimeStamp */
- stream_write_uint16(s, rdpsnd->context.selected_client_format); /* wFormatNo */
- stream_write_uint8(s, rdpsnd->context.block_no); /* cBlockNo */
+ stream_write_UINT16(s, 0); /* wTimeStamp */
+ stream_write_UINT16(s, rdpsnd->context.selected_client_format); /* wFormatNo */
+ stream_write_BYTE(s, rdpsnd->context.block_no); /* cBlockNo */
stream_seek(s, 3); /* bPad */
stream_write(s, src, 4);
cframesize = cframes * rdpsnd->src_bytes_per_frame;
memcpy(rdpsnd->out_buffer + (rdpsnd->out_pending_frames * rdpsnd->src_bytes_per_frame), buf, cframesize);
- buf = (uint8*) buf + cframesize;
+ buf = (BYTE*) buf + cframesize;
nframes -= cframes;
rdpsnd->out_pending_frames += cframes;
RDPSND_PDU_INIT(s, SNDC_SETVOLUME);
- stream_write_uint16(s, left);
- stream_write_uint16(s, right);
+ stream_write_UINT16(s, left);
+ stream_write_UINT16(s, right);
RDPSND_PDU_FINISH(s);
}
}
stream_write_uint32(irp->output, FileId);
- stream_write_uint8(irp->output, 0);
+ stream_write_BYTE(irp->output, 0);
free(path);
SERIAL_TTY* tty;
uint32 Length;
uint64 Offset;
- uint8* buffer = NULL;
+ BYTE* buffer = NULL;
stream_read_uint32(irp->input, Length);
stream_read_uint64(irp->input, Offset);
}
else
{
- buffer = (uint8*) malloc(Length);
+ buffer = (BYTE*) malloc(Length);
if (!serial_tty_read(tty, buffer, &Length))
{
}
stream_write_uint32(irp->output, Length);
- stream_write_uint8(irp->output, 0); /* Padding */
+ stream_write_BYTE(irp->output, 0); /* Padding */
irp->Complete(irp);
}
serial->device.data = stream_new(len + 1);
for (i = 0; i <= len; i++)
- stream_write_uint8(serial->device.data, name[i] < 0 ? '_' : name[i]);
+ stream_write_BYTE(serial->device.data, name[i] < 0 ? '_' : name[i]);
serial->path = path;
serial->irp_list = list_new();
#define TIOCOUTQ FIONWRITE
#endif
-static uint32 tty_write_data(SERIAL_TTY* tty, uint8* data, int len);
+static uint32 tty_write_data(SERIAL_TTY* tty, BYTE* data, int len);
static void tty_set_termios(SERIAL_TTY* tty);
static BOOL tty_get_termios(SERIAL_TTY* tty);
static int tty_get_error_status();
int purge_mask;
uint32 result;
uint32 modemstate;
- uint8 immediate;
+ BYTE immediate;
uint32 ret = STATUS_SUCCESS;
uint32 length = 0;
uint32 pos;
break;
case IOCTL_SERIAL_SET_LINE_CONTROL:
- stream_read_uint8(input, tty->stop_bits);
- stream_read_uint8(input, tty->parity);
- stream_read_uint8(input, tty->word_length);
+ stream_read_BYTE(input, tty->stop_bits);
+ stream_read_BYTE(input, tty->parity);
+ stream_read_BYTE(input, tty->word_length);
tty_set_termios(tty);
DEBUG_SVC("SERIAL_SET_LINE_CONTROL stop %d parity %d word %d",
tty->stop_bits, tty->parity, tty->word_length);
case IOCTL_SERIAL_GET_LINE_CONTROL:
DEBUG_SVC("SERIAL_GET_LINE_CONTROL");
length = 3;
- stream_write_uint8(output, tty->stop_bits);
- stream_write_uint8(output, tty->parity);
- stream_write_uint8(output, tty->word_length);
+ stream_write_BYTE(output, tty->stop_bits);
+ stream_write_BYTE(output, tty->parity);
+ stream_write_BYTE(output, tty->word_length);
break;
case IOCTL_SERIAL_IMMEDIATE_CHAR:
DEBUG_SVC("SERIAL_IMMEDIATE_CHAR");
- stream_read_uint8(input, immediate);
+ stream_read_BYTE(input, immediate);
tty_write_data(tty, &immediate, 1);
break;
stream_write_uint32(output, result); /* Amount in out queue */
DEBUG_SVC("SERIAL_GET_COMMSTATUS out queue %d", result);
- stream_write_uint8(output, 0); /* EofReceived */
- stream_write_uint8(output, 0); /* WaitForImmediate */
+ stream_write_BYTE(output, 0); /* EofReceived */
+ stream_write_BYTE(output, 0); /* WaitForImmediate */
break;
case IOCTL_SERIAL_PURGE:
return ret;
}
-BOOL serial_tty_read(SERIAL_TTY* tty, uint8* buffer, uint32* Length)
+BOOL serial_tty_read(SERIAL_TTY* tty, BYTE* buffer, uint32* Length)
{
long timeout = 90;
struct termios *ptermios;
return TRUE;
}
-BOOL serial_tty_write(SERIAL_TTY* tty, uint8* buffer, uint32 Length)
+BOOL serial_tty_write(SERIAL_TTY* tty, BYTE* buffer, uint32 Length)
{
ssize_t r;
uint32 event_txempty = Length;
tcsetattr(tty->fd, TCSANOW, ptermios);
}
-static uint32 tty_write_data(SERIAL_TTY* tty, uint8* data, int len)
+static uint32 tty_write_data(SERIAL_TTY* tty, BYTE* data, int len)
{
ssize_t r;
uint32 read_total_timeout_constant;
uint32 write_total_timeout_multiplier;
uint32 write_total_timeout_constant;
- uint8 stop_bits;
- uint8 parity;
- uint8 word_length;
- uint8 chars[6];
+ BYTE stop_bits;
+ BYTE parity;
+ BYTE word_length;
+ BYTE chars[6];
struct termios* ptermios;
struct termios* pold_termios;
int event_txempty;
SERIAL_TTY* serial_tty_new(const char* path, uint32 id);
void serial_tty_free(SERIAL_TTY* tty);
-BOOL serial_tty_read(SERIAL_TTY* tty, uint8* buffer, uint32* Length);
-BOOL serial_tty_write(SERIAL_TTY* tty, uint8* buffer, uint32 Length);
+BOOL serial_tty_read(SERIAL_TTY* tty, BYTE* buffer, uint32* Length);
+BOOL serial_tty_write(SERIAL_TTY* tty, BYTE* buffer, uint32 Length);
uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input, STREAM* output, uint32* abort_io);
BOOL serial_tty_get_event(SERIAL_TTY* tty, uint32* result);
scard->device.data = stream_new(length + 1);
for (i = 0; i <= length; i++)
- stream_write_uint8(scard->device.data, name[i] < 0 ? '_' : name[i]);
+ stream_write_BYTE(scard->device.data, name[i] < 0 ? '_' : name[i]);
scard->path = path;
static uint32 sc_output_string(IRP* irp, char *src, BOOL wide)
{
- uint8* p;
+ BYTE* p;
uint32 len;
p = stream_get_tail(irp->output);
SCARDHANDLE hCard;
DWORD dwAttrId = 0, dwAttrLen = 0;
DWORD attrLen = 0;
- uint8* pbAttr = NULL;
+ BYTE* pbAttr = NULL;
stream_seek(irp->input, 0x20);
stream_read_uint32(irp->input, dwAttrId);
}
#endif
- rv = SCardGetAttrib(hCard, dwAttrId, attrLen == 0 ? NULL : (uint8*) &pbAttr, &attrLen);
+ rv = SCardGetAttrib(hCard, dwAttrId, attrLen == 0 ? NULL : (BYTE*) &pbAttr, &attrLen);
if( rv != SCARD_S_SUCCESS ) {
#ifdef SCARD_AUTOALLOCATE
if(dwAttrLen == 0)
if(dwAttrId == SCARD_ATTR_DEVICE_FRIENDLY_NAME_A && rv == SCARD_E_UNSUPPORTED_FEATURE)
{
rv = SCardGetAttrib(hCard, SCARD_ATTR_DEVICE_FRIENDLY_NAME_W,
- attrLen == 0 ? NULL : (uint8*) &pbAttr, &attrLen);
+ attrLen == 0 ? NULL : (BYTE*) &pbAttr, &attrLen);
if( rv != SCARD_S_SUCCESS ) {
#ifdef SCARD_AUTOALLOCATE
if(dwAttrLen == 0)
if(dwAttrId == SCARD_ATTR_DEVICE_FRIENDLY_NAME_W && rv == SCARD_E_UNSUPPORTED_FEATURE)
{
rv = SCardGetAttrib(hCard, SCARD_ATTR_DEVICE_FRIENDLY_NAME_A,
- attrLen == 0 ? NULL : (uint8*) &pbAttr, &attrLen);
+ attrLen == 0 ? NULL : (BYTE*) &pbAttr, &attrLen);
if( rv != SCARD_S_SUCCESS ) {
#ifdef SCARD_AUTOALLOCATE
if(dwAttrLen == 0)
typedef struct _SERVER_SCARD_ATRMASK
{
uint32 cbAtr;
- uint8 rgbAtr[36];
- uint8 rgbMask[36];
+ BYTE rgbAtr[36];
+ BYTE rgbMask[36];
}
SERVER_SCARD_ATRMASK;
return TRUE;
}
-static BOOL tsmf_alsa_play(ITSMFAudioDevice* audio, uint8* data, uint32 data_size)
+static BOOL tsmf_alsa_play(ITSMFAudioDevice* audio, BYTE* data, uint32 data_size)
{
int len;
int error;
int frames;
- uint8* end;
- uint8* src;
- uint8* pindex;
+ BYTE* end;
+ BYTE* src;
+ BYTE* pindex;
int rbytes_per_frame;
int sbytes_per_frame;
TSMFALSAAudioDevice* alsa = (TSMFALSAAudioDevice*) audio;
AVFrame* frame;
int prepared;
- uint8* decoded_data;
+ BYTE* decoded_data;
uint32 decoded_size;
uint32 decoded_size_max;
} TSMFFFmpegDecoder;
{
TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder;
uint32 size;
- const uint8* s;
- uint8* p;
+ const BYTE* s;
+ BYTE* p;
mdecoder->codec = avcodec_find_decoder(mdecoder->codec_id);
if (!mdecoder->codec)
return TRUE;
}
-static BOOL tsmf_ffmpeg_decode_video(ITSMFDecoder* decoder, const uint8* data, uint32 data_size, uint32 extensions)
+static BOOL tsmf_ffmpeg_decode_video(ITSMFDecoder* decoder, const BYTE* data, uint32 data_size, uint32 extensions)
{
TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder;
int decoded;
{
AVPacket pkt;
av_init_packet(&pkt);
- pkt.data = (uint8*) data;
+ pkt.data = (BYTE*) data;
pkt.size = data_size;
if (extensions & TSMM_SAMPLE_EXT_CLEANPOINT)
pkt.flags |= AV_PKT_FLAG_KEY;
return ret;
}
-static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const uint8* data, uint32 data_size, uint32 extensions)
+static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const BYTE* data, uint32 data_size, uint32 extensions)
{
TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder;
int len;
int frame_size;
uint32 src_size;
- const uint8* src;
- uint8* dst;
+ const BYTE* src;
+ BYTE* dst;
int dst_offset;
#if 0
mdecoder->decoded_size_max = AVCODEC_MAX_AUDIO_FRAME_SIZE + 16;
mdecoder->decoded_data = xzalloc(mdecoder->decoded_size_max);
/* align the memory for SSE2 needs */
- dst = (uint8*) (((uintptr_t)mdecoder->decoded_data + 15) & ~ 0x0F);
+ dst = (BYTE*) (((uintptr_t)mdecoder->decoded_data + 15) & ~ 0x0F);
dst_offset = dst - mdecoder->decoded_data;
src = data;
src_size = data_size;
{
mdecoder->decoded_size_max = mdecoder->decoded_size_max * 2 + 16;
mdecoder->decoded_data = realloc(mdecoder->decoded_data, mdecoder->decoded_size_max);
- dst = (uint8*) (((uintptr_t)mdecoder->decoded_data + 15) & ~ 0x0F);
+ dst = (BYTE*) (((uintptr_t)mdecoder->decoded_data + 15) & ~ 0x0F);
if (dst - mdecoder->decoded_data != dst_offset)
{
/* re-align the memory if the alignment has changed after realloc */
int got_frame = 0;
AVPacket pkt;
av_init_packet(&pkt);
- pkt.data = (uint8*) src;
+ pkt.data = (BYTE*) src;
pkt.size = src_size;
len = avcodec_decode_audio4(mdecoder->codec_context, decoded_frame, &got_frame, &pkt);
return TRUE;
}
-static BOOL tsmf_ffmpeg_decode(ITSMFDecoder* decoder, const uint8* data, uint32 data_size, uint32 extensions)
+static BOOL tsmf_ffmpeg_decode(ITSMFDecoder* decoder, const BYTE* data, uint32 data_size, uint32 extensions)
{
TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder;
}
}
-static uint8* tsmf_ffmpeg_get_decoded_data(ITSMFDecoder* decoder, uint32* size)
+static BYTE* tsmf_ffmpeg_get_decoded_data(ITSMFDecoder* decoder, uint32* size)
{
TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder;
- uint8* buf;
+ BYTE* buf;
*size = mdecoder->decoded_size;
buf = mdecoder->decoded_data;
return TRUE;
}
-static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder * decoder, const uint8 * data, uint32 data_size, uint32 extensions,
+static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder * decoder, const BYTE * data, uint32 data_size, uint32 extensions,
uint64 start_time, uint64 end_time, uint64 duration)
{
TSMFGstreamerDecoder * mdecoder = (TSMFGstreamerDecoder *) decoder;
return tsmf_pulse_open_stream(pulse);
}
-static BOOL tsmf_pulse_play(ITSMFAudioDevice* audio, uint8* data, uint32 data_size)
+static BOOL tsmf_pulse_play(ITSMFAudioDevice* audio, BYTE* data, uint32 data_size)
{
TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*) audio;
- uint8* src;
+ BYTE* src;
int len;
int ret;
/* Set the audio data format. */
BOOL (*SetFormat) (ITSMFAudioDevice* audio, uint32 sample_rate, uint32 channels, uint32 bits_per_sample);
/* Play audio data. */
- BOOL (*Play) (ITSMFAudioDevice* audio, uint8* data, uint32 data_size);
+ BOOL (*Play) (ITSMFAudioDevice* audio, BYTE* data, uint32 data_size);
/* Get the latency of the last written sample, in 100ns */
uint64 (*GetLatency) (ITSMFAudioDevice* audio);
/* Change the playback volume level */
typedef struct _TSMFMediaTypeMap
{
- uint8 guid[16];
+ BYTE guid[16];
const char* name;
int type;
} TSMFMediaTypeMap;
}
};
-static void tsmf_print_guid(const uint8* guid)
+static void tsmf_print_guid(const BYTE* guid)
{
#ifdef WITH_DEBUG_DVC
int i;
case TSMF_FORMAT_TYPE_WAVEFORMATEX:
/* http://msdn.microsoft.com/en-us/library/dd757720.aspx */
- stream_seek_uint16(s);
- stream_read_uint16(s, mediatype->Channels);
+ stream_seek_UINT16(s);
+ stream_read_UINT16(s, mediatype->Channels);
stream_read_uint32(s, mediatype->SamplesPerSecond.Numerator);
mediatype->SamplesPerSecond.Denominator = 1;
stream_read_uint32(s, mediatype->BitRate);
mediatype->BitRate *= 8;
- stream_read_uint16(s, mediatype->BlockAlign);
- stream_read_uint16(s, mediatype->BitsPerSample);
- stream_read_uint16(s, mediatype->ExtraDataSize);
+ stream_read_UINT16(s, mediatype->BlockAlign);
+ stream_read_UINT16(s, mediatype->BitsPerSample);
+ stream_read_UINT16(s, mediatype->ExtraDataSize);
if (mediatype->ExtraDataSize > 0)
mediatype->ExtraData = stream_get_tail(s);
BOOL tsmf_codec_check_media_type(STREAM* s)
{
- uint8* m;
+ BYTE* m;
BOOL ret;
TS_AM_MEDIA_TYPE mediatype;
/* Set the decoder format. Return true if supported. */
BOOL (*SetFormat) (ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* media_type);
/* Decode a sample. */
- BOOL (*Decode) (ITSMFDecoder* decoder, const uint8* data, uint32 data_size, uint32 extensions);
+ BOOL (*Decode) (ITSMFDecoder* decoder, const BYTE* data, uint32 data_size, uint32 extensions);
/* Get the decoded data */
- uint8* (*GetDecodedData) (ITSMFDecoder* decoder, uint32* size);
+ BYTE* (*GetDecodedData) (ITSMFDecoder* decoder, uint32* size);
/* Get the pixel format of decoded video frame */
uint32 (*GetDecodedFormat) (ITSMFDecoder* decoder);
/* Get the width and height of decoded video frame */
/* Optional Contol function */
void (*Control) (ITSMFDecoder * decoder, ITSMFControlMsg control_msg, uint32 *arg);
/* Decode a sample with extended interface. */
- int (*DecodeEx) (ITSMFDecoder * decoder, const uint8 * data, uint32 data_size, uint32 extensions,
+ int (*DecodeEx) (ITSMFDecoder * decoder, const BYTE * data, uint32 data_size, uint32 extensions,
uint64 start_time, uint64 end_time, uint64 duration);
/* Get current play time */
uint64 (*GetRunningTime) (ITSMFDecoder * decoder);
rects = (RDP_RECT*) xzalloc(sizeof(RDP_RECT) * num_rects);
for (i = 0; i < num_rects; i++)
{
- stream_read_uint16(ifman->input, rects[i].y); /* Top */
- stream_seek_uint16(ifman->input);
- stream_read_uint16(ifman->input, rects[i].x); /* Left */
- stream_seek_uint16(ifman->input);
- stream_read_uint16(ifman->input, rects[i].height); /* Bottom */
- stream_seek_uint16(ifman->input);
- stream_read_uint16(ifman->input, rects[i].width); /* Right */
- stream_seek_uint16(ifman->input);
+ stream_read_UINT16(ifman->input, rects[i].y); /* Top */
+ stream_seek_UINT16(ifman->input);
+ stream_read_UINT16(ifman->input, rects[i].x); /* Left */
+ stream_seek_UINT16(ifman->input);
+ stream_read_UINT16(ifman->input, rects[i].height); /* Bottom */
+ stream_seek_UINT16(ifman->input);
+ stream_read_UINT16(ifman->input, rects[i].width); /* Right */
+ stream_seek_UINT16(ifman->input);
rects[i].width -= rects[i].x;
rects[i].height -= rects[i].y;
const char* decoder_name;
const char* audio_name;
const char* audio_device;
- uint8 presentation_id[16];
+ BYTE presentation_id[16];
uint32 stream_id;
uint32 message_id;
IWTSVirtualChannelManager* channel_mgr;
IWTSVirtualChannel* channel;
- uint8 presentation_id[16];
+ BYTE presentation_id[16];
uint32 stream_id;
};
static int tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
uint32 cbSize,
- uint8* pBuffer)
+ BYTE* pBuffer)
{
int length;
STREAM* input;
return 1;
}
input = stream_new(0);
- stream_attach(input, (uint8*) pBuffer, cbSize);
+ stream_attach(input, (BYTE*) pBuffer, cbSize);
output = stream_new(256);
stream_seek(output, 8);
static int tsmf_on_new_channel_connection(IWTSListenerCallback* pListenerCallback,
IWTSVirtualChannel* pChannel,
- uint8* Data,
+ BYTE* Data,
int* pbAccept,
IWTSVirtualChannelCallback** ppCallback)
{
}
}
- data = (RDP_PLUGIN_DATA*)(((uint8*)data) + data->size);
+ data = (RDP_PLUGIN_DATA*)(((BYTE*)data) + data->size);
}
}
struct _TSMF_PRESENTATION
{
- uint8 presentation_id[GUID_SIZE];
+ BYTE presentation_id[GUID_SIZE];
const char* audio_name;
const char* audio_device;
uint32 last_y;
uint32 last_width;
uint32 last_height;
- uint16 last_num_rects;
+ UINT16 last_num_rects;
RDP_RECT* last_rects;
uint32 output_x;
uint32 output_y;
uint32 output_width;
uint32 output_height;
- uint16 output_num_rects;
+ UINT16 output_num_rects;
RDP_RECT* output_rects;
IWTSVirtualChannelCallback* channel_callback;
uint64 duration;
uint32 extensions;
uint32 data_size;
- uint8* data;
+ BYTE* data;
uint32 decoded_size;
uint32 pixfmt;
}
}
-TSMF_PRESENTATION* tsmf_presentation_new(const uint8* guid, IWTSVirtualChannelCallback* pChannelCallback)
+TSMF_PRESENTATION* tsmf_presentation_new(const BYTE* guid, IWTSVirtualChannelCallback* pChannelCallback)
{
TSMF_PRESENTATION* presentation;
pthread_t thid = pthread_self();
return presentation;
}
-TSMF_PRESENTATION* tsmf_presentation_find_by_id(const uint8* guid)
+TSMF_PRESENTATION* tsmf_presentation_find_by_id(const BYTE* guid)
{
LIST_ITEM* item;
TSMF_PRESENTATION* presentation;
void tsmf_stream_push_sample(TSMF_STREAM* stream, IWTSVirtualChannelCallback* pChannelCallback,
uint32 sample_id, uint64 start_time, uint64 end_time, uint64 duration, uint32 extensions,
- uint32 data_size, uint8* data)
+ uint32 data_size, BYTE* data)
{
TSMF_SAMPLE* sample;
typedef struct _TSMF_SAMPLE TSMF_SAMPLE;
-TSMF_PRESENTATION* tsmf_presentation_new(const uint8* guid, IWTSVirtualChannelCallback* pChannelCallback);
-TSMF_PRESENTATION* tsmf_presentation_find_by_id(const uint8* guid);
+TSMF_PRESENTATION* tsmf_presentation_new(const BYTE* guid, IWTSVirtualChannelCallback* pChannelCallback);
+TSMF_PRESENTATION* tsmf_presentation_find_by_id(const BYTE* guid);
void tsmf_presentation_start(TSMF_PRESENTATION* presentation);
void tsmf_presentation_stop(TSMF_PRESENTATION* presentation);
void tsmf_presentation_paused(TSMF_PRESENTATION* presentation);
void tsmf_stream_push_sample(TSMF_STREAM* stream, IWTSVirtualChannelCallback* pChannelCallback,
uint32 sample_id, uint64 start_time, uint64 end_time, uint64 duration, uint32 extensions,
- uint32 data_size, uint8* data);
+ uint32 data_size, BYTE* data);
void tsmf_media_init(void);
uint32 Channels;
uint32 BitsPerSample;
uint32 BlockAlign;
- const uint8* ExtraData;
+ const BYTE* ExtraData;
uint32 ExtraDataSize;
} TS_AM_MEDIA_TYPE;
#include "urbdrc_types.h"
#include "data_transfer.h"
-static void usb_process_get_port_status(IUDEVICE* pdev, uint8* OutputBuffer)
+static void usb_process_get_port_status(IUDEVICE* pdev, BYTE* OutputBuffer)
{
int bcdUSB = pdev->query_device_descriptor(pdev, BCD_USB);
static int func_check_isochronous_fds(IUDEVICE* pdev)
{
int ret = 0;
- uint8* data_temp;
+ BYTE* data_temp;
uint32 size_temp, process_times = 2;
ISOCH_CALLBACK_QUEUE* isoch_queue = NULL;
ISOCH_CALLBACK_DATA* isoch = NULL;
#endif
static int urbdrc_process_register_request_callback(URBDRC_CHANNEL_CALLBACK* callback,
- uint8* data, uint32 data_sizem, IUDEVMAN* udevman, uint32 UsbDevice)
+ BYTE* data, uint32 data_sizem, IUDEVMAN* udevman, uint32 UsbDevice)
{
IUDEVICE* pdev;
uint32 NumRequestCompletion = 0;
return 0;
}
-static int urbdrc_process_cancel_request(uint8* data, uint32 data_sizem, IUDEVMAN* udevman, uint32 UsbDevice)
+static int urbdrc_process_cancel_request(BYTE* data, uint32 data_sizem, IUDEVMAN* udevman, uint32 UsbDevice)
{
IUDEVICE* pdev;
uint32 CancelId;
return error;
}
-static int urbdrc_process_retract_device_request(uint8* data, uint32 data_sizem, IUDEVMAN* udevman, uint32 UsbDevice)
+static int urbdrc_process_retract_device_request(BYTE* data, uint32 data_sizem, IUDEVMAN* udevman, uint32 UsbDevice)
{
uint32 Reason;
LLOGLN(urbdrc_debug, ("urbdrc_process_retract_device_request"));
return 0;
}
-static int urbdrc_process_io_control(URBDRC_CHANNEL_CALLBACK* callback, uint8* data,
+static int urbdrc_process_io_control(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data,
uint32 data_sizem, uint32 MessageId, IUDEVMAN * udevman, uint32 UsbDevice)
{
IUDEVICE* pdev;
uint32 OutputBufferSize;
uint32 RequestId;
uint32 usbd_status = USBD_STATUS_SUCCESS;
- uint8* OutputBuffer;
- uint8* out_data;
+ BYTE* OutputBuffer;
+ BYTE* out_data;
int i, offset, success = 0;
LLOGLN(urbdrc_debug, ("urbdrc_process__io_control"));
InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev));
/** process */
- OutputBuffer = (uint8 *)malloc(OutputBufferSize);
+ OutputBuffer = (BYTE *)malloc(OutputBufferSize);
memset(OutputBuffer, 0, OutputBufferSize);
switch (IoControlCode)
offset = 28;
out_size = offset + OutputBufferSize;
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
memset(out_data, 0, out_size);
data_write_uint32(out_data + 0, InterfaceId); /** interface */
data_write_uint32(out_data + 4, MessageId); /** message id */
for (i=0;i<OutputBufferSize;i++)
{
- data_write_uint8(out_data + offset, OutputBuffer[i]); /** OutputBuffer */
+ data_write_BYTE(out_data + offset, OutputBuffer[i]); /** OutputBuffer */
offset += 1;
}
return 0;
}
-static int urbdrc_process_internal_io_control(URBDRC_CHANNEL_CALLBACK* callback, uint8* data,
+static int urbdrc_process_internal_io_control(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data,
uint32 data_sizem, uint32 MessageId, IUDEVMAN* udevman, uint32 UsbDevice)
{
IUDEVICE* pdev;
- uint8* out_data;
+ BYTE* out_data;
uint32 out_size, IoControlCode, InterfaceId, InputBufferSize;
uint32 OutputBufferSize, RequestId, frames;
urbdrc_get_mstime(frames);
out_size = 32;
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
memset(out_data, 0, out_size);
data_write_uint32(out_data + 0, InterfaceId); /** interface */
data_write_uint32(out_data + 4, MessageId); /** message id */
return 0;
}
-static int urbdrc_process_query_device_text(URBDRC_CHANNEL_CALLBACK* callback, uint8* data,
+static int urbdrc_process_query_device_text(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data,
uint32 data_sizem, uint32 MessageId, IUDEVMAN* udevman, uint32 UsbDevice)
{
IUDEVICE* pdev;
uint32 TextType;
uint32 LocaleId;
uint32 bufferSize = 1024;
- uint8* out_data;
- uint8 DeviceDescription[bufferSize];
+ BYTE* out_data;
+ BYTE DeviceDescription[bufferSize];
int out_offset;
LLOGLN(urbdrc_debug, ("urbdrc_process_query_device_text"));
if (bufferSize != 0)
out_size += 2;
- out_data = (uint8*) malloc(out_size);
+ out_data = (BYTE*) malloc(out_size);
memset(out_data, 0, out_size);
data_write_uint32(out_data + 0, InterfaceId); /** interface */
out_offset = 12;
memcpy(out_data + out_offset, DeviceDescription, bufferSize);
out_offset += bufferSize;
- data_write_uint16(out_data + out_offset, 0x0000);
+ data_write_UINT16(out_data + out_offset, 0x0000);
out_offset += 2;
}
else
{
int inum;
MSUSB_INTERFACE_DESCRIPTOR** MsInterfaces = MsConfig->MsInterfaces;
- uint8 InterfaceNumber, AlternateSetting;
+ BYTE InterfaceNumber, AlternateSetting;
uint32 NumInterfaces = MsConfig->NumInterfaces;
for (inum = 0; inum < NumInterfaces; inum++)
}
}
-static int urb_select_configuration(URBDRC_CHANNEL_CALLBACK* callback, uint8* data,
+static int urb_select_configuration(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data,
uint32 data_sizem, uint32 MessageId, IUDEVMAN* udevman, uint32 UsbDevice, int transferDir)
{
MSUSB_CONFIG_DESCRIPTOR * MsConfig = NULL;
IUDEVICE* pdev = NULL;
uint32 out_size, InterfaceId, RequestId, NumInterfaces, usbd_status = 0;
- uint8 ConfigurationDescriptorIsValid;
- uint8* out_data;
+ BYTE ConfigurationDescriptorIsValid;
+ BYTE* out_data;
int MsOutSize = 0, offset = 0;
if (transferDir == 0)
InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev));
data_read_uint32(data + 0, RequestId);
- data_read_uint8(data + 4, ConfigurationDescriptorIsValid);
+ data_read_BYTE(data + 4, ConfigurationDescriptorIsValid);
data_read_uint32(data + 8, NumInterfaces);
offset = 12;
out_size = 36 + MsOutSize;
else
out_size = 44;
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
memset(out_data, 0, out_size);
data_write_uint32(out_data + 0, InterfaceId); /** interface */
data_write_uint32(out_data + 4, MessageId); /** message id */
/** CbTsUrbResult */
data_write_uint32(out_data + 16, 8 + MsOutSize);
/** TS_URB_RESULT_HEADER Size*/
- data_write_uint16(out_data + 20, 8 + MsOutSize);
+ data_write_UINT16(out_data + 20, 8 + MsOutSize);
}
else
{
data_write_uint32(out_data + 16, 16);
- data_write_uint16(out_data + 20, 16);
+ data_write_UINT16(out_data + 20, 16);
}
/** Padding, MUST be ignored upon receipt */
- data_write_uint16(out_data + 22, URB_FUNCTION_SELECT_CONFIGURATION);
+ data_write_UINT16(out_data + 22, URB_FUNCTION_SELECT_CONFIGURATION);
data_write_uint32(out_data + 24, usbd_status); /** UsbdStatus */
offset = 28;
/** TS_URB_SELECT_CONFIGURATION_RESULT */
return 0;
}
-static int urb_select_interface(URBDRC_CHANNEL_CALLBACK* callback, uint8* data, uint32 data_sizem,
+static int urb_select_interface(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data, uint32 data_sizem,
uint32 MessageId, IUDEVMAN* udevman, uint32 UsbDevice, int transferDir)
{
MSUSB_CONFIG_DESCRIPTOR* MsConfig;
IUDEVICE* pdev;
uint32 out_size, InterfaceId, RequestId, ConfigurationHandle;
uint32 OutputBufferSize;
- uint8 InterfaceNumber;
- uint8* out_data;
+ BYTE InterfaceNumber;
+ BYTE* out_data;
int out_offset, interface_size;
if (transferDir == 0)
interface_size = 16 + (MsInterface->NumberOfPipes * 20);
out_size = 36 + interface_size ;
- out_data = (uint8*) malloc(out_size);
+ out_data = (BYTE*) malloc(out_size);
memset(out_data, 0, out_size);
data_write_uint32(out_data + 0, InterfaceId); /** interface */
data_write_uint32(out_data + 12, RequestId); /** RequestId */
data_write_uint32(out_data + 16, 8 + interface_size); /** CbTsUrbResult */
/** TS_URB_RESULT_HEADER */
- data_write_uint16(out_data + 20, 8 + interface_size); /** Size */
+ data_write_UINT16(out_data + 20, 8 + interface_size); /** Size */
/** Padding, MUST be ignored upon receipt */
- data_write_uint16(out_data + 22, URB_FUNCTION_SELECT_INTERFACE);
+ data_write_UINT16(out_data + 22, URB_FUNCTION_SELECT_INTERFACE);
data_write_uint32(out_data + 24, USBD_STATUS_SUCCESS); /** UsbdStatus */
out_offset = 28;
return 0;
}
-static int urb_control_transfer(URBDRC_CHANNEL_CALLBACK* callback, uint8* data,
+static int urb_control_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data,
uint32 data_sizem, uint32 MessageId, IUDEVMAN* udevman, uint32 UsbDevice, int transferDir, int External)
{
IUDEVICE* pdev;
uint32 out_size, RequestId, InterfaceId, EndpointAddress, PipeHandle;
uint32 TransferFlags, OutputBufferSize, usbd_status, Timeout;
- uint8 bmRequestType, Request;
- uint16 Value, Index, length;
- uint8* buffer;
- uint8* out_data;
+ BYTE bmRequestType, Request;
+ UINT16 Value, Index, length;
+ BYTE* buffer;
+ BYTE* out_data;
int offset, ret;
pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice);
}
/** SetupPacket 8 bytes */
- data_read_uint8(data + offset, bmRequestType);
- data_read_uint8(data + offset + 1, Request);
- data_read_uint16(data + offset + 2, Value);
- data_read_uint16(data + offset + 4, Index);
- data_read_uint16(data + offset + 6, length);
+ data_read_BYTE(data + offset, bmRequestType);
+ data_read_BYTE(data + offset + 1, Request);
+ data_read_UINT16(data + offset + 2, Value);
+ data_read_UINT16(data + offset + 4, Index);
+ data_read_UINT16(data + offset + 6, length);
data_read_uint32(data + offset + 8, OutputBufferSize);
offset += 12;
}
out_size = 36 + OutputBufferSize;
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
memset(out_data, 0, out_size);
buffer = out_data + 36;
data_write_uint32(out_data + 12, RequestId); /** RequestId */
data_write_uint32(out_data + 16, 0x00000008); /** CbTsUrbResult */
/** TsUrbResult TS_URB_RESULT_HEADER */
- data_write_uint16(out_data + 20, 0x0008); /** Size */
+ data_write_UINT16(out_data + 20, 0x0008); /** Size */
/** Padding, MUST be ignored upon receipt */
- data_write_uint16(out_data + 22, URB_FUNCTION_CONTROL_TRANSFER);
+ data_write_UINT16(out_data + 22, URB_FUNCTION_CONTROL_TRANSFER);
data_write_uint32(out_data + 24, usbd_status); /** UsbdStatus */
data_write_uint32(out_data + 28, 0); /** HResult */
return 0;
}
-static int urb_bulk_or_interrupt_transfer(URBDRC_CHANNEL_CALLBACK* callback, uint8* data,
+static int urb_bulk_or_interrupt_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data,
uint32 data_sizem, uint32 MessageId, IUDEVMAN* udevman, uint32 UsbDevice, int transferDir)
{
IUDEVICE * pdev;
uint32 out_size, RequestId, InterfaceId, EndpointAddress, PipeHandle;
uint32 TransferFlags, OutputBufferSize, usbd_status = 0;
- uint8 * Buffer;
- uint8 * out_data;
+ BYTE * Buffer;
+ BYTE * out_data;
int offset;
pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice);
else
out_size = 36 + OutputBufferSize;
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
memset(out_data, 0, out_size);
switch (transferDir)
data_write_uint32(out_data + 12, RequestId); /** RequestId */
data_write_uint32(out_data + 16, 0x00000008); /** CbTsUrbResult */
/** TsUrbResult TS_URB_RESULT_HEADER */
- data_write_uint16(out_data + 20, 0x0008); /** Size */
+ data_write_UINT16(out_data + 20, 0x0008); /** Size */
/** Padding, MUST be ignored upon receipt */
- data_write_uint16(out_data + 22, URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER);
+ data_write_UINT16(out_data + 22, URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER);
data_write_uint32(out_data + 24, usbd_status); /** UsbdStatus */
data_write_uint32(out_data + 28, 0); /** HResult */
static int
-urb_isoch_transfer(URBDRC_CHANNEL_CALLBACK * callback, uint8 * data,
+urb_isoch_transfer(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data,
uint32 data_sizem,
uint32 MessageId,
IUDEVMAN * udevman,
uint32 ErrorCount, OutputBufferSize, usbd_status = 0;
uint32 RequestField, noAck = 0;
uint32 out_size = 0;
- uint8 * iso_buffer = NULL;
- uint8 * iso_packets = NULL;
- uint8 * out_data = NULL;
+ BYTE * iso_buffer = NULL;
+ BYTE * iso_packets = NULL;
+ BYTE * out_data = NULL;
int offset, nullBuffer = 0, iso_status;
pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice);
if (transferDir == USBD_TRANSFER_DIRECTION_OUT) {
if (!noAck) {
out_size = 48 + (NumberOfPackets * 12);
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
iso_packets = out_data + 40;
}
}
else {
out_size = 48 + OutputBufferSize + (NumberOfPackets * 12);
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
iso_packets = out_data + 40;
}
data_write_uint32(out_data + 12, RequestId); /** RequestId */
data_write_uint32(out_data + 16, 20 + (NumberOfPackets * 12)); /** CbTsUrbResult */
/** TsUrbResult TS_URB_RESULT_HEADER */
- data_write_uint16(out_data + 20, 20 + (NumberOfPackets * 12)); /** Size */
+ data_write_UINT16(out_data + 20, 20 + (NumberOfPackets * 12)); /** Size */
/** Padding, MUST be ignored upon receipt */
- data_write_uint16(out_data + 22, URB_FUNCTION_ISOCH_TRANSFER);
+ data_write_UINT16(out_data + 22, URB_FUNCTION_ISOCH_TRANSFER);
data_write_uint32(out_data + 24, usbd_status); /** UsbdStatus */
data_write_uint32(out_data + 28, StartFrame); /** StartFrame */
static int
urb_control_descriptor_request(URBDRC_CHANNEL_CALLBACK * callback,
- uint8 * data,
+ BYTE * data,
uint32 data_sizem,
uint32 MessageId,
IUDEVMAN * udevman,
uint32 UsbDevice,
- uint8 func_recipient,
+ BYTE func_recipient,
int transferDir)
{
IUDEVICE * pdev;
uint32 out_size, InterfaceId, RequestId, OutputBufferSize, usbd_status;
- uint8 bmRequestType, desc_index, desc_type;
- uint16 langId;
- uint8 * buffer;
- uint8 * out_data;
+ BYTE bmRequestType, desc_index, desc_type;
+ UINT16 langId;
+ BYTE * buffer;
+ BYTE * out_data;
int ret, offset;
pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice);
return 0;
InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev));
data_read_uint32(data + 0, RequestId);
- data_read_uint8(data + 4, desc_index);
- data_read_uint8(data + 5, desc_type);
- data_read_uint16(data + 6, langId);
+ data_read_BYTE(data + 4, desc_index);
+ data_read_BYTE(data + 5, desc_type);
+ data_read_UINT16(data + 6, langId);
data_read_uint32(data + 8, OutputBufferSize);
out_size = 36 + OutputBufferSize;
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
memset(out_data, 0, out_size);
buffer = out_data + 36;
data_write_uint32(out_data + 12, RequestId); /** RequestId */
data_write_uint32(out_data + 16, 0x00000008); /** CbTsUrbResult */
/** TsUrbResult TS_URB_RESULT_HEADER */
- data_write_uint16(out_data + 20, 0x0008); /** Size */
+ data_write_UINT16(out_data + 20, 0x0008); /** Size */
/** Padding, MUST be ignored upon receipt */
- data_write_uint16(out_data + 22, URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE);
+ data_write_UINT16(out_data + 22, URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE);
data_write_uint32(out_data + 24, usbd_status); /** UsbdStatus */
data_write_uint32(out_data + 28, 0); /** HResult */
data_write_uint32(out_data + 32, OutputBufferSize); /** OutputBufferSize */
static int
-urb_control_get_status_request(URBDRC_CHANNEL_CALLBACK * callback, uint8 * data,
+urb_control_get_status_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data,
uint32 data_sizem,
uint32 MessageId,
IUDEVMAN * udevman,
uint32 UsbDevice,
- uint8 func_recipient,
+ BYTE func_recipient,
int transferDir)
{
IUDEVICE * pdev;
uint32 out_size, RequestId, InterfaceId, OutputBufferSize, usbd_status;
- uint16 Index;
- uint8 bmRequestType;
- uint8 * buffer;
- uint8 * out_data;
+ UINT16 Index;
+ BYTE bmRequestType;
+ BYTE * buffer;
+ BYTE * out_data;
int offset, ret;
if (transferDir == 0){
InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev));
data_read_uint32(data + 0, RequestId);
- data_read_uint16(data + 4, Index); /** Index */
+ data_read_UINT16(data + 4, Index); /** Index */
data_read_uint32(data + 8, OutputBufferSize);
out_size = 36 + OutputBufferSize;
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
memset(out_data, 0, out_size);
buffer = out_data + 36;
data_write_uint32(out_data + 12, RequestId); /** RequestId, include NoAck*/
data_write_uint32(out_data + 16, 0x00000008); /** CbTsUrbResult */
/** TsUrbResult TS_URB_RESULT_HEADER */
- data_write_uint16(out_data + 20, 0x0008); /** Size */
+ data_write_UINT16(out_data + 20, 0x0008); /** Size */
/** Padding, MUST be ignored upon receipt */
- data_write_uint16(out_data + 22, URB_FUNCTION_VENDOR_DEVICE);
+ data_write_UINT16(out_data + 22, URB_FUNCTION_VENDOR_DEVICE);
data_write_uint32(out_data + 24, usbd_status); /** UsbdStatus */
data_write_uint32(out_data + 28, 0); /** HResult */
static int
urb_control_vendor_or_class_request(URBDRC_CHANNEL_CALLBACK * callback,
- uint8 * data,
+ BYTE * data,
uint32 data_sizem,
uint32 MessageId,
IUDEVMAN * udevman,
uint32 UsbDevice,
- uint8 func_type,
- uint8 func_recipient,
+ BYTE func_type,
+ BYTE func_recipient,
int transferDir)
{
IUDEVICE * pdev;
uint32 out_size, RequestId, InterfaceId, TransferFlags, usbd_status;
uint32 OutputBufferSize;
- uint8 ReqTypeReservedBits, Request, bmRequestType;
- uint16 Value, Index, Padding;
- uint8 * buffer;
- uint8 * out_data;
+ BYTE ReqTypeReservedBits, Request, bmRequestType;
+ UINT16 Value, Index, Padding;
+ BYTE * buffer;
+ BYTE * out_data;
int offset, ret;
/** control by vendor command */
data_read_uint32(data + 0, RequestId);
data_read_uint32(data + 4, TransferFlags); /** TransferFlags */
- data_read_uint8(data + 8, ReqTypeReservedBits); /** ReqTypeReservedBids */
- data_read_uint8(data + 9, Request); /** Request */
- data_read_uint16(data + 10, Value); /** value */
- data_read_uint16(data + 12, Index); /** index */
- data_read_uint16(data + 14, Padding); /** Padding */
+ data_read_BYTE(data + 8, ReqTypeReservedBits); /** ReqTypeReservedBids */
+ data_read_BYTE(data + 9, Request); /** Request */
+ data_read_UINT16(data + 10, Value); /** value */
+ data_read_UINT16(data + 12, Index); /** index */
+ data_read_UINT16(data + 14, Padding); /** Padding */
data_read_uint32(data + 16, OutputBufferSize);
offset = 20;
out_size = 36 + OutputBufferSize;
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
memset(out_data, 0, out_size);
buffer = out_data + 36;
data_write_uint32(out_data + 12, RequestId); /** RequestId, include NoAck*/
data_write_uint32(out_data + 16, 0x00000008); /** CbTsUrbResult */
/** TsUrbResult TS_URB_RESULT_HEADER */
- data_write_uint16(out_data + 20, 0x0008); /** Size */
- data_write_uint16(out_data + 22, URB_FUNCTION_VENDOR_DEVICE); /** Padding, MUST be ignored upon receipt */
+ data_write_UINT16(out_data + 20, 0x0008); /** Size */
+ data_write_UINT16(out_data + 22, URB_FUNCTION_VENDOR_DEVICE); /** Padding, MUST be ignored upon receipt */
data_write_uint32(out_data + 24, usbd_status); /** UsbdStatus */
data_write_uint32(out_data + 28, 0); /** HResult */
static int
urb_os_feature_descriptor_request(URBDRC_CHANNEL_CALLBACK * callback,
- uint8 * data,
+ BYTE * data,
uint32 data_sizem,
uint32 MessageId,
IUDEVMAN * udevman,
{
IUDEVICE * pdev;
uint32 out_size, RequestId, InterfaceId, OutputBufferSize, usbd_status;
- uint8 Recipient, InterfaceNumber, Ms_PageIndex;
- uint16 Ms_featureDescIndex;
- uint8 * out_data;
- uint8 * buffer;
+ BYTE Recipient, InterfaceNumber, Ms_PageIndex;
+ UINT16 Ms_featureDescIndex;
+ BYTE * out_data;
+ BYTE * buffer;
int offset, ret;
pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice);
InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev));
data_read_uint32(data + 0, RequestId);
- data_read_uint8(data + 4, Recipient); /** Recipient */
+ data_read_BYTE(data + 4, Recipient); /** Recipient */
Recipient = Recipient && 0x1f;
- data_read_uint8(data + 5, InterfaceNumber); /** InterfaceNumber */
- data_read_uint8(data + 6, Ms_PageIndex); /** Ms_PageIndex */
- data_read_uint16(data + 7, Ms_featureDescIndex); /** Ms_featureDescIndex */
+ data_read_BYTE(data + 5, InterfaceNumber); /** InterfaceNumber */
+ data_read_BYTE(data + 6, Ms_PageIndex); /** Ms_PageIndex */
+ data_read_UINT16(data + 7, Ms_featureDescIndex); /** Ms_featureDescIndex */
data_read_uint32(data + 12, OutputBufferSize);
offset = 16;
out_size = 36 + OutputBufferSize;
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
memset(out_data, 0, out_size);
buffer = out_data + 36;
data_write_uint32(out_data + 12, RequestId); /** RequestId */
data_write_uint32(out_data + 16, 0x00000008); /** CbTsUrbResult */
/** TsUrbResult TS_URB_RESULT_HEADER */
- data_write_uint16(out_data + 20, 0x0008); /** Size */
+ data_write_UINT16(out_data + 20, 0x0008); /** Size */
/** Padding, MUST be ignored upon receipt */
- data_write_uint16(out_data + 22, URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR);
+ data_write_UINT16(out_data + 22, URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR);
data_write_uint32(out_data + 24, usbd_status); /** UsbdStatus */
data_write_uint32(out_data + 28, 0); /** HResult */
static int
-urb_pipe_request(URBDRC_CHANNEL_CALLBACK * callback, uint8 * data,
+urb_pipe_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data,
uint32 data_sizem,
uint32 MessageId,
IUDEVMAN * udevman,
IUDEVICE * pdev;
uint32 out_size, RequestId, InterfaceId, PipeHandle, EndpointAddress;
uint32 OutputBufferSize, usbd_status = 0;
- uint8 * out_data;
+ BYTE * out_data;
int out_offset, ret;
if (transferDir == 0){
/** send data */
out_offset = 36;
out_size = out_offset + OutputBufferSize;
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
memset(out_data, 0, out_size);
data_write_uint32(out_data + 0, InterfaceId); /** interface */
data_write_uint32(out_data + 4, MessageId); /** message id */
data_write_uint32(out_data + 12, RequestId); /** RequestId */
data_write_uint32(out_data + 16, 0x00000008); /** CbTsUrbResult */
/** TsUrbResult TS_URB_RESULT_HEADER */
- data_write_uint16(out_data + 20, 0x0008); /** Size */
+ data_write_UINT16(out_data + 20, 0x0008); /** Size */
/** Padding, MUST be ignored upon receipt */
- data_write_uint16(out_data + 22, URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL);
+ data_write_UINT16(out_data + 22, URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL);
data_write_uint32(out_data + 24, usbd_status); /** UsbdStatus */
data_write_uint32(out_data + 28, 0); /** HResult */
static int
urb_get_current_frame_number(URBDRC_CHANNEL_CALLBACK * callback,
- uint8 * data,
+ BYTE * data,
uint32 data_sizem,
uint32 MessageId,
IUDEVMAN * udevman,
IUDEVICE * pdev;
uint32 out_size, RequestId, InterfaceId, OutputBufferSize;
uint32 dummy_frames;
- uint8 * out_data;
+ BYTE * out_data;
if (transferDir == 0){
LLOGLN(urbdrc_debug, ("urb_get_current_frame_number: not support transfer out\n"));
urbdrc_get_mstime(dummy_frames);
out_size = 40;
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
memset(out_data, 0, out_size);
data_write_uint32(out_data + 0, InterfaceId); /** interface */
data_write_uint32(out_data + 4, MessageId); /** message id */
data_write_uint32(out_data + 12, RequestId); /** RequestId */
data_write_uint32(out_data + 16, 12); /** CbTsUrbResult */
/** TsUrbResult TS_URB_RESULT_HEADER */
- data_write_uint16(out_data + 20, 12); /** Size */
+ data_write_UINT16(out_data + 20, 12); /** Size */
/** Padding, MUST be ignored upon receipt */
- data_write_uint16(out_data + 22, URB_FUNCTION_GET_CURRENT_FRAME_NUMBER);
+ data_write_UINT16(out_data + 22, URB_FUNCTION_GET_CURRENT_FRAME_NUMBER);
data_write_uint32(out_data + 24, USBD_STATUS_SUCCESS); /** UsbdStatus */
data_write_uint32(out_data + 28, dummy_frames); /** FrameNumber */
/* Unused function for current server */
static int
urb_control_get_configuration_request(URBDRC_CHANNEL_CALLBACK * callback,
- uint8 * data,
+ BYTE * data,
uint32 data_sizem,
uint32 MessageId,
IUDEVMAN * udevman,
{
IUDEVICE * pdev;
uint32 out_size, RequestId, InterfaceId, OutputBufferSize, usbd_status;
- uint8 * buffer;
- uint8 * out_data;
+ BYTE * buffer;
+ BYTE * out_data;
int ret, offset;
if (transferDir == 0){
data_read_uint32(data + 4, OutputBufferSize);
out_size = 36 + OutputBufferSize;
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
memset(out_data, 0, out_size);
buffer = out_data + 36;
data_write_uint32(out_data + 12, RequestId); /** RequestId */
data_write_uint32(out_data + 16, 8); /** CbTsUrbResult */
/** TsUrbResult TS_URB_RESULT_HEADER */
- data_write_uint16(out_data + 20, 8); /** Size */
+ data_write_UINT16(out_data + 20, 8); /** Size */
/** Padding, MUST be ignored upon receipt */
- data_write_uint16(out_data + 22, URB_FUNCTION_GET_CONFIGURATION);
+ data_write_UINT16(out_data + 22, URB_FUNCTION_GET_CONFIGURATION);
data_write_uint32(out_data + 24, usbd_status); /** UsbdStatus */
data_write_uint32(out_data + 28, 0); /** HResult */
/* Unused function for current server */
static int
urb_control_get_interface_request(URBDRC_CHANNEL_CALLBACK * callback,
- uint8 * data,
+ BYTE * data,
uint32 data_sizem,
uint32 MessageId,
IUDEVMAN * udevman,
{
IUDEVICE * pdev;
uint32 out_size, RequestId, InterfaceId, OutputBufferSize, usbd_status;
- uint16 interface;
- uint8 * buffer;
- uint8 * out_data;
+ UINT16 interface;
+ BYTE * buffer;
+ BYTE * out_data;
int ret, offset;
if (transferDir == 0){
InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev));
data_read_uint32(data + 0, RequestId);
- data_read_uint16(data + 4, interface);
+ data_read_UINT16(data + 4, interface);
data_read_uint32(data + 8, OutputBufferSize);
out_size = 36 + OutputBufferSize;
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
memset(out_data, 0, out_size);
buffer = out_data + 36;
data_write_uint32(out_data + 12, RequestId); /** RequestId */
data_write_uint32(out_data + 16, 8); /** CbTsUrbResult */
/** TsUrbResult TS_URB_RESULT_HEADER */
- data_write_uint16(out_data + 20, 8); /** Size */
+ data_write_UINT16(out_data + 20, 8); /** Size */
/** Padding, MUST be ignored upon receipt */
- data_write_uint16(out_data + 22, URB_FUNCTION_GET_INTERFACE);
+ data_write_UINT16(out_data + 22, URB_FUNCTION_GET_INTERFACE);
data_write_uint32(out_data + 24, usbd_status); /** UsbdStatus */
data_write_uint32(out_data + 28, 0); /** HResult */
}
static int
-urb_control_feature_request(URBDRC_CHANNEL_CALLBACK * callback, uint8 * data,
+urb_control_feature_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data,
uint32 data_sizem,
uint32 MessageId,
IUDEVMAN * udevman,
uint32 UsbDevice,
- uint8 func_recipient,
- uint8 command,
+ BYTE func_recipient,
+ BYTE command,
int transferDir)
{
IUDEVICE * pdev;
uint32 out_size, RequestId, InterfaceId, OutputBufferSize, usbd_status;
- uint16 FeatureSelector, Index;
- uint8 bmRequestType, bmRequest;
- uint8 * buffer;
- uint8 * out_data;
+ UINT16 FeatureSelector, Index;
+ BYTE bmRequestType, bmRequest;
+ BYTE * buffer;
+ BYTE * out_data;
int ret, offset;
pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice);
InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev));
data_read_uint32(data + 0, RequestId);
- data_read_uint16(data + 4, FeatureSelector);
- data_read_uint16(data + 6, Index);
+ data_read_UINT16(data + 4, FeatureSelector);
+ data_read_UINT16(data + 6, Index);
data_read_uint32(data + 8, OutputBufferSize);
offset = 12;
out_size = 36 + OutputBufferSize;
- out_data = (uint8 *) malloc(out_size);
+ out_data = (BYTE *) malloc(out_size);
memset(out_data, 0, out_size);
buffer = out_data + 36;
data_write_uint32(out_data + 12, RequestId); /** RequestId */
data_write_uint32(out_data + 16, 8); /** CbTsUrbResult */
/** TsUrbResult TS_URB_RESULT_HEADER */
- data_write_uint16(out_data + 20, 8); /** Size */
+ data_write_UINT16(out_data + 20, 8); /** Size */
/** Padding, MUST be ignored upon receipt */
- data_write_uint16(out_data + 22, URB_FUNCTION_GET_INTERFACE);
+ data_write_UINT16(out_data + 22, URB_FUNCTION_GET_INTERFACE);
data_write_uint32(out_data + 24, usbd_status); /** UsbdStatus */
data_write_uint32(out_data + 28, 0); /** HResult */
}
static int
-urbdrc_process_transfer_request(URBDRC_CHANNEL_CALLBACK * callback, uint8 * data,
+urbdrc_process_transfer_request(URBDRC_CHANNEL_CALLBACK * callback, BYTE * data,
uint32 data_sizem,
uint32 MessageId,
IUDEVMAN * udevman,
{
IUDEVICE * pdev;
uint32 CbTsUrb;
- uint16 Size;
- uint16 URB_Function;
+ UINT16 Size;
+ UINT16 URB_Function;
uint32 OutputBufferSize;
int error = 0;
if (pdev == NULL)
return 0;
data_read_uint32(data + 0, CbTsUrb); /** CbTsUrb */
- data_read_uint16(data + 4, Size); /** size */
- data_read_uint16(data + 6, URB_Function);
+ data_read_UINT16(data + 4, Size); /** size */
+ data_read_UINT16(data + 6, URB_Function);
data_read_uint32(data + 4 + CbTsUrb, OutputBufferSize);
switch (URB_Function)
{
TRANSFER_DATA* transfer_data = (TRANSFER_DATA*) arg;
URBDRC_CHANNEL_CALLBACK * callback = transfer_data->callback;
- uint8 * pBuffer = transfer_data->pBuffer;
+ BYTE * pBuffer = transfer_data->pBuffer;
uint32 cbSize = transfer_data->cbSize;
uint32 UsbDevice = transfer_data->UsbDevice;
IUDEVMAN * udevman = transfer_data->udevman;
void * prev;
void * next;
void * device;
- uint8 * out_data;
+ BYTE * out_data;
uint32 out_size;
void * callback;
};
return search;
}
-static int searchman_list_add(USB_SEARCHMAN* searchman, uint16 idVendor, uint16 idProduct)
+static int searchman_list_add(USB_SEARCHMAN* searchman, UINT16 idVendor, UINT16 idProduct)
{
USB_SEARCHDEV* search;
return 1;
}
-static int searchman_list_remove(USB_SEARCHMAN* searchman, uint16 idVendor, uint16 idProduct)
+static int searchman_list_remove(USB_SEARCHMAN* searchman, UINT16 idVendor, UINT16 idProduct)
{
USB_SEARCHDEV* search;
USB_SEARCHDEV* point;
void * inode;
void * prev;
void * next;
- uint16 idVendor;
- uint16 idProduct;
+ UINT16 idVendor;
+ UINT16 idProduct;
};
typedef struct _USB_SEARCHMAN USB_SEARCHMAN;
/* close searchman */
void (*close) (USB_SEARCHMAN* self);
/* add a new usb device for search */
- int (*add) (USB_SEARCHMAN* seachman, uint16 idVendor, uint16 idProduct);
+ int (*add) (USB_SEARCHMAN* seachman, UINT16 idVendor, UINT16 idProduct);
/* remove a usb device from list */
- int (*remove) (USB_SEARCHMAN* searchman, uint16 idVendor, uint16 idProduct);
+ int (*remove) (USB_SEARCHMAN* searchman, UINT16 idVendor, UINT16 idProduct);
/* check list has next device*/
int (*has_next) (USB_SEARCHMAN* seachman);
/* get the device from list*/
pdev->SigToEnd(pdev);
idVendor = pdev->query_device_descriptor(pdev, ID_VENDOR);
idProduct = pdev->query_device_descriptor(pdev, ID_PRODUCT);
- searchman->add(searchman, (uint16) idVendor, (uint16) idProduct);
+ searchman->add(searchman, (UINT16) idVendor, (UINT16) idProduct);
pdev->cancel_all_transfer_request(pdev);
pdev->wait_action_completion(pdev);
while (str[i])
{
- data_write_uint16(out_data + out_offset + offset, str[i]); /* str */
+ data_write_UINT16(out_data + out_offset + offset, str[i]); /* str */
i++;
offset += 2;
}
- data_write_uint16(out_data + out_offset + offset, 0x0000); /* add "\0" */
+ data_write_UINT16(out_data + out_offset + offset, 0x0000); /* add "\0" */
offset += 2;
return offset + out_offset;
IUDEVICE* pdev;
uint32 FunctionId;
uint32 RequestField;
- uint16 URB_Function;
+ UINT16 URB_Function;
IUDEVMAN* udevman = transfer_data->udevman;
if (transfer_data->cbSize >= 8)
FunctionId == TRANSFER_OUT_REQUEST) &&
transfer_data->cbSize >= 16)
{
- data_read_uint16(transfer_data->pBuffer + 14, URB_Function);
+ data_read_UINT16(transfer_data->pBuffer + 14, URB_Function);
if (URB_Function == URB_FUNCTION_ISOCH_TRANSFER &&
transfer_data->cbSize >= 20)
data_write_uint32(out_data + 4, MessageId); /* message id */
data_write_uint32(out_data + 8, Version); /* usb protocol version */
data_write_uint32(out_data + 12, 0x00000000); /* HRESULT */
- callback->channel->Write(callback->channel, out_size, (uint8*) out_data, NULL);
+ callback->channel->Write(callback->channel, out_size, (BYTE*) out_data, NULL);
zfree(out_data);
return 0;
data_write_uint32(out_data + 12, MajorVersion);
data_write_uint32(out_data + 16, MinorVersion);
data_write_uint32(out_data + 20, Capabilities); /* capabilities version */
- callback->channel->Write(callback->channel, out_size, (uint8 *)out_data, NULL);
+ callback->channel->Write(callback->channel, out_size, (BYTE *)out_data, NULL);
zfree(out_data);
return 0;
data_write_uint32(out_data + 4, MessageId); /* message id */
data_write_uint32(out_data + 8, ADD_VIRTUAL_CHANNEL); /* function id */
- channel->Write(channel, out_size, (uint8*) out_data, NULL);
+ channel->Write(channel, out_size, (BYTE*) out_data, NULL);
zfree(out_data);
return 0;
out_offset = fun_device_string_send_set(out_data, out_offset, HardwareIds[0]);
/* HardwareIds 2 */
out_offset = fun_device_string_send_set(out_data, out_offset, HardwareIds[1]);
- data_write_uint16(out_data + out_offset, 0x0000); /* add "\0" */
+ data_write_UINT16(out_data + out_offset, 0x0000); /* add "\0" */
out_offset += 2;
data_write_uint32(out_data + out_offset, cchCompatIds); /* cchCompatIds */
if (pdev->isCompositeDevice(pdev))
out_offset = fun_device_string_send_set(out_data, out_offset, composite_str);
- data_write_uint16(out_data + out_offset, 0x0000); /* add "\0" */
+ data_write_UINT16(out_data + out_offset, 0x0000); /* add "\0" */
out_offset += 2;
data_write_uint32(out_data + out_offset, 0x00000027); /* cchContainerId */
data_write_uint32(out_data + out_offset + 24, 0x50); /* NoAckIsochWriteJitterBufferSizeInMs, >=10 or <=512 */
out_offset += 28;
- callback->channel->Write(callback->channel, out_offset, (uint8 *)out_data, NULL);
+ callback->channel->Write(callback->channel, out_offset, (BYTE *)out_data, NULL);
zfree(out_data);
return 0;
IWTSVirtualChannelManager* channel_mgr;
URBDRC_PLUGIN* urbdrc = transfer_data->urbdrc;
USB_SEARCHMAN* searchman = urbdrc->searchman;
- uint8* pBuffer = transfer_data->pBuffer;
+ BYTE* pBuffer = transfer_data->pBuffer;
IUDEVMAN* udevman = transfer_data->udevman;
IUDEVICE* pdev = NULL;
uint32 ChannelId = 0;
transfer_data->udevman = urbdrc->udevman;
transfer_data->urbdrc = urbdrc;
transfer_data->cbSize = cbSize;
- transfer_data->pBuffer = (uint8 *)malloc((cbSize));
+ transfer_data->pBuffer = (BYTE *)malloc((cbSize));
for (i = 0; i < (cbSize); i++)
{
return error;
}
-static int urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, uint32 cbSize, uint8* Buffer)
+static int urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, uint32 cbSize, BYTE* Buffer)
{
URBDRC_CHANNEL_CALLBACK* callback = (URBDRC_CHANNEL_CALLBACK*) pChannelCallback;
URBDRC_PLUGIN* urbdrc;
transfer_data->udevman = udevman;
transfer_data->cbSize = cbSize - 4;
transfer_data->UsbDevice = InterfaceId;
- transfer_data->pBuffer = (uint8 *)malloc((cbSize - 4));
+ transfer_data->pBuffer = (BYTE *)malloc((cbSize - 4));
memcpy(transfer_data->pBuffer, pBuffer + 4, (cbSize - 4));
}
static int urbdrc_on_new_channel_connection(IWTSListenerCallback* pListenerCallback,
- IWTSVirtualChannel * pChannel, uint8* pData, int* pbAccept, IWTSVirtualChannelCallback** ppCallback)
+ IWTSVirtualChannel * pChannel, BYTE* pData, int* pbAccept, IWTSVirtualChannelCallback** ppCallback)
{
URBDRC_LISTENER_CALLBACK* listener_callback = (URBDRC_LISTENER_CALLBACK*) pListenerCallback;
URBDRC_CHANNEL_CALLBACK* callback;
URBDRC_CHANNEL_CALLBACK* callback;
URBDRC_PLUGIN* urbdrc;
IUDEVMAN* udevman;
- uint8* pBuffer;
+ BYTE* pBuffer;
uint32 cbSize;
uint32 UsbDevice;
};
uint32 *UrbdStatus,
uint32 *StartFrame,
uint32 NumberOfPackets,
- uint8 *IsoPacket,
+ BYTE *IsoPacket,
uint32 *BufferSize,
- uint8 *Buffer,
+ BYTE *Buffer,
int Timeout);
int (*control_transfer) (IUDEVICE * idev, uint32 RequestId,
uint32 EndpointAddress,
uint32 TransferFlags,
- uint8 bmRequestType,
- uint8 Request,
- uint16 Value,
- uint16 Index,
+ BYTE bmRequestType,
+ BYTE Request,
+ UINT16 Value,
+ UINT16 Index,
uint32 *UrbdStatus,
uint32 *BufferSize,
- uint8 *Buffer,
+ BYTE *Buffer,
uint32 Timeout);
int (*bulk_or_interrupt_transfer) (IUDEVICE * idev, uint32 RequestId,
uint32 TransferFlags,
uint32 *UsbdStatus,
uint32 *BufferSize,
- uint8 *Buffer,
+ BYTE *Buffer,
uint32 Timeout);
int (*select_configuration) (IUDEVICE * idev, uint32 bConfigurationValue);
- int (*select_interface) (IUDEVICE * idev, uint8 InterfaceNumber,
- uint8 AlternateSetting);
+ int (*select_interface) (IUDEVICE * idev, BYTE InterfaceNumber,
+ BYTE AlternateSetting);
int (*control_pipe_request) (IUDEVICE * idev, uint32 RequestId,
uint32 EndpointAddress,
int (*control_query_device_text) (IUDEVICE * idev, uint32 TextType,
uint32 LocaleId,
uint32 *BufferSize,
- uint8 * Buffer);
+ BYTE * Buffer);
int (*os_feature_descriptor_request) (IUDEVICE * idev, uint32 RequestId,
- uint8 Recipient,
- uint8 InterfaceNumber,
- uint8 Ms_PageIndex,
- uint16 Ms_featureDescIndex,
+ BYTE Recipient,
+ BYTE InterfaceNumber,
+ BYTE Ms_PageIndex,
+ UINT16 Ms_featureDescIndex,
uint32 * UsbdStatus,
uint32 * BufferSize,
- uint8* Buffer,
+ BYTE* Buffer,
int Timeout);
void (*cancel_all_transfer_request) (IUDEVICE * idev);
int (*query_device_port_status) (IUDEVICE * idev, uint32 *UsbdStatus,
uint32 * BufferSize,
- uint8 * Buffer);
+ BYTE * Buffer);
int (*request_queue_is_none) (IUDEVICE * idev);
BASIC_DEV_STATE_DEFINED(channel_id, uint32);
BASIC_DEV_STATE_DEFINED(UsbDevice, uint32);
BASIC_DEV_STATE_DEFINED(ReqCompletion, uint32);
- BASIC_DEV_STATE_DEFINED(bus_number, uint16);
- BASIC_DEV_STATE_DEFINED(dev_number, uint16);
+ BASIC_DEV_STATE_DEFINED(bus_number, UINT16);
+ BASIC_DEV_STATE_DEFINED(dev_number, UINT16);
BASIC_DEV_STATE_DEFINED(port_number, int);
BASIC_DEV_STATE_DEFINED(isoch_queue, void *);
BASIC_DEV_STATE_DEFINED(MsConfig, MSUSB_CONFIG_DESCRIPTOR *);
int (*register_udevice) (IUDEVMAN* idevman, int bus_number,
int dev_number,
int UsbDevice,
- uint16 idVendor,
- uint16 idProduct,
+ UINT16 idVendor,
+ UINT16 idProduct,
int flag);
IUDEVICE *(*get_next) (IUDEVMAN *idevman);
IUDEVICE *(*get_udevice_by_UsbDevice) (IUDEVMAN * idevman,
IUDEVICE *(*get_udevice_by_UsbDevice_try_again) (IUDEVMAN * idevman,
uint32 UsbDevice);
/* Extension */
- int (*check_device_exist_by_id) (IUDEVMAN * idevman, uint16 idVendor,
- uint16 idProduct);
+ int (*check_device_exist_by_id) (IUDEVMAN * idevman, UINT16 idVendor,
+ UINT16 idProduct);
int (*isAutoAdd) (IUDEVMAN * idevman);
/* Basic state */
BASIC_DEVMAN_STATE_DEFINED(defUsbDevice, uint32);
typedef struct _ISO_USER_DATA ISO_USER_DATA;
struct _ISO_USER_DATA
{
- uint8 * IsoPacket;
- uint8 * output_data;
+ BYTE * IsoPacket;
+ BYTE * output_data;
int iso_status;
int completed;
uint32 error_count;
func_iso_callback(struct libusb_transfer *transfer)
{
ISO_USER_DATA * iso_user_data = (ISO_USER_DATA *) transfer->user_data;
- uint8 * data = iso_user_data->IsoPacket;
+ BYTE * data = iso_user_data->IsoPacket;
int * completed = &iso_user_data->completed;
uint32 offset = 0;
uint32 index = 0;
uint32 i, act_len;
- uint8 *b;
+ BYTE *b;
*completed = 1;
/* Fixme: currently fill the dummy frame number, tt needs to be
MSUSB_INTERFACE_DESCRIPTOR ** MsInterfaces;
const LIBUSB_INTERFACE * interface;
const LIBUSB_ENDPOINT_DESCEIPTOR * endpoint;
- uint8 alt;
+ BYTE alt;
int inum, pnum;
MsInterfaces = MsConfig->MsInterfaces;
static void
func_iso_data_init(ISO_USER_DATA * iso_user_data, uint32 numPacket, uint32 buffsize,
- uint32 noAck, uint8 * isoPacket, uint8 * buffer)
+ uint32 noAck, BYTE * isoPacket, BYTE * buffer)
{
/* init struct iso_user_data */
iso_user_data->IsoPacket = isoPacket;
/* Get HUB handle */
static int
-udev_get_hub_handle(UDEVICE * pdev, uint16 bus_number, uint16 dev_number)
+udev_get_hub_handle(UDEVICE * pdev, UINT16 bus_number, UINT16 dev_number)
{
struct udev *udev;
struct udev_enumerate *enumerate;
static int
-libusb_udev_select_interface(IUDEVICE * idev, uint8 InterfaceNumber, uint8 AlternateSetting)
+libusb_udev_select_interface(IUDEVICE * idev, BYTE InterfaceNumber, BYTE AlternateSetting)
{
MSUSB_CONFIG_DESCRIPTOR * MsConfig;
MSUSB_INTERFACE_DESCRIPTOR ** MsInterfaces;
const LIBUSB_INTERFACE * LibusbInterface;
const LIBUSB_INTERFACE_DESCRIPTOR * LibusbAltsetting;
const LIBUSB_ENDPOINT_DESCEIPTOR * LibusbEndpoint;
- uint8 LibusbNumEndpoint;
+ BYTE LibusbNumEndpoint;
int inum = 0, pnum = 0, MsOutSize = 0;
LibusbConfig = pdev->LibusbConfig;
| (pdev->bus_number << 24);
/* count endpoint max packet size */
int max = LibusbEndpoint->wMaxPacketSize & 0x07ff;
- uint8 attr = LibusbEndpoint->bmAttributes;
+ BYTE attr = LibusbEndpoint->bmAttributes;
if ((attr & 0x3) == 1 || (attr & 0x3) == 3)
{
max *= (1 + ((LibusbEndpoint->wMaxPacketSize >> 11) & 3));
libusb_udev_control_query_device_text(IUDEVICE * idev, uint32 TextType,
uint32 LocaleId,
uint32 * BufferSize,
- uint8 * Buffer)
+ BYTE * Buffer)
{
UDEVICE * pdev = (UDEVICE *) idev;
LIBUSB_DEVICE_DESCRIPTOR * devDescriptor = pdev->devDescriptor;
char * strDesc = "Generic Usb String";
char deviceLocation[25];
- uint8 bus_number;
- uint8 device_address;
+ BYTE bus_number;
+ BYTE device_address;
int ret = 0, i = 0;
switch (TextType){
sprintf(deviceLocation, "Port_#%04d.Hub_#%04d", device_address, bus_number);
for(i=0;i<strlen(deviceLocation);i++){
- Buffer[i*2] = (uint8)deviceLocation[i];
+ Buffer[i*2] = (BYTE)deviceLocation[i];
Buffer[(i*2)+1] = 0;
}
*BufferSize = (i*2);
static int
libusb_udev_os_feature_descriptor_request(IUDEVICE * idev, uint32 RequestId,
- uint8 Recipient,
- uint8 InterfaceNumber,
- uint8 Ms_PageIndex,
- uint16 Ms_featureDescIndex,
+ BYTE Recipient,
+ BYTE InterfaceNumber,
+ BYTE Ms_PageIndex,
+ UINT16 Ms_featureDescIndex,
uint32 * UsbdStatus,
uint32 * BufferSize,
- uint8* Buffer,
+ BYTE* Buffer,
int Timeout)
{
UDEVICE * pdev = (UDEVICE *) idev;
- uint8 ms_string_desc[0x13];
+ BYTE ms_string_desc[0x13];
int error = 0;
/*
pdev->request_queue->register_request(pdev->request_queue, RequestId, NULL, 0);
//printf("Get ms string: result number %d", error);
if (error > 0)
{
- uint8 bMS_Vendorcode;
- data_read_uint8(ms_string_desc + 16, bMS_Vendorcode);
+ BYTE bMS_Vendorcode;
+ data_read_BYTE(ms_string_desc + 16, bMS_Vendorcode);
//printf("bMS_Vendorcode:0x%x", bMS_Vendorcode);
/** get os descriptor */
error = libusb_control_transfer(pdev->libusb_handle,
static int
libusb_udev_query_device_port_status(IUDEVICE * idev, uint32 *UsbdStatus,
uint32 * BufferSize,
- uint8 * Buffer)
+ BYTE * Buffer)
{
UDEVICE * pdev = (UDEVICE *) idev;
int success = 0, ret;
uint32 *UrbdStatus,
uint32 *StartFrame,
uint32 NumberOfPackets,
- uint8 *IsoPacket,
+ BYTE *IsoPacket,
uint32 *BufferSize,
- uint8 *Buffer,
+ BYTE *Buffer,
int Timeout)
{
UDEVICE * pdev = (UDEVICE *) idev;
static int
libusb_udev_control_transfer(IUDEVICE * idev, uint32 RequestId, uint32 EndpointAddress,
uint32 TransferFlags,
- uint8 bmRequestType,
- uint8 Request,
- uint16 Value,
- uint16 Index,
+ BYTE bmRequestType,
+ BYTE Request,
+ UINT16 Value,
+ UINT16 Index,
uint32 *UrbdStatus,
uint32 *BufferSize,
- uint8 *Buffer,
+ BYTE *Buffer,
uint32 Timeout)
{
UDEVICE * pdev = (UDEVICE *) idev;
uint32 TransferFlags,
uint32 *UsbdStatus,
uint32 *BufferSize,
- uint8 *Buffer,
+ BYTE *Buffer,
uint32 Timeout)
{
UDEVICE * pdev = (UDEVICE *) idev;
BASIC_STATE_FUNC_DEFINED(channel_id, uint32)
BASIC_STATE_FUNC_DEFINED(UsbDevice, uint32)
BASIC_STATE_FUNC_DEFINED(ReqCompletion, uint32)
-BASIC_STATE_FUNC_DEFINED(bus_number, uint16)
-BASIC_STATE_FUNC_DEFINED(dev_number, uint16)
+BASIC_STATE_FUNC_DEFINED(bus_number, UINT16)
+BASIC_STATE_FUNC_DEFINED(dev_number, UINT16)
BASIC_STATE_FUNC_DEFINED(port_number, int)
BASIC_STATE_FUNC_DEFINED(isoch_queue, void *)
BASIC_STATE_FUNC_DEFINED(MsConfig, MSUSB_CONFIG_DESCRIPTOR *)
static IUDEVICE*
-udev_init(UDEVICE* pdev, uint16 bus_number, uint16 dev_number)
+udev_init(UDEVICE* pdev, UINT16 bus_number, UINT16 dev_number)
{
LIBUSB_DEVICE_DESCRIPTOR* devDescriptor;
LIBUSB_CONFIG_DESCRIPTOR* config_temp;
int
-udev_new_by_id(uint16 idVendor, uint16 idProduct, IUDEVICE *** devArray)
+udev_new_by_id(UINT16 idVendor, UINT16 idProduct, IUDEVICE *** devArray)
{
LIBUSB_DEVICE_DESCRIPTOR * descriptor;
LIBUSB_DEVICE ** libusb_list;
UDEVICE ** array;
- uint16 bus_number;
- uint16 dev_number;
+ UINT16 bus_number;
+ UINT16 dev_number;
ssize_t total_device;
int i, ret, num = 0;
uint32 UsbDevice; /* An unique interface ID */
uint32 ReqCompletion; /* An unique interface ID */
uint32 channel_id;
- uint16 status;
- uint16 bus_number;
- uint16 dev_number;
+ UINT16 status;
+ UINT16 bus_number;
+ UINT16 dev_number;
char path[17];
int port_number;
int isCompositeDevice;
int
-udev_new_by_id(uint16_t idVendor, uint16_t idProduct, IUDEVICE ***devArray);
+udev_new_by_id(UINT16_t idVendor, UINT16_t idProduct, IUDEVICE ***devArray);
IUDEVICE*
udev_new_by_addr(int bus_number, int dev_number);
IUDEVICE* tail; /* tail device in linked list */
uint32 defUsbDevice;
- uint16 flags;
+ UINT16 flags;
int device_num;
int sem_timeout;
static int
udevman_register_udevice(IUDEVMAN* idevman, int bus_number, int dev_number,
int UsbDevice,
- uint16 idVendor,
- uint16 idProduct,
+ UINT16 idVendor,
+ UINT16 idProduct,
int flag)
{
UDEVMAN * udevman = (UDEVMAN *) idevman;
static int
-udevman_check_device_exist_by_id(IUDEVMAN * idevman, uint16 idVendor, uint16 idProduct)
+udevman_check_device_exist_by_id(IUDEVMAN * idevman, UINT16 idVendor, UINT16 idProduct)
{
if (libusb_open_device_with_vid_pid (NULL, idVendor, idProduct))
return 1;
0,
0,
UsbDevice,
- (uint16) idVendor,
- (uint16) idProduct,
+ (UINT16) idVendor,
+ (UINT16) idProduct,
UDEVMAN_FLAG_ADD_BY_VID_PID);
}
else if (udevman->flags & UDEVMAN_FLAG_ADD_BY_ADDR)
TRANSFER_REQUEST*
request_queue_register_request(REQUEST_QUEUE* queue, uint32 RequestId,
struct libusb_transfer * transfer,
- uint8 endpoint)
+ BYTE endpoint)
{
TRANSFER_REQUEST* request;
/* Get first*/
TRANSFER_REQUEST*
-request_queue_get_request_by_endpoint(REQUEST_QUEUE *queue, uint8 ep)
+request_queue_get_request_by_endpoint(REQUEST_QUEUE *queue, BYTE ep)
{
TRANSFER_REQUEST * request;
pthread_mutex_lock(&queue->request_loading);
void* next;
uint32 RequestId;
- uint8 endpoint;
+ BYTE endpoint;
struct libusb_transfer *transfer;
int submit;
};
int (*has_next) (REQUEST_QUEUE* queue);
int (*unregister_request) (REQUEST_QUEUE *queue, uint32 RequestId);
TRANSFER_REQUEST *(*get_next) (REQUEST_QUEUE* queue);
- TRANSFER_REQUEST *(*get_request_by_ep) (REQUEST_QUEUE *queue, uint8 ep);
+ TRANSFER_REQUEST *(*get_request_by_ep) (REQUEST_QUEUE *queue, BYTE ep);
TRANSFER_REQUEST *(*register_request) (REQUEST_QUEUE* queue,
- uint32 RequestId, struct libusb_transfer * transfer, uint8 endpoint);
+ uint32 RequestId, struct libusb_transfer * transfer, BYTE endpoint);
};
#include "df_event.h"
-static uint8 keymap[256];
-static uint8 functionmap[128];
+static BYTE keymap[256];
+static BYTE functionmap[128];
void df_keyboard_init()
{
}
-void df_send_mouse_button_event(rdpInput* input, BOOL down, uint32 button, uint16 x, uint16 y)
+void df_send_mouse_button_event(rdpInput* input, BOOL down, uint32 button, UINT16 x, UINT16 y)
{
- uint16 flags;
+ UINT16 flags;
flags = (down) ? PTR_FLAGS_DOWN : 0;
input->MouseEvent(input, flags, x, y);
}
-void df_send_mouse_motion_event(rdpInput* input, uint16 x, uint16 y)
+void df_send_mouse_motion_event(rdpInput* input, UINT16 x, UINT16 y)
{
input->MouseEvent(input, PTR_FLAGS_MOVE, x, y);
}
-void df_send_mouse_wheel_event(rdpInput* input, sint16 axisrel, uint16 x, uint16 y)
+void df_send_mouse_wheel_event(rdpInput* input, INT16 axisrel, UINT16 x, UINT16 y)
{
- uint16 flags = PTR_FLAGS_WHEEL;
+ UINT16 flags = PTR_FLAGS_WHEEL;
if (axisrel < 0)
flags |= 0x0078;
input->MouseEvent(input, flags, x, y);
}
-void df_send_keyboard_event(rdpInput* input, BOOL down, uint8 keycode, uint8 function)
+void df_send_keyboard_event(rdpInput* input, BOOL down, BYTE keycode, BYTE function)
{
- uint8 vkcode;
+ BYTE vkcode;
RDP_SCANCODE rdp_scancode;
if (keycode)
if (result == DFB_OK)
{
int pitch;
- uint8* point = NULL;
+ BYTE* point = NULL;
df_pointer->xhot = pointer->xPos;
df_pointer->yhot = pointer->yPos;
}
static int
-df_receive_channel_data(freerdp* instance, int channelId, uint8* data, int size, int flags, int total_size)
+df_receive_channel_data(freerdp* instance, int channelId, BYTE* data, int size, int flags, int total_size)
{
return freerdp_channels_data(instance, channelId, data, size, flags, total_size);
}
{
@public
rdpPointer *pointer;
- uint8 *cursor_data; // bitmapped pixel data
+ BYTE *cursor_data; // bitmapped pixel data
NSBitmapImageRep *bmiRep;
NSCursor *nsCursor;
NSImage *nsImage;
void mac_rail_MoveWindow(rdpRail *rail, rdpWindow *window);
void apple_to_windowMove(NSRect * r, RAIL_WINDOW_MOVE_ORDER * windowMove);
-void mac_send_rail_client_event(rdpChannels *channels, uint16 event_type, void *param);
+void mac_send_rail_client_event(rdpChannels *channels, UINT16 event_type, void *param);
void windows_to_apple_cords(NSRect * r);
void rail_MoveWindow(rdpRail * rail, rdpWindow * window);
void mac_rail_send_activate(int window_id);
int register_fds(int *fds, int count, void *inst);
int invoke_draw_rect(rdpContext *context);
int process_plugin_args(rdpSettings* settings, const char* name, RDP_PLUGIN_DATA* plugin_data, void* user_data);
-int receive_channel_data(freerdp *inst, int chan_id, uint8 *data, int size, int flags, int total_size);
+int receive_channel_data(freerdp *inst, int chan_id, BYTE *data, int size, int flags, int total_size);
void process_cliprdr_event(freerdp *inst, RDP_EVENT *event);
void cliprdr_process_cb_format_list_event(freerdp *inst, RDP_CB_FORMAT_LIST_EVENT* event);
void cliprdr_send_data_request(freerdp *inst, uint32 format);
void cliprdr_process_cb_monitor_ready_event(freerdp* inst);
void cliprdr_process_cb_data_response_event(freerdp *inst, RDP_CB_DATA_RESPONSE_EVENT *event);
-void cliprdr_process_text(freerdp *inst, uint8 *data, int len);
+void cliprdr_process_text(freerdp *inst, BYTE *data, int len);
void cliprdr_send_supported_format_list(freerdp *inst);
int register_channel_fds(int *fds, int count, void *inst);
void mac_rail_register_callbacks(freerdp *inst, rdpRail *rail);
void mac_rail_CreateWindow(rdpRail *rail, rdpWindow *window);
void mac_rail_MoveWindow(rdpRail *rail, rdpWindow *window);
-void mac_rail_ShowWindow(rdpRail *rail, rdpWindow *window, uint8 state);
+void mac_rail_ShowWindow(rdpRail *rail, rdpWindow *window, BYTE state);
void mac_rail_SetWindowText(rdpRail *rail, rdpWindow *window);
void mac_rail_SetWindowIcon(rdpRail *rail, rdpWindow *window, rdpIcon *icon);
void mac_rail_SetWindowRects(rdpRail *rail, rdpWindow *window);
void mac_rail_SetWindowVisibilityRects(rdpRail *rail, rdpWindow *window);
void mac_rail_DestroyWindow(rdpRail *rail, rdpWindow *window);
void mac_process_rail_get_sysparams_event(rdpChannels *channels, RDP_EVENT *event);
-void mac_send_rail_client_event(rdpChannels *channels, uint16 event_type, void *param);
+void mac_send_rail_client_event(rdpChannels *channels, UINT16 event_type, void *param);
void mac_on_free_rail_client_event(RDP_EVENT* event);
void mac_process_rail_server_sysparam_event(rdpChannels* channels, RDP_EVENT* event);
void mac_process_rail_exec_result_event(rdpChannels* channels, RDP_EVENT* event);
struct cursor
{
rdpPointer *pointer;
- uint8 *cursor_data; // bitmapped pixel data
+ BYTE *cursor_data; // bitmapped pixel data
void *bmiRep; // NSBitmapImageRep
void *nsCursor; // NSCursor
void *nsImage; // NSImage
return;
}
-int tf_receive_channel_data(freerdp* instance, int channelId, uint8* data, int size, int flags, int total_size)
+int tf_receive_channel_data(freerdp* instance, int channelId, BYTE* data, int size, int flags, int total_size)
{
return freerdp_channels_data(instance, channelId, data, size, flags, total_size);
}
if (!wfi || !p)
return 1;
input = wfi->instance->input;
- rdp_scancode = MAKE_RDP_SCANCODE((uint8) p->scanCode, p->flags & LLKHF_EXTENDED);
+ rdp_scancode = MAKE_RDP_SCANCODE((BYTE) p->scanCode, p->flags & LLKHF_EXTENDED);
DEBUG_KBD("keydown %d scanCode %04X flags %02X vkCode %02X",
- (wParam == WM_KEYDOWN), (uint8) p->scanCode, p->flags, p->vkCode);
+ (wParam == WM_KEYDOWN), (BYTE) p->scanCode, p->flags, p->vkCode);
if (wfi->fs_toggle &&
((p->vkCode == VK_RETURN) || (p->vkCode == VK_CANCEL)) &&
#include "wfreerdp.h"
#include "wf_graphics.h"
-const uint8 wf_rop2_table[] =
+const BYTE wf_rop2_table[] =
{
R2_BLACK, /* 0 */
R2_NOTMERGEPEN, /* DPon */
wf_image_free(glyph);
}
-uint8* wf_glyph_convert(wfInfo* wfi, int width, int height, uint8* data)
+BYTE* wf_glyph_convert(wfInfo* wfi, int width, int height, BYTE* data)
{
int indexx;
int indexy;
- uint8* src;
- uint8* dst;
- uint8* cdata;
+ BYTE* src;
+ BYTE* dst;
+ BYTE* cdata;
int src_bytes_per_row;
int dst_bytes_per_row;
src_bytes_per_row = (width + 7) / 8;
dst_bytes_per_row = src_bytes_per_row + (src_bytes_per_row % 2);
- cdata = (uint8 *) malloc(dst_bytes_per_row * height);
+ cdata = (BYTE *) malloc(dst_bytes_per_row * height);
src = data;
for (indexy = 0; indexy < height; indexy++)
int i;
HBRUSH br;
LOGBRUSH lbr;
- uint8* cdata;
- uint8 ipattern[8];
+ BYTE* cdata;
+ BYTE ipattern[8];
HBITMAP pattern = NULL;
lbr.lbStyle = brush->style;
wfi->image->_bitmap.width = surface_bits_command->width;
wfi->image->_bitmap.height = surface_bits_command->height;
wfi->image->_bitmap.bpp = surface_bits_command->bpp;
- wfi->image->_bitmap.data = (uint8*) realloc(wfi->image->_bitmap.data, wfi->image->_bitmap.width * wfi->image->_bitmap.height * 4);
+ wfi->image->_bitmap.data = (BYTE*) realloc(wfi->image->_bitmap.data, wfi->image->_bitmap.width * wfi->image->_bitmap.height * 4);
freerdp_image_flip(nsc_context->bmpdata, wfi->image->_bitmap.data, wfi->image->_bitmap.width, wfi->image->_bitmap.height, 32);
BitBlt(wfi->primary->hdc, surface_bits_command->destLeft, surface_bits_command->destTop, surface_bits_command->width, surface_bits_command->height, wfi->image->hdc, 0, 0, GDI_SRCCOPY);
}
wfi->image->_bitmap.height = surface_bits_command->height;
wfi->image->_bitmap.bpp = surface_bits_command->bpp;
- wfi->image->_bitmap.data = (uint8*) realloc(wfi->image->_bitmap.data,
+ wfi->image->_bitmap.data = (BYTE*) realloc(wfi->image->_bitmap.data,
wfi->image->_bitmap.width * wfi->image->_bitmap.height * 4);
if ((surface_bits_command->bpp != 32) || (wfi->clrconv->alpha == TRUE))
{
- uint8* temp_image;
+ BYTE* temp_image;
freerdp_image_convert(surface_bits_command->bitmapData, wfi->image->_bitmap.data,
wfi->image->_bitmap.width, wfi->image->_bitmap.height,
surface_bits_command->bpp = 32;
surface_bits_command->bitmapData = wfi->image->_bitmap.data;
- temp_image = (uint8*) malloc(wfi->image->_bitmap.width * wfi->image->_bitmap.height * 4);
+ temp_image = (BYTE*) malloc(wfi->image->_bitmap.width * wfi->image->_bitmap.height * 4);
freerdp_image_flip(wfi->image->_bitmap.data, temp_image, wfi->image->_bitmap.width, wfi->image->_bitmap.height, 32);
free(wfi->image->_bitmap.data);
wfi->image->_bitmap.data = temp_image;
#include "wfreerdp.h"
void wf_invalidate_region(wfInfo* wfi, int x, int y, int width, int height);
-wfBitmap* wf_image_new(wfInfo* wfi, int width, int height, int bpp, uint8* data);
+wfBitmap* wf_image_new(wfInfo* wfi, int width, int height, int bpp, BYTE* data);
void wf_image_free(wfBitmap* image);
void wf_toggle_fullscreen(wfInfo* wfi);
#include "wf_gdi.h"
#include "wf_graphics.h"
-HBITMAP wf_create_dib(wfInfo* wfi, int width, int height, int bpp, uint8* data, uint8** pdata)
+HBITMAP wf_create_dib(wfInfo* wfi, int width, int height, int bpp, BYTE* data, BYTE** pdata)
{
HDC hdc;
int negHeight;
HBITMAP bitmap;
BITMAPINFO bmi;
- uint8* cdata = NULL;
+ BYTE* cdata = NULL;
/**
* See: http://msdn.microsoft.com/en-us/library/dd183376
return bitmap;
}
-wfBitmap* wf_image_new(wfInfo* wfi, int width, int height, int bpp, uint8* data)
+wfBitmap* wf_image_new(wfInfo* wfi, int width, int height, int bpp, BYTE* data)
{
HDC hdc;
wfBitmap* image;
}
void wf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
- uint8* data, int width, int height, int bpp, int length, BOOL compressed, int codec_id)
+ BYTE* data, int width, int height, int bpp, int length, BOOL compressed, int codec_id)
{
- uint16 size;
+ UINT16 size;
size = width * height * (bpp / 8);
if (bitmap->data == NULL)
- bitmap->data = (uint8*) malloc(size);
+ bitmap->data = (BYTE*) malloc(size);
else
- bitmap->data = (uint8*) realloc(bitmap->data, size);
+ bitmap->data = (BYTE*) realloc(bitmap->data, size);
if (compressed)
{
#include "wfreerdp.h"
-HBITMAP wf_create_dib(wfInfo* wfi, int width, int height, int bpp, uint8* data, uint8** pdata);
-wfBitmap* wf_image_new(wfInfo* wfi, int width, int height, int bpp, uint8* data);
+HBITMAP wf_create_dib(wfInfo* wfi, int width, int height, int bpp, BYTE* data, BYTE** pdata);
+wfBitmap* wf_image_new(wfInfo* wfi, int width, int height, int bpp, BYTE* data);
void wf_image_free(wfBitmap* image);
void wf_register_graphics(rdpGraphics* graphics);
{
}
-void wf_rail_send_client_system_command(wfInfo* wfi, uint32 windowId, uint16 command)
+void wf_rail_send_client_system_command(wfInfo* wfi, uint32 windowId, UINT16 command)
{
}
void wf_rail_paint(wfInfo* wfi, rdpRail* rail, sint32 uleft, sint32 utop, uint32 uright, uint32 ubottom);
void wf_rail_register_callbacks(wfInfo* wfi, rdpRail* rail);
-void wf_rail_send_client_system_command(wfInfo* wfi, uint32 windowId, uint16 command);
+void wf_rail_send_client_system_command(wfInfo* wfi, uint32 windowId, UINT16 command);
void wf_rail_send_activate(wfInfo* wfi, HWND window, BOOL enabled);
void wf_process_rail_event(wfInfo* wfi, rdpChannels* chanman, RDP_EVENT* event);
void wf_rail_adjust_position(wfInfo* wfi, rdpWindow *window);
return TRUE;
}
-int wf_receive_channel_data(freerdp* instance, int channelId, uint8* data, int size, int flags, int total_size)
+int wf_receive_channel_data(freerdp* instance, int channelId, BYTE* data, int size, int flags, int total_size)
{
return freerdp_channels_data(instance, channelId, data, size, flags, total_size);
}
HDC hdc;
HBITMAP bitmap;
HBITMAP org_bitmap;
- uint8* pdata;
+ BYTE* pdata;
};
typedef struct wf_bitmap wfBitmap;
HWND hwnd;
HGDI_DC hdc;
- uint16 srcBpp;
- uint16 dstBpp;
+ UINT16 srcBpp;
+ UINT16 dstBpp;
freerdp* instance;
wfBitmap* primary;
wfBitmap* drawing;
int num_formats;
Atom targets[20];
int num_targets;
- uint8* data;
+ BYTE* data;
uint32 data_format;
uint32 data_alt_format;
int data_length;
/* INCR mechanism */
Atom incr_atom;
BOOL incr_starts;
- uint8* incr_data;
+ BYTE* incr_data;
int incr_data_length;
};
cb->identity_atom = XInternAtom(xfi->display, "_FREERDP_CLIPRDR_ID", FALSE);
XChangeProperty(xfi->display, xfi->drawable, cb->identity_atom,
- XA_INTEGER, 32, PropModeReplace, (uint8*) &id, 1);
+ XA_INTEGER, 32, PropModeReplace, (BYTE*) &id, 1);
XSelectInput(xfi->display, cb->root_window, PropertyChangeMask);
}
}
-static uint8* lf2crlf(uint8* data, int* size)
+static BYTE* lf2crlf(BYTE* data, int* size)
{
- uint8 c;
- uint8* outbuf;
- uint8* out;
- uint8* in_end;
- uint8* in;
+ BYTE c;
+ BYTE* outbuf;
+ BYTE* out;
+ BYTE* in_end;
+ BYTE* in;
int out_size;
out_size = (*size) * 2 + 1;
- outbuf = (uint8*) xzalloc(out_size);
+ outbuf = (BYTE*) xzalloc(out_size);
out = outbuf;
in = data;
in_end = data + (*size);
return outbuf;
}
-static void crlf2lf(uint8* data, int* size)
+static void crlf2lf(BYTE* data, int* size)
{
- uint8 c;
- uint8* out;
- uint8* in;
- uint8* in_end;
+ BYTE c;
+ BYTE* out;
+ BYTE* in;
+ BYTE* in_end;
out = data;
in = data;
*size = out - data;
}
-static void be2le(uint8* data, int size)
+static void be2le(BYTE* data, int size)
{
- uint8 c;
+ BYTE c;
while (size >= 2)
{
{
result = XGetWindowProperty(xfi->display, cb->owner,
cb->identity_atom, 0, 4, 0, XA_INTEGER,
- &type, &format, &length, &bytes_left, (uint8**) &pid);
+ &type, &format, &length, &bytes_left, (BYTE**) &pid);
}
if (pid)
static void xf_cliprdr_send_raw_format_list(xfInfo* xfi)
{
Atom type;
- uint8* format_data;
+ BYTE* format_data;
int format, result;
unsigned long length, bytes_left;
RDP_CB_FORMAT_LIST_EVENT* event;
result = XGetWindowProperty(xfi->display, cb->root_window,
cb->property_atom, 0, 3600, 0, XA_STRING,
- &type, &format, &length, &bytes_left, (uint8**) &format_data);
+ &type, &format, &length, &bytes_left, (BYTE**) &format_data);
if (result != Success)
{
event = (RDP_CB_FORMAT_LIST_EVENT*) freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR,
RDP_EVENT_TYPE_CB_FORMAT_LIST, NULL, NULL);
- event->raw_format_data = (uint8*) malloc(length);
+ event->raw_format_data = (BYTE*) malloc(length);
memcpy(event->raw_format_data, format_data, length);
event->raw_format_data_size = length;
XFree(format_data);
freerdp_channels_send_event(cb->channels, (RDP_EVENT*) event);
}
-static void xf_cliprdr_send_data_response(xfInfo* xfi, uint8* data, int size)
+static void xf_cliprdr_send_data_response(xfInfo* xfi, BYTE* data, int size)
{
RDP_CB_DATA_RESPONSE_EVENT* event;
clipboardContext* cb = (clipboardContext*) xfi->clipboard_context;
/* CB_FORMAT_RAW */
i = 0;
XChangeProperty(xfi->display, xfi->drawable, cb->property_atom,
- XA_INTEGER, 32, PropModeReplace, (uint8*) &event->format, 1);
+ XA_INTEGER, 32, PropModeReplace, (BYTE*) &event->format, 1);
}
else
{
int i, j;
Atom atom;
int format;
- uint8* data = NULL;
+ BYTE* data = NULL;
unsigned long length, bytes_left;
RDP_CB_FORMAT_LIST_EVENT* event;
clipboardContext* cb = (clipboardContext*) xfi->clipboard_context;
}
}
-static uint8* xf_cliprdr_process_requested_raw(uint8* data, int* size)
+static BYTE* xf_cliprdr_process_requested_raw(BYTE* data, int* size)
{
- uint8* outbuf;
+ BYTE* outbuf;
- outbuf = (uint8*) malloc(*size);
+ outbuf = (BYTE*) malloc(*size);
memcpy(outbuf, data, *size);
return outbuf;
}
-static uint8* xf_cliprdr_process_requested_unicodetext(uint8* data, int* size)
+static BYTE* xf_cliprdr_process_requested_unicodetext(BYTE* data, int* size)
{
char* inbuf;
WCHAR* outbuf;
*size = (int) ((out_size + 1) * 2);
- return (uint8*) outbuf;
+ return (BYTE*) outbuf;
}
-static uint8* xf_cliprdr_process_requested_text(uint8* data, int* size)
+static BYTE* xf_cliprdr_process_requested_text(BYTE* data, int* size)
{
- uint8* outbuf;
+ BYTE* outbuf;
outbuf = lf2crlf(data, size);
return outbuf;
}
-static uint8* xf_cliprdr_process_requested_dib(uint8* data, int* size)
+static BYTE* xf_cliprdr_process_requested_dib(BYTE* data, int* size)
{
- uint8* outbuf;
+ BYTE* outbuf;
/* length should be at least BMP header (14) + sizeof(BITMAPINFOHEADER) */
if (*size < 54)
}
*size -= 14;
- outbuf = (uint8*) xzalloc(*size);
+ outbuf = (BYTE*) xzalloc(*size);
memcpy(outbuf, data + 14, *size);
return outbuf;
}
-static uint8* xf_cliprdr_process_requested_html(uint8* data, int* size)
+static BYTE* xf_cliprdr_process_requested_html(BYTE* data, int* size)
{
char* inbuf;
- uint8* in;
- uint8* outbuf;
+ BYTE* in;
+ BYTE* outbuf;
char num[11];
inbuf = NULL;
if (*size > 2)
{
- if ((uint8) data[0] == 0xFE && (uint8) data[1] == 0xFF)
+ if ((BYTE) data[0] == 0xFE && (BYTE) data[1] == 0xFF)
{
be2le(data, *size);
}
- if ((uint8) data[0] == 0xFF && (uint8) data[1] == 0xFE)
+ if ((BYTE) data[0] == 0xFF && (BYTE) data[1] == 0xFE)
{
freerdp_UnicodeToAsciiAlloc((WCHAR*) (data + 2), &inbuf, (*size - 2) / 2);
}
memcpy(inbuf, data, *size);
}
- outbuf = (uint8*) xzalloc(*size + 200);
+ outbuf = (BYTE*) xzalloc(*size + 200);
strcpy((char*) outbuf,
"Version:0.9\r\n"
"StartHTML:0000000000\r\n"
"StartFragment:0000000000\r\n"
"EndFragment:0000000000\r\n");
- in = (uint8*) strstr((char*) inbuf, "<body");
+ in = (BYTE*) strstr((char*) inbuf, "<body");
if (in == NULL)
{
- in = (uint8*) strstr((char*) inbuf, "<BODY");
+ in = (BYTE*) strstr((char*) inbuf, "<BODY");
}
/* StartHTML */
snprintf(num, sizeof(num), "%010lu", (unsigned long) strlen((char*) outbuf));
return outbuf;
}
-static void xf_cliprdr_process_requested_data(xfInfo* xfi, BOOL has_data, uint8* data, int size)
+static void xf_cliprdr_process_requested_data(xfInfo* xfi, BOOL has_data, BYTE* data, int size)
{
- uint8* outbuf;
+ BYTE* outbuf;
clipboardContext* cb = (clipboardContext*) xfi->clipboard_context;
if (cb->incr_starts && has_data)
{
Atom type;
int format;
- uint8* data = NULL;
+ BYTE* data = NULL;
BOOL has_data = FALSE;
unsigned long length, bytes_left, dummy;
clipboardContext* cb = (clipboardContext*) xfi->clipboard_context;
{
bytes_left = length * format / 8;
DEBUG_X11("%d bytes", (int)bytes_left);
- cb->incr_data = (uint8*) realloc(cb->incr_data, cb->incr_data_length + bytes_left);
+ cb->incr_data = (BYTE*) realloc(cb->incr_data, cb->incr_data_length + bytes_left);
memcpy(cb->incr_data + cb->incr_data_length, data, bytes_left);
cb->incr_data_length += bytes_left;
XFree(data);
respond->xselection.requestor,
respond->xselection.property,
XA_ATOM, 32, PropModeReplace,
- (uint8*) cb->targets, cb->num_targets);
+ (BYTE*) cb->targets, cb->num_targets);
}
}
respond->xselection.requestor,
respond->xselection.property,
respond->xselection.target, 8, PropModeReplace,
- (uint8*) cb->data, cb->data_length);
+ (BYTE*) cb->data, cb->data_length);
}
}
XFlush(xfi->display);
}
-static void xf_cliprdr_process_text(clipboardContext* cb, uint8* data, int size)
+static void xf_cliprdr_process_text(clipboardContext* cb, BYTE* data, int size)
{
- cb->data = (uint8*) malloc(size);
+ cb->data = (BYTE*) malloc(size);
memcpy(cb->data, data, size);
cb->data_length = size;
crlf2lf(cb->data, &cb->data_length);
}
-static void xf_cliprdr_process_unicodetext(clipboardContext* cb, uint8* data, int size)
+static void xf_cliprdr_process_unicodetext(clipboardContext* cb, BYTE* data, int size)
{
cb->data_length = freerdp_UnicodeToAsciiAlloc((WCHAR*) data, (CHAR**) &(cb->data), size / 2);
crlf2lf(cb->data, &cb->data_length);
}
-static void xf_cliprdr_process_dib(clipboardContext* cb, uint8* data, int size)
+static void xf_cliprdr_process_dib(clipboardContext* cb, BYTE* data, int size)
{
STREAM* s;
- uint16 bpp;
+ UINT16 bpp;
uint32 offset;
uint32 ncolors;
s = stream_new(0);
stream_attach(s, data, size);
stream_seek(s, 14);
- stream_read_uint16(s, bpp);
+ stream_read_UINT16(s, bpp);
stream_read_uint32(s, ncolors);
offset = 14 + 40 + (bpp <= 8 ? (ncolors == 0 ? (1 << bpp) : ncolors) * 4 : 0);
stream_detach(s);
DEBUG_X11_CLIPRDR("offset=%d bpp=%d ncolors=%d", offset, bpp, ncolors);
s = stream_new(14 + size);
- stream_write_uint8(s, 'B');
- stream_write_uint8(s, 'M');
+ stream_write_BYTE(s, 'B');
+ stream_write_BYTE(s, 'M');
stream_write_uint32(s, 14 + size);
stream_write_uint32(s, 0);
stream_write_uint32(s, offset);
stream_free(s);
}
-static void xf_cliprdr_process_html(clipboardContext* cb, uint8* data, int size)
+static void xf_cliprdr_process_html(clipboardContext* cb, BYTE* data, int size)
{
char* start_str;
char* end_str;
return;
}
- cb->data = (uint8*) malloc(size - start + 1);
+ cb->data = (BYTE*) malloc(size - start + 1);
memcpy(cb->data, data + start, end - start);
cb->data_length = end - start;
crlf2lf(cb->data, &cb->data_length);
uint32 format;
XEvent* respond;
uint32 alt_format;
- uint8* data = NULL;
+ BYTE* data = NULL;
BOOL delay_respond;
unsigned long length, bytes_left;
clipboardContext* cb = (clipboardContext*) xfi->clipboard_context;
for (i=0;i<nitems;i++)
{
- if ((Atom) ((uint16 **) prop)[i] == XInternAtom(xfi->display, "_NET_WM_STATE_MAXIMIZED_VERT", False))
+ if ((Atom) ((UINT16 **) prop)[i] == XInternAtom(xfi->display, "_NET_WM_STATE_MAXIMIZED_VERT", False))
{
maxVert = TRUE;
}
- if ((Atom) ((uint16 **)prop)[i] == XInternAtom(xfi->display, "_NET_WM_STATE_MAXIMIZED_HORZ", False))
+ if ((Atom) ((UINT16 **)prop)[i] == XInternAtom(xfi->display, "_NET_WM_STATE_MAXIMIZED_HORZ", False))
{
maxHorz = TRUE;
}
#include "xf_gdi.h"
-static const uint8 xf_rop2_table[] =
+static const BYTE xf_rop2_table[] =
{
0,
GXclear, /* 0 */
return TRUE;
}
-Pixmap xf_brush_new(xfInfo* xfi, int width, int height, int bpp, uint8* data)
+Pixmap xf_brush_new(xfInfo* xfi, int width, int height, int bpp, BYTE* data)
{
Pixmap bitmap;
- uint8* cdata;
+ BYTE* cdata;
XImage* image;
bitmap = XCreatePixmap(xfi->display, xfi->drawable, width, height, xfi->depth);
return bitmap;
}
-Pixmap xf_mono_bitmap_new(xfInfo* xfi, int width, int height, uint8* data)
+Pixmap xf_mono_bitmap_new(xfInfo* xfi, int width, int height, BYTE* data)
{
int scanline;
XImage* image;
return bitmap;
}
-Pixmap xf_glyph_new(xfInfo* xfi, int width, int height, uint8* data)
+Pixmap xf_glyph_new(xfInfo* xfi, int width, int height, BYTE* data)
{
int scanline;
Pixmap bitmap;
}
}
-static void xf_gdi_surface_update_frame(xfInfo* xfi, uint16 tx, uint16 ty, uint16 width, uint16 height)
+static void xf_gdi_surface_update_frame(xfInfo* xfi, UINT16 tx, UINT16 ty, UINT16 width, UINT16 height)
{
if (xfi->remote_app != TRUE)
{
XSetFunction(xfi->display, xfi->gc, GXcopy);
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
- xfi->bmp_codec_nsc = (uint8*) realloc(xfi->bmp_codec_nsc,
+ xfi->bmp_codec_nsc = (BYTE*) realloc(xfi->bmp_codec_nsc,
surface_bits_command->width * surface_bits_command->height * 4);
freerdp_image_flip(nsc_context->bmpdata, xfi->bmp_codec_nsc,
/* Validate that the data received is large enough */
if( surface_bits_command->width * surface_bits_command->height * surface_bits_command->bpp / 8 <= surface_bits_command->bitmapDataLength )
{
- xfi->bmp_codec_none = (uint8*) realloc(xfi->bmp_codec_none,
+ xfi->bmp_codec_none = (BYTE*) realloc(xfi->bmp_codec_none,
surface_bits_command->width * surface_bits_command->height * 4);
freerdp_image_flip(surface_bits_command->bitmapData, xfi->bmp_codec_none,
void xf_Bitmap_New(rdpContext* context, rdpBitmap* bitmap)
{
- uint8* data;
+ BYTE* data;
Pixmap pixmap;
XImage* image;
xfContext* context_ = (xfContext*) context;
}
void xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
- uint8* data, int width, int height, int bpp, int length,
+ BYTE* data, int width, int height, int bpp, int length,
BOOL compressed, int codec_id)
{
- uint16 size;
+ UINT16 size;
RFX_MESSAGE* msg;
- uint8* src;
- uint8* dst;
+ BYTE* src;
+ BYTE* dst;
int yindex;
int xindex;
xfInfo* xfi;
size = width * height * (bpp + 7) / 8;
if (bitmap->data == NULL)
- bitmap->data = (uint8*) malloc(size);
+ bitmap->data = (BYTE*) malloc(size);
else
- bitmap->data = (uint8*) realloc(bitmap->data, size);
+ bitmap->data = (BYTE*) realloc(bitmap->data, size);
switch (codec_id)
{
if ((pointer->andMaskData != 0) && (pointer->xorMaskData != 0))
{
- freerdp_alpha_cursor_convert((uint8*) (ci.pixels), pointer->xorMaskData, pointer->andMaskData,
+ freerdp_alpha_cursor_convert((BYTE*) (ci.pixels), pointer->xorMaskData, pointer->andMaskData,
pointer->width, pointer->height, pointer->xorBpp, xfi->clrconv);
}
memset(xfi->pressed_keys, 0, 256 * sizeof(BOOL));
}
-void xf_kbd_set_keypress(xfInfo* xfi, uint8 keycode, KeySym keysym)
+void xf_kbd_set_keypress(xfInfo* xfi, BYTE keycode, KeySym keysym)
{
if (keycode >= 8)
xfi->pressed_keys[keycode] = keysym;
return;
}
-void xf_kbd_unset_keypress(xfInfo* xfi, uint8 keycode)
+void xf_kbd_unset_keypress(xfInfo* xfi, BYTE keycode)
{
if (keycode >= 8)
xfi->pressed_keys[keycode] = NoSymbol;
return (xfi->pressed_keys[keycode] == keysym);
}
-void xf_kbd_send_key(xfInfo* xfi, BOOL down, uint8 keycode)
+void xf_kbd_send_key(xfInfo* xfi, BOOL down, BYTE keycode)
{
RDP_SCANCODE rdp_scancode;
rdpInput* input;
void xf_kbd_init(xfInfo* xfi);
void xf_kbd_clear(xfInfo* xfi);
-void xf_kbd_set_keypress(xfInfo* xfi, uint8 keycode, KeySym keysym);
-void xf_kbd_unset_keypress(xfInfo* xfi, uint8 keycode);
+void xf_kbd_set_keypress(xfInfo* xfi, BYTE keycode, KeySym keysym);
+void xf_kbd_unset_keypress(xfInfo* xfi, BYTE keycode);
void xf_kbd_release_all_keypress(xfInfo* xfi);
BOOL xf_kbd_key_pressed(xfInfo* xfi, KeySym keysym);
-void xf_kbd_send_key(xfInfo* xfi, BOOL down, uint8 keycode);
+void xf_kbd_send_key(xfInfo* xfi, BOOL down, BYTE keycode);
int xf_kbd_read_keyboard_state(xfInfo* xfi);
BOOL xf_kbd_get_key_state(xfInfo* xfi, int state, int keysym);
int xf_kbd_get_toggle_keys_state(xfInfo* xfi);
window->windowWidth, window->windowHeight);
}
-static void xf_rail_ShowWindow(rdpRail* rail, rdpWindow* window, uint8 state)
+static void xf_rail_ShowWindow(rdpRail* rail, rdpWindow* window, BYTE state)
{
xfInfo* xfi;
xfWindow* xfw;
}
}
-static void xf_send_rail_client_event(rdpChannels* channels, uint16 event_type, void* param)
+static void xf_send_rail_client_event(rdpChannels* channels, UINT16 event_type, void* param)
{
RDP_EVENT* out_event = NULL;
void * payload = NULL;
xf_send_rail_client_event(channels, RDP_EVENT_TYPE_RAIL_CLIENT_ACTIVATE, &activate);
}
-void xf_rail_send_client_system_command(xfInfo* xfi, uint32 windowId, uint16 command)
+void xf_rail_send_client_system_command(xfInfo* xfi, uint32 windowId, UINT16 command)
{
rdpChannels* channels;
RAIL_SYSCOMMAND_ORDER syscommand;
DEBUG_X11_LMS("windowId=0x%X maxWidth=%d maxHeight=%d maxPosX=%d maxPosY=%d "
"minTrackWidth=%d minTrackHeight=%d maxTrackWidth=%d maxTrackHeight=%d",
minmax->windowId, minmax->maxWidth, minmax->maxHeight,
- (sint16)minmax->maxPosX, (sint16)minmax->maxPosY,
+ (INT16)minmax->maxPosX, (INT16)minmax->maxPosY,
minmax->minTrackWidth, minmax->minTrackHeight,
minmax->maxTrackWidth, minmax->maxTrackHeight);
DEBUG_X11_LMS("windowId=0x%X isMoveSizeStart=%d moveSizeType=%s PosX=%d PosY=%d",
movesize->windowId, movesize->isMoveSizeStart,
- movetype_names[movesize->moveSizeType], (sint16) movesize->posX, (sint16) movesize->posY);
+ movetype_names[movesize->moveSizeType], (INT16) movesize->posX, (INT16) movesize->posY);
switch (movesize->moveSizeType)
{
void xf_rail_paint(xfInfo* xfi, rdpRail* rail, sint32 uleft, sint32 utop, uint32 uright, uint32 ubottom);
void xf_rail_register_callbacks(xfInfo* xfi, rdpRail* rail);
-void xf_rail_send_client_system_command(xfInfo* xfi, uint32 windowId, uint16 command);
+void xf_rail_send_client_system_command(xfInfo* xfi, uint32 windowId, UINT16 command);
void xf_rail_send_activate(xfInfo* xfi, Window xwindow, BOOL enabled);
void xf_process_rail_event(xfInfo* xfi, rdpChannels* chanman, RDP_EVENT* event);
void xf_rail_adjust_position(xfInfo* xfi, rdpWindow *window);
static void xf_process_tsmf_video_frame_event(xfInfo* xfi, RDP_VIDEO_FRAME_EVENT* vevent)
{
int i;
- uint8* data1;
- uint8* data2;
+ BYTE* data1;
+ BYTE* data2;
uint32 pixfmt;
uint32 xvpixfmt;
BOOL converti420yv12 = FALSE;
/* http://tronche.com/gui/x/xlib/window-information/XGetWindowProperty.html */
BOOL xf_GetWindowProperty(xfInfo* xfi, Window window, Atom property, int length,
- unsigned long* nitems, unsigned long* bytes, uint8** prop)
+ unsigned long* nitems, unsigned long* bytes, BYTE** prop)
{
int status;
Atom actual_type;
hints.status = 0;
XChangeProperty(xfi->display, window->handle, xfi->_MOTIF_WM_HINTS, xfi->_MOTIF_WM_HINTS, 32,
- PropModeReplace, (uint8*) &hints, PROP_MOTIF_WM_HINTS_ELEMENTS);
+ PropModeReplace, (BYTE*) &hints, PROP_MOTIF_WM_HINTS_ELEMENTS);
}
void xf_SetWindowUnlisted(xfInfo* xfi, xfWindow* window)
window_state[1] = xfi->_NET_WM_STATE_SKIP_TASKBAR;
XChangeProperty(xfi->display, window->handle, xfi->_NET_WM_STATE,
- XA_ATOM, 32, PropModeReplace, (uint8*) &window_state, 2);
+ XA_ATOM, 32, PropModeReplace, (BYTE*) &window_state, 2);
}
void xf_SetWindowStyle(xfInfo* xfi, xfWindow* window, uint32 style, uint32 ex_style)
}
XChangeProperty(xfi->display, window->handle, xfi->_NET_WM_WINDOW_TYPE,
- XA_ATOM, 32, PropModeReplace, (uint8*) &window_type, 1);
+ XA_ATOM, 32, PropModeReplace, (BYTE*) &window_type, 1);
}
input_mask |= EnterWindowMask | LeaveWindowMask;
XChangeProperty(xfi->display, window->handle, xfi->_NET_WM_ICON, XA_CARDINAL, 32,
- PropModeReplace, (uint8*) xf_icon_prop, ARRAY_SIZE(xf_icon_prop));
+ PropModeReplace, (BYTE*) xf_icon_prop, ARRAY_SIZE(xf_icon_prop));
if (xfi->parent_window)
XReparentWindow(xfi->display, window->handle, xfi->parent_window, 0, 0);
xf_UpdateWindowArea(xfi, window, 0, 0, width, height);
}
-void xf_ShowWindow(xfInfo* xfi, xfWindow* window, uint8 state)
+void xf_ShowWindow(xfInfo* xfi, xfWindow* window, BYTE state)
{
switch (state)
{
}
XChangeProperty(xfi->display, window->handle, xfi->_NET_WM_ICON, XA_CARDINAL, 32,
- PropModeReplace, (uint8*) propdata, propsize);
+ PropModeReplace, (BYTE*) propdata, propsize);
XFlush(xfi->display);
}
BOOL is_mapped;
BOOL is_transient;
xfLocalMove local_move;
- uint8 rail_state;
+ BYTE rail_state;
BOOL rail_ignore_configure;
};
xfWindow* xf_CreateWindow(xfInfo* xfi, rdpWindow* wnd, int x, int y, int width, int height, uint32 id);
void xf_SetWindowText(xfInfo *xfi, xfWindow* window, char *name);
void xf_MoveWindow(xfInfo* xfi, xfWindow* window, int x, int y, int width, int height);
-void xf_ShowWindow(xfInfo* xfi, xfWindow* window, uint8 state);
+void xf_ShowWindow(xfInfo* xfi, xfWindow* window, BYTE state);
void xf_SetWindowIcon(xfInfo* xfi, xfWindow* window, rdpIcon* icon);
void xf_SetWindowRects(xfInfo* xfi, xfWindow* window, RECTANGLE_16* rects, int nrects);
void xf_SetWindowVisibilityRects(xfInfo* xfi, xfWindow* window, RECTANGLE_16* rects, int nrects);
rdpWindow* xf_rdpWindowFromWindow(xfInfo* xfi, Window wnd);
BOOL xf_GetWindowProperty(xfInfo* xfi, Window window, Atom property, int length,
- unsigned long* nitems, unsigned long* bytes, uint8** prop);
+ unsigned long* nitems, unsigned long* bytes, BYTE** prop);
void xf_SetWindowMinMaxInfo(xfInfo* xfi, xfWindow* window, int maxWidth, int maxHeight,
int maxPosX, int maxPosY, int minTrackWidth, int minTrackHeight, int maxTrackWidth, int maxTrackHeight);
static HANDLE g_sem;
static int g_thread_count = 0;
-static uint8 g_disconnect_reason = 0;
+static BYTE g_disconnect_reason = 0;
static long xv_port = 0;
static const size_t password_size = 512;
xfi->image = XCreateImage(xfi->display, xfi->visual, xfi->depth, ZPixmap, 0,
(char*) xfi->primary_buffer, xfi->width, xfi->height, xfi->scanline_pad, 0);
- xfi->bmp_codec_none = (uint8*) malloc(64 * 64 * 4);
+ xfi->bmp_codec_none = (BYTE*) malloc(64 * 64 * 4);
if (xfi->sw_gdi)
{
return 1;
}
-int xf_receive_channel_data(freerdp* instance, int channelId, uint8* data, int size, int flags, int total_size)
+int xf_receive_channel_data(freerdp* instance, int channelId, BYTE* data, int size, int flags, int total_size)
{
return freerdp_channels_data(instance, channelId, data, size, flags, total_size);
}
pthread_exit(NULL);
}
-static uint8 exit_code_from_disconnect_reason(uint32 reason)
+static BYTE exit_code_from_disconnect_reason(uint32 reason)
{
if (reason == 0 ||
(reason >= XF_EXIT_PARSE_ARGUMENTS && reason <= XF_EXIT_CONN_FAILED))
HGDI_DC hdc;
BOOL sw_gdi;
- uint8* primary_buffer;
+ BYTE* primary_buffer;
BOOL frame_begin;
- uint16 frame_x1;
- uint16 frame_y1;
- uint16 frame_x2;
- uint16 frame_y2;
+ UINT16 frame_x1;
+ UINT16 frame_y1;
+ UINT16 frame_x2;
+ UINT16 frame_y2;
BOOL focused;
BOOL mouse_active;
XSetWindowAttributes attribs;
BOOL complex_regions;
VIRTUAL_SCREEN vscreen;
- uint8* bmp_codec_none;
- uint8* bmp_codec_nsc;
+ BYTE* bmp_codec_none;
+ BYTE* bmp_codec_nsc;
void* rfx_context;
void* nsc_context;
void* xv_context;
#include "test_bitmap.h"
-uint8 compressed_16x1x8[] =
+BYTE compressed_16x1x8[] =
{
0x10
};
-uint8 decompressed_16x1x8[] =
+BYTE decompressed_16x1x8[] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
-uint8 compressed_32x32x8[] =
+BYTE compressed_32x32x8[] =
{
0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x06, 0x06, 0xed, 0x06, 0x06, 0x06, 0xed, 0x06, 0x06, 0x06,
0xec, 0x6c, 0x0e, 0x0e, 0x44, 0x0e, 0x0e, 0x0e, 0x13, 0x06, 0x06, 0x06, 0xed, 0x06, 0x06, 0x06,
0x04, 0x8b, 0x04, 0x6c, 0xe6, 0x04, 0x06, 0x82, 0x00, 0x00
};
-uint8 decompressed_32x32x8[] =
+BYTE decompressed_32x32x8[] =
{
0x04, 0x06, 0x04, 0x06, 0x04, 0x06, 0x04, 0x06, 0x04, 0x06, 0x04, 0x06, 0x04, 0x6c, 0x04, 0x8b,
0x04, 0x6c, 0x04, 0x06, 0x04, 0x06, 0x04, 0x06, 0x04, 0x06, 0x04, 0x06, 0x04, 0x06, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
-uint8 compressed_16x1x16[] =
+BYTE compressed_16x1x16[] =
{
0x0c, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
-uint8 decompressed_16x1x16[] =
+BYTE decompressed_16x1x16[] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
-uint8 compressed_32x32x16[] =
+BYTE compressed_32x32x16[] =
{
0x1c, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0xef, 0x1a, 0x8a,
0xcf, 0x12, 0x4e, 0x12, 0xce, 0x09, 0xaf, 0x09, 0x8f, 0x01, 0x8f, 0x01, 0xaf, 0x09, 0xce, 0x09,
0xcf, 0x12, 0x69, 0xef, 0x1a, 0x84, 0xef, 0x1a, 0xef, 0x1a, 0x00, 0x00, 0x00, 0x00
};
-uint8 decompressed_32x32x16[] =
+BYTE decompressed_32x32x16[] =
{
0xef, 0x1a, 0xef, 0x1a, 0xef, 0x1a, 0xef, 0x1a, 0xef, 0x1a, 0xef, 0x1a, 0xef, 0x1a, 0xef, 0x1a,
0xef, 0x1a, 0xef, 0x1a, 0xef, 0x1a, 0xcf, 0x12, 0xb0, 0x12, 0x91, 0x0a, 0xb3, 0x0a, 0xb3, 0x0a,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
-uint8 compressed_16x1x24[] =
+BYTE compressed_16x1x24[] =
{
0x0c, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
-uint8 decompressed_16x1x24[] =
+BYTE decompressed_16x1x24[] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
-uint8 compressed_32x32x24[] =
+BYTE compressed_32x32x24[] =
{
0x84, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x38, 0x8a, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x80,
0xff, 0xff, 0xff, 0xff
};
-uint8 decompressed_32x32x24[] =
+BYTE decompressed_32x32x24[] =
{
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
-uint8 compressed_16x1x32[] =
+BYTE compressed_16x1x32[] =
{
0x10, 0x01, 0x01, 0x01, 0x01
};
-uint8 decompressed_16x1x32[] =
+BYTE decompressed_16x1x32[] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
-uint8 compressed_32x32x32[] =
+BYTE compressed_32x32x32[] =
{
0x10, 0x02, 0x02, 0x0a, 0xbb, 0x22, 0x8e, 0xf6, 0xb9, 0x91, 0x91, 0xa9, 0xf5, 0xaa, 0x3c, 0x00,
0x08, 0xf9, 0x5e, 0xd1, 0x59, 0x8f, 0xf7, 0xb8, 0x90, 0x90, 0xa8, 0xf4, 0xab, 0x59, 0xa3, 0x8c,
0xcf, 0xb5, 0xb3, 0xc7, 0xd3, 0xc1, 0x85, 0x31, 0x03, 0x00
};
-uint8 decompressed_32x32x32[] =
+BYTE decompressed_32x32x32[] =
{
0x7a, 0x5f, 0x1d, 0x00, 0x7a, 0x5f, 0x1d, 0x00, 0x7a, 0x5f, 0x1d, 0x00, 0x7a, 0x5f, 0x1d, 0x00,
0x7a, 0x5f, 0x1d, 0x00, 0x7a, 0x5f, 0x1d, 0x00, 0x7a, 0x5f, 0x1d, 0x00, 0x7a, 0x5f, 0x1d, 0x00,
{
struct btest
{
- uint8 decompressed_16x1x8[16 * 1 * 1];
- uint8 decompressed_32x32x8[32 * 32 * 1];
- uint8 decompressed_16x1x16[16 * 1 * 2];
- uint8 decompressed_32x32x16[32 * 32 * 2];
- uint8 decompressed_16x1x24[16 * 1 * 3];
- uint8 decompressed_32x32x24[32 * 32 * 3];
- uint8 decompressed_16x1x32[16 * 1 * 4];
- uint8 decompressed_32x32x32[32 * 32 * 4];
+ BYTE decompressed_16x1x8[16 * 1 * 1];
+ BYTE decompressed_32x32x8[32 * 32 * 1];
+ BYTE decompressed_16x1x16[16 * 1 * 2];
+ BYTE decompressed_32x32x16[32 * 32 * 2];
+ BYTE decompressed_16x1x24[16 * 1 * 3];
+ BYTE decompressed_32x32x24[32 * 32 * 3];
+ BYTE decompressed_16x1x32[16 * 1 * 4];
+ BYTE decompressed_32x32x32[32 * 32 * 4];
};
struct btest* t;
int width;
return 0;
}
-static const uint8 test_clip_caps_data[] =
+static const BYTE test_clip_caps_data[] =
{
"\x07\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x01\x00\x0C\x00"
"\x02\x00\x00\x00\x0E\x00\x00\x00"
};
-static const uint8 test_monitor_ready_data[] =
+static const BYTE test_monitor_ready_data[] =
{
"\x01\x00\x00\x00\x00\x00\x00\x00"
};
-static const uint8 test_format_list_data[] =
+static const BYTE test_format_list_data[] =
{
"\x02\x00\x00\x00\x48\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x6D\x00\x61\x00\x74\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
};
-static const uint8 test_format_list_response_data[] =
+static const BYTE test_format_list_response_data[] =
{
"\x03\x00\x01\x00\x00\x00\x00\x00"
};
-static const uint8 test_data_request_data[] =
+static const BYTE test_data_request_data[] =
{
"\x04\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00"
};
-static const uint8 test_data_response_data[] =
+static const BYTE test_data_response_data[] =
{
"\x05\x00\x01\x00\x18\x00\x00\x00\x68\x00\x65\x00\x6C\x00\x6C\x00"
"\x6F\x00\x20\x00\x77\x00\x6F\x00\x72\x00\x6c\x00\x64\x00\x00\x00"
};
-static int test_rdp_channel_data(freerdp* instance, int chan_id, uint8* data, int data_size)
+static int test_rdp_channel_data(freerdp* instance, int chan_id, BYTE* data, int data_size)
{
printf("chan_id %d data_size %d\n", chan_id, data_size);
freerdp_hexdump(data, data_size);
/* UI sends data response event to cliprdr */
event = freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR, RDP_EVENT_TYPE_CB_DATA_RESPONSE, event_process_callback, NULL);
data_response_event = (RDP_CB_DATA_RESPONSE_EVENT*)event;
- data_response_event->data = (uint8*)malloc(6);
+ data_response_event->data = (BYTE*)malloc(6);
strcpy((char*)data_response_event->data, "hello");
data_response_event->size = 6;
event_processed = 0;
*/
int r, g, b;
- uint16 rgb16 = 0xAE7D;
+ UINT16 rgb16 = 0xAE7D;
GetRGB_565(r, g, b, rgb16);
CU_ASSERT(r == 0x15);
*/
int r, g, b;
- uint16 rgb16 = 0xAE7D;
+ UINT16 rgb16 = 0xAE7D;
GetRGB16(r, g, b, rgb16);
CU_ASSERT(r == 0xAD);
*/
int r, g, b;
- uint16 bgr16 = 0xEE75;
+ UINT16 bgr16 = 0xEE75;
GetBGR_565(r, g, b, bgr16);
CU_ASSERT(r == 0x15);
*/
int r, g, b;
- uint16 bgr16 = 0xEE75;
+ UINT16 bgr16 = 0xEE75;
GetBGR16(r, g, b, bgr16);
CU_ASSERT(r == 0xAD);
return 0;
}
-static const uint8 test_capability_request_data[] =
+static const BYTE test_capability_request_data[] =
{
"\x58\x00\x02\x00\x33\x33\x11\x11\x3D\x0A\xA7\x04"
};
static int data_received = 0;
-static int test_rdp_channel_data(freerdp* instance, int chan_id, uint8* data, int data_size)
+static int test_rdp_channel_data(freerdp* instance, int chan_id, BYTE* data, int data_size)
{
printf("chan_id %d data_size %d\n", chan_id, data_size);
freerdp_hexdump(data, data_size);
printf("\n");
}
-void assert_stream(STREAM* s, uint8* data, int length, const char* func, int line)
+void assert_stream(STREAM* s, BYTE* data, int length, const char* func, int line)
{
int i;
int actual_length;
- uint8* actual_data;
+ BYTE* actual_data;
actual_data = s->data;
actual_length = stream_get_length(s);
}
void dump_data(unsigned char * p, int len, int width, char* name);
-void assert_stream(STREAM* s, uint8* data, int length, const char* func, int line);
+void assert_stream(STREAM* s, BYTE* data, int length, const char* func, int line);
#define ASSERT_STREAM(_s, _data, _length) assert_stream(_s, _data, _length, __FUNCTION__, __LINE__)
return 0;
}
-uint8 gcc_user_data[284] =
+BYTE gcc_user_data[284] =
"\x01\xc0\xd8\x00\x04\x00\x08\x00\x00\x05\x00\x04\x01\xCA\x03\xAA"
"\x09\x04\x00\x00\xCE\x0E\x00\x00\x45\x00\x4c\x00\x54\x00\x4f\x00"
"\x4e\x00\x53\x00\x2d\x00\x44\x00\x45\x00\x56\x00\x32\x00\x00\x00"
"\x00\x00\x80\x80\x63\x6c\x69\x70\x72\x64\x72\x00\x00\x00\xA0\xC0"
"\x72\x64\x70\x73\x6e\x64\x00\x00\x00\x00\x00\xc0";
-uint8 gcc_conference_create_request_expected[307] =
+BYTE gcc_conference_create_request_expected[307] =
"\x00\x05\x00\x14\x7C\x00\x01\x81\x2A\x00\x08\x00\x10\x00\x01\xC0"
"\x00\x44\x75\x63\x61\x81\x1c\x01\xc0\xd8\x00\x04\x00\x08\x00\x00"
"\x05\x00\x04\x01\xCA\x03\xAA\x09\x04\x00\x00\xCE\x0E\x00\x00\x45"
s = stream_new(sizeof(gcc_conference_create_request_expected));
gcc_write_conference_create_request(s, &user_data);
- ASSERT_STREAM(s, (uint8*) gcc_conference_create_request_expected, sizeof(gcc_conference_create_request_expected));
+ ASSERT_STREAM(s, (BYTE*) gcc_conference_create_request_expected, sizeof(gcc_conference_create_request_expected));
}
-uint8 gcc_client_core_data_expected[216] =
+BYTE gcc_client_core_data_expected[216] =
"\x01\xc0\xd8\x00\x04\x00\x08\x00\x00\x05\x00\x04\x01\xCA\x03\xAA"
"\x09\x04\x00\x00\xCE\x0E\x00\x00\x45\x00\x4c\x00\x54\x00\x4f\x00"
"\x4e\x00\x53\x00\x2d\x00\x44\x00\x45\x00\x56\x00\x32\x00\x00\x00"
gcc_write_client_core_data(s, settings);
- ASSERT_STREAM(s, (uint8*) gcc_client_core_data_expected, sizeof(gcc_client_core_data_expected));
+ ASSERT_STREAM(s, (BYTE*) gcc_client_core_data_expected, sizeof(gcc_client_core_data_expected));
}
-uint8 gcc_client_security_data_expected[12] =
+BYTE gcc_client_security_data_expected[12] =
"\x02\xC0\x0C\x00\x1B\x00\x00\x00\x00\x00\x00\x00";
void test_gcc_write_client_security_data(void)
gcc_write_client_security_data(s, settings);
- ASSERT_STREAM(s, (uint8*) gcc_client_security_data_expected, sizeof(gcc_client_security_data_expected));
+ ASSERT_STREAM(s, (BYTE*) gcc_client_security_data_expected, sizeof(gcc_client_security_data_expected));
}
-uint8 gcc_client_cluster_data_expected[12] =
+BYTE gcc_client_cluster_data_expected[12] =
"\x04\xC0\x0C\x00\x0D\x00\x00\x00\x00\x00\x00\x00";
void test_gcc_write_client_cluster_data(void)
gcc_write_client_cluster_data(s, settings);
- ASSERT_STREAM(s, (uint8*) gcc_client_cluster_data_expected, sizeof(gcc_client_cluster_data_expected));
+ ASSERT_STREAM(s, (BYTE*) gcc_client_cluster_data_expected, sizeof(gcc_client_cluster_data_expected));
}
-uint8 gcc_client_network_data_expected[44] =
+BYTE gcc_client_network_data_expected[44] =
"\x03\xC0\x2C\x00\x03\x00\x00\x00\x72\x64\x70\x64\x72\x00\x00\x00"
"\x00\x00\x80\x80\x63\x6c\x69\x70\x72\x64\x72\x00\x00\x00\xA0\xC0"
"\x72\x64\x70\x73\x6e\x64\x00\x00\x00\x00\x00\xc0";
gcc_write_client_network_data(s, settings);
- ASSERT_STREAM(s, (uint8*) gcc_client_network_data_expected, sizeof(gcc_client_network_data_expected));
+ ASSERT_STREAM(s, (BYTE*) gcc_client_network_data_expected, sizeof(gcc_client_network_data_expected));
}
int CompareBitmaps(HGDI_BITMAP hBmp1, HGDI_BITMAP hBmp2)
{
int x, y;
- uint8 *p1, *p2;
+ BYTE *p1, *p2;
int minw = (hBmp1->width < hBmp2->width) ? hBmp1->width : hBmp2->width;
int minh = (hBmp1->height < hBmp2->height) ? hBmp1->height : hBmp2->height;
int bpp;
int width;
int height;
- uint8* data;
+ BYTE* data;
HGDI_BITMAP hBitmap;
bpp = 32;
width = 32;
height = 16;
- data = (uint8*) malloc(width * height * 4);
+ data = (BYTE*) malloc(width * height * 4);
hBitmap = gdi_CreateBitmap(width, height, bpp, data);
CU_ASSERT(hBitmap->objectType == GDIOBJECT_BITMAP);
{
HGDI_DC hdc;
HGDI_PEN pen;
- uint8* data;
+ BYTE* data;
HGDI_BITMAP hBmp;
HGDI_BITMAP hBmp_LineTo_1;
HGDI_BITMAP hBmp_LineTo_2;
clrconv->invert = 0;
clrconv->palette = hPalette;
- data = (uint8*) freerdp_image_convert((uint8*) line_to_case_1, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_case_1, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_1 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_case_2, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_case_2, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_2 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_case_3, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_case_3, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_3 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_case_4, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_case_4, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_4 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_case_5, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_case_5, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_5 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_case_5, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_case_5, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_5 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_case_6, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_case_6, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_6 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_case_7, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_case_7, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_7 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_case_8, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_case_8, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_8 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_case_9, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_case_9, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_9 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_case_10, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_case_10, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_10 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_case_11, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_case_11, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_11 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_BLACK, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_BLACK, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_BLACK = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_NOTMERGEPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_NOTMERGEPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_NOTMERGEPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_MASKNOTPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_MASKNOTPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_MASKNOTPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_NOTCOPYPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_NOTCOPYPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_NOTCOPYPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_MASKPENNOT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_MASKPENNOT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_MASKPENNOT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_NOT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_NOT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_NOT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_XORPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_XORPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_XORPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_NOTMASKPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_NOTMASKPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_NOTMASKPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_MASKPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_MASKPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_MASKPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_NOTXORPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_NOTXORPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_NOTXORPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_NOP, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_NOP, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_NOP = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_MERGENOTPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_MERGENOTPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_MERGENOTPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_COPYPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_COPYPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_COPYPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_MERGEPENNOT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_MERGEPENNOT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_MERGEPENNOT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_MERGEPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_MERGEPEN, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_MERGEPEN = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) line_to_R2_WHITE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) line_to_R2_WHITE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_LineTo_R2_WHITE = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
/* Test Case 1: (0,0) -> (15, 15) */
{
HGDI_DC hdc;
HGDI_PEN pen;
- uint8* data;
+ BYTE* data;
HGDI_BITMAP hBmp;
HGDI_BITMAP hBmp_Ellipse_1;
HGDI_BITMAP hBmp_Ellipse_2;
clrconv->invert = 0;
clrconv->palette = hPalette;
- data = (uint8*) freerdp_image_convert((uint8*) ellipse_case_1, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) ellipse_case_1, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_Ellipse_1 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) ellipse_case_2, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) ellipse_case_2, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_Ellipse_2 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) ellipse_case_3, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) ellipse_case_3, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_Ellipse_3 = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
/* Test Case 1: (0,0) -> (16, 16) */
void test_gdi_BitBlt_32bpp(void)
{
- uint8* data;
+ BYTE* data;
HGDI_DC hdcSrc;
HGDI_DC hdcDst;
HGDI_BRUSH hBrush;
clrconv->invert = 0;
clrconv->palette = hPalette;
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRC, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRC, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpSrc = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpDst = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpDstOriginal = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_PAT, NULL, 8, 8, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_PAT, NULL, 8, 8, 8, bitsPerPixel, clrconv);
hBmpPat = gdi_CreateBitmap(8, 8, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SPna, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SPna, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SPna = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_BLACKNESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_BLACKNESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_BLACKNESS = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_WHITENESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_WHITENESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_WHITENESS = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCAND, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRCAND, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCAND = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRCPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRCINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCERASE = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_NOTSRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_NOTSRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_NOTSRCCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_NOTSRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_NOTSRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_NOTSRCERASE = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_DSTINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_DSTINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_DSTINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_MERGECOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_MERGECOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_MERGECOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_MERGEPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_MERGEPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_MERGEPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_PATCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_PATCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_PATPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_PATPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_PATINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_PATINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
gdi_SelectObject(hdcSrc, (HGDIOBJECT) hBmpSrc);
void test_gdi_BitBlt_16bpp(void)
{
- uint8* data;
+ BYTE* data;
HGDI_DC hdcSrc;
HGDI_DC hdcDst;
HGDI_BRUSH hBrush;
clrconv->invert = 0;
clrconv->palette = hPalette;
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRC, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRC, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpSrc = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpDst = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpDstOriginal = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_PAT, NULL, 8, 8, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_PAT, NULL, 8, 8, 8, bitsPerPixel, clrconv);
hBmpPat = gdi_CreateBitmap(8, 8, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SPna, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SPna, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SPna = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_BLACKNESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_BLACKNESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_BLACKNESS = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_WHITENESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_WHITENESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_WHITENESS = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCAND, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRCAND, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCAND = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRCPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRCINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCERASE = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_NOTSRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_NOTSRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_NOTSRCCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_NOTSRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_NOTSRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_NOTSRCERASE = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_DSTINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_DSTINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_DSTINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_MERGECOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_MERGECOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_MERGECOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_MERGEPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_MERGEPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_MERGEPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_PATCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_PATCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_PATPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_PATPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_PATINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_PATINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
gdi_SelectObject(hdcSrc, (HGDIOBJECT) hBmpSrc);
void test_gdi_BitBlt_8bpp(void)
{
- uint8* data;
+ BYTE* data;
HGDI_DC hdcSrc;
HGDI_DC hdcDst;
HGDI_BRUSH hBrush;
clrconv->invert = 0;
clrconv->palette = hPalette;
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRC, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRC, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpSrc = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpDst = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_DST, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmpDstOriginal = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_PAT, NULL, 8, 8, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_PAT, NULL, 8, 8, 8, bitsPerPixel, clrconv);
hBmpPat = gdi_CreateBitmap(8, 8, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SPna, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SPna, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SPna = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_BLACKNESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_BLACKNESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_BLACKNESS = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_WHITENESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_WHITENESS, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_WHITENESS = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCAND, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRCAND, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCAND = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRCPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRCINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_SRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_SRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_SRCERASE = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_NOTSRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_NOTSRCCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_NOTSRCCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_NOTSRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_NOTSRCERASE, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_NOTSRCERASE = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_DSTINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_DSTINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_DSTINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_MERGECOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_MERGECOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_MERGECOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_MERGEPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_MERGEPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_MERGEPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_PATCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_PATCOPY, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATCOPY = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_PATPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_PATPAINT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATPAINT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
- data = (uint8*) freerdp_image_convert((uint8*) bmp_PATINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
+ data = (BYTE*) freerdp_image_convert((BYTE*) bmp_PATINVERT, NULL, 16, 16, 8, bitsPerPixel, clrconv);
hBmp_PATINVERT = gdi_CreateBitmap(16, 16, bitsPerPixel, data);
gdi_SelectObject(hdcSrc, (HGDIOBJECT) hBmpSrc);
/* Server License Request (2200 bytes) */
-uint8 server_license_request[2200] =
+BYTE server_license_request[2200] =
"\x01\x03\x98\x08\x84\xef\xae\x20\xb1\xd5\x9e\x36\x49\x1a\xe8\x2e"
"\x0a\x99\x89\xac\x49\xa6\x47\x4f\x33\x9b\x5a\xb9\x95\x03\xa6\xc6"
"\xc2\x3c\x3f\x61\x00\x00\x06\x00\x2c\x00\x00\x00\x4d\x00\x69\x00"
/* Client New License Request (341 bytes) */
-uint8 client_new_license_request[341] =
+BYTE client_new_license_request[341] =
"\x13\x83\x55\x01\x01\x00\x00\x00\x00\x00\x01\x04\xdc\x73\xa0\xc8"
"\x69\x25\x6b\x18\xaf\x0b\x94\x7a\xa9\xa5\x20\xaf\x8b\xbc\x0d\xcc"
"\xa3\x95\xb7\xb9\xeb\x81\x5d\xbe\x0a\x10\x9c\xd8\x02\x00\x08\x01"
/* Server Platform Challenge (38 bytes) */
-uint8 server_platform_challenge[38] =
+BYTE server_platform_challenge[38] =
"\x02\x03\x26\x00\xff\xff\xff\xff\x50\xf7\x0a\x00\x46\x37\x85\x54"
"\x8e\xc5\x91\x34\x97\x5d\x78\x94\xad\x3b\x81\xda\x88\x18\x56\x0f"
"\x3a\xd1\xf1\x03\xef\x35";
/* Client Platform Challenge Response (66 bytes) */
-uint8 client_platform_challenge_response[66] =
+BYTE client_platform_challenge_response[66] =
"\x15\x83\x42\x00\x01\x00\x12\x00\xfa\xb4\xe8\x24\xcf\x56\xb2\x4e"
"\x80\x02\xbd\xb6\x61\xfc\xdf\xe9\x6c\x44\x01\x00\x14\x00\xf8\xb5"
"\xe8\x25\x3d\x0f\x3f\x70\x1d\xda\x60\x19\x16\xfe\x73\x1a\x45\x7e"
"\x02\x71\x38\x23\x62\x5d\x10\x8b\x93\xc3\xf1\xe4\x67\x1f\x4a\xb6"
"\x00\x0a";
-uint8 license_server_modulus[256] =
+BYTE license_server_modulus[256] =
"\x88\xad\x7c\x8f\x8b\x82\x76\x5a\xbd\x8f\x6f\x62\x18\xe1\xd9\xaa"
"\x41\xfd\xed\x68\x01\xc6\x34\x35\xb0\x29\x04\xca\x4a\x4a\x1c\x7e"
"\x80\x14\xf7\x8e\x77\xb8\x25\xff\x16\x47\x6f\xbd\xe2\x34\x3d\x2e"
"\x6a\x9d\x7d\xde\xae\xf9\xe6\xaf\x57\xae\xb9\x01\x96\x5d\xe0\x4d"
"\xcd\xed\xc8\xd7\xf3\x01\x03\x38\x10\xbe\x7c\x42\x67\x01\xa7\x23";
-uint8 license_server_exponent[4] = "\x00\x01\x00\x01";
+BYTE license_server_exponent[4] = "\x00\x01\x00\x01";
-uint8 terminal_server_modulus[256] =
+BYTE terminal_server_modulus[256] =
"\xc8\x90\x6b\xf0\xc6\x58\x81\xa6\x89\x1c\x0e\xf2\xf6\xd9\x82\x12"
"\x71\xa5\x6e\x51\xdb\xe0\x32\x66\xaa\x91\x77\x0e\x88\xab\x44\xb7"
"\xd3\x97\xda\x78\x8f\x0e\x44\x26\x46\x7f\x16\xd4\xc6\x63\xeb\xca"
"\x88\x1f\xb4\x35\x0f\x7c\xc0\x75\x17\xc6\x67\xdd\x48\x80\xcb\x0a"
"\xbe\x9d\xf6\x93\x60\x65\x34\xeb\x97\xaf\x65\x6d\xdf\xbf\x6f\x5b";
-uint8 terminal_server_exponent[4] = "\x00\x01\x00\x01";
+BYTE terminal_server_exponent[4] = "\x00\x01\x00\x01";
-uint8 client_random[32] =
+BYTE client_random[32] =
"\xdc\x73\xa0\xc8\x69\x25\x6b\x18\xaf\x0b\x94\x7a\xa9\xa5\x20\xaf"
"\x8b\xbc\x0d\xcc\xa3\x95\xb7\xb9\xeb\x81\x5d\xbe\x0a\x10\x9c\xd8";
-uint8 server_random[32] =
+BYTE server_random[32] =
"\x84\xef\xae\x20\xb1\xd5\x9e\x36\x49\x1a\xe8\x2e\x0a\x99\x89\xac"
"\x49\xa6\x47\x4f\x33\x9b\x5a\xb9\x95\x03\xa6\xc6\xc2\x3c\x3f\x61";
-uint8 premaster_secret[48] =
+BYTE premaster_secret[48] =
"\xcf\x7a\xdb\xcb\xfb\x0e\x15\x23\x87\x1c\x84\x81\xba\x9d\x4e\x15"
"\xbb\xd2\x56\xbd\xd8\xf7\xf3\x16\xcc\x35\x3b\xe1\x93\x42\x78\xdd"
"\x92\x9a\xe4\x7a\xe2\x99\xd4\x73\xb1\xaa\x6f\x55\x94\x3b\xc9\xbc";
-uint8 encrypted_premaster_secret[264] =
+BYTE encrypted_premaster_secret[264] =
"\xda\x9c\x5d\xa6\x68\x9d\xa3\x90\x67\x24\xf3\x3a\xea\xa1\xe2\x68"
"\xad\x12\xf5\xf6\x0b\x7a\xac\x92\xb1\x69\x6f\x42\x55\x8a\xa0\xe2"
"\x9b\x2c\xd0\xc7\xee\x33\x6c\x47\x79\xc3\x1e\xbf\x03\x8b\x95\x70"
"\x09\x83\x0b\xbc\x3d\x3e\x05\x47\x65\x96\x31\x8c\x6b\xc5\xe6\xa0"
"\x00\x00\x00\x00\x00\x00\x00\x00";
-uint8 platform_challenge[10] = "\x54\x00\x45\x00\x53\x00\x54\x00\x00\x00";
+BYTE platform_challenge[10] = "\x54\x00\x45\x00\x53\x00\x54\x00\x00\x00";
void test_license(void)
{
license_read_platform_challenge_packet(license, s);
}
-uint8 test_client_random[32] =
+BYTE test_client_random[32] =
"\xdc\x73\xa0\xc8\x69\x25\x6b\x18\xaf\x0b\x94\x7a\xa9\xa5\x20\xaf"
"\x8b\xbc\x0d\xcc\xa3\x95\xb7\xb9\xeb\x81\x5d\xbe\x0a\x10\x9c\xd8";
-uint8 test_server_random[32] =
+BYTE test_server_random[32] =
"\x16\x7e\xf8\x71\x48\x16\x1a\x4f\xa5\x2c\xcd\x73\x63\x60\xa6\xc3"
"\xb9\x19\x1b\x4b\x6b\xb2\x0a\xb8\xec\xf1\x8d\x95\x4e\xa8\x21\xc5";
-uint8 test_premaster_secret[48] =
+BYTE test_premaster_secret[48] =
"\xcf\x7a\xdb\xcb\xfb\x0e\x15\x23\x87\x1c\x84\x81\xba\x9d\x4e\x15"
"\xbb\xd2\x56\xbd\xd8\xf7\xf3\x16\xcc\x35\x3b\xe1\x93\x42\x78\xdd"
"\x92\x9a\xe4\x7a\xe2\x99\xd4\x73\xb1\xaa\x6f\x55\x94\x3b\xc9\xbc";
-uint8 test_modulus[64] =
+BYTE test_modulus[64] =
"\x23\xc9\xec\x0e\x9f\x1e\x0e\x1a\x78\xaf\xa5\x14\xd4\xf5\x45\xe4"
"\x04\x6e\xf4\x01\xe9\xdf\x45\xd1\xc2\xae\xf4\x7f\xd3\xb9\xcb\xf3"
"\x1a\x23\xa1\x0d\x4b\xd4\xd1\x4a\xd2\xd1\xc9\x7c\xab\x24\x8b\xb1"
"\x5a\x93\xca\x34\x44\x17\xb5\xe4\xfe\xf7\x9a\xaa\x72\x0d\x41\x95";
-uint8 test_exponent[4] = "\x01\x00\x01\x00";
+BYTE test_exponent[4] = "\x01\x00\x01\x00";
-uint8 test_master_secret[48] =
+BYTE test_master_secret[48] =
"\xbe\x51\xee\x63\x23\x90\xd0\xf4\x3a\xce\x3a\x37\x65\xc3\xdd\xcf"
"\xed\xf0\xc8\x19\xed\x77\x33\x4e\xfd\x2b\x7d\x5a\xe2\xca\xf3\x0a"
"\xf1\x16\xe5\x0c\x78\x59\x7e\xd4\x4b\x57\xce\x17\x60\x3a\x5a\xb3";
-uint8 test_session_key_blob[48] =
+BYTE test_session_key_blob[48] =
"\x07\x4f\xa0\x2e\xee\xc4\x5a\x46\x21\x8c\xae\x01\x45\x02\x26\xe4"
"\x54\x6b\x59\x10\xcc\x5b\xd1\x96\xd0\x5c\xeb\xc2\x96\x9b\x44\x7b"
"\x1c\xd9\x66\xb1\x9e\x24\xaa\x60\x4f\x89\xd1\x4e\xf8\xb9\x55\x3b";
-uint8 test_mac_salt_key[16] =
+BYTE test_mac_salt_key[16] =
"\x07\x4f\xa0\x2e\xee\xc4\x5a\x46\x21\x8c\xae\x01\x45\x02\x26\xe4";
-uint8 test_licensing_encryption_key[16] =
+BYTE test_licensing_encryption_key[16] =
"\xf3\xb1\xe0\x3b\xfe\xb4\xf2\xc5\x28\xa9\x48\xcd\x90\xf1\x93\xe5";
-uint8 test_encrypted_premaster_secret[64] =
+BYTE test_encrypted_premaster_secret[64] =
"\x6b\xbc\x77\x9f\x20\x0c\x98\x39\xc1\x85\x77\xc8\x19\x87\xd8\x82"
"\x93\xbd\x21\x69\x5f\x87\xe0\xd6\x4e\xad\x5e\x23\x13\x80\x8c\x63"
"\x3e\xd6\x6e\x60\xc9\x40\xe9\x86\x08\x8c\xd5\xaa\xa9\x54\xfe\x27"
ASSERT_STREAM(s, test_encrypted_premaster_secret, sizeof(test_encrypted_premaster_secret));
}
-uint8 test_encrypted_platform_challenge[10] =
+BYTE test_encrypted_platform_challenge[10] =
"\x84\x0a\x42\x50\xad\x5e\xc1\x29\x30\xbd";
-uint8 test_platform_challenge[10] =
+BYTE test_platform_challenge[10] =
"\x54\x00\x45\x00\x53\x00\x54\x00\x00\x00";
void test_license_decrypt_platform_challenge(void)
sizeof(test_licensing_encryption_key));
license->encrypted_platform_challenge->data =
- (uint8*) malloc(sizeof(test_encrypted_platform_challenge));
+ (BYTE*) malloc(sizeof(test_encrypted_platform_challenge));
license->encrypted_platform_challenge->length =
sizeof(test_encrypted_platform_challenge);
return 0;
}
-uint8 gcc_CCrq[307] =
+BYTE gcc_CCrq[307] =
"\x00\x05\x00\x14\x7C\x00\x01\x81\x2A\x00\x08\x00\x10\x00\x01\xC0"
"\x00\x44\x75\x63\x61\x81\x1c\x01\xc0\xd8\x00\x04\x00\x08\x00\x00"
"\x05\x00\x04\x01\xCA\x03\xAA\x09\x04\x00\x00\xCE\x0E\x00\x00\x45"
"\x64\x72\x00\x00\x00\xA0\xC0\x72\x64\x70\x73\x6e\x64\x00\x00\x00"
"\x00\x00\xc0";
-uint8 mcs_connect_initial_expected[409] =
+BYTE mcs_connect_initial_expected[409] =
"\x7F\x65\x82\x01\x94\x04\x01\x01\x04\x01\x01\x01\x01\xFF\x30\x19"
"\x02\x01\x22\x02\x01\x02\x02\x01\x00\x02\x01\x01\x02\x01\x00\x02"
"\x01\x01\x02\x02\xFF\xFF\x02\x01\x02\x30\x19\x02\x01\x01\x02\x01"
s = stream_new(512);
mcs_write_connect_initial(s, mcs, user_data);
- ASSERT_STREAM(s, (uint8*) mcs_connect_initial_expected, sizeof(mcs_connect_initial_expected));
+ ASSERT_STREAM(s, (BYTE*) mcs_connect_initial_expected, sizeof(mcs_connect_initial_expected));
stream_free(s);
}
#include "rdp.h"
#include "test_mppc.h"
-uint8_t compressed_rd5[] =
+BYTE_t compressed_rd5[] =
{
0x24, 0x02, 0x03, 0x09, 0x00, 0x20, 0x0c, 0x05, 0x10, 0x01, 0x40, 0x0a, 0xbf, 0xdf, 0xc3, 0x20,
0x80, 0x00, 0x1f, 0x0a, 0x00, 0x00, 0x07, 0x43, 0x4e, 0x00, 0x68, 0x02, 0x00, 0x22, 0x00, 0x34,
0x7f, 0x52, 0x00
};
-uint8_t decompressed_rd5[] =
+BYTE_t decompressed_rd5[] =
{
0x24, 0x02, 0x03, 0x09, 0x00, 0x20, 0x0c, 0x05, 0x10, 0x01, 0x40, 0x0a, 0xff, 0xff, 0x0c, 0x84,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x0d, 0x38, 0x01, 0xc0, 0x10, 0x01, 0x10,
block_num++;
total += bytes_read;
DLOG(("block_num=%d\n", block_num));
- CU_ASSERT(compress_rdp(enc, (uint8*) buf, bytes_read) != FALSE);
+ CU_ASSERT(compress_rdp(enc, (BYTE*) buf, bytes_read) != FALSE);
if (enc->flags & PACKET_COMPRESSED)
{
DLOG(("%d bytes compressed to %d\n", bytes_read, enc->bytes_in_opb));
clen += enc->bytes_in_opb;
- CU_ASSERT(decompress_rdp_5(rmppc, (uint8 *) enc->outputBuffer,
+ CU_ASSERT(decompress_rdp_5(rmppc, (BYTE *) enc->outputBuffer,
enc->bytes_in_opb, enc->flags, &roff, &rlen) != FALSE);
CU_ASSERT(bytes_read == rlen);
CU_ASSERT(memcmp(buf, &rmppc->history_buf[roff], rlen) == 0);
/* save starting time */
gettimeofday(&start_time, NULL);
- CU_ASSERT(compress_rdp(enc, (uint8*) decompressed_rd5_data, data_len) != FALSE);
+ CU_ASSERT(compress_rdp(enc, (BYTE*) decompressed_rd5_data, data_len) != FALSE);
if (enc->flags & PACKET_COMPRESSED)
{
- CU_ASSERT(decompress_rdp_5(rmppc, (uint8 *) enc->outputBuffer,
+ CU_ASSERT(decompress_rdp_5(rmppc, (BYTE *) enc->outputBuffer,
enc->bytes_in_opb, enc->flags, &roff, &rlen) != FALSE);
CU_ASSERT(data_len == rlen);
CU_ASSERT(memcmp(decompressed_rd5_data, &rmppc->history_buf[roff], rlen) == 0);
#include "test_nsc.h"
-static const uint8 nsc_data[] =
+static const BYTE nsc_data[] =
{
0x71, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
0x03, 0x01, 0x00, 0x00, 0x63, 0x63, 0x01, 0x64, 0x64, 0x00, 0x63, 0x63, 0x02, 0x64, 0x64, 0x00,
0x37, 0x37, 0x06, 0x37, 0x37, 0x37, 0x37, 0xff, 0xff, 0x90, 0xff, 0xff, 0xff, 0xff
};
-static const uint8 nsc_stress_data[] =
+static const BYTE nsc_stress_data[] =
{
0xec, 0x04, 0x00, 0x00, 0xfb, 0x04, 0x00, 0x00, 0x74, 0x03, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00
, 0x03, 0x00, 0x00, 0x00, 0x94, 0x94, 0x0f, 0xa2, 0xb2, 0x8e, 0x61, 0x62, 0x82, 0x9b, 0xa8, 0xb0
, 0x00, 0x00, 0xff, 0xf7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
-static const uint8 rgb_scanline_data[] =
+static const BYTE rgb_scanline_data[] =
{
0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00,
0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00,
context = nsc_context_new();
nsc_context_set_cpu_opt(context, CPU_SSE2);
- nsc_process_message(context, 32, 15, 10, (uint8*) nsc_data, sizeof(nsc_data));
+ nsc_process_message(context, 32, 15, 10, (BYTE*) nsc_data, sizeof(nsc_data));
/*freerdp_hexdump(context->bmpdata, 15 * 10 * 4);*/
for (i = 0; i < 30000; i++)
{
- nsc_process_message(context, 32, 54, 44, (uint8*) nsc_stress_data, sizeof(nsc_stress_data));
+ nsc_process_message(context, 32, 54, 44, (BYTE*) nsc_stress_data, sizeof(nsc_stress_data));
}
nsc_context_free(context);
}
void test_nsc_encode(void)
{
int i;
- uint8* rgb_data;
+ BYTE* rgb_data;
STREAM* enc_stream;
NSC_CONTEXT* context;
- rgb_data = (uint8 *) malloc(64 * 64 * 3);
+ rgb_data = (BYTE *) malloc(64 * 64 * 3);
for (i = 0; i < 64; i++)
memcpy(rgb_data + i * 64 * 3, rgb_scanline_data, 64 * 3);
context = ntlm_ContextNew();
ntlm_set_password(context, password);
- ntlm_compute_ntlm_hash((uint16*) &password, ntlm_hash);
+ ntlm_compute_ntlm_hash((UINT16*) &password, ntlm_hash);
ntlm_hash_good = 1;
int i;
NTLM_CONTEXT* ntlm;
int client_signing_key_good;
- uint8 exported_session_key[16] = "\x89\x90\x0d\x5d\x2c\x53\x2b\x36\x31\xcc\x1a\x46\xce\xa9\x34\xf1";
- uint8 expected_client_signing_key[16] = "\xbf\x5e\x42\x76\x55\x68\x38\x97\x45\xd3\xb4\x9f\x5e\x2f\xbc\x89";
+ BYTE exported_session_key[16] = "\x89\x90\x0d\x5d\x2c\x53\x2b\x36\x31\xcc\x1a\x46\xce\xa9\x34\xf1";
+ BYTE expected_client_signing_key[16] = "\xbf\x5e\x42\x76\x55\x68\x38\x97\x45\xd3\xb4\x9f\x5e\x2f\xbc\x89";
ntlm = ntlm_client_new();
memcpy(ntlm->exported_session_key, exported_session_key, sizeof(exported_session_key));
int i;
NTLM_CONTEXT* ntlm;
int server_signing_key_good;
- uint8 exported_session_key[16] = "\x89\x90\x0d\x5d\x2c\x53\x2b\x36\x31\xcc\x1a\x46\xce\xa9\x34\xf1";
- uint8 expected_server_signing_key[16] = "\x9b\x3b\x64\x89\xda\x84\x52\x17\xd5\xc2\x6e\x90\x16\x3b\x42\x11";
+ BYTE exported_session_key[16] = "\x89\x90\x0d\x5d\x2c\x53\x2b\x36\x31\xcc\x1a\x46\xce\xa9\x34\xf1";
+ BYTE expected_server_signing_key[16] = "\x9b\x3b\x64\x89\xda\x84\x52\x17\xd5\xc2\x6e\x90\x16\x3b\x42\x11";
ntlm = ntlm_client_new();
memcpy(ntlm->exported_session_key, exported_session_key, sizeof(exported_session_key));
int i;
NTLM_CONTEXT* ntlm;
int client_sealing_key_good;
- uint8 exported_session_key[16] = "\x89\x90\x0d\x5d\x2c\x53\x2b\x36\x31\xcc\x1a\x46\xce\xa9\x34\xf1";
- uint8 expected_client_sealing_key[16] = "\xca\x41\xcd\x08\x48\x07\x22\x6e\x0d\x84\xc3\x88\xa5\x07\xa9\x73";
+ BYTE exported_session_key[16] = "\x89\x90\x0d\x5d\x2c\x53\x2b\x36\x31\xcc\x1a\x46\xce\xa9\x34\xf1";
+ BYTE expected_client_sealing_key[16] = "\xca\x41\xcd\x08\x48\x07\x22\x6e\x0d\x84\xc3\x88\xa5\x07\xa9\x73";
ntlm = ntlm_client_new();
memcpy(ntlm->exported_session_key, exported_session_key, sizeof(exported_session_key));
int i;
NTLM_CONTEXT* ntlm;
int server_sealing_key_good;
- uint8 exported_session_key[16] = "\x89\x90\x0d\x5d\x2c\x53\x2b\x36\x31\xcc\x1a\x46\xce\xa9\x34\xf1";
- uint8 expected_server_sealing_key[16] = "\x14\xb7\x1d\x06\x2c\x68\x2e\xad\x4b\x0e\x95\x23\x70\x91\x98\x90";
+ BYTE exported_session_key[16] = "\x89\x90\x0d\x5d\x2c\x53\x2b\x36\x31\xcc\x1a\x46\xce\xa9\x34\xf1";
+ BYTE expected_server_sealing_key[16] = "\x14\xb7\x1d\x06\x2c\x68\x2e\xad\x4b\x0e\x95\x23\x70\x91\x98\x90";
ntlm = ntlm_client_new();
memcpy(ntlm->exported_session_key, exported_session_key, sizeof(exported_session_key));
int i;
NTLM_CONTEXT* ntlm;
int encrypted_random_session_key_good;
- uint8 key_exchange_key[16] = "\x6e\xf1\x6b\x79\x88\xf2\x3d\x7e\x54\x2a\x1a\x38\x4e\xa0\x6b\x52";
- uint8 exported_session_key[16] = "\x89\x90\x0d\x5d\x2c\x53\x2b\x36\x31\xcc\x1a\x46\xce\xa9\x34\xf1";
- uint8 expected_encrypted_random_session_key[16] = "\xb1\xd2\x45\x42\x0f\x37\x9a\x0e\xe0\xce\x77\x40\x10\x8a\xda\xba";
+ BYTE key_exchange_key[16] = "\x6e\xf1\x6b\x79\x88\xf2\x3d\x7e\x54\x2a\x1a\x38\x4e\xa0\x6b\x52";
+ BYTE exported_session_key[16] = "\x89\x90\x0d\x5d\x2c\x53\x2b\x36\x31\xcc\x1a\x46\xce\xa9\x34\xf1";
+ BYTE expected_encrypted_random_session_key[16] = "\xb1\xd2\x45\x42\x0f\x37\x9a\x0e\xe0\xce\x77\x40\x10\x8a\xda\xba";
ntlm = ntlm_client_new();
memcpy(ntlm->key_exchange_key, key_exchange_key, 16);
int i;
NTLM_CONTEXT* ntlm;
int message_integrity_check_good;
- uint8 exported_session_key[16] = "\xfd\x35\x59\x39\x23\x81\x29\xcd\xb8\x1c\x11\x04\xd7\x54\x4f\xd4";
- uint8 expected_message_integrity_check[16] = "\x81\x37\x56\xcf\x19\x76\x71\xf2\xc0\x3f\x95\x87\xe3\x30\xe6\x9b";
+ BYTE exported_session_key[16] = "\xfd\x35\x59\x39\x23\x81\x29\xcd\xb8\x1c\x11\x04\xd7\x54\x4f\xd4";
+ BYTE expected_message_integrity_check[16] = "\x81\x37\x56\xcf\x19\x76\x71\xf2\xc0\x3f\x95\x87\xe3\x30\xe6\x9b";
- uint8 negotiate_message_data[40] =
+ BYTE negotiate_message_data[40] =
"\x4e\x54\x4c\x4d\x53\x53\x50\x00\x01\x00\x00\x00\xb7\x82\x08\xe2"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x06\x01\xb0\x1d\x00\x00\x00\x0f";
- uint8 challenge_message_data[278] =
+ BYTE challenge_message_data[278] =
"\x4e\x54\x4c\x4d\x53\x53\x50\x00\x02\x00\x00\x00\x16\x00\x16\x00"
"\x38\x00\x00\x00\x35\x82\x89\xe2\xed\x75\x9b\x8d\x1c\x2e\x3e\xc8"
"\x00\x00\x00\x00\x00\x00\x00\x00\xc8\x00\xc8\x00\x4e\x00\x00\x00"
"\x2e\x00\x63\x00\x78\x00\x07\x00\x08\x00\xd1\x12\x78\x10\xde\xd2"
"\xcb\x01\x00\x00\x00\x00";
- uint8 authenticate_message_data[504] =
+ BYTE authenticate_message_data[504] =
"\x4e\x54\x4c\x4d\x53\x53\x50\x00\x03\x00\x00\x00\x18\x00\x18\x00"
"\x98\x00\x00\x00\x38\x01\x38\x01\xb0\x00\x00\x00\x16\x00\x16\x00"
"\x58\x00\x00\x00\x1a\x00\x1a\x00\x6e\x00\x00\x00\x10\x00\x10\x00"
void test_ntlm_encrypt_message(void)
{
int i;
- uint8* p;
+ BYTE* p;
NTLM_CONTEXT* ntlm;
rdpBlob public_key;
rdpBlob ts_credentials;
rdpBlob encrypted_public_key;
rdpBlob encrypted_ts_credentials;
- uint8 public_key_signature[16];
- uint8 ts_credentials_signature[16];
+ BYTE public_key_signature[16];
+ BYTE ts_credentials_signature[16];
int encrypted_public_key_good;
int public_key_signature_good;
int encrypted_ts_credentials_good;
int ts_credentials_signature_good;
- uint8 client_signing_key[16] = "\xbf\x5e\x42\x76\x55\x68\x38\x97\x45\xd3\xb4\x9f\x5e\x2f\xbc\x89";
- uint8 client_sealing_key[16] = "\xca\x41\xcd\x08\x48\x07\x22\x6e\x0d\x84\xc3\x88\xa5\x07\xa9\x73";
+ BYTE client_signing_key[16] = "\xbf\x5e\x42\x76\x55\x68\x38\x97\x45\xd3\xb4\x9f\x5e\x2f\xbc\x89";
+ BYTE client_sealing_key[16] = "\xca\x41\xcd\x08\x48\x07\x22\x6e\x0d\x84\xc3\x88\xa5\x07\xa9\x73";
- uint8 public_key_data[270] =
+ BYTE public_key_data[270] =
"\x30\x82\x01\x0a\x02\x82\x01\x01\x00\xc2\x1c\x54\xaf\x07\xf1\x16"
"\x97\xc3\x0f\x6b\xa6\x33\x2e\xdd\x1e\xe4\xb2\x9c\xe4\x12\x7f\xda"
"\x58\x21\xc0\x68\xe6\xd3\xf5\x20\x1c\xba\x06\x64\x7d\x7f\x44\xb5"
"\x1b\xbc\x0b\x47\x66\x16\x3a\x7b\x6d\x8e\xcf\x55\xe8\x8c\x8a\xfe"
"\x24\xce\x19\x99\xc3\x5a\xe5\xc2\xf3\x02\x03\x01\x00\x01";
- uint8 expected_encrypted_public_key[270] =
+ BYTE expected_encrypted_public_key[270] =
"\x27\x29\x73\xa9\xfa\x46\x17\x3c\x74\x14\x45\x2a\xd1\xe2\x92\xa1"
"\xc6\x0a\x30\xd4\xcc\xe0\x92\xf6\xb3\x20\xb3\xa0\xf1\x38\xb1\xf4"
"\xe5\x96\xdf\xa1\x65\x5b\xd6\x0c\x2a\x86\x99\xcc\x72\x80\xbd\xe9"
"\xfb\xc9\xfc\x89\xaa\x5d\x25\x49\xc8\x6e\x86\xee\xc2\xce\xc4\x8e"
"\x85\x9f\xe8\x30\xb3\x86\x11\xd5\xb8\x34\x4a\xe0\x03\xe5";
- uint8 expected_public_key_signature[16] =
+ BYTE expected_public_key_signature[16] =
"\x01\x00\x00\x00\x91\x5e\xb0\x6e\x72\x82\x53\xae\x00\x00\x00\x00";
- uint8 ts_credentials_data[65] =
+ BYTE ts_credentials_data[65] =
"\x30\x3f\xa0\x03\x02\x01\x01\xa1\x38\x04\x36\x30\x34\xa0\x0a\x04"
"\x08\x77\x00\x69\x00\x6e\x00\x37\x00\xa1\x12\x04\x10\x75\x00\x73"
"\x00\x65\x00\x72\x00\x6e\x00\x61\x00\x6d\x00\x65\x00\xa2\x12\x04"
"\x10\x70\x00\x61\x00\x73\x00\x73\x00\x77\x00\x6f\x00\x72\x00\x64"
"\x00";
- uint8 expected_encrypted_ts_credentials[65] =
+ BYTE expected_encrypted_ts_credentials[65] =
"\xa8\x85\x7d\x11\xef\x92\xa0\xd6\xff\xee\xa1\xae\x6d\xc5\x2e\x4e"
"\x65\x50\x28\x93\x75\x30\xe1\xc3\x37\xeb\xac\x1f\xdd\xf3\xe0\x92"
"\xf6\x21\xbc\x8f\xa8\xd4\xe0\x5a\xa6\xff\xda\x09\x50\x24\x0d\x8f"
"\x8f\xf4\x92\xfe\x49\x2a\x13\x52\xa6\x52\x75\x50\x8d\x3e\xe9\x6b"
"\x57";
- uint8 expected_ts_credentials_signature[16] =
+ BYTE expected_ts_credentials_signature[16] =
"\x01\x00\x00\x00\xb3\x2c\x3b\xa1\x36\xf6\x55\x71\x01\x00\x00\x00";
public_key.data = public_key_data;
ntlm_encrypt_message(ntlm, &public_key, &encrypted_public_key, public_key_signature);
- p = (uint8*) encrypted_public_key.data;
+ p = (BYTE*) encrypted_public_key.data;
encrypted_public_key_good = 1;
for (i = 0; i < encrypted_public_key.length; i++)
ntlm_encrypt_message(ntlm, &ts_credentials, &encrypted_ts_credentials, ts_credentials_signature);
- p = (uint8*) encrypted_ts_credentials.data;
+ p = (BYTE*) encrypted_ts_credentials.data;
encrypted_ts_credentials_good = 1;
for (i = 0; i < encrypted_ts_credentials.length; i++)
void test_ntlm_decrypt_message(void)
{
int i;
- uint8* p;
+ BYTE* p;
NTLM_CONTEXT* ntlm;
rdpBlob public_key;
rdpBlob encrypted_public_key;
int public_key_good;
- uint8 server_signing_key[16] = "\x9b\x3b\x64\x89\xda\x84\x52\x17\xd5\xc2\x6e\x90\x16\x3b\x42\x11";
- uint8 server_sealing_key[16] = "\x14\xb7\x1d\x06\x2c\x68\x2e\xad\x4b\x0e\x95\x23\x70\x91\x98\x90";
+ BYTE server_signing_key[16] = "\x9b\x3b\x64\x89\xda\x84\x52\x17\xd5\xc2\x6e\x90\x16\x3b\x42\x11";
+ BYTE server_sealing_key[16] = "\x14\xb7\x1d\x06\x2c\x68\x2e\xad\x4b\x0e\x95\x23\x70\x91\x98\x90";
- uint8 encrypted_public_key_data[270] =
+ BYTE encrypted_public_key_data[270] =
"\xc7\x51\xf4\x71\xd3\x9f\xb6\x50\xbe\xa8\xf6\x20\x77\xa1\xfc\xdd"
"\x8e\x02\xf0\xa4\x6b\xba\x3f\x9d\x65\x9d\xab\x4a\x95\xc9\xb4\x38"
"\x03\x87\x04\xb1\xfe\x42\xec\xfa\xfc\xaa\x85\xf1\x31\x2d\x26\xcf"
"\xcd\x43\x3a\xce\x40\x74\xe1\x34\x81\xe3\x94\x47\x6f\x49\x01\xf8"
"\xb5\xfc\xd0\x75\x80\xc6\x35\xac\xc0\xfd\x1b\xb5\xa2\xd3";
- uint8 expected_public_key[270] =
+ BYTE expected_public_key[270] =
"\x31\x82\x01\x0a\x02\x82\x01\x01\x00\xc2\x1c\x54\xaf\x07\xf1\x16"
"\x97\xc3\x0f\x6b\xa6\x33\x2e\xdd\x1e\xe4\xb2\x9c\xe4\x12\x7f\xda"
"\x58\x21\xc0\x68\xe6\xd3\xf5\x20\x1c\xba\x06\x64\x7d\x7f\x44\xb5"
"\x1b\xbc\x0b\x47\x66\x16\x3a\x7b\x6d\x8e\xcf\x55\xe8\x8c\x8a\xfe"
"\x24\xce\x19\x99\xc3\x5a\xe5\xc2\xf3\x02\x03\x01\x00\x01";
- uint8 public_key_signature[16] =
+ BYTE public_key_signature[16] =
"\x01\x00\x00\x00\xc9\x88\xfc\xf1\x11\x68\x2c\x72\x00\x00\x00\x00";
encrypted_public_key.data = encrypted_public_key_data;
ntlm_decrypt_message(ntlm, &encrypted_public_key, &public_key, public_key_signature);
- p = (uint8*) public_key.data;
+ p = (BYTE*) public_key.data;
public_key_good = 1;
for (i = 0; i < public_key.length; i++)
return 0;
}
-uint8 dstblt_order[] = "\x48\x00\x37\x01";
+BYTE dstblt_order[] = "\x48\x00\x37\x01";
void test_read_dstblt_order(void)
{
CU_ASSERT(stream_get_length(s) == (sizeof(dstblt_order) - 1));
}
-uint8 patblt_order[] = "\x1a\x00\xc3\x01\x0d\x00\x0d\x00\xf0\xff\xff\x00\x5b\xef\x00\x81";
+BYTE patblt_order[] = "\x1a\x00\xc3\x01\x0d\x00\x0d\x00\xf0\xff\xff\x00\x5b\xef\x00\x81";
void test_read_patblt_order(void)
{
CU_ASSERT(stream_get_length(s) == (sizeof(patblt_order) - 1));
}
-uint8 scrblt_order[] = "\x07\x00\xa1\x01\xf1\x00\xcc\x2f\x01\x8e\x00";
+BYTE scrblt_order[] = "\x07\x00\xa1\x01\xf1\x00\xcc\x2f\x01\x8e\x00";
void test_read_scrblt_order(void)
{
CU_ASSERT(stream_get_length(s) == (sizeof(scrblt_order) - 1));
}
-uint8 opaque_rect_order[] = "\x00\x04\x00\x03\x73\x02\x06";
+BYTE opaque_rect_order[] = "\x00\x04\x00\x03\x73\x02\x06";
void test_read_opaque_rect_order(void)
{
CU_ASSERT(stream_get_length(s) == (sizeof(opaque_rect_order) - 1));
}
-uint8 draw_nine_grid_order[] = "\xfb\xf9\x0d\x00";
+BYTE draw_nine_grid_order[] = "\xfb\xf9\x0d\x00";
void test_read_draw_nine_grid_order(void)
{
}
-uint8 multi_opaque_rect_order[] =
+BYTE multi_opaque_rect_order[] =
"\x87\x01\x1c\x01\xf1\x00\x12\x00\x5c\xef\x04\x16\x00\x08\x40\x81"
"\x87\x81\x1c\x80\xf1\x01\x01\x01\x10\x80\xf0\x01\x10\xff\x10\x10"
"\x80\xf1\x01";
CU_ASSERT(stream_get_length(s) == (sizeof(multi_opaque_rect_order) - 1));
}
-uint8 line_to_order[] = "\x03\xb1\x0e\xa6\x5b\xef\x00";
+BYTE line_to_order[] = "\x03\xb1\x0e\xa6\x5b\xef\x00";
void test_read_line_to_order(void)
{
CU_ASSERT(stream_get_length(s) == (sizeof(line_to_order) - 1));
}
-uint8 polyline_order[] =
+BYTE polyline_order[] =
"\xf8\x01\xb8\x02\x00\xc0\x00\x20\x6c\x00\x00\x00\x00\x00\x04\x00"
"\x00\xff\x7e\x76\xff\x41\x6c\xff\x24\x62\xff\x2b\x59\xff\x55\x51"
"\xff\x9c\x49\x73\x43\x80\x4d\xff\xbe\x80\x99\xff\xba\x80\xcd\xff"
CU_ASSERT(stream_get_length(s) == (sizeof(polyline_order) - 1));
}
-uint8 glyph_index_order_1[] =
+BYTE glyph_index_order_1[] =
"\x6a\x02\x27\x38\x00\x39\x07\x3a\x06\x3b\x07\x3c\x06\x3d\x06\x18"
"\x04\x1f\x06\x17\x02\x14\x04\x1b\x06\x19\x06\x45\x05\x18\x06\x1f"
"\x06\x1f\x02\x14\x02\x46\x06\xff\x15\x24";
-uint8 glyph_index_order_2[] =
+BYTE glyph_index_order_2[] =
"\x00\xff\xff\xff\x0c\x02\x6e\x01\x4d\x02\x7b\x01\x09\x02\x6e\x01"
"\xf6\x02\x7b\x01\x0c\x02\x79\x01\x03\xfe\x04\x00";
CU_ASSERT(stream_get_length(s) == (sizeof(glyph_index_order_2) - 1));
}
-uint8 fast_index_order[] =
+BYTE fast_index_order[] =
"\x07\x00\x03\xff\xff\x00\x74\x3b\x00\x0e\x00\x71\x00\x42\x00\x7e"
"\x00\x00\x80\x7c\x00\x15\x00\x00\x01\x06\x02\x04\x03\x08\x05\x09"
"\x06\x06\x06\x06\x07\x06\x08\x02\xff\x00\x12";
CU_ASSERT(stream_get_length(s) == (sizeof(fast_index_order) - 1));
}
-uint8 fast_glyph_order[] =
+BYTE fast_glyph_order[] =
"\x06\x00\x03\xff\xff\x00\x8b\x00\xb1\x00\x93\x00\xbe\x00\x0d\x00"
"\xfe\x7f\x00\x80\x00\x80\xbb\x00\x13\x00\x01\x4a\x06\x0a\x80\x80"
"\x80\xb8\xc4\x84\x84\x84\x84\x84\x00\x00\x68\x00";
CU_ASSERT(stream_get_length(s) == (sizeof(fast_glyph_order) - 1));
}
-uint8 polygon_cb_order[] =
+BYTE polygon_cb_order[] =
"\xea\x00\x46\x01\x0d\x01\x08\x00\x00\x04\x03\x81\x08\x03\x05\x88"
"\x09\x26\x09\x77";
CU_ASSERT(stream_get_length(s) == (sizeof(polygon_cb_order) - 1));
}
-uint8 cache_bitmap_order[] = "\x00\x00\x10\x01\x08\x01\x00\x00\x00\x10";
+BYTE cache_bitmap_order[] = "\x00\x00\x10\x01\x08\x01\x00\x00\x00\x10";
void test_read_cache_bitmap_order(void)
{
STREAM _s, *s;
- uint16 extraFlags;
+ UINT16 extraFlags;
CACHE_BITMAP_ORDER cache_bitmap;
s = &_s;
CU_ASSERT(stream_get_length(s) == (sizeof(cache_bitmap_order) - 1));
}
-uint8 cache_bitmap_v2_order[] =
+BYTE cache_bitmap_v2_order[] =
"\x20\x40\xdc\xff\xff\x85\xff\xff\x99\xd6\x99\xd6\x99\xd6\x99\xd6"
"\x06\x8b\x99\xd6\x99\xd6\x99\xd6\x10\x84\x08\x42\x08\x42\x10\x84"
"\x99\xd6\x99\xd6\x99\xd6\x99\xd6\x06\x84\x99\xd6\x99\xd6\x99\xd6"
void test_read_cache_bitmap_v2_order(void)
{
STREAM _s, *s;
- uint16 extraFlags;
+ UINT16 extraFlags;
CACHE_BITMAP_V2_ORDER cache_bitmap_v2;
s = &_s;
CU_ASSERT(stream_get_length(s) == (sizeof(cache_bitmap_v2_order) - 1));
}
-uint8 cache_bitmap_v3_order[] =
+BYTE cache_bitmap_v3_order[] =
"\xff\x7f\x35\x50\xec\xbc\x74\x52\x65\xb7\x20\x00\x00\x00\x05\x00"
"\x02\x00\x28\x00\x00\x00\x5b\x4f\x45\xff\x5b\x4f\x45\xff\x5b\x4f"
"\x45\xff\x5b\x4f\x45\xff\x5b\x4f\x45\xff\x5b\x50\x45\xff\x5b\x50"
void test_read_cache_bitmap_v3_order(void)
{
STREAM _s, *s;
- uint16 extraFlags;
+ UINT16 extraFlags;
CACHE_BITMAP_V3_ORDER cache_bitmap_v3;
s = &_s;
CU_ASSERT(stream_get_length(s) == (sizeof(cache_bitmap_v3_order) - 1));
}
-uint8 cache_brush_order[] = "\x00\x01\x08\x08\x81\x08\xaa\x55\xaa\x55\xaa\x55\xaa\x55";
+BYTE cache_brush_order[] = "\x00\x01\x08\x08\x81\x08\xaa\x55\xaa\x55\xaa\x55\xaa\x55";
void test_read_cache_brush_order(void)
{
CU_ASSERT(stream_get_length(s) == (sizeof(cache_brush_order) - 1));
}
-uint8 create_offscreen_bitmap_order[] = "\x00\x80\x60\x01\x10\x00\x01\x00\x02\x00";
+BYTE create_offscreen_bitmap_order[] = "\x00\x80\x60\x01\x10\x00\x01\x00\x02\x00";
void test_read_create_offscreen_bitmap_order(void)
{
deleteList = &(create_offscreen_bitmap.deleteList);
deleteList->cIndices = 0;
deleteList->sIndices = 16;
- deleteList->indices = malloc(sizeof(uint16) * deleteList->sIndices);
+ deleteList->indices = malloc(sizeof(UINT16) * deleteList->sIndices);
update_read_create_offscreen_bitmap_order(s, &create_offscreen_bitmap);
CU_ASSERT(stream_get_length(s) == (sizeof(create_offscreen_bitmap_order) - 1));
}
-uint8 switch_surface_order[] = "\xff\xff";
+BYTE switch_surface_order[] = "\xff\xff";
void test_read_switch_surface_order(void)
{
int polyline_count;
int patblt_count;
-uint8 orders_update_1[] =
+BYTE orders_update_1[] =
"\x00\x00\x33\xd0\x07\x00\x80\xba\x0d\x0a\x7f\x1e\x2c\x4d\x00\x36"
"\x02\xd3\x00\x47\x00\x4d\x00\xf0\x01\x87\x00\xc2\xdc\xff\x05\x7f"
"\x0f\x67\x01\x90\x01\x8e\x01\xa5\x01\x67\x01\x90\x01\x28\x00\x16"
"\x03\x15\x0f\xf0\x65\x01\x15\xfe\x65\x01\xb0\xfd\x1d\x16\x01\xf0"
"\xff\xff\x01\x01\x7a";
-uint8 orders_update_2[] =
+BYTE orders_update_2[] =
"\x00\x00\x45\x62\x03\x00\x93\x14\x55\x01\x50\xff\xff\xff\x55\x01"
"\x50\x01\x01\x01\x55\x01\x50\xff\xff\xff\x16\x00\x17\x00\xea\x03"
"\xea\x03\x02\x00\x85\x02\x16\x00\x02\x00\x00\x00\x03\x00\x14\xb2";
return 0;
}
-uint8 test_packet_1[16] =
+BYTE test_packet_1[16] =
"\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA";
-uint8 test_packet_2[32] =
+BYTE test_packet_2[32] =
"\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB"
"\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB\xBB";
-uint8 test_packet_3[64] =
+BYTE test_packet_3[64] =
"\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC"
"\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC"
"\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC"
}
-static uint8 client_handshake[] =
+static BYTE client_handshake[] =
{
0x05, 0x00, 0x08, 0x00, 0xb0, 0x1d, 0x00, 0x00
};
-static uint8 client_info_pdu[] =
+static BYTE client_info_pdu[] =
{
0x0b, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00
};
// WorkingDir: f:\windows\system32
// Arguments: www.bing.com
-static uint8 client_execute_pdu[] =
+static BYTE client_execute_pdu[] =
{
0x01,0x00,0x5e,0x00,0x08,0x00,0x14,0x00,0x26,0x00,0x18,0x00,0x7c,0x00,
0x7c,0x00,0x69,0x00,0x65,0x00,0x78,0x00,0x70,0x00,0x6c,0x00,0x6f,0x00,
0x67,0x00,0x2e,0x00,0x63,0x00,0x6f,0x00,0x6d,0x00
};
-static uint8 client_activate_pdu[] =
+static BYTE client_activate_pdu[] =
{
0x02,0x00,
0x09,0x00,
-static uint8 client_sysparam_highcontrast_pdu[] =
+static BYTE client_sysparam_highcontrast_pdu[] =
{
0x03,0x00,
0x12,0x00,
};
-static uint8 client_sysparam_taskbarpos_pdu[] =
+static BYTE client_sysparam_taskbarpos_pdu[] =
{
0x03,0x00,
0x10,0x00,
0xc2,0x03 // 0x03c2
};
-static uint8 client_sysparam_mousebuttonswap_pdu[] =
+static BYTE client_sysparam_mousebuttonswap_pdu[] =
{
0x03,0x00,
0x09,0x00,
};
-static uint8 client_sysparam_keyboardpref_pdu[] =
+static BYTE client_sysparam_keyboardpref_pdu[] =
{
0x03,0x00,
0x09,0x00,
};
-static uint8 client_sysparam_dragfullwindow_pdu[] =
+static BYTE client_sysparam_dragfullwindow_pdu[] =
{
0x03,0x00,
0x09,0x00,
};
-static uint8 client_sysparam_keyboardcues_pdu[] =
+static BYTE client_sysparam_keyboardcues_pdu[] =
{
0x03,0x00,
0x09,0x00,
0x00 // FALSE
};
-static uint8 client_sysparam_setworkarea_pdu[] =
+static BYTE client_sysparam_setworkarea_pdu[] =
{
0x03,0x00,
0x10,0x00,
0x9a,0x03 // 0x039a
};
-static uint8 client_syscommand_pdu[] =
+static BYTE client_syscommand_pdu[] =
{
0x04,0x00,
0x0a,0x00,
0x20,0xf0
};
-static uint8 client_notify_pdu[] =
+static BYTE client_notify_pdu[] =
{
0x06,0x00,
0x10,0x00,
0x04,0x02,0x00,0x00
};
-static uint8 client_windowmove_pdu[] =
+static BYTE client_windowmove_pdu[] =
{
0x08,0x00,
0x10,0x00,
0x88,0x01
};
-static uint8 client_system_menu_pdu[] =
+static BYTE client_system_menu_pdu[] =
{
0x0c,0x00,
0x0c,0x00,
0x4a,0x02
};
-static uint8 client_langbar_pdu[] =
+static BYTE client_langbar_pdu[] =
{
0x0D,0x00,0x08,0x00,0x01,0x00,0x00,0x00
};
-static uint8 client_get_app_id_req_pdu[] =
+static BYTE client_get_app_id_req_pdu[] =
{
0x0E,0x00,0x08,0x00,0x52,0x00,0x02,0x00
};
-static uint8 server_handshake[] =
+static BYTE server_handshake[] =
{
0x05, 0x00, 0x08, 0x00, 0xb0, 0x1d, 0x00, 0x00
};
-static uint8 server_exec_result_pdu[] =
+static BYTE server_exec_result_pdu[] =
{
0x80,0x00,0x24,0x00,0x08,0x00,0x03,0x00,0x15,0x00,0x00,0x00,0x00,0x00,
0x14,0x00,0x7c,0x00,0x7c,0x00,0x57,0x00,0x72,0x00,0x6f,0x00,0x6e,0x00,
0x67,0x00,0x41,0x00,0x70,0x00,0x70,0x00
};
-static uint8 server_exec_result_exe_or_file[] =
+static BYTE server_exec_result_exe_or_file[] =
{
0x7c,0x00,0x7c,0x00,0x57,0x00,0x72,0x00,0x6f,0x00,0x6e,0x00,
0x67,0x00,0x41,0x00,0x70,0x00,0x70,0x00
};
-static uint8 server_sysparam1_pdu[] =
+static BYTE server_sysparam1_pdu[] =
{
0x03,0x00,
0x09,0x00,
0x00
};
-static uint8 server_sysparam2_pdu[] =
+static BYTE server_sysparam2_pdu[] =
{
0x03,0x00,
0x09,0x00,
0x00
};
-static uint8 server_localmovesize_start_pdu[] =
+static BYTE server_localmovesize_start_pdu[] =
{
0x09,0x00,0x10,0x00,0x8e,0x00,0x07,0x00,0x01,0x00,0x09,0x00,0x7e,0x01,
0x0a,0x00
};
-static uint8 server_localmovesize_stop_pdu[] =
+static BYTE server_localmovesize_stop_pdu[] =
{
0x09,0x00,0x10,0x00,0x8e,0x00,0x07,0x00,0x00,0x00,0x09,0x00,0xa6,0x00,
0x44,0x00
};
-static uint8 server_minmaxinfo_pdu[] =
+static BYTE server_minmaxinfo_pdu[] =
{
0x0a,0x00,0x18,0x00,0x8e,0x00,0x07,0x00,0x08,0x04,0xd6,0x02,0x00,0x00,
0x00,0x00,0x70,0x00,0x1b,0x00,0x0c,0x04,0x0c,0x03
};
-static uint8 server_langbar_pdu[] =
+static BYTE server_langbar_pdu[] =
{
0x0D,0x00,0x08,0x00,0x01,0x00,0x00,0x00
};
-static uint8 server_app_get_resp_pdu[] =
+static BYTE server_app_get_resp_pdu[] =
{
0x0F,0x00,0x08,0x02,0x52,0x00,0x02,0x00,0x6d,0x00,0x69,0x00,0x63,0x00,
0x72,0x00,0x6f,0x00,0x73,0x00,0x6f,0x00,0x66,0x00,0x74,0x00,0x2e,0x00,
0x00,0x00,0x00,0x00,0x00,0x00
};
-static uint8 server_app_get_resp_app_id[] =
+static BYTE server_app_get_resp_app_id[] =
{
0x6d,0x00,0x69,0x00,0x63,0x00,0x72,0x00,0x6f,0x00,0x73,0x00,0x6f,0x00,
0x66,0x00,0x74,0x00,0x2e,0x00,0x77,0x00,0x69,0x00,0x6e,0x6f,0x00,0x77,
for (i=0; i < size; i++)
{
- if (((uint8*)dataS)[i] != ((uint8*)data)[i])
+ if (((BYTE*)dataS)[i] != ((BYTE*)data)[i])
{
printf("----------------- stream_equal_dump -----------------\n");
printf("Stream and dump have different content from %d offset.\n", (int) i);
//-----------------------------------------------------------------------------
static void send_ui_event2plugin(
rdpChannels* chan_man,
- uint16 event_type,
+ UINT16 event_type,
void * data
)
{
}
//-----------------------------------------------------------------------------
static int emulate_client_send_channel_data(
- freerdp* freerdp, int channelId, uint8* data, int size
+ freerdp* freerdp, int channelId, BYTE* data, int size
)
{
static int counter = 0;
#include "test_rfx.h"
-static const uint8 y_data[] =
+static const BYTE y_data[] =
{
0x19, 0x82, 0x1d, 0x10, 0x62, 0x9d, 0x28, 0x85, 0x2c, 0xa2, 0x14, 0xb2, 0x88,
0x52, 0xca, 0x21, 0x4b, 0x28, 0x85, 0x2c, 0xa2, 0x14, 0xb2, 0x88, 0x52, 0xca, 0x21, 0x4b, 0x28,
0x4d, 0x43, 0x46, 0xd7, 0xe9, 0xe2, 0x20, 0x30, 0x00
};
-static const uint8 cb_data[] =
+static const BYTE cb_data[] =
{
0x1b, 0x04, 0x7f, 0x04, 0x31, 0x5f, 0xc2,
0x94, 0xaf, 0x05, 0x29, 0x5e, 0x0a, 0x52, 0xbc, 0x14, 0xa5, 0x78, 0x29, 0x25, 0x78, 0x29, 0x25,
0x77, 0x82, 0xbc, 0x00, 0x18, 0x00
};
-static const uint8 cr_data[] =
+static const BYTE cr_data[] =
{
0x1b, 0xfc, 0x11, 0xc1, 0x0f, 0x4a, 0xc1, 0x4f, 0x4a, 0xc1,
0x4f, 0x4a, 0xa1, 0x4d, 0x95, 0x42, 0x9e, 0x95, 0x42, 0x9e, 0x95, 0x42, 0x9b, 0x2a, 0x85, 0x3d,
6, 6, 6, 6, 7, 7, 8, 8, 8, 9
};
-static const uint8 rgb_scanline_data[] =
+static const BYTE rgb_scanline_data[] =
{
0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00,
0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00,
0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF
};
-static uint8* rgb_data;
+static BYTE* rgb_data;
int init_rfx_suite(void)
{
void test_bitstream(void)
{
- uint16 b;
+ UINT16 b;
RFX_BITSTREAM* bs;
bs = xnew(RFX_BITSTREAM);
- rfx_bitstream_attach(bs, (uint8*) y_data, sizeof(y_data));
+ rfx_bitstream_attach(bs, (BYTE*) y_data, sizeof(y_data));
while (!rfx_bitstream_eos(bs))
{
rfx_bitstream_get_bits(bs, 3, b);
void test_bitstream_enc(void)
{
- uint8 buffer[10];
+ BYTE buffer[10];
RFX_BITSTREAM* bs;
int i;
//printf("\n");
}
-static sint16 buffer[4096];
+static INT16 buffer[4096];
-void dump_buffer(sint16* buf, int n)
+void dump_buffer(INT16* buf, int n)
{
int i;
}
/* Dump a .ppm image. */
-static void dump_ppm_image(uint8* image_buf)
+static void dump_ppm_image(BYTE* image_buf)
{
static int frame_id = 0;
char buf[100];
void test_decode(void)
{
RFX_CONTEXT* context;
- uint8 decode_buffer[4096 * 3];
+ BYTE decode_buffer[4096 * 3];
STREAM* s;
s = stream_new(sizeof(y_data) + sizeof(cb_data) + sizeof(cr_data));
STREAM* enc_stream;
int y_size, cb_size, cr_size;
int i;
- uint8 decode_buffer[4096 * 3];
+ BYTE decode_buffer[4096 * 3];
- rgb_data = (uint8 *) malloc(64 * 64 * 3);
+ rgb_data = (BYTE *) malloc(64 * 64 * 3);
for (i = 0; i < 64; i++)
memcpy(rgb_data + i * 64 * 3, rgb_scanline_data, 64 * 3);
//freerdp_hexdump(rgb_data, 64 * 64 * 3);
RFX_RECT rect = {0, 0, 100, 80};
RFX_MESSAGE * message;
- rgb_data = (uint8 *) malloc(100 * 80 * 3);
+ rgb_data = (BYTE *) malloc(100 * 80 * 3);
for (i = 0; i < 80; i++)
memcpy(rgb_data + i * 100 * 3, rgb_scanline_data, 100 * 3);
{
uint32 sIndices;
uint32 cIndices;
- uint16* indices;
+ UINT16* indices;
};
typedef struct _OFFSCREEN_DELETE_LIST OFFSCREEN_DELETE_LIST;
uint32 bitmapHeight;
uint32 bitmapSize;
uint32 bitmapBlockSize;
- uint8* bitmapBlock;
+ BYTE* bitmapBlock;
};
typedef struct _STREAM_BITMAP_FIRST_ORDER STREAM_BITMAP_FIRST_ORDER;
uint32 bitmapFlags;
uint32 bitmapType;
uint32 bitmapBlockSize;
- uint8* bitmapBlock;
+ BYTE* bitmapBlock;
};
typedef struct _STREAM_BITMAP_NEXT_ORDER STREAM_BITMAP_NEXT_ORDER;
uint32 cbSize;
uint32 cbTotalSize;
uint32 cbTotalEmfSize;
- uint8* emfRecords;
+ BYTE* emfRecords;
};
typedef struct _DRAW_GDIPLUS_FIRST_ORDER DRAW_GDIPLUS_FIRST_ORDER;
struct _DRAW_GDIPLUS_NEXT_ORDER
{
uint32 cbSize;
- uint8* emfRecords;
+ BYTE* emfRecords;
};
typedef struct _DRAW_GDIPLUS_NEXT_ORDER DRAW_GDIPLUS_NEXT_ORDER;
uint32 cbSize;
uint32 cbTotalSize;
uint32 cbTotalEmfSize;
- uint8* emfRecords;
+ BYTE* emfRecords;
};
typedef struct _DRAW_GDIPLUS_END_ORDER DRAW_GDIPLUS_END_ORDER;
uint32 cacheIndex;
uint32 cbSize;
uint32 cbTotalSize;
- uint8* emfRecords;
+ BYTE* emfRecords;
};
typedef struct _DRAW_GDIPLUS_CACHE_FIRST_ORDER DRAW_GDIPLUS_CACHE_FIRST_ORDER;
uint32 cacheType;
uint32 cacheIndex;
uint32 cbSize;
- uint8* emfRecords;
+ BYTE* emfRecords;
};
typedef struct _DRAW_GDIPLUS_CACHE_NEXT_ORDER DRAW_GDIPLUS_CACHE_NEXT_ORDER;
uint32 cacheIndex;
uint32 cbSize;
uint32 cbTotalSize;
- uint8* emfRecords;
+ BYTE* emfRecords;
};
typedef struct _DRAW_GDIPLUS_CACHE_END_ORDER DRAW_GDIPLUS_CACHE_END_ORDER;
struct rdpsnd_format
{
- uint16 wFormatTag;
- uint16 nChannels;
+ UINT16 wFormatTag;
+ UINT16 nChannels;
uint32 nSamplesPerSec;
- uint16 nBlockAlign;
- uint16 wBitsPerSample;
- uint16 cbSize;
- uint8* data;
+ UINT16 nBlockAlign;
+ UINT16 wBitsPerSample;
+ UINT16 cbSize;
+ BYTE* data;
};
#define SNDC_CLOSE 1
FREERDP_API BOOL WTSVirtualChannelRead(
/* __in */ void* hChannelHandle,
/* __in */ uint32 TimeOut,
- /* __out */ uint8* Buffer,
+ /* __out */ BYTE* Buffer,
/* __in */ uint32 BufferSize,
/* __out */ uint32* pBytesRead);
*/
FREERDP_API BOOL WTSVirtualChannelWrite(
/* __in */ void* hChannelHandle,
- /* __in */ uint8* Buffer,
+ /* __in */ BYTE* Buffer,
/* __in */ uint32 Length,
/* __out */ uint32* pBytesWritten);
{
RDP_EVENT event;
uint32* formats;
- uint16 num_formats;
- uint8* raw_format_data;
+ UINT16 num_formats;
+ BYTE* raw_format_data;
uint32 raw_format_data_size;
};
typedef struct _RDP_CB_FORMAT_LIST_EVENT RDP_CB_FORMAT_LIST_EVENT;
struct _RDP_CB_DATA_RESPONSE_EVENT
{
RDP_EVENT event;
- uint8* data;
+ BYTE* data;
uint32 size;
};
typedef struct _RDP_CB_DATA_RESPONSE_EVENT RDP_CB_DATA_RESPONSE_EVENT;
struct _RDP_VIDEO_FRAME_EVENT
{
RDP_EVENT event;
- uint8* frame_data;
+ BYTE* frame_data;
uint32 frame_size;
uint32 frame_pixfmt;
- sint16 frame_width;
- sint16 frame_height;
- sint16 x;
- sint16 y;
- sint16 width;
- sint16 height;
- uint16 num_visible_rects;
+ INT16 frame_width;
+ INT16 frame_height;
+ INT16 x;
+ INT16 y;
+ INT16 width;
+ INT16 height;
+ UINT16 num_visible_rects;
RDP_RECT* visible_rects;
};
typedef struct _RDP_VIDEO_FRAME_EVENT RDP_VIDEO_FRAME_EVENT;
struct _RDP_REDRAW_EVENT
{
RDP_EVENT event;
- sint16 x;
- sint16 y;
- sint16 width;
- sint16 height;
+ INT16 x;
+ INT16 y;
+ INT16 width;
+ INT16 height;
};
typedef struct _RDP_REDRAW_EVENT RDP_REDRAW_EVENT;
#include <freerdp/api.h>
#include <freerdp/types.h>
-FREERDP_API BOOL bitmap_decompress(uint8* srcData, uint8* dstData, int width, int height, int size, int srcBpp, int dstBpp);
+FREERDP_API BOOL bitmap_decompress(BYTE* srcData, BYTE* dstData, int width, int height, int size, int srcBpp, int dstBpp);
#endif /* __BITMAP_H */
#define IBPP(_bpp) (((_bpp + 1)/ 8) % 5)
-typedef uint8* (*p_freerdp_image_convert)(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv);
-
-FREERDP_API uint8* freerdp_image_convert(uint8* srcData, uint8 *dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv);
-FREERDP_API uint8* freerdp_glyph_convert(int width, int height, uint8* data);
-FREERDP_API void freerdp_bitmap_flip(uint8 * src, uint8 * dst, int scanLineSz, int height);
-FREERDP_API uint8* freerdp_image_flip(uint8* srcData, uint8* dstData, int width, int height, int bpp);
-FREERDP_API uint8* freerdp_icon_convert(uint8* srcData, uint8* dstData, uint8* mask, int width, int height, int bpp, HCLRCONV clrconv);
-FREERDP_API uint8* freerdp_mono_image_convert(uint8* srcData, int width, int height, int srcBpp, int dstBpp, uint32 bgcolor, uint32 fgcolor, HCLRCONV clrconv);
-FREERDP_API void freerdp_alpha_cursor_convert(uint8* alphaData, uint8* xorMask, uint8* andMask, int width, int height, int bpp, HCLRCONV clrconv);
-FREERDP_API void freerdp_image_swap_color_order(uint8* data, int width, int height);
+typedef BYTE* (*p_freerdp_image_convert)(BYTE* srcData, BYTE* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv);
+
+FREERDP_API BYTE* freerdp_image_convert(BYTE* srcData, BYTE *dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv);
+FREERDP_API BYTE* freerdp_glyph_convert(int width, int height, BYTE* data);
+FREERDP_API void freerdp_bitmap_flip(BYTE * src, BYTE * dst, int scanLineSz, int height);
+FREERDP_API BYTE* freerdp_image_flip(BYTE* srcData, BYTE* dstData, int width, int height, int bpp);
+FREERDP_API BYTE* freerdp_icon_convert(BYTE* srcData, BYTE* dstData, BYTE* mask, int width, int height, int bpp, HCLRCONV clrconv);
+FREERDP_API BYTE* freerdp_mono_image_convert(BYTE* srcData, int width, int height, int srcBpp, int dstBpp, uint32 bgcolor, uint32 fgcolor, HCLRCONV clrconv);
+FREERDP_API void freerdp_alpha_cursor_convert(BYTE* alphaData, BYTE* xorMask, BYTE* andMask, int width, int height, int bpp, HCLRCONV clrconv);
+FREERDP_API void freerdp_image_swap_color_order(BYTE* data, int width, int height);
FREERDP_API uint32 freerdp_color_convert_var(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv);
FREERDP_API uint32 freerdp_color_convert_rgb(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv);
#include <freerdp/types.h>
BOOL
-jpeg_decompress(uint8* input, uint8* output, int width, int height, int size, int bpp);
+jpeg_decompress(BYTE* input, BYTE* output, int width, int height, int size, int bpp);
#endif /* __BITMAP_H */
struct rdp_mppc_dec
{
- uint8* history_buf;
- uint16* offset_cache;
- uint8* history_buf_end;
- uint8* history_ptr;
+ BYTE* history_buf;
+ UINT16* offset_cache;
+ BYTE* history_buf_end;
+ BYTE* history_ptr;
};
-FREERDP_API int decompress_rdp(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen);
-FREERDP_API int decompress_rdp_4(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen);
-FREERDP_API int decompress_rdp_5(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen);
-FREERDP_API int decompress_rdp_6(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen);
-FREERDP_API int decompress_rdp_61(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen);
+FREERDP_API int decompress_rdp(struct rdp_mppc_dec* dec, BYTE* cbuf, int len, int ctype, uint32* roff, uint32* rlen);
+FREERDP_API int decompress_rdp_4(struct rdp_mppc_dec* dec, BYTE* cbuf, int len, int ctype, uint32* roff, uint32* rlen);
+FREERDP_API int decompress_rdp_5(struct rdp_mppc_dec* dec, BYTE* cbuf, int len, int ctype, uint32* roff, uint32* rlen);
+FREERDP_API int decompress_rdp_6(struct rdp_mppc_dec* dec, BYTE* cbuf, int len, int ctype, uint32* roff, uint32* rlen);
+FREERDP_API int decompress_rdp_61(struct rdp_mppc_dec* dec, BYTE* cbuf, int len, int ctype, uint32* roff, uint32* rlen);
FREERDP_API struct rdp_mppc_dec* mppc_dec_new(void);
FREERDP_API void mppc_dec_free(struct rdp_mppc_dec* dec);
int flags; /* PACKET_COMPRESSED, PACKET_AT_FRONT, PACKET_FLUSHED etc */
int flagsHold;
int first_pkt; /* this is the first pkt passing through enc */
- uint16* hash_table;
+ UINT16* hash_table;
};
-FREERDP_API BOOL compress_rdp(struct rdp_mppc_enc* enc, uint8* srcData, int len);
-FREERDP_API BOOL compress_rdp_4(struct rdp_mppc_enc* enc, uint8* srcData, int len);
-FREERDP_API BOOL compress_rdp_5(struct rdp_mppc_enc* enc, uint8* srcData, int len);
+FREERDP_API BOOL compress_rdp(struct rdp_mppc_enc* enc, BYTE* srcData, int len);
+FREERDP_API BOOL compress_rdp_4(struct rdp_mppc_enc* enc, BYTE* srcData, int len);
+FREERDP_API BOOL compress_rdp_5(struct rdp_mppc_enc* enc, BYTE* srcData, int len);
FREERDP_API struct rdp_mppc_enc* mppc_enc_new(int protocol_type);
FREERDP_API void mppc_enc_free(struct rdp_mppc_enc* enc);
struct _NSC_STREAM
{
uint32 PlaneByteCount[4];
- uint8 ColorLossLevel;
- uint8 ChromaSubSamplingLevel;
- uint16 Reserved;
- uint8* Planes;
+ BYTE ColorLossLevel;
+ BYTE ChromaSubSamplingLevel;
+ UINT16 Reserved;
+ BYTE* Planes;
};
typedef struct _NSC_STREAM NSC_STREAM;
{
uint32 OrgByteCount[4]; /* original byte length of luma, chroma orange, chroma green, alpha variable in order */
NSC_STREAM nsc_stream;
- uint16 bpp;
- uint16 width;
- uint16 height;
- uint8* bmpdata; /* final argb values in little endian order */
+ UINT16 bpp;
+ UINT16 width;
+ UINT16 height;
+ BYTE* bmpdata; /* final argb values in little endian order */
uint32 bmpdata_length; /* the maximum length of the buffer that bmpdata points to */
RDP_PIXEL_FORMAT pixel_format;
/* color palette allocated by the application */
- const uint8* palette;
+ const BYTE* palette;
void (*decode)(NSC_CONTEXT* context);
- void (*encode)(NSC_CONTEXT* context, uint8* bmpdata, int rowstride);
+ void (*encode)(NSC_CONTEXT* context, BYTE* bmpdata, int rowstride);
NSC_CONTEXT_PRIV* priv;
};
FREERDP_API NSC_CONTEXT* nsc_context_new(void);
FREERDP_API void nsc_context_set_cpu_opt(NSC_CONTEXT* context, uint32 cpu_opt);
FREERDP_API void nsc_context_set_pixel_format(NSC_CONTEXT* context, RDP_PIXEL_FORMAT pixel_format);
-FREERDP_API void nsc_process_message(NSC_CONTEXT* context, uint16 bpp,
- uint16 width, uint16 height, uint8* data, uint32 length);
+FREERDP_API void nsc_process_message(NSC_CONTEXT* context, UINT16 bpp,
+ UINT16 width, UINT16 height, BYTE* data, uint32 length);
FREERDP_API void nsc_compose_message(NSC_CONTEXT* context, STREAM* s,
- uint8* bmpdata, int width, int height, int rowstride);
+ BYTE* bmpdata, int width, int height, int rowstride);
FREERDP_API void nsc_context_free(NSC_CONTEXT* context);
#ifdef __cplusplus
struct _RFX_RECT
{
- uint16 x;
- uint16 y;
- uint16 width;
- uint16 height;
+ UINT16 x;
+ UINT16 y;
+ UINT16 width;
+ UINT16 height;
};
typedef struct _RFX_RECT RFX_RECT;
struct _RFX_TILE
{
- uint16 x;
- uint16 y;
- uint8* data;
+ UINT16 x;
+ UINT16 y;
+ BYTE* data;
};
typedef struct _RFX_TILE RFX_TILE;
* The rects array represents the updated region of the frame. The UI
* requires to clip drawing destination base on the union of the rects.
*/
- uint16 num_rects;
+ UINT16 num_rects;
RFX_RECT* rects;
/**
* rects described above) are valid. Pixels outside of the region may
* contain arbitrary data.
*/
- uint16 num_tiles;
+ UINT16 num_tiles;
RFX_TILE** tiles;
};
typedef struct _RFX_MESSAGE RFX_MESSAGE;
struct _RFX_CONTEXT
{
- uint16 flags;
- uint16 properties;
- uint16 width;
- uint16 height;
+ UINT16 flags;
+ UINT16 properties;
+ UINT16 width;
+ UINT16 height;
RLGR_MODE mode;
uint32 version;
uint32 codec_id;
uint32 codec_version;
RDP_PIXEL_FORMAT pixel_format;
- uint8 bits_per_pixel;
+ BYTE bits_per_pixel;
/* color palette allocated by the application */
- const uint8* palette;
+ const BYTE* palette;
/* temporary data within a frame */
uint32 frame_idx;
BOOL header_processed;
- uint8 num_quants;
+ BYTE num_quants;
uint32* quants;
- uint8 quant_idx_y;
- uint8 quant_idx_cb;
- uint8 quant_idx_cr;
+ BYTE quant_idx_y;
+ BYTE quant_idx_cb;
+ BYTE quant_idx_cr;
/* routines */
- void (*decode_ycbcr_to_rgb)(sint16* y_r_buf, sint16* cb_g_buf, sint16* cr_b_buf);
- void (*encode_rgb_to_ycbcr)(sint16* y_r_buf, sint16* cb_g_buf, sint16* cr_b_buf);
- void (*quantization_decode)(sint16* buffer, const uint32* quantization_values);
- void (*quantization_encode)(sint16* buffer, const uint32* quantization_values);
- void (*dwt_2d_decode)(sint16* buffer, sint16* dwt_buffer);
- void (*dwt_2d_encode)(sint16* buffer, sint16* dwt_buffer);
+ void (*decode_ycbcr_to_rgb)(INT16* y_r_buf, INT16* cb_g_buf, INT16* cr_b_buf);
+ void (*encode_rgb_to_ycbcr)(INT16* y_r_buf, INT16* cb_g_buf, INT16* cr_b_buf);
+ void (*quantization_decode)(INT16* buffer, const uint32* quantization_values);
+ void (*quantization_encode)(INT16* buffer, const uint32* quantization_values);
+ void (*dwt_2d_decode)(INT16* buffer, INT16* dwt_buffer);
+ void (*dwt_2d_encode)(INT16* buffer, INT16* dwt_buffer);
/* private definitions */
RFX_CONTEXT_PRIV* priv;
FREERDP_API void rfx_context_set_pixel_format(RFX_CONTEXT* context, RDP_PIXEL_FORMAT pixel_format);
FREERDP_API void rfx_context_reset(RFX_CONTEXT* context);
-FREERDP_API RFX_MESSAGE* rfx_process_message(RFX_CONTEXT* context, uint8* data, uint32 length);
-FREERDP_API uint16 rfx_message_get_tile_count(RFX_MESSAGE* message);
+FREERDP_API RFX_MESSAGE* rfx_process_message(RFX_CONTEXT* context, BYTE* data, uint32 length);
+FREERDP_API UINT16 rfx_message_get_tile_count(RFX_MESSAGE* message);
FREERDP_API RFX_TILE* rfx_message_get_tile(RFX_MESSAGE* message, int index);
-FREERDP_API uint16 rfx_message_get_rect_count(RFX_MESSAGE* message);
+FREERDP_API UINT16 rfx_message_get_rect_count(RFX_MESSAGE* message);
FREERDP_API RFX_RECT* rfx_message_get_rect(RFX_MESSAGE* message, int index);
FREERDP_API void rfx_message_free(RFX_CONTEXT* context, RFX_MESSAGE* message);
FREERDP_API void rfx_compose_message_header(RFX_CONTEXT* context, STREAM* s);
FREERDP_API void rfx_compose_message(RFX_CONTEXT* context, STREAM* s,
- const RFX_RECT* rects, int num_rects, uint8* image_data, int width, int height, int rowstride);
+ const RFX_RECT* rects, int num_rects, BYTE* image_data, int width, int height, int rowstride);
#ifdef __cplusplus
}
FREERDP_API int ber_write_length(STREAM* s, int length);
FREERDP_API int _ber_skip_length(int length);
FREERDP_API int ber_get_content_length(int length);
-FREERDP_API BOOL ber_read_universal_tag(STREAM* s, uint8 tag, BOOL pc);
-FREERDP_API void ber_write_universal_tag(STREAM* s, uint8 tag, BOOL pc);
-FREERDP_API BOOL ber_read_application_tag(STREAM* s, uint8 tag, int* length);
-FREERDP_API void ber_write_application_tag(STREAM* s, uint8 tag, int length);
-FREERDP_API BOOL ber_read_application_tag(STREAM* s, uint8 tag, int* length);
-FREERDP_API BOOL ber_read_enumerated(STREAM* s, uint8* enumerated, uint8 count);
-FREERDP_API void ber_write_enumerated(STREAM* s, uint8 enumerated, uint8 count);
-FREERDP_API BOOL ber_read_contextual_tag(STREAM* s, uint8 tag, int* length, BOOL pc);
-FREERDP_API int ber_write_contextual_tag(STREAM* s, uint8 tag, int length, BOOL pc);
+FREERDP_API BOOL ber_read_universal_tag(STREAM* s, BYTE tag, BOOL pc);
+FREERDP_API void ber_write_universal_tag(STREAM* s, BYTE tag, BOOL pc);
+FREERDP_API BOOL ber_read_application_tag(STREAM* s, BYTE tag, int* length);
+FREERDP_API void ber_write_application_tag(STREAM* s, BYTE tag, int length);
+FREERDP_API BOOL ber_read_application_tag(STREAM* s, BYTE tag, int* length);
+FREERDP_API BOOL ber_read_enumerated(STREAM* s, BYTE* enumerated, BYTE count);
+FREERDP_API void ber_write_enumerated(STREAM* s, BYTE enumerated, BYTE count);
+FREERDP_API BOOL ber_read_contextual_tag(STREAM* s, BYTE tag, int* length, BOOL pc);
+FREERDP_API int ber_write_contextual_tag(STREAM* s, BYTE tag, int length, BOOL pc);
FREERDP_API int ber_skip_contextual_tag(int length);
FREERDP_API BOOL ber_read_sequence_tag(STREAM* s, int* length);
FREERDP_API int ber_write_sequence_tag(STREAM* s, int length);
FREERDP_API int ber_skip_sequence(int length);
FREERDP_API int ber_skip_sequence_tag(int length);
-FREERDP_API BOOL ber_read_bit_string(STREAM* s, int* length, uint8* padding);
-FREERDP_API void ber_write_octet_string(STREAM* s, const uint8* oct_str, int length);
+FREERDP_API BOOL ber_read_bit_string(STREAM* s, int* length, BYTE* padding);
+FREERDP_API void ber_write_octet_string(STREAM* s, const BYTE* oct_str, int length);
FREERDP_API BOOL ber_read_octet_string_tag(STREAM* s, int* length);
FREERDP_API int ber_write_octet_string_tag(STREAM* s, int length);
FREERDP_API int ber_skip_octet_string(int length);
typedef struct crypto_sha1_struct* CryptoSha1;
FREERDP_API CryptoSha1 crypto_sha1_init(void);
-FREERDP_API void crypto_sha1_update(CryptoSha1 sha1, const uint8* data, uint32 length);
-FREERDP_API void crypto_sha1_final(CryptoSha1 sha1, uint8* out_data);
+FREERDP_API void crypto_sha1_update(CryptoSha1 sha1, const BYTE* data, uint32 length);
+FREERDP_API void crypto_sha1_final(CryptoSha1 sha1, BYTE* out_data);
#define CRYPTO_MD5_DIGEST_LENGTH MD5_DIGEST_LENGTH
typedef struct crypto_md5_struct* CryptoMd5;
FREERDP_API CryptoMd5 crypto_md5_init(void);
-FREERDP_API void crypto_md5_update(CryptoMd5 md5, const uint8* data, uint32 length);
-FREERDP_API void crypto_md5_final(CryptoMd5 md5, uint8* out_data);
+FREERDP_API void crypto_md5_update(CryptoMd5 md5, const BYTE* data, uint32 length);
+FREERDP_API void crypto_md5_final(CryptoMd5 md5, BYTE* out_data);
typedef struct crypto_rc4_struct* CryptoRc4;
-FREERDP_API CryptoRc4 crypto_rc4_init(const uint8* key, uint32 length);
-FREERDP_API void crypto_rc4(CryptoRc4 rc4, uint32 length, const uint8* in_data, uint8* out_data);
+FREERDP_API CryptoRc4 crypto_rc4_init(const BYTE* key, uint32 length);
+FREERDP_API void crypto_rc4(CryptoRc4 rc4, uint32 length, const BYTE* in_data, BYTE* out_data);
FREERDP_API void crypto_rc4_free(CryptoRc4 rc4);
typedef struct crypto_des3_struct* CryptoDes3;
-FREERDP_API CryptoDes3 crypto_des3_encrypt_init(const uint8* key, const uint8* ivec);
-FREERDP_API CryptoDes3 crypto_des3_decrypt_init(const uint8* key, const uint8* ivec);
-FREERDP_API void crypto_des3_encrypt(CryptoDes3 des3, uint32 length, const uint8 *in_data, uint8 *out_data);
-FREERDP_API void crypto_des3_decrypt(CryptoDes3 des3, uint32 length, const uint8 *in_data, uint8* out_data);
+FREERDP_API CryptoDes3 crypto_des3_encrypt_init(const BYTE* key, const BYTE* ivec);
+FREERDP_API CryptoDes3 crypto_des3_decrypt_init(const BYTE* key, const BYTE* ivec);
+FREERDP_API void crypto_des3_encrypt(CryptoDes3 des3, uint32 length, const BYTE *in_data, BYTE *out_data);
+FREERDP_API void crypto_des3_decrypt(CryptoDes3 des3, uint32 length, const BYTE *in_data, BYTE* out_data);
FREERDP_API void crypto_des3_free(CryptoDes3 des3);
typedef struct crypto_hmac_struct* CryptoHmac;
FREERDP_API CryptoHmac crypto_hmac_new(void);
-FREERDP_API void crypto_hmac_sha1_init(CryptoHmac hmac, const uint8 *data, uint32 length);
-FREERDP_API void crypto_hmac_update(CryptoHmac hmac, const uint8 *data, uint32 length);
-FREERDP_API void crypto_hmac_final(CryptoHmac hmac, uint8 *out_data, uint32 length);
+FREERDP_API void crypto_hmac_sha1_init(CryptoHmac hmac, const BYTE *data, uint32 length);
+FREERDP_API void crypto_hmac_update(CryptoHmac hmac, const BYTE *data, uint32 length);
+FREERDP_API void crypto_hmac_final(CryptoHmac hmac, BYTE *out_data, uint32 length);
FREERDP_API void crypto_hmac_free(CryptoHmac hmac);
typedef struct crypto_cert_struct* CryptoCert;
#include <freerdp/crypto/certificate.h>
-FREERDP_API CryptoCert crypto_cert_read(uint8* data, uint32 length);
+FREERDP_API CryptoCert crypto_cert_read(BYTE* data, uint32 length);
FREERDP_API char* crypto_cert_fingerprint(X509* xcert);
FREERDP_API char* crypto_cert_subject(X509* xcert);
FREERDP_API char* crypto_cert_subject_common_name(X509* xcert, int* length);
FREERDP_API BOOL crypto_cert_get_public_key(CryptoCert cert, BYTE** PublicKey, DWORD* PublicKeyLength);
#define TSSK_KEY_LENGTH 64
-extern const uint8 tssk_modulus[];
-extern const uint8 tssk_privateExponent[];
-extern const uint8 tssk_exponent[];
-
-FREERDP_API void crypto_rsa_public_encrypt(const uint8* input, int length, uint32 key_length, const uint8* modulus, const uint8* exponent, uint8* output);
-FREERDP_API void crypto_rsa_public_decrypt(const uint8* input, int length, uint32 key_length, const uint8* modulus, const uint8* exponent, uint8* output);
-FREERDP_API void crypto_rsa_private_encrypt(const uint8* input, int length, uint32 key_length, const uint8* modulus, const uint8* private_exponent, uint8* output);
-FREERDP_API void crypto_rsa_private_decrypt(const uint8* input, int length, uint32 key_length, const uint8* modulus, const uint8* private_exponent, uint8* output);
-FREERDP_API void crypto_reverse(uint8* data, int length);
-FREERDP_API void crypto_nonce(uint8* nonce, int size);
-
-FREERDP_API char* crypto_base64_encode(uint8* data, int length);
-FREERDP_API void crypto_base64_decode(uint8* enc_data, int length, uint8** dec_data, int* res_length);
+extern const BYTE tssk_modulus[];
+extern const BYTE tssk_privateExponent[];
+extern const BYTE tssk_exponent[];
+
+FREERDP_API void crypto_rsa_public_encrypt(const BYTE* input, int length, uint32 key_length, const BYTE* modulus, const BYTE* exponent, BYTE* output);
+FREERDP_API void crypto_rsa_public_decrypt(const BYTE* input, int length, uint32 key_length, const BYTE* modulus, const BYTE* exponent, BYTE* output);
+FREERDP_API void crypto_rsa_private_encrypt(const BYTE* input, int length, uint32 key_length, const BYTE* modulus, const BYTE* private_exponent, BYTE* output);
+FREERDP_API void crypto_rsa_private_decrypt(const BYTE* input, int length, uint32 key_length, const BYTE* modulus, const BYTE* private_exponent, BYTE* output);
+FREERDP_API void crypto_reverse(BYTE* data, int length);
+FREERDP_API void crypto_nonce(BYTE* nonce, int size);
+
+FREERDP_API char* crypto_base64_encode(BYTE* data, int length);
+FREERDP_API void crypto_base64_decode(BYTE* enc_data, int length, BYTE** dec_data, int* res_length);
#endif /* FREERDP_CRYPTO_H */
FREERDP_API int der_skip_sequence_tag(int length);
FREERDP_API int der_write_sequence_tag(STREAM* s, int length);
FREERDP_API int der_skip_contextual_tag(int length);
-FREERDP_API int der_write_contextual_tag(STREAM* s, uint8 tag, int length, BOOL pc);
-FREERDP_API void der_write_octet_string(STREAM* s, uint8* oct_str, int length);
+FREERDP_API int der_write_contextual_tag(STREAM* s, BYTE tag, int length, BOOL pc);
+FREERDP_API void der_write_octet_string(STREAM* s, BYTE* oct_str, int length);
#endif /* FREERDP_CRYPTO_DER_H */
FREERDP_API int er_write_length(STREAM* s, int length, BOOL flag);
FREERDP_API int _er_skip_length(int length);
FREERDP_API int er_get_content_length(int length);
-FREERDP_API BOOL er_read_universal_tag(STREAM* s, uint8 tag, BOOL pc);
-FREERDP_API void er_write_universal_tag(STREAM* s, uint8 tag, BOOL pc);
-FREERDP_API BOOL er_read_application_tag(STREAM* s, uint8 tag, int* length);
-FREERDP_API void er_write_application_tag(STREAM* s, uint8 tag, int length, BOOL flag);
-FREERDP_API BOOL er_read_application_tag(STREAM* s, uint8 tag, int* length);
-FREERDP_API BOOL er_read_enumerated(STREAM* s, uint8* enumerated, uint8 count);
-FREERDP_API void er_write_enumerated(STREAM* s, uint8 enumerated, uint8 count, BOOL flag);
-FREERDP_API BOOL er_read_contextual_tag(STREAM* s, uint8 tag, int* length, BOOL pc);
-FREERDP_API int er_write_contextual_tag(STREAM* s, uint8 tag, int length, BOOL pc, BOOL flag);
+FREERDP_API BOOL er_read_universal_tag(STREAM* s, BYTE tag, BOOL pc);
+FREERDP_API void er_write_universal_tag(STREAM* s, BYTE tag, BOOL pc);
+FREERDP_API BOOL er_read_application_tag(STREAM* s, BYTE tag, int* length);
+FREERDP_API void er_write_application_tag(STREAM* s, BYTE tag, int length, BOOL flag);
+FREERDP_API BOOL er_read_application_tag(STREAM* s, BYTE tag, int* length);
+FREERDP_API BOOL er_read_enumerated(STREAM* s, BYTE* enumerated, BYTE count);
+FREERDP_API void er_write_enumerated(STREAM* s, BYTE enumerated, BYTE count, BOOL flag);
+FREERDP_API BOOL er_read_contextual_tag(STREAM* s, BYTE tag, int* length, BOOL pc);
+FREERDP_API int er_write_contextual_tag(STREAM* s, BYTE tag, int length, BOOL pc, BOOL flag);
FREERDP_API int er_skip_contextual_tag(int length);
FREERDP_API BOOL er_read_sequence_tag(STREAM* s, int* length);
FREERDP_API int er_write_sequence_tag(STREAM* s, int length, BOOL flag);
FREERDP_API int er_skip_sequence(int length);
FREERDP_API int er_skip_sequence_tag(int length);
-FREERDP_API BOOL er_read_bit_string(STREAM* s, int* length, uint8* padding);
-FREERDP_API BOOL er_write_bit_string_tag(STREAM* s, uint32 length, uint8 padding, BOOL flag);
+FREERDP_API BOOL er_read_bit_string(STREAM* s, int* length, BYTE* padding);
+FREERDP_API BOOL er_write_bit_string_tag(STREAM* s, uint32 length, BYTE padding, BOOL flag);
FREERDP_API BOOL er_read_octet_string(STREAM* s, int* length);
-FREERDP_API void er_write_octet_string(STREAM* s, uint8* oct_str, int length, BOOL flag);
+FREERDP_API void er_write_octet_string(STREAM* s, BYTE* oct_str, int length, BOOL flag);
FREERDP_API int er_write_octet_string_tag(STREAM* s, int length, BOOL flag);
FREERDP_API int er_skip_octet_string(int length);
FREERDP_API BOOL er_read_BOOL(STREAM* s, BOOL* value);
#include <freerdp/api.h>
#include <freerdp/utils/stream.h>
-FREERDP_API BOOL per_read_length(STREAM* s, uint16* length);
+FREERDP_API BOOL per_read_length(STREAM* s, UINT16* length);
FREERDP_API void per_write_length(STREAM* s, int length);
-FREERDP_API BOOL per_read_choice(STREAM* s, uint8* choice);
-FREERDP_API void per_write_choice(STREAM* s, uint8 choice);
-FREERDP_API BOOL per_read_selection(STREAM* s, uint8* selection);
-FREERDP_API void per_write_selection(STREAM* s, uint8 selection);
-FREERDP_API BOOL per_read_number_of_sets(STREAM* s, uint8* number);
-FREERDP_API void per_write_number_of_sets(STREAM* s, uint8 number);
+FREERDP_API BOOL per_read_choice(STREAM* s, BYTE* choice);
+FREERDP_API void per_write_choice(STREAM* s, BYTE choice);
+FREERDP_API BOOL per_read_selection(STREAM* s, BYTE* selection);
+FREERDP_API void per_write_selection(STREAM* s, BYTE selection);
+FREERDP_API BOOL per_read_number_of_sets(STREAM* s, BYTE* number);
+FREERDP_API void per_write_number_of_sets(STREAM* s, BYTE number);
FREERDP_API BOOL per_read_padding(STREAM* s, int length);
FREERDP_API void per_write_padding(STREAM* s, int length);
FREERDP_API BOOL per_read_integer(STREAM* s, uint32* integer);
-FREERDP_API BOOL per_read_integer16(STREAM* s, uint16* integer, uint16 min);
+FREERDP_API BOOL per_read_integer16(STREAM* s, UINT16* integer, UINT16 min);
FREERDP_API void per_write_integer(STREAM* s, uint32 integer);
-FREERDP_API void per_write_integer16(STREAM* s, uint16 integer, uint16 min);
-FREERDP_API BOOL per_read_enumerated(STREAM* s, uint8* enumerated, uint8 count);
-FREERDP_API void per_write_enumerated(STREAM* s, uint8 enumerated, uint8 count);
-FREERDP_API void per_write_object_identifier(STREAM* s, uint8 oid[6]);
-FREERDP_API BOOL per_read_object_identifier(STREAM* s, uint8 oid[6]);
-FREERDP_API BOOL per_read_octet_string(STREAM* s, uint8* oct_str, int length, int min);
-FREERDP_API void per_write_octet_string(STREAM* s, uint8* oct_str, int length, int min);
+FREERDP_API void per_write_integer16(STREAM* s, UINT16 integer, UINT16 min);
+FREERDP_API BOOL per_read_enumerated(STREAM* s, BYTE* enumerated, BYTE count);
+FREERDP_API void per_write_enumerated(STREAM* s, BYTE enumerated, BYTE count);
+FREERDP_API void per_write_object_identifier(STREAM* s, BYTE oid[6]);
+FREERDP_API BOOL per_read_object_identifier(STREAM* s, BYTE oid[6]);
+FREERDP_API BOOL per_read_octet_string(STREAM* s, BYTE* oct_str, int length, int min);
+FREERDP_API void per_write_octet_string(STREAM* s, BYTE* oct_str, int length, int min);
FREERDP_API BOOL per_read_numeric_string(STREAM* s, int min);
-FREERDP_API void per_write_numeric_string(STREAM* s, uint8* num_str, int length, int min);
+FREERDP_API void per_write_numeric_string(STREAM* s, BYTE* num_str, int length, int min);
#endif /* FREERDP_CRYPTO_PER_H */
FREERDP_API BOOL tls_accept(rdpTls* tls, const char* cert_file, const char* privatekey_file);
FREERDP_API BOOL tls_disconnect(rdpTls* tls);
-FREERDP_API int tls_read(rdpTls* tls, uint8* data, int length);
-FREERDP_API int tls_write(rdpTls* tls, uint8* data, int length);
+FREERDP_API int tls_read(rdpTls* tls, BYTE* data, int length);
+FREERDP_API int tls_write(rdpTls* tls, BYTE* data, int length);
-FREERDP_API int tls_read_all(rdpTls* tls, uint8* data, int length);
-FREERDP_API int tls_write_all(rdpTls* tls, uint8* data, int length);
+FREERDP_API int tls_read_all(rdpTls* tls, BYTE* data, int length);
+FREERDP_API int tls_write_all(rdpTls* tls, BYTE* data, int length);
FREERDP_API BOOL tls_verify_certificate(rdpTls* tls, CryptoCert cert, char* hostname);
FREERDP_API void tls_print_certificate_error(char* hostname, char* fingerprint);
/* Starts a write request on the channel. */
int (*Write) (IWTSVirtualChannel* pChannel,
uint32 cbSize,
- uint8* pBuffer,
+ BYTE* pBuffer,
void* pReserved);
/* Closes the channel. */
int (*Close) (IWTSVirtualChannel* pChannel);
the associated listener. */
int (*OnNewChannelConnection) (IWTSListenerCallback* pListenerCallback,
IWTSVirtualChannel* pChannel,
- uint8* Data,
+ BYTE* Data,
int* pbAccept,
IWTSVirtualChannelCallback** ppCallback);
};
/* Notifies the user about data that is being received. */
int (*OnDataReceived) (IWTSVirtualChannelCallback* pChannelCallback,
uint32 cbSize,
- uint8* pBuffer);
+ BYTE* pBuffer);
/* Notifies the user that the channel has been closed. */
int (*OnClose) (IWTSVirtualChannelCallback* pChannelCallback);
};
typedef BOOL (*pVerifyCertificate)(freerdp* instance, char* subject, char* issuer, char* fingerprint);
typedef BOOL (*pVerifyChangedCertificate)(freerdp* instance, char* subject, char* issuer, char* new_fingerprint, char* old_fingerprint);
-typedef int (*pSendChannelData)(freerdp* instance, int channelId, uint8* data, int size);
-typedef int (*pReceiveChannelData)(freerdp* instance, int channelId, uint8* data, int size, int flags, int total_size);
+typedef int (*pSendChannelData)(freerdp* instance, int channelId, BYTE* data, int size);
+typedef int (*pReceiveChannelData)(freerdp* instance, int channelId, BYTE* data, int size, int flags, int total_size);
/**
* Defines the context for a given instance of RDP connection.
typedef int (*pLineTo_16bpp)(HGDI_DC hdc, int nXEnd, int nYEnd);
-FREERDP_API uint16 gdi_get_color_16bpp(HGDI_DC hdc, GDI_COLOR color);
+FREERDP_API UINT16 gdi_get_color_16bpp(HGDI_DC hdc, GDI_COLOR color);
FREERDP_API int FillRect_16bpp(HGDI_DC hdc, HGDI_RECT rect, HGDI_BRUSH hbr);
FREERDP_API int BitBlt_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, int rop);
typedef int (*pLineTo_8bpp)(HGDI_DC hdc, int nXEnd, int nYEnd);
-FREERDP_API uint8 gdi_get_color_8bpp(HGDI_DC hdc, GDI_COLOR color);
+FREERDP_API BYTE gdi_get_color_8bpp(HGDI_DC hdc, GDI_COLOR color);
FREERDP_API int FillRect_8bpp(HGDI_DC hdc, HGDI_RECT rect, HGDI_BRUSH hbr);
FREERDP_API int BitBlt_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, int rop);
FREERDP_API GDI_COLOR gdi_GetPixel(HGDI_DC hdc, int nXPos, int nYPos);
FREERDP_API GDI_COLOR gdi_SetPixel(HGDI_DC hdc, int X, int Y, GDI_COLOR crColor);
-FREERDP_API uint8 gdi_GetPixel_8bpp(HGDI_BITMAP hBmp, int X, int Y);
-FREERDP_API uint16 gdi_GetPixel_16bpp(HGDI_BITMAP hBmp, int X, int Y);
+FREERDP_API BYTE gdi_GetPixel_8bpp(HGDI_BITMAP hBmp, int X, int Y);
+FREERDP_API UINT16 gdi_GetPixel_16bpp(HGDI_BITMAP hBmp, int X, int Y);
FREERDP_API uint32 gdi_GetPixel_32bpp(HGDI_BITMAP hBmp, int X, int Y);
-FREERDP_API uint8* gdi_GetPointer_8bpp(HGDI_BITMAP hBmp, int X, int Y);
-FREERDP_API uint16* gdi_GetPointer_16bpp(HGDI_BITMAP hBmp, int X, int Y);
+FREERDP_API BYTE* gdi_GetPointer_8bpp(HGDI_BITMAP hBmp, int X, int Y);
+FREERDP_API UINT16* gdi_GetPointer_16bpp(HGDI_BITMAP hBmp, int X, int Y);
FREERDP_API uint32* gdi_GetPointer_32bpp(HGDI_BITMAP hBmp, int X, int Y);
-FREERDP_API void gdi_SetPixel_8bpp(HGDI_BITMAP hBmp, int X, int Y, uint8 pixel);
-FREERDP_API void gdi_SetPixel_16bpp(HGDI_BITMAP hBmp, int X, int Y, uint16 pixel);
+FREERDP_API void gdi_SetPixel_8bpp(HGDI_BITMAP hBmp, int X, int Y, BYTE pixel);
+FREERDP_API void gdi_SetPixel_16bpp(HGDI_BITMAP hBmp, int X, int Y, UINT16 pixel);
FREERDP_API void gdi_SetPixel_32bpp(HGDI_BITMAP hBmp, int X, int Y, uint32 pixel);
-FREERDP_API HGDI_BITMAP gdi_CreateBitmap(int nWidth, int nHeight, int cBitsPerPixel, uint8* data);
+FREERDP_API HGDI_BITMAP gdi_CreateBitmap(int nWidth, int nHeight, int cBitsPerPixel, BYTE* data);
FREERDP_API HGDI_BITMAP gdi_CreateCompatibleBitmap(HGDI_DC hdc, int nWidth, int nHeight);
FREERDP_API int gdi_BitBlt(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc, int rop);
struct _GDIOBJECT
{
- uint8 objectType;
+ BYTE objectType;
};
typedef struct _GDIOBJECT GDIOBJECT;
typedef GDIOBJECT* HGDIOBJECT;
struct _GDI_RECT
{
- uint8 objectType;
+ BYTE objectType;
int left;
int top;
int right;
struct _GDI_RGN
{
- uint8 objectType;
+ BYTE objectType;
int x; /* left */
int y; /* top */
int w; /* width */
struct _GDI_BITMAP
{
- uint8 objectType;
+ BYTE objectType;
int bytesPerPixel;
int bitsPerPixel;
int width;
int height;
int scanline;
- uint8* data;
+ BYTE* data;
};
typedef struct _GDI_BITMAP GDI_BITMAP;
typedef GDI_BITMAP* HGDI_BITMAP;
struct _GDI_PEN
{
- uint8 objectType;
+ BYTE objectType;
int style;
int width;
int posX;
struct _GDI_PALETTEENTRY
{
- uint8 red;
- uint8 green;
- uint8 blue;
+ BYTE red;
+ BYTE green;
+ BYTE blue;
};
typedef struct _GDI_PALETTEENTRY GDI_PALETTEENTRY;
struct _GDI_PALETTE
{
- uint16 count;
+ UINT16 count;
GDI_PALETTEENTRY *entries;
};
typedef struct _GDI_PALETTE GDI_PALETTE;
struct _GDI_BRUSH
{
- uint8 objectType;
+ BYTE objectType;
int style;
HGDI_BITMAP pattern;
GDI_COLOR color;
HCLRCONV clrconv;
gdiBitmap* primary;
gdiBitmap* drawing;
- uint8* primary_buffer;
+ BYTE* primary_buffer;
GDI_COLOR textColor;
void* rfx_context;
void* nsc_context;
gdiBitmap* image;
};
-FREERDP_API uint32 gdi_rop3_code(uint8 code);
-FREERDP_API uint8* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, int x, int y);
-FREERDP_API uint8* gdi_get_brush_pointer(HGDI_DC hdcBrush, int x, int y);
-FREERDP_API int gdi_is_mono_pixel_set(uint8* data, int x, int y, int width);
+FREERDP_API uint32 gdi_rop3_code(BYTE code);
+FREERDP_API BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, int x, int y);
+FREERDP_API BYTE* gdi_get_brush_pointer(HGDI_DC hdcBrush, int x, int y);
+FREERDP_API int gdi_is_mono_pixel_set(BYTE* data, int x, int y, int width);
FREERDP_API void gdi_resize(rdpGdi* gdi, int width, int height);
-FREERDP_API int gdi_init(freerdp* instance, uint32 flags, uint8* buffer);
+FREERDP_API int gdi_init(freerdp* instance, uint32 flags, BYTE* buffer);
FREERDP_API void gdi_free(freerdp* instance);
#ifdef WITH_DEBUG_GDI
#include <freerdp/gdi/gdi.h>
FREERDP_API HGDI_PEN gdi_CreatePen(int fnPenStyle, int nWidth, int crColor);
-FREERDP_API uint8 gdi_GetPenColor_8bpp(HGDI_PEN pen);
-FREERDP_API uint16 gdi_GetPenColor_16bpp(HGDI_PEN pen);
+FREERDP_API BYTE gdi_GetPenColor_8bpp(HGDI_PEN pen);
+FREERDP_API UINT16 gdi_GetPenColor_16bpp(HGDI_PEN pen);
FREERDP_API uint32 gdi_GetPenColor_32bpp(HGDI_PEN pen);
#endif /* __GDI_PEN_H */
typedef void (*pBitmap_Free)(rdpContext* context, rdpBitmap* bitmap);
typedef void (*pBitmap_Paint)(rdpContext* context, rdpBitmap* bitmap);
typedef void (*pBitmap_Decompress)(rdpContext* context, rdpBitmap* bitmap,
- uint8* data, int width, int height, int bpp, int length,
+ BYTE* data, int width, int height, int bpp, int length,
BOOL compressed, int codec_id);
typedef void (*pBitmap_SetSurface)(rdpContext* context, rdpBitmap* bitmap, BOOL primary);
uint32 bpp; /* 22 */
uint32 flags; /* 23 */
uint32 length; /* 24 */
- uint8* data; /* 25 */
+ BYTE* data; /* 25 */
uint32 paddingB[32 - 26]; /* 26 */
BOOL compressed; /* 32 */
FREERDP_API void Bitmap_Free(rdpContext* context, rdpBitmap* bitmap);
FREERDP_API void Bitmap_Register(rdpContext* context, rdpBitmap* bitmap);
FREERDP_API void Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
- uint8* data, int width, int height, int bpp, int length, BOOL compressed);
+ BYTE* data, int width, int height, int bpp, int length, BOOL compressed);
FREERDP_API void Bitmap_SetRectangle(rdpContext* context, rdpBitmap* bitmap,
- uint16 left, uint16 top, uint16 right, uint16 bottom);
-FREERDP_API void Bitmap_SetDimensions(rdpContext* context, rdpBitmap* bitmap, uint16 width, uint16 height);
+ UINT16 left, UINT16 top, UINT16 right, UINT16 bottom);
+FREERDP_API void Bitmap_SetDimensions(rdpContext* context, rdpBitmap* bitmap, UINT16 width, UINT16 height);
FREERDP_API void Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap, BOOL primary);
/* Pointer Class */
uint32 xorBpp; /* 20 */
uint32 lengthAndMask; /* 21 */
uint32 lengthXorMask; /* 22 */
- uint8* xorMaskData; /* 23 */
- uint8* andMaskData; /* 24 */
+ BYTE* xorMaskData; /* 23 */
+ BYTE* andMaskData; /* 24 */
uint32 paddingB[32 - 25]; /* 25 */
};
uint32 cx; /* 18 */
uint32 cy; /* 19 */
uint32 cb; /* 20 */
- uint8* aj; /* 21 */
+ BYTE* aj; /* 21 */
uint32 paddingB[32 - 22]; /* 22 */
};
#define RDP_CLIENT_INPUT_PDU_HEADER_LENGTH 4
typedef void (*pSynchronizeEvent)(rdpInput* input, uint32 flags);
-typedef void (*pKeyboardEvent)(rdpInput* input, uint16 flags, uint16 code);
-typedef void (*pUnicodeKeyboardEvent)(rdpInput* input, uint16 flags, uint16 code);
-typedef void (*pMouseEvent)(rdpInput* input, uint16 flags, uint16 x, uint16 y);
-typedef void (*pExtendedMouseEvent)(rdpInput* input, uint16 flags, uint16 x, uint16 y);
+typedef void (*pKeyboardEvent)(rdpInput* input, UINT16 flags, UINT16 code);
+typedef void (*pUnicodeKeyboardEvent)(rdpInput* input, UINT16 flags, UINT16 code);
+typedef void (*pMouseEvent)(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
+typedef void (*pExtendedMouseEvent)(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
struct rdp_input
{
};
FREERDP_API void freerdp_input_send_synchronize_event(rdpInput* input, uint32 flags);
-FREERDP_API void freerdp_input_send_keyboard_event(rdpInput* input, uint16 flags, uint16 code);
+FREERDP_API void freerdp_input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
FREERDP_API void freerdp_input_send_keyboard_event_ex(rdpInput* input, BOOL down, uint32 rdp_scancode);
-FREERDP_API void freerdp_input_send_unicode_keyboard_event(rdpInput* input, uint16 flags, uint16 code);
-FREERDP_API void freerdp_input_send_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y);
-FREERDP_API void freerdp_input_send_extended_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y);
+FREERDP_API void freerdp_input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
+FREERDP_API void freerdp_input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
+FREERDP_API void freerdp_input_send_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
#endif /* __INPUT_API_H */
extern "C" {
#endif
-typedef BOOL (*psListenerOpen)(freerdp_listener* instance, const char* bind_address, uint16 port);
+typedef BOOL (*psListenerOpen)(freerdp_listener* instance, const char* bind_address, UINT16 port);
typedef BOOL (*psListenerOpenLocal)(freerdp_listener* instance, const char* path);
typedef BOOL (*psListenerGetFileDescriptor)(freerdp_listener* instance, void** rfds, int* rcount);
typedef BOOL (*psListenerCheckFileDescriptor)(freerdp_listener* instance);
typedef BOOL (*psPeerActivate)(freerdp_peer* client);
typedef BOOL (*psPeerLogon)(freerdp_peer* client, SEC_WINNT_AUTH_IDENTITY* identity, BOOL automatic);
-typedef int (*psPeerSendChannelData)(freerdp_peer* client, int channelId, uint8* data, int size);
-typedef int (*psPeerReceiveChannelData)(freerdp_peer* client, int channelId, uint8* data, int size, int flags, int total_size);
+typedef int (*psPeerSendChannelData)(freerdp_peer* client, int channelId, BYTE* data, int size);
+typedef int (*psPeerReceiveChannelData)(freerdp_peer* client, int channelId, BYTE* data, int size, int flags, int total_size);
struct rdp_freerdp_peer
{
uint32 height;
uint32 lengthAndMask;
uint32 lengthXorMask;
- uint8* xorMaskData;
- uint8* andMaskData;
+ BYTE* xorMaskData;
+ BYTE* andMaskData;
};
typedef struct _POINTER_COLOR_UPDATE POINTER_COLOR_UPDATE;
uint32 style;
uint32 hatch;
uint32 index;
- uint8* data;
- uint8 p8x8[8];
+ BYTE* data;
+ BYTE p8x8[8];
};
typedef struct rdp_brush rdpBrush;
uint32 bitmapId;
uint32 nDeltaEntries;
uint32 cbData;
- uint8* codeDeltaList;
+ BYTE* codeDeltaList;
};
typedef struct _MULTI_DRAW_NINE_GRID_ORDER MULTI_DRAW_NINE_GRID_ORDER;
sint32 x;
sint32 y;
uint32 cbData;
- uint8 data[256];
+ BYTE data[256];
};
typedef struct _GLYPH_INDEX_ORDER GLYPH_INDEX_ORDER;
sint32 x;
sint32 y;
uint32 cbData;
- uint8 data[256];
+ BYTE data[256];
};
typedef struct _FAST_INDEX_ORDER FAST_INDEX_ORDER;
sint32 x;
sint32 y;
uint32 cbData;
- uint8 data[256];
+ BYTE data[256];
void* glyph_data;
};
typedef struct _FAST_GLYPH_ORDER FAST_GLYPH_ORDER;
struct _RAIL_UNICODE_STRING
{
- uint16 length;
- uint8* string;
+ UINT16 length;
+ BYTE* string;
};
typedef struct _RAIL_UNICODE_STRING RAIL_UNICODE_STRING;
struct _RAIL_EXEC_ORDER
{
- uint16 flags;
+ UINT16 flags;
RAIL_UNICODE_STRING exeOrFile;
RAIL_UNICODE_STRING workingDir;
RAIL_UNICODE_STRING arguments;
struct _RAIL_EXEC_RESULT_ORDER
{
- uint16 flags;
- uint16 execResult;
+ UINT16 flags;
+ UINT16 execResult;
uint32 rawResult;
RAIL_UNICODE_STRING exeOrFile;
};
struct _RAIL_SYSMENU_ORDER
{
uint32 windowId;
- uint16 left;
- uint16 top;
+ UINT16 left;
+ UINT16 top;
};
typedef struct _RAIL_SYSMENU_ORDER RAIL_SYSMENU_ORDER;
struct _RAIL_SYSCOMMAND_ORDER
{
uint32 windowId;
- uint16 command;
+ UINT16 command;
};
typedef struct _RAIL_SYSCOMMAND_ORDER RAIL_SYSCOMMAND_ORDER;
struct _RAIL_MINMAXINFO_ORDER
{
uint32 windowId;
- uint16 maxWidth;
- uint16 maxHeight;
- uint16 maxPosX;
- uint16 maxPosY;
- uint16 minTrackWidth;
- uint16 minTrackHeight;
- uint16 maxTrackWidth;
- uint16 maxTrackHeight;
+ UINT16 maxWidth;
+ UINT16 maxHeight;
+ UINT16 maxPosX;
+ UINT16 maxPosY;
+ UINT16 minTrackWidth;
+ UINT16 minTrackHeight;
+ UINT16 maxTrackWidth;
+ UINT16 maxTrackHeight;
};
typedef struct _RAIL_MINMAXINFO_ORDER RAIL_MINMAXINFO_ORDER;
{
uint32 windowId;
BOOL isMoveSizeStart;
- uint16 moveSizeType;
- uint16 posX;
- uint16 posY;
+ UINT16 moveSizeType;
+ UINT16 posX;
+ UINT16 posY;
};
typedef struct _RAIL_LOCALMOVESIZE_ORDER RAIL_LOCALMOVESIZE_ORDER;
struct _RAIL_WINDOWMOVE_ORDER
{
uint32 windowId;
- uint16 left;
- uint16 top;
- uint16 right;
- uint16 bottom;
+ UINT16 left;
+ UINT16 top;
+ UINT16 right;
+ UINT16 bottom;
};
typedef struct _RAIL_WINDOWMOVE_ORDER RAIL_WINDOW_MOVE_ORDER;
{
uint32 windowId;
RAIL_UNICODE_STRING applicationId;
- uint8 applicationIdBuffer[512];
+ BYTE applicationIdBuffer[512];
};
typedef struct _RAIL_GET_APPID_RESP_ORDER RAIL_GET_APPID_RESP_ORDER;
struct rdp_icon_cache
{
rdpRail* rail;
- uint8 numCaches;
- uint16 numCacheEntries;
+ BYTE numCaches;
+ UINT16 numCacheEntries;
WINDOW_ICON_CACHE* caches;
};
-ICON_INFO* icon_cache_get(rdpIconCache* cache, uint8 id, uint16 index, void** extra);
-void icon_cache_put(rdpIconCache* cache, uint8 id, uint16 index, ICON_INFO* entry, void* extra);
+ICON_INFO* icon_cache_get(rdpIconCache* cache, BYTE id, UINT16 index, void** extra);
+void icon_cache_put(rdpIconCache* cache, BYTE id, UINT16 index, ICON_INFO* entry, void* extra);
rdpIconCache* icon_cache_new(rdpRail* rail);
void icon_cache_free(rdpIconCache* cache);
typedef void (*railCreateWindow)(rdpRail* rail, rdpWindow* window);
typedef void (*railDestroyWindow)(rdpRail* rail, rdpWindow* window);
typedef void (*railMoveWindow)(rdpRail* rail, rdpWindow* window);
-typedef void (*railShowWindow)(rdpRail* rail, rdpWindow* window, uint8 state);
+typedef void (*railShowWindow)(rdpRail* rail, rdpWindow* window, BYTE state);
typedef void (*railSetWindowText)(rdpRail* rail, rdpWindow* window);
typedef void (*railSetWindowIcon)(rdpRail* rail, rdpWindow* window, rdpIcon* icon);
typedef void (*railSetWindowRects)(rdpRail* rail, rdpWindow* window);
uint32 ownerWindowId;
uint32 style;
uint32 extendedStyle;
- uint8 showState;
+ BYTE showState;
RAIL_UNICODE_STRING titleInfo;
uint32 clientOffsetX;
uint32 clientOffsetY;
uint32 clientAreaWidth;
uint32 clientAreaHeight;
- uint8 RPContent;
+ BYTE RPContent;
uint32 rootParentHandle;
sint32 windowOffsetX;
sint32 windowOffsetY;
uint32 windowClientDeltaY;
uint32 windowWidth;
uint32 windowHeight;
- uint16 numWindowRects;
+ UINT16 numWindowRects;
RECTANGLE_16* windowRects;
uint32 visibleOffsetX;
uint32 visibleOffsetY;
- uint16 numVisibilityRects;
+ UINT16 numVisibilityRects;
RECTANGLE_16* visibilityRects;
};
*/
typedef uint32 RDP_SCANCODE; /* Our own representation of a RDP protocol scancode */
-#define RDP_SCANCODE_CODE(_rdp_scancode) ((uint8)(_rdp_scancode & 0xFF))
+#define RDP_SCANCODE_CODE(_rdp_scancode) ((BYTE)(_rdp_scancode & 0xFF))
#define RDP_SCANCODE_EXTENDED(_rdp_scancode) (((_rdp_scancode) & 0x100) ? TRUE : FALSE)
#define MAKE_RDP_SCANCODE(_code, _extended) (((_code) & 0xFF) | ((_extended) ? 0x100 : 0))
uint32 bitmapLength;
uint32 cacheIndex;
BOOL compressed;
- uint8 bitmapComprHdr[8];
- uint8* bitmapDataStream;
+ BYTE bitmapComprHdr[8];
+ BYTE* bitmapDataStream;
};
typedef struct _CACHE_BITMAP_ORDER CACHE_BITMAP_ORDER;
uint32 cbCompMainBodySize;
uint32 cbScanWidth;
uint32 cbUncompressedSize;
- uint8* bitmapDataStream;
+ BYTE* bitmapDataStream;
};
typedef struct _CACHE_BITMAP_V2_ORDER CACHE_BITMAP_V2_ORDER;
uint32 width;
uint32 height;
uint32 length;
- uint8* data;
+ BYTE* data;
};
typedef struct _BITMAP_DATA_EX BITMAP_DATA_EX;
uint32 cx;
uint32 cy;
uint32 cb;
- uint8* aj;
+ BYTE* aj;
};
typedef struct _GLYPH_DATA GLYPH_DATA;
uint32 cacheId;
uint32 cGlyphs;
GLYPH_DATA* glyphData[255];
- uint8* unicodeCharacters;
+ BYTE* unicodeCharacters;
};
typedef struct _CACHE_GLYPH_ORDER CACHE_GLYPH_ORDER;
uint32 cx;
uint32 cy;
uint32 cb;
- uint8* aj;
+ BYTE* aj;
};
typedef struct _GLYPH_DATA_V2 GLYPH_DATA_V2;
uint32 flags;
uint32 cGlyphs;
GLYPH_DATA_V2* glyphData[255];
- uint8* unicodeCharacters;
+ BYTE* unicodeCharacters;
};
typedef struct _CACHE_GLYPH_V2_ORDER CACHE_GLYPH_V2_ORDER;
uint32 cy;
uint32 style;
uint32 length;
- uint8* data;
+ BYTE* data;
};
typedef struct _CACHE_BRUSH_ORDER CACHE_BRUSH_ORDER;
/* SYSTEM_TIME */
typedef struct
{
- uint16 wYear;
- uint16 wMonth;
- uint16 wDayOfWeek;
- uint16 wDay;
- uint16 wHour;
- uint16 wMinute;
- uint16 wSecond;
- uint16 wMilliseconds;
+ UINT16 wYear;
+ UINT16 wMonth;
+ UINT16 wDayOfWeek;
+ UINT16 wDay;
+ UINT16 wHour;
+ UINT16 wMinute;
+ UINT16 wSecond;
+ UINT16 wMilliseconds;
} SYSTEM_TIME;
/* TIME_ZONE_INFORMATION */
uint32 cbLen;
uint32 version;
uint32 logonId;
- uint8 securityVerifier[16];
+ BYTE securityVerifier[16];
} ARC_CS_PRIVATE_PACKET;
/* ARC_SC_PRIVATE_PACKET */
uint32 cbLen;
uint32 version;
uint32 logonId;
- uint8 arcRandomBits[16];
+ BYTE arcRandomBits[16];
} ARC_SC_PRIVATE_PACKET;
/* Certificates */
struct rdp_CertBlob
{
uint32 length;
- uint8* data;
+ BYTE* data;
};
typedef struct rdp_CertBlob rdpCertBlob;
{
BYTE* Modulus;
DWORD ModulusLength;
- uint8 exponent[4];
+ BYTE exponent[4];
};
typedef struct rdp_CertInfo rdpCertInfo;
DWORD ModulusLength;
BYTE* PrivateExponent;
DWORD PrivateExponentLength;
- uint8 exponent[4];
+ BYTE exponent[4];
};
typedef struct rdp_key rdpKey;
struct _BITMAP_CACHE_CELL_INFO
{
- uint16 numEntries;
- uint16 maxSize;
+ UINT16 numEntries;
+ UINT16 maxSize;
};
typedef struct _BITMAP_CACHE_CELL_INFO BITMAP_CACHE_CELL_INFO;
struct _GLYPH_CACHE_DEFINITION
{
- uint16 cacheEntries;
- uint16 cacheMaximumCellSize;
+ UINT16 cacheEntries;
+ UINT16 cacheMaximumCellSize;
};
typedef struct _GLYPH_CACHE_DEFINITION GLYPH_CACHE_DEFINITION;
ALIGN64 BOOL frame_marker; /* 221 */
ALIGN64 BOOL fastpath_input; /* 222 */
ALIGN64 BOOL fastpath_output; /* 223 */
- ALIGN64 uint8* received_caps; /* 224 */
- ALIGN64 uint8* order_support; /* 225 */
+ ALIGN64 BYTE* received_caps; /* 224 */
+ ALIGN64 BYTE* order_support; /* 225 */
ALIGN64 BOOL surface_commands; /* 226 */
ALIGN64 BOOL disable_wallpaper; /* 227 */
ALIGN64 BOOL disable_full_window_drag; /* 228 */
#ifdef FREERDP_HAVE_INTTYPES_H
#include <inttypes.h>
-typedef uint8_t uint8;
-typedef int8_t sint8;
-typedef uint16_t uint16;
-typedef int16_t sint16;
typedef uint32_t uint32;
typedef int32_t sint32;
typedef uint64_t uint64;
#else
-typedef unsigned char uint8;
-typedef signed char sint8;
-typedef unsigned short uint16;
-typedef signed short sint16;
typedef unsigned int uint32;
typedef signed int sint32;
#ifdef _WIN32
#endif /* HAVE_INTTYPES_H */
-#ifdef FREERDP_HAVE_STDBOOL_H
-
-#include <stdbool.h>
-
-#ifdef _WIN32
-#define BOOL BOOLEAN
-#else
-typedef int BOOL;
-#endif
-
-#else
-
-#ifndef __cplusplus
-
-#define TRUE 1
-#define FALSE 0
-
-#ifdef _WIN32
-#define BOOL BOOLEAN
-#else
-typedef int BOOL;
-#endif
-
-#else /* ifdef __cplusplus */
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-typedef int BOOL;
-
-#endif /* __cplusplus */
-
-#endif /* FREERDP_HAVE_STDBOOL_H */
-
#ifndef MIN
#define MIN(x,y) (((x) < (y)) ? (x) : (y))
#endif
typedef struct
{
uint32 time_low;
- uint16 time_mid;
- uint16 time_hi_and_version;
- uint8 clock_seq_hi_and_reserved;
- uint8 clock_seq_low;
- uint8 node[6];
+ UINT16 time_mid;
+ UINT16 time_hi_and_version;
+ BYTE clock_seq_hi_and_reserved;
+ BYTE clock_seq_low;
+ BYTE node[6];
} uuid;
struct _RDP_PLUGIN_DATA
{
- uint16 size;
+ UINT16 size;
void* data[4];
};
typedef struct _RDP_PLUGIN_DATA RDP_PLUGIN_DATA;
struct _RDP_RECT
{
- sint16 x;
- sint16 y;
- sint16 width;
- sint16 height;
+ INT16 x;
+ INT16 y;
+ INT16 width;
+ INT16 height;
};
typedef struct _RDP_RECT RDP_RECT;
struct _RECTANGLE_16
{
- uint16 left;
- uint16 top;
- uint16 right;
- uint16 bottom;
+ UINT16 left;
+ UINT16 top;
+ UINT16 right;
+ UINT16 bottom;
};
typedef struct _RECTANGLE_16 RECTANGLE_16;
struct _RDP_EVENT
{
- uint16 event_class;
- uint16 event_type;
+ UINT16 event_class;
+ UINT16 event_type;
RDP_EVENT_CALLBACK on_event_free_callback;
void* user_data;
};
uint32 cbCompMainBodySize;
uint32 cbScanWidth;
uint32 cbUncompressedSize;
- uint8* bitmapDataStream;
+ BYTE* bitmapDataStream;
BOOL compressed;
};
typedef struct _BITMAP_DATA BITMAP_DATA;
struct _PALETTE_ENTRY
{
- uint8 red;
- uint8 green;
- uint8 blue;
+ BYTE red;
+ BYTE green;
+ BYTE blue;
};
typedef struct _PALETTE_ENTRY PALETTE_ENTRY;
uint32 width;
uint32 height;
uint32 bitmapDataLength;
- uint8* bitmapData;
+ BYTE* bitmapData;
};
typedef struct _SURFACE_BITS_COMMAND SURFACE_BITS_COMMAND;
typedef void (*pPalette)(rdpContext* context, PALETTE_UPDATE* palette);
typedef void (*pPlaySound)(rdpContext* context, PLAY_SOUND_UPDATE* play_sound);
-typedef void (*pRefreshRect)(rdpContext* context, uint8 count, RECTANGLE_16* areas);
-typedef void (*pSuppressOutput)(rdpContext* context, uint8 allow, RECTANGLE_16* area);
+typedef void (*pRefreshRect)(rdpContext* context, BYTE count, RECTANGLE_16* areas);
+typedef void (*pSuppressOutput)(rdpContext* context, BYTE allow, RECTANGLE_16* area);
typedef void (*pSurfaceCommand)(rdpContext* context, STREAM* s);
typedef void (*pSurfaceBits)(rdpContext* context, SURFACE_BITS_COMMAND* surface_bits_command);
{
struct
{
- sint16 last_sample[2];
- sint16 last_step[2];
+ INT16 last_sample[2];
+ INT16 last_step[2];
} ima;
struct
{
- uint8 predictor[2];
+ BYTE predictor[2];
sint32 delta[2];
sint32 sample1[2];
sint32 sample2[2];
typedef struct _FREERDP_DSP_CONTEXT FREERDP_DSP_CONTEXT;
struct _FREERDP_DSP_CONTEXT
{
- uint8* resampled_buffer;
+ BYTE* resampled_buffer;
uint32 resampled_size;
uint32 resampled_frames;
uint32 resampled_maxlength;
- uint8* adpcm_buffer;
+ BYTE* adpcm_buffer;
uint32 adpcm_size;
uint32 adpcm_maxlength;
ADPCM adpcm;
void (*resample)(FREERDP_DSP_CONTEXT* context,
- const uint8* src, int bytes_per_sample,
+ const BYTE* src, int bytes_per_sample,
uint32 schan, uint32 srate, int sframes,
uint32 rchan, uint32 rrate);
void (*decode_ima_adpcm)(FREERDP_DSP_CONTEXT* context,
- const uint8* src, int size, int channels, int block_size);
+ const BYTE* src, int size, int channels, int block_size);
void (*encode_ima_adpcm)(FREERDP_DSP_CONTEXT* context,
- const uint8* src, int size, int channels, int block_size);
+ const BYTE* src, int size, int channels, int block_size);
void (*decode_ms_adpcm)(FREERDP_DSP_CONTEXT* context,
- const uint8* src, int size, int channels, int block_size);
+ const BYTE* src, int size, int channels, int block_size);
void (*encode_ms_adpcm)(FREERDP_DSP_CONTEXT* context,
- const uint8* src, int size, int channels, int block_size);
+ const BYTE* src, int size, int channels, int block_size);
};
FREERDP_API FREERDP_DSP_CONTEXT* freerdp_dsp_context_new(void);
#include <freerdp/api.h>
#include <freerdp/types.h>
-FREERDP_API RDP_EVENT* freerdp_event_new(uint16 event_class, uint16 event_type,
+FREERDP_API RDP_EVENT* freerdp_event_new(UINT16 event_class, UINT16 event_type,
RDP_EVENT_CALLBACK on_event_free_callback, void* user_data);
FREERDP_API void freerdp_event_free(RDP_EVENT* event);
#define FREERDP_HEXDUMP_LINE_LENGTH 16
-FREERDP_API void freerdp_hexdump(uint8* data, int length);
+FREERDP_API void freerdp_hexdump(BYTE* data, int length);
#endif /* __UTILS_HEXDUMP_H */
#define zfree(p) do { if (p != NULL) {free(p); p = NULL;} } while (0)
/* Data maintenance helper only used in URBDRC */
-#define data_read_uint8(_p, _v) do { _v = \
- *((uint8 *) (_p)); \
+#define data_read_BYTE(_p, _v) do { _v = \
+ *((BYTE *) (_p)); \
} while (0)
-#define data_read_uint16(_p, _v) do { _v = \
- ((uint16) (*((uint8 *) (_p)))) + \
- ((uint16) (*(((uint8 *) (_p)) + 1)) << 8); \
+#define data_read_UINT16(_p, _v) do { _v = \
+ ((UINT16) (*((BYTE *) (_p)))) + \
+ ((UINT16) (*(((BYTE *) (_p)) + 1)) << 8); \
} while (0)
#define data_read_uint32(_p, _v) do { _v = \
- (uint32) (*((uint8 *) (_p))) + \
- ((uint32) (*(((uint8 *) (_p)) + 1)) << 8) + \
- ((uint32) (*(((uint8 *) (_p)) + 2)) << 16) + \
- ((uint32) (*(((uint8 *) (_p)) + 3)) << 24); \
+ (uint32) (*((BYTE *) (_p))) + \
+ ((uint32) (*(((BYTE *) (_p)) + 1)) << 8) + \
+ ((uint32) (*(((BYTE *) (_p)) + 2)) << 16) + \
+ ((uint32) (*(((BYTE *) (_p)) + 3)) << 24); \
} while (0)
#define data_read_uint64(_p, _v) do { _v = \
- (uint64) (*((uint8 *) (_p))) + \
- ((uint64) (*(((uint8 *) (_p)) + 1)) << 8) + \
- ((uint64) (*(((uint8 *) (_p)) + 2)) << 16) + \
- ((uint64) (*(((uint8 *) (_p)) + 3)) << 24) + \
- ((uint64) (*(((uint8 *) (_p)) + 4)) << 32) + \
- ((uint64) (*(((uint8 *) (_p)) + 5)) << 40) + \
- ((uint64) (*(((uint8 *) (_p)) + 6)) << 48) + \
- ((uint64) (*(((uint8 *) (_p)) + 7)) << 56); \
+ (uint64) (*((BYTE *) (_p))) + \
+ ((uint64) (*(((BYTE *) (_p)) + 1)) << 8) + \
+ ((uint64) (*(((BYTE *) (_p)) + 2)) << 16) + \
+ ((uint64) (*(((BYTE *) (_p)) + 3)) << 24) + \
+ ((uint64) (*(((BYTE *) (_p)) + 4)) << 32) + \
+ ((uint64) (*(((BYTE *) (_p)) + 5)) << 40) + \
+ ((uint64) (*(((BYTE *) (_p)) + 6)) << 48) + \
+ ((uint64) (*(((BYTE *) (_p)) + 7)) << 56); \
} while (0)
-#define data_write_uint8(_p, _v) do { \
- *((uint8 *) _p) = (uint8) (_v); \
+#define data_write_BYTE(_p, _v) do { \
+ *((BYTE *) _p) = (BYTE) (_v); \
} while (0)
-#define data_write_uint16(_p, _v) do { \
- *((uint8 *) _p) = (uint8) (((uint16) (_v)) & 0xff); \
- *(((uint8 *) _p) + 1) = (uint8) ((((uint16) (_v)) >> 8) & 0xff); \
+#define data_write_UINT16(_p, _v) do { \
+ *((BYTE *) _p) = (BYTE) (((UINT16) (_v)) & 0xff); \
+ *(((BYTE *) _p) + 1) = (BYTE) ((((UINT16) (_v)) >> 8) & 0xff); \
} while (0)
#define data_write_uint32(_p, _v) do { \
- *((uint8 *) _p) = (uint8) (((uint32) (_v)) & 0xff); \
- *(((uint8 *) _p) + 1) = (uint8) ((((uint32) (_v)) >> 8) & 0xff); \
- *(((uint8 *) _p) + 2) = (uint8) ((((uint32) (_v)) >> 16) & 0xff); \
- *(((uint8 *) _p) + 3) = (uint8) ((((uint32) (_v)) >> 24) & 0xff); \
+ *((BYTE *) _p) = (BYTE) (((uint32) (_v)) & 0xff); \
+ *(((BYTE *) _p) + 1) = (BYTE) ((((uint32) (_v)) >> 8) & 0xff); \
+ *(((BYTE *) _p) + 2) = (BYTE) ((((uint32) (_v)) >> 16) & 0xff); \
+ *(((BYTE *) _p) + 3) = (BYTE) ((((uint32) (_v)) >> 24) & 0xff); \
} while (0)
#define data_write_uint64(_p, _v) do { \
- *((uint8 *) _p) = (uint8) (((uint64) (_v)) & 0xff); \
- *(((uint8 *) _p) + 1) = (uint8) ((((uint64) (_v)) >> 8) & 0xff); \
- *(((uint8 *) _p) + 2) = (uint8) ((((uint64) (_v)) >> 16) & 0xff); \
- *(((uint8 *) _p) + 3) = (uint8) ((((uint64) (_v)) >> 24) & 0xff); \
- *(((uint8 *) _p) + 4) = (uint8) ((((uint64) (_v)) >> 32) & 0xff); \
- *(((uint8 *) _p) + 5) = (uint8) ((((uint64) (_v)) >> 40) & 0xff); \
- *(((uint8 *) _p) + 6) = (uint8) ((((uint64) (_v)) >> 48) & 0xff); \
- *(((uint8 *) _p) + 7) = (uint8) ((((uint64) (_v)) >> 56) & 0xff); \
+ *((BYTE *) _p) = (BYTE) (((uint64) (_v)) & 0xff); \
+ *(((BYTE *) _p) + 1) = (BYTE) ((((uint64) (_v)) >> 8) & 0xff); \
+ *(((BYTE *) _p) + 2) = (BYTE) ((((uint64) (_v)) >> 16) & 0xff); \
+ *(((BYTE *) _p) + 3) = (BYTE) ((((uint64) (_v)) >> 24) & 0xff); \
+ *(((BYTE *) _p) + 4) = (BYTE) ((((uint64) (_v)) >> 32) & 0xff); \
+ *(((BYTE *) _p) + 5) = (BYTE) ((((uint64) (_v)) >> 40) & 0xff); \
+ *(((BYTE *) _p) + 6) = (BYTE) ((((uint64) (_v)) >> 48) & 0xff); \
+ *(((BYTE *) _p) + 7) = (BYTE) ((((uint64) (_v)) >> 56) & 0xff); \
} while (0)
typedef struct _MSUSB_INTERFACE_DESCRIPTOR MSUSB_INTERFACE_DESCRIPTOR;
struct _MSUSB_PIPE_DESCRIPTOR
{
- uint16 MaximumPacketSize;
+ UINT16 MaximumPacketSize;
uint32 MaximumTransferSize;
uint32 PipeFlags;
uint32 PipeHandle;
- uint8 bEndpointAddress;
- uint8 bInterval;
- uint8 PipeType;
+ BYTE bEndpointAddress;
+ BYTE bInterval;
+ BYTE PipeType;
int InitCompleted;
} __attribute__((packed));
struct _MSUSB_INTERFACE_DESCRIPTOR
{
- uint16 Length;
- uint16 NumberOfPipesExpected;
- uint8 InterfaceNumber;
- uint8 AlternateSetting;
+ UINT16 Length;
+ UINT16 NumberOfPipesExpected;
+ BYTE InterfaceNumber;
+ BYTE AlternateSetting;
uint32 NumberOfPipes;
uint32 InterfaceHandle;
- uint8 bInterfaceClass;
- uint8 bInterfaceSubClass;
- uint8 bInterfaceProtocol;
+ BYTE bInterfaceClass;
+ BYTE bInterfaceSubClass;
+ BYTE bInterfaceProtocol;
MSUSB_PIPE_DESCRIPTOR ** MsPipes;
int InitCompleted;
} __attribute__((packed));
struct _MSUSB_CONFIG_DESCRIPTOR
{
- uint16 wTotalLength;
- uint8 bConfigurationValue;
+ UINT16 wTotalLength;
+ BYTE bConfigurationValue;
uint32 ConfigurationHandle;
uint32 NumInterfaces;
MSUSB_INTERFACE_DESCRIPTOR ** MsInterfaces;
void msusb_mspipes_replace(MSUSB_INTERFACE_DESCRIPTOR* MsInterface, MSUSB_PIPE_DESCRIPTOR** NewMsPipes, uint32 NewNumberOfPipes);
/* MSUSB_INTERFACE exported functions */
-void msusb_msinterface_replace(MSUSB_CONFIG_DESCRIPTOR* MsConfig, uint8 InterfaceNumber, MSUSB_INTERFACE_DESCRIPTOR* NewMsInterface);
-MSUSB_INTERFACE_DESCRIPTOR* msusb_msinterface_read(uint8* data, uint32 data_size, int* offset);
-int msusb_msinterface_write(MSUSB_INTERFACE_DESCRIPTOR* MsInterface, uint8* data, int* offset);
+void msusb_msinterface_replace(MSUSB_CONFIG_DESCRIPTOR* MsConfig, BYTE InterfaceNumber, MSUSB_INTERFACE_DESCRIPTOR* NewMsInterface);
+MSUSB_INTERFACE_DESCRIPTOR* msusb_msinterface_read(BYTE* data, uint32 data_size, int* offset);
+int msusb_msinterface_write(MSUSB_INTERFACE_DESCRIPTOR* MsInterface, BYTE* data, int* offset);
/* MSUSB_CONFIG exported functions */
MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_new();
void msusb_msconfig_free(MSUSB_CONFIG_DESCRIPTOR* MsConfig);
-MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_read(uint8* data, uint32 data_size, uint32 NumInterfaces);
-int msusb_msconfig_write(MSUSB_CONFIG_DESCRIPTOR* MsConfg, uint8* data, int * offset);
+MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_read(BYTE* data, uint32 data_size, uint32 NumInterfaces);
+int msusb_msconfig_write(MSUSB_CONFIG_DESCRIPTOR* MsConfg, BYTE* data, int * offset);
void msusb_msconfig_dump(MSUSB_CONFIG_DESCRIPTOR* MsConfg);
#endif
struct _pcap_header
{
uint32 magic_number; /* magic number */
- uint16 version_major; /* major version number */
- uint16 version_minor; /* minor version number */
+ UINT16 version_major; /* major version number */
+ UINT16 version_minor; /* minor version number */
sint32 thiszone; /* GMT to local correction */
uint32 sigfigs; /* accuracy of timestamps */
uint32 snaplen; /* max length of captured packets, in octets */
#include <freerdp/rail.h>
#include <freerdp/utils/stream.h>
-FREERDP_API void rail_unicode_string_alloc(RAIL_UNICODE_STRING* unicode_string, uint16 cbString);
+FREERDP_API void rail_unicode_string_alloc(RAIL_UNICODE_STRING* unicode_string, UINT16 cbString);
FREERDP_API void rail_unicode_string_free(RAIL_UNICODE_STRING* unicode_string);
FREERDP_API void rail_read_unicode_string(STREAM* s, RAIL_UNICODE_STRING* unicode_string);
FREERDP_API void rail_write_unicode_string(STREAM* s, RAIL_UNICODE_STRING* unicode_string);
struct _STREAM
{
int size;
- uint8* p;
- uint8* data;
+ BYTE* p;
+ BYTE* data;
};
typedef struct _STREAM STREAM;
#define stream_get_size(_s) (_s->size)
#define stream_get_left(_s) (_s->size - (_s->p - _s->data))
-#define stream_read_uint8(_s, _v) do { _v = *_s->p++; } while (0)
-#define stream_read_uint16(_s, _v) do { _v = \
- (uint16)(*_s->p) + \
- (uint16)(((uint16)(*(_s->p + 1))) << 8); \
+#define stream_read_BYTE(_s, _v) do { _v = *_s->p++; } while (0)
+#define stream_read_UINT16(_s, _v) do { _v = \
+ (UINT16)(*_s->p) + \
+ (UINT16)(((UINT16)(*(_s->p + 1))) << 8); \
_s->p += 2; } while (0)
#define stream_read_uint32(_s, _v) do { _v = \
(uint32)(*_s->p) + \
_s->p += (_n); \
} while (0)
-#define stream_write_uint8(_s, _v) do { \
- *_s->p++ = (uint8)(_v); } while (0)
-#define stream_write_uint16(_s, _v) do { \
+#define stream_write_BYTE(_s, _v) do { \
+ *_s->p++ = (BYTE)(_v); } while (0)
+#define stream_write_UINT16(_s, _v) do { \
*_s->p++ = (_v) & 0xFF; \
*_s->p++ = ((_v) >> 8) & 0xFF; } while (0)
#define stream_write_uint32(_s, _v) do { \
_s->p += (_n); \
} while (0)
-#define stream_peek_uint8(_s, _v) do { _v = *_s->p; } while (0)
-#define stream_peek_uint16(_s, _v) do { _v = \
- (uint16)(*_s->p) + \
- (((uint16)(*(_s->p + 1))) << 8); \
+#define stream_peek_BYTE(_s, _v) do { _v = *_s->p; } while (0)
+#define stream_peek_UINT16(_s, _v) do { _v = \
+ (UINT16)(*_s->p) + \
+ (((UINT16)(*(_s->p + 1))) << 8); \
} while (0)
#define stream_peek_uint32(_s, _v) do { _v = \
(uint32)(*_s->p) + \
(((uint64)(*(_s->p + 7))) << 56); \
} while (0)
-#define stream_seek_uint8(_s) stream_seek(_s, 1)
-#define stream_seek_uint16(_s) stream_seek(_s, 2)
+#define stream_seek_BYTE(_s) stream_seek(_s, 1)
+#define stream_seek_UINT16(_s) stream_seek(_s, 2)
#define stream_seek_uint32(_s) stream_seek(_s, 4)
#define stream_seek_uint64(_s) stream_seek(_s, 8)
-#define stream_read_uint16_be(_s, _v) do { _v = \
- (((uint16)(*_s->p)) << 8) + \
- (uint16)(*(_s->p + 1)); \
+#define stream_read_UINT16_be(_s, _v) do { _v = \
+ (((UINT16)(*_s->p)) << 8) + \
+ (UINT16)(*(_s->p + 1)); \
_s->p += 2; } while (0)
#define stream_read_uint32_be(_s, _v) do { _v = \
(((uint32)(*(_s->p))) << 24) + \
(((uint32)(*(_s->p + 3)))); \
_s->p += 4; } while (0)
-#define stream_write_uint16_be(_s, _v) do { \
+#define stream_write_UINT16_be(_s, _v) do { \
*_s->p++ = ((_v) >> 8) & 0xFF; \
*_s->p++ = (_v) & 0xFF; } while (0)
#define stream_write_uint32_be(_s, _v) do { \
- stream_write_uint16_be(_s, ((_v) >> 16 & 0xFFFF)); \
- stream_write_uint16_be(_s, ((_v) & 0xFFFF)); \
+ stream_write_UINT16_be(_s, ((_v) >> 16 & 0xFFFF)); \
+ stream_write_UINT16_be(_s, ((_v) & 0xFFFF)); \
} while (0)
#define stream_copy(_dst, _src, _n) do { \
#include <freerdp/types.h>
FREERDP_API int freerdp_tcp_connect(const char* hostname, int port);
-FREERDP_API int freerdp_tcp_read(int sockfd, uint8* data, int length);
-FREERDP_API int freerdp_tcp_write(int sockfd, uint8* data, int length);
+FREERDP_API int freerdp_tcp_read(int sockfd, BYTE* data, int length);
+FREERDP_API int freerdp_tcp_write(int sockfd, BYTE* data, int length);
FREERDP_API int freerdp_tcp_disconnect(int sockfd);
FREERDP_API int freerdp_tcp_set_no_delay(int sockfd, BOOL no_delay);
uint32 cbColorTable;
uint32 cbBitsMask;
uint32 cbBitsColor;
- uint8* bitsMask;
- uint8* colorTable;
- uint8* bitsColor;
+ BYTE* bitsMask;
+ BYTE* colorTable;
+ BYTE* bitsColor;
};
typedef struct _ICON_INFO ICON_INFO;
if (memblt->cacheId == 0xFF)
bitmap = offscreen_cache_get(cache->offscreen, memblt->cacheIndex);
else
- bitmap = bitmap_cache_get(cache->bitmap, (uint8) memblt->cacheId, memblt->cacheIndex);
+ bitmap = bitmap_cache_get(cache->bitmap, (BYTE) memblt->cacheId, memblt->cacheIndex);
memblt->bitmap = bitmap;
IFCALL(cache->bitmap->MemBlt, context, memblt);
void update_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
{
- uint8 style;
+ BYTE style;
rdpBitmap* bitmap;
rdpCache* cache = context->cache;
rdpBrush* brush = &mem3blt->brush;
if (mem3blt->cacheId == 0xFF)
bitmap = offscreen_cache_get(cache->offscreen, mem3blt->cacheIndex);
else
- bitmap = bitmap_cache_get(cache->bitmap, (uint8) mem3blt->cacheId, mem3blt->cacheIndex);
+ bitmap = bitmap_cache_get(cache->bitmap, (BYTE) mem3blt->cacheId, mem3blt->cacheIndex);
style = brush->style;
void update_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
{
- uint8 style;
+ BYTE style;
rdpBrush* brush = &patblt->brush;
rdpCache* cache = context->cache;
void update_gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb)
{
- uint8 style;
+ BYTE style;
rdpBrush* brush = &polygon_cb->brush;
rdpCache* cache = context->cache;
#include <freerdp/cache/glyph.h>
-void update_process_glyph(rdpContext* context, uint8* data, int* index,
+void update_process_glyph(rdpContext* context, BYTE* data, int* index,
int* x, int* y, uint32 cacheId, uint32 ulCharInc, uint32 flAccel)
{
int offset;
}
}
-void update_process_glyph_fragments(rdpContext* context, uint8* data, uint32 length,
+void update_process_glyph_fragments(rdpContext* context, BYTE* data, uint32 length,
uint32 cacheId, uint32 ulCharInc, uint32 flAccel, uint32 bgcolor, uint32 fgcolor, int x, int y,
int bkX, int bkY, int bkWidth, int bkHeight, int opX, int opY, int opWidth, int opHeight)
{
uint32 id;
uint32 size;
int index = 0;
- uint8* fragments;
+ BYTE* fragments;
rdpGraphics* graphics;
rdpGlyphCache* glyph_cache;
}
id = data[index + 1];
- fragments = (uint8*) glyph_cache_fragment_get(glyph_cache, id, &size);
+ fragments = (BYTE*) glyph_cache_fragment_get(glyph_cache, id, &size);
if (fragments != NULL)
{
id = data[index + 1];
size = data[index + 2];
- fragments = (uint8*) malloc(size);
+ fragments = (BYTE*) malloc(size);
memcpy(fragments, data, size);
glyph_cache_fragment_put(glyph_cache, id, size, fragments);
if (opBottom == -32768)
{
- uint8 flags = (uint8) (opTop & 0x0F);
+ BYTE flags = (BYTE) (opTop & 0x0F);
if (flags & 0x01)
opBottom = fast_index->bkBottom;
GLYPH_DATA_V2* glyph_data;
rdpGlyph* glyph;
rdpCache* cache = context->cache;
- uint8 text_data[2];
+ BYTE text_data[2];
opLeft = fast_glyph->opLeft;
opTop = fast_glyph->opTop;
if (opBottom == -32768)
{
- uint8 flags = (uint8) (opTop & 0x0F);
+ BYTE flags = (BYTE) (opTop & 0x0F);
if (flags & 0x01)
opBottom = fast_glyph->bkBottom;
void* fragment;
fragment = glyph_cache->fragCache.entries[index].fragment;
- *size = (uint8) glyph_cache->fragCache.entries[index].size;
+ *size = (BYTE) glyph_cache->fragCache.entries[index].size;
if (fragment == NULL)
{
void update_gdi_create_offscreen_bitmap(rdpContext* context, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap)
{
int i;
- uint16 index;
+ UINT16 index;
rdpBitmap* bitmap;
rdpCache* cache = context->cache;
typedef struct wts_data_item
{
- uint16 channel_id;
- uint8* buffer;
+ UINT16 channel_id;
+ BYTE* buffer;
uint32 length;
} wts_data_item;
return channel;
}
-static void wts_queue_receive_data(rdpPeerChannel* channel, const uint8* buffer, uint32 length)
+static void wts_queue_receive_data(rdpPeerChannel* channel, const BYTE* buffer, uint32 length)
{
wts_data_item* item;
case 0:
if (stream_get_left(s) < 1)
return 0;
- stream_read_uint8(s, *val);
+ stream_read_BYTE(s, *val);
return 1;
case 1:
if (stream_get_left(s) < 2)
return 0;
- stream_read_uint16(s, *val);
+ stream_read_UINT16(s, *val);
return 2;
default:
if (stream_get_left(s) < 4)
static void wts_read_drdynvc_capabilities_response(rdpPeerChannel* channel, uint32 length)
{
- uint16 Version;
+ UINT16 Version;
if (length < 3)
return;
- stream_seek_uint8(channel->receive_data); /* Pad (1 byte) */
- stream_read_uint16(channel->receive_data, Version);
+ stream_seek_BYTE(channel->receive_data); /* Pad (1 byte) */
+ stream_read_UINT16(channel->receive_data, Version);
DEBUG_DVC("Version: %d", Version);
return;
stream_set_pos(channel->receive_data, 0);
- stream_read_uint8(channel->receive_data, value);
+ stream_read_BYTE(channel->receive_data, value);
length--;
Cmd = (value & 0xf0) >> 4;
if (val <= 0xFF)
{
cb = 0;
- stream_write_uint8(stream, val);
+ stream_write_BYTE(stream, val);
}
else if (val <= 0xFFFF)
{
cb = 1;
- stream_write_uint16(stream, val);
+ stream_write_UINT16(stream, val);
}
else
{
return cb;
}
-static void wts_write_drdynvc_header(STREAM *s, uint8 Cmd, uint32 ChannelId)
+static void wts_write_drdynvc_header(STREAM *s, BYTE Cmd, uint32 ChannelId)
{
- uint8* bm;
+ BYTE* bm;
int cbChId;
stream_get_mark(s, bm);
- stream_seek_uint8(s);
+ stream_seek_BYTE(s);
cbChId = wts_write_variable_uint(s, ChannelId);
*bm = ((Cmd & 0x0F) << 4) | cbChId;
}
stream_write(s, ChannelName, len);
}
-static void WTSProcessChannelData(rdpPeerChannel* channel, int channelId, uint8* data, int size, int flags, int total_size)
+static void WTSProcessChannelData(rdpPeerChannel* channel, int channelId, BYTE* data, int size, int flags, int total_size)
{
if (flags & CHANNEL_FLAG_FIRST)
{
}
}
-static int WTSReceiveChannelData(freerdp_peer* client, int channelId, uint8* data, int size, int flags, int total_size)
+static int WTSReceiveChannelData(freerdp_peer* client, int channelId, BYTE* data, int size, int flags, int total_size)
{
int i;
BOOL result = FALSE;
{
vcm->drdynvc_channel = channel;
dynvc_caps = 0x00010050; /* DYNVC_CAPS_VERSION1 (4 bytes) */
- WTSVirtualChannelWrite(channel, (uint8*) &dynvc_caps, sizeof(dynvc_caps), NULL);
+ WTSVirtualChannelWrite(channel, (BYTE*) &dynvc_caps, sizeof(dynvc_caps), NULL);
}
}
BOOL WTSVirtualChannelRead(
/* __in */ void* hChannelHandle,
/* __in */ uint32 TimeOut,
- /* __out */ uint8* Buffer,
+ /* __out */ BYTE* Buffer,
/* __in */ uint32 BufferSize,
/* __out */ uint32* pBytesRead)
{
BOOL WTSVirtualChannelWrite(
/* __in */ void* hChannelHandle,
- /* __in */ uint8* Buffer,
+ /* __in */ BYTE* Buffer,
/* __in */ uint32 Length,
/* __out */ uint32* pBytesWritten)
{
item->buffer = malloc(channel->client->settings->vc_chunk_size);
stream_attach(s, item->buffer, channel->client->settings->vc_chunk_size);
- stream_seek_uint8(s);
+ stream_seek_BYTE(s);
cbChId = wts_write_variable_uint(s, channel->channel_id);
if (first && (Length > (uint32) stream_get_left(s)))
WTSVirtualChannelManager* vcm;
freerdp_peer* client;
uint32 channel_id;
- uint16 channel_type;
- uint16 index;
+ UINT16 channel_type;
+ UINT16 index;
STREAM* receive_data;
struct wait_obj* receive_event;
LIST* receive_queue;
HANDLE mutex;
- uint8 dvc_open_state;
+ BYTE dvc_open_state;
uint32 dvc_total_length;
};
HANDLE mutex;
rdpPeerChannel* drdynvc_channel;
- uint8 drdynvc_state;
+ BYTE drdynvc_state;
uint32 dvc_channel_id_seq;
LIST* dvc_channel_list;
};
typedef uint32 PIXEL;
-static const uint8 g_MaskBit0 = 0x01; /* Least significant bit */
-static const uint8 g_MaskBit1 = 0x02;
-static const uint8 g_MaskBit2 = 0x04;
-static const uint8 g_MaskBit3 = 0x08;
-static const uint8 g_MaskBit4 = 0x10;
-static const uint8 g_MaskBit5 = 0x20;
-static const uint8 g_MaskBit6 = 0x40;
-static const uint8 g_MaskBit7 = 0x80; /* Most significant bit */
+static const BYTE g_MaskBit0 = 0x01; /* Least significant bit */
+static const BYTE g_MaskBit1 = 0x02;
+static const BYTE g_MaskBit2 = 0x04;
+static const BYTE g_MaskBit3 = 0x08;
+static const BYTE g_MaskBit4 = 0x10;
+static const BYTE g_MaskBit5 = 0x20;
+static const BYTE g_MaskBit6 = 0x40;
+static const BYTE g_MaskBit7 = 0x80; /* Most significant bit */
-static const uint8 g_MaskSpecialFgBg1 = 0x03;
-static const uint8 g_MaskSpecialFgBg2 = 0x05;
+static const BYTE g_MaskSpecialFgBg1 = 0x03;
+static const BYTE g_MaskSpecialFgBg2 = 0x05;
-static const uint8 g_MaskRegularRunLength = 0x1F;
-static const uint8 g_MaskLiteRunLength = 0x0F;
+static const BYTE g_MaskRegularRunLength = 0x1F;
+static const BYTE g_MaskLiteRunLength = 0x0F;
/**
* Reads the supplied order header and extracts the compression
* order code ID.
*/
-static uint32 ExtractCodeId(uint8 bOrderHdr)
+static uint32 ExtractCodeId(BYTE bOrderHdr)
{
int code;
/**
* Extract the run length of a compression order.
*/
-static uint32 ExtractRunLength(uint32 code, uint8* pbOrderHdr, uint32* advance)
+static uint32 ExtractRunLength(uint32 code, BYTE* pbOrderHdr, uint32* advance)
{
uint32 runLength;
uint32 ladvance;
case MEGA_MEGA_FGBG_IMAGE:
case MEGA_MEGA_SET_FGBG_IMAGE:
case MEGA_MEGA_COLOR_IMAGE:
- runLength = ((uint16) pbOrderHdr[1]) | ((uint16) (pbOrderHdr[2] << 8));
+ runLength = ((UINT16) pbOrderHdr[1]) | ((UINT16) (pbOrderHdr[2] << 8));
ladvance += 2;
break;
}
#undef WRITEFIRSTLINEFGBGIMAGE
#undef RLEDECOMPRESS
#undef RLEEXTRA
-#define DESTWRITEPIXEL(_buf, _pix) (_buf)[0] = (uint8)(_pix)
+#define DESTWRITEPIXEL(_buf, _pix) (_buf)[0] = (BYTE)(_pix)
#define DESTREADPIXEL(_pix, _buf) _pix = (_buf)[0]
#define SRCREADPIXEL(_pix, _buf) _pix = (_buf)[0]
#define DESTNEXTPIXEL(_buf) _buf += 1
#undef WRITEFIRSTLINEFGBGIMAGE
#undef RLEDECOMPRESS
#undef RLEEXTRA
-#define DESTWRITEPIXEL(_buf, _pix) ((uint16*)(_buf))[0] = (uint16)(_pix)
-#define DESTREADPIXEL(_pix, _buf) _pix = ((uint16*)(_buf))[0]
-#define SRCREADPIXEL(_pix, _buf) _pix = ((uint16*)(_buf))[0]
+#define DESTWRITEPIXEL(_buf, _pix) ((UINT16*)(_buf))[0] = (UINT16)(_pix)
+#define DESTREADPIXEL(_pix, _buf) _pix = ((UINT16*)(_buf))[0]
+#define SRCREADPIXEL(_pix, _buf) _pix = ((UINT16*)(_buf))[0]
#define DESTNEXTPIXEL(_buf) _buf += 2
#define SRCNEXTPIXEL(_buf) _buf += 2
#define WRITEFGBGIMAGE WriteFgBgImage16to16
#undef WRITEFIRSTLINEFGBGIMAGE
#undef RLEDECOMPRESS
#undef RLEEXTRA
-#define DESTWRITEPIXEL(_buf, _pix) do { (_buf)[0] = (uint8)(_pix); \
- (_buf)[1] = (uint8)((_pix) >> 8); (_buf)[2] = (uint8)((_pix) >> 16); } while (0)
+#define DESTWRITEPIXEL(_buf, _pix) do { (_buf)[0] = (BYTE)(_pix); \
+ (_buf)[1] = (BYTE)((_pix) >> 8); (_buf)[2] = (BYTE)((_pix) >> 16); } while (0)
#define DESTREADPIXEL(_pix, _buf) _pix = (_buf)[0] | ((_buf)[1] << 8) | \
((_buf)[2] << 16)
#define SRCREADPIXEL(_pix, _buf) _pix = (_buf)[0] | ((_buf)[1] << 8) | \
* decompress an RLE color plane
* RDP6_BITMAP_STREAM
*/
-static int process_rle_plane(uint8* in, int width, int height, uint8* out, int size)
+static int process_rle_plane(BYTE* in, int width, int height, BYTE* out, int size)
{
int indexw;
int indexh;
int color;
int x;
int revcode;
- uint8* last_line;
- uint8* this_line;
- uint8* org_in;
- uint8* org_out;
+ BYTE* last_line;
+ BYTE* this_line;
+ BYTE* org_in;
+ BYTE* org_out;
org_in = in;
org_out = out;
/**
* process a raw color plane
*/
-static int process_raw_plane(uint8* srcData, int width, int height, uint8* dstData, int size)
+static int process_raw_plane(BYTE* srcData, int width, int height, BYTE* dstData, int size)
{
int x, y;
* 4 byte bitmap decompress
* RDP6_BITMAP_STREAM
*/
-static BOOL bitmap_decompress4(uint8* srcData, uint8* dstData, int width, int height, int size)
+static BOOL bitmap_decompress4(BYTE* srcData, BYTE* dstData, int width, int height, int size)
{
int RLE;
int code;
/**
* bitmap decompression routine
*/
-BOOL bitmap_decompress(uint8* srcData, uint8* dstData, int width, int height, int size, int srcBpp, int dstBpp)
+BOOL bitmap_decompress(BYTE* srcData, BYTE* dstData, int width, int height, int size, int srcBpp, int dstBpp)
{
- uint8 * TmpBfr;
+ BYTE * TmpBfr;
if (srcBpp == 16 && dstBpp == 16)
{
- TmpBfr = (uint8*) malloc(width * height * 2);
+ TmpBfr = (BYTE*) malloc(width * height * 2);
RleDecompress16to16(srcData, size, TmpBfr, width * 2, width, height);
freerdp_bitmap_flip(TmpBfr, dstData, width * 2, height);
free(TmpBfr);
}
else if (srcBpp == 15 && dstBpp == 15)
{
- TmpBfr = (uint8*) malloc(width * height * 2);
+ TmpBfr = (BYTE*) malloc(width * height * 2);
RleDecompress16to16(srcData, size, TmpBfr, width * 2, width, height);
freerdp_bitmap_flip(TmpBfr, dstData, width * 2, height);
free(TmpBfr);
}
else if (srcBpp == 8 && dstBpp == 8)
{
- TmpBfr = (uint8*) malloc(width * height);
+ TmpBfr = (BYTE*) malloc(width * height);
RleDecompress8to8(srcData, size, TmpBfr, width, width, height);
freerdp_bitmap_flip(TmpBfr, dstData, width, height);
free(TmpBfr);
}
else if (srcBpp == 24 && dstBpp == 24)
{
- TmpBfr = (uint8*) malloc(width * height * 3);
+ TmpBfr = (BYTE*) malloc(width * height * 3);
RleDecompress24to24(srcData, size, TmpBfr, width * 3, width, height);
freerdp_bitmap_flip(TmpBfr, dstData, width * 3, height);
free(TmpBfr);
#include <freerdp/codec/color.h>
#include <freerdp/utils/memory.h>
-int freerdp_get_pixel(uint8 * data, int x, int y, int width, int height, int bpp)
+int freerdp_get_pixel(BYTE * data, int x, int y, int width, int height, int bpp)
{
int start;
int shift;
- uint16 *src16;
+ UINT16 *src16;
uint32 *src32;
int red, green, blue;
return data[y * width + x];
case 15:
case 16:
- src16 = (uint16*) data;
+ src16 = (UINT16*) data;
return src16[y * width + x];
case 24:
data += y * width * 3;
return 0;
}
-void freerdp_set_pixel(uint8* data, int x, int y, int width, int height, int bpp, int pixel)
+void freerdp_set_pixel(BYTE* data, int x, int y, int width, int height, int bpp, int pixel)
{
int start;
int shift;
}
}
-static INLINE void freerdp_color_split_rgb(uint32* color, int bpp, uint8* red, uint8* green, uint8* blue, uint8* alpha, HCLRCONV clrconv)
+static INLINE void freerdp_color_split_rgb(uint32* color, int bpp, BYTE* red, BYTE* green, BYTE* blue, BYTE* alpha, HCLRCONV clrconv)
{
*red = *green = *blue = 0;
*alpha = (clrconv->alpha) ? 0xFF : 0x00;
}
}
-static INLINE void freerdp_color_split_bgr(uint32* color, int bpp, uint8* red, uint8* green, uint8* blue, uint8* alpha, HCLRCONV clrconv)
+static INLINE void freerdp_color_split_bgr(uint32* color, int bpp, BYTE* red, BYTE* green, BYTE* blue, BYTE* alpha, HCLRCONV clrconv)
{
*red = *green = *blue = 0;
*alpha = (clrconv->alpha) ? 0xFF : 0x00;
}
}
-static INLINE void freerdp_color_make_rgb(uint32* color, int bpp, uint8* red, uint8* green, uint8* blue, uint8* alpha, HCLRCONV clrconv)
+static INLINE void freerdp_color_make_rgb(uint32* color, int bpp, BYTE* red, BYTE* green, BYTE* blue, BYTE* alpha, HCLRCONV clrconv)
{
switch (bpp)
{
}
}
-static INLINE void freerdp_color_make_bgr(uint32* color, int bpp, uint8* red, uint8* green, uint8* blue, uint8* alpha, HCLRCONV clrconv)
+static INLINE void freerdp_color_make_bgr(uint32* color, int bpp, BYTE* red, BYTE* green, BYTE* blue, BYTE* alpha, HCLRCONV clrconv)
{
switch (bpp)
{
uint32 freerdp_color_convert_rgb(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
- uint8 red = 0;
- uint8 green = 0;
- uint8 blue = 0;
- uint8 alpha = 0xFF;
+ BYTE red = 0;
+ BYTE green = 0;
+ BYTE blue = 0;
+ BYTE alpha = 0xFF;
uint32 dstColor = 0;
freerdp_color_split_rgb(&srcColor, srcBpp, &red, &green, &blue, &alpha, clrconv);
uint32 freerdp_color_convert_bgr(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
- uint8 red = 0;
- uint8 green = 0;
- uint8 blue = 0;
- uint8 alpha = 0xFF;
+ BYTE red = 0;
+ BYTE green = 0;
+ BYTE blue = 0;
+ BYTE alpha = 0xFF;
uint32 dstColor = 0;
freerdp_color_split_bgr(&srcColor, srcBpp, &red, &green, &blue, &alpha, clrconv);
uint32 freerdp_color_convert_rgb_bgr(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
- uint8 red = 0;
- uint8 green = 0;
- uint8 blue = 0;
- uint8 alpha = 0xFF;
+ BYTE red = 0;
+ BYTE green = 0;
+ BYTE blue = 0;
+ BYTE alpha = 0xFF;
uint32 dstColor = 0;
freerdp_color_split_rgb(&srcColor, srcBpp, &red, &green, &blue, &alpha, clrconv);
uint32 freerdp_color_convert_bgr_rgb(uint32 srcColor, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
- uint8 red = 0;
- uint8 green = 0;
- uint8 blue = 0;
- uint8 alpha = 0xFF;
+ BYTE red = 0;
+ BYTE green = 0;
+ BYTE blue = 0;
+ BYTE alpha = 0xFF;
uint32 dstColor = 0;
freerdp_color_split_bgr(&srcColor, srcBpp, &red, &green, &blue, &alpha, clrconv);
return freerdp_color_convert_rgb_bgr(srcColor, srcBpp, dstBpp, clrconv);
}
-uint8* freerdp_image_convert_8bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
+BYTE* freerdp_image_convert_8bpp(BYTE* srcData, BYTE* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
int i;
- uint8 red;
- uint8 green;
- uint8 blue;
+ BYTE red;
+ BYTE green;
+ BYTE blue;
uint32 pixel;
- uint8 *src8;
- uint16 *dst16;
+ BYTE *src8;
+ UINT16 *dst16;
uint32 *dst32;
if (dstBpp == 8)
{
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height);
+ dstData = (BYTE*) malloc(width * height);
memcpy(dstData, srcData, width * height);
return dstData;
else if (dstBpp == 15 || (dstBpp == 16 && clrconv->rgb555))
{
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height * 2);
+ dstData = (BYTE*) malloc(width * height * 2);
- dst16 = (uint16 *) dstData;
+ dst16 = (UINT16 *) dstData;
for (i = width * height; i > 0; i--)
{
pixel = *srcData;
else if (dstBpp == 16)
{
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height * 2);
+ dstData = (BYTE*) malloc(width * height * 2);
- dst16 = (uint16 *) dstData;
+ dst16 = (UINT16 *) dstData;
for (i = width * height; i > 0; i--)
{
pixel = *srcData;
else if (dstBpp == 32)
{
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height * 4);
+ dstData = (BYTE*) malloc(width * height * 4);
- src8 = (uint8*) srcData;
+ src8 = (BYTE*) srcData;
dst32 = (uint32*) dstData;
for (i = width * height; i > 0; i--)
{
return srcData;
}
-uint8* freerdp_image_convert_15bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
+BYTE* freerdp_image_convert_15bpp(BYTE* srcData, BYTE* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
int i;
- uint8 red;
- uint8 green;
- uint8 blue;
+ BYTE red;
+ BYTE green;
+ BYTE blue;
uint32 pixel;
- uint16 *src16;
- uint16 *dst16;
+ UINT16 *src16;
+ UINT16 *dst16;
uint32 *dst32;
if (dstBpp == 15 || (dstBpp == 16 && clrconv->rgb555))
{
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height * 2);
+ dstData = (BYTE*) malloc(width * height * 2);
memcpy(dstData, srcData, width * height * 2);
else if (dstBpp == 32)
{
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height * 4);
+ dstData = (BYTE*) malloc(width * height * 4);
- src16 = (uint16 *) srcData;
+ src16 = (UINT16 *) srcData;
dst32 = (uint32 *) dstData;
for (i = width * height; i > 0; i--)
{
else if (dstBpp == 16)
{
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height * 2);
+ dstData = (BYTE*) malloc(width * height * 2);
- src16 = (uint16 *) srcData;
- dst16 = (uint16 *) dstData;
+ src16 = (UINT16 *) srcData;
+ dst16 = (UINT16 *) dstData;
for (i = width * height; i > 0; i--)
{
pixel = *src16;
return srcData;
}
-uint8* freerdp_image_convert_16bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
+BYTE* freerdp_image_convert_16bpp(BYTE* srcData, BYTE* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
if (srcBpp == 15)
return freerdp_image_convert_15bpp(srcData, dstData, width, height, srcBpp, dstBpp, clrconv);
if (dstBpp == 16)
{
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height * 2);
+ dstData = (BYTE*) malloc(width * height * 2);
if (clrconv->rgb555)
{
int i;
- uint8 red, green, blue;
- uint16* src16 = (uint16 *) srcData;
- uint16* dst16 = (uint16 *) dstData;
+ BYTE red, green, blue;
+ UINT16* src16 = (UINT16 *) srcData;
+ UINT16* dst16 = (UINT16 *) dstData;
for (i = width * height; i > 0; i--)
{
else if (dstBpp == 24)
{
int i;
- uint8 *dst8;
- uint16 *src16;
- uint8 red, green, blue;
+ BYTE *dst8;
+ UINT16 *src16;
+ BYTE red, green, blue;
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height * 3);
+ dstData = (BYTE*) malloc(width * height * 3);
- dst8 = (uint8*) dstData;
- src16 = (uint16*) srcData;
+ dst8 = (BYTE*) dstData;
+ src16 = (UINT16*) srcData;
for (i = width * height; i > 0; i--)
{
{
int i;
uint32 pixel;
- uint16* src16;
+ UINT16* src16;
uint32* dst32;
- uint8 red, green, blue;
+ BYTE red, green, blue;
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height * 4);
+ dstData = (BYTE*) malloc(width * height * 4);
- src16 = (uint16*) srcData;
+ src16 = (UINT16*) srcData;
dst32 = (uint32*) dstData;
for (i = width * height; i > 0; i--)
return srcData;
}
-uint8* freerdp_image_convert_24bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
+BYTE* freerdp_image_convert_24bpp(BYTE* srcData, BYTE* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
int i;
if (dstBpp == 32)
{
- uint8 *dstp;
+ BYTE *dstp;
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height * 4);
+ dstData = (BYTE*) malloc(width * height * 4);
dstp = dstData;
for (i = width * height; i > 0; i--)
return srcData;
}
-uint8* freerdp_image_convert_32bpp(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
+BYTE* freerdp_image_convert_32bpp(BYTE* srcData, BYTE* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
if (dstBpp == 16)
{
int index;
- uint16 *dst16;
+ UINT16 *dst16;
uint32 *src32;
- uint8 red, green, blue;
+ BYTE red, green, blue;
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height * 2);
+ dstData = (BYTE*) malloc(width * height * 2);
- dst16 = (uint16*) dstData;
+ dst16 = (UINT16*) dstData;
src32 = (uint32*) srcData;
for (index = 0; index < width * height; index++)
}
else if (dstBpp == 24)
{
- uint8 *dstp;
+ BYTE *dstp;
int index;
- uint8 red, green, blue;
+ BYTE red, green, blue;
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height * 3);
+ dstData = (BYTE*) malloc(width * height * 3);
dstp = dstData;
for (index = 0; index < width * height; index++)
if (clrconv->alpha)
{
int x, y;
- uint8 *dstp;
+ BYTE *dstp;
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height * 4);
+ dstData = (BYTE*) malloc(width * height * 4);
memcpy(dstData, srcData, width * height * 4);
else
{
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height * 4);
+ dstData = (BYTE*) malloc(width * height * 4);
memcpy(dstData, srcData, width * height * 4);
}
freerdp_image_convert_32bpp
};
-uint8* freerdp_image_convert(uint8* srcData, uint8* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
+BYTE* freerdp_image_convert(BYTE* srcData, BYTE* dstData, int width, int height, int srcBpp, int dstBpp, HCLRCONV clrconv)
{
p_freerdp_image_convert _p_freerdp_image_convert = freerdp_image_convert_[IBPP(srcBpp)];
return 0;
}
-void freerdp_bitmap_flip(uint8 * src, uint8 * dst, int scanLineSz, int height)
+void freerdp_bitmap_flip(BYTE * src, BYTE * dst, int scanLineSz, int height)
{
int i;
- uint8 * bottomLine = dst + (scanLineSz * (height - 1));
- uint8 * topLine = src;
+ BYTE * bottomLine = dst + (scanLineSz * (height - 1));
+ BYTE * topLine = src;
/* Special processing if called for flip-in-place. */
if (src == dst)
* fixed size buffers (of max scanline size (or adaptative?) )
* -- would be much faster).
*/
- uint8 * tmpBfr = malloc(scanLineSz);
+ BYTE * tmpBfr = malloc(scanLineSz);
int half = height / 2;
/* Flip buffer in place by line permutations through the temp
* scan line buffer.
}
-uint8* freerdp_image_flip(uint8* srcData, uint8* dstData, int width, int height, int bpp)
+BYTE* freerdp_image_flip(BYTE* srcData, BYTE* dstData, int width, int height, int bpp)
{
int scanline;
scanline = width * ((bpp + 7) / 8);
if (dstData == NULL)
- dstData = (uint8*) malloc(width * height * ((bpp + 7) / 8));
+ dstData = (BYTE*) malloc(width * height * ((bpp + 7) / 8));
freerdp_bitmap_flip(srcData, dstData, scanline, height);
return dstData;
}
-uint8* freerdp_icon_convert(uint8* srcData, uint8* dstData, uint8* mask, int width, int height, int bpp, HCLRCONV clrconv)
+BYTE* freerdp_icon_convert(BYTE* srcData, BYTE* dstData, BYTE* mask, int width, int height, int bpp, HCLRCONV clrconv)
{
- uint8* data;
- uint8 bmask;
+ BYTE* data;
+ BYTE bmask;
uint32* icon;
int x, y, bit;
int maskIndex;
return dstData;
}
-uint8* freerdp_glyph_convert(int width, int height, uint8* data)
+BYTE* freerdp_glyph_convert(int width, int height, BYTE* data)
{
int x, y;
- uint8 *srcp;
- uint8 *dstp;
- uint8 *dstData;
+ BYTE *srcp;
+ BYTE *dstp;
+ BYTE *dstData;
int scanline;
/*
*/
scanline = (width + 7) / 8;
- dstData = (uint8*) malloc(width * height);
+ dstData = (BYTE*) malloc(width * height);
memset(dstData, 0, width * height);
dstp = dstData;
return dstData;
}
-uint8* freerdp_mono_image_convert(uint8* srcData, int width, int height, int srcBpp, int dstBpp, uint32 bgcolor, uint32 fgcolor, HCLRCONV clrconv)
+BYTE* freerdp_mono_image_convert(BYTE* srcData, int width, int height, int srcBpp, int dstBpp, uint32 bgcolor, uint32 fgcolor, HCLRCONV clrconv)
{
int index;
- uint16* dst16;
+ UINT16* dst16;
uint32* dst32;
- uint8* dstData;
- uint8 bitMask;
+ BYTE* dstData;
+ BYTE bitMask;
int bitIndex;
- uint8 redBg, greenBg, blueBg;
- uint8 redFg, greenFg, blueFg;
+ BYTE redBg, greenBg, blueBg;
+ BYTE redFg, greenFg, blueFg;
switch (srcBpp)
{
}
}
- dstData = (uint8*) malloc(width * height * 2);
- dst16 = (uint16*) dstData;
+ dstData = (BYTE*) malloc(width * height * 2);
+ dst16 = (UINT16*) dstData;
for (index = height; index > 0; index--)
{
}
else if (dstBpp == 32)
{
- dstData = (uint8*) malloc(width * height * 4);
+ dstData = (BYTE*) malloc(width * height * 4);
dst32 = (uint32*) dstData;
for (index = height; index > 0; index--)
return srcData;
}
-void freerdp_alpha_cursor_convert(uint8* alphaData, uint8* xorMask, uint8* andMask, int width, int height, int bpp, HCLRCONV clrconv)
+void freerdp_alpha_cursor_convert(BYTE* alphaData, BYTE* xorMask, BYTE* andMask, int width, int height, int bpp, HCLRCONV clrconv)
{
int xpixel;
int apixel;
}
}
-void freerdp_image_swap_color_order(uint8* data, int width, int height)
+void freerdp_image_swap_color_order(BYTE* data, int width, int height)
{
int x, y;
uint32* pixel;
- uint8 a, r, g, b;
+ BYTE a, r, g, b;
pixel = (uint32*) data;
/**
* Write a foreground/background image to a destination buffer.
*/
-static uint8* WRITEFGBGIMAGE(uint8* pbDest, uint32 rowDelta,
- uint8 bitmask, PIXEL fgPel, uint32 cBits)
+static BYTE* WRITEFGBGIMAGE(BYTE* pbDest, uint32 rowDelta,
+ BYTE bitmask, PIXEL fgPel, uint32 cBits)
{
PIXEL xorPixel;
* Write a foreground/background image to a destination buffer
* for the first line of compressed data.
*/
-static uint8* WRITEFIRSTLINEFGBGIMAGE(uint8* pbDest, uint8 bitmask,
+static BYTE* WRITEFIRSTLINEFGBGIMAGE(BYTE* pbDest, BYTE bitmask,
PIXEL fgPel, uint32 cBits)
{
if (bitmask & g_MaskBit0)
/**
* Decompress an RLE compressed bitmap.
*/
-void RLEDECOMPRESS(uint8* pbSrcBuffer, uint32 cbSrcBuffer, uint8* pbDestBuffer,
+void RLEDECOMPRESS(BYTE* pbSrcBuffer, uint32 cbSrcBuffer, BYTE* pbDestBuffer,
uint32 rowDelta, uint32 width, uint32 height)
{
- uint8* pbSrc = pbSrcBuffer;
- uint8* pbEnd = pbSrcBuffer + cbSrcBuffer;
- uint8* pbDest = pbDestBuffer;
+ BYTE* pbSrc = pbSrcBuffer;
+ BYTE* pbEnd = pbSrcBuffer + cbSrcBuffer;
+ BYTE* pbDest = pbDestBuffer;
PIXEL temp;
PIXEL fgPel = WHITE_PIXEL;
BOOL fInsertFgPel = FALSE;
BOOL fFirstLine = TRUE;
- uint8 bitmask;
+ BYTE bitmask;
PIXEL pixelA, pixelB;
uint32 runLength;
/* jpeg decompress */
BOOL
-jpeg_decompress(uint8 * input, uint8 * output, int width, int height, int size, int bpp)
+jpeg_decompress(BYTE * input, BYTE * output, int width, int height, int size, int bpp)
{
int lwidth;
int lheight;
#else
BOOL
-jpeg_decompress(uint8 * input, uint8 * output, int width, int height, int size, int bpp)
+jpeg_decompress(BYTE * input, BYTE * output, int width, int height, int size, int bpp)
{
return 0;
}
#include <freerdp/codec/mppc_dec.h>
-static uint8 HuffLenLEC[] = {
+static BYTE HuffLenLEC[] = {
0x6, 0x6, 0x6, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x9, 0x8, 0x9, 0x9, 0x9, 0x9, 0x8, 0x8, 0x9, 0x9, 0x9, 0x9, 0x9, 0x9, 0x8, 0x9, 0x9, 0xa, 0x9, 0x9, 0x9, 0x9, 0x9, 0x9, 0x9, 0xa, 0x9, 0xa, 0xa, 0xa, 0x9, 0x9, 0xa, 0x9, 0xa, 0x9, 0xa, 0x9, 0x9, 0x9, 0xa, 0xa, 0x9, 0xa, 0x9, 0x9, 0x8, 0x9, 0x9, 0x9, 0x9, 0xa, 0xa, 0xa, 0x9, 0x9, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0x9, 0x9, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0x9, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0x8, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0x9, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0x9, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0x9, 0x7, 0x9, 0x9, 0xa, 0x9, 0xa, 0xa, 0xa, 0x9, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0x9, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xd, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xb, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0x9, 0xa, 0xa, 0xa, 0xa, 0xa, 0x9, 0xa, 0xa, 0xa, 0xa, 0xa, 0x9, 0xa, 0xa, 0xa, 0x9, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0x9, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0xa, 0x9, 0xa, 0x8, 0x9, 0x9, 0xa, 0x9, 0xa, 0xa, 0xa, 0x9, 0xa, 0xa, 0xa, 0x9, 0x9, 0x8, 0x7, 0xd, 0xd, 0x7, 0x7, 0xa, 0x7, 0x7, 0x6, 0x6, 0x6, 0x6, 0x5, 0x6, 0x6, 0x6, 0x5, 0x6, 0x5, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x6, 0x8, 0x5, 0x6, 0x7, 0x7 };
-static uint16 HuffIndexLEC[512] = {
+static UINT16 HuffIndexLEC[512] = {
0x007b, 0xff1f, 0xff0d, 0xfe27, 0xfe00, 0xff05, 0xff17, 0xfe68, 0x00c5, 0xfe07, 0xff13, 0xfec0, 0xff08, 0xfe18, 0xff1b, 0xfeb3, 0xfe03, 0x00a2, 0xfe42, 0xff10, 0xfe0b, 0xfe02, 0xfe91, 0xff19, 0xfe80, 0x00e9, 0xfe3a, 0xff15, 0xfe12, 0x0057, 0xfed7, 0xff1d, 0xff0e, 0xfe35, 0xfe69, 0xff22, 0xff18, 0xfe7a, 0xfe01, 0xff23, 0xff14, 0xfef4, 0xfeb4, 0xfe09, 0xff1c, 0xfec4, 0xff09, 0xfe60, 0xfe70, 0xff12, 0xfe05, 0xfe92, 0xfea1, 0xff1a, 0xfe0f, 0xff07, 0xfe56, 0xff16, 0xff02, 0xfed8, 0xfee8, 0xff1e, 0xfe1d, 0x003b, 0xffff, 0xff06, 0xffff, 0xfe71, 0xfe89, 0xffff, 0xffff, 0xfe2c, 0xfe2b, 0xfe20, 0xffff, 0xfebb, 0xfecf, 0xfe08, 0xffff, 0xfee0, 0xfe0d, 0xffff, 0xfe99, 0xffff, 0xfe04, 0xfeaa, 0xfe49, 0xffff, 0xfe17, 0xfe61, 0xfedf, 0xffff, 0xfeff, 0xfef6, 0xfe4c, 0xffff, 0xffff, 0xfe87, 0xffff, 0xff24, 0xffff, 0xfe3c, 0xfe72, 0xffff, 0xffff, 0xfece, 0xffff, 0xfefe, 0xffff, 0xfe23, 0xfebc, 0xfe0a, 0xfea9, 0xffff, 0xfe11, 0xffff, 0xfe82, 0xffff, 0xfe06, 0xfe9a, 0xfef5, 0xffff, 0xfe22, 0xfe4d, 0xfe5f, 0xffff, 0xff03, 0xfee1, 0xffff, 0xfeca, 0xfecc, 0xffff, 0xfe19, 0xffff, 0xfeb7, 0xffff, 0xffff, 0xfe83, 0xfe29, 0xffff, 0xffff, 0xffff, 0xfe6c, 0xffff, 0xfeed, 0xffff, 0xffff, 0xfe46, 0xfe5c, 0xfe15, 0xffff, 0xfedb, 0xfea6, 0xffff, 0xffff, 0xfe44, 0xffff, 0xfe0c, 0xffff, 0xfe95, 0xfefc, 0xffff, 0xffff, 0xfeb8, 0x16c9, 0xffff, 0xfef0, 0xffff, 0xfe38, 0xffff, 0xffff, 0xfe6d, 0xfe7e, 0xffff, 0xffff, 0xffff, 0xffff, 0xfe5b, 0xfedc, 0xffff, 0xffff, 0xfeec, 0xfe47, 0xfe1f, 0xffff, 0xfe7f, 0xfe96, 0xffff, 0xffff, 0xfea5, 0xffff, 0xfe10, 0xfe40, 0xfe32, 0xfebf, 0xffff, 0xffff, 0xfed4, 0xfef1, 0xffff, 0xffff, 0xffff, 0xfe75, 0xffff, 0xffff, 0xfe8d, 0xfe31, 0xffff, 0xfe65, 0xfe1b, 0xffff, 0xfee4, 0xfefb, 0xffff, 0xffff, 0xfe52, 0xffff, 0xfe0e, 0xffff, 0xfe9d, 0xfeaf, 0xffff, 0xffff, 0xfe51, 0xfed3, 0xffff, 0xff20, 0xffff, 0xfe2f, 0xffff, 0xffff, 0xfec1, 0xfe8c, 0xffff, 0xffff, 0xffff, 0xfe3f, 0xffff, 0xffff, 0xfe76, 0xffff, 0xfefa, 0xfe53, 0xfe25, 0xffff, 0xfe64, 0xfee5, 0xffff, 0xffff, 0xfeae, 0xffff, 0xfe13, 0xffff, 0xfe88, 0xfe9e, 0xffff, 0xfe43, 0xffff, 0xffff, 0xfea4, 0xfe93, 0xffff, 0xffff, 0xffff, 0xfe3d, 0xffff, 0xffff, 0xfeeb, 0xfed9, 0xffff, 0xfe14, 0xfe5a, 0xffff, 0xfe28, 0xfe7d, 0xffff, 0xffff, 0xfe6a, 0xffff, 0xffff, 0xff01, 0xfec6, 0xfec8, 0xffff, 0xffff, 0xfeb5, 0xffff, 0xffff, 0xffff, 0xfe94, 0xfe78, 0xffff, 0xffff, 0xffff, 0xfea3, 0xffff, 0xffff, 0xfeda, 0xfe58, 0xffff, 0xfe1e, 0xfe45, 0xfeea, 0xffff, 0xfe6b, 0xffff, 0xffff, 0xfe37, 0xffff, 0xffff, 0xffff, 0xfe7c, 0xfeb6, 0xffff, 0xffff, 0xfef8, 0xffff, 0xffff, 0xffff, 0xfec7, 0xfe9b, 0xffff, 0xffff, 0xffff, 0xfe50, 0xffff, 0xffff, 0xfead, 0xfee2, 0xffff, 0xfe1a, 0xfe63, 0xfe4e, 0xffff, 0xffff, 0xfef9, 0xffff, 0xfe73, 0xffff, 0xffff, 0xffff, 0xfe30, 0xfe8b, 0xffff, 0xffff, 0xfebd, 0xfe2e, 0x0100, 0xffff, 0xfeee, 0xfed2, 0xffff, 0xffff, 0xffff, 0xfeac, 0xffff, 0xffff, 0xfe9c, 0xfe84, 0xffff, 0xfe24, 0xfe4f, 0xfef7, 0xffff, 0xffff, 0xfee3, 0xfe62, 0xffff, 0xffff, 0xffff, 0xffff, 0xfe8a, 0xfe74, 0xffff, 0xffff, 0xfe3e, 0xffff, 0xffff, 0xffff, 0xfed1, 0xfebe, 0xffff, 0xffff, 0xfe2d, 0xffff, 0xfe4a, 0xfef3, 0xffff, 0xffff, 0xfedd, 0xfe5e, 0xfe16, 0xffff, 0xfe48, 0xfea8, 0xffff, 0xfeab, 0xfe97, 0xffff, 0xffff, 0xfed0, 0xffff, 0xffff, 0xfecd, 0xfeb9, 0xffff, 0xffff, 0xffff, 0xfe2a, 0xffff, 0xffff, 0xfe86, 0xfe6e, 0xffff, 0xffff, 0xffff, 0xfede, 0xffff, 0xffff, 0xfe5d, 0xfe4b, 0xfe21, 0xffff, 0xfeef, 0xfe98, 0xffff, 0xffff, 0xfe81, 0xffff, 0xffff, 0xffff, 0xfea7, 0xffff, 0xfeba, 0xfefd, 0xffff, 0xffff, 0xffff, 0xfecb, 0xffff, 0xffff, 0xfe6f, 0xfe39, 0xffff, 0xffff, 0xffff, 0xfe85, 0xffff, 0x010c, 0xfee6, 0xfe67, 0xfe1c, 0xffff, 0xfe54, 0xfeb2, 0xffff, 0xffff, 0xfe9f, 0xffff, 0xffff, 0xffff, 0xfe59, 0xfeb1, 0xffff, 0xfec2, 0xffff, 0xffff, 0xfe36, 0xfef2, 0xffff, 0xffff, 0xfed6, 0xfe77, 0xffff, 0xffff, 0xffff, 0xfe33, 0xffff, 0xffff, 0xfe8f, 0xfe55, 0xfe26, 0x010a, 0xff04, 0xfee7, 0xffff, 0x0121, 0xfe66, 0xffff, 0xffff, 0xffff, 0xfeb0, 0xfea0, 0xffff, 0x010f, 0xfe90, 0xffff, 0xffff, 0xfed5, 0xffff, 0xffff, 0xfec3, 0xfe34, 0xffff, 0xffff, 0xffff, 0xfe8e, 0xffff, 0x0111, 0xfe79, 0xfe41, 0x010b };
-static uint16 LECHTab[] = {511, 0, 508, 448, 494, 347, 486, 482};
+static UINT16 LECHTab[] = {511, 0, 508, 448, 494, 347, 486, 482};
-static uint8 HuffLenLOM[] = {
+static BYTE HuffLenLOM[] = {
0x4, 0x2, 0x3, 0x4, 0x3, 0x4, 0x4, 0x5, 0x4, 0x5, 0x5, 0x6, 0x6, 0x7, 0x7, 0x8, 0x7, 0x8, 0x8, 0x9, 0x9, 0x8, 0x9, 0x9, 0x9, 0x9, 0x9, 0x9, 0x9, 0x9, 0x9, 0x9 };
-static uint16 HuffIndexLOM[] = {
+static UINT16 HuffIndexLOM[] = {
0xfe1, 0xfe0, 0xfe2, 0xfe8, 0xe, 0xfe5, 0xfe4, 0xfea, 0xff1, 0xfe3, 0x15, 0xfe7, 0xfef, 0x46, 0xff0, 0xfed, 0xfff, 0xff7, 0xffb, 0x19, 0xffd, 0xff4, 0x12c, 0xfeb, 0xffe, 0xff6, 0xffa, 0x89, 0xffc, 0xff3, 0xff8, 0xff2 };
-static uint8 LOMHTab[] = {0, 4, 10, 19};
+static BYTE LOMHTab[] = {0, 4, 10, 19};
-static uint8 CopyOffsetBitsLUT[] = {
+static BYTE CopyOffsetBitsLUT[] = {
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15 };
static uint32 CopyOffsetBaseLUT[] = {
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 32769, 49153, 65537 };
-static uint8 LOMBitsLUT[] = {
+static BYTE LOMBitsLUT[] = {
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 6, 6, 8, 8, 14, 14 };
-static uint16 LOMBaseLUT[] = {
+static UINT16 LOMBaseLUT[] = {
2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 22, 26, 30, 34, 42, 50, 58, 66, 82, 98, 114, 130, 194, 258, 514, 2, 2 };
-uint16 LEChash(uint16 key)
+UINT16 LEChash(UINT16 key)
{
return ((key & 0x1ff) ^ (key >> 9) ^ (key >> 4) ^ (key >> 7));
}
-uint16 LOMhash(uint16 key)
+UINT16 LOMhash(UINT16 key)
{
return ((key & 0x1f) ^ (key >> 5) ^ (key >> 9));
}
-uint16 miniLEChash(uint16 key)
+UINT16 miniLEChash(UINT16 key)
{
- uint16 h;
+ UINT16 h;
h = ((((key >> 8) ^ (key & 0xff)) >> 2) & 0xf);
if(key >> 9)
h = ~h;
return (h % 12);
}
-uint8 miniLOMhash(uint16 key)
+BYTE miniLOMhash(UINT16 key)
{
- uint8 h;
+ BYTE h;
h = (key >> 4) & 0xf;
return ((h ^ (h >> 2) ^ (h >> 3)) & 0x3);
}
-uint16 getLECindex(uint16 huff)
+UINT16 getLECindex(UINT16 huff)
{
- uint16 h = HuffIndexLEC[LEChash(huff)];
+ UINT16 h = HuffIndexLEC[LEChash(huff)];
if((h ^ huff) >> 9)
return h & 0x1ff;
else
return HuffIndexLEC[LECHTab[miniLEChash(huff)]];
}
-uint16 getLOMindex(uint16 huff)
+UINT16 getLOMindex(UINT16 huff)
{
- uint16 h = HuffIndexLOM[LOMhash(huff)];
+ UINT16 h = HuffIndexLOM[LOMhash(huff)];
if((h ^ huff) >> 5)
{
return h & 0x1f;
*((uint32*)(_s)) = (*((uint32*)(_s)) << 16) | (_x); } while(0)
#define cache_swap(_s, _i) do { \
- uint16 t = *(_s); \
+ UINT16 t = *(_s); \
*(_s) = *((_s) + (_i)); \
*((_s) + (_i)) = t; } while(0)
-int decompress_rdp(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen)
+int decompress_rdp(struct rdp_mppc_dec* dec, BYTE* cbuf, int len, int ctype, uint32* roff, uint32* rlen)
{
int type = ctype & 0x0f;
* @return True on success, False on failure
*/
-int decompress_rdp_4(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen)
+int decompress_rdp_4(struct rdp_mppc_dec* dec, BYTE* cbuf, int len, int ctype, uint32* roff, uint32* rlen)
{
- uint8* history_buf; /* uncompressed data goes here */
- uint8* history_ptr; /* points to next free slot in history_buf */
+ BYTE* history_buf; /* uncompressed data goes here */
+ BYTE* history_ptr; /* points to next free slot in history_buf */
uint32 d32; /* we process 4 compressed bytes at a time */
- uint16 copy_offset; /* location to copy data from */
- uint16 lom; /* length of match */
- uint8* src_ptr; /* used while copying compressed data */
- uint8* cptr; /* points to next byte in cbuf */
- uint8 cur_byte; /* last byte fetched from cbuf */
+ UINT16 copy_offset; /* location to copy data from */
+ UINT16 lom; /* length of match */
+ BYTE* src_ptr; /* used while copying compressed data */
+ BYTE* cptr; /* points to next byte in cbuf */
+ BYTE cur_byte; /* last byte fetched from cbuf */
int bits_left; /* bits left in d34 for processing */
int cur_bits_left; /* bits left in cur_byte for processing */
int tmp;
* @return True on success, False on failure
*/
-int decompress_rdp_5(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen)
+int decompress_rdp_5(struct rdp_mppc_dec* dec, BYTE* cbuf, int len, int ctype, uint32* roff, uint32* rlen)
{
- uint8* history_buf; /* uncompressed data goes here */
- uint8* history_ptr; /* points to next free slot in bistory_buf */
+ BYTE* history_buf; /* uncompressed data goes here */
+ BYTE* history_ptr; /* points to next free slot in bistory_buf */
uint32 d32; /* we process 4 compressed bytes at a time */
- uint16 copy_offset; /* location to copy data from */
- uint16 lom; /* length of match */
- uint8* src_ptr; /* used while copying compressed data */
- uint8* cptr; /* points to next byte in cbuf */
- uint8 cur_byte; /* last byte fetched from cbuf */
+ UINT16 copy_offset; /* location to copy data from */
+ UINT16 lom; /* length of match */
+ BYTE* src_ptr; /* used while copying compressed data */
+ BYTE* cptr; /* points to next byte in cbuf */
+ BYTE cur_byte; /* last byte fetched from cbuf */
int bits_left; /* bits left in d32 for processing */
int cur_bits_left; /* bits left in cur_byte for processing */
int tmp;
* @return True on success, False on failure
*/
-int decompress_rdp_6(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen)
+int decompress_rdp_6(struct rdp_mppc_dec* dec, BYTE* cbuf, int len, int ctype, uint32* roff, uint32* rlen)
{
- uint8* history_buf; /* uncompressed data goes here */
- uint16* offset_cache; /* Copy Offset cache */
- uint8* history_ptr; /* points to next free slot in bistory_buf */
+ BYTE* history_buf; /* uncompressed data goes here */
+ UINT16* offset_cache; /* Copy Offset cache */
+ BYTE* history_ptr; /* points to next free slot in bistory_buf */
uint32 d32; /* we process 4 compressed bytes at a time */
- uint16 copy_offset; /* location to copy data from */
- uint16 lom; /* length of match */
- uint16 LUTIndex; /* LookUp table Index */
- uint8* src_ptr; /* used while copying compressed data */
- uint8* cptr; /* points to next byte in cbuf */
- uint8 cur_byte; /* last byte fetched from cbuf */
+ UINT16 copy_offset; /* location to copy data from */
+ UINT16 lom; /* length of match */
+ UINT16 LUTIndex; /* LookUp table Index */
+ BYTE* src_ptr; /* used while copying compressed data */
+ BYTE* cptr; /* points to next byte in cbuf */
+ BYTE cur_byte; /* last byte fetched from cbuf */
int bits_left; /* bits left in d32 for processing */
int cur_bits_left; /* bits left in cur_byte for processing */
int tmp, i;
d32 <<= i;
bits_left -= i;
if(i32 < 256)
- *history_ptr++ = (uint8)i32;
+ *history_ptr++ = (BYTE)i32;
else if(i32 > 256 && i32 < 289)
{
LUTIndex = i32 - 257;
* @return True on success, False on failure
*/
-int decompress_rdp_61(struct rdp_mppc_dec* dec, uint8* cbuf, int len, int ctype, uint32* roff, uint32* rlen)
+int decompress_rdp_61(struct rdp_mppc_dec* dec, BYTE* cbuf, int len, int ctype, uint32* roff, uint32* rlen)
{
return FALSE;
}
return NULL;
}
- ptr->history_buf = (uint8 *) xzalloc(RDP6_HISTORY_BUF_SIZE);
- ptr->offset_cache = (uint16 *) xzalloc(RDP6_OFFSET_CACHE_SIZE);
+ ptr->history_buf = (BYTE *) xzalloc(RDP6_HISTORY_BUF_SIZE);
+ ptr->offset_cache = (UINT16 *) xzalloc(RDP6_OFFSET_CACHE_SIZE);
if (!ptr->history_buf)
{
printf("mppc_new(): system out of memory\n");
#define CRC(crcval, newchar) crcval = (crcval >> 8) ^ crc_table[(crcval ^ newchar) & 0x00ff]
/* CRC16 defs */
-static const uint16 crc_table[256] =
+static const UINT16 crc_table[256] =
{
0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
return NULL;
}
enc->outputBuffer = enc->outputBufferPlus + 64;
- enc->hash_table = (uint16*) xzalloc(enc->buf_len * 2);
+ enc->hash_table = (UINT16*) xzalloc(enc->buf_len * 2);
if (enc->hash_table == NULL)
{
free(enc->historyBuffer);
* @return TRUE on success, FALSE on failure
*/
-BOOL compress_rdp(struct rdp_mppc_enc* enc, uint8* srcData, int len)
+BOOL compress_rdp(struct rdp_mppc_enc* enc, BYTE* srcData, int len)
{
if ((enc == NULL) || (srcData == NULL) || (len <= 0) || (len > enc->buf_len))
return FALSE;
* @return TRUE on success, FALSE on failure
*/
-BOOL compress_rdp_4(struct rdp_mppc_enc* enc, uint8* srcData, int len)
+BOOL compress_rdp_4(struct rdp_mppc_enc* enc, BYTE* srcData, int len)
{
/* RDP 4.0 encoding not yet implemented */
return FALSE;
* @return TRUE on success, FALSE on failure
*/
-BOOL compress_rdp_5(struct rdp_mppc_enc* enc, uint8* srcData, int len)
+BOOL compress_rdp_5(struct rdp_mppc_enc* enc, BYTE* srcData, int len)
{
char* outputBuffer; /* points to enc->outputBuffer */
char* hptr_end; /* points to end of history data */
uint32 copy_offset; /* pattern match starts here... */
uint32 lom; /* ...and matches this many bytes */
int last_crc_index; /* don't compute CRC beyond this index */
- uint16 *hash_table; /* hash table for pattern matching */
+ UINT16 *hash_table; /* hash table for pattern matching */
uint32 i;
uint32 j;
uint32 k;
uint32 x;
- uint8 data;
- uint16 data16;
+ BYTE data;
+ UINT16 data16;
uint32 historyOffset;
- uint16 crc;
+ UINT16 crc;
uint32 ctr;
uint32 saved_ctr;
uint32 data_end;
- uint8 byte_val;
+ BYTE byte_val;
crc = 0;
opb_index = 0;
static void nsc_decode(NSC_CONTEXT* context)
{
- uint16 x;
- uint16 y;
- uint16 rw;
- uint8 shift;
- uint8* yplane;
- uint8* coplane;
- uint8* cgplane;
- uint8* aplane;
- sint16 y_val;
- sint16 co_val;
- sint16 cg_val;
- sint16 r_val;
- sint16 g_val;
- sint16 b_val;
- uint8* bmpdata;
+ UINT16 x;
+ UINT16 y;
+ UINT16 rw;
+ BYTE shift;
+ BYTE* yplane;
+ BYTE* coplane;
+ BYTE* cgplane;
+ BYTE* aplane;
+ INT16 y_val;
+ INT16 co_val;
+ INT16 cg_val;
+ INT16 r_val;
+ INT16 g_val;
+ INT16 b_val;
+ BYTE* bmpdata;
bmpdata = context->bmpdata;
rw = ROUND_UP_TO(context->width, 8);
aplane = context->priv->plane_buf[3] + y * context->width; /* A */
for (x = 0; x < context->width; x++)
{
- y_val = (sint16) *yplane;
- co_val = (sint16) (sint8) (*coplane << shift);
- cg_val = (sint16) (sint8) (*cgplane << shift);
+ y_val = (INT16) *yplane;
+ co_val = (INT16) (INT8) (*coplane << shift);
+ cg_val = (INT16) (INT8) (*cgplane << shift);
r_val = y_val + co_val - cg_val;
g_val = y_val + cg_val;
b_val = y_val - co_val - cg_val;
}
}
-static void nsc_rle_decode(uint8* in, uint8* out, uint32 origsz)
+static void nsc_rle_decode(BYTE* in, BYTE* out, uint32 origsz)
{
uint32 len;
uint32 left;
- uint8 value;
+ BYTE value;
left = origsz;
while (left > 4)
static void nsc_rle_decompress_data(NSC_CONTEXT* context)
{
- uint16 i;
- uint8* rle;
+ UINT16 i;
+ BYTE* rle;
uint32 origsize;
uint32 planesize;
for (i = 0; i < 4; i++)
stream_read_uint32(s, context->nsc_stream.PlaneByteCount[i]);
- stream_read_uint8(s, context->nsc_stream.ColorLossLevel);
- stream_read_uint8(s, context->nsc_stream.ChromaSubSamplingLevel);
+ stream_read_BYTE(s, context->nsc_stream.ColorLossLevel);
+ stream_read_BYTE(s, context->nsc_stream.ChromaSubSamplingLevel);
stream_seek(s, 2);
context->nsc_stream.Planes = stream_get_tail(s);
if (length > context->priv->plane_buf_length)
{
for (i = 0; i < 4; i++)
- context->priv->plane_buf[i] = (uint8*) realloc(context->priv->plane_buf[i], length);
+ context->priv->plane_buf[i] = (BYTE*) realloc(context->priv->plane_buf[i], length);
context->priv->plane_buf_length = length;
}
}
}
-void nsc_process_message(NSC_CONTEXT* context, uint16 bpp,
- uint16 width, uint16 height, uint8* data, uint32 length)
+void nsc_process_message(NSC_CONTEXT* context, UINT16 bpp,
+ UINT16 width, UINT16 height, BYTE* data, uint32 length)
{
STREAM* s;
if (length > context->priv->plane_buf_length)
{
for (i = 0; i < 5; i++)
- context->priv->plane_buf[i] = (uint8*) realloc(context->priv->plane_buf[i], length);
+ context->priv->plane_buf[i] = (BYTE*) realloc(context->priv->plane_buf[i], length);
context->priv->plane_buf_length = length;
}
}
}
-static void nsc_encode_argb_to_aycocg(NSC_CONTEXT* context, uint8* bmpdata, int rowstride)
+static void nsc_encode_argb_to_aycocg(NSC_CONTEXT* context, BYTE* bmpdata, int rowstride)
{
- uint16 x;
- uint16 y;
- uint16 rw;
- uint8 ccl;
- uint8* src;
- uint8* yplane;
- uint8* coplane;
- uint8* cgplane;
- uint8* aplane;
- sint16 r_val;
- sint16 g_val;
- sint16 b_val;
- uint8 a_val;
+ UINT16 x;
+ UINT16 y;
+ UINT16 rw;
+ BYTE ccl;
+ BYTE* src;
+ BYTE* yplane;
+ BYTE* coplane;
+ BYTE* cgplane;
+ BYTE* aplane;
+ INT16 r_val;
+ INT16 g_val;
+ INT16 b_val;
+ BYTE a_val;
uint32 tempWidth;
uint32 tempHeight;
a_val = 0xFF;
break;
case RDP_PIXEL_FORMAT_B5G6R5_LE:
- b_val = (sint16) (((*(src + 1)) & 0xF8) | ((*(src + 1)) >> 5));
- g_val = (sint16) ((((*(src + 1)) & 0x07) << 5) | (((*src) & 0xE0) >> 3));
- r_val = (sint16) ((((*src) & 0x1F) << 3) | (((*src) >> 2) & 0x07));
+ b_val = (INT16) (((*(src + 1)) & 0xF8) | ((*(src + 1)) >> 5));
+ g_val = (INT16) ((((*(src + 1)) & 0x07) << 5) | (((*src) & 0xE0) >> 3));
+ r_val = (INT16) ((((*src) & 0x1F) << 3) | (((*src) >> 2) & 0x07));
a_val = 0xFF;
src += 2;
break;
case RDP_PIXEL_FORMAT_R5G6B5_LE:
- r_val = (sint16) (((*(src + 1)) & 0xF8) | ((*(src + 1)) >> 5));
- g_val = (sint16) ((((*(src + 1)) & 0x07) << 5) | (((*src) & 0xE0) >> 3));
- b_val = (sint16) ((((*src) & 0x1F) << 3) | (((*src) >> 2) & 0x07));
+ r_val = (INT16) (((*(src + 1)) & 0xF8) | ((*(src + 1)) >> 5));
+ g_val = (INT16) ((((*(src + 1)) & 0x07) << 5) | (((*src) & 0xE0) >> 3));
+ b_val = (INT16) ((((*src) & 0x1F) << 3) | (((*src) >> 2) & 0x07));
a_val = 0xFF;
src += 2;
break;
case RDP_PIXEL_FORMAT_P4_PLANER:
{
int shift;
- uint8 idx;
+ BYTE idx;
shift = (7 - (x % 8));
idx = ((*src) >> shift) & 1;
idx |= (((*(src + 2)) >> shift) & 1) << 2;
idx |= (((*(src + 3)) >> shift) & 1) << 3;
idx *= 3;
- r_val = (sint16) context->palette[idx];
- g_val = (sint16) context->palette[idx + 1];
- b_val = (sint16) context->palette[idx + 2];
+ r_val = (INT16) context->palette[idx];
+ g_val = (INT16) context->palette[idx + 1];
+ b_val = (INT16) context->palette[idx + 2];
if (shift == 0)
src += 4;
}
{
int idx = (*src) * 3;
- r_val = (sint16) context->palette[idx];
- g_val = (sint16) context->palette[idx + 1];
- b_val = (sint16) context->palette[idx + 2];
+ r_val = (INT16) context->palette[idx];
+ g_val = (INT16) context->palette[idx + 1];
+ b_val = (INT16) context->palette[idx + 2];
src++;
}
a_val = 0xFF;
r_val = g_val = b_val = a_val = 0;
break;
}
- *yplane++ = (uint8) ((r_val >> 2) + (g_val >> 1) + (b_val >> 2));
+ *yplane++ = (BYTE) ((r_val >> 2) + (g_val >> 1) + (b_val >> 2));
/* Perform color loss reduction here */
- *coplane++ = (uint8) ((r_val - b_val) >> ccl);
- *cgplane++ = (uint8) ((-(r_val >> 1) + g_val - (b_val >> 1)) >> ccl);
+ *coplane++ = (BYTE) ((r_val - b_val) >> ccl);
+ *cgplane++ = (BYTE) ((-(r_val >> 1) + g_val - (b_val >> 1)) >> ccl);
*aplane++ = a_val;
}
if (context->nsc_stream.ChromaSubSamplingLevel > 0 && (x % 2) == 1)
static void nsc_encode_subsampling(NSC_CONTEXT* context)
{
- uint16 x;
- uint16 y;
- uint8* co_dst;
- uint8* cg_dst;
- sint8* co_src0;
- sint8* co_src1;
- sint8* cg_src0;
- sint8* cg_src1;
+ UINT16 x;
+ UINT16 y;
+ BYTE* co_dst;
+ BYTE* cg_dst;
+ INT8* co_src0;
+ INT8* co_src1;
+ INT8* cg_src0;
+ INT8* cg_src1;
uint32 tempWidth;
uint32 tempHeight;
{
co_dst = context->priv->plane_buf[1] + y * (tempWidth >> 1);
cg_dst = context->priv->plane_buf[2] + y * (tempWidth >> 1);
- co_src0 = (sint8*) context->priv->plane_buf[1] + (y << 1) * tempWidth;
+ co_src0 = (INT8*) context->priv->plane_buf[1] + (y << 1) * tempWidth;
co_src1 = co_src0 + tempWidth;
- cg_src0 = (sint8*) context->priv->plane_buf[2] + (y << 1) * tempWidth;
+ cg_src0 = (INT8*) context->priv->plane_buf[2] + (y << 1) * tempWidth;
cg_src1 = cg_src0 + tempWidth;
for (x = 0; x < tempWidth >> 1; x++)
{
- *co_dst++ = (uint8) (((sint16) *co_src0 + (sint16) *(co_src0 + 1) +
- (sint16) *co_src1 + (sint16) *(co_src1 + 1)) >> 2);
- *cg_dst++ = (uint8) (((sint16) *cg_src0 + (sint16) *(cg_src0 + 1) +
- (sint16) *cg_src1 + (sint16) *(cg_src1 + 1)) >> 2);
+ *co_dst++ = (BYTE) (((INT16) *co_src0 + (INT16) *(co_src0 + 1) +
+ (INT16) *co_src1 + (INT16) *(co_src1 + 1)) >> 2);
+ *cg_dst++ = (BYTE) (((INT16) *cg_src0 + (INT16) *(cg_src0 + 1) +
+ (INT16) *cg_src1 + (INT16) *(cg_src1 + 1)) >> 2);
co_src0 += 2;
co_src1 += 2;
cg_src0 += 2;
}
}
-void nsc_encode(NSC_CONTEXT* context, uint8* bmpdata, int rowstride)
+void nsc_encode(NSC_CONTEXT* context, BYTE* bmpdata, int rowstride)
{
nsc_encode_argb_to_aycocg(context, bmpdata, rowstride);
if (context->nsc_stream.ChromaSubSamplingLevel > 0)
}
}
-static uint32 nsc_rle_encode(uint8* in, uint8* out, uint32 origsz)
+static uint32 nsc_rle_encode(BYTE* in, BYTE* out, uint32 origsz)
{
uint32 left;
uint32 runlength = 1;
static void nsc_rle_compress_data(NSC_CONTEXT* context)
{
- uint16 i;
- uint8* rle;
+ UINT16 i;
+ BYTE* rle;
uint32 origsize;
uint32 planesize;
}
void nsc_compose_message(NSC_CONTEXT* context, STREAM* s,
- uint8* bmpdata, int width, int height, int rowstride)
+ BYTE* bmpdata, int width, int height, int rowstride)
{
int i;
stream_write_uint32(s, context->nsc_stream.PlaneByteCount[1]); /* OrangeChromaPlaneByteCount (4 bytes) */
stream_write_uint32(s, context->nsc_stream.PlaneByteCount[2]); /* GreenChromaPlaneByteCount (4 bytes) */
stream_write_uint32(s, context->nsc_stream.PlaneByteCount[3]); /* AlphaPlaneByteCount (4 bytes) */
- stream_write_uint8(s, context->nsc_stream.ColorLossLevel); /* ColorLossLevel (1 byte) */
- stream_write_uint8(s, context->nsc_stream.ChromaSubSamplingLevel); /* ChromaSubsamplingLevel (1 byte) */
- stream_write_uint16(s, 0); /* Reserved (2 bytes) */
+ stream_write_BYTE(s, context->nsc_stream.ColorLossLevel); /* ColorLossLevel (1 byte) */
+ stream_write_BYTE(s, context->nsc_stream.ChromaSubSamplingLevel); /* ChromaSubsamplingLevel (1 byte) */
+ stream_write_UINT16(s, 0); /* Reserved (2 bytes) */
for (i = 0; i < 4; i++)
{
#ifndef __NSC_ENCODE_H
#define __NSC_ENCODE_H
-void nsc_encode(NSC_CONTEXT* context, uint8* bmpdata, int rowstride);
+void nsc_encode(NSC_CONTEXT* context, BYTE* bmpdata, int rowstride);
#endif
#include "nsc_types.h"
#include "nsc_sse2.h"
-static void nsc_encode_argb_to_aycocg_sse2(NSC_CONTEXT* context, uint8* bmpdata, int rowstride)
+static void nsc_encode_argb_to_aycocg_sse2(NSC_CONTEXT* context, BYTE* bmpdata, int rowstride)
{
- uint16 x;
- uint16 y;
- uint16 rw;
- uint8 ccl;
- uint8* src;
- uint8* yplane;
- uint8* coplane;
- uint8* cgplane;
- uint8* aplane;
+ UINT16 x;
+ UINT16 y;
+ UINT16 rw;
+ BYTE ccl;
+ BYTE* src;
+ BYTE* yplane;
+ BYTE* coplane;
+ BYTE* cgplane;
+ BYTE* aplane;
__m128i r_val;
__m128i g_val;
__m128i b_val;
case RDP_PIXEL_FORMAT_P4_PLANER:
{
int shift;
- uint8 idx[8];
+ BYTE idx[8];
for (shift = 7; shift >= 0; shift--)
{
static void nsc_encode_subsampling_sse2(NSC_CONTEXT* context)
{
- uint16 x;
- uint16 y;
- uint8* co_dst;
- uint8* cg_dst;
- sint8* co_src0;
- sint8* co_src1;
- sint8* cg_src0;
- sint8* cg_src1;
+ UINT16 x;
+ UINT16 y;
+ BYTE* co_dst;
+ BYTE* cg_dst;
+ INT8* co_src0;
+ INT8* co_src1;
+ INT8* cg_src0;
+ INT8* cg_src1;
uint32 tempWidth;
uint32 tempHeight;
__m128i t;
{
co_dst = context->priv->plane_buf[1] + y * (tempWidth >> 1);
cg_dst = context->priv->plane_buf[2] + y * (tempWidth >> 1);
- co_src0 = (sint8*) context->priv->plane_buf[1] + (y << 1) * tempWidth;
+ co_src0 = (INT8*) context->priv->plane_buf[1] + (y << 1) * tempWidth;
co_src1 = co_src0 + tempWidth;
- cg_src0 = (sint8*) context->priv->plane_buf[2] + (y << 1) * tempWidth;
+ cg_src0 = (INT8*) context->priv->plane_buf[2] + (y << 1) * tempWidth;
cg_src1 = cg_src0 + tempWidth;
for (x = 0; x < tempWidth >> 1; x += 8)
{
}
}
-static void nsc_encode_sse2(NSC_CONTEXT* context, uint8* bmpdata, int rowstride)
+static void nsc_encode_sse2(NSC_CONTEXT* context, BYTE* bmpdata, int rowstride)
{
nsc_encode_argb_to_aycocg_sse2(context, bmpdata, rowstride);
if (context->nsc_stream.ChromaSubSamplingLevel > 0)
struct _NSC_CONTEXT_PRIV
{
- uint8* plane_buf[5]; /* Decompressed Plane Buffers in the respective order */
+ BYTE* plane_buf[5]; /* Decompressed Plane Buffers in the respective order */
uint32 plane_buf_length; /* Lengths of each plane buffer */
/* profilers */
rfx_context_set_pixel_format(context, RDP_PIXEL_FORMAT_B8G8R8A8);
/* align buffers to 16 byte boundary (needed for SSE/SSE2 instructions) */
- context->priv->y_r_buffer = (sint16*)(((uintptr_t)context->priv->y_r_mem + 16) & ~ 0x0F);
- context->priv->cb_g_buffer = (sint16*)(((uintptr_t)context->priv->cb_g_mem + 16) & ~ 0x0F);
- context->priv->cr_b_buffer = (sint16*)(((uintptr_t)context->priv->cr_b_mem + 16) & ~ 0x0F);
+ context->priv->y_r_buffer = (INT16*)(((uintptr_t)context->priv->y_r_mem + 16) & ~ 0x0F);
+ context->priv->cb_g_buffer = (INT16*)(((uintptr_t)context->priv->cb_g_mem + 16) & ~ 0x0F);
+ context->priv->cr_b_buffer = (INT16*)(((uintptr_t)context->priv->cr_b_mem + 16) & ~ 0x0F);
- context->priv->dwt_buffer = (sint16*)(((uintptr_t)context->priv->dwt_mem + 16) & ~ 0x0F);
+ context->priv->dwt_buffer = (INT16*)(((uintptr_t)context->priv->dwt_mem + 16) & ~ 0x0F);
/* create profilers for default decoding routines */
rfx_profiler_create(context);
return;
}
- stream_read_uint16(s, context->version); /* version (2 bytes), WF_VERSION_1_0 (0x0100) */
+ stream_read_UINT16(s, context->version); /* version (2 bytes), WF_VERSION_1_0 (0x0100) */
if (context->version != WF_VERSION_1_0)
{
static void rfx_process_message_codec_versions(RFX_CONTEXT* context, STREAM* s)
{
- uint8 numCodecs;
+ BYTE numCodecs;
- stream_read_uint8(s, numCodecs); /* numCodecs (1 byte), must be set to 0x01 */
+ stream_read_BYTE(s, numCodecs); /* numCodecs (1 byte), must be set to 0x01 */
if (numCodecs != 1)
{
}
/* RFX_CODEC_VERSIONT */
- stream_read_uint8(s, context->codec_id); /* codecId (1 byte) */
- stream_read_uint8(s, context->codec_version); /* version (2 bytes) */
+ stream_read_BYTE(s, context->codec_id); /* codecId (1 byte) */
+ stream_read_BYTE(s, context->codec_version); /* version (2 bytes) */
DEBUG_RFX("id %d version 0x%X.", context->codec_id, context->codec_version);
}
static void rfx_process_message_channels(RFX_CONTEXT* context, STREAM* s)
{
- uint8 channelId;
- uint8 numChannels;
+ BYTE channelId;
+ BYTE numChannels;
- stream_read_uint8(s, numChannels); /* numChannels (1 byte), must bet set to 0x01 */
+ stream_read_BYTE(s, numChannels); /* numChannels (1 byte), must bet set to 0x01 */
/* In RDVH sessions, numChannels will represent the number of virtual monitors
* configured and does not always be set to 0x01 as [MS-RDPRFX] said.
}
/* RFX_CHANNELT */
- stream_read_uint8(s, channelId); /* channelId (1 byte) */
- stream_read_uint16(s, context->width); /* width (2 bytes) */
- stream_read_uint16(s, context->height); /* height (2 bytes) */
+ stream_read_BYTE(s, channelId); /* channelId (1 byte) */
+ stream_read_UINT16(s, context->width); /* width (2 bytes) */
+ stream_read_UINT16(s, context->height); /* height (2 bytes) */
/* Now, only the first monitor can be used, therefore the other channels will be ignored. */
stream_seek(s, 5 * (numChannels - 1));
static void rfx_process_message_context(RFX_CONTEXT* context, STREAM* s)
{
- uint8 ctxId;
- uint16 tileSize;
- uint16 properties;
+ BYTE ctxId;
+ UINT16 tileSize;
+ UINT16 properties;
- stream_read_uint8(s, ctxId); /* ctxId (1 byte), must be set to 0x00 */
- stream_read_uint16(s, tileSize); /* tileSize (2 bytes), must be set to CT_TILE_64x64 (0x0040) */
- stream_read_uint16(s, properties); /* properties (2 bytes) */
+ stream_read_BYTE(s, ctxId); /* ctxId (1 byte), must be set to 0x00 */
+ stream_read_UINT16(s, tileSize); /* tileSize (2 bytes), must be set to CT_TILE_64x64 (0x0040) */
+ stream_read_UINT16(s, properties); /* properties (2 bytes) */
DEBUG_RFX("ctxId %d tileSize %d properties 0x%X.", ctxId, tileSize, properties);
static void rfx_process_message_frame_begin(RFX_CONTEXT* context, RFX_MESSAGE* message, STREAM* s)
{
uint32 frameIdx;
- uint16 numRegions;
+ UINT16 numRegions;
stream_read_uint32(s, frameIdx); /* frameIdx (4 bytes), if codec is in video mode, must be ignored */
- stream_read_uint16(s, numRegions); /* numRegions (2 bytes) */
+ stream_read_UINT16(s, numRegions); /* numRegions (2 bytes) */
DEBUG_RFX("RFX_FRAME_BEGIN: frameIdx:%d numRegions:%d", frameIdx, numRegions);
}
{
int i;
- stream_seek_uint8(s); /* regionFlags (1 byte) */
- stream_read_uint16(s, message->num_rects); /* numRects (2 bytes) */
+ stream_seek_BYTE(s); /* regionFlags (1 byte) */
+ stream_read_UINT16(s, message->num_rects); /* numRects (2 bytes) */
if (message->num_rects < 1)
{
for (i = 0; i < message->num_rects; i++)
{
/* RFX_RECT */
- stream_read_uint16(s, message->rects[i].x); /* x (2 bytes) */
- stream_read_uint16(s, message->rects[i].y); /* y (2 bytes) */
- stream_read_uint16(s, message->rects[i].width); /* width (2 bytes) */
- stream_read_uint16(s, message->rects[i].height); /* height (2 bytes) */
+ stream_read_UINT16(s, message->rects[i].x); /* x (2 bytes) */
+ stream_read_UINT16(s, message->rects[i].y); /* y (2 bytes) */
+ stream_read_UINT16(s, message->rects[i].width); /* width (2 bytes) */
+ stream_read_UINT16(s, message->rects[i].height); /* height (2 bytes) */
DEBUG_RFX("rect %d (%d %d %d %d).",
i, message->rects[i].x, message->rects[i].y, message->rects[i].width, message->rects[i].height);
static void rfx_process_message_tile(RFX_CONTEXT* context, RFX_TILE* tile, STREAM* s)
{
- uint8 quantIdxY;
- uint8 quantIdxCb;
- uint8 quantIdxCr;
- uint16 xIdx, yIdx;
- uint16 YLen, CbLen, CrLen;
+ BYTE quantIdxY;
+ BYTE quantIdxCb;
+ BYTE quantIdxCr;
+ UINT16 xIdx, yIdx;
+ UINT16 YLen, CbLen, CrLen;
/* RFX_TILE */
- stream_read_uint8(s, quantIdxY); /* quantIdxY (1 byte) */
- stream_read_uint8(s, quantIdxCb); /* quantIdxCb (1 byte) */
- stream_read_uint8(s, quantIdxCr); /* quantIdxCr (1 byte) */
- stream_read_uint16(s, xIdx); /* xIdx (2 bytes) */
- stream_read_uint16(s, yIdx); /* yIdx (2 bytes) */
- stream_read_uint16(s, YLen); /* YLen (2 bytes) */
- stream_read_uint16(s, CbLen); /* CbLen (2 bytes) */
- stream_read_uint16(s, CrLen); /* CrLen (2 bytes) */
+ stream_read_BYTE(s, quantIdxY); /* quantIdxY (1 byte) */
+ stream_read_BYTE(s, quantIdxCb); /* quantIdxCb (1 byte) */
+ stream_read_BYTE(s, quantIdxCr); /* quantIdxCr (1 byte) */
+ stream_read_UINT16(s, xIdx); /* xIdx (2 bytes) */
+ stream_read_UINT16(s, yIdx); /* yIdx (2 bytes) */
+ stream_read_UINT16(s, YLen); /* YLen (2 bytes) */
+ stream_read_UINT16(s, CbLen); /* CbLen (2 bytes) */
+ stream_read_UINT16(s, CrLen); /* CrLen (2 bytes) */
DEBUG_RFX("quantIdxY:%d quantIdxCb:%d quantIdxCr:%d xIdx:%d yIdx:%d YLen:%d CbLen:%d CrLen:%d",
quantIdxY, quantIdxCb, quantIdxCr, xIdx, yIdx, YLen, CbLen, CrLen);
static void rfx_process_message_tileset(RFX_CONTEXT* context, RFX_MESSAGE* message, STREAM* s)
{
int i;
- uint16 subtype;
+ UINT16 subtype;
uint32 blockLen;
uint32 blockType;
uint32 tilesDataSize;
uint32* quants;
- uint8 quant;
+ BYTE quant;
int pos;
- stream_read_uint16(s, subtype); /* subtype (2 bytes) must be set to CBT_TILESET (0xCAC2) */
+ stream_read_UINT16(s, subtype); /* subtype (2 bytes) must be set to CBT_TILESET (0xCAC2) */
if (subtype != CBT_TILESET)
{
return;
}
- stream_seek_uint16(s); /* idx (2 bytes), must be set to 0x0000 */
- stream_seek_uint16(s); /* properties (2 bytes) */
+ stream_seek_UINT16(s); /* idx (2 bytes), must be set to 0x0000 */
+ stream_seek_UINT16(s); /* properties (2 bytes) */
- stream_read_uint8(s, context->num_quants); /* numQuant (1 byte) */
- stream_seek_uint8(s); /* tileSize (1 byte), must be set to 0x40 */
+ stream_read_BYTE(s, context->num_quants); /* numQuant (1 byte) */
+ stream_seek_BYTE(s); /* tileSize (1 byte), must be set to 0x40 */
if (context->num_quants < 1)
{
return;
}
- stream_read_uint16(s, message->num_tiles); /* numTiles (2 bytes) */
+ stream_read_UINT16(s, message->num_tiles); /* numTiles (2 bytes) */
if (message->num_tiles < 1)
{
for (i = 0; i < context->num_quants; i++)
{
/* RFX_CODEC_QUANT */
- stream_read_uint8(s, quant);
+ stream_read_BYTE(s, quant);
*quants++ = (quant & 0x0F);
*quants++ = (quant >> 4);
- stream_read_uint8(s, quant);
+ stream_read_BYTE(s, quant);
*quants++ = (quant & 0x0F);
*quants++ = (quant >> 4);
- stream_read_uint8(s, quant);
+ stream_read_BYTE(s, quant);
*quants++ = (quant & 0x0F);
*quants++ = (quant >> 4);
- stream_read_uint8(s, quant);
+ stream_read_BYTE(s, quant);
*quants++ = (quant & 0x0F);
*quants++ = (quant >> 4);
- stream_read_uint8(s, quant);
+ stream_read_BYTE(s, quant);
*quants++ = (quant & 0x0F);
*quants++ = (quant >> 4);
for (i = 0; i < message->num_tiles; i++)
{
/* RFX_TILE */
- stream_read_uint16(s, blockType); /* blockType (2 bytes), must be set to CBT_TILE (0xCAC3) */
+ stream_read_UINT16(s, blockType); /* blockType (2 bytes), must be set to CBT_TILE (0xCAC3) */
stream_read_uint32(s, blockLen); /* blockLen (4 bytes) */
pos = stream_get_pos(s) - 6 + blockLen;
}
}
-RFX_MESSAGE* rfx_process_message(RFX_CONTEXT* context, uint8* data, uint32 length)
+RFX_MESSAGE* rfx_process_message(RFX_CONTEXT* context, BYTE* data, uint32 length)
{
int pos;
STREAM* s;
while (stream_get_left(s) > 6)
{
/* RFX_BLOCKT */
- stream_read_uint16(s, blockType); /* blockType (2 bytes) */
+ stream_read_UINT16(s, blockType); /* blockType (2 bytes) */
stream_read_uint32(s, blockLen); /* blockLen (4 bytes) */
DEBUG_RFX("blockType 0x%X blockLen %d", blockType, blockLen);
return message;
}
-uint16 rfx_message_get_tile_count(RFX_MESSAGE* message)
+UINT16 rfx_message_get_tile_count(RFX_MESSAGE* message)
{
return message->num_tiles;
}
return message->tiles[index];
}
-uint16 rfx_message_get_rect_count(RFX_MESSAGE* message)
+UINT16 rfx_message_get_rect_count(RFX_MESSAGE* message)
{
return message->num_rects;
}
static void rfx_compose_message_sync(RFX_CONTEXT* context, STREAM* s)
{
- stream_write_uint16(s, WBT_SYNC); /* BlockT.blockType */
+ stream_write_UINT16(s, WBT_SYNC); /* BlockT.blockType */
stream_write_uint32(s, 12); /* BlockT.blockLen */
stream_write_uint32(s, WF_MAGIC); /* magic */
- stream_write_uint16(s, WF_VERSION_1_0); /* version */
+ stream_write_UINT16(s, WF_VERSION_1_0); /* version */
}
static void rfx_compose_message_codec_versions(RFX_CONTEXT* context, STREAM* s)
{
- stream_write_uint16(s, WBT_CODEC_VERSIONS); /* BlockT.blockType */
+ stream_write_UINT16(s, WBT_CODEC_VERSIONS); /* BlockT.blockType */
stream_write_uint32(s, 10); /* BlockT.blockLen */
- stream_write_uint8(s, 1); /* numCodecs */
- stream_write_uint8(s, 1); /* codecs.codecId */
- stream_write_uint16(s, WF_VERSION_1_0); /* codecs.version */
+ stream_write_BYTE(s, 1); /* numCodecs */
+ stream_write_BYTE(s, 1); /* codecs.codecId */
+ stream_write_UINT16(s, WF_VERSION_1_0); /* codecs.version */
}
static void rfx_compose_message_channels(RFX_CONTEXT* context, STREAM* s)
{
- stream_write_uint16(s, WBT_CHANNELS); /* BlockT.blockType */
+ stream_write_UINT16(s, WBT_CHANNELS); /* BlockT.blockType */
stream_write_uint32(s, 12); /* BlockT.blockLen */
- stream_write_uint8(s, 1); /* numChannels */
- stream_write_uint8(s, 0); /* Channel.channelId */
- stream_write_uint16(s, context->width); /* Channel.width */
- stream_write_uint16(s, context->height); /* Channel.height */
+ stream_write_BYTE(s, 1); /* numChannels */
+ stream_write_BYTE(s, 0); /* Channel.channelId */
+ stream_write_UINT16(s, context->width); /* Channel.width */
+ stream_write_UINT16(s, context->height); /* Channel.height */
}
static void rfx_compose_message_context(RFX_CONTEXT* context, STREAM* s)
{
- uint16 properties;
+ UINT16 properties;
- stream_write_uint16(s, WBT_CONTEXT); /* CodecChannelT.blockType */
+ stream_write_UINT16(s, WBT_CONTEXT); /* CodecChannelT.blockType */
stream_write_uint32(s, 13); /* CodecChannelT.blockLen */
- stream_write_uint8(s, 1); /* CodecChannelT.codecId */
- stream_write_uint8(s, 0); /* CodecChannelT.channelId */
- stream_write_uint8(s, 0); /* ctxId */
- stream_write_uint16(s, CT_TILE_64x64); /* tileSize */
+ stream_write_BYTE(s, 1); /* CodecChannelT.codecId */
+ stream_write_BYTE(s, 0); /* CodecChannelT.channelId */
+ stream_write_BYTE(s, 0); /* ctxId */
+ stream_write_UINT16(s, CT_TILE_64x64); /* tileSize */
/* properties */
properties = context->flags; /* flags */
properties |= (CLW_XFORM_DWT_53_A << 5); /* xft */
properties |= ((context->mode == RLGR1 ? CLW_ENTROPY_RLGR1 : CLW_ENTROPY_RLGR3) << 9); /* et */
properties |= (SCALAR_QUANTIZATION << 13); /* qt */
- stream_write_uint16(s, properties);
+ stream_write_UINT16(s, properties);
/* properties in tilesets: note that this has different format from the one in TS_RFX_CONTEXT */
properties = 1; /* lt */
{
stream_check_size(s, 14);
- stream_write_uint16(s, WBT_FRAME_BEGIN); /* CodecChannelT.blockType */
+ stream_write_UINT16(s, WBT_FRAME_BEGIN); /* CodecChannelT.blockType */
stream_write_uint32(s, 14); /* CodecChannelT.blockLen */
- stream_write_uint8(s, 1); /* CodecChannelT.codecId */
- stream_write_uint8(s, 0); /* CodecChannelT.channelId */
+ stream_write_BYTE(s, 1); /* CodecChannelT.codecId */
+ stream_write_BYTE(s, 0); /* CodecChannelT.channelId */
stream_write_uint32(s, context->frame_idx); /* frameIdx */
- stream_write_uint16(s, 1); /* numRegions */
+ stream_write_UINT16(s, 1); /* numRegions */
context->frame_idx++;
}
size = 15 + num_rects * 8;
stream_check_size(s, size);
- stream_write_uint16(s, WBT_REGION); /* CodecChannelT.blockType */
+ stream_write_UINT16(s, WBT_REGION); /* CodecChannelT.blockType */
stream_write_uint32(s, size); /* set CodecChannelT.blockLen later */
- stream_write_uint8(s, 1); /* CodecChannelT.codecId */
- stream_write_uint8(s, 0); /* CodecChannelT.channelId */
- stream_write_uint8(s, 1); /* regionFlags */
- stream_write_uint16(s, num_rects); /* numRects */
+ stream_write_BYTE(s, 1); /* CodecChannelT.codecId */
+ stream_write_BYTE(s, 0); /* CodecChannelT.channelId */
+ stream_write_BYTE(s, 1); /* regionFlags */
+ stream_write_UINT16(s, num_rects); /* numRects */
for (i = 0; i < num_rects; i++)
{
- stream_write_uint16(s, rects[i].x);
- stream_write_uint16(s, rects[i].y);
- stream_write_uint16(s, rects[i].width);
- stream_write_uint16(s, rects[i].height);
+ stream_write_UINT16(s, rects[i].x);
+ stream_write_UINT16(s, rects[i].y);
+ stream_write_UINT16(s, rects[i].width);
+ stream_write_UINT16(s, rects[i].height);
}
- stream_write_uint16(s, CBT_REGION); /* regionType */
- stream_write_uint16(s, 1); /* numTilesets */
+ stream_write_UINT16(s, CBT_REGION); /* regionType */
+ stream_write_UINT16(s, 1); /* numTilesets */
}
static void rfx_compose_message_tile(RFX_CONTEXT* context, STREAM* s,
- uint8* tile_data, int tile_width, int tile_height, int rowstride,
+ BYTE* tile_data, int tile_width, int tile_height, int rowstride,
const uint32* quantVals, int quantIdxY, int quantIdxCb, int quantIdxCr,
int xIdx, int yIdx)
{
stream_check_size(s, 19);
start_pos = stream_get_pos(s);
- stream_write_uint16(s, CBT_TILE); /* BlockT.blockType */
+ stream_write_UINT16(s, CBT_TILE); /* BlockT.blockType */
stream_seek_uint32(s); /* set BlockT.blockLen later */
- stream_write_uint8(s, quantIdxY);
- stream_write_uint8(s, quantIdxCb);
- stream_write_uint8(s, quantIdxCr);
- stream_write_uint16(s, xIdx);
- stream_write_uint16(s, yIdx);
+ stream_write_BYTE(s, quantIdxY);
+ stream_write_BYTE(s, quantIdxCb);
+ stream_write_BYTE(s, quantIdxCr);
+ stream_write_UINT16(s, xIdx);
+ stream_write_UINT16(s, yIdx);
stream_seek(s, 6); /* YLen, CbLen, CrLen */
stream_set_pos(s, start_pos + 2);
stream_write_uint32(s, 19 + YLen + CbLen + CrLen); /* BlockT.blockLen */
stream_set_pos(s, start_pos + 13);
- stream_write_uint16(s, YLen);
- stream_write_uint16(s, CbLen);
- stream_write_uint16(s, CrLen);
+ stream_write_UINT16(s, YLen);
+ stream_write_UINT16(s, CbLen);
+ stream_write_UINT16(s, CrLen);
stream_set_pos(s, end_pos);
}
static void rfx_compose_message_tileset(RFX_CONTEXT* context, STREAM* s,
- uint8* image_data, int width, int height, int rowstride)
+ BYTE* image_data, int width, int height, int rowstride)
{
int size;
int start_pos, end_pos;
stream_check_size(s, size);
start_pos = stream_get_pos(s);
- stream_write_uint16(s, WBT_EXTENSION); /* CodecChannelT.blockType */
+ stream_write_UINT16(s, WBT_EXTENSION); /* CodecChannelT.blockType */
stream_seek_uint32(s); /* set CodecChannelT.blockLen later */
- stream_write_uint8(s, 1); /* CodecChannelT.codecId */
- stream_write_uint8(s, 0); /* CodecChannelT.channelId */
- stream_write_uint16(s, CBT_TILESET); /* subtype */
- stream_write_uint16(s, 0); /* idx */
- stream_write_uint16(s, context->properties); /* properties */
- stream_write_uint8(s, numQuants); /* numQuants */
- stream_write_uint8(s, 0x40); /* tileSize */
- stream_write_uint16(s, numTiles); /* numTiles */
+ stream_write_BYTE(s, 1); /* CodecChannelT.codecId */
+ stream_write_BYTE(s, 0); /* CodecChannelT.channelId */
+ stream_write_UINT16(s, CBT_TILESET); /* subtype */
+ stream_write_UINT16(s, 0); /* idx */
+ stream_write_UINT16(s, context->properties); /* properties */
+ stream_write_BYTE(s, numQuants); /* numQuants */
+ stream_write_BYTE(s, 0x40); /* tileSize */
+ stream_write_UINT16(s, numTiles); /* numTiles */
stream_seek_uint32(s); /* set tilesDataSize later */
quantValsPtr = quantVals;
for (i = 0; i < numQuants * 5; i++)
{
- stream_write_uint8(s, quantValsPtr[0] + (quantValsPtr[1] << 4));
+ stream_write_BYTE(s, quantValsPtr[0] + (quantValsPtr[1] << 4));
quantValsPtr += 2;
}
{
stream_check_size(s, 8);
- stream_write_uint16(s, WBT_FRAME_END); /* CodecChannelT.blockType */
+ stream_write_UINT16(s, WBT_FRAME_END); /* CodecChannelT.blockType */
stream_write_uint32(s, 8); /* CodecChannelT.blockLen */
- stream_write_uint8(s, 1); /* CodecChannelT.codecId */
- stream_write_uint8(s, 0); /* CodecChannelT.channelId */
+ stream_write_BYTE(s, 1); /* CodecChannelT.codecId */
+ stream_write_BYTE(s, 0); /* CodecChannelT.channelId */
}
static void rfx_compose_message_data(RFX_CONTEXT* context, STREAM* s,
- const RFX_RECT* rects, int num_rects, uint8* image_data, int width, int height, int rowstride)
+ const RFX_RECT* rects, int num_rects, BYTE* image_data, int width, int height, int rowstride)
{
rfx_compose_message_frame_begin(context, s);
rfx_compose_message_region(context, s, rects, num_rects);
}
FREERDP_API void rfx_compose_message(RFX_CONTEXT* context, STREAM* s,
- const RFX_RECT* rects, int num_rects, uint8* image_data, int width, int height, int rowstride)
+ const RFX_RECT* rects, int num_rects, BYTE* image_data, int width, int height, int rowstride)
{
/* Only the first frame should send the RemoteFX header */
if (context->frame_idx == 0 && !context->header_processed)
struct _RFX_BITSTREAM
{
- uint8* buffer;
+ BYTE* buffer;
int nbytes;
int byte_pos;
int bits_left;
typedef struct _RFX_BITSTREAM RFX_BITSTREAM;
#define rfx_bitstream_attach(bs, _buffer, _nbytes) do { \
- bs->buffer = (uint8*) (_buffer); \
+ bs->buffer = (BYTE*) (_buffer); \
bs->nbytes = (_nbytes); \
bs->byte_pos = 0; \
bs->bits_left = 8; } while (0)
#define rfx_bitstream_get_bits(bs, _nbits, _r) do { \
int nbits = _nbits; \
int b; \
- uint16 n = 0; \
+ UINT16 n = 0; \
while (bs->byte_pos < bs->nbytes && nbits > 0) \
{ \
b = nbits; \
_r = n; } while (0)
#define rfx_bitstream_put_bits(bs, _bits, _nbits) do { \
- uint16 bits = (_bits); \
+ UINT16 bits = (_bits); \
int nbits = (_nbits); \
int b; \
while (bs->byte_pos < bs->nbytes && nbits > 0) \
#include "rfx_decode.h"
-static void rfx_decode_format_rgb(sint16* r_buf, sint16* g_buf, sint16* b_buf,
- RDP_PIXEL_FORMAT pixel_format, uint8* dst_buf)
+static void rfx_decode_format_rgb(INT16* r_buf, INT16* g_buf, INT16* b_buf,
+ RDP_PIXEL_FORMAT pixel_format, BYTE* dst_buf)
{
- sint16* r = r_buf;
- sint16* g = g_buf;
- sint16* b = b_buf;
- uint8* dst = dst_buf;
+ INT16* r = r_buf;
+ INT16* g = g_buf;
+ INT16* b = b_buf;
+ BYTE* dst = dst_buf;
int i;
switch (pixel_format)
case RDP_PIXEL_FORMAT_B8G8R8A8:
for (i = 0; i < 4096; i++)
{
- *dst++ = (uint8) (*b++);
- *dst++ = (uint8) (*g++);
- *dst++ = (uint8) (*r++);
+ *dst++ = (BYTE) (*b++);
+ *dst++ = (BYTE) (*g++);
+ *dst++ = (BYTE) (*r++);
*dst++ = 0xFF;
}
break;
case RDP_PIXEL_FORMAT_R8G8B8A8:
for (i = 0; i < 4096; i++)
{
- *dst++ = (uint8) (*r++);
- *dst++ = (uint8) (*g++);
- *dst++ = (uint8) (*b++);
+ *dst++ = (BYTE) (*r++);
+ *dst++ = (BYTE) (*g++);
+ *dst++ = (BYTE) (*b++);
*dst++ = 0xFF;
}
break;
case RDP_PIXEL_FORMAT_B8G8R8:
for (i = 0; i < 4096; i++)
{
- *dst++ = (uint8) (*b++);
- *dst++ = (uint8) (*g++);
- *dst++ = (uint8) (*r++);
+ *dst++ = (BYTE) (*b++);
+ *dst++ = (BYTE) (*g++);
+ *dst++ = (BYTE) (*r++);
}
break;
case RDP_PIXEL_FORMAT_R8G8B8:
for (i = 0; i < 4096; i++)
{
- *dst++ = (uint8) (*r++);
- *dst++ = (uint8) (*g++);
- *dst++ = (uint8) (*b++);
+ *dst++ = (BYTE) (*r++);
+ *dst++ = (BYTE) (*g++);
+ *dst++ = (BYTE) (*b++);
}
break;
default:
#define MINMAX(_v,_l,_h) ((_v) < (_l) ? (_l) : ((_v) > (_h) ? (_h) : (_v)))
-void rfx_decode_ycbcr_to_rgb(sint16* y_r_buf, sint16* cb_g_buf, sint16* cr_b_buf)
+void rfx_decode_ycbcr_to_rgb(INT16* y_r_buf, INT16* cb_g_buf, INT16* cr_b_buf)
{
/* sint32 is used intentionally because we calculate with shifted factors! */
sint32 y, cb, cr;
* 1 sign bit + 10 integer bits + 5 fractional bits
*
* However only 7 integer bits will be actually used since the value range is [-128.0, 127.0].
- * In other words, the decoded coeffectients is scaled by << 5 when intepreted as sint16.
+ * In other words, the decoded coeffectients is scaled by << 5 when intepreted as INT16.
* It was scaled in the quantization phase, so we must scale it back here.
*/
for (i = 0; i < 4096; i++)
}
static void rfx_decode_component(RFX_CONTEXT* context, const uint32* quantization_values,
- const uint8* data, int size, sint16* buffer)
+ const BYTE* data, int size, INT16* buffer)
{
PROFILER_ENTER(context->priv->prof_rfx_decode_component);
void rfx_decode_rgb(RFX_CONTEXT* context, STREAM* data_in,
int y_size, const uint32 * y_quants,
int cb_size, const uint32 * cb_quants,
- int cr_size, const uint32 * cr_quants, uint8* rgb_buffer)
+ int cr_size, const uint32 * cr_quants, BYTE* rgb_buffer)
{
PROFILER_ENTER(context->priv->prof_rfx_decode_rgb);
#include <freerdp/codec/rfx.h>
-void rfx_decode_ycbcr_to_rgb(sint16* y_r_buf, sint16* cb_g_buf, sint16* cr_b_buf);
+void rfx_decode_ycbcr_to_rgb(INT16* y_r_buf, INT16* cb_g_buf, INT16* cr_b_buf);
void rfx_decode_rgb(RFX_CONTEXT* context, STREAM* data_in,
int y_size, const uint32 * y_quants,
int cb_size, const uint32 * cb_quants,
- int cr_size, const uint32 * cr_quants, uint8* rgb_buffer);
+ int cr_size, const uint32 * cr_quants, BYTE* rgb_buffer);
#endif /* __RFX_DECODE_H */
#include "rfx_differential.h"
-void rfx_differential_decode(sint16* buffer, int buffer_size)
+void rfx_differential_decode(INT16* buffer, int buffer_size)
{
- sint16* src;
- sint16* dst;
+ INT16* src;
+ INT16* dst;
for (src = buffer, dst = buffer + 1; buffer_size > 1; src++, dst++, buffer_size--)
{
}
}
-void rfx_differential_encode(sint16* buffer, int buffer_size)
+void rfx_differential_encode(INT16* buffer, int buffer_size)
{
- sint16 n1, n2;
- sint16* dst;
+ INT16 n1, n2;
+ INT16* dst;
for (n1 = *buffer, dst = buffer + 1; buffer_size > 1; dst++, buffer_size--)
{
#include <freerdp/codec/rfx.h>
-void rfx_differential_decode(sint16* buffer, int buffer_size);
-void rfx_differential_encode(sint16* buffer, int buffer_size);
+void rfx_differential_decode(INT16* buffer, int buffer_size);
+void rfx_differential_encode(INT16* buffer, int buffer_size);
#endif /* __RFX_DIFFERENTIAL_H */
#include "rfx_dwt.h"
-static void rfx_dwt_2d_decode_block(sint16* buffer, sint16* idwt, int subband_width)
+static void rfx_dwt_2d_decode_block(INT16* buffer, INT16* idwt, int subband_width)
{
- sint16 *dst, *l, *h;
- sint16 *l_dst, *h_dst;
- sint16 *hl, *lh, *hh, *ll;
+ INT16 *dst, *l, *h;
+ INT16 *l_dst, *h_dst;
+ INT16 *hl, *lh, *hh, *ll;
int total_width;
int x, y;
int n;
}
}
-void rfx_dwt_2d_decode(sint16* buffer, sint16* dwt_buffer)
+void rfx_dwt_2d_decode(INT16* buffer, INT16* dwt_buffer)
{
rfx_dwt_2d_decode_block(buffer + 3840, dwt_buffer, 8);
rfx_dwt_2d_decode_block(buffer + 3072, dwt_buffer, 16);
rfx_dwt_2d_decode_block(buffer, dwt_buffer, 32);
}
-static void rfx_dwt_2d_encode_block(sint16* buffer, sint16* dwt, int subband_width)
+static void rfx_dwt_2d_encode_block(INT16* buffer, INT16* dwt, int subband_width)
{
- sint16 *src, *l, *h;
- sint16 *l_src, *h_src;
- sint16 *hl, *lh, *hh, *ll;
+ INT16 *src, *l, *h;
+ INT16 *l_src, *h_src;
+ INT16 *hl, *lh, *hh, *ll;
int total_width;
int x, y;
int n;
}
}
-void rfx_dwt_2d_encode(sint16* buffer, sint16* dwt_buffer)
+void rfx_dwt_2d_encode(INT16* buffer, INT16* dwt_buffer)
{
rfx_dwt_2d_encode_block(buffer, dwt_buffer, 32);
rfx_dwt_2d_encode_block(buffer + 3072, dwt_buffer, 16);
#include <freerdp/codec/rfx.h>
-void rfx_dwt_2d_decode(sint16* buffer, sint16* dwt_buffer);
-void rfx_dwt_2d_encode(sint16* buffer, sint16* dwt_buffer);
+void rfx_dwt_2d_decode(INT16* buffer, INT16* dwt_buffer);
+void rfx_dwt_2d_encode(INT16* buffer, INT16* dwt_buffer);
#endif /* __RFX_DWT_H */
#define MINMAX(_v,_l,_h) ((_v) < (_l) ? (_l) : ((_v) > (_h) ? (_h) : (_v)))
-static void rfx_encode_format_rgb(const uint8* rgb_data, int width, int height, int rowstride,
- RDP_PIXEL_FORMAT pixel_format, const uint8* palette, sint16* r_buf, sint16* g_buf, sint16* b_buf)
+static void rfx_encode_format_rgb(const BYTE* rgb_data, int width, int height, int rowstride,
+ RDP_PIXEL_FORMAT pixel_format, const BYTE* palette, INT16* r_buf, INT16* g_buf, INT16* b_buf)
{
int x, y;
int x_exceed;
int y_exceed;
- const uint8* src;
- sint16 r, g, b;
- sint16 *r_last, *g_last, *b_last;
+ const BYTE* src;
+ INT16 r, g, b;
+ INT16 *r_last, *g_last, *b_last;
x_exceed = 64 - width;
y_exceed = 64 - height;
case RDP_PIXEL_FORMAT_B8G8R8A8:
for (x = 0; x < width; x++)
{
- *b_buf++ = (sint16) (*src++);
- *g_buf++ = (sint16) (*src++);
- *r_buf++ = (sint16) (*src++);
+ *b_buf++ = (INT16) (*src++);
+ *g_buf++ = (INT16) (*src++);
+ *r_buf++ = (INT16) (*src++);
src++;
}
break;
case RDP_PIXEL_FORMAT_R8G8B8A8:
for (x = 0; x < width; x++)
{
- *r_buf++ = (sint16) (*src++);
- *g_buf++ = (sint16) (*src++);
- *b_buf++ = (sint16) (*src++);
+ *r_buf++ = (INT16) (*src++);
+ *g_buf++ = (INT16) (*src++);
+ *b_buf++ = (INT16) (*src++);
src++;
}
break;
case RDP_PIXEL_FORMAT_B8G8R8:
for (x = 0; x < width; x++)
{
- *b_buf++ = (sint16) (*src++);
- *g_buf++ = (sint16) (*src++);
- *r_buf++ = (sint16) (*src++);
+ *b_buf++ = (INT16) (*src++);
+ *g_buf++ = (INT16) (*src++);
+ *r_buf++ = (INT16) (*src++);
}
break;
case RDP_PIXEL_FORMAT_R8G8B8:
for (x = 0; x < width; x++)
{
- *r_buf++ = (sint16) (*src++);
- *g_buf++ = (sint16) (*src++);
- *b_buf++ = (sint16) (*src++);
+ *r_buf++ = (INT16) (*src++);
+ *g_buf++ = (INT16) (*src++);
+ *b_buf++ = (INT16) (*src++);
}
break;
case RDP_PIXEL_FORMAT_B5G6R5_LE:
for (x = 0; x < width; x++)
{
- *b_buf++ = (sint16) (((*(src + 1)) & 0xF8) | ((*(src + 1)) >> 5));
- *g_buf++ = (sint16) ((((*(src + 1)) & 0x07) << 5) | (((*src) & 0xE0) >> 3));
- *r_buf++ = (sint16) ((((*src) & 0x1F) << 3) | (((*src) >> 2) & 0x07));
+ *b_buf++ = (INT16) (((*(src + 1)) & 0xF8) | ((*(src + 1)) >> 5));
+ *g_buf++ = (INT16) ((((*(src + 1)) & 0x07) << 5) | (((*src) & 0xE0) >> 3));
+ *r_buf++ = (INT16) ((((*src) & 0x1F) << 3) | (((*src) >> 2) & 0x07));
src += 2;
}
break;
case RDP_PIXEL_FORMAT_R5G6B5_LE:
for (x = 0; x < width; x++)
{
- *r_buf++ = (sint16) (((*(src + 1)) & 0xF8) | ((*(src + 1)) >> 5));
- *g_buf++ = (sint16) ((((*(src + 1)) & 0x07) << 5) | (((*src) & 0xE0) >> 3));
- *b_buf++ = (sint16) ((((*src) & 0x1F) << 3) | (((*src) >> 2) & 0x07));
+ *r_buf++ = (INT16) (((*(src + 1)) & 0xF8) | ((*(src + 1)) >> 5));
+ *g_buf++ = (INT16) ((((*(src + 1)) & 0x07) << 5) | (((*src) & 0xE0) >> 3));
+ *b_buf++ = (INT16) ((((*src) & 0x1F) << 3) | (((*src) >> 2) & 0x07));
src += 2;
}
break;
for (x = 0; x < width; x++)
{
int shift;
- uint8 idx;
+ BYTE idx;
shift = (7 - (x % 8));
idx = ((*src) >> shift) & 1;
idx |= (((*(src + 2)) >> shift) & 1) << 2;
idx |= (((*(src + 3)) >> shift) & 1) << 3;
idx *= 3;
- *r_buf++ = (sint16) palette[idx];
- *g_buf++ = (sint16) palette[idx + 1];
- *b_buf++ = (sint16) palette[idx + 2];
+ *r_buf++ = (INT16) palette[idx];
+ *g_buf++ = (INT16) palette[idx + 1];
+ *b_buf++ = (INT16) palette[idx + 2];
if (shift == 0)
src += 4;
}
{
int idx = (*src) * 3;
- *r_buf++ = (sint16) palette[idx];
- *g_buf++ = (sint16) palette[idx + 1];
- *b_buf++ = (sint16) palette[idx + 2];
+ *r_buf++ = (INT16) palette[idx];
+ *g_buf++ = (INT16) palette[idx + 1];
+ *b_buf++ = (INT16) palette[idx + 2];
src++;
}
break;
while (y_exceed > 0)
{
- memcpy(r_buf, r_last, 64 * sizeof(sint16));
- memcpy(g_buf, g_last, 64 * sizeof(sint16));
- memcpy(b_buf, b_last, 64 * sizeof(sint16));
+ memcpy(r_buf, r_last, 64 * sizeof(INT16));
+ memcpy(g_buf, g_last, 64 * sizeof(INT16));
+ memcpy(b_buf, b_last, 64 * sizeof(INT16));
r_buf += 64;
g_buf += 64;
b_buf += 64;
}
}
-void rfx_encode_rgb_to_ycbcr(sint16* y_r_buf, sint16* cb_g_buf, sint16* cr_b_buf)
+void rfx_encode_rgb_to_ycbcr(INT16* y_r_buf, INT16* cb_g_buf, INT16* cr_b_buf)
{
/* sint32 is used intentionally because we calculate with shifted factors! */
int i;
* 1 sign bit + 10 integer bits + 5 fractional bits
*
* However only 7 integer bits will be actually used since the value range is [-128.0, 127.0].
- * In other words, the encoded coefficients is scaled by << 5 when interpreted as sint16.
+ * In other words, the encoded coefficients is scaled by << 5 when interpreted as INT16.
* It will be scaled down to original during the quantization phase.
*/
for (i = 0; i < 4096; i++)
}
static void rfx_encode_component(RFX_CONTEXT* context, const uint32* quantization_values,
- sint16* data, uint8* buffer, int buffer_size, int* size)
+ INT16* data, BYTE* buffer, int buffer_size, int* size)
{
PROFILER_ENTER(context->priv->prof_rfx_encode_component);
PROFILER_EXIT(context->priv->prof_rfx_encode_component);
}
-void rfx_encode_rgb(RFX_CONTEXT* context, const uint8* rgb_data, int width, int height, int rowstride,
+void rfx_encode_rgb(RFX_CONTEXT* context, const BYTE* rgb_data, int width, int height, int rowstride,
const uint32* y_quants, const uint32* cb_quants, const uint32* cr_quants,
STREAM* data_out, int* y_size, int* cb_size, int* cr_size)
{
- sint16* y_r_buffer = context->priv->y_r_buffer;
- sint16* cb_g_buffer = context->priv->cb_g_buffer;
- sint16* cr_b_buffer = context->priv->cr_b_buffer;
+ INT16* y_r_buffer = context->priv->y_r_buffer;
+ INT16* cb_g_buffer = context->priv->cb_g_buffer;
+ INT16* cr_b_buffer = context->priv->cr_b_buffer;
PROFILER_ENTER(context->priv->prof_rfx_encode_rgb);
#include <freerdp/codec/rfx.h>
-void rfx_encode_rgb_to_ycbcr(sint16* y_r_buf, sint16* cb_g_buf, sint16* cr_b_buf);
+void rfx_encode_rgb_to_ycbcr(INT16* y_r_buf, INT16* cb_g_buf, INT16* cr_b_buf);
-void rfx_encode_rgb(RFX_CONTEXT* context, const uint8* rgb_data, int width, int height, int rowstride,
+void rfx_encode_rgb(RFX_CONTEXT* context, const BYTE* rgb_data, int width, int height, int rowstride,
const uint32* y_quants, const uint32* cb_quants, const uint32* cr_quants,
STREAM* data_out, int* y_size, int* cb_size, int* cr_size);
#endif
-void rfx_decode_YCbCr_to_RGB_NEON(sint16 * y_r_buffer, sint16 * cb_g_buffer, sint16 * cr_b_buffer)
+void rfx_decode_YCbCr_to_RGB_NEON(INT16 * y_r_buffer, INT16 * cb_g_buffer, INT16 * cr_b_buffer)
{
int16x8_t zero = vdupq_n_s16(0);
int16x8_t max = vdupq_n_s16(255);
int i;
for (i = 0; i < 4096 / 8; i++)
{
- int16x8_t y = vld1q_s16((sint16*)&y_r_buf[i]);
+ int16x8_t y = vld1q_s16((INT16*)&y_r_buf[i]);
y = vaddq_s16(y, y_add);
- int16x8_t cr = vld1q_s16((sint16*)&cr_b_buf[i]);
+ int16x8_t cr = vld1q_s16((INT16*)&cr_b_buf[i]);
// r = between((y + cr + (cr >> 2) + (cr >> 3) + (cr >> 5)), 0, 255);
int16x8_t r = vaddq_s16(y, cr);
r = vaddq_s16(r, vshrq_n_s16(cr, 3));
r = vaddq_s16(r, vshrq_n_s16(cr, 5));
r = vminq_s16(vmaxq_s16(r, zero), max);
- vst1q_s16((sint16*)&y_r_buf[i], r);
+ vst1q_s16((INT16*)&y_r_buf[i], r);
// cb = cb_g_buf[i];
- int16x8_t cb = vld1q_s16((sint16*)&cb_g_buf[i]);
+ int16x8_t cb = vld1q_s16((INT16*)&cb_g_buf[i]);
// g = between(y - (cb >> 2) - (cb >> 4) - (cb >> 5) - (cr >> 1) - (cr >> 3) - (cr >> 4) - (cr >> 5), 0, 255);
int16x8_t g = vsubq_s16(y, vshrq_n_s16(cb, 2));
g = vsubq_s16(g, vshrq_n_s16(cr, 4));
g = vsubq_s16(g, vshrq_n_s16(cr, 5));
g = vminq_s16(vmaxq_s16(g, zero), max);
- vst1q_s16((sint16*)&cb_g_buf[i], g);
+ vst1q_s16((INT16*)&cb_g_buf[i], g);
// b = between((y + cb + (cb >> 1) + (cb >> 2) + (cb >> 6)), 0, 255);
int16x8_t b = vaddq_s16(y, cb);
b = vaddq_s16(b, vshrq_n_s16(cb, 2));
b = vaddq_s16(b, vshrq_n_s16(cb, 6));
b = vminq_s16(vmaxq_s16(b, zero), max);
- vst1q_s16((sint16*)&cr_b_buf[i], b);
+ vst1q_s16((INT16*)&cr_b_buf[i], b);
}
}
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-rfx_quantization_decode_block_NEON(sint16 * buffer, const int buffer_size, const uint32 factor)
+rfx_quantization_decode_block_NEON(INT16 * buffer, const int buffer_size, const uint32 factor)
{
if (factor <= 6)
return;
do
{
- int16x8_t val = vld1q_s16((sint16*)buf);
+ int16x8_t val = vld1q_s16((INT16*)buf);
val = vshlq_s16(val, quantFactors);
- vst1q_s16((sint16*)buf, val);
+ vst1q_s16((INT16*)buf, val);
buf++;
}
while(buf < buf_end);
}
void
-rfx_quantization_decode_NEON(sint16 * buffer, const uint32 * quantization_values)
+rfx_quantization_decode_NEON(INT16 * buffer, const uint32 * quantization_values)
{
rfx_quantization_decode_block_NEON(buffer, 1024, quantization_values[8]); /* HL1 */
rfx_quantization_decode_block_NEON(buffer + 1024, 1024, quantization_values[7]); /* LH1 */
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-rfx_dwt_2d_decode_block_horiz_NEON(sint16 * l, sint16 * h, sint16 * dst, int subband_width)
+rfx_dwt_2d_decode_block_horiz_NEON(INT16 * l, INT16 * h, INT16 * dst, int subband_width)
{
int y, n;
- sint16 * l_ptr = l;
- sint16 * h_ptr = h;
- sint16 * dst_ptr = dst;
+ INT16 * l_ptr = l;
+ INT16 * h_ptr = h;
+ INT16 * dst_ptr = dst;
for (y = 0; y < subband_width; y++)
{
}
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-rfx_dwt_2d_decode_block_vert_NEON(sint16 * l, sint16 * h, sint16 * dst, int subband_width)
+rfx_dwt_2d_decode_block_vert_NEON(INT16 * l, INT16 * h, INT16 * dst, int subband_width)
{
int x, n;
- sint16 * l_ptr = l;
- sint16 * h_ptr = h;
- sint16 * dst_ptr = dst;
+ INT16 * l_ptr = l;
+ INT16 * h_ptr = h;
+ INT16 * dst_ptr = dst;
int total_width = subband_width + subband_width;
}
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-rfx_dwt_2d_decode_block_NEON(sint16 * buffer, sint16 * idwt, int subband_width)
+rfx_dwt_2d_decode_block_NEON(INT16 * buffer, INT16 * idwt, int subband_width)
{
- sint16 * hl, * lh, * hh, * ll;
- sint16 * l_dst, * h_dst;
+ INT16 * hl, * lh, * hh, * ll;
+ INT16 * l_dst, * h_dst;
/* Inverse DWT in horizontal direction, results in 2 sub-bands in L, H order in tmp buffer idwt. */
/* The 4 sub-bands are stored in HL(0), LH(1), HH(2), LL(3) order. */
}
void
-rfx_dwt_2d_decode_NEON(sint16 * buffer, sint16 * dwt_buffer)
+rfx_dwt_2d_decode_NEON(INT16 * buffer, INT16 * dwt_buffer)
{
rfx_dwt_2d_decode_block_NEON(buffer + 3840, dwt_buffer, 8);
rfx_dwt_2d_decode_block_NEON(buffer + 3072, dwt_buffer, 16);
if (pool->count < 1)
{
tile = xnew(RFX_TILE);
- tile->data = (uint8*) malloc(4096 * 4); /* 64x64 * 4 */
+ tile->data = (BYTE*) malloc(4096 * 4); /* 64x64 * 4 */
}
else
{
#include "rfx_quantization.h"
-static void rfx_quantization_decode_block(sint16* buffer, int buffer_size, uint32 factor)
+static void rfx_quantization_decode_block(INT16* buffer, int buffer_size, uint32 factor)
{
- sint16* dst;
+ INT16* dst;
if (factor == 0)
return;
}
}
-void rfx_quantization_decode(sint16* buffer, const uint32* quantization_values)
+void rfx_quantization_decode(INT16* buffer, const uint32* quantization_values)
{
/* Scale the values so that they are represented as 11.5 fixed-point number */
rfx_quantization_decode_block(buffer, 4096, 5);
rfx_quantization_decode_block(buffer + 4032, 64, quantization_values[0] - 6); /* LL3 */
}
-static void rfx_quantization_encode_block(sint16* buffer, int buffer_size, uint32 factor)
+static void rfx_quantization_encode_block(INT16* buffer, int buffer_size, uint32 factor)
{
- sint16* dst;
- sint16 half;
+ INT16* dst;
+ INT16 half;
if (factor == 0)
return;
}
}
-void rfx_quantization_encode(sint16* buffer, const uint32* quantization_values)
+void rfx_quantization_encode(INT16* buffer, const uint32* quantization_values)
{
rfx_quantization_encode_block(buffer, 1024, quantization_values[8] - 6); /* HL1 */
rfx_quantization_encode_block(buffer + 1024, 1024, quantization_values[7] - 6); /* LH1 */
#include <freerdp/codec/rfx.h>
-void rfx_quantization_decode(sint16* buffer, const uint32* quantization_values);
-void rfx_quantization_encode(sint16* buffer, const uint32* quantization_values);
+void rfx_quantization_decode(INT16* buffer, const uint32* quantization_values);
+void rfx_quantization_encode(INT16* buffer, const uint32* quantization_values);
#endif /* __RFX_QUANTIZATION_H */
nZeroesWritten = buffer_size; \
if (nZeroesWritten > 0) \
{ \
- memset(dst, 0, nZeroesWritten * sizeof(sint16)); \
+ memset(dst, 0, nZeroesWritten * sizeof(INT16)); \
dst += nZeroesWritten; \
} \
buffer_size -= (nZeroes); \
}
/* Converts from (2 * magnitude - sign) to integer */
-#define GetIntFrom2MagSign(twoMs) (((twoMs) & 1) ? -1 * (sint16)(((twoMs) + 1) >> 1) : (sint16)((twoMs) >> 1))
+#define GetIntFrom2MagSign(twoMs) (((twoMs) & 1) ? -1 * (INT16)(((twoMs) + 1) >> 1) : (INT16)((twoMs) >> 1))
/*
* Update the passed parameter and clamp it to the range [0, KPMAX]
UpdateParam(*krp, vk, *kr); /* at 1, no change! */ \
}
-int rfx_rlgr_decode(RLGR_MODE mode, const uint8* data, int data_size, sint16* buffer, int buffer_size)
+int rfx_rlgr_decode(RLGR_MODE mode, const BYTE* data, int data_size, INT16* buffer, int buffer_size)
{
int k;
int kp;
int kr;
int krp;
- uint16 r;
- sint16* dst;
+ UINT16 r;
+ INT16* dst;
RFX_BITSTREAM* bs;
int vk;
- uint16 mag16;
+ UINT16 mag16;
bs = xnew(RFX_BITSTREAM);
rfx_bitstream_attach(bs, data, data_size);
/* Emit a bit (0 or 1), count number of times, to the output bitstream */
#define OutputBit(count, bit) \
{ \
- uint16 _b = (bit ? 0xFFFF : 0); \
+ UINT16 _b = (bit ? 0xFFFF : 0); \
int _c = (count); \
for (; _c > 0; _c -= 16) \
rfx_bitstream_put_bits(bs, _b, (_c > 16 ? 16 : _c)); \
}
}
-int rfx_rlgr_encode(RLGR_MODE mode, const sint16* data, int data_size, uint8* buffer, int buffer_size)
+int rfx_rlgr_encode(RLGR_MODE mode, const INT16* data, int data_size, BYTE* buffer, int buffer_size)
{
int k;
int kp;
#include <freerdp/codec/rfx.h>
-int rfx_rlgr_decode(RLGR_MODE mode, const uint8* data, int data_size, sint16* buffer, int buffer_size);
-int rfx_rlgr_encode(RLGR_MODE mode, const sint16* data, int data_size, uint8* buffer, int buffer_size);
+int rfx_rlgr_decode(RLGR_MODE mode, const BYTE* data, int data_size, INT16* buffer, int buffer_size);
+int rfx_rlgr_encode(RLGR_MODE mode, const INT16* data, int data_size, BYTE* buffer, int buffer_size);
#endif /* __RFX_RLGR_H */
}
}
-static void rfx_decode_ycbcr_to_rgb_sse2(sint16* y_r_buffer, sint16* cb_g_buffer, sint16* cr_b_buffer)
+static void rfx_decode_ycbcr_to_rgb_sse2(INT16* y_r_buffer, INT16* cb_g_buffer, INT16* cr_b_buffer)
{
__m128i zero = _mm_setzero_si128();
__m128i max = _mm_set1_epi16(255);
__m128i b_cb = _mm_set1_epi16(28999); // 1.770 << 14
__m128i c4096 = _mm_set1_epi16(4096);
- for (i = 0; i < (4096 * sizeof(sint16) / sizeof(__m128i)); i += (CACHE_LINE_BYTES / sizeof(__m128i)))
+ for (i = 0; i < (4096 * sizeof(INT16) / sizeof(__m128i)); i += (CACHE_LINE_BYTES / sizeof(__m128i)))
{
_mm_prefetch((char*)(&y_r_buf[i]), _MM_HINT_NTA);
_mm_prefetch((char*)(&cb_g_buf[i]), _MM_HINT_NTA);
_mm_prefetch((char*)(&cr_b_buf[i]), _MM_HINT_NTA);
}
- for (i = 0; i < (4096 * sizeof(sint16) / sizeof(__m128i)); i++)
+ for (i = 0; i < (4096 * sizeof(INT16) / sizeof(__m128i)); i++)
{
/*
In order to use SSE2 signed 16-bit integer multiplication we need to convert
}
/* The encodec YCbCr coeffectients are represented as 11.5 fixed-point numbers. See rfx_encode.c */
-static void rfx_encode_rgb_to_ycbcr_sse2(sint16* y_r_buffer, sint16* cb_g_buffer, sint16* cr_b_buffer)
+static void rfx_encode_rgb_to_ycbcr_sse2(INT16* y_r_buffer, INT16* cb_g_buffer, INT16* cr_b_buffer)
{
__m128i min = _mm_set1_epi16(-128 << 5);
__m128i max = _mm_set1_epi16(127 << 5);
int i;
- for (i = 0; i < (4096 * sizeof(sint16) / sizeof(__m128i)); i += (CACHE_LINE_BYTES / sizeof(__m128i)))
+ for (i = 0; i < (4096 * sizeof(INT16) / sizeof(__m128i)); i += (CACHE_LINE_BYTES / sizeof(__m128i)))
{
_mm_prefetch((char*)(&y_r_buf[i]), _MM_HINT_NTA);
_mm_prefetch((char*)(&cb_g_buf[i]), _MM_HINT_NTA);
_mm_prefetch((char*)(&cr_b_buf[i]), _MM_HINT_NTA);
}
- for (i = 0; i < (4096 * sizeof(sint16) / sizeof(__m128i)); i++)
+ for (i = 0; i < (4096 * sizeof(INT16) / sizeof(__m128i)); i++)
{
/*
In order to use SSE2 signed 16-bit integer multiplication we need to convert
}
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-rfx_quantization_decode_block_sse2(sint16* buffer, const int buffer_size, const uint32 factor)
+rfx_quantization_decode_block_sse2(INT16* buffer, const int buffer_size, const uint32 factor)
{
__m128i a;
__m128i * ptr = (__m128i*) buffer;
} while(ptr < buf_end);
}
-static void rfx_quantization_decode_sse2(sint16* buffer, const uint32* quantization_values)
+static void rfx_quantization_decode_sse2(INT16* buffer, const uint32* quantization_values)
{
- _mm_prefetch_buffer((char*) buffer, 4096 * sizeof(sint16));
+ _mm_prefetch_buffer((char*) buffer, 4096 * sizeof(INT16));
rfx_quantization_decode_block_sse2(buffer, 4096, 5);
}
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-rfx_quantization_encode_block_sse2(sint16* buffer, const int buffer_size, const uint32 factor)
+rfx_quantization_encode_block_sse2(INT16* buffer, const int buffer_size, const uint32 factor)
{
__m128i a;
__m128i* ptr = (__m128i*) buffer;
} while(ptr < buf_end);
}
-static void rfx_quantization_encode_sse2(sint16* buffer, const uint32* quantization_values)
+static void rfx_quantization_encode_sse2(INT16* buffer, const uint32* quantization_values)
{
- _mm_prefetch_buffer((char*) buffer, 4096 * sizeof(sint16));
+ _mm_prefetch_buffer((char*) buffer, 4096 * sizeof(INT16));
rfx_quantization_encode_block_sse2(buffer, 1024, quantization_values[8] - 6); /* HL1 */
rfx_quantization_encode_block_sse2(buffer + 1024, 1024, quantization_values[7] - 6); /* LH1 */
}
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-rfx_dwt_2d_decode_block_horiz_sse2(sint16* l, sint16* h, sint16* dst, int subband_width)
+rfx_dwt_2d_decode_block_horiz_sse2(INT16* l, INT16* h, INT16* dst, int subband_width)
{
int y, n;
- sint16* l_ptr = l;
- sint16* h_ptr = h;
- sint16* dst_ptr = dst;
+ INT16* l_ptr = l;
+ INT16* h_ptr = h;
+ INT16* dst_ptr = dst;
int first;
int last;
__m128i l_n;
}
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-rfx_dwt_2d_decode_block_vert_sse2(sint16* l, sint16* h, sint16* dst, int subband_width)
+rfx_dwt_2d_decode_block_vert_sse2(INT16* l, INT16* h, INT16* dst, int subband_width)
{
int x, n;
- sint16* l_ptr = l;
- sint16* h_ptr = h;
- sint16* dst_ptr = dst;
+ INT16* l_ptr = l;
+ INT16* h_ptr = h;
+ INT16* dst_ptr = dst;
__m128i l_n;
__m128i h_n;
__m128i tmp_n;
}
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-rfx_dwt_2d_decode_block_sse2(sint16* buffer, sint16* idwt, int subband_width)
+rfx_dwt_2d_decode_block_sse2(INT16* buffer, INT16* idwt, int subband_width)
{
- sint16 *hl, *lh, *hh, *ll;
- sint16 *l_dst, *h_dst;
+ INT16 *hl, *lh, *hh, *ll;
+ INT16 *l_dst, *h_dst;
- _mm_prefetch_buffer((char*) idwt, subband_width * 4 * sizeof(sint16));
+ _mm_prefetch_buffer((char*) idwt, subband_width * 4 * sizeof(INT16));
/* Inverse DWT in horizontal direction, results in 2 sub-bands in L, H order in tmp buffer idwt. */
/* The 4 sub-bands are stored in HL(0), LH(1), HH(2), LL(3) order. */
rfx_dwt_2d_decode_block_vert_sse2(l_dst, h_dst, buffer, subband_width);
}
-static void rfx_dwt_2d_decode_sse2(sint16* buffer, sint16* dwt_buffer)
+static void rfx_dwt_2d_decode_sse2(INT16* buffer, INT16* dwt_buffer)
{
- _mm_prefetch_buffer((char*) buffer, 4096 * sizeof(sint16));
+ _mm_prefetch_buffer((char*) buffer, 4096 * sizeof(INT16));
rfx_dwt_2d_decode_block_sse2(buffer + 3840, dwt_buffer, 8);
rfx_dwt_2d_decode_block_sse2(buffer + 3072, dwt_buffer, 16);
}
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-rfx_dwt_2d_encode_block_vert_sse2(sint16* src, sint16* l, sint16* h, int subband_width)
+rfx_dwt_2d_encode_block_vert_sse2(INT16* src, INT16* l, INT16* h, int subband_width)
{
int total_width;
int x;
}
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-rfx_dwt_2d_encode_block_horiz_sse2(sint16* src, sint16* l, sint16* h, int subband_width)
+rfx_dwt_2d_encode_block_horiz_sse2(INT16* src, INT16* l, INT16* h, int subband_width)
{
int y;
int n;
}
static __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-rfx_dwt_2d_encode_block_sse2(sint16* buffer, sint16* dwt, int subband_width)
+rfx_dwt_2d_encode_block_sse2(INT16* buffer, INT16* dwt, int subband_width)
{
- sint16 *hl, *lh, *hh, *ll;
- sint16 *l_src, *h_src;
+ INT16 *hl, *lh, *hh, *ll;
+ INT16 *l_src, *h_src;
- _mm_prefetch_buffer((char*) dwt, subband_width * 4 * sizeof(sint16));
+ _mm_prefetch_buffer((char*) dwt, subband_width * 4 * sizeof(INT16));
/* DWT in vertical direction, results in 2 sub-bands in L, H order in tmp buffer dwt. */
rfx_dwt_2d_encode_block_horiz_sse2(h_src, lh, hh, subband_width);
}
-static void rfx_dwt_2d_encode_sse2(sint16* buffer, sint16* dwt_buffer)
+static void rfx_dwt_2d_encode_sse2(INT16* buffer, INT16* dwt_buffer)
{
- _mm_prefetch_buffer((char*) buffer, 4096 * sizeof(sint16));
+ _mm_prefetch_buffer((char*) buffer, 4096 * sizeof(INT16));
rfx_dwt_2d_encode_block_sse2(buffer, dwt_buffer, 32);
rfx_dwt_2d_encode_block_sse2(buffer + 3072, dwt_buffer, 16);
RFX_POOL* pool; /* memory pool */
- sint16 y_r_mem[4096 + 8]; /* 4096 = 64x64 (+ 8x2 = 16 for mem align) */
- sint16 cb_g_mem[4096 + 8]; /* 4096 = 64x64 (+ 8x2 = 16 for mem align) */
- sint16 cr_b_mem[4096 + 8]; /* 4096 = 64x64 (+ 8x2 = 16 for mem align) */
+ INT16 y_r_mem[4096 + 8]; /* 4096 = 64x64 (+ 8x2 = 16 for mem align) */
+ INT16 cb_g_mem[4096 + 8]; /* 4096 = 64x64 (+ 8x2 = 16 for mem align) */
+ INT16 cr_b_mem[4096 + 8]; /* 4096 = 64x64 (+ 8x2 = 16 for mem align) */
- sint16* y_r_buffer;
- sint16* cb_g_buffer;
- sint16* cr_b_buffer;
+ INT16* y_r_buffer;
+ INT16* cb_g_buffer;
+ INT16* cr_b_buffer;
- sint16 dwt_mem[32 * 32 * 2 * 2 + 8]; /* maximum sub-band width is 32 */
+ INT16 dwt_mem[32 * 32 * 2 * 2 + 8]; /* maximum sub-band width is 32 */
- sint16* dwt_buffer;
+ INT16* dwt_buffer;
/* profilers */
PROFILER_DEFINE(prof_rfx_decode_rgb);
void rdp_write_synchronize_pdu(STREAM* s, rdpSettings* settings)
{
- stream_write_uint16(s, SYNCMSGTYPE_SYNC); /* messageType (2 bytes) */
- stream_write_uint16(s, settings->pdu_source); /* targetUser (2 bytes) */
+ stream_write_UINT16(s, SYNCMSGTYPE_SYNC); /* messageType (2 bytes) */
+ stream_write_UINT16(s, settings->pdu_source); /* targetUser (2 bytes) */
}
BOOL rdp_recv_synchronize_pdu(rdpRdp* rdp, STREAM* s)
BOOL rdp_recv_client_synchronize_pdu(rdpRdp* rdp, STREAM* s)
{
- uint16 messageType;
+ UINT16 messageType;
rdp->finalize_sc_pdus |= FINALIZE_SC_SYNCHRONIZE_PDU;
if (stream_get_left(s) < 4)
return FALSE;
- stream_read_uint16(s, messageType); /* messageType (2 bytes) */
+ stream_read_UINT16(s, messageType); /* messageType (2 bytes) */
if (messageType != SYNCMSGTYPE_SYNC)
return FALSE;
/* targetUser (2 bytes) */
- stream_seek_uint16(s);
+ stream_seek_UINT16(s);
return TRUE;
}
return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_SYNCHRONIZE, rdp->mcs->user_id);
}
-BOOL rdp_recv_control_pdu(STREAM* s, uint16* action)
+BOOL rdp_recv_control_pdu(STREAM* s, UINT16* action)
{
if (stream_get_left(s) < 8)
return FALSE;
- stream_read_uint16(s, *action); /* action (2 bytes) */
- stream_seek_uint16(s); /* grantId (2 bytes) */
+ stream_read_UINT16(s, *action); /* action (2 bytes) */
+ stream_seek_UINT16(s); /* grantId (2 bytes) */
stream_seek_uint32(s); /* controlId (4 bytes) */
return TRUE;
}
-void rdp_write_client_control_pdu(STREAM* s, uint16 action)
+void rdp_write_client_control_pdu(STREAM* s, UINT16 action)
{
- stream_write_uint16(s, action); /* action (2 bytes) */
- stream_write_uint16(s, 0); /* grantId (2 bytes) */
+ stream_write_UINT16(s, action); /* action (2 bytes) */
+ stream_write_UINT16(s, 0); /* grantId (2 bytes) */
stream_write_uint32(s, 0); /* controlId (4 bytes) */
}
BOOL rdp_recv_server_control_pdu(rdpRdp* rdp, STREAM* s)
{
- uint16 action;
+ UINT16 action;
rdp_recv_control_pdu(s, &action);
s = rdp_data_pdu_init(rdp);
- stream_write_uint16(s, CTRLACTION_COOPERATE); /* action (2 bytes) */
- stream_write_uint16(s, 0); /* grantId (2 bytes) */
+ stream_write_UINT16(s, CTRLACTION_COOPERATE); /* action (2 bytes) */
+ stream_write_UINT16(s, 0); /* grantId (2 bytes) */
stream_write_uint32(s, 0); /* controlId (4 bytes) */
rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_CONTROL, rdp->mcs->user_id);
s = rdp_data_pdu_init(rdp);
- stream_write_uint16(s, CTRLACTION_GRANTED_CONTROL); /* action (2 bytes) */
- stream_write_uint16(s, rdp->mcs->user_id); /* grantId (2 bytes) */
+ stream_write_UINT16(s, CTRLACTION_GRANTED_CONTROL); /* action (2 bytes) */
+ stream_write_UINT16(s, rdp->mcs->user_id); /* grantId (2 bytes) */
stream_write_uint32(s, 0x03EA); /* controlId (4 bytes) */
rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_CONTROL, rdp->mcs->user_id);
return TRUE;
}
-BOOL rdp_send_client_control_pdu(rdpRdp* rdp, uint16 action)
+BOOL rdp_send_client_control_pdu(rdpRdp* rdp, UINT16 action)
{
STREAM* s;
void rdp_write_client_persistent_key_list_pdu(STREAM* s, rdpSettings* settings)
{
- stream_write_uint16(s, 0); /* numEntriesCache0 (2 bytes) */
- stream_write_uint16(s, 0); /* numEntriesCache1 (2 bytes) */
- stream_write_uint16(s, 0); /* numEntriesCache2 (2 bytes) */
- stream_write_uint16(s, 0); /* numEntriesCache3 (2 bytes) */
- stream_write_uint16(s, 0); /* numEntriesCache4 (2 bytes) */
- stream_write_uint16(s, 0); /* totalEntriesCache0 (2 bytes) */
- stream_write_uint16(s, 0); /* totalEntriesCache1 (2 bytes) */
- stream_write_uint16(s, 0); /* totalEntriesCache2 (2 bytes) */
- stream_write_uint16(s, 0); /* totalEntriesCache3 (2 bytes) */
- stream_write_uint16(s, 0); /* totalEntriesCache4 (2 bytes) */
- stream_write_uint8(s, PERSIST_FIRST_PDU | PERSIST_LAST_PDU); /* bBitMask (1 byte) */
- stream_write_uint8(s, 0); /* pad1 (1 byte) */
- stream_write_uint16(s, 0); /* pad3 (2 bytes) */
+ stream_write_UINT16(s, 0); /* numEntriesCache0 (2 bytes) */
+ stream_write_UINT16(s, 0); /* numEntriesCache1 (2 bytes) */
+ stream_write_UINT16(s, 0); /* numEntriesCache2 (2 bytes) */
+ stream_write_UINT16(s, 0); /* numEntriesCache3 (2 bytes) */
+ stream_write_UINT16(s, 0); /* numEntriesCache4 (2 bytes) */
+ stream_write_UINT16(s, 0); /* totalEntriesCache0 (2 bytes) */
+ stream_write_UINT16(s, 0); /* totalEntriesCache1 (2 bytes) */
+ stream_write_UINT16(s, 0); /* totalEntriesCache2 (2 bytes) */
+ stream_write_UINT16(s, 0); /* totalEntriesCache3 (2 bytes) */
+ stream_write_UINT16(s, 0); /* totalEntriesCache4 (2 bytes) */
+ stream_write_BYTE(s, PERSIST_FIRST_PDU | PERSIST_LAST_PDU); /* bBitMask (1 byte) */
+ stream_write_BYTE(s, 0); /* pad1 (1 byte) */
+ stream_write_UINT16(s, 0); /* pad3 (2 bytes) */
/* entries */
}
return TRUE;
}
-void rdp_write_client_font_list_pdu(STREAM* s, uint16 flags)
+void rdp_write_client_font_list_pdu(STREAM* s, UINT16 flags)
{
- stream_write_uint16(s, 0); /* numberFonts (2 bytes) */
- stream_write_uint16(s, 0); /* totalNumFonts (2 bytes) */
- stream_write_uint16(s, flags); /* listFlags (2 bytes) */
- stream_write_uint16(s, 50); /* entrySize (2 bytes) */
+ stream_write_UINT16(s, 0); /* numberFonts (2 bytes) */
+ stream_write_UINT16(s, 0); /* totalNumFonts (2 bytes) */
+ stream_write_UINT16(s, flags); /* listFlags (2 bytes) */
+ stream_write_UINT16(s, 50); /* entrySize (2 bytes) */
}
-BOOL rdp_send_client_font_list_pdu(rdpRdp* rdp, uint16 flags)
+BOOL rdp_send_client_font_list_pdu(rdpRdp* rdp, UINT16 flags)
{
STREAM* s;
{
rdp->finalize_sc_pdus |= FINALIZE_SC_FONT_MAP_PDU;
- stream_seek_uint16(s); /* numberEntries (2 bytes) */
- stream_seek_uint16(s); /* totalNumEntries (2 bytes) */
- stream_seek_uint16(s); /* mapFlags (2 bytes) */
- stream_seek_uint16(s); /* entrySize (2 bytes) */
+ stream_seek_UINT16(s); /* numberEntries (2 bytes) */
+ stream_seek_UINT16(s); /* totalNumEntries (2 bytes) */
+ stream_seek_UINT16(s); /* mapFlags (2 bytes) */
+ stream_seek_UINT16(s); /* entrySize (2 bytes) */
return TRUE;
}
s = rdp_data_pdu_init(rdp);
- stream_write_uint16(s, 0); /* numberEntries (2 bytes) */
- stream_write_uint16(s, 0); /* totalNumEntries (2 bytes) */
- stream_write_uint16(s, FONTLIST_FIRST | FONTLIST_LAST); /* mapFlags (2 bytes) */
- stream_write_uint16(s, 4); /* entrySize (2 bytes) */
+ stream_write_UINT16(s, 0); /* numberEntries (2 bytes) */
+ stream_write_UINT16(s, 0); /* totalNumEntries (2 bytes) */
+ stream_write_UINT16(s, FONTLIST_FIRST | FONTLIST_LAST); /* mapFlags (2 bytes) */
+ stream_write_UINT16(s, 4); /* entrySize (2 bytes) */
return rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_FONT_MAP, rdp->mcs->user_id);
}
BOOL rdp_recv_deactivate_all(rdpRdp* rdp, STREAM* s)
{
- uint16 lengthSourceDescriptor;
+ UINT16 lengthSourceDescriptor;
/*
* Windows XP can send short DEACTIVATE_ALL PDU that doesn't contain
if (stream_get_left(s) > 0)
{
stream_read_uint32(s, rdp->settings->share_id); /* shareId (4 bytes) */
- stream_read_uint16(s, lengthSourceDescriptor); /* lengthSourceDescriptor (2 bytes) */
+ stream_read_UINT16(s, lengthSourceDescriptor); /* lengthSourceDescriptor (2 bytes) */
stream_seek(s, lengthSourceDescriptor); /* sourceDescriptor (should be 0x00) */
}
s = rdp_pdu_init(rdp);
stream_write_uint32(s, rdp->settings->share_id); /* shareId (4 bytes) */
- stream_write_uint16(s, 1); /* lengthSourceDescriptor (2 bytes) */
- stream_write_uint8(s, 0); /* sourceDescriptor (should be 0x00) */
+ stream_write_UINT16(s, 1); /* lengthSourceDescriptor (2 bytes) */
+ stream_write_BYTE(s, 0); /* sourceDescriptor (should be 0x00) */
return rdp_send_pdu(rdp, s, PDU_TYPE_DEACTIVATE_ALL, rdp->mcs->user_id);
}
BOOL rdp_server_accept_client_control_pdu(rdpRdp* rdp, STREAM* s)
{
- uint16 action;
+ UINT16 action;
if (!rdp_recv_control_pdu(s, &action))
return FALSE;
BOOL rdp_send_server_synchronize_pdu(rdpRdp* rdp);
BOOL rdp_recv_client_synchronize_pdu(rdpRdp* rdp, STREAM* s);
BOOL rdp_send_client_synchronize_pdu(rdpRdp* rdp);
-BOOL rdp_recv_control_pdu(STREAM* s, uint16* action);
+BOOL rdp_recv_control_pdu(STREAM* s, UINT16* action);
BOOL rdp_recv_server_control_pdu(rdpRdp* rdp, STREAM* s);
BOOL rdp_send_server_control_cooperate_pdu(rdpRdp* rdp);
BOOL rdp_send_server_control_granted_pdu(rdpRdp* rdp);
-BOOL rdp_send_client_control_pdu(rdpRdp* rdp, uint16 action);
+BOOL rdp_send_client_control_pdu(rdpRdp* rdp, UINT16 action);
BOOL rdp_send_client_persistent_key_list_pdu(rdpRdp* rdp);
BOOL rdp_recv_client_font_list_pdu(STREAM* s);
-BOOL rdp_send_client_font_list_pdu(rdpRdp* rdp, uint16 flags);
+BOOL rdp_send_client_font_list_pdu(rdpRdp* rdp, UINT16 flags);
BOOL rdp_recv_font_map_pdu(rdpRdp* rdp, STREAM* s);
BOOL rdp_recv_server_font_map_pdu(rdpRdp* rdp, STREAM* s);
BOOL rdp_recv_client_font_map_pdu(rdpRdp* rdp, STREAM* s);
/* CODEC_GUID_JPEG 0x430C9EED1BAF4CE6869ACB8B37B66237*/
#define CODEC_GUID_JPEG "\xE6\x4C\xAF\x1B\xED\x9E\x0C\x43\x86\x9A\xCB\x8B\x37\xB6\x62\x37"
-void rdp_read_capability_set_header(STREAM* s, uint16* length, uint16* type)
+void rdp_read_capability_set_header(STREAM* s, UINT16* length, UINT16* type)
{
- stream_read_uint16(s, *type); /* capabilitySetType */
- stream_read_uint16(s, *length); /* lengthCapability */
+ stream_read_UINT16(s, *type); /* capabilitySetType */
+ stream_read_UINT16(s, *length); /* lengthCapability */
}
-void rdp_write_capability_set_header(STREAM* s, uint16 length, uint16 type)
+void rdp_write_capability_set_header(STREAM* s, UINT16 length, UINT16 type)
{
- stream_write_uint16(s, type); /* capabilitySetType */
- stream_write_uint16(s, length); /* lengthCapability */
+ stream_write_UINT16(s, type); /* capabilitySetType */
+ stream_write_UINT16(s, length); /* lengthCapability */
}
-uint8* rdp_capability_set_start(STREAM* s)
+BYTE* rdp_capability_set_start(STREAM* s)
{
- uint8* header;
+ BYTE* header;
stream_get_mark(s, header);
stream_write_zero(s, CAPSET_HEADER_LENGTH);
return header;
}
-void rdp_capability_set_finish(STREAM* s, uint8* header, uint16 type)
+void rdp_capability_set_finish(STREAM* s, BYTE* header, UINT16 type)
{
- uint16 length;
- uint8* footer;
+ UINT16 length;
+ BYTE* footer;
footer = s->p;
length = footer - header;
* @param settings settings
*/
-void rdp_read_general_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_general_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
- uint16 extraFlags;
- uint8 refreshRectSupport;
- uint8 suppressOutputSupport;
+ UINT16 extraFlags;
+ BYTE refreshRectSupport;
+ BYTE suppressOutputSupport;
if (settings->server_mode)
{
- stream_read_uint16(s, settings->os_major_type); /* osMajorType (2 bytes) */
- stream_read_uint16(s, settings->os_minor_type); /* osMinorType (2 bytes) */
+ stream_read_UINT16(s, settings->os_major_type); /* osMajorType (2 bytes) */
+ stream_read_UINT16(s, settings->os_minor_type); /* osMinorType (2 bytes) */
}
else
{
- stream_seek_uint16(s); /* osMajorType (2 bytes) */
- stream_seek_uint16(s); /* osMinorType (2 bytes) */
+ stream_seek_UINT16(s); /* osMajorType (2 bytes) */
+ stream_seek_UINT16(s); /* osMinorType (2 bytes) */
}
- stream_seek_uint16(s); /* protocolVersion (2 bytes) */
- stream_seek_uint16(s); /* pad2OctetsA (2 bytes) */
- stream_seek_uint16(s); /* generalCompressionTypes (2 bytes) */
- stream_read_uint16(s, extraFlags); /* extraFlags (2 bytes) */
- stream_seek_uint16(s); /* updateCapabilityFlag (2 bytes) */
- stream_seek_uint16(s); /* remoteUnshareFlag (2 bytes) */
- stream_seek_uint16(s); /* generalCompressionLevel (2 bytes) */
- stream_read_uint8(s, refreshRectSupport); /* refreshRectSupport (1 byte) */
- stream_read_uint8(s, suppressOutputSupport); /* suppressOutputSupport (1 byte) */
+ stream_seek_UINT16(s); /* protocolVersion (2 bytes) */
+ stream_seek_UINT16(s); /* pad2OctetsA (2 bytes) */
+ stream_seek_UINT16(s); /* generalCompressionTypes (2 bytes) */
+ stream_read_UINT16(s, extraFlags); /* extraFlags (2 bytes) */
+ stream_seek_UINT16(s); /* updateCapabilityFlag (2 bytes) */
+ stream_seek_UINT16(s); /* remoteUnshareFlag (2 bytes) */
+ stream_seek_UINT16(s); /* generalCompressionLevel (2 bytes) */
+ stream_read_BYTE(s, refreshRectSupport); /* refreshRectSupport (1 byte) */
+ stream_read_BYTE(s, suppressOutputSupport); /* suppressOutputSupport (1 byte) */
if (!(extraFlags & FASTPATH_OUTPUT_SUPPORTED))
settings->fastpath_output = FALSE;
void rdp_write_general_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
- uint16 extraFlags;
+ BYTE* header;
+ UINT16 extraFlags;
header = rdp_capability_set_start(s);
if (settings->salted_checksum)
extraFlags |= ENC_SALTED_CHECKSUM;
- stream_write_uint16(s, settings->os_major_type); /* osMajorType (2 bytes) */
- stream_write_uint16(s, settings->os_minor_type); /* osMinorType (2 bytes) */
- stream_write_uint16(s, CAPS_PROTOCOL_VERSION); /* protocolVersion (2 bytes) */
- stream_write_uint16(s, 0); /* pad2OctetsA (2 bytes) */
- stream_write_uint16(s, 0); /* generalCompressionTypes (2 bytes) */
- stream_write_uint16(s, extraFlags); /* extraFlags (2 bytes) */
- stream_write_uint16(s, 0); /* updateCapabilityFlag (2 bytes) */
- stream_write_uint16(s, 0); /* remoteUnshareFlag (2 bytes) */
- stream_write_uint16(s, 0); /* generalCompressionLevel (2 bytes) */
- stream_write_uint8(s, settings->refresh_rect); /* refreshRectSupport (1 byte) */
- stream_write_uint8(s, settings->suppress_output); /* suppressOutputSupport (1 byte) */
+ stream_write_UINT16(s, settings->os_major_type); /* osMajorType (2 bytes) */
+ stream_write_UINT16(s, settings->os_minor_type); /* osMinorType (2 bytes) */
+ stream_write_UINT16(s, CAPS_PROTOCOL_VERSION); /* protocolVersion (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2OctetsA (2 bytes) */
+ stream_write_UINT16(s, 0); /* generalCompressionTypes (2 bytes) */
+ stream_write_UINT16(s, extraFlags); /* extraFlags (2 bytes) */
+ stream_write_UINT16(s, 0); /* updateCapabilityFlag (2 bytes) */
+ stream_write_UINT16(s, 0); /* remoteUnshareFlag (2 bytes) */
+ stream_write_UINT16(s, 0); /* generalCompressionLevel (2 bytes) */
+ stream_write_BYTE(s, settings->refresh_rect); /* refreshRectSupport (1 byte) */
+ stream_write_BYTE(s, settings->suppress_output); /* suppressOutputSupport (1 byte) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_GENERAL);
}
* @param settings settings
*/
-void rdp_read_bitmap_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
-{
- uint8 drawingFlags;
- uint16 desktopWidth;
- uint16 desktopHeight;
- uint16 desktopResizeFlag;
- uint16 preferredBitsPerPixel;
-
- stream_read_uint16(s, preferredBitsPerPixel); /* preferredBitsPerPixel (2 bytes) */
- stream_seek_uint16(s); /* receive1BitPerPixel (2 bytes) */
- stream_seek_uint16(s); /* receive4BitsPerPixel (2 bytes) */
- stream_seek_uint16(s); /* receive8BitsPerPixel (2 bytes) */
- stream_read_uint16(s, desktopWidth); /* desktopWidth (2 bytes) */
- stream_read_uint16(s, desktopHeight); /* desktopHeight (2 bytes) */
- stream_seek_uint16(s); /* pad2Octets (2 bytes) */
- stream_read_uint16(s, desktopResizeFlag); /* desktopResizeFlag (2 bytes) */
- stream_seek_uint16(s); /* bitmapCompressionFlag (2 bytes) */
- stream_seek_uint8(s); /* highColorFlags (1 byte) */
- stream_read_uint8(s, drawingFlags); /* drawingFlags (1 byte) */
- stream_seek_uint16(s); /* multipleRectangleSupport (2 bytes) */
- stream_seek_uint16(s); /* pad2OctetsB (2 bytes) */
+void rdp_read_bitmap_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
+{
+ BYTE drawingFlags;
+ UINT16 desktopWidth;
+ UINT16 desktopHeight;
+ UINT16 desktopResizeFlag;
+ UINT16 preferredBitsPerPixel;
+
+ stream_read_UINT16(s, preferredBitsPerPixel); /* preferredBitsPerPixel (2 bytes) */
+ stream_seek_UINT16(s); /* receive1BitPerPixel (2 bytes) */
+ stream_seek_UINT16(s); /* receive4BitsPerPixel (2 bytes) */
+ stream_seek_UINT16(s); /* receive8BitsPerPixel (2 bytes) */
+ stream_read_UINT16(s, desktopWidth); /* desktopWidth (2 bytes) */
+ stream_read_UINT16(s, desktopHeight); /* desktopHeight (2 bytes) */
+ stream_seek_UINT16(s); /* pad2Octets (2 bytes) */
+ stream_read_UINT16(s, desktopResizeFlag); /* desktopResizeFlag (2 bytes) */
+ stream_seek_UINT16(s); /* bitmapCompressionFlag (2 bytes) */
+ stream_seek_BYTE(s); /* highColorFlags (1 byte) */
+ stream_read_BYTE(s, drawingFlags); /* drawingFlags (1 byte) */
+ stream_seek_UINT16(s); /* multipleRectangleSupport (2 bytes) */
+ stream_seek_UINT16(s); /* pad2OctetsB (2 bytes) */
if (!settings->server_mode && preferredBitsPerPixel != settings->color_depth)
{
void rdp_write_bitmap_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
- uint8 drawingFlags = 0;
- uint16 desktopResizeFlag;
- uint16 preferredBitsPerPixel;
+ BYTE* header;
+ BYTE drawingFlags = 0;
+ UINT16 desktopResizeFlag;
+ UINT16 preferredBitsPerPixel;
header = rdp_capability_set_start(s);
desktopResizeFlag = settings->desktop_resize;
- stream_write_uint16(s, preferredBitsPerPixel); /* preferredBitsPerPixel (2 bytes) */
- stream_write_uint16(s, 1); /* receive1BitPerPixel (2 bytes) */
- stream_write_uint16(s, 1); /* receive4BitsPerPixel (2 bytes) */
- stream_write_uint16(s, 1); /* receive8BitsPerPixel (2 bytes) */
- stream_write_uint16(s, settings->width); /* desktopWidth (2 bytes) */
- stream_write_uint16(s, settings->height); /* desktopHeight (2 bytes) */
- stream_write_uint16(s, 0); /* pad2Octets (2 bytes) */
- stream_write_uint16(s, desktopResizeFlag); /* desktopResizeFlag (2 bytes) */
- stream_write_uint16(s, 1); /* bitmapCompressionFlag (2 bytes) */
- stream_write_uint8(s, 0); /* highColorFlags (1 byte) */
- stream_write_uint8(s, drawingFlags); /* drawingFlags (1 byte) */
- stream_write_uint16(s, 1); /* multipleRectangleSupport (2 bytes) */
- stream_write_uint16(s, 0); /* pad2OctetsB (2 bytes) */
+ stream_write_UINT16(s, preferredBitsPerPixel); /* preferredBitsPerPixel (2 bytes) */
+ stream_write_UINT16(s, 1); /* receive1BitPerPixel (2 bytes) */
+ stream_write_UINT16(s, 1); /* receive4BitsPerPixel (2 bytes) */
+ stream_write_UINT16(s, 1); /* receive8BitsPerPixel (2 bytes) */
+ stream_write_UINT16(s, settings->width); /* desktopWidth (2 bytes) */
+ stream_write_UINT16(s, settings->height); /* desktopHeight (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2Octets (2 bytes) */
+ stream_write_UINT16(s, desktopResizeFlag); /* desktopResizeFlag (2 bytes) */
+ stream_write_UINT16(s, 1); /* bitmapCompressionFlag (2 bytes) */
+ stream_write_BYTE(s, 0); /* highColorFlags (1 byte) */
+ stream_write_BYTE(s, drawingFlags); /* drawingFlags (1 byte) */
+ stream_write_UINT16(s, 1); /* multipleRectangleSupport (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2OctetsB (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_BITMAP);
}
* @param settings settings
*/
-void rdp_read_order_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_order_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
int i;
- uint16 orderFlags;
- uint8 orderSupport[32];
- uint16 orderSupportExFlags;
+ UINT16 orderFlags;
+ BYTE orderSupport[32];
+ UINT16 orderSupportExFlags;
stream_seek(s, 16); /* terminalDescriptor (16 bytes) */
stream_seek_uint32(s); /* pad4OctetsA (4 bytes) */
- stream_seek_uint16(s); /* desktopSaveXGranularity (2 bytes) */
- stream_seek_uint16(s); /* desktopSaveYGranularity (2 bytes) */
- stream_seek_uint16(s); /* pad2OctetsA (2 bytes) */
- stream_seek_uint16(s); /* maximumOrderLevel (2 bytes) */
- stream_seek_uint16(s); /* numberFonts (2 bytes) */
- stream_read_uint16(s, orderFlags); /* orderFlags (2 bytes) */
+ stream_seek_UINT16(s); /* desktopSaveXGranularity (2 bytes) */
+ stream_seek_UINT16(s); /* desktopSaveYGranularity (2 bytes) */
+ stream_seek_UINT16(s); /* pad2OctetsA (2 bytes) */
+ stream_seek_UINT16(s); /* maximumOrderLevel (2 bytes) */
+ stream_seek_UINT16(s); /* numberFonts (2 bytes) */
+ stream_read_UINT16(s, orderFlags); /* orderFlags (2 bytes) */
stream_read(s, orderSupport, 32); /* orderSupport (32 bytes) */
- stream_seek_uint16(s); /* textFlags (2 bytes) */
- stream_read_uint16(s, orderSupportExFlags); /* orderSupportExFlags (2 bytes) */
+ stream_seek_UINT16(s); /* textFlags (2 bytes) */
+ stream_read_UINT16(s, orderSupportExFlags); /* orderSupportExFlags (2 bytes) */
stream_seek_uint32(s); /* pad4OctetsB (4 bytes) */
stream_seek_uint32(s); /* desktopSaveSize (4 bytes) */
- stream_seek_uint16(s); /* pad2OctetsC (2 bytes) */
- stream_seek_uint16(s); /* pad2OctetsD (2 bytes) */
- stream_seek_uint16(s); /* textANSICodePage (2 bytes) */
- stream_seek_uint16(s); /* pad2OctetsE (2 bytes) */
+ stream_seek_UINT16(s); /* pad2OctetsC (2 bytes) */
+ stream_seek_UINT16(s); /* pad2OctetsD (2 bytes) */
+ stream_seek_UINT16(s); /* textANSICodePage (2 bytes) */
+ stream_seek_UINT16(s); /* pad2OctetsE (2 bytes) */
for (i = 0; i < 32; i++)
{
void rdp_write_order_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
- uint16 orderFlags;
- uint16 orderSupportExFlags;
- uint16 textANSICodePage;
+ BYTE* header;
+ UINT16 orderFlags;
+ UINT16 orderSupportExFlags;
+ UINT16 textANSICodePage;
header = rdp_capability_set_start(s);
stream_write_zero(s, 16); /* terminalDescriptor (16 bytes) */
stream_write_uint32(s, 0); /* pad4OctetsA (4 bytes) */
- stream_write_uint16(s, 1); /* desktopSaveXGranularity (2 bytes) */
- stream_write_uint16(s, 20); /* desktopSaveYGranularity (2 bytes) */
- stream_write_uint16(s, 0); /* pad2OctetsA (2 bytes) */
- stream_write_uint16(s, 1); /* maximumOrderLevel (2 bytes) */
- stream_write_uint16(s, 0); /* numberFonts (2 bytes) */
- stream_write_uint16(s, orderFlags); /* orderFlags (2 bytes) */
+ stream_write_UINT16(s, 1); /* desktopSaveXGranularity (2 bytes) */
+ stream_write_UINT16(s, 20); /* desktopSaveYGranularity (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2OctetsA (2 bytes) */
+ stream_write_UINT16(s, 1); /* maximumOrderLevel (2 bytes) */
+ stream_write_UINT16(s, 0); /* numberFonts (2 bytes) */
+ stream_write_UINT16(s, orderFlags); /* orderFlags (2 bytes) */
stream_write(s, settings->order_support, 32); /* orderSupport (32 bytes) */
- stream_write_uint16(s, 0); /* textFlags (2 bytes) */
- stream_write_uint16(s, orderSupportExFlags); /* orderSupportExFlags (2 bytes) */
+ stream_write_UINT16(s, 0); /* textFlags (2 bytes) */
+ stream_write_UINT16(s, orderSupportExFlags); /* orderSupportExFlags (2 bytes) */
stream_write_uint32(s, 0); /* pad4OctetsB (4 bytes) */
stream_write_uint32(s, 230400); /* desktopSaveSize (4 bytes) */
- stream_write_uint16(s, 0); /* pad2OctetsC (2 bytes) */
- stream_write_uint16(s, 0); /* pad2OctetsD (2 bytes) */
- stream_write_uint16(s, 0); /* textANSICodePage (2 bytes) */
- stream_write_uint16(s, 0); /* pad2OctetsE (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2OctetsC (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2OctetsD (2 bytes) */
+ stream_write_UINT16(s, 0); /* textANSICodePage (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2OctetsE (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_ORDER);
}
* @param settings settings
*/
-void rdp_read_bitmap_cache_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_bitmap_cache_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
stream_seek_uint32(s); /* pad1 (4 bytes) */
stream_seek_uint32(s); /* pad2 (4 bytes) */
stream_seek_uint32(s); /* pad4 (4 bytes) */
stream_seek_uint32(s); /* pad5 (4 bytes) */
stream_seek_uint32(s); /* pad6 (4 bytes) */
- stream_seek_uint16(s); /* Cache0Entries (2 bytes) */
- stream_seek_uint16(s); /* Cache0MaximumCellSize (2 bytes) */
- stream_seek_uint16(s); /* Cache1Entries (2 bytes) */
- stream_seek_uint16(s); /* Cache1MaximumCellSize (2 bytes) */
- stream_seek_uint16(s); /* Cache2Entries (2 bytes) */
- stream_seek_uint16(s); /* Cache2MaximumCellSize (2 bytes) */
+ stream_seek_UINT16(s); /* Cache0Entries (2 bytes) */
+ stream_seek_UINT16(s); /* Cache0MaximumCellSize (2 bytes) */
+ stream_seek_UINT16(s); /* Cache1Entries (2 bytes) */
+ stream_seek_UINT16(s); /* Cache1MaximumCellSize (2 bytes) */
+ stream_seek_UINT16(s); /* Cache2Entries (2 bytes) */
+ stream_seek_UINT16(s); /* Cache2MaximumCellSize (2 bytes) */
}
/**
void rdp_write_bitmap_cache_capability_set(STREAM* s, rdpSettings* settings)
{
int bpp;
- uint16 size;
- uint8* header;
+ UINT16 size;
+ BYTE* header;
header = rdp_capability_set_start(s);
stream_write_uint32(s, 0); /* pad6 (4 bytes) */
size = bpp * 256;
- stream_write_uint16(s, 200); /* Cache0Entries (2 bytes) */
- stream_write_uint16(s, size); /* Cache0MaximumCellSize (2 bytes) */
+ stream_write_UINT16(s, 200); /* Cache0Entries (2 bytes) */
+ stream_write_UINT16(s, size); /* Cache0MaximumCellSize (2 bytes) */
size = bpp * 1024;
- stream_write_uint16(s, 600); /* Cache1Entries (2 bytes) */
- stream_write_uint16(s, size); /* Cache1MaximumCellSize (2 bytes) */
+ stream_write_UINT16(s, 600); /* Cache1Entries (2 bytes) */
+ stream_write_UINT16(s, size); /* Cache1MaximumCellSize (2 bytes) */
size = bpp * 4096;
- stream_write_uint16(s, 1000); /* Cache2Entries (2 bytes) */
- stream_write_uint16(s, size); /* Cache2MaximumCellSize (2 bytes) */
+ stream_write_UINT16(s, 1000); /* Cache2Entries (2 bytes) */
+ stream_write_UINT16(s, size); /* Cache2MaximumCellSize (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_BITMAP_CACHE);
}
* @param settings settings
*/
-void rdp_read_control_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_control_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
- stream_seek_uint16(s); /* controlFlags (2 bytes) */
- stream_seek_uint16(s); /* remoteDetachFlag (2 bytes) */
- stream_seek_uint16(s); /* controlInterest (2 bytes) */
- stream_seek_uint16(s); /* detachInterest (2 bytes) */
+ stream_seek_UINT16(s); /* controlFlags (2 bytes) */
+ stream_seek_UINT16(s); /* remoteDetachFlag (2 bytes) */
+ stream_seek_UINT16(s); /* controlInterest (2 bytes) */
+ stream_seek_UINT16(s); /* detachInterest (2 bytes) */
}
/**
void rdp_write_control_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
header = rdp_capability_set_start(s);
- stream_write_uint16(s, 0); /* controlFlags (2 bytes) */
- stream_write_uint16(s, 0); /* remoteDetachFlag (2 bytes) */
- stream_write_uint16(s, 2); /* controlInterest (2 bytes) */
- stream_write_uint16(s, 2); /* detachInterest (2 bytes) */
+ stream_write_UINT16(s, 0); /* controlFlags (2 bytes) */
+ stream_write_UINT16(s, 0); /* remoteDetachFlag (2 bytes) */
+ stream_write_UINT16(s, 2); /* controlInterest (2 bytes) */
+ stream_write_UINT16(s, 2); /* detachInterest (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_CONTROL);
}
* @param settings settings
*/
-void rdp_read_window_activation_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_window_activation_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
- stream_seek_uint16(s); /* helpKeyFlag (2 bytes) */
- stream_seek_uint16(s); /* helpKeyIndexFlag (2 bytes) */
- stream_seek_uint16(s); /* helpExtendedKeyFlag (2 bytes) */
- stream_seek_uint16(s); /* windowManagerKeyFlag (2 bytes) */
+ stream_seek_UINT16(s); /* helpKeyFlag (2 bytes) */
+ stream_seek_UINT16(s); /* helpKeyIndexFlag (2 bytes) */
+ stream_seek_UINT16(s); /* helpExtendedKeyFlag (2 bytes) */
+ stream_seek_UINT16(s); /* windowManagerKeyFlag (2 bytes) */
}
/**
void rdp_write_window_activation_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
header = rdp_capability_set_start(s);
- stream_write_uint16(s, 0); /* helpKeyFlag (2 bytes) */
- stream_write_uint16(s, 0); /* helpKeyIndexFlag (2 bytes) */
- stream_write_uint16(s, 0); /* helpExtendedKeyFlag (2 bytes) */
- stream_write_uint16(s, 0); /* windowManagerKeyFlag (2 bytes) */
+ stream_write_UINT16(s, 0); /* helpKeyFlag (2 bytes) */
+ stream_write_UINT16(s, 0); /* helpKeyIndexFlag (2 bytes) */
+ stream_write_UINT16(s, 0); /* helpExtendedKeyFlag (2 bytes) */
+ stream_write_UINT16(s, 0); /* windowManagerKeyFlag (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_ACTIVATION);
}
* @param settings settings
*/
-void rdp_read_pointer_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_pointer_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
- uint16 colorPointerFlag;
- uint16 colorPointerCacheSize;
- uint16 pointerCacheSize;
+ UINT16 colorPointerFlag;
+ UINT16 colorPointerCacheSize;
+ UINT16 pointerCacheSize;
- stream_read_uint16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */
- stream_read_uint16(s, colorPointerCacheSize); /* colorPointerCacheSize (2 bytes) */
- stream_read_uint16(s, pointerCacheSize); /* pointerCacheSize (2 bytes) */
+ stream_read_UINT16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */
+ stream_read_UINT16(s, colorPointerCacheSize); /* colorPointerCacheSize (2 bytes) */
+ stream_read_UINT16(s, pointerCacheSize); /* pointerCacheSize (2 bytes) */
if (colorPointerFlag == FALSE)
settings->color_pointer = FALSE;
void rdp_write_pointer_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
- uint16 colorPointerFlag;
+ BYTE* header;
+ UINT16 colorPointerFlag;
header = rdp_capability_set_start(s);
colorPointerFlag = (settings->color_pointer) ? 1 : 0;
- stream_write_uint16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */
- stream_write_uint16(s, settings->pointer_cache_size); /* colorPointerCacheSize (2 bytes) */
+ stream_write_UINT16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */
+ stream_write_UINT16(s, settings->pointer_cache_size); /* colorPointerCacheSize (2 bytes) */
if (settings->large_pointer)
{
- stream_write_uint16(s, settings->pointer_cache_size); /* pointerCacheSize (2 bytes) */
+ stream_write_UINT16(s, settings->pointer_cache_size); /* pointerCacheSize (2 bytes) */
}
rdp_capability_set_finish(s, header, CAPSET_TYPE_POINTER);
* @param settings settings
*/
-void rdp_read_share_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_share_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
- stream_seek_uint16(s); /* nodeId (2 bytes) */
- stream_seek_uint16(s); /* pad2Octets (2 bytes) */
+ stream_seek_UINT16(s); /* nodeId (2 bytes) */
+ stream_seek_UINT16(s); /* pad2Octets (2 bytes) */
}
/**
void rdp_write_share_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
- uint16 nodeId;
+ BYTE* header;
+ UINT16 nodeId;
header = rdp_capability_set_start(s);
nodeId = (settings->server_mode) ? 0x03EA : 0;
- stream_write_uint16(s, nodeId); /* nodeId (2 bytes) */
- stream_write_uint16(s, 0); /* pad2Octets (2 bytes) */
+ stream_write_UINT16(s, nodeId); /* nodeId (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2Octets (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_SHARE);
}
* @param settings settings
*/
-void rdp_read_color_cache_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_color_cache_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
- stream_seek_uint16(s); /* colorTableCacheSize (2 bytes) */
- stream_seek_uint16(s); /* pad2Octets (2 bytes) */
+ stream_seek_UINT16(s); /* colorTableCacheSize (2 bytes) */
+ stream_seek_UINT16(s); /* pad2Octets (2 bytes) */
}
/**
void rdp_write_color_cache_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
header = rdp_capability_set_start(s);
- stream_write_uint16(s, 6); /* colorTableCacheSize (2 bytes) */
- stream_write_uint16(s, 0); /* pad2Octets (2 bytes) */
+ stream_write_UINT16(s, 6); /* colorTableCacheSize (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2Octets (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_COLOR_CACHE);
}
* @param settings settings
*/
-void rdp_read_sound_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_sound_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
- uint16 soundFlags;
+ UINT16 soundFlags;
- stream_read_uint16(s, soundFlags); /* soundFlags (2 bytes) */
- stream_seek_uint16(s); /* pad2OctetsA (2 bytes) */
+ stream_read_UINT16(s, soundFlags); /* soundFlags (2 bytes) */
+ stream_seek_UINT16(s); /* pad2OctetsA (2 bytes) */
settings->sound_beeps = (soundFlags & SOUND_BEEPS_FLAG) ? TRUE : FALSE;
}
void rdp_write_sound_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
- uint16 soundFlags;
+ BYTE* header;
+ UINT16 soundFlags;
header = rdp_capability_set_start(s);
soundFlags = (settings->sound_beeps) ? SOUND_BEEPS_FLAG : 0;
- stream_write_uint16(s, soundFlags); /* soundFlags (2 bytes) */
- stream_write_uint16(s, 0); /* pad2OctetsA (2 bytes) */
+ stream_write_UINT16(s, soundFlags); /* soundFlags (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2OctetsA (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_SOUND);
}
* @param settings settings
*/
-void rdp_read_input_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_input_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
- uint16 inputFlags;
+ UINT16 inputFlags;
- stream_read_uint16(s, inputFlags); /* inputFlags (2 bytes) */
- stream_seek_uint16(s); /* pad2OctetsA (2 bytes) */
+ stream_read_UINT16(s, inputFlags); /* inputFlags (2 bytes) */
+ stream_seek_UINT16(s); /* pad2OctetsA (2 bytes) */
if (settings->server_mode)
{
void rdp_write_input_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
- uint16 inputFlags;
+ BYTE* header;
+ UINT16 inputFlags;
header = rdp_capability_set_start(s);
inputFlags |= INPUT_FLAG_FASTPATH_INPUT2;
}
- stream_write_uint16(s, inputFlags); /* inputFlags (2 bytes) */
- stream_write_uint16(s, 0); /* pad2OctetsA (2 bytes) */
+ stream_write_UINT16(s, inputFlags); /* inputFlags (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2OctetsA (2 bytes) */
stream_write_uint32(s, settings->kbd_layout); /* keyboardLayout (4 bytes) */
stream_write_uint32(s, settings->kbd_type); /* keyboardType (4 bytes) */
stream_write_uint32(s, settings->kbd_subtype); /* keyboardSubType (4 bytes) */
* @param settings settings
*/
-void rdp_read_font_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_font_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
if (length > 4)
- stream_seek_uint16(s); /* fontSupportFlags (2 bytes) */
+ stream_seek_UINT16(s); /* fontSupportFlags (2 bytes) */
if (length > 6)
- stream_seek_uint16(s); /* pad2Octets (2 bytes) */
+ stream_seek_UINT16(s); /* pad2Octets (2 bytes) */
}
/**
void rdp_write_font_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
header = rdp_capability_set_start(s);
- stream_write_uint16(s, FONTSUPPORT_FONTLIST); /* fontSupportFlags (2 bytes) */
- stream_write_uint16(s, 0); /* pad2Octets (2 bytes) */
+ stream_write_UINT16(s, FONTSUPPORT_FONTLIST); /* fontSupportFlags (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2Octets (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_FONT);
}
* @param settings settings
*/
-void rdp_read_brush_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_brush_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
stream_seek_uint32(s); /* brushSupportLevel (4 bytes) */
}
void rdp_write_brush_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
header = rdp_capability_set_start(s);
*/
void rdp_read_cache_definition(STREAM* s, GLYPH_CACHE_DEFINITION* cache_definition)
{
- stream_read_uint16(s, cache_definition->cacheEntries); /* cacheEntries (2 bytes) */
- stream_read_uint16(s, cache_definition->cacheMaximumCellSize); /* cacheMaximumCellSize (2 bytes) */
+ stream_read_UINT16(s, cache_definition->cacheEntries); /* cacheEntries (2 bytes) */
+ stream_read_UINT16(s, cache_definition->cacheMaximumCellSize); /* cacheMaximumCellSize (2 bytes) */
}
/**
*/
void rdp_write_cache_definition(STREAM* s, GLYPH_CACHE_DEFINITION* cache_definition)
{
- stream_write_uint16(s, cache_definition->cacheEntries); /* cacheEntries (2 bytes) */
- stream_write_uint16(s, cache_definition->cacheMaximumCellSize); /* cacheMaximumCellSize (2 bytes) */
+ stream_write_UINT16(s, cache_definition->cacheEntries); /* cacheEntries (2 bytes) */
+ stream_write_UINT16(s, cache_definition->cacheMaximumCellSize); /* cacheMaximumCellSize (2 bytes) */
}
/**
* @param settings settings
*/
-void rdp_read_glyph_cache_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_glyph_cache_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
- uint16 glyphSupportLevel;
+ UINT16 glyphSupportLevel;
stream_seek(s, 40); /* glyphCache (40 bytes) */
stream_seek_uint32(s); /* fragCache (4 bytes) */
- stream_read_uint16(s, glyphSupportLevel); /* glyphSupportLevel (2 bytes) */
- stream_seek_uint16(s); /* pad2Octets (2 bytes) */
+ stream_read_UINT16(s, glyphSupportLevel); /* glyphSupportLevel (2 bytes) */
+ stream_seek_UINT16(s); /* pad2Octets (2 bytes) */
settings->glyphSupportLevel = glyphSupportLevel;
}
void rdp_write_glyph_cache_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
header = rdp_capability_set_start(s);
rdp_write_cache_definition(s, settings->fragCache); /* fragCache (4 bytes) */
- stream_write_uint16(s, settings->glyphSupportLevel); /* glyphSupportLevel (2 bytes) */
+ stream_write_UINT16(s, settings->glyphSupportLevel); /* glyphSupportLevel (2 bytes) */
- stream_write_uint16(s, 0); /* pad2Octets (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2Octets (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_GLYPH_CACHE);
}
* @param settings settings
*/
-void rdp_read_offscreen_bitmap_cache_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_offscreen_bitmap_cache_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
uint32 offscreenSupportLevel;
stream_read_uint32(s, offscreenSupportLevel); /* offscreenSupportLevel (4 bytes) */
- stream_read_uint16(s, settings->offscreen_bitmap_cache_size); /* offscreenCacheSize (2 bytes) */
- stream_read_uint16(s, settings->offscreen_bitmap_cache_entries); /* offscreenCacheEntries (2 bytes) */
+ stream_read_UINT16(s, settings->offscreen_bitmap_cache_size); /* offscreenCacheSize (2 bytes) */
+ stream_read_UINT16(s, settings->offscreen_bitmap_cache_entries); /* offscreenCacheEntries (2 bytes) */
if (offscreenSupportLevel & TRUE)
settings->offscreen_bitmap_cache = TRUE;
void rdp_write_offscreen_bitmap_cache_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
uint32 offscreenSupportLevel = FALSE;
header = rdp_capability_set_start(s);
offscreenSupportLevel = TRUE;
stream_write_uint32(s, offscreenSupportLevel); /* offscreenSupportLevel (4 bytes) */
- stream_write_uint16(s, settings->offscreen_bitmap_cache_size); /* offscreenCacheSize (2 bytes) */
- stream_write_uint16(s, settings->offscreen_bitmap_cache_entries); /* offscreenCacheEntries (2 bytes) */
+ stream_write_UINT16(s, settings->offscreen_bitmap_cache_size); /* offscreenCacheSize (2 bytes) */
+ stream_write_UINT16(s, settings->offscreen_bitmap_cache_entries); /* offscreenCacheEntries (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_OFFSCREEN_CACHE);
}
* @param settings settings
*/
-void rdp_read_bitmap_cache_host_support_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_bitmap_cache_host_support_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
- uint8 cacheVersion;
+ BYTE cacheVersion;
- stream_read_uint8(s, cacheVersion); /* cacheVersion (1 byte) */
- stream_seek_uint8(s); /* pad1 (1 byte) */
- stream_seek_uint16(s); /* pad2 (2 bytes) */
+ stream_read_BYTE(s, cacheVersion); /* cacheVersion (1 byte) */
+ stream_seek_BYTE(s); /* pad1 (1 byte) */
+ stream_seek_UINT16(s); /* pad2 (2 bytes) */
if (cacheVersion & BITMAP_CACHE_V2)
settings->persistent_bitmap_cache = TRUE;
void rdp_write_bitmap_cache_host_support_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
header = rdp_capability_set_start(s);
- stream_write_uint8(s, BITMAP_CACHE_V2); /* cacheVersion (1 byte) */
- stream_write_uint8(s, 0); /* pad1 (1 byte) */
- stream_write_uint16(s, 0); /* pad2 (2 bytes) */
+ stream_write_BYTE(s, BITMAP_CACHE_V2); /* cacheVersion (1 byte) */
+ stream_write_BYTE(s, 0); /* pad1 (1 byte) */
+ stream_write_UINT16(s, 0); /* pad2 (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_BITMAP_CACHE_HOST_SUPPORT);
}
* @param settings settings
*/
-void rdp_read_bitmap_cache_v2_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_bitmap_cache_v2_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
- stream_seek_uint16(s); /* cacheFlags (2 bytes) */
- stream_seek_uint8(s); /* pad2 (1 byte) */
- stream_seek_uint8(s); /* numCellCaches (1 byte) */
+ stream_seek_UINT16(s); /* cacheFlags (2 bytes) */
+ stream_seek_BYTE(s); /* pad2 (1 byte) */
+ stream_seek_BYTE(s); /* numCellCaches (1 byte) */
stream_seek(s, 4); /* bitmapCache0CellInfo (4 bytes) */
stream_seek(s, 4); /* bitmapCache1CellInfo (4 bytes) */
stream_seek(s, 4); /* bitmapCache2CellInfo (4 bytes) */
void rdp_write_bitmap_cache_v2_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
- uint16 cacheFlags;
+ BYTE* header;
+ UINT16 cacheFlags;
header = rdp_capability_set_start(s);
if (settings->persistent_bitmap_cache)
cacheFlags |= PERSISTENT_KEYS_EXPECTED_FLAG;
- stream_write_uint16(s, cacheFlags); /* cacheFlags (2 bytes) */
- stream_write_uint8(s, 0); /* pad2 (1 byte) */
- stream_write_uint8(s, settings->bitmapCacheV2NumCells); /* numCellCaches (1 byte) */
+ stream_write_UINT16(s, cacheFlags); /* cacheFlags (2 bytes) */
+ stream_write_BYTE(s, 0); /* pad2 (1 byte) */
+ stream_write_BYTE(s, settings->bitmapCacheV2NumCells); /* numCellCaches (1 byte) */
rdp_write_bitmap_cache_cell_info(s, &settings->bitmapCacheV2CellInfo[0]); /* bitmapCache0CellInfo (4 bytes) */
rdp_write_bitmap_cache_cell_info(s, &settings->bitmapCacheV2CellInfo[1]); /* bitmapCache1CellInfo (4 bytes) */
rdp_write_bitmap_cache_cell_info(s, &settings->bitmapCacheV2CellInfo[2]); /* bitmapCache2CellInfo (4 bytes) */
* @param settings settings
*/
-void rdp_read_virtual_channel_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_virtual_channel_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
uint32 flags;
uint32 VCChunkSize;
void rdp_write_virtual_channel_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
uint32 flags;
header = rdp_capability_set_start(s);
* @param settings settings
*/
-void rdp_read_draw_nine_grid_cache_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_draw_nine_grid_cache_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
uint32 drawNineGridSupportLevel;
stream_read_uint32(s, drawNineGridSupportLevel); /* drawNineGridSupportLevel (4 bytes) */
- stream_read_uint16(s, settings->draw_nine_grid_cache_size); /* drawNineGridCacheSize (2 bytes) */
- stream_read_uint16(s, settings->draw_nine_grid_cache_entries); /* drawNineGridCacheEntries (2 bytes) */
+ stream_read_UINT16(s, settings->draw_nine_grid_cache_size); /* drawNineGridCacheSize (2 bytes) */
+ stream_read_UINT16(s, settings->draw_nine_grid_cache_entries); /* drawNineGridCacheEntries (2 bytes) */
if ((drawNineGridSupportLevel & DRAW_NINEGRID_SUPPORTED) ||
(drawNineGridSupportLevel & DRAW_NINEGRID_SUPPORTED_V2))
void rdp_write_draw_nine_grid_cache_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
uint32 drawNineGridSupportLevel;
header = rdp_capability_set_start(s);
drawNineGridSupportLevel = (settings->draw_nine_grid) ? DRAW_NINEGRID_SUPPORTED_V2 : DRAW_NINEGRID_NO_SUPPORT;
stream_write_uint32(s, drawNineGridSupportLevel); /* drawNineGridSupportLevel (4 bytes) */
- stream_write_uint16(s, settings->draw_nine_grid_cache_size); /* drawNineGridCacheSize (2 bytes) */
- stream_write_uint16(s, settings->draw_nine_grid_cache_entries); /* drawNineGridCacheEntries (2 bytes) */
+ stream_write_UINT16(s, settings->draw_nine_grid_cache_size); /* drawNineGridCacheSize (2 bytes) */
+ stream_write_UINT16(s, settings->draw_nine_grid_cache_entries); /* drawNineGridCacheEntries (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_DRAW_NINE_GRID_CACHE);
}
-void rdp_write_gdiplus_cache_entries(STREAM* s, uint16 gce, uint16 bce, uint16 pce, uint16 ice, uint16 ace)
+void rdp_write_gdiplus_cache_entries(STREAM* s, UINT16 gce, UINT16 bce, UINT16 pce, UINT16 ice, UINT16 ace)
{
- stream_write_uint16(s, gce); /* gdipGraphicsCacheEntries (2 bytes) */
- stream_write_uint16(s, bce); /* gdipBrushCacheEntries (2 bytes) */
- stream_write_uint16(s, pce); /* gdipPenCacheEntries (2 bytes) */
- stream_write_uint16(s, ice); /* gdipImageCacheEntries (2 bytes) */
- stream_write_uint16(s, ace); /* gdipImageAttributesCacheEntries (2 bytes) */
+ stream_write_UINT16(s, gce); /* gdipGraphicsCacheEntries (2 bytes) */
+ stream_write_UINT16(s, bce); /* gdipBrushCacheEntries (2 bytes) */
+ stream_write_UINT16(s, pce); /* gdipPenCacheEntries (2 bytes) */
+ stream_write_UINT16(s, ice); /* gdipImageCacheEntries (2 bytes) */
+ stream_write_UINT16(s, ace); /* gdipImageAttributesCacheEntries (2 bytes) */
}
-void rdp_write_gdiplus_cache_chunk_size(STREAM* s, uint16 gccs, uint16 obccs, uint16 opccs, uint16 oiaccs)
+void rdp_write_gdiplus_cache_chunk_size(STREAM* s, UINT16 gccs, UINT16 obccs, UINT16 opccs, UINT16 oiaccs)
{
- stream_write_uint16(s, gccs); /* gdipGraphicsCacheChunkSize (2 bytes) */
- stream_write_uint16(s, obccs); /* gdipObjectBrushCacheChunkSize (2 bytes) */
- stream_write_uint16(s, opccs); /* gdipObjectPenCacheChunkSize (2 bytes) */
- stream_write_uint16(s, oiaccs); /* gdipObjectImageAttributesCacheChunkSize (2 bytes) */
+ stream_write_UINT16(s, gccs); /* gdipGraphicsCacheChunkSize (2 bytes) */
+ stream_write_UINT16(s, obccs); /* gdipObjectBrushCacheChunkSize (2 bytes) */
+ stream_write_UINT16(s, opccs); /* gdipObjectPenCacheChunkSize (2 bytes) */
+ stream_write_UINT16(s, oiaccs); /* gdipObjectImageAttributesCacheChunkSize (2 bytes) */
}
-void rdp_write_gdiplus_image_cache_properties(STREAM* s, uint16 oiccs, uint16 oicts, uint16 oicms)
+void rdp_write_gdiplus_image_cache_properties(STREAM* s, UINT16 oiccs, UINT16 oicts, UINT16 oicms)
{
- stream_write_uint16(s, oiccs); /* gdipObjectImageCacheChunkSize (2 bytes) */
- stream_write_uint16(s, oicts); /* gdipObjectImageCacheTotalSize (2 bytes) */
- stream_write_uint16(s, oicms); /* gdipObjectImageCacheMaxSize (2 bytes) */
+ stream_write_UINT16(s, oiccs); /* gdipObjectImageCacheChunkSize (2 bytes) */
+ stream_write_UINT16(s, oicts); /* gdipObjectImageCacheTotalSize (2 bytes) */
+ stream_write_UINT16(s, oicms); /* gdipObjectImageCacheMaxSize (2 bytes) */
}
/**
* @param settings settings
*/
-void rdp_read_draw_gdiplus_cache_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_draw_gdiplus_cache_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
uint32 drawGDIPlusSupportLevel;
uint32 drawGdiplusCacheLevel;
void rdp_write_draw_gdiplus_cache_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
uint32 drawGDIPlusSupportLevel;
uint32 drawGdiplusCacheLevel;
* @param settings settings
*/
-void rdp_read_remote_programs_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_remote_programs_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
uint32 railSupportLevel;
void rdp_write_remote_programs_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
uint32 railSupportLevel;
header = rdp_capability_set_start(s);
* @param settings settings
*/
-void rdp_read_window_list_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_window_list_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
stream_seek_uint32(s); /* wndSupportLevel (4 bytes) */
- stream_seek_uint8(s); /* numIconCaches (1 byte) */
- stream_seek_uint16(s); /* numIconCacheEntries (2 bytes) */
+ stream_seek_BYTE(s); /* numIconCaches (1 byte) */
+ stream_seek_UINT16(s); /* numIconCacheEntries (2 bytes) */
}
/**
void rdp_write_window_list_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
uint32 wndSupportLevel;
header = rdp_capability_set_start(s);
wndSupportLevel = WINDOW_LEVEL_SUPPORTED_EX;
stream_write_uint32(s, wndSupportLevel); /* wndSupportLevel (4 bytes) */
- stream_write_uint8(s, settings->num_icon_caches); /* numIconCaches (1 byte) */
- stream_write_uint16(s, settings->num_icon_cache_entries); /* numIconCacheEntries (2 bytes) */
+ stream_write_BYTE(s, settings->num_icon_caches); /* numIconCaches (1 byte) */
+ stream_write_UINT16(s, settings->num_icon_cache_entries); /* numIconCacheEntries (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_WINDOW);
}
* @param settings settings
*/
-void rdp_read_desktop_composition_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_desktop_composition_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
- stream_seek_uint16(s); /* compDeskSupportLevel (2 bytes) */
+ stream_seek_UINT16(s); /* compDeskSupportLevel (2 bytes) */
}
/**
void rdp_write_desktop_composition_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
- uint16 compDeskSupportLevel;
+ BYTE* header;
+ UINT16 compDeskSupportLevel;
header = rdp_capability_set_start(s);
compDeskSupportLevel = (settings->desktop_composition) ? COMPDESK_SUPPORTED : COMPDESK_NOT_SUPPORTED;
- stream_write_uint16(s, compDeskSupportLevel); /* compDeskSupportLevel (2 bytes) */
+ stream_write_UINT16(s, compDeskSupportLevel); /* compDeskSupportLevel (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_COMP_DESK);
}
* @param settings settings
*/
-void rdp_read_multifragment_update_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_multifragment_update_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
stream_read_uint32(s, settings->multifrag_max_request_size); /* MaxRequestSize (4 bytes) */
}
void rdp_write_multifragment_update_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
header = rdp_capability_set_start(s);
* @param settings settings
*/
-void rdp_read_large_pointer_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_large_pointer_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
- stream_seek_uint16(s); /* largePointerSupportFlags (2 bytes) */
+ stream_seek_UINT16(s); /* largePointerSupportFlags (2 bytes) */
}
/**
void rdp_write_large_pointer_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
- uint16 largePointerSupportFlags;
+ BYTE* header;
+ UINT16 largePointerSupportFlags;
header = rdp_capability_set_start(s);
largePointerSupportFlags = (settings->large_pointer) ? LARGE_POINTER_FLAG_96x96 : 0;
- stream_write_uint16(s, largePointerSupportFlags); /* largePointerSupportFlags (2 bytes) */
+ stream_write_UINT16(s, largePointerSupportFlags); /* largePointerSupportFlags (2 bytes) */
rdp_capability_set_finish(s, header, CAPSET_TYPE_LARGE_POINTER);
}
* @param settings settings
*/
-void rdp_read_surface_commands_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_surface_commands_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
stream_seek_uint32(s); /* cmdFlags (4 bytes) */
stream_seek_uint32(s); /* reserved (4 bytes) */
void rdp_write_surface_commands_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
uint32 cmdFlags;
header = rdp_capability_set_start(s);
* @param settings settings
*/
-void rdp_read_bitmap_codecs_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_bitmap_codecs_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
- uint8 bitmapCodecCount;
- uint16 codecPropertiesLength;
+ BYTE bitmapCodecCount;
+ UINT16 codecPropertiesLength;
- stream_read_uint8(s, bitmapCodecCount); /* bitmapCodecCount (1 byte) */
+ stream_read_BYTE(s, bitmapCodecCount); /* bitmapCodecCount (1 byte) */
if (settings->server_mode)
{
if (settings->server_mode && strncmp((char*)stream_get_tail(s), CODEC_GUID_REMOTEFX, 16) == 0)
{
stream_seek(s, 16); /* codecGUID (16 bytes) */
- stream_read_uint8(s, settings->rfx_codec_id);
+ stream_read_BYTE(s, settings->rfx_codec_id);
settings->rfx_codec = TRUE;
}
else if (settings->server_mode && strncmp((char*)stream_get_tail(s), CODEC_GUID_NSCODEC, 16) == 0)
{
stream_seek(s, 16); /*codec GUID (16 bytes) */
- stream_read_uint8(s, settings->ns_codec_id);
+ stream_read_BYTE(s, settings->ns_codec_id);
settings->ns_codec = TRUE;
}
else
{
stream_seek(s, 16); /* codecGUID (16 bytes) */
- stream_seek_uint8(s); /* codecID (1 byte) */
+ stream_seek_BYTE(s); /* codecID (1 byte) */
}
- stream_read_uint16(s, codecPropertiesLength); /* codecPropertiesLength (2 bytes) */
+ stream_read_UINT16(s, codecPropertiesLength); /* codecPropertiesLength (2 bytes) */
stream_seek(s, codecPropertiesLength); /* codecProperties */
bitmapCodecCount--;
void rdp_write_rfx_client_capability_container(STREAM* s, rdpSettings* settings)
{
uint32 captureFlags;
- uint8 codecMode;
+ BYTE codecMode;
captureFlags = settings->rfx_codec_only ? CARDP_CAPS_CAPTURE_NON_CAC : 0;
codecMode = settings->rfx_codec_mode;
- stream_write_uint16(s, 49); /* codecPropertiesLength */
+ stream_write_UINT16(s, 49); /* codecPropertiesLength */
/* TS_RFX_CLNT_CAPS_CONTAINER */
stream_write_uint32(s, 49); /* length */
stream_write_uint32(s, 37); /* capsLength */
/* TS_RFX_CAPS */
- stream_write_uint16(s, CBY_CAPS); /* blockType */
+ stream_write_UINT16(s, CBY_CAPS); /* blockType */
stream_write_uint32(s, 8); /* blockLen */
- stream_write_uint16(s, 1); /* numCapsets */
+ stream_write_UINT16(s, 1); /* numCapsets */
/* TS_RFX_CAPSET */
- stream_write_uint16(s, CBY_CAPSET); /* blockType */
+ stream_write_UINT16(s, CBY_CAPSET); /* blockType */
stream_write_uint32(s, 29); /* blockLen */
- stream_write_uint8(s, 0x01); /* codecId (MUST be set to 0x01) */
- stream_write_uint16(s, CLY_CAPSET); /* capsetType */
- stream_write_uint16(s, 2); /* numIcaps */
- stream_write_uint16(s, 8); /* icapLen */
+ stream_write_BYTE(s, 0x01); /* codecId (MUST be set to 0x01) */
+ stream_write_UINT16(s, CLY_CAPSET); /* capsetType */
+ stream_write_UINT16(s, 2); /* numIcaps */
+ stream_write_UINT16(s, 8); /* icapLen */
/* TS_RFX_ICAP (RLGR1) */
- stream_write_uint16(s, CLW_VERSION_1_0); /* version */
- stream_write_uint16(s, CT_TILE_64x64); /* tileSize */
- stream_write_uint8(s, codecMode); /* flags */
- stream_write_uint8(s, CLW_COL_CONV_ICT); /* colConvBits */
- stream_write_uint8(s, CLW_XFORM_DWT_53_A); /* transformBits */
- stream_write_uint8(s, CLW_ENTROPY_RLGR1); /* entropyBits */
+ stream_write_UINT16(s, CLW_VERSION_1_0); /* version */
+ stream_write_UINT16(s, CT_TILE_64x64); /* tileSize */
+ stream_write_BYTE(s, codecMode); /* flags */
+ stream_write_BYTE(s, CLW_COL_CONV_ICT); /* colConvBits */
+ stream_write_BYTE(s, CLW_XFORM_DWT_53_A); /* transformBits */
+ stream_write_BYTE(s, CLW_ENTROPY_RLGR1); /* entropyBits */
/* TS_RFX_ICAP (RLGR3) */
- stream_write_uint16(s, CLW_VERSION_1_0); /* version */
- stream_write_uint16(s, CT_TILE_64x64); /* tileSize */
- stream_write_uint8(s, codecMode); /* flags */
- stream_write_uint8(s, CLW_COL_CONV_ICT); /* colConvBits */
- stream_write_uint8(s, CLW_XFORM_DWT_53_A); /* transformBits */
- stream_write_uint8(s, CLW_ENTROPY_RLGR3); /* entropyBits */
+ stream_write_UINT16(s, CLW_VERSION_1_0); /* version */
+ stream_write_UINT16(s, CT_TILE_64x64); /* tileSize */
+ stream_write_BYTE(s, codecMode); /* flags */
+ stream_write_BYTE(s, CLW_COL_CONV_ICT); /* colConvBits */
+ stream_write_BYTE(s, CLW_XFORM_DWT_53_A); /* transformBits */
+ stream_write_BYTE(s, CLW_ENTROPY_RLGR3); /* entropyBits */
}
/**
*/
void rdp_write_nsc_client_capability_container(STREAM* s, rdpSettings* settings)
{
- stream_write_uint16(s, 3); /* codecPropertiesLength */
+ stream_write_UINT16(s, 3); /* codecPropertiesLength */
/* TS_NSCODEC_CAPABILITYSET */
- stream_write_uint8(s, 1); /* fAllowDynamicFidelity */
- stream_write_uint8(s, 1); /* fAllowSubsampling */
- stream_write_uint8(s, 3); /* colorLossLevel */
+ stream_write_BYTE(s, 1); /* fAllowDynamicFidelity */
+ stream_write_BYTE(s, 1); /* fAllowSubsampling */
+ stream_write_BYTE(s, 3); /* colorLossLevel */
}
void rdp_write_jpeg_client_capability_container(STREAM* s, rdpSettings* settings)
{
- stream_write_uint16(s, 1); /* codecPropertiesLength */
- stream_write_uint8(s, settings->jpeg_quality);
+ stream_write_UINT16(s, 1); /* codecPropertiesLength */
+ stream_write_BYTE(s, settings->jpeg_quality);
}
/**
*/
void rdp_write_rfx_server_capability_container(STREAM* s, rdpSettings* settings)
{
- stream_write_uint16(s, 4); /* codecPropertiesLength */
+ stream_write_UINT16(s, 4); /* codecPropertiesLength */
stream_write_uint32(s, 0); /* reserved */
}
void rdp_write_jpeg_server_capability_container(STREAM* s, rdpSettings* settings)
{
- stream_write_uint16(s, 1); /* codecPropertiesLength */
- stream_write_uint8(s, 75);
+ stream_write_UINT16(s, 1); /* codecPropertiesLength */
+ stream_write_BYTE(s, 75);
}
/**
*/
void rdp_write_nsc_server_capability_container(STREAM* s, rdpSettings* settings)
{
- stream_write_uint16(s, 4); /* codecPropertiesLength */
+ stream_write_UINT16(s, 4); /* codecPropertiesLength */
stream_write_uint32(s, 0); /* reserved */
}
void rdp_write_bitmap_codecs_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
- uint8 bitmapCodecCount;
+ BYTE* header;
+ BYTE bitmapCodecCount;
header = rdp_capability_set_start(s);
if (settings->jpeg_codec)
bitmapCodecCount++;
- stream_write_uint8(s, bitmapCodecCount);
+ stream_write_BYTE(s, bitmapCodecCount);
if (settings->rfx_codec)
{
if (settings->server_mode)
{
- stream_write_uint8(s, 0); /* codecID is defined by the client */
+ stream_write_BYTE(s, 0); /* codecID is defined by the client */
rdp_write_rfx_server_capability_container(s, settings);
}
else
{
- stream_write_uint8(s, CODEC_ID_REMOTEFX); /* codecID */
+ stream_write_BYTE(s, CODEC_ID_REMOTEFX); /* codecID */
rdp_write_rfx_client_capability_container(s, settings);
}
}
stream_write(s, CODEC_GUID_NSCODEC, 16);
if (settings->server_mode)
{
- stream_write_uint8(s, 0); /* codecID is defined by the client */
+ stream_write_BYTE(s, 0); /* codecID is defined by the client */
rdp_write_nsc_server_capability_container(s, settings);
}
else
{
- stream_write_uint8(s, CODEC_ID_NSCODEC); /* codecID */
+ stream_write_BYTE(s, CODEC_ID_NSCODEC); /* codecID */
rdp_write_nsc_client_capability_container(s, settings);
}
}
stream_write(s, CODEC_GUID_JPEG, 16);
if (settings->server_mode)
{
- stream_write_uint8(s, 0); /* codecID is defined by the client */
+ stream_write_BYTE(s, 0); /* codecID is defined by the client */
rdp_write_jpeg_server_capability_container(s, settings);
}
else
{
- stream_write_uint8(s, CODEC_ID_JPEG); /* codecID */
+ stream_write_BYTE(s, CODEC_ID_JPEG); /* codecID */
rdp_write_jpeg_client_capability_container(s, settings);
}
}
* @param settings settings
*/
-void rdp_read_frame_acknowledge_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_frame_acknowledge_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
if (settings->server_mode)
{
}
}
-void rdp_read_bitmap_cache_v3_codec_id_capability_set(STREAM* s, uint16 length, rdpSettings* settings)
+void rdp_read_bitmap_cache_v3_codec_id_capability_set(STREAM* s, UINT16 length, rdpSettings* settings)
{
- stream_seek_uint8(s); /* (1 byte) */
+ stream_seek_BYTE(s); /* (1 byte) */
}
void rdp_write_bitmap_cache_v3_codec_id_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
header = rdp_capability_set_start(s);
- stream_write_uint8(s, settings->v3_codec_id);
+ stream_write_BYTE(s, settings->v3_codec_id);
rdp_capability_set_finish(s, header, 6);
}
void rdp_write_frame_acknowledge_capability_set(STREAM* s, rdpSettings* settings)
{
- uint8* header;
+ BYTE* header;
uint32 frame_acknowledge;
header = rdp_capability_set_start(s);
rdp_capability_set_finish(s, header, CAPSET_TYPE_FRAME_ACKNOWLEDGE);
}
-BOOL rdp_read_capability_sets(STREAM* s, rdpSettings* settings, uint16 numberCapabilities)
+BOOL rdp_read_capability_sets(STREAM* s, rdpSettings* settings, UINT16 numberCapabilities)
{
- uint16 type;
- uint16 length;
- uint8 *bm, *em;
+ UINT16 type;
+ UINT16 length;
+ BYTE *bm, *em;
while (numberCapabilities > 0)
{
BOOL rdp_recv_demand_active(rdpRdp* rdp, STREAM* s)
{
- uint16 length;
- uint16 channelId;
- uint16 pduType;
- uint16 pduLength;
- uint16 pduSource;
- uint16 numberCapabilities;
- uint16 lengthSourceDescriptor;
- uint16 lengthCombinedCapabilities;
- uint16 securityFlags;
+ UINT16 length;
+ UINT16 channelId;
+ UINT16 pduType;
+ UINT16 pduLength;
+ UINT16 pduSource;
+ UINT16 numberCapabilities;
+ UINT16 lengthSourceDescriptor;
+ UINT16 lengthCombinedCapabilities;
+ UINT16 securityFlags;
if (!rdp_read_header(rdp, s, &length, &channelId))
return FALSE;
}
stream_read_uint32(s, rdp->settings->share_id); /* shareId (4 bytes) */
- stream_read_uint16(s, lengthSourceDescriptor); /* lengthSourceDescriptor (2 bytes) */
- stream_read_uint16(s, lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */
+ stream_read_UINT16(s, lengthSourceDescriptor); /* lengthSourceDescriptor (2 bytes) */
+ stream_read_UINT16(s, lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */
stream_seek(s, lengthSourceDescriptor); /* sourceDescriptor */
- stream_read_uint16(s, numberCapabilities); /* numberCapabilities (2 bytes) */
+ stream_read_UINT16(s, numberCapabilities); /* numberCapabilities (2 bytes) */
stream_seek(s, 2); /* pad2Octets (2 bytes) */
/* capabilitySets */
void rdp_write_demand_active(STREAM* s, rdpSettings* settings)
{
- uint8 *bm, *em, *lm;
- uint16 numberCapabilities;
- uint16 lengthCombinedCapabilities;
+ BYTE *bm, *em, *lm;
+ UINT16 numberCapabilities;
+ UINT16 lengthCombinedCapabilities;
stream_write_uint32(s, settings->share_id); /* shareId (4 bytes) */
- stream_write_uint16(s, 4); /* lengthSourceDescriptor (2 bytes) */
+ stream_write_UINT16(s, 4); /* lengthSourceDescriptor (2 bytes) */
stream_get_mark(s, lm);
- stream_seek_uint16(s); /* lengthCombinedCapabilities (2 bytes) */
+ stream_seek_UINT16(s); /* lengthCombinedCapabilities (2 bytes) */
stream_write(s, "RDP", 4); /* sourceDescriptor */
stream_get_mark(s, bm);
- stream_seek_uint16(s); /* numberCapabilities (2 bytes) */
- stream_write_uint16(s, 0); /* pad2Octets (2 bytes) */
+ stream_seek_UINT16(s); /* numberCapabilities (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2Octets (2 bytes) */
numberCapabilities = 14;
rdp_write_general_capability_set(s, settings);
stream_set_mark(s, lm); /* go back to lengthCombinedCapabilities */
lengthCombinedCapabilities = (em - bm);
- stream_write_uint16(s, lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */
+ stream_write_UINT16(s, lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */
stream_set_mark(s, bm); /* go back to numberCapabilities */
- stream_write_uint16(s, numberCapabilities); /* numberCapabilities (2 bytes) */
+ stream_write_UINT16(s, numberCapabilities); /* numberCapabilities (2 bytes) */
stream_set_mark(s, em);
BOOL rdp_recv_confirm_active(rdpRdp* rdp, STREAM* s)
{
- uint16 length;
- uint16 channelId;
- uint16 pduType;
- uint16 pduLength;
- uint16 pduSource;
- uint16 lengthSourceDescriptor;
- uint16 lengthCombinedCapabilities;
- uint16 numberCapabilities;
- uint16 securityFlags;
+ UINT16 length;
+ UINT16 channelId;
+ UINT16 pduType;
+ UINT16 pduLength;
+ UINT16 pduSource;
+ UINT16 lengthSourceDescriptor;
+ UINT16 lengthCombinedCapabilities;
+ UINT16 numberCapabilities;
+ UINT16 securityFlags;
if (!rdp_read_header(rdp, s, &length, &channelId))
return FALSE;
return FALSE;
stream_seek_uint32(s); /* shareId (4 bytes) */
- stream_seek_uint16(s); /* originatorId (2 bytes) */
- stream_read_uint16(s, lengthSourceDescriptor); /* lengthSourceDescriptor (2 bytes) */
- stream_read_uint16(s, lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */
+ stream_seek_UINT16(s); /* originatorId (2 bytes) */
+ stream_read_UINT16(s, lengthSourceDescriptor); /* lengthSourceDescriptor (2 bytes) */
+ stream_read_UINT16(s, lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */
stream_seek(s, lengthSourceDescriptor); /* sourceDescriptor */
- stream_read_uint16(s, numberCapabilities); /* numberCapabilities (2 bytes) */
+ stream_read_UINT16(s, numberCapabilities); /* numberCapabilities (2 bytes) */
stream_seek(s, 2); /* pad2Octets (2 bytes) */
if (!rdp_read_capability_sets(s, rdp->settings, numberCapabilities))
void rdp_write_confirm_active(STREAM* s, rdpSettings* settings)
{
- uint8 *bm, *em, *lm;
- uint16 numberCapabilities;
- uint16 lengthSourceDescriptor;
- uint16 lengthCombinedCapabilities;
+ BYTE *bm, *em, *lm;
+ UINT16 numberCapabilities;
+ UINT16 lengthSourceDescriptor;
+ UINT16 lengthCombinedCapabilities;
lengthSourceDescriptor = sizeof(SOURCE_DESCRIPTOR);
stream_write_uint32(s, settings->share_id); /* shareId (4 bytes) */
- stream_write_uint16(s, 0x03EA); /* originatorId (2 bytes) */
- stream_write_uint16(s, lengthSourceDescriptor);/* lengthSourceDescriptor (2 bytes) */
+ stream_write_UINT16(s, 0x03EA); /* originatorId (2 bytes) */
+ stream_write_UINT16(s, lengthSourceDescriptor);/* lengthSourceDescriptor (2 bytes) */
stream_get_mark(s, lm);
- stream_seek_uint16(s); /* lengthCombinedCapabilities (2 bytes) */
+ stream_seek_UINT16(s); /* lengthCombinedCapabilities (2 bytes) */
stream_write(s, SOURCE_DESCRIPTOR, lengthSourceDescriptor); /* sourceDescriptor */
stream_get_mark(s, bm);
- stream_seek_uint16(s); /* numberCapabilities (2 bytes) */
- stream_write_uint16(s, 0); /* pad2Octets (2 bytes) */
+ stream_seek_UINT16(s); /* numberCapabilities (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2Octets (2 bytes) */
/* Capability Sets */
numberCapabilities = 15;
stream_set_mark(s, lm); /* go back to lengthCombinedCapabilities */
lengthCombinedCapabilities = (em - bm);
- stream_write_uint16(s, lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */
+ stream_write_UINT16(s, lengthCombinedCapabilities); /* lengthCombinedCapabilities (2 bytes) */
stream_set_mark(s, bm); /* go back to numberCapabilities */
- stream_write_uint16(s, numberCapabilities); /* numberCapabilities (2 bytes) */
+ stream_write_UINT16(s, numberCapabilities); /* numberCapabilities (2 bytes) */
stream_set_mark(s, em);
}
{
STREAM* s;
int length;
- uint8 padding;
+ BYTE padding;
uint32 version;
int modulus_length;
int exponent_length;
/* skip zero padding, if any */
do
{
- stream_peek_uint8(s, padding);
+ stream_peek_BYTE(s, padding);
if (padding == 0)
{
static BOOL certificate_process_server_public_key(rdpCertificate* certificate, STREAM* s, uint32 length)
{
- uint8 magic[4];
+ BYTE magic[4];
uint32 keylen;
uint32 bitlen;
uint32 datalen;
return TRUE;
}
-static BOOL certificate_process_server_public_signature(rdpCertificate* certificate, uint8* sigdata, int sigdatalen, STREAM* s, uint32 siglen)
+static BOOL certificate_process_server_public_signature(rdpCertificate* certificate, BYTE* sigdata, int sigdatalen, STREAM* s, uint32 siglen)
{
int i, sum;
CryptoMd5 md5ctx;
- uint8 sig[TSSK_KEY_LENGTH];
- uint8 encsig[TSSK_KEY_LENGTH + 8];
- uint8 md5hash[CRYPTO_MD5_DIGEST_LENGTH];
+ BYTE sig[TSSK_KEY_LENGTH];
+ BYTE encsig[TSSK_KEY_LENGTH + 8];
+ BYTE md5hash[CRYPTO_MD5_DIGEST_LENGTH];
md5ctx = crypto_md5_init();
crypto_md5_update(md5ctx, sigdata, sigdatalen);
uint32 wPublicKeyBlobLen;
uint32 wSignatureBlobType;
uint32 wSignatureBlobLen;
- uint8* sigdata;
+ BYTE* sigdata;
int sigdatalen;
/* -4, because we need to include dwVersion */
return FALSE;
}
- stream_read_uint16(s, wPublicKeyBlobType);
+ stream_read_UINT16(s, wPublicKeyBlobType);
if (wPublicKeyBlobType != BB_RSA_KEY_BLOB)
{
return FALSE;
}
- stream_read_uint16(s, wPublicKeyBlobLen);
+ stream_read_UINT16(s, wPublicKeyBlobLen);
if (!certificate_process_server_public_key(certificate, s, wPublicKeyBlobLen))
{
}
sigdatalen = stream_get_tail(s) - sigdata;
- stream_read_uint16(s, wSignatureBlobType);
+ stream_read_UINT16(s, wSignatureBlobType);
if (wSignatureBlobType != BB_RSA_SIGNATURE_BLOB)
{
return FALSE;
}
- stream_read_uint16(s, wSignatureBlobLen);
+ stream_read_UINT16(s, wSignatureBlobLen);
if (wSignatureBlobLen != 72)
{
DEBUG_CERTIFICATE("\nX.509 Certificate #%d, length:%d", i + 1, certLength);
- certificate->x509_cert_chain->array[i].data = (uint8*) malloc(certLength);
+ certificate->x509_cert_chain->array[i].data = (BYTE*) malloc(certLength);
stream_read(s, certificate->x509_cert_chain->array[i].data, certLength);
certificate->x509_cert_chain->array[i].length = certLength;
* @param length certificate length
*/
-BOOL certificate_read_server_certificate(rdpCertificate* certificate, uint8* server_cert, int length)
+BOOL certificate_read_server_certificate(rdpCertificate* certificate, BYTE* server_cert, int length)
{
STREAM* s;
uint32 dwVersion;
BOOL certificate_read_server_proprietary_certificate(rdpCertificate* certificate, STREAM* s);
BOOL certificate_read_server_x509_certificate_chain(rdpCertificate* certificate, STREAM* s);
-BOOL certificate_read_server_certificate(rdpCertificate* certificate, uint8* server_cert, int length);
+BOOL certificate_read_server_certificate(rdpCertificate* certificate, BYTE* server_cert, int length);
rdpCertificate* certificate_new();
void certificate_free(rdpCertificate* certificate);
#include "rdp.h"
#include "channel.h"
-BOOL freerdp_channel_send(rdpRdp* rdp, uint16 channel_id, uint8* data, int size)
+BOOL freerdp_channel_send(rdpRdp* rdp, UINT16 channel_id, BYTE* data, int size)
{
STREAM* s;
uint32 flags;
return TRUE;
}
-void freerdp_channel_process(freerdp* instance, STREAM* s, uint16 channel_id)
+void freerdp_channel_process(freerdp* instance, STREAM* s, UINT16 channel_id)
{
uint32 length;
uint32 flags;
channel_id, stream_get_tail(s), chunk_length, flags, length);
}
-void freerdp_channel_peer_process(freerdp_peer* client, STREAM* s, uint16 channel_id)
+void freerdp_channel_peer_process(freerdp_peer* client, STREAM* s, UINT16 channel_id)
{
uint32 length;
uint32 flags;
#ifndef __CHANNEL_H
#define __CHANNEL_H
-BOOL freerdp_channel_send(rdpRdp* rdp, uint16 channel_id, uint8* data, int size);
-void freerdp_channel_process(freerdp* instance, STREAM* s, uint16 channel_id);
-void freerdp_channel_peer_process(freerdp_peer* client, STREAM* s, uint16 channel_id);
+BOOL freerdp_channel_send(rdpRdp* rdp, UINT16 channel_id, BYTE* data, int size);
+void freerdp_channel_process(freerdp* instance, STREAM* s, UINT16 channel_id);
+void freerdp_channel_peer_process(freerdp_peer* client, STREAM* s, UINT16 channel_id);
#endif /* __CHANNEL_H */
static BOOL rdp_client_establish_keys(rdpRdp* rdp)
{
- uint8 client_random[CLIENT_RANDOM_LENGTH];
- uint8 crypt_client_random[256 + 8];
+ BYTE client_random[CLIENT_RANDOM_LENGTH];
+ BYTE crypt_client_random[256 + 8];
uint32 key_len;
- uint8* mod;
- uint8* exp;
+ BYTE* mod;
+ BYTE* exp;
uint32 length;
STREAM* s;
if (rdp->settings->encryption_method == ENCRYPTION_METHOD_FIPS)
{
- uint8 fips_ivec[8] = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
+ BYTE fips_ivec[8] = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
rdp->fips_encrypt = crypto_des3_encrypt_init(rdp->fips_encrypt_key, fips_ivec);
rdp->fips_decrypt = crypto_des3_decrypt_init(rdp->fips_decrypt_key, fips_ivec);
static BOOL rdp_server_establish_keys(rdpRdp* rdp, STREAM* s)
{
- uint8 client_random[64]; /* Should be only 32 after successful decryption, but on failure might take up to 64 bytes. */
- uint8 crypt_client_random[256 + 8];
+ BYTE client_random[64]; /* Should be only 32 after successful decryption, but on failure might take up to 64 bytes. */
+ BYTE crypt_client_random[256 + 8];
uint32 rand_len, key_len;
- uint16 channel_id, length, sec_flags;
- uint8* mod;
- uint8* priv_exp;
+ UINT16 channel_id, length, sec_flags;
+ BYTE* mod;
+ BYTE* priv_exp;
if (rdp->settings->encryption == FALSE)
{
if (rdp->settings->encryption_method == ENCRYPTION_METHOD_FIPS)
{
- uint8 fips_ivec[8] = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
+ BYTE fips_ivec[8] = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF };
rdp->fips_encrypt = crypto_des3_encrypt_init(rdp->fips_encrypt_key, fips_ivec);
rdp->fips_decrypt = crypto_des3_decrypt_init(rdp->fips_decrypt_key, fips_ivec);
BOOL rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp, STREAM* s)
{
int i;
- uint16 channel_id;
+ UINT16 channel_id;
BOOL all_joined = TRUE;
if (!mcs_recv_channel_join_confirm(rdp->mcs, s, &channel_id))
BOOL rdp_client_connect_demand_active(rdpRdp* rdp, STREAM* s)
{
- uint8* mark;
- uint16 width;
- uint16 height;
+ BYTE* mark;
+ UINT16 width;
+ UINT16 height;
width = rdp->settings->width;
height = rdp->settings->height;
BOOL rdp_server_accept_mcs_channel_join_request(rdpRdp* rdp, STREAM* s)
{
int i;
- uint16 channel_id;
+ UINT16 channel_id;
BOOL all_joined = TRUE;
if (!mcs_recv_channel_join_request(rdp->mcs, s, &channel_id))
* This function assumes that at least two bytes are available in the stream
* and doesn't touch third byte.
*/
-uint16 fastpath_header_length(STREAM* s)
+UINT16 fastpath_header_length(STREAM* s)
{
- uint8 length1;
+ BYTE length1;
- stream_seek_uint8(s);
- stream_read_uint8(s, length1);
+ stream_seek_BYTE(s);
+ stream_read_BYTE(s, length1);
stream_rewind(s, 2);
return ((length1 & 0x80) != 0 ? 3 : 2);
* @param encryptionFlags
* @return length
*/
-uint16 fastpath_read_header(rdpFastPath* fastpath, STREAM* s)
+UINT16 fastpath_read_header(rdpFastPath* fastpath, STREAM* s)
{
- uint8 header;
- uint16 length;
+ BYTE header;
+ UINT16 length;
- stream_read_uint8(s, header);
+ stream_read_BYTE(s, header);
if (fastpath != NULL)
{
return length;
}
-static INLINE void fastpath_read_update_header(STREAM* s, uint8* updateCode, uint8* fragmentation, uint8* compression)
+static INLINE void fastpath_read_update_header(STREAM* s, BYTE* updateCode, BYTE* fragmentation, BYTE* compression)
{
- uint8 updateHeader;
+ BYTE updateHeader;
- stream_read_uint8(s, updateHeader);
+ stream_read_BYTE(s, updateHeader);
*updateCode = updateHeader & 0x0F;
*fragmentation = (updateHeader >> 4) & 0x03;
*compression = (updateHeader >> 6) & 0x03;
}
-static INLINE void fastpath_write_update_header(STREAM* s, uint8 updateCode, uint8 fragmentation, uint8 compression)
+static INLINE void fastpath_write_update_header(STREAM* s, BYTE updateCode, BYTE fragmentation, BYTE compression)
{
- uint8 updateHeader = 0;
+ BYTE updateHeader = 0;
updateHeader |= updateCode & 0x0F;
updateHeader |= (fragmentation & 0x03) << 4;
updateHeader |= (compression & 0x03) << 6;
- stream_write_uint8(s, updateHeader);
+ stream_write_BYTE(s, updateHeader);
}
-uint16 fastpath_read_header_rdp(rdpFastPath* fastpath, STREAM* s)
+UINT16 fastpath_read_header_rdp(rdpFastPath* fastpath, STREAM* s)
{
- uint8 header;
- uint16 length;
+ BYTE header;
+ UINT16 length;
- stream_read_uint8(s, header);
+ stream_read_BYTE(s, header);
if (fastpath != NULL)
{
static BOOL fastpath_recv_orders(rdpFastPath* fastpath, STREAM* s)
{
rdpUpdate* update = fastpath->rdp->update;
- uint16 numberOrders;
+ UINT16 numberOrders;
- stream_read_uint16(s, numberOrders); /* numberOrders (2 bytes) */
+ stream_read_UINT16(s, numberOrders); /* numberOrders (2 bytes) */
while (numberOrders > 0)
{
static void fastpath_recv_update_common(rdpFastPath* fastpath, STREAM* s)
{
- uint16 updateType;
+ UINT16 updateType;
rdpUpdate* update = fastpath->rdp->update;
rdpContext* context = update->context;
- stream_read_uint16(s, updateType); /* updateType (2 bytes) */
+ stream_read_UINT16(s, updateType); /* updateType (2 bytes) */
switch (updateType)
{
static void fastpath_recv_update_synchronize(rdpFastPath* fastpath, STREAM* s)
{
- stream_seek_uint16(s); /* size (2 bytes), must be set to zero */
+ stream_seek_UINT16(s); /* size (2 bytes), must be set to zero */
}
-static BOOL fastpath_recv_update(rdpFastPath* fastpath, uint8 updateCode, uint32 size, STREAM* s)
+static BOOL fastpath_recv_update(rdpFastPath* fastpath, BYTE updateCode, uint32 size, STREAM* s)
{
rdpUpdate* update = fastpath->rdp->update;
rdpContext* context = fastpath->rdp->update->context;
static BOOL fastpath_recv_update_data(rdpFastPath* fastpath, STREAM* s)
{
- uint16 size;
+ UINT16 size;
int next_pos;
uint32 totalSize;
- uint8 updateCode;
- uint8 fragmentation;
- uint8 compression;
- uint8 compressionFlags;
+ BYTE updateCode;
+ BYTE fragmentation;
+ BYTE compression;
+ BYTE compressionFlags;
STREAM* update_stream;
STREAM* comp_stream;
rdpRdp *rdp;
fastpath_read_update_header(s, &updateCode, &fragmentation, &compression);
if (compression == FASTPATH_OUTPUT_COMPRESSION_USED)
- stream_read_uint8(s, compressionFlags);
+ stream_read_BYTE(s, compressionFlags);
else
compressionFlags = 0;
- stream_read_uint16(s, size);
+ stream_read_UINT16(s, size);
next_pos = stream_get_pos(s) + size;
comp_stream = s;
return TRUE;
}
-static BOOL fastpath_read_input_event_header(STREAM* s, uint8* eventFlags, uint8* eventCode)
+static BOOL fastpath_read_input_event_header(STREAM* s, BYTE* eventFlags, BYTE* eventCode)
{
- uint8 eventHeader;
+ BYTE eventHeader;
if (stream_get_left(s) < 1)
return FALSE;
- stream_read_uint8(s, eventHeader); /* eventHeader (1 byte) */
+ stream_read_BYTE(s, eventHeader); /* eventHeader (1 byte) */
*eventFlags = (eventHeader & 0x1F);
*eventCode = (eventHeader >> 5);
return TRUE;
}
-static BOOL fastpath_recv_input_event_scancode(rdpFastPath* fastpath, STREAM* s, uint8 eventFlags)
+static BOOL fastpath_recv_input_event_scancode(rdpFastPath* fastpath, STREAM* s, BYTE eventFlags)
{
- uint16 flags;
- uint16 code;
+ UINT16 flags;
+ UINT16 code;
if (stream_get_left(s) < 1)
return FALSE;
- stream_read_uint8(s, code); /* keyCode (1 byte) */
+ stream_read_BYTE(s, code); /* keyCode (1 byte) */
flags = 0;
if ((eventFlags & FASTPATH_INPUT_KBDFLAGS_RELEASE))
return TRUE;
}
-static BOOL fastpath_recv_input_event_mouse(rdpFastPath* fastpath, STREAM* s, uint8 eventFlags)
+static BOOL fastpath_recv_input_event_mouse(rdpFastPath* fastpath, STREAM* s, BYTE eventFlags)
{
- uint16 pointerFlags;
- uint16 xPos;
- uint16 yPos;
+ UINT16 pointerFlags;
+ UINT16 xPos;
+ UINT16 yPos;
if (stream_get_left(s) < 6)
return FALSE;
- stream_read_uint16(s, pointerFlags); /* pointerFlags (2 bytes) */
- stream_read_uint16(s, xPos); /* xPos (2 bytes) */
- stream_read_uint16(s, yPos); /* yPos (2 bytes) */
+ stream_read_UINT16(s, pointerFlags); /* pointerFlags (2 bytes) */
+ stream_read_UINT16(s, xPos); /* xPos (2 bytes) */
+ stream_read_UINT16(s, yPos); /* yPos (2 bytes) */
IFCALL(fastpath->rdp->input->MouseEvent, fastpath->rdp->input, pointerFlags, xPos, yPos);
return TRUE;
}
-static BOOL fastpath_recv_input_event_mousex(rdpFastPath* fastpath, STREAM* s, uint8 eventFlags)
+static BOOL fastpath_recv_input_event_mousex(rdpFastPath* fastpath, STREAM* s, BYTE eventFlags)
{
- uint16 pointerFlags;
- uint16 xPos;
- uint16 yPos;
+ UINT16 pointerFlags;
+ UINT16 xPos;
+ UINT16 yPos;
if (stream_get_left(s) < 6)
return FALSE;
- stream_read_uint16(s, pointerFlags); /* pointerFlags (2 bytes) */
- stream_read_uint16(s, xPos); /* xPos (2 bytes) */
- stream_read_uint16(s, yPos); /* yPos (2 bytes) */
+ stream_read_UINT16(s, pointerFlags); /* pointerFlags (2 bytes) */
+ stream_read_UINT16(s, xPos); /* xPos (2 bytes) */
+ stream_read_UINT16(s, yPos); /* yPos (2 bytes) */
IFCALL(fastpath->rdp->input->ExtendedMouseEvent, fastpath->rdp->input, pointerFlags, xPos, yPos);
return TRUE;
}
-static BOOL fastpath_recv_input_event_sync(rdpFastPath* fastpath, STREAM* s, uint8 eventFlags)
+static BOOL fastpath_recv_input_event_sync(rdpFastPath* fastpath, STREAM* s, BYTE eventFlags)
{
IFCALL(fastpath->rdp->input->SynchronizeEvent, fastpath->rdp->input, eventFlags);
return TRUE;
}
-static BOOL fastpath_recv_input_event_unicode(rdpFastPath* fastpath, STREAM* s, uint8 eventFlags)
+static BOOL fastpath_recv_input_event_unicode(rdpFastPath* fastpath, STREAM* s, BYTE eventFlags)
{
- uint16 unicodeCode;
- uint16 flags;
+ UINT16 unicodeCode;
+ UINT16 flags;
if (stream_get_left(s) < 2)
return FALSE;
- stream_read_uint16(s, unicodeCode); /* unicodeCode (2 bytes) */
+ stream_read_UINT16(s, unicodeCode); /* unicodeCode (2 bytes) */
flags = 0;
if ((eventFlags & FASTPATH_INPUT_KBDFLAGS_RELEASE))
static BOOL fastpath_recv_input_event(rdpFastPath* fastpath, STREAM* s)
{
- uint8 eventFlags;
- uint8 eventCode;
+ BYTE eventFlags;
+ BYTE eventCode;
if (!fastpath_read_input_event_header(s, &eventFlags, &eventCode))
return FALSE;
BOOL fastpath_recv_inputs(rdpFastPath* fastpath, STREAM* s)
{
- uint8 i;
+ BYTE i;
if (fastpath->numberEvents == 0)
{
if (stream_get_left(s) < 1)
return FALSE;
- stream_read_uint8(s, fastpath->numberEvents); /* eventHeader (1 byte) */
+ stream_read_BYTE(s, fastpath->numberEvents); /* eventHeader (1 byte) */
}
for (i = 0; i < fastpath->numberEvents; i++)
return sec_bytes;
}
-STREAM* fastpath_input_pdu_init(rdpFastPath* fastpath, uint8 eventFlags, uint8 eventCode)
+STREAM* fastpath_input_pdu_init(rdpFastPath* fastpath, BYTE eventFlags, BYTE eventCode)
{
rdpRdp *rdp;
STREAM* s;
rdp->sec_flags |= SEC_SECURE_CHECKSUM;
}
stream_seek(s, fastpath_get_sec_bytes(rdp));
- stream_write_uint8(s, eventFlags | (eventCode << 5)); /* eventHeader (1 byte) */
+ stream_write_BYTE(s, eventFlags | (eventCode << 5)); /* eventHeader (1 byte) */
return s;
}
BOOL fastpath_send_input_pdu(rdpFastPath* fastpath, STREAM* s)
{
rdpRdp *rdp;
- uint16 length;
- uint8 eventHeader;
+ UINT16 length;
+ BYTE eventHeader;
int sec_bytes;
rdp = fastpath->rdp;
eventHeader |= (FASTPATH_INPUT_SECURE_CHECKSUM << 6);
stream_set_pos(s, 0);
- stream_write_uint8(s, eventHeader);
+ stream_write_BYTE(s, eventHeader);
sec_bytes = fastpath_get_sec_bytes(fastpath->rdp);
/*
* We always encode length in two bytes, eventhough we could use
* because we can leave room for fixed-length header, store all
* the data first and then store the header.
*/
- stream_write_uint16_be(s, 0x8000 | length);
+ stream_write_UINT16_be(s, 0x8000 | length);
if (sec_bytes > 0)
{
- uint8* fpInputEvents;
- uint16 fpInputEvents_length;
+ BYTE* fpInputEvents;
+ UINT16 fpInputEvents_length;
fpInputEvents = stream_get_tail(s) + sec_bytes;
fpInputEvents_length = length - 3 - sec_bytes;
return s;
}
-BOOL fastpath_send_update_pdu(rdpFastPath* fastpath, uint8 updateCode, STREAM* s)
+BOOL fastpath_send_update_pdu(rdpFastPath* fastpath, BYTE updateCode, STREAM* s)
{
rdpRdp* rdp;
- uint8* bm;
- uint8* ptr_to_crypt;
- uint8* ptr_sig;
- uint8* holdp;
+ BYTE* bm;
+ BYTE* ptr_to_crypt;
+ BYTE* ptr_sig;
+ BYTE* holdp;
int fragment;
int sec_bytes;
int try_comp;
int dlen;
int bytes_to_crypt;
BOOL result;
- uint16 pduLength;
- uint16 maxLength;
+ UINT16 pduLength;
+ UINT16 maxLength;
uint32 totalLength;
- uint8 fragmentation;
- uint8 header;
+ BYTE fragmentation;
+ BYTE header;
STREAM* update;
STREAM* comp_update;
STREAM* ls;
pdu_data_bytes = rdp->mppc_enc->bytes_in_opb;
comp_flags = FASTPATH_OUTPUT_COMPRESSION_USED;
header_bytes = 7 + sec_bytes;
- bm = (uint8*) (rdp->mppc_enc->outputBuffer - header_bytes);
+ bm = (BYTE*) (rdp->mppc_enc->outputBuffer - header_bytes);
stream_attach(comp_update, bm, pdu_data_bytes + header_bytes);
ls = comp_update;
}
header = 0;
if (sec_bytes > 0)
header |= (FASTPATH_OUTPUT_ENCRYPTED << 6);
- stream_write_uint8(ls, header); /* fpOutputHeader (1 byte) */
- stream_write_uint8(ls, 0x80 | (pduLength >> 8)); /* length1 */
- stream_write_uint8(ls, pduLength & 0xFF); /* length2 */
+ stream_write_BYTE(ls, header); /* fpOutputHeader (1 byte) */
+ stream_write_BYTE(ls, 0x80 | (pduLength >> 8)); /* length1 */
+ stream_write_BYTE(ls, pduLength & 0xFF); /* length2 */
if (sec_bytes > 0)
stream_seek(ls, sec_bytes);
/* extra byte if compressed */
if (ls == comp_update)
{
- stream_write_uint8(ls, cflags);
+ stream_write_BYTE(ls, cflags);
bytes_to_crypt = pdu_data_bytes + 4;
}
else
bytes_to_crypt = pdu_data_bytes + 3;
- stream_write_uint16(ls, pdu_data_bytes);
+ stream_write_UINT16(ls, pdu_data_bytes);
stream_attach(update, bm, pduLength);
stream_seek(update, pduLength);
struct rdp_fastpath
{
rdpRdp* rdp;
- uint8 encryptionFlags;
- uint8 numberEvents;
+ BYTE encryptionFlags;
+ BYTE numberEvents;
STREAM* updateData;
};
-uint16 fastpath_header_length(STREAM* s);
-uint16 fastpath_read_header(rdpFastPath* fastpath, STREAM* s);
-uint16 fastpath_read_header_rdp(rdpFastPath* fastpath, STREAM* s);
+UINT16 fastpath_header_length(STREAM* s);
+UINT16 fastpath_read_header(rdpFastPath* fastpath, STREAM* s);
+UINT16 fastpath_read_header_rdp(rdpFastPath* fastpath, STREAM* s);
BOOL fastpath_recv_updates(rdpFastPath* fastpath, STREAM* s);
BOOL fastpath_recv_inputs(rdpFastPath* fastpath, STREAM* s);
-STREAM* fastpath_input_pdu_init(rdpFastPath* fastpath, uint8 eventFlags, uint8 eventCode);
+STREAM* fastpath_input_pdu_init(rdpFastPath* fastpath, BYTE eventFlags, BYTE eventCode);
BOOL fastpath_send_input_pdu(rdpFastPath* fastpath, STREAM* s);
STREAM* fastpath_update_pdu_init(rdpFastPath* fastpath);
-BOOL fastpath_send_update_pdu(rdpFastPath* fastpath, uint8 updateCode, STREAM* s);
+BOOL fastpath_send_update_pdu(rdpFastPath* fastpath, BYTE updateCode, STREAM* s);
-BOOL fastpath_send_surfcmd_frame_marker(rdpFastPath* fastpath, uint16 frameAction, uint32 frameId);
+BOOL fastpath_send_surfcmd_frame_marker(rdpFastPath* fastpath, UINT16 frameAction, uint32 frameId);
rdpFastPath* fastpath_new(rdpRdp* rdp);
void fastpath_free(rdpFastPath* fastpath);
{
pcap_get_next_record_header(update->pcap_rfx, &record);
- s->data = (uint8*) realloc(s->data, record.length);
+ s->data = (BYTE*) realloc(s->data, record.length);
record.data = s->data;
s->size = record.length;
return TRUE;
}
-static int freerdp_send_channel_data(freerdp* instance, int channel_id, uint8* data, int size)
+static int freerdp_send_channel_data(freerdp* instance, int channel_id, BYTE* data, int size)
{
return rdp_send_channel_data(instance->context->rdp, channel_id, data, size);
}
* { itu-t(0) recommendation(0) t(20) t124(124) version(0) 1 }
* v.1 of ITU-T Recommendation T.124 (Feb 1998): "Generic Conference Control"
*/
-uint8 t124_02_98_oid[6] = { 0, 0, 20, 124, 0, 1 };
+BYTE t124_02_98_oid[6] = { 0, 0, 20, 124, 0, 1 };
-uint8 h221_cs_key[4] = "Duca";
-uint8 h221_sc_key[4] = "McDn";
+BYTE h221_cs_key[4] = "Duca";
+BYTE h221_sc_key[4] = "McDn";
/**
* Read a GCC Conference Create Request.\n
BOOL gcc_read_conference_create_request(STREAM* s, rdpSettings* settings)
{
- uint16 length;
- uint8 choice;
- uint8 number;
- uint8 selection;
+ UINT16 length;
+ BYTE choice;
+ BYTE number;
+ BYTE selection;
/* ConnectData */
if (!per_read_choice(s, &choice))
per_write_selection(s, 0x08); /* select optional userData from ConferenceCreateRequest */
/* ConferenceCreateRequest::conferenceName */
- per_write_numeric_string(s, (uint8*)"1", 1, 1); /* ConferenceName::numeric */
+ per_write_numeric_string(s, (BYTE*)"1", 1, 1); /* ConferenceName::numeric */
per_write_padding(s, 1); /* padding */
/* UserData (SET OF SEQUENCE) */
BOOL gcc_read_conference_create_response(STREAM* s, rdpSettings* settings)
{
- uint16 length;
+ UINT16 length;
uint32 tag;
- uint16 nodeID;
- uint8 result;
- uint8 choice;
- uint8 number;
+ UINT16 nodeID;
+ BYTE result;
+ BYTE choice;
+ BYTE number;
/* ConnectData */
per_read_choice(s, &choice);
BOOL gcc_read_client_data_blocks(STREAM* s, rdpSettings* settings, int length)
{
- uint16 type;
- uint16 blockLength;
+ UINT16 type;
+ UINT16 blockLength;
int pos;
while (length > 0)
BOOL gcc_read_server_data_blocks(STREAM* s, rdpSettings* settings, int length)
{
- uint16 type;
- uint16 offset = 0;
- uint16 blockLength;
- uint8* holdp;
+ UINT16 type;
+ UINT16 offset = 0;
+ UINT16 blockLength;
+ BYTE* holdp;
while (offset < length)
{
gcc_write_server_security_data(s, settings);
}
-BOOL gcc_read_user_data_header(STREAM* s, uint16* type, uint16* length)
+BOOL gcc_read_user_data_header(STREAM* s, UINT16* type, UINT16* length)
{
- stream_read_uint16(s, *type); /* type */
- stream_read_uint16(s, *length); /* length */
+ stream_read_UINT16(s, *type); /* type */
+ stream_read_UINT16(s, *length); /* length */
if (*length < 4)
return FALSE;
* @param length data block length
*/
-void gcc_write_user_data_header(STREAM* s, uint16 type, uint16 length)
+void gcc_write_user_data_header(STREAM* s, UINT16 type, UINT16 length)
{
- stream_write_uint16(s, type); /* type */
- stream_write_uint16(s, length); /* length */
+ stream_write_UINT16(s, type); /* type */
+ stream_write_UINT16(s, length); /* length */
}
/**
* @param settings rdp settings
*/
-BOOL gcc_read_client_core_data(STREAM* s, rdpSettings* settings, uint16 blockLength)
+BOOL gcc_read_client_core_data(STREAM* s, rdpSettings* settings, UINT16 blockLength)
{
char* str;
uint32 version;
uint32 color_depth;
- uint16 colorDepth = 0;
- uint16 postBeta2ColorDepth = 0;
- uint16 highColorDepth = 0;
- uint16 supportedColorDepths = 0;
- uint16 earlyCapabilityFlags = 0;
+ UINT16 colorDepth = 0;
+ UINT16 postBeta2ColorDepth = 0;
+ UINT16 highColorDepth = 0;
+ UINT16 supportedColorDepths = 0;
+ UINT16 earlyCapabilityFlags = 0;
uint32 serverSelectedProtocol = 0;
/* Length of all required fields, until imeFileName */
stream_read_uint32(s, version); /* version */
settings->rdp_version = (version == RDP_VERSION_4 ? 4 : 7);
- stream_read_uint16(s, settings->width); /* desktopWidth */
- stream_read_uint16(s, settings->height); /* desktopHeight */
- stream_read_uint16(s, colorDepth); /* colorDepth */
- stream_seek_uint16(s); /* SASSequence (Secure Access Sequence) */
+ stream_read_UINT16(s, settings->width); /* desktopWidth */
+ stream_read_UINT16(s, settings->height); /* desktopHeight */
+ stream_read_UINT16(s, colorDepth); /* colorDepth */
+ stream_seek_UINT16(s); /* SASSequence (Secure Access Sequence) */
stream_read_uint32(s, settings->kbd_layout); /* keyboardLayout */
stream_read_uint32(s, settings->client_build); /* clientBuild */
{
if (blockLength < 2)
break;
- stream_read_uint16(s, postBeta2ColorDepth); /* postBeta2ColorDepth */
+ stream_read_UINT16(s, postBeta2ColorDepth); /* postBeta2ColorDepth */
blockLength -= 2;
if (blockLength < 2)
break;
- stream_seek_uint16(s); /* clientProductID */
+ stream_seek_UINT16(s); /* clientProductID */
blockLength -= 2;
if (blockLength < 4)
if (blockLength < 2)
break;
- stream_read_uint16(s, highColorDepth); /* highColorDepth */
+ stream_read_UINT16(s, highColorDepth); /* highColorDepth */
blockLength -= 2;
if (blockLength < 2)
break;
- stream_read_uint16(s, supportedColorDepths); /* supportedColorDepths */
+ stream_read_UINT16(s, supportedColorDepths); /* supportedColorDepths */
blockLength -= 2;
if (blockLength < 2)
break;
- stream_read_uint16(s, earlyCapabilityFlags); /* earlyCapabilityFlags */
+ stream_read_UINT16(s, earlyCapabilityFlags); /* earlyCapabilityFlags */
blockLength -= 2;
if (blockLength < 64)
if (blockLength < 1)
break;
- stream_read_uint8(s, settings->performance_flags); /* connectionType */
+ stream_read_BYTE(s, settings->performance_flags); /* connectionType */
blockLength -= 1;
if (blockLength < 1)
break;
- stream_seek_uint8(s); /* pad1octet */
+ stream_seek_BYTE(s); /* pad1octet */
blockLength -= 1;
if (blockLength < 4)
uint32 version;
WCHAR* clientName;
int clientNameLength;
- uint8 connectionType;
- uint16 highColorDepth;
- uint16 supportedColorDepths;
- uint16 earlyCapabilityFlags;
+ BYTE connectionType;
+ UINT16 highColorDepth;
+ UINT16 supportedColorDepths;
+ UINT16 earlyCapabilityFlags;
WCHAR* clientDigProductId;
int clientDigProductIdLength;
clientDigProductIdLength = freerdp_AsciiToUnicodeAlloc(settings->client_product_id, &clientDigProductId, 0);
stream_write_uint32(s, version); /* version */
- stream_write_uint16(s, settings->width); /* desktopWidth */
- stream_write_uint16(s, settings->height); /* desktopHeight */
- stream_write_uint16(s, RNS_UD_COLOR_8BPP); /* colorDepth, ignored because of postBeta2ColorDepth */
- stream_write_uint16(s, RNS_UD_SAS_DEL); /* SASSequence (Secure Access Sequence) */
+ stream_write_UINT16(s, settings->width); /* desktopWidth */
+ stream_write_UINT16(s, settings->height); /* desktopHeight */
+ stream_write_UINT16(s, RNS_UD_COLOR_8BPP); /* colorDepth, ignored because of postBeta2ColorDepth */
+ stream_write_UINT16(s, RNS_UD_SAS_DEL); /* SASSequence (Secure Access Sequence) */
stream_write_uint32(s, settings->kbd_layout); /* keyboardLayout */
stream_write_uint32(s, settings->client_build); /* clientBuild */
stream_write_zero(s, 64); /* imeFileName */
- stream_write_uint16(s, RNS_UD_COLOR_8BPP); /* postBeta2ColorDepth */
- stream_write_uint16(s, 1); /* clientProductID */
+ stream_write_UINT16(s, RNS_UD_COLOR_8BPP); /* postBeta2ColorDepth */
+ stream_write_UINT16(s, 1); /* clientProductID */
stream_write_uint32(s, 0); /* serialNumber (should be initialized to 0) */
highColorDepth = MIN(settings->color_depth, 24);
earlyCapabilityFlags |= RNS_UD_CS_WANT_32BPP_SESSION;
}
- stream_write_uint16(s, highColorDepth); /* highColorDepth */
- stream_write_uint16(s, supportedColorDepths); /* supportedColorDepths */
+ stream_write_UINT16(s, highColorDepth); /* highColorDepth */
+ stream_write_UINT16(s, supportedColorDepths); /* supportedColorDepths */
- stream_write_uint16(s, earlyCapabilityFlags); /* earlyCapabilityFlags */
+ stream_write_UINT16(s, earlyCapabilityFlags); /* earlyCapabilityFlags */
/* clientDigProductId (64 bytes, null-terminated unicode, truncated to 30 characters) */
if (clientDigProductIdLength > 62)
stream_write_zero(s, 64 - clientDigProductIdLength - 2);
free(clientDigProductId);
- stream_write_uint8(s, connectionType); /* connectionType */
- stream_write_uint8(s, 0); /* pad1octet */
+ stream_write_BYTE(s, connectionType); /* connectionType */
+ stream_write_BYTE(s, 0); /* pad1octet */
stream_write_uint32(s, settings->selected_protocol); /* serverSelectedProtocol */
}
* @param settings rdp settings
*/
-BOOL gcc_read_client_security_data(STREAM* s, rdpSettings* settings, uint16 blockLength)
+BOOL gcc_read_client_security_data(STREAM* s, rdpSettings* settings, UINT16 blockLength)
{
if (blockLength < 8)
return FALSE;
BOOL gcc_read_server_security_data(STREAM* s, rdpSettings* settings)
{
- uint8* data;
+ BYTE* data;
uint32 length;
stream_read_uint32(s, settings->encryption_method); /* encryptionMethod */
return TRUE;
}
-static const uint8 initial_signature[] =
+static const BYTE initial_signature[] =
{
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
* Yes, Terminal Services Private Key is publicly available.
*/
-const uint8 tssk_modulus[] =
+const BYTE tssk_modulus[] =
{
0x3d, 0x3a, 0x5e, 0xbd, 0x72, 0x43, 0x3e, 0xc9,
0x4d, 0xbb, 0xc1, 0x1e, 0x4a, 0xba, 0x5f, 0xcb,
0x20, 0x93, 0x09, 0x5f, 0x05, 0x6d, 0xea, 0x87
};
-const uint8 tssk_privateExponent[] =
+const BYTE tssk_privateExponent[] =
{
0x87, 0xa7, 0x19, 0x32, 0xda, 0x11, 0x87, 0x55,
0x58, 0x00, 0x16, 0x16, 0x25, 0x65, 0x68, 0xf8,
0xc7, 0x10, 0x01, 0x13, 0xe7, 0x3f, 0xf3, 0x5f
};
-const uint8 tssk_exponent[] =
+const BYTE tssk_exponent[] =
{
0x5b, 0x7b, 0x88, 0xc0
};
void gcc_write_server_security_data(STREAM* s, rdpSettings* settings)
{
CryptoMd5 md5;
- uint8* sigData;
+ BYTE* sigData;
int expLen, keyLen, sigDataLen;
- uint8 encryptedSignature[TSSK_KEY_LENGTH];
- uint8 signature[sizeof(initial_signature)];
+ BYTE encryptedSignature[TSSK_KEY_LENGTH];
+ BYTE signature[sizeof(initial_signature)];
uint32 headerLen, serverRandomLen, serverCertLen, wPublicKeyBlobLen;
if (!settings->encryption)
stream_write_uint32(s, CERT_CHAIN_VERSION_1); /* dwVersion (4 bytes) */
stream_write_uint32(s, SIGNATURE_ALG_RSA); /* dwSigAlgId */
stream_write_uint32(s, KEY_EXCHANGE_ALG_RSA); /* dwKeyAlgId */
- stream_write_uint16(s, BB_RSA_KEY_BLOB); /* wPublicKeyBlobType */
+ stream_write_UINT16(s, BB_RSA_KEY_BLOB); /* wPublicKeyBlobType */
- stream_write_uint16(s, wPublicKeyBlobLen); /* wPublicKeyBlobLen */
+ stream_write_UINT16(s, wPublicKeyBlobLen); /* wPublicKeyBlobLen */
stream_write(s, "RSA1", 4); /* magic */
stream_write_uint32(s, keyLen + 8); /* keylen */
stream_write_uint32(s, keyLen * 8); /* bitlen */
sigDataLen = stream_get_tail(s) - sigData;
- stream_write_uint16(s, BB_RSA_SIGNATURE_BLOB); /* wSignatureBlobType */
- stream_write_uint16(s, keyLen + 8); /* wSignatureBlobLen */
+ stream_write_UINT16(s, BB_RSA_SIGNATURE_BLOB); /* wSignatureBlobType */
+ stream_write_UINT16(s, keyLen + 8); /* wSignatureBlobLen */
memcpy(signature, initial_signature, sizeof(initial_signature));
* @param settings rdp settings
*/
-BOOL gcc_read_client_network_data(STREAM* s, rdpSettings* settings, uint16 blockLength)
+BOOL gcc_read_client_network_data(STREAM* s, rdpSettings* settings, UINT16 blockLength)
{
int i;
void gcc_write_client_network_data(STREAM* s, rdpSettings* settings)
{
int i;
- uint16 length;
+ UINT16 length;
if (settings->num_channels > 0)
{
BOOL gcc_read_server_network_data(STREAM* s, rdpSettings* settings)
{
int i;
- uint16 MCSChannelId;
- uint16 channelCount;
- uint16 channelId;
+ UINT16 MCSChannelId;
+ UINT16 channelCount;
+ UINT16 channelId;
- stream_read_uint16(s, MCSChannelId); /* MCSChannelId */
- stream_read_uint16(s, channelCount); /* channelCount */
+ stream_read_UINT16(s, MCSChannelId); /* MCSChannelId */
+ stream_read_UINT16(s, channelCount); /* channelCount */
if (channelCount != settings->num_channels)
{
for (i = 0; i < channelCount; i++)
{
- stream_read_uint16(s, channelId); /* channelId */
+ stream_read_UINT16(s, channelId); /* channelId */
settings->channels[i].channel_id = channelId;
}
gcc_write_user_data_header(s, SC_NET, 8 + settings->num_channels * 2 + (settings->num_channels % 2 == 1 ? 2 : 0));
- stream_write_uint16(s, MCS_GLOBAL_CHANNEL_ID); /* MCSChannelId */
- stream_write_uint16(s, settings->num_channels); /* channelCount */
+ stream_write_UINT16(s, MCS_GLOBAL_CHANNEL_ID); /* MCSChannelId */
+ stream_write_UINT16(s, settings->num_channels); /* channelCount */
for (i = 0; i < settings->num_channels; i++)
{
- stream_write_uint16(s, settings->channels[i].channel_id);
+ stream_write_UINT16(s, settings->channels[i].channel_id);
}
if (settings->num_channels % 2 == 1)
- stream_write_uint16(s, 0);
+ stream_write_UINT16(s, 0);
}
/**
* @param settings rdp settings
*/
-BOOL gcc_read_client_cluster_data(STREAM* s, rdpSettings* settings, uint16 blockLength)
+BOOL gcc_read_client_cluster_data(STREAM* s, rdpSettings* settings, UINT16 blockLength)
{
uint32 flags;
* @param settings rdp settings
*/
-BOOL gcc_read_client_monitor_data(STREAM* s, rdpSettings* settings, uint16 blockLength)
+BOOL gcc_read_client_monitor_data(STREAM* s, rdpSettings* settings, UINT16 blockLength)
{
printf("CS_MONITOR\n");
return TRUE;
void gcc_write_client_monitor_data(STREAM* s, rdpSettings* settings)
{
int i;
- uint16 length;
+ UINT16 length;
uint32 left, top, right, bottom, flags;
if (settings->num_monitors > 1)
void gcc_write_client_data_blocks(STREAM* s, rdpSettings *settings);
BOOL gcc_read_server_data_blocks(STREAM* s, rdpSettings *settings, int length);
void gcc_write_server_data_blocks(STREAM* s, rdpSettings *settings);
-BOOL gcc_read_user_data_header(STREAM* s, uint16* type, uint16* length);
-void gcc_write_user_data_header(STREAM* s, uint16 type, uint16 length);
-BOOL gcc_read_client_core_data(STREAM* s, rdpSettings *settings, uint16 blockLength);
+BOOL gcc_read_user_data_header(STREAM* s, UINT16* type, UINT16* length);
+void gcc_write_user_data_header(STREAM* s, UINT16 type, UINT16 length);
+BOOL gcc_read_client_core_data(STREAM* s, rdpSettings *settings, UINT16 blockLength);
void gcc_write_client_core_data(STREAM* s, rdpSettings *settings);
BOOL gcc_read_server_core_data(STREAM* s, rdpSettings *settings);
void gcc_write_server_core_data(STREAM* s, rdpSettings *settings);
-BOOL gcc_read_client_security_data(STREAM* s, rdpSettings *settings, uint16 blockLength);
+BOOL gcc_read_client_security_data(STREAM* s, rdpSettings *settings, UINT16 blockLength);
void gcc_write_client_security_data(STREAM* s, rdpSettings *settings);
BOOL gcc_read_server_security_data(STREAM* s, rdpSettings *settings);
void gcc_write_server_security_data(STREAM* s, rdpSettings *settings);
-BOOL gcc_read_client_network_data(STREAM* s, rdpSettings *settings, uint16 blockLength);
+BOOL gcc_read_client_network_data(STREAM* s, rdpSettings *settings, UINT16 blockLength);
void gcc_write_client_network_data(STREAM* s, rdpSettings *settings);
BOOL gcc_read_server_network_data(STREAM* s, rdpSettings *settings);
void gcc_write_server_network_data(STREAM* s, rdpSettings *settings);
-BOOL gcc_read_client_cluster_data(STREAM* s, rdpSettings *settings, uint16 blockLength);
+BOOL gcc_read_client_cluster_data(STREAM* s, rdpSettings *settings, UINT16 blockLength);
void gcc_write_client_cluster_data(STREAM* s, rdpSettings *settings);
-BOOL gcc_read_client_monitor_data(STREAM* s, rdpSettings *settings, uint16 blockLength);
+BOOL gcc_read_client_monitor_data(STREAM* s, rdpSettings *settings, UINT16 blockLength);
void gcc_write_client_monitor_data(STREAM* s, rdpSettings *settings);
#endif /* __GCC_H */
}
}
-void Bitmap_SetRectangle(rdpContext* context, rdpBitmap* bitmap, uint16 left, uint16 top, uint16 right, uint16 bottom)
+void Bitmap_SetRectangle(rdpContext* context, rdpBitmap* bitmap, UINT16 left, UINT16 top, UINT16 right, UINT16 bottom)
{
bitmap->left = left;
bitmap->top = top;
bitmap->bottom = bottom;
}
-void Bitmap_SetDimensions(rdpContext* context, rdpBitmap* bitmap, uint16 width, uint16 height)
+void Bitmap_SetDimensions(rdpContext* context, rdpBitmap* bitmap, UINT16 width, UINT16 height)
{
bitmap->width = width;
bitmap->height = height;
HttpResponse* http_response_recv(rdpTls* tls)
{
- uint8* p;
+ BYTE* p;
int nbytes;
int length;
int status;
- uint8* buffer;
+ BYTE* buffer;
char* content;
char* header_end;
HttpResponse* http_response;
if (status > 0)
{
nbytes += status;
- p = (uint8*) &buffer[nbytes];
+ p = (BYTE*) &buffer[nbytes];
}
else if (status == 0)
{
{
length *= 2;
buffer = realloc(buffer, length);
- p = (uint8*) &buffer[nbytes];
+ p = (BYTE*) &buffer[nbytes];
}
}
BOOL rdp_read_extended_info_packet(STREAM* s, rdpSettings* settings)
{
- uint16 clientAddressFamily;
- uint16 cbClientAddress;
- uint16 cbClientDir;
- uint16 cbAutoReconnectLen;
+ UINT16 clientAddressFamily;
+ UINT16 cbClientAddress;
+ UINT16 cbClientDir;
+ UINT16 cbAutoReconnectLen;
- stream_read_uint16(s, clientAddressFamily); /* clientAddressFamily */
- stream_read_uint16(s, cbClientAddress); /* cbClientAddress */
+ stream_read_UINT16(s, clientAddressFamily); /* clientAddressFamily */
+ stream_read_UINT16(s, cbClientAddress); /* cbClientAddress */
settings->ipv6 = (clientAddressFamily == ADDRESS_FAMILY_INET6 ? TRUE : FALSE);
freerdp_UnicodeToAsciiAlloc((WCHAR*) stream_get_tail(s), &settings->ip_address, cbClientAddress / 2);
stream_seek(s, cbClientAddress);
- stream_read_uint16(s, cbClientDir); /* cbClientDir */
+ stream_read_UINT16(s, cbClientDir); /* cbClientDir */
if (stream_get_left(s) < cbClientDir)
return FALSE;
stream_seek_uint32(s); /* clientSessionId, should be set to 0 */
stream_read_uint32(s, settings->performance_flags); /* performanceFlags */
- stream_read_uint16(s, cbAutoReconnectLen); /* cbAutoReconnectLen */
+ stream_read_UINT16(s, cbAutoReconnectLen); /* cbAutoReconnectLen */
if (cbAutoReconnectLen > 0)
return rdp_read_client_auto_reconnect_cookie(s, settings); /* autoReconnectCookie */
cbAutoReconnectLen = (int) settings->client_auto_reconnect_cookie->cbLen;
- stream_write_uint16(s, clientAddressFamily); /* clientAddressFamily */
+ stream_write_UINT16(s, clientAddressFamily); /* clientAddressFamily */
- stream_write_uint16(s, cbClientAddress + 2); /* cbClientAddress */
+ stream_write_UINT16(s, cbClientAddress + 2); /* cbClientAddress */
if (cbClientAddress > 0)
stream_write(s, clientAddress, cbClientAddress); /* clientAddress */
- stream_write_uint16(s, 0);
+ stream_write_UINT16(s, 0);
- stream_write_uint16(s, cbClientDir + 2); /* cbClientDir */
+ stream_write_UINT16(s, cbClientDir + 2); /* cbClientDir */
if (cbClientDir > 0)
stream_write(s, clientDir, cbClientDir); /* clientDir */
- stream_write_uint16(s, 0);
+ stream_write_UINT16(s, 0);
rdp_write_client_time_zone(s, settings); /* clientTimeZone */
stream_write_uint32(s, 0); /* clientSessionId, should be set to 0 */
stream_write_uint32(s, settings->performance_flags); /* performanceFlags */
- stream_write_uint16(s, cbAutoReconnectLen); /* cbAutoReconnectLen */
+ stream_write_UINT16(s, cbAutoReconnectLen); /* cbAutoReconnectLen */
if (cbAutoReconnectLen > 0)
rdp_write_client_auto_reconnect_cookie(s, settings); /* autoReconnectCookie */
BOOL rdp_read_info_packet(STREAM* s, rdpSettings* settings)
{
uint32 flags;
- uint16 cbDomain;
- uint16 cbUserName;
- uint16 cbPassword;
- uint16 cbAlternateShell;
- uint16 cbWorkingDir;
+ UINT16 cbDomain;
+ UINT16 cbUserName;
+ UINT16 cbPassword;
+ UINT16 cbAlternateShell;
+ UINT16 cbWorkingDir;
stream_seek_uint32(s); /* CodePage */
stream_read_uint32(s, flags); /* flags */
settings->console_audio = ((flags & INFO_REMOTECONSOLEAUDIO) ? TRUE : FALSE);
settings->compression = ((flags & INFO_COMPRESSION) ? TRUE : FALSE);
- stream_read_uint16(s, cbDomain); /* cbDomain */
- stream_read_uint16(s, cbUserName); /* cbUserName */
- stream_read_uint16(s, cbPassword); /* cbPassword */
- stream_read_uint16(s, cbAlternateShell); /* cbAlternateShell */
- stream_read_uint16(s, cbWorkingDir); /* cbWorkingDir */
+ stream_read_UINT16(s, cbDomain); /* cbDomain */
+ stream_read_UINT16(s, cbUserName); /* cbUserName */
+ stream_read_UINT16(s, cbPassword); /* cbPassword */
+ stream_read_UINT16(s, cbAlternateShell); /* cbAlternateShell */
+ stream_read_UINT16(s, cbWorkingDir); /* cbWorkingDir */
if (stream_get_left(s) < cbDomain + 2)
return FALSE;
stream_write_uint32(s, 0); /* CodePage */
stream_write_uint32(s, flags); /* flags */
- stream_write_uint16(s, cbDomain); /* cbDomain */
- stream_write_uint16(s, cbUserName); /* cbUserName */
- stream_write_uint16(s, cbPassword); /* cbPassword */
- stream_write_uint16(s, cbAlternateShell); /* cbAlternateShell */
- stream_write_uint16(s, cbWorkingDir); /* cbWorkingDir */
+ stream_write_UINT16(s, cbDomain); /* cbDomain */
+ stream_write_UINT16(s, cbUserName); /* cbUserName */
+ stream_write_UINT16(s, cbPassword); /* cbPassword */
+ stream_write_UINT16(s, cbAlternateShell); /* cbAlternateShell */
+ stream_write_UINT16(s, cbWorkingDir); /* cbWorkingDir */
if (cbDomain > 0)
stream_write(s, domain, cbDomain);
- stream_write_uint16(s, 0);
+ stream_write_UINT16(s, 0);
if (cbUserName > 0)
stream_write(s, userName, cbUserName);
- stream_write_uint16(s, 0);
+ stream_write_UINT16(s, 0);
if (cbPassword > 0)
stream_write(s, password, cbPassword);
- stream_write_uint16(s, 0);
+ stream_write_UINT16(s, 0);
if (cbAlternateShell > 0)
stream_write(s, alternateShell, cbAlternateShell);
- stream_write_uint16(s, 0);
+ stream_write_UINT16(s, 0);
if (cbWorkingDir > 0)
stream_write(s, workingDir, cbWorkingDir);
- stream_write_uint16(s, 0);
+ stream_write_UINT16(s, 0);
free(domain);
free(userName);
BOOL rdp_recv_client_info(rdpRdp* rdp, STREAM* s)
{
- uint16 length;
- uint16 channelId;
- uint16 securityFlags;
+ UINT16 length;
+ UINT16 channelId;
+ UINT16 securityFlags;
if (!rdp_read_header(rdp, s, &length, &channelId))
return FALSE;
uint32 cbDomain;
uint32 cbUserName;
- stream_seek_uint16(s); /* version (2 bytes) */
+ stream_seek_UINT16(s); /* version (2 bytes) */
stream_seek_uint32(s); /* size (4 bytes) */
stream_seek_uint32(s); /* sessionId (4 bytes) */
stream_read_uint32(s, cbDomain); /* cbDomain (4 bytes) */
{
uint32 cbFieldData;
uint32 fieldsPresent;
- uint16 Length;
+ UINT16 Length;
- stream_read_uint16(s, Length); /* The total size in bytes of this structure */
+ stream_read_UINT16(s, Length); /* The total size in bytes of this structure */
stream_read_uint32(s, fieldsPresent); /* fieldsPresent (4 bytes) */
/* logonFields */
#include "input.h"
-void rdp_write_client_input_pdu_header(STREAM* s, uint16 number)
+void rdp_write_client_input_pdu_header(STREAM* s, UINT16 number)
{
- stream_write_uint16(s, 1); /* numberEvents (2 bytes) */
- stream_write_uint16(s, 0); /* pad2Octets (2 bytes) */
+ stream_write_UINT16(s, 1); /* numberEvents (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2Octets (2 bytes) */
}
-void rdp_write_input_event_header(STREAM* s, uint32 time, uint16 type)
+void rdp_write_input_event_header(STREAM* s, uint32 time, UINT16 type)
{
stream_write_uint32(s, time); /* eventTime (4 bytes) */
- stream_write_uint16(s, type); /* messageType (2 bytes) */
+ stream_write_UINT16(s, type); /* messageType (2 bytes) */
}
-STREAM* rdp_client_input_pdu_init(rdpRdp* rdp, uint16 type)
+STREAM* rdp_client_input_pdu_init(rdpRdp* rdp, UINT16 type)
{
STREAM* s;
s = rdp_data_pdu_init(rdp);
void input_write_synchronize_event(STREAM* s, uint32 flags)
{
- stream_write_uint16(s, 0); /* pad2Octets (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2Octets (2 bytes) */
stream_write_uint32(s, flags); /* toggleFlags (4 bytes) */
}
rdp_send_client_input_pdu(rdp, s);
}
-void input_write_keyboard_event(STREAM* s, uint16 flags, uint16 code)
+void input_write_keyboard_event(STREAM* s, UINT16 flags, UINT16 code)
{
- stream_write_uint16(s, flags); /* keyboardFlags (2 bytes) */
- stream_write_uint16(s, code); /* keyCode (2 bytes) */
- stream_write_uint16(s, 0); /* pad2Octets (2 bytes) */
+ stream_write_UINT16(s, flags); /* keyboardFlags (2 bytes) */
+ stream_write_UINT16(s, code); /* keyCode (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2Octets (2 bytes) */
}
-void input_send_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
+void input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
STREAM* s;
rdpRdp* rdp = input->context->rdp;
rdp_send_client_input_pdu(rdp, s);
}
-void input_write_unicode_keyboard_event(STREAM* s, uint16 flags, uint16 code)
+void input_write_unicode_keyboard_event(STREAM* s, UINT16 flags, UINT16 code)
{
- stream_write_uint16(s, flags); /* keyboardFlags (2 bytes) */
- stream_write_uint16(s, code); /* unicodeCode (2 bytes) */
- stream_write_uint16(s, 0); /* pad2Octets (2 bytes) */
+ stream_write_UINT16(s, flags); /* keyboardFlags (2 bytes) */
+ stream_write_UINT16(s, code); /* unicodeCode (2 bytes) */
+ stream_write_UINT16(s, 0); /* pad2Octets (2 bytes) */
}
-void input_send_unicode_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
+void input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
STREAM* s;
- uint16 keyboardFlags = 0;
+ UINT16 keyboardFlags = 0;
rdpRdp* rdp = input->context->rdp;
/*
rdp_send_client_input_pdu(rdp, s);
}
-void input_write_mouse_event(STREAM* s, uint16 flags, uint16 x, uint16 y)
+void input_write_mouse_event(STREAM* s, UINT16 flags, UINT16 x, UINT16 y)
{
- stream_write_uint16(s, flags); /* pointerFlags (2 bytes) */
- stream_write_uint16(s, x); /* xPos (2 bytes) */
- stream_write_uint16(s, y); /* yPos (2 bytes) */
+ stream_write_UINT16(s, flags); /* pointerFlags (2 bytes) */
+ stream_write_UINT16(s, x); /* xPos (2 bytes) */
+ stream_write_UINT16(s, y); /* yPos (2 bytes) */
}
-void input_send_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
+void input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
STREAM* s;
rdpRdp* rdp = input->context->rdp;
rdp_send_client_input_pdu(rdp, s);
}
-void input_write_extended_mouse_event(STREAM* s, uint16 flags, uint16 x, uint16 y)
+void input_write_extended_mouse_event(STREAM* s, UINT16 flags, UINT16 x, UINT16 y)
{
- stream_write_uint16(s, flags); /* pointerFlags (2 bytes) */
- stream_write_uint16(s, x); /* xPos (2 bytes) */
- stream_write_uint16(s, y); /* yPos (2 bytes) */
+ stream_write_UINT16(s, flags); /* pointerFlags (2 bytes) */
+ stream_write_UINT16(s, x); /* xPos (2 bytes) */
+ stream_write_UINT16(s, y); /* yPos (2 bytes) */
}
-void input_send_extended_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
+void input_send_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
STREAM* s;
rdpRdp* rdp = input->context->rdp;
rdpRdp* rdp = input->context->rdp;
/* The FastPath Synchronization eventFlags has identical values as SlowPath */
- s = fastpath_input_pdu_init(rdp->fastpath, (uint8) flags, FASTPATH_INPUT_EVENT_SYNC);
+ s = fastpath_input_pdu_init(rdp->fastpath, (BYTE) flags, FASTPATH_INPUT_EVENT_SYNC);
fastpath_send_input_pdu(rdp->fastpath, s);
}
-void input_send_fastpath_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
+void input_send_fastpath_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
STREAM* s;
- uint8 eventFlags = 0;
+ BYTE eventFlags = 0;
rdpRdp* rdp = input->context->rdp;
eventFlags |= (flags & KBD_FLAGS_RELEASE) ? FASTPATH_INPUT_KBDFLAGS_RELEASE : 0;
eventFlags |= (flags & KBD_FLAGS_EXTENDED) ? FASTPATH_INPUT_KBDFLAGS_EXTENDED : 0;
s = fastpath_input_pdu_init(rdp->fastpath, eventFlags, FASTPATH_INPUT_EVENT_SCANCODE);
- stream_write_uint8(s, code); /* keyCode (1 byte) */
+ stream_write_BYTE(s, code); /* keyCode (1 byte) */
fastpath_send_input_pdu(rdp->fastpath, s);
}
-void input_send_fastpath_unicode_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
+void input_send_fastpath_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
STREAM* s;
- uint8 eventFlags = 0;
+ BYTE eventFlags = 0;
rdpRdp* rdp = input->context->rdp;
eventFlags |= (flags & KBD_FLAGS_RELEASE) ? FASTPATH_INPUT_KBDFLAGS_RELEASE : 0;
s = fastpath_input_pdu_init(rdp->fastpath, eventFlags, FASTPATH_INPUT_EVENT_UNICODE);
- stream_write_uint16(s, code); /* unicodeCode (2 bytes) */
+ stream_write_UINT16(s, code); /* unicodeCode (2 bytes) */
fastpath_send_input_pdu(rdp->fastpath, s);
}
-void input_send_fastpath_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
+void input_send_fastpath_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
STREAM* s;
rdpRdp* rdp = input->context->rdp;
fastpath_send_input_pdu(rdp->fastpath, s);
}
-void input_send_fastpath_extended_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
+void input_send_fastpath_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
STREAM* s;
rdpRdp* rdp = input->context->rdp;
static BOOL input_recv_keyboard_event(rdpInput* input, STREAM* s)
{
- uint16 keyboardFlags, keyCode;
+ UINT16 keyboardFlags, keyCode;
if (stream_get_left(s) < 6)
return FALSE;
- stream_read_uint16(s, keyboardFlags); /* keyboardFlags (2 bytes) */
- stream_read_uint16(s, keyCode); /* keyCode (2 bytes) */
+ stream_read_UINT16(s, keyboardFlags); /* keyboardFlags (2 bytes) */
+ stream_read_UINT16(s, keyCode); /* keyCode (2 bytes) */
stream_seek(s, 2); /* pad2Octets (2 bytes) */
IFCALL(input->KeyboardEvent, input, keyboardFlags, keyCode);
static BOOL input_recv_unicode_keyboard_event(rdpInput* input, STREAM* s)
{
- uint16 keyboardFlags, unicodeCode;
+ UINT16 keyboardFlags, unicodeCode;
if (stream_get_left(s) < 6)
return FALSE;
- stream_read_uint16(s, keyboardFlags); /* keyboardFlags (2 bytes) */
- stream_read_uint16(s, unicodeCode); /* unicodeCode (2 bytes) */
+ stream_read_UINT16(s, keyboardFlags); /* keyboardFlags (2 bytes) */
+ stream_read_UINT16(s, unicodeCode); /* unicodeCode (2 bytes) */
stream_seek(s, 2); /* pad2Octets (2 bytes) */
/*
static BOOL input_recv_mouse_event(rdpInput* input, STREAM* s)
{
- uint16 pointerFlags, xPos, yPos;
+ UINT16 pointerFlags, xPos, yPos;
if (stream_get_left(s) < 6)
return FALSE;
- stream_read_uint16(s, pointerFlags); /* pointerFlags (2 bytes) */
- stream_read_uint16(s, xPos); /* xPos (2 bytes) */
- stream_read_uint16(s, yPos); /* yPos (2 bytes) */
+ stream_read_UINT16(s, pointerFlags); /* pointerFlags (2 bytes) */
+ stream_read_UINT16(s, xPos); /* xPos (2 bytes) */
+ stream_read_UINT16(s, yPos); /* yPos (2 bytes) */
IFCALL(input->MouseEvent, input, pointerFlags, xPos, yPos);
static BOOL input_recv_extended_mouse_event(rdpInput* input, STREAM* s)
{
- uint16 pointerFlags, xPos, yPos;
+ UINT16 pointerFlags, xPos, yPos;
if (stream_get_left(s) < 6)
return FALSE;
- stream_read_uint16(s, pointerFlags); /* pointerFlags (2 bytes) */
- stream_read_uint16(s, xPos); /* xPos (2 bytes) */
- stream_read_uint16(s, yPos); /* yPos (2 bytes) */
+ stream_read_UINT16(s, pointerFlags); /* pointerFlags (2 bytes) */
+ stream_read_UINT16(s, xPos); /* xPos (2 bytes) */
+ stream_read_UINT16(s, yPos); /* yPos (2 bytes) */
IFCALL(input->ExtendedMouseEvent, input, pointerFlags, xPos, yPos);
static BOOL input_recv_event(rdpInput* input, STREAM* s)
{
- uint16 messageType;
+ UINT16 messageType;
if (stream_get_left(s) < 4)
return FALSE;
stream_seek(s, 4); /* eventTime (4 bytes), ignored by the server */
- stream_read_uint16(s, messageType); /* messageType (2 bytes) */
+ stream_read_UINT16(s, messageType); /* messageType (2 bytes) */
switch (messageType)
{
BOOL input_recv(rdpInput* input, STREAM* s)
{
- uint16 i, numberEvents;
+ UINT16 i, numberEvents;
if (stream_get_left(s) < 4)
return FALSE;
- stream_read_uint16(s, numberEvents); /* numberEvents (2 bytes) */
+ stream_read_UINT16(s, numberEvents); /* numberEvents (2 bytes) */
stream_seek(s, 2); /* pad2Octets (2 bytes) */
/* Each input event uses 6 exactly bytes. */
IFCALL(input->SynchronizeEvent, input, flags);
}
-void freerdp_input_send_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
+void freerdp_input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
IFCALL(input->KeyboardEvent, input, flags, code);
}
RDP_SCANCODE_CODE(rdp_scancode));
}
-void freerdp_input_send_unicode_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
+void freerdp_input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
IFCALL(input->UnicodeKeyboardEvent, input, flags, code);
}
-void freerdp_input_send_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
+void freerdp_input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
IFCALL(input->MouseEvent, input, flags, x, y);
}
-void freerdp_input_send_extended_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
+void freerdp_input_send_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
IFCALL(input->ExtendedMouseEvent, input, flags, x, y);
}
#define RDP_CLIENT_INPUT_PDU_HEADER_LENGTH 4
void input_send_synchronize_event(rdpInput* input, uint32 flags);
-void input_send_keyboard_event(rdpInput* input, uint16 flags, uint16 code);
-void input_send_unicode_keyboard_event(rdpInput* input, uint16 flags, uint16 code);
-void input_send_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y);
-void input_send_extended_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y);
+void input_send_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
+void input_send_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
+void input_send_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
+void input_send_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
void input_send_fastpath_synchronize_event(rdpInput* input, uint32 flags);
-void input_send_fastpath_keyboard_event(rdpInput* input, uint16 flags, uint16 code);
-void input_send_fastpath_unicode_keyboard_event(rdpInput* input, uint16 flags, uint16 code);
-void input_send_fastpath_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y);
-void input_send_fastpath_extended_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y);
+void input_send_fastpath_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
+void input_send_fastpath_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
+void input_send_fastpath_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
+void input_send_fastpath_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
BOOL input_recv(rdpInput* input, STREAM* s);
* @param wMsgSize message size
*/
-void license_read_preamble(STREAM* s, uint8* bMsgType, uint8* flags, uint16* wMsgSize)
+void license_read_preamble(STREAM* s, BYTE* bMsgType, BYTE* flags, UINT16* wMsgSize)
{
/* preamble (4 bytes) */
- stream_read_uint8(s, *bMsgType); /* bMsgType (1 byte) */
- stream_read_uint8(s, *flags); /* flags (1 byte) */
- stream_read_uint16(s, *wMsgSize); /* wMsgSize (2 bytes) */
+ stream_read_BYTE(s, *bMsgType); /* bMsgType (1 byte) */
+ stream_read_BYTE(s, *flags); /* flags (1 byte) */
+ stream_read_UINT16(s, *wMsgSize); /* wMsgSize (2 bytes) */
}
/**
* @param wMsgSize message size
*/
-void license_write_preamble(STREAM* s, uint8 bMsgType, uint8 flags, uint16 wMsgSize)
+void license_write_preamble(STREAM* s, BYTE bMsgType, BYTE flags, UINT16 wMsgSize)
{
/* preamble (4 bytes) */
- stream_write_uint8(s, bMsgType); /* bMsgType (1 byte) */
- stream_write_uint8(s, flags); /* flags (1 byte) */
- stream_write_uint16(s, wMsgSize); /* wMsgSize (2 bytes) */
+ stream_write_BYTE(s, bMsgType); /* bMsgType (1 byte) */
+ stream_write_BYTE(s, flags); /* flags (1 byte) */
+ stream_write_UINT16(s, wMsgSize); /* wMsgSize (2 bytes) */
}
/**
* @param s stream
*/
-BOOL license_send(rdpLicense* license, STREAM* s, uint8 type)
+BOOL license_send(rdpLicense* license, STREAM* s, BYTE type)
{
int length;
- uint8 flags;
- uint16 wMsgSize;
- uint16 sec_flags;
+ BYTE flags;
+ UINT16 wMsgSize;
+ UINT16 sec_flags;
DEBUG_LICENSE("Sending %s Packet", LICENSE_MESSAGE_STRINGS[type & 0x1F]);
BOOL license_recv(rdpLicense* license, STREAM* s)
{
- uint16 length;
- uint16 channelId;
- uint16 sec_flags;
- uint8 flags;
- uint8 bMsgType;
- uint16 wMsgSize;
+ UINT16 length;
+ UINT16 channelId;
+ UINT16 sec_flags;
+ BYTE flags;
+ BYTE bMsgType;
+ UINT16 wMsgSize;
if (!rdp_read_header(license->rdp, s, &length, &channelId))
{
void license_generate_hwid(rdpLicense* license)
{
CryptoMd5 md5;
- uint8* mac_address;
+ BYTE* mac_address;
memset(license->hwid, 0, HWID_LENGTH);
mac_address = license->rdp->transport->tcp->mac_address;
void license_encrypt_premaster_secret(rdpLicense* license)
{
- uint8* encrypted_premaster_secret;
+ BYTE* encrypted_premaster_secret;
#if 0
int key_length;
- uint8* modulus;
- uint8* exponent;
+ BYTE* modulus;
+ BYTE* exponent;
rdpCertificate *certificate;
if (license->server_certificate->length)
freerdp_hexdump(exponent, 4);
#endif
- encrypted_premaster_secret = (uint8*) malloc(MODULUS_MAX_SIZE);
+ encrypted_premaster_secret = (BYTE*) malloc(MODULUS_MAX_SIZE);
memset(encrypted_premaster_secret, 0, MODULUS_MAX_SIZE);
crypto_rsa_public_encrypt(license->premaster_secret, PREMASTER_SECRET_LENGTH,
license->encrypted_premaster_secret->length = PREMASTER_SECRET_LENGTH;
license->encrypted_premaster_secret->data = encrypted_premaster_secret;
#else
- encrypted_premaster_secret = (uint8*) malloc(MODULUS_MAX_SIZE);
+ encrypted_premaster_secret = (BYTE*) malloc(MODULUS_MAX_SIZE);
memset(encrypted_premaster_secret, 0, MODULUS_MAX_SIZE);
license->encrypted_premaster_secret->type = BB_RANDOM_BLOB;
CryptoRc4 rc4;
license->platform_challenge->data =
- (uint8*) malloc(license->encrypted_platform_challenge->length);
+ (BYTE*) malloc(license->encrypted_platform_challenge->length);
license->platform_challenge->length =
license->encrypted_platform_challenge->length;
stream_read_uint32(s, productInfo->cbCompanyName); /* cbCompanyName (4 bytes) */
- productInfo->pbCompanyName = (uint8*) malloc(productInfo->cbCompanyName);
+ productInfo->pbCompanyName = (BYTE*) malloc(productInfo->cbCompanyName);
stream_read(s, productInfo->pbCompanyName, productInfo->cbCompanyName);
stream_read_uint32(s, productInfo->cbProductId); /* cbProductId (4 bytes) */
- productInfo->pbProductId = (uint8*) malloc(productInfo->cbProductId);
+ productInfo->pbProductId = (BYTE*) malloc(productInfo->cbProductId);
stream_read(s, productInfo->pbProductId, productInfo->cbProductId);
}
void license_read_binary_blob(STREAM* s, LICENSE_BLOB* blob)
{
- uint16 wBlobType;
+ UINT16 wBlobType;
- stream_read_uint16(s, wBlobType); /* wBlobType (2 bytes) */
- stream_read_uint16(s, blob->length); /* wBlobLen (2 bytes) */
+ stream_read_UINT16(s, wBlobType); /* wBlobType (2 bytes) */
+ stream_read_UINT16(s, blob->length); /* wBlobLen (2 bytes) */
/*
* Server can choose to not send data by setting len to 0.
}
blob->type = wBlobType;
- blob->data = (uint8*) malloc(blob->length);
+ blob->data = (BYTE*) malloc(blob->length);
stream_read(s, blob->data, blob->length); /* blobData */
}
void license_write_binary_blob(STREAM* s, LICENSE_BLOB* blob)
{
- stream_write_uint16(s, blob->type); /* wBlobType (2 bytes) */
- stream_write_uint16(s, blob->length); /* wBlobLen (2 bytes) */
+ stream_write_UINT16(s, blob->type); /* wBlobType (2 bytes) */
+ stream_write_UINT16(s, blob->length); /* wBlobLen (2 bytes) */
if (blob->length > 0)
stream_write(s, blob->data, blob->length); /* blobData */
void license_write_padded_binary_blob(STREAM* s, LICENSE_BLOB* blob)
{
- uint16 pad_len;
+ UINT16 pad_len;
pad_len = 72 % blob->length;
- stream_write_uint16(s, blob->type); /* wBlobType (2 bytes) */
- stream_write_uint16(s, blob->length + pad_len); /* wBlobLen (2 bytes) */
+ stream_write_UINT16(s, blob->type); /* wBlobType (2 bytes) */
+ stream_write_UINT16(s, blob->length + pad_len); /* wBlobLen (2 bytes) */
if (blob->length > 0)
stream_write(s, blob->data, blob->length); /* blobData */
* @return new license binary blob
*/
-LICENSE_BLOB* license_new_binary_blob(uint16 type)
+LICENSE_BLOB* license_new_binary_blob(UINT16 type)
{
LICENSE_BLOB* blob;
void license_write_platform_id(rdpLicense* license, STREAM* s)
{
- stream_write_uint8(s, 0); /* Client Operating System Version */
- stream_write_uint8(s, 0); /* Independent Software Vendor (ISV) */
- stream_write_uint16(s, 0); /* Client Software Build */
+ stream_write_BYTE(s, 0); /* Client Operating System Version */
+ stream_write_BYTE(s, 0); /* Independent Software Vendor (ISV) */
+ stream_write_UINT16(s, 0); /* Client Software Build */
}
/**
else
username = "username";
- license->client_user_name->data = (uint8*) username;
+ license->client_user_name->data = (BYTE*) username;
license->client_user_name->length = strlen(username) + 1;
- license->client_machine_name->data = (uint8*) license->rdp->settings->client_hostname;
+ license->client_machine_name->data = (BYTE*) license->rdp->settings->client_hostname;
license->client_machine_name->length = strlen(license->rdp->settings->client_hostname) + 1;
license_write_new_license_request_packet(license, s);
* @param mac_data signature
*/
-void license_write_platform_challenge_response_packet(rdpLicense* license, STREAM* s, uint8* mac_data)
+void license_write_platform_challenge_response_packet(rdpLicense* license, STREAM* s, BYTE* mac_data)
{
/* EncryptedPlatformChallengeResponse */
license_write_binary_blob(s, license->encrypted_platform_challenge);
{
STREAM* s;
int length;
- uint8* buffer;
+ BYTE* buffer;
CryptoRc4 rc4;
- uint8 mac_data[16];
+ BYTE mac_data[16];
s = license_send_stream_init(license);
DEBUG_LICENSE("Sending Platform Challenge Response Packet");
license->encrypted_platform_challenge->type = BB_DATA_BLOB;
length = license->platform_challenge->length + HWID_LENGTH;
- buffer = (uint8*) malloc(length);
+ buffer = (BYTE*) malloc(length);
memcpy(buffer, license->platform_challenge->data, license->platform_challenge->length);
memcpy(&buffer[license->platform_challenge->length], license->hwid, HWID_LENGTH);
security_mac_data(license->mac_salt_key, buffer, length, mac_data);
free(buffer);
- buffer = (uint8*) malloc(HWID_LENGTH);
+ buffer = (BYTE*) malloc(HWID_LENGTH);
rc4 = crypto_rc4_init(license->licensing_encryption_key, LICENSING_ENCRYPTION_KEY_LENGTH);
crypto_rc4(rc4, HWID_LENGTH, license->hwid, buffer);
crypto_rc4_free(rc4);
{
uint32 dwVersion;
uint32 cbCompanyName;
- uint8* pbCompanyName;
+ BYTE* pbCompanyName;
uint32 cbProductId;
- uint8* pbProductId;
+ BYTE* pbProductId;
} PRODUCT_INFO;
typedef struct
{
- uint16 type;
- uint16 length;
- uint8* data;
+ UINT16 type;
+ UINT16 length;
+ BYTE* data;
} LICENSE_BLOB;
typedef struct
LICENSE_STATE state;
struct rdp_rdp* rdp;
struct rdp_certificate* certificate;
- uint8 hwid[HWID_LENGTH];
- uint8 modulus[MODULUS_MAX_SIZE];
- uint8 exponent[EXPONENT_MAX_SIZE];
- uint8 client_random[CLIENT_RANDOM_LENGTH];
- uint8 server_random[SERVER_RANDOM_LENGTH];
- uint8 master_secret[MASTER_SECRET_LENGTH];
- uint8 premaster_secret[PREMASTER_SECRET_LENGTH];
- uint8 session_key_blob[SESSION_KEY_BLOB_LENGTH];
- uint8 mac_salt_key[MAC_SALT_KEY_LENGTH];
- uint8 licensing_encryption_key[LICENSING_ENCRYPTION_KEY_LENGTH];
+ BYTE hwid[HWID_LENGTH];
+ BYTE modulus[MODULUS_MAX_SIZE];
+ BYTE exponent[EXPONENT_MAX_SIZE];
+ BYTE client_random[CLIENT_RANDOM_LENGTH];
+ BYTE server_random[SERVER_RANDOM_LENGTH];
+ BYTE master_secret[MASTER_SECRET_LENGTH];
+ BYTE premaster_secret[PREMASTER_SECRET_LENGTH];
+ BYTE session_key_blob[SESSION_KEY_BLOB_LENGTH];
+ BYTE mac_salt_key[MAC_SALT_KEY_LENGTH];
+ BYTE licensing_encryption_key[LICENSING_ENCRYPTION_KEY_LENGTH];
PRODUCT_INFO* product_info;
LICENSE_BLOB* error_info;
LICENSE_BLOB* key_exchange_list;
};
BOOL license_recv(rdpLicense* license, STREAM* s);
-BOOL license_send(rdpLicense* license, STREAM* s, uint8 type);
+BOOL license_send(rdpLicense* license, STREAM* s, BYTE type);
STREAM* license_send_stream_init(rdpLicense* license);
void license_generate_randoms(rdpLicense* license);
void license_free_product_info(PRODUCT_INFO* productInfo);
void license_read_product_info(STREAM* s, PRODUCT_INFO* productInfo);
-LICENSE_BLOB* license_new_binary_blob(uint16 type);
+LICENSE_BLOB* license_new_binary_blob(UINT16 type);
void license_free_binary_blob(LICENSE_BLOB* blob);
void license_read_binary_blob(STREAM* s, LICENSE_BLOB* blob);
void license_write_binary_blob(STREAM* s, LICENSE_BLOB* blob);
void license_write_new_license_request_packet(rdpLicense* license, STREAM* s);
void license_send_new_license_request_packet(rdpLicense* license);
-void license_write_platform_challenge_response_packet(rdpLicense* license, STREAM* s, uint8* mac_data);
+void license_write_platform_challenge_response_packet(rdpLicense* license, STREAM* s, BYTE* mac_data);
void license_send_platform_challenge_response_packet(rdpLicense* license);
BOOL license_send_valid_client_error_packet(rdpLicense* license);
#endif
#endif
-static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_address, uint16 port)
+static BOOL freerdp_listener_open(freerdp_listener* instance, const char* bind_address, UINT16 port)
{
rdpListener* listener = (rdpListener*) instance->listener;
int status;
*
*/
-static const uint8 callingDomainSelector[1] = "\x01";
-static const uint8 calledDomainSelector[1] = "\x01";
+static const BYTE callingDomainSelector[1] = "\x01";
+static const BYTE calledDomainSelector[1] = "\x01";
/*
static const char* const mcs_result_enumerated[] =
* @return
*/
-BOOL mcs_read_domain_mcspdu_header(STREAM* s, enum DomainMCSPDU* domainMCSPDU, uint16* length)
+BOOL mcs_read_domain_mcspdu_header(STREAM* s, enum DomainMCSPDU* domainMCSPDU, UINT16* length)
{
- uint8 choice;
+ BYTE choice;
enum DomainMCSPDU MCSPDU;
*length = tpkt_read_header(s);
* @param length TPKT length
*/
-void mcs_write_domain_mcspdu_header(STREAM* s, enum DomainMCSPDU domainMCSPDU, uint16 length, uint8 options)
+void mcs_write_domain_mcspdu_header(STREAM* s, enum DomainMCSPDU domainMCSPDU, UINT16 length, BYTE options)
{
tpkt_write_header(s, length);
tpdu_write_data(s);
{
STREAM* s;
int length;
- uint8 *bm, *em;
+ BYTE *bm, *em;
STREAM* gcc_CCrq;
STREAM* client_data;
int status;
BOOL mcs_recv_connect_response(rdpMcs* mcs, STREAM* s)
{
int length;
- uint8 result;
+ BYTE result;
uint32 calledConnectId;
tpkt_read_header(s);
{
STREAM* s;
int length;
- uint8 *bm, *em;
+ BYTE *bm, *em;
STREAM* gcc_CCrsp;
STREAM* server_data;
BOOL mcs_recv_erect_domain_request(rdpMcs* mcs, STREAM* s)
{
- uint16 length;
+ UINT16 length;
enum DomainMCSPDU MCSPDU;
MCSPDU = DomainMCSPDU_ErectDomainRequest;
BOOL mcs_send_erect_domain_request(rdpMcs* mcs)
{
STREAM* s;
- uint16 length = 12;
+ UINT16 length = 12;
s = transport_send_stream_init(mcs->transport, length);
mcs_write_domain_mcspdu_header(s, DomainMCSPDU_ErectDomainRequest, length, 0);
BOOL mcs_recv_attach_user_request(rdpMcs* mcs, STREAM* s)
{
- uint16 length;
+ UINT16 length;
enum DomainMCSPDU MCSPDU;
MCSPDU = DomainMCSPDU_AttachUserRequest;
BOOL mcs_send_attach_user_request(rdpMcs* mcs)
{
STREAM* s;
- uint16 length = 8;
+ UINT16 length = 8;
s = transport_send_stream_init(mcs->transport, length);
mcs_write_domain_mcspdu_header(s, DomainMCSPDU_AttachUserRequest, length, 0);
BOOL mcs_recv_attach_user_confirm(rdpMcs* mcs, STREAM* s)
{
- uint16 length;
- uint8 result;
+ UINT16 length;
+ BYTE result;
enum DomainMCSPDU MCSPDU;
MCSPDU = DomainMCSPDU_AttachUserConfirm;
BOOL mcs_send_attach_user_confirm(rdpMcs* mcs)
{
STREAM* s;
- uint16 length = 11;
+ UINT16 length = 11;
s = transport_send_stream_init(mcs->transport, length);
* @param s stream
*/
-BOOL mcs_recv_channel_join_request(rdpMcs* mcs, STREAM* s, uint16* channel_id)
+BOOL mcs_recv_channel_join_request(rdpMcs* mcs, STREAM* s, UINT16* channel_id)
{
- uint16 length;
+ UINT16 length;
enum DomainMCSPDU MCSPDU;
- uint16 user_id;
+ UINT16 user_id;
MCSPDU = DomainMCSPDU_ChannelJoinRequest;
if (!mcs_read_domain_mcspdu_header(s, &MCSPDU, &length))
* @param channel_id channel id
*/
-BOOL mcs_send_channel_join_request(rdpMcs* mcs, uint16 channel_id)
+BOOL mcs_send_channel_join_request(rdpMcs* mcs, UINT16 channel_id)
{
STREAM* s;
- uint16 length = 12;
+ UINT16 length = 12;
s = transport_send_stream_init(mcs->transport, 12);
mcs_write_domain_mcspdu_header(s, DomainMCSPDU_ChannelJoinRequest, length, 0);
* @param mcs mcs module
*/
-BOOL mcs_recv_channel_join_confirm(rdpMcs* mcs, STREAM* s, uint16* channel_id)
+BOOL mcs_recv_channel_join_confirm(rdpMcs* mcs, STREAM* s, UINT16* channel_id)
{
- uint16 length;
- uint8 result;
- uint16 initiator;
- uint16 requested;
+ UINT16 length;
+ BYTE result;
+ UINT16 initiator;
+ UINT16 requested;
enum DomainMCSPDU MCSPDU;
MCSPDU = DomainMCSPDU_ChannelJoinConfirm;
* @param mcs mcs module
*/
-BOOL mcs_send_channel_join_confirm(rdpMcs* mcs, uint16 channel_id)
+BOOL mcs_send_channel_join_confirm(rdpMcs* mcs, UINT16 channel_id)
{
STREAM* s;
- uint16 length = 15;
+ UINT16 length = 15;
s = transport_send_stream_init(mcs->transport, 15);
mcs_write_domain_mcspdu_header(s, DomainMCSPDU_ChannelJoinConfirm, length, 2);
BOOL mcs_send_disconnect_provider_ultimatum(rdpMcs* mcs)
{
STREAM* s;
- uint16 length = 9;
+ UINT16 length = 9;
s = transport_send_stream_init(mcs->transport, 9);
mcs_write_domain_mcspdu_header(s, DomainMCSPDU_DisconnectProviderUltimatum, length, 1);
struct rdp_mcs
{
- uint16 user_id;
+ UINT16 user_id;
struct rdp_transport* transport;
DomainParameters domainParameters;
DomainParameters targetParameters;
BOOL mcs_send_attach_user_request(rdpMcs* mcs);
BOOL mcs_recv_attach_user_confirm(rdpMcs* mcs, STREAM* s);
BOOL mcs_send_attach_user_confirm(rdpMcs* mcs);
-BOOL mcs_recv_channel_join_request(rdpMcs* mcs, STREAM* s, uint16* channel_id);
-BOOL mcs_send_channel_join_request(rdpMcs* mcs, uint16 channel_id);
-BOOL mcs_recv_channel_join_confirm(rdpMcs* mcs, STREAM* s, uint16* channel_id);
-BOOL mcs_send_channel_join_confirm(rdpMcs* mcs, uint16 channel_id);
+BOOL mcs_recv_channel_join_request(rdpMcs* mcs, STREAM* s, UINT16* channel_id);
+BOOL mcs_send_channel_join_request(rdpMcs* mcs, UINT16 channel_id);
+BOOL mcs_recv_channel_join_confirm(rdpMcs* mcs, STREAM* s, UINT16* channel_id);
+BOOL mcs_send_channel_join_confirm(rdpMcs* mcs, UINT16 channel_id);
BOOL mcs_send_disconnect_provider_ultimatum(rdpMcs* mcs);
-BOOL mcs_read_domain_mcspdu_header(STREAM* s, enum DomainMCSPDU* domainMCSPDU, uint16* length);
-void mcs_write_domain_mcspdu_header(STREAM* s, enum DomainMCSPDU domainMCSPDU, uint16 length, uint8 options);
+BOOL mcs_read_domain_mcspdu_header(STREAM* s, enum DomainMCSPDU* domainMCSPDU, UINT16* length);
+void mcs_write_domain_mcspdu_header(STREAM* s, enum DomainMCSPDU domainMCSPDU, UINT16 length, BYTE options);
rdpMcs* mcs_new(rdpTransport* transport);
void mcs_free(rdpMcs* mcs);
{
STREAM* s;
uint32 cbSize;
- uint16 cchPCB = 0;
+ UINT16 cchPCB = 0;
WCHAR* wszPCB = NULL;
if (!nego->send_preconnection_pdu)
if (nego->preconnection_blob)
{
- cchPCB = (uint16) freerdp_AsciiToUnicodeAlloc(nego->preconnection_blob, &wszPCB, 0);
+ cchPCB = (UINT16) freerdp_AsciiToUnicodeAlloc(nego->preconnection_blob, &wszPCB, 0);
cchPCB += 1; /* zero-termination */
cbSize += cchPCB * 2;
}
stream_write_uint32(s, 0); /* Flags */
stream_write_uint32(s, PRECONNECTION_PDU_V2); /* Version */
stream_write_uint32(s, nego->preconnection_id); /* Id */
- stream_write_uint16(s, cchPCB); /* cchPCB */
+ stream_write_UINT16(s, cchPCB); /* cchPCB */
if (wszPCB)
{
BOOL nego_recv(rdpTransport* transport, STREAM* s, void* extra)
{
- uint8 li;
- uint8 type;
+ BYTE li;
+ BYTE type;
rdpNego* nego = (rdpNego*) extra;
if (tpkt_read_header(s) == 0)
{
/* rdpNegData (optional) */
- stream_read_uint8(s, type); /* Type */
+ stream_read_BYTE(s, type); /* Type */
switch (type)
{
BOOL nego_read_request(rdpNego* nego, STREAM* s)
{
- uint8 li;
- uint8 c;
- uint8 type;
+ BYTE li;
+ BYTE c;
+ BYTE type;
tpkt_read_header(s);
li = tpdu_read_connection_request(s);
/* Optional routingToken or cookie, ending with CR+LF */
while (stream_get_left(s) > 0)
{
- stream_read_uint8(s, c);
+ stream_read_BYTE(s, c);
if (c != '\x0D')
continue;
- stream_peek_uint8(s, c);
+ stream_peek_BYTE(s, c);
if (c != '\x0A')
continue;
- stream_seek_uint8(s);
+ stream_seek_BYTE(s);
break;
}
}
{
/* rdpNegData (optional) */
- stream_read_uint8(s, type); /* Type */
+ stream_read_BYTE(s, type); /* Type */
if (type != TYPE_RDP_NEG_REQ)
{
{
STREAM* s;
int length;
- uint8 *bm, *em;
+ BYTE *bm, *em;
s = transport_send_stream_init(nego->transport, 256);
length = TPDU_CONNECTION_REQUEST_LENGTH;
{
int cookie_length = strlen(nego->cookie);
stream_write(s, "Cookie: mstshash=", 17);
- stream_write(s, (uint8*) nego->cookie, cookie_length);
- stream_write_uint8(s, 0x0D); /* CR */
- stream_write_uint8(s, 0x0A); /* LF */
+ stream_write(s, (BYTE*) nego->cookie, cookie_length);
+ stream_write_BYTE(s, 0x0D); /* CR */
+ stream_write_BYTE(s, 0x0A); /* LF */
length += cookie_length + 19;
}
if (nego->requested_protocols > PROTOCOL_RDP)
{
/* RDP_NEG_DATA must be present for TLS and NLA */
- stream_write_uint8(s, TYPE_RDP_NEG_REQ);
- stream_write_uint8(s, 0); /* flags, must be set to zero */
- stream_write_uint16(s, 8); /* RDP_NEG_DATA length (8) */
+ stream_write_BYTE(s, TYPE_RDP_NEG_REQ);
+ stream_write_BYTE(s, 0); /* flags, must be set to zero */
+ stream_write_UINT16(s, 8); /* RDP_NEG_DATA length (8) */
stream_write_uint32(s, nego->requested_protocols); /* requestedProtocols */
length += 8;
}
void nego_process_negotiation_request(rdpNego* nego, STREAM* s)
{
- uint8 flags;
- uint16 length;
+ BYTE flags;
+ UINT16 length;
DEBUG_NEGO("RDP_NEG_REQ");
- stream_read_uint8(s, flags);
- stream_read_uint16(s, length);
+ stream_read_BYTE(s, flags);
+ stream_read_UINT16(s, length);
stream_read_uint32(s, nego->requested_protocols);
DEBUG_NEGO("requested_protocols: %d", nego->requested_protocols);
void nego_process_negotiation_response(rdpNego* nego, STREAM* s)
{
- uint16 length;
+ UINT16 length;
DEBUG_NEGO("RDP_NEG_RSP");
- stream_read_uint8(s, nego->flags);
- stream_read_uint16(s, length);
+ stream_read_BYTE(s, nego->flags);
+ stream_read_UINT16(s, length);
stream_read_uint32(s, nego->selected_protocol);
nego->state = NEGO_STATE_FINAL;
void nego_process_negotiation_failure(rdpNego* nego, STREAM* s)
{
- uint8 flags;
- uint16 length;
+ BYTE flags;
+ UINT16 length;
uint32 failureCode;
DEBUG_NEGO("RDP_NEG_FAILURE");
- stream_read_uint8(s, flags);
- stream_read_uint16(s, length);
+ stream_read_BYTE(s, flags);
+ stream_read_UINT16(s, length);
stream_read_uint32(s, failureCode);
switch (failureCode)
BOOL nego_send_negotiation_response(rdpNego* nego)
{
STREAM* s;
- uint8* bm;
- uint8* em;
+ BYTE* bm;
+ BYTE* em;
int length;
BOOL status;
rdpSettings* settings;
if (nego->selected_protocol > PROTOCOL_RDP)
{
/* RDP_NEG_DATA must be present for TLS and NLA */
- stream_write_uint8(s, TYPE_RDP_NEG_RSP);
- stream_write_uint8(s, EXTENDED_CLIENT_DATA_SUPPORTED); /* flags */
- stream_write_uint16(s, 8); /* RDP_NEG_DATA length (8) */
+ stream_write_BYTE(s, TYPE_RDP_NEG_RSP);
+ stream_write_BYTE(s, EXTENDED_CLIENT_DATA_SUPPORTED); /* flags */
+ stream_write_UINT16(s, 8); /* RDP_NEG_DATA length (8) */
stream_write_uint32(s, nego->selected_protocol); /* selectedProtocol */
length += 8;
}
else if (!settings->rdp_security)
{
- stream_write_uint8(s, TYPE_RDP_NEG_FAILURE);
- stream_write_uint8(s, 0); /* flags */
- stream_write_uint16(s, 8); /* RDP_NEG_DATA length (8) */
+ stream_write_BYTE(s, TYPE_RDP_NEG_FAILURE);
+ stream_write_BYTE(s, 0); /* flags */
+ stream_write_UINT16(s, 8); /* RDP_NEG_DATA length (8) */
/*
* TODO: Check for other possibilities,
* like SSL_NOT_ALLOWED_BY_SERVER.
uint32 selected_protocol;
uint32 requested_protocols;
BOOL security_layer_negotiation_enabled;
- uint8 enabled_protocols[3];
+ BYTE enabled_protocols[3];
rdpTransport* transport;
};
#endif /* WITH_DEBUG_ORDERS */
-static const uint8 PRIMARY_DRAWING_ORDER_FIELD_BYTES[] =
+static const BYTE PRIMARY_DRAWING_ORDER_FIELD_BYTES[] =
{
DSTBLT_ORDER_FIELD_BYTES,
PATBLT_ORDER_FIELD_BYTES,
#define PRIMARY_DRAWING_ORDER_COUNT (ARRAY_SIZE(PRIMARY_DRAWING_ORDER_FIELD_BYTES))
-static const uint8 CBR2_BPP[] =
+static const BYTE CBR2_BPP[] =
{
0, 0, 0, 8, 16, 24, 32
};
-static const uint8 CBR23_BPP[] =
+static const BYTE CBR23_BPP[] =
{
0, 0, 0, 8, 16, 24, 32
};
-static const uint8 BMF_BPP[] =
+static const BYTE BMF_BPP[] =
{
0, 1, 0, 8, 16, 24, 32
};
static INLINE void update_read_coord(STREAM* s, sint32* coord, BOOL delta)
{
- sint8 lsi8;
- sint16 lsi16;
+ INT8 lsi8;
+ INT16 lsi16;
if (delta)
{
- stream_read_uint8(s, lsi8);
+ stream_read_BYTE(s, lsi8);
*coord += lsi8;
}
else
{
- stream_read_uint16(s, lsi16);
+ stream_read_UINT16(s, lsi16);
*coord = lsi16;
}
}
static INLINE void update_read_color(STREAM* s, uint32* color)
{
- uint8 byte;
+ BYTE byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*color = byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*color |= (byte << 8);
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*color |= (byte << 16);
}
static INLINE void update_read_colorref(STREAM* s, uint32* color)
{
- uint8 byte;
+ BYTE byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*color = byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*color |= (byte << 8);
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*color |= (byte << 16);
- stream_seek_uint8(s);
+ stream_seek_BYTE(s);
}
static INLINE void update_read_color_quad(STREAM* s, uint32* color)
{
- uint8 byte;
+ BYTE byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*color = (byte << 16);
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*color |= (byte << 8);
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*color |= byte;
- stream_seek_uint8(s);
+ stream_seek_BYTE(s);
}
static INLINE void update_read_2byte_unsigned(STREAM* s, uint32* value)
{
- uint8 byte;
+ BYTE byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte & 0x80)
{
*value = (byte & 0x7F) << 8;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*value |= byte;
}
else
static INLINE void update_read_2byte_signed(STREAM* s, sint32* value)
{
- uint8 byte;
+ BYTE byte;
BOOL negative;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
negative = (byte & 0x40) ? TRUE : FALSE;
if (byte & 0x80)
{
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*value = (*value << 8) | byte;
}
static INLINE void update_read_4byte_unsigned(STREAM* s, uint32* value)
{
- uint8 byte;
- uint8 count;
+ BYTE byte;
+ BYTE count;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
count = (byte & 0xC0) >> 6;
case 1:
*value = (byte & 0x3F) << 8;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*value |= byte;
break;
case 2:
*value = (byte & 0x3F) << 16;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*value |= (byte << 8);
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*value |= byte;
break;
case 3:
*value = (byte & 0x3F) << 24;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*value |= (byte << 16);
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*value |= (byte << 8);
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*value |= byte;
break;
static INLINE void update_read_delta(STREAM* s, sint32* value)
{
- uint8 byte;
+ BYTE byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte & 0x40)
*value = (byte | ~0x3F);
if (byte & 0x80)
{
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*value = (*value << 8) | byte;
}
}
-static INLINE void update_read_glyph_delta(STREAM* s, uint16* value)
+static INLINE void update_read_glyph_delta(STREAM* s, UINT16* value)
{
- uint8 byte;
+ BYTE byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte == 0x80)
- stream_read_uint16(s, *value);
+ stream_read_UINT16(s, *value);
else
*value = (byte & 0x3F);
}
static INLINE void update_seek_glyph_delta(STREAM* s)
{
- uint8 byte;
+ BYTE byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte & 0x80)
- stream_seek_uint8(s);
+ stream_seek_BYTE(s);
}
-static INLINE void update_read_brush(STREAM* s, rdpBrush* brush, uint8 fieldFlags)
+static INLINE void update_read_brush(STREAM* s, rdpBrush* brush, BYTE fieldFlags)
{
if (fieldFlags & ORDER_FIELD_01)
- stream_read_uint8(s, brush->x);
+ stream_read_BYTE(s, brush->x);
if (fieldFlags & ORDER_FIELD_02)
- stream_read_uint8(s, brush->y);
+ stream_read_BYTE(s, brush->y);
if (fieldFlags & ORDER_FIELD_03)
- stream_read_uint8(s, brush->style);
+ stream_read_BYTE(s, brush->style);
if (fieldFlags & ORDER_FIELD_04)
- stream_read_uint8(s, brush->hatch);
+ stream_read_BYTE(s, brush->hatch);
if (brush->style & CACHED_BRUSH)
{
if (fieldFlags & ORDER_FIELD_05)
{
- brush->data = (uint8*) brush->p8x8;
- stream_read_uint8(s, brush->data[7]);
- stream_read_uint8(s, brush->data[6]);
- stream_read_uint8(s, brush->data[5]);
- stream_read_uint8(s, brush->data[4]);
- stream_read_uint8(s, brush->data[3]);
- stream_read_uint8(s, brush->data[2]);
- stream_read_uint8(s, brush->data[1]);
+ brush->data = (BYTE*) brush->p8x8;
+ stream_read_BYTE(s, brush->data[7]);
+ stream_read_BYTE(s, brush->data[6]);
+ stream_read_BYTE(s, brush->data[5]);
+ stream_read_BYTE(s, brush->data[4]);
+ stream_read_BYTE(s, brush->data[3]);
+ stream_read_BYTE(s, brush->data[2]);
+ stream_read_BYTE(s, brush->data[1]);
brush->data[0] = brush->hatch;
}
}
static INLINE void update_read_delta_rects(STREAM* s, DELTA_RECT* rectangles, int number)
{
int i;
- uint8 flags = 0;
- uint8* zeroBits;
+ BYTE flags = 0;
+ BYTE* zeroBits;
int zeroBitsSize;
if (number > 45)
}
}
-static INLINE void update_read_delta_points(STREAM* s, DELTA_POINT* points, int number, sint16 x, sint16 y)
+static INLINE void update_read_delta_points(STREAM* s, DELTA_POINT* points, int number, INT16 x, INT16 y)
{
int i;
- uint8 flags = 0;
- uint8* zeroBits;
+ BYTE flags = 0;
+ BYTE* zeroBits;
int zeroBitsSize;
zeroBitsSize = ((number + 3) / 4);
update_read_coord(s, &dstblt->nHeight, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
- stream_read_uint8(s, dstblt->bRop);
+ stream_read_BYTE(s, dstblt->bRop);
}
void update_read_patblt_order(STREAM* s, ORDER_INFO* orderInfo, PATBLT_ORDER* patblt)
update_read_coord(s, &patblt->nHeight, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
- stream_read_uint8(s, patblt->bRop);
+ stream_read_BYTE(s, patblt->bRop);
if (orderInfo->fieldFlags & ORDER_FIELD_06)
update_read_color(s, &patblt->backColor);
update_read_coord(s, &scrblt->nHeight, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
- stream_read_uint8(s, scrblt->bRop);
+ stream_read_BYTE(s, scrblt->bRop);
if (orderInfo->fieldFlags & ORDER_FIELD_06)
update_read_coord(s, &scrblt->nXSrc, orderInfo->deltaCoordinates);
void update_read_opaque_rect_order(STREAM* s, ORDER_INFO* orderInfo, OPAQUE_RECT_ORDER* opaque_rect)
{
- uint8 byte;
+ BYTE byte;
if (orderInfo->fieldFlags & ORDER_FIELD_01)
update_read_coord(s, &opaque_rect->nLeftRect, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
{
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
opaque_rect->color = (opaque_rect->color & 0xFFFFFF00) | byte;
}
if (orderInfo->fieldFlags & ORDER_FIELD_06)
{
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
opaque_rect->color = (opaque_rect->color & 0xFFFF00FF) | (byte << 8);
}
if (orderInfo->fieldFlags & ORDER_FIELD_07)
{
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
opaque_rect->color = (opaque_rect->color & 0xFF00FFFF) | (byte << 16);
}
}
update_read_coord(s, &draw_nine_grid->srcBottom, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
- stream_read_uint16(s, draw_nine_grid->bitmapId);
+ stream_read_UINT16(s, draw_nine_grid->bitmapId);
}
void update_read_multi_dstblt_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_DSTBLT_ORDER* multi_dstblt)
update_read_coord(s, &multi_dstblt->nHeight, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
- stream_read_uint8(s, multi_dstblt->bRop);
+ stream_read_BYTE(s, multi_dstblt->bRop);
if (orderInfo->fieldFlags & ORDER_FIELD_06)
- stream_read_uint8(s, multi_dstblt->numRectangles);
+ stream_read_BYTE(s, multi_dstblt->numRectangles);
if (orderInfo->fieldFlags & ORDER_FIELD_07)
{
- stream_read_uint16(s, multi_dstblt->cbData);
+ stream_read_UINT16(s, multi_dstblt->cbData);
update_read_delta_rects(s, multi_dstblt->rectangles, multi_dstblt->numRectangles);
}
}
update_read_coord(s, &multi_patblt->nHeight, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
- stream_read_uint8(s, multi_patblt->bRop);
+ stream_read_BYTE(s, multi_patblt->bRop);
if (orderInfo->fieldFlags & ORDER_FIELD_06)
update_read_color(s, &multi_patblt->backColor);
update_read_brush(s, &multi_patblt->brush, orderInfo->fieldFlags >> 7);
if (orderInfo->fieldFlags & ORDER_FIELD_13)
- stream_read_uint8(s, multi_patblt->numRectangles);
+ stream_read_BYTE(s, multi_patblt->numRectangles);
if (orderInfo->fieldFlags & ORDER_FIELD_14)
{
- stream_read_uint16(s, multi_patblt->cbData);
+ stream_read_UINT16(s, multi_patblt->cbData);
update_read_delta_rects(s, multi_patblt->rectangles, multi_patblt->numRectangles);
}
}
update_read_coord(s, &multi_scrblt->nHeight, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
- stream_read_uint8(s, multi_scrblt->bRop);
+ stream_read_BYTE(s, multi_scrblt->bRop);
if (orderInfo->fieldFlags & ORDER_FIELD_06)
update_read_coord(s, &multi_scrblt->nXSrc, orderInfo->deltaCoordinates);
update_read_coord(s, &multi_scrblt->nYSrc, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_08)
- stream_read_uint8(s, multi_scrblt->numRectangles);
+ stream_read_BYTE(s, multi_scrblt->numRectangles);
if (orderInfo->fieldFlags & ORDER_FIELD_09)
{
- stream_read_uint16(s, multi_scrblt->cbData);
+ stream_read_UINT16(s, multi_scrblt->cbData);
update_read_delta_rects(s, multi_scrblt->rectangles, multi_scrblt->numRectangles);
}
}
void update_read_multi_opaque_rect_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect)
{
- uint8 byte;
+ BYTE byte;
if (orderInfo->fieldFlags & ORDER_FIELD_01)
update_read_coord(s, &multi_opaque_rect->nLeftRect, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
{
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
multi_opaque_rect->color = (multi_opaque_rect->color & 0xFFFFFF00) | byte;
}
if (orderInfo->fieldFlags & ORDER_FIELD_06)
{
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
multi_opaque_rect->color = (multi_opaque_rect->color & 0xFFFF00FF) | (byte << 8);
}
if (orderInfo->fieldFlags & ORDER_FIELD_07)
{
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
multi_opaque_rect->color = (multi_opaque_rect->color & 0xFF00FFFF) | (byte << 16);
}
if (orderInfo->fieldFlags & ORDER_FIELD_08)
- stream_read_uint8(s, multi_opaque_rect->numRectangles);
+ stream_read_BYTE(s, multi_opaque_rect->numRectangles);
if (orderInfo->fieldFlags & ORDER_FIELD_09)
{
- stream_read_uint16(s, multi_opaque_rect->cbData);
+ stream_read_UINT16(s, multi_opaque_rect->cbData);
update_read_delta_rects(s, multi_opaque_rect->rectangles, multi_opaque_rect->numRectangles);
}
}
update_read_coord(s, &multi_draw_nine_grid->srcBottom, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
- stream_read_uint16(s, multi_draw_nine_grid->bitmapId);
+ stream_read_UINT16(s, multi_draw_nine_grid->bitmapId);
if (orderInfo->fieldFlags & ORDER_FIELD_06)
- stream_read_uint8(s, multi_draw_nine_grid->nDeltaEntries);
+ stream_read_BYTE(s, multi_draw_nine_grid->nDeltaEntries);
if (orderInfo->fieldFlags & ORDER_FIELD_07)
{
- stream_read_uint16(s, multi_draw_nine_grid->cbData);
+ stream_read_UINT16(s, multi_draw_nine_grid->cbData);
stream_seek(s, multi_draw_nine_grid->cbData);
}
}
void update_read_line_to_order(STREAM* s, ORDER_INFO* orderInfo, LINE_TO_ORDER* line_to)
{
if (orderInfo->fieldFlags & ORDER_FIELD_01)
- stream_read_uint16(s, line_to->backMode);
+ stream_read_UINT16(s, line_to->backMode);
if (orderInfo->fieldFlags & ORDER_FIELD_02)
update_read_coord(s, &line_to->nXStart, orderInfo->deltaCoordinates);
update_read_color(s, &line_to->backColor);
if (orderInfo->fieldFlags & ORDER_FIELD_07)
- stream_read_uint8(s, line_to->bRop2);
+ stream_read_BYTE(s, line_to->bRop2);
if (orderInfo->fieldFlags & ORDER_FIELD_08)
- stream_read_uint8(s, line_to->penStyle);
+ stream_read_BYTE(s, line_to->penStyle);
if (orderInfo->fieldFlags & ORDER_FIELD_09)
- stream_read_uint8(s, line_to->penWidth);
+ stream_read_BYTE(s, line_to->penWidth);
if (orderInfo->fieldFlags & ORDER_FIELD_10)
update_read_color(s, &line_to->penColor);
update_read_coord(s, &polyline->yStart, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_03)
- stream_read_uint8(s, polyline->bRop2);
+ stream_read_BYTE(s, polyline->bRop2);
if (orderInfo->fieldFlags & ORDER_FIELD_04)
- stream_seek_uint16(s);
+ stream_seek_UINT16(s);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
update_read_color(s, &polyline->penColor);
if (orderInfo->fieldFlags & ORDER_FIELD_06)
- stream_read_uint8(s, polyline->numPoints);
+ stream_read_BYTE(s, polyline->numPoints);
if (orderInfo->fieldFlags & ORDER_FIELD_07)
{
- stream_read_uint8(s, polyline->cbData);
+ stream_read_BYTE(s, polyline->cbData);
if (polyline->points == NULL)
polyline->points = (DELTA_POINT*) malloc(sizeof(DELTA_POINT) * polyline->numPoints);
void update_read_memblt_order(STREAM* s, ORDER_INFO* orderInfo, MEMBLT_ORDER* memblt)
{
if (orderInfo->fieldFlags & ORDER_FIELD_01)
- stream_read_uint16(s, memblt->cacheId);
+ stream_read_UINT16(s, memblt->cacheId);
if (orderInfo->fieldFlags & ORDER_FIELD_02)
update_read_coord(s, &memblt->nLeftRect, orderInfo->deltaCoordinates);
update_read_coord(s, &memblt->nHeight, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_06)
- stream_read_uint8(s, memblt->bRop);
+ stream_read_BYTE(s, memblt->bRop);
if (orderInfo->fieldFlags & ORDER_FIELD_07)
update_read_coord(s, &memblt->nXSrc, orderInfo->deltaCoordinates);
update_read_coord(s, &memblt->nYSrc, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_09)
- stream_read_uint16(s, memblt->cacheIndex);
+ stream_read_UINT16(s, memblt->cacheIndex);
memblt->colorIndex = (memblt->cacheId >> 8);
memblt->cacheId = (memblt->cacheId & 0xFF);
void update_read_mem3blt_order(STREAM* s, ORDER_INFO* orderInfo, MEM3BLT_ORDER* mem3blt)
{
if (orderInfo->fieldFlags & ORDER_FIELD_01)
- stream_read_uint16(s, mem3blt->cacheId);
+ stream_read_UINT16(s, mem3blt->cacheId);
if (orderInfo->fieldFlags & ORDER_FIELD_02)
update_read_coord(s, &mem3blt->nLeftRect, orderInfo->deltaCoordinates);
update_read_coord(s, &mem3blt->nHeight, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_06)
- stream_read_uint8(s, mem3blt->bRop);
+ stream_read_BYTE(s, mem3blt->bRop);
if (orderInfo->fieldFlags & ORDER_FIELD_07)
update_read_coord(s, &mem3blt->nXSrc, orderInfo->deltaCoordinates);
update_read_brush(s, &mem3blt->brush, orderInfo->fieldFlags >> 10);
if (orderInfo->fieldFlags & ORDER_FIELD_16)
- stream_read_uint16(s, mem3blt->cacheIndex);
+ stream_read_UINT16(s, mem3blt->cacheIndex);
mem3blt->colorIndex = (mem3blt->cacheId >> 8);
mem3blt->cacheId = (mem3blt->cacheId & 0xFF);
update_read_coord(s, &save_bitmap->nBottomRect, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_06)
- stream_read_uint8(s, save_bitmap->operation);
+ stream_read_BYTE(s, save_bitmap->operation);
}
void update_read_glyph_index_order(STREAM* s, ORDER_INFO* orderInfo, GLYPH_INDEX_ORDER* glyph_index)
{
if (orderInfo->fieldFlags & ORDER_FIELD_01)
- stream_read_uint8(s, glyph_index->cacheId);
+ stream_read_BYTE(s, glyph_index->cacheId);
if (orderInfo->fieldFlags & ORDER_FIELD_02)
- stream_read_uint8(s, glyph_index->flAccel);
+ stream_read_BYTE(s, glyph_index->flAccel);
if (orderInfo->fieldFlags & ORDER_FIELD_03)
- stream_read_uint8(s, glyph_index->ulCharInc);
+ stream_read_BYTE(s, glyph_index->ulCharInc);
if (orderInfo->fieldFlags & ORDER_FIELD_04)
- stream_read_uint8(s, glyph_index->fOpRedundant);
+ stream_read_BYTE(s, glyph_index->fOpRedundant);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
update_read_color(s, &glyph_index->backColor);
update_read_color(s, &glyph_index->foreColor);
if (orderInfo->fieldFlags & ORDER_FIELD_07)
- stream_read_uint16(s, glyph_index->bkLeft);
+ stream_read_UINT16(s, glyph_index->bkLeft);
if (orderInfo->fieldFlags & ORDER_FIELD_08)
- stream_read_uint16(s, glyph_index->bkTop);
+ stream_read_UINT16(s, glyph_index->bkTop);
if (orderInfo->fieldFlags & ORDER_FIELD_09)
- stream_read_uint16(s, glyph_index->bkRight);
+ stream_read_UINT16(s, glyph_index->bkRight);
if (orderInfo->fieldFlags & ORDER_FIELD_10)
- stream_read_uint16(s, glyph_index->bkBottom);
+ stream_read_UINT16(s, glyph_index->bkBottom);
if (orderInfo->fieldFlags & ORDER_FIELD_11)
- stream_read_uint16(s, glyph_index->opLeft);
+ stream_read_UINT16(s, glyph_index->opLeft);
if (orderInfo->fieldFlags & ORDER_FIELD_12)
- stream_read_uint16(s, glyph_index->opTop);
+ stream_read_UINT16(s, glyph_index->opTop);
if (orderInfo->fieldFlags & ORDER_FIELD_13)
- stream_read_uint16(s, glyph_index->opRight);
+ stream_read_UINT16(s, glyph_index->opRight);
if (orderInfo->fieldFlags & ORDER_FIELD_14)
- stream_read_uint16(s, glyph_index->opBottom);
+ stream_read_UINT16(s, glyph_index->opBottom);
update_read_brush(s, &glyph_index->brush, orderInfo->fieldFlags >> 14);
if (orderInfo->fieldFlags & ORDER_FIELD_20)
- stream_read_uint16(s, glyph_index->x);
+ stream_read_UINT16(s, glyph_index->x);
if (orderInfo->fieldFlags & ORDER_FIELD_21)
- stream_read_uint16(s, glyph_index->y);
+ stream_read_UINT16(s, glyph_index->y);
if (orderInfo->fieldFlags & ORDER_FIELD_22)
{
- stream_read_uint8(s, glyph_index->cbData);
+ stream_read_BYTE(s, glyph_index->cbData);
memcpy(glyph_index->data, s->p, glyph_index->cbData);
stream_seek(s, glyph_index->cbData);
}
void update_read_fast_index_order(STREAM* s, ORDER_INFO* orderInfo, FAST_INDEX_ORDER* fast_index)
{
if (orderInfo->fieldFlags & ORDER_FIELD_01)
- stream_read_uint8(s, fast_index->cacheId);
+ stream_read_BYTE(s, fast_index->cacheId);
if (orderInfo->fieldFlags & ORDER_FIELD_02)
{
- stream_read_uint8(s, fast_index->ulCharInc);
- stream_read_uint8(s, fast_index->flAccel);
+ stream_read_BYTE(s, fast_index->ulCharInc);
+ stream_read_BYTE(s, fast_index->flAccel);
}
if (orderInfo->fieldFlags & ORDER_FIELD_03)
if (orderInfo->fieldFlags & ORDER_FIELD_15)
{
- stream_read_uint8(s, fast_index->cbData);
+ stream_read_BYTE(s, fast_index->cbData);
memcpy(fast_index->data, s->p, fast_index->cbData);
stream_seek(s, fast_index->cbData);
}
void update_read_fast_glyph_order(STREAM* s, ORDER_INFO* orderInfo, FAST_GLYPH_ORDER* fast_glyph)
{
GLYPH_DATA_V2* glyph;
- uint8* phold;
+ BYTE* phold;
if (orderInfo->fieldFlags & ORDER_FIELD_01)
- stream_read_uint8(s, fast_glyph->cacheId);
+ stream_read_BYTE(s, fast_glyph->cacheId);
if (orderInfo->fieldFlags & ORDER_FIELD_02)
{
- stream_read_uint8(s, fast_glyph->ulCharInc);
- stream_read_uint8(s, fast_glyph->flAccel);
+ stream_read_BYTE(s, fast_glyph->ulCharInc);
+ stream_read_BYTE(s, fast_glyph->flAccel);
}
if (orderInfo->fieldFlags & ORDER_FIELD_03)
if (orderInfo->fieldFlags & ORDER_FIELD_15)
{
- stream_read_uint8(s, fast_glyph->cbData);
+ stream_read_BYTE(s, fast_glyph->cbData);
memcpy(fast_glyph->data, s->p, fast_glyph->cbData);
phold = s->p;
stream_seek(s, 1);
update_read_2byte_unsigned(s, &glyph->cy);
glyph->cb = ((glyph->cx + 7) / 8) * glyph->cy;
glyph->cb += ((glyph->cb % 4) > 0) ? 4 - (glyph->cb % 4) : 0;
- glyph->aj = (uint8*) malloc(glyph->cb);
+ glyph->aj = (BYTE*) malloc(glyph->cb);
stream_read(s, glyph->aj, glyph->cb);
fast_glyph->glyph_data = glyph;
}
update_read_coord(s, &polygon_sc->yStart, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_03)
- stream_read_uint8(s, polygon_sc->bRop2);
+ stream_read_BYTE(s, polygon_sc->bRop2);
if (orderInfo->fieldFlags & ORDER_FIELD_04)
- stream_read_uint8(s, polygon_sc->fillMode);
+ stream_read_BYTE(s, polygon_sc->fillMode);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
update_read_color(s, &polygon_sc->brushColor);
if (orderInfo->fieldFlags & ORDER_FIELD_06)
- stream_read_uint8(s, polygon_sc->numPoints);
+ stream_read_BYTE(s, polygon_sc->numPoints);
if (orderInfo->fieldFlags & ORDER_FIELD_07)
{
- stream_read_uint8(s, polygon_sc->cbData);
+ stream_read_BYTE(s, polygon_sc->cbData);
if (polygon_sc->points == NULL)
polygon_sc->points = (DELTA_POINT*) malloc(sizeof(DELTA_POINT) * polygon_sc->numPoints);
update_read_coord(s, &polygon_cb->yStart, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_03)
- stream_read_uint8(s, polygon_cb->bRop2);
+ stream_read_BYTE(s, polygon_cb->bRop2);
if (orderInfo->fieldFlags & ORDER_FIELD_04)
- stream_read_uint8(s, polygon_cb->fillMode);
+ stream_read_BYTE(s, polygon_cb->fillMode);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
update_read_color(s, &polygon_cb->backColor);
update_read_brush(s, &polygon_cb->brush, orderInfo->fieldFlags >> 6);
if (orderInfo->fieldFlags & ORDER_FIELD_12)
- stream_read_uint8(s, polygon_cb->numPoints);
+ stream_read_BYTE(s, polygon_cb->numPoints);
if (orderInfo->fieldFlags & ORDER_FIELD_13)
{
- stream_read_uint8(s, polygon_cb->cbData);
+ stream_read_BYTE(s, polygon_cb->cbData);
if (polygon_cb->points == NULL)
polygon_cb->points = (DELTA_POINT*) malloc(sizeof(DELTA_POINT) * polygon_cb->numPoints);
update_read_coord(s, &ellipse_sc->bottomRect, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
- stream_read_uint8(s, ellipse_sc->bRop2);
+ stream_read_BYTE(s, ellipse_sc->bRop2);
if (orderInfo->fieldFlags & ORDER_FIELD_06)
- stream_read_uint8(s, ellipse_sc->fillMode);
+ stream_read_BYTE(s, ellipse_sc->fillMode);
if (orderInfo->fieldFlags & ORDER_FIELD_07)
update_read_color(s, &ellipse_sc->color);
update_read_coord(s, &ellipse_cb->bottomRect, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_05)
- stream_read_uint8(s, ellipse_cb->bRop2);
+ stream_read_BYTE(s, ellipse_cb->bRop2);
if (orderInfo->fieldFlags & ORDER_FIELD_06)
- stream_read_uint8(s, ellipse_cb->fillMode);
+ stream_read_BYTE(s, ellipse_cb->fillMode);
if (orderInfo->fieldFlags & ORDER_FIELD_07)
update_read_color(s, &ellipse_cb->backColor);
/* Secondary Drawing Orders */
-void update_read_cache_bitmap_order(STREAM* s, CACHE_BITMAP_ORDER* cache_bitmap_order, BOOL compressed, uint16 flags)
+void update_read_cache_bitmap_order(STREAM* s, CACHE_BITMAP_ORDER* cache_bitmap_order, BOOL compressed, UINT16 flags)
{
- stream_read_uint8(s, cache_bitmap_order->cacheId); /* cacheId (1 byte) */
- stream_seek_uint8(s); /* pad1Octet (1 byte) */
- stream_read_uint8(s, cache_bitmap_order->bitmapWidth); /* bitmapWidth (1 byte) */
- stream_read_uint8(s, cache_bitmap_order->bitmapHeight); /* bitmapHeight (1 byte) */
- stream_read_uint8(s, cache_bitmap_order->bitmapBpp); /* bitmapBpp (1 byte) */
- stream_read_uint16(s, cache_bitmap_order->bitmapLength); /* bitmapLength (2 bytes) */
- stream_read_uint16(s, cache_bitmap_order->cacheIndex); /* cacheIndex (2 bytes) */
+ stream_read_BYTE(s, cache_bitmap_order->cacheId); /* cacheId (1 byte) */
+ stream_seek_BYTE(s); /* pad1Octet (1 byte) */
+ stream_read_BYTE(s, cache_bitmap_order->bitmapWidth); /* bitmapWidth (1 byte) */
+ stream_read_BYTE(s, cache_bitmap_order->bitmapHeight); /* bitmapHeight (1 byte) */
+ stream_read_BYTE(s, cache_bitmap_order->bitmapBpp); /* bitmapBpp (1 byte) */
+ stream_read_UINT16(s, cache_bitmap_order->bitmapLength); /* bitmapLength (2 bytes) */
+ stream_read_UINT16(s, cache_bitmap_order->cacheIndex); /* cacheIndex (2 bytes) */
if (compressed)
{
if ((flags & NO_BITMAP_COMPRESSION_HDR) == 0)
{
- uint8* bitmapComprHdr = (uint8*) &(cache_bitmap_order->bitmapComprHdr);
+ BYTE* bitmapComprHdr = (BYTE*) &(cache_bitmap_order->bitmapComprHdr);
stream_read(s, bitmapComprHdr, 8); /* bitmapComprHdr (8 bytes) */
cache_bitmap_order->bitmapLength -= 8;
}
cache_bitmap_order->compressed = compressed;
}
-void update_read_cache_bitmap_v2_order(STREAM* s, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2_order, BOOL compressed, uint16 flags)
+void update_read_cache_bitmap_v2_order(STREAM* s, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2_order, BOOL compressed, UINT16 flags)
{
- uint8 bitsPerPixelId;
+ BYTE bitsPerPixelId;
cache_bitmap_v2_order->cacheId = flags & 0x0003;
cache_bitmap_v2_order->flags = (flags & 0xFF80) >> 7;
{
if (!(cache_bitmap_v2_order->flags & CBR2_NO_BITMAP_COMPRESSION_HDR))
{
- stream_read_uint16(s, cache_bitmap_v2_order->cbCompFirstRowSize); /* cbCompFirstRowSize (2 bytes) */
- stream_read_uint16(s, cache_bitmap_v2_order->cbCompMainBodySize); /* cbCompMainBodySize (2 bytes) */
- stream_read_uint16(s, cache_bitmap_v2_order->cbScanWidth); /* cbScanWidth (2 bytes) */
- stream_read_uint16(s, cache_bitmap_v2_order->cbUncompressedSize); /* cbUncompressedSize (2 bytes) */
+ stream_read_UINT16(s, cache_bitmap_v2_order->cbCompFirstRowSize); /* cbCompFirstRowSize (2 bytes) */
+ stream_read_UINT16(s, cache_bitmap_v2_order->cbCompMainBodySize); /* cbCompMainBodySize (2 bytes) */
+ stream_read_UINT16(s, cache_bitmap_v2_order->cbScanWidth); /* cbScanWidth (2 bytes) */
+ stream_read_UINT16(s, cache_bitmap_v2_order->cbUncompressedSize); /* cbUncompressedSize (2 bytes) */
cache_bitmap_v2_order->bitmapLength = cache_bitmap_v2_order->cbCompMainBodySize;
}
cache_bitmap_v2_order->compressed = compressed;
}
-void update_read_cache_bitmap_v3_order(STREAM* s, CACHE_BITMAP_V3_ORDER* cache_bitmap_v3_order, BOOL compressed, uint16 flags)
+void update_read_cache_bitmap_v3_order(STREAM* s, CACHE_BITMAP_V3_ORDER* cache_bitmap_v3_order, BOOL compressed, UINT16 flags)
{
- uint8 bitsPerPixelId;
+ BYTE bitsPerPixelId;
BITMAP_DATA_EX* bitmapData;
cache_bitmap_v3_order->cacheId = flags & 0x00000003;
bitsPerPixelId = (flags & 0x00000078) >> 3;
cache_bitmap_v3_order->bpp = CBR23_BPP[bitsPerPixelId];
- stream_read_uint16(s, cache_bitmap_v3_order->cacheIndex); /* cacheIndex (2 bytes) */
+ stream_read_UINT16(s, cache_bitmap_v3_order->cacheIndex); /* cacheIndex (2 bytes) */
stream_read_uint32(s, cache_bitmap_v3_order->key1); /* key1 (4 bytes) */
stream_read_uint32(s, cache_bitmap_v3_order->key2); /* key2 (4 bytes) */
bitmapData = &cache_bitmap_v3_order->bitmapData;
- stream_read_uint8(s, bitmapData->bpp);
- stream_seek_uint8(s); /* reserved1 (1 byte) */
- stream_seek_uint8(s); /* reserved2 (1 byte) */
- stream_read_uint8(s, bitmapData->codecID); /* codecID (1 byte) */
- stream_read_uint16(s, bitmapData->width); /* width (2 bytes) */
- stream_read_uint16(s, bitmapData->height); /* height (2 bytes) */
+ stream_read_BYTE(s, bitmapData->bpp);
+ stream_seek_BYTE(s); /* reserved1 (1 byte) */
+ stream_seek_BYTE(s); /* reserved2 (1 byte) */
+ stream_read_BYTE(s, bitmapData->codecID); /* codecID (1 byte) */
+ stream_read_UINT16(s, bitmapData->width); /* width (2 bytes) */
+ stream_read_UINT16(s, bitmapData->height); /* height (2 bytes) */
stream_read_uint32(s, bitmapData->length); /* length (4 bytes) */
if (bitmapData->data == NULL)
- bitmapData->data = (uint8*) malloc(bitmapData->length);
+ bitmapData->data = (BYTE*) malloc(bitmapData->length);
else
- bitmapData->data = (uint8*) realloc(bitmapData->data, bitmapData->length);
+ bitmapData->data = (BYTE*) realloc(bitmapData->data, bitmapData->length);
stream_read(s, bitmapData->data, bitmapData->length);
}
-void update_read_cache_color_table_order(STREAM* s, CACHE_COLOR_TABLE_ORDER* cache_color_table_order, uint16 flags)
+void update_read_cache_color_table_order(STREAM* s, CACHE_COLOR_TABLE_ORDER* cache_color_table_order, UINT16 flags)
{
int i;
uint32* colorTable;
- stream_read_uint8(s, cache_color_table_order->cacheIndex); /* cacheIndex (1 byte) */
- stream_read_uint8(s, cache_color_table_order->numberColors); /* numberColors (2 bytes) */
+ stream_read_BYTE(s, cache_color_table_order->cacheIndex); /* cacheIndex (1 byte) */
+ stream_read_BYTE(s, cache_color_table_order->numberColors); /* numberColors (2 bytes) */
colorTable = cache_color_table_order->colorTable;
cache_color_table_order->colorTable = colorTable;
}
-void update_read_cache_glyph_order(STREAM* s, CACHE_GLYPH_ORDER* cache_glyph_order, uint16 flags)
+void update_read_cache_glyph_order(STREAM* s, CACHE_GLYPH_ORDER* cache_glyph_order, UINT16 flags)
{
int i;
- sint16 lsi16;
+ INT16 lsi16;
GLYPH_DATA* glyph;
- stream_read_uint8(s, cache_glyph_order->cacheId); /* cacheId (1 byte) */
- stream_read_uint8(s, cache_glyph_order->cGlyphs); /* cGlyphs (1 byte) */
+ stream_read_BYTE(s, cache_glyph_order->cacheId); /* cacheId (1 byte) */
+ stream_read_BYTE(s, cache_glyph_order->cGlyphs); /* cGlyphs (1 byte) */
for (i = 0; i < (int) cache_glyph_order->cGlyphs; i++)
{
}
glyph = cache_glyph_order->glyphData[i];
- stream_read_uint16(s, glyph->cacheIndex);
- stream_read_uint16(s, lsi16);
+ stream_read_UINT16(s, glyph->cacheIndex);
+ stream_read_UINT16(s, lsi16);
glyph->x = lsi16;
- stream_read_uint16(s, lsi16);
+ stream_read_UINT16(s, lsi16);
glyph->y = lsi16;
- stream_read_uint16(s, glyph->cx);
- stream_read_uint16(s, glyph->cy);
+ stream_read_UINT16(s, glyph->cx);
+ stream_read_UINT16(s, glyph->cy);
glyph->cb = ((glyph->cx + 7) / 8) * glyph->cy;
glyph->cb += ((glyph->cb % 4) > 0) ? 4 - (glyph->cb % 4) : 0;
- glyph->aj = (uint8*) malloc(glyph->cb);
+ glyph->aj = (BYTE*) malloc(glyph->cb);
stream_read(s, glyph->aj, glyph->cb);
}
stream_seek(s, cache_glyph_order->cGlyphs * 2);
}
-void update_read_cache_glyph_v2_order(STREAM* s, CACHE_GLYPH_V2_ORDER* cache_glyph_v2_order, uint16 flags)
+void update_read_cache_glyph_v2_order(STREAM* s, CACHE_GLYPH_V2_ORDER* cache_glyph_v2_order, UINT16 flags)
{
int i;
GLYPH_DATA_V2* glyph;
}
glyph = cache_glyph_v2_order->glyphData[i];
- stream_read_uint8(s, glyph->cacheIndex);
+ stream_read_BYTE(s, glyph->cacheIndex);
update_read_2byte_signed(s, &glyph->x);
update_read_2byte_signed(s, &glyph->y);
update_read_2byte_unsigned(s, &glyph->cx);
glyph->cb = ((glyph->cx + 7) / 8) * glyph->cy;
glyph->cb += ((glyph->cb % 4) > 0) ? 4 - (glyph->cb % 4) : 0;
- glyph->aj = (uint8*) malloc(glyph->cb);
+ glyph->aj = (BYTE*) malloc(glyph->cb);
stream_read(s, glyph->aj, glyph->cb);
}
stream_seek(s, cache_glyph_v2_order->cGlyphs * 2);
}
-void update_decompress_brush(STREAM* s, uint8* output, uint8 bpp)
+void update_decompress_brush(STREAM* s, BYTE* output, BYTE bpp)
{
int index;
int x, y, k;
- uint8 byte = 0;
- uint8* palette;
+ BYTE byte = 0;
+ BYTE* palette;
int bytesPerPixel;
palette = s->p + 16;
for (x = 0; x < 8; x++)
{
if ((x % 4) == 0)
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
index = ((byte >> ((3 - (x % 4)) * 2)) & 0x03);
}
}
-void update_read_cache_brush_order(STREAM* s, CACHE_BRUSH_ORDER* cache_brush_order, uint16 flags)
+void update_read_cache_brush_order(STREAM* s, CACHE_BRUSH_ORDER* cache_brush_order, UINT16 flags)
{
int i;
int size;
- uint8 iBitmapFormat;
+ BYTE iBitmapFormat;
BOOL compressed = FALSE;
- stream_read_uint8(s, cache_brush_order->index); /* cacheEntry (1 byte) */
+ stream_read_BYTE(s, cache_brush_order->index); /* cacheEntry (1 byte) */
- stream_read_uint8(s, iBitmapFormat); /* iBitmapFormat (1 byte) */
+ stream_read_BYTE(s, iBitmapFormat); /* iBitmapFormat (1 byte) */
cache_brush_order->bpp = BMF_BPP[iBitmapFormat];
- stream_read_uint8(s, cache_brush_order->cx); /* cx (1 byte) */
- stream_read_uint8(s, cache_brush_order->cy); /* cy (1 byte) */
- stream_read_uint8(s, cache_brush_order->style); /* style (1 byte) */
- stream_read_uint8(s, cache_brush_order->length); /* iBytes (1 byte) */
+ stream_read_BYTE(s, cache_brush_order->cx); /* cx (1 byte) */
+ stream_read_BYTE(s, cache_brush_order->cy); /* cy (1 byte) */
+ stream_read_BYTE(s, cache_brush_order->style); /* style (1 byte) */
+ stream_read_BYTE(s, cache_brush_order->length); /* iBytes (1 byte) */
if ((cache_brush_order->cx == 8) && (cache_brush_order->cy == 8))
{
size = (cache_brush_order->bpp == 1) ? 8 : 8 * 8 * cache_brush_order->bpp;
- cache_brush_order->data = (uint8*) malloc(size);
+ cache_brush_order->data = (BYTE*) malloc(size);
if (cache_brush_order->bpp == 1)
{
for (i = 7; i >= 0; i--)
{
- stream_read_uint8(s, cache_brush_order->data[i]);
+ stream_read_BYTE(s, cache_brush_order->data[i]);
}
}
else
void update_read_create_offscreen_bitmap_order(STREAM* s, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap)
{
- uint16 flags;
+ UINT16 flags;
BOOL deleteListPresent;
OFFSCREEN_DELETE_LIST* deleteList;
- stream_read_uint16(s, flags); /* flags (2 bytes) */
+ stream_read_UINT16(s, flags); /* flags (2 bytes) */
create_offscreen_bitmap->id = flags & 0x7FFF;
deleteListPresent = (flags & 0x8000) ? TRUE : FALSE;
- stream_read_uint16(s, create_offscreen_bitmap->cx); /* cx (2 bytes) */
- stream_read_uint16(s, create_offscreen_bitmap->cy); /* cy (2 bytes) */
+ stream_read_UINT16(s, create_offscreen_bitmap->cx); /* cx (2 bytes) */
+ stream_read_UINT16(s, create_offscreen_bitmap->cy); /* cy (2 bytes) */
deleteList = &(create_offscreen_bitmap->deleteList);
if (deleteListPresent)
{
int i;
- stream_read_uint16(s, deleteList->cIndices);
+ stream_read_UINT16(s, deleteList->cIndices);
if (deleteList->cIndices > deleteList->sIndices)
{
for (i = 0; i < (int) deleteList->cIndices; i++)
{
- stream_read_uint16(s, deleteList->indices[i]);
+ stream_read_UINT16(s, deleteList->indices[i]);
}
}
else
void update_read_switch_surface_order(STREAM* s, SWITCH_SURFACE_ORDER* switch_surface)
{
- stream_read_uint16(s, switch_surface->bitmapId); /* bitmapId (2 bytes) */
+ stream_read_UINT16(s, switch_surface->bitmapId); /* bitmapId (2 bytes) */
}
void update_read_create_nine_grid_bitmap_order(STREAM* s, CREATE_NINE_GRID_BITMAP_ORDER* create_nine_grid_bitmap)
{
NINE_GRID_BITMAP_INFO* nineGridInfo;
- stream_read_uint8(s, create_nine_grid_bitmap->bitmapBpp); /* bitmapBpp (1 byte) */
- stream_read_uint16(s, create_nine_grid_bitmap->bitmapId); /* bitmapId (2 bytes) */
+ stream_read_BYTE(s, create_nine_grid_bitmap->bitmapBpp); /* bitmapBpp (1 byte) */
+ stream_read_UINT16(s, create_nine_grid_bitmap->bitmapId); /* bitmapId (2 bytes) */
nineGridInfo = &(create_nine_grid_bitmap->nineGridInfo);
stream_read_uint32(s, nineGridInfo->flFlags); /* flFlags (4 bytes) */
- stream_read_uint16(s, nineGridInfo->ulLeftWidth); /* ulLeftWidth (2 bytes) */
- stream_read_uint16(s, nineGridInfo->ulRightWidth); /* ulRightWidth (2 bytes) */
- stream_read_uint16(s, nineGridInfo->ulTopHeight); /* ulTopHeight (2 bytes) */
- stream_read_uint16(s, nineGridInfo->ulBottomHeight); /* ulBottomHeight (2 bytes) */
+ stream_read_UINT16(s, nineGridInfo->ulLeftWidth); /* ulLeftWidth (2 bytes) */
+ stream_read_UINT16(s, nineGridInfo->ulRightWidth); /* ulRightWidth (2 bytes) */
+ stream_read_UINT16(s, nineGridInfo->ulTopHeight); /* ulTopHeight (2 bytes) */
+ stream_read_UINT16(s, nineGridInfo->ulBottomHeight); /* ulBottomHeight (2 bytes) */
update_read_colorref(s, &nineGridInfo->crTransparent); /* crTransparent (4 bytes) */
}
void update_read_stream_bitmap_first_order(STREAM* s, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_first)
{
- stream_read_uint8(s, stream_bitmap_first->bitmapFlags); /* bitmapFlags (1 byte) */
- stream_read_uint8(s, stream_bitmap_first->bitmapBpp); /* bitmapBpp (1 byte) */
- stream_read_uint16(s, stream_bitmap_first->bitmapType); /* bitmapType (2 bytes) */
- stream_read_uint16(s, stream_bitmap_first->bitmapWidth); /* bitmapWidth (2 bytes) */
- stream_read_uint16(s, stream_bitmap_first->bitmapHeight); /* bitmapHeigth (2 bytes) */
+ stream_read_BYTE(s, stream_bitmap_first->bitmapFlags); /* bitmapFlags (1 byte) */
+ stream_read_BYTE(s, stream_bitmap_first->bitmapBpp); /* bitmapBpp (1 byte) */
+ stream_read_UINT16(s, stream_bitmap_first->bitmapType); /* bitmapType (2 bytes) */
+ stream_read_UINT16(s, stream_bitmap_first->bitmapWidth); /* bitmapWidth (2 bytes) */
+ stream_read_UINT16(s, stream_bitmap_first->bitmapHeight); /* bitmapHeigth (2 bytes) */
if (stream_bitmap_first->bitmapFlags & STREAM_BITMAP_V2)
stream_read_uint32(s, stream_bitmap_first->bitmapSize); /* bitmapSize (4 bytes) */
else
- stream_read_uint16(s, stream_bitmap_first->bitmapSize); /* bitmapSize (2 bytes) */
+ stream_read_UINT16(s, stream_bitmap_first->bitmapSize); /* bitmapSize (2 bytes) */
- stream_read_uint16(s, stream_bitmap_first->bitmapBlockSize); /* bitmapBlockSize (2 bytes) */
+ stream_read_UINT16(s, stream_bitmap_first->bitmapBlockSize); /* bitmapBlockSize (2 bytes) */
stream_seek(s, stream_bitmap_first->bitmapBlockSize); /* bitmapBlock */
}
void update_read_stream_bitmap_next_order(STREAM* s, STREAM_BITMAP_FIRST_ORDER* stream_bitmap_next)
{
- stream_read_uint8(s, stream_bitmap_next->bitmapFlags); /* bitmapFlags (1 byte) */
- stream_read_uint16(s, stream_bitmap_next->bitmapType); /* bitmapType (2 bytes) */
- stream_read_uint16(s, stream_bitmap_next->bitmapBlockSize); /* bitmapBlockSize (2 bytes) */
+ stream_read_BYTE(s, stream_bitmap_next->bitmapFlags); /* bitmapFlags (1 byte) */
+ stream_read_UINT16(s, stream_bitmap_next->bitmapType); /* bitmapType (2 bytes) */
+ stream_read_UINT16(s, stream_bitmap_next->bitmapBlockSize); /* bitmapBlockSize (2 bytes) */
stream_seek(s, stream_bitmap_next->bitmapBlockSize); /* bitmapBlock */
}
void update_read_draw_gdiplus_first_order(STREAM* s, DRAW_GDIPLUS_FIRST_ORDER* draw_gdiplus_first)
{
- stream_seek_uint8(s); /* pad1Octet (1 byte) */
- stream_read_uint16(s, draw_gdiplus_first->cbSize); /* cbSize (2 bytes) */
+ stream_seek_BYTE(s); /* pad1Octet (1 byte) */
+ stream_read_UINT16(s, draw_gdiplus_first->cbSize); /* cbSize (2 bytes) */
stream_read_uint32(s, draw_gdiplus_first->cbTotalSize); /* cbTotalSize (4 bytes) */
stream_read_uint32(s, draw_gdiplus_first->cbTotalEmfSize); /* cbTotalEmfSize (4 bytes) */
stream_seek(s, draw_gdiplus_first->cbSize); /* emfRecords */
void update_read_draw_gdiplus_next_order(STREAM* s, DRAW_GDIPLUS_NEXT_ORDER* draw_gdiplus_next)
{
- stream_seek_uint8(s); /* pad1Octet (1 byte) */
- stream_read_uint16(s, draw_gdiplus_next->cbSize); /* cbSize (2 bytes) */
+ stream_seek_BYTE(s); /* pad1Octet (1 byte) */
+ stream_read_UINT16(s, draw_gdiplus_next->cbSize); /* cbSize (2 bytes) */
stream_seek(s, draw_gdiplus_next->cbSize); /* emfRecords */
}
void update_read_draw_gdiplus_end_order(STREAM* s, DRAW_GDIPLUS_END_ORDER* draw_gdiplus_end)
{
- stream_seek_uint8(s); /* pad1Octet (1 byte) */
- stream_read_uint16(s, draw_gdiplus_end->cbSize); /* cbSize (2 bytes) */
+ stream_seek_BYTE(s); /* pad1Octet (1 byte) */
+ stream_read_UINT16(s, draw_gdiplus_end->cbSize); /* cbSize (2 bytes) */
stream_read_uint32(s, draw_gdiplus_end->cbTotalSize); /* cbTotalSize (4 bytes) */
stream_read_uint32(s, draw_gdiplus_end->cbTotalEmfSize); /* cbTotalEmfSize (4 bytes) */
stream_seek(s, draw_gdiplus_end->cbSize); /* emfRecords */
void update_read_draw_gdiplus_cache_first_order(STREAM* s, DRAW_GDIPLUS_CACHE_FIRST_ORDER* draw_gdiplus_cache_first)
{
- stream_read_uint8(s, draw_gdiplus_cache_first->flags); /* flags (1 byte) */
- stream_read_uint16(s, draw_gdiplus_cache_first->cacheType); /* cacheType (2 bytes) */
- stream_read_uint16(s, draw_gdiplus_cache_first->cacheIndex); /* cacheIndex (2 bytes) */
- stream_read_uint16(s, draw_gdiplus_cache_first->cbSize); /* cbSize (2 bytes) */
+ stream_read_BYTE(s, draw_gdiplus_cache_first->flags); /* flags (1 byte) */
+ stream_read_UINT16(s, draw_gdiplus_cache_first->cacheType); /* cacheType (2 bytes) */
+ stream_read_UINT16(s, draw_gdiplus_cache_first->cacheIndex); /* cacheIndex (2 bytes) */
+ stream_read_UINT16(s, draw_gdiplus_cache_first->cbSize); /* cbSize (2 bytes) */
stream_read_uint32(s, draw_gdiplus_cache_first->cbTotalSize); /* cbTotalSize (4 bytes) */
stream_seek(s, draw_gdiplus_cache_first->cbSize); /* emfRecords */
}
void update_read_draw_gdiplus_cache_next_order(STREAM* s, DRAW_GDIPLUS_CACHE_NEXT_ORDER* draw_gdiplus_cache_next)
{
- stream_read_uint8(s, draw_gdiplus_cache_next->flags); /* flags (1 byte) */
- stream_read_uint16(s, draw_gdiplus_cache_next->cacheType); /* cacheType (2 bytes) */
- stream_read_uint16(s, draw_gdiplus_cache_next->cacheIndex); /* cacheIndex (2 bytes) */
- stream_read_uint16(s, draw_gdiplus_cache_next->cbSize); /* cbSize (2 bytes) */
+ stream_read_BYTE(s, draw_gdiplus_cache_next->flags); /* flags (1 byte) */
+ stream_read_UINT16(s, draw_gdiplus_cache_next->cacheType); /* cacheType (2 bytes) */
+ stream_read_UINT16(s, draw_gdiplus_cache_next->cacheIndex); /* cacheIndex (2 bytes) */
+ stream_read_UINT16(s, draw_gdiplus_cache_next->cbSize); /* cbSize (2 bytes) */
stream_seek(s, draw_gdiplus_cache_next->cbSize); /* emfRecords */
}
void update_read_draw_gdiplus_cache_end_order(STREAM* s, DRAW_GDIPLUS_CACHE_END_ORDER* draw_gdiplus_cache_end)
{
- stream_read_uint8(s, draw_gdiplus_cache_end->flags); /* flags (1 byte) */
- stream_read_uint16(s, draw_gdiplus_cache_end->cacheType); /* cacheType (2 bytes) */
- stream_read_uint16(s, draw_gdiplus_cache_end->cacheIndex); /* cacheIndex (2 bytes) */
- stream_read_uint16(s, draw_gdiplus_cache_end->cbSize); /* cbSize (2 bytes) */
+ stream_read_BYTE(s, draw_gdiplus_cache_end->flags); /* flags (1 byte) */
+ stream_read_UINT16(s, draw_gdiplus_cache_end->cacheType); /* cacheType (2 bytes) */
+ stream_read_UINT16(s, draw_gdiplus_cache_end->cacheIndex); /* cacheIndex (2 bytes) */
+ stream_read_UINT16(s, draw_gdiplus_cache_end->cbSize); /* cbSize (2 bytes) */
stream_read_uint32(s, draw_gdiplus_cache_end->cbTotalSize); /* cbTotalSize (4 bytes) */
stream_seek(s, draw_gdiplus_cache_end->cbSize); /* emfRecords */
}
-void update_read_field_flags(STREAM* s, uint32* fieldFlags, uint8 flags, uint8 fieldBytes)
+void update_read_field_flags(STREAM* s, uint32* fieldFlags, BYTE flags, BYTE fieldBytes)
{
int i;
- uint8 byte;
+ BYTE byte;
if (flags & ORDER_ZERO_FIELD_BYTE_BIT0)
fieldBytes--;
*fieldFlags = 0;
for (i = 0; i < fieldBytes; i++)
{
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*fieldFlags |= byte << (i * 8);
}
}
void update_read_bounds(STREAM* s, rdpBounds* bounds)
{
- uint8 flags;
+ BYTE flags;
- stream_read_uint8(s, flags); /* field flags */
+ stream_read_BYTE(s, flags); /* field flags */
if (flags & BOUND_LEFT)
update_read_coord(s, &bounds->left, FALSE);
update_read_coord(s, &bounds->bottom, TRUE);
}
-BOOL update_recv_primary_order(rdpUpdate* update, STREAM* s, uint8 flags)
+BOOL update_recv_primary_order(rdpUpdate* update, STREAM* s, BYTE flags)
{
ORDER_INFO* orderInfo;
rdpContext* context = update->context;
orderInfo = &(primary->order_info);
if (flags & ORDER_TYPE_CHANGE)
- stream_read_uint8(s, orderInfo->orderType); /* orderType (1 byte) */
+ stream_read_BYTE(s, orderInfo->orderType); /* orderType (1 byte) */
if (orderInfo->orderType >= PRIMARY_DRAWING_ORDER_COUNT)
{
return TRUE;
}
-void update_recv_secondary_order(rdpUpdate* update, STREAM* s, uint8 flags)
+void update_recv_secondary_order(rdpUpdate* update, STREAM* s, BYTE flags)
{
- uint8* next;
- uint8 orderType;
- uint16 extraFlags;
- uint16 orderLength;
+ BYTE* next;
+ BYTE orderType;
+ UINT16 extraFlags;
+ UINT16 orderLength;
rdpContext* context = update->context;
rdpSecondaryUpdate* secondary = update->secondary;
- stream_read_uint16(s, orderLength); /* orderLength (2 bytes) */
- stream_read_uint16(s, extraFlags); /* extraFlags (2 bytes) */
- stream_read_uint8(s, orderType); /* orderType (1 byte) */
+ stream_read_UINT16(s, orderLength); /* orderLength (2 bytes) */
+ stream_read_UINT16(s, extraFlags); /* extraFlags (2 bytes) */
+ stream_read_BYTE(s, orderType); /* orderType (1 byte) */
- next = s->p + ((sint16) orderLength) + 7;
+ next = s->p + ((INT16) orderLength) + 7;
#ifdef WITH_DEBUG_ORDERS
if (orderType < SECONDARY_DRAWING_ORDER_COUNT)
s->p = next;
}
-void update_recv_altsec_order(rdpUpdate* update, STREAM* s, uint8 flags)
+void update_recv_altsec_order(rdpUpdate* update, STREAM* s, BYTE flags)
{
- uint8 orderType;
+ BYTE orderType;
rdpContext* context = update->context;
rdpAltSecUpdate* altsec = update->altsec;
BOOL update_recv_order(rdpUpdate* update, STREAM* s)
{
- uint8 controlFlags;
+ BYTE controlFlags;
- stream_read_uint8(s, controlFlags); /* controlFlags (1 byte) */
+ stream_read_BYTE(s, controlFlags); /* controlFlags (1 byte) */
if (!(controlFlags & ORDER_STANDARD))
update_recv_altsec_order(update, s, controlFlags);
void update_read_ellipse_sc_order(STREAM* s, ORDER_INFO* orderInfo, ELLIPSE_SC_ORDER* ellipse_sc);
void update_read_ellipse_cb_order(STREAM* s, ORDER_INFO* orderInfo, ELLIPSE_CB_ORDER* ellipse_cb);
-void update_read_cache_bitmap_order(STREAM* s, CACHE_BITMAP_ORDER* cache_bitmap_order, BOOL compressed, uint16 flags);
-void update_read_cache_bitmap_v2_order(STREAM* s, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2_order, BOOL compressed, uint16 flags);
-void update_read_cache_bitmap_v3_order(STREAM* s, CACHE_BITMAP_V3_ORDER* cache_bitmap_v3_order, BOOL compressed, uint16 flags);
-void update_read_cache_color_table_order(STREAM* s, CACHE_COLOR_TABLE_ORDER* cache_color_table_order, uint16 flags);
-void update_read_cache_glyph_order(STREAM* s, CACHE_GLYPH_ORDER* cache_glyph_order, uint16 flags);
-void update_read_cache_glyph_v2_order(STREAM* s, CACHE_GLYPH_V2_ORDER* cache_glyph_v2_order, uint16 flags);
-void update_read_cache_brush_order(STREAM* s, CACHE_BRUSH_ORDER* cache_brush_order, uint16 flags);
+void update_read_cache_bitmap_order(STREAM* s, CACHE_BITMAP_ORDER* cache_bitmap_order, BOOL compressed, UINT16 flags);
+void update_read_cache_bitmap_v2_order(STREAM* s, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2_order, BOOL compressed, UINT16 flags);
+void update_read_cache_bitmap_v3_order(STREAM* s, CACHE_BITMAP_V3_ORDER* cache_bitmap_v3_order, BOOL compressed, UINT16 flags);
+void update_read_cache_color_table_order(STREAM* s, CACHE_COLOR_TABLE_ORDER* cache_color_table_order, UINT16 flags);
+void update_read_cache_glyph_order(STREAM* s, CACHE_GLYPH_ORDER* cache_glyph_order, UINT16 flags);
+void update_read_cache_glyph_v2_order(STREAM* s, CACHE_GLYPH_V2_ORDER* cache_glyph_v2_order, UINT16 flags);
+void update_read_cache_brush_order(STREAM* s, CACHE_BRUSH_ORDER* cache_brush_order, UINT16 flags);
void update_read_create_offscreen_bitmap_order(STREAM* s, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap);
void update_read_switch_surface_order(STREAM* s, SWITCH_SURFACE_ORDER* switch_surface);
static BOOL peer_recv_data_pdu(freerdp_peer* client, STREAM* s)
{
- uint8 type;
- uint16 length;
+ BYTE type;
+ UINT16 length;
uint32 share_id;
- uint8 compressed_type;
- uint16 compressed_len;
+ BYTE compressed_type;
+ UINT16 compressed_len;
if (!rdp_read_share_data_header(s, &length, &type, &share_id, &compressed_type, &compressed_len))
return FALSE;
static BOOL peer_recv_tpkt_pdu(freerdp_peer* client, STREAM* s)
{
rdpRdp* rdp;
- uint16 length;
- uint16 pduType;
- uint16 pduLength;
- uint16 pduSource;
- uint16 channelId;
- uint16 securityFlags;
+ UINT16 length;
+ UINT16 pduType;
+ UINT16 pduLength;
+ UINT16 pduSource;
+ UINT16 channelId;
+ UINT16 securityFlags;
rdp = client->context->rdp;
static BOOL peer_recv_fastpath_pdu(freerdp_peer* client, STREAM* s)
{
rdpRdp* rdp;
- uint16 length;
+ UINT16 length;
rdpFastPath* fastpath;
rdp = client->context->rdp;
transport_disconnect(client->context->rdp->transport);
}
-static int freerdp_peer_send_channel_data(freerdp_peer* client, int channelId, uint8* data, int size)
+static int freerdp_peer_send_channel_data(freerdp_peer* client, int channelId, BYTE* data, int size)
{
return rdp_send_channel_data(client->context->rdp, channelId, data, size);
}
* @param flags security flags
*/
-void rdp_read_security_header(STREAM* s, uint16* flags)
+void rdp_read_security_header(STREAM* s, UINT16* flags)
{
/* Basic Security Header */
- stream_read_uint16(s, *flags); /* flags */
+ stream_read_UINT16(s, *flags); /* flags */
stream_seek(s, 2); /* flagsHi (unused) */
}
* @param flags security flags
*/
-void rdp_write_security_header(STREAM* s, uint16 flags)
+void rdp_write_security_header(STREAM* s, UINT16 flags)
{
/* Basic Security Header */
- stream_write_uint16(s, flags); /* flags */
- stream_write_uint16(s, 0); /* flagsHi (unused) */
+ stream_write_UINT16(s, flags); /* flags */
+ stream_write_UINT16(s, 0); /* flagsHi (unused) */
}
-BOOL rdp_read_share_control_header(STREAM* s, uint16* length, uint16* type, uint16* channel_id)
+BOOL rdp_read_share_control_header(STREAM* s, UINT16* length, UINT16* type, UINT16* channel_id)
{
/* Share Control Header */
- stream_read_uint16(s, *length); /* totalLength */
+ stream_read_UINT16(s, *length); /* totalLength */
if (*length - 2 > stream_get_left(s))
return FALSE;
- stream_read_uint16(s, *type); /* pduType */
+ stream_read_UINT16(s, *type); /* pduType */
*type &= 0x0F; /* type is in the 4 least significant bits */
if (*length > 4)
- stream_read_uint16(s, *channel_id); /* pduSource */
+ stream_read_UINT16(s, *channel_id); /* pduSource */
else /* Windows XP can send such short DEACTIVATE_ALL PDUs. */
*channel_id = 0;
return TRUE;
}
-void rdp_write_share_control_header(STREAM* s, uint16 length, uint16 type, uint16 channel_id)
+void rdp_write_share_control_header(STREAM* s, UINT16 length, UINT16 type, UINT16 channel_id)
{
length -= RDP_PACKET_HEADER_MAX_LENGTH;
/* Share Control Header */
- stream_write_uint16(s, length); /* totalLength */
- stream_write_uint16(s, type | 0x10); /* pduType */
- stream_write_uint16(s, channel_id); /* pduSource */
+ stream_write_UINT16(s, length); /* totalLength */
+ stream_write_UINT16(s, type | 0x10); /* pduType */
+ stream_write_UINT16(s, channel_id); /* pduSource */
}
-BOOL rdp_read_share_data_header(STREAM* s, uint16* length, uint8* type, uint32* share_id,
- uint8 *compressed_type, uint16 *compressed_len)
+BOOL rdp_read_share_data_header(STREAM* s, UINT16* length, BYTE* type, uint32* share_id,
+ BYTE *compressed_type, UINT16 *compressed_len)
{
if (stream_get_left(s) < 12)
return FALSE;
/* Share Data Header */
stream_read_uint32(s, *share_id); /* shareId (4 bytes) */
- stream_seek_uint8(s); /* pad1 (1 byte) */
- stream_seek_uint8(s); /* streamId (1 byte) */
- stream_read_uint16(s, *length); /* uncompressedLength (2 bytes) */
- stream_read_uint8(s, *type); /* pduType2, Data PDU Type (1 byte) */
- stream_read_uint8(s, *compressed_type); /* compressedType (1 byte) */
- stream_read_uint16(s, *compressed_len); /* compressedLength (2 bytes) */
+ stream_seek_BYTE(s); /* pad1 (1 byte) */
+ stream_seek_BYTE(s); /* streamId (1 byte) */
+ stream_read_UINT16(s, *length); /* uncompressedLength (2 bytes) */
+ stream_read_BYTE(s, *type); /* pduType2, Data PDU Type (1 byte) */
+ stream_read_BYTE(s, *compressed_type); /* compressedType (1 byte) */
+ stream_read_UINT16(s, *compressed_len); /* compressedLength (2 bytes) */
return TRUE;
}
-void rdp_write_share_data_header(STREAM* s, uint16 length, uint8 type, uint32 share_id)
+void rdp_write_share_data_header(STREAM* s, UINT16 length, BYTE type, uint32 share_id)
{
length -= RDP_PACKET_HEADER_MAX_LENGTH;
length -= RDP_SHARE_CONTROL_HEADER_LENGTH;
/* Share Data Header */
stream_write_uint32(s, share_id); /* shareId (4 bytes) */
- stream_write_uint8(s, 0); /* pad1 (1 byte) */
- stream_write_uint8(s, STREAM_LOW); /* streamId (1 byte) */
- stream_write_uint16(s, length); /* uncompressedLength (2 bytes) */
- stream_write_uint8(s, type); /* pduType2, Data PDU Type (1 byte) */
- stream_write_uint8(s, 0); /* compressedType (1 byte) */
- stream_write_uint16(s, 0); /* compressedLength (2 bytes) */
+ stream_write_BYTE(s, 0); /* pad1 (1 byte) */
+ stream_write_BYTE(s, STREAM_LOW); /* streamId (1 byte) */
+ stream_write_UINT16(s, length); /* uncompressedLength (2 bytes) */
+ stream_write_BYTE(s, type); /* pduType2, Data PDU Type (1 byte) */
+ stream_write_BYTE(s, 0); /* compressedType (1 byte) */
+ stream_write_UINT16(s, 0); /* compressedLength (2 bytes) */
}
static int rdp_security_stream_init(rdpRdp* rdp, STREAM* s)
* @param channel_id channel id
*/
-BOOL rdp_read_header(rdpRdp* rdp, STREAM* s, uint16* length, uint16* channel_id)
+BOOL rdp_read_header(rdpRdp* rdp, STREAM* s, UINT16* length, UINT16* channel_id)
{
- uint16 initiator;
+ UINT16 initiator;
enum DomainMCSPDU MCSPDU;
MCSPDU = (rdp->settings->server_mode) ? DomainMCSPDU_SendDataRequest : DomainMCSPDU_SendDataIndication;
if (MCSPDU == DomainMCSPDU_DisconnectProviderUltimatum)
{
- uint8 reason;
+ BYTE reason;
(void) per_read_enumerated(s, &reason, 0);
DEBUG_RDP("DisconnectProviderUltimatum from server, reason code 0x%02x\n", reason);
* @param channel_id channel id
*/
-void rdp_write_header(rdpRdp* rdp, STREAM* s, uint16 length, uint16 channel_id)
+void rdp_write_header(rdpRdp* rdp, STREAM* s, UINT16 length, UINT16 channel_id)
{
int body_length;
enum DomainMCSPDU MCSPDU;
mcs_write_domain_mcspdu_header(s, MCSPDU, length, 0);
per_write_integer16(s, rdp->mcs->user_id, MCS_BASE_CHANNEL_ID); /* initiator */
per_write_integer16(s, channel_id, 0); /* channelId */
- stream_write_uint8(s, 0x70); /* dataPriority + segmentation */
+ stream_write_BYTE(s, 0x70); /* dataPriority + segmentation */
/*
* We always encode length in two bytes, eventhough we could use
* only one byte if length <= 0x7F. It is just easier that way,
* the data first and then store the header.
*/
length = (length - RDP_PACKET_HEADER_MAX_LENGTH) | 0x8000;
- stream_write_uint16_be(s, length); /* userData (OCTET_STRING) */
+ stream_write_UINT16_be(s, length); /* userData (OCTET_STRING) */
}
static uint32 rdp_security_stream_out(rdpRdp* rdp, STREAM* s, int length)
{
- uint8* data;
+ BYTE* data;
uint32 sec_flags;
uint32 pad = 0;
data = s->p + 12;
length = length - (data - s->data);
- stream_write_uint16(s, 0x10); /* length */
- stream_write_uint8(s, 0x1); /* TSFIPS_VERSION 1*/
+ stream_write_UINT16(s, 0x10); /* length */
+ stream_write_BYTE(s, 0x1); /* TSFIPS_VERSION 1*/
/* handle padding */
pad = 8 - (length % 8);
if (pad)
memset(data+length, 0, pad);
- stream_write_uint8(s, pad);
+ stream_write_BYTE(s, pad);
security_hmac_signature(data, length, s->p, rdp);
stream_seek(s, 8);
* @param channel_id channel id
*/
-BOOL rdp_send(rdpRdp* rdp, STREAM* s, uint16 channel_id)
+BOOL rdp_send(rdpRdp* rdp, STREAM* s, UINT16 channel_id)
{
- uint16 length;
+ UINT16 length;
uint32 sec_bytes;
- uint8* sec_hold;
+ BYTE* sec_hold;
length = stream_get_length(s);
stream_set_pos(s, 0);
return TRUE;
}
-BOOL rdp_send_pdu(rdpRdp* rdp, STREAM* s, uint16 type, uint16 channel_id)
+BOOL rdp_send_pdu(rdpRdp* rdp, STREAM* s, UINT16 type, UINT16 channel_id)
{
- uint16 length;
+ UINT16 length;
uint32 sec_bytes;
- uint8* sec_hold;
+ BYTE* sec_hold;
length = stream_get_length(s);
stream_set_pos(s, 0);
return TRUE;
}
-BOOL rdp_send_data_pdu(rdpRdp* rdp, STREAM* s, uint8 type, uint16 channel_id)
+BOOL rdp_send_data_pdu(rdpRdp* rdp, STREAM* s, BYTE type, UINT16 channel_id)
{
- uint16 length;
+ UINT16 length;
uint32 sec_bytes;
- uint8* sec_hold;
+ BYTE* sec_hold;
length = stream_get_length(s);
stream_set_pos(s, 0);
BOOL rdp_recv_data_pdu(rdpRdp* rdp, STREAM* s)
{
- uint8 type;
- uint16 length;
+ BYTE type;
+ UINT16 length;
uint32 share_id;
- uint8 compressed_type;
- uint16 compressed_len;
+ BYTE compressed_type;
+ UINT16 compressed_len;
uint32 roff;
uint32 rlen;
STREAM* comp_stream;
BOOL rdp_recv_out_of_sequence_pdu(rdpRdp* rdp, STREAM* s)
{
- uint16 type;
- uint16 length;
- uint16 channelId;
+ UINT16 type;
+ UINT16 length;
+ UINT16 channelId;
rdp_read_share_control_header(s, &length, &type, &channelId);
* @param length int
*/
-BOOL rdp_decrypt(rdpRdp* rdp, STREAM* s, int length, uint16 securityFlags)
+BOOL rdp_decrypt(rdpRdp* rdp, STREAM* s, int length, UINT16 securityFlags)
{
- uint8 cmac[8], wmac[8];
+ BYTE cmac[8], wmac[8];
if (rdp->settings->encryption_method == ENCRYPTION_METHOD_FIPS)
{
- uint16 len;
- uint8 version, pad;
- uint8 *sig;
+ UINT16 len;
+ BYTE version, pad;
+ BYTE *sig;
- stream_read_uint16(s, len); /* 0x10 */
- stream_read_uint8(s, version); /* 0x1 */
- stream_read_uint8(s, pad);
+ stream_read_UINT16(s, len); /* 0x10 */
+ stream_read_BYTE(s, version); /* 0x1 */
+ stream_read_BYTE(s, pad);
sig = s->p;
stream_seek(s, 8); /* signature */
static BOOL rdp_recv_tpkt_pdu(rdpRdp* rdp, STREAM* s)
{
- uint16 length;
- uint16 pduType;
- uint16 pduLength;
- uint16 pduSource;
- uint16 channelId;
- uint16 securityFlags;
- uint8* nextp;
+ UINT16 length;
+ UINT16 pduType;
+ UINT16 pduLength;
+ UINT16 pduSource;
+ UINT16 channelId;
+ UINT16 securityFlags;
+ BYTE* nextp;
if (!rdp_read_header(rdp, s, &length, &channelId))
{
static BOOL rdp_recv_fastpath_pdu(rdpRdp* rdp, STREAM* s)
{
- uint16 length;
+ UINT16 length;
rdpFastPath* fastpath;
fastpath = rdp->fastpath;
return TRUE;
}
-int rdp_send_channel_data(rdpRdp* rdp, int channel_id, uint8* data, int size)
+int rdp_send_channel_data(rdpRdp* rdp, int channel_id, BYTE* data, int size)
{
return freerdp_channel_send(rdp, channel_id, data, size);
}
uint32 sec_flags;
BOOL do_crypt;
BOOL do_secure_checksum;
- uint8 sign_key[16];
- uint8 decrypt_key[16];
- uint8 encrypt_key[16];
- uint8 decrypt_update_key[16];
- uint8 encrypt_update_key[16];
+ BYTE sign_key[16];
+ BYTE decrypt_key[16];
+ BYTE encrypt_key[16];
+ BYTE decrypt_update_key[16];
+ BYTE encrypt_update_key[16];
int rc4_key_len;
- uint8 fips_sign_key[20];
- uint8 fips_encrypt_key[24];
- uint8 fips_decrypt_key[24];
+ BYTE fips_sign_key[20];
+ BYTE fips_encrypt_key[24];
+ BYTE fips_decrypt_key[24];
uint32 errorInfo;
uint32 finalize_sc_pdus;
BOOL disconnect;
};
-void rdp_read_security_header(STREAM* s, uint16* flags);
-void rdp_write_security_header(STREAM* s, uint16 flags);
+void rdp_read_security_header(STREAM* s, UINT16* flags);
+void rdp_write_security_header(STREAM* s, UINT16 flags);
-BOOL rdp_read_share_control_header(STREAM* s, uint16* length, uint16* type, uint16* channel_id);
-void rdp_write_share_control_header(STREAM* s, uint16 length, uint16 type, uint16 channel_id);
+BOOL rdp_read_share_control_header(STREAM* s, UINT16* length, UINT16* type, UINT16* channel_id);
+void rdp_write_share_control_header(STREAM* s, UINT16 length, UINT16 type, UINT16 channel_id);
-BOOL rdp_read_share_data_header(STREAM* s, uint16* length, uint8* type, uint32* share_id,
- uint8 *compressed_type, uint16 *compressed_len);
+BOOL rdp_read_share_data_header(STREAM* s, UINT16* length, BYTE* type, uint32* share_id,
+ BYTE *compressed_type, UINT16 *compressed_len);
-void rdp_write_share_data_header(STREAM* s, uint16 length, uint8 type, uint32 share_id);
+void rdp_write_share_data_header(STREAM* s, UINT16 length, BYTE type, uint32 share_id);
STREAM* rdp_send_stream_init(rdpRdp* rdp);
-BOOL rdp_read_header(rdpRdp* rdp, STREAM* s, uint16* length, uint16* channel_id);
-void rdp_write_header(rdpRdp* rdp, STREAM* s, uint16 length, uint16 channel_id);
+BOOL rdp_read_header(rdpRdp* rdp, STREAM* s, UINT16* length, UINT16* channel_id);
+void rdp_write_header(rdpRdp* rdp, STREAM* s, UINT16 length, UINT16 channel_id);
STREAM* rdp_pdu_init(rdpRdp* rdp);
-BOOL rdp_send_pdu(rdpRdp* rdp, STREAM* s, uint16 type, uint16 channel_id);
+BOOL rdp_send_pdu(rdpRdp* rdp, STREAM* s, UINT16 type, UINT16 channel_id);
STREAM* rdp_data_pdu_init(rdpRdp* rdp);
-BOOL rdp_send_data_pdu(rdpRdp* rdp, STREAM* s, uint8 type, uint16 channel_id);
+BOOL rdp_send_data_pdu(rdpRdp* rdp, STREAM* s, BYTE type, UINT16 channel_id);
BOOL rdp_recv_data_pdu(rdpRdp* rdp, STREAM* s);
-BOOL rdp_send(rdpRdp* rdp, STREAM* s, uint16 channel_id);
+BOOL rdp_send(rdpRdp* rdp, STREAM* s, UINT16 channel_id);
void rdp_recv(rdpRdp* rdp);
-int rdp_send_channel_data(rdpRdp* rdp, int channel_id, uint8* data, int size);
+int rdp_send_channel_data(rdpRdp* rdp, int channel_id, BYTE* data, int size);
BOOL rdp_recv_out_of_sequence_pdu(rdpRdp* rdp, STREAM* s);
#define DEBUG_RDP(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
#endif
-BOOL rdp_decrypt(rdpRdp* rdp, STREAM* s, int length, uint16 securityFlags);
+BOOL rdp_decrypt(rdpRdp* rdp, STREAM* s, int length, UINT16 securityFlags);
#endif /* __RDP_H */
BOOL rdp_recv_server_redirection_pdu(rdpRdp* rdp, STREAM* s)
{
- uint16 flags;
- uint16 length;
+ UINT16 flags;
+ UINT16 length;
rdpRedirection* redirection = rdp->redirection;
- stream_read_uint16(s, flags); /* flags (2 bytes) */
- stream_read_uint16(s, length); /* length (2 bytes) */
+ stream_read_UINT16(s, flags); /* flags (2 bytes) */
+ stream_read_UINT16(s, length); /* length (2 bytes) */
stream_read_uint32(s, redirection->sessionID); /* sessionID (4 bytes) */
stream_read_uint32(s, redirection->flags); /* redirFlags (4 bytes) */
BOOL rdp_recv_enhanced_security_redirection_packet(rdpRdp* rdp, STREAM* s)
{
- stream_seek_uint16(s); /* pad2Octets (2 bytes) */
+ stream_seek_UINT16(s); /* pad2Octets (2 bytes) */
rdp_recv_server_redirection_pdu(rdp, s);
- stream_seek_uint8(s); /* pad2Octets (1 byte) */
+ stream_seek_BYTE(s); /* pad2Octets (1 byte) */
return TRUE;
}
{
STREAM* s;
int ntlm_token_length;
- uint8* ntlm_token_data;
+ BYTE* ntlm_token_data;
HttpResponse* http_response;
rdpNtlm* ntlm = rpc->ntlm_http_out->ntlm;
http_response = http_response_recv(rpc->tls_out);
ntlm_token_data = NULL;
- crypto_base64_decode((uint8*) http_response->AuthParam, strlen(http_response->AuthParam),
+ crypto_base64_decode((BYTE*) http_response->AuthParam, strlen(http_response->AuthParam),
&ntlm_token_data, &ntlm_token_length);
ntlm->inputBuffer.pvBuffer = ntlm_token_data;
{
STREAM* s;
int ntlm_token_length;
- uint8* ntlm_token_data;
+ BYTE* ntlm_token_data;
HttpResponse* http_response;
rdpNtlm* ntlm = rpc->ntlm_http_in->ntlm;
http_response = http_response_recv(rpc->tls_in);
ntlm_token_data = NULL;
- crypto_base64_decode((uint8*) http_response->AuthParam, strlen(http_response->AuthParam),
+ crypto_base64_decode((BYTE*) http_response->AuthParam, strlen(http_response->AuthParam),
&ntlm_token_data, &ntlm_token_length);
ntlm->inputBuffer.pvBuffer = ntlm_token_data;
void rpc_pdu_header_read(STREAM* s, RPC_PDU_HEADER* header)
{
- stream_read_uint8(s, header->rpc_vers); /* rpc_vers (1 byte) */
- stream_read_uint8(s, header->rpc_vers_minor); /* rpc_vers_minor (1 byte) */
- stream_read_uint8(s, header->ptype); /* PTYPE (1 byte) */
- stream_read_uint8(s, header->pfc_flags); /* pfc_flags (1 byte) */
- stream_read_uint8(s, header->packed_drep[0]); /* packet_drep[0] (1 byte) */
- stream_read_uint8(s, header->packed_drep[1]); /* packet_drep[1] (1 byte) */
- stream_read_uint8(s, header->packed_drep[2]); /* packet_drep[2] (1 byte) */
- stream_read_uint8(s, header->packed_drep[3]); /* packet_drep[3] (1 byte) */
- stream_read_uint16(s, header->frag_length); /* frag_length (2 bytes) */
- stream_read_uint16(s, header->auth_length); /* auth_length (2 bytes) */
+ stream_read_BYTE(s, header->rpc_vers); /* rpc_vers (1 byte) */
+ stream_read_BYTE(s, header->rpc_vers_minor); /* rpc_vers_minor (1 byte) */
+ stream_read_BYTE(s, header->ptype); /* PTYPE (1 byte) */
+ stream_read_BYTE(s, header->pfc_flags); /* pfc_flags (1 byte) */
+ stream_read_BYTE(s, header->packed_drep[0]); /* packet_drep[0] (1 byte) */
+ stream_read_BYTE(s, header->packed_drep[1]); /* packet_drep[1] (1 byte) */
+ stream_read_BYTE(s, header->packed_drep[2]); /* packet_drep[2] (1 byte) */
+ stream_read_BYTE(s, header->packed_drep[3]); /* packet_drep[3] (1 byte) */
+ stream_read_UINT16(s, header->frag_length); /* frag_length (2 bytes) */
+ stream_read_UINT16(s, header->auth_length); /* auth_length (2 bytes) */
stream_read_uint32(s, header->call_id); /* call_id (4 bytes) */
}
-int rpc_out_write(rdpRpc* rpc, uint8* data, int length)
+int rpc_out_write(rdpRpc* rpc, BYTE* data, int length)
{
int status;
return status;
}
-int rpc_in_write(rdpRpc* rpc, uint8* data, int length)
+int rpc_in_write(rdpRpc* rpc, BYTE* data, int length)
{
int status;
if (bind_pdu->auth_verifier.auth_pad_length > 0)
stream_write(pdu, bind_pdu->auth_verifier.auth_pad, bind_pdu->auth_verifier.auth_pad_length);
- stream_write(pdu, &bind_pdu->auth_verifier.auth_type, 8); /* assumed that uint8 pointer is 32bit long (4 bytes) */
+ stream_write(pdu, &bind_pdu->auth_verifier.auth_type, 8); /* assumed that BYTE pointer is 32bit long (4 bytes) */
stream_write(pdu, bind_pdu->auth_verifier.auth_value, bind_pdu->auth_length);
stream_seal(pdu);
int rpc_recv_bind_ack_pdu(rdpRpc* rpc)
{
- uint8* p;
+ BYTE* p;
STREAM* s;
int status;
- uint8* pdu;
- uint8* auth_data;
+ BYTE* pdu;
+ BYTE* auth_data;
RPC_PDU_HEADER header;
int pdu_length = 0x8FFF;
return TRUE;
}
-int rpc_out_read(rdpRpc* rpc, uint8* data, int length)
+int rpc_out_read(rdpRpc* rpc, BYTE* data, int length)
{
STREAM* s;
int status;
- uint8* pdu;
+ BYTE* pdu;
int content_length;
RPC_PDU_HEADER header;
return header.frag_length;
}
-int rpc_tsg_write(rdpRpc* rpc, uint8* data, int length, uint16 opnum)
+int rpc_tsg_write(rdpRpc* rpc, BYTE* data, int length, UINT16 opnum)
{
int i;
int status;
SECURITY_STATUS encrypt_status;
rpcconn_request_hdr_t* request_pdu;
- uint8 auth_pad_length = 16 - ((24 + length + 8 + 16) % 16);
+ BYTE auth_pad_length = 16 - ((24 + length + 8 + 16) % 16);
ntlm = rpc->ntlm;
return length;
}
-int rpc_read(rdpRpc* rpc, uint8* data, int length)
+int rpc_read(rdpRpc* rpc, BYTE* data, int length)
{
int status;
int read = 0;
int data_length;
- uint16 frag_length;
- uint16 auth_length;
- uint8 auth_pad_length;
+ UINT16 frag_length;
+ UINT16 auth_length;
+ BYTE auth_pad_length;
uint32 call_id = -1;
int rpc_length = length + 0xFF;
- uint8* rpc_data = malloc(rpc_length);
+ BYTE* rpc_data = malloc(rpc_length);
if (rpc_data == NULL)
{
return status;
}
- frag_length = *(uint16*)(rpc_data + 8);
- auth_length = *(uint16*)(rpc_data + 10);
+ frag_length = *(UINT16*)(rpc_data + 8);
+ auth_length = *(UINT16*)(rpc_data + 10);
call_id = *(uint32*)(rpc_data + 12);
status = *(uint32*)(rpc_data + 16); /* alloc_hint */
auth_pad_length = *(rpc_data + frag_length - auth_length - 6); /* -6 = -8 + 2 (sec_trailer + 2) */
struct _rpc_pdu_header
{
- uint8 rpc_vers;
- uint8 rpc_vers_minor;
- uint8 ptype;
- uint8 pfc_flags;
- uint8 packed_drep[4];
- uint16 frag_length;
- uint16 auth_length;
+ BYTE rpc_vers;
+ BYTE rpc_vers_minor;
+ BYTE ptype;
+ BYTE pfc_flags;
+ BYTE packed_drep[4];
+ UINT16 frag_length;
+ UINT16 auth_length;
uint32 call_id;
};
typedef struct _rpc_pdu_header RPC_PDU_HEADER;
-typedef uint16 p_context_id_t;
+typedef UINT16 p_context_id_t;
typedef struct {
uuid if_uuid;
typedef struct {
p_context_id_t p_cont_id;
- uint8 n_transfer_syn; /* number of items */
- uint8 reserved; /* alignment pad, m.b.z. */
+ BYTE n_transfer_syn; /* number of items */
+ BYTE reserved; /* alignment pad, m.b.z. */
p_syntax_id_t abstract_syntax; /* transfer syntax list */
p_syntax_id_t* transfer_syntaxes; /*size_is(n_transfer_syn)*/
} p_cont_elem_t;
typedef struct {
- uint8 n_context_elem; /* number of items */
- uint8 reserved; /* alignment pad, m.b.z. */
- uint16 reserved2; /* alignment pad, m.b.z. */
+ BYTE n_context_elem; /* number of items */
+ BYTE reserved; /* alignment pad, m.b.z. */
+ UINT16 reserved2; /* alignment pad, m.b.z. */
p_cont_elem_t* p_cont_elem; /*size_is(n_cont_elem)*/
} p_cont_list_t;
/* Same order and number of elements as in bind request */
typedef struct {
- uint8 n_results; /* count */
- uint8 reserved; /* alignment pad, m.b.z. */
- uint16 reserved2; /* alignment pad, m.b.z. */
+ BYTE n_results; /* count */
+ BYTE reserved; /* alignment pad, m.b.z. */
+ UINT16 reserved2; /* alignment pad, m.b.z. */
p_result_t* p_results; /*size_is(n_results)*/
} p_result_list_t;
typedef struct {
- uint8 major;
- uint8 minor;
+ BYTE major;
+ BYTE minor;
} version_t;
typedef version_t p_rt_version_t;
typedef struct {
- uint8 n_protocols; /* count */
+ BYTE n_protocols; /* count */
p_rt_version_t* p_protocols; /* size_is(n_protocols) */
} p_rt_versions_supported_t;
typedef struct {
- uint16 length;
+ UINT16 length;
char* port_spec; /* port string spec; size_is(length) */
} port_any_t;
#define USER_DATA_NOT_READABLE 6 /* not used */
#define NO_PSAP_AVAILABLE 7 /* not used */
-typedef uint16 rpcrt_reason_code_t;/* 0..65535 */
+typedef UINT16 rpcrt_reason_code_t;/* 0..65535 */
typedef struct {
- uint8 rpc_vers;
- uint8 rpc_vers_minor;
- uint8 reserved[2];/* must be zero */
- uint8 packed_drep[4];
+ BYTE rpc_vers;
+ BYTE rpc_vers_minor;
+ BYTE reserved[2];/* must be zero */
+ BYTE packed_drep[4];
uint32 reject_status;
- uint8 reserved2[4];
+ BYTE reserved2[4];
} rpcrt_optional_data_t;
typedef struct {
typedef struct{
/* restore 4 byte alignment */
- uint8* auth_pad; /* align(4); size_is(auth_pad_length) */
- uint8 auth_type; /* :01 which authent service */
- uint8 auth_level; /* :01 which level within service */
- uint8 auth_pad_length; /* :01 */
- uint8 auth_reserved; /* :01 reserved, m.b.z. */
+ BYTE* auth_pad; /* align(4); size_is(auth_pad_length) */
+ BYTE auth_type; /* :01 which authent service */
+ BYTE auth_level; /* :01 which level within service */
+ BYTE auth_pad_length; /* :01 */
+ BYTE auth_reserved; /* :01 reserved, m.b.z. */
uint32 auth_context_id; /* :04 */
- uint8* auth_value; /* credentials; size_is(auth_length) */
+ BYTE* auth_value; /* credentials; size_is(auth_length) */
} auth_verifier_co_t;
/* Connection-oriented PDU Definitions */
/* start 8-octet aligned */
/* common fields */
- uint8 rpc_vers; /* 00:01 RPC version */
- uint8 rpc_vers_minor ; /* 01:01 minor version */
- uint8 PTYPE; /* 02:01 alter context PDU */
- uint8 pfc_flags; /* 03:01 flags */
- uint8 packed_drep[4]; /* 04:04 NDR data rep format label*/
- uint16 frag_length; /* 08:02 total length of fragment */
- uint16 auth_length; /* 10:02 length of auth_value */
+ BYTE rpc_vers; /* 00:01 RPC version */
+ BYTE rpc_vers_minor ; /* 01:01 minor version */
+ BYTE PTYPE; /* 02:01 alter context PDU */
+ BYTE pfc_flags; /* 03:01 flags */
+ BYTE packed_drep[4]; /* 04:04 NDR data rep format label*/
+ UINT16 frag_length; /* 08:02 total length of fragment */
+ UINT16 auth_length; /* 10:02 length of auth_value */
uint32 call_id; /* 12:04 call identifier */
/* end common fields */
- uint16 max_xmit_frag; /* ignored */
- uint16 max_recv_frag; /* ignored */
+ UINT16 max_xmit_frag; /* ignored */
+ UINT16 max_recv_frag; /* ignored */
uint32 assoc_group_id; /* ignored */
/* presentation context list */
/* start 8-octet aligned */
/* common fields */
- uint8 rpc_vers; /* 00:01 RPC version */
- uint8 rpc_vers_minor; /* 01:01 minor version */
- uint8 PTYPE; /* 02:01 alter
+ BYTE rpc_vers; /* 00:01 RPC version */
+ BYTE rpc_vers_minor; /* 01:01 minor version */
+ BYTE PTYPE; /* 02:01 alter
context response PDU */
- uint8 pfc_flags; /* 03:01 flags */
- uint8 packed_drep[4]; /* 04:04 NDR data rep format label*/
- uint16 frag_length; /* 08:02 total length of fragment */
- uint16 auth_length; /* 10:02 length of auth_value */
+ BYTE pfc_flags; /* 03:01 flags */
+ BYTE packed_drep[4]; /* 04:04 NDR data rep format label*/
+ UINT16 frag_length; /* 08:02 total length of fragment */
+ UINT16 auth_length; /* 10:02 length of auth_value */
uint32 call_id; /* 12:04 call identifier */
/* end common fields */
- uint16 max_xmit_frag; /* ignored */
- uint16 max_recv_frag; /* ignored */
+ UINT16 max_xmit_frag; /* ignored */
+ UINT16 max_recv_frag; /* ignored */
uint32 assoc_group_id; /* ignored */
port_any_t sec_addr; /* ignored */
/* restore 4-octet alignment */
- uint8* pad2; /* size_is(align(4)) */
+ BYTE* pad2; /* size_is(align(4)) */
/* presentation context result list, including hints */
/* start 8-octet aligned */
/* common fields */
- uint8 rpc_vers; /* 00:01 RPC version */
- uint8 rpc_vers_minor; /* 01:01 minor version */
- uint8 PTYPE; /* 02:01 bind PDU */
- uint8 pfc_flags; /* 03:01 flags */
- uint8 packed_drep[4]; /* 04:04 NDR data rep format label*/
- uint16 frag_length; /* 08:02 total length of fragment */
- uint16 auth_length; /* 10:02 length of auth_value */
+ BYTE rpc_vers; /* 00:01 RPC version */
+ BYTE rpc_vers_minor; /* 01:01 minor version */
+ BYTE PTYPE; /* 02:01 bind PDU */
+ BYTE pfc_flags; /* 03:01 flags */
+ BYTE packed_drep[4]; /* 04:04 NDR data rep format label*/
+ UINT16 frag_length; /* 08:02 total length of fragment */
+ UINT16 auth_length; /* 10:02 length of auth_value */
uint32 call_id; /* 12:04 call identifier */
/* end common fields */
- uint16 max_xmit_frag; /* 16:02 max transmit frag size, bytes */
- uint16 max_recv_frag; /* 18:02 max receive frag size, bytes */
+ UINT16 max_xmit_frag; /* 16:02 max transmit frag size, bytes */
+ UINT16 max_recv_frag; /* 18:02 max receive frag size, bytes */
uint32 assoc_group_id; /* 20:04 incarnation of client-server
* assoc group */
/* presentation context list */
/* start 8-octet aligned */
/* common fields */
- uint8 rpc_vers; /* 00:01 RPC version */
- uint8 rpc_vers_minor ; /* 01:01 minor version */
- uint8 PTYPE; /* 02:01 bind ack PDU */
- uint8 pfc_flags; /* 03:01 flags */
- uint8 packed_drep[4]; /* 04:04 NDR data rep format label*/
- uint16 frag_length; /* 08:02 total length of fragment */
- uint16 auth_length; /* 10:02 length of auth_value */
+ BYTE rpc_vers; /* 00:01 RPC version */
+ BYTE rpc_vers_minor ; /* 01:01 minor version */
+ BYTE PTYPE; /* 02:01 bind ack PDU */
+ BYTE pfc_flags; /* 03:01 flags */
+ BYTE packed_drep[4]; /* 04:04 NDR data rep format label*/
+ UINT16 frag_length; /* 08:02 total length of fragment */
+ UINT16 auth_length; /* 10:02 length of auth_value */
uint32 call_id; /* 12:04 call identifier */
/* end common fields */
- uint16 max_xmit_frag; /* 16:02 max transmit frag size */
- uint16 max_recv_frag; /* 18:02 max receive frag size */
+ UINT16 max_xmit_frag; /* 16:02 max transmit frag size */
+ UINT16 max_recv_frag; /* 18:02 max receive frag size */
uint32 assoc_group_id; /* 20:04 returned assoc_group_id */
port_any_t sec_addr; /* 24:yy optional secondary address
* for process incarnation; local port
* part of address only */
/* restore 4-octet alignment */
- uint8* pad2; /* size_is(align(4)) */
+ BYTE* pad2; /* size_is(align(4)) */
/* presentation context result list, including hints */
/* start 8-octet aligned */
/* common fields */
- uint8 rpc_vers; /* 00:01 RPC version */
- uint8 rpc_vers_minor ; /* 01:01 minor version */
- uint8 PTYPE; /* 02:01 bind ack PDU */
- uint8 pfc_flags; /* 03:01 flags */
- uint8 packed_drep[4]; /* 04:04 NDR data rep format label*/
- uint16 frag_length; /* 08:02 total length of fragment */
- uint16 auth_length; /* 10:02 length of auth_value */
+ BYTE rpc_vers; /* 00:01 RPC version */
+ BYTE rpc_vers_minor ; /* 01:01 minor version */
+ BYTE PTYPE; /* 02:01 bind ack PDU */
+ BYTE pfc_flags; /* 03:01 flags */
+ BYTE packed_drep[4]; /* 04:04 NDR data rep format label*/
+ UINT16 frag_length; /* 08:02 total length of fragment */
+ UINT16 auth_length; /* 10:02 length of auth_value */
uint32 call_id; /* 12:04 call identifier */
/* end common fields */
- uint16 max_xmit_frag; /* 16:02 max transmit frag size */
- uint16 max_recv_frag; /* 18:02 max receive frag size */
+ UINT16 max_xmit_frag; /* 16:02 max transmit frag size */
+ UINT16 max_recv_frag; /* 18:02 max receive frag size */
/* optional authentication verifier */
/* following fields present iff auth_length != 0 */
/* start 8-octet aligned */
/* common fields */
- uint8 rpc_vers; /* 00:01 RPC version */
- uint8 rpc_vers_minor ; /* 01:01 minor version */
- uint8 PTYPE; /* 02:01 bind nak PDU */
- uint8 pfc_flags; /* 03:01 flags */
- uint8 packed_drep[4]; /* 04:04 NDR data rep format label*/
- uint16 frag_length; /* 08:02 total length of fragment */
- uint16 auth_length; /* 10:02 length of auth_value */
+ BYTE rpc_vers; /* 00:01 RPC version */
+ BYTE rpc_vers_minor ; /* 01:01 minor version */
+ BYTE PTYPE; /* 02:01 bind nak PDU */
+ BYTE pfc_flags; /* 03:01 flags */
+ BYTE packed_drep[4]; /* 04:04 NDR data rep format label*/
+ UINT16 frag_length; /* 08:02 total length of fragment */
+ UINT16 auth_length; /* 10:02 length of auth_value */
uint32 call_id; /* 12:04 call identifier */
/* end common fields */
- /*p_reject_reason_t*/uint16 provider_reject_reason; /* 16:02 presentation (TODO search definition of p_reject_reason_t)
+ /*p_reject_reason_t*/UINT16 provider_reject_reason; /* 16:02 presentation (TODO search definition of p_reject_reason_t)
context reject */
p_rt_versions_supported_t versions; /* 18:yy array of protocol
/* start 8-octet aligned */
/* common fields */
- uint8 rpc_vers; /* 00:01 RPC version */
- uint8 rpc_vers_minor; /* 01:01 minor version */
- uint8 PTYPE; /* 02:01 CO cancel PDU */
- uint8 pfc_flags; /* 03:01 flags */
- uint8 packed_drep[4]; /* 04:04 NDR data rep format label*/
- uint16 frag_length; /* 08:02 total length of fragment */
- uint16 auth_length; /* 10:02 length of auth_value */
+ BYTE rpc_vers; /* 00:01 RPC version */
+ BYTE rpc_vers_minor; /* 01:01 minor version */
+ BYTE PTYPE; /* 02:01 CO cancel PDU */
+ BYTE pfc_flags; /* 03:01 flags */
+ BYTE packed_drep[4]; /* 04:04 NDR data rep format label*/
+ UINT16 frag_length; /* 08:02 total length of fragment */
+ UINT16 auth_length; /* 10:02 length of auth_value */
uint32 call_id; /* 12:04 call identifier */
/* end common fields */
/* start 8-octet aligned */
/* common fields */
- uint8 rpc_vers; /* 00:01 RPC version */
- uint8 rpc_vers_minor; /* 01:01 minor version */
- uint8 PTYPE; /* 02:01 fault PDU */
- uint8 pfc_flags; /* 03:01 flags */
- uint8 packed_drep[4]; /* 04:04 NDR data rep format label*/
- uint16 frag_length; /* 08:02 total length of fragment */
- uint16 auth_length; /* 10:02 length of auth_value */
+ BYTE rpc_vers; /* 00:01 RPC version */
+ BYTE rpc_vers_minor; /* 01:01 minor version */
+ BYTE PTYPE; /* 02:01 fault PDU */
+ BYTE pfc_flags; /* 03:01 flags */
+ BYTE packed_drep[4]; /* 04:04 NDR data rep format label*/
+ UINT16 frag_length; /* 08:02 total length of fragment */
+ UINT16 auth_length; /* 10:02 length of auth_value */
uint32 call_id; /* 12:04 call identifier */
/* end common fields */
/* needed for response or fault */
- uint8 cancel_count; /* 22:01 received cancel count */
- uint8 reserved; /* 23:01 reserved, m.b.z. */
+ BYTE cancel_count; /* 22:01 received cancel count */
+ BYTE reserved; /* 23:01 reserved, m.b.z. */
/* fault code */
/* always pad to next 8-octet boundary */
- uint8 reserved2[4]; /* 28:04 reserved padding, m.b.z. */
+ BYTE reserved2[4]; /* 28:04 reserved padding, m.b.z. */
/* stub data here, 8-octet aligned
.
.
. */
- uint8* stub_data;
+ BYTE* stub_data;
/* optional authentication verifier */
/* following fields present iff auth_length != 0 */
/* start 8-octet aligned */
/* common fields */
- uint8 rpc_vers; /* 00:01 RPC version */
- uint8 rpc_vers_minor; /* 01:01 minor version */
- uint8 PTYPE; /* 02:01 orphaned PDU */
- uint8 pfc_flags; /* 03:01 flags */
- uint8 packed_drep[4]; /* 04:04 NDR data rep format label*/
- uint16 frag_length; /* 08:02 total length of fragment */
- uint16 auth_length; /* 10:02 length of auth_value */
+ BYTE rpc_vers; /* 00:01 RPC version */
+ BYTE rpc_vers_minor; /* 01:01 minor version */
+ BYTE PTYPE; /* 02:01 orphaned PDU */
+ BYTE pfc_flags; /* 03:01 flags */
+ BYTE packed_drep[4]; /* 04:04 NDR data rep format label*/
+ UINT16 frag_length; /* 08:02 total length of fragment */
+ UINT16 auth_length; /* 10:02 length of auth_value */
uint32 call_id; /* 12:04 call identifier */
/* end common fields */
/* start 8-octet aligned */
/* common fields */
- uint8 rpc_vers; /* 00:01 RPC version */
- uint8 rpc_vers_minor; /* 01:01 minor version */
- uint8 PTYPE; /* 02:01 request PDU */
- uint8 pfc_flags; /* 03:01 flags */
- uint8 packed_drep[4]; /* 04:04 NDR data rep format label*/
- uint16 frag_length; /* 08:02 total length of fragment */
- uint16 auth_length; /* 10:02 length of auth_value */
+ BYTE rpc_vers; /* 00:01 RPC version */
+ BYTE rpc_vers_minor; /* 01:01 minor version */
+ BYTE PTYPE; /* 02:01 request PDU */
+ BYTE pfc_flags; /* 03:01 flags */
+ BYTE packed_drep[4]; /* 04:04 NDR data rep format label*/
+ UINT16 frag_length; /* 08:02 total length of fragment */
+ UINT16 auth_length; /* 10:02 length of auth_value */
uint32 call_id; /* 12:04 call identifier */
/* end common fields */
uint32 alloc_hint; /* 16:04 allocation hint */
p_context_id_t p_cont_id; /* 20:02 pres context, i.e. data rep */
- uint16 opnum; /* 22:02 operation #
+ UINT16 opnum; /* 22:02 operation #
* within the interface */
/* optional field for request, only present if the PFC_OBJECT_UUID
.
.
. */
- uint8* stub_data;
+ BYTE* stub_data;
/* optional authentication verifier */
/* following fields present iff auth_length != 0 */
/* start 8-octet aligned */
/* common fields */
- uint8 rpc_vers; /* 00:01 RPC version */
- uint8 rpc_vers_minor; /* 01:01 minor version */
- uint8 PTYPE; /* 02:01 response PDU */
- uint8 pfc_flags; /* 03:01 flags */
- uint8 packed_drep[4]; /* 04:04 NDR data rep format label*/
- uint16 frag_length; /* 08:02 total length of fragment */
- uint16 auth_length; /* 10:02 length of auth_value */
+ BYTE rpc_vers; /* 00:01 RPC version */
+ BYTE rpc_vers_minor; /* 01:01 minor version */
+ BYTE PTYPE; /* 02:01 response PDU */
+ BYTE pfc_flags; /* 03:01 flags */
+ BYTE packed_drep[4]; /* 04:04 NDR data rep format label*/
+ UINT16 frag_length; /* 08:02 total length of fragment */
+ UINT16 auth_length; /* 10:02 length of auth_value */
uint32 call_id; /* 12:04 call identifier */
/* end common fields */
/* needed for response or fault */
- uint8 cancel_count; /* 22:01 cancel count */
- uint8 reserved; /* 23:01 reserved, m.b.z. */
+ BYTE cancel_count; /* 22:01 cancel count */
+ BYTE reserved; /* 23:01 reserved, m.b.z. */
/* stub data here, 8-octet aligned
.
.
. */
- uint8* stub_data;
+ BYTE* stub_data;
/* optional authentication verifier */
/* following fields present iff auth_length != 0 */
/* start 8-octet aligned */
/* common fields */
- uint8 rpc_vers; /* 00:01 RPC version */
- uint8 rpc_vers_minor; /* 01:01 minor version */
- uint8 PTYPE; /* 02:01 shutdown PDU */
- uint8 pfc_flags; /* 03:01 flags */
- uint8 packed_drep[4]; /* 04:04 NDR data rep format label*/
- uint16 frag_length; /* 08:02 total length of fragment */
- uint16 auth_length; /* 10:02 */
+ BYTE rpc_vers; /* 00:01 RPC version */
+ BYTE rpc_vers_minor; /* 01:01 minor version */
+ BYTE PTYPE; /* 02:01 shutdown PDU */
+ BYTE pfc_flags; /* 03:01 flags */
+ BYTE packed_drep[4]; /* 04:04 NDR data rep format label*/
+ UINT16 frag_length; /* 08:02 total length of fragment */
+ UINT16 auth_length; /* 10:02 */
uint32 call_id; /* 12:04 call identifier */
/* end common fields */
struct rpc_virtual_connection
{
- uint8 Cookie[16]; /* Virtual Connection Cookie */
+ BYTE Cookie[16]; /* Virtual Connection Cookie */
VIRTUAL_CONNECTION_STATE State; /* Virtual Connection State */
RpcInChannel* DefaultInChannel; /* Default IN Channel */
RpcInChannel* NonDefaultInChannel; /* Non-Default IN Channel */
- uint8 DefaultInChannelCookie[16]; /* Default IN Channel Cookie */
- uint8 NonDefaultInChannelCookie[16]; /* Non-Default Default IN Channel Cookie */
+ BYTE DefaultInChannelCookie[16]; /* Default IN Channel Cookie */
+ BYTE NonDefaultInChannelCookie[16]; /* Non-Default Default IN Channel Cookie */
RpcOutChannel* DefaultOutChannel; /* Default OUT Channel */
RpcOutChannel* NonDefaultOutChannel; /* Non-Default OUT Channel */
- uint8 DefaultOutChannelCookie[16]; /* Default OUT Channel Cookie */
- uint8 NonDefaultOutChannelCookie[16]; /* Non-Default Default OUT Channel Cookie */
- uint8 AssociationGroupId[16]; /* AssociationGroupId */
+ BYTE DefaultOutChannelCookie[16]; /* Default OUT Channel Cookie */
+ BYTE NonDefaultOutChannelCookie[16]; /* Non-Default Default OUT Channel Cookie */
+ BYTE AssociationGroupId[16]; /* AssociationGroupId */
};
typedef struct rpc_virtual_connection RpcVirtualConnection;
rdpSettings* settings;
rdpTransport* transport;
- uint8* write_buffer;
+ BYTE* write_buffer;
uint32 write_buffer_len;
- uint8* read_buffer;
+ BYTE* read_buffer;
uint32 read_buffer_len;
uint32 call_id;
void rpc_pdu_header_read(STREAM* s, RPC_PDU_HEADER* header);
-int rpc_out_write(rdpRpc* rpc, uint8* data, int length);
-int rpc_in_write(rdpRpc* rpc, uint8* data, int length);
+int rpc_out_write(rdpRpc* rpc, BYTE* data, int length);
+int rpc_in_write(rdpRpc* rpc, BYTE* data, int length);
-int rpc_out_read(rdpRpc* rpc, uint8* data, int length);
+int rpc_out_read(rdpRpc* rpc, BYTE* data, int length);
-int rpc_tsg_write(rdpRpc* rpc, uint8* data, int length, uint16 opnum);
-int rpc_read(rdpRpc* rpc, uint8* data, int length);
+int rpc_tsg_write(rdpRpc* rpc, BYTE* data, int length, UINT16 opnum);
+int rpc_read(rdpRpc* rpc, BYTE* data, int length);
rdpRpc* rpc_new(rdpTransport* transport);
void rpc_free(rdpRpc* rpc);
void rts_pdu_header_read(STREAM* s, RTS_PDU_HEADER* header)
{
- stream_read_uint8(s, header->rpc_vers); /* rpc_vers (1 byte) */
- stream_read_uint8(s, header->rpc_vers_minor); /* rpc_vers_minor (1 byte) */
- stream_read_uint8(s, header->ptype); /* PTYPE (1 byte) */
- stream_read_uint8(s, header->pfc_flags); /* pfc_flags (1 byte) */
- stream_read_uint8(s, header->packed_drep[0]); /* packet_drep[0] (1 byte) */
- stream_read_uint8(s, header->packed_drep[1]); /* packet_drep[1] (1 byte) */
- stream_read_uint8(s, header->packed_drep[2]); /* packet_drep[2] (1 byte) */
- stream_read_uint8(s, header->packed_drep[3]); /* packet_drep[3] (1 byte) */
- stream_read_uint16(s, header->frag_length); /* frag_length (2 bytes) */
- stream_read_uint16(s, header->auth_length); /* auth_length (2 bytes) */
+ stream_read_BYTE(s, header->rpc_vers); /* rpc_vers (1 byte) */
+ stream_read_BYTE(s, header->rpc_vers_minor); /* rpc_vers_minor (1 byte) */
+ stream_read_BYTE(s, header->ptype); /* PTYPE (1 byte) */
+ stream_read_BYTE(s, header->pfc_flags); /* pfc_flags (1 byte) */
+ stream_read_BYTE(s, header->packed_drep[0]); /* packet_drep[0] (1 byte) */
+ stream_read_BYTE(s, header->packed_drep[1]); /* packet_drep[1] (1 byte) */
+ stream_read_BYTE(s, header->packed_drep[2]); /* packet_drep[2] (1 byte) */
+ stream_read_BYTE(s, header->packed_drep[3]); /* packet_drep[3] (1 byte) */
+ stream_read_UINT16(s, header->frag_length); /* frag_length (2 bytes) */
+ stream_read_UINT16(s, header->auth_length); /* auth_length (2 bytes) */
stream_read_uint32(s, header->call_id); /* call_id (4 bytes) */
- stream_read_uint16(s, header->flags); /* flags (2 bytes) */
- stream_read_uint16(s, header->numberOfCommands); /* numberOfCommands (2 bytes) */
+ stream_read_UINT16(s, header->flags); /* flags (2 bytes) */
+ stream_read_UINT16(s, header->numberOfCommands); /* numberOfCommands (2 bytes) */
}
void rts_pdu_header_write(STREAM* s, RTS_PDU_HEADER* header)
{
- stream_write_uint8(s, header->rpc_vers); /* rpc_vers (1 byte) */
- stream_write_uint8(s, header->rpc_vers_minor); /* rpc_vers_minor (1 byte) */
- stream_write_uint8(s, header->ptype); /* PTYPE (1 byte) */
- stream_write_uint8(s, header->pfc_flags); /* pfc_flags (1 byte) */
- stream_write_uint8(s, header->packed_drep[0]); /* packet_drep[0] (1 byte) */
- stream_write_uint8(s, header->packed_drep[1]); /* packet_drep[1] (1 byte) */
- stream_write_uint8(s, header->packed_drep[2]); /* packet_drep[2] (1 byte) */
- stream_write_uint8(s, header->packed_drep[3]); /* packet_drep[3] (1 byte) */
- stream_write_uint16(s, header->frag_length); /* frag_length (2 bytes) */
- stream_write_uint16(s, header->auth_length); /* auth_length (2 bytes) */
+ stream_write_BYTE(s, header->rpc_vers); /* rpc_vers (1 byte) */
+ stream_write_BYTE(s, header->rpc_vers_minor); /* rpc_vers_minor (1 byte) */
+ stream_write_BYTE(s, header->ptype); /* PTYPE (1 byte) */
+ stream_write_BYTE(s, header->pfc_flags); /* pfc_flags (1 byte) */
+ stream_write_BYTE(s, header->packed_drep[0]); /* packet_drep[0] (1 byte) */
+ stream_write_BYTE(s, header->packed_drep[1]); /* packet_drep[1] (1 byte) */
+ stream_write_BYTE(s, header->packed_drep[2]); /* packet_drep[2] (1 byte) */
+ stream_write_BYTE(s, header->packed_drep[3]); /* packet_drep[3] (1 byte) */
+ stream_write_UINT16(s, header->frag_length); /* frag_length (2 bytes) */
+ stream_write_UINT16(s, header->auth_length); /* auth_length (2 bytes) */
stream_write_uint32(s, header->call_id); /* call_id (4 bytes) */
- stream_write_uint16(s, header->flags); /* flags (2 bytes) */
- stream_write_uint16(s, header->numberOfCommands); /* numberOfCommands (2 bytes) */
+ stream_write_UINT16(s, header->flags); /* flags (2 bytes) */
+ stream_write_UINT16(s, header->numberOfCommands); /* numberOfCommands (2 bytes) */
}
void rts_receive_window_size_command_read(rdpRpc* rpc, STREAM* s)
stream_seek(s, 16); /* ChannelCookie (16 bytes) */
}
-void rts_flow_control_ack_command_write(STREAM* s, uint32 BytesReceived, uint32 AvailableWindow, uint8* ChannelCookie)
+void rts_flow_control_ack_command_write(STREAM* s, uint32 BytesReceived, uint32 AvailableWindow, BYTE* ChannelCookie)
{
stream_write_uint32(s, RTS_CMD_FLOW_CONTROL_ACK); /* CommandType (4 bytes) */
stream_seek(s, 16); /* Cookie (16 bytes) */
}
-void rts_cookie_command_write(STREAM* s, uint8* Cookie)
+void rts_cookie_command_write(STREAM* s, BYTE* Cookie)
{
stream_write_uint32(s, RTS_CMD_COOKIE); /* CommandType (4 bytes) */
stream_write(s, Cookie, 16); /* Cookie (16 bytes) */
stream_seek(s, 12); /* padding (12 bytes) */
}
-void rts_client_address_command_write(STREAM* s, uint32 AddressType, uint8* ClientAddress)
+void rts_client_address_command_write(STREAM* s, uint32 AddressType, BYTE* ClientAddress)
{
stream_write_uint32(s, RTS_CMD_CLIENT_ADDRESS); /* CommandType (4 bytes) */
stream_write_uint32(s, AddressType); /* AddressType (4 bytes) */
stream_seek(s, 16); /* AssociationGroupId (16 bytes) */
}
-void rts_association_group_id_command_write(STREAM* s, uint8* associationGroupId)
+void rts_association_group_id_command_write(STREAM* s, BYTE* associationGroupId)
{
stream_write_uint32(s, RTS_CMD_ASSOCIATION_GROUP_ID); /* CommandType (4 bytes) */
stream_write(s, associationGroupId, 16); /* AssociationGroupId (16 bytes) */
stream_write_uint32(s, PingTrafficSent); /* PingTrafficSent (4 bytes) */
}
-void rpc_generate_cookie(uint8* cookie)
+void rpc_generate_cookie(BYTE* cookie)
{
RAND_pseudo_bytes(cookie, 16);
}
STREAM* s;
RTS_PDU_HEADER header;
uint32 ReceiveWindowSize;
- uint8* OUTChannelCookie;
- uint8* VirtualConnectionCookie;
+ BYTE* OUTChannelCookie;
+ BYTE* VirtualConnectionCookie;
header.rpc_vers = 5;
header.rpc_vers_minor = 0;
s = stream_new(header.frag_length);
- rpc_generate_cookie((uint8*) &(rpc->VirtualConnection->Cookie));
- rpc_generate_cookie((uint8*) &(rpc->VirtualConnection->DefaultOutChannelCookie));
+ rpc_generate_cookie((BYTE*) &(rpc->VirtualConnection->Cookie));
+ rpc_generate_cookie((BYTE*) &(rpc->VirtualConnection->DefaultOutChannelCookie));
- VirtualConnectionCookie = (uint8*) &(rpc->VirtualConnection->Cookie);
- OUTChannelCookie = (uint8*) &(rpc->VirtualConnection->DefaultOutChannelCookie);
+ VirtualConnectionCookie = (BYTE*) &(rpc->VirtualConnection->Cookie);
+ OUTChannelCookie = (BYTE*) &(rpc->VirtualConnection->DefaultOutChannelCookie);
ReceiveWindowSize = rpc->VirtualConnection->DefaultOutChannel->ReceiveWindow;
rts_pdu_header_write(s, &header); /* RTS Header (20 bytes) */
{
STREAM* s;
RTS_PDU_HEADER header;
- uint8* INChannelCookie;
- uint8* AssociationGroupId;
- uint8* VirtualConnectionCookie;
+ BYTE* INChannelCookie;
+ BYTE* AssociationGroupId;
+ BYTE* VirtualConnectionCookie;
header.rpc_vers = 5;
header.rpc_vers_minor = 0;
s = stream_new(header.frag_length);
- rpc_generate_cookie((uint8*) &(rpc->VirtualConnection->DefaultInChannelCookie));
- rpc_generate_cookie((uint8*) &(rpc->VirtualConnection->AssociationGroupId));
+ rpc_generate_cookie((BYTE*) &(rpc->VirtualConnection->DefaultInChannelCookie));
+ rpc_generate_cookie((BYTE*) &(rpc->VirtualConnection->AssociationGroupId));
- VirtualConnectionCookie = (uint8*) &(rpc->VirtualConnection->Cookie);
- INChannelCookie = (uint8*) &(rpc->VirtualConnection->DefaultInChannelCookie);
- AssociationGroupId = (uint8*) &(rpc->VirtualConnection->AssociationGroupId);
+ VirtualConnectionCookie = (BYTE*) &(rpc->VirtualConnection->Cookie);
+ INChannelCookie = (BYTE*) &(rpc->VirtualConnection->DefaultInChannelCookie);
+ AssociationGroupId = (BYTE*) &(rpc->VirtualConnection->AssociationGroupId);
rts_pdu_header_write(s, &header); /* RTS Header (20 bytes) */
rts_version_command_write(s); /* Version (8 bytes) */
RTS_PDU_HEADER header;
uint32 BytesReceived;
uint32 AvailableWindow;
- uint8* ChannelCookie;
+ BYTE* ChannelCookie;
header.rpc_vers = 5;
header.rpc_vers_minor = 0;
BytesReceived = rpc->VirtualConnection->DefaultOutChannel->BytesReceived;
AvailableWindow = rpc->VirtualConnection->DefaultOutChannel->ReceiverAvailableWindow;
- ChannelCookie = (uint8*) &(rpc->VirtualConnection->DefaultOutChannelCookie);
+ ChannelCookie = (BYTE*) &(rpc->VirtualConnection->DefaultOutChannelCookie);
s = stream_new(header.frag_length);
rts_pdu_header_write(s, &header); /* RTS Header (20 bytes) */
STREAM* s;
int status;
int length;
- uint8 header_buffer[20];
+ BYTE header_buffer[20];
rdpTls* tls_out = rpc->tls_out;
/* read first 20 bytes to get RTS PDU Header */
- status = tls_read(tls_out, (uint8*) &header_buffer, 20);
+ status = tls_read(tls_out, (BYTE*) &header_buffer, 20);
if (status <= 0)
{
stream_free(s);
length = rts_pdu->header.frag_length - 20;
- rts_pdu->content = (uint8*) malloc(length);
+ rts_pdu->content = (BYTE*) malloc(length);
status = tls_read(tls_out, rts_pdu->content, length);
struct _rts_pdu_header
{
- uint8 rpc_vers;
- uint8 rpc_vers_minor;
- uint8 ptype;
- uint8 pfc_flags;
- uint8 packed_drep[4];
- uint16 frag_length;
- uint16 auth_length;
+ BYTE rpc_vers;
+ BYTE rpc_vers_minor;
+ BYTE ptype;
+ BYTE pfc_flags;
+ BYTE packed_drep[4];
+ UINT16 frag_length;
+ UINT16 auth_length;
uint32 call_id;
- uint16 flags;
- uint16 numberOfCommands;
+ UINT16 flags;
+ UINT16 numberOfCommands;
};
typedef struct _rts_pdu_header RTS_PDU_HEADER;
struct _rts_pdu
{
RTS_PDU_HEADER header;
- uint8* content;
+ BYTE* content;
};
typedef struct _rts_pdu RTS_PDU;
void rts_receive_window_size_command_read(rdpRpc* rpc, STREAM* s);
void rts_receive_window_size_command_write(STREAM* s, uint32 ReceiveWindowSize);
void rts_flow_control_ack_command_read(rdpRpc* rpc, STREAM* s);
-void rts_flow_control_ack_command_write(STREAM* s, uint32 BytesReceived, uint32 AvailableWindow, uint8* ChannelCookie);
+void rts_flow_control_ack_command_write(STREAM* s, uint32 BytesReceived, uint32 AvailableWindow, BYTE* ChannelCookie);
void rts_connection_timeout_command_read(rdpRpc* rpc, STREAM* s);
void rts_connection_timeout_command_write(STREAM* s, uint32 ConnectionTimeout);
void rts_cookie_command_read(rdpRpc* rpc, STREAM* s);
-void rts_cookie_command_write(STREAM* s, uint8* Cookie);
+void rts_cookie_command_write(STREAM* s, BYTE* Cookie);
void rts_channel_lifetime_command_read(rdpRpc* rpc, STREAM* s);
void rts_channel_lifetime_command_write(STREAM* s, uint32 ChannelLifetime);
void rts_client_keepalive_command_read(rdpRpc* rpc, STREAM* s);
void rts_ance_command_read(rdpRpc* rpc, STREAM* s);
void rts_ance_command_write(STREAM* s);
void rts_client_address_command_read(rdpRpc* rpc, STREAM* s);
-void rts_client_address_command_write(STREAM* s, uint32 AddressType, uint8* ClientAddress);
+void rts_client_address_command_write(STREAM* s, uint32 AddressType, BYTE* ClientAddress);
void rts_association_group_id_command_read(rdpRpc* rpc, STREAM* s);
-void rts_association_group_id_command_write(STREAM* s, uint8* AssociationGroupId);
+void rts_association_group_id_command_write(STREAM* s, BYTE* AssociationGroupId);
void rts_destination_command_read(rdpRpc* rpc, STREAM* s);
void rts_destination_command_write(STREAM* s, uint32 Destination);
void rts_ping_traffic_sent_notify_command_read(rdpRpc* rpc, STREAM* s);
#include "security.h"
/* 0x36 repeated 40 times */
-static const uint8 pad1[40] =
+static const BYTE pad1[40] =
{
"\x36\x36\x36\x36\x36\x36\x36\x36"
"\x36\x36\x36\x36\x36\x36\x36\x36"
};
/* 0x5C repeated 48 times */
-static const uint8 pad2[48] =
+static const BYTE pad2[48] =
{
"\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C"
"\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C"
"\x5C\x5C\x5C\x5C\x5C\x5C\x5C\x5C"
};
-static const uint8
+static const BYTE
fips_reverse_table[256] =
{
0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
};
-static const uint8
+static const BYTE
fips_oddparity_table[256] =
{
0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x07, 0x07,
0xf8, 0xf8, 0xfb, 0xfb, 0xfd, 0xfd, 0xfe, 0xfe
};
-static void security_salted_hash(uint8* salt, uint8* input, int length, uint8* salt1, uint8* salt2, uint8* output)
+static void security_salted_hash(BYTE* salt, BYTE* input, int length, BYTE* salt1, BYTE* salt2, BYTE* output)
{
CryptoMd5 md5;
CryptoSha1 sha1;
- uint8 sha1_digest[CRYPTO_SHA1_DIGEST_LENGTH];
+ BYTE sha1_digest[CRYPTO_SHA1_DIGEST_LENGTH];
/* SaltedHash(Salt, Input, Salt1, Salt2) = MD5(S + SHA1(Input + Salt + Salt1 + Salt2)) */
crypto_md5_final(md5, output);
}
-static void security_premaster_hash(char* input, int length, uint8* premaster_secret, uint8* client_random, uint8* server_random, uint8* output)
+static void security_premaster_hash(char* input, int length, BYTE* premaster_secret, BYTE* client_random, BYTE* server_random, BYTE* output)
{
/* PremasterHash(Input) = SaltedHash(PremasterSecret, Input, ClientRandom, ServerRandom) */
- security_salted_hash(premaster_secret, (uint8*)input, length, client_random, server_random, output);
+ security_salted_hash(premaster_secret, (BYTE*)input, length, client_random, server_random, output);
}
-void security_master_secret(uint8* premaster_secret, uint8* client_random, uint8* server_random, uint8* output)
+void security_master_secret(BYTE* premaster_secret, BYTE* client_random, BYTE* server_random, BYTE* output)
{
/* MasterSecret = PremasterHash('A') + PremasterHash('BB') + PremasterHash('CCC') */
security_premaster_hash("A", 1, premaster_secret, client_random, server_random, &output[0]);
security_premaster_hash("CCC", 3, premaster_secret, client_random, server_random, &output[32]);
}
-static void security_master_hash(char* input, int length, uint8* master_secret, uint8* client_random, uint8* server_random, uint8* output)
+static void security_master_hash(char* input, int length, BYTE* master_secret, BYTE* client_random, BYTE* server_random, BYTE* output)
{
/* MasterHash(Input) = SaltedHash(MasterSecret, Input, ServerRandom, ClientRandom) */
- security_salted_hash(master_secret, (uint8*)input, length, server_random, client_random, output);
+ security_salted_hash(master_secret, (BYTE*)input, length, server_random, client_random, output);
}
-void security_session_key_blob(uint8* master_secret, uint8* client_random, uint8* server_random, uint8* output)
+void security_session_key_blob(BYTE* master_secret, BYTE* client_random, BYTE* server_random, BYTE* output)
{
/* MasterHash = MasterHash('A') + MasterHash('BB') + MasterHash('CCC') */
security_master_hash("A", 1, master_secret, client_random, server_random, &output[0]);
security_master_hash("CCC", 3, master_secret, client_random, server_random, &output[32]);
}
-void security_mac_salt_key(uint8* session_key_blob, uint8* client_random, uint8* server_random, uint8* output)
+void security_mac_salt_key(BYTE* session_key_blob, BYTE* client_random, BYTE* server_random, BYTE* output)
{
/* MacSaltKey = First128Bits(SessionKeyBlob) */
memcpy(output, session_key_blob, 16);
}
-void security_md5_16_32_32(uint8* in0, uint8* in1, uint8* in2, uint8* output)
+void security_md5_16_32_32(BYTE* in0, BYTE* in1, BYTE* in2, BYTE* output)
{
CryptoMd5 md5;
crypto_md5_final(md5, output);
}
-void security_licensing_encryption_key(uint8* session_key_blob, uint8* client_random, uint8* server_random, uint8* output)
+void security_licensing_encryption_key(BYTE* session_key_blob, BYTE* client_random, BYTE* server_random, BYTE* output)
{
/* LicensingEncryptionKey = MD5(Second128Bits(SessionKeyBlob) + ClientRandom + ServerRandom)) */
security_md5_16_32_32(&session_key_blob[16], client_random, server_random, output);
}
-void security_uint32_le(uint8* output, uint32 value)
+void security_uint32_le(BYTE* output, uint32 value)
{
output[0] = (value) & 0xFF;
output[1] = (value >> 8) & 0xFF;
output[3] = (value >> 24) & 0xFF;
}
-void security_mac_data(uint8* mac_salt_key, uint8* data, uint32 length, uint8* output)
+void security_mac_data(BYTE* mac_salt_key, BYTE* data, uint32 length, BYTE* output)
{
CryptoMd5 md5;
CryptoSha1 sha1;
- uint8 length_le[4];
- uint8 sha1_digest[CRYPTO_SHA1_DIGEST_LENGTH];
+ BYTE length_le[4];
+ BYTE sha1_digest[CRYPTO_SHA1_DIGEST_LENGTH];
/* MacData = MD5(MacSaltKey + pad2 + SHA1(MacSaltKey + pad1 + length + data)) */
crypto_md5_final(md5, output);
}
-void security_mac_signature(rdpRdp *rdp, uint8* data, uint32 length, uint8* output)
+void security_mac_signature(rdpRdp *rdp, BYTE* data, uint32 length, BYTE* output)
{
CryptoMd5 md5;
CryptoSha1 sha1;
- uint8 length_le[4];
- uint8 md5_digest[CRYPTO_MD5_DIGEST_LENGTH];
- uint8 sha1_digest[CRYPTO_SHA1_DIGEST_LENGTH];
+ BYTE length_le[4];
+ BYTE md5_digest[CRYPTO_MD5_DIGEST_LENGTH];
+ BYTE sha1_digest[CRYPTO_SHA1_DIGEST_LENGTH];
security_uint32_le(length_le, length); /* length must be little-endian */
memcpy(output, md5_digest, 8);
}
-void security_salted_mac_signature(rdpRdp *rdp, uint8* data, uint32 length, BOOL encryption, uint8* output)
+void security_salted_mac_signature(rdpRdp *rdp, BYTE* data, uint32 length, BOOL encryption, BYTE* output)
{
CryptoMd5 md5;
CryptoSha1 sha1;
- uint8 length_le[4];
- uint8 use_count_le[4];
- uint8 md5_digest[CRYPTO_MD5_DIGEST_LENGTH];
- uint8 sha1_digest[CRYPTO_SHA1_DIGEST_LENGTH];
+ BYTE length_le[4];
+ BYTE use_count_le[4];
+ BYTE md5_digest[CRYPTO_MD5_DIGEST_LENGTH];
+ BYTE sha1_digest[CRYPTO_SHA1_DIGEST_LENGTH];
security_uint32_le(length_le, length); /* length must be little-endian */
if (encryption)
memcpy(output, md5_digest, 8);
}
-static void security_A(uint8* master_secret, uint8* client_random, uint8* server_random, uint8* output)
+static void security_A(BYTE* master_secret, BYTE* client_random, BYTE* server_random, BYTE* output)
{
security_premaster_hash("A", 1, master_secret, client_random, server_random, &output[0]);
security_premaster_hash("BB", 2, master_secret, client_random, server_random, &output[16]);
security_premaster_hash("CCC", 3, master_secret, client_random, server_random, &output[32]);
}
-static void security_X(uint8* master_secret, uint8* client_random, uint8* server_random, uint8* output)
+static void security_X(BYTE* master_secret, BYTE* client_random, BYTE* server_random, BYTE* output)
{
security_premaster_hash("X", 1, master_secret, client_random, server_random, &output[0]);
security_premaster_hash("YY", 2, master_secret, client_random, server_random, &output[16]);
security_premaster_hash("ZZZ", 3, master_secret, client_random, server_random, &output[32]);
}
-static void fips_expand_key_bits(uint8* in, uint8* out)
+static void fips_expand_key_bits(BYTE* in, BYTE* out)
{
- uint8 buf[21], c;
+ BYTE buf[21], c;
int i, b, p, r;
/* reverse every byte in the key */
out[i] = fips_oddparity_table[fips_reverse_table[out[i]]];
}
-BOOL security_establish_keys(uint8* client_random, rdpRdp* rdp)
+BOOL security_establish_keys(BYTE* client_random, rdpRdp* rdp)
{
- uint8 pre_master_secret[48];
- uint8 master_secret[48];
- uint8 session_key_blob[48];
- uint8* server_random;
- uint8 salt40[] = { 0xD1, 0x26, 0x9E };
+ BYTE pre_master_secret[48];
+ BYTE master_secret[48];
+ BYTE session_key_blob[48];
+ BYTE* server_random;
+ BYTE salt40[] = { 0xD1, 0x26, 0x9E };
rdpSettings* settings;
settings = rdp->settings;
if (settings->encryption_method == ENCRYPTION_METHOD_FIPS)
{
CryptoSha1 sha1;
- uint8 client_encrypt_key_t[CRYPTO_SHA1_DIGEST_LENGTH + 1];
- uint8 client_decrypt_key_t[CRYPTO_SHA1_DIGEST_LENGTH + 1];
+ BYTE client_encrypt_key_t[CRYPTO_SHA1_DIGEST_LENGTH + 1];
+ BYTE client_decrypt_key_t[CRYPTO_SHA1_DIGEST_LENGTH + 1];
printf("FIPS Compliant encryption level.\n");
return TRUE;
}
-BOOL security_key_update(uint8* key, uint8* update_key, int key_len)
+BOOL security_key_update(BYTE* key, BYTE* update_key, int key_len)
{
- uint8 sha1h[CRYPTO_SHA1_DIGEST_LENGTH];
+ BYTE sha1h[CRYPTO_SHA1_DIGEST_LENGTH];
CryptoMd5 md5;
CryptoSha1 sha1;
CryptoRc4 rc4;
- uint8 salt40[] = { 0xD1, 0x26, 0x9E };
+ BYTE salt40[] = { 0xD1, 0x26, 0x9E };
sha1 = crypto_sha1_init();
crypto_sha1_update(sha1, update_key, key_len);
return TRUE;
}
-BOOL security_encrypt(uint8* data, int length, rdpRdp* rdp)
+BOOL security_encrypt(BYTE* data, int length, rdpRdp* rdp)
{
if (rdp->encrypt_use_count >= 4096)
{
return TRUE;
}
-BOOL security_decrypt(uint8* data, int length, rdpRdp* rdp)
+BOOL security_decrypt(BYTE* data, int length, rdpRdp* rdp)
{
if (rdp->decrypt_use_count >= 4096)
{
return TRUE;
}
-void security_hmac_signature(uint8* data, int length, uint8* output, rdpRdp* rdp)
+void security_hmac_signature(BYTE* data, int length, BYTE* output, rdpRdp* rdp)
{
- uint8 buf[20];
- uint8 use_count_le[4];
+ BYTE buf[20];
+ BYTE use_count_le[4];
security_uint32_le(use_count_le, rdp->encrypt_use_count);
memmove(output, buf, 8);
}
-BOOL security_fips_encrypt(uint8* data, int length, rdpRdp* rdp)
+BOOL security_fips_encrypt(BYTE* data, int length, rdpRdp* rdp)
{
crypto_des3_encrypt(rdp->fips_encrypt, length, data, data);
rdp->encrypt_use_count++;
return TRUE;
}
-BOOL security_fips_decrypt(uint8* data, int length, rdpRdp* rdp)
+BOOL security_fips_decrypt(BYTE* data, int length, rdpRdp* rdp)
{
crypto_des3_decrypt(rdp->fips_decrypt, length, data, data);
return TRUE;
}
-BOOL security_fips_check_signature(uint8* data, int length, uint8* sig, rdpRdp* rdp)
+BOOL security_fips_check_signature(BYTE* data, int length, BYTE* sig, rdpRdp* rdp)
{
- uint8 buf[20];
- uint8 use_count_le[4];
+ BYTE buf[20];
+ BYTE use_count_le[4];
security_uint32_le(use_count_le, rdp->decrypt_use_count);
#include <freerdp/freerdp.h>
#include <freerdp/utils/stream.h>
-void security_master_secret(uint8* premaster_secret, uint8* client_random, uint8* server_random, uint8* output);
-void security_session_key_blob(uint8* master_secret, uint8* client_random, uint8* server_random, uint8* output);
-void security_mac_salt_key(uint8* session_key_blob, uint8* client_random, uint8* server_random, uint8* output);
-void security_licensing_encryption_key(uint8* session_key_blob, uint8* client_random, uint8* server_random, uint8* output);
-void security_mac_data(uint8* mac_salt_key, uint8* data, uint32 length, uint8* output);
-
-void security_mac_signature(rdpRdp *rdp, uint8* data, uint32 length, uint8* output);
-void security_salted_mac_signature(rdpRdp *rdp, uint8* data, uint32 length, BOOL encryption, uint8* output);
-BOOL security_establish_keys(uint8* client_random, rdpRdp* rdp);
-
-BOOL security_encrypt(uint8* data, int length, rdpRdp* rdp);
-BOOL security_decrypt(uint8* data, int length, rdpRdp* rdp);
-
-void security_hmac_signature(uint8* data, int length, uint8* output, rdpRdp* rdp);
-BOOL security_fips_encrypt(uint8* data, int length, rdpRdp* rdp);
-BOOL security_fips_decrypt(uint8* data, int length, rdpRdp* rdp);
-BOOL security_fips_check_signature(uint8* data, int length, uint8* sig, rdpRdp* rdp);
+void security_master_secret(BYTE* premaster_secret, BYTE* client_random, BYTE* server_random, BYTE* output);
+void security_session_key_blob(BYTE* master_secret, BYTE* client_random, BYTE* server_random, BYTE* output);
+void security_mac_salt_key(BYTE* session_key_blob, BYTE* client_random, BYTE* server_random, BYTE* output);
+void security_licensing_encryption_key(BYTE* session_key_blob, BYTE* client_random, BYTE* server_random, BYTE* output);
+void security_mac_data(BYTE* mac_salt_key, BYTE* data, uint32 length, BYTE* output);
+
+void security_mac_signature(rdpRdp *rdp, BYTE* data, uint32 length, BYTE* output);
+void security_salted_mac_signature(rdpRdp *rdp, BYTE* data, uint32 length, BOOL encryption, BYTE* output);
+BOOL security_establish_keys(BYTE* client_random, rdpRdp* rdp);
+
+BOOL security_encrypt(BYTE* data, int length, rdpRdp* rdp);
+BOOL security_decrypt(BYTE* data, int length, rdpRdp* rdp);
+
+void security_hmac_signature(BYTE* data, int length, BYTE* output, rdpRdp* rdp);
+BOOL security_fips_encrypt(BYTE* data, int length, rdpRdp* rdp);
+BOOL security_fips_decrypt(BYTE* data, int length, rdpRdp* rdp);
+BOOL security_fips_check_signature(BYTE* data, int length, BYTE* sig, rdpRdp* rdp);
#endif /* __SECURITY_H */
int pos;
SURFACE_BITS_COMMAND* cmd = &update->surface_bits_command;
- stream_read_uint16(s, cmd->destLeft);
- stream_read_uint16(s, cmd->destTop);
- stream_read_uint16(s, cmd->destRight);
- stream_read_uint16(s, cmd->destBottom);
- stream_read_uint8(s, cmd->bpp);
+ stream_read_UINT16(s, cmd->destLeft);
+ stream_read_UINT16(s, cmd->destTop);
+ stream_read_UINT16(s, cmd->destRight);
+ stream_read_UINT16(s, cmd->destBottom);
+ stream_read_BYTE(s, cmd->bpp);
stream_seek(s, 2); /* reserved1, reserved2 */
- stream_read_uint8(s, cmd->codecID);
- stream_read_uint16(s, cmd->width);
- stream_read_uint16(s, cmd->height);
+ stream_read_BYTE(s, cmd->codecID);
+ stream_read_UINT16(s, cmd->width);
+ stream_read_UINT16(s, cmd->height);
stream_read_uint32(s, cmd->bitmapDataLength);
pos = stream_get_pos(s) + cmd->bitmapDataLength;
cmd->bitmapData = stream_get_tail(s);
{
SURFACE_FRAME_MARKER* marker = &update->surface_frame_marker;
- stream_read_uint16(s, marker->frameAction);
+ stream_read_UINT16(s, marker->frameAction);
stream_read_uint32(s, marker->frameId);
IFCALL(update->SurfaceFrameMarker, update->context, marker);
BOOL update_recv_surfcmds(rdpUpdate* update, uint32 size, STREAM* s)
{
- uint8* mark;
- uint16 cmdType;
+ BYTE* mark;
+ UINT16 cmdType;
uint32 cmdLength;
while (size > 2)
{
stream_get_mark(s, mark);
- stream_read_uint16(s, cmdType);
+ stream_read_UINT16(s, cmdType);
size -= 2;
switch (cmdType)
{
stream_check_size(s, SURFCMD_SURFACE_BITS_HEADER_LENGTH);
- stream_write_uint16(s, CMDTYPE_STREAM_SURFACE_BITS);
-
- stream_write_uint16(s, cmd->destLeft);
- stream_write_uint16(s, cmd->destTop);
- stream_write_uint16(s, cmd->destRight);
- stream_write_uint16(s, cmd->destBottom);
- stream_write_uint8(s, cmd->bpp);
- stream_write_uint16(s, 0); /* reserved1, reserved2 */
- stream_write_uint8(s, cmd->codecID);
- stream_write_uint16(s, cmd->width);
- stream_write_uint16(s, cmd->height);
+ stream_write_UINT16(s, CMDTYPE_STREAM_SURFACE_BITS);
+
+ stream_write_UINT16(s, cmd->destLeft);
+ stream_write_UINT16(s, cmd->destTop);
+ stream_write_UINT16(s, cmd->destRight);
+ stream_write_UINT16(s, cmd->destBottom);
+ stream_write_BYTE(s, cmd->bpp);
+ stream_write_UINT16(s, 0); /* reserved1, reserved2 */
+ stream_write_BYTE(s, cmd->codecID);
+ stream_write_UINT16(s, cmd->width);
+ stream_write_UINT16(s, cmd->height);
stream_write_uint32(s, cmd->bitmapDataLength);
}
-void update_write_surfcmd_frame_marker(STREAM* s, uint16 frameAction, uint32 frameId)
+void update_write_surfcmd_frame_marker(STREAM* s, UINT16 frameAction, uint32 frameId)
{
stream_check_size(s, SURFCMD_FRAME_MARKER_LENGTH);
- stream_write_uint16(s, CMDTYPE_FRAME_MARKER);
+ stream_write_UINT16(s, CMDTYPE_FRAME_MARKER);
- stream_write_uint16(s, frameAction);
+ stream_write_UINT16(s, frameAction);
stream_write_uint32(s, frameId);
}
BOOL update_recv_surfcmds(rdpUpdate* update, uint32 size, STREAM* s);
void update_write_surfcmd_surface_bits_header(STREAM* s, SURFACE_BITS_COMMAND* cmd);
-void update_write_surfcmd_frame_marker(STREAM* s, uint16 frameAction, uint32 frameId);
+void update_write_surfcmd_frame_marker(STREAM* s, UINT16 frameAction, uint32 frameId);
#endif /* __SURFACE */
void tcp_get_ip_address(rdpTcp * tcp)
{
- uint8* ip;
+ BYTE* ip;
socklen_t length;
struct sockaddr_in sockaddr;
if (getsockname(tcp->sockfd, (struct sockaddr*) &sockaddr, &length) == 0)
{
- ip = (uint8*) (&sockaddr.sin_addr);
+ ip = (BYTE*) (&sockaddr.sin_addr);
snprintf(tcp->ip_address, sizeof(tcp->ip_address),
"%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]);
}
void tcp_get_mac_address(rdpTcp * tcp)
{
#ifdef LINUX
- uint8* mac;
+ BYTE* mac;
struct ifreq if_req;
struct if_nameindex* ni;
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); */
}
-BOOL tcp_connect(rdpTcp* tcp, const char* hostname, uint16 port)
+BOOL tcp_connect(rdpTcp* tcp, const char* hostname, UINT16 port)
{
uint32 option_value;
socklen_t option_len;
return TRUE;
}
-int tcp_read(rdpTcp* tcp, uint8* data, int length)
+int tcp_read(rdpTcp* tcp, BYTE* data, int length)
{
return freerdp_tcp_read(tcp->sockfd, data, length);
}
-int tcp_write(rdpTcp* tcp, uint8* data, int length)
+int tcp_write(rdpTcp* tcp, BYTE* data, int length)
{
return freerdp_tcp_write(tcp->sockfd, data, length);
}
{
int sockfd;
char ip_address[32];
- uint8 mac_address[6];
+ BYTE mac_address[6];
struct rdp_settings* settings;
#ifdef _WIN32
WSAEVENT wsa_event;
#endif
};
-BOOL tcp_connect(rdpTcp* tcp, const char* hostname, uint16 port);
+BOOL tcp_connect(rdpTcp* tcp, const char* hostname, UINT16 port);
BOOL tcp_disconnect(rdpTcp* tcp);
-int tcp_read(rdpTcp* tcp, uint8* data, int length);
-int tcp_write(rdpTcp* tcp, uint8* data, int length);
+int tcp_read(rdpTcp* tcp, BYTE* data, int length);
+int tcp_write(rdpTcp* tcp, BYTE* data, int length);
BOOL tcp_set_blocking_mode(rdpTcp* tcp, BOOL blocking);
BOOL tcp_set_keep_alive_mode(rdpTcp* tcp);
void rdp_read_system_time(STREAM* s, SYSTEM_TIME* system_time)
{
- stream_read_uint16(s, system_time->wYear); /* wYear, must be set to 0 */
- stream_read_uint16(s, system_time->wMonth); /* wMonth */
- stream_read_uint16(s, system_time->wDayOfWeek); /* wDayOfWeek */
- stream_read_uint16(s, system_time->wDay); /* wDay */
- stream_read_uint16(s, system_time->wHour); /* wHour */
- stream_read_uint16(s, system_time->wMinute); /* wMinute */
- stream_read_uint16(s, system_time->wSecond); /* wSecond */
- stream_read_uint16(s, system_time->wMilliseconds); /* wMilliseconds */
+ stream_read_UINT16(s, system_time->wYear); /* wYear, must be set to 0 */
+ stream_read_UINT16(s, system_time->wMonth); /* wMonth */
+ stream_read_UINT16(s, system_time->wDayOfWeek); /* wDayOfWeek */
+ stream_read_UINT16(s, system_time->wDay); /* wDay */
+ stream_read_UINT16(s, system_time->wHour); /* wHour */
+ stream_read_UINT16(s, system_time->wMinute); /* wMinute */
+ stream_read_UINT16(s, system_time->wSecond); /* wSecond */
+ stream_read_UINT16(s, system_time->wMilliseconds); /* wMilliseconds */
}
/**
void rdp_write_system_time(STREAM* s, SYSTEM_TIME* system_time)
{
- stream_write_uint16(s, system_time->wYear); /* wYear, must be set to 0 */
- stream_write_uint16(s, system_time->wMonth); /* wMonth */
- stream_write_uint16(s, system_time->wDayOfWeek); /* wDayOfWeek */
- stream_write_uint16(s, system_time->wDay); /* wDay */
- stream_write_uint16(s, system_time->wHour); /* wHour */
- stream_write_uint16(s, system_time->wMinute); /* wMinute */
- stream_write_uint16(s, system_time->wSecond); /* wSecond */
- stream_write_uint16(s, system_time->wMilliseconds); /* wMilliseconds */
+ stream_write_UINT16(s, system_time->wYear); /* wYear, must be set to 0 */
+ stream_write_UINT16(s, system_time->wMonth); /* wMonth */
+ stream_write_UINT16(s, system_time->wDayOfWeek); /* wDayOfWeek */
+ stream_write_UINT16(s, system_time->wDay); /* wDay */
+ stream_write_UINT16(s, system_time->wHour); /* wHour */
+ stream_write_UINT16(s, system_time->wMinute); /* wMinute */
+ stream_write_UINT16(s, system_time->wSecond); /* wSecond */
+ stream_write_UINT16(s, system_time->wMilliseconds); /* wMilliseconds */
DEBUG_TIMEZONE("Time: y=%d,m=%d,dow=%d,d=%d, %02d:%02d:%02d.%03d",
system_time->wYear, system_time->wMonth, system_time->wDayOfWeek,
system_time->wDay, system_time->wHour, system_time->wMinute,
* @return TPDU length indicator (LI)
*/
-uint8
-tpdu_read_header(STREAM* s, uint8* code)
+BYTE
+tpdu_read_header(STREAM* s, BYTE* code)
{
- uint8 li;
+ BYTE li;
- stream_read_uint8(s, li); /* LI */
- stream_read_uint8(s, *code); /* Code */
+ stream_read_BYTE(s, li); /* LI */
+ stream_read_BYTE(s, *code); /* Code */
if (*code == X224_TPDU_DATA)
{
*/
void
-tpdu_write_header(STREAM* s, uint16 length, uint8 code)
+tpdu_write_header(STREAM* s, UINT16 length, BYTE code)
{
- stream_write_uint8(s, length); /* LI */
- stream_write_uint8(s, code); /* code */
+ stream_write_BYTE(s, length); /* LI */
+ stream_write_BYTE(s, code); /* code */
if (code == X224_TPDU_DATA)
{
- stream_write_uint8(s, 0x80); /* EOT */
+ stream_write_BYTE(s, 0x80); /* EOT */
}
else
{
- stream_write_uint16(s, 0); /* DST-REF */
- stream_write_uint16(s, 0); /* SRC-REF */
- stream_write_uint8(s, 0); /* Class 0 */
+ stream_write_UINT16(s, 0); /* DST-REF */
+ stream_write_UINT16(s, 0); /* SRC-REF */
+ stream_write_BYTE(s, 0); /* Class 0 */
}
}
* @return length indicator (LI)
*/
-uint8 tpdu_read_connection_request(STREAM* s)
+BYTE tpdu_read_connection_request(STREAM* s)
{
- uint8 li;
- uint8 code;
+ BYTE li;
+ BYTE code;
li = tpdu_read_header(s, &code);
*/
void
-tpdu_write_connection_request(STREAM* s, uint16 length)
+tpdu_write_connection_request(STREAM* s, UINT16 length)
{
tpdu_write_header(s, length, X224_TPDU_CONNECTION_REQUEST);
}
* @return length indicator (LI)
*/
-uint8
+BYTE
tpdu_read_connection_confirm(STREAM* s)
{
- uint8 li;
- uint8 code;
+ BYTE li;
+ BYTE code;
li = tpdu_read_header(s, &code);
*/
void
-tpdu_write_connection_confirm(STREAM* s, uint16 length)
+tpdu_write_connection_confirm(STREAM* s, UINT16 length)
{
tpdu_write_header(s, length, X224_TPDU_CONNECTION_CONFIRM);
}
*/
void
-tpdu_write_disconnect_request(STREAM* s, uint16 length)
+tpdu_write_disconnect_request(STREAM* s, UINT16 length)
{
tpdu_write_header(s, length, X224_TPDU_DISCONNECT_REQUEST);
}
* @param s stream
*/
-uint16
+UINT16
tpdu_read_data(STREAM* s)
{
- uint8 code;
- uint16 li;
+ BYTE code;
+ UINT16 li;
li = tpdu_read_header(s, &code);
#define TPDU_CONNECTION_CONFIRM_LENGTH (TPKT_HEADER_LENGTH + TPDU_CONNECTION_CONFIRM_HEADER_LENGTH)
#define TPDU_DISCONNECT_REQUEST_LENGTH (TPKT_HEADER_LENGTH + TPDU_DISCONNECT_REQUEST_HEADER_LENGTH)
-uint8 tpdu_read_header(STREAM* s, uint8* code);
-void tpdu_write_header(STREAM* s, uint16 length, uint8 code);
-uint8 tpdu_read_connection_request(STREAM* s);
-void tpdu_write_connection_request(STREAM* s, uint16 length);
-uint8 tpdu_read_connection_confirm(STREAM* s);
-void tpdu_write_connection_confirm(STREAM* s, uint16 length);
-void tpdu_write_disconnect_request(STREAM* s, uint16 length);
-uint16 tpdu_read_data(STREAM* s);
+BYTE tpdu_read_header(STREAM* s, BYTE* code);
+void tpdu_write_header(STREAM* s, UINT16 length, BYTE code);
+BYTE tpdu_read_connection_request(STREAM* s);
+void tpdu_write_connection_request(STREAM* s, UINT16 length);
+BYTE tpdu_read_connection_confirm(STREAM* s);
+void tpdu_write_connection_confirm(STREAM* s, UINT16 length);
+void tpdu_write_disconnect_request(STREAM* s, UINT16 length);
+UINT16 tpdu_read_data(STREAM* s);
void tpdu_write_data(STREAM* s);
#endif /* __TPDU_H */
BOOL tpkt_verify_header(STREAM* s)
{
- uint8 version;
+ BYTE version;
- stream_peek_uint8(s, version);
+ stream_peek_BYTE(s, version);
if (version == 3)
return TRUE;
else
* @return length
*/
-uint16 tpkt_read_header(STREAM* s)
+UINT16 tpkt_read_header(STREAM* s)
{
- uint8 version;
- uint16 length;
+ BYTE version;
+ UINT16 length;
- stream_peek_uint8(s, version);
+ stream_peek_BYTE(s, version);
if (version == 3)
{
stream_seek(s, 2);
- stream_read_uint16_be(s, length);
+ stream_read_UINT16_be(s, length);
}
else
{
* @param length
*/
-void tpkt_write_header(STREAM* s, uint16 length)
+void tpkt_write_header(STREAM* s, UINT16 length)
{
- stream_write_uint8(s, 3); /* version */
- stream_write_uint8(s, 0); /* reserved */
- stream_write_uint16_be(s, length); /* length */
+ stream_write_BYTE(s, 3); /* version */
+ stream_write_BYTE(s, 0); /* reserved */
+ stream_write_UINT16_be(s, length); /* length */
}
#define TPKT_HEADER_LENGTH 4
BOOL tpkt_verify_header(STREAM* s);
-uint16 tpkt_read_header(STREAM* s);
-void tpkt_write_header(STREAM* s, uint16 length);
+UINT16 tpkt_read_header(STREAM* s);
+void tpkt_write_header(STREAM* s, UINT16 length);
#endif /* __TPKT_H */
return TRUE;
}
-BOOL transport_tsg_connect(rdpTransport* transport, const char* hostname, uint16 port)
+BOOL transport_tsg_connect(rdpTransport* transport, const char* hostname, UINT16 port)
{
rdpTsg* tsg = tsg_new(transport);
return TRUE;
}
-BOOL transport_connect(rdpTransport* transport, const char* hostname, uint16 port)
+BOOL transport_connect(rdpTransport* transport, const char* hostname, UINT16 port)
{
BOOL status = FALSE;
rdpSettings* settings = transport->settings;
{
int pos;
int status;
- uint16 length;
+ UINT16 length;
STREAM* received;
rdpTransport* transport = *ptransport;
STREAM* transport_recv_stream_init(rdpTransport* transport, int size);
STREAM* transport_send_stream_init(rdpTransport* transport, int size);
-BOOL transport_connect(rdpTransport* transport, const char* hostname, uint16 port);
+BOOL transport_connect(rdpTransport* transport, const char* hostname, UINT16 port);
void transport_attach(rdpTransport* transport, int sockfd);
BOOL transport_disconnect(rdpTransport* transport);
BOOL transport_connect_rdp(rdpTransport* transport);
* RPC NDR Interface Reference: http://msdn.microsoft.com/en-us/library/windows/desktop/hh802752/
*/
-uint8 tsg_packet1[108] =
+BYTE tsg_packet1[108] =
{
0x43, 0x56, 0x00, 0x00, 0x43, 0x56, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x52, 0x54, 0x43, 0x56,
0x04, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
HRESULT ReturnValue: 00 00 00 00
*/
-uint8 tsg_packet2[112] =
+BYTE tsg_packet2[112] =
{
0x00, 0x00, 0x00, 0x00, 0x6A, 0x78, 0xE9, 0xAB, 0x02, 0x90, 0x1C, 0x44, 0x8D, 0x99, 0x29, 0x30,
0x53, 0x6C, 0x04, 0x33, 0x52, 0x51, 0x00, 0x00, 0x52, 0x51, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x00
*/
-uint8 tsg_packet3[40] =
+BYTE tsg_packet3[40] =
{
0x00, 0x00, 0x00, 0x00, 0x6A, 0x78, 0xE9, 0xAB, 0x02, 0x90, 0x1C, 0x44, 0x8D, 0x99, 0x29, 0x30,
0x53, 0x6C, 0x04, 0x33, 0x01, 0x00, 0x00, 0x00, 0x52, 0x47, 0x00, 0x00, 0x52, 0x47, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00
*/
-uint8 tsg_packet4[48] =
+BYTE tsg_packet4[48] =
{
0x00, 0x00, 0x00, 0x00, 0x6A, 0x78, 0xE9, 0xAB, 0x02, 0x90, 0x1C, 0x44, 0x8D, 0x99, 0x29, 0x30,
0x53, 0x6C, 0x04, 0x33, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x02, 0x00
*/
-uint8 tsg_packet5[20] =
+BYTE tsg_packet5[20] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
return length;
}
-BOOL tsg_connect(rdpTsg* tsg, const char* hostname, uint16 port)
+BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port)
{
- uint8* data;
+ BYTE* data;
uint32 length;
STREAM* s_p4;
int status = -1;
stream_write_uint32(s_p4, 0x00000000); /* Offset */
stream_write_uint32(s_p4, (dest_addr_unic_len / 2) + 1); /* ActualCount */
stream_write(s_p4, dest_addr_unic, dest_addr_unic_len);
- stream_write_uint16(s_p4, 0x0000); /* unicode zero to terminate hostname string */
+ stream_write_UINT16(s_p4, 0x0000); /* unicode zero to terminate hostname string */
free(dest_addr_unic);
return TRUE;
}
-int tsg_read(rdpTsg* tsg, uint8* data, uint32 length)
+int tsg_read(rdpTsg* tsg, BYTE* data, uint32 length)
{
int status;
return status;
}
-int tsg_write(rdpTsg* tsg, uint8* data, uint32 length)
+int tsg_write(rdpTsg* tsg, BYTE* data, uint32 length)
{
return TsProxySendToServer((handle_t) tsg, data, 1, &length);
}
rdpRpc* rpc;
rdpSettings* settings;
rdpTransport* transport;
- uint8 TunnelContext[16];
- uint8 ChannelContext[16];
+ BYTE TunnelContext[16];
+ BYTE ChannelContext[16];
};
typedef wchar_t* RESOURCENAME;
DWORD TsProxySendToServer(handle_t IDL_handle, byte pRpcMessage[], uint32 count, uint32* lengths);
-BOOL tsg_connect(rdpTsg* tsg, const char* hostname, uint16 port);
+BOOL tsg_connect(rdpTsg* tsg, const char* hostname, UINT16 port);
-int tsg_write(rdpTsg* tsg, uint8* data, uint32 length);
-int tsg_read(rdpTsg* tsg, uint8* data, uint32 length);
+int tsg_write(rdpTsg* tsg, BYTE* data, uint32 length);
+int tsg_read(rdpTsg* tsg, BYTE* data, uint32 length);
rdpTsg* tsg_new(rdpTransport* transport);
void tsg_free(rdpTsg* tsg);
BOOL update_recv_orders(rdpUpdate* update, STREAM* s)
{
- uint16 numberOrders;
+ UINT16 numberOrders;
- stream_seek_uint16(s); /* pad2OctetsA (2 bytes) */
- stream_read_uint16(s, numberOrders); /* numberOrders (2 bytes) */
- stream_seek_uint16(s); /* pad2OctetsB (2 bytes) */
+ stream_seek_UINT16(s); /* pad2OctetsA (2 bytes) */
+ stream_read_UINT16(s, numberOrders); /* numberOrders (2 bytes) */
+ stream_seek_UINT16(s); /* pad2OctetsB (2 bytes) */
while (numberOrders > 0)
{
void update_read_bitmap_data(STREAM* s, BITMAP_DATA* bitmap_data)
{
- stream_read_uint16(s, bitmap_data->destLeft);
- stream_read_uint16(s, bitmap_data->destTop);
- stream_read_uint16(s, bitmap_data->destRight);
- stream_read_uint16(s, bitmap_data->destBottom);
- stream_read_uint16(s, bitmap_data->width);
- stream_read_uint16(s, bitmap_data->height);
- stream_read_uint16(s, bitmap_data->bitsPerPixel);
- stream_read_uint16(s, bitmap_data->flags);
- stream_read_uint16(s, bitmap_data->bitmapLength);
+ stream_read_UINT16(s, bitmap_data->destLeft);
+ stream_read_UINT16(s, bitmap_data->destTop);
+ stream_read_UINT16(s, bitmap_data->destRight);
+ stream_read_UINT16(s, bitmap_data->destBottom);
+ stream_read_UINT16(s, bitmap_data->width);
+ stream_read_UINT16(s, bitmap_data->height);
+ stream_read_UINT16(s, bitmap_data->bitsPerPixel);
+ stream_read_UINT16(s, bitmap_data->flags);
+ stream_read_UINT16(s, bitmap_data->bitmapLength);
if (bitmap_data->flags & BITMAP_COMPRESSION)
{
if (!(bitmap_data->flags & NO_BITMAP_COMPRESSION_HDR))
{
- stream_read_uint16(s, bitmap_data->cbCompFirstRowSize); /* cbCompFirstRowSize (2 bytes) */
- stream_read_uint16(s, bitmap_data->cbCompMainBodySize); /* cbCompMainBodySize (2 bytes) */
- stream_read_uint16(s, bitmap_data->cbScanWidth); /* cbScanWidth (2 bytes) */
- stream_read_uint16(s, bitmap_data->cbUncompressedSize); /* cbUncompressedSize (2 bytes) */
+ stream_read_UINT16(s, bitmap_data->cbCompFirstRowSize); /* cbCompFirstRowSize (2 bytes) */
+ stream_read_UINT16(s, bitmap_data->cbCompMainBodySize); /* cbCompMainBodySize (2 bytes) */
+ stream_read_UINT16(s, bitmap_data->cbScanWidth); /* cbScanWidth (2 bytes) */
+ stream_read_UINT16(s, bitmap_data->cbUncompressedSize); /* cbUncompressedSize (2 bytes) */
bitmap_data->bitmapLength = bitmap_data->cbCompMainBodySize;
}
{
int i;
- stream_read_uint16(s, bitmap_update->number); /* numberRectangles (2 bytes) */
+ stream_read_UINT16(s, bitmap_update->number); /* numberRectangles (2 bytes) */
if (bitmap_update->number > bitmap_update->count)
{
- uint16 count;
+ UINT16 count;
count = bitmap_update->number * 2;
int i;
PALETTE_ENTRY* entry;
- stream_seek_uint16(s); /* pad2Octets (2 bytes) */
+ stream_seek_UINT16(s); /* pad2Octets (2 bytes) */
stream_read_uint32(s, palette_update->number); /* numberColors (4 bytes), must be set to 256 */
if (palette_update->number > 256)
{
entry = &palette_update->entries[i];
- stream_read_uint8(s, entry->blue);
- stream_read_uint8(s, entry->green);
- stream_read_uint8(s, entry->red);
+ stream_read_BYTE(s, entry->blue);
+ stream_read_BYTE(s, entry->green);
+ stream_read_BYTE(s, entry->red);
}
}
void update_read_synchronize(rdpUpdate* update, STREAM* s)
{
- stream_seek_uint16(s); /* pad2Octets (2 bytes) */
+ stream_seek_UINT16(s); /* pad2Octets (2 bytes) */
/**
* The Synchronize Update is an artifact from the
void update_read_pointer_position(STREAM* s, POINTER_POSITION_UPDATE* pointer_position)
{
- stream_read_uint16(s, pointer_position->xPos); /* xPos (2 bytes) */
- stream_read_uint16(s, pointer_position->yPos); /* yPos (2 bytes) */
+ stream_read_UINT16(s, pointer_position->xPos); /* xPos (2 bytes) */
+ stream_read_UINT16(s, pointer_position->yPos); /* yPos (2 bytes) */
}
void update_read_pointer_system(STREAM* s, POINTER_SYSTEM_UPDATE* pointer_system)
void update_read_pointer_color(STREAM* s, POINTER_COLOR_UPDATE* pointer_color)
{
- stream_read_uint16(s, pointer_color->cacheIndex); /* cacheIndex (2 bytes) */
- stream_read_uint16(s, pointer_color->xPos); /* xPos (2 bytes) */
- stream_read_uint16(s, pointer_color->yPos); /* yPos (2 bytes) */
- stream_read_uint16(s, pointer_color->width); /* width (2 bytes) */
- stream_read_uint16(s, pointer_color->height); /* height (2 bytes) */
- stream_read_uint16(s, pointer_color->lengthAndMask); /* lengthAndMask (2 bytes) */
- stream_read_uint16(s, pointer_color->lengthXorMask); /* lengthXorMask (2 bytes) */
+ stream_read_UINT16(s, pointer_color->cacheIndex); /* cacheIndex (2 bytes) */
+ stream_read_UINT16(s, pointer_color->xPos); /* xPos (2 bytes) */
+ stream_read_UINT16(s, pointer_color->yPos); /* yPos (2 bytes) */
+ stream_read_UINT16(s, pointer_color->width); /* width (2 bytes) */
+ stream_read_UINT16(s, pointer_color->height); /* height (2 bytes) */
+ stream_read_UINT16(s, pointer_color->lengthAndMask); /* lengthAndMask (2 bytes) */
+ stream_read_UINT16(s, pointer_color->lengthXorMask); /* lengthXorMask (2 bytes) */
/**
* There does not seem to be any documentation on why
if (pointer_color->lengthXorMask > 0)
{
- pointer_color->xorMaskData = (uint8*) malloc(pointer_color->lengthXorMask);
+ pointer_color->xorMaskData = (BYTE*) malloc(pointer_color->lengthXorMask);
stream_read(s, pointer_color->xorMaskData, pointer_color->lengthXorMask);
}
if (pointer_color->lengthAndMask > 0)
{
- pointer_color->andMaskData = (uint8*) malloc(pointer_color->lengthAndMask);
+ pointer_color->andMaskData = (BYTE*) malloc(pointer_color->lengthAndMask);
stream_read(s, pointer_color->andMaskData, pointer_color->lengthAndMask);
}
if (stream_get_left(s) > 0)
- stream_seek_uint8(s); /* pad (1 byte) */
+ stream_seek_BYTE(s); /* pad (1 byte) */
}
void update_read_pointer_new(STREAM* s, POINTER_NEW_UPDATE* pointer_new)
{
- stream_read_uint16(s, pointer_new->xorBpp); /* xorBpp (2 bytes) */
+ stream_read_UINT16(s, pointer_new->xorBpp); /* xorBpp (2 bytes) */
update_read_pointer_color(s, &pointer_new->colorPtrAttr); /* colorPtrAttr */
}
void update_read_pointer_cached(STREAM* s, POINTER_CACHED_UPDATE* pointer_cached)
{
- stream_read_uint16(s, pointer_cached->cacheIndex); /* cacheIndex (2 bytes) */
+ stream_read_UINT16(s, pointer_cached->cacheIndex); /* cacheIndex (2 bytes) */
}
void update_recv_pointer(rdpUpdate* update, STREAM* s)
{
- uint16 messageType;
+ UINT16 messageType;
rdpContext* context = update->context;
rdpPointerUpdate* pointer = update->pointer;
- stream_read_uint16(s, messageType); /* messageType (2 bytes) */
- stream_seek_uint16(s); /* pad2Octets (2 bytes) */
+ stream_read_UINT16(s, messageType); /* messageType (2 bytes) */
+ stream_seek_UINT16(s); /* pad2Octets (2 bytes) */
switch (messageType)
{
BOOL update_recv(rdpUpdate* update, STREAM* s)
{
- uint16 updateType;
+ UINT16 updateType;
rdpContext* context = update->context;
- stream_read_uint16(s, updateType); /* updateType (2 bytes) */
+ stream_read_UINT16(s, updateType); /* updateType (2 bytes) */
//printf("%s Update Data PDU\n", UPDATE_TYPE_STRINGS[updateType]);
}
-static void update_write_refresh_rect(STREAM* s, uint8 count, RECTANGLE_16* areas)
+static void update_write_refresh_rect(STREAM* s, BYTE count, RECTANGLE_16* areas)
{
int i;
- stream_write_uint8(s, count); /* numberOfAreas (1 byte) */
+ stream_write_BYTE(s, count); /* numberOfAreas (1 byte) */
stream_seek(s, 3); /* pad3Octets (3 bytes) */
for (i = 0; i < count; i++)
{
- stream_write_uint16(s, areas[i].left); /* left (2 bytes) */
- stream_write_uint16(s, areas[i].top); /* top (2 bytes) */
- stream_write_uint16(s, areas[i].right); /* right (2 bytes) */
- stream_write_uint16(s, areas[i].bottom); /* bottom (2 bytes) */
+ stream_write_UINT16(s, areas[i].left); /* left (2 bytes) */
+ stream_write_UINT16(s, areas[i].top); /* top (2 bytes) */
+ stream_write_UINT16(s, areas[i].right); /* right (2 bytes) */
+ stream_write_UINT16(s, areas[i].bottom); /* bottom (2 bytes) */
}
}
-static void update_send_refresh_rect(rdpContext* context, uint8 count, RECTANGLE_16* areas)
+static void update_send_refresh_rect(rdpContext* context, BYTE count, RECTANGLE_16* areas)
{
STREAM* s;
rdpRdp* rdp = context->rdp;
}
}
-static void update_write_suppress_output(STREAM* s, uint8 allow, RECTANGLE_16* area)
+static void update_write_suppress_output(STREAM* s, BYTE allow, RECTANGLE_16* area)
{
- stream_write_uint8(s, allow); /* allowDisplayUpdates (1 byte) */
+ stream_write_BYTE(s, allow); /* allowDisplayUpdates (1 byte) */
stream_seek(s, 3); /* pad3Octets (3 bytes) */
if (allow > 0)
{
- stream_write_uint16(s, area->left); /* left (2 bytes) */
- stream_write_uint16(s, area->top); /* top (2 bytes) */
- stream_write_uint16(s, area->right); /* right (2 bytes) */
- stream_write_uint16(s, area->bottom); /* bottom (2 bytes) */
+ stream_write_UINT16(s, area->left); /* left (2 bytes) */
+ stream_write_UINT16(s, area->top); /* top (2 bytes) */
+ stream_write_UINT16(s, area->right); /* right (2 bytes) */
+ stream_write_UINT16(s, area->bottom); /* bottom (2 bytes) */
}
}
-static void update_send_suppress_output(rdpContext* context, uint8 allow, RECTANGLE_16* area)
+static void update_send_suppress_output(rdpContext* context, BYTE allow, RECTANGLE_16* area)
{
STREAM* s;
rdpRdp* rdp = context->rdp;
s = fastpath_update_pdu_init(rdp->fastpath);
- stream_write_uint16(s, 1); /* numberOrders (2 bytes) */
- stream_write_uint8(s, ORDER_STANDARD | ORDER_TYPE_CHANGE); /* controlFlags (1 byte) */
- stream_write_uint8(s, ORDER_TYPE_SCRBLT); /* orderType (1 byte) */
- stream_write_uint8(s, 0x7F); /* fieldFlags (variable) */
+ stream_write_UINT16(s, 1); /* numberOrders (2 bytes) */
+ stream_write_BYTE(s, ORDER_STANDARD | ORDER_TYPE_CHANGE); /* controlFlags (1 byte) */
+ stream_write_BYTE(s, ORDER_TYPE_SCRBLT); /* orderType (1 byte) */
+ stream_write_BYTE(s, 0x7F); /* fieldFlags (variable) */
- stream_write_uint16(s, scrblt->nLeftRect);
- stream_write_uint16(s, scrblt->nTopRect);
- stream_write_uint16(s, scrblt->nWidth);
- stream_write_uint16(s, scrblt->nHeight);
- stream_write_uint8(s, scrblt->bRop);
- stream_write_uint16(s, scrblt->nXSrc);
- stream_write_uint16(s, scrblt->nYSrc);
+ stream_write_UINT16(s, scrblt->nLeftRect);
+ stream_write_UINT16(s, scrblt->nTopRect);
+ stream_write_UINT16(s, scrblt->nWidth);
+ stream_write_UINT16(s, scrblt->nHeight);
+ stream_write_BYTE(s, scrblt->bRop);
+ stream_write_UINT16(s, scrblt->nXSrc);
+ stream_write_UINT16(s, scrblt->nYSrc);
fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_ORDERS, s);
}
static void update_send_pointer_system(rdpContext* context, POINTER_SYSTEM_UPDATE* pointer_system)
{
STREAM* s;
- uint8 updateCode;
+ BYTE updateCode;
rdpRdp* rdp = context->rdp;
s = fastpath_update_pdu_init(rdp->fastpath);
{
stream_check_size(s, 15 + (int) pointer_color->lengthAndMask + (int) pointer_color->lengthXorMask);
- stream_write_uint16(s, pointer_color->cacheIndex);
- stream_write_uint16(s, pointer_color->xPos);
- stream_write_uint16(s, pointer_color->yPos);
- stream_write_uint16(s, pointer_color->width);
- stream_write_uint16(s, pointer_color->height);
- stream_write_uint16(s, pointer_color->lengthAndMask);
- stream_write_uint16(s, pointer_color->lengthXorMask);
+ stream_write_UINT16(s, pointer_color->cacheIndex);
+ stream_write_UINT16(s, pointer_color->xPos);
+ stream_write_UINT16(s, pointer_color->yPos);
+ stream_write_UINT16(s, pointer_color->width);
+ stream_write_UINT16(s, pointer_color->height);
+ stream_write_UINT16(s, pointer_color->lengthAndMask);
+ stream_write_UINT16(s, pointer_color->lengthXorMask);
if (pointer_color->lengthXorMask > 0)
stream_write(s, pointer_color->xorMaskData, pointer_color->lengthXorMask);
if (pointer_color->lengthAndMask > 0)
stream_write(s, pointer_color->andMaskData, pointer_color->lengthAndMask);
- stream_write_uint8(s, 0); /* pad (1 byte) */
+ stream_write_BYTE(s, 0); /* pad (1 byte) */
}
static void update_send_pointer_color(rdpContext* context, POINTER_COLOR_UPDATE* pointer_color)
rdpRdp* rdp = context->rdp;
s = fastpath_update_pdu_init(rdp->fastpath);
- stream_write_uint16(s, pointer_new->xorBpp); /* xorBpp (2 bytes) */
+ stream_write_UINT16(s, pointer_new->xorBpp); /* xorBpp (2 bytes) */
update_write_pointer_color(s, &pointer_new->colorPtrAttr);
fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_POINTER, s);
}
rdpRdp* rdp = context->rdp;
s = fastpath_update_pdu_init(rdp->fastpath);
- stream_write_uint16(s, pointer_cached->cacheIndex); /* cacheIndex (2 bytes) */
+ stream_write_UINT16(s, pointer_cached->cacheIndex); /* cacheIndex (2 bytes) */
fastpath_send_update_pdu(rdp->fastpath, FASTPATH_UPDATETYPE_CACHED, s);
}
BOOL update_read_refresh_rect(rdpUpdate* update, STREAM* s)
{
int index;
- uint8 numberOfAreas;
+ BYTE numberOfAreas;
RECTANGLE_16* areas;
if (stream_get_left(s) < 4)
return FALSE;
- stream_read_uint8(s, numberOfAreas);
+ stream_read_BYTE(s, numberOfAreas);
stream_seek(s, 3); /* pad3Octects */
areas = (RECTANGLE_16*) malloc(sizeof(RECTANGLE_16) * numberOfAreas);
for (index = 0; index < numberOfAreas; index++)
{
- stream_read_uint16(s, areas[index].left);
- stream_read_uint16(s, areas[index].top);
- stream_read_uint16(s, areas[index].right);
- stream_read_uint16(s, areas[index].bottom);
+ stream_read_UINT16(s, areas[index].left);
+ stream_read_UINT16(s, areas[index].top);
+ stream_read_UINT16(s, areas[index].right);
+ stream_read_UINT16(s, areas[index].bottom);
}
IFCALL(update->RefreshRect, update->context, numberOfAreas, areas);
BOOL update_read_suppress_output(rdpUpdate* update, STREAM* s)
{
- uint8 allowDisplayUpdates;
+ BYTE allowDisplayUpdates;
if (stream_get_left(s) < 4)
return FALSE;
- stream_read_uint8(s, allowDisplayUpdates);
+ stream_read_BYTE(s, allowDisplayUpdates);
stream_seek(s, 3); /* pad3Octects */
if (allowDisplayUpdates > 0 && stream_get_left(s) < 8)
void update_read_icon_info(STREAM* s, ICON_INFO* icon_info)
{
- stream_read_uint16(s, icon_info->cacheEntry); /* cacheEntry (2 bytes) */
- stream_read_uint8(s, icon_info->cacheId); /* cacheId (1 byte) */
- stream_read_uint8(s, icon_info->bpp); /* bpp (1 byte) */
- stream_read_uint16(s, icon_info->width); /* width (2 bytes) */
- stream_read_uint16(s, icon_info->height); /* height (2 bytes) */
+ stream_read_UINT16(s, icon_info->cacheEntry); /* cacheEntry (2 bytes) */
+ stream_read_BYTE(s, icon_info->cacheId); /* cacheId (1 byte) */
+ stream_read_BYTE(s, icon_info->bpp); /* bpp (1 byte) */
+ stream_read_UINT16(s, icon_info->width); /* width (2 bytes) */
+ stream_read_UINT16(s, icon_info->height); /* height (2 bytes) */
/* cbColorTable is only present when bpp is 1, 2 or 4 */
if (icon_info->bpp == 1 || icon_info->bpp == 2 || icon_info->bpp == 4)
- stream_read_uint16(s, icon_info->cbColorTable); /* cbColorTable (2 bytes) */
+ stream_read_UINT16(s, icon_info->cbColorTable); /* cbColorTable (2 bytes) */
else
icon_info->cbColorTable = 0;
- stream_read_uint16(s, icon_info->cbBitsMask); /* cbBitsMask (2 bytes) */
- stream_read_uint16(s, icon_info->cbBitsColor); /* cbBitsColor (2 bytes) */
+ stream_read_UINT16(s, icon_info->cbBitsMask); /* cbBitsMask (2 bytes) */
+ stream_read_UINT16(s, icon_info->cbBitsColor); /* cbBitsColor (2 bytes) */
/* bitsMask */
if (icon_info->bitsMask == NULL)
- icon_info->bitsMask = (uint8*) malloc(icon_info->cbBitsMask);
+ icon_info->bitsMask = (BYTE*) malloc(icon_info->cbBitsMask);
else
- icon_info->bitsMask = (uint8*) realloc(icon_info->bitsMask, icon_info->cbBitsMask);
+ icon_info->bitsMask = (BYTE*) realloc(icon_info->bitsMask, icon_info->cbBitsMask);
stream_read(s, icon_info->bitsMask, icon_info->cbBitsMask);
/* colorTable */
if (icon_info->colorTable == NULL)
- icon_info->colorTable = (uint8*) malloc(icon_info->cbColorTable);
+ icon_info->colorTable = (BYTE*) malloc(icon_info->cbColorTable);
else
- icon_info->colorTable = (uint8*) realloc(icon_info->colorTable, icon_info->cbColorTable);
+ icon_info->colorTable = (BYTE*) realloc(icon_info->colorTable, icon_info->cbColorTable);
stream_read(s, icon_info->colorTable, icon_info->cbColorTable);
/* bitsColor */
if (icon_info->bitsColor == NULL)
- icon_info->bitsColor = (uint8*) malloc(icon_info->cbBitsColor);
+ icon_info->bitsColor = (BYTE*) malloc(icon_info->cbBitsColor);
else
- icon_info->bitsColor = (uint8*) realloc(icon_info->bitsColor, icon_info->cbBitsColor);
+ icon_info->bitsColor = (BYTE*) realloc(icon_info->bitsColor, icon_info->cbBitsColor);
stream_read(s, icon_info->bitsColor, icon_info->cbBitsColor);
}
void update_read_cached_icon_info(STREAM* s, CACHED_ICON_INFO* cached_icon_info)
{
- stream_read_uint16(s, cached_icon_info->cacheEntry); /* cacheEntry (2 bytes) */
- stream_read_uint8(s, cached_icon_info->cacheId); /* cacheId (1 byte) */
+ stream_read_UINT16(s, cached_icon_info->cacheEntry); /* cacheEntry (2 bytes) */
+ stream_read_BYTE(s, cached_icon_info->cacheId); /* cacheId (1 byte) */
}
void update_read_notify_icon_infotip(STREAM* s, NOTIFY_ICON_INFOTIP* notify_icon_infotip)
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_SHOW)
- stream_read_uint8(s, window_state->showState); /* showState (1 byte) */
+ stream_read_BYTE(s, window_state->showState); /* showState (1 byte) */
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_TITLE)
rail_read_unicode_string(s, &window_state->titleInfo); /* titleInfo */
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_RP_CONTENT)
- stream_read_uint8(s, window_state->RPContent); /* RPContent (1 byte) */
+ stream_read_BYTE(s, window_state->RPContent); /* RPContent (1 byte) */
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_ROOT_PARENT)
stream_read_uint32(s, window_state->rootParentHandle);/* rootParentHandle (4 bytes) */
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_WND_RECTS)
{
- stream_read_uint16(s, window_state->numWindowRects); /* numWindowRects (2 bytes) */
+ stream_read_UINT16(s, window_state->numWindowRects); /* numWindowRects (2 bytes) */
size = sizeof(RECTANGLE_16) * window_state->numWindowRects;
window_state->windowRects = (RECTANGLE_16*) malloc(size);
/* windowRects */
for (i = 0; i < (int) window_state->numWindowRects; i++)
{
- stream_read_uint16(s, window_state->windowRects[i].left); /* left (2 bytes) */
- stream_read_uint16(s, window_state->windowRects[i].top); /* top (2 bytes) */
- stream_read_uint16(s, window_state->windowRects[i].right); /* right (2 bytes) */
- stream_read_uint16(s, window_state->windowRects[i].bottom); /* bottom (2 bytes) */
+ stream_read_UINT16(s, window_state->windowRects[i].left); /* left (2 bytes) */
+ stream_read_UINT16(s, window_state->windowRects[i].top); /* top (2 bytes) */
+ stream_read_UINT16(s, window_state->windowRects[i].right); /* right (2 bytes) */
+ stream_read_UINT16(s, window_state->windowRects[i].bottom); /* bottom (2 bytes) */
}
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_VISIBILITY)
{
- stream_read_uint16(s, window_state->numVisibilityRects); /* numVisibilityRects (2 bytes) */
+ stream_read_UINT16(s, window_state->numVisibilityRects); /* numVisibilityRects (2 bytes) */
size = sizeof(RECTANGLE_16) * window_state->numVisibilityRects;
window_state->visibilityRects = (RECTANGLE_16*) malloc(size);
/* visibilityRects */
for (i = 0; i < (int) window_state->numVisibilityRects; i++)
{
- stream_read_uint16(s, window_state->visibilityRects[i].left); /* left (2 bytes) */
- stream_read_uint16(s, window_state->visibilityRects[i].top); /* top (2 bytes) */
- stream_read_uint16(s, window_state->visibilityRects[i].right); /* right (2 bytes) */
- stream_read_uint16(s, window_state->visibilityRects[i].bottom); /* bottom (2 bytes) */
+ stream_read_UINT16(s, window_state->visibilityRects[i].left); /* left (2 bytes) */
+ stream_read_UINT16(s, window_state->visibilityRects[i].top); /* top (2 bytes) */
+ stream_read_UINT16(s, window_state->visibilityRects[i].right); /* right (2 bytes) */
+ stream_read_UINT16(s, window_state->visibilityRects[i].bottom); /* bottom (2 bytes) */
}
}
}
if (orderInfo->fieldFlags & WINDOW_ORDER_FIELD_DESKTOP_ZORDER)
{
- stream_read_uint8(s, monitored_desktop->numWindowIds); /* numWindowIds (1 byte) */
+ stream_read_BYTE(s, monitored_desktop->numWindowIds); /* numWindowIds (1 byte) */
size = sizeof(uint32) * monitored_desktop->numWindowIds;
void update_recv_altsec_window_order(rdpUpdate* update, STREAM* s)
{
- uint16 orderSize;
+ UINT16 orderSize;
rdpWindowUpdate* window = update->window;
- stream_read_uint16(s, orderSize); /* orderSize (2 bytes) */
+ stream_read_UINT16(s, orderSize); /* orderSize (2 bytes) */
stream_read_uint32(s, window->orderInfo.fieldFlags); /* FieldsPresentFlags (4 bytes) */
if (window->orderInfo.fieldFlags & WINDOW_ORDER_TYPE_WINDOW)
void ber_read_length(STREAM* s, int* length)
{
- uint8 byte;
+ BYTE byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte & 0x80)
{
byte &= ~(0x80);
if (byte == 1)
- stream_read_uint8(s, *length);
+ stream_read_BYTE(s, *length);
if (byte == 2)
- stream_read_uint16_be(s, *length);
+ stream_read_UINT16_be(s, *length);
}
else
{
{
if (length > 0x7F)
{
- stream_write_uint8(s, 0x82);
- stream_write_uint16_be(s, length);
+ stream_write_BYTE(s, 0x82);
+ stream_write_UINT16_be(s, length);
return 3;
}
else
{
- stream_write_uint8(s, length);
+ stream_write_BYTE(s, length);
return 1;
}
}
* @return
*/
-BOOL ber_read_universal_tag(STREAM* s, uint8 tag, BOOL pc)
+BOOL ber_read_universal_tag(STREAM* s, BYTE tag, BOOL pc)
{
- uint8 byte;
+ BYTE byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte != (BER_CLASS_UNIV | BER_PC(pc) | (BER_TAG_MASK & tag)))
return FALSE;
* @param pc primitive (FALSE) or constructed (TRUE)
*/
-void ber_write_universal_tag(STREAM* s, uint8 tag, BOOL pc)
+void ber_write_universal_tag(STREAM* s, BYTE tag, BOOL pc)
{
- stream_write_uint8(s, (BER_CLASS_UNIV | BER_PC(pc)) | (BER_TAG_MASK & tag));
+ stream_write_BYTE(s, (BER_CLASS_UNIV | BER_PC(pc)) | (BER_TAG_MASK & tag));
}
/**
* @param length length
*/
-BOOL ber_read_application_tag(STREAM* s, uint8 tag, int* length)
+BOOL ber_read_application_tag(STREAM* s, BYTE tag, int* length)
{
- uint8 byte;
+ BYTE byte;
if (tag > 30)
{
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte != ((BER_CLASS_APPL | BER_CONSTRUCT) | BER_TAG_MASK))
return FALSE;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte != tag)
return FALSE;
}
else
{
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte != ((BER_CLASS_APPL | BER_CONSTRUCT) | (BER_TAG_MASK & tag)))
return FALSE;
* @param length length
*/
-void ber_write_application_tag(STREAM* s, uint8 tag, int length)
+void ber_write_application_tag(STREAM* s, BYTE tag, int length)
{
if (tag > 30)
{
- stream_write_uint8(s, (BER_CLASS_APPL | BER_CONSTRUCT) | BER_TAG_MASK);
- stream_write_uint8(s, tag);
+ stream_write_BYTE(s, (BER_CLASS_APPL | BER_CONSTRUCT) | BER_TAG_MASK);
+ stream_write_BYTE(s, tag);
ber_write_length(s, length);
}
else
{
- stream_write_uint8(s, (BER_CLASS_APPL | BER_CONSTRUCT) | (BER_TAG_MASK & tag));
+ stream_write_BYTE(s, (BER_CLASS_APPL | BER_CONSTRUCT) | (BER_TAG_MASK & tag));
ber_write_length(s, length);
}
}
-BOOL ber_read_contextual_tag(STREAM* s, uint8 tag, int* length, BOOL pc)
+BOOL ber_read_contextual_tag(STREAM* s, BYTE tag, int* length, BOOL pc)
{
- uint8 byte;
+ BYTE byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte != ((BER_CLASS_CTXT | BER_PC(pc)) | (BER_TAG_MASK & tag)))
{
return TRUE;
}
-int ber_write_contextual_tag(STREAM* s, uint8 tag, int length, BOOL pc)
+int ber_write_contextual_tag(STREAM* s, BYTE tag, int length, BOOL pc)
{
- stream_write_uint8(s, (BER_CLASS_CTXT | BER_PC(pc)) | (BER_TAG_MASK & tag));
+ stream_write_BYTE(s, (BER_CLASS_CTXT | BER_PC(pc)) | (BER_TAG_MASK & tag));
return ber_write_length(s, length) + 1;
}
BOOL ber_read_sequence_tag(STREAM* s, int* length)
{
- uint8 byte;
+ BYTE byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte != ((BER_CLASS_UNIV | BER_CONSTRUCT) | (BER_TAG_SEQUENCE_OF)))
return FALSE;
int ber_write_sequence_tag(STREAM* s, int length)
{
- stream_write_uint8(s, (BER_CLASS_UNIV | BER_CONSTRUCT) | (BER_TAG_MASK & BER_TAG_SEQUENCE));
+ stream_write_BYTE(s, (BER_CLASS_UNIV | BER_CONSTRUCT) | (BER_TAG_MASK & BER_TAG_SEQUENCE));
return ber_write_length(s, length) + 1;
}
return 1 + _ber_skip_length(length);
}
-BOOL ber_read_enumerated(STREAM* s, uint8* enumerated, uint8 count)
+BOOL ber_read_enumerated(STREAM* s, BYTE* enumerated, BYTE count)
{
int length;
ber_read_length(s, &length);
if (length == 1)
- stream_read_uint8(s, *enumerated);
+ stream_read_BYTE(s, *enumerated);
else
return FALSE;
return TRUE;
}
-void ber_write_enumerated(STREAM* s, uint8 enumerated, uint8 count)
+void ber_write_enumerated(STREAM* s, BYTE enumerated, BYTE count)
{
ber_write_universal_tag(s, BER_TAG_ENUMERATED, FALSE);
ber_write_length(s, 1);
- stream_write_uint8(s, enumerated);
+ stream_write_BYTE(s, enumerated);
}
-BOOL ber_read_bit_string(STREAM* s, int* length, uint8* padding)
+BOOL ber_read_bit_string(STREAM* s, int* length, BYTE* padding)
{
ber_read_universal_tag(s, BER_TAG_BIT_STRING, FALSE);
ber_read_length(s, length);
- stream_read_uint8(s, *padding);
+ stream_read_BYTE(s, *padding);
return TRUE;
}
* @param length string length
*/
-void ber_write_octet_string(STREAM* s, const uint8* oct_str, int length)
+void ber_write_octet_string(STREAM* s, const BYTE* oct_str, int length)
{
ber_write_universal_tag(s, BER_TAG_OCTET_STRING, FALSE);
ber_write_length(s, length);
BOOL ber_read_BOOL(STREAM* s, BOOL* value)
{
int length;
- uint8 v;
+ BYTE v;
if (!ber_read_universal_tag(s, BER_TAG_BOOLEAN, FALSE))
return FALSE;
ber_read_length(s, &length);
if (length != 1)
return FALSE;
- stream_read_uint8(s, v);
+ stream_read_BYTE(s, v);
*value = (v ? TRUE : FALSE);
return TRUE;
}
{
ber_write_universal_tag(s, BER_TAG_BOOLEAN, FALSE);
ber_write_length(s, 1);
- stream_write_uint8(s, (value == TRUE) ? 0xFF : 0);
+ stream_write_BYTE(s, (value == TRUE) ? 0xFF : 0);
}
BOOL ber_read_integer(STREAM* s, uint32* value)
}
if (length == 1)
- stream_read_uint8(s, *value);
+ stream_read_BYTE(s, *value);
else if (length == 2)
- stream_read_uint16_be(s, *value);
+ stream_read_UINT16_be(s, *value);
else if (length == 3)
{
- uint8 byte;
- stream_read_uint8(s, byte);
- stream_read_uint16_be(s, *value);
+ BYTE byte;
+ stream_read_BYTE(s, byte);
+ stream_read_UINT16_be(s, *value);
*value += (byte << 16);
}
else if (length == 4)
if (value <= 0xFF)
{
ber_write_length(s, 1);
- stream_write_uint8(s, value);
+ stream_write_BYTE(s, value);
return 2;
}
else if (value < 0xFF80)
{
ber_write_length(s, 2);
- stream_write_uint16_be(s, value);
+ stream_write_UINT16_be(s, value);
return 3;
}
else if (value < 0xFF8000)
{
ber_write_length(s, 3);
- stream_write_uint8(s, (value >> 16));
- stream_write_uint16_be(s, (value & 0xFFFF));
+ stream_write_BYTE(s, (value >> 16));
+ stream_write_UINT16_be(s, (value & 0xFFFF));
return 4;
}
else if (value <= 0xFFFFFFFF)
return sha1;
}
-void crypto_sha1_update(CryptoSha1 sha1, const uint8* data, uint32 length)
+void crypto_sha1_update(CryptoSha1 sha1, const BYTE* data, uint32 length)
{
SHA1_Update(&sha1->sha_ctx, data, length);
}
-void crypto_sha1_final(CryptoSha1 sha1, uint8* out_data)
+void crypto_sha1_final(CryptoSha1 sha1, BYTE* out_data)
{
SHA1_Final(out_data, &sha1->sha_ctx);
free(sha1);
return md5;
}
-void crypto_md5_update(CryptoMd5 md5, const uint8* data, uint32 length)
+void crypto_md5_update(CryptoMd5 md5, const BYTE* data, uint32 length)
{
MD5_Update(&md5->md5_ctx, data, length);
}
-void crypto_md5_final(CryptoMd5 md5, uint8* out_data)
+void crypto_md5_final(CryptoMd5 md5, BYTE* out_data)
{
MD5_Final(out_data, &md5->md5_ctx);
free(md5);
}
-CryptoRc4 crypto_rc4_init(const uint8* key, uint32 length)
+CryptoRc4 crypto_rc4_init(const BYTE* key, uint32 length)
{
CryptoRc4 rc4 = malloc(sizeof(*rc4));
RC4_set_key(&rc4->rc4_key, length, key);
return rc4;
}
-void crypto_rc4(CryptoRc4 rc4, uint32 length, const uint8* in_data, uint8* out_data)
+void crypto_rc4(CryptoRc4 rc4, uint32 length, const BYTE* in_data, BYTE* out_data)
{
RC4(&rc4->rc4_key, length, in_data, out_data);
}
free(rc4);
}
-CryptoDes3 crypto_des3_encrypt_init(const uint8* key, const uint8* ivec)
+CryptoDes3 crypto_des3_encrypt_init(const BYTE* key, const BYTE* ivec)
{
CryptoDes3 des3 = malloc(sizeof(*des3));
EVP_CIPHER_CTX_init(&des3->des3_ctx);
return des3;
}
-CryptoDes3 crypto_des3_decrypt_init(const uint8* key, const uint8* ivec)
+CryptoDes3 crypto_des3_decrypt_init(const BYTE* key, const BYTE* ivec)
{
CryptoDes3 des3 = malloc(sizeof(*des3));
EVP_CIPHER_CTX_init(&des3->des3_ctx);
return des3;
}
-void crypto_des3_encrypt(CryptoDes3 des3, uint32 length, const uint8* in_data, uint8* out_data)
+void crypto_des3_encrypt(CryptoDes3 des3, uint32 length, const BYTE* in_data, BYTE* out_data)
{
int len;
EVP_EncryptUpdate(&des3->des3_ctx, out_data, &len, in_data, length);
}
-void crypto_des3_decrypt(CryptoDes3 des3, uint32 length, const uint8* in_data, uint8* out_data)
+void crypto_des3_decrypt(CryptoDes3 des3, uint32 length, const BYTE* in_data, BYTE* out_data)
{
int len;
EVP_DecryptUpdate(&des3->des3_ctx, out_data, &len, in_data, length);
return hmac;
}
-void crypto_hmac_sha1_init(CryptoHmac hmac, const uint8* data, uint32 length)
+void crypto_hmac_sha1_init(CryptoHmac hmac, const BYTE* data, uint32 length)
{
HMAC_Init_ex(&hmac->hmac_ctx, data, length, EVP_sha1(), NULL);
}
-void crypto_hmac_update(CryptoHmac hmac, const uint8* data, uint32 length)
+void crypto_hmac_update(CryptoHmac hmac, const BYTE* data, uint32 length)
{
HMAC_Update(&hmac->hmac_ctx, data, length);
}
-void crypto_hmac_final(CryptoHmac hmac, uint8* out_data, uint32 length)
+void crypto_hmac_final(CryptoHmac hmac, BYTE* out_data, uint32 length)
{
HMAC_Final(&hmac->hmac_ctx, out_data, &length);
}
free(hmac);
}
-CryptoCert crypto_cert_read(uint8* data, uint32 length)
+CryptoCert crypto_cert_read(BYTE* data, uint32 length)
{
CryptoCert cert = malloc(sizeof(*cert));
/* this will move the data pointer but we don't care, we don't use it again */
- cert->px509 = d2i_X509(NULL, (D2I_X509_CONST uint8 **) &data, length);
+ cert->px509 = d2i_X509(NULL, (D2I_X509_CONST BYTE **) &data, length);
return cert;
}
return status;
}
-static void crypto_rsa_common(const uint8* input, int length, uint32 key_length, const uint8* modulus, const uint8* exponent, int exponent_size, uint8* output)
+static void crypto_rsa_common(const BYTE* input, int length, uint32 key_length, const BYTE* modulus, const BYTE* exponent, int exponent_size, BYTE* output)
{
BN_CTX* ctx;
int output_length;
- uint8* input_reverse;
- uint8* modulus_reverse;
- uint8* exponent_reverse;
+ BYTE* input_reverse;
+ BYTE* modulus_reverse;
+ BYTE* exponent_reverse;
BIGNUM mod, exp, x, y;
- input_reverse = (uint8*) malloc(2 * key_length + exponent_size);
+ input_reverse = (BYTE*) malloc(2 * key_length + exponent_size);
modulus_reverse = input_reverse + key_length;
exponent_reverse = modulus_reverse + key_length;
free(input_reverse);
}
-static void crypto_rsa_public(const uint8* input, int length, uint32 key_length, const uint8* modulus, const uint8* exponent, uint8* output)
+static void crypto_rsa_public(const BYTE* input, int length, uint32 key_length, const BYTE* modulus, const BYTE* exponent, BYTE* output)
{
crypto_rsa_common(input, length, key_length, modulus, exponent, EXPONENT_MAX_SIZE, output);
}
-static void crypto_rsa_private(const uint8* input, int length, uint32 key_length, const uint8* modulus, const uint8* private_exponent, uint8* output)
+static void crypto_rsa_private(const BYTE* input, int length, uint32 key_length, const BYTE* modulus, const BYTE* private_exponent, BYTE* output)
{
crypto_rsa_common(input, length, key_length, modulus, private_exponent, key_length, output);
}
-void crypto_rsa_public_encrypt(const uint8* input, int length, uint32 key_length, const uint8* modulus, const uint8* exponent, uint8* output)
+void crypto_rsa_public_encrypt(const BYTE* input, int length, uint32 key_length, const BYTE* modulus, const BYTE* exponent, BYTE* output)
{
crypto_rsa_public(input, length, key_length, modulus, exponent, output);
}
-void crypto_rsa_public_decrypt(const uint8* input, int length, uint32 key_length, const uint8* modulus, const uint8* exponent, uint8* output)
+void crypto_rsa_public_decrypt(const BYTE* input, int length, uint32 key_length, const BYTE* modulus, const BYTE* exponent, BYTE* output)
{
crypto_rsa_public(input, length, key_length, modulus, exponent, output);
}
-void crypto_rsa_private_encrypt(const uint8* input, int length, uint32 key_length, const uint8* modulus, const uint8* private_exponent, uint8* output)
+void crypto_rsa_private_encrypt(const BYTE* input, int length, uint32 key_length, const BYTE* modulus, const BYTE* private_exponent, BYTE* output)
{
crypto_rsa_private(input, length, key_length, modulus, private_exponent, output);
}
-void crypto_rsa_private_decrypt(const uint8* input, int length, uint32 key_length, const uint8* modulus, const uint8* private_exponent, uint8* output)
+void crypto_rsa_private_decrypt(const BYTE* input, int length, uint32 key_length, const BYTE* modulus, const BYTE* private_exponent, BYTE* output)
{
crypto_rsa_private(input, length, key_length, modulus, private_exponent, output);
}
-void crypto_rsa_decrypt(const uint8* input, int length, uint32 key_length, const uint8* modulus, const uint8* private_exponent, uint8* output)
+void crypto_rsa_decrypt(const BYTE* input, int length, uint32 key_length, const BYTE* modulus, const BYTE* private_exponent, BYTE* output)
{
crypto_rsa_common(input, length, key_length, modulus, private_exponent, key_length, output);
}
-void crypto_reverse(uint8* data, int length)
+void crypto_reverse(BYTE* data, int length)
{
int i, j;
- uint8 temp;
+ BYTE temp;
for (i = 0, j = length - 1; i < j; i++, j--)
{
}
}
-void crypto_nonce(uint8* nonce, int size)
+void crypto_nonce(BYTE* nonce, int size)
{
RAND_bytes((void*) nonce, size);
}
char* p;
char* fp_buffer;
uint32 fp_len;
- uint8 fp[EVP_MAX_MD_SIZE];
+ BYTE fp[EVP_MAX_MD_SIZE];
X509_digest(xcert, EVP_sha1(), fp, &fp_len);
char* crypto_cert_subject_common_name(X509* xcert, int* length)
{
int index;
- uint8* common_name;
+ BYTE* common_name;
X509_NAME* subject_name;
X509_NAME_ENTRY* entry;
ASN1_STRING* entry_data;
int index;
int length;
char** strings;
- uint8* string;
+ BYTE* string;
int num_subject_alt_names;
GENERAL_NAMES* subject_alt_names;
GENERAL_NAME* subject_alt_name;
free(fp);
}
-char* crypto_base64_encode(uint8* data, int length)
+char* crypto_base64_encode(BYTE* data, int length)
{
BIO* bmem;
BIO* b64;
return base64_string;
}
-void crypto_base64_decode(uint8* enc_data, int length, uint8** dec_data, int* res_length)
+void crypto_base64_decode(BYTE* enc_data, int length, BYTE** dec_data, int* res_length)
{
BIO *b64, *bmem;
{
if (length > 0x7F && length <= 0xFF)
{
- stream_write_uint8(s, 0x81);
- stream_write_uint8(s, length);
+ stream_write_BYTE(s, 0x81);
+ stream_write_BYTE(s, length);
return 2;
}
else if (length > 0xFF)
{
- stream_write_uint8(s, 0x82);
- stream_write_uint16_be(s, length);
+ stream_write_BYTE(s, 0x82);
+ stream_write_UINT16_be(s, length);
return 3;
}
else
{
- stream_write_uint8(s, length);
+ stream_write_BYTE(s, length);
return 1;
}
}
return _der_skip_length(length) + 1;
}
-int der_write_contextual_tag(STREAM* s, uint8 tag, int length, BOOL pc)
+int der_write_contextual_tag(STREAM* s, BYTE tag, int length, BOOL pc)
{
- stream_write_uint8(s, (ER_CLASS_CTXT | ER_PC(pc)) | (ER_TAG_MASK & tag));
+ stream_write_BYTE(s, (ER_CLASS_CTXT | ER_PC(pc)) | (ER_TAG_MASK & tag));
return der_write_length(s, length) + 1;
}
-void der_write_universal_tag(STREAM* s, uint8 tag, BOOL pc)
+void der_write_universal_tag(STREAM* s, BYTE tag, BOOL pc)
{
- stream_write_uint8(s, (ER_CLASS_UNIV | ER_PC(pc)) | (ER_TAG_MASK & tag));
+ stream_write_BYTE(s, (ER_CLASS_UNIV | ER_PC(pc)) | (ER_TAG_MASK & tag));
}
int der_skip_octet_string(int length)
return 1 + _der_skip_length(length) + length;
}
-void der_write_octet_string(STREAM* s, uint8* oct_str, int length)
+void der_write_octet_string(STREAM* s, BYTE* oct_str, int length)
{
der_write_universal_tag(s, ER_TAG_OCTET_STRING, FALSE);
der_write_length(s, length);
int der_write_sequence_tag(STREAM* s, int length)
{
- stream_write_uint8(s, (ER_CLASS_UNIV | ER_CONSTRUCT) | (ER_TAG_MASK & ER_TAG_SEQUENCE));
+ stream_write_BYTE(s, (ER_CLASS_UNIV | ER_CONSTRUCT) | (ER_TAG_MASK & ER_TAG_SEQUENCE));
return der_write_length(s, length) + 1;
}
void er_read_length(STREAM* s, int* length)
{
- uint8 byte;
+ BYTE byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte & 0x80)
{
byte &= ~(0x80);
if (byte == 1)
- stream_read_uint8(s, *length);
+ stream_read_BYTE(s, *length);
if (byte == 2)
- stream_read_uint16_be(s, *length);
+ stream_read_UINT16_be(s, *length);
}
else
{
* @return
*/
-BOOL er_read_universal_tag(STREAM* s, uint8 tag, BOOL pc)
+BOOL er_read_universal_tag(STREAM* s, BYTE tag, BOOL pc)
{
- uint8 byte;
+ BYTE byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte != (ER_CLASS_UNIV | ER_PC(pc) | (ER_TAG_MASK & tag)))
return FALSE;
* @param pc primitive (FALSE) or constructed (TRUE)
*/
-void er_write_universal_tag(STREAM* s, uint8 tag, BOOL pc)
+void er_write_universal_tag(STREAM* s, BYTE tag, BOOL pc)
{
- stream_write_uint8(s, (ER_CLASS_UNIV | ER_PC(pc)) | (ER_TAG_MASK & tag));
+ stream_write_BYTE(s, (ER_CLASS_UNIV | ER_PC(pc)) | (ER_TAG_MASK & tag));
}
/**
* @param length length
*/
-BOOL er_read_application_tag(STREAM* s, uint8 tag, int* length)
+BOOL er_read_application_tag(STREAM* s, BYTE tag, int* length)
{
- uint8 byte;
+ BYTE byte;
if (tag > 30)
{
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte != ((ER_CLASS_APPL | ER_CONSTRUCT) | ER_TAG_MASK))
return FALSE;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte != tag)
return FALSE;
}
else
{
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte != ((ER_CLASS_APPL | ER_CONSTRUCT) | (ER_TAG_MASK & tag)))
return FALSE;
* @param length length
*/
-void er_write_application_tag(STREAM* s, uint8 tag, int length, BOOL flag)
+void er_write_application_tag(STREAM* s, BYTE tag, int length, BOOL flag)
{
if (tag > 30)
{
- stream_write_uint8(s, (ER_CLASS_APPL | ER_CONSTRUCT) | ER_TAG_MASK);
- stream_write_uint8(s, tag);
+ stream_write_BYTE(s, (ER_CLASS_APPL | ER_CONSTRUCT) | ER_TAG_MASK);
+ stream_write_BYTE(s, tag);
er_write_length(s, length, flag);
}
else
{
- stream_write_uint8(s, (ER_CLASS_APPL | ER_CONSTRUCT) | (ER_TAG_MASK & tag));
+ stream_write_BYTE(s, (ER_CLASS_APPL | ER_CONSTRUCT) | (ER_TAG_MASK & tag));
er_write_length(s, length, flag);
}
}
-BOOL er_read_contextual_tag(STREAM* s, uint8 tag, int* length, BOOL pc)
+BOOL er_read_contextual_tag(STREAM* s, BYTE tag, int* length, BOOL pc)
{
- uint8 byte;
+ BYTE byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte != ((ER_CLASS_CTXT | ER_PC(pc)) | (ER_TAG_MASK & tag)))
{
return TRUE;
}
-int er_write_contextual_tag(STREAM* s, uint8 tag, int length, BOOL pc, BOOL flag)
+int er_write_contextual_tag(STREAM* s, BYTE tag, int length, BOOL pc, BOOL flag)
{
- stream_write_uint8(s, (ER_CLASS_CTXT | ER_PC(pc)) | (ER_TAG_MASK & tag));
+ stream_write_BYTE(s, (ER_CLASS_CTXT | ER_PC(pc)) | (ER_TAG_MASK & tag));
return er_write_length(s, length, flag) + 1;
}
BOOL er_read_sequence_tag(STREAM* s, int* length)
{
- uint8 byte;
+ BYTE byte;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte != ((ER_CLASS_UNIV | ER_CONSTRUCT) | (ER_TAG_SEQUENCE_OF)))
return FALSE;
int er_write_sequence_tag(STREAM* s, int length, BOOL flag)
{
- stream_write_uint8(s, (ER_CLASS_UNIV | ER_CONSTRUCT) | (ER_TAG_MASK & ER_TAG_SEQUENCE));
+ stream_write_BYTE(s, (ER_CLASS_UNIV | ER_CONSTRUCT) | (ER_TAG_MASK & ER_TAG_SEQUENCE));
return er_write_length(s, length, flag) + 1;
}
return 1 + _er_skip_length(length);
}
-BOOL er_read_enumerated(STREAM* s, uint8* enumerated, uint8 count)
+BOOL er_read_enumerated(STREAM* s, BYTE* enumerated, BYTE count)
{
int length;
er_read_length(s, &length);
if (length == 1)
- stream_read_uint8(s, *enumerated);
+ stream_read_BYTE(s, *enumerated);
else
return FALSE;
return TRUE;
}
-void er_write_enumerated(STREAM* s, uint8 enumerated, uint8 count, BOOL flag)
+void er_write_enumerated(STREAM* s, BYTE enumerated, BYTE count, BOOL flag)
{
er_write_universal_tag(s, ER_TAG_ENUMERATED, FALSE);
er_write_length(s, 1, flag);
- stream_write_uint8(s, enumerated);
+ stream_write_BYTE(s, enumerated);
}
-BOOL er_read_bit_string(STREAM* s, int* length, uint8* padding)
+BOOL er_read_bit_string(STREAM* s, int* length, BYTE* padding)
{
er_read_universal_tag(s, ER_TAG_BIT_STRING, FALSE);
er_read_length(s, length);
- stream_read_uint8(s, *padding);
+ stream_read_BYTE(s, *padding);
return TRUE;
}
-BOOL er_write_bit_string_tag(STREAM* s, uint32 length, uint8 padding, BOOL flag)
+BOOL er_write_bit_string_tag(STREAM* s, uint32 length, BYTE padding, BOOL flag)
{
er_write_universal_tag(s, ER_TAG_BIT_STRING, FALSE);
er_write_length(s, length, flag);
- stream_write_uint8(s, padding);
+ stream_write_BYTE(s, padding);
return TRUE;
}
* @param length string length
*/
-void er_write_octet_string(STREAM* s, uint8* oct_str, int length, BOOL flag)
+void er_write_octet_string(STREAM* s, BYTE* oct_str, int length, BOOL flag)
{
er_write_universal_tag(s, ER_TAG_OCTET_STRING, FALSE);
er_write_length(s, length, flag);
BOOL er_read_BOOL(STREAM* s, BOOL* value)
{
int length;
- uint8 v;
+ BYTE v;
if (!er_read_universal_tag(s, ER_TAG_BOOLEAN, FALSE))
return FALSE;
er_read_length(s, &length);
if (length != 1)
return FALSE;
- stream_read_uint8(s, v);
+ stream_read_BYTE(s, v);
*value = (v ? TRUE : FALSE);
return TRUE;
}
{
er_write_universal_tag(s, ER_TAG_BOOLEAN, FALSE);
er_write_length(s, 1, FALSE);
- stream_write_uint8(s, (value == TRUE) ? 0xFF : 0);
+ stream_write_BYTE(s, (value == TRUE) ? 0xFF : 0);
}
BOOL er_read_integer(STREAM* s, uint32* value)
}
if (length == 1)
- stream_read_uint8(s, *value);
+ stream_read_BYTE(s, *value);
else if (length == 2)
- stream_read_uint16_be(s, *value);
+ stream_read_UINT16_be(s, *value);
else if (length == 3)
{
- uint8 byte;
- stream_read_uint8(s, byte);
- stream_read_uint16_be(s, *value);
+ BYTE byte;
+ stream_read_BYTE(s, byte);
+ stream_read_UINT16_be(s, *value);
*value += (byte << 16);
}
else if (length == 4)
if (value <= 127 && value >= -128)
{
er_write_length(s, 1, FALSE);
- stream_write_uint8(s, value);
+ stream_write_BYTE(s, value);
return 2;
}
else if (value <= 32767 && value >= -32768)
{
er_write_length(s, 2, FALSE);
- stream_write_uint16_be(s, value);
+ stream_write_UINT16_be(s, value);
return 3;
}
else
length -= der_write_sequence_tag(s, length); /* SEQUENCE OF NegoDataItem */
length -= der_write_sequence_tag(s, length); /* NegoDataItem */
length -= der_write_contextual_tag(s, 0, length, TRUE); /* [0] negoToken */
- der_write_octet_string(s, (uint8*) credssp->negoToken.pvBuffer, length); /* OCTET STRING */
+ der_write_octet_string(s, (BYTE*) credssp->negoToken.pvBuffer, length); /* OCTET STRING */
}
/* [2] authInfo (OCTET STRING) */
* @return
*/
-BOOL per_read_length(STREAM* s, uint16* length)
+BOOL per_read_length(STREAM* s, UINT16* length)
{
- uint8 byte;
+ BYTE byte;
if (stream_get_left(s) < 1)
return FALSE;
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
if (byte & 0x80)
{
byte &= ~(0x80);
*length = (byte << 8);
- stream_read_uint8(s, byte);
+ stream_read_BYTE(s, byte);
*length += byte;
}
else
void per_write_length(STREAM* s, int length)
{
if (length > 0x7F)
- stream_write_uint16_be(s, (length | 0x8000));
+ stream_write_UINT16_be(s, (length | 0x8000));
else
- stream_write_uint8(s, length);
+ stream_write_BYTE(s, length);
}
/**
* @return
*/
-BOOL per_read_choice(STREAM* s, uint8* choice)
+BOOL per_read_choice(STREAM* s, BYTE* choice)
{
if (stream_get_left(s) < 1)
return FALSE;
- stream_read_uint8(s, *choice);
+ stream_read_BYTE(s, *choice);
return TRUE;
}
* @param choice index of chosen field
*/
-void per_write_choice(STREAM* s, uint8 choice)
+void per_write_choice(STREAM* s, BYTE choice)
{
- stream_write_uint8(s, choice);
+ stream_write_BYTE(s, choice);
}
/**
* @return
*/
-BOOL per_read_selection(STREAM* s, uint8* selection)
+BOOL per_read_selection(STREAM* s, BYTE* selection)
{
if (stream_get_left(s) < 1)
return FALSE;
- stream_read_uint8(s, *selection);
+ stream_read_BYTE(s, *selection);
return TRUE;
}
* @param selection bit map of selected fields
*/
-void per_write_selection(STREAM* s, uint8 selection)
+void per_write_selection(STREAM* s, BYTE selection)
{
- stream_write_uint8(s, selection);
+ stream_write_BYTE(s, selection);
}
/**
* @return
*/
-BOOL per_read_number_of_sets(STREAM* s, uint8* number)
+BOOL per_read_number_of_sets(STREAM* s, BYTE* number)
{
if (stream_get_left(s) < 1)
return FALSE;
- stream_read_uint8(s, *number);
+ stream_read_BYTE(s, *number);
return TRUE;
}
* @param number number of sets
*/
-void per_write_number_of_sets(STREAM* s, uint8 number)
+void per_write_number_of_sets(STREAM* s, BYTE number)
{
- stream_write_uint8(s, number);
+ stream_write_BYTE(s, number);
}
/**
int i;
for (i = 0; i < length; i++)
- stream_write_uint8(s, 0);
+ stream_write_BYTE(s, 0);
}
/**
BOOL per_read_integer(STREAM* s, uint32* integer)
{
- uint16 length;
+ UINT16 length;
if (!per_read_length(s, &length))
return FALSE;
return FALSE;
if (length == 1)
- stream_read_uint8(s, *integer);
+ stream_read_BYTE(s, *integer);
else if (length == 2)
- stream_read_uint16_be(s, *integer);
+ stream_read_UINT16_be(s, *integer);
else
return FALSE;
if (integer <= 0xFF)
{
per_write_length(s, 1);
- stream_write_uint8(s, integer);
+ stream_write_BYTE(s, integer);
}
else if (integer <= 0xFFFF)
{
per_write_length(s, 2);
- stream_write_uint16_be(s, integer);
+ stream_write_UINT16_be(s, integer);
}
else if (integer <= 0xFFFFFFFF)
{
}
/**
- * Read PER INTEGER (uint16).
+ * Read PER INTEGER (UINT16).
* @param s stream
* @param integer integer
* @param min minimum value
* @return
*/
-BOOL per_read_integer16(STREAM* s, uint16* integer, uint16 min)
+BOOL per_read_integer16(STREAM* s, UINT16* integer, UINT16 min)
{
if (stream_get_left(s) < 2)
return FALSE;
- stream_read_uint16_be(s, *integer);
+ stream_read_UINT16_be(s, *integer);
if (*integer + min > 0xFFFF)
return FALSE;
}
/**
- * Write PER INTEGER (uint16).
+ * Write PER INTEGER (UINT16).
* @param s stream
* @param integer integer
* @param min minimum value
*/
-void per_write_integer16(STREAM* s, uint16 integer, uint16 min)
+void per_write_integer16(STREAM* s, UINT16 integer, UINT16 min)
{
- stream_write_uint16_be(s, integer - min);
+ stream_write_UINT16_be(s, integer - min);
}
/**
* @return
*/
-BOOL per_read_enumerated(STREAM* s, uint8* enumerated, uint8 count)
+BOOL per_read_enumerated(STREAM* s, BYTE* enumerated, BYTE count)
{
if (stream_get_left(s) < 1)
return FALSE;
- stream_read_uint8(s, *enumerated);
+ stream_read_BYTE(s, *enumerated);
/* check that enumerated value falls within expected range */
if (*enumerated + 1 > count)
* @return
*/
-void per_write_enumerated(STREAM* s, uint8 enumerated, uint8 count)
+void per_write_enumerated(STREAM* s, BYTE enumerated, BYTE count)
{
- stream_write_uint8(s, enumerated);
+ stream_write_BYTE(s, enumerated);
}
/**
* @return
*/
-BOOL per_read_object_identifier(STREAM* s, uint8 oid[6])
+BOOL per_read_object_identifier(STREAM* s, BYTE oid[6])
{
- uint8 t12;
- uint16 length;
- uint8 a_oid[6];
+ BYTE t12;
+ UINT16 length;
+ BYTE a_oid[6];
if (!per_read_length(s, &length))
return FALSE;
if (stream_get_left(s) < length)
return FALSE;
- stream_read_uint8(s, t12); /* first two tuples */
+ stream_read_BYTE(s, t12); /* first two tuples */
a_oid[0] = (t12 >> 4);
a_oid[1] = (t12 & 0x0F);
- stream_read_uint8(s, a_oid[2]); /* tuple 3 */
- stream_read_uint8(s, a_oid[3]); /* tuple 4 */
- stream_read_uint8(s, a_oid[4]); /* tuple 5 */
- stream_read_uint8(s, a_oid[5]); /* tuple 6 */
+ stream_read_BYTE(s, a_oid[2]); /* tuple 3 */
+ stream_read_BYTE(s, a_oid[3]); /* tuple 4 */
+ stream_read_BYTE(s, a_oid[4]); /* tuple 5 */
+ stream_read_BYTE(s, a_oid[5]); /* tuple 6 */
if ((a_oid[0] == oid[0]) && (a_oid[1] == oid[1]) &&
(a_oid[2] == oid[2]) && (a_oid[3] == oid[3]) &&
* @param oid object identifier (oid)
*/
-void per_write_object_identifier(STREAM* s, uint8 oid[6])
+void per_write_object_identifier(STREAM* s, BYTE oid[6])
{
- uint8 t12 = (oid[0] << 4) & (oid[1] & 0x0F);
- stream_write_uint8(s, 5); /* length */
- stream_write_uint8(s, t12); /* first two tuples */
- stream_write_uint8(s, oid[2]); /* tuple 3 */
- stream_write_uint8(s, oid[3]); /* tuple 4 */
- stream_write_uint8(s, oid[4]); /* tuple 5 */
- stream_write_uint8(s, oid[5]); /* tuple 6 */
+ BYTE t12 = (oid[0] << 4) & (oid[1] & 0x0F);
+ stream_write_BYTE(s, 5); /* length */
+ stream_write_BYTE(s, t12); /* first two tuples */
+ stream_write_BYTE(s, oid[2]); /* tuple 3 */
+ stream_write_BYTE(s, oid[3]); /* tuple 4 */
+ stream_write_BYTE(s, oid[4]); /* tuple 5 */
+ stream_write_BYTE(s, oid[5]); /* tuple 6 */
}
/**
* @param length string length
*/
-void per_write_string(STREAM* s, uint8* str, int length)
+void per_write_string(STREAM* s, BYTE* str, int length)
{
int i;
for (i = 0; i < length; i++)
- stream_write_uint8(s, str[i]);
+ stream_write_BYTE(s, str[i]);
}
/**
* @return
*/
-BOOL per_read_octet_string(STREAM* s, uint8* oct_str, int length, int min)
+BOOL per_read_octet_string(STREAM* s, BYTE* oct_str, int length, int min)
{
int i;
- uint16 mlength;
- uint8* a_oct_str;
+ UINT16 mlength;
+ BYTE* a_oct_str;
if (!per_read_length(s, &mlength))
return FALSE;
* @param min minimum string length
*/
-void per_write_octet_string(STREAM* s, uint8* oct_str, int length, int min)
+void per_write_octet_string(STREAM* s, BYTE* oct_str, int length, int min)
{
int i;
int mlength;
per_write_length(s, mlength);
for (i = 0; i < length; i++)
- stream_write_uint8(s, oct_str[i]);
+ stream_write_BYTE(s, oct_str[i]);
}
/**
BOOL per_read_numeric_string(STREAM* s, int min)
{
int length;
- uint16 mlength;
+ UINT16 mlength;
if (!per_read_length(s, &mlength))
return FALSE;
* @param min minimum string length
*/
-void per_write_numeric_string(STREAM* s, uint8* num_str, int length, int min)
+void per_write_numeric_string(STREAM* s, BYTE* num_str, int length, int min)
{
int i;
int mlength;
- uint8 num, c1, c2;
+ BYTE num, c1, c2;
mlength = (length - min >= 0) ? length - min : min;
c2 = (c2 - 0x30) % 10;
num = (c1 << 4) | c2;
- stream_write_uint8(s, num); /* string */
+ stream_write_BYTE(s, num); /* string */
}
}
return TRUE;
}
-int tls_read(rdpTls* tls, uint8* data, int length)
+int tls_read(rdpTls* tls, BYTE* data, int length)
{
int status;
return status;
}
-int tls_read_all(rdpTls* tls, uint8* data, int length)
+int tls_read_all(rdpTls* tls, BYTE* data, int length)
{
int status;
return status;
}
-int tls_write(rdpTls* tls, uint8* data, int length)
+int tls_write(rdpTls* tls, BYTE* data, int length)
{
int status;
}
-int tls_write_all(rdpTls* tls, uint8* data, int length)
+int tls_write_all(rdpTls* tls, BYTE* data, int length)
{
int status;
int sent = 0;
#include <freerdp/gdi/16bpp.h>
-uint16 gdi_get_color_16bpp(HGDI_DC hdc, GDI_COLOR color)
+UINT16 gdi_get_color_16bpp(HGDI_DC hdc, GDI_COLOR color)
{
- uint8 r, g, b;
- uint16 color16;
+ BYTE r, g, b;
+ UINT16 color16;
GetBGR32(r, g, b, color);
int FillRect_16bpp(HGDI_DC hdc, HGDI_RECT rect, HGDI_BRUSH hbr)
{
int x, y;
- uint16 *dstp;
+ UINT16 *dstp;
int nXDest, nYDest;
int nWidth, nHeight;
- uint16 color16;
+ UINT16 color16;
gdi_RectToCRgn(rect, &nXDest, &nYDest, &nWidth, &nHeight);
for (y = 0; y < nHeight; y++)
{
- dstp = (uint16*) gdi_get_bitmap_pointer(hdc, nXDest, nYDest + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdc, nXDest, nYDest + y);
if (dstp != 0)
{
static int BitBlt_BLACKNESS_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int y;
- uint8* dstp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_WHITENESS_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int y;
- uint8* dstp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_SRCCOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int y;
- uint8* srcp;
- uint8* dstp;
+ BYTE* srcp;
+ BYTE* dstp;
if ((hdcDest->selectedObject != hdcSrc->selectedObject) ||
gdi_CopyOverlap(nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc) == 0)
static int BitBlt_NOTSRCCOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint16* srcp;
- uint16* dstp;
+ UINT16* srcp;
+ UINT16* dstp;
for (y = 0; y < nHeight; y++)
{
- srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
static int BitBlt_DSTINVERT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
- uint16* dstp;
+ UINT16* dstp;
for (y = 0; y < nHeight; y++)
{
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
static int BitBlt_SRCERASE_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint16* srcp;
- uint16* dstp;
+ UINT16* srcp;
+ UINT16* dstp;
for (y = 0; y < nHeight; y++)
{
- srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
static int BitBlt_NOTSRCERASE_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint16* srcp;
- uint16* dstp;
+ UINT16* srcp;
+ UINT16* dstp;
for (y = 0; y < nHeight; y++)
{
- srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
static int BitBlt_SRCINVERT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint16* srcp;
- uint16* dstp;
+ UINT16* srcp;
+ UINT16* dstp;
for (y = 0; y < nHeight; y++)
{
- srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
static int BitBlt_SRCAND_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint16* srcp;
- uint16* dstp;
+ UINT16* srcp;
+ UINT16* dstp;
for (y = 0; y < nHeight; y++)
{
- srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
static int BitBlt_SRCPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint16* srcp;
- uint16* dstp;
+ UINT16* srcp;
+ UINT16* dstp;
for (y = 0; y < nHeight; y++)
{
- srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
static int BitBlt_DSPDxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint8* srcp;
- uint16* dstp;
- uint16 src16;
- uint16 color16;
+ BYTE* srcp;
+ UINT16* dstp;
+ UINT16 src16;
+ UINT16 color16;
HGDI_BITMAP hSrcBmp;
/* D = (S & P) | (~S & D) */
for (y = 0; y < nHeight; y++)
{
- srcp = (uint8*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (BYTE*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
static int BitBlt_PSDPxax_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint16* srcp;
- uint16* dstp;
- uint16* patp;
- uint16 color16;
+ UINT16* srcp;
+ UINT16* dstp;
+ UINT16* patp;
+ UINT16 color16;
/* D = (S & D) | (~S & P) */
if (hdcDest->brush->style == GDI_BS_SOLID)
{
color16 = gdi_get_color_16bpp(hdcDest, hdcDest->brush->color);
- patp = (uint16*) &color16;
+ patp = (UINT16*) &color16;
for (y = 0; y < nHeight; y++)
{
- srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
{
for (y = 0; y < nHeight; y++)
{
- srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
for (x = 0; x < nWidth; x++)
{
- patp = (uint16*) gdi_get_brush_pointer(hdcDest, x, y);
+ patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
*dstp = (*srcp & *dstp) | (~(*srcp) & *patp);
srcp++;
dstp++;
static int BitBlt_SPna_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint16* srcp;
- uint16* dstp;
- uint16* patp;
+ UINT16* srcp;
+ UINT16* dstp;
+ UINT16* patp;
for (y = 0; y < nHeight; y++)
{
- srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
for (x = 0; x < nWidth; x++)
{
- patp = (uint16*) gdi_get_brush_pointer(hdcDest, x, y);
+ patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
*dstp = *srcp & ~(*patp);
srcp++;
dstp++;
static int BitBlt_DPa_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
- uint16* dstp;
- uint16* patp;
+ UINT16* dstp;
+ UINT16* patp;
for (y = 0; y < nHeight; y++)
{
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
for (x = 0; x < nWidth; x++)
{
- patp = (uint16*) gdi_get_brush_pointer(hdcDest, x, y);
+ patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
*dstp = *dstp & *patp;
dstp++;
static int BitBlt_PDxn_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
- uint16* dstp;
- uint16* patp;
+ UINT16* dstp;
+ UINT16* patp;
for (y = 0; y < nHeight; y++)
{
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
for (x = 0; x < nWidth; x++)
{
- patp = (uint16*) gdi_get_brush_pointer(hdcDest, x, y);
+ patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
*dstp = *dstp ^ ~(*patp);
dstp++;
}
static int BitBlt_DSna_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint16* srcp;
- uint16* dstp;
+ UINT16* srcp;
+ UINT16* dstp;
for (y = 0; y < nHeight; y++)
{
- srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
static int BitBlt_MERGECOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint16* srcp;
- uint16* dstp;
- uint16* patp;
+ UINT16* srcp;
+ UINT16* dstp;
+ UINT16* patp;
for (y = 0; y < nHeight; y++)
{
- srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
for (x = 0; x < nWidth; x++)
{
- patp = (uint16*) gdi_get_brush_pointer(hdcDest, x, y);
+ patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
*dstp = *srcp & *patp;
srcp++;
dstp++;
static int BitBlt_MERGEPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint16* srcp;
- uint16* dstp;
+ UINT16* srcp;
+ UINT16* dstp;
for (y = 0; y < nHeight; y++)
{
- srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
static int BitBlt_PATCOPY_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
- uint16* dstp;
- uint16* patp;
- uint16 color16;
+ UINT16* dstp;
+ UINT16* patp;
+ UINT16 color16;
if (hdcDest->brush->style == GDI_BS_SOLID)
{
for (y = 0; y < nHeight; y++)
{
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
{
for (y = 0; y < nHeight; y++)
{
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
for (x = 0; x < nWidth; x++)
{
- patp = (uint16*) gdi_get_brush_pointer(hdcDest, x, y);
+ patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
*dstp = *patp;
dstp++;
}
static int BitBlt_PATINVERT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
- uint16* dstp;
- uint16* patp;
- uint16 color16;
+ UINT16* dstp;
+ UINT16* patp;
+ UINT16 color16;
if (hdcDest->brush->style == GDI_BS_SOLID)
{
for (y = 0; y < nHeight; y++)
{
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
{
for (y = 0; y < nHeight; y++)
{
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
for (x = 0; x < nWidth; x++)
{
- patp = (uint16*) gdi_get_brush_pointer(hdcDest, x, y);
+ patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
*dstp = *patp ^ *dstp;
dstp++;
}
static int BitBlt_PATPAINT_16bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint16* srcp;
- uint16* dstp;
- uint16* patp;
+ UINT16* srcp;
+ UINT16* dstp;
+ UINT16* patp;
for (y = 0; y < nHeight; y++)
{
- srcp = (uint16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (UINT16*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (UINT16*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
for (x = 0; x < nWidth; x++)
{
- patp = (uint16*) gdi_get_brush_pointer(hdcDest, x, y);
+ patp = (UINT16*) gdi_get_brush_pointer(hdcDest, x, y);
*dstp = *dstp | (*patp | ~(*srcp));
srcp++;
dstp++;
return 1;
}
-static INLINE void SetPixel_BLACK_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_BLACK_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = 0 */
*pixel = 0;
}
-static INLINE void SetPixel_NOTMERGEPEN_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_NOTMERGEPEN_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = ~(D | P) */
*pixel = ~(*pixel | *pen);
}
-static INLINE void SetPixel_MASKNOTPEN_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_MASKNOTPEN_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = D & ~P */
*pixel &= ~(*pen);
}
-static INLINE void SetPixel_NOTCOPYPEN_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_NOTCOPYPEN_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = ~P */
*pixel = ~(*pen);
}
-static INLINE void SetPixel_MASKPENNOT_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_MASKPENNOT_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = P & ~D */
*pixel = *pen & ~*pixel;
}
-static INLINE void SetPixel_NOT_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_NOT_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = ~D */
*pixel = ~(*pixel);
}
-static INLINE void SetPixel_XORPEN_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_XORPEN_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = D ^ P */
*pixel = *pixel ^ *pen;
}
-static INLINE void SetPixel_NOTMASKPEN_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_NOTMASKPEN_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = ~(D & P) */
*pixel = ~(*pixel & *pen);
}
-static INLINE void SetPixel_MASKPEN_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_MASKPEN_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = D & P */
*pixel &= *pen;
}
-static INLINE void SetPixel_NOTXORPEN_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_NOTXORPEN_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = ~(D ^ P) */
*pixel = ~(*pixel ^ *pen);
}
-static INLINE void SetPixel_NOP_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_NOP_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = D */
}
-static INLINE void SetPixel_MERGENOTPEN_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_MERGENOTPEN_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = D | ~P */
*pixel |= ~(*pen);
}
-static INLINE void SetPixel_COPYPEN_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_COPYPEN_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = P */
*pixel = *pen;
}
-static INLINE void SetPixel_MERGEPENNOT_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_MERGEPENNOT_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = P | ~D */
*pixel = *pen | ~(*pixel);
}
-static INLINE void SetPixel_MERGEPEN_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_MERGEPEN_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = P | D */
*pixel |= *pen;
}
-static INLINE void SetPixel_WHITE_16bpp(uint16 *pixel, uint16 *pen)
+static INLINE void SetPixel_WHITE_16bpp(UINT16 *pixel, UINT16 *pen)
{
/* D = 1 */
*pixel = 0xFFFF;
}
-#define PIXEL_TYPE uint16
+#define PIXEL_TYPE UINT16
#define GDI_GET_POINTER gdi_GetPointer_16bpp
#define GDI_GET_PEN_COLOR gdi_GetPenColor_16bpp
uint32 gdi_get_color_32bpp(HGDI_DC hdc, GDI_COLOR color)
{
uint32 color32;
- uint8 a, r, g, b;
+ BYTE a, r, g, b;
a = 0xFF;
GetBGR32(r, g, b, color);
if (hdcDest->alpha)
{
int x, y;
- uint8* dstp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
else
{
int y;
- uint8* dstp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_WHITENESS_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int y;
- uint8* dstp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_SRCCOPY_32bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int y;
- uint8* srcp;
- uint8* dstp;
+ BYTE* srcp;
+ BYTE* dstp;
if ((hdcDest->selectedObject != hdcSrc->selectedObject) ||
gdi_CopyOverlap(nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc) == 0)
uint32* srcp;
uint32* dstp;
uint32* patp;
- uint8* srcp8;
+ BYTE* srcp8;
uint32 src32;
uint32 color32;
HGDI_BITMAP hSrcBmp;
for (y = 0; y < nHeight; y++)
{
- srcp8 = (uint8*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ srcp8 = (BYTE*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
dstp = (uint32*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
#include <freerdp/gdi/8bpp.h>
-uint8 gdi_get_color_8bpp(HGDI_DC hdc, GDI_COLOR color)
+BYTE gdi_get_color_8bpp(HGDI_DC hdc, GDI_COLOR color)
{
/* TODO: Implement 8bpp gdi_get_color_8bpp() */
return 0;
static int BitBlt_BLACKNESS_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int y;
- uint8* dstp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_WHITENESS_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int y;
- uint8* dstp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_SRCCOPY_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int y;
- uint8* srcp;
- uint8* dstp;
+ BYTE* srcp;
+ BYTE* dstp;
if ((hdcDest->selectedObject != hdcSrc->selectedObject) ||
gdi_CopyOverlap(nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc) == 0)
static int BitBlt_NOTSRCCOPY_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint8* srcp;
- uint8* dstp;
+ BYTE* srcp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_DSTINVERT_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
- uint8* dstp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_SRCERASE_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint8* srcp;
- uint8* dstp;
+ BYTE* srcp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_NOTSRCERASE_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint8* srcp;
- uint8* dstp;
+ BYTE* srcp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_SRCINVERT_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint8* srcp;
- uint8* dstp;
+ BYTE* srcp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_SRCAND_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint8* srcp;
- uint8* dstp;
+ BYTE* srcp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_SRCPAINT_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint8* srcp;
- uint8* dstp;
+ BYTE* srcp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_PSDPxax_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint8* srcp;
- uint8* dstp;
- uint8* patp;
- uint8 color8;
+ BYTE* srcp;
+ BYTE* dstp;
+ BYTE* patp;
+ BYTE color8;
/* D = (S & D) | (~S & P) */
if (hdcDest->brush->style == GDI_BS_SOLID)
{
color8 = gdi_get_color_8bpp(hdcDest, hdcDest->brush->color);
- patp = (uint8*) &color8;
+ patp = (BYTE*) &color8;
for (y = 0; y < nHeight; y++)
{
- srcp = (uint8*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint8*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (BYTE*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (BYTE*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
{
for (y = 0; y < nHeight; y++)
{
- srcp = (uint8*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
- dstp = (uint8*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
+ srcp = (BYTE*) gdi_get_bitmap_pointer(hdcSrc, nXSrc, nYSrc + y);
+ dstp = (BYTE*) gdi_get_bitmap_pointer(hdcDest, nXDest, nYDest + y);
if (dstp != 0)
{
for (x = 0; x < nWidth; x++)
{
- patp = (uint8*) gdi_get_brush_pointer(hdcDest, x, y);
+ patp = (BYTE*) gdi_get_brush_pointer(hdcDest, x, y);
*dstp = (*srcp & *dstp) | (~(*srcp) & *patp);
srcp++;
dstp++;
static int BitBlt_SPna_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint8* srcp;
- uint8* dstp;
- uint8* patp;
+ BYTE* srcp;
+ BYTE* dstp;
+ BYTE* patp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_DPa_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
- uint8* dstp;
- uint8* patp;
+ BYTE* dstp;
+ BYTE* patp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_PDxn_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
- uint8* dstp;
- uint8* patp;
+ BYTE* dstp;
+ BYTE* patp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_DSna_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint8* srcp;
- uint8* dstp;
+ BYTE* srcp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_MERGECOPY_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint8* srcp;
- uint8* dstp;
- uint8* patp;
+ BYTE* srcp;
+ BYTE* dstp;
+ BYTE* patp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_MERGEPAINT_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint8* srcp;
- uint8* dstp;
+ BYTE* srcp;
+ BYTE* dstp;
for (y = 0; y < nHeight; y++)
{
static int BitBlt_PATCOPY_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
- uint8* dstp;
- uint8* patp;
- uint8 palIndex;
+ BYTE* dstp;
+ BYTE* patp;
+ BYTE palIndex;
if(hdcDest->brush->style == GDI_BS_SOLID)
{
static int BitBlt_PATINVERT_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight)
{
int x, y;
- uint8* dstp;
- uint8* patp;
- uint8 palIndex;
+ BYTE* dstp;
+ BYTE* patp;
+ BYTE palIndex;
if(hdcDest->brush->style == GDI_BS_SOLID)
{
static int BitBlt_PATPAINT_8bpp(HGDI_DC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HGDI_DC hdcSrc, int nXSrc, int nYSrc)
{
int x, y;
- uint8* srcp;
- uint8* dstp;
- uint8* patp;
+ BYTE* srcp;
+ BYTE* dstp;
+ BYTE* patp;
for (y = 0; y < nHeight; y++)
{
return 1;
}
-static INLINE void SetPixel_BLACK_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_BLACK_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = 0 */
*pixel = 0;
}
-static INLINE void SetPixel_NOTMERGEPEN_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_NOTMERGEPEN_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = ~(D | P) */
*pixel = ~(*pixel | *pen);
}
-static INLINE void SetPixel_MASKNOTPEN_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_MASKNOTPEN_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = D & ~P */
*pixel &= ~(*pen);
}
-static INLINE void SetPixel_NOTCOPYPEN_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_NOTCOPYPEN_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = ~P */
*pixel = ~(*pen);
}
-static INLINE void SetPixel_MASKPENNOT_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_MASKPENNOT_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = P & ~D */
*pixel = *pen & ~*pixel;
}
-static INLINE void SetPixel_NOT_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_NOT_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = ~D */
*pixel = ~(*pixel);
}
-static INLINE void SetPixel_XORPEN_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_XORPEN_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = D ^ P */
*pixel = *pixel ^ *pen;
}
-static INLINE void SetPixel_NOTMASKPEN_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_NOTMASKPEN_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = ~(D & P) */
*pixel = ~(*pixel & *pen);
}
-static INLINE void SetPixel_MASKPEN_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_MASKPEN_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = D & P */
*pixel &= *pen;
}
-static INLINE void SetPixel_NOTXORPEN_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_NOTXORPEN_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = ~(D ^ P) */
*pixel = ~(*pixel ^ *pen);
}
-static INLINE void SetPixel_NOP_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_NOP_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = D */
}
-static INLINE void SetPixel_MERGENOTPEN_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_MERGENOTPEN_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = D | ~P */
*pixel |= ~(*pen);
}
-static INLINE void SetPixel_COPYPEN_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_COPYPEN_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = P */
*pixel = *pen;
}
-static INLINE void SetPixel_MERGEPENNOT_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_MERGEPENNOT_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = P | ~D */
*pixel = *pen | ~(*pixel);
}
-static INLINE void SetPixel_MERGEPEN_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_MERGEPEN_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = P | D */
*pixel |= *pen;
}
-static INLINE void SetPixel_WHITE_8bpp(uint8* pixel, uint8* pen)
+static INLINE void SetPixel_WHITE_8bpp(BYTE* pixel, BYTE* pen)
{
/* D = 1 */
*pixel = 0xFF;
}
-#define PIXEL_TYPE uint8
+#define PIXEL_TYPE BYTE
#define GDI_GET_POINTER gdi_GetPointer_8bpp
#define GDI_GET_PEN_COLOR gdi_GetPenColor_8bpp
return (GDI_COLOR) *colorp;
}
-INLINE uint8 gdi_GetPixel_8bpp(HGDI_BITMAP hBmp, int X, int Y)
+INLINE BYTE gdi_GetPixel_8bpp(HGDI_BITMAP hBmp, int X, int Y)
{
- return *((uint8*)&(hBmp->data[(Y * hBmp->width) + X]));
+ return *((BYTE*)&(hBmp->data[(Y * hBmp->width) + X]));
}
-INLINE uint16 gdi_GetPixel_16bpp(HGDI_BITMAP hBmp, int X, int Y)
+INLINE UINT16 gdi_GetPixel_16bpp(HGDI_BITMAP hBmp, int X, int Y)
{
- return *((uint16*)&(hBmp->data[(Y * hBmp->width * 2) + X * 2]));
+ return *((UINT16*)&(hBmp->data[(Y * hBmp->width * 2) + X * 2]));
}
INLINE uint32 gdi_GetPixel_32bpp(HGDI_BITMAP hBmp, int X, int Y)
return *((uint32*)&(hBmp->data[(Y * hBmp->width * 4) + X * 4]));
}
-INLINE uint8* gdi_GetPointer_8bpp(HGDI_BITMAP hBmp, int X, int Y)
+INLINE BYTE* gdi_GetPointer_8bpp(HGDI_BITMAP hBmp, int X, int Y)
{
- return ((uint8*)&(hBmp->data[(Y * hBmp->width) + X]));
+ return ((BYTE*)&(hBmp->data[(Y * hBmp->width) + X]));
}
-INLINE uint16* gdi_GetPointer_16bpp(HGDI_BITMAP hBmp, int X, int Y)
+INLINE UINT16* gdi_GetPointer_16bpp(HGDI_BITMAP hBmp, int X, int Y)
{
- return ((uint16*)&(hBmp->data[(Y * hBmp->width * 2) + X * 2]));
+ return ((UINT16*)&(hBmp->data[(Y * hBmp->width * 2) + X * 2]));
}
INLINE uint32* gdi_GetPointer_32bpp(HGDI_BITMAP hBmp, int X, int Y)
return 0;
}
-INLINE void gdi_SetPixel_8bpp(HGDI_BITMAP hBmp, int X, int Y, uint8 pixel)
+INLINE void gdi_SetPixel_8bpp(HGDI_BITMAP hBmp, int X, int Y, BYTE pixel)
{
- *((uint8*)&(hBmp->data[(Y * hBmp->width) + X])) = pixel;
+ *((BYTE*)&(hBmp->data[(Y * hBmp->width) + X])) = pixel;
}
-INLINE void gdi_SetPixel_16bpp(HGDI_BITMAP hBmp, int X, int Y, uint16 pixel)
+INLINE void gdi_SetPixel_16bpp(HGDI_BITMAP hBmp, int X, int Y, UINT16 pixel)
{
- *((uint16*)&(hBmp->data[(Y * hBmp->width * 2) + X * 2])) = pixel;
+ *((UINT16*)&(hBmp->data[(Y * hBmp->width * 2) + X * 2])) = pixel;
}
INLINE void gdi_SetPixel_32bpp(HGDI_BITMAP hBmp, int X, int Y, uint32 pixel)
* @return new bitmap
*/
-HGDI_BITMAP gdi_CreateBitmap(int nWidth, int nHeight, int cBitsPerPixel, uint8* data)
+HGDI_BITMAP gdi_CreateBitmap(int nWidth, int nHeight, int cBitsPerPixel, BYTE* data)
{
HGDI_BITMAP hBitmap = (HGDI_BITMAP) malloc(sizeof(GDI_BITMAP));
hBitmap->objectType = GDIOBJECT_BITMAP;
/* GDI Helper Functions */
-INLINE uint32 gdi_rop3_code(uint8 code)
+INLINE uint32 gdi_rop3_code(BYTE code)
{
return rop3_code_table[code];
}
-INLINE uint8* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, int x, int y)
+INLINE BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, int x, int y)
{
- uint8* p;
+ BYTE* p;
HGDI_BITMAP hBmp = (HGDI_BITMAP) hdcBmp->selectedObject;
if (x >= 0 && x < hBmp->width && y >= 0 && y < hBmp->height)
}
}
-INLINE uint8* gdi_get_brush_pointer(HGDI_DC hdcBrush, int x, int y)
+INLINE BYTE* gdi_get_brush_pointer(HGDI_DC hdcBrush, int x, int y)
{
- uint8 * p;
+ BYTE * p;
if (hdcBrush->brush != NULL)
{
}
}
- p = (uint8*) &(hdcBrush->textColor);
+ p = (BYTE*) &(hdcBrush->textColor);
return p;
}
-INLINE int gdi_is_mono_pixel_set(uint8* data, int x, int y, int width)
+INLINE int gdi_is_mono_pixel_set(BYTE* data, int x, int y, int width)
{
int byte;
int shift;
gdiBitmap* gdi_glyph_new(rdpGdi* gdi, GLYPH_DATA* glyph)
{
- uint8* extra;
+ BYTE* extra;
gdiBitmap* gdi_bmp;
gdi_bmp = (gdiBitmap*) malloc(sizeof(gdiBitmap));
}
}
-gdiBitmap* gdi_bitmap_new_ex(rdpGdi* gdi, int width, int height, int bpp, uint8* data)
+gdiBitmap* gdi_bitmap_new_ex(rdpGdi* gdi, int width, int height, int bpp, BYTE* data)
{
gdiBitmap* bitmap;
void gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
{
- uint8* data;
+ BYTE* data;
rdpBrush* brush;
HGDI_BRUSH originalBrush;
rdpGdi* gdi = context->gdi;
gdi->image->bitmap->height = surface_bits_command->height;
gdi->image->bitmap->bitsPerPixel = surface_bits_command->bpp;
gdi->image->bitmap->bytesPerPixel = gdi->image->bitmap->bitsPerPixel / 8;
- gdi->image->bitmap->data = (uint8*) realloc(gdi->image->bitmap->data, gdi->image->bitmap->width * gdi->image->bitmap->height * 4);
+ gdi->image->bitmap->data = (BYTE*) realloc(gdi->image->bitmap->data, gdi->image->bitmap->width * gdi->image->bitmap->height * 4);
freerdp_image_flip(nsc_context->bmpdata, gdi->image->bitmap->data, gdi->image->bitmap->width, gdi->image->bitmap->height, 32);
gdi_BitBlt(gdi->primary->hdc, surface_bits_command->destLeft, surface_bits_command->destTop, surface_bits_command->width, surface_bits_command->height, gdi->image->hdc, 0, 0, GDI_SRCCOPY);
}
gdi->image->bitmap->bitsPerPixel = surface_bits_command->bpp;
gdi->image->bitmap->bytesPerPixel = gdi->image->bitmap->bitsPerPixel / 8;
- gdi->image->bitmap->data = (uint8*) realloc(gdi->image->bitmap->data,
+ gdi->image->bitmap->data = (BYTE*) realloc(gdi->image->bitmap->data,
gdi->image->bitmap->width * gdi->image->bitmap->height * 4);
if ((surface_bits_command->bpp != 32) || (gdi->clrconv->alpha == TRUE))
{
- uint8* temp_image;
+ BYTE* temp_image;
freerdp_image_convert(surface_bits_command->bitmapData, gdi->image->bitmap->data,
gdi->image->bitmap->width, gdi->image->bitmap->height,
surface_bits_command->bpp = 32;
surface_bits_command->bitmapData = gdi->image->bitmap->data;
- temp_image = (uint8*) malloc(gdi->image->bitmap->width * gdi->image->bitmap->height * 4);
+ temp_image = (BYTE*) malloc(gdi->image->bitmap->width * gdi->image->bitmap->height * 4);
freerdp_image_flip(gdi->image->bitmap->data, temp_image, gdi->image->bitmap->width, gdi->image->bitmap->height, 32);
free(gdi->image->bitmap->data);
gdi->image->bitmap->data = temp_image;
* @return
*/
-int gdi_init(freerdp* instance, uint32 flags, uint8* buffer)
+int gdi_init(freerdp* instance, uint32 flags, BYTE* buffer)
{
rdpGdi* gdi;
rdpCache* cache;
#include "graphics.h"
-gdiBitmap* gdi_bitmap_new_ex(rdpGdi* gdi, int width, int height, int bpp, uint8* data);
+gdiBitmap* gdi_bitmap_new_ex(rdpGdi* gdi, int width, int height, int bpp, BYTE* data);
void gdi_bitmap_free_ex(gdiBitmap* gdi_bmp);
#endif /* __GDI_CORE_H */
/* Bitmap Class */
-HGDI_BITMAP gdi_create_bitmap(rdpGdi* gdi, int width, int height, int bpp, uint8* data)
+HGDI_BITMAP gdi_create_bitmap(rdpGdi* gdi, int width, int height, int bpp, BYTE* data)
{
- uint8* bmpData;
+ BYTE* bmpData;
HGDI_BITMAP bitmap;
bmpData = freerdp_image_convert(data, NULL, width, height, gdi->srcBpp, bpp, gdi->clrconv);
}
void gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
- uint8* data, int width, int height, int bpp, int length,
+ BYTE* data, int width, int height, int bpp, int length,
BOOL compressed, int codec_id)
{
- uint16 size;
+ UINT16 size;
RFX_MESSAGE* msg;
- uint8* src;
- uint8* dst;
+ BYTE* src;
+ BYTE* dst;
int yindex;
int xindex;
rdpGdi* gdi;
size = width * height * (bpp + 7) / 8;
if (bitmap->data == NULL)
- bitmap->data = (uint8*) malloc(size);
+ bitmap->data = (BYTE*) malloc(size);
else
- bitmap->data = (uint8*) realloc(bitmap->data, size);
+ bitmap->data = (BYTE*) realloc(bitmap->data, size);
switch (codec_id)
{
void gdi_Glyph_New(rdpContext* context, rdpGlyph* glyph)
{
- uint8* data;
+ BYTE* data;
gdiGlyph* gdi_glyph;
gdi_glyph = (gdiGlyph*) glyph;
#include <freerdp/gdi/gdi.h>
#include <freerdp/graphics.h>
-HGDI_BITMAP gdi_create_bitmap(rdpGdi* gdi, int width, int height, int bpp, uint8* data);
+HGDI_BITMAP gdi_create_bitmap(rdpGdi* gdi, int width, int height, int bpp, BYTE* data);
void gdi_Bitmap_New(rdpContext* context, rdpBitmap* bitmap);
void gdi_Bitmap_Free(rdpContext* context, rdpBitmap* bitmap);
void gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
- uint8* data, int width, int height, int bpp, int length,
+ BYTE* data, int width, int height, int bpp, int length,
BOOL compressed, int codec_id);
void gdi_register_graphics(rdpGraphics* graphics);
return hPen;
}
-INLINE uint8 gdi_GetPenColor_8bpp(HGDI_PEN pen)
+INLINE BYTE gdi_GetPenColor_8bpp(HGDI_PEN pen)
{
/* TODO: implement conversion using palette */
return 0xFF;
}
-INLINE uint16 gdi_GetPenColor_16bpp(HGDI_PEN pen)
+INLINE UINT16 gdi_GetPenColor_16bpp(HGDI_PEN pen)
{
- uint16 p;
+ UINT16 p;
int r, g, b;
GetRGB32(r, g, b, pen->color);
RGB_888_565(r, g, b);
int a, b, c;
HGDI_BITMAP bmp;
- uint8 pixel8;
- uint16 pixel16;
+ BYTE pixel8;
+ UINT16 pixel16;
uint32 pixel32;
int bpp = hdc->bitsPerPixel;
struct _SYSTEM_TIME_ENTRY
{
- uint16 wYear;
- uint16 wMonth;
- uint16 wDayOfWeek;
- uint16 wDay;
- uint16 wHour;
- uint16 wMinute;
- uint16 wSecond;
- uint16 wMilliseconds;
+ UINT16 wYear;
+ UINT16 wMonth;
+ UINT16 wDayOfWeek;
+ UINT16 wDay;
+ UINT16 wHour;
+ UINT16 wMinute;
+ UINT16 wSecond;
+ UINT16 wMilliseconds;
};
typedef struct _SYSTEM_TIME_ENTRY SYSTEM_TIME_ENTRY;
#include <freerdp/rail/icon.h>
-ICON_INFO* icon_cache_get(rdpIconCache* cache, uint8 id, uint16 index, void** extra)
+ICON_INFO* icon_cache_get(rdpIconCache* cache, BYTE id, UINT16 index, void** extra)
{
ICON_INFO* entry;
return entry;
}
-void icon_cache_put(rdpIconCache* cache, uint8 id, uint16 index, ICON_INFO* entry, void* extra)
+void icon_cache_put(rdpIconCache* cache, BYTE id, UINT16 index, ICON_INFO* entry, void* extra)
{
if (id >= cache->numCaches)
{
int i;
cache->rail = rail;
- cache->numCaches = (uint8) rail->settings->num_icon_cache_entries;
+ cache->numCaches = (BYTE) rail->settings->num_icon_cache_entries;
cache->numCacheEntries = rail->settings->num_icon_cache_entries;
cache->caches = xzalloc(cache->numCaches * sizeof(WINDOW_ICON_CACHE));
}
else
{
- settings->width = (uint16) strtol(argv[index], &p, 10);
+ settings->width = (UINT16) strtol(argv[index], &p, 10);
if (*p == 'x')
{
- settings->height = (uint16) strtol(p + 1, &p, 10);
+ settings->height = (UINT16) strtol(p + 1, &p, 10);
}
if (*p == '%')
{
typedef struct
{
- uint8 magic[2];
+ BYTE magic[2];
} BITMAP_MAGIC;
typedef struct
{
uint32 filesz;
- uint16 creator1;
- uint16 creator2;
+ UINT16 creator1;
+ UINT16 creator2;
uint32 bmp_offset;
} BITMAP_CORE_HEADER;
uint32 header_sz;
sint32 width;
sint32 height;
- uint16 nplanes;
- uint16 bitspp;
+ UINT16 nplanes;
+ UINT16 bitspp;
uint32 compress_type;
uint32 bmp_bytesz;
sint32 hres;
#include <freerdp/utils/dsp.h>
static void freerdp_dsp_resample(FREERDP_DSP_CONTEXT* context,
- const uint8* src, int bytes_per_sample,
+ const BYTE* src, int bytes_per_sample,
uint32 schan, uint32 srate, int sframes,
uint32 rchan, uint32 rrate)
{
- uint8* dst;
- uint8* p;
+ BYTE* dst;
+ BYTE* p;
int rframes;
int rsize;
int i, j;
if (rsize > (int) context->resampled_maxlength)
{
context->resampled_maxlength = rsize + 1024;
- context->resampled_buffer = (uint8*) realloc(context->resampled_buffer, context->resampled_maxlength);
+ context->resampled_buffer = (BYTE*) realloc(context->resampled_buffer, context->resampled_maxlength);
}
dst = context->resampled_buffer;
* http://wiki.multimedia.cx/index.php?title=IMA_ADPCM
*/
-static const sint16 ima_step_index_table[] =
+static const INT16 ima_step_index_table[] =
{
-1, -1, -1, -1, 2, 4, 6, 8,
-1, -1, -1, -1, 2, 4, 6, 8
};
-static const sint16 ima_step_size_table[] =
+static const INT16 ima_step_size_table[] =
{
7, 8, 9, 10, 11, 12, 13, 14, 16, 17,
19, 21, 23, 25, 28, 31, 34, 37, 41, 45,
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
};
-static uint16 dsp_decode_ima_adpcm_sample(ADPCM* adpcm,
- int channel, uint8 sample)
+static UINT16 dsp_decode_ima_adpcm_sample(ADPCM* adpcm,
+ int channel, BYTE sample)
{
sint32 ss;
sint32 d;
else if (d > 32767)
d = 32767;
- adpcm->ima.last_sample[channel] = (sint16) d;
+ adpcm->ima.last_sample[channel] = (INT16) d;
adpcm->ima.last_step[channel] += ima_step_index_table[sample];
if (adpcm->ima.last_step[channel] < 0)
else if (adpcm->ima.last_step[channel] > 88)
adpcm->ima.last_step[channel] = 88;
- return (uint16) d;
+ return (UINT16) d;
}
static void freerdp_dsp_decode_ima_adpcm(FREERDP_DSP_CONTEXT* context,
- const uint8* src, int size, int channels, int block_size)
+ const BYTE* src, int size, int channels, int block_size)
{
- uint8* dst;
- uint8 sample;
- uint16 decoded;
+ BYTE* dst;
+ BYTE sample;
+ UINT16 decoded;
uint32 out_size;
int channel;
int i;
{
if (size % block_size == 0)
{
- context->adpcm.ima.last_sample[0] = (sint16) (((uint16)(*src)) | (((uint16)(*(src + 1))) << 8));
- context->adpcm.ima.last_step[0] = (sint16) (*(src + 2));
+ context->adpcm.ima.last_sample[0] = (INT16) (((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8));
+ context->adpcm.ima.last_step[0] = (INT16) (*(src + 2));
src += 4;
size -= 4;
out_size -= 16;
if (channels > 1)
{
- context->adpcm.ima.last_sample[1] = (sint16) (((uint16)(*src)) | (((uint16)(*(src + 1))) << 8));
- context->adpcm.ima.last_step[1] = (sint16) (*(src + 2));
+ context->adpcm.ima.last_sample[1] = (INT16) (((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8));
+ context->adpcm.ima.last_step[1] = (INT16) (*(src + 2));
src += 4;
size -= 4;
out_size -= 16;
*/
static const struct
{
- uint8 byte_num;
- uint8 byte_shift;
+ BYTE byte_num;
+ BYTE byte_shift;
} ima_stereo_encode_map[] =
{
{ 0, 0 },
{ 7, 4 }
};
-static uint8 dsp_encode_ima_adpcm_sample(ADPCM* adpcm,
- int channel, sint16 sample)
+static BYTE dsp_encode_ima_adpcm_sample(ADPCM* adpcm,
+ int channel, INT16 sample)
{
sint32 e;
sint32 d;
sint32 ss;
- uint8 enc;
+ BYTE enc;
sint32 diff;
ss = ima_step_size_table[adpcm->ima.last_step[channel]];
diff = -32768;
else if (diff > 32767)
diff = 32767;
- adpcm->ima.last_sample[channel] = (sint16) diff;
+ adpcm->ima.last_sample[channel] = (INT16) diff;
adpcm->ima.last_step[channel] += ima_step_index_table[enc];
if (adpcm->ima.last_step[channel] < 0)
}
static void freerdp_dsp_encode_ima_adpcm(FREERDP_DSP_CONTEXT* context,
- const uint8* src, int size, int channels, int block_size)
+ const BYTE* src, int size, int channels, int block_size)
{
- uint8* dst;
- sint16 sample;
- uint8 encoded;
+ BYTE* dst;
+ INT16 sample;
+ BYTE encoded;
uint32 out_size;
int i;
{
*dst++ = context->adpcm.ima.last_sample[0] & 0xff;
*dst++ = (context->adpcm.ima.last_sample[0] >> 8) & 0xff;
- *dst++ = (uint8) context->adpcm.ima.last_step[0];
+ *dst++ = (BYTE) context->adpcm.ima.last_step[0];
*dst++ = 0;
if (channels > 1)
{
*dst++ = context->adpcm.ima.last_sample[1] & 0xff;
*dst++ = (context->adpcm.ima.last_sample[1] >> 8) & 0xff;
- *dst++ = (uint8) context->adpcm.ima.last_step[1];
+ *dst++ = (BYTE) context->adpcm.ima.last_step[1];
*dst++ = 0;
}
}
memset(dst, 0, 8);
for (i = 0; i < 16; i++)
{
- sample = (sint16) (((uint16)(*src)) | (((uint16)(*(src + 1))) << 8));
+ sample = (INT16) (((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8));
src += 2;
encoded = dsp_encode_ima_adpcm_sample(&context->adpcm, i % 2, sample);
dst[ima_stereo_encode_map[i].byte_num] |= encoded << ima_stereo_encode_map[i].byte_shift;
}
else
{
- sample = (sint16) (((uint16)(*src)) | (((uint16)(*(src + 1))) << 8));
+ sample = (INT16) (((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8));
src += 2;
encoded = dsp_encode_ima_adpcm_sample(&context->adpcm, 0, sample);
- sample = (sint16) (((uint16)(*src)) | (((uint16)(*(src + 1))) << 8));
+ sample = (INT16) (((UINT16)(*src)) | (((UINT16)(*(src + 1))) << 8));
src += 2;
encoded |= dsp_encode_ima_adpcm_sample(&context->adpcm, 0, sample) << 4;
*dst++ = encoded;
* http://wiki.multimedia.cx/index.php?title=Microsoft_ADPCM
*/
-static const sint16 ms_adpcm_adaptation_table[] =
+static const INT16 ms_adpcm_adaptation_table[] =
{
230, 230, 230, 230, 307, 409, 512, 614,
768, 614, 512, 409, 307, 230, 230, 230
};
-static const sint16 ms_adpcm_coeff1_table[] =
+static const INT16 ms_adpcm_coeff1_table[] =
{
256, 512, 0, 192, 240, 460, 392
};
-static const sint16 ms_adpcm_coeff2_table[] =
+static const INT16 ms_adpcm_coeff2_table[] =
{
0, -256, 0, 64, 0, -208, -232
};
-static sint16 freerdp_dsp_decode_ms_adpcm_sample(ADPCM* adpcm, uint8 sample, int channel)
+static INT16 freerdp_dsp_decode_ms_adpcm_sample(ADPCM* adpcm, BYTE sample, int channel)
{
- sint8 nibble;
+ INT8 nibble;
sint32 presample;
- nibble = (sample & 0x08 ? (sint8)sample - 16 : sample);
+ nibble = (sample & 0x08 ? (INT8)sample - 16 : sample);
presample = ((adpcm->ms.sample1[channel] * ms_adpcm_coeff1_table[adpcm->ms.predictor[channel]]) +
(adpcm->ms.sample2[channel] * ms_adpcm_coeff2_table[adpcm->ms.predictor[channel]])) / 256;
presample += nibble * adpcm->ms.delta[channel];
adpcm->ms.delta[channel] = adpcm->ms.delta[channel] * ms_adpcm_adaptation_table[sample] / 256;
if (adpcm->ms.delta[channel] < 16)
adpcm->ms.delta[channel] = 16;
- return (sint16) presample;
+ return (INT16) presample;
}
static void freerdp_dsp_decode_ms_adpcm(FREERDP_DSP_CONTEXT* context,
- const uint8* src, int size, int channels, int block_size)
+ const BYTE* src, int size, int channels, int block_size)
{
- uint8* dst;
- uint8 sample;
+ BYTE* dst;
+ BYTE sample;
uint32 out_size;
out_size = size * 4;
{
context->adpcm.ms.predictor[0] = *src++;
context->adpcm.ms.predictor[1] = *src++;
- context->adpcm.ms.delta[0] = *((sint16*)src);
+ context->adpcm.ms.delta[0] = *((INT16*)src);
src += 2;
- context->adpcm.ms.delta[1] = *((sint16*)src);
+ context->adpcm.ms.delta[1] = *((INT16*)src);
src += 2;
- context->adpcm.ms.sample1[0] = *((sint16*)src);
+ context->adpcm.ms.sample1[0] = *((INT16*)src);
src += 2;
- context->adpcm.ms.sample1[1] = *((sint16*)src);
+ context->adpcm.ms.sample1[1] = *((INT16*)src);
src += 2;
- context->adpcm.ms.sample2[0] = *((sint16*)src);
+ context->adpcm.ms.sample2[0] = *((INT16*)src);
src += 2;
- context->adpcm.ms.sample2[1] = *((sint16*)src);
+ context->adpcm.ms.sample2[1] = *((INT16*)src);
src += 2;
size -= 14;
- *((sint16*)dst) = context->adpcm.ms.sample2[0];
+ *((INT16*)dst) = context->adpcm.ms.sample2[0];
dst += 2;
- *((sint16*)dst) = context->adpcm.ms.sample2[1];
+ *((INT16*)dst) = context->adpcm.ms.sample2[1];
dst += 2;
- *((sint16*)dst) = context->adpcm.ms.sample1[0];
+ *((INT16*)dst) = context->adpcm.ms.sample1[0];
dst += 2;
- *((sint16*)dst) = context->adpcm.ms.sample1[1];
+ *((INT16*)dst) = context->adpcm.ms.sample1[1];
dst += 2;
}
else
{
context->adpcm.ms.predictor[0] = *src++;
- context->adpcm.ms.delta[0] = *((sint16*)src);
+ context->adpcm.ms.delta[0] = *((INT16*)src);
src += 2;
- context->adpcm.ms.sample1[0] = *((sint16*)src);
+ context->adpcm.ms.sample1[0] = *((INT16*)src);
src += 2;
- context->adpcm.ms.sample2[0] = *((sint16*)src);
+ context->adpcm.ms.sample2[0] = *((INT16*)src);
src += 2;
size -= 7;
- *((sint16*)dst) = context->adpcm.ms.sample2[0];
+ *((INT16*)dst) = context->adpcm.ms.sample2[0];
dst += 2;
- *((sint16*)dst) = context->adpcm.ms.sample1[0];
+ *((INT16*)dst) = context->adpcm.ms.sample1[0];
dst += 2;
}
}
{
sample = *src++;
size--;
- *((sint16*)dst) = freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample >> 4, 0);
+ *((INT16*)dst) = freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample >> 4, 0);
dst += 2;
- *((sint16*)dst) = freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample & 0x0F, 1);
+ *((INT16*)dst) = freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample & 0x0F, 1);
dst += 2;
sample = *src++;
size--;
- *((sint16*)dst) = freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample >> 4, 0);
+ *((INT16*)dst) = freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample >> 4, 0);
dst += 2;
- *((sint16*)dst) = freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample & 0x0F, 1);
+ *((INT16*)dst) = freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample & 0x0F, 1);
dst += 2;
}
else
{
sample = *src++;
size--;
- *((sint16*)dst) = freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample >> 4, 0);
+ *((INT16*)dst) = freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample >> 4, 0);
dst += 2;
- *((sint16*)dst) = freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample & 0x0F, 0);
+ *((INT16*)dst) = freerdp_dsp_decode_ms_adpcm_sample(&context->adpcm, sample & 0x0F, 0);
dst += 2;
}
}
context->adpcm_size = dst - context->adpcm_buffer;
}
-static uint8 freerdp_dsp_encode_ms_adpcm_sample(ADPCM* adpcm, sint32 sample, int channel)
+static BYTE freerdp_dsp_encode_ms_adpcm_sample(ADPCM* adpcm, sint32 sample, int channel)
{
sint32 presample;
sint32 errordelta;
presample = -32768;
adpcm->ms.sample2[channel] = adpcm->ms.sample1[channel];
adpcm->ms.sample1[channel] = presample;
- adpcm->ms.delta[channel] = adpcm->ms.delta[channel] * ms_adpcm_adaptation_table[(((uint8)errordelta) & 0x0F)] / 256;
+ adpcm->ms.delta[channel] = adpcm->ms.delta[channel] * ms_adpcm_adaptation_table[(((BYTE)errordelta) & 0x0F)] / 256;
if (adpcm->ms.delta[channel] < 16)
adpcm->ms.delta[channel] = 16;
- return ((uint8)errordelta) & 0x0F;
+ return ((BYTE)errordelta) & 0x0F;
}
static void freerdp_dsp_encode_ms_adpcm(FREERDP_DSP_CONTEXT* context,
- const uint8* src, int size, int channels, int block_size)
+ const BYTE* src, int size, int channels, int block_size)
{
- uint8* dst;
+ BYTE* dst;
sint32 sample;
uint32 out_size;
{
*dst++ = context->adpcm.ms.predictor[0];
*dst++ = context->adpcm.ms.predictor[1];
- *dst++ = (uint8) (context->adpcm.ms.delta[0] & 0xff);
- *dst++ = (uint8) ((context->adpcm.ms.delta[0] >> 8) & 0xff);
- *dst++ = (uint8) (context->adpcm.ms.delta[1] & 0xff);
- *dst++ = (uint8) ((context->adpcm.ms.delta[1] >> 8) & 0xff);
- context->adpcm.ms.sample1[0] = *((sint16*) (src + 4));
- context->adpcm.ms.sample1[1] = *((sint16*) (src + 6));
- context->adpcm.ms.sample2[0] = *((sint16*) (src + 0));
- context->adpcm.ms.sample2[1] = *((sint16*) (src + 2));
- *((sint16*) (dst + 0)) = (sint16) context->adpcm.ms.sample1[0];
- *((sint16*) (dst + 2)) = (sint16) context->adpcm.ms.sample1[1];
- *((sint16*) (dst + 4)) = (sint16) context->adpcm.ms.sample2[0];
- *((sint16*) (dst + 6)) = (sint16) context->adpcm.ms.sample2[1];
+ *dst++ = (BYTE) (context->adpcm.ms.delta[0] & 0xff);
+ *dst++ = (BYTE) ((context->adpcm.ms.delta[0] >> 8) & 0xff);
+ *dst++ = (BYTE) (context->adpcm.ms.delta[1] & 0xff);
+ *dst++ = (BYTE) ((context->adpcm.ms.delta[1] >> 8) & 0xff);
+ context->adpcm.ms.sample1[0] = *((INT16*) (src + 4));
+ context->adpcm.ms.sample1[1] = *((INT16*) (src + 6));
+ context->adpcm.ms.sample2[0] = *((INT16*) (src + 0));
+ context->adpcm.ms.sample2[1] = *((INT16*) (src + 2));
+ *((INT16*) (dst + 0)) = (INT16) context->adpcm.ms.sample1[0];
+ *((INT16*) (dst + 2)) = (INT16) context->adpcm.ms.sample1[1];
+ *((INT16*) (dst + 4)) = (INT16) context->adpcm.ms.sample2[0];
+ *((INT16*) (dst + 6)) = (INT16) context->adpcm.ms.sample2[1];
dst += 8;
src += 8;
size -= 8;
else
{
*dst++ = context->adpcm.ms.predictor[0];
- *dst++ = (uint8) (context->adpcm.ms.delta[0] & 0xff);
- *dst++ = (uint8) ((context->adpcm.ms.delta[0] >> 8) & 0xff);
- context->adpcm.ms.sample1[0] = *((sint16*) (src + 2));
- context->adpcm.ms.sample2[0] = *((sint16*) (src + 0));
- *((sint16*) (dst + 0)) = (sint16) context->adpcm.ms.sample1[0];
- *((sint16*) (dst + 2)) = (sint16) context->adpcm.ms.sample2[0];
+ *dst++ = (BYTE) (context->adpcm.ms.delta[0] & 0xff);
+ *dst++ = (BYTE) ((context->adpcm.ms.delta[0] >> 8) & 0xff);
+ context->adpcm.ms.sample1[0] = *((INT16*) (src + 2));
+ context->adpcm.ms.sample2[0] = *((INT16*) (src + 0));
+ *((INT16*) (dst + 0)) = (INT16) context->adpcm.ms.sample1[0];
+ *((INT16*) (dst + 2)) = (INT16) context->adpcm.ms.sample2[0];
dst += 4;
src += 4;
size -= 4;
}
}
- sample = *((sint16*) src);
+ sample = *((INT16*) src);
src += 2;
*dst = freerdp_dsp_encode_ms_adpcm_sample(&context->adpcm, sample, 0) << 4;
- sample = *((sint16*) src);
+ sample = *((INT16*) src);
src += 2;
*dst += freerdp_dsp_encode_ms_adpcm_sample(&context->adpcm, sample, channels > 1 ? 1 : 0);
dst++;
#include <freerdp/client/tsmf.h>
#include <freerdp/rail.h>
-static RDP_EVENT* freerdp_cliprdr_event_new(uint16 event_type)
+static RDP_EVENT* freerdp_cliprdr_event_new(UINT16 event_type)
{
RDP_EVENT* event = NULL;
return event;
}
-static RDP_EVENT* freerdp_tsmf_event_new(uint16 event_type)
+static RDP_EVENT* freerdp_tsmf_event_new(UINT16 event_type)
{
RDP_EVENT* event = NULL;
return event;
}
-static RDP_EVENT* freerdp_rail_event_new(uint16 event_type)
+static RDP_EVENT* freerdp_rail_event_new(UINT16 event_type)
{
RDP_EVENT* event = NULL;
event = xnew(RDP_EVENT);
return event;
}
-RDP_EVENT* freerdp_event_new(uint16 event_class, uint16 event_type,
+RDP_EVENT* freerdp_event_new(UINT16 event_class, UINT16 event_type,
RDP_EVENT_CALLBACK on_event_free_callback, void* user_data)
{
RDP_EVENT* event = NULL;
#include <freerdp/utils/hexdump.h>
-void freerdp_hexdump(uint8* data, int length)
+void freerdp_hexdump(BYTE* data, int length)
{
- uint8* p = data;
+ BYTE* p = data;
int i, line, offset = 0;
while (offset < length)
}
static MSUSB_PIPE_DESCRIPTOR **
-msusb_mspipes_read(uint8 * data, uint32 data_size, uint32 NumberOfPipes, int * offset)
+msusb_mspipes_read(BYTE * data, uint32 data_size, uint32 NumberOfPipes, int * offset)
{
MSUSB_PIPE_DESCRIPTOR ** MsPipes;
int pnum, move = 0;
{
MSUSB_PIPE_DESCRIPTOR * MsPipe = msusb_mspipe_new();
- data_read_uint16(data + move, MsPipe->MaximumPacketSize);
+ data_read_UINT16(data + move, MsPipe->MaximumPacketSize);
data_read_uint32(data + move + 4, MsPipe->MaximumTransferSize);
data_read_uint32(data + move + 8, MsPipe->PipeFlags);
move += 12;
}
void
-msusb_msinterface_replace(MSUSB_CONFIG_DESCRIPTOR * MsConfig, uint8 InterfaceNumber, MSUSB_INTERFACE_DESCRIPTOR * NewMsInterface)
+msusb_msinterface_replace(MSUSB_CONFIG_DESCRIPTOR * MsConfig, BYTE InterfaceNumber, MSUSB_INTERFACE_DESCRIPTOR * NewMsInterface)
{
msusb_msinterface_free(MsConfig->MsInterfaces[InterfaceNumber]);
MsConfig->MsInterfaces[InterfaceNumber] = NewMsInterface;
}
MSUSB_INTERFACE_DESCRIPTOR *
-msusb_msinterface_read(uint8 * data, uint32 data_size, int * offset)
+msusb_msinterface_read(BYTE * data, uint32 data_size, int * offset)
{
MSUSB_INTERFACE_DESCRIPTOR * MsInterface;
MsInterface = msusb_msinterface_new();
- data_read_uint16(data, MsInterface->Length);
- data_read_uint16(data + 2, MsInterface->NumberOfPipesExpected);
- data_read_uint8(data + 4, MsInterface->InterfaceNumber);
- data_read_uint8(data + 5, MsInterface->AlternateSetting);
+ data_read_UINT16(data, MsInterface->Length);
+ data_read_UINT16(data + 2, MsInterface->NumberOfPipesExpected);
+ data_read_BYTE(data + 4, MsInterface->InterfaceNumber);
+ data_read_BYTE(data + 5, MsInterface->AlternateSetting);
data_read_uint32(data + 8, MsInterface->NumberOfPipes);
*offset += 12;
}
int
-msusb_msinterface_write(MSUSB_INTERFACE_DESCRIPTOR * MsInterface, uint8 * data, int * offset)
+msusb_msinterface_write(MSUSB_INTERFACE_DESCRIPTOR * MsInterface, BYTE * data, int * offset)
{
MSUSB_PIPE_DESCRIPTOR ** MsPipes;
MSUSB_PIPE_DESCRIPTOR * MsPipe;
int pnum = 0, move = 0;
/* Length */
- data_write_uint16(data, MsInterface->Length);
+ data_write_UINT16(data, MsInterface->Length);
/* InterfaceNumber */
- data_write_uint8(data + 2, MsInterface->InterfaceNumber);
+ data_write_BYTE(data + 2, MsInterface->InterfaceNumber);
/* AlternateSetting */
- data_write_uint8(data + 3, MsInterface->AlternateSetting);
+ data_write_BYTE(data + 3, MsInterface->AlternateSetting);
/* bInterfaceClass */
- data_write_uint8(data + 4, MsInterface->bInterfaceClass);
+ data_write_BYTE(data + 4, MsInterface->bInterfaceClass);
/* bInterfaceSubClass */
- data_write_uint8(data + 5, MsInterface->bInterfaceSubClass);
+ data_write_BYTE(data + 5, MsInterface->bInterfaceSubClass);
/* bInterfaceProtocol */
- data_write_uint8(data + 6, MsInterface->bInterfaceProtocol);
+ data_write_BYTE(data + 6, MsInterface->bInterfaceProtocol);
/* Padding */
- data_write_uint8(data + 7, 0);
+ data_write_BYTE(data + 7, 0);
/* InterfaceHandle */
data_write_uint32(data + 8, MsInterface->InterfaceHandle);
/* NumberOfPipes */
{
MsPipe = MsPipes[pnum];
/* MaximumPacketSize */
- data_write_uint16(data + move, MsPipe->MaximumPacketSize);
+ data_write_UINT16(data + move, MsPipe->MaximumPacketSize);
/* EndpointAddress */
- data_write_uint8(data + move + 2, MsPipe->bEndpointAddress);
+ data_write_BYTE(data + move + 2, MsPipe->bEndpointAddress);
/* Interval */
- data_write_uint8(data + move + 3, MsPipe->bInterval);
+ data_write_BYTE(data + move + 3, MsPipe->bInterval);
/* PipeType */
data_write_uint32(data + move + 4, MsPipe->PipeType);
/* PipeHandle */
}
static MSUSB_INTERFACE_DESCRIPTOR **
-msusb_msinterface_read_list(uint8 * data, uint32 data_size, uint32 NumInterfaces)
+msusb_msinterface_read_list(BYTE * data, uint32 data_size, uint32 NumInterfaces)
{
MSUSB_INTERFACE_DESCRIPTOR ** MsInterfaces;
int inum, offset = 0;
}
int
-msusb_msconfig_write(MSUSB_CONFIG_DESCRIPTOR * MsConfg, uint8 * data, int * offset)
+msusb_msconfig_write(MSUSB_CONFIG_DESCRIPTOR * MsConfg, BYTE * data, int * offset)
{
MSUSB_INTERFACE_DESCRIPTOR ** MsInterfaces;
MSUSB_INTERFACE_DESCRIPTOR * MsInterface;
}
MSUSB_CONFIG_DESCRIPTOR *
-msusb_msconfig_read(uint8 * data, uint32 data_size, uint32 NumInterfaces)
+msusb_msconfig_read(BYTE * data, uint32 data_size, uint32 NumInterfaces)
{
MSUSB_CONFIG_DESCRIPTOR * MsConfig;
- uint8 lenConfiguration, typeConfiguration;
- uint16 lenInterface;
+ BYTE lenConfiguration, typeConfiguration;
+ UINT16 lenInterface;
int i, offset = 0;
MsConfig = msusb_msconfig_new();
for(i = 0; i < NumInterfaces; i++)
{
- data_read_uint16(data + offset, lenInterface);
+ data_read_UINT16(data + offset, lenInterface);
offset += lenInterface;
}
- data_read_uint8(data + offset, lenConfiguration);
- data_read_uint8(data + offset + 1, typeConfiguration);
+ data_read_BYTE(data + offset, lenConfiguration);
+ data_read_BYTE(data + offset + 1, typeConfiguration);
if (lenConfiguration != 0x9 || typeConfiguration != 0x2)
{
DEBUG("%s: len and type must be 0x9 and 0x2 , but it is 0x%x and 0x%x",
lenConfiguration, typeConfiguration);
}
- data_read_uint16(data + offset + 2, MsConfig->wTotalLength);
- data_read_uint8(data + offset + 5, MsConfig->bConfigurationValue);
+ data_read_UINT16(data + offset + 2, MsConfig->wTotalLength);
+ data_read_BYTE(data + offset + 5, MsConfig->bConfigurationValue);
MsConfig->NumInterfaces = NumInterfaces;
MsConfig->ConfigurationHandle = 0;
MsConfig->InitCompleted = 0;
#include <freerdp/rail.h>
-void rail_unicode_string_alloc(RAIL_UNICODE_STRING* unicode_string, uint16 cbString)
+void rail_unicode_string_alloc(RAIL_UNICODE_STRING* unicode_string, UINT16 cbString)
{
unicode_string->length = cbString;
unicode_string->string = malloc(cbString);
void rail_read_unicode_string(STREAM* s, RAIL_UNICODE_STRING* unicode_string)
{
- stream_read_uint16(s, unicode_string->length); /* cbString (2 bytes) */
+ stream_read_UINT16(s, unicode_string->length); /* cbString (2 bytes) */
if (unicode_string->string == NULL)
- unicode_string->string = (uint8*) malloc(unicode_string->length);
+ unicode_string->string = (BYTE*) malloc(unicode_string->length);
else
- unicode_string->string = (uint8*) realloc(unicode_string->string, unicode_string->length);
+ unicode_string->string = (BYTE*) realloc(unicode_string->string, unicode_string->length);
stream_read(s, unicode_string->string, unicode_string->length);
}
void rail_write_unicode_string(STREAM* s, RAIL_UNICODE_STRING* unicode_string)
{
stream_check_size(s, 2 + unicode_string->length);
- stream_write_uint16(s, unicode_string->length); /* cbString (2 bytes) */
+ stream_write_UINT16(s, unicode_string->length); /* cbString (2 bytes) */
stream_write(s, unicode_string->string, unicode_string->length); /* string */
}
void rail_read_rectangle_16(STREAM* s, RECTANGLE_16* rectangle_16)
{
- stream_read_uint16(s, rectangle_16->left); /* left (2 bytes) */
- stream_read_uint16(s, rectangle_16->top); /* top (2 bytes) */
- stream_read_uint16(s, rectangle_16->right); /* right (2 bytes) */
- stream_read_uint16(s, rectangle_16->bottom); /* bottom (2 bytes) */
+ stream_read_UINT16(s, rectangle_16->left); /* left (2 bytes) */
+ stream_read_UINT16(s, rectangle_16->top); /* top (2 bytes) */
+ stream_read_UINT16(s, rectangle_16->right); /* right (2 bytes) */
+ stream_read_UINT16(s, rectangle_16->bottom); /* bottom (2 bytes) */
}
void rail_write_rectangle_16(STREAM* s, RECTANGLE_16* rectangle_16)
{
- stream_write_uint16(s, rectangle_16->left); /* left (2 bytes) */
- stream_write_uint16(s, rectangle_16->top); /* top (2 bytes) */
- stream_write_uint16(s, rectangle_16->right); /* right (2 bytes) */
- stream_write_uint16(s, rectangle_16->bottom); /* bottom (2 bytes) */
+ stream_write_UINT16(s, rectangle_16->left); /* left (2 bytes) */
+ stream_write_UINT16(s, rectangle_16->top); /* top (2 bytes) */
+ stream_write_UINT16(s, rectangle_16->right); /* right (2 bytes) */
+ stream_write_UINT16(s, rectangle_16->bottom); /* bottom (2 bytes) */
}
void* rail_clone_order(uint32 event_type, void* order)
if (size != 0)
{
size = size > 0 ? size : 0x400;
- stream->data = (uint8*) xzalloc(size);
+ stream->data = (BYTE*) xzalloc(size);
stream->p = stream->data;
stream->size = size;
}
stream->size += increased_size;
if (original_size == 0)
- stream->data = (uint8*) malloc(stream->size);
+ stream->data = (BYTE*) malloc(stream->size);
else
- stream->data = (uint8*) realloc(stream->data, stream->size);
+ stream->data = (BYTE*) realloc(stream->data, stream->size);
memset(stream->data + original_size, 0, increased_size);
stream_set_pos(stream, pos);
return sockfd;
}
-int freerdp_tcp_read(int sockfd, uint8* data, int length)
+int freerdp_tcp_read(int sockfd, BYTE* data, int length)
{
int status;
return status;
}
-int freerdp_tcp_write(int sockfd, uint8* data, int length)
+int freerdp_tcp_write(int sockfd, BYTE* data, int length)
{
int status;
#include<stdio.h>
-typedef unsigned short uint16;
+typedef unsigned short UINT16;
-static uint16 HuffCodeLEC[] = {
+static UINT16 HuffCodeLEC[] = {
0x0004, 0x0024, 0x0014, 0x0011, 0x0051, 0x0031, 0x0071, 0x0009, 0x0049, 0x0029, 0x0069, 0x0015, 0x0095,
0x0055, 0x00d5, 0x0035, 0x00b5, 0x0075, 0x001d, 0x00f5, 0x011d, 0x009d, 0x019d, 0x005d, 0x000d, 0x008d, 0x015d,
0x00dd, 0x01dd, 0x003d, 0x013d, 0x00bd, 0x004d, 0x01bd, 0x007d, 0x006b, 0x017d, 0x00fd, 0x01fd, 0x0003, 0x0103,
0x002c, 0x001c, 0x0000, 0x003c, 0x0002, 0x0022, 0x0010, 0x0012, 0x0008, 0x0032, 0x000a, 0x002a, 0x001a, 0x003a,
0x0006, 0x0026, 0x0016, 0x0036, 0x000e, 0x002e, 0x001e, 0x003e, 0x0001, 0x00ed, 0x0018, 0x0021, 0x0025, 0x0065 };
-uint16 HashTable[512] = { [0 ... 511] = 0xffff };
+UINT16 HashTable[512] = { [0 ... 511] = 0xffff };
-static uint16 tab[8] = {511, 0, 508, 448, 494, 347, 486, 482};
+static UINT16 tab[8] = {511, 0, 508, 448, 494, 347, 486, 482};
-uint16 hash(uint16 key)
+UINT16 hash(UINT16 key)
{
- uint16 h;
+ UINT16 h;
h = (key & 0x1ff) ^ (key >> 9) ^ (key >> 4) ^ (key >> 7);
return h;
}
-uint16 minihash(uint16 key)
+UINT16 minihash(UINT16 key)
{
- uint16 h;
+ UINT16 h;
h = ((((key >> 8) ^ (key & 0xff)) >> 2) & 0xf);
if(key >> 9)
h = ~h;
void buildhashtable(void)
{
int i,j;
- uint16 h;
+ UINT16 h;
for(i=0;i<293;i++)
{
h=hash(HuffCodeLEC[i]);
}
}
-uint16 getvalue(uint16 huff)
+UINT16 getvalue(UINT16 huff)
{
- uint16 h = HashTable[hash(huff)];
+ UINT16 h = HashTable[hash(huff)];
if((h ^ huff) >> 9)
return h & 0x1ff;
else
{
int i;
buildhashtable();
- printf("static uint16 HuffIndexLEC[512] = {\n");
+ printf("static UINT16 HuffIndexLEC[512] = {\n");
for(i=0;i<512;i++)
{
if(i == 511)
#include<stdio.h>
-typedef unsigned short uint16;
-typedef unsigned char uint8;
-static uint16 HuffCodeLOM[] = {
+typedef unsigned short UINT16;
+typedef unsigned char BYTE;
+static UINT16 HuffCodeLOM[] = {
0x0001, 0x0000, 0x0002, 0x0009, 0x0006, 0x0005, 0x000d, 0x000b, 0x0003, 0x001b, 0x0007, 0x0017, 0x0037,
0x000f, 0x004f, 0x006f, 0x002f, 0x00ef, 0x001f, 0x005f, 0x015f, 0x009f, 0x00df, 0x01df, 0x003f, 0x013f, 0x00bf,
0x01bf, 0x007f, 0x017f, 0x00ff, 0x01ff };
-uint16 HashTable[32] = { [0 ... 31] = 0xffff };
+UINT16 HashTable[32] = { [0 ... 31] = 0xffff };
-uint8 tab[4] = { 0, 4, 10, 19 };
+BYTE tab[4] = { 0, 4, 10, 19 };
-uint16 hash(uint16 key)
+UINT16 hash(UINT16 key)
{
return ((key & 0x1f) ^ (key >> 5) ^ (key >> 9));
}
-uint8 minihash(uint16 key)
+BYTE minihash(UINT16 key)
{
- uint8 h;
+ BYTE h;
h = (key >> 4) & 0xf;
return ((h ^ (h >> 2) ^ (h >> 3)) & 0x3);
}
void buildhashtable(void)
{
int i,j;
- uint16 h;
+ UINT16 h;
for(i=0;i<32;i++)
{
h=hash(HuffCodeLOM[i]);
}
}
-uint8 getvalue(uint16 huff)
+BYTE getvalue(UINT16 huff)
{
- uint16 h = HashTable[hash(huff)];
+ UINT16 h = HashTable[hash(huff)];
if((h ^ huff) >> 5)
{
return h & 0x1f;
{
int i;
buildhashtable();
- printf("static uint16 HuffIndexLOM[32] = {\n");
+ printf("static UINT16 HuffIndexLOM[32] = {\n");
for(i=0;i<32;i++)
{
if(i == 31)
int size;
STREAM* s;
RFX_RECT rect;
- uint8* rgb_data;
+ BYTE* rgb_data;
rdpUpdate* update = client->update;
SURFACE_BITS_COMMAND* cmd = &update->surface_bits_command;
testPeerContext* context = (testPeerContext*) client->context;
FILE* fp;
int i;
char line[50];
- uint8* rgb_data;
+ BYTE* rgb_data;
int c;
if (!client->settings->rfx_codec && !client->settings->ns_codec)
if (fgets(line, sizeof(line), fp))
{
sscanf(line, "%d", &c);
- rgb_data[i] = (uint8)c;
+ rgb_data[i] = (BYTE)c;
}
}
s = stream_new(4096);
- WTSVirtualChannelWrite(context->debug_channel, (uint8*) "test1", 5, NULL);
+ WTSVirtualChannelWrite(context->debug_channel, (BYTE*) "test1", 5, NULL);
while (1)
{
printf("Client sent a synchronize event (flags:0x%X)\n", flags);
}
-void tf_peer_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
+void tf_peer_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
freerdp_peer* client = input->context->peer;
rdpUpdate* update = client->update;
{
if (context->debug_channel)
{
- WTSVirtualChannelWrite(context->debug_channel, (uint8*) "test2", 5, NULL);
+ WTSVirtualChannelWrite(context->debug_channel, (BYTE*) "test2", 5, NULL);
}
}
else if ((flags & 0x4000) && code == 0x2D) /* 'x' key */
}
}
-void tf_peer_unicode_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
+void tf_peer_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
printf("Client sent a unicode keyboard event (flags:0x%X code:0x%X)\n", flags, code);
}
-void tf_peer_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
+void tf_peer_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
//printf("Client sent a mouse event (flags:0x%X pos:%d,%d)\n", flags, x, y);
test_peer_draw_icon(input->context->peer, x + 10, y);
}
-void tf_peer_extended_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
+void tf_peer_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
//printf("Client sent an extended mouse event (flags:0x%X pos:%d,%d)\n", flags, x, y);
}
-static void tf_peer_refresh_rect(rdpContext* context, uint8 count, RECTANGLE_16* areas)
+static void tf_peer_refresh_rect(rdpContext* context, BYTE count, RECTANGLE_16* areas)
{
- uint8 i;
+ BYTE i;
printf("Client requested to refresh:\n");
}
}
-static void tf_peer_suppress_output(rdpContext* context, uint8 allow, RECTANGLE_16* area)
+static void tf_peer_suppress_output(rdpContext* context, BYTE allow, RECTANGLE_16* area)
{
if (allow > 0)
{
RFX_CONTEXT* rfx_context;\r
NSC_CONTEXT* nsc_context;\r
STREAM* s;\r
- uint8* icon_data;\r
- uint8* bg_data;\r
+ BYTE* icon_data;\r
+ BYTE* bg_data;\r
int icon_width;\r
int icon_height;\r
int icon_x;\r
return IsRectEmpty(&wfi->invalid);\r
}\r
\r
-void wf_info_getScreenData(wfInfo* wfi, long* width, long* height, uint8** pBits, int* pitch)\r
+void wf_info_getScreenData(wfInfo* wfi, long* width, long* height, BYTE** pBits, int* pitch)\r
{\r
*width = (wfi->invalid.right - wfi->invalid.left);\r
*height = (wfi->invalid.bottom - wfi->invalid.top);\r
*height += 1;\r
\r
offset = (4 * wfi->invalid.left) + (wfi->invalid.top * wfi->width * 4);\r
- *pBits = ((uint8*) (changes->Userbuffer)) + offset;\r
+ *pBits = ((BYTE*) (changes->Userbuffer)) + offset;\r
*pitch = wfi->width * 4;\r
}\r
#endif\r
void wf_info_clear_invalid_region(wfInfo* wfi);\r
void wf_info_invalidate_full_screen(wfInfo* wfi);\r
BOOL wf_info_have_invalid_region(wfInfo* wfi);\r
-void wf_info_getScreenData(wfInfo* wfi, long* width, long* height, uint8** pBits, int* pitch);\r
+void wf_info_getScreenData(wfInfo* wfi, long* width, long* height, BYTE** pBits, int* pitch);\r
\r
#endif /* WF_INFO_H */
\ No newline at end of file
#include "wf_input.h"
-void wf_peer_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
+void wf_peer_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
INPUT keyboard_event;
SendInput(1, &keyboard_event, sizeof(INPUT));
}
-void wf_peer_unicode_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
+void wf_peer_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
INPUT keyboard_event;
SendInput(1, &keyboard_event, sizeof(INPUT));
}
-void wf_peer_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
+void wf_peer_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
INPUT mouse_event;
float width, height;
}
}
-void wf_peer_extended_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
+void wf_peer_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
if ((flags & PTR_XFLAGS_BUTTON1) || (flags & PTR_XFLAGS_BUTTON2))
{
#include "wf_interface.h"
-void wf_peer_keyboard_event(rdpInput* input, uint16 flags, uint16 code);
-void wf_peer_unicode_keyboard_event(rdpInput* input, uint16 flags, uint16 code);
-void wf_peer_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y);
-void wf_peer_extended_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y);
+void wf_peer_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
+void wf_peer_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
+void wf_peer_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
+void wf_peer_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
#endif /* WF_INPUT_H */
wf_settings_read_dword(HKEY_LOCAL_MACHINE, _T("Software\\FreeRDP\\Server"), _T("DefaultPort"), &server->port);
- if (instance->Open(instance, NULL, (uint16) server->port))
+ if (instance->Open(instance, NULL, (UINT16) server->port))
{
server->thread = CreateThread(NULL, 0, wf_server_main_loop, (void*) instance, 0, NULL);
return TRUE;
RFX_RECT rect;
long height, width;
- uint8* pDataBits = NULL;
+ BYTE* pDataBits = NULL;
int stride;
SURFACE_BITS_COMMAND* cmd;
rect.x = 0;
rect.y = 0;
- rect.width = (uint16) width;
- rect.height = (uint16) height;
+ rect.width = (UINT16) width;
+ rect.height = (UINT16) height;
//printf("x:%d y:%d w:%d h:%d\n", wfi->invalid.left, wfi->invalid.top, width, height);
printf("Client sent a synchronize event (flags:0x%X)\n", flags);
}
-void xf_input_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
+void xf_input_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
#ifdef WITH_XTEST
unsigned int keycode;
#endif
}
-void xf_input_unicode_keyboard_event(rdpInput* input, uint16 flags, uint16 code)
+void xf_input_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
{
printf("Client sent a unicode keyboard event (flags:0x%X code:0x%X)\n", flags, code);
}
-void xf_input_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
+void xf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
#ifdef WITH_XTEST
xfPeerContext* xfp = (xfPeerContext*) input->context;
#endif
}
-void xf_input_extended_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y)
+void xf_input_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
#ifdef WITH_XTEST
xfPeerContext* xfp = (xfPeerContext*) input->context;
#include "xfreerdp.h"
void xf_input_synchronize_event(rdpInput* input, uint32 flags);
-void xf_input_keyboard_event(rdpInput* input, uint16 flags, uint16 code);
-void xf_input_unicode_keyboard_event(rdpInput* input, uint16 flags, uint16 code);
-void xf_input_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y);
-void xf_input_extended_mouse_event(rdpInput* input, uint16 flags, uint16 x, uint16 y);
+void xf_input_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
+void xf_input_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code);
+void xf_input_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
+void xf_input_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y);
void xf_input_register_callbacks(rdpInput* input);
#endif /* __XF_INPUT_H */
void xf_peer_rfx_update(freerdp_peer* client, int x, int y, int width, int height)
{
STREAM* s;
- uint8* data;
+ BYTE* data;
xfInfo* xfi;
RFX_RECT rect;
XImage* image;
image = xf_snapshot(xfp, x, y, width, height);
- data = (uint8*) image->data;
+ data = (BYTE*) image->data;
data = &data[(y * image->bytes_per_line) + (x * image->bits_per_pixel / 8)];
rfx_compose_message(xfp->rfx_context, s, &rect, 1, data,
image = xf_snapshot(xfp, x, y, width, height);
rfx_compose_message(xfp->rfx_context, s, &rect, 1,
- (uint8*) image->data, width, height, width * xfi->bytesPerPixel);
+ (BYTE*) image->data, width, height, width * xfi->bytesPerPixel);
cmd->destLeft = x;
cmd->destTop = y;