mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 08:24:16 +09:00
freerdp: get rid of old types
This commit is contained in:
@@ -37,12 +37,12 @@ typedef struct _AudinALSADevice
|
||||
IAudinDevice iface;
|
||||
|
||||
char device_name[32];
|
||||
uint32 frames_per_packet;
|
||||
uint32 target_rate;
|
||||
uint32 actual_rate;
|
||||
UINT32 frames_per_packet;
|
||||
UINT32 target_rate;
|
||||
UINT32 actual_rate;
|
||||
snd_pcm_format_t format;
|
||||
uint32 target_channels;
|
||||
uint32 actual_channels;
|
||||
UINT32 target_channels;
|
||||
UINT32 actual_channels;
|
||||
int bytes_per_channel;
|
||||
int wformat;
|
||||
int block_size;
|
||||
@@ -265,7 +265,7 @@ static BOOL audin_alsa_format_supported(IAudinDevice* device, audinFormat* forma
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void audin_alsa_set_format(IAudinDevice* device, audinFormat* format, uint32 FramesPerPacket)
|
||||
static void audin_alsa_set_format(IAudinDevice* device, audinFormat* format, UINT32 FramesPerPacket)
|
||||
{
|
||||
int bs;
|
||||
AudinALSADevice* alsa = (AudinALSADevice*) device;
|
||||
|
||||
@@ -76,7 +76,7 @@ struct _AUDIN_PLUGIN
|
||||
/* Parsed plugin data */
|
||||
UINT16 fixed_format;
|
||||
UINT16 fixed_channel;
|
||||
uint32 fixed_rate;
|
||||
UINT32 fixed_rate;
|
||||
|
||||
/* Device interface */
|
||||
IAudinDevice* device;
|
||||
@@ -86,16 +86,16 @@ static int audin_process_version(IWTSVirtualChannelCallback* pChannelCallback, S
|
||||
{
|
||||
int error;
|
||||
STREAM* out;
|
||||
uint32 Version;
|
||||
UINT32 Version;
|
||||
AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback;
|
||||
|
||||
stream_read_uint32(s, Version);
|
||||
stream_read_UINT32(s, Version);
|
||||
|
||||
DEBUG_DVC("Version=%d", Version);
|
||||
|
||||
out = stream_new(5);
|
||||
stream_write_BYTE(out, MSG_SNDIN_VERSION);
|
||||
stream_write_uint32(out, Version);
|
||||
stream_write_UINT32(out, Version);
|
||||
error = callback->channel->Write(callback->channel, stream_get_length(s), stream_get_head(s), NULL);
|
||||
stream_free(out);
|
||||
|
||||
@@ -115,22 +115,22 @@ static int audin_process_formats(IWTSVirtualChannelCallback* pChannelCallback, S
|
||||
{
|
||||
AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback;
|
||||
AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) callback->plugin;
|
||||
uint32 i;
|
||||
UINT32 i;
|
||||
BYTE* fm;
|
||||
int error;
|
||||
STREAM* out;
|
||||
uint32 NumFormats;
|
||||
UINT32 NumFormats;
|
||||
audinFormat format;
|
||||
uint32 cbSizeFormatsPacket;
|
||||
UINT32 cbSizeFormatsPacket;
|
||||
|
||||
stream_read_uint32(s, NumFormats);
|
||||
stream_read_UINT32(s, NumFormats);
|
||||
DEBUG_DVC("NumFormats %d", NumFormats);
|
||||
if ((NumFormats < 1) || (NumFormats > 1000))
|
||||
{
|
||||
DEBUG_WARN("bad NumFormats %d", NumFormats);
|
||||
return 1;
|
||||
}
|
||||
stream_seek_uint32(s); /* cbSizeFormatsPacket */
|
||||
stream_seek_UINT32(s); /* cbSizeFormatsPacket */
|
||||
|
||||
callback->formats = (audinFormat*) xzalloc(NumFormats * sizeof(audinFormat));
|
||||
|
||||
@@ -143,8 +143,8 @@ static int audin_process_formats(IWTSVirtualChannelCallback* pChannelCallback, S
|
||||
stream_get_mark(s, fm);
|
||||
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_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);
|
||||
@@ -180,8 +180,8 @@ static int audin_process_formats(IWTSVirtualChannelCallback* pChannelCallback, S
|
||||
stream_set_pos(out, 0);
|
||||
|
||||
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) */
|
||||
stream_write_UINT32(out, callback->formats_count); /* NumFormats (4 bytes) */
|
||||
stream_write_UINT32(out, cbSizeFormatsPacket); /* cbSizeFormatsPacket (4 bytes) */
|
||||
|
||||
error = callback->channel->Write(callback->channel, cbSizeFormatsPacket, stream_get_head(out), NULL);
|
||||
stream_free(out);
|
||||
@@ -189,7 +189,7 @@ static int audin_process_formats(IWTSVirtualChannelCallback* pChannelCallback, S
|
||||
return error;
|
||||
}
|
||||
|
||||
static int audin_send_format_change_pdu(IWTSVirtualChannelCallback* pChannelCallback, uint32 NewFormat)
|
||||
static int audin_send_format_change_pdu(IWTSVirtualChannelCallback* pChannelCallback, UINT32 NewFormat)
|
||||
{
|
||||
int error;
|
||||
STREAM* out;
|
||||
@@ -197,14 +197,14 @@ static int audin_send_format_change_pdu(IWTSVirtualChannelCallback* pChannelCall
|
||||
|
||||
out = stream_new(5);
|
||||
stream_write_BYTE(out, MSG_SNDIN_FORMATCHANGE);
|
||||
stream_write_uint32(out, NewFormat);
|
||||
stream_write_UINT32(out, NewFormat);
|
||||
error = callback->channel->Write(callback->channel, 5, stream_get_head(out), NULL);
|
||||
stream_free(out);
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
static int audin_send_open_reply_pdu(IWTSVirtualChannelCallback* pChannelCallback, uint32 Result)
|
||||
static int audin_send_open_reply_pdu(IWTSVirtualChannelCallback* pChannelCallback, UINT32 Result)
|
||||
{
|
||||
int error;
|
||||
STREAM* out;
|
||||
@@ -212,7 +212,7 @@ static int audin_send_open_reply_pdu(IWTSVirtualChannelCallback* pChannelCallbac
|
||||
|
||||
out = stream_new(5);
|
||||
stream_write_BYTE(out, MSG_SNDIN_OPEN_REPLY);
|
||||
stream_write_uint32(out, Result);
|
||||
stream_write_UINT32(out, Result);
|
||||
error = callback->channel->Write(callback->channel, 5, stream_get_head(out), NULL);
|
||||
stream_free(out);
|
||||
|
||||
@@ -244,16 +244,16 @@ static int audin_process_open(IWTSVirtualChannelCallback* pChannelCallback, STRE
|
||||
AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback;
|
||||
AUDIN_PLUGIN* audin = (AUDIN_PLUGIN*) callback->plugin;
|
||||
audinFormat* format;
|
||||
uint32 initialFormat;
|
||||
uint32 FramesPerPacket;
|
||||
UINT32 initialFormat;
|
||||
UINT32 FramesPerPacket;
|
||||
|
||||
stream_read_uint32(s, FramesPerPacket);
|
||||
stream_read_uint32(s, initialFormat);
|
||||
stream_read_UINT32(s, FramesPerPacket);
|
||||
stream_read_UINT32(s, initialFormat);
|
||||
|
||||
DEBUG_DVC("FramesPerPacket=%d initialFormat=%d",
|
||||
FramesPerPacket, initialFormat);
|
||||
|
||||
if (initialFormat >= (uint32) callback->formats_count)
|
||||
if (initialFormat >= (UINT32) callback->formats_count)
|
||||
{
|
||||
DEBUG_WARN("invalid format index %d (total %d)",
|
||||
initialFormat, callback->formats_count);
|
||||
@@ -277,14 +277,14 @@ static int audin_process_format_change(IWTSVirtualChannelCallback* pChannelCallb
|
||||
{
|
||||
AUDIN_CHANNEL_CALLBACK* callback = (AUDIN_CHANNEL_CALLBACK*) pChannelCallback;
|
||||
AUDIN_PLUGIN * audin = (AUDIN_PLUGIN*) callback->plugin;
|
||||
uint32 NewFormat;
|
||||
UINT32 NewFormat;
|
||||
audinFormat* format;
|
||||
|
||||
stream_read_uint32(s, NewFormat);
|
||||
stream_read_UINT32(s, NewFormat);
|
||||
|
||||
DEBUG_DVC("NewFormat=%d", NewFormat);
|
||||
|
||||
if (NewFormat >= (uint32) callback->formats_count)
|
||||
if (NewFormat >= (UINT32) callback->formats_count)
|
||||
{
|
||||
DEBUG_WARN("invalid format index %d (total %d)",
|
||||
NewFormat, callback->formats_count);
|
||||
@@ -305,7 +305,7 @@ static int audin_process_format_change(IWTSVirtualChannelCallback* pChannelCallb
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int audin_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, uint32 cbSize, BYTE* pBuffer)
|
||||
static int audin_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, UINT32 cbSize, BYTE* pBuffer)
|
||||
{
|
||||
int error;
|
||||
STREAM* s;
|
||||
|
||||
@@ -41,7 +41,7 @@ struct audin_format
|
||||
{
|
||||
UINT16 wFormatTag;
|
||||
UINT16 nChannels;
|
||||
uint32 nSamplesPerSec;
|
||||
UINT32 nSamplesPerSec;
|
||||
UINT16 nBlockAlign;
|
||||
UINT16 wBitsPerSample;
|
||||
UINT16 cbSize;
|
||||
@@ -53,7 +53,7 @@ struct _IAudinDevice
|
||||
{
|
||||
void (*Open) (IAudinDevice* devplugin, AudinReceive receive, void* user_data);
|
||||
BOOL (*FormatSupported) (IAudinDevice* devplugin, audinFormat* format);
|
||||
void (*SetFormat) (IAudinDevice* devplugin, audinFormat* format, uint32 FramesPerPacket);
|
||||
void (*SetFormat) (IAudinDevice* devplugin, audinFormat* format, UINT32 FramesPerPacket);
|
||||
void (*Close) (IAudinDevice* devplugin);
|
||||
void (*Free) (IAudinDevice* devplugin);
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ typedef struct _AudinPulseDevice
|
||||
IAudinDevice iface;
|
||||
|
||||
char device_name[32];
|
||||
uint32 frames_per_packet;
|
||||
UINT32 frames_per_packet;
|
||||
pa_threaded_mainloop* mainloop;
|
||||
pa_context* context;
|
||||
pa_sample_spec sample_spec;
|
||||
@@ -197,7 +197,7 @@ static BOOL audin_pulse_format_supported(IAudinDevice* device, audinFormat* form
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void audin_pulse_set_format(IAudinDevice* device, audinFormat* format, uint32 FramesPerPacket)
|
||||
static void audin_pulse_set_format(IAudinDevice* device, audinFormat* format, UINT32 FramesPerPacket)
|
||||
{
|
||||
int bs;
|
||||
pa_sample_spec sample_spec = { 0 };
|
||||
@@ -387,10 +387,10 @@ static void audin_pulse_open(IAudinDevice* device, AudinReceive receive, void* u
|
||||
audin_pulse_stream_state_callback, pulse);
|
||||
pa_stream_set_read_callback(pulse->stream,
|
||||
audin_pulse_stream_request_callback, pulse);
|
||||
buffer_attr.maxlength = (uint32_t) -1;
|
||||
buffer_attr.tlength = (uint32_t) -1;
|
||||
buffer_attr.prebuf = (uint32_t) -1;
|
||||
buffer_attr.minreq = (uint32_t) -1;
|
||||
buffer_attr.maxlength = (UINT32_t) -1;
|
||||
buffer_attr.tlength = (UINT32_t) -1;
|
||||
buffer_attr.prebuf = (UINT32_t) -1;
|
||||
buffer_attr.minreq = (UINT32_t) -1;
|
||||
/* 500ms latency */
|
||||
buffer_attr.fragsize = pa_usec_to_bytes(500000, &pulse->sample_spec);
|
||||
if (pa_stream_connect_record(pulse->stream,
|
||||
|
||||
@@ -69,17 +69,17 @@ static void audin_server_select_format(audin_server_context* context, int client
|
||||
static void audin_server_send_version(audin_server* audin, STREAM* s)
|
||||
{
|
||||
stream_write_BYTE(s, MSG_SNDIN_VERSION);
|
||||
stream_write_uint32(s, 1); /* Version (4 bytes) */
|
||||
stream_write_UINT32(s, 1); /* Version (4 bytes) */
|
||||
WTSVirtualChannelWrite(audin->audin_channel, stream_get_head(s), stream_get_length(s), NULL);
|
||||
}
|
||||
|
||||
static BOOL audin_server_recv_version(audin_server* audin, STREAM* s, uint32 length)
|
||||
static BOOL audin_server_recv_version(audin_server* audin, STREAM* s, UINT32 length)
|
||||
{
|
||||
uint32 Version;
|
||||
UINT32 Version;
|
||||
|
||||
if (length < 4)
|
||||
return FALSE;
|
||||
stream_read_uint32(s, Version);
|
||||
stream_read_UINT32(s, Version);
|
||||
if (Version < 1)
|
||||
return FALSE;
|
||||
|
||||
@@ -89,12 +89,12 @@ static BOOL audin_server_recv_version(audin_server* audin, STREAM* s, uint32 len
|
||||
static void audin_server_send_formats(audin_server* audin, STREAM* s)
|
||||
{
|
||||
int i;
|
||||
uint32 nAvgBytesPerSec;
|
||||
UINT32 nAvgBytesPerSec;
|
||||
|
||||
stream_set_pos(s, 0);
|
||||
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 */
|
||||
stream_write_UINT32(s, audin->context.num_server_formats); /* NumFormats (4 bytes) */
|
||||
stream_write_UINT32(s, 0); /* cbSizeFormatsPacket (4 bytes), client-to-server only */
|
||||
|
||||
for (i = 0; i < audin->context.num_server_formats; i++)
|
||||
{
|
||||
@@ -104,8 +104,8 @@ static void audin_server_send_formats(audin_server* audin, STREAM* s)
|
||||
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_uint32(s, audin->context.server_formats[i].nSamplesPerSec);
|
||||
stream_write_uint32(s, nAvgBytesPerSec);
|
||||
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);
|
||||
@@ -120,15 +120,15 @@ static void audin_server_send_formats(audin_server* audin, STREAM* s)
|
||||
WTSVirtualChannelWrite(audin->audin_channel, stream_get_head(s), stream_get_length(s), NULL);
|
||||
}
|
||||
|
||||
static BOOL audin_server_recv_formats(audin_server* audin, STREAM* s, uint32 length)
|
||||
static BOOL audin_server_recv_formats(audin_server* audin, STREAM* s, UINT32 length)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (length < 8)
|
||||
return FALSE;
|
||||
|
||||
stream_read_uint32(s, audin->context.num_client_formats); /* NumFormats (4 bytes) */
|
||||
stream_seek_uint32(s); /* cbSizeFormatsPacket (4 bytes) */
|
||||
stream_read_UINT32(s, audin->context.num_client_formats); /* NumFormats (4 bytes) */
|
||||
stream_seek_UINT32(s); /* cbSizeFormatsPacket (4 bytes) */
|
||||
length -= 8;
|
||||
|
||||
if (audin->context.num_client_formats <= 0)
|
||||
@@ -146,8 +146,8 @@ static BOOL audin_server_recv_formats(audin_server* audin, STREAM* s, uint32 len
|
||||
|
||||
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_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);
|
||||
@@ -171,8 +171,8 @@ static void audin_server_send_open(audin_server* audin, STREAM* s)
|
||||
|
||||
stream_set_pos(s, 0);
|
||||
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) */
|
||||
stream_write_UINT32(s, audin->context.frames_per_packet); /* FramesPerPacket (4 bytes) */
|
||||
stream_write_UINT32(s, audin->context.selected_client_format); /* initialFormat (4 bytes) */
|
||||
/*
|
||||
* [MS-RDPEAI] 3.2.5.1.6
|
||||
* The second format specify the format that SHOULD be used to capture data from
|
||||
@@ -180,8 +180,8 @@ static void audin_server_send_open(audin_server* audin, STREAM* s)
|
||||
*/
|
||||
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_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 */
|
||||
@@ -189,20 +189,20 @@ static void audin_server_send_open(audin_server* audin, STREAM* s)
|
||||
WTSVirtualChannelWrite(audin->audin_channel, stream_get_head(s), stream_get_length(s), NULL);
|
||||
}
|
||||
|
||||
static BOOL audin_server_recv_open_reply(audin_server* audin, STREAM* s, uint32 length)
|
||||
static BOOL audin_server_recv_open_reply(audin_server* audin, STREAM* s, UINT32 length)
|
||||
{
|
||||
uint32 Result;
|
||||
UINT32 Result;
|
||||
|
||||
if (length < 4)
|
||||
return FALSE;
|
||||
stream_read_uint32(s, Result);
|
||||
stream_read_UINT32(s, Result);
|
||||
|
||||
IFCALL(audin->context.OpenResult, &audin->context, Result);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL audin_server_recv_data(audin_server* audin, STREAM* s, uint32 length)
|
||||
static BOOL audin_server_recv_data(audin_server* audin, STREAM* s, UINT32 length)
|
||||
{
|
||||
rdpsndFormat* format;
|
||||
int sbytes_per_sample;
|
||||
@@ -267,7 +267,7 @@ static void* audin_server_thread_func(void* arg)
|
||||
void* buffer;
|
||||
BYTE MessageId;
|
||||
BOOL ready = FALSE;
|
||||
uint32 bytes_returned = 0;
|
||||
UINT32 bytes_returned = 0;
|
||||
audin_server* audin = (audin_server*) arg;
|
||||
freerdp_thread* thread = audin->audin_channel_thread;
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ void cliprdr_process_format_list_event(cliprdrPlugin* cliprdr, RDP_CB_FORMAT_LIS
|
||||
|
||||
stream_extend(body, stream_get_size(body) + 4 + name_length);
|
||||
|
||||
stream_write_uint32(body, cb_event->formats[i]);
|
||||
stream_write_UINT32(body, cb_event->formats[i]);
|
||||
stream_write(body, name, name_length);
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ static void cliprdr_send_format_list_response(cliprdrPlugin* cliprdr)
|
||||
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;
|
||||
@@ -137,7 +137,7 @@ void cliprdr_process_short_format_names(cliprdrPlugin* cliprdr, STREAM* s, uint3
|
||||
{
|
||||
format_name = &cliprdr->format_names[i];
|
||||
|
||||
stream_read_uint32(s, format_name->id);
|
||||
stream_read_UINT32(s, format_name->id);
|
||||
|
||||
if (ascii)
|
||||
{
|
||||
@@ -153,7 +153,7 @@ void cliprdr_process_short_format_names(cliprdrPlugin* cliprdr, STREAM* s, uint3
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
BYTE* end_mark;
|
||||
@@ -178,7 +178,7 @@ void cliprdr_process_long_format_names(cliprdrPlugin* cliprdr, STREAM* s, uint32
|
||||
}
|
||||
|
||||
format_name = &cliprdr->format_names[cliprdr->num_format_names++];
|
||||
stream_read_uint32(s, format_name->id);
|
||||
stream_read_UINT32(s, format_name->id);
|
||||
|
||||
format_name->name = NULL;
|
||||
format_name->length = 0;
|
||||
@@ -194,10 +194,10 @@ void cliprdr_process_long_format_names(cliprdrPlugin* cliprdr, STREAM* s, uint32
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
UINT32 format;
|
||||
BOOL supported;
|
||||
CLIPRDR_FORMAT_NAME* format_name;
|
||||
RDP_CB_FORMAT_LIST_EVENT* cb_event;
|
||||
@@ -218,7 +218,7 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataL
|
||||
cliprdr_process_short_format_names(cliprdr, s, dataLen, msgFlags);
|
||||
|
||||
if (cliprdr->num_format_names > 0)
|
||||
cb_event->formats = (uint32*) malloc(sizeof(uint32) * cliprdr->num_format_names);
|
||||
cb_event->formats = (UINT32*) malloc(sizeof(UINT32) * cliprdr->num_format_names);
|
||||
|
||||
cb_event->num_formats = 0;
|
||||
|
||||
@@ -286,7 +286,7 @@ void cliprdr_process_format_list(cliprdrPlugin* cliprdr, STREAM* s, uint32 dataL
|
||||
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
|
||||
@@ -300,14 +300,14 @@ void cliprdr_process_format_list_response(cliprdrPlugin* cliprdr, STREAM* s, uin
|
||||
#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;
|
||||
|
||||
cb_event = (RDP_CB_DATA_REQUEST_EVENT*) freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR,
|
||||
RDP_EVENT_TYPE_CB_DATA_REQUEST, NULL, NULL);
|
||||
|
||||
stream_read_uint32(s, cb_event->format);
|
||||
stream_read_UINT32(s, cb_event->format);
|
||||
svc_plugin_send_event((rdpSvcPlugin*) cliprdr, (RDP_EVENT*) cb_event);
|
||||
}
|
||||
|
||||
@@ -337,11 +337,11 @@ void cliprdr_process_format_data_request_event(cliprdrPlugin* cliprdr, RDP_CB_DA
|
||||
DEBUG_CLIPRDR("Sending Format Data Request");
|
||||
|
||||
s = cliprdr_packet_new(CB_FORMAT_DATA_REQUEST, 0, 4);
|
||||
stream_write_uint32(s, cb_event->format);
|
||||
stream_write_UINT32(s, cb_event->format);
|
||||
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;
|
||||
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
#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 */
|
||||
|
||||
@@ -55,7 +55,7 @@ static const char* const CB_MSG_TYPE_STRINGS[] =
|
||||
"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;
|
||||
|
||||
@@ -71,12 +71,12 @@ STREAM* cliprdr_packet_new(UINT16 msgType, UINT16 msgFlags, uint32 dataLen)
|
||||
void cliprdr_packet_send(cliprdrPlugin* cliprdr, STREAM* s)
|
||||
{
|
||||
int pos;
|
||||
uint32 dataLen;
|
||||
UINT32 dataLen;
|
||||
|
||||
pos = stream_get_pos(s);
|
||||
dataLen = pos - 8;
|
||||
stream_set_pos(s, 4);
|
||||
stream_write_uint32(s, dataLen);
|
||||
stream_write_UINT32(s, dataLen);
|
||||
stream_set_pos(s, pos);
|
||||
|
||||
svc_plugin_send((rdpSvcPlugin*) cliprdr, s);
|
||||
@@ -87,7 +87,7 @@ static void cliprdr_process_connect(rdpSvcPlugin* plugin)
|
||||
DEBUG_CLIPRDR("connecting");
|
||||
}
|
||||
|
||||
void cliprdr_print_general_capability_flags(uint32 flags)
|
||||
void cliprdr_print_general_capability_flags(UINT32 flags)
|
||||
{
|
||||
printf("generalFlags (0x%08X) {\n", flags);
|
||||
|
||||
@@ -105,11 +105,11 @@ void cliprdr_print_general_capability_flags(uint32 flags)
|
||||
|
||||
static void cliprdr_process_general_capability(cliprdrPlugin* cliprdr, STREAM* s)
|
||||
{
|
||||
uint32 version;
|
||||
uint32 generalFlags;
|
||||
UINT32 version;
|
||||
UINT32 generalFlags;
|
||||
|
||||
stream_read_uint32(s, version); /* version (4 bytes) */
|
||||
stream_read_uint32(s, generalFlags); /* generalFlags (4 bytes) */
|
||||
stream_read_UINT32(s, version); /* version (4 bytes) */
|
||||
stream_read_UINT32(s, generalFlags); /* generalFlags (4 bytes) */
|
||||
|
||||
DEBUG_CLIPRDR("Version: %d", version);
|
||||
|
||||
@@ -165,7 +165,7 @@ static void cliprdr_process_clip_caps(cliprdrPlugin* cliprdr, STREAM* s, UINT16
|
||||
static void cliprdr_send_clip_caps(cliprdrPlugin* cliprdr)
|
||||
{
|
||||
STREAM* s;
|
||||
uint32 flags;
|
||||
UINT32 flags;
|
||||
|
||||
s = cliprdr_packet_new(CB_CLIP_CAPS, 0, 4 + CB_CAPSTYPE_GENERAL_LEN);
|
||||
|
||||
@@ -177,8 +177,8 @@ static void cliprdr_send_clip_caps(cliprdrPlugin* cliprdr)
|
||||
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 */
|
||||
stream_write_UINT32(s, CB_CAPS_VERSION_2); /* version */
|
||||
stream_write_UINT32(s, flags); /* generalFlags */
|
||||
|
||||
cliprdr_packet_send(cliprdr, s);
|
||||
}
|
||||
@@ -198,12 +198,12 @@ static void cliprdr_process_receive(rdpSvcPlugin* plugin, STREAM* s)
|
||||
{
|
||||
UINT16 msgType;
|
||||
UINT16 msgFlags;
|
||||
uint32 dataLen;
|
||||
UINT32 dataLen;
|
||||
cliprdrPlugin* cliprdr = (cliprdrPlugin*) plugin;
|
||||
|
||||
stream_read_UINT16(s, msgType);
|
||||
stream_read_UINT16(s, msgFlags);
|
||||
stream_read_uint32(s, dataLen);
|
||||
stream_read_UINT32(s, dataLen);
|
||||
|
||||
DEBUG_CLIPRDR("msgType: %s (%d), msgFlags: %d dataLen: %d",
|
||||
CB_MSG_TYPE_STRINGS[msgType], msgType, msgFlags, dataLen);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
struct _CLIPRDR_FORMAT_NAME
|
||||
{
|
||||
uint32 id;
|
||||
UINT32 id;
|
||||
char* name;
|
||||
int length;
|
||||
};
|
||||
@@ -45,7 +45,7 @@ struct cliprdr_plugin
|
||||
};
|
||||
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
|
||||
|
||||
@@ -200,7 +200,7 @@ static void disk_file_set_fullpath(DISK_FILE* file, char* fullpath)
|
||||
file->filename += 1;
|
||||
}
|
||||
|
||||
static BOOL disk_file_init(DISK_FILE* file, uint32 DesiredAccess, uint32 CreateDisposition, uint32 CreateOptions)
|
||||
static BOOL disk_file_init(DISK_FILE* file, UINT32 DesiredAccess, UINT32 CreateDisposition, UINT32 CreateOptions)
|
||||
{
|
||||
struct STAT st;
|
||||
BOOL exists;
|
||||
@@ -306,8 +306,8 @@ static BOOL disk_file_init(DISK_FILE* file, uint32 DesiredAccess, uint32 CreateD
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
DISK_FILE* disk_file_new(const char* base_path, const char* path, uint32 id,
|
||||
uint32 DesiredAccess, uint32 CreateDisposition, uint32 CreateOptions)
|
||||
DISK_FILE* disk_file_new(const char* base_path, const char* path, UINT32 id,
|
||||
UINT32 DesiredAccess, UINT32 CreateDisposition, UINT32 CreateOptions)
|
||||
{
|
||||
DISK_FILE* file;
|
||||
|
||||
@@ -346,7 +346,7 @@ void disk_file_free(DISK_FILE* file)
|
||||
free(file);
|
||||
}
|
||||
|
||||
BOOL disk_file_seek(DISK_FILE* file, uint64 Offset)
|
||||
BOOL disk_file_seek(DISK_FILE* file, UINT64 Offset)
|
||||
{
|
||||
if (file->is_dir || file->fd == -1)
|
||||
return FALSE;
|
||||
@@ -357,7 +357,7 @@ BOOL disk_file_seek(DISK_FILE* file, uint64 Offset)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL disk_file_read(DISK_FILE* file, BYTE* buffer, uint32* Length)
|
||||
BOOL disk_file_read(DISK_FILE* file, BYTE* buffer, UINT32* Length)
|
||||
{
|
||||
ssize_t r;
|
||||
|
||||
@@ -367,12 +367,12 @@ BOOL disk_file_read(DISK_FILE* file, BYTE* buffer, uint32* Length)
|
||||
r = read(file->fd, buffer, *Length);
|
||||
if (r < 0)
|
||||
return FALSE;
|
||||
*Length = (uint32)r;
|
||||
*Length = (UINT32)r;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL disk_file_write(DISK_FILE* file, BYTE* buffer, uint32 Length)
|
||||
BOOL disk_file_write(DISK_FILE* file, BYTE* buffer, UINT32 Length)
|
||||
{
|
||||
ssize_t r;
|
||||
|
||||
@@ -391,36 +391,36 @@ BOOL disk_file_write(DISK_FILE* file, BYTE* buffer, uint32 Length)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL disk_file_query_information(DISK_FILE* file, uint32 FsInformationClass, STREAM* output)
|
||||
BOOL disk_file_query_information(DISK_FILE* file, UINT32 FsInformationClass, STREAM* output)
|
||||
{
|
||||
struct STAT st;
|
||||
|
||||
if (STAT(file->fullpath, &st) != 0)
|
||||
{
|
||||
stream_write_uint32(output, 0); /* Length */
|
||||
stream_write_UINT32(output, 0); /* Length */
|
||||
return FALSE;
|
||||
}
|
||||
switch (FsInformationClass)
|
||||
{
|
||||
case FileBasicInformation:
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232094.aspx */
|
||||
stream_write_uint32(output, 36); /* Length */
|
||||
stream_write_UINT32(output, 36); /* Length */
|
||||
stream_check_size(output, 36);
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* CreationTime */
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_atime)); /* LastAccessTime */
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* LastWriteTime */
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_ctime)); /* ChangeTime */
|
||||
stream_write_uint32(output, FILE_ATTR_SYSTEM_TO_RDP(file, st)); /* FileAttributes */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* CreationTime */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_atime)); /* LastAccessTime */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* LastWriteTime */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_ctime)); /* ChangeTime */
|
||||
stream_write_UINT32(output, FILE_ATTR_SYSTEM_TO_RDP(file, st)); /* FileAttributes */
|
||||
/* Reserved(4), MUST NOT be added! */
|
||||
break;
|
||||
|
||||
case FileStandardInformation:
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232088.aspx */
|
||||
stream_write_uint32(output, 22); /* Length */
|
||||
stream_write_UINT32(output, 22); /* Length */
|
||||
stream_check_size(output, 22);
|
||||
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_UINT64(output, st.st_size); /* AllocationSize */
|
||||
stream_write_UINT64(output, st.st_size); /* EndOfFile */
|
||||
stream_write_UINT32(output, st.st_nlink); /* NumberOfLinks */
|
||||
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! */
|
||||
@@ -428,42 +428,42 @@ BOOL disk_file_query_information(DISK_FILE* file, uint32 FsInformationClass, STR
|
||||
|
||||
case FileAttributeTagInformation:
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232093.aspx */
|
||||
stream_write_uint32(output, 8); /* Length */
|
||||
stream_write_UINT32(output, 8); /* Length */
|
||||
stream_check_size(output, 8);
|
||||
stream_write_uint32(output, FILE_ATTR_SYSTEM_TO_RDP(file, st)); /* FileAttributes */
|
||||
stream_write_uint32(output, 0); /* ReparseTag */
|
||||
stream_write_UINT32(output, FILE_ATTR_SYSTEM_TO_RDP(file, st)); /* FileAttributes */
|
||||
stream_write_UINT32(output, 0); /* ReparseTag */
|
||||
break;
|
||||
|
||||
default:
|
||||
stream_write_uint32(output, 0); /* Length */
|
||||
stream_write_UINT32(output, 0); /* Length */
|
||||
DEBUG_WARN("invalid FsInformationClass %d", FsInformationClass);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL disk_file_set_information(DISK_FILE* file, uint32 FsInformationClass, uint32 Length, STREAM* input)
|
||||
BOOL disk_file_set_information(DISK_FILE* file, UINT32 FsInformationClass, UINT32 Length, STREAM* input)
|
||||
{
|
||||
char* s;
|
||||
|
||||
mode_t m;
|
||||
uint64 size;
|
||||
UINT64 size;
|
||||
char* fullpath;
|
||||
struct STAT st;
|
||||
struct timeval tv[2];
|
||||
uint64 LastWriteTime;
|
||||
uint32 FileAttributes;
|
||||
uint32 FileNameLength;
|
||||
UINT64 LastWriteTime;
|
||||
UINT32 FileAttributes;
|
||||
UINT32 FileNameLength;
|
||||
|
||||
switch (FsInformationClass)
|
||||
{
|
||||
case FileBasicInformation:
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232094.aspx */
|
||||
stream_seek_uint64(input); /* CreationTime */
|
||||
stream_seek_uint64(input); /* LastAccessTime */
|
||||
stream_read_uint64(input, LastWriteTime);
|
||||
stream_seek_uint64(input); /* ChangeTime */
|
||||
stream_read_uint32(input, FileAttributes);
|
||||
stream_seek_UINT64(input); /* CreationTime */
|
||||
stream_seek_UINT64(input); /* LastAccessTime */
|
||||
stream_read_UINT64(input, LastWriteTime);
|
||||
stream_seek_UINT64(input); /* ChangeTime */
|
||||
stream_read_UINT32(input, FileAttributes);
|
||||
|
||||
if (FSTAT(file->fd, &st) != 0)
|
||||
return FALSE;
|
||||
@@ -493,7 +493,7 @@ BOOL disk_file_set_information(DISK_FILE* file, uint32 FsInformationClass, uint3
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232067.aspx */
|
||||
case FileAllocationInformation:
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232076.aspx */
|
||||
stream_read_uint64(input, size);
|
||||
stream_read_UINT64(input, size);
|
||||
if (ftruncate(file->fd, size) != 0)
|
||||
return FALSE;
|
||||
break;
|
||||
@@ -511,7 +511,7 @@ BOOL disk_file_set_information(DISK_FILE* file, uint32 FsInformationClass, uint3
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232085.aspx */
|
||||
stream_seek_BYTE(input); /* ReplaceIfExists */
|
||||
stream_seek_BYTE(input); /* RootDirectory */
|
||||
stream_read_uint32(input, FileNameLength);
|
||||
stream_read_UINT32(input, FileNameLength);
|
||||
|
||||
freerdp_UnicodeToAsciiAlloc((WCHAR*) stream_get_tail(input), &s, FileNameLength / 2);
|
||||
|
||||
@@ -541,7 +541,7 @@ BOOL disk_file_set_information(DISK_FILE* file, uint32 FsInformationClass, uint3
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL disk_file_query_directory(DISK_FILE* file, uint32 FsInformationClass, BYTE InitialQuery,
|
||||
BOOL disk_file_query_directory(DISK_FILE* file, UINT32 FsInformationClass, BYTE InitialQuery,
|
||||
const char* path, STREAM* output)
|
||||
{
|
||||
int length;
|
||||
@@ -554,7 +554,7 @@ BOOL disk_file_query_directory(DISK_FILE* file, uint32 FsInformationClass, BYTE
|
||||
|
||||
if (!file->dir)
|
||||
{
|
||||
stream_write_uint32(output, 0); /* Length */
|
||||
stream_write_UINT32(output, 0); /* Length */
|
||||
stream_write_BYTE(output, 0); /* Padding */
|
||||
return FALSE;
|
||||
}
|
||||
@@ -591,7 +591,7 @@ BOOL disk_file_query_directory(DISK_FILE* file, uint32 FsInformationClass, BYTE
|
||||
if (ent == NULL)
|
||||
{
|
||||
DEBUG_SVC(" pattern %s not found.", file->pattern);
|
||||
stream_write_uint32(output, 0); /* Length */
|
||||
stream_write_UINT32(output, 0); /* Length */
|
||||
stream_write_BYTE(output, 0); /* Padding */
|
||||
return FALSE;
|
||||
}
|
||||
@@ -616,54 +616,54 @@ BOOL disk_file_query_directory(DISK_FILE* file, uint32 FsInformationClass, BYTE
|
||||
{
|
||||
case FileDirectoryInformation:
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232097.aspx */
|
||||
stream_write_uint32(output, 64 + length); /* Length */
|
||||
stream_write_UINT32(output, 64 + length); /* Length */
|
||||
stream_check_size(output, 64 + length);
|
||||
stream_write_uint32(output, 0); /* NextEntryOffset */
|
||||
stream_write_uint32(output, 0); /* FileIndex */
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* CreationTime */
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_atime)); /* LastAccessTime */
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* LastWriteTime */
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_ctime)); /* ChangeTime */
|
||||
stream_write_uint64(output, st.st_size); /* EndOfFile */
|
||||
stream_write_uint64(output, st.st_size); /* AllocationSize */
|
||||
stream_write_uint32(output, FILE_ATTR_SYSTEM_TO_RDP(file, st)); /* FileAttributes */
|
||||
stream_write_uint32(output, length); /* FileNameLength */
|
||||
stream_write_UINT32(output, 0); /* NextEntryOffset */
|
||||
stream_write_UINT32(output, 0); /* FileIndex */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* CreationTime */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_atime)); /* LastAccessTime */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* LastWriteTime */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_ctime)); /* ChangeTime */
|
||||
stream_write_UINT64(output, st.st_size); /* EndOfFile */
|
||||
stream_write_UINT64(output, st.st_size); /* AllocationSize */
|
||||
stream_write_UINT32(output, FILE_ATTR_SYSTEM_TO_RDP(file, st)); /* FileAttributes */
|
||||
stream_write_UINT32(output, length); /* FileNameLength */
|
||||
stream_write(output, ent_path, length);
|
||||
break;
|
||||
|
||||
case FileFullDirectoryInformation:
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232068.aspx */
|
||||
stream_write_uint32(output, 68 + length); /* Length */
|
||||
stream_write_UINT32(output, 68 + length); /* Length */
|
||||
stream_check_size(output, 68 + length);
|
||||
stream_write_uint32(output, 0); /* NextEntryOffset */
|
||||
stream_write_uint32(output, 0); /* FileIndex */
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* CreationTime */
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_atime)); /* LastAccessTime */
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* LastWriteTime */
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_ctime)); /* ChangeTime */
|
||||
stream_write_uint64(output, st.st_size); /* EndOfFile */
|
||||
stream_write_uint64(output, st.st_size); /* AllocationSize */
|
||||
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_UINT32(output, 0); /* NextEntryOffset */
|
||||
stream_write_UINT32(output, 0); /* FileIndex */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* CreationTime */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_atime)); /* LastAccessTime */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* LastWriteTime */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_ctime)); /* ChangeTime */
|
||||
stream_write_UINT64(output, st.st_size); /* EndOfFile */
|
||||
stream_write_UINT64(output, st.st_size); /* AllocationSize */
|
||||
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(output, ent_path, length);
|
||||
break;
|
||||
|
||||
case FileBothDirectoryInformation:
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232095.aspx */
|
||||
stream_write_uint32(output, 93 + length); /* Length */
|
||||
stream_write_UINT32(output, 93 + length); /* Length */
|
||||
stream_check_size(output, 93 + length);
|
||||
stream_write_uint32(output, 0); /* NextEntryOffset */
|
||||
stream_write_uint32(output, 0); /* FileIndex */
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* CreationTime */
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_atime)); /* LastAccessTime */
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* LastWriteTime */
|
||||
stream_write_uint64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_ctime)); /* ChangeTime */
|
||||
stream_write_uint64(output, st.st_size); /* EndOfFile */
|
||||
stream_write_uint64(output, st.st_size); /* AllocationSize */
|
||||
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_UINT32(output, 0); /* NextEntryOffset */
|
||||
stream_write_UINT32(output, 0); /* FileIndex */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* CreationTime */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_atime)); /* LastAccessTime */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_mtime)); /* LastWriteTime */
|
||||
stream_write_UINT64(output, FILE_TIME_SYSTEM_TO_RDP(st.st_ctime)); /* ChangeTime */
|
||||
stream_write_UINT64(output, st.st_size); /* EndOfFile */
|
||||
stream_write_UINT64(output, st.st_size); /* AllocationSize */
|
||||
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_BYTE(output, 0); /* ShortNameLength */
|
||||
/* Reserved(1), MUST NOT be added! */
|
||||
stream_write_zero(output, 24); /* ShortName */
|
||||
@@ -672,16 +672,16 @@ BOOL disk_file_query_directory(DISK_FILE* file, uint32 FsInformationClass, BYTE
|
||||
|
||||
case FileNamesInformation:
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232077.aspx */
|
||||
stream_write_uint32(output, 12 + length); /* Length */
|
||||
stream_write_UINT32(output, 12 + length); /* Length */
|
||||
stream_check_size(output, 12 + length);
|
||||
stream_write_uint32(output, 0); /* NextEntryOffset */
|
||||
stream_write_uint32(output, 0); /* FileIndex */
|
||||
stream_write_uint32(output, length); /* FileNameLength */
|
||||
stream_write_UINT32(output, 0); /* NextEntryOffset */
|
||||
stream_write_UINT32(output, 0); /* FileIndex */
|
||||
stream_write_UINT32(output, length); /* FileNameLength */
|
||||
stream_write(output, ent_path, length);
|
||||
break;
|
||||
|
||||
default:
|
||||
stream_write_uint32(output, 0); /* Length */
|
||||
stream_write_UINT32(output, 0); /* Length */
|
||||
stream_write_BYTE(output, 0); /* Padding */
|
||||
DEBUG_WARN("invalid FsInformationClass %d", FsInformationClass);
|
||||
ret = FALSE;
|
||||
|
||||
@@ -49,8 +49,8 @@
|
||||
#define unlink(a) _unlink(a)
|
||||
#define ftruncate(a,b) _chsize(a,b)
|
||||
|
||||
typedef uint32 ssize_t ;
|
||||
typedef uint32 mode_t ;
|
||||
typedef UINT32 ssize_t ;
|
||||
typedef UINT32 mode_t ;
|
||||
|
||||
#elif defined(__APPLE__) || defined(__FreeBSD__)
|
||||
#define STAT stat
|
||||
@@ -70,9 +70,9 @@ typedef uint32 mode_t ;
|
||||
#define EPOCH_DIFF 11644473600LL
|
||||
|
||||
#define FILE_TIME_SYSTEM_TO_RDP(_t) \
|
||||
(((uint64)(_t) + EPOCH_DIFF) * 10000000LL)
|
||||
(((UINT64)(_t) + EPOCH_DIFF) * 10000000LL)
|
||||
#define FILE_TIME_RDP_TO_SYSTEM(_t) \
|
||||
(((_t) == 0LL || (_t) == (uint64)(-1LL)) ? 0 : (time_t)((_t) / 10000000LL - EPOCH_DIFF))
|
||||
(((_t) == 0LL || (_t) == (UINT64)(-1LL)) ? 0 : (time_t)((_t) / 10000000LL - EPOCH_DIFF))
|
||||
|
||||
#define FILE_ATTR_SYSTEM_TO_RDP(_f, _st) ( \
|
||||
(S_ISDIR(_st.st_mode) ? FILE_ATTRIBUTE_DIRECTORY : 0) | \
|
||||
@@ -83,7 +83,7 @@ typedef uint32 mode_t ;
|
||||
typedef struct _DISK_FILE DISK_FILE;
|
||||
struct _DISK_FILE
|
||||
{
|
||||
uint32 id;
|
||||
UINT32 id;
|
||||
BOOL is_dir;
|
||||
int fd;
|
||||
int err;
|
||||
@@ -95,16 +95,16 @@ struct _DISK_FILE
|
||||
BOOL delete_pending;
|
||||
};
|
||||
|
||||
DISK_FILE* disk_file_new(const char* base_path, const char* path, uint32 id,
|
||||
uint32 DesiredAccess, uint32 CreateDisposition, uint32 CreateOptions);
|
||||
DISK_FILE* disk_file_new(const char* base_path, const char* path, UINT32 id,
|
||||
UINT32 DesiredAccess, UINT32 CreateDisposition, UINT32 CreateOptions);
|
||||
void disk_file_free(DISK_FILE* file);
|
||||
|
||||
BOOL disk_file_seek(DISK_FILE* file, uint64 Offset);
|
||||
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, BYTE InitialQuery,
|
||||
BOOL disk_file_seek(DISK_FILE* file, UINT64 Offset);
|
||||
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, BYTE InitialQuery,
|
||||
const char* path, STREAM* output);
|
||||
|
||||
#endif /* __DISK_FILE_H */
|
||||
|
||||
@@ -66,9 +66,9 @@ struct _DISK_DEVICE
|
||||
DEVMAN* devman;
|
||||
};
|
||||
|
||||
static uint32 disk_map_posix_err(int fs_errno)
|
||||
static UINT32 disk_map_posix_err(int fs_errno)
|
||||
{
|
||||
uint32 rc;
|
||||
UINT32 rc;
|
||||
|
||||
/* try to return NTSTATUS version of error code */
|
||||
|
||||
@@ -101,7 +101,7 @@ static uint32 disk_map_posix_err(int fs_errno)
|
||||
return rc;
|
||||
}
|
||||
|
||||
static DISK_FILE* disk_get_file_by_id(DISK_DEVICE* disk, uint32 id)
|
||||
static DISK_FILE* disk_get_file_by_id(DISK_DEVICE* disk, UINT32 id)
|
||||
{
|
||||
LIST_ITEM* item;
|
||||
DISK_FILE* file;
|
||||
@@ -120,19 +120,19 @@ static DISK_FILE* disk_get_file_by_id(DISK_DEVICE* disk, uint32 id)
|
||||
static void disk_process_irp_create(DISK_DEVICE* disk, IRP* irp)
|
||||
{
|
||||
char* path;
|
||||
uint32 FileId;
|
||||
UINT32 FileId;
|
||||
DISK_FILE* file;
|
||||
BYTE Information;
|
||||
uint32 DesiredAccess;
|
||||
uint32 CreateDisposition;
|
||||
uint32 CreateOptions;
|
||||
uint32 PathLength;
|
||||
UINT32 DesiredAccess;
|
||||
UINT32 CreateDisposition;
|
||||
UINT32 CreateOptions;
|
||||
UINT32 PathLength;
|
||||
|
||||
stream_read_uint32(irp->input, DesiredAccess);
|
||||
stream_read_UINT32(irp->input, DesiredAccess);
|
||||
stream_seek(irp->input, 16); /* AllocationSize(8), FileAttributes(4), SharedAccess(4) */
|
||||
stream_read_uint32(irp->input, CreateDisposition);
|
||||
stream_read_uint32(irp->input, CreateOptions);
|
||||
stream_read_uint32(irp->input, PathLength);
|
||||
stream_read_UINT32(irp->input, CreateDisposition);
|
||||
stream_read_UINT32(irp->input, CreateOptions);
|
||||
stream_read_UINT32(irp->input, PathLength);
|
||||
|
||||
freerdp_UnicodeToAsciiAlloc((WCHAR*) stream_get_tail(irp->input), &path, PathLength / 2);
|
||||
|
||||
@@ -183,7 +183,7 @@ static void disk_process_irp_create(DISK_DEVICE* disk, IRP* irp)
|
||||
DEBUG_SVC("%s(%d) created.", file->fullpath, file->id);
|
||||
}
|
||||
|
||||
stream_write_uint32(irp->output, FileId);
|
||||
stream_write_UINT32(irp->output, FileId);
|
||||
stream_write_BYTE(irp->output, Information);
|
||||
|
||||
free(path);
|
||||
@@ -219,12 +219,12 @@ static void disk_process_irp_close(DISK_DEVICE* disk, IRP* irp)
|
||||
static void disk_process_irp_read(DISK_DEVICE* disk, IRP* irp)
|
||||
{
|
||||
DISK_FILE* file;
|
||||
uint32 Length;
|
||||
uint64 Offset;
|
||||
UINT32 Length;
|
||||
UINT64 Offset;
|
||||
BYTE* buffer = NULL;
|
||||
|
||||
stream_read_uint32(irp->input, Length);
|
||||
stream_read_uint64(irp->input, Offset);
|
||||
stream_read_UINT32(irp->input, Length);
|
||||
stream_read_UINT64(irp->input, Offset);
|
||||
|
||||
file = disk_get_file_by_id(disk, irp->FileId);
|
||||
|
||||
@@ -260,7 +260,7 @@ static void disk_process_irp_read(DISK_DEVICE* disk, IRP* irp)
|
||||
}
|
||||
}
|
||||
|
||||
stream_write_uint32(irp->output, Length);
|
||||
stream_write_UINT32(irp->output, Length);
|
||||
|
||||
if (Length > 0)
|
||||
{
|
||||
@@ -276,11 +276,11 @@ static void disk_process_irp_read(DISK_DEVICE* disk, IRP* irp)
|
||||
static void disk_process_irp_write(DISK_DEVICE* disk, IRP* irp)
|
||||
{
|
||||
DISK_FILE* file;
|
||||
uint32 Length;
|
||||
uint64 Offset;
|
||||
UINT32 Length;
|
||||
UINT64 Offset;
|
||||
|
||||
stream_read_uint32(irp->input, Length);
|
||||
stream_read_uint64(irp->input, Offset);
|
||||
stream_read_UINT32(irp->input, Length);
|
||||
stream_read_UINT64(irp->input, Offset);
|
||||
stream_seek(irp->input, 20); /* Padding */
|
||||
|
||||
file = disk_get_file_by_id(disk, irp->FileId);
|
||||
@@ -311,7 +311,7 @@ static void disk_process_irp_write(DISK_DEVICE* disk, IRP* irp)
|
||||
DEBUG_SVC("write %llu-%llu to %s(%d).", Offset, Offset + Length, file->fullpath, file->id);
|
||||
}
|
||||
|
||||
stream_write_uint32(irp->output, Length);
|
||||
stream_write_UINT32(irp->output, Length);
|
||||
stream_write_BYTE(irp->output, 0); /* Padding */
|
||||
|
||||
irp->Complete(irp);
|
||||
@@ -320,9 +320,9 @@ static void disk_process_irp_write(DISK_DEVICE* disk, IRP* irp)
|
||||
static void disk_process_irp_query_information(DISK_DEVICE* disk, IRP* irp)
|
||||
{
|
||||
DISK_FILE* file;
|
||||
uint32 FsInformationClass;
|
||||
UINT32 FsInformationClass;
|
||||
|
||||
stream_read_uint32(irp->input, FsInformationClass);
|
||||
stream_read_UINT32(irp->input, FsInformationClass);
|
||||
|
||||
file = disk_get_file_by_id(disk, irp->FileId);
|
||||
|
||||
@@ -349,11 +349,11 @@ static void disk_process_irp_query_information(DISK_DEVICE* disk, IRP* irp)
|
||||
static void disk_process_irp_set_information(DISK_DEVICE* disk, IRP* irp)
|
||||
{
|
||||
DISK_FILE* file;
|
||||
uint32 FsInformationClass;
|
||||
uint32 Length;
|
||||
UINT32 FsInformationClass;
|
||||
UINT32 Length;
|
||||
|
||||
stream_read_uint32(irp->input, FsInformationClass);
|
||||
stream_read_uint32(irp->input, Length);
|
||||
stream_read_UINT32(irp->input, FsInformationClass);
|
||||
stream_read_UINT32(irp->input, Length);
|
||||
stream_seek(irp->input, 24); /* Padding */
|
||||
|
||||
file = disk_get_file_by_id(disk, irp->FileId);
|
||||
@@ -375,14 +375,14 @@ static void disk_process_irp_set_information(DISK_DEVICE* disk, IRP* irp)
|
||||
DEBUG_SVC("FsInformationClass %d on %s(%d) ok.", FsInformationClass, file->fullpath, file->id);
|
||||
}
|
||||
|
||||
stream_write_uint32(irp->output, Length);
|
||||
stream_write_UINT32(irp->output, Length);
|
||||
|
||||
irp->Complete(irp);
|
||||
}
|
||||
|
||||
static void disk_process_irp_query_volume_information(DISK_DEVICE* disk, IRP* irp)
|
||||
{
|
||||
uint32 FsInformationClass;
|
||||
UINT32 FsInformationClass;
|
||||
STREAM* output = irp->output;
|
||||
struct STATVFS svfst;
|
||||
struct STAT st;
|
||||
@@ -391,7 +391,7 @@ static void disk_process_irp_query_volume_information(DISK_DEVICE* disk, IRP* ir
|
||||
WCHAR* outStr;
|
||||
int length;
|
||||
|
||||
stream_read_uint32(irp->input, FsInformationClass);
|
||||
stream_read_UINT32(irp->input, FsInformationClass);
|
||||
|
||||
STATVFS(disk->path, &svfst);
|
||||
STAT(disk->path, &st);
|
||||
@@ -401,11 +401,11 @@ static void disk_process_irp_query_volume_information(DISK_DEVICE* disk, IRP* ir
|
||||
case FileFsVolumeInformation:
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232108.aspx */
|
||||
length = freerdp_AsciiToUnicodeAlloc(volumeLabel, &outStr, 0) * 2;
|
||||
stream_write_uint32(output, 17 + length); /* Length */
|
||||
stream_write_UINT32(output, 17 + length); /* Length */
|
||||
stream_check_size(output, 17 + length);
|
||||
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_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_BYTE(output, 0); /* SupportsObjects */
|
||||
/* Reserved(1), MUST NOT be added! */
|
||||
stream_write(output, outStr, length); /* VolumeLabel (Unicode) */
|
||||
@@ -414,51 +414,51 @@ static void disk_process_irp_query_volume_information(DISK_DEVICE* disk, IRP* ir
|
||||
|
||||
case FileFsSizeInformation:
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232107.aspx */
|
||||
stream_write_uint32(output, 24); /* Length */
|
||||
stream_write_UINT32(output, 24); /* Length */
|
||||
stream_check_size(output, 24);
|
||||
stream_write_uint64(output, svfst.f_blocks); /* TotalAllocationUnits */
|
||||
stream_write_uint64(output, svfst.f_bavail); /* AvailableAllocationUnits */
|
||||
stream_write_uint32(output, 1); /* SectorsPerAllocationUnit */
|
||||
stream_write_uint32(output, svfst.f_bsize); /* BytesPerSector */
|
||||
stream_write_UINT64(output, svfst.f_blocks); /* TotalAllocationUnits */
|
||||
stream_write_UINT64(output, svfst.f_bavail); /* AvailableAllocationUnits */
|
||||
stream_write_UINT32(output, 1); /* SectorsPerAllocationUnit */
|
||||
stream_write_UINT32(output, svfst.f_bsize); /* BytesPerSector */
|
||||
break;
|
||||
|
||||
case FileFsAttributeInformation:
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232101.aspx */
|
||||
length = freerdp_AsciiToUnicodeAlloc(diskType, &outStr, 0) * 2;
|
||||
stream_write_uint32(output, 12 + length); /* Length */
|
||||
stream_write_UINT32(output, 12 + length); /* Length */
|
||||
stream_check_size(output, 12 + length);
|
||||
stream_write_uint32(output,
|
||||
stream_write_UINT32(output,
|
||||
FILE_CASE_SENSITIVE_SEARCH |
|
||||
FILE_CASE_PRESERVED_NAMES |
|
||||
FILE_UNICODE_ON_DISK); /* FileSystemAttributes */
|
||||
stream_write_uint32(output, svfst.f_namemax/*510*/); /* MaximumComponentNameLength */
|
||||
stream_write_uint32(output, length); /* FileSystemNameLength */
|
||||
stream_write_UINT32(output, svfst.f_namemax/*510*/); /* MaximumComponentNameLength */
|
||||
stream_write_UINT32(output, length); /* FileSystemNameLength */
|
||||
stream_write(output, outStr, length); /* FileSystemName (Unicode) */
|
||||
free(outStr);
|
||||
break;
|
||||
|
||||
case FileFsFullSizeInformation:
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232104.aspx */
|
||||
stream_write_uint32(output, 32); /* Length */
|
||||
stream_write_UINT32(output, 32); /* Length */
|
||||
stream_check_size(output, 32);
|
||||
stream_write_uint64(output, svfst.f_blocks); /* TotalAllocationUnits */
|
||||
stream_write_uint64(output, svfst.f_bavail); /* CallerAvailableAllocationUnits */
|
||||
stream_write_uint64(output, svfst.f_bfree); /* AvailableAllocationUnits */
|
||||
stream_write_uint32(output, 1); /* SectorsPerAllocationUnit */
|
||||
stream_write_uint32(output, svfst.f_bsize); /* BytesPerSector */
|
||||
stream_write_UINT64(output, svfst.f_blocks); /* TotalAllocationUnits */
|
||||
stream_write_UINT64(output, svfst.f_bavail); /* CallerAvailableAllocationUnits */
|
||||
stream_write_UINT64(output, svfst.f_bfree); /* AvailableAllocationUnits */
|
||||
stream_write_UINT32(output, 1); /* SectorsPerAllocationUnit */
|
||||
stream_write_UINT32(output, svfst.f_bsize); /* BytesPerSector */
|
||||
break;
|
||||
|
||||
case FileFsDeviceInformation:
|
||||
/* http://msdn.microsoft.com/en-us/library/cc232109.aspx */
|
||||
stream_write_uint32(output, 8); /* Length */
|
||||
stream_write_UINT32(output, 8); /* Length */
|
||||
stream_check_size(output, 8);
|
||||
stream_write_uint32(output, FILE_DEVICE_DISK); /* DeviceType */
|
||||
stream_write_uint32(output, 0); /* Characteristics */
|
||||
stream_write_UINT32(output, FILE_DEVICE_DISK); /* DeviceType */
|
||||
stream_write_UINT32(output, 0); /* Characteristics */
|
||||
break;
|
||||
|
||||
default:
|
||||
irp->IoStatus = STATUS_UNSUCCESSFUL;
|
||||
stream_write_uint32(output, 0); /* Length */
|
||||
stream_write_UINT32(output, 0); /* Length */
|
||||
DEBUG_WARN("invalid FsInformationClass %d", FsInformationClass);
|
||||
break;
|
||||
}
|
||||
@@ -471,12 +471,12 @@ static void disk_process_irp_query_directory(DISK_DEVICE* disk, IRP* irp)
|
||||
char* path;
|
||||
DISK_FILE* file;
|
||||
BYTE InitialQuery;
|
||||
uint32 PathLength;
|
||||
uint32 FsInformationClass;
|
||||
UINT32 PathLength;
|
||||
UINT32 FsInformationClass;
|
||||
|
||||
stream_read_uint32(irp->input, FsInformationClass);
|
||||
stream_read_UINT32(irp->input, FsInformationClass);
|
||||
stream_read_BYTE(irp->input, InitialQuery);
|
||||
stream_read_uint32(irp->input, PathLength);
|
||||
stream_read_UINT32(irp->input, PathLength);
|
||||
stream_seek(irp->input, 23); /* Padding */
|
||||
|
||||
freerdp_UnicodeToAsciiAlloc((WCHAR*) stream_get_tail(irp->input), &path, PathLength / 2);
|
||||
@@ -486,7 +486,7 @@ static void disk_process_irp_query_directory(DISK_DEVICE* disk, IRP* irp)
|
||||
if (file == NULL)
|
||||
{
|
||||
irp->IoStatus = STATUS_UNSUCCESSFUL;
|
||||
stream_write_uint32(irp->output, 0); /* Length */
|
||||
stream_write_UINT32(irp->output, 0); /* Length */
|
||||
DEBUG_WARN("FileId %d not valid.", irp->FileId);
|
||||
}
|
||||
else if (!disk_file_query_directory(file, FsInformationClass, InitialQuery, path, irp->output))
|
||||
@@ -514,7 +514,7 @@ static void disk_process_irp_directory_control(DISK_DEVICE* disk, IRP* irp)
|
||||
default:
|
||||
DEBUG_WARN("MinorFunction 0x%X not supported", irp->MinorFunction);
|
||||
irp->IoStatus = STATUS_NOT_SUPPORTED;
|
||||
stream_write_uint32(irp->output, 0); /* Length */
|
||||
stream_write_UINT32(irp->output, 0); /* Length */
|
||||
irp->Complete(irp);
|
||||
break;
|
||||
}
|
||||
@@ -522,7 +522,7 @@ static void disk_process_irp_directory_control(DISK_DEVICE* disk, IRP* irp)
|
||||
|
||||
static void disk_process_irp_device_control(DISK_DEVICE* disk, IRP* irp)
|
||||
{
|
||||
stream_write_uint32(irp->output, 0); /* OutputBufferLength */
|
||||
stream_write_UINT32(irp->output, 0); /* OutputBufferLength */
|
||||
irp->Complete(irp);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ struct drdynvc_plugin
|
||||
IWTSVirtualChannelManager* channel_mgr;
|
||||
};
|
||||
|
||||
static int drdynvc_write_variable_uint(STREAM* stream, uint32 val)
|
||||
static int drdynvc_write_variable_uint(STREAM* stream, UINT32 val)
|
||||
{
|
||||
int cb;
|
||||
|
||||
@@ -74,18 +74,18 @@ static int drdynvc_write_variable_uint(STREAM* stream, uint32 val)
|
||||
else
|
||||
{
|
||||
cb = 2;
|
||||
stream_write_uint32(stream, val);
|
||||
stream_write_UINT32(stream, val);
|
||||
}
|
||||
return cb;
|
||||
}
|
||||
|
||||
int drdynvc_write_data(drdynvcPlugin* drdynvc, uint32 ChannelId, BYTE* data, uint32 data_size)
|
||||
int drdynvc_write_data(drdynvcPlugin* drdynvc, UINT32 ChannelId, BYTE* data, UINT32 data_size)
|
||||
{
|
||||
STREAM* data_out;
|
||||
uint32 pos = 0;
|
||||
uint32 cbChId;
|
||||
uint32 cbLen;
|
||||
uint32 chunk_len;
|
||||
UINT32 pos = 0;
|
||||
UINT32 cbChId;
|
||||
UINT32 cbLen;
|
||||
UINT32 chunk_len;
|
||||
int error;
|
||||
|
||||
DEBUG_DVC("ChannelId=%d size=%d", ChannelId, data_size);
|
||||
@@ -199,9 +199,9 @@ static int drdynvc_process_capability_request(drdynvcPlugin* drdynvc, int Sp, in
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint32 drdynvc_read_variable_uint(STREAM* stream, int cbLen)
|
||||
static UINT32 drdynvc_read_variable_uint(STREAM* stream, int cbLen)
|
||||
{
|
||||
uint32 val;
|
||||
UINT32 val;
|
||||
|
||||
switch (cbLen)
|
||||
{
|
||||
@@ -212,7 +212,7 @@ static uint32 drdynvc_read_variable_uint(STREAM* stream, int cbLen)
|
||||
stream_read_UINT16(stream, val);
|
||||
break;
|
||||
default:
|
||||
stream_read_uint32(stream, val);
|
||||
stream_read_UINT32(stream, val);
|
||||
break;
|
||||
}
|
||||
return val;
|
||||
@@ -223,7 +223,7 @@ static int drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, int cb
|
||||
STREAM* data_out;
|
||||
int pos;
|
||||
int error;
|
||||
uint32 ChannelId;
|
||||
UINT32 ChannelId;
|
||||
|
||||
ChannelId = drdynvc_read_variable_uint(s, cbChId);
|
||||
pos = stream_get_pos(s);
|
||||
@@ -239,12 +239,12 @@ static int drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, int cb
|
||||
if (error == 0)
|
||||
{
|
||||
DEBUG_DVC("channel created");
|
||||
stream_write_uint32(data_out, 0);
|
||||
stream_write_UINT32(data_out, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_DVC("no listener");
|
||||
stream_write_uint32(data_out, (uint32)(-1));
|
||||
stream_write_UINT32(data_out, (UINT32)(-1));
|
||||
}
|
||||
|
||||
error = svc_plugin_send((rdpSvcPlugin*)drdynvc, data_out);
|
||||
@@ -258,8 +258,8 @@ static int drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, int cb
|
||||
|
||||
static int drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, int cbChId, STREAM* s)
|
||||
{
|
||||
uint32 ChannelId;
|
||||
uint32 Length;
|
||||
UINT32 ChannelId;
|
||||
UINT32 Length;
|
||||
int error;
|
||||
|
||||
ChannelId = drdynvc_read_variable_uint(s, cbChId);
|
||||
@@ -276,7 +276,7 @@ static int drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, int cbChId
|
||||
|
||||
static int drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, STREAM* s)
|
||||
{
|
||||
uint32 ChannelId;
|
||||
UINT32 ChannelId;
|
||||
|
||||
ChannelId = drdynvc_read_variable_uint(s, cbChId);
|
||||
DEBUG_DVC("ChannelId=%d", ChannelId);
|
||||
@@ -287,7 +287,7 @@ static int drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, STRE
|
||||
|
||||
static int drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, STREAM* s)
|
||||
{
|
||||
uint32 ChannelId;
|
||||
UINT32 ChannelId;
|
||||
|
||||
ChannelId = drdynvc_read_variable_uint(s, cbChId);
|
||||
DEBUG_DVC("ChannelId=%d", ChannelId);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
typedef struct drdynvc_plugin drdynvcPlugin;
|
||||
|
||||
int drdynvc_write_data(drdynvcPlugin* plugin, uint32 ChannelId, BYTE* 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
|
||||
|
||||
@@ -62,7 +62,7 @@ struct _DVCMAN_LISTENER
|
||||
|
||||
DVCMAN* dvcman;
|
||||
char* channel_name;
|
||||
uint32 flags;
|
||||
UINT32 flags;
|
||||
IWTSListenerCallback* listener_callback;
|
||||
};
|
||||
|
||||
@@ -82,7 +82,7 @@ struct _DVCMAN_CHANNEL
|
||||
|
||||
DVCMAN* dvcman;
|
||||
DVCMAN_CHANNEL* next;
|
||||
uint32 channel_id;
|
||||
UINT32 channel_id;
|
||||
IWTSVirtualChannelCallback* channel_callback;
|
||||
|
||||
STREAM* dvc_data;
|
||||
@@ -97,7 +97,7 @@ static int dvcman_get_configuration(IWTSListener* pListener, void** ppPropertyBa
|
||||
}
|
||||
|
||||
static int dvcman_create_listener(IWTSVirtualChannelManager* pChannelMgr,
|
||||
const char* pszChannelName, uint32 ulFlags,
|
||||
const char* pszChannelName, UINT32 ulFlags,
|
||||
IWTSListenerCallback* pListenerCallback, IWTSListener** ppListener)
|
||||
{
|
||||
DVCMAN* dvcman = (DVCMAN*)pChannelMgr;
|
||||
@@ -186,12 +186,12 @@ RDP_PLUGIN_DATA* dvcman_get_plugin_data(IDRDYNVC_ENTRY_POINTS* pEntryPoints)
|
||||
return ((DVCMAN_ENTRY_POINTS*) pEntryPoints)->plugin_data;
|
||||
}
|
||||
|
||||
uint32 dvcman_get_channel_id(IWTSVirtualChannel * channel)
|
||||
UINT32 dvcman_get_channel_id(IWTSVirtualChannel * channel)
|
||||
{
|
||||
return ((DVCMAN_CHANNEL*)channel)->channel_id;
|
||||
}
|
||||
|
||||
IWTSVirtualChannel* dvcman_find_channel_by_id(IWTSVirtualChannelManager* pChannelMgr, uint32 ChannelId)
|
||||
IWTSVirtualChannel* dvcman_find_channel_by_id(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId)
|
||||
{
|
||||
LIST_ITEM* curr;
|
||||
DVCMAN* dvcman = (DVCMAN*) pChannelMgr;
|
||||
@@ -303,7 +303,7 @@ int dvcman_init(IWTSVirtualChannelManager* pChannelMgr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dvcman_write_channel(IWTSVirtualChannel* pChannel, uint32 cbSize, BYTE* pBuffer, void* pReserved)
|
||||
static int dvcman_write_channel(IWTSVirtualChannel* pChannel, UINT32 cbSize, BYTE* pBuffer, void* pReserved)
|
||||
{
|
||||
int status;
|
||||
DVCMAN_CHANNEL* channel = (DVCMAN_CHANNEL*) pChannel;
|
||||
@@ -330,7 +330,7 @@ static int dvcman_close_channel_iface(IWTSVirtualChannel* pChannel)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, uint32 ChannelId, const char* ChannelName)
|
||||
int dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, const char* ChannelName)
|
||||
{
|
||||
int i;
|
||||
int bAccept;
|
||||
@@ -378,7 +378,7 @@ int dvcman_create_channel(IWTSVirtualChannelManager* pChannelMgr, uint32 Channel
|
||||
}
|
||||
|
||||
|
||||
int dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, uint32 ChannelId)
|
||||
int dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId)
|
||||
{
|
||||
DVCMAN_CHANNEL* channel;
|
||||
IWTSVirtualChannel* ichannel;
|
||||
@@ -404,7 +404,7 @@ int dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, uint32 ChannelI
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dvcman_receive_channel_data_first(IWTSVirtualChannelManager* pChannelMgr, uint32 ChannelId, uint32 length)
|
||||
int dvcman_receive_channel_data_first(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, UINT32 length)
|
||||
{
|
||||
DVCMAN_CHANNEL* channel;
|
||||
|
||||
@@ -424,7 +424,7 @@ int dvcman_receive_channel_data_first(IWTSVirtualChannelManager* pChannelMgr, ui
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, uint32 ChannelId, BYTE* data, uint32 data_size)
|
||||
int dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelId, BYTE* data, UINT32 data_size)
|
||||
{
|
||||
int error = 0;
|
||||
DVCMAN_CHANNEL* channel;
|
||||
@@ -440,7 +440,7 @@ int dvcman_receive_channel_data(IWTSVirtualChannelManager* pChannelMgr, uint32 C
|
||||
if (channel->dvc_data)
|
||||
{
|
||||
/* Fragmented data */
|
||||
if (stream_get_length(channel->dvc_data) + data_size > (uint32) stream_get_size(channel->dvc_data))
|
||||
if (stream_get_length(channel->dvc_data) + data_size > (UINT32) stream_get_size(channel->dvc_data))
|
||||
{
|
||||
DEBUG_WARN("data exceeding declared length!");
|
||||
stream_free(channel->dvc_data);
|
||||
|
||||
@@ -27,10 +27,10 @@ IWTSVirtualChannelManager* dvcman_new(drdynvcPlugin* plugin);
|
||||
int dvcman_load_plugin(IWTSVirtualChannelManager* pChannelMgr, RDP_PLUGIN_DATA* data);
|
||||
void dvcman_free(IWTSVirtualChannelManager* pChannelMgr);
|
||||
int dvcman_init(IWTSVirtualChannelManager* pChannelMgr);
|
||||
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, BYTE* data, uint32 data_size);
|
||||
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, BYTE* data, UINT32 data_size);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ struct _PARALLEL_DEVICE
|
||||
|
||||
int file;
|
||||
char* path;
|
||||
uint32 id;
|
||||
UINT32 id;
|
||||
|
||||
PSLIST_HEADER pIrpList;
|
||||
freerdp_thread* thread;
|
||||
@@ -75,12 +75,12 @@ typedef struct _PARALLEL_DEVICE PARALLEL_DEVICE;
|
||||
static void parallel_process_irp_create(PARALLEL_DEVICE* parallel, IRP* irp)
|
||||
{
|
||||
char* path;
|
||||
uint32 PathLength;
|
||||
UINT32 PathLength;
|
||||
|
||||
stream_seek(irp->input, 28);
|
||||
/* DesiredAccess(4) AllocationSize(8), FileAttributes(4) */
|
||||
/* SharedAccess(4) CreateDisposition(4), CreateOptions(4) */
|
||||
stream_read_uint32(irp->input, PathLength);
|
||||
stream_read_UINT32(irp->input, PathLength);
|
||||
|
||||
freerdp_UnicodeToAsciiAlloc((WCHAR*) stream_get_tail(irp->input), &path, PathLength / 2);
|
||||
|
||||
@@ -103,7 +103,7 @@ static void parallel_process_irp_create(PARALLEL_DEVICE* parallel, IRP* irp)
|
||||
DEBUG_SVC("%s(%d) created", parallel->path, parallel->file);
|
||||
}
|
||||
|
||||
stream_write_uint32(irp->output, parallel->id);
|
||||
stream_write_UINT32(irp->output, parallel->id);
|
||||
stream_write_BYTE(irp->output, 0);
|
||||
|
||||
free(path);
|
||||
@@ -125,13 +125,13 @@ static void parallel_process_irp_close(PARALLEL_DEVICE* parallel, IRP* irp)
|
||||
|
||||
static void parallel_process_irp_read(PARALLEL_DEVICE* parallel, IRP* irp)
|
||||
{
|
||||
uint32 Length;
|
||||
uint64 Offset;
|
||||
UINT32 Length;
|
||||
UINT64 Offset;
|
||||
ssize_t status;
|
||||
BYTE* buffer = NULL;
|
||||
|
||||
stream_read_uint32(irp->input, Length);
|
||||
stream_read_uint64(irp->input, Offset);
|
||||
stream_read_UINT32(irp->input, Length);
|
||||
stream_read_UINT64(irp->input, Offset);
|
||||
|
||||
buffer = (BYTE*) malloc(Length);
|
||||
|
||||
@@ -151,7 +151,7 @@ static void parallel_process_irp_read(PARALLEL_DEVICE* parallel, IRP* irp)
|
||||
DEBUG_SVC("read %llu-%llu from %d", Offset, Offset + Length, parallel->id);
|
||||
}
|
||||
|
||||
stream_write_uint32(irp->output, Length);
|
||||
stream_write_UINT32(irp->output, Length);
|
||||
if (Length > 0)
|
||||
{
|
||||
stream_check_size(irp->output, Length);
|
||||
@@ -164,13 +164,13 @@ static void parallel_process_irp_read(PARALLEL_DEVICE* parallel, IRP* irp)
|
||||
|
||||
static void parallel_process_irp_write(PARALLEL_DEVICE* parallel, IRP* irp)
|
||||
{
|
||||
uint32 Length;
|
||||
uint64 Offset;
|
||||
UINT32 Length;
|
||||
UINT64 Offset;
|
||||
ssize_t status;
|
||||
uint32 len;
|
||||
UINT32 len;
|
||||
|
||||
stream_read_uint32(irp->input, Length);
|
||||
stream_read_uint64(irp->input, Offset);
|
||||
stream_read_UINT32(irp->input, Length);
|
||||
stream_read_UINT64(irp->input, Offset);
|
||||
stream_seek(irp->input, 20); /* Padding */
|
||||
|
||||
DEBUG_SVC("Length %u Offset %llu", Length, Offset);
|
||||
@@ -194,7 +194,7 @@ static void parallel_process_irp_write(PARALLEL_DEVICE* parallel, IRP* irp)
|
||||
len -= status;
|
||||
}
|
||||
|
||||
stream_write_uint32(irp->output, Length);
|
||||
stream_write_UINT32(irp->output, Length);
|
||||
stream_write_BYTE(irp->output, 0); /* Padding */
|
||||
|
||||
irp->Complete(irp);
|
||||
@@ -203,7 +203,7 @@ static void parallel_process_irp_write(PARALLEL_DEVICE* parallel, IRP* irp)
|
||||
static void parallel_process_irp_device_control(PARALLEL_DEVICE* parallel, IRP* irp)
|
||||
{
|
||||
DEBUG_SVC("in");
|
||||
stream_write_uint32(irp->output, 0); /* OutputBufferLength */
|
||||
stream_write_UINT32(irp->output, 0); /* OutputBufferLength */
|
||||
irp->Complete(irp);
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ static void printer_cups_close_printjob(rdpPrintJob* printjob)
|
||||
free(cups_printjob) ;
|
||||
}
|
||||
|
||||
static rdpPrintJob* printer_cups_create_printjob(rdpPrinter* printer, uint32 id)
|
||||
static rdpPrintJob* printer_cups_create_printjob(rdpPrinter* printer, UINT32 id)
|
||||
{
|
||||
rdpCupsPrinter* cups_printer = (rdpCupsPrinter*)printer;
|
||||
rdpCupsPrintJob* cups_printjob;
|
||||
@@ -191,7 +191,7 @@ static rdpPrintJob* printer_cups_create_printjob(rdpPrinter* printer, uint32 id)
|
||||
return (rdpPrintJob*)cups_printjob;
|
||||
}
|
||||
|
||||
static rdpPrintJob* printer_cups_find_printjob(rdpPrinter* printer, uint32 id)
|
||||
static rdpPrintJob* printer_cups_find_printjob(rdpPrinter* printer, UINT32 id)
|
||||
{
|
||||
rdpCupsPrinter* cups_printer = (rdpCupsPrinter*)printer;
|
||||
|
||||
|
||||
@@ -67,13 +67,13 @@ static void printer_process_irp_create(PRINTER_DEVICE* printer_dev, IRP* irp)
|
||||
|
||||
if (printjob != NULL)
|
||||
{
|
||||
stream_write_uint32(irp->output, printjob->id); /* FileId */
|
||||
stream_write_UINT32(irp->output, printjob->id); /* FileId */
|
||||
|
||||
DEBUG_SVC("printjob id: %d", printjob->id);
|
||||
}
|
||||
else
|
||||
{
|
||||
stream_write_uint32(irp->output, 0); /* FileId */
|
||||
stream_write_UINT32(irp->output, 0); /* FileId */
|
||||
irp->IoStatus = STATUS_PRINT_QUEUE_FULL;
|
||||
|
||||
DEBUG_WARN("error creating print job.");
|
||||
@@ -109,12 +109,12 @@ static void printer_process_irp_close(PRINTER_DEVICE* printer_dev, IRP* irp)
|
||||
|
||||
static void printer_process_irp_write(PRINTER_DEVICE* printer_dev, IRP* irp)
|
||||
{
|
||||
uint32 Length;
|
||||
uint64 Offset;
|
||||
UINT32 Length;
|
||||
UINT64 Offset;
|
||||
rdpPrintJob* printjob = NULL;
|
||||
|
||||
stream_read_uint32(irp->input, Length);
|
||||
stream_read_uint64(irp->input, Offset);
|
||||
stream_read_UINT32(irp->input, Length);
|
||||
stream_read_UINT64(irp->input, Offset);
|
||||
stream_seek(irp->input, 20); /* Padding */
|
||||
|
||||
if (printer_dev->printer != NULL)
|
||||
@@ -134,7 +134,7 @@ static void printer_process_irp_write(PRINTER_DEVICE* printer_dev, IRP* irp)
|
||||
DEBUG_SVC("printjob id %d written %d bytes.", irp->FileId, Length);
|
||||
}
|
||||
|
||||
stream_write_uint32(irp->output, Length);
|
||||
stream_write_UINT32(irp->output, Length);
|
||||
stream_write_BYTE(irp->output, 0); /* Padding */
|
||||
|
||||
irp->Complete(irp);
|
||||
@@ -235,12 +235,12 @@ static void printer_free(DEVICE* device)
|
||||
void printer_register(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, rdpPrinter* printer)
|
||||
{
|
||||
char* port;
|
||||
uint32 Flags;
|
||||
UINT32 Flags;
|
||||
int DriverNameLen;
|
||||
WCHAR* DriverName;
|
||||
int PrintNameLen;
|
||||
WCHAR* PrintName;
|
||||
uint32 CachedFieldsLen;
|
||||
UINT32 CachedFieldsLen;
|
||||
BYTE* CachedPrinterConfigData;
|
||||
PRINTER_DEVICE* printer_dev;
|
||||
|
||||
@@ -271,12 +271,12 @@ void printer_register(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints, rdpPrinter* pri
|
||||
|
||||
printer_dev->device.data = stream_new(28 + DriverNameLen + PrintNameLen + CachedFieldsLen);
|
||||
|
||||
stream_write_uint32(printer_dev->device.data, Flags);
|
||||
stream_write_uint32(printer_dev->device.data, 0); /* CodePage, reserved */
|
||||
stream_write_uint32(printer_dev->device.data, 0); /* PnPNameLen */
|
||||
stream_write_uint32(printer_dev->device.data, DriverNameLen + 2);
|
||||
stream_write_uint32(printer_dev->device.data, PrintNameLen + 2);
|
||||
stream_write_uint32(printer_dev->device.data, CachedFieldsLen);
|
||||
stream_write_UINT32(printer_dev->device.data, Flags);
|
||||
stream_write_UINT32(printer_dev->device.data, 0); /* CodePage, reserved */
|
||||
stream_write_UINT32(printer_dev->device.data, 0); /* PnPNameLen */
|
||||
stream_write_UINT32(printer_dev->device.data, DriverNameLen + 2);
|
||||
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(printer_dev->device.data, PrintName, PrintNameLen);
|
||||
|
||||
@@ -48,8 +48,8 @@ struct rdp_printer_driver
|
||||
pcGetPrinter GetPrinter;
|
||||
};
|
||||
|
||||
typedef rdpPrintJob* (*pcCreatePrintJob) (rdpPrinter* printer, uint32 id);
|
||||
typedef rdpPrintJob* (*pcFindPrintJob) (rdpPrinter* printer, uint32 id);
|
||||
typedef rdpPrintJob* (*pcCreatePrintJob) (rdpPrinter* printer, UINT32 id);
|
||||
typedef rdpPrintJob* (*pcFindPrintJob) (rdpPrinter* printer, UINT32 id);
|
||||
typedef void (*pcFreePrinter) (rdpPrinter* printer);
|
||||
|
||||
struct rdp_printer
|
||||
@@ -69,7 +69,7 @@ typedef void (*pcClosePrintJob) (rdpPrintJob* printjob);
|
||||
|
||||
struct rdp_print_job
|
||||
{
|
||||
uint32 id;
|
||||
UINT32 id;
|
||||
rdpPrinter* printer;
|
||||
|
||||
pcWritePrintJob Write;
|
||||
|
||||
@@ -111,7 +111,7 @@ static void printer_win_close_printjob(rdpPrintJob* printjob)
|
||||
free(win_printjob) ;
|
||||
}
|
||||
|
||||
static rdpPrintJob* printer_win_create_printjob(rdpPrinter* printer, uint32 id)
|
||||
static rdpPrintJob* printer_win_create_printjob(rdpPrinter* printer, UINT32 id)
|
||||
{
|
||||
rdpWinPrinter* win_printer = (rdpWinPrinter*)printer;
|
||||
rdpWinPrintJob* win_printjob;
|
||||
@@ -145,7 +145,7 @@ static rdpPrintJob* printer_win_create_printjob(rdpPrinter* printer, uint32 id)
|
||||
return (rdpPrintJob*)win_printjob;
|
||||
}
|
||||
|
||||
static rdpPrintJob* printer_win_find_printjob(rdpPrinter* printer, uint32 id)
|
||||
static rdpPrintJob* printer_win_find_printjob(rdpPrinter* printer, UINT32 id)
|
||||
{
|
||||
rdpWinPrinter* win_printer = (rdpWinPrinter*)printer;
|
||||
|
||||
|
||||
@@ -129,21 +129,21 @@ void rail_send_pdu(rdpRailOrder* rail_order, STREAM* s, UINT16 orderType)
|
||||
void rail_write_high_contrast(STREAM* s, HIGH_CONTRAST* high_contrast)
|
||||
{
|
||||
high_contrast->colorSchemeLength = high_contrast->colorScheme.length + 2;
|
||||
stream_write_uint32(s, high_contrast->flags); /* flags (4 bytes) */
|
||||
stream_write_uint32(s, high_contrast->colorSchemeLength); /* colorSchemeLength (4 bytes) */
|
||||
stream_write_UINT32(s, high_contrast->flags); /* flags (4 bytes) */
|
||||
stream_write_UINT32(s, high_contrast->colorSchemeLength); /* colorSchemeLength (4 bytes) */
|
||||
rail_write_unicode_string(s, &high_contrast->colorScheme); /* colorScheme */
|
||||
}
|
||||
|
||||
void rail_read_handshake_order(STREAM* s, RAIL_HANDSHAKE_ORDER* handshake)
|
||||
{
|
||||
stream_read_uint32(s, handshake->buildNumber); /* buildNumber (4 bytes) */
|
||||
stream_read_UINT32(s, handshake->buildNumber); /* buildNumber (4 bytes) */
|
||||
}
|
||||
|
||||
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_uint32(s, exec_result->rawResult); /* rawResult (4 bytes) */
|
||||
stream_read_UINT32(s, exec_result->rawResult); /* rawResult (4 bytes) */
|
||||
stream_seek_UINT16(s); /* padding (2 bytes) */
|
||||
rail_read_unicode_string(s, &exec_result->exeOrFile); /* exeOrFile */
|
||||
}
|
||||
@@ -151,7 +151,7 @@ void rail_read_server_exec_result_order(STREAM* s, RAIL_EXEC_RESULT_ORDER* exec_
|
||||
void rail_read_server_sysparam_order(STREAM* s, RAIL_SYSPARAM_ORDER* sysparam)
|
||||
{
|
||||
BYTE body;
|
||||
stream_read_uint32(s, sysparam->param); /* systemParam (4 bytes) */
|
||||
stream_read_UINT32(s, sysparam->param); /* systemParam (4 bytes) */
|
||||
stream_read_BYTE(s, body); /* body (1 byte) */
|
||||
|
||||
switch (sysparam->param)
|
||||
@@ -171,7 +171,7 @@ void rail_read_server_sysparam_order(STREAM* s, RAIL_SYSPARAM_ORDER* sysparam)
|
||||
|
||||
void rail_read_server_minmaxinfo_order(STREAM* s, RAIL_MINMAXINFO_ORDER* minmaxinfo)
|
||||
{
|
||||
stream_read_uint32(s, minmaxinfo->windowId); /* windowId (4 bytes) */
|
||||
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) */
|
||||
@@ -185,7 +185,7 @@ void rail_read_server_minmaxinfo_order(STREAM* s, RAIL_MINMAXINFO_ORDER* minmaxi
|
||||
void rail_read_server_localmovesize_order(STREAM* s, RAIL_LOCALMOVESIZE_ORDER* localmovesize)
|
||||
{
|
||||
UINT16 isMoveSizeStart;
|
||||
stream_read_uint32(s, localmovesize->windowId); /* windowId (4 bytes) */
|
||||
stream_read_UINT32(s, localmovesize->windowId); /* windowId (4 bytes) */
|
||||
|
||||
stream_read_UINT16(s, isMoveSizeStart); /* isMoveSizeStart (2 bytes) */
|
||||
localmovesize->isMoveSizeStart = (isMoveSizeStart != 0) ? TRUE : FALSE;
|
||||
@@ -197,7 +197,7 @@ void rail_read_server_localmovesize_order(STREAM* s, RAIL_LOCALMOVESIZE_ORDER* l
|
||||
|
||||
void rail_read_server_get_appid_resp_order(STREAM* s, RAIL_GET_APPID_RESP_ORDER* get_appid_resp)
|
||||
{
|
||||
stream_read_uint32(s, get_appid_resp->windowId); /* windowId (4 bytes) */
|
||||
stream_read_UINT32(s, get_appid_resp->windowId); /* windowId (4 bytes) */
|
||||
stream_read(s, &get_appid_resp->applicationIdBuffer[0], 512); /* applicationId (256 UNICODE chars) */
|
||||
|
||||
get_appid_resp->applicationId.length = 512;
|
||||
@@ -206,17 +206,17 @@ void rail_read_server_get_appid_resp_order(STREAM* s, RAIL_GET_APPID_RESP_ORDER*
|
||||
|
||||
void rail_read_langbar_info_order(STREAM* s, RAIL_LANGBAR_INFO_ORDER* langbar_info)
|
||||
{
|
||||
stream_read_uint32(s, langbar_info->languageBarStatus); /* languageBarStatus (4 bytes) */
|
||||
stream_read_UINT32(s, langbar_info->languageBarStatus); /* languageBarStatus (4 bytes) */
|
||||
}
|
||||
|
||||
void rail_write_handshake_order(STREAM* s, RAIL_HANDSHAKE_ORDER* handshake)
|
||||
{
|
||||
stream_write_uint32(s, handshake->buildNumber); /* buildNumber (4 bytes) */
|
||||
stream_write_UINT32(s, handshake->buildNumber); /* buildNumber (4 bytes) */
|
||||
}
|
||||
|
||||
void rail_write_client_status_order(STREAM* s, RAIL_CLIENT_STATUS_ORDER* client_status)
|
||||
{
|
||||
stream_write_uint32(s, client_status->flags); /* flags (4 bytes) */
|
||||
stream_write_UINT32(s, client_status->flags); /* flags (4 bytes) */
|
||||
}
|
||||
|
||||
void rail_write_client_exec_order(STREAM* s, RAIL_EXEC_ORDER* exec)
|
||||
@@ -233,7 +233,7 @@ void rail_write_client_exec_order(STREAM* s, RAIL_EXEC_ORDER* exec)
|
||||
void rail_write_client_sysparam_order(STREAM* s, RAIL_SYSPARAM_ORDER* sysparam)
|
||||
{
|
||||
BYTE body;
|
||||
stream_write_uint32(s, sysparam->param); /* systemParam (4 bytes) */
|
||||
stream_write_UINT32(s, sysparam->param); /* systemParam (4 bytes) */
|
||||
|
||||
switch (sysparam->param)
|
||||
{
|
||||
@@ -288,7 +288,7 @@ void rail_write_client_activate_order(STREAM* s, RAIL_ACTIVATE_ORDER* activate)
|
||||
{
|
||||
BYTE enabled;
|
||||
|
||||
stream_write_uint32(s, activate->windowId); /* windowId (4 bytes) */
|
||||
stream_write_UINT32(s, activate->windowId); /* windowId (4 bytes) */
|
||||
|
||||
enabled = activate->enabled;
|
||||
stream_write_BYTE(s, enabled); /* enabled (1 byte) */
|
||||
@@ -296,27 +296,27 @@ void rail_write_client_activate_order(STREAM* s, RAIL_ACTIVATE_ORDER* activate)
|
||||
|
||||
void rail_write_client_sysmenu_order(STREAM* s, RAIL_SYSMENU_ORDER* sysmenu)
|
||||
{
|
||||
stream_write_uint32(s, sysmenu->windowId); /* windowId (4 bytes) */
|
||||
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) */
|
||||
}
|
||||
|
||||
void rail_write_client_syscommand_order(STREAM* s, RAIL_SYSCOMMAND_ORDER* syscommand)
|
||||
{
|
||||
stream_write_uint32(s, syscommand->windowId); /* windowId (4 bytes) */
|
||||
stream_write_UINT32(s, syscommand->windowId); /* windowId (4 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)
|
||||
{
|
||||
stream_write_uint32(s, notify_event->windowId); /* windowId (4 bytes) */
|
||||
stream_write_uint32(s, notify_event->notifyIconId); /* notifyIconId (4 bytes) */
|
||||
stream_write_uint32(s, notify_event->message); /* notifyIconId (4 bytes) */
|
||||
stream_write_UINT32(s, notify_event->windowId); /* windowId (4 bytes) */
|
||||
stream_write_UINT32(s, notify_event->notifyIconId); /* notifyIconId (4 bytes) */
|
||||
stream_write_UINT32(s, notify_event->message); /* notifyIconId (4 bytes) */
|
||||
}
|
||||
|
||||
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_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) */
|
||||
@@ -325,12 +325,12 @@ void rail_write_client_window_move_order(STREAM* s, RAIL_WINDOW_MOVE_ORDER* wind
|
||||
|
||||
void rail_write_client_get_appid_req_order(STREAM* s, RAIL_GET_APPID_REQ_ORDER* get_appid_req)
|
||||
{
|
||||
stream_write_uint32(s, get_appid_req->windowId); /* windowId (4 bytes) */
|
||||
stream_write_UINT32(s, get_appid_req->windowId); /* windowId (4 bytes) */
|
||||
}
|
||||
|
||||
void rail_write_langbar_info_order(STREAM* s, RAIL_LANGBAR_INFO_ORDER* langbar_info)
|
||||
{
|
||||
stream_write_uint32(s, langbar_info->languageBarStatus); /* languageBarStatus (4 bytes) */
|
||||
stream_write_UINT32(s, langbar_info->languageBarStatus); /* languageBarStatus (4 bytes) */
|
||||
}
|
||||
|
||||
void rail_recv_handshake_order(rdpRailOrder* rail_order, STREAM* s)
|
||||
|
||||
@@ -100,7 +100,7 @@ BOOL devman_load_device_service(DEVMAN* devman, RDP_PLUGIN_DATA* plugin_data)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
DEVICE* devman_get_device_by_id(DEVMAN* devman, uint32 id)
|
||||
DEVICE* devman_get_device_by_id(DEVMAN* devman, UINT32 id)
|
||||
{
|
||||
LIST_ITEM* item;
|
||||
DEVICE* device;
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
DEVMAN* devman_new(rdpSvcPlugin* plugin);
|
||||
void devman_free(DEVMAN* devman);
|
||||
BOOL devman_load_device_service(DEVMAN* devman, RDP_PLUGIN_DATA* plugin_data);
|
||||
DEVICE* devman_get_device_by_id(DEVMAN* devman, uint32 id);
|
||||
DEVICE* devman_get_device_by_id(DEVMAN* devman, UINT32 id);
|
||||
|
||||
#endif /* FREERDP_CHANNEL_RDPDR_CLIENT_DEVMAN_H */
|
||||
|
||||
@@ -54,7 +54,7 @@ static void irp_complete(IRP* irp)
|
||||
|
||||
pos = stream_get_pos(irp->output);
|
||||
stream_set_pos(irp->output, 12);
|
||||
stream_write_uint32(irp->output, irp->IoStatus);
|
||||
stream_write_UINT32(irp->output, irp->IoStatus);
|
||||
stream_set_pos(irp->output, pos);
|
||||
|
||||
svc_plugin_send(irp->devman->plugin, irp->output);
|
||||
@@ -66,10 +66,10 @@ static void irp_complete(IRP* irp)
|
||||
IRP* irp_new(DEVMAN* devman, STREAM* data_in)
|
||||
{
|
||||
IRP* irp;
|
||||
uint32 DeviceId;
|
||||
UINT32 DeviceId;
|
||||
DEVICE* device;
|
||||
|
||||
stream_read_uint32(data_in, DeviceId);
|
||||
stream_read_UINT32(data_in, DeviceId);
|
||||
device = devman_get_device_by_id(devman, DeviceId);
|
||||
|
||||
if (device == NULL)
|
||||
@@ -83,18 +83,18 @@ IRP* irp_new(DEVMAN* devman, STREAM* data_in)
|
||||
|
||||
irp->device = device;
|
||||
irp->devman = devman;
|
||||
stream_read_uint32(data_in, irp->FileId);
|
||||
stream_read_uint32(data_in, irp->CompletionId);
|
||||
stream_read_uint32(data_in, irp->MajorFunction);
|
||||
stream_read_uint32(data_in, irp->MinorFunction);
|
||||
stream_read_UINT32(data_in, irp->FileId);
|
||||
stream_read_UINT32(data_in, irp->CompletionId);
|
||||
stream_read_UINT32(data_in, irp->MajorFunction);
|
||||
stream_read_UINT32(data_in, irp->MinorFunction);
|
||||
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_uint32(irp->output, DeviceId);
|
||||
stream_write_uint32(irp->output, irp->CompletionId);
|
||||
stream_seek_uint32(irp->output); /* IoStatus */
|
||||
stream_write_UINT32(irp->output, DeviceId);
|
||||
stream_write_UINT32(irp->output, irp->CompletionId);
|
||||
stream_seek_UINT32(irp->output); /* IoStatus */
|
||||
|
||||
irp->Complete = irp_complete;
|
||||
irp->Discard = irp_free;
|
||||
|
||||
@@ -33,11 +33,11 @@
|
||||
#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_uint32(data_out, version);
|
||||
stream_write_UINT32(data_out, version);
|
||||
}
|
||||
|
||||
/* Output device direction general capability set */
|
||||
@@ -45,16 +45,16 @@ static void rdpdr_write_general_capset(rdpdrPlugin* rdpdr, STREAM* data_out)
|
||||
{
|
||||
rdpdr_write_capset_header(data_out, CAP_GENERAL_TYPE, 44, GENERAL_CAPABILITY_VERSION_02);
|
||||
|
||||
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_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_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 */
|
||||
stream_write_uint32(data_out, ENABLE_ASYNCIO); /* extraFlags1 */
|
||||
stream_write_uint32(data_out, 0); /* extraFlags2, must be set to zero, reserved for future use */
|
||||
stream_write_uint32(data_out, 0); /* SpecialTypeDeviceCap, number of special devices to be redirected before logon */
|
||||
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 */
|
||||
stream_write_UINT32(data_out, ENABLE_ASYNCIO); /* extraFlags1 */
|
||||
stream_write_UINT32(data_out, 0); /* extraFlags2, must be set to zero, reserved for future use */
|
||||
stream_write_UINT32(data_out, 0); /* SpecialTypeDeviceCap, number of special devices to be redirected before logon */
|
||||
}
|
||||
|
||||
/* Process device direction general capability set */
|
||||
|
||||
@@ -75,7 +75,7 @@ static void rdpdr_process_server_announce_request(rdpdrPlugin* rdpdr, STREAM* da
|
||||
{
|
||||
stream_read_UINT16(data_in, rdpdr->versionMajor);
|
||||
stream_read_UINT16(data_in, rdpdr->versionMinor);
|
||||
stream_read_uint32(data_in, rdpdr->clientID);
|
||||
stream_read_UINT32(data_in, rdpdr->clientID);
|
||||
|
||||
DEBUG_SVC("version %d.%d clientID %d", rdpdr->versionMajor, rdpdr->versionMinor, rdpdr->clientID);
|
||||
}
|
||||
@@ -91,7 +91,7 @@ static void rdpdr_send_client_announce_reply(rdpdrPlugin* rdpdr)
|
||||
|
||||
stream_write_UINT16(data_out, rdpdr->versionMajor);
|
||||
stream_write_UINT16(data_out, rdpdr->versionMinor);
|
||||
stream_write_uint32(data_out, (uint32) rdpdr->clientID);
|
||||
stream_write_UINT32(data_out, (UINT32) rdpdr->clientID);
|
||||
|
||||
svc_plugin_send((rdpSvcPlugin*) rdpdr, data_out);
|
||||
}
|
||||
@@ -112,9 +112,9 @@ static void rdpdr_send_client_name_request(rdpdrPlugin* rdpdr)
|
||||
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_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 */
|
||||
|
||||
@@ -127,11 +127,11 @@ static void rdpdr_process_server_clientid_confirm(rdpdrPlugin* rdpdr, STREAM* da
|
||||
{
|
||||
UINT16 versionMajor;
|
||||
UINT16 versionMinor;
|
||||
uint32 clientID;
|
||||
UINT32 clientID;
|
||||
|
||||
stream_read_UINT16(data_in, versionMajor);
|
||||
stream_read_UINT16(data_in, versionMinor);
|
||||
stream_read_uint32(data_in, clientID);
|
||||
stream_read_UINT32(data_in, clientID);
|
||||
|
||||
if (versionMajor != rdpdr->versionMajor || versionMinor != rdpdr->versionMinor)
|
||||
{
|
||||
@@ -152,7 +152,7 @@ static void rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL use
|
||||
int i;
|
||||
int pos;
|
||||
BYTE c;
|
||||
uint32 count;
|
||||
UINT32 count;
|
||||
int data_len;
|
||||
int count_pos;
|
||||
STREAM* data_out;
|
||||
@@ -166,7 +166,7 @@ static void rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL use
|
||||
|
||||
count_pos = stream_get_pos(data_out);
|
||||
count = 0;
|
||||
stream_seek_uint32(data_out); /* deviceCount */
|
||||
stream_seek_UINT32(data_out); /* deviceCount */
|
||||
|
||||
for (item = rdpdr->devman->devices->head; item; item = item->next)
|
||||
{
|
||||
@@ -184,8 +184,8 @@ static void rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL use
|
||||
data_len = (device->data == NULL ? 0 : stream_get_length(device->data));
|
||||
stream_check_size(data_out, 20 + data_len);
|
||||
|
||||
stream_write_uint32(data_out, device->type); /* deviceType */
|
||||
stream_write_uint32(data_out, device->id); /* deviceID */
|
||||
stream_write_UINT32(data_out, device->type); /* deviceType */
|
||||
stream_write_UINT32(data_out, device->id); /* deviceID */
|
||||
strncpy((char*) stream_get_tail(data_out), device->name, 8);
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
@@ -198,7 +198,7 @@ static void rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL use
|
||||
stream_seek_BYTE(data_out);
|
||||
}
|
||||
|
||||
stream_write_uint32(data_out, data_len);
|
||||
stream_write_UINT32(data_out, data_len);
|
||||
|
||||
if (data_len > 0)
|
||||
stream_write(data_out, stream_get_data(device->data), data_len);
|
||||
@@ -212,7 +212,7 @@ static void rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL use
|
||||
|
||||
pos = stream_get_pos(data_out);
|
||||
stream_set_pos(data_out, count_pos);
|
||||
stream_write_uint32(data_out, count);
|
||||
stream_write_UINT32(data_out, count);
|
||||
stream_set_pos(data_out, pos);
|
||||
stream_seal(data_out);
|
||||
|
||||
@@ -237,8 +237,8 @@ static void rdpdr_process_receive(rdpSvcPlugin* plugin, STREAM* data_in)
|
||||
{
|
||||
UINT16 component;
|
||||
UINT16 packetID;
|
||||
uint32 deviceID;
|
||||
uint32 status;
|
||||
UINT32 deviceID;
|
||||
UINT32 status;
|
||||
rdpdrPlugin* rdpdr = (rdpdrPlugin*) plugin;
|
||||
|
||||
stream_read_UINT16(data_in, component);
|
||||
@@ -274,8 +274,8 @@ static void rdpdr_process_receive(rdpSvcPlugin* plugin, STREAM* data_in)
|
||||
|
||||
case PAKID_CORE_DEVICE_REPLY:
|
||||
/* connect to a specific resource */
|
||||
stream_read_uint32(data_in, deviceID);
|
||||
stream_read_uint32(data_in, status);
|
||||
stream_read_UINT32(data_in, deviceID);
|
||||
stream_read_UINT32(data_in, status);
|
||||
DEBUG_SVC("RDPDR_CTYP_CORE / PAKID_CORE_DEVICE_REPLY (deviceID=%d status=0x%08X)", deviceID, status);
|
||||
break;
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ static void rdpsnd_audio_set_format(rdpsndDevicePlugin* device, rdpsndFormat* fo
|
||||
{
|
||||
}
|
||||
|
||||
static void rdpsnd_audio_set_volume(rdpsndDevicePlugin* device, uint32 value)
|
||||
static void rdpsnd_audio_set_volume(rdpsndDevicePlugin* device, UINT32 value)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -45,11 +45,11 @@ struct rdpsnd_alsa_plugin
|
||||
char* device_name;
|
||||
snd_pcm_t* out_handle;
|
||||
snd_mixer_t* mixer_handle;
|
||||
uint32 source_rate;
|
||||
uint32 actual_rate;
|
||||
UINT32 source_rate;
|
||||
UINT32 actual_rate;
|
||||
snd_pcm_format_t format;
|
||||
uint32 source_channels;
|
||||
uint32 actual_channels;
|
||||
UINT32 source_channels;
|
||||
UINT32 actual_channels;
|
||||
int bytes_per_channel;
|
||||
int wformat;
|
||||
int block_size;
|
||||
@@ -291,7 +291,7 @@ static BOOL rdpsnd_alsa_format_supported(rdpsndDevicePlugin* device, rdpsndForma
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void rdpsnd_alsa_set_volume(rdpsndDevicePlugin* device, uint32 value)
|
||||
static void rdpsnd_alsa_set_volume(rdpsndDevicePlugin* device, UINT32 value)
|
||||
{
|
||||
long left;
|
||||
long right;
|
||||
|
||||
@@ -288,9 +288,9 @@ static void rdpsnd_pulse_open(rdpsndDevicePlugin* device, rdpsndFormat* format,
|
||||
{
|
||||
buffer_attr.maxlength = pa_usec_to_bytes(pulse->latency * 2 * 1000, &pulse->sample_spec);
|
||||
buffer_attr.tlength = pa_usec_to_bytes(pulse->latency * 1000, &pulse->sample_spec);
|
||||
buffer_attr.prebuf = (uint32_t) -1;
|
||||
buffer_attr.minreq = (uint32_t) -1;
|
||||
buffer_attr.fragsize = (uint32_t) -1;
|
||||
buffer_attr.prebuf = (UINT32_t) -1;
|
||||
buffer_attr.minreq = (UINT32_t) -1;
|
||||
buffer_attr.fragsize = (UINT32_t) -1;
|
||||
flags |= PA_STREAM_ADJUST_LATENCY;
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ static void rdpsnd_pulse_set_format(rdpsndDevicePlugin* device, rdpsndFormat* fo
|
||||
rdpsnd_pulse_open(device, format, latency);
|
||||
}
|
||||
|
||||
static void rdpsnd_pulse_set_volume(rdpsndDevicePlugin* device, uint32 value)
|
||||
static void rdpsnd_pulse_set_volume(rdpsndDevicePlugin* device, UINT32 value)
|
||||
{
|
||||
pa_cvolume cv;
|
||||
pa_volume_t left;
|
||||
|
||||
@@ -56,15 +56,15 @@ struct rdpsnd_plugin
|
||||
BOOL expectingWave;
|
||||
BYTE waveData[4];
|
||||
UINT16 waveDataSize;
|
||||
uint32 wTimeStamp; /* server timestamp */
|
||||
uint32 wave_timestamp; /* client timestamp */
|
||||
UINT32 wTimeStamp; /* server timestamp */
|
||||
UINT32 wave_timestamp; /* client timestamp */
|
||||
|
||||
BOOL is_open;
|
||||
uint32 close_timestamp;
|
||||
UINT32 close_timestamp;
|
||||
|
||||
UINT16 fixed_format;
|
||||
UINT16 fixed_channel;
|
||||
uint32 fixed_rate;
|
||||
UINT32 fixed_rate;
|
||||
int latency;
|
||||
|
||||
/* Device plugin */
|
||||
@@ -74,11 +74,11 @@ struct rdpsnd_plugin
|
||||
struct data_out_item
|
||||
{
|
||||
STREAM* data_out;
|
||||
uint32 out_timestamp;
|
||||
UINT32 out_timestamp;
|
||||
};
|
||||
|
||||
/* get time in milliseconds */
|
||||
static uint32 get_mstime(void)
|
||||
static UINT32 get_mstime(void)
|
||||
{
|
||||
struct timeval tp;
|
||||
|
||||
@@ -91,7 +91,7 @@ static void rdpsnd_process_interval(rdpSvcPlugin* plugin)
|
||||
{
|
||||
rdpsndPlugin* rdpsnd = (rdpsndPlugin*)plugin;
|
||||
struct data_out_item* item;
|
||||
uint32 cur_time;
|
||||
UINT32 cur_time;
|
||||
|
||||
while (list_size(rdpsnd->data_out_list) > 0)
|
||||
{
|
||||
@@ -159,9 +159,9 @@ static void rdpsnd_process_message_formats(rdpsndPlugin* rdpsnd, STREAM* data_in
|
||||
|
||||
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_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_BYTE(data_in, rdpsnd->cBlockNo); /* cLastBlockConfirmed */
|
||||
@@ -182,9 +182,9 @@ static void rdpsnd_process_message_formats(rdpsndPlugin* rdpsnd, STREAM* data_in
|
||||
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_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_BYTE(data_out, 0); /* cLastBlockConfirmed */
|
||||
@@ -197,8 +197,8 @@ static void rdpsnd_process_message_formats(rdpsndPlugin* rdpsnd, STREAM* data_in
|
||||
format = &out_formats[n_out_formats];
|
||||
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_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);
|
||||
@@ -321,8 +321,8 @@ static void rdpsnd_process_message_wave_info(rdpsndPlugin* rdpsnd, STREAM* data_
|
||||
static void rdpsnd_process_message_wave(rdpsndPlugin* rdpsnd, STREAM* data_in)
|
||||
{
|
||||
UINT16 wTimeStamp;
|
||||
uint32 delay_ms;
|
||||
uint32 process_ms;
|
||||
UINT32 delay_ms;
|
||||
UINT32 process_ms;
|
||||
struct data_out_item* item;
|
||||
|
||||
rdpsnd->expectingWave = 0;
|
||||
@@ -367,9 +367,9 @@ static void rdpsnd_process_message_close(rdpsndPlugin* rdpsnd)
|
||||
|
||||
static void rdpsnd_process_message_setvolume(rdpsndPlugin* rdpsnd, STREAM* data_in)
|
||||
{
|
||||
uint32 dwVolume;
|
||||
UINT32 dwVolume;
|
||||
|
||||
stream_read_uint32(data_in, dwVolume);
|
||||
stream_read_UINT32(data_in, dwVolume);
|
||||
DEBUG_SVC("dwVolume 0x%X", dwVolume);
|
||||
if (rdpsnd->device)
|
||||
IFCALL(rdpsnd->device->SetVolume, rdpsnd->device, dwVolume);
|
||||
|
||||
@@ -29,7 +29,7 @@ typedef struct rdpsnd_device_plugin rdpsndDevicePlugin;
|
||||
typedef BOOL (*pcFormatSupported) (rdpsndDevicePlugin* device, rdpsndFormat* format);
|
||||
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 (*pcSetVolume) (rdpsndDevicePlugin* device, UINT32 value);
|
||||
typedef void (*pcPlay) (rdpsndDevicePlugin* device, BYTE* data, int size);
|
||||
typedef void (*pcStart) (rdpsndDevicePlugin* device);
|
||||
typedef void (*pcClose) (rdpsndDevicePlugin* device);
|
||||
|
||||
@@ -47,8 +47,8 @@ typedef struct _rdpsnd_server
|
||||
int out_frames;
|
||||
int out_pending_frames;
|
||||
|
||||
uint32 src_bytes_per_sample;
|
||||
uint32 src_bytes_per_frame;
|
||||
UINT32 src_bytes_per_sample;
|
||||
UINT32 src_bytes_per_frame;
|
||||
} rdpsnd_server;
|
||||
|
||||
#define RDPSND_PDU_INIT(_s, _msgType) \
|
||||
@@ -77,9 +77,9 @@ static BOOL rdpsnd_server_send_formats(rdpsnd_server* rdpsnd, STREAM* s)
|
||||
|
||||
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_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_BYTE(s, rdpsnd->context.block_no); /* cLastBlockConfirmed */
|
||||
@@ -90,9 +90,9 @@ static BOOL rdpsnd_server_send_formats(rdpsnd_server* rdpsnd, STREAM* s)
|
||||
{
|
||||
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); /* nSamplesPerSec */
|
||||
|
||||
stream_write_uint32(s, rdpsnd->context.server_formats[i].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 */
|
||||
|
||||
@@ -116,9 +116,9 @@ static BOOL rdpsnd_server_recv_formats(rdpsnd_server* rdpsnd, STREAM* s)
|
||||
if (stream_get_left(s) < 20)
|
||||
return FALSE;
|
||||
|
||||
stream_seek_uint32(s); /* dwFlags */
|
||||
stream_seek_uint32(s); /* dwVolume */
|
||||
stream_seek_uint32(s); /* dwPitch */
|
||||
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_BYTE(s); /* cLastBlockConfirmed */
|
||||
@@ -140,8 +140,8 @@ static BOOL rdpsnd_server_recv_formats(rdpsnd_server* rdpsnd, STREAM* s)
|
||||
|
||||
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_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);
|
||||
@@ -163,7 +163,7 @@ static void* rdpsnd_server_thread_func(void* arg)
|
||||
void* buffer;
|
||||
BYTE msgType;
|
||||
UINT16 BodySize;
|
||||
uint32 bytes_returned = 0;
|
||||
UINT32 bytes_returned = 0;
|
||||
rdpsnd_server* rdpsnd = (rdpsnd_server*) arg;
|
||||
freerdp_thread* thread = rdpsnd->rdpsnd_channel_thread;
|
||||
|
||||
@@ -368,7 +368,7 @@ static BOOL rdpsnd_server_send_audio_pdu(rdpsnd_server* rdpsnd)
|
||||
|
||||
/* Wave PDU */
|
||||
stream_check_size(s, size + fill_size);
|
||||
stream_write_uint32(s, 0); /* bPad */
|
||||
stream_write_UINT32(s, 0); /* bPad */
|
||||
stream_write(s, src + 4, size - 4);
|
||||
|
||||
if (fill_size > 0)
|
||||
|
||||
@@ -66,13 +66,13 @@ struct _SERIAL_DEVICE
|
||||
|
||||
fd_set read_fds;
|
||||
fd_set write_fds;
|
||||
uint32 nfds;
|
||||
UINT32 nfds;
|
||||
struct timeval tv;
|
||||
uint32 select_timeout;
|
||||
uint32 timeout_id;
|
||||
UINT32 select_timeout;
|
||||
UINT32 timeout_id;
|
||||
};
|
||||
|
||||
static void serial_abort_single_io(SERIAL_DEVICE* serial, uint32 file_id, uint32 abort_io, uint32 io_status);
|
||||
static void serial_abort_single_io(SERIAL_DEVICE* serial, UINT32 file_id, UINT32 abort_io, UINT32 io_status);
|
||||
static void serial_check_for_events(SERIAL_DEVICE* serial);
|
||||
static void serial_handle_async_irp(SERIAL_DEVICE* serial, IRP* irp);
|
||||
static BOOL serial_check_fds(SERIAL_DEVICE* serial);
|
||||
@@ -81,12 +81,12 @@ static void serial_process_irp_create(SERIAL_DEVICE* serial, IRP* irp)
|
||||
{
|
||||
char* path;
|
||||
SERIAL_TTY* tty;
|
||||
uint32 PathLength;
|
||||
uint32 FileId;
|
||||
UINT32 PathLength;
|
||||
UINT32 FileId;
|
||||
|
||||
stream_seek(irp->input, 28); /* DesiredAccess(4) AllocationSize(8), FileAttributes(4) */
|
||||
/* SharedAccess(4) CreateDisposition(4), CreateOptions(4) */
|
||||
stream_read_uint32(irp->input, PathLength);
|
||||
stream_read_UINT32(irp->input, PathLength);
|
||||
|
||||
freerdp_UnicodeToAsciiAlloc((WCHAR*) stream_get_tail(irp->input), &path, PathLength / 2);
|
||||
|
||||
@@ -107,7 +107,7 @@ static void serial_process_irp_create(SERIAL_DEVICE* serial, IRP* irp)
|
||||
DEBUG_SVC("%s(%d) created.", serial->path, FileId);
|
||||
}
|
||||
|
||||
stream_write_uint32(irp->output, FileId);
|
||||
stream_write_UINT32(irp->output, FileId);
|
||||
stream_write_BYTE(irp->output, 0);
|
||||
|
||||
free(path);
|
||||
@@ -142,12 +142,12 @@ static void serial_process_irp_close(SERIAL_DEVICE* serial, IRP* irp)
|
||||
static void serial_process_irp_read(SERIAL_DEVICE* serial, IRP* irp)
|
||||
{
|
||||
SERIAL_TTY* tty;
|
||||
uint32 Length;
|
||||
uint64 Offset;
|
||||
UINT32 Length;
|
||||
UINT64 Offset;
|
||||
BYTE* buffer = NULL;
|
||||
|
||||
stream_read_uint32(irp->input, Length);
|
||||
stream_read_uint64(irp->input, Offset);
|
||||
stream_read_UINT32(irp->input, Length);
|
||||
stream_read_UINT64(irp->input, Offset);
|
||||
|
||||
DEBUG_SVC("length %u offset %llu", Length, Offset);
|
||||
|
||||
@@ -179,7 +179,7 @@ static void serial_process_irp_read(SERIAL_DEVICE* serial, IRP* irp)
|
||||
}
|
||||
}
|
||||
|
||||
stream_write_uint32(irp->output, Length);
|
||||
stream_write_UINT32(irp->output, Length);
|
||||
|
||||
if (Length > 0)
|
||||
{
|
||||
@@ -195,11 +195,11 @@ static void serial_process_irp_read(SERIAL_DEVICE* serial, IRP* irp)
|
||||
static void serial_process_irp_write(SERIAL_DEVICE* serial, IRP* irp)
|
||||
{
|
||||
SERIAL_TTY* tty;
|
||||
uint32 Length;
|
||||
uint64 Offset;
|
||||
UINT32 Length;
|
||||
UINT64 Offset;
|
||||
|
||||
stream_read_uint32(irp->input, Length);
|
||||
stream_read_uint64(irp->input, Offset);
|
||||
stream_read_UINT32(irp->input, Length);
|
||||
stream_read_UINT64(irp->input, Offset);
|
||||
stream_seek(irp->input, 20); /* Padding */
|
||||
|
||||
DEBUG_SVC("length %u offset %llu", Length, Offset);
|
||||
@@ -225,7 +225,7 @@ static void serial_process_irp_write(SERIAL_DEVICE* serial, IRP* irp)
|
||||
DEBUG_SVC("write %llu-%llu to %s(%d).", Offset, Offset + Length, serial->path, tty->id);
|
||||
}
|
||||
|
||||
stream_write_uint32(irp->output, Length);
|
||||
stream_write_UINT32(irp->output, Length);
|
||||
stream_write_BYTE(irp->output, 0); /* Padding */
|
||||
|
||||
irp->Complete(irp);
|
||||
@@ -234,16 +234,16 @@ static void serial_process_irp_write(SERIAL_DEVICE* serial, IRP* irp)
|
||||
static void serial_process_irp_device_control(SERIAL_DEVICE* serial, IRP* irp)
|
||||
{
|
||||
SERIAL_TTY* tty;
|
||||
uint32 IoControlCode;
|
||||
uint32 InputBufferLength;
|
||||
uint32 OutputBufferLength;
|
||||
uint32 abort_io = SERIAL_ABORT_IO_NONE;
|
||||
UINT32 IoControlCode;
|
||||
UINT32 InputBufferLength;
|
||||
UINT32 OutputBufferLength;
|
||||
UINT32 abort_io = SERIAL_ABORT_IO_NONE;
|
||||
|
||||
DEBUG_SVC("[in] pending size %d", list_size(serial->pending_irps));
|
||||
|
||||
stream_read_uint32(irp->input, InputBufferLength);
|
||||
stream_read_uint32(irp->input, OutputBufferLength);
|
||||
stream_read_uint32(irp->input, IoControlCode);
|
||||
stream_read_UINT32(irp->input, InputBufferLength);
|
||||
stream_read_UINT32(irp->input, OutputBufferLength);
|
||||
stream_read_UINT32(irp->input, IoControlCode);
|
||||
stream_seek(irp->input, 20); /* Padding */
|
||||
|
||||
tty = serial->tty;
|
||||
@@ -436,10 +436,10 @@ int DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void serial_abort_single_io(SERIAL_DEVICE* serial, uint32 file_id, uint32 abort_io, uint32 io_status)
|
||||
static void serial_abort_single_io(SERIAL_DEVICE* serial, UINT32 file_id, UINT32 abort_io, UINT32 io_status)
|
||||
{
|
||||
IRP* irp = NULL;
|
||||
uint32 major;
|
||||
UINT32 major;
|
||||
SERIAL_TTY* tty;
|
||||
|
||||
DEBUG_SVC("[in] pending size %d", list_size(serial->pending_irps));
|
||||
@@ -478,7 +478,7 @@ static void serial_abort_single_io(SERIAL_DEVICE* serial, uint32 file_id, uint32
|
||||
/* Process a SINGLE FileId and MajorFunction */
|
||||
list_remove(serial->pending_irps, irp);
|
||||
irp->IoStatus = io_status;
|
||||
stream_write_uint32(irp->output, 0);
|
||||
stream_write_UINT32(irp->output, 0);
|
||||
irp->Complete(irp);
|
||||
|
||||
wait_obj_set(serial->in_event);
|
||||
@@ -492,7 +492,7 @@ static void serial_check_for_events(SERIAL_DEVICE* serial)
|
||||
{
|
||||
IRP* irp = NULL;
|
||||
IRP* prev;
|
||||
uint32 result = 0;
|
||||
UINT32 result = 0;
|
||||
SERIAL_TTY* tty;
|
||||
|
||||
tty = serial->tty;
|
||||
@@ -512,7 +512,7 @@ static void serial_check_for_events(SERIAL_DEVICE* serial)
|
||||
DEBUG_SVC("got event result %u", result);
|
||||
|
||||
irp->IoStatus = STATUS_SUCCESS;
|
||||
stream_write_uint32(irp->output, result);
|
||||
stream_write_UINT32(irp->output, result);
|
||||
irp->Complete(irp);
|
||||
|
||||
prev = irp;
|
||||
@@ -530,14 +530,14 @@ static void serial_check_for_events(SERIAL_DEVICE* serial)
|
||||
DEBUG_SVC("[out] pending size %d", list_size(serial->pending_irps));
|
||||
}
|
||||
|
||||
void serial_get_timeouts(SERIAL_DEVICE* serial, IRP* irp, uint32* timeout, uint32* interval_timeout)
|
||||
void serial_get_timeouts(SERIAL_DEVICE* serial, IRP* irp, UINT32* timeout, UINT32* interval_timeout)
|
||||
{
|
||||
SERIAL_TTY* tty;
|
||||
uint32 Length;
|
||||
uint32 pos;
|
||||
UINT32 Length;
|
||||
UINT32 pos;
|
||||
|
||||
pos = stream_get_pos(irp->input);
|
||||
stream_read_uint32(irp->input, Length);
|
||||
stream_read_UINT32(irp->input, Length);
|
||||
stream_set_pos(irp->input, pos);
|
||||
|
||||
DEBUG_SVC("length read %u", Length);
|
||||
@@ -552,8 +552,8 @@ void serial_get_timeouts(SERIAL_DEVICE* serial, IRP* irp, uint32* timeout, uint3
|
||||
|
||||
static void serial_handle_async_irp(SERIAL_DEVICE* serial, IRP* irp)
|
||||
{
|
||||
uint32 timeout = 0;
|
||||
uint32 itv_timeout = 0;
|
||||
UINT32 timeout = 0;
|
||||
UINT32 itv_timeout = 0;
|
||||
SERIAL_TTY* tty;
|
||||
|
||||
tty = serial->tty;
|
||||
@@ -603,7 +603,7 @@ static void __serial_check_fds(SERIAL_DEVICE* serial)
|
||||
IRP* irp;
|
||||
IRP* prev;
|
||||
SERIAL_TTY* tty;
|
||||
uint32 result = 0;
|
||||
UINT32 result = 0;
|
||||
|
||||
memset(&serial->tv, 0, sizeof(struct timeval));
|
||||
tty = serial->tty;
|
||||
@@ -639,7 +639,7 @@ static void __serial_check_fds(SERIAL_DEVICE* serial)
|
||||
DEBUG_SVC("got event result %u", result);
|
||||
|
||||
irp->IoStatus = STATUS_SUCCESS;
|
||||
stream_write_uint32(irp->output, result);
|
||||
stream_write_UINT32(irp->output, result);
|
||||
irp->Complete(irp);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -73,42 +73,42 @@
|
||||
#define TIOCOUTQ FIONWRITE
|
||||
#endif
|
||||
|
||||
static uint32 tty_write_data(SERIAL_TTY* tty, BYTE* 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();
|
||||
|
||||
uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input, STREAM* output, uint32* abort_io)
|
||||
UINT32 serial_tty_control(SERIAL_TTY* tty, UINT32 IoControlCode, STREAM* input, STREAM* output, UINT32* abort_io)
|
||||
{
|
||||
int purge_mask;
|
||||
uint32 result;
|
||||
uint32 modemstate;
|
||||
UINT32 result;
|
||||
UINT32 modemstate;
|
||||
BYTE immediate;
|
||||
uint32 ret = STATUS_SUCCESS;
|
||||
uint32 length = 0;
|
||||
uint32 pos;
|
||||
UINT32 ret = STATUS_SUCCESS;
|
||||
UINT32 length = 0;
|
||||
UINT32 pos;
|
||||
|
||||
DEBUG_SVC("in");
|
||||
|
||||
stream_seek(output, sizeof(uint32));
|
||||
stream_seek(output, sizeof(UINT32));
|
||||
|
||||
switch (IoControlCode)
|
||||
{
|
||||
case IOCTL_SERIAL_SET_BAUD_RATE:
|
||||
stream_read_uint32(input, tty->baud_rate);
|
||||
stream_read_UINT32(input, tty->baud_rate);
|
||||
tty_set_termios(tty);
|
||||
DEBUG_SVC("SERIAL_SET_BAUD_RATE %d", tty->baud_rate);
|
||||
break;
|
||||
|
||||
case IOCTL_SERIAL_GET_BAUD_RATE:
|
||||
length = 4;
|
||||
stream_write_uint32(output, tty->baud_rate);
|
||||
stream_write_UINT32(output, tty->baud_rate);
|
||||
DEBUG_SVC("SERIAL_GET_BAUD_RATE %d", tty->baud_rate);
|
||||
break;
|
||||
|
||||
case IOCTL_SERIAL_SET_QUEUE_SIZE:
|
||||
stream_read_uint32(input, tty->queue_in_size);
|
||||
stream_read_uint32(input, tty->queue_out_size);
|
||||
stream_read_UINT32(input, tty->queue_in_size);
|
||||
stream_read_UINT32(input, tty->queue_out_size);
|
||||
DEBUG_SVC("SERIAL_SET_QUEUE_SIZE in %d out %d", tty->queue_in_size, tty->queue_out_size);
|
||||
break;
|
||||
|
||||
@@ -138,7 +138,7 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
|
||||
case IOCTL_SERIAL_CONFIG_SIZE:
|
||||
DEBUG_SVC("SERIAL_CONFIG_SIZE");
|
||||
length = 4;
|
||||
stream_write_uint32(output, 0);
|
||||
stream_write_UINT32(output, 0);
|
||||
break;
|
||||
|
||||
case IOCTL_SERIAL_GET_CHARS:
|
||||
@@ -156,30 +156,30 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
|
||||
case IOCTL_SERIAL_GET_HANDFLOW:
|
||||
length = 16;
|
||||
tty_get_termios(tty);
|
||||
stream_write_uint32(output, tty->control);
|
||||
stream_write_uint32(output, tty->xonoff);
|
||||
stream_write_uint32(output, tty->onlimit);
|
||||
stream_write_uint32(output, tty->offlimit);
|
||||
stream_write_UINT32(output, tty->control);
|
||||
stream_write_UINT32(output, tty->xonoff);
|
||||
stream_write_UINT32(output, tty->onlimit);
|
||||
stream_write_UINT32(output, tty->offlimit);
|
||||
DEBUG_SVC("IOCTL_SERIAL_GET_HANDFLOW %X %X %X %X",
|
||||
tty->control, tty->xonoff, tty->onlimit, tty->offlimit);
|
||||
break;
|
||||
|
||||
case IOCTL_SERIAL_SET_HANDFLOW:
|
||||
stream_read_uint32(input, tty->control);
|
||||
stream_read_uint32(input, tty->xonoff);
|
||||
stream_read_uint32(input, tty->onlimit);
|
||||
stream_read_uint32(input, tty->offlimit);
|
||||
stream_read_UINT32(input, tty->control);
|
||||
stream_read_UINT32(input, tty->xonoff);
|
||||
stream_read_UINT32(input, tty->onlimit);
|
||||
stream_read_UINT32(input, tty->offlimit);
|
||||
DEBUG_SVC("IOCTL_SERIAL_SET_HANDFLOW %X %X %X %X",
|
||||
tty->control, tty->xonoff, tty->onlimit, tty->offlimit);
|
||||
tty_set_termios(tty);
|
||||
break;
|
||||
|
||||
case IOCTL_SERIAL_SET_TIMEOUTS:
|
||||
stream_read_uint32(input, tty->read_interval_timeout);
|
||||
stream_read_uint32(input, tty->read_total_timeout_multiplier);
|
||||
stream_read_uint32(input, tty->read_total_timeout_constant);
|
||||
stream_read_uint32(input, tty->write_total_timeout_multiplier);
|
||||
stream_read_uint32(input, tty->write_total_timeout_constant);
|
||||
stream_read_UINT32(input, tty->read_interval_timeout);
|
||||
stream_read_UINT32(input, tty->read_total_timeout_multiplier);
|
||||
stream_read_UINT32(input, tty->read_total_timeout_constant);
|
||||
stream_read_UINT32(input, tty->write_total_timeout_multiplier);
|
||||
stream_read_UINT32(input, tty->write_total_timeout_constant);
|
||||
|
||||
/* http://www.codeproject.com/KB/system/chaiyasit_t.aspx, see 'ReadIntervalTimeout' section
|
||||
http://msdn.microsoft.com/en-us/library/ms885171.aspx */
|
||||
@@ -201,21 +201,21 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
|
||||
tty->read_total_timeout_multiplier,
|
||||
tty->read_total_timeout_constant);
|
||||
length = 20;
|
||||
stream_write_uint32(output, tty->read_interval_timeout);
|
||||
stream_write_uint32(output, tty->read_total_timeout_multiplier);
|
||||
stream_write_uint32(output, tty->read_total_timeout_constant);
|
||||
stream_write_uint32(output, tty->write_total_timeout_multiplier);
|
||||
stream_write_uint32(output, tty->write_total_timeout_constant);
|
||||
stream_write_UINT32(output, tty->read_interval_timeout);
|
||||
stream_write_UINT32(output, tty->read_total_timeout_multiplier);
|
||||
stream_write_UINT32(output, tty->read_total_timeout_constant);
|
||||
stream_write_UINT32(output, tty->write_total_timeout_multiplier);
|
||||
stream_write_UINT32(output, tty->write_total_timeout_constant);
|
||||
break;
|
||||
|
||||
case IOCTL_SERIAL_GET_WAIT_MASK:
|
||||
DEBUG_SVC("SERIAL_GET_WAIT_MASK %X", tty->wait_mask);
|
||||
length = 4;
|
||||
stream_write_uint32(output, tty->wait_mask);
|
||||
stream_write_UINT32(output, tty->wait_mask);
|
||||
break;
|
||||
|
||||
case IOCTL_SERIAL_SET_WAIT_MASK:
|
||||
stream_read_uint32(input, tty->wait_mask);
|
||||
stream_read_UINT32(input, tty->wait_mask);
|
||||
DEBUG_SVC("SERIAL_SET_WAIT_MASK %X", tty->wait_mask);
|
||||
break;
|
||||
|
||||
@@ -270,19 +270,19 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
|
||||
#endif
|
||||
DEBUG_SVC("SERIAL_GET_MODEMSTATUS %X", modemstate);
|
||||
length = 4;
|
||||
stream_write_uint32(output, modemstate);
|
||||
stream_write_UINT32(output, modemstate);
|
||||
break;
|
||||
|
||||
case IOCTL_SERIAL_GET_COMMSTATUS:
|
||||
length = 18;
|
||||
stream_write_uint32(output, 0); /* Errors */
|
||||
stream_write_uint32(output, 0); /* Hold reasons */
|
||||
stream_write_UINT32(output, 0); /* Errors */
|
||||
stream_write_UINT32(output, 0); /* Hold reasons */
|
||||
|
||||
result = 0;
|
||||
#ifdef TIOCINQ
|
||||
ioctl(tty->fd, TIOCINQ, &result);
|
||||
#endif
|
||||
stream_write_uint32(output, result); /* Amount in in queue */
|
||||
stream_write_UINT32(output, result); /* Amount in in queue */
|
||||
if (result)
|
||||
DEBUG_SVC("SERIAL_GET_COMMSTATUS in queue %d", result);
|
||||
|
||||
@@ -290,7 +290,7 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
|
||||
#ifdef TIOCOUTQ
|
||||
ioctl(tty->fd, TIOCOUTQ, &result);
|
||||
#endif
|
||||
stream_write_uint32(output, result); /* Amount in out queue */
|
||||
stream_write_UINT32(output, result); /* Amount in out queue */
|
||||
DEBUG_SVC("SERIAL_GET_COMMSTATUS out queue %d", result);
|
||||
|
||||
stream_write_BYTE(output, 0); /* EofReceived */
|
||||
@@ -298,7 +298,7 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
|
||||
break;
|
||||
|
||||
case IOCTL_SERIAL_PURGE:
|
||||
stream_read_uint32(input, purge_mask);
|
||||
stream_read_UINT32(input, purge_mask);
|
||||
DEBUG_SVC("SERIAL_PURGE purge_mask %X", purge_mask);
|
||||
|
||||
/* See http://msdn.microsoft.com/en-us/library/ms901431.aspx
|
||||
@@ -327,7 +327,7 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
|
||||
if (serial_tty_get_event(tty, &result))
|
||||
{
|
||||
DEBUG_SVC("WAIT end event = %X", result);
|
||||
stream_write_uint32(output, result);
|
||||
stream_write_UINT32(output, result);
|
||||
break;
|
||||
}
|
||||
ret = STATUS_PENDING;
|
||||
@@ -363,13 +363,13 @@ uint32 serial_tty_control(SERIAL_TTY* tty, uint32 IoControlCode, STREAM* input,
|
||||
/* Write OutputBufferLength */
|
||||
pos = stream_get_pos(output);
|
||||
stream_set_pos(output, 16);
|
||||
stream_write_uint32(output, length);
|
||||
stream_write_UINT32(output, length);
|
||||
stream_set_pos(output, pos);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOL serial_tty_read(SERIAL_TTY* tty, BYTE* buffer, uint32* Length)
|
||||
BOOL serial_tty_read(SERIAL_TTY* tty, BYTE* buffer, UINT32* Length)
|
||||
{
|
||||
long timeout = 90;
|
||||
struct termios *ptermios;
|
||||
@@ -418,10 +418,10 @@ BOOL serial_tty_read(SERIAL_TTY* tty, BYTE* buffer, uint32* Length)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL serial_tty_write(SERIAL_TTY* tty, BYTE* buffer, uint32 Length)
|
||||
BOOL serial_tty_write(SERIAL_TTY* tty, BYTE* buffer, UINT32 Length)
|
||||
{
|
||||
ssize_t r;
|
||||
uint32 event_txempty = Length;
|
||||
UINT32 event_txempty = Length;
|
||||
|
||||
DEBUG_SVC("in");
|
||||
|
||||
@@ -463,7 +463,7 @@ void serial_tty_free(SERIAL_TTY* tty)
|
||||
}
|
||||
|
||||
|
||||
SERIAL_TTY* serial_tty_new(const char* path, uint32 id)
|
||||
SERIAL_TTY* serial_tty_new(const char* path, UINT32 id)
|
||||
{
|
||||
SERIAL_TTY* tty;
|
||||
|
||||
@@ -531,7 +531,7 @@ SERIAL_TTY* serial_tty_new(const char* path, uint32 id)
|
||||
return tty;
|
||||
}
|
||||
|
||||
BOOL serial_tty_get_event(SERIAL_TTY* tty, uint32* result)
|
||||
BOOL serial_tty_get_event(SERIAL_TTY* tty, UINT32* result)
|
||||
{
|
||||
int bytes;
|
||||
BOOL ret = FALSE;
|
||||
@@ -969,7 +969,7 @@ static void tty_set_termios(SERIAL_TTY* tty)
|
||||
tcsetattr(tty->fd, TCSANOW, ptermios);
|
||||
}
|
||||
|
||||
static uint32 tty_write_data(SERIAL_TTY* tty, BYTE* data, int len)
|
||||
static UINT32 tty_write_data(SERIAL_TTY* tty, BYTE* data, int len)
|
||||
{
|
||||
ssize_t r;
|
||||
|
||||
|
||||
@@ -35,24 +35,24 @@ typedef struct _SERIAL_TTY SERIAL_TTY;
|
||||
|
||||
struct _SERIAL_TTY
|
||||
{
|
||||
uint32 id;
|
||||
UINT32 id;
|
||||
int fd;
|
||||
|
||||
int dtr;
|
||||
int rts;
|
||||
uint32 control;
|
||||
uint32 xonoff;
|
||||
uint32 onlimit;
|
||||
uint32 offlimit;
|
||||
uint32 baud_rate;
|
||||
uint32 queue_in_size;
|
||||
uint32 queue_out_size;
|
||||
uint32 wait_mask;
|
||||
uint32 read_interval_timeout;
|
||||
uint32 read_total_timeout_multiplier;
|
||||
uint32 read_total_timeout_constant;
|
||||
uint32 write_total_timeout_multiplier;
|
||||
uint32 write_total_timeout_constant;
|
||||
UINT32 control;
|
||||
UINT32 xonoff;
|
||||
UINT32 onlimit;
|
||||
UINT32 offlimit;
|
||||
UINT32 baud_rate;
|
||||
UINT32 queue_in_size;
|
||||
UINT32 queue_out_size;
|
||||
UINT32 wait_mask;
|
||||
UINT32 read_interval_timeout;
|
||||
UINT32 read_total_timeout_multiplier;
|
||||
UINT32 read_total_timeout_constant;
|
||||
UINT32 write_total_timeout_multiplier;
|
||||
UINT32 write_total_timeout_constant;
|
||||
BYTE stop_bits;
|
||||
BYTE parity;
|
||||
BYTE word_length;
|
||||
@@ -66,13 +66,13 @@ struct _SERIAL_TTY
|
||||
int event_pending;
|
||||
};
|
||||
|
||||
SERIAL_TTY* serial_tty_new(const char* path, uint32 id);
|
||||
SERIAL_TTY* serial_tty_new(const char* path, UINT32 id);
|
||||
void serial_tty_free(SERIAL_TTY* tty);
|
||||
|
||||
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_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);
|
||||
BOOL serial_tty_get_event(SERIAL_TTY* tty, UINT32* result);
|
||||
|
||||
#endif /* __SERIAL_TTY_H */
|
||||
|
||||
@@ -130,7 +130,7 @@ static void* scard_thread_func(void* arg)
|
||||
}
|
||||
|
||||
/* Begin TS Client defect workaround. */
|
||||
static COMPLETIONIDINFO* scard_mark_duplicate_id(SCARD_DEVICE* scard, uint32 CompletionId)
|
||||
static COMPLETIONIDINFO* scard_mark_duplicate_id(SCARD_DEVICE* scard, UINT32 CompletionId)
|
||||
{
|
||||
/*
|
||||
* Search from the beginning of the LIST for one outstanding "CompletionID"
|
||||
@@ -157,7 +157,7 @@ static COMPLETIONIDINFO* scard_mark_duplicate_id(SCARD_DEVICE* scard, uint32 Com
|
||||
return NULL; /* Either no items in the list or no match. */
|
||||
}
|
||||
|
||||
static BOOL scard_check_for_duplicate_id(SCARD_DEVICE* scard, uint32 CompletionId)
|
||||
static BOOL scard_check_for_duplicate_id(SCARD_DEVICE* scard, UINT32 CompletionId)
|
||||
{
|
||||
/*
|
||||
* Search from the end of the LIST for one outstanding "CompletionID"
|
||||
@@ -208,7 +208,7 @@ static void scard_irp_complete(IRP* irp)
|
||||
|
||||
pos = stream_get_pos(irp->output);
|
||||
stream_set_pos(irp->output, 12);
|
||||
stream_write_uint32(irp->output, irp->IoStatus);
|
||||
stream_write_UINT32(irp->output, irp->IoStatus);
|
||||
stream_set_pos(irp->output, pos);
|
||||
|
||||
/* Begin TS Client defect workaround. */
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
*/
|
||||
struct _COMPLETIONIDINFO
|
||||
{
|
||||
uint32 ID; /* CompletionID */
|
||||
UINT32 ID; /* CompletionID */
|
||||
BOOL duplicate; /* Indicates whether or not this
|
||||
* CompletionID is a duplicate of an
|
||||
* earlier, outstanding, CompletionID.
|
||||
|
||||
@@ -84,10 +84,10 @@
|
||||
#define WIN_FILE_DEVICE_SMARTCARD 0x00000031
|
||||
|
||||
|
||||
static uint32 sc_output_string(IRP* irp, char *src, BOOL wide)
|
||||
static UINT32 sc_output_string(IRP* irp, char *src, BOOL wide)
|
||||
{
|
||||
BYTE* p;
|
||||
uint32 len;
|
||||
UINT32 len;
|
||||
|
||||
p = stream_get_tail(irp->output);
|
||||
len = strlen(src) + 1;
|
||||
@@ -113,29 +113,29 @@ static uint32 sc_output_string(IRP* irp, char *src, BOOL wide)
|
||||
return len;
|
||||
}
|
||||
|
||||
static void sc_output_alignment(IRP *irp, uint32 seed)
|
||||
static void sc_output_alignment(IRP *irp, UINT32 seed)
|
||||
{
|
||||
const uint32 field_lengths = 20;/* Remove the lengths of the fields
|
||||
const UINT32 field_lengths = 20;/* Remove the lengths of the fields
|
||||
* RDPDR_HEADER, DeviceID,
|
||||
* CompletionID, and IoStatus
|
||||
* of Section 2.2.1.5.5 of MS-RDPEFS.
|
||||
*/
|
||||
uint32 size = stream_get_length(irp->output) - field_lengths;
|
||||
uint32 add = (seed - (size % seed)) % seed;
|
||||
UINT32 size = stream_get_length(irp->output) - field_lengths;
|
||||
UINT32 add = (seed - (size % seed)) % seed;
|
||||
|
||||
if (add > 0)
|
||||
stream_write_zero(irp->output, add);
|
||||
}
|
||||
|
||||
static void sc_output_repos(IRP* irp, uint32 written)
|
||||
static void sc_output_repos(IRP* irp, UINT32 written)
|
||||
{
|
||||
uint32 add = (4 - (written % 4)) % 4;
|
||||
UINT32 add = (4 - (written % 4)) % 4;
|
||||
|
||||
if (add > 0)
|
||||
stream_write_zero(irp->output, add);
|
||||
}
|
||||
|
||||
static uint32 sc_output_return(IRP* irp, uint32 rv)
|
||||
static UINT32 sc_output_return(IRP* irp, UINT32 rv)
|
||||
{
|
||||
stream_write_zero(irp->output, 256);
|
||||
return rv;
|
||||
@@ -145,11 +145,11 @@ static void sc_output_buffer_limit(IRP* irp, char *buffer, unsigned int length,
|
||||
{
|
||||
int header = (length < 0) ? (0) : ((length > highLimit) ? (highLimit) : (length));
|
||||
|
||||
stream_write_uint32(irp->output, header);
|
||||
stream_write_UINT32(irp->output, header);
|
||||
|
||||
if (length <= 0)
|
||||
{
|
||||
stream_write_uint32(irp->output, 0);
|
||||
stream_write_UINT32(irp->output, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -170,8 +170,8 @@ static void sc_output_buffer_start_limit(IRP *irp, int length, int highLimit)
|
||||
{
|
||||
int header = (length < 0) ? (0) : ((length > highLimit) ? (highLimit) : (length));
|
||||
|
||||
stream_write_uint32(irp->output, header);
|
||||
stream_write_uint32(irp->output, 0x00000001); /* Magic DWORD - any non zero */
|
||||
stream_write_UINT32(irp->output, header);
|
||||
stream_write_UINT32(irp->output, 0x00000001); /* Magic DWORD - any non zero */
|
||||
}
|
||||
|
||||
static void sc_output_buffer_start(IRP *irp, int length)
|
||||
@@ -179,7 +179,7 @@ static void sc_output_buffer_start(IRP *irp, int length)
|
||||
sc_output_buffer_start_limit(irp, length, 0x7FFFFFFF);
|
||||
}
|
||||
|
||||
static uint32 sc_input_string(IRP* irp, char **dest, uint32 dataLength, BOOL wide)
|
||||
static UINT32 sc_input_string(IRP* irp, char **dest, UINT32 dataLength, BOOL wide)
|
||||
{
|
||||
char* buffer;
|
||||
int bufferSize;
|
||||
@@ -207,9 +207,9 @@ static uint32 sc_input_string(IRP* irp, char **dest, uint32 dataLength, BOOL wid
|
||||
return bufferSize;
|
||||
}
|
||||
|
||||
static void sc_input_repos(IRP* irp, uint32 read)
|
||||
static void sc_input_repos(IRP* irp, UINT32 read)
|
||||
{
|
||||
uint32 add = 4 - (read % 4);
|
||||
UINT32 add = 4 - (read % 4);
|
||||
|
||||
if (add < 4 && add > 0)
|
||||
stream_seek(irp->input, add);
|
||||
@@ -217,10 +217,10 @@ static void sc_input_repos(IRP* irp, uint32 read)
|
||||
|
||||
static void sc_input_reader_name(IRP* irp, char **dest, BOOL wide)
|
||||
{
|
||||
uint32 dataLength;
|
||||
UINT32 dataLength;
|
||||
|
||||
stream_seek(irp->input, 8);
|
||||
stream_read_uint32(irp->input, dataLength);
|
||||
stream_read_UINT32(irp->input, dataLength);
|
||||
|
||||
DEBUG_SCARD("datalength %d", dataLength);
|
||||
sc_input_repos(irp, sc_input_string(irp, dest, dataLength, wide));
|
||||
@@ -228,8 +228,8 @@ static void sc_input_reader_name(IRP* irp, char **dest, BOOL wide)
|
||||
|
||||
static void sc_input_skip_linked(IRP* irp)
|
||||
{
|
||||
uint32 len;
|
||||
stream_read_uint32(irp->input, len);
|
||||
UINT32 len;
|
||||
stream_read_UINT32(irp->input, len);
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
@@ -238,7 +238,7 @@ static void sc_input_skip_linked(IRP* irp)
|
||||
}
|
||||
}
|
||||
|
||||
static uint32 sc_map_state(uint32 state)
|
||||
static UINT32 sc_map_state(UINT32 state)
|
||||
{
|
||||
/* is this mapping still needed? */
|
||||
|
||||
@@ -260,28 +260,28 @@ static uint32 sc_map_state(uint32 state)
|
||||
return state;
|
||||
}
|
||||
|
||||
static uint32 handle_EstablishContext(IRP* irp)
|
||||
static UINT32 handle_EstablishContext(IRP* irp)
|
||||
{
|
||||
uint32 len, rv;
|
||||
uint32 scope;
|
||||
UINT32 len, rv;
|
||||
UINT32 scope;
|
||||
SCARDCONTEXT hContext = -1;
|
||||
|
||||
stream_seek(irp->input, 8);
|
||||
stream_read_uint32(irp->input, len);
|
||||
stream_read_UINT32(irp->input, len);
|
||||
|
||||
if (len != 8)
|
||||
return SCARD_F_INTERNAL_ERROR;
|
||||
|
||||
stream_seek_uint32(irp->input);
|
||||
stream_read_uint32(irp->input, scope);
|
||||
stream_seek_UINT32(irp->input);
|
||||
stream_read_UINT32(irp->input, scope);
|
||||
|
||||
rv = SCardEstablishContext(scope, NULL, NULL, &hContext);
|
||||
|
||||
stream_write_uint32(irp->output, 4); // cbContext
|
||||
stream_write_uint32(irp->output, -1); // ReferentID
|
||||
stream_write_UINT32(irp->output, 4); // cbContext
|
||||
stream_write_UINT32(irp->output, -1); // ReferentID
|
||||
|
||||
stream_write_uint32(irp->output, 4);
|
||||
stream_write_uint32(irp->output, hContext);
|
||||
stream_write_UINT32(irp->output, 4);
|
||||
stream_write_UINT32(irp->output, hContext);
|
||||
|
||||
/* TODO: store hContext in allowed context list */
|
||||
|
||||
@@ -289,16 +289,16 @@ static uint32 handle_EstablishContext(IRP* irp)
|
||||
return SCARD_S_SUCCESS;
|
||||
}
|
||||
|
||||
static uint32 handle_ReleaseContext(IRP* irp)
|
||||
static UINT32 handle_ReleaseContext(IRP* irp)
|
||||
{
|
||||
uint32 len, rv;
|
||||
UINT32 len, rv;
|
||||
SCARDCONTEXT hContext = -1;
|
||||
|
||||
stream_seek(irp->input, 8);
|
||||
stream_read_uint32(irp->input, len);
|
||||
stream_read_UINT32(irp->input, len);
|
||||
|
||||
stream_seek(irp->input, 0x10);
|
||||
stream_read_uint32(irp->input, hContext);
|
||||
stream_read_UINT32(irp->input, hContext);
|
||||
|
||||
rv = SCardReleaseContext(hContext);
|
||||
if (rv)
|
||||
@@ -310,13 +310,13 @@ static uint32 handle_ReleaseContext(IRP* irp)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static uint32 handle_IsValidContext(IRP* irp)
|
||||
static UINT32 handle_IsValidContext(IRP* irp)
|
||||
{
|
||||
uint32 rv;
|
||||
UINT32 rv;
|
||||
SCARDCONTEXT hContext;
|
||||
|
||||
stream_seek(irp->input, 0x1C);
|
||||
stream_read_uint32(irp->input, hContext);
|
||||
stream_read_UINT32(irp->input, hContext);
|
||||
|
||||
rv = SCardIsValidContext(hContext);
|
||||
|
||||
@@ -330,9 +330,9 @@ static uint32 handle_IsValidContext(IRP* irp)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static uint32 handle_ListReaders(IRP* irp, BOOL wide)
|
||||
static UINT32 handle_ListReaders(IRP* irp, BOOL wide)
|
||||
{
|
||||
uint32 len, rv;
|
||||
UINT32 len, rv;
|
||||
SCARDCONTEXT hContext;
|
||||
DWORD dwReaders;
|
||||
char *readerList = NULL, *walker;
|
||||
@@ -340,15 +340,15 @@ static uint32 handle_ListReaders(IRP* irp, BOOL wide)
|
||||
int pos, poslen1, poslen2;
|
||||
|
||||
stream_seek(irp->input, 8);
|
||||
stream_read_uint32(irp->input, len);
|
||||
stream_read_UINT32(irp->input, len);
|
||||
|
||||
stream_seek(irp->input, 0x1c);
|
||||
stream_read_uint32(irp->input, len);
|
||||
stream_read_UINT32(irp->input, len);
|
||||
|
||||
if (len != 4)
|
||||
return SCARD_F_INTERNAL_ERROR;
|
||||
|
||||
stream_read_uint32(irp->input, hContext);
|
||||
stream_read_UINT32(irp->input, hContext);
|
||||
|
||||
/* ignore rest of [MS-RDPESC] 2.2.2.4 ListReaders_Call */
|
||||
|
||||
@@ -371,12 +371,12 @@ static uint32 handle_ListReaders(IRP* irp, BOOL wide)
|
||||
/* DEBUG_SCARD("Success 0x%08x %d %d", (unsigned) hContext, (unsigned) cchReaders, (int) strlen(readerList));*/
|
||||
|
||||
poslen1 = stream_get_pos(irp->output);
|
||||
stream_seek_uint32(irp->output);
|
||||
stream_seek_UINT32(irp->output);
|
||||
|
||||
stream_write_uint32(irp->output, 0x01760650);
|
||||
stream_write_UINT32(irp->output, 0x01760650);
|
||||
|
||||
poslen2 = stream_get_pos(irp->output);
|
||||
stream_seek_uint32(irp->output);
|
||||
stream_seek_UINT32(irp->output);
|
||||
|
||||
walker = readerList;
|
||||
dataLength = 0;
|
||||
@@ -397,9 +397,9 @@ static uint32 handle_ListReaders(IRP* irp, BOOL wide)
|
||||
pos = stream_get_pos(irp->output);
|
||||
|
||||
stream_set_pos(irp->output, poslen1);
|
||||
stream_write_uint32(irp->output, dataLength);
|
||||
stream_write_UINT32(irp->output, dataLength);
|
||||
stream_set_pos(irp->output, poslen2);
|
||||
stream_write_uint32(irp->output, dataLength);
|
||||
stream_write_UINT32(irp->output, dataLength);
|
||||
|
||||
stream_set_pos(irp->output, pos);
|
||||
|
||||
@@ -415,7 +415,7 @@ static uint32 handle_ListReaders(IRP* irp, BOOL wide)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static uint32 handle_GetStatusChange(IRP* irp, BOOL wide)
|
||||
static UINT32 handle_GetStatusChange(IRP* irp, BOOL wide)
|
||||
{
|
||||
LONG rv;
|
||||
SCARDCONTEXT hContext;
|
||||
@@ -425,12 +425,12 @@ static uint32 handle_GetStatusChange(IRP* irp, BOOL wide)
|
||||
int i;
|
||||
|
||||
stream_seek(irp->input, 0x18);
|
||||
stream_read_uint32(irp->input, dwTimeout);
|
||||
stream_read_uint32(irp->input, readerCount);
|
||||
stream_read_UINT32(irp->input, dwTimeout);
|
||||
stream_read_UINT32(irp->input, readerCount);
|
||||
|
||||
stream_seek(irp->input, 8);
|
||||
|
||||
stream_read_uint32(irp->input, hContext);
|
||||
stream_read_UINT32(irp->input, hContext);
|
||||
|
||||
stream_seek(irp->input, 4);
|
||||
|
||||
@@ -454,9 +454,9 @@ static uint32 handle_GetStatusChange(IRP* irp, BOOL wide)
|
||||
* convert to host endian or fix the headers to
|
||||
* request the order we want
|
||||
*/
|
||||
stream_read_uint32(irp->input, cur->dwCurrentState);
|
||||
stream_read_uint32(irp->input, cur->dwEventState);
|
||||
stream_read_uint32(irp->input, cur->cbAtr);
|
||||
stream_read_UINT32(irp->input, cur->dwCurrentState);
|
||||
stream_read_UINT32(irp->input, cur->dwEventState);
|
||||
stream_read_UINT32(irp->input, cur->cbAtr);
|
||||
stream_read(irp->input, cur->rgbAtr, 32);
|
||||
|
||||
stream_seek(irp->input, 4);
|
||||
@@ -469,10 +469,10 @@ static uint32 handle_GetStatusChange(IRP* irp, BOOL wide)
|
||||
for (i = 0; i < readerCount; i++)
|
||||
{
|
||||
cur = &readerStates[i];
|
||||
uint32 dataLength;
|
||||
UINT32 dataLength;
|
||||
|
||||
stream_seek(irp->input, 8);
|
||||
stream_read_uint32(irp->input, dataLength);
|
||||
stream_read_UINT32(irp->input, dataLength);
|
||||
sc_input_repos(irp, sc_input_string(irp, (char **) &cur->szReader, dataLength, wide));
|
||||
|
||||
DEBUG_SCARD(" \"%s\"", cur->szReader ? cur->szReader : "NULL");
|
||||
@@ -496,9 +496,9 @@ static uint32 handle_GetStatusChange(IRP* irp, BOOL wide)
|
||||
else
|
||||
DEBUG_SCARD("Success");
|
||||
|
||||
stream_write_uint32(irp->output, readerCount);
|
||||
stream_write_uint32(irp->output, 0x00084dd8);
|
||||
stream_write_uint32(irp->output, readerCount);
|
||||
stream_write_UINT32(irp->output, readerCount);
|
||||
stream_write_UINT32(irp->output, 0x00084dd8);
|
||||
stream_write_UINT32(irp->output, readerCount);
|
||||
|
||||
for (i = 0; i < readerCount; i++)
|
||||
{
|
||||
@@ -510,9 +510,9 @@ static uint32 handle_GetStatusChange(IRP* irp, BOOL wide)
|
||||
(unsigned) cur->dwEventState);
|
||||
|
||||
/* TODO: do byte conversions if necessary */
|
||||
stream_write_uint32(irp->output, cur->dwCurrentState);
|
||||
stream_write_uint32(irp->output, cur->dwEventState);
|
||||
stream_write_uint32(irp->output, cur->cbAtr);
|
||||
stream_write_UINT32(irp->output, cur->dwCurrentState);
|
||||
stream_write_UINT32(irp->output, cur->dwEventState);
|
||||
stream_write_UINT32(irp->output, cur->cbAtr);
|
||||
stream_write(irp->output, cur->rgbAtr, 32);
|
||||
|
||||
stream_write_zero(irp->output, 4);
|
||||
@@ -526,13 +526,13 @@ static uint32 handle_GetStatusChange(IRP* irp, BOOL wide)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static uint32 handle_Cancel(IRP *irp)
|
||||
static UINT32 handle_Cancel(IRP *irp)
|
||||
{
|
||||
LONG rv;
|
||||
SCARDCONTEXT hContext;
|
||||
|
||||
stream_seek(irp->input, 0x1C);
|
||||
stream_read_uint32(irp->input, hContext);
|
||||
stream_read_UINT32(irp->input, hContext);
|
||||
|
||||
rv = SCardCancel(hContext);
|
||||
|
||||
@@ -546,7 +546,7 @@ static uint32 handle_Cancel(IRP *irp)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static uint32 handle_Connect(IRP* irp, BOOL wide)
|
||||
static UINT32 handle_Connect(IRP* irp, BOOL wide)
|
||||
{
|
||||
LONG rv;
|
||||
SCARDCONTEXT hContext;
|
||||
@@ -557,13 +557,13 @@ static uint32 handle_Connect(IRP* irp, BOOL wide)
|
||||
SCARDHANDLE hCard;
|
||||
|
||||
stream_seek(irp->input, 0x1c);
|
||||
stream_read_uint32(irp->input, dwShareMode);
|
||||
stream_read_uint32(irp->input, dwPreferredProtocol);
|
||||
stream_read_UINT32(irp->input, dwShareMode);
|
||||
stream_read_UINT32(irp->input, dwPreferredProtocol);
|
||||
|
||||
sc_input_reader_name(irp, &readerName, wide);
|
||||
|
||||
stream_seek(irp->input, 4);
|
||||
stream_read_uint32(irp->input, hContext);
|
||||
stream_read_UINT32(irp->input, hContext);
|
||||
|
||||
DEBUG_SCARD("(context: 0x%08x, share: 0x%08x, proto: 0x%08x, reader: \"%s\")",
|
||||
(unsigned) hContext, (unsigned) dwShareMode,
|
||||
@@ -577,13 +577,13 @@ static uint32 handle_Connect(IRP* irp, BOOL wide)
|
||||
else
|
||||
DEBUG_SCARD("Success 0x%08x", (unsigned) hCard);
|
||||
|
||||
stream_write_uint32(irp->output, 0x00000000);
|
||||
stream_write_uint32(irp->output, 0x00000000);
|
||||
stream_write_uint32(irp->output, 0x00000004);
|
||||
stream_write_uint32(irp->output, 0x016Cff34);
|
||||
stream_write_uint32(irp->output, dwActiveProtocol);
|
||||
stream_write_uint32(irp->output, 0x00000004);
|
||||
stream_write_uint32(irp->output, hCard);
|
||||
stream_write_UINT32(irp->output, 0x00000000);
|
||||
stream_write_UINT32(irp->output, 0x00000000);
|
||||
stream_write_UINT32(irp->output, 0x00000004);
|
||||
stream_write_UINT32(irp->output, 0x016Cff34);
|
||||
stream_write_UINT32(irp->output, dwActiveProtocol);
|
||||
stream_write_UINT32(irp->output, 0x00000004);
|
||||
stream_write_UINT32(irp->output, hCard);
|
||||
|
||||
sc_output_alignment(irp, 8);
|
||||
|
||||
@@ -591,7 +591,7 @@ static uint32 handle_Connect(IRP* irp, BOOL wide)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static uint32 handle_Reconnect(IRP* irp)
|
||||
static UINT32 handle_Reconnect(IRP* irp)
|
||||
{
|
||||
LONG rv;
|
||||
SCARDCONTEXT hContext;
|
||||
@@ -602,14 +602,14 @@ static uint32 handle_Reconnect(IRP* irp)
|
||||
DWORD dwActiveProtocol = 0;
|
||||
|
||||
stream_seek(irp->input, 0x20);
|
||||
stream_read_uint32(irp->input, dwShareMode);
|
||||
stream_read_uint32(irp->input, dwPreferredProtocol);
|
||||
stream_read_uint32(irp->input, dwInitialization);
|
||||
stream_read_UINT32(irp->input, dwShareMode);
|
||||
stream_read_UINT32(irp->input, dwPreferredProtocol);
|
||||
stream_read_UINT32(irp->input, dwInitialization);
|
||||
|
||||
stream_seek(irp->input, 0x4);
|
||||
stream_read_uint32(irp->input, hContext);
|
||||
stream_read_UINT32(irp->input, hContext);
|
||||
stream_seek(irp->input, 0x4);
|
||||
stream_read_uint32(irp->input, hCard);
|
||||
stream_read_UINT32(irp->input, hCard);
|
||||
|
||||
DEBUG_SCARD("(context: 0x%08x, hcard: 0x%08x, share: 0x%08x, proto: 0x%08x, init: 0x%08x)",
|
||||
(unsigned) hContext, (unsigned) hCard,
|
||||
@@ -623,13 +623,13 @@ static uint32 handle_Reconnect(IRP* irp)
|
||||
else
|
||||
DEBUG_SCARD("Success (proto: 0x%08x)", (unsigned) dwActiveProtocol);
|
||||
|
||||
stream_write_uint32(irp->output, dwActiveProtocol);
|
||||
stream_write_UINT32(irp->output, dwActiveProtocol);
|
||||
sc_output_alignment(irp, 8);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
static uint32 handle_Disconnect(IRP* irp)
|
||||
static UINT32 handle_Disconnect(IRP* irp)
|
||||
{
|
||||
LONG rv;
|
||||
SCARDCONTEXT hContext;
|
||||
@@ -637,11 +637,11 @@ static uint32 handle_Disconnect(IRP* irp)
|
||||
DWORD dwDisposition = 0;
|
||||
|
||||
stream_seek(irp->input, 0x20);
|
||||
stream_read_uint32(irp->input, dwDisposition);
|
||||
stream_read_UINT32(irp->input, dwDisposition);
|
||||
stream_seek(irp->input, 4);
|
||||
stream_read_uint32(irp->input, hContext);
|
||||
stream_read_UINT32(irp->input, hContext);
|
||||
stream_seek(irp->input, 4);
|
||||
stream_read_uint32(irp->input, hCard);
|
||||
stream_read_UINT32(irp->input, hCard);
|
||||
|
||||
DEBUG_SCARD("(context: 0x%08x, hcard: 0x%08x, disposition: 0x%08x)",
|
||||
(unsigned) hContext, (unsigned) hCard, (unsigned) dwDisposition);
|
||||
@@ -658,13 +658,13 @@ static uint32 handle_Disconnect(IRP* irp)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static uint32 handle_BeginTransaction(IRP* irp)
|
||||
static UINT32 handle_BeginTransaction(IRP* irp)
|
||||
{
|
||||
LONG rv;
|
||||
SCARDCONTEXT hCard;
|
||||
|
||||
stream_seek(irp->input, 0x30);
|
||||
stream_read_uint32(irp->input, hCard);
|
||||
stream_read_UINT32(irp->input, hCard);
|
||||
|
||||
rv = SCardBeginTransaction(hCard);
|
||||
|
||||
@@ -678,17 +678,17 @@ static uint32 handle_BeginTransaction(IRP* irp)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static uint32 handle_EndTransaction(IRP* irp)
|
||||
static UINT32 handle_EndTransaction(IRP* irp)
|
||||
{
|
||||
LONG rv;
|
||||
SCARDCONTEXT hCard;
|
||||
DWORD dwDisposition = 0;
|
||||
|
||||
stream_seek(irp->input, 0x20);
|
||||
stream_read_uint32(irp->input, dwDisposition);
|
||||
stream_read_UINT32(irp->input, dwDisposition);
|
||||
|
||||
stream_seek(irp->input, 0x0C);
|
||||
stream_read_uint32(irp->input, hCard);
|
||||
stream_read_UINT32(irp->input, hCard);
|
||||
|
||||
rv = SCardEndTransaction(hCard, dwDisposition);
|
||||
|
||||
@@ -702,7 +702,7 @@ static uint32 handle_EndTransaction(IRP* irp)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static uint32 handle_State(IRP* irp)
|
||||
static UINT32 handle_State(IRP* irp)
|
||||
{
|
||||
LONG rv;
|
||||
SCARDHANDLE hCard;
|
||||
@@ -717,10 +717,10 @@ static uint32 handle_State(IRP* irp)
|
||||
#endif
|
||||
|
||||
stream_seek(irp->input, 0x24);
|
||||
stream_seek_uint32(irp->input); /* atrLen */
|
||||
stream_seek_UINT32(irp->input); /* atrLen */
|
||||
|
||||
stream_seek(irp->input, 0x0c);
|
||||
stream_read_uint32(irp->input, hCard);
|
||||
stream_read_UINT32(irp->input, hCard);
|
||||
stream_seek(irp->input, 0x04);
|
||||
|
||||
#ifdef SCARD_AUTOALLOCATE
|
||||
@@ -752,11 +752,11 @@ static uint32 handle_State(IRP* irp)
|
||||
|
||||
state = sc_map_state(state);
|
||||
|
||||
stream_write_uint32(irp->output, state);
|
||||
stream_write_uint32(irp->output, protocol);
|
||||
stream_write_uint32(irp->output, atrLen);
|
||||
stream_write_uint32(irp->output, 0x00000001);
|
||||
stream_write_uint32(irp->output, atrLen);
|
||||
stream_write_UINT32(irp->output, state);
|
||||
stream_write_UINT32(irp->output, protocol);
|
||||
stream_write_UINT32(irp->output, atrLen);
|
||||
stream_write_UINT32(irp->output, 0x00000001);
|
||||
stream_write_UINT32(irp->output, atrLen);
|
||||
stream_write(irp->output, pbAtr, atrLen);
|
||||
|
||||
sc_output_repos(irp, atrLen);
|
||||
@@ -780,7 +780,7 @@ static DWORD handle_Status(IRP *irp, BOOL wide)
|
||||
DWORD atrLen = 0;
|
||||
char * readerName;
|
||||
BYTE pbAtr[MAX_ATR_SIZE];
|
||||
uint32 dataLength;
|
||||
UINT32 dataLength;
|
||||
int pos, poslen1, poslen2;
|
||||
|
||||
#ifdef WITH_DEBUG_SCARD
|
||||
@@ -788,10 +788,10 @@ static DWORD handle_Status(IRP *irp, BOOL wide)
|
||||
#endif
|
||||
|
||||
stream_seek(irp->input, 0x24);
|
||||
stream_read_uint32(irp->input, readerLen);
|
||||
stream_read_uint32(irp->input, atrLen);
|
||||
stream_read_UINT32(irp->input, readerLen);
|
||||
stream_read_UINT32(irp->input, atrLen);
|
||||
stream_seek(irp->input, 0x0c);
|
||||
stream_read_uint32(irp->input, hCard);
|
||||
stream_read_UINT32(irp->input, hCard);
|
||||
stream_seek(irp->input, 0x4);
|
||||
|
||||
atrLen = MAX_ATR_SIZE;
|
||||
@@ -826,18 +826,18 @@ static DWORD handle_Status(IRP *irp, BOOL wide)
|
||||
state = sc_map_state(state);
|
||||
|
||||
poslen1 = stream_get_pos(irp->output);
|
||||
stream_write_uint32(irp->output, readerLen);
|
||||
stream_write_uint32(irp->output, 0x00020000);
|
||||
stream_write_uint32(irp->output, state);
|
||||
stream_write_uint32(irp->output, protocol);
|
||||
stream_write_UINT32(irp->output, readerLen);
|
||||
stream_write_UINT32(irp->output, 0x00020000);
|
||||
stream_write_UINT32(irp->output, state);
|
||||
stream_write_UINT32(irp->output, protocol);
|
||||
stream_write(irp->output, pbAtr, atrLen);
|
||||
|
||||
if (atrLen < 32)
|
||||
stream_write_zero(irp->output, 32 - atrLen);
|
||||
stream_write_uint32(irp->output, atrLen);
|
||||
stream_write_UINT32(irp->output, atrLen);
|
||||
|
||||
poslen2 = stream_get_pos(irp->output);
|
||||
stream_write_uint32(irp->output, readerLen);
|
||||
stream_write_UINT32(irp->output, readerLen);
|
||||
|
||||
dataLength = sc_output_string(irp, readerName, wide);
|
||||
dataLength += sc_output_string(irp, "\0", wide);
|
||||
@@ -845,9 +845,9 @@ static DWORD handle_Status(IRP *irp, BOOL wide)
|
||||
|
||||
pos = stream_get_pos(irp->output);
|
||||
stream_set_pos(irp->output, poslen1);
|
||||
stream_write_uint32(irp->output,dataLength);
|
||||
stream_write_UINT32(irp->output,dataLength);
|
||||
stream_set_pos(irp->output, poslen2);
|
||||
stream_write_uint32(irp->output,dataLength);
|
||||
stream_write_UINT32(irp->output,dataLength);
|
||||
stream_set_pos(irp->output, pos);
|
||||
|
||||
sc_output_alignment(irp, 8);
|
||||
@@ -862,42 +862,42 @@ static DWORD handle_Status(IRP *irp, BOOL wide)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static uint32 handle_Transmit(IRP* irp)
|
||||
static UINT32 handle_Transmit(IRP* irp)
|
||||
{
|
||||
LONG rv;
|
||||
SCARDCONTEXT hCard;
|
||||
uint32 map[7], linkedLen;
|
||||
UINT32 map[7], linkedLen;
|
||||
SCARD_IO_REQUEST pioSendPci, pioRecvPci, *pPioRecvPci;
|
||||
DWORD cbSendLength = 0, cbRecvLength = 0;
|
||||
BYTE *sendBuf = NULL, *recvBuf = NULL;
|
||||
|
||||
stream_seek(irp->input, 0x14);
|
||||
stream_read_uint32(irp->input, map[0]);
|
||||
stream_read_UINT32(irp->input, map[0]);
|
||||
stream_seek(irp->input, 0x4);
|
||||
stream_read_uint32(irp->input, map[1]);
|
||||
stream_read_UINT32(irp->input, map[1]);
|
||||
|
||||
stream_read_uint32(irp->input, pioSendPci.dwProtocol);
|
||||
stream_read_uint32(irp->input, pioSendPci.cbPciLength);
|
||||
stream_read_UINT32(irp->input, pioSendPci.dwProtocol);
|
||||
stream_read_UINT32(irp->input, pioSendPci.cbPciLength);
|
||||
|
||||
stream_read_uint32(irp->input, map[2]);
|
||||
stream_read_uint32(irp->input, cbSendLength);
|
||||
stream_read_uint32(irp->input, map[3]);
|
||||
stream_read_uint32(irp->input, map[4]);
|
||||
stream_read_uint32(irp->input, map[5]);
|
||||
stream_read_uint32(irp->input, cbRecvLength);
|
||||
stream_read_UINT32(irp->input, map[2]);
|
||||
stream_read_UINT32(irp->input, cbSendLength);
|
||||
stream_read_UINT32(irp->input, map[3]);
|
||||
stream_read_UINT32(irp->input, map[4]);
|
||||
stream_read_UINT32(irp->input, map[5]);
|
||||
stream_read_UINT32(irp->input, cbRecvLength);
|
||||
|
||||
if (map[0] & SCARD_INPUT_LINKED)
|
||||
sc_input_skip_linked(irp);
|
||||
|
||||
stream_seek(irp->input, 4);
|
||||
stream_read_uint32(irp->input, hCard);
|
||||
stream_read_UINT32(irp->input, hCard);
|
||||
|
||||
if (map[2] & SCARD_INPUT_LINKED)
|
||||
{
|
||||
/* sendPci */
|
||||
stream_read_uint32(irp->input, linkedLen);
|
||||
stream_read_UINT32(irp->input, linkedLen);
|
||||
|
||||
stream_read_uint32(irp->input, pioSendPci.dwProtocol);
|
||||
stream_read_UINT32(irp->input, pioSendPci.dwProtocol);
|
||||
stream_seek(irp->input, linkedLen - 4);
|
||||
|
||||
sc_input_repos(irp, linkedLen);
|
||||
@@ -907,7 +907,7 @@ static uint32 handle_Transmit(IRP* irp)
|
||||
if (map[3] & SCARD_INPUT_LINKED)
|
||||
{
|
||||
/* send buffer */
|
||||
stream_read_uint32(irp->input, linkedLen);
|
||||
stream_read_UINT32(irp->input, linkedLen);
|
||||
|
||||
sendBuf = malloc(linkedLen);
|
||||
stream_read(irp->input, sendBuf, linkedLen);
|
||||
@@ -920,18 +920,18 @@ static uint32 handle_Transmit(IRP* irp)
|
||||
if (map[4] & SCARD_INPUT_LINKED)
|
||||
{
|
||||
/* recvPci */
|
||||
stream_read_uint32(irp->input, linkedLen);
|
||||
stream_read_UINT32(irp->input, linkedLen);
|
||||
|
||||
stream_read_uint32(irp->input, pioRecvPci.dwProtocol);
|
||||
stream_read_UINT32(irp->input, pioRecvPci.dwProtocol);
|
||||
stream_seek(irp->input, linkedLen - 4);
|
||||
|
||||
sc_input_repos(irp, linkedLen);
|
||||
|
||||
stream_read_uint32(irp->input, map[6]);
|
||||
stream_read_UINT32(irp->input, map[6]);
|
||||
if (map[6] & SCARD_INPUT_LINKED)
|
||||
{
|
||||
/* not sure what this is */
|
||||
stream_read_uint32(irp->input, linkedLen);
|
||||
stream_read_UINT32(irp->input, linkedLen);
|
||||
stream_seek(irp->input, linkedLen);
|
||||
|
||||
sc_input_repos(irp, linkedLen);
|
||||
@@ -959,7 +959,7 @@ static uint32 handle_Transmit(IRP* irp)
|
||||
{
|
||||
DEBUG_SCARD("Success (%d bytes)", (int) cbRecvLength);
|
||||
|
||||
stream_write_uint32(irp->output, 0); /* pioRecvPci 0x00; */
|
||||
stream_write_UINT32(irp->output, 0); /* pioRecvPci 0x00; */
|
||||
|
||||
sc_output_buffer_start(irp, cbRecvLength); /* start of recvBuf output */
|
||||
|
||||
@@ -974,32 +974,32 @@ static uint32 handle_Transmit(IRP* irp)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static uint32 handle_Control(IRP* irp)
|
||||
static UINT32 handle_Control(IRP* irp)
|
||||
{
|
||||
LONG rv;
|
||||
SCARDCONTEXT hContext;
|
||||
SCARDHANDLE hCard;
|
||||
uint32 map[3];
|
||||
uint32 controlCode;
|
||||
uint32 controlFunction;
|
||||
UINT32 map[3];
|
||||
UINT32 controlCode;
|
||||
UINT32 controlFunction;
|
||||
BYTE *recvBuffer = NULL, *sendBuffer = NULL;
|
||||
uint32 recvLength;
|
||||
UINT32 recvLength;
|
||||
DWORD nBytesReturned;
|
||||
DWORD outBufferSize;
|
||||
|
||||
stream_seek(irp->input, 0x14);
|
||||
stream_read_uint32(irp->input, map[0]);
|
||||
stream_read_UINT32(irp->input, map[0]);
|
||||
stream_seek(irp->input, 0x4);
|
||||
stream_read_uint32(irp->input, map[1]);
|
||||
stream_read_uint32(irp->input, controlCode);
|
||||
stream_read_uint32(irp->input, recvLength);
|
||||
stream_read_uint32(irp->input, map[2]);
|
||||
stream_read_UINT32(irp->input, map[1]);
|
||||
stream_read_UINT32(irp->input, controlCode);
|
||||
stream_read_UINT32(irp->input, recvLength);
|
||||
stream_read_UINT32(irp->input, map[2]);
|
||||
stream_seek(irp->input, 0x4);
|
||||
stream_read_uint32(irp->input, outBufferSize);
|
||||
stream_read_UINT32(irp->input, outBufferSize);
|
||||
stream_seek(irp->input, 0x4);
|
||||
stream_read_uint32(irp->input, hContext);
|
||||
stream_read_UINT32(irp->input, hContext);
|
||||
stream_seek(irp->input, 0x4);
|
||||
stream_read_uint32(irp->input, hCard);
|
||||
stream_read_UINT32(irp->input, hCard);
|
||||
|
||||
/* Translate Windows SCARD_CTL_CODE's to corresponding local code */
|
||||
if (WIN_CTL_DEVICE_TYPE(controlCode) == WIN_FILE_DEVICE_SMARTCARD)
|
||||
@@ -1012,7 +1012,7 @@ static uint32 handle_Control(IRP* irp)
|
||||
if (map[2] & SCARD_INPUT_LINKED)
|
||||
{
|
||||
/* read real input size */
|
||||
stream_read_uint32(irp->input, recvLength);
|
||||
stream_read_UINT32(irp->input, recvLength);
|
||||
|
||||
recvBuffer = malloc(recvLength);
|
||||
|
||||
@@ -1036,9 +1036,9 @@ static uint32 handle_Control(IRP* irp)
|
||||
else
|
||||
DEBUG_SCARD("Success (out: %u bytes)", (unsigned) nBytesReturned);
|
||||
|
||||
stream_write_uint32(irp->output, (uint32) nBytesReturned);
|
||||
stream_write_uint32(irp->output, 0x00000004);
|
||||
stream_write_uint32(irp->output, nBytesReturned);
|
||||
stream_write_UINT32(irp->output, (UINT32) nBytesReturned);
|
||||
stream_write_UINT32(irp->output, 0x00000004);
|
||||
stream_write_UINT32(irp->output, nBytesReturned);
|
||||
|
||||
if (nBytesReturned > 0)
|
||||
{
|
||||
@@ -1054,7 +1054,7 @@ static uint32 handle_Control(IRP* irp)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static uint32 handle_GetAttrib(IRP* irp)
|
||||
static UINT32 handle_GetAttrib(IRP* irp)
|
||||
{
|
||||
LONG rv;
|
||||
SCARDHANDLE hCard;
|
||||
@@ -1063,11 +1063,11 @@ static uint32 handle_GetAttrib(IRP* irp)
|
||||
BYTE* pbAttr = NULL;
|
||||
|
||||
stream_seek(irp->input, 0x20);
|
||||
stream_read_uint32(irp->input, dwAttrId);
|
||||
stream_read_UINT32(irp->input, dwAttrId);
|
||||
stream_seek(irp->input, 0x4);
|
||||
stream_read_uint32(irp->input, dwAttrLen);
|
||||
stream_read_UINT32(irp->input, dwAttrLen);
|
||||
stream_seek(irp->input, 0xC);
|
||||
stream_read_uint32(irp->input, hCard);
|
||||
stream_read_UINT32(irp->input, hCard);
|
||||
|
||||
DEBUG_SCARD("hcard: 0x%08x, attrib: 0x%08x (%d bytes)",
|
||||
(unsigned) hCard, (unsigned) dwAttrId, (int) dwAttrLen);
|
||||
@@ -1147,9 +1147,9 @@ static uint32 handle_GetAttrib(IRP* irp)
|
||||
{
|
||||
DEBUG_SCARD("Success (%d bytes)", (int) dwAttrLen);
|
||||
|
||||
stream_write_uint32(irp->output, dwAttrLen);
|
||||
stream_write_uint32(irp->output, 0x00000200);
|
||||
stream_write_uint32(irp->output, dwAttrLen);
|
||||
stream_write_UINT32(irp->output, dwAttrLen);
|
||||
stream_write_UINT32(irp->output, 0x00000200);
|
||||
stream_write_UINT32(irp->output, dwAttrLen);
|
||||
|
||||
if (!pbAttr)
|
||||
{
|
||||
@@ -1161,7 +1161,7 @@ static uint32 handle_GetAttrib(IRP* irp)
|
||||
}
|
||||
sc_output_repos(irp, dwAttrLen);
|
||||
/* align to multiple of 4 */
|
||||
stream_write_uint32(irp->output, 0);
|
||||
stream_write_UINT32(irp->output, 0);
|
||||
}
|
||||
sc_output_alignment(irp, 8);
|
||||
|
||||
@@ -1170,13 +1170,13 @@ static uint32 handle_GetAttrib(IRP* irp)
|
||||
return rv;
|
||||
}
|
||||
|
||||
static uint32 handle_AccessStartedEvent(IRP* irp)
|
||||
static UINT32 handle_AccessStartedEvent(IRP* irp)
|
||||
{
|
||||
sc_output_alignment(irp, 8);
|
||||
return SCARD_S_SUCCESS;
|
||||
}
|
||||
|
||||
void scard_error(SCARD_DEVICE* scard, IRP* irp, uint32 ntstatus)
|
||||
void scard_error(SCARD_DEVICE* scard, IRP* irp, UINT32 ntstatus)
|
||||
{
|
||||
/* [MS-RDPESC] 3.1.4.4 */
|
||||
printf("scard processing error %x\n", ntstatus);
|
||||
@@ -1189,19 +1189,19 @@ void scard_error(SCARD_DEVICE* scard, IRP* irp, uint32 ntstatus)
|
||||
/* http://msdn.microsoft.com/en-gb/library/ms938473.aspx */
|
||||
typedef struct _SERVER_SCARD_ATRMASK
|
||||
{
|
||||
uint32 cbAtr;
|
||||
UINT32 cbAtr;
|
||||
BYTE rgbAtr[36];
|
||||
BYTE rgbMask[36];
|
||||
}
|
||||
SERVER_SCARD_ATRMASK;
|
||||
|
||||
static uint32 handle_LocateCardsByATR(IRP* irp, BOOL wide)
|
||||
static UINT32 handle_LocateCardsByATR(IRP* irp, BOOL wide)
|
||||
{
|
||||
LONG rv;
|
||||
int i, j, k;
|
||||
SCARDCONTEXT hContext;
|
||||
uint32 atrMaskCount = 0;
|
||||
uint32 readerCount = 0;
|
||||
UINT32 atrMaskCount = 0;
|
||||
UINT32 readerCount = 0;
|
||||
SCARD_READERSTATE* cur = NULL;
|
||||
SCARD_READERSTATE* rsCur = NULL;
|
||||
SCARD_READERSTATE* readerStates = NULL;
|
||||
@@ -1209,8 +1209,8 @@ static uint32 handle_LocateCardsByATR(IRP* irp, BOOL wide)
|
||||
SERVER_SCARD_ATRMASK* pAtrMasks = NULL;
|
||||
|
||||
stream_seek(irp->input, 0x2C);
|
||||
stream_read_uint32(irp->input, hContext);
|
||||
stream_read_uint32(irp->input, atrMaskCount);
|
||||
stream_read_UINT32(irp->input, hContext);
|
||||
stream_read_UINT32(irp->input, atrMaskCount);
|
||||
|
||||
pAtrMasks = malloc(atrMaskCount * sizeof(SERVER_SCARD_ATRMASK));
|
||||
|
||||
@@ -1219,12 +1219,12 @@ static uint32 handle_LocateCardsByATR(IRP* irp, BOOL wide)
|
||||
|
||||
for (i = 0; i < atrMaskCount; i++)
|
||||
{
|
||||
stream_read_uint32(irp->input, pAtrMasks[i].cbAtr);
|
||||
stream_read_UINT32(irp->input, pAtrMasks[i].cbAtr);
|
||||
stream_read(irp->input, pAtrMasks[i].rgbAtr, 36);
|
||||
stream_read(irp->input, pAtrMasks[i].rgbMask, 36);
|
||||
}
|
||||
|
||||
stream_read_uint32(irp->input, readerCount);
|
||||
stream_read_UINT32(irp->input, readerCount);
|
||||
|
||||
readerStates = xzalloc(readerCount * sizeof(SCARD_READERSTATE));
|
||||
|
||||
@@ -1242,9 +1242,9 @@ static uint32 handle_LocateCardsByATR(IRP* irp, BOOL wide)
|
||||
* convert to host endian or fix the headers to
|
||||
* request the order we want
|
||||
*/
|
||||
stream_read_uint32(irp->input, cur->dwCurrentState);
|
||||
stream_read_uint32(irp->input, cur->dwEventState);
|
||||
stream_read_uint32(irp->input, cur->cbAtr);
|
||||
stream_read_UINT32(irp->input, cur->dwCurrentState);
|
||||
stream_read_UINT32(irp->input, cur->dwEventState);
|
||||
stream_read_UINT32(irp->input, cur->cbAtr);
|
||||
stream_read(irp->input, cur->rgbAtr, 32);
|
||||
|
||||
stream_seek(irp->input, 4);
|
||||
@@ -1258,10 +1258,10 @@ static uint32 handle_LocateCardsByATR(IRP* irp, BOOL wide)
|
||||
for (i = 0; i < readerCount; i++)
|
||||
{
|
||||
cur = &readerStates[i];
|
||||
uint32 dataLength;
|
||||
UINT32 dataLength;
|
||||
|
||||
stream_seek(irp->input, 8);
|
||||
stream_read_uint32(irp->input, dataLength);
|
||||
stream_read_UINT32(irp->input, dataLength);
|
||||
sc_input_repos(irp, sc_input_string(irp, (char **) &cur->szReader, dataLength, wide));
|
||||
|
||||
DEBUG_SCARD(" \"%s\"", cur->szReader ? cur->szReader : "NULL");
|
||||
@@ -1304,15 +1304,15 @@ static uint32 handle_LocateCardsByATR(IRP* irp, BOOL wide)
|
||||
}
|
||||
}
|
||||
|
||||
stream_write_uint32(irp->output, readerCount);
|
||||
stream_write_uint32(irp->output, 0x00084dd8);
|
||||
stream_write_uint32(irp->output, readerCount);
|
||||
stream_write_UINT32(irp->output, readerCount);
|
||||
stream_write_UINT32(irp->output, 0x00084dd8);
|
||||
stream_write_UINT32(irp->output, readerCount);
|
||||
|
||||
for (i = 0, rsCur = readerStates; i < readerCount; i++, rsCur++)
|
||||
{
|
||||
stream_write_uint32(irp->output, cur->dwCurrentState);
|
||||
stream_write_uint32(irp->output, cur->dwEventState);
|
||||
stream_write_uint32(irp->output, cur->cbAtr);
|
||||
stream_write_UINT32(irp->output, cur->dwCurrentState);
|
||||
stream_write_UINT32(irp->output, cur->dwEventState);
|
||||
stream_write_UINT32(irp->output, cur->cbAtr);
|
||||
stream_write(irp->output, cur->rgbAtr, 32);
|
||||
|
||||
stream_write_zero(irp->output, 4);
|
||||
@@ -1329,11 +1329,11 @@ static uint32 handle_LocateCardsByATR(IRP* irp, BOOL wide)
|
||||
|
||||
BOOL scard_async_op(IRP* irp)
|
||||
{
|
||||
uint32 ioctl_code;
|
||||
UINT32 ioctl_code;
|
||||
|
||||
/* peek ahead */
|
||||
stream_seek(irp->input, 8);
|
||||
stream_read_uint32(irp->input, ioctl_code);
|
||||
stream_read_UINT32(irp->input, ioctl_code);
|
||||
stream_rewind(irp->input, 12);
|
||||
|
||||
switch (ioctl_code)
|
||||
@@ -1369,22 +1369,22 @@ BOOL scard_async_op(IRP* irp)
|
||||
|
||||
void scard_device_control(SCARD_DEVICE* scard, IRP* irp)
|
||||
{
|
||||
uint32 pos;
|
||||
uint32 result;
|
||||
uint32 result_pos;
|
||||
uint32 output_len;
|
||||
uint32 input_len;
|
||||
uint32 ioctl_code;
|
||||
uint32 stream_len;
|
||||
uint32 irp_result_pos;
|
||||
uint32 output_len_pos;
|
||||
const uint32 header_lengths = 16; /* MS-RPCE, Sections 2.2.6.1
|
||||
UINT32 pos;
|
||||
UINT32 result;
|
||||
UINT32 result_pos;
|
||||
UINT32 output_len;
|
||||
UINT32 input_len;
|
||||
UINT32 ioctl_code;
|
||||
UINT32 stream_len;
|
||||
UINT32 irp_result_pos;
|
||||
UINT32 output_len_pos;
|
||||
const UINT32 header_lengths = 16; /* MS-RPCE, Sections 2.2.6.1
|
||||
* and 2.2.6.2.
|
||||
*/
|
||||
|
||||
stream_read_uint32(irp->input, output_len);
|
||||
stream_read_uint32(irp->input, input_len);
|
||||
stream_read_uint32(irp->input, ioctl_code);
|
||||
stream_read_UINT32(irp->input, output_len);
|
||||
stream_read_UINT32(irp->input, input_len);
|
||||
stream_read_UINT32(irp->input, ioctl_code);
|
||||
|
||||
stream_seek(irp->input, 20); /* padding */
|
||||
|
||||
@@ -1397,20 +1397,20 @@ void scard_device_control(SCARD_DEVICE* scard, IRP* irp)
|
||||
|
||||
irp_result_pos = stream_get_pos(irp->output);
|
||||
|
||||
stream_write_uint32(irp->output, 0x00000000); /* MS-RDPEFS
|
||||
stream_write_UINT32(irp->output, 0x00000000); /* MS-RDPEFS
|
||||
* OutputBufferLength
|
||||
* will be updated
|
||||
* later in this
|
||||
* function.
|
||||
*/
|
||||
/* [MS-RPCE] 2.2.6.1 */
|
||||
stream_write_uint32(irp->output, 0x00081001); /* len 8, LE, v1 */
|
||||
stream_write_uint32(irp->output, 0xcccccccc); /* filler */
|
||||
stream_write_UINT32(irp->output, 0x00081001); /* len 8, LE, v1 */
|
||||
stream_write_UINT32(irp->output, 0xcccccccc); /* filler */
|
||||
|
||||
output_len_pos = stream_get_pos(irp->output);
|
||||
stream_seek(irp->output, 4); /* size */
|
||||
|
||||
stream_write_uint32(irp->output, 0x0); /* filler */
|
||||
stream_write_UINT32(irp->output, 0x0); /* filler */
|
||||
|
||||
result_pos = stream_get_pos(irp->output);
|
||||
stream_seek(irp->output, 4); /* result */
|
||||
@@ -1530,16 +1530,16 @@ void scard_device_control(SCARD_DEVICE* scard, IRP* irp)
|
||||
pos = stream_get_pos(irp->output);
|
||||
stream_len = pos - irp_result_pos - 4; /* Value of OutputBufferLength */
|
||||
stream_set_pos(irp->output, irp_result_pos);
|
||||
stream_write_uint32(irp->output, stream_len);
|
||||
stream_write_UINT32(irp->output, stream_len);
|
||||
|
||||
stream_set_pos(irp->output, output_len_pos);
|
||||
/* Remove the effect of the MS-RPCE Common Type Header and Private
|
||||
* Header (Sections 2.2.6.1 and 2.2.6.2).
|
||||
*/
|
||||
stream_write_uint32(irp->output, stream_len - header_lengths);
|
||||
stream_write_UINT32(irp->output, stream_len - header_lengths);
|
||||
|
||||
stream_set_pos(irp->output, result_pos);
|
||||
stream_write_uint32(irp->output, result);
|
||||
stream_write_UINT32(irp->output, result);
|
||||
|
||||
stream_set_pos(irp->output, pos);
|
||||
|
||||
|
||||
@@ -39,11 +39,11 @@ typedef struct _TSMFALSAAudioDevice
|
||||
|
||||
char device[32];
|
||||
snd_pcm_t* out_handle;
|
||||
uint32 source_rate;
|
||||
uint32 actual_rate;
|
||||
uint32 source_channels;
|
||||
uint32 actual_channels;
|
||||
uint32 bytes_per_sample;
|
||||
UINT32 source_rate;
|
||||
UINT32 actual_rate;
|
||||
UINT32 source_channels;
|
||||
UINT32 actual_channels;
|
||||
UINT32 bytes_per_sample;
|
||||
|
||||
FREERDP_DSP_CONTEXT* dsp_context;
|
||||
} TSMFALSAAudioDevice;
|
||||
@@ -81,7 +81,7 @@ static BOOL tsmf_alsa_open(ITSMFAudioDevice* audio, const char* device)
|
||||
}
|
||||
|
||||
static BOOL tsmf_alsa_set_format(ITSMFAudioDevice* audio,
|
||||
uint32 sample_rate, uint32 channels, uint32 bits_per_sample)
|
||||
UINT32 sample_rate, UINT32 channels, UINT32 bits_per_sample)
|
||||
{
|
||||
int error;
|
||||
snd_pcm_uframes_t frames;
|
||||
@@ -147,7 +147,7 @@ static BOOL tsmf_alsa_set_format(ITSMFAudioDevice* audio,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL tsmf_alsa_play(ITSMFAudioDevice* audio, BYTE* data, uint32 data_size)
|
||||
static BOOL tsmf_alsa_play(ITSMFAudioDevice* audio, BYTE* data, UINT32 data_size)
|
||||
{
|
||||
int len;
|
||||
int error;
|
||||
@@ -214,9 +214,9 @@ static BOOL tsmf_alsa_play(ITSMFAudioDevice* audio, BYTE* data, uint32 data_size
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static uint64 tsmf_alsa_get_latency(ITSMFAudioDevice* audio)
|
||||
static UINT64 tsmf_alsa_get_latency(ITSMFAudioDevice* audio)
|
||||
{
|
||||
uint64 latency = 0;
|
||||
UINT64 latency = 0;
|
||||
snd_pcm_sframes_t frames = 0;
|
||||
TSMFALSAAudioDevice* alsa = (TSMFALSAAudioDevice*) audio;
|
||||
|
||||
@@ -224,7 +224,7 @@ static uint64 tsmf_alsa_get_latency(ITSMFAudioDevice* audio)
|
||||
snd_pcm_delay(alsa->out_handle, &frames) == 0 &&
|
||||
frames > 0)
|
||||
{
|
||||
latency = ((uint64)frames) * 10000000LL / (uint64)alsa->actual_rate;
|
||||
latency = ((UINT64)frames) * 10000000LL / (UINT64)alsa->actual_rate;
|
||||
}
|
||||
return latency;
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ typedef struct _TSMFFFmpegDecoder
|
||||
int prepared;
|
||||
|
||||
BYTE* decoded_data;
|
||||
uint32 decoded_size;
|
||||
uint32 decoded_size_max;
|
||||
UINT32 decoded_size;
|
||||
UINT32 decoded_size_max;
|
||||
} TSMFFFmpegDecoder;
|
||||
|
||||
static BOOL tsmf_ffmpeg_init_context(ITSMFDecoder* decoder)
|
||||
@@ -109,7 +109,7 @@ static BOOL tsmf_ffmpeg_init_audio_stream(ITSMFDecoder* decoder, const TS_AM_MED
|
||||
static BOOL tsmf_ffmpeg_init_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_TYPE* media_type)
|
||||
{
|
||||
TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder;
|
||||
uint32 size;
|
||||
UINT32 size;
|
||||
const BYTE* s;
|
||||
BYTE* p;
|
||||
|
||||
@@ -151,12 +151,12 @@ static BOOL tsmf_ffmpeg_init_stream(ITSMFDecoder* decoder, const TS_AM_MEDIA_TYP
|
||||
*p++ = 0xff; /* Flag? */
|
||||
*p++ = 0xe0 | 0x01; /* Reserved | #sps */
|
||||
s = media_type->ExtraData + 20;
|
||||
size = ((uint32)(*s)) * 256 + ((uint32)(*(s + 1)));
|
||||
size = ((UINT32)(*s)) * 256 + ((UINT32)(*(s + 1)));
|
||||
memcpy(p, s, size + 2);
|
||||
s += size + 2;
|
||||
p += size + 2;
|
||||
*p++ = 1; /* #pps */
|
||||
size = ((uint32)(*s)) * 256 + ((uint32)(*(s + 1)));
|
||||
size = ((UINT32)(*s)) * 256 + ((UINT32)(*(s + 1)));
|
||||
memcpy(p, s, size + 2);
|
||||
}
|
||||
else
|
||||
@@ -260,7 +260,7 @@ static BOOL tsmf_ffmpeg_set_format(ITSMFDecoder* decoder, TS_AM_MEDIA_TYPE* medi
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL tsmf_ffmpeg_decode_video(ITSMFDecoder* decoder, const BYTE* 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;
|
||||
@@ -319,12 +319,12 @@ static BOOL tsmf_ffmpeg_decode_video(ITSMFDecoder* decoder, const BYTE* data, ui
|
||||
return ret;
|
||||
}
|
||||
|
||||
static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const BYTE* 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;
|
||||
UINT32 src_size;
|
||||
const BYTE* src;
|
||||
BYTE* dst;
|
||||
int dst_offset;
|
||||
@@ -419,7 +419,7 @@ static BOOL tsmf_ffmpeg_decode_audio(ITSMFDecoder* decoder, const BYTE* data, ui
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL tsmf_ffmpeg_decode(ITSMFDecoder* decoder, const BYTE* 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;
|
||||
|
||||
@@ -442,7 +442,7 @@ static BOOL tsmf_ffmpeg_decode(ITSMFDecoder* decoder, const BYTE* data, uint32 d
|
||||
}
|
||||
}
|
||||
|
||||
static BYTE* tsmf_ffmpeg_get_decoded_data(ITSMFDecoder* decoder, uint32* size)
|
||||
static BYTE* tsmf_ffmpeg_get_decoded_data(ITSMFDecoder* decoder, UINT32* size)
|
||||
{
|
||||
TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder;
|
||||
BYTE* buf;
|
||||
@@ -454,7 +454,7 @@ static BYTE* tsmf_ffmpeg_get_decoded_data(ITSMFDecoder* decoder, uint32* size)
|
||||
return buf;
|
||||
}
|
||||
|
||||
static uint32 tsmf_ffmpeg_get_decoded_format(ITSMFDecoder* decoder)
|
||||
static UINT32 tsmf_ffmpeg_get_decoded_format(ITSMFDecoder* decoder)
|
||||
{
|
||||
TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder;
|
||||
|
||||
@@ -466,11 +466,11 @@ static uint32 tsmf_ffmpeg_get_decoded_format(ITSMFDecoder* decoder)
|
||||
default:
|
||||
DEBUG_WARN("unsupported pixel format %u",
|
||||
mdecoder->codec_context->pix_fmt);
|
||||
return (uint32) -1;
|
||||
return (UINT32) -1;
|
||||
}
|
||||
}
|
||||
|
||||
static BOOL tsmf_ffmpeg_get_decoded_dimension(ITSMFDecoder* decoder, uint32* width, uint32* height)
|
||||
static BOOL tsmf_ffmpeg_get_decoded_dimension(ITSMFDecoder* decoder, UINT32* width, UINT32* height)
|
||||
{
|
||||
TSMFFFmpegDecoder* mdecoder = (TSMFFFmpegDecoder*) decoder;
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ typedef struct _TSMFGstreamerDecoder
|
||||
GstElement *aVolume;
|
||||
|
||||
BOOL paused;
|
||||
uint64 last_sample_end_time;
|
||||
UINT64 last_sample_end_time;
|
||||
|
||||
Display *disp;
|
||||
int *xfwin;
|
||||
@@ -95,7 +95,7 @@ const char *NAME_GST_STATE_NULL = "GST_STATE_NULL";
|
||||
const char *NAME_GST_STATE_VOID_PENDING = "GST_STATE_VOID_PENDING";
|
||||
const char *NAME_GST_STATE_OTHER = "GST_STATE_?";
|
||||
|
||||
static inline const GstClockTime tsmf_gstreamer_timestamp_ms_to_gst(uint64 ms_timestamp)
|
||||
static inline const GstClockTime tsmf_gstreamer_timestamp_ms_to_gst(UINT64 ms_timestamp)
|
||||
{
|
||||
/*
|
||||
* Convert Microsoft 100ns timestamps to Gstreamer 1ns units.
|
||||
@@ -1094,8 +1094,8 @@ static BOOL tsmf_gstreamer_pipeline_build(TSMFGstreamerDecoder * mdecoder)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder * decoder, const BYTE * data, uint32 data_size, uint32 extensions,
|
||||
uint64 start_time, uint64 end_time, uint64 duration)
|
||||
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;
|
||||
if (!mdecoder)
|
||||
@@ -1215,12 +1215,12 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder * decoder, const BYTE * data, u
|
||||
FILE *fin = fopen("/tmp/tsmf_aseek.info", "rt");
|
||||
if (fin)
|
||||
{
|
||||
uint64 AStartTime = 0;
|
||||
UINT64 AStartTime = 0;
|
||||
fscanf(fin, "%"PRIu64, &AStartTime);
|
||||
fclose(fin);
|
||||
if (start_time > AStartTime)
|
||||
{
|
||||
uint64 streamDelay = (start_time - AStartTime) / 10;
|
||||
UINT64 streamDelay = (start_time - AStartTime) / 10;
|
||||
usleep(streamDelay);
|
||||
}
|
||||
unlink("/tmp/tsmf_aseek.info");
|
||||
@@ -1249,12 +1249,12 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder * decoder, const BYTE * data, u
|
||||
fin = fopen("/tmp/tsmf_vseek.info", "rt");
|
||||
if (fin)
|
||||
{
|
||||
uint64 VStartTime = 0;
|
||||
UINT64 VStartTime = 0;
|
||||
fscanf(fin, "%"PRIu64, &VStartTime);
|
||||
fclose(fin);
|
||||
if (start_time > VStartTime)
|
||||
{
|
||||
uint64 streamDelay = (start_time - VStartTime) / 10;
|
||||
UINT64 streamDelay = (start_time - VStartTime) / 10;
|
||||
usleep(streamDelay);
|
||||
}
|
||||
unlink("/tmp/tsmf_vseek.info");
|
||||
@@ -1301,7 +1301,7 @@ static BOOL tsmf_gstreamer_decodeEx(ITSMFDecoder * decoder, const BYTE * data, u
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void tsmf_gstreamer_change_volume(ITSMFDecoder * decoder, uint32 newVolume, uint32 muted)
|
||||
static void tsmf_gstreamer_change_volume(ITSMFDecoder * decoder, UINT32 newVolume, UINT32 muted)
|
||||
{
|
||||
TSMFGstreamerDecoder * mdecoder = (TSMFGstreamerDecoder *) decoder;
|
||||
if (!mdecoder)
|
||||
@@ -1327,7 +1327,7 @@ static void tsmf_gstreamer_change_volume(ITSMFDecoder * decoder, uint32 newVolum
|
||||
g_object_set(mdecoder->aVolume, "volume", mdecoder->gstVolume, NULL);
|
||||
}
|
||||
|
||||
static void tsmf_gstreamer_control(ITSMFDecoder * decoder, ITSMFControlMsg control_msg, uint32 *arg)
|
||||
static void tsmf_gstreamer_control(ITSMFDecoder * decoder, ITSMFControlMsg control_msg, UINT32 *arg)
|
||||
{
|
||||
TSMFGstreamerDecoder * mdecoder = (TSMFGstreamerDecoder *) decoder;
|
||||
if (!mdecoder)
|
||||
@@ -1453,7 +1453,7 @@ static void tsmf_gstreamer_free(ITSMFDecoder * decoder)
|
||||
}
|
||||
}
|
||||
|
||||
static uint64 tsmf_gstreamer_get_running_time(ITSMFDecoder * decoder)
|
||||
static UINT64 tsmf_gstreamer_get_running_time(ITSMFDecoder * decoder)
|
||||
{
|
||||
TSMFGstreamerDecoder *mdecoder = (TSMFGstreamerDecoder *) decoder;
|
||||
if (!mdecoder)
|
||||
|
||||
@@ -243,9 +243,9 @@ static BOOL tsmf_pulse_open_stream(TSMFPulseAudioDevice* pulse)
|
||||
tsmf_pulse_stream_request_callback, pulse);
|
||||
buffer_attr.maxlength = pa_usec_to_bytes(500000, &pulse->sample_spec);
|
||||
buffer_attr.tlength = pa_usec_to_bytes(250000, &pulse->sample_spec);
|
||||
buffer_attr.prebuf = (uint32_t) -1;
|
||||
buffer_attr.minreq = (uint32_t) -1;
|
||||
buffer_attr.fragsize = (uint32_t) -1;
|
||||
buffer_attr.prebuf = (UINT32_t) -1;
|
||||
buffer_attr.minreq = (UINT32_t) -1;
|
||||
buffer_attr.fragsize = (UINT32_t) -1;
|
||||
if (pa_stream_connect_playback(pulse->stream,
|
||||
pulse->device[0] ? pulse->device : NULL, &buffer_attr,
|
||||
PA_STREAM_ADJUST_LATENCY | PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_AUTO_TIMING_UPDATE,
|
||||
@@ -284,7 +284,7 @@ static BOOL tsmf_pulse_open_stream(TSMFPulseAudioDevice* pulse)
|
||||
}
|
||||
|
||||
static BOOL tsmf_pulse_set_format(ITSMFAudioDevice* audio,
|
||||
uint32 sample_rate, uint32 channels, uint32 bits_per_sample)
|
||||
UINT32 sample_rate, UINT32 channels, UINT32 bits_per_sample)
|
||||
{
|
||||
TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*) audio;
|
||||
|
||||
@@ -298,7 +298,7 @@ static BOOL tsmf_pulse_set_format(ITSMFAudioDevice* audio,
|
||||
return tsmf_pulse_open_stream(pulse);
|
||||
}
|
||||
|
||||
static BOOL tsmf_pulse_play(ITSMFAudioDevice* audio, BYTE* data, uint32 data_size)
|
||||
static BOOL tsmf_pulse_play(ITSMFAudioDevice* audio, BYTE* data, UINT32 data_size)
|
||||
{
|
||||
TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*) audio;
|
||||
BYTE* src;
|
||||
@@ -341,15 +341,15 @@ static BOOL tsmf_pulse_play(ITSMFAudioDevice* audio, BYTE* data, uint32 data_siz
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static uint64 tsmf_pulse_get_latency(ITSMFAudioDevice* audio)
|
||||
static UINT64 tsmf_pulse_get_latency(ITSMFAudioDevice* audio)
|
||||
{
|
||||
pa_usec_t usec;
|
||||
uint64 latency = 0;
|
||||
UINT64 latency = 0;
|
||||
TSMFPulseAudioDevice* pulse = (TSMFPulseAudioDevice*) audio;
|
||||
|
||||
if (pulse->stream && pa_stream_get_latency(pulse->stream, &usec, NULL) == 0)
|
||||
{
|
||||
latency = ((uint64)usec) * 10LL;
|
||||
latency = ((UINT64)usec) * 10LL;
|
||||
}
|
||||
return latency;
|
||||
}
|
||||
|
||||
@@ -29,13 +29,13 @@ struct _ITSMFAudioDevice
|
||||
/* Open the audio device. */
|
||||
BOOL (*Open) (ITSMFAudioDevice* audio, const char* device);
|
||||
/* Set the audio data format. */
|
||||
BOOL (*SetFormat) (ITSMFAudioDevice* audio, uint32 sample_rate, uint32 channels, uint32 bits_per_sample);
|
||||
BOOL (*SetFormat) (ITSMFAudioDevice* audio, UINT32 sample_rate, UINT32 channels, UINT32 bits_per_sample);
|
||||
/* Play audio data. */
|
||||
BOOL (*Play) (ITSMFAudioDevice* audio, BYTE* 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);
|
||||
UINT64 (*GetLatency) (ITSMFAudioDevice* audio);
|
||||
/* Change the playback volume level */
|
||||
void (*ChangeVolume) (ITSMFAudioDevice* audio, uint32 newVolume, uint32 muted);
|
||||
void (*ChangeVolume) (ITSMFAudioDevice* audio, UINT32 newVolume, UINT32 muted);
|
||||
/* Flush queued audio data */
|
||||
void (*Flush) (ITSMFAudioDevice* audio);
|
||||
/* Free the audio device */
|
||||
|
||||
@@ -284,15 +284,15 @@ static void tsmf_print_guid(const BYTE* guid)
|
||||
}
|
||||
|
||||
/* http://msdn.microsoft.com/en-us/library/dd318229.aspx */
|
||||
static uint32 tsmf_codec_parse_BITMAPINFOHEADER(TS_AM_MEDIA_TYPE* mediatype, STREAM* s, BOOL bypass)
|
||||
static UINT32 tsmf_codec_parse_BITMAPINFOHEADER(TS_AM_MEDIA_TYPE* mediatype, STREAM* s, BOOL bypass)
|
||||
{
|
||||
uint32 biSize;
|
||||
uint32 biWidth;
|
||||
uint32 biHeight;
|
||||
UINT32 biSize;
|
||||
UINT32 biWidth;
|
||||
UINT32 biHeight;
|
||||
|
||||
stream_read_uint32(s, biSize);
|
||||
stream_read_uint32(s, biWidth);
|
||||
stream_read_uint32(s, biHeight);
|
||||
stream_read_UINT32(s, biSize);
|
||||
stream_read_UINT32(s, biWidth);
|
||||
stream_read_UINT32(s, biHeight);
|
||||
stream_seek(s, 28);
|
||||
|
||||
if (mediatype->Width == 0)
|
||||
@@ -308,23 +308,23 @@ static uint32 tsmf_codec_parse_BITMAPINFOHEADER(TS_AM_MEDIA_TYPE* mediatype, STR
|
||||
}
|
||||
|
||||
/* http://msdn.microsoft.com/en-us/library/dd407326.aspx */
|
||||
static uint32 tsmf_codec_parse_VIDEOINFOHEADER2(TS_AM_MEDIA_TYPE* mediatype, STREAM* s)
|
||||
static UINT32 tsmf_codec_parse_VIDEOINFOHEADER2(TS_AM_MEDIA_TYPE* mediatype, STREAM* s)
|
||||
{
|
||||
uint64 AvgTimePerFrame;
|
||||
UINT64 AvgTimePerFrame;
|
||||
|
||||
/* VIDEOINFOHEADER2.rcSource, RECT(LONG left, LONG top, LONG right, LONG bottom) */
|
||||
stream_seek_uint32(s);
|
||||
stream_seek_uint32(s);
|
||||
stream_read_uint32(s, mediatype->Width);
|
||||
stream_read_uint32(s, mediatype->Height);
|
||||
stream_seek_UINT32(s);
|
||||
stream_seek_UINT32(s);
|
||||
stream_read_UINT32(s, mediatype->Width);
|
||||
stream_read_UINT32(s, mediatype->Height);
|
||||
/* VIDEOINFOHEADER2.rcTarget */
|
||||
stream_seek(s, 16);
|
||||
/* VIDEOINFOHEADER2.dwBitRate */
|
||||
stream_read_uint32(s, mediatype->BitRate);
|
||||
stream_read_UINT32(s, mediatype->BitRate);
|
||||
/* VIDEOINFOHEADER2.dwBitErrorRate */
|
||||
stream_seek_uint32(s);
|
||||
stream_seek_UINT32(s);
|
||||
/* VIDEOINFOHEADER2.AvgTimePerFrame */
|
||||
stream_read_uint64(s, AvgTimePerFrame);
|
||||
stream_read_UINT64(s, AvgTimePerFrame);
|
||||
mediatype->SamplesPerSecond.Numerator = 1000000;
|
||||
mediatype->SamplesPerSecond.Denominator = (int)(AvgTimePerFrame / 10LL);
|
||||
/* Remaining fields before bmiHeader */
|
||||
@@ -334,7 +334,7 @@ static uint32 tsmf_codec_parse_VIDEOINFOHEADER2(TS_AM_MEDIA_TYPE* mediatype, STR
|
||||
}
|
||||
|
||||
/* http://msdn.microsoft.com/en-us/library/dd390700.aspx */
|
||||
static uint32 tsmf_codec_parse_VIDEOINFOHEADER(TS_AM_MEDIA_TYPE* mediatype, STREAM* s)
|
||||
static UINT32 tsmf_codec_parse_VIDEOINFOHEADER(TS_AM_MEDIA_TYPE* mediatype, STREAM* s)
|
||||
{
|
||||
/*
|
||||
typedef struct tagVIDEOINFOHEADER {
|
||||
@@ -346,21 +346,21 @@ typedef struct tagVIDEOINFOHEADER {
|
||||
BITMAPINFOHEADER bmiHeader;
|
||||
} VIDEOINFOHEADER;
|
||||
*/
|
||||
uint64 AvgTimePerFrame;
|
||||
UINT64 AvgTimePerFrame;
|
||||
|
||||
/* VIDEOINFOHEADER.rcSource, RECT(LONG left, LONG top, LONG right, LONG bottom) */
|
||||
stream_seek_uint32(s);
|
||||
stream_seek_uint32(s);
|
||||
stream_read_uint32(s, mediatype->Width);
|
||||
stream_read_uint32(s, mediatype->Height);
|
||||
stream_seek_UINT32(s);
|
||||
stream_seek_UINT32(s);
|
||||
stream_read_UINT32(s, mediatype->Width);
|
||||
stream_read_UINT32(s, mediatype->Height);
|
||||
/* VIDEOINFOHEADER.rcTarget */
|
||||
stream_seek(s, 16);
|
||||
/* VIDEOINFOHEADER.dwBitRate */
|
||||
stream_read_uint32(s, mediatype->BitRate);
|
||||
stream_read_UINT32(s, mediatype->BitRate);
|
||||
/* VIDEOINFOHEADER.dwBitErrorRate */
|
||||
stream_seek_uint32(s);
|
||||
stream_seek_UINT32(s);
|
||||
/* VIDEOINFOHEADER.AvgTimePerFrame */
|
||||
stream_read_uint64(s, AvgTimePerFrame);
|
||||
stream_read_UINT64(s, AvgTimePerFrame);
|
||||
mediatype->SamplesPerSecond.Numerator = 1000000;
|
||||
mediatype->SamplesPerSecond.Denominator = (int)(AvgTimePerFrame / 10LL);
|
||||
|
||||
@@ -370,7 +370,7 @@ typedef struct tagVIDEOINFOHEADER {
|
||||
BOOL tsmf_codec_parse_media_type(TS_AM_MEDIA_TYPE* mediatype, STREAM* s)
|
||||
{
|
||||
int i;
|
||||
uint32 cbFormat;
|
||||
UINT32 cbFormat;
|
||||
BOOL ret = TRUE;
|
||||
|
||||
memset(mediatype, 0, sizeof(TS_AM_MEDIA_TYPE));
|
||||
@@ -421,7 +421,7 @@ BOOL tsmf_codec_parse_media_type(TS_AM_MEDIA_TYPE* mediatype, STREAM* s)
|
||||
stream_seek(s, 16);
|
||||
|
||||
/* cbFormat */
|
||||
stream_read_uint32(s, cbFormat);
|
||||
stream_read_UINT32(s, cbFormat);
|
||||
DEBUG_DVC("cbFormat %d", cbFormat);
|
||||
|
||||
#ifdef WITH_DEBUG_DVC
|
||||
@@ -434,14 +434,14 @@ BOOL tsmf_codec_parse_media_type(TS_AM_MEDIA_TYPE* mediatype, STREAM* s)
|
||||
/* http://msdn.microsoft.com/en-us/library/aa473808.aspx */
|
||||
|
||||
stream_seek(s, 8); /* dwSize and ? */
|
||||
stream_read_uint32(s, mediatype->Width); /* videoInfo.dwWidth */
|
||||
stream_read_uint32(s, mediatype->Height); /* videoInfo.dwHeight */
|
||||
stream_read_UINT32(s, mediatype->Width); /* videoInfo.dwWidth */
|
||||
stream_read_UINT32(s, mediatype->Height); /* videoInfo.dwHeight */
|
||||
stream_seek(s, 32);
|
||||
/* videoInfo.FramesPerSecond */
|
||||
stream_read_uint32(s, mediatype->SamplesPerSecond.Numerator);
|
||||
stream_read_uint32(s, mediatype->SamplesPerSecond.Denominator);
|
||||
stream_read_UINT32(s, mediatype->SamplesPerSecond.Numerator);
|
||||
stream_read_UINT32(s, mediatype->SamplesPerSecond.Denominator);
|
||||
stream_seek(s, 80);
|
||||
stream_read_uint32(s, mediatype->BitRate); /* compressedInfo.AvgBitrate */
|
||||
stream_read_UINT32(s, mediatype->BitRate); /* compressedInfo.AvgBitrate */
|
||||
stream_seek(s, 36);
|
||||
|
||||
if (cbFormat > 176)
|
||||
@@ -456,9 +456,9 @@ BOOL tsmf_codec_parse_media_type(TS_AM_MEDIA_TYPE* mediatype, STREAM* s)
|
||||
|
||||
stream_seek_UINT16(s);
|
||||
stream_read_UINT16(s, mediatype->Channels);
|
||||
stream_read_uint32(s, mediatype->SamplesPerSecond.Numerator);
|
||||
stream_read_UINT32(s, mediatype->SamplesPerSecond.Numerator);
|
||||
mediatype->SamplesPerSecond.Denominator = 1;
|
||||
stream_read_uint32(s, mediatype->BitRate);
|
||||
stream_read_UINT32(s, mediatype->BitRate);
|
||||
mediatype->BitRate *= 8;
|
||||
stream_read_UINT16(s, mediatype->BlockAlign);
|
||||
stream_read_UINT16(s, mediatype->BitsPerSample);
|
||||
|
||||
@@ -38,28 +38,28 @@ struct _ITSMFDecoder
|
||||
/* 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 BYTE* data, uint32 data_size, uint32 extensions);
|
||||
BOOL (*Decode) (ITSMFDecoder* decoder, const BYTE* data, UINT32 data_size, UINT32 extensions);
|
||||
/* Get the decoded data */
|
||||
BYTE* (*GetDecodedData) (ITSMFDecoder* decoder, uint32* size);
|
||||
BYTE* (*GetDecodedData) (ITSMFDecoder* decoder, UINT32* size);
|
||||
/* Get the pixel format of decoded video frame */
|
||||
uint32 (*GetDecodedFormat) (ITSMFDecoder* decoder);
|
||||
UINT32 (*GetDecodedFormat) (ITSMFDecoder* decoder);
|
||||
/* Get the width and height of decoded video frame */
|
||||
BOOL (*GetDecodedDimension) (ITSMFDecoder* decoder, uint32* width, uint32* height);
|
||||
BOOL (*GetDecodedDimension) (ITSMFDecoder* decoder, UINT32* width, UINT32* height);
|
||||
/* Free the decoder */
|
||||
void (*Free) (ITSMFDecoder * decoder);
|
||||
/* Optional Contol function */
|
||||
void (*Control) (ITSMFDecoder * decoder, ITSMFControlMsg control_msg, uint32 *arg);
|
||||
void (*Control) (ITSMFDecoder * decoder, ITSMFControlMsg control_msg, UINT32 *arg);
|
||||
/* Decode a sample with extended interface. */
|
||||
int (*DecodeEx) (ITSMFDecoder * decoder, const BYTE * data, uint32 data_size, uint32 extensions,
|
||||
uint64 start_time, uint64 end_time, uint64 duration);
|
||||
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);
|
||||
UINT64 (*GetRunningTime) (ITSMFDecoder * decoder);
|
||||
/* Update Gstreamer Rendering Area */
|
||||
void (*UpdateRenderingArea) (ITSMFDecoder * decoder, int newX, int newY, int newWidth, int newHeight, int numRectangles, RDP_RECT *rectangles);
|
||||
/* Change Gstreamer Audio Volume */
|
||||
void (*ChangeVolume) (ITSMFDecoder * decoder, uint32 newVolume, uint32 muted);
|
||||
void (*ChangeVolume) (ITSMFDecoder * decoder, UINT32 newVolume, UINT32 muted);
|
||||
/* Check buffer level */
|
||||
uint32 (*BufferLevel) (ITSMFDecoder * decoder);
|
||||
UINT32 (*BufferLevel) (ITSMFDecoder * decoder);
|
||||
};
|
||||
|
||||
#define TSMF_DECODER_EXPORT_FUNC_NAME "TSMFDecoderEntry"
|
||||
|
||||
@@ -38,49 +38,49 @@
|
||||
|
||||
int tsmf_ifman_rim_exchange_capability_request(TSMF_IFMAN* ifman)
|
||||
{
|
||||
uint32 CapabilityValue;
|
||||
UINT32 CapabilityValue;
|
||||
|
||||
stream_read_uint32(ifman->input, CapabilityValue);
|
||||
stream_read_UINT32(ifman->input, CapabilityValue);
|
||||
DEBUG_DVC("server CapabilityValue %d", CapabilityValue);
|
||||
|
||||
stream_check_size(ifman->output, 8);
|
||||
stream_write_uint32(ifman->output, 1); /* CapabilityValue */
|
||||
stream_write_uint32(ifman->output, 0); /* Result */
|
||||
stream_write_UINT32(ifman->output, 1); /* CapabilityValue */
|
||||
stream_write_UINT32(ifman->output, 0); /* Result */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tsmf_ifman_exchange_capability_request(TSMF_IFMAN* ifman)
|
||||
{
|
||||
uint32 i;
|
||||
uint32 v;
|
||||
uint32 pos;
|
||||
uint32 CapabilityType;
|
||||
uint32 cbCapabilityLength;
|
||||
uint32 numHostCapabilities;
|
||||
UINT32 i;
|
||||
UINT32 v;
|
||||
UINT32 pos;
|
||||
UINT32 CapabilityType;
|
||||
UINT32 cbCapabilityLength;
|
||||
UINT32 numHostCapabilities;
|
||||
|
||||
pos = stream_get_pos(ifman->output);
|
||||
stream_check_size(ifman->output, ifman->input_size + 4);
|
||||
stream_copy(ifman->output, ifman->input, ifman->input_size);
|
||||
|
||||
stream_set_pos(ifman->output, pos);
|
||||
stream_read_uint32(ifman->output, numHostCapabilities);
|
||||
stream_read_UINT32(ifman->output, numHostCapabilities);
|
||||
for (i = 0; i < numHostCapabilities; i++)
|
||||
{
|
||||
stream_read_uint32(ifman->output, CapabilityType);
|
||||
stream_read_uint32(ifman->output, cbCapabilityLength);
|
||||
stream_read_UINT32(ifman->output, CapabilityType);
|
||||
stream_read_UINT32(ifman->output, cbCapabilityLength);
|
||||
pos = stream_get_pos(ifman->output);
|
||||
switch (CapabilityType)
|
||||
{
|
||||
case 1: /* Protocol version request */
|
||||
stream_read_uint32(ifman->output, v);
|
||||
stream_read_UINT32(ifman->output, v);
|
||||
DEBUG_DVC("server protocol version %d", v);
|
||||
break;
|
||||
case 2: /* Supported platform */
|
||||
stream_peek_uint32(ifman->output, v);
|
||||
stream_peek_UINT32(ifman->output, v);
|
||||
DEBUG_DVC("server supported platform %d", v);
|
||||
/* Claim that we support both MF and DShow platforms. */
|
||||
stream_write_uint32(ifman->output,
|
||||
stream_write_UINT32(ifman->output,
|
||||
MMREDIR_CAPABILITY_PLATFORM_MF | MMREDIR_CAPABILITY_PLATFORM_DSHOW);
|
||||
break;
|
||||
default:
|
||||
@@ -89,7 +89,7 @@ int tsmf_ifman_exchange_capability_request(TSMF_IFMAN* ifman)
|
||||
}
|
||||
stream_set_pos(ifman->output, pos + cbCapabilityLength);
|
||||
}
|
||||
stream_write_uint32(ifman->output, 0); /* Result */
|
||||
stream_write_UINT32(ifman->output, 0); /* Result */
|
||||
|
||||
ifman->output_interface_id = TSMF_INTERFACE_DEFAULT | STREAM_ID_STUB;
|
||||
|
||||
@@ -98,13 +98,13 @@ int tsmf_ifman_exchange_capability_request(TSMF_IFMAN* ifman)
|
||||
|
||||
int tsmf_ifman_check_format_support_request(TSMF_IFMAN* ifman)
|
||||
{
|
||||
uint32 numMediaType;
|
||||
uint32 PlatformCookie;
|
||||
uint32 FormatSupported = 1;
|
||||
UINT32 numMediaType;
|
||||
UINT32 PlatformCookie;
|
||||
UINT32 FormatSupported = 1;
|
||||
|
||||
stream_read_uint32(ifman->input, PlatformCookie);
|
||||
stream_seek_uint32(ifman->input); /* NoRolloverFlags (4 bytes) */
|
||||
stream_read_uint32(ifman->input, numMediaType);
|
||||
stream_read_UINT32(ifman->input, PlatformCookie);
|
||||
stream_seek_UINT32(ifman->input); /* NoRolloverFlags (4 bytes) */
|
||||
stream_read_UINT32(ifman->input, numMediaType);
|
||||
|
||||
DEBUG_DVC("PlatformCookie %d numMediaType %d", PlatformCookie, numMediaType);
|
||||
|
||||
@@ -115,9 +115,9 @@ int tsmf_ifman_check_format_support_request(TSMF_IFMAN* ifman)
|
||||
DEBUG_DVC("format ok.");
|
||||
|
||||
stream_check_size(ifman->output, 12);
|
||||
stream_write_uint32(ifman->output, FormatSupported);
|
||||
stream_write_uint32(ifman->output, PlatformCookie);
|
||||
stream_write_uint32(ifman->output, 0); /* Result */
|
||||
stream_write_UINT32(ifman->output, FormatSupported);
|
||||
stream_write_UINT32(ifman->output, PlatformCookie);
|
||||
stream_write_UINT32(ifman->output, 0); /* Result */
|
||||
|
||||
ifman->output_interface_id = TSMF_INTERFACE_DEFAULT | STREAM_ID_STUB;
|
||||
|
||||
@@ -151,7 +151,7 @@ int tsmf_ifman_on_new_presentation(TSMF_IFMAN* ifman)
|
||||
|
||||
int tsmf_ifman_add_stream(TSMF_IFMAN* ifman)
|
||||
{
|
||||
uint32 StreamId;
|
||||
UINT32 StreamId;
|
||||
int error = 0;
|
||||
TSMF_STREAM* stream;
|
||||
TSMF_PRESENTATION* presentation;
|
||||
@@ -165,8 +165,8 @@ int tsmf_ifman_add_stream(TSMF_IFMAN* ifman)
|
||||
error = 1;
|
||||
else
|
||||
{
|
||||
stream_read_uint32(ifman->input, StreamId);
|
||||
stream_seek_uint32(ifman->input); /* numMediaType */
|
||||
stream_read_UINT32(ifman->input, StreamId);
|
||||
stream_seek_UINT32(ifman->input); /* numMediaType */
|
||||
stream = tsmf_stream_new(presentation, StreamId);
|
||||
if (stream)
|
||||
tsmf_stream_set_format(stream, ifman->decoder_name, ifman->input);
|
||||
@@ -180,8 +180,8 @@ int tsmf_ifman_set_topology_request(TSMF_IFMAN* ifman)
|
||||
DEBUG_DVC("");
|
||||
|
||||
stream_check_size(ifman->output, 8);
|
||||
stream_write_uint32(ifman->output, 1); /* TopologyReady */
|
||||
stream_write_uint32(ifman->output, 0); /* Result */
|
||||
stream_write_UINT32(ifman->output, 1); /* TopologyReady */
|
||||
stream_write_UINT32(ifman->output, 0); /* Result */
|
||||
ifman->output_interface_id = TSMF_INTERFACE_DEFAULT | STREAM_ID_STUB;
|
||||
return 0;
|
||||
}
|
||||
@@ -189,7 +189,7 @@ int tsmf_ifman_set_topology_request(TSMF_IFMAN* ifman)
|
||||
int tsmf_ifman_remove_stream(TSMF_IFMAN* ifman)
|
||||
{
|
||||
int error = 0;
|
||||
uint32 StreamId;
|
||||
UINT32 StreamId;
|
||||
TSMF_STREAM* stream;
|
||||
TSMF_PRESENTATION* presentation;
|
||||
|
||||
@@ -202,7 +202,7 @@ int tsmf_ifman_remove_stream(TSMF_IFMAN* ifman)
|
||||
error = 1;
|
||||
else
|
||||
{
|
||||
stream_read_uint32(ifman->input, StreamId);
|
||||
stream_read_UINT32(ifman->input, StreamId);
|
||||
stream = tsmf_stream_find_by_id(presentation, StreamId);
|
||||
if (stream)
|
||||
tsmf_stream_free(stream);
|
||||
@@ -226,7 +226,7 @@ int tsmf_ifman_shutdown_presentation(TSMF_IFMAN* ifman)
|
||||
pexisted = 0;
|
||||
|
||||
stream_check_size(ifman->output, 4);
|
||||
stream_write_uint32(ifman->output, 0); /* Result */
|
||||
stream_write_UINT32(ifman->output, 0); /* Result */
|
||||
ifman->output_interface_id = TSMF_INTERFACE_DEFAULT | STREAM_ID_STUB;
|
||||
return 0;
|
||||
}
|
||||
@@ -241,13 +241,13 @@ int tsmf_ifman_on_stream_volume(TSMF_IFMAN* ifman)
|
||||
|
||||
if (presentation)
|
||||
{
|
||||
uint32 newVolume;
|
||||
uint32 muted;
|
||||
UINT32 newVolume;
|
||||
UINT32 muted;
|
||||
|
||||
stream_seek(ifman->input, 16);
|
||||
stream_read_uint32(ifman->input, newVolume);
|
||||
stream_read_UINT32(ifman->input, newVolume);
|
||||
DEBUG_DVC("on stream volume: new volume=[%d]", newVolume);
|
||||
stream_read_uint32(ifman->input, muted);
|
||||
stream_read_UINT32(ifman->input, muted);
|
||||
DEBUG_DVC("on stream volume: muted=[%d]", muted);
|
||||
tsmf_presentation_volume_changed(presentation, newVolume, muted);
|
||||
}
|
||||
@@ -271,13 +271,13 @@ int tsmf_ifman_on_channel_volume(TSMF_IFMAN* ifman)
|
||||
|
||||
if (presentation)
|
||||
{
|
||||
uint32 channelVolume;
|
||||
uint32 changedChannel;
|
||||
UINT32 channelVolume;
|
||||
UINT32 changedChannel;
|
||||
|
||||
stream_seek(ifman->input, 16);
|
||||
stream_read_uint32(ifman->input, channelVolume);
|
||||
stream_read_UINT32(ifman->input, channelVolume);
|
||||
DEBUG_DVC("on channel volume: channel volume=[%d]", channelVolume);
|
||||
stream_read_uint32(ifman->input, changedChannel);
|
||||
stream_read_UINT32(ifman->input, changedChannel);
|
||||
DEBUG_DVC("on stream volume: changed channel=[%d]", changedChannel);
|
||||
}
|
||||
|
||||
@@ -296,12 +296,12 @@ int tsmf_ifman_set_video_window(TSMF_IFMAN* ifman)
|
||||
int tsmf_ifman_update_geometry_info(TSMF_IFMAN* ifman)
|
||||
{
|
||||
TSMF_PRESENTATION* presentation;
|
||||
uint32 numGeometryInfo;
|
||||
uint32 Left;
|
||||
uint32 Top;
|
||||
uint32 Width;
|
||||
uint32 Height;
|
||||
uint32 cbVisibleRect;
|
||||
UINT32 numGeometryInfo;
|
||||
UINT32 Left;
|
||||
UINT32 Top;
|
||||
UINT32 Width;
|
||||
UINT32 Height;
|
||||
UINT32 cbVisibleRect;
|
||||
RDP_RECT* rects = NULL;
|
||||
int num_rects = 0;
|
||||
int error = 0;
|
||||
@@ -311,17 +311,17 @@ int tsmf_ifman_update_geometry_info(TSMF_IFMAN* ifman)
|
||||
presentation = tsmf_presentation_find_by_id(stream_get_tail(ifman->input));
|
||||
stream_seek(ifman->input, 16);
|
||||
|
||||
stream_read_uint32(ifman->input, numGeometryInfo);
|
||||
stream_read_UINT32(ifman->input, numGeometryInfo);
|
||||
pos = stream_get_pos(ifman->input);
|
||||
|
||||
stream_seek(ifman->input, 12); /* VideoWindowId (8 bytes), VideoWindowState (4 bytes) */
|
||||
stream_read_uint32(ifman->input, Width);
|
||||
stream_read_uint32(ifman->input, Height);
|
||||
stream_read_uint32(ifman->input, Left);
|
||||
stream_read_uint32(ifman->input, Top);
|
||||
stream_read_UINT32(ifman->input, Width);
|
||||
stream_read_UINT32(ifman->input, Height);
|
||||
stream_read_UINT32(ifman->input, Left);
|
||||
stream_read_UINT32(ifman->input, Top);
|
||||
|
||||
stream_set_pos(ifman->input, pos + numGeometryInfo);
|
||||
stream_read_uint32(ifman->input, cbVisibleRect);
|
||||
stream_read_UINT32(ifman->input, cbVisibleRect);
|
||||
num_rects = cbVisibleRect / 16;
|
||||
|
||||
DEBUG_DVC("numGeometryInfo %d Width %d Height %d Left %d Top %d cbVisibleRect %d num_rects %d",
|
||||
@@ -379,22 +379,22 @@ int tsmf_ifman_on_sample(TSMF_IFMAN* ifman)
|
||||
{
|
||||
TSMF_PRESENTATION* presentation;
|
||||
TSMF_STREAM* stream;
|
||||
uint32 StreamId;
|
||||
uint64 SampleStartTime;
|
||||
uint64 SampleEndTime;
|
||||
uint64 ThrottleDuration;
|
||||
uint32 SampleExtensions;
|
||||
uint32 cbData;
|
||||
UINT32 StreamId;
|
||||
UINT64 SampleStartTime;
|
||||
UINT64 SampleEndTime;
|
||||
UINT64 ThrottleDuration;
|
||||
UINT32 SampleExtensions;
|
||||
UINT32 cbData;
|
||||
|
||||
stream_seek(ifman->input, 16);
|
||||
stream_read_uint32(ifman->input, StreamId);
|
||||
stream_seek_uint32(ifman->input); /* numSample */
|
||||
stream_read_uint64(ifman->input, SampleStartTime);
|
||||
stream_read_uint64(ifman->input, SampleEndTime);
|
||||
stream_read_uint64(ifman->input, ThrottleDuration);
|
||||
stream_seek_uint32(ifman->input); /* SampleFlags */
|
||||
stream_read_uint32(ifman->input, SampleExtensions);
|
||||
stream_read_uint32(ifman->input, cbData);
|
||||
stream_read_UINT32(ifman->input, StreamId);
|
||||
stream_seek_UINT32(ifman->input); /* numSample */
|
||||
stream_read_UINT64(ifman->input, SampleStartTime);
|
||||
stream_read_UINT64(ifman->input, SampleEndTime);
|
||||
stream_read_UINT64(ifman->input, ThrottleDuration);
|
||||
stream_seek_UINT32(ifman->input); /* SampleFlags */
|
||||
stream_read_UINT32(ifman->input, SampleExtensions);
|
||||
stream_read_UINT32(ifman->input, cbData);
|
||||
|
||||
DEBUG_DVC("MessageId %d StreamId %d SampleStartTime %d SampleEndTime %d "
|
||||
"ThrottleDuration %d SampleExtensions %d cbData %d",
|
||||
@@ -424,10 +424,10 @@ int tsmf_ifman_on_sample(TSMF_IFMAN* ifman)
|
||||
int tsmf_ifman_on_flush(TSMF_IFMAN* ifman)
|
||||
{
|
||||
TSMF_PRESENTATION* presentation;
|
||||
uint32 StreamId;
|
||||
UINT32 StreamId;
|
||||
|
||||
stream_seek(ifman->input, 16);
|
||||
stream_read_uint32(ifman->input, StreamId);
|
||||
stream_read_UINT32(ifman->input, StreamId);
|
||||
DEBUG_DVC("StreamId %d", StreamId);
|
||||
|
||||
presentation = tsmf_presentation_find_by_id(ifman->presentation_id);
|
||||
@@ -447,11 +447,11 @@ int tsmf_ifman_on_end_of_stream(TSMF_IFMAN* ifman)
|
||||
{
|
||||
TSMF_PRESENTATION* presentation;
|
||||
TSMF_STREAM* stream;
|
||||
uint32 StreamId;
|
||||
UINT32 StreamId;
|
||||
|
||||
presentation = tsmf_presentation_find_by_id(stream_get_tail(ifman->input));
|
||||
stream_seek(ifman->input, 16);
|
||||
stream_read_uint32(ifman->input, StreamId);
|
||||
stream_read_UINT32(ifman->input, StreamId);
|
||||
if (presentation)
|
||||
{
|
||||
stream = tsmf_stream_find_by_id(presentation, StreamId);
|
||||
@@ -461,10 +461,10 @@ int tsmf_ifman_on_end_of_stream(TSMF_IFMAN* ifman)
|
||||
DEBUG_DVC("StreamId %d", StreamId);
|
||||
|
||||
stream_check_size(ifman->output, 16);
|
||||
stream_write_uint32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */
|
||||
stream_write_uint32(ifman->output, StreamId); /* StreamId */
|
||||
stream_write_uint32(ifman->output, TSMM_CLIENT_EVENT_ENDOFSTREAM); /* EventId */
|
||||
stream_write_uint32(ifman->output, 0); /* cbData */
|
||||
stream_write_UINT32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */
|
||||
stream_write_UINT32(ifman->output, StreamId); /* StreamId */
|
||||
stream_write_UINT32(ifman->output, TSMM_CLIENT_EVENT_ENDOFSTREAM); /* EventId */
|
||||
stream_write_UINT32(ifman->output, 0); /* cbData */
|
||||
ifman->output_interface_id = TSMF_INTERFACE_CLIENT_NOTIFICATIONS | STREAM_ID_PROXY;
|
||||
|
||||
return 0;
|
||||
@@ -483,10 +483,10 @@ int tsmf_ifman_on_playback_started(TSMF_IFMAN* ifman)
|
||||
DEBUG_WARN("unknown presentation id");
|
||||
|
||||
stream_check_size(ifman->output, 16);
|
||||
stream_write_uint32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */
|
||||
stream_write_uint32(ifman->output, 0); /* StreamId */
|
||||
stream_write_uint32(ifman->output, TSMM_CLIENT_EVENT_START_COMPLETED); /* EventId */
|
||||
stream_write_uint32(ifman->output, 0); /* cbData */
|
||||
stream_write_UINT32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */
|
||||
stream_write_UINT32(ifman->output, 0); /* StreamId */
|
||||
stream_write_UINT32(ifman->output, TSMM_CLIENT_EVENT_START_COMPLETED); /* EventId */
|
||||
stream_write_UINT32(ifman->output, 0); /* cbData */
|
||||
ifman->output_interface_id = TSMF_INTERFACE_CLIENT_NOTIFICATIONS | STREAM_ID_PROXY;
|
||||
|
||||
return 0;
|
||||
@@ -542,10 +542,10 @@ int tsmf_ifman_on_playback_stopped(TSMF_IFMAN* ifman)
|
||||
DEBUG_WARN("unknown presentation id");
|
||||
|
||||
stream_check_size(ifman->output, 16);
|
||||
stream_write_uint32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */
|
||||
stream_write_uint32(ifman->output, 0); /* StreamId */
|
||||
stream_write_uint32(ifman->output, TSMM_CLIENT_EVENT_STOP_COMPLETED); /* EventId */
|
||||
stream_write_uint32(ifman->output, 0); /* cbData */
|
||||
stream_write_UINT32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */
|
||||
stream_write_UINT32(ifman->output, 0); /* StreamId */
|
||||
stream_write_UINT32(ifman->output, TSMM_CLIENT_EVENT_STOP_COMPLETED); /* EventId */
|
||||
stream_write_UINT32(ifman->output, 0); /* cbData */
|
||||
ifman->output_interface_id = TSMF_INTERFACE_CLIENT_NOTIFICATIONS | STREAM_ID_PROXY;
|
||||
|
||||
return 0;
|
||||
@@ -556,10 +556,10 @@ int tsmf_ifman_on_playback_rate_changed(TSMF_IFMAN * ifman)
|
||||
DEBUG_DVC("");
|
||||
|
||||
stream_check_size(ifman->output, 16);
|
||||
stream_write_uint32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */
|
||||
stream_write_uint32(ifman->output, 0); /* StreamId */
|
||||
stream_write_uint32(ifman->output, TSMM_CLIENT_EVENT_MONITORCHANGED); /* EventId */
|
||||
stream_write_uint32(ifman->output, 0); /* cbData */
|
||||
stream_write_UINT32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */
|
||||
stream_write_UINT32(ifman->output, 0); /* StreamId */
|
||||
stream_write_UINT32(ifman->output, TSMM_CLIENT_EVENT_MONITORCHANGED); /* EventId */
|
||||
stream_write_UINT32(ifman->output, 0); /* cbData */
|
||||
ifman->output_interface_id = TSMF_INTERFACE_CLIENT_NOTIFICATIONS | STREAM_ID_PROXY;
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -28,14 +28,14 @@ struct _TSMF_IFMAN
|
||||
const char* audio_name;
|
||||
const char* audio_device;
|
||||
BYTE presentation_id[16];
|
||||
uint32 stream_id;
|
||||
uint32 message_id;
|
||||
UINT32 stream_id;
|
||||
UINT32 message_id;
|
||||
|
||||
STREAM* input;
|
||||
uint32 input_size;
|
||||
UINT32 input_size;
|
||||
STREAM* output;
|
||||
BOOL output_pending;
|
||||
uint32 output_interface_id;
|
||||
UINT32 output_interface_id;
|
||||
};
|
||||
|
||||
int tsmf_ifman_rim_exchange_capability_request(TSMF_IFMAN* ifman);
|
||||
|
||||
@@ -58,7 +58,7 @@ struct _TSMF_CHANNEL_CALLBACK
|
||||
IWTSVirtualChannel* channel;
|
||||
|
||||
BYTE presentation_id[16];
|
||||
uint32 stream_id;
|
||||
UINT32 stream_id;
|
||||
};
|
||||
|
||||
struct _TSMF_PLUGIN
|
||||
@@ -73,19 +73,19 @@ struct _TSMF_PLUGIN
|
||||
};
|
||||
|
||||
void tsmf_playback_ack(IWTSVirtualChannelCallback* pChannelCallback,
|
||||
uint32 message_id, uint64 duration, uint32 data_size)
|
||||
UINT32 message_id, UINT64 duration, UINT32 data_size)
|
||||
{
|
||||
STREAM* s;
|
||||
int error;
|
||||
TSMF_CHANNEL_CALLBACK* callback = (TSMF_CHANNEL_CALLBACK*) pChannelCallback;
|
||||
|
||||
s = stream_new(32);
|
||||
stream_write_uint32(s, TSMF_INTERFACE_CLIENT_NOTIFICATIONS | STREAM_ID_PROXY);
|
||||
stream_write_uint32(s, message_id);
|
||||
stream_write_uint32(s, PLAYBACK_ACK); /* FunctionId */
|
||||
stream_write_uint32(s, callback->stream_id); /* StreamId */
|
||||
stream_write_uint64(s, duration); /* DataDuration */
|
||||
stream_write_uint64(s, data_size); /* cbData */
|
||||
stream_write_UINT32(s, TSMF_INTERFACE_CLIENT_NOTIFICATIONS | STREAM_ID_PROXY);
|
||||
stream_write_UINT32(s, message_id);
|
||||
stream_write_UINT32(s, PLAYBACK_ACK); /* FunctionId */
|
||||
stream_write_UINT32(s, callback->stream_id); /* StreamId */
|
||||
stream_write_UINT64(s, duration); /* DataDuration */
|
||||
stream_write_UINT64(s, data_size); /* cbData */
|
||||
|
||||
DEBUG_DVC("response size %d", (int) stream_get_length(s));
|
||||
error = callback->channel->Write(callback->channel, stream_get_length(s), stream_get_head(s), NULL);
|
||||
@@ -112,7 +112,7 @@ BOOL tsmf_push_event(IWTSVirtualChannelCallback* pChannelCallback,
|
||||
}
|
||||
|
||||
static int tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
|
||||
uint32 cbSize,
|
||||
UINT32 cbSize,
|
||||
BYTE* pBuffer)
|
||||
{
|
||||
int length;
|
||||
@@ -120,9 +120,9 @@ static int tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
|
||||
STREAM* output;
|
||||
int error = -1;
|
||||
TSMF_IFMAN ifman;
|
||||
uint32 MessageId;
|
||||
uint32 FunctionId;
|
||||
uint32 InterfaceId;
|
||||
UINT32 MessageId;
|
||||
UINT32 FunctionId;
|
||||
UINT32 InterfaceId;
|
||||
TSMF_CHANNEL_CALLBACK* callback = (TSMF_CHANNEL_CALLBACK*) pChannelCallback;
|
||||
|
||||
/* 2.2.1 Shared Message Header (SHARED_MSG_HEADER) */
|
||||
@@ -136,9 +136,9 @@ static int tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
|
||||
output = stream_new(256);
|
||||
stream_seek(output, 8);
|
||||
|
||||
stream_read_uint32(input, InterfaceId);
|
||||
stream_read_uint32(input, MessageId);
|
||||
stream_read_uint32(input, FunctionId);
|
||||
stream_read_UINT32(input, InterfaceId);
|
||||
stream_read_UINT32(input, MessageId);
|
||||
stream_read_UINT32(input, FunctionId);
|
||||
DEBUG_DVC("cbSize=%d InterfaceId=0x%X MessageId=0x%X FunctionId=0x%X",
|
||||
cbSize, InterfaceId, MessageId, FunctionId);
|
||||
|
||||
@@ -178,7 +178,7 @@ static int tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
|
||||
case SET_CHANNEL_PARAMS:
|
||||
memcpy(callback->presentation_id, stream_get_tail(input), 16);
|
||||
stream_seek(input, 16);
|
||||
stream_read_uint32(input, callback->stream_id);
|
||||
stream_read_UINT32(input, callback->stream_id);
|
||||
DEBUG_DVC("SET_CHANNEL_PARAMS StreamId=%d", callback->stream_id);
|
||||
ifman.output_pending = TRUE;
|
||||
error = 0;
|
||||
@@ -314,8 +314,8 @@ static int tsmf_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
|
||||
/* Response packet does not have FunctionId */
|
||||
length = stream_get_length(output);
|
||||
stream_set_pos(output, 0);
|
||||
stream_write_uint32(output, ifman.output_interface_id);
|
||||
stream_write_uint32(output, MessageId);
|
||||
stream_write_UINT32(output, ifman.output_interface_id);
|
||||
stream_write_UINT32(output, MessageId);
|
||||
|
||||
DEBUG_DVC("response size %d", length);
|
||||
error = callback->channel->Write(callback->channel, length, stream_get_head(output), NULL);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define __TSMF_MAIN_H
|
||||
|
||||
void tsmf_playback_ack(IWTSVirtualChannelCallback* pChannelCallback,
|
||||
uint32 message_id, uint64 duration, uint32 data_size);
|
||||
UINT32 message_id, UINT64 duration, UINT32 data_size);
|
||||
BOOL tsmf_push_event(IWTSVirtualChannelCallback* pChannelCallback,
|
||||
RDP_EVENT* event);
|
||||
|
||||
|
||||
@@ -63,24 +63,24 @@ struct _TSMF_PRESENTATION
|
||||
const char* audio_device;
|
||||
int eos;
|
||||
|
||||
uint32 last_x;
|
||||
uint32 last_y;
|
||||
uint32 last_width;
|
||||
uint32 last_height;
|
||||
UINT32 last_x;
|
||||
UINT32 last_y;
|
||||
UINT32 last_width;
|
||||
UINT32 last_height;
|
||||
UINT16 last_num_rects;
|
||||
RDP_RECT* last_rects;
|
||||
|
||||
uint32 output_x;
|
||||
uint32 output_y;
|
||||
uint32 output_width;
|
||||
uint32 output_height;
|
||||
UINT32 output_x;
|
||||
UINT32 output_y;
|
||||
UINT32 output_width;
|
||||
UINT32 output_height;
|
||||
UINT16 output_num_rects;
|
||||
RDP_RECT* output_rects;
|
||||
|
||||
IWTSVirtualChannelCallback* channel_callback;
|
||||
|
||||
uint64 audio_start_time;
|
||||
uint64 audio_end_time;
|
||||
UINT64 audio_start_time;
|
||||
UINT64 audio_end_time;
|
||||
|
||||
/* The stream list could be accessed by different threads and need to be protected. */
|
||||
HANDLE mutex;
|
||||
@@ -90,7 +90,7 @@ struct _TSMF_PRESENTATION
|
||||
|
||||
struct _TSMF_STREAM
|
||||
{
|
||||
uint32 stream_id;
|
||||
UINT32 stream_id;
|
||||
|
||||
TSMF_PRESENTATION* presentation;
|
||||
|
||||
@@ -98,18 +98,18 @@ struct _TSMF_STREAM
|
||||
|
||||
int major_type;
|
||||
int eos;
|
||||
uint32 width;
|
||||
uint32 height;
|
||||
UINT32 width;
|
||||
UINT32 height;
|
||||
|
||||
ITSMFAudioDevice* audio;
|
||||
uint32 sample_rate;
|
||||
uint32 channels;
|
||||
uint32 bits_per_sample;
|
||||
UINT32 sample_rate;
|
||||
UINT32 channels;
|
||||
UINT32 bits_per_sample;
|
||||
|
||||
/* The end_time of last played sample */
|
||||
uint64 last_end_time;
|
||||
UINT64 last_end_time;
|
||||
/* Next sample should not start before this system time. */
|
||||
uint64 next_start_time;
|
||||
UINT64 next_start_time;
|
||||
|
||||
freerdp_thread* thread;
|
||||
|
||||
@@ -121,32 +121,32 @@ struct _TSMF_STREAM
|
||||
|
||||
struct _TSMF_SAMPLE
|
||||
{
|
||||
uint32 sample_id;
|
||||
uint64 start_time;
|
||||
uint64 end_time;
|
||||
uint64 duration;
|
||||
uint32 extensions;
|
||||
uint32 data_size;
|
||||
UINT32 sample_id;
|
||||
UINT64 start_time;
|
||||
UINT64 end_time;
|
||||
UINT64 duration;
|
||||
UINT32 extensions;
|
||||
UINT32 data_size;
|
||||
BYTE* data;
|
||||
uint32 decoded_size;
|
||||
uint32 pixfmt;
|
||||
UINT32 decoded_size;
|
||||
UINT32 pixfmt;
|
||||
|
||||
TSMF_STREAM* stream;
|
||||
IWTSVirtualChannelCallback* channel_callback;
|
||||
uint64 ack_time;
|
||||
UINT64 ack_time;
|
||||
};
|
||||
|
||||
static LIST* presentation_list = NULL;
|
||||
static uint64 last_played_audio_time = 0;
|
||||
static UINT64 last_played_audio_time = 0;
|
||||
static HANDLE tsmf_mutex = NULL;
|
||||
static int TERMINATING = 0;
|
||||
|
||||
static uint64 get_current_time(void)
|
||||
static UINT64 get_current_time(void)
|
||||
{
|
||||
struct timeval tp;
|
||||
|
||||
gettimeofday(&tp, 0);
|
||||
return ((uint64)tp.tv_sec) * 10000000LL + ((uint64)tp.tv_usec) * 10LL;
|
||||
return ((UINT64)tp.tv_sec) * 10000000LL + ((UINT64)tp.tv_usec) * 10LL;
|
||||
}
|
||||
|
||||
static TSMF_SAMPLE* tsmf_stream_pop_sample(TSMF_STREAM* stream, int sync)
|
||||
@@ -235,7 +235,7 @@ static void tsmf_sample_queue_ack(TSMF_SAMPLE* sample)
|
||||
static void tsmf_stream_process_ack(TSMF_STREAM* stream)
|
||||
{
|
||||
TSMF_SAMPLE* sample;
|
||||
uint64 ack_time;
|
||||
UINT64 ack_time;
|
||||
|
||||
ack_time = get_current_time();
|
||||
while (list_size(stream->sample_ack_list) > 0 && !freerdp_thread_is_stopped(stream->thread))
|
||||
@@ -323,7 +323,7 @@ static void tsmf_presentation_restore_last_video_frame(TSMF_PRESENTATION* presen
|
||||
|
||||
static void tsmf_sample_playback_video(TSMF_SAMPLE* sample)
|
||||
{
|
||||
uint64 t;
|
||||
UINT64 t;
|
||||
RDP_VIDEO_FRAME_EVENT* vevent;
|
||||
TSMF_STREAM* stream = sample->stream;
|
||||
TSMF_PRESENTATION* presentation = stream->presentation;
|
||||
@@ -426,7 +426,7 @@ static void tsmf_sample_playback_video(TSMF_SAMPLE* sample)
|
||||
|
||||
static void tsmf_sample_playback_audio(TSMF_SAMPLE* sample)
|
||||
{
|
||||
uint64 latency = 0;
|
||||
UINT64 latency = 0;
|
||||
TSMF_STREAM* stream = sample->stream;
|
||||
|
||||
DEBUG_DVC("MessageId %d EndTime %d consumed.",
|
||||
@@ -456,9 +456,9 @@ static void tsmf_sample_playback_audio(TSMF_SAMPLE* sample)
|
||||
static void tsmf_sample_playback(TSMF_SAMPLE* sample)
|
||||
{
|
||||
BOOL ret = FALSE;
|
||||
uint32 width;
|
||||
uint32 height;
|
||||
uint32 pixfmt = 0;
|
||||
UINT32 width;
|
||||
UINT32 height;
|
||||
UINT32 pixfmt = 0;
|
||||
TSMF_STREAM* stream = sample->stream;
|
||||
|
||||
if (stream->decoder)
|
||||
@@ -485,7 +485,7 @@ static void tsmf_sample_playback(TSMF_SAMPLE* sample)
|
||||
if (stream->decoder->GetDecodedFormat)
|
||||
{
|
||||
pixfmt = stream->decoder->GetDecodedFormat(stream->decoder);
|
||||
if (pixfmt == ((uint32) -1))
|
||||
if (pixfmt == ((UINT32) -1))
|
||||
{
|
||||
tsmf_sample_ack(sample);
|
||||
tsmf_sample_free(sample);
|
||||
@@ -526,9 +526,9 @@ static void tsmf_sample_playback(TSMF_SAMPLE* sample)
|
||||
else
|
||||
{
|
||||
TSMF_STREAM * stream = sample->stream;
|
||||
uint64 ack_anticipation_time = get_current_time();
|
||||
uint64 currentRunningTime = sample->start_time;
|
||||
uint32 bufferLevel = 0;
|
||||
UINT64 ack_anticipation_time = get_current_time();
|
||||
UINT64 currentRunningTime = sample->start_time;
|
||||
UINT32 bufferLevel = 0;
|
||||
if (stream->decoder->GetRunningTime)
|
||||
{
|
||||
currentRunningTime = stream->decoder->GetRunningTime(stream->decoder);
|
||||
@@ -738,7 +738,7 @@ static void tsmf_stream_restart(TSMF_STREAM* stream)
|
||||
}
|
||||
}
|
||||
|
||||
static void tsmf_stream_change_volume(TSMF_STREAM* stream, uint32 newVolume, uint32 muted)
|
||||
static void tsmf_stream_change_volume(TSMF_STREAM* stream, UINT32 newVolume, UINT32 muted)
|
||||
{
|
||||
if (!stream)
|
||||
return;
|
||||
@@ -753,7 +753,7 @@ static void tsmf_stream_change_volume(TSMF_STREAM* stream, uint32 newVolume, uin
|
||||
}
|
||||
}
|
||||
|
||||
void tsmf_presentation_volume_changed(TSMF_PRESENTATION* presentation, uint32 newVolume, uint32 muted)
|
||||
void tsmf_presentation_volume_changed(TSMF_PRESENTATION* presentation, UINT32 newVolume, UINT32 muted)
|
||||
{
|
||||
LIST_ITEM* item;
|
||||
TSMF_STREAM* stream;
|
||||
@@ -831,7 +831,7 @@ void tsmf_presentation_stop(TSMF_PRESENTATION* presentation)
|
||||
}
|
||||
|
||||
void tsmf_presentation_set_geometry_info(TSMF_PRESENTATION* presentation,
|
||||
uint32 x, uint32 y, uint32 width, uint32 height,
|
||||
UINT32 x, UINT32 y, UINT32 width, UINT32 height,
|
||||
int num_rects, RDP_RECT* rects)
|
||||
{
|
||||
presentation->output_x = x;
|
||||
@@ -910,7 +910,7 @@ void tsmf_presentation_free(TSMF_PRESENTATION* presentation)
|
||||
free(presentation);
|
||||
}
|
||||
|
||||
TSMF_STREAM* tsmf_stream_new(TSMF_PRESENTATION* presentation, uint32 stream_id)
|
||||
TSMF_STREAM* tsmf_stream_new(TSMF_PRESENTATION* presentation, UINT32 stream_id)
|
||||
{
|
||||
TSMF_STREAM* stream;
|
||||
|
||||
@@ -936,7 +936,7 @@ TSMF_STREAM* tsmf_stream_new(TSMF_PRESENTATION* presentation, uint32 stream_id)
|
||||
return stream;
|
||||
}
|
||||
|
||||
TSMF_STREAM* tsmf_stream_find_by_id(TSMF_PRESENTATION* presentation, uint32 stream_id)
|
||||
TSMF_STREAM* tsmf_stream_find_by_id(TSMF_PRESENTATION* presentation, UINT32 stream_id)
|
||||
{
|
||||
LIST_ITEM* item;
|
||||
TSMF_STREAM* stream;
|
||||
@@ -1020,8 +1020,8 @@ void tsmf_stream_free(TSMF_STREAM* stream)
|
||||
}
|
||||
|
||||
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, BYTE* data)
|
||||
UINT32 sample_id, UINT64 start_time, UINT64 end_time, UINT64 duration, UINT32 extensions,
|
||||
UINT32 data_size, BYTE* data)
|
||||
{
|
||||
TSMF_SAMPLE* sample;
|
||||
|
||||
|
||||
@@ -38,24 +38,24 @@ void tsmf_presentation_start(TSMF_PRESENTATION* presentation);
|
||||
void tsmf_presentation_stop(TSMF_PRESENTATION* presentation);
|
||||
void tsmf_presentation_paused(TSMF_PRESENTATION* presentation);
|
||||
void tsmf_presentation_restarted(TSMF_PRESENTATION* presentation);
|
||||
void tsmf_presentation_volume_changed(TSMF_PRESENTATION* presentation, uint32 newVolume, uint32 muted);
|
||||
void tsmf_presentation_volume_changed(TSMF_PRESENTATION* presentation, UINT32 newVolume, UINT32 muted);
|
||||
void tsmf_presentation_set_geometry_info(TSMF_PRESENTATION* presentation,
|
||||
uint32 x, uint32 y, uint32 width, uint32 height,
|
||||
UINT32 x, UINT32 y, UINT32 width, UINT32 height,
|
||||
int num_rects, RDP_RECT* rects);
|
||||
void tsmf_presentation_set_audio_device(TSMF_PRESENTATION* presentation,
|
||||
const char* name, const char* device);
|
||||
void tsmf_presentation_flush(TSMF_PRESENTATION* presentation);
|
||||
void tsmf_presentation_free(TSMF_PRESENTATION* presentation);
|
||||
|
||||
TSMF_STREAM* tsmf_stream_new(TSMF_PRESENTATION* presentation, uint32 stream_id);
|
||||
TSMF_STREAM* tsmf_stream_find_by_id(TSMF_PRESENTATION* presentation, uint32 stream_id);
|
||||
TSMF_STREAM* tsmf_stream_new(TSMF_PRESENTATION* presentation, UINT32 stream_id);
|
||||
TSMF_STREAM* tsmf_stream_find_by_id(TSMF_PRESENTATION* presentation, UINT32 stream_id);
|
||||
void tsmf_stream_set_format(TSMF_STREAM* stream, const char* name, STREAM* s);
|
||||
void tsmf_stream_end(TSMF_STREAM* stream);
|
||||
void tsmf_stream_free(TSMF_STREAM* stream);
|
||||
|
||||
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, BYTE* data);
|
||||
UINT32 sample_id, UINT64 start_time, UINT64 end_time, UINT64 duration, UINT32 extensions,
|
||||
UINT32 data_size, BYTE* data);
|
||||
|
||||
void tsmf_media_init(void);
|
||||
|
||||
|
||||
@@ -40,19 +40,19 @@ typedef struct _TS_AM_MEDIA_TYPE
|
||||
int SubType;
|
||||
int FormatType;
|
||||
|
||||
uint32 Width;
|
||||
uint32 Height;
|
||||
uint32 BitRate;
|
||||
UINT32 Width;
|
||||
UINT32 Height;
|
||||
UINT32 BitRate;
|
||||
struct
|
||||
{
|
||||
uint32 Numerator;
|
||||
uint32 Denominator;
|
||||
UINT32 Numerator;
|
||||
UINT32 Denominator;
|
||||
} SamplesPerSecond;
|
||||
uint32 Channels;
|
||||
uint32 BitsPerSample;
|
||||
uint32 BlockAlign;
|
||||
UINT32 Channels;
|
||||
UINT32 BitsPerSample;
|
||||
UINT32 BlockAlign;
|
||||
const BYTE* ExtraData;
|
||||
uint32 ExtraDataSize;
|
||||
UINT32 ExtraDataSize;
|
||||
} TS_AM_MEDIA_TYPE;
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -35,7 +35,7 @@ struct _ISOCH_CALLBACK_DATA
|
||||
void * next;
|
||||
void * device;
|
||||
BYTE * out_data;
|
||||
uint32 out_size;
|
||||
UINT32 out_size;
|
||||
void * callback;
|
||||
};
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ void searchman_free(USB_SEARCHMAN* self)
|
||||
free(self);
|
||||
}
|
||||
|
||||
USB_SEARCHMAN* searchman_new(void * urbdrc, uint32 UsbDevice)
|
||||
USB_SEARCHMAN* searchman_new(void * urbdrc, UINT32 UsbDevice)
|
||||
{
|
||||
int ret;
|
||||
USB_SEARCHMAN* searchman;
|
||||
|
||||
@@ -38,7 +38,7 @@ typedef struct _USB_SEARCHMAN USB_SEARCHMAN;
|
||||
struct _USB_SEARCHMAN
|
||||
{
|
||||
int usb_numbers;
|
||||
uint32 UsbDevice;
|
||||
UINT32 UsbDevice;
|
||||
USB_SEARCHDEV * idev; /* iterator device */
|
||||
USB_SEARCHDEV * head; /* head device in linked list */
|
||||
USB_SEARCHDEV * tail; /* tail device in linked list */
|
||||
@@ -71,7 +71,7 @@ struct _USB_SEARCHMAN
|
||||
void (*free) (USB_SEARCHMAN* searchman);
|
||||
};
|
||||
|
||||
USB_SEARCHMAN * searchman_new(void * urbdrc, uint32 UsbDevice);
|
||||
USB_SEARCHMAN * searchman_new(void * urbdrc, UINT32 UsbDevice);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -185,14 +185,14 @@ static void func_lock_isoch_mutex(TRANSFER_DATA* transfer_data)
|
||||
{
|
||||
int noAck = 0;
|
||||
IUDEVICE* pdev;
|
||||
uint32 FunctionId;
|
||||
uint32 RequestField;
|
||||
UINT32 FunctionId;
|
||||
UINT32 RequestField;
|
||||
UINT16 URB_Function;
|
||||
IUDEVMAN* udevman = transfer_data->udevman;
|
||||
|
||||
if (transfer_data->cbSize >= 8)
|
||||
{
|
||||
data_read_uint32(transfer_data->pBuffer + 4, FunctionId);
|
||||
data_read_UINT32(transfer_data->pBuffer + 4, FunctionId);
|
||||
|
||||
if ((FunctionId == TRANSFER_IN_REQUEST ||
|
||||
FunctionId == TRANSFER_OUT_REQUEST) &&
|
||||
@@ -203,7 +203,7 @@ static void func_lock_isoch_mutex(TRANSFER_DATA* transfer_data)
|
||||
if (URB_Function == URB_FUNCTION_ISOCH_TRANSFER &&
|
||||
transfer_data->cbSize >= 20)
|
||||
{
|
||||
data_read_uint32(transfer_data->pBuffer + 16, RequestField);
|
||||
data_read_UINT32(transfer_data->pBuffer + 16, RequestField);
|
||||
noAck = (RequestField & 0x80000000)>>31;
|
||||
|
||||
if (!noAck)
|
||||
@@ -218,66 +218,66 @@ static void func_lock_isoch_mutex(TRANSFER_DATA* transfer_data)
|
||||
|
||||
#endif
|
||||
|
||||
static int urbdrc_process_capability_request(URBDRC_CHANNEL_CALLBACK* callback, char* data, uint32 data_sizem, uint32 MessageId)
|
||||
static int urbdrc_process_capability_request(URBDRC_CHANNEL_CALLBACK* callback, char* data, UINT32 data_sizem, UINT32 MessageId)
|
||||
{
|
||||
uint32 InterfaceId;
|
||||
uint32 Version;
|
||||
uint32 out_size;
|
||||
UINT32 InterfaceId;
|
||||
UINT32 Version;
|
||||
UINT32 out_size;
|
||||
char * out_data;
|
||||
|
||||
LLOGLN(10, ("urbdrc_process_capability_request"));
|
||||
data_read_uint32(data + 0, Version);
|
||||
data_read_UINT32(data + 0, Version);
|
||||
|
||||
InterfaceId = ((STREAM_ID_NONE<<30) | CAPABILITIES_NEGOTIATOR);
|
||||
|
||||
out_size = 16;
|
||||
out_data = (char *) malloc(out_size);
|
||||
memset(out_data, 0, out_size);
|
||||
data_write_uint32(out_data + 0, InterfaceId); /* interface id */
|
||||
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 */
|
||||
data_write_UINT32(out_data + 0, InterfaceId); /* interface id */
|
||||
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, (BYTE*) out_data, NULL);
|
||||
zfree(out_data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int urbdrc_process_channel_create(URBDRC_CHANNEL_CALLBACK* callback, char* data, uint32 data_sizem, uint32 MessageId)
|
||||
static int urbdrc_process_channel_create(URBDRC_CHANNEL_CALLBACK* callback, char* data, UINT32 data_sizem, UINT32 MessageId)
|
||||
{
|
||||
uint32 InterfaceId;
|
||||
uint32 out_size;
|
||||
uint32 MajorVersion;
|
||||
uint32 MinorVersion;
|
||||
uint32 Capabilities;
|
||||
UINT32 InterfaceId;
|
||||
UINT32 out_size;
|
||||
UINT32 MajorVersion;
|
||||
UINT32 MinorVersion;
|
||||
UINT32 Capabilities;
|
||||
char* out_data;
|
||||
|
||||
LLOGLN(10, ("urbdrc_process_channel_create"));
|
||||
data_read_uint32(data + 0, MajorVersion);
|
||||
data_read_uint32(data + 4, MinorVersion);
|
||||
data_read_uint32(data + 8, Capabilities);
|
||||
data_read_UINT32(data + 0, MajorVersion);
|
||||
data_read_UINT32(data + 4, MinorVersion);
|
||||
data_read_UINT32(data + 8, Capabilities);
|
||||
|
||||
InterfaceId = ((STREAM_ID_PROXY<<30) | CLIENT_CHANNEL_NOTIFICATION);
|
||||
|
||||
out_size = 24;
|
||||
out_data = (char *) malloc(out_size);
|
||||
memset(out_data, 0, out_size);
|
||||
data_write_uint32(out_data + 0, InterfaceId); /* interface id */
|
||||
data_write_uint32(out_data + 4, MessageId); /* message id */
|
||||
data_write_uint32(out_data + 8, CHANNEL_CREATED); /* function id */
|
||||
data_write_uint32(out_data + 12, MajorVersion);
|
||||
data_write_uint32(out_data + 16, MinorVersion);
|
||||
data_write_uint32(out_data + 20, Capabilities); /* capabilities version */
|
||||
data_write_UINT32(out_data + 0, InterfaceId); /* interface id */
|
||||
data_write_UINT32(out_data + 4, MessageId); /* message id */
|
||||
data_write_UINT32(out_data + 8, CHANNEL_CREATED); /* function id */
|
||||
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, (BYTE *)out_data, NULL);
|
||||
zfree(out_data);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int urdbrc_send_virtual_channel_add(IWTSVirtualChannel* channel, uint32 MessageId)
|
||||
static int urdbrc_send_virtual_channel_add(IWTSVirtualChannel* channel, UINT32 MessageId)
|
||||
{
|
||||
uint32 out_size;
|
||||
uint32 InterfaceId;
|
||||
UINT32 out_size;
|
||||
UINT32 InterfaceId;
|
||||
char* out_data;
|
||||
|
||||
LLOGLN(10, ("urdbrc_send_virtual_channel_add"));
|
||||
@@ -287,9 +287,9 @@ static int urdbrc_send_virtual_channel_add(IWTSVirtualChannel* channel, uint32 M
|
||||
out_size = 12;
|
||||
out_data = (char *) 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 + 8, ADD_VIRTUAL_CHANNEL); /* function id */
|
||||
data_write_UINT32(out_data + 0, InterfaceId); /* interface */
|
||||
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, (BYTE*) out_data, NULL);
|
||||
zfree(out_data);
|
||||
@@ -300,7 +300,7 @@ static int urdbrc_send_virtual_channel_add(IWTSVirtualChannel* channel, uint32 M
|
||||
static int urdbrc_send_usb_device_add(URBDRC_CHANNEL_CALLBACK* callback, IUDEVICE* pdev)
|
||||
{
|
||||
char* out_data;
|
||||
uint32 InterfaceId;
|
||||
UINT32 InterfaceId;
|
||||
char HardwareIds[2][DEVICE_HARDWARE_ID_SIZE];
|
||||
char CompatibilityIds[3][DEVICE_COMPATIBILITY_ID_SIZE];
|
||||
char strContainerId[DEVICE_CONTAINER_STR_SIZE];
|
||||
@@ -343,16 +343,16 @@ static int urdbrc_send_usb_device_add(URBDRC_CHANNEL_CALLBACK* callback, IUDEVIC
|
||||
out_data = (char*) malloc(size);
|
||||
memset(out_data, 0, size);
|
||||
|
||||
data_write_uint32(out_data + 0, InterfaceId); /* interface */
|
||||
data_write_uint32(out_data + 4, 0); /* message id */
|
||||
data_write_uint32(out_data + 8, ADD_DEVICE); /* function id */
|
||||
data_write_uint32(out_data + 12, 0x00000001); /* NumUsbDevice */
|
||||
data_write_uint32(out_data + 16, pdev->get_UsbDevice(pdev)); /* UsbDevice */
|
||||
data_write_uint32(out_data + 20, 0x00000025); /* cchDeviceInstanceId */
|
||||
data_write_UINT32(out_data + 0, InterfaceId); /* interface */
|
||||
data_write_UINT32(out_data + 4, 0); /* message id */
|
||||
data_write_UINT32(out_data + 8, ADD_DEVICE); /* function id */
|
||||
data_write_UINT32(out_data + 12, 0x00000001); /* NumUsbDevice */
|
||||
data_write_UINT32(out_data + 16, pdev->get_UsbDevice(pdev)); /* UsbDevice */
|
||||
data_write_UINT32(out_data + 20, 0x00000025); /* cchDeviceInstanceId */
|
||||
|
||||
out_offset = fun_device_string_send_set(out_data, out_offset, strInstanceId);
|
||||
|
||||
data_write_uint32(out_data + out_offset, 0x00000036); /* cchHwIds */
|
||||
data_write_UINT32(out_data + out_offset, 0x00000036); /* cchHwIds */
|
||||
out_offset += 4;
|
||||
/* HardwareIds 1 */
|
||||
out_offset = fun_device_string_send_set(out_data, out_offset, HardwareIds[0]);
|
||||
@@ -361,7 +361,7 @@ static int urdbrc_send_usb_device_add(URBDRC_CHANNEL_CALLBACK* callback, IUDEVIC
|
||||
data_write_UINT16(out_data + out_offset, 0x0000); /* add "\0" */
|
||||
out_offset += 2;
|
||||
|
||||
data_write_uint32(out_data + out_offset, cchCompatIds); /* cchCompatIds */
|
||||
data_write_UINT32(out_data + out_offset, cchCompatIds); /* cchCompatIds */
|
||||
out_offset += 4;
|
||||
/* CompatibilityIds 1 */
|
||||
out_offset = fun_device_string_send_set(out_data, out_offset, CompatibilityIds[0]);
|
||||
@@ -376,27 +376,27 @@ static int urdbrc_send_usb_device_add(URBDRC_CHANNEL_CALLBACK* callback, IUDEVIC
|
||||
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, 0x00000027); /* cchContainerId */
|
||||
out_offset += 4;
|
||||
/* ContainerId */
|
||||
out_offset = fun_device_string_send_set(out_data, out_offset, strContainerId);
|
||||
|
||||
/* USB_DEVICE_CAPABILITIES 28 bytes */
|
||||
data_write_uint32(out_data + out_offset, 0x0000001c); /* CbSize */
|
||||
data_write_uint32(out_data + out_offset + 4, 2); /* UsbBusInterfaceVersion, 0 ,1 or 2 */
|
||||
data_write_uint32(out_data + out_offset + 8, 0x600); /* USBDI_Version, 0x500 or 0x600 */
|
||||
data_write_UINT32(out_data + out_offset, 0x0000001c); /* CbSize */
|
||||
data_write_UINT32(out_data + out_offset + 4, 2); /* UsbBusInterfaceVersion, 0 ,1 or 2 */
|
||||
data_write_UINT32(out_data + out_offset + 8, 0x600); /* USBDI_Version, 0x500 or 0x600 */
|
||||
|
||||
/* Supported_USB_Version, 0x110,0x110 or 0x200(usb2.0) */
|
||||
bcdUSB = pdev->query_device_descriptor(pdev, BCD_USB);
|
||||
data_write_uint32(out_data + out_offset + 12, bcdUSB);
|
||||
data_write_uint32(out_data + out_offset + 16, 0x00000000); /* HcdCapabilities, MUST always be zero */
|
||||
data_write_UINT32(out_data + out_offset + 12, bcdUSB);
|
||||
data_write_UINT32(out_data + out_offset + 16, 0x00000000); /* HcdCapabilities, MUST always be zero */
|
||||
|
||||
if (bcdUSB < 0x200)
|
||||
data_write_uint32(out_data + out_offset + 20, 0x00000000); /* DeviceIsHighSpeed */
|
||||
data_write_UINT32(out_data + out_offset + 20, 0x00000000); /* DeviceIsHighSpeed */
|
||||
else
|
||||
data_write_uint32(out_data + out_offset + 20, 0x00000001); /* DeviceIsHighSpeed */
|
||||
data_write_UINT32(out_data + out_offset + 20, 0x00000001); /* DeviceIsHighSpeed */
|
||||
|
||||
data_write_uint32(out_data + out_offset + 24, 0x50); /* NoAckIsochWriteJitterBufferSizeInMs, >=10 or <=512 */
|
||||
data_write_UINT32(out_data + out_offset + 24, 0x50); /* NoAckIsochWriteJitterBufferSizeInMs, >=10 or <=512 */
|
||||
out_offset += 28;
|
||||
|
||||
callback->channel->Write(callback->channel, out_offset, (BYTE *)out_data, NULL);
|
||||
@@ -405,15 +405,15 @@ static int urdbrc_send_usb_device_add(URBDRC_CHANNEL_CALLBACK* callback, IUDEVIC
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int urbdrc_exchange_capabilities(URBDRC_CHANNEL_CALLBACK* callback, char* pBuffer, uint32 cbSize)
|
||||
static int urbdrc_exchange_capabilities(URBDRC_CHANNEL_CALLBACK* callback, char* pBuffer, UINT32 cbSize)
|
||||
{
|
||||
uint32 MessageId;
|
||||
uint32 FunctionId;
|
||||
UINT32 MessageId;
|
||||
UINT32 FunctionId;
|
||||
|
||||
int error = 0;
|
||||
|
||||
data_read_uint32(pBuffer + 0, MessageId);
|
||||
data_read_uint32(pBuffer + 4, FunctionId);
|
||||
data_read_UINT32(pBuffer + 0, MessageId);
|
||||
data_read_UINT32(pBuffer + 4, FunctionId);
|
||||
|
||||
switch (FunctionId)
|
||||
{
|
||||
@@ -661,16 +661,16 @@ void* urbdrc_new_device_create(void * arg)
|
||||
BYTE* pBuffer = transfer_data->pBuffer;
|
||||
IUDEVMAN* udevman = transfer_data->udevman;
|
||||
IUDEVICE* pdev = NULL;
|
||||
uint32 ChannelId = 0;
|
||||
uint32 MessageId;
|
||||
uint32 FunctionId;
|
||||
UINT32 ChannelId = 0;
|
||||
UINT32 MessageId;
|
||||
UINT32 FunctionId;
|
||||
int i = 0, found = 0;
|
||||
|
||||
channel_mgr = urbdrc->listener_callback->channel_mgr;
|
||||
ChannelId = channel_mgr->GetChannelId(callback->channel);
|
||||
|
||||
data_read_uint32(pBuffer + 0, MessageId);
|
||||
data_read_uint32(pBuffer + 4, FunctionId);
|
||||
data_read_UINT32(pBuffer + 0, MessageId);
|
||||
data_read_UINT32(pBuffer + 4, FunctionId);
|
||||
|
||||
int error = 0;
|
||||
|
||||
@@ -728,15 +728,15 @@ void* urbdrc_new_device_create(void * arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int urbdrc_process_channel_notification(URBDRC_CHANNEL_CALLBACK* callback, char* pBuffer, uint32 cbSize)
|
||||
static int urbdrc_process_channel_notification(URBDRC_CHANNEL_CALLBACK* callback, char* pBuffer, UINT32 cbSize)
|
||||
{
|
||||
int i, error = 0;
|
||||
uint32 MessageId;
|
||||
uint32 FunctionId;
|
||||
UINT32 MessageId;
|
||||
UINT32 FunctionId;
|
||||
URBDRC_PLUGIN* urbdrc = (URBDRC_PLUGIN*) callback->plugin;
|
||||
|
||||
data_read_uint32(pBuffer + 0, MessageId);
|
||||
data_read_uint32(pBuffer + 4, FunctionId);
|
||||
data_read_UINT32(pBuffer + 0, MessageId);
|
||||
data_read_UINT32(pBuffer + 4, FunctionId);
|
||||
|
||||
switch (FunctionId)
|
||||
{
|
||||
@@ -775,14 +775,14 @@ static int urbdrc_process_channel_notification(URBDRC_CHANNEL_CALLBACK* callback
|
||||
return error;
|
||||
}
|
||||
|
||||
static int urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, uint32 cbSize, BYTE* Buffer)
|
||||
static int urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, UINT32 cbSize, BYTE* Buffer)
|
||||
{
|
||||
URBDRC_CHANNEL_CALLBACK* callback = (URBDRC_CHANNEL_CALLBACK*) pChannelCallback;
|
||||
URBDRC_PLUGIN* urbdrc;
|
||||
IUDEVMAN* udevman;
|
||||
uint32 InterfaceTemp;
|
||||
uint32 InterfaceId;
|
||||
uint32 Mask;
|
||||
UINT32 InterfaceTemp;
|
||||
UINT32 InterfaceId;
|
||||
UINT32 Mask;
|
||||
int error = 0;
|
||||
char* pBuffer = (char*) Buffer;
|
||||
|
||||
@@ -799,7 +799,7 @@ static int urbdrc_on_data_received(IWTSVirtualChannelCallback* pChannelCallback,
|
||||
|
||||
udevman = (IUDEVMAN*) urbdrc->udevman;
|
||||
|
||||
data_read_uint32(pBuffer + 0, InterfaceTemp);
|
||||
data_read_UINT32(pBuffer + 0, InterfaceTemp);
|
||||
InterfaceId = (InterfaceTemp & 0x0fffffff);
|
||||
Mask = ((InterfaceTemp & 0xf0000000)>>30);
|
||||
LLOGLN(10, ("urbdrc_on_data_received: Size=%d InterfaceId=0x%X Mask=0x%X", cbSize, InterfaceId, Mask));
|
||||
@@ -861,7 +861,7 @@ static int urbdrc_on_close(IWTSVirtualChannelCallback * pChannelCallback)
|
||||
IUDEVMAN* udevman = (IUDEVMAN*) urbdrc->udevman;
|
||||
USB_SEARCHMAN* searchman = (USB_SEARCHMAN*) urbdrc->searchman;
|
||||
IUDEVICE* pdev = NULL;
|
||||
uint32 ChannelId = 0;
|
||||
UINT32 ChannelId = 0;
|
||||
int found = 0;
|
||||
|
||||
ChannelId = callback->channel_mgr->GetChannelId(callback->channel);
|
||||
|
||||
@@ -72,8 +72,8 @@ struct _URBDRC_PLUGIN
|
||||
|
||||
IUDEVMAN* udevman;
|
||||
USB_SEARCHMAN* searchman;
|
||||
uint32 first_channel_id;
|
||||
uint32 vchannel_status;
|
||||
UINT32 first_channel_id;
|
||||
UINT32 vchannel_status;
|
||||
};
|
||||
|
||||
#define URBDRC_UDEVMAN_EXPORT_FUNC_NAME "FreeRDPUDEVMANEntry"
|
||||
@@ -99,75 +99,75 @@ struct _TRANSFER_DATA
|
||||
URBDRC_PLUGIN* urbdrc;
|
||||
IUDEVMAN* udevman;
|
||||
BYTE* pBuffer;
|
||||
uint32 cbSize;
|
||||
uint32 UsbDevice;
|
||||
UINT32 cbSize;
|
||||
UINT32 UsbDevice;
|
||||
};
|
||||
|
||||
struct _IUDEVICE
|
||||
{
|
||||
/* Transfer */
|
||||
int (*isoch_transfer) (IUDEVICE * idev, uint32 RequestId,
|
||||
uint32 EndpointAddress,
|
||||
uint32 TransferFlags,
|
||||
int (*isoch_transfer) (IUDEVICE * idev, UINT32 RequestId,
|
||||
UINT32 EndpointAddress,
|
||||
UINT32 TransferFlags,
|
||||
int NoAck,
|
||||
uint32 *ErrorCount,
|
||||
uint32 *UrbdStatus,
|
||||
uint32 *StartFrame,
|
||||
uint32 NumberOfPackets,
|
||||
UINT32 *ErrorCount,
|
||||
UINT32 *UrbdStatus,
|
||||
UINT32 *StartFrame,
|
||||
UINT32 NumberOfPackets,
|
||||
BYTE *IsoPacket,
|
||||
uint32 *BufferSize,
|
||||
UINT32 *BufferSize,
|
||||
BYTE *Buffer,
|
||||
int Timeout);
|
||||
|
||||
int (*control_transfer) (IUDEVICE * idev, uint32 RequestId,
|
||||
uint32 EndpointAddress,
|
||||
uint32 TransferFlags,
|
||||
int (*control_transfer) (IUDEVICE * idev, UINT32 RequestId,
|
||||
UINT32 EndpointAddress,
|
||||
UINT32 TransferFlags,
|
||||
BYTE bmRequestType,
|
||||
BYTE Request,
|
||||
UINT16 Value,
|
||||
UINT16 Index,
|
||||
uint32 *UrbdStatus,
|
||||
uint32 *BufferSize,
|
||||
UINT32 *UrbdStatus,
|
||||
UINT32 *BufferSize,
|
||||
BYTE *Buffer,
|
||||
uint32 Timeout);
|
||||
UINT32 Timeout);
|
||||
|
||||
int (*bulk_or_interrupt_transfer) (IUDEVICE * idev, uint32 RequestId,
|
||||
uint32 EndpointAddress,
|
||||
uint32 TransferFlags,
|
||||
uint32 *UsbdStatus,
|
||||
uint32 *BufferSize,
|
||||
int (*bulk_or_interrupt_transfer) (IUDEVICE * idev, UINT32 RequestId,
|
||||
UINT32 EndpointAddress,
|
||||
UINT32 TransferFlags,
|
||||
UINT32 *UsbdStatus,
|
||||
UINT32 *BufferSize,
|
||||
BYTE *Buffer,
|
||||
uint32 Timeout);
|
||||
UINT32 Timeout);
|
||||
|
||||
|
||||
int (*select_configuration) (IUDEVICE * idev, uint32 bConfigurationValue);
|
||||
int (*select_configuration) (IUDEVICE * idev, UINT32 bConfigurationValue);
|
||||
|
||||
int (*select_interface) (IUDEVICE * idev, BYTE InterfaceNumber,
|
||||
BYTE AlternateSetting);
|
||||
|
||||
int (*control_pipe_request) (IUDEVICE * idev, uint32 RequestId,
|
||||
uint32 EndpointAddress,
|
||||
uint32 *UsbdStatus,
|
||||
int (*control_pipe_request) (IUDEVICE * idev, UINT32 RequestId,
|
||||
UINT32 EndpointAddress,
|
||||
UINT32 *UsbdStatus,
|
||||
int command);
|
||||
|
||||
int (*control_query_device_text) (IUDEVICE * idev, uint32 TextType,
|
||||
uint32 LocaleId,
|
||||
uint32 *BufferSize,
|
||||
int (*control_query_device_text) (IUDEVICE * idev, UINT32 TextType,
|
||||
UINT32 LocaleId,
|
||||
UINT32 *BufferSize,
|
||||
BYTE * Buffer);
|
||||
|
||||
int (*os_feature_descriptor_request) (IUDEVICE * idev, uint32 RequestId,
|
||||
int (*os_feature_descriptor_request) (IUDEVICE * idev, UINT32 RequestId,
|
||||
BYTE Recipient,
|
||||
BYTE InterfaceNumber,
|
||||
BYTE Ms_PageIndex,
|
||||
UINT16 Ms_featureDescIndex,
|
||||
uint32 * UsbdStatus,
|
||||
uint32 * BufferSize,
|
||||
UINT32 * UsbdStatus,
|
||||
UINT32 * BufferSize,
|
||||
BYTE* Buffer,
|
||||
int Timeout);
|
||||
|
||||
void (*cancel_all_transfer_request) (IUDEVICE * idev);
|
||||
|
||||
int (*cancel_transfer_request) (IUDEVICE * idev, uint32 RequestId);
|
||||
int (*cancel_transfer_request) (IUDEVICE * idev, UINT32 RequestId);
|
||||
|
||||
int (*query_device_descriptor) (IUDEVICE * idev, int offset);
|
||||
|
||||
@@ -189,8 +189,8 @@ struct _IUDEVICE
|
||||
void (*lock_fifo_isoch) (IUDEVICE * idev);
|
||||
void (*unlock_fifo_isoch) (IUDEVICE * idev);
|
||||
|
||||
int (*query_device_port_status) (IUDEVICE * idev, uint32 *UsbdStatus,
|
||||
uint32 * BufferSize,
|
||||
int (*query_device_port_status) (IUDEVICE * idev, UINT32 *UsbdStatus,
|
||||
UINT32 * BufferSize,
|
||||
BYTE * Buffer);
|
||||
|
||||
int (*request_queue_is_none) (IUDEVICE * idev);
|
||||
@@ -208,9 +208,9 @@ struct _IUDEVICE
|
||||
void (*setChannelClosed) (IUDEVICE * idev);
|
||||
char *(*getPath) (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(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(port_number, int);
|
||||
@@ -242,15 +242,15 @@ struct _IUDEVMAN
|
||||
int flag);
|
||||
IUDEVICE *(*get_next) (IUDEVMAN *idevman);
|
||||
IUDEVICE *(*get_udevice_by_UsbDevice) (IUDEVMAN * idevman,
|
||||
uint32 UsbDevice);
|
||||
UINT32 UsbDevice);
|
||||
IUDEVICE *(*get_udevice_by_UsbDevice_try_again) (IUDEVMAN * idevman,
|
||||
uint32 UsbDevice);
|
||||
UINT32 UsbDevice);
|
||||
/* Extension */
|
||||
int (*check_device_exist_by_id) (IUDEVMAN * idevman, UINT16 idVendor,
|
||||
UINT16 idProduct);
|
||||
int (*isAutoAdd) (IUDEVMAN * idevman);
|
||||
/* Basic state */
|
||||
BASIC_DEVMAN_STATE_DEFINED(defUsbDevice, uint32);
|
||||
BASIC_DEVMAN_STATE_DEFINED(defUsbDevice, UINT32);
|
||||
BASIC_DEVMAN_STATE_DEFINED(device_num, int);
|
||||
BASIC_DEVMAN_STATE_DEFINED(sem_timeout, int);
|
||||
/* control semaphore or mutex lock */
|
||||
|
||||
@@ -62,9 +62,9 @@ struct _ISO_USER_DATA
|
||||
BYTE * output_data;
|
||||
int iso_status;
|
||||
int completed;
|
||||
uint32 error_count;
|
||||
UINT32 error_count;
|
||||
int noack;
|
||||
uint32 start_frame;
|
||||
UINT32 start_frame;
|
||||
};
|
||||
|
||||
static int
|
||||
@@ -155,9 +155,9 @@ func_iso_callback(struct libusb_transfer *transfer)
|
||||
ISO_USER_DATA * iso_user_data = (ISO_USER_DATA *) transfer->user_data;
|
||||
BYTE * data = iso_user_data->IsoPacket;
|
||||
int * completed = &iso_user_data->completed;
|
||||
uint32 offset = 0;
|
||||
uint32 index = 0;
|
||||
uint32 i, act_len;
|
||||
UINT32 offset = 0;
|
||||
UINT32 index = 0;
|
||||
UINT32 i, act_len;
|
||||
BYTE *b;
|
||||
|
||||
*completed = 1;
|
||||
@@ -170,9 +170,9 @@ func_iso_callback(struct libusb_transfer *transfer)
|
||||
for (i = 0; i < transfer->num_iso_packets; i++)
|
||||
{
|
||||
act_len = transfer->iso_packet_desc[i].actual_length;
|
||||
data_write_uint32(data + offset, index);
|
||||
data_write_uint32(data + offset + 4, act_len);
|
||||
data_write_uint32(data + offset + 8,
|
||||
data_write_UINT32(data + offset, index);
|
||||
data_write_UINT32(data + offset + 4, act_len);
|
||||
data_write_UINT32(data + offset + 8,
|
||||
transfer->iso_packet_desc[i].status);
|
||||
offset += 12;
|
||||
if (transfer->iso_packet_desc[i].status == USBD_STATUS_SUCCESS)
|
||||
@@ -215,7 +215,7 @@ func_iso_callback(struct libusb_transfer *transfer)
|
||||
static const LIBUSB_ENDPOINT_DESCEIPTOR*
|
||||
func_get_ep_desc(LIBUSB_CONFIG_DESCRIPTOR * LibusbConfig,
|
||||
MSUSB_CONFIG_DESCRIPTOR * MsConfig,
|
||||
uint32 EndpointAddress)
|
||||
UINT32 EndpointAddress)
|
||||
{
|
||||
MSUSB_INTERFACE_DESCRIPTOR ** MsInterfaces;
|
||||
const LIBUSB_INTERFACE * interface;
|
||||
@@ -255,7 +255,7 @@ func_bulk_transfer_cb(struct libusb_transfer *transfer)
|
||||
|
||||
|
||||
static int
|
||||
func_set_usbd_status(UDEVICE* pdev, uint32* status, int err_result)
|
||||
func_set_usbd_status(UDEVICE* pdev, UINT32* status, int err_result)
|
||||
{
|
||||
switch (err_result)
|
||||
{
|
||||
@@ -319,8 +319,8 @@ func_set_usbd_status(UDEVICE* pdev, uint32* status, int err_result)
|
||||
|
||||
|
||||
static void
|
||||
func_iso_data_init(ISO_USER_DATA * iso_user_data, uint32 numPacket, uint32 buffsize,
|
||||
uint32 noAck, BYTE * isoPacket, BYTE * buffer)
|
||||
func_iso_data_init(ISO_USER_DATA * iso_user_data, UINT32 numPacket, UINT32 buffsize,
|
||||
UINT32 noAck, BYTE * isoPacket, BYTE * buffer)
|
||||
{
|
||||
/* init struct iso_user_data */
|
||||
iso_user_data->IsoPacket = isoPacket;
|
||||
@@ -334,7 +334,7 @@ func_iso_data_init(ISO_USER_DATA * iso_user_data, uint32 numPacket, uint32 buffs
|
||||
|
||||
|
||||
static int
|
||||
func_config_release_all_interface(LIBUSB_DEVICE_HANDLE *libusb_handle, uint32_t NumInterfaces)
|
||||
func_config_release_all_interface(LIBUSB_DEVICE_HANDLE *libusb_handle, UINT32_t NumInterfaces)
|
||||
{
|
||||
int i, ret;
|
||||
for (i = 0; i < NumInterfaces; i++)
|
||||
@@ -774,7 +774,7 @@ libusb_udev_complete_msconfig_setup(IUDEVICE * idev, MSUSB_CONFIG_DESCRIPTOR * M
|
||||
|
||||
|
||||
static int
|
||||
libusb_udev_select_configuration(IUDEVICE * idev, uint32 bConfigurationValue)
|
||||
libusb_udev_select_configuration(IUDEVICE * idev, UINT32 bConfigurationValue)
|
||||
{
|
||||
UDEVICE * pdev = (UDEVICE *) idev;
|
||||
MSUSB_CONFIG_DESCRIPTOR * MsConfig = pdev->MsConfig;
|
||||
@@ -815,9 +815,9 @@ libusb_udev_select_configuration(IUDEVICE * idev, uint32 bConfigurationValue)
|
||||
|
||||
|
||||
static int
|
||||
libusb_udev_control_pipe_request(IUDEVICE * idev, uint32 RequestId,
|
||||
uint32 EndpointAddress,
|
||||
uint32 *UsbdStatus,
|
||||
libusb_udev_control_pipe_request(IUDEVICE * idev, UINT32 RequestId,
|
||||
UINT32 EndpointAddress,
|
||||
UINT32 *UsbdStatus,
|
||||
int command)
|
||||
{
|
||||
UDEVICE * pdev = (UDEVICE *) idev;
|
||||
@@ -863,9 +863,9 @@ libusb_udev_control_pipe_request(IUDEVICE * idev, uint32 RequestId,
|
||||
|
||||
|
||||
static int
|
||||
libusb_udev_control_query_device_text(IUDEVICE * idev, uint32 TextType,
|
||||
uint32 LocaleId,
|
||||
uint32 * BufferSize,
|
||||
libusb_udev_control_query_device_text(IUDEVICE * idev, UINT32 TextType,
|
||||
UINT32 LocaleId,
|
||||
UINT32 * BufferSize,
|
||||
BYTE * Buffer)
|
||||
{
|
||||
UDEVICE * pdev = (UDEVICE *) idev;
|
||||
@@ -929,13 +929,13 @@ libusb_udev_control_query_device_text(IUDEVICE * idev, uint32 TextType,
|
||||
|
||||
|
||||
static int
|
||||
libusb_udev_os_feature_descriptor_request(IUDEVICE * idev, uint32 RequestId,
|
||||
libusb_udev_os_feature_descriptor_request(IUDEVICE * idev, UINT32 RequestId,
|
||||
BYTE Recipient,
|
||||
BYTE InterfaceNumber,
|
||||
BYTE Ms_PageIndex,
|
||||
UINT16 Ms_featureDescIndex,
|
||||
uint32 * UsbdStatus,
|
||||
uint32 * BufferSize,
|
||||
UINT32 * UsbdStatus,
|
||||
UINT32 * BufferSize,
|
||||
BYTE* Buffer,
|
||||
int Timeout)
|
||||
{
|
||||
@@ -1203,8 +1203,8 @@ libusb_udev_unlock_fifo_isoch(IUDEVICE * idev)
|
||||
|
||||
|
||||
static int
|
||||
libusb_udev_query_device_port_status(IUDEVICE * idev, uint32 *UsbdStatus,
|
||||
uint32 * BufferSize,
|
||||
libusb_udev_query_device_port_status(IUDEVICE * idev, UINT32 *UsbdStatus,
|
||||
UINT32 * BufferSize,
|
||||
BYTE * Buffer)
|
||||
{
|
||||
UDEVICE * pdev = (UDEVICE *) idev;
|
||||
@@ -1249,22 +1249,22 @@ libusb_udev_request_queue_is_none(IUDEVICE * idev)
|
||||
|
||||
|
||||
static int
|
||||
libusb_udev_isoch_transfer(IUDEVICE * idev, uint32 RequestId, uint32 EndpointAddress,
|
||||
uint32 TransferFlags,
|
||||
libusb_udev_isoch_transfer(IUDEVICE * idev, UINT32 RequestId, UINT32 EndpointAddress,
|
||||
UINT32 TransferFlags,
|
||||
int NoAck,
|
||||
uint32 *ErrorCount,
|
||||
uint32 *UrbdStatus,
|
||||
uint32 *StartFrame,
|
||||
uint32 NumberOfPackets,
|
||||
UINT32 *ErrorCount,
|
||||
UINT32 *UrbdStatus,
|
||||
UINT32 *StartFrame,
|
||||
UINT32 NumberOfPackets,
|
||||
BYTE *IsoPacket,
|
||||
uint32 *BufferSize,
|
||||
UINT32 *BufferSize,
|
||||
BYTE *Buffer,
|
||||
int Timeout)
|
||||
{
|
||||
UDEVICE * pdev = (UDEVICE *) idev;
|
||||
ISO_USER_DATA iso_user_data;
|
||||
struct libusb_transfer * iso_transfer = NULL;
|
||||
uint32 iso_packet_size;
|
||||
UINT32 iso_packet_size;
|
||||
int error = 0, ret = 0, submit = 0;
|
||||
|
||||
|
||||
@@ -1344,16 +1344,16 @@ libusb_udev_isoch_transfer(IUDEVICE * idev, uint32 RequestId, uint32 EndpointAdd
|
||||
|
||||
|
||||
static int
|
||||
libusb_udev_control_transfer(IUDEVICE * idev, uint32 RequestId, uint32 EndpointAddress,
|
||||
uint32 TransferFlags,
|
||||
libusb_udev_control_transfer(IUDEVICE * idev, UINT32 RequestId, UINT32 EndpointAddress,
|
||||
UINT32 TransferFlags,
|
||||
BYTE bmRequestType,
|
||||
BYTE Request,
|
||||
UINT16 Value,
|
||||
UINT16 Index,
|
||||
uint32 *UrbdStatus,
|
||||
uint32 *BufferSize,
|
||||
UINT32 *UrbdStatus,
|
||||
UINT32 *BufferSize,
|
||||
BYTE *Buffer,
|
||||
uint32 Timeout)
|
||||
UINT32 Timeout)
|
||||
{
|
||||
UDEVICE * pdev = (UDEVICE *) idev;
|
||||
int error = 0;
|
||||
@@ -1381,19 +1381,19 @@ libusb_udev_control_transfer(IUDEVICE * idev, uint32 RequestId, uint32 EndpointA
|
||||
|
||||
|
||||
static int
|
||||
libusb_udev_bulk_or_interrupt_transfer(IUDEVICE * idev, uint32 RequestId,
|
||||
uint32 EndpointAddress,
|
||||
uint32 TransferFlags,
|
||||
uint32 *UsbdStatus,
|
||||
uint32 *BufferSize,
|
||||
libusb_udev_bulk_or_interrupt_transfer(IUDEVICE * idev, UINT32 RequestId,
|
||||
UINT32 EndpointAddress,
|
||||
UINT32 TransferFlags,
|
||||
UINT32 *UsbdStatus,
|
||||
UINT32 *BufferSize,
|
||||
BYTE *Buffer,
|
||||
uint32 Timeout)
|
||||
UINT32 Timeout)
|
||||
{
|
||||
UDEVICE * pdev = (UDEVICE *) idev;
|
||||
const LIBUSB_ENDPOINT_DESCEIPTOR * ep_desc;
|
||||
struct libusb_transfer * transfer = NULL;
|
||||
TRANSFER_REQUEST * request = NULL;
|
||||
uint32 transfer_type;
|
||||
UINT32 transfer_type;
|
||||
int completed = 0, ret = 0, submit = 0;
|
||||
int transferDir = EndpointAddress & 0x80;
|
||||
|
||||
@@ -1601,7 +1601,7 @@ func_cancel_xact_request(TRANSFER_REQUEST *request)
|
||||
|
||||
|
||||
static int
|
||||
libusb_udev_cancel_transfer_request(IUDEVICE * idev, uint32 RequestId)
|
||||
libusb_udev_cancel_transfer_request(IUDEVICE * idev, UINT32 RequestId)
|
||||
{
|
||||
UDEVICE * pdev = (UDEVICE *) idev;
|
||||
REQUEST_QUEUE * request_queue = pdev->request_queue;
|
||||
@@ -1644,9 +1644,9 @@ cancel_retry:
|
||||
return 0;
|
||||
}
|
||||
|
||||
BASIC_STATE_FUNC_DEFINED(channel_id, uint32)
|
||||
BASIC_STATE_FUNC_DEFINED(UsbDevice, uint32)
|
||||
BASIC_STATE_FUNC_DEFINED(ReqCompletion, uint32)
|
||||
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(port_number, int)
|
||||
|
||||
@@ -49,9 +49,9 @@ struct _UDEVICE
|
||||
void * prev;
|
||||
void * next;
|
||||
|
||||
uint32 UsbDevice; /* An unique interface ID */
|
||||
uint32 ReqCompletion; /* An unique interface ID */
|
||||
uint32 channel_id;
|
||||
UINT32 UsbDevice; /* An unique interface ID */
|
||||
UINT32 ReqCompletion; /* An unique interface ID */
|
||||
UINT32 channel_id;
|
||||
UINT16 status;
|
||||
UINT16 bus_number;
|
||||
UINT16 dev_number;
|
||||
|
||||
@@ -55,7 +55,7 @@ struct _UDEVMAN
|
||||
IUDEVICE* head; /* head device in linked list */
|
||||
IUDEVICE* tail; /* tail device in linked list */
|
||||
|
||||
uint32 defUsbDevice;
|
||||
UINT32 defUsbDevice;
|
||||
UINT16 flags;
|
||||
int device_num;
|
||||
int sem_timeout;
|
||||
@@ -342,7 +342,7 @@ udevman_is_auto_add(IUDEVMAN * idevman)
|
||||
|
||||
|
||||
static IUDEVICE*
|
||||
udevman_get_udevice_by_UsbDevice_try_again(IUDEVMAN * idevman, uint32 UsbDevice)
|
||||
udevman_get_udevice_by_UsbDevice_try_again(IUDEVMAN * idevman, UINT32 UsbDevice)
|
||||
{
|
||||
UDEVICE * pdev;
|
||||
idevman->loading_lock(idevman);
|
||||
@@ -361,7 +361,7 @@ udevman_get_udevice_by_UsbDevice_try_again(IUDEVMAN * idevman, uint32 UsbDevice)
|
||||
}
|
||||
|
||||
static IUDEVICE*
|
||||
udevman_get_udevice_by_UsbDevice(IUDEVMAN * idevman, uint32 UsbDevice)
|
||||
udevman_get_udevice_by_UsbDevice(IUDEVMAN * idevman, UINT32 UsbDevice)
|
||||
{
|
||||
UDEVICE * pdev;
|
||||
idevman->loading_lock(idevman);
|
||||
@@ -420,7 +420,7 @@ udevman_push_urb(IUDEVMAN * idevman)
|
||||
}
|
||||
|
||||
|
||||
BASIC_STATE_FUNC_DEFINED(defUsbDevice, uint32)
|
||||
BASIC_STATE_FUNC_DEFINED(defUsbDevice, UINT32)
|
||||
BASIC_STATE_FUNC_DEFINED(device_num, int)
|
||||
BASIC_STATE_FUNC_DEFINED(sem_timeout, int)
|
||||
|
||||
@@ -474,7 +474,7 @@ int FreeRDPUDEVMANEntry(PFREERDP_URBDRC_SERVICE_ENTRY_POINTS pEntryPoints)
|
||||
{
|
||||
UDEVMAN* udevman;
|
||||
RDP_PLUGIN_DATA * plugin_data = pEntryPoints->plugin_data;
|
||||
uint32 UsbDevice = BASE_USBDEVICE_NUM;
|
||||
UINT32 UsbDevice = BASE_USBDEVICE_NUM;
|
||||
char * token;
|
||||
char * message = "id";
|
||||
char hardware_id[16];
|
||||
|
||||
@@ -48,7 +48,7 @@ request_queue_has_next(REQUEST_QUEUE* queue)
|
||||
}
|
||||
|
||||
TRANSFER_REQUEST*
|
||||
request_queue_register_request(REQUEST_QUEUE* queue, uint32 RequestId,
|
||||
request_queue_register_request(REQUEST_QUEUE* queue, UINT32 RequestId,
|
||||
struct libusb_transfer * transfer,
|
||||
BYTE endpoint)
|
||||
{
|
||||
@@ -110,7 +110,7 @@ request_queue_get_request_by_endpoint(REQUEST_QUEUE *queue, BYTE ep)
|
||||
}
|
||||
|
||||
int
|
||||
request_queue_unregister_request(REQUEST_QUEUE *queue, uint32 RequestId)
|
||||
request_queue_unregister_request(REQUEST_QUEUE *queue, UINT32 RequestId)
|
||||
{
|
||||
TRANSFER_REQUEST *request, *request_temp;
|
||||
pthread_mutex_lock(&queue->request_loading);
|
||||
|
||||
@@ -32,7 +32,7 @@ struct _TRANSFER_REQUEST
|
||||
void* prev;
|
||||
void* next;
|
||||
|
||||
uint32 RequestId;
|
||||
UINT32 RequestId;
|
||||
BYTE endpoint;
|
||||
struct libusb_transfer *transfer;
|
||||
int submit;
|
||||
@@ -51,11 +51,11 @@ struct _REQUEST_QUEUE
|
||||
/* request queue manager service */
|
||||
void (*rewind) (REQUEST_QUEUE *queue);
|
||||
int (*has_next) (REQUEST_QUEUE* queue);
|
||||
int (*unregister_request) (REQUEST_QUEUE *queue, uint32 RequestId);
|
||||
int (*unregister_request) (REQUEST_QUEUE *queue, UINT32 RequestId);
|
||||
TRANSFER_REQUEST *(*get_next) (REQUEST_QUEUE* queue);
|
||||
TRANSFER_REQUEST *(*get_request_by_ep) (REQUEST_QUEUE *queue, BYTE ep);
|
||||
TRANSFER_REQUEST *(*register_request) (REQUEST_QUEUE* queue,
|
||||
uint32 RequestId, struct libusb_transfer * transfer, BYTE endpoint);
|
||||
UINT32 RequestId, struct libusb_transfer * transfer, BYTE endpoint);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ 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;
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ struct df_pointer
|
||||
{
|
||||
rdpPointer pointer;
|
||||
IDirectFBSurface* surface;
|
||||
uint32 xhot;
|
||||
uint32 yhot;
|
||||
UINT32 xhot;
|
||||
UINT32 yhot;
|
||||
};
|
||||
typedef struct df_pointer dfPointer;
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ int process_plugin_args(rdpSettings* settings, const char* name, RDP_PLUGIN_DATA
|
||||
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_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, BYTE *data, int len);
|
||||
|
||||
@@ -115,7 +115,7 @@ BYTE* wf_glyph_convert(wfInfo* wfi, int width, int height, BYTE* data)
|
||||
return cdata;
|
||||
}
|
||||
|
||||
HBRUSH wf_create_brush(wfInfo * wfi, rdpBrush* brush, uint32 color, int bpp)
|
||||
HBRUSH wf_create_brush(wfInfo * wfi, rdpBrush* brush, UINT32 color, int bpp)
|
||||
{
|
||||
int i;
|
||||
HBRUSH br;
|
||||
@@ -235,8 +235,8 @@ void wf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
||||
HBRUSH brush;
|
||||
HBRUSH org_brush;
|
||||
int org_bkmode;
|
||||
uint32 fgcolor;
|
||||
uint32 bgcolor;
|
||||
UINT32 fgcolor;
|
||||
UINT32 bgcolor;
|
||||
COLORREF org_bkcolor;
|
||||
COLORREF org_textcolor;
|
||||
wfInfo* wfi = ((wfContext*) context)->wfi;
|
||||
@@ -280,7 +280,7 @@ void wf_gdi_opaque_rect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect)
|
||||
{
|
||||
RECT rect;
|
||||
HBRUSH brush;
|
||||
uint32 brush_color;
|
||||
UINT32 brush_color;
|
||||
wfInfo* wfi = ((wfContext*) context)->wfi;
|
||||
|
||||
brush_color = freerdp_color_convert_var_bgr(opaque_rect->color, wfi->srcBpp, wfi->dstBpp, wfi->clrconv);
|
||||
@@ -302,7 +302,7 @@ void wf_gdi_multi_opaque_rect(rdpContext* context, MULTI_OPAQUE_RECT_ORDER* mult
|
||||
int i;
|
||||
RECT rect;
|
||||
HBRUSH brush;
|
||||
uint32 brush_color;
|
||||
UINT32 brush_color;
|
||||
DELTA_RECT* rectangle;
|
||||
wfInfo* wfi = ((wfContext*) context)->wfi;
|
||||
|
||||
@@ -333,7 +333,7 @@ void wf_gdi_line_to(rdpContext* context, LINE_TO_ORDER* line_to)
|
||||
HPEN pen;
|
||||
HPEN org_pen;
|
||||
int x, y, w, h;
|
||||
uint32 pen_color;
|
||||
UINT32 pen_color;
|
||||
wfInfo* wfi = ((wfContext*) context)->wfi;
|
||||
|
||||
pen_color = freerdp_color_convert_bgr(line_to->penColor, wfi->srcBpp, wfi->dstBpp, wfi->clrconv);
|
||||
@@ -365,7 +365,7 @@ void wf_gdi_polyline(rdpContext* context, POLYLINE_ORDER* polyline)
|
||||
int org_rop2;
|
||||
HPEN hpen;
|
||||
HPEN org_hpen;
|
||||
uint32 pen_color;
|
||||
UINT32 pen_color;
|
||||
wfInfo* wfi = ((wfContext*) context)->wfi;
|
||||
|
||||
pen_color = freerdp_color_convert_bgr(polyline->penColor, wfi->srcBpp, wfi->dstBpp, wfi->clrconv);
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "wf_window.h"
|
||||
#include "wf_rail.h"
|
||||
|
||||
void wf_rail_paint(wfInfo* wfi, rdpRail* rail, sint32 uleft, sint32 utop, uint32 uright, uint32 ubottom)
|
||||
void wf_rail_paint(wfInfo* wfi, rdpRail* rail, INT32 uleft, INT32 utop, UINT32 uright, UINT32 ubottom)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ 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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
|
||||
#include "wfreerdp.h"
|
||||
|
||||
void wf_rail_paint(wfInfo* wfi, rdpRail* rail, sint32 uleft, sint32 utop, uint32 uright, uint32 ubottom);
|
||||
void wf_rail_paint(wfInfo* wfi, rdpRail* rail, INT32 uleft, INT32 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);
|
||||
|
||||
@@ -96,8 +96,8 @@ void wf_sw_end_paint(rdpContext* context)
|
||||
int i;
|
||||
rdpGdi* gdi;
|
||||
wfInfo* wfi;
|
||||
sint32 x, y;
|
||||
uint32 w, h;
|
||||
INT32 x, y;
|
||||
UINT32 w, h;
|
||||
int ninvalid;
|
||||
RECT update_rect;
|
||||
HGDI_RGN cinvalid;
|
||||
@@ -247,9 +247,9 @@ void cpuid(unsigned info, unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned
|
||||
#endif
|
||||
}
|
||||
|
||||
uint32 wfi_detect_cpu()
|
||||
UINT32 wfi_detect_cpu()
|
||||
{
|
||||
uint32 cpu_opt = 0;
|
||||
UINT32 cpu_opt = 0;
|
||||
unsigned int eax, ebx, ecx, edx = 0;
|
||||
|
||||
cpuid(1, &eax, &ebx, &ecx, &edx);
|
||||
|
||||
@@ -36,7 +36,7 @@ typedef struct clipboard_format_mapping clipboardFormatMapping;
|
||||
struct clipboard_format_mapping
|
||||
{
|
||||
Atom target_format;
|
||||
uint32 format_id;
|
||||
UINT32 format_id;
|
||||
};
|
||||
|
||||
typedef struct clipboard_context clipboardContext;
|
||||
@@ -52,13 +52,13 @@ struct clipboard_context
|
||||
int num_format_mappings;
|
||||
|
||||
/* server->client data */
|
||||
uint32* formats;
|
||||
UINT32* formats;
|
||||
int num_formats;
|
||||
Atom targets[20];
|
||||
int num_targets;
|
||||
BYTE* data;
|
||||
uint32 data_format;
|
||||
uint32 data_alt_format;
|
||||
UINT32 data_format;
|
||||
UINT32 data_alt_format;
|
||||
int data_length;
|
||||
XEvent* respond;
|
||||
|
||||
@@ -77,7 +77,7 @@ struct clipboard_context
|
||||
void xf_cliprdr_init(xfInfo* xfi, rdpChannels* chanman)
|
||||
{
|
||||
int n;
|
||||
uint32 id;
|
||||
UINT32 id;
|
||||
clipboardContext* cb;
|
||||
|
||||
cb = xnew(clipboardContext);
|
||||
@@ -233,8 +233,8 @@ static void be2le(BYTE* data, int size)
|
||||
static BOOL xf_cliprdr_is_self_owned(xfInfo* xfi)
|
||||
{
|
||||
Atom type;
|
||||
uint32 id = 0;
|
||||
uint32* pid = NULL;
|
||||
UINT32 id = 0;
|
||||
UINT32* pid = NULL;
|
||||
int format, result = 0;
|
||||
unsigned long length, bytes_left;
|
||||
clipboardContext* cb = (clipboardContext*) xfi->clipboard_context;
|
||||
@@ -263,7 +263,7 @@ static BOOL xf_cliprdr_is_self_owned(xfInfo* xfi)
|
||||
return (id ? TRUE : FALSE);
|
||||
}
|
||||
|
||||
static int xf_cliprdr_select_format_by_id(clipboardContext* cb, uint32 format_id)
|
||||
static int xf_cliprdr_select_format_by_id(clipboardContext* cb, UINT32 format_id)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -355,7 +355,7 @@ static void xf_cliprdr_send_supported_format_list(xfInfo* xfi)
|
||||
event = (RDP_CB_FORMAT_LIST_EVENT*) freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR,
|
||||
RDP_EVENT_TYPE_CB_FORMAT_LIST, NULL, NULL);
|
||||
|
||||
event->formats = (uint32*) malloc(sizeof(uint32) * cb->num_format_mappings);
|
||||
event->formats = (UINT32*) malloc(sizeof(UINT32) * cb->num_format_mappings);
|
||||
event->num_formats = cb->num_format_mappings;
|
||||
|
||||
for (i = 0; i < cb->num_format_mappings; i++)
|
||||
@@ -384,7 +384,7 @@ static void xf_cliprdr_send_format_list(xfInfo* xfi)
|
||||
}
|
||||
}
|
||||
|
||||
static void xf_cliprdr_send_data_request(xfInfo* xfi, uint32 format)
|
||||
static void xf_cliprdr_send_data_request(xfInfo* xfi, UINT32 format)
|
||||
{
|
||||
RDP_CB_DATA_REQUEST_EVENT* event;
|
||||
clipboardContext* cb = (clipboardContext*) xfi->clipboard_context;
|
||||
@@ -485,7 +485,7 @@ static void xf_cliprdr_get_requested_targets(xfInfo* xfi)
|
||||
event = (RDP_CB_FORMAT_LIST_EVENT*) freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR,
|
||||
RDP_EVENT_TYPE_CB_FORMAT_LIST, NULL, NULL);
|
||||
|
||||
event->formats = (uint32*) malloc(sizeof(uint32) * cb->num_format_mappings);
|
||||
event->formats = (UINT32*) malloc(sizeof(UINT32) * cb->num_format_mappings);
|
||||
num = 0;
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
@@ -886,8 +886,8 @@ static void xf_cliprdr_process_dib(clipboardContext* cb, BYTE* data, int size)
|
||||
{
|
||||
STREAM* s;
|
||||
UINT16 bpp;
|
||||
uint32 offset;
|
||||
uint32 ncolors;
|
||||
UINT32 offset;
|
||||
UINT32 ncolors;
|
||||
|
||||
/* size should be at least sizeof(BITMAPINFOHEADER) */
|
||||
if (size < 40)
|
||||
@@ -900,7 +900,7 @@ static void xf_cliprdr_process_dib(clipboardContext* cb, BYTE* data, int size)
|
||||
stream_attach(s, data, size);
|
||||
stream_seek(s, 14);
|
||||
stream_read_UINT16(s, bpp);
|
||||
stream_read_uint32(s, ncolors);
|
||||
stream_read_UINT32(s, ncolors);
|
||||
offset = 14 + 40 + (bpp <= 8 ? (ncolors == 0 ? (1 << bpp) : ncolors) * 4 : 0);
|
||||
stream_detach(s);
|
||||
stream_free(s);
|
||||
@@ -910,9 +910,9 @@ static void xf_cliprdr_process_dib(clipboardContext* cb, BYTE* data, int size)
|
||||
s = stream_new(14 + size);
|
||||
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_write_UINT32(s, 14 + size);
|
||||
stream_write_UINT32(s, 0);
|
||||
stream_write_UINT32(s, offset);
|
||||
stream_write(s, data, size);
|
||||
|
||||
cb->data = stream_get_head(s);
|
||||
@@ -1068,9 +1068,9 @@ BOOL xf_cliprdr_process_selection_request(xfInfo* xfi, XEvent* xevent)
|
||||
int i;
|
||||
int fmt;
|
||||
Atom type;
|
||||
uint32 format;
|
||||
UINT32 format;
|
||||
XEvent* respond;
|
||||
uint32 alt_format;
|
||||
UINT32 alt_format;
|
||||
BYTE* data = NULL;
|
||||
BOOL delay_respond;
|
||||
unsigned long length, bytes_left;
|
||||
|
||||
@@ -534,7 +534,7 @@ static BOOL xf_event_ConfigureNotify(xfInfo* xfi, XEvent* event, BOOL app)
|
||||
xfw->bottom = xfw->top + xfw->height - 1;
|
||||
|
||||
DEBUG_X11_LMS("window=0x%X rc={l=%d t=%d r=%d b=%d} w=%u h=%u send_event=%d",
|
||||
(uint32) xfw->handle, xfw->left, xfw->top, xfw->right, xfw->bottom,
|
||||
(UINT32) xfw->handle, xfw->left, xfw->top, xfw->right, xfw->bottom,
|
||||
xfw->width, xfw->height, event->xconfigure.send_event);
|
||||
|
||||
/* additonal checks for not in a local move and not ignoring configure to send
|
||||
@@ -723,7 +723,7 @@ static BOOL xf_event_PropertyNotify(xfInfo* xfi, XEvent* event, BOOL app)
|
||||
else
|
||||
{
|
||||
//If the window is in the iconic state
|
||||
if (((uint32) *prop == 3))
|
||||
if (((UINT32) *prop == 3))
|
||||
{
|
||||
minimized = TRUE;
|
||||
}
|
||||
@@ -872,7 +872,7 @@ BOOL xf_event_process(freerdp* instance, XEvent* event)
|
||||
}
|
||||
|
||||
if (event->type != MotionNotify)
|
||||
DEBUG_X11("%s Event(%d): wnd=0x%04X", X11_EVENT_STRINGS[event->type], event->type, (uint32) event->xany.window);
|
||||
DEBUG_X11("%s Event(%d): wnd=0x%04X", X11_EVENT_STRINGS[event->type], event->type, (UINT32) event->xany.window);
|
||||
|
||||
switch (event->type)
|
||||
{
|
||||
|
||||
@@ -331,8 +331,8 @@ void xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
||||
{
|
||||
Pixmap pattern;
|
||||
rdpBrush* brush;
|
||||
uint32 foreColor;
|
||||
uint32 backColor;
|
||||
UINT32 foreColor;
|
||||
UINT32 backColor;
|
||||
xfContext* context_ = (xfContext*) context;
|
||||
xfInfo* xfi = context_->xfi;
|
||||
|
||||
@@ -440,7 +440,7 @@ void xf_gdi_scrblt(rdpContext* context, SCRBLT_ORDER* scrblt)
|
||||
|
||||
void xf_gdi_opaque_rect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect)
|
||||
{
|
||||
uint32 color;
|
||||
UINT32 color;
|
||||
xfContext* context_ = (xfContext*) context;
|
||||
xfInfo* xfi = context_->xfi;
|
||||
|
||||
@@ -470,7 +470,7 @@ void xf_gdi_opaque_rect(rdpContext* context, OPAQUE_RECT_ORDER* opaque_rect)
|
||||
void xf_gdi_multi_opaque_rect(rdpContext* context, MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect)
|
||||
{
|
||||
int i;
|
||||
uint32 color;
|
||||
UINT32 color;
|
||||
DELTA_RECT* rectangle;
|
||||
xfContext* context_ = (xfContext*) context;
|
||||
xfInfo* xfi = context_->xfi;
|
||||
@@ -509,7 +509,7 @@ void xf_gdi_draw_nine_grid(rdpContext* context, DRAW_NINE_GRID_ORDER* draw_nine_
|
||||
|
||||
void xf_gdi_line_to(rdpContext* context, LINE_TO_ORDER* line_to)
|
||||
{
|
||||
uint32 color;
|
||||
UINT32 color;
|
||||
xfContext* context_ = (xfContext*) context;
|
||||
xfInfo* xfi = context_->xfi;
|
||||
|
||||
@@ -555,7 +555,7 @@ void xf_gdi_polyline(rdpContext* context, POLYLINE_ORDER* polyline)
|
||||
int x1, y1;
|
||||
int x2, y2;
|
||||
int npoints;
|
||||
uint32 color;
|
||||
UINT32 color;
|
||||
XPoint* points;
|
||||
int width, height;
|
||||
xfContext* context_ = (xfContext*) context;
|
||||
@@ -642,8 +642,8 @@ void xf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
|
||||
{
|
||||
rdpBrush* brush;
|
||||
xfBitmap* bitmap;
|
||||
uint32 foreColor;
|
||||
uint32 backColor;
|
||||
UINT32 foreColor;
|
||||
UINT32 backColor;
|
||||
Pixmap pattern = 0;
|
||||
xfContext* context_ = (xfContext*) context;
|
||||
xfInfo* xfi = context_->xfi;
|
||||
@@ -717,7 +717,7 @@ void xf_gdi_polygon_sc(rdpContext* context, POLYGON_SC_ORDER* polygon_sc)
|
||||
{
|
||||
int i, npoints;
|
||||
XPoint* points;
|
||||
uint32 brush_color;
|
||||
UINT32 brush_color;
|
||||
xfInfo* xfi = ((xfContext*) context)->xfi;
|
||||
|
||||
xf_set_rop2(xfi, polygon_sc->bRop2);
|
||||
@@ -772,8 +772,8 @@ void xf_gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb)
|
||||
XPoint* points;
|
||||
Pixmap pattern;
|
||||
rdpBrush* brush;
|
||||
uint32 foreColor;
|
||||
uint32 backColor;
|
||||
UINT32 foreColor;
|
||||
UINT32 backColor;
|
||||
xfInfo* xfi = ((xfContext*) context)->xfi;
|
||||
|
||||
brush = &(polygon_cb->brush);
|
||||
|
||||
@@ -320,7 +320,7 @@ void xf_Glyph_Draw(rdpContext* context, rdpGlyph* glyph, int x, int y)
|
||||
XSetStipple(xfi->display, xfi->gc, xfi->bitmap_mono);
|
||||
}
|
||||
|
||||
void xf_Glyph_BeginDraw(rdpContext* context, int x, int y, int width, int height, uint32 bgcolor, uint32 fgcolor)
|
||||
void xf_Glyph_BeginDraw(rdpContext* context, int x, int y, int width, int height, UINT32 bgcolor, UINT32 fgcolor)
|
||||
{
|
||||
xfContext* context_ = (xfContext*) context;
|
||||
xfInfo* xfi = context_->xfi;
|
||||
@@ -343,7 +343,7 @@ void xf_Glyph_BeginDraw(rdpContext* context, int x, int y, int width, int height
|
||||
XSetFillStyle(xfi->display, xfi->gc, FillStippled);
|
||||
}
|
||||
|
||||
void xf_Glyph_EndDraw(rdpContext* context, int x, int y, int width, int height, uint32 bgcolor, uint32 fgcolor)
|
||||
void xf_Glyph_EndDraw(rdpContext* context, int x, int y, int width, int height, UINT32 bgcolor, UINT32 fgcolor)
|
||||
{
|
||||
xfInfo* xfi = ((xfContext*) context)->xfi;
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ void xf_kbd_send_key(xfInfo* xfi, BOOL down, BYTE keycode)
|
||||
|
||||
if ((rdp_scancode == RDP_SCANCODE_CAPSLOCK) && (down == FALSE))
|
||||
{
|
||||
uint32 syncFlags;
|
||||
UINT32 syncFlags;
|
||||
syncFlags = xf_kbd_get_toggle_keys_state(xfi);
|
||||
input->SynchronizeEvent(input, syncFlags);
|
||||
}
|
||||
@@ -122,7 +122,7 @@ int xf_kbd_read_keyboard_state(xfInfo* xfi)
|
||||
{
|
||||
int dummy;
|
||||
Window wdummy;
|
||||
uint32 state = 0;
|
||||
UINT32 state = 0;
|
||||
|
||||
if (xfi->remote_app != TRUE)
|
||||
{
|
||||
@@ -182,7 +182,7 @@ int xf_kbd_get_toggle_keys_state(xfInfo* xfi)
|
||||
void xf_kbd_focus_in(xfInfo* xfi)
|
||||
{
|
||||
rdpInput* input;
|
||||
uint32 syncFlags;
|
||||
UINT32 syncFlags;
|
||||
|
||||
input = xfi->instance->input;
|
||||
|
||||
|
||||
@@ -52,16 +52,16 @@ void xf_rail_disable_remoteapp_mode(xfInfo* xfi)
|
||||
}
|
||||
}
|
||||
|
||||
void xf_rail_paint(xfInfo* xfi, rdpRail* rail, sint32 uleft, sint32 utop, uint32 uright, uint32 ubottom)
|
||||
void xf_rail_paint(xfInfo* xfi, rdpRail* rail, INT32 uleft, INT32 utop, UINT32 uright, UINT32 ubottom)
|
||||
{
|
||||
xfWindow* xfw;
|
||||
rdpWindow* window;
|
||||
BOOL intersect;
|
||||
uint32 iwidth, iheight;
|
||||
sint32 ileft, itop;
|
||||
uint32 iright, ibottom;
|
||||
sint32 wleft, wtop;
|
||||
uint32 wright, wbottom;
|
||||
UINT32 iwidth, iheight;
|
||||
INT32 ileft, itop;
|
||||
UINT32 iright, ibottom;
|
||||
INT32 wleft, wtop;
|
||||
UINT32 wright, wbottom;
|
||||
|
||||
window_list_rewind(rail->list);
|
||||
|
||||
@@ -284,7 +284,7 @@ void xf_rail_send_activate(xfInfo* xfi, Window xwindow, BOOL enabled)
|
||||
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;
|
||||
@@ -325,8 +325,8 @@ void xf_rail_adjust_position(xfInfo* xfi, rdpWindow *window)
|
||||
//Although the rail server can give negative window coordinates when updating windowOffsetX and windowOffsetY,
|
||||
//we can only send unsigned integers to the rail server. Therefore, we always bring negative coordinates up to 0 when
|
||||
//attempting to adjust the rail window.
|
||||
uint32 offsetX = 0;
|
||||
uint32 offsetY = 0;
|
||||
UINT32 offsetX = 0;
|
||||
UINT32 offsetY = 0;
|
||||
|
||||
if (window->windowOffsetX < 0)
|
||||
offsetX = offsetX - window->windowOffsetX;
|
||||
@@ -348,7 +348,7 @@ void xf_rail_adjust_position(xfInfo* xfi, rdpWindow *window)
|
||||
|
||||
DEBUG_X11_LMS("window=0x%X rc={l=%d t=%d r=%d b=%d} w=%u h=%u"
|
||||
" RDP=0x%X rc={l=%d t=%d} w=%d h=%d",
|
||||
(uint32) xfw->handle, window_move.left, window_move.top,
|
||||
(UINT32) xfw->handle, window_move.left, window_move.top,
|
||||
window_move.right, window_move.bottom, xfw->width, xfw->height,
|
||||
window->windowId,
|
||||
window->windowOffsetX, window->windowOffsetY,
|
||||
@@ -375,15 +375,15 @@ void xf_rail_end_local_move(xfInfo* xfi, rdpWindow *window)
|
||||
channels = xfi->_context->channels;
|
||||
|
||||
DEBUG_X11_LMS("window=0x%X rc={l=%d t=%d r=%d b=%d} w=%d h=%d",
|
||||
(uint32) xfw->handle,
|
||||
(UINT32) xfw->handle,
|
||||
xfw->left, xfw->top, xfw->right, xfw->bottom,
|
||||
xfw->width, xfw->height);
|
||||
|
||||
//Although the rail server can give negative window coordinates when updating windowOffsetX and windowOffsetY,
|
||||
//we can only send unsigned integers to the rail server. Therefore, we always bring negative coordinates up to 0 when
|
||||
//attempting to adjust the rail window.
|
||||
uint32 offsetX = 0;
|
||||
uint32 offsetY = 0;
|
||||
UINT32 offsetX = 0;
|
||||
UINT32 offsetY = 0;
|
||||
|
||||
if (window->windowOffsetX < 0)
|
||||
offsetX = offsetX - window->windowOffsetX;
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
|
||||
#include "xfreerdp.h"
|
||||
|
||||
void xf_rail_paint(xfInfo* xfi, rdpRail* rail, sint32 uleft, sint32 utop, uint32 uright, uint32 ubottom);
|
||||
void xf_rail_paint(xfInfo* xfi, rdpRail* rail, INT32 uleft, INT32 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);
|
||||
|
||||
@@ -53,7 +53,7 @@ struct xf_xv_context
|
||||
int xv_image_size;
|
||||
int xv_shmid;
|
||||
char* xv_shmaddr;
|
||||
uint32* xv_pixfmts;
|
||||
UINT32* xv_pixfmts;
|
||||
};
|
||||
|
||||
#ifdef WITH_DEBUG_XV
|
||||
@@ -142,7 +142,7 @@ void xf_tsmf_init(xfInfo* xfi, long xv_port)
|
||||
fo = XvListImageFormats(xfi->display, xv->xv_port, &ret);
|
||||
if (ret > 0)
|
||||
{
|
||||
xv->xv_pixfmts = (uint32*) xzalloc((ret + 1) * sizeof(uint32));
|
||||
xv->xv_pixfmts = (UINT32*) xzalloc((ret + 1) * sizeof(UINT32));
|
||||
for (i = 0; i < ret; i++)
|
||||
{
|
||||
xv->xv_pixfmts[i] = fo[i].id;
|
||||
@@ -181,7 +181,7 @@ void xf_tsmf_uninit(xfInfo* xfi)
|
||||
}
|
||||
|
||||
static BOOL
|
||||
xf_tsmf_is_format_supported(xfXvContext* xv, uint32 pixfmt)
|
||||
xf_tsmf_is_format_supported(xfXvContext* xv, UINT32 pixfmt)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -202,8 +202,8 @@ static void xf_process_tsmf_video_frame_event(xfInfo* xfi, RDP_VIDEO_FRAME_EVENT
|
||||
int i;
|
||||
BYTE* data1;
|
||||
BYTE* data2;
|
||||
uint32 pixfmt;
|
||||
uint32 xvpixfmt;
|
||||
UINT32 pixfmt;
|
||||
UINT32 xvpixfmt;
|
||||
BOOL converti420yv12 = FALSE;
|
||||
XvImage * image;
|
||||
int colorkey = 0;
|
||||
|
||||
@@ -238,7 +238,7 @@ void xf_SetWindowUnlisted(xfInfo* xfi, xfWindow* window)
|
||||
XA_ATOM, 32, PropModeReplace, (BYTE*) &window_state, 2);
|
||||
}
|
||||
|
||||
void xf_SetWindowStyle(xfInfo* xfi, xfWindow* window, uint32 style, uint32 ex_style)
|
||||
void xf_SetWindowStyle(xfInfo* xfi, xfWindow* window, UINT32 style, UINT32 ex_style)
|
||||
{
|
||||
Atom window_type;
|
||||
|
||||
@@ -463,7 +463,7 @@ void xf_FixWindowCoordinates(xfInfo* xfi, int* x, int* y, int* width, int* heigh
|
||||
|
||||
char rail_window_class[] = "RAIL:00000000";
|
||||
|
||||
xfWindow* xf_CreateWindow(xfInfo* xfi, rdpWindow* wnd, int x, int y, int width, int height, uint32 id)
|
||||
xfWindow* xf_CreateWindow(xfInfo* xfi, rdpWindow* wnd, int x, int y, int width, int height, UINT32 id)
|
||||
{
|
||||
XGCValues gcv;
|
||||
int input_mask;
|
||||
@@ -500,7 +500,7 @@ xfWindow* xf_CreateWindow(xfInfo* xfi, rdpWindow* wnd, int x, int y, int width,
|
||||
CWBorderPixel | CWWinGravity | CWBitGravity, &xfi->attribs);
|
||||
|
||||
DEBUG_X11_LMS("Create window=0x%X rc={l=%d t=%d r=%d b=%d} w=%d h=%d rdp=0x%X",
|
||||
(uint32) window->handle, window->left, window->top, window->right, window->bottom,
|
||||
(UINT32) window->handle, window->left, window->top, window->right, window->bottom,
|
||||
window->width, window->height, wnd->windowId);
|
||||
|
||||
memset(&gcv, 0, sizeof(gcv));
|
||||
@@ -587,7 +587,7 @@ void xf_StartLocalMoveSize(xfInfo* xfi, xfWindow* window, int direction, int x,
|
||||
|
||||
DEBUG_X11_LMS("direction=%d window=0x%X rc={l=%d t=%d r=%d b=%d} w=%d h=%d "
|
||||
"RDP=0x%X rc={l=%d t=%d} w=%d h=%d mouse_x=%d mouse_y=%d",
|
||||
direction, (uint32) window->handle,
|
||||
direction, (UINT32) window->handle,
|
||||
window->left, window->top, window->right, window->bottom,
|
||||
window->width, window->height, window->window->windowId,
|
||||
window->window->windowOffsetX, window->window->windowOffsetY,
|
||||
@@ -620,7 +620,7 @@ void xf_EndLocalMoveSize(xfInfo *xfi, xfWindow *window)
|
||||
DEBUG_X11_LMS("state=%d window=0x%X rc={l=%d t=%d r=%d b=%d} w=%d h=%d "
|
||||
"RDP=0x%X rc={l=%d t=%d} w=%d h=%d",
|
||||
window->local_move.state,
|
||||
(uint32) window->handle, window->left, window->top, window->right, window->bottom,
|
||||
(UINT32) window->handle, window->left, window->top, window->right, window->bottom,
|
||||
window->width, window->height, window->window->windowId,
|
||||
window->window->windowOffsetX, window->window->windowOffsetY,
|
||||
window->window->windowWidth, window->window->windowHeight);
|
||||
@@ -666,7 +666,7 @@ void xf_MoveWindow(xfInfo* xfi, xfWindow* window, int x, int y, int width, int h
|
||||
DEBUG_X11_LMS("window=0x%X rc={l=%d t=%d r=%d b=%d} w=%u h=%u "
|
||||
"new rc={l=%d t=%d r=%d b=%d} w=%u h=%u"
|
||||
" RDP=0x%X rc={l=%d t=%d} w=%d h=%d",
|
||||
(uint32) window->handle, window->left, window->top,
|
||||
(UINT32) window->handle, window->left, window->top,
|
||||
window->right, window->bottom, window->width, window->height,
|
||||
x, y, x + width -1, y + height -1, width, height,
|
||||
window->window->windowId,
|
||||
@@ -754,7 +754,7 @@ void xf_SetWindowIcon(xfInfo* xfi, xfWindow* window, rdpIcon* icon)
|
||||
int propsize;
|
||||
long* propdata;
|
||||
long* dstp;
|
||||
uint32* srcp;
|
||||
UINT32* srcp;
|
||||
|
||||
if (icon->big != TRUE)
|
||||
return;
|
||||
@@ -766,7 +766,7 @@ void xf_SetWindowIcon(xfInfo* xfi, xfWindow* window, rdpIcon* icon)
|
||||
propdata[0] = icon->entry->width;
|
||||
propdata[1] = icon->entry->height;
|
||||
dstp = &(propdata[2]);
|
||||
srcp = (uint32*) icon->extra;
|
||||
srcp = (UINT32*) icon->extra;
|
||||
|
||||
for (y = 0; y < icon->entry->height; y++)
|
||||
{
|
||||
|
||||
@@ -93,14 +93,14 @@ void xf_SetWindowUnlisted(xfInfo* xfi, xfWindow* window);
|
||||
xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height, BOOL decorations);
|
||||
void xf_ResizeDesktopWindow(xfInfo* xfi, xfWindow* window, int width, int height);
|
||||
|
||||
xfWindow* xf_CreateWindow(xfInfo* xfi, rdpWindow* wnd, int x, int y, int width, int height, uint32 id);
|
||||
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, 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);
|
||||
void xf_SetWindowStyle(xfInfo* xfi, xfWindow* window, uint32 style, uint32 ex_style);
|
||||
void xf_SetWindowStyle(xfInfo* xfi, xfWindow* window, UINT32 style, UINT32 ex_style);
|
||||
void xf_UpdateWindowArea(xfInfo* xfi, xfWindow* window, int x, int y, int width, int height);
|
||||
BOOL xf_IsWindowBorder(xfInfo* xfi, xfWindow* xfw, int x, int y);
|
||||
void xf_DestroyWindow(xfInfo* xfi, xfWindow* window);
|
||||
|
||||
@@ -109,8 +109,8 @@ void xf_sw_end_paint(rdpContext* context)
|
||||
{
|
||||
rdpGdi* gdi;
|
||||
xfInfo* xfi;
|
||||
sint32 x, y;
|
||||
uint32 w, h;
|
||||
INT32 x, y;
|
||||
UINT32 w, h;
|
||||
|
||||
xfi = ((xfContext*) context)->xfi;
|
||||
gdi = context->gdi;
|
||||
@@ -204,8 +204,8 @@ void xf_hw_begin_paint(rdpContext* context)
|
||||
void xf_hw_end_paint(rdpContext* context)
|
||||
{
|
||||
xfInfo* xfi;
|
||||
sint32 x, y;
|
||||
uint32 w, h;
|
||||
INT32 x, y;
|
||||
UINT32 w, h;
|
||||
|
||||
xfi = ((xfContext*) context)->xfi;
|
||||
|
||||
@@ -646,10 +646,10 @@ void cpuid(unsigned info, unsigned *eax, unsigned *ebx, unsigned *ecx, unsigned
|
||||
#endif
|
||||
}
|
||||
|
||||
uint32 xf_detect_cpu()
|
||||
UINT32 xf_detect_cpu()
|
||||
{
|
||||
unsigned int eax, ebx, ecx, edx = 0;
|
||||
uint32 cpu_opt = 0;
|
||||
UINT32 cpu_opt = 0;
|
||||
|
||||
cpuid(1, &eax, &ebx, &ecx, &edx);
|
||||
|
||||
@@ -670,7 +670,7 @@ uint32 xf_detect_cpu()
|
||||
BOOL xf_post_connect(freerdp* instance)
|
||||
{
|
||||
#ifdef WITH_SSE2
|
||||
uint32 cpu;
|
||||
UINT32 cpu;
|
||||
#endif
|
||||
xfInfo* xfi;
|
||||
XGCValues gcv;
|
||||
@@ -691,7 +691,7 @@ BOOL xf_post_connect(freerdp* instance)
|
||||
if (xfi->sw_gdi)
|
||||
{
|
||||
rdpGdi* gdi;
|
||||
uint32 flags;
|
||||
UINT32 flags;
|
||||
|
||||
flags = CLRCONV_ALPHA;
|
||||
|
||||
@@ -1272,7 +1272,7 @@ void* thread_func(void* param)
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
static BYTE 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))
|
||||
|
||||
@@ -39,10 +39,10 @@ typedef struct xf_info xfInfo;
|
||||
|
||||
struct xf_WorkArea
|
||||
{
|
||||
uint32 x;
|
||||
uint32 y;
|
||||
uint32 width;
|
||||
uint32 height;
|
||||
UINT32 x;
|
||||
UINT32 y;
|
||||
UINT32 width;
|
||||
UINT32 height;
|
||||
};
|
||||
typedef struct xf_WorkArea xfWorkArea;
|
||||
|
||||
@@ -130,7 +130,7 @@ struct xf_info
|
||||
BOOL mouse_motion;
|
||||
BOOL suppress_output;
|
||||
BOOL fullscreen_toggle;
|
||||
uint32 keyboard_layout_id;
|
||||
UINT32 keyboard_layout_id;
|
||||
BOOL pressed_keys[256];
|
||||
XModifierKeymap* modifier_map;
|
||||
XSetWindowAttributes attribs;
|
||||
|
||||
@@ -143,7 +143,7 @@ void test_cliprdr(void)
|
||||
event = freerdp_event_new(RDP_EVENT_CLASS_CLIPRDR, RDP_EVENT_TYPE_CB_FORMAT_LIST, event_process_callback, NULL);
|
||||
format_list_event = (RDP_CB_FORMAT_LIST_EVENT*) event;
|
||||
format_list_event->num_formats = 2;
|
||||
format_list_event->formats = (uint32*) malloc(sizeof(uint32) * 2);
|
||||
format_list_event->formats = (UINT32*) malloc(sizeof(UINT32) * 2);
|
||||
format_list_event->formats[0] = CB_FORMAT_TEXT;
|
||||
format_list_event->formats[1] = CB_FORMAT_HTML;
|
||||
event_processed = 0;
|
||||
|
||||
@@ -53,7 +53,7 @@ int add_color_suite(void)
|
||||
void test_color_GetRGB32(void)
|
||||
{
|
||||
int r, g, b;
|
||||
uint32 rgb32 = 0x00AABBCC;
|
||||
UINT32 rgb32 = 0x00AABBCC;
|
||||
GetRGB32(r, g, b, rgb32);
|
||||
|
||||
CU_ASSERT(r == 0xAA);
|
||||
@@ -64,7 +64,7 @@ void test_color_GetRGB32(void)
|
||||
void test_color_GetBGR32(void)
|
||||
{
|
||||
int r, g, b;
|
||||
uint32 bgr32 = 0x00CCBBAA;
|
||||
UINT32 bgr32 = 0x00CCBBAA;
|
||||
GetBGR32(r, g, b, bgr32);
|
||||
|
||||
CU_ASSERT(r == 0xAA);
|
||||
|
||||
@@ -636,8 +636,8 @@ int add_mppc_suite(void)
|
||||
void test_mppc(void)
|
||||
{
|
||||
struct rdp_mppc_dec* rmppc;
|
||||
uint32_t roff;
|
||||
uint32_t rlen;
|
||||
UINT32_t roff;
|
||||
UINT32_t rlen;
|
||||
long int dur;
|
||||
|
||||
struct timeval start_time;
|
||||
|
||||
@@ -494,8 +494,8 @@ void test_mppc_enc(void)
|
||||
|
||||
/* needed by decoder */
|
||||
struct rdp_mppc_dec* rmppc;
|
||||
uint32 roff;
|
||||
uint32 rlen;
|
||||
UINT32 roff;
|
||||
UINT32 rlen;
|
||||
|
||||
/* required for timing the test */
|
||||
struct timeval start_time;
|
||||
|
||||
@@ -58,7 +58,7 @@ BYTE test_packet_3[64] =
|
||||
typedef struct
|
||||
{
|
||||
void* data;
|
||||
uint32 length;
|
||||
UINT32 length;
|
||||
} test_packet;
|
||||
|
||||
void test_pcap(void)
|
||||
|
||||
@@ -411,7 +411,7 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
RAIL_ORDERS order_info;
|
||||
uint32 event_type;
|
||||
UINT32 event_type;
|
||||
}
|
||||
RAIL_EVENT;
|
||||
|
||||
|
||||
@@ -38,129 +38,129 @@
|
||||
|
||||
struct _OFFSCREEN_DELETE_LIST
|
||||
{
|
||||
uint32 sIndices;
|
||||
uint32 cIndices;
|
||||
UINT32 sIndices;
|
||||
UINT32 cIndices;
|
||||
UINT16* indices;
|
||||
};
|
||||
typedef struct _OFFSCREEN_DELETE_LIST OFFSCREEN_DELETE_LIST;
|
||||
|
||||
struct _CREATE_OFFSCREEN_BITMAP_ORDER
|
||||
{
|
||||
uint32 id;
|
||||
uint32 cx;
|
||||
uint32 cy;
|
||||
UINT32 id;
|
||||
UINT32 cx;
|
||||
UINT32 cy;
|
||||
OFFSCREEN_DELETE_LIST deleteList;
|
||||
};
|
||||
typedef struct _CREATE_OFFSCREEN_BITMAP_ORDER CREATE_OFFSCREEN_BITMAP_ORDER;
|
||||
|
||||
struct _SWITCH_SURFACE_ORDER
|
||||
{
|
||||
uint32 bitmapId;
|
||||
UINT32 bitmapId;
|
||||
};
|
||||
typedef struct _SWITCH_SURFACE_ORDER SWITCH_SURFACE_ORDER;
|
||||
|
||||
struct _NINE_GRID_BITMAP_INFO
|
||||
{
|
||||
uint32 flFlags;
|
||||
uint32 ulLeftWidth;
|
||||
uint32 ulRightWidth;
|
||||
uint32 ulTopHeight;
|
||||
uint32 ulBottomHeight;
|
||||
uint32 crTransparent;
|
||||
UINT32 flFlags;
|
||||
UINT32 ulLeftWidth;
|
||||
UINT32 ulRightWidth;
|
||||
UINT32 ulTopHeight;
|
||||
UINT32 ulBottomHeight;
|
||||
UINT32 crTransparent;
|
||||
};
|
||||
typedef struct _NINE_GRID_BITMAP_INFO NINE_GRID_BITMAP_INFO;
|
||||
|
||||
struct _CREATE_NINE_GRID_BITMAP_ORDER
|
||||
{
|
||||
uint32 bitmapBpp;
|
||||
uint32 bitmapId;
|
||||
uint32 cx;
|
||||
uint32 cy;
|
||||
UINT32 bitmapBpp;
|
||||
UINT32 bitmapId;
|
||||
UINT32 cx;
|
||||
UINT32 cy;
|
||||
NINE_GRID_BITMAP_INFO nineGridInfo;
|
||||
};
|
||||
typedef struct _CREATE_NINE_GRID_BITMAP_ORDER CREATE_NINE_GRID_BITMAP_ORDER;
|
||||
|
||||
struct _FRAME_MARKER_ORDER
|
||||
{
|
||||
uint32 action;
|
||||
UINT32 action;
|
||||
};
|
||||
typedef struct _FRAME_MARKER_ORDER FRAME_MARKER_ORDER;
|
||||
|
||||
struct _STREAM_BITMAP_FIRST_ORDER
|
||||
{
|
||||
uint32 bitmapFlags;
|
||||
uint32 bitmapBpp;
|
||||
uint32 bitmapType;
|
||||
uint32 bitmapWidth;
|
||||
uint32 bitmapHeight;
|
||||
uint32 bitmapSize;
|
||||
uint32 bitmapBlockSize;
|
||||
UINT32 bitmapFlags;
|
||||
UINT32 bitmapBpp;
|
||||
UINT32 bitmapType;
|
||||
UINT32 bitmapWidth;
|
||||
UINT32 bitmapHeight;
|
||||
UINT32 bitmapSize;
|
||||
UINT32 bitmapBlockSize;
|
||||
BYTE* bitmapBlock;
|
||||
};
|
||||
typedef struct _STREAM_BITMAP_FIRST_ORDER STREAM_BITMAP_FIRST_ORDER;
|
||||
|
||||
struct _STREAM_BITMAP_NEXT_ORDER
|
||||
{
|
||||
uint32 bitmapFlags;
|
||||
uint32 bitmapType;
|
||||
uint32 bitmapBlockSize;
|
||||
UINT32 bitmapFlags;
|
||||
UINT32 bitmapType;
|
||||
UINT32 bitmapBlockSize;
|
||||
BYTE* bitmapBlock;
|
||||
};
|
||||
typedef struct _STREAM_BITMAP_NEXT_ORDER STREAM_BITMAP_NEXT_ORDER;
|
||||
|
||||
struct _DRAW_GDIPLUS_FIRST_ORDER
|
||||
{
|
||||
uint32 cbSize;
|
||||
uint32 cbTotalSize;
|
||||
uint32 cbTotalEmfSize;
|
||||
UINT32 cbSize;
|
||||
UINT32 cbTotalSize;
|
||||
UINT32 cbTotalEmfSize;
|
||||
BYTE* emfRecords;
|
||||
};
|
||||
typedef struct _DRAW_GDIPLUS_FIRST_ORDER DRAW_GDIPLUS_FIRST_ORDER;
|
||||
|
||||
struct _DRAW_GDIPLUS_NEXT_ORDER
|
||||
{
|
||||
uint32 cbSize;
|
||||
UINT32 cbSize;
|
||||
BYTE* emfRecords;
|
||||
};
|
||||
typedef struct _DRAW_GDIPLUS_NEXT_ORDER DRAW_GDIPLUS_NEXT_ORDER;
|
||||
|
||||
struct _DRAW_GDIPLUS_END_ORDER
|
||||
{
|
||||
uint32 cbSize;
|
||||
uint32 cbTotalSize;
|
||||
uint32 cbTotalEmfSize;
|
||||
UINT32 cbSize;
|
||||
UINT32 cbTotalSize;
|
||||
UINT32 cbTotalEmfSize;
|
||||
BYTE* emfRecords;
|
||||
};
|
||||
typedef struct _DRAW_GDIPLUS_END_ORDER DRAW_GDIPLUS_END_ORDER;
|
||||
|
||||
struct _DRAW_GDIPLUS_CACHE_FIRST_ORDER
|
||||
{
|
||||
uint32 flags;
|
||||
uint32 cacheType;
|
||||
uint32 cacheIndex;
|
||||
uint32 cbSize;
|
||||
uint32 cbTotalSize;
|
||||
UINT32 flags;
|
||||
UINT32 cacheType;
|
||||
UINT32 cacheIndex;
|
||||
UINT32 cbSize;
|
||||
UINT32 cbTotalSize;
|
||||
BYTE* emfRecords;
|
||||
};
|
||||
typedef struct _DRAW_GDIPLUS_CACHE_FIRST_ORDER DRAW_GDIPLUS_CACHE_FIRST_ORDER;
|
||||
|
||||
struct _DRAW_GDIPLUS_CACHE_NEXT_ORDER
|
||||
{
|
||||
uint32 flags;
|
||||
uint32 cacheType;
|
||||
uint32 cacheIndex;
|
||||
uint32 cbSize;
|
||||
UINT32 flags;
|
||||
UINT32 cacheType;
|
||||
UINT32 cacheIndex;
|
||||
UINT32 cbSize;
|
||||
BYTE* emfRecords;
|
||||
};
|
||||
typedef struct _DRAW_GDIPLUS_CACHE_NEXT_ORDER DRAW_GDIPLUS_CACHE_NEXT_ORDER;
|
||||
|
||||
struct _DRAW_GDIPLUS_CACHE_END_ORDER
|
||||
{
|
||||
uint32 flags;
|
||||
uint32 cacheType;
|
||||
uint32 cacheIndex;
|
||||
uint32 cbSize;
|
||||
uint32 cbTotalSize;
|
||||
UINT32 flags;
|
||||
UINT32 cacheType;
|
||||
UINT32 cacheIndex;
|
||||
UINT32 cbSize;
|
||||
UINT32 cbTotalSize;
|
||||
BYTE* emfRecords;
|
||||
};
|
||||
typedef struct _DRAW_GDIPLUS_CACHE_END_ORDER DRAW_GDIPLUS_CACHE_END_ORDER;
|
||||
@@ -181,7 +181,7 @@ typedef void (*pDrawGdiPlusCacheEnd)(rdpContext* context, DRAW_GDIPLUS_CACHE_END
|
||||
struct rdp_altsec_update
|
||||
{
|
||||
rdpContext* context; /* 0 */
|
||||
uint32 paddingA[16 - 1]; /* 1 */
|
||||
UINT32 paddingA[16 - 1]; /* 1 */
|
||||
|
||||
pCreateOffscreenBitmap CreateOffscreenBitmap; /* 16 */
|
||||
pSwitchSurface SwitchSurface; /* 17 */
|
||||
@@ -195,7 +195,7 @@ struct rdp_altsec_update
|
||||
pDrawGdiPlusCacheFirst DrawGdiPlusCacheFirst; /* 25 */
|
||||
pDrawGdiPlusCacheNext DrawGdiPlusCacheNext; /* 26 */
|
||||
pDrawGdiPlusCacheEnd DrawGdiPlusCacheEnd; /* 27 */
|
||||
uint32 paddingB[32 - 28]; /* 28 */
|
||||
UINT32 paddingB[32 - 28]; /* 28 */
|
||||
|
||||
/* internal */
|
||||
|
||||
|
||||
12
include/freerdp/cache/bitmap.h
vendored
12
include/freerdp/cache/bitmap.h
vendored
@@ -33,7 +33,7 @@ typedef struct rdp_bitmap_cache rdpBitmapCache;
|
||||
|
||||
struct _BITMAP_V2_CELL
|
||||
{
|
||||
uint32 number;
|
||||
UINT32 number;
|
||||
rdpBitmap** entries;
|
||||
};
|
||||
|
||||
@@ -45,11 +45,11 @@ struct rdp_bitmap_cache
|
||||
pCacheBitmapV2 CacheBitmapV2; /* 3 */
|
||||
pCacheBitmapV3 CacheBitmapV3; /* 4 */
|
||||
pBitmapUpdate BitmapUpdate; /* 5 */
|
||||
uint32 paddingA[16 - 6]; /* 6 */
|
||||
UINT32 paddingA[16 - 6]; /* 6 */
|
||||
|
||||
uint32 maxCells; /* 16 */
|
||||
UINT32 maxCells; /* 16 */
|
||||
BITMAP_V2_CELL* cells; /* 17 */
|
||||
uint32 paddingB[32 - 18]; /* 18 */
|
||||
UINT32 paddingB[32 - 18]; /* 18 */
|
||||
|
||||
/* internal */
|
||||
|
||||
@@ -59,8 +59,8 @@ struct rdp_bitmap_cache
|
||||
rdpSettings* settings;
|
||||
};
|
||||
|
||||
FREERDP_API rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmap_cache, uint32 id, uint32 index);
|
||||
FREERDP_API void bitmap_cache_put(rdpBitmapCache* bitmap_cache, uint32 id, uint32 index, rdpBitmap* bitmap);
|
||||
FREERDP_API rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmap_cache, UINT32 id, UINT32 index);
|
||||
FREERDP_API void bitmap_cache_put(rdpBitmapCache* bitmap_cache, UINT32 id, UINT32 index, rdpBitmap* bitmap);
|
||||
|
||||
FREERDP_API void bitmap_cache_register_callbacks(rdpUpdate* update);
|
||||
|
||||
|
||||
14
include/freerdp/cache/brush.h
vendored
14
include/freerdp/cache/brush.h
vendored
@@ -33,7 +33,7 @@ typedef struct rdp_brush_cache rdpBrushCache;
|
||||
|
||||
struct _BRUSH_ENTRY
|
||||
{
|
||||
uint32 bpp;
|
||||
UINT32 bpp;
|
||||
void* entry;
|
||||
};
|
||||
|
||||
@@ -43,21 +43,21 @@ struct rdp_brush_cache
|
||||
pCacheBrush CacheBrush; /* 1 */
|
||||
pPolygonSC PolygonSC; /* 2 */
|
||||
pPolygonCB PolygonCB; /* 3 */
|
||||
uint32 paddingA[16 - 4]; /* 4 */
|
||||
UINT32 paddingA[16 - 4]; /* 4 */
|
||||
|
||||
uint32 maxEntries; /* 16 */
|
||||
uint32 maxMonoEntries; /* 17 */
|
||||
UINT32 maxEntries; /* 16 */
|
||||
UINT32 maxMonoEntries; /* 17 */
|
||||
BRUSH_ENTRY* entries; /* 18 */
|
||||
BRUSH_ENTRY* monoEntries; /* 19 */
|
||||
uint32 paddingB[32 - 20]; /* 20 */
|
||||
UINT32 paddingB[32 - 20]; /* 20 */
|
||||
|
||||
/* internal */
|
||||
|
||||
rdpSettings* settings;
|
||||
};
|
||||
|
||||
FREERDP_API void* brush_cache_get(rdpBrushCache* brush, uint32 index, uint32* bpp);
|
||||
FREERDP_API void brush_cache_put(rdpBrushCache* brush, uint32 index, void* entry, uint32 bpp);
|
||||
FREERDP_API void* brush_cache_get(rdpBrushCache* brush, UINT32 index, UINT32* bpp);
|
||||
FREERDP_API void brush_cache_put(rdpBrushCache* brush, UINT32 index, void* entry, UINT32 bpp);
|
||||
|
||||
FREERDP_API void brush_cache_register_callbacks(rdpUpdate* update);
|
||||
|
||||
|
||||
14
include/freerdp/cache/glyph.h
vendored
14
include/freerdp/cache/glyph.h
vendored
@@ -34,15 +34,15 @@ typedef struct rdp_glyph_cache rdpGlyphCache;
|
||||
|
||||
struct _GLYPH_CACHE
|
||||
{
|
||||
uint32 number;
|
||||
uint32 maxCellSize;
|
||||
UINT32 number;
|
||||
UINT32 maxCellSize;
|
||||
rdpGlyph** entries;
|
||||
};
|
||||
|
||||
struct _FRAGMENT_CACHE_ENTRY
|
||||
{
|
||||
void* fragment;
|
||||
uint32 size;
|
||||
UINT32 size;
|
||||
};
|
||||
|
||||
struct _FRAGMENT_CACHE
|
||||
@@ -59,11 +59,11 @@ struct rdp_glyph_cache
|
||||
rdpSettings* settings;
|
||||
};
|
||||
|
||||
FREERDP_API rdpGlyph* glyph_cache_get(rdpGlyphCache* glyph_cache, uint32 id, uint32 index);
|
||||
FREERDP_API void glyph_cache_put(rdpGlyphCache* glyph_cache, uint32 id, uint32 index, rdpGlyph* entry);
|
||||
FREERDP_API rdpGlyph* glyph_cache_get(rdpGlyphCache* glyph_cache, UINT32 id, UINT32 index);
|
||||
FREERDP_API void glyph_cache_put(rdpGlyphCache* glyph_cache, UINT32 id, UINT32 index, rdpGlyph* entry);
|
||||
|
||||
FREERDP_API void* glyph_cache_fragment_get(rdpGlyphCache* glyph, uint32 index, uint32* count);
|
||||
FREERDP_API void glyph_cache_fragment_put(rdpGlyphCache* glyph, uint32 index, uint32 count, void* entry);
|
||||
FREERDP_API void* glyph_cache_fragment_get(rdpGlyphCache* glyph, UINT32 index, UINT32* count);
|
||||
FREERDP_API void glyph_cache_fragment_put(rdpGlyphCache* glyph, UINT32 index, UINT32 count, void* entry);
|
||||
|
||||
FREERDP_API void glyph_cache_register_callbacks(rdpUpdate* update);
|
||||
|
||||
|
||||
12
include/freerdp/cache/nine_grid.h
vendored
12
include/freerdp/cache/nine_grid.h
vendored
@@ -40,20 +40,20 @@ struct rdp_nine_grid_cache
|
||||
{
|
||||
pDrawNineGrid DrawNineGrid; /* 0 */
|
||||
pMultiDrawNineGrid MultiDrawNineGrid; /* 1 */
|
||||
uint32 paddingA[16 - 2]; /* 2 */
|
||||
UINT32 paddingA[16 - 2]; /* 2 */
|
||||
|
||||
uint32 maxEntries; /* 16 */
|
||||
uint32 maxSize; /* 17 */
|
||||
UINT32 maxEntries; /* 16 */
|
||||
UINT32 maxSize; /* 17 */
|
||||
NINE_GRID_ENTRY* entries; /* 18 */
|
||||
uint32 paddingB[32 - 19]; /* 19 */
|
||||
UINT32 paddingB[32 - 19]; /* 19 */
|
||||
|
||||
/* internal */
|
||||
|
||||
rdpSettings* settings;
|
||||
};
|
||||
|
||||
FREERDP_API void* nine_grid_cache_get(rdpNineGridCache* nine_grid, uint32 index);
|
||||
FREERDP_API void nine_grid_cache_put(rdpNineGridCache* nine_grid, uint32 index, void* entry);
|
||||
FREERDP_API void* nine_grid_cache_get(rdpNineGridCache* nine_grid, UINT32 index);
|
||||
FREERDP_API void nine_grid_cache_put(rdpNineGridCache* nine_grid, UINT32 index, void* entry);
|
||||
|
||||
FREERDP_API void nine_grid_cache_register_callbacks(rdpUpdate* update);
|
||||
|
||||
|
||||
12
include/freerdp/cache/offscreen.h
vendored
12
include/freerdp/cache/offscreen.h
vendored
@@ -32,10 +32,10 @@ typedef struct rdp_offscreen_cache rdpOffscreenCache;
|
||||
|
||||
struct rdp_offscreen_cache
|
||||
{
|
||||
uint32 maxSize; /* 0 */
|
||||
uint32 maxEntries; /* 1 */
|
||||
UINT32 maxSize; /* 0 */
|
||||
UINT32 maxEntries; /* 1 */
|
||||
rdpBitmap** entries; /* 2 */
|
||||
uint32 currentSurface; /* 3 */
|
||||
UINT32 currentSurface; /* 3 */
|
||||
|
||||
/* internal */
|
||||
|
||||
@@ -43,9 +43,9 @@ struct rdp_offscreen_cache
|
||||
rdpSettings* settings;
|
||||
};
|
||||
|
||||
FREERDP_API rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreen_cache, uint32 index);
|
||||
FREERDP_API void offscreen_cache_put(rdpOffscreenCache* offscreen_cache, uint32 index, rdpBitmap* bitmap);
|
||||
FREERDP_API void offscreen_cache_delete(rdpOffscreenCache* offscreen, uint32 index);
|
||||
FREERDP_API rdpBitmap* offscreen_cache_get(rdpOffscreenCache* offscreen_cache, UINT32 index);
|
||||
FREERDP_API void offscreen_cache_put(rdpOffscreenCache* offscreen_cache, UINT32 index, rdpBitmap* bitmap);
|
||||
FREERDP_API void offscreen_cache_delete(rdpOffscreenCache* offscreen, UINT32 index);
|
||||
|
||||
FREERDP_API void offscreen_cache_register_callbacks(rdpUpdate* update);
|
||||
|
||||
|
||||
6
include/freerdp/cache/palette.h
vendored
6
include/freerdp/cache/palette.h
vendored
@@ -38,7 +38,7 @@ struct _PALETTE_TABLE_ENTRY
|
||||
|
||||
struct rdp_palette_cache
|
||||
{
|
||||
uint32 maxEntries; /* 0 */
|
||||
UINT32 maxEntries; /* 0 */
|
||||
PALETTE_TABLE_ENTRY* entries; /* 1 */
|
||||
|
||||
/* internal */
|
||||
@@ -46,8 +46,8 @@ struct rdp_palette_cache
|
||||
rdpSettings* settings;
|
||||
};
|
||||
|
||||
FREERDP_API void* palette_cache_get(rdpPaletteCache* palette, uint32 index);
|
||||
FREERDP_API void palette_cache_put(rdpPaletteCache* palette, uint32 index, void* entry);
|
||||
FREERDP_API void* palette_cache_get(rdpPaletteCache* palette, UINT32 index);
|
||||
FREERDP_API void palette_cache_put(rdpPaletteCache* palette, UINT32 index, void* entry);
|
||||
|
||||
FREERDP_API void palette_cache_register_callbacks(rdpUpdate* update);
|
||||
|
||||
|
||||
6
include/freerdp/cache/pointer.h
vendored
6
include/freerdp/cache/pointer.h
vendored
@@ -33,7 +33,7 @@ typedef struct rdp_pointer_cache rdpPointerCache;
|
||||
|
||||
struct rdp_pointer_cache
|
||||
{
|
||||
uint32 cacheSize; /* 0 */
|
||||
UINT32 cacheSize; /* 0 */
|
||||
rdpPointer** entries; /* 1 */
|
||||
|
||||
/* internal */
|
||||
@@ -42,8 +42,8 @@ struct rdp_pointer_cache
|
||||
rdpSettings* settings;
|
||||
};
|
||||
|
||||
FREERDP_API rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, uint32 index);
|
||||
FREERDP_API void pointer_cache_put(rdpPointerCache* pointer_cache, uint32 index, rdpPointer* pointer);
|
||||
FREERDP_API rdpPointer* pointer_cache_get(rdpPointerCache* pointer_cache, UINT32 index);
|
||||
FREERDP_API void pointer_cache_put(rdpPointerCache* pointer_cache, UINT32 index, rdpPointer* pointer);
|
||||
|
||||
FREERDP_API void pointer_cache_register_callbacks(rdpUpdate* update);
|
||||
|
||||
|
||||
@@ -474,9 +474,9 @@ typedef void (*pcFreeDevice)(DEVICE* device);
|
||||
|
||||
struct _DEVICE
|
||||
{
|
||||
uint32 id;
|
||||
UINT32 id;
|
||||
|
||||
uint32 type;
|
||||
UINT32 type;
|
||||
char* name;
|
||||
STREAM* data;
|
||||
|
||||
@@ -492,13 +492,13 @@ struct _IRP
|
||||
|
||||
DEVICE* device;
|
||||
DEVMAN* devman;
|
||||
uint32 FileId;
|
||||
uint32 CompletionId;
|
||||
uint32 MajorFunction;
|
||||
uint32 MinorFunction;
|
||||
UINT32 FileId;
|
||||
UINT32 CompletionId;
|
||||
UINT32 MajorFunction;
|
||||
UINT32 MinorFunction;
|
||||
STREAM* input;
|
||||
|
||||
uint32 IoStatus;
|
||||
UINT32 IoStatus;
|
||||
STREAM* output;
|
||||
|
||||
pcIRPResponse Complete;
|
||||
@@ -508,7 +508,7 @@ struct _IRP
|
||||
struct _DEVMAN
|
||||
{
|
||||
rdpSvcPlugin* plugin;
|
||||
uint32 id_sequence;
|
||||
UINT32 id_sequence;
|
||||
LIST* devices;
|
||||
};
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ struct rdpsnd_format
|
||||
{
|
||||
UINT16 wFormatTag;
|
||||
UINT16 nChannels;
|
||||
uint32 nSamplesPerSec;
|
||||
UINT32 nSamplesPerSec;
|
||||
UINT16 nBlockAlign;
|
||||
UINT16 wBitsPerSample;
|
||||
UINT16 cbSize;
|
||||
|
||||
@@ -68,7 +68,7 @@ FREERDP_API BOOL WTSVirtualChannelManagerCheckFileDescriptor(WTSVirtualChannelMa
|
||||
FREERDP_API void* WTSVirtualChannelOpenEx(
|
||||
/* __in */ WTSVirtualChannelManager* vcm,
|
||||
/* __in */ const char* pVirtualName,
|
||||
/* __in */ uint32 flags);
|
||||
/* __in */ UINT32 flags);
|
||||
|
||||
/**
|
||||
* Returns information about a specified virtual channel.
|
||||
@@ -80,7 +80,7 @@ FREERDP_API BOOL WTSVirtualChannelQuery(
|
||||
/* __in */ void* hChannelHandle,
|
||||
/* __in */ WTS_VIRTUAL_CLASS WtsVirtualClass,
|
||||
/* __out */ void** ppBuffer,
|
||||
/* __out */ uint32* pBytesReturned);
|
||||
/* __out */ UINT32* pBytesReturned);
|
||||
|
||||
/**
|
||||
* Frees memory allocated by WTSVirtualChannelQuery
|
||||
@@ -107,10 +107,10 @@ FREERDP_API void WTSFreeMemory(
|
||||
*/
|
||||
FREERDP_API BOOL WTSVirtualChannelRead(
|
||||
/* __in */ void* hChannelHandle,
|
||||
/* __in */ uint32 TimeOut,
|
||||
/* __in */ UINT32 TimeOut,
|
||||
/* __out */ BYTE* Buffer,
|
||||
/* __in */ uint32 BufferSize,
|
||||
/* __out */ uint32* pBytesRead);
|
||||
/* __in */ UINT32 BufferSize,
|
||||
/* __out */ UINT32* pBytesRead);
|
||||
|
||||
/**
|
||||
* Writes data to the server end of a virtual channel.
|
||||
@@ -118,8 +118,8 @@ FREERDP_API BOOL WTSVirtualChannelRead(
|
||||
FREERDP_API BOOL WTSVirtualChannelWrite(
|
||||
/* __in */ void* hChannelHandle,
|
||||
/* __in */ BYTE* Buffer,
|
||||
/* __in */ uint32 Length,
|
||||
/* __out */ uint32* pBytesWritten);
|
||||
/* __in */ UINT32 Length,
|
||||
/* __out */ UINT32* pBytesWritten);
|
||||
|
||||
/**
|
||||
* Closes an open virtual channel handle.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user