2012-10-06 00:01:59 +04:00
|
|
|
/**
|
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2012-10-09 03:54:11 +04:00
|
|
|
* Client Channels
|
2012-10-06 00:01:59 +04:00
|
|
|
*
|
|
|
|
* Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2012-10-08 06:53:24 +04:00
|
|
|
#include "tables.h"
|
2012-10-06 00:01:59 +04:00
|
|
|
|
2012-10-08 06:53:24 +04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2012-10-09 03:54:11 +04:00
|
|
|
#include <freerdp/client/channels.h>
|
|
|
|
|
2012-10-08 06:53:24 +04:00
|
|
|
extern const VIRTUAL_CHANNEL_ENTRY VIRTUAL_CHANNEL_TABLE[];
|
|
|
|
extern const DEVICE_SERVICE_ENTRY DEVICE_SERVICE_TABLE[];
|
|
|
|
|
2012-10-09 03:54:11 +04:00
|
|
|
void* freerdp_channels_find_static_virtual_channel_entry(const char* name)
|
2012-10-08 06:53:24 +04:00
|
|
|
{
|
2012-10-09 03:54:11 +04:00
|
|
|
int index = 0;
|
|
|
|
VIRTUAL_CHANNEL_ENTRY* pEntry;
|
2012-10-08 06:53:24 +04:00
|
|
|
|
2012-10-09 03:54:11 +04:00
|
|
|
pEntry = (VIRTUAL_CHANNEL_ENTRY*) &VIRTUAL_CHANNEL_TABLE[index++];
|
2012-10-08 06:53:24 +04:00
|
|
|
|
2012-10-09 03:54:11 +04:00
|
|
|
while (pEntry->entry != NULL)
|
|
|
|
{
|
|
|
|
if (strcmp(pEntry->name, name) == 0)
|
2012-10-08 06:53:24 +04:00
|
|
|
{
|
2012-10-09 03:54:11 +04:00
|
|
|
return (void*) pEntry->entry;
|
2012-10-08 06:53:24 +04:00
|
|
|
}
|
2012-10-09 03:54:11 +04:00
|
|
|
|
|
|
|
pEntry = (VIRTUAL_CHANNEL_ENTRY*) &VIRTUAL_CHANNEL_TABLE[index++];
|
2012-10-08 06:53:24 +04:00
|
|
|
}
|
|
|
|
|
2012-10-09 03:54:11 +04:00
|
|
|
return NULL;
|
|
|
|
}
|
2012-10-08 06:53:24 +04:00
|
|
|
|
2012-10-09 03:54:11 +04:00
|
|
|
void* freerdp_channels_find_static_device_service_entry(const char* name)
|
|
|
|
{
|
|
|
|
int index = 0;
|
|
|
|
DEVICE_SERVICE_ENTRY* pEntry;
|
|
|
|
|
|
|
|
pEntry = (DEVICE_SERVICE_ENTRY*) &DEVICE_SERVICE_TABLE[index++];
|
2012-10-08 06:53:24 +04:00
|
|
|
|
2012-10-09 03:54:11 +04:00
|
|
|
while (pEntry->entry != NULL)
|
|
|
|
{
|
|
|
|
if (strcmp(pEntry->name, name) == 0)
|
|
|
|
{
|
|
|
|
return (void*) pEntry->entry;
|
2012-10-08 06:53:24 +04:00
|
|
|
}
|
2012-10-09 03:54:11 +04:00
|
|
|
|
|
|
|
pEntry = (DEVICE_SERVICE_ENTRY*) &DEVICE_SERVICE_TABLE[index++];
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void* freerdp_channels_find_static_entry(const char* name, const char* entry)
|
|
|
|
{
|
|
|
|
if (strcmp(entry, "VirtualChannelEntry") == 0)
|
|
|
|
{
|
|
|
|
return freerdp_channels_find_static_virtual_channel_entry(name);
|
|
|
|
}
|
|
|
|
else if (strcmp(entry, "DeviceServiceEntry") == 0)
|
|
|
|
{
|
|
|
|
return freerdp_channels_find_static_device_service_entry(name);
|
2012-10-08 06:53:24 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
2012-10-09 03:54:11 +04:00
|
|
|
|