本文整理汇总了C++中DEBUG_SVC函数的典型用法代码示例。如果您正苦于以下问题:C++ DEBUG_SVC函数的具体用法?C++ DEBUG_SVC怎么用?C++ DEBUG_SVC使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DEBUG_SVC函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: svc_plugin_thread_func
static void* svc_plugin_thread_func(void* arg)
{
rdpSvcPlugin* plugin = (rdpSvcPlugin*)arg;
DEBUG_SVC("in");
IFCALL(plugin->connect_callback, plugin);
while (1)
{
if (plugin->interval_ms > 0)
freerdp_thread_wait_timeout(plugin->priv->thread, plugin->interval_ms);
else
freerdp_thread_wait(plugin->priv->thread);
if (freerdp_thread_is_stopped(plugin->priv->thread))
break;
freerdp_thread_reset(plugin->priv->thread);
svc_plugin_process_data_in(plugin);
if (plugin->interval_ms > 0)
IFCALL(plugin->interval_callback, plugin);
}
freerdp_thread_quit(plugin->priv->thread);
DEBUG_SVC("out");
return 0;
}
示例2: __serial_check_fds
static void __serial_check_fds(SERIAL_DEVICE* serial)
{
IRP* irp;
IRP* prev;
SERIAL_TTY* tty;
uint32 result = 0;
memset(&serial->tv, 0, sizeof(struct timeval));
tty = serial->tty;
/* scan every pending */
irp = list_peek(serial->pending_irps);
while (irp)
{
DEBUG_SVC("MajorFunction %u", irp->MajorFunction);
switch (irp->MajorFunction)
{
case IRP_MJ_READ:
if (FD_ISSET(tty->fd, &serial->read_fds))
{
irp->IoStatus = STATUS_SUCCESS;
serial_process_irp_read(serial, irp);
}
break;
case IRP_MJ_WRITE:
if (FD_ISSET(tty->fd, &serial->write_fds))
{
irp->IoStatus = STATUS_SUCCESS;
serial_process_irp_write(serial, irp);
}
break;
case IRP_MJ_DEVICE_CONTROL:
if (serial_tty_get_event(tty, &result))
{
DEBUG_SVC("got event result %u", result);
irp->IoStatus = STATUS_SUCCESS;
stream_write_uint32(irp->output, result);
irp->Complete(irp);
}
break;
default:
DEBUG_SVC("no request found");
break;
}
prev = irp;
irp = (IRP*)list_next(serial->pending_irps, irp);
if (prev->IoStatus == STATUS_SUCCESS)
{
list_remove(serial->pending_irps, prev);
wait_obj_set(serial->in_event);
}
}
}
示例3: parallel_process_irp_close
static void parallel_process_irp_close(PARALLEL_DEVICE* parallel, IRP* irp)
{
if (close(parallel->file) < 0)
DEBUG_SVC("failed to close %s(%d)", parallel->path, parallel->id);
else
DEBUG_SVC("%s(%d) closed", parallel->path, parallel->id);
stream_write_zero(irp->output, 5); /* Padding(5) */
irp->Complete(irp);
}
示例4: serial_process_irp_read
static void serial_process_irp_read(SERIAL_DEVICE* serial, IRP* irp)
{
SERIAL_TTY* tty;
uint32 Length;
uint64 Offset;
uint8* buffer = NULL;
stream_read_uint32(irp->input, Length);
stream_read_uint64(irp->input, Offset);
DEBUG_SVC("length %u offset %llu", Length, Offset);
tty = serial->tty;
if (tty == NULL)
{
irp->IoStatus = STATUS_UNSUCCESSFUL;
Length = 0;
DEBUG_WARN("tty not valid.");
}
else
{
buffer = (uint8*)xmalloc(Length);
if (!serial_tty_read(tty, buffer, &Length))
{
irp->IoStatus = STATUS_UNSUCCESSFUL;
xfree(buffer);
buffer = NULL;
Length = 0;
DEBUG_WARN("read %s(%d) failed.", serial->path, tty->id);
}
else
{
DEBUG_SVC("read %llu-%llu from %d", Offset, Offset + Length, tty->id);
}
}
stream_write_uint32(irp->output, Length);
if (Length > 0)
{
stream_check_size(irp->output, Length);
stream_write(irp->output, buffer, Length);
}
xfree(buffer);
irp->Complete(irp);
}
示例5: drive_map_posix_err
static UINT32 drive_map_posix_err(int fs_errno)
{
UINT32 rc;
/* try to return NTSTATUS version of error code */
switch (fs_errno)
{
case EPERM:
case EACCES:
rc = STATUS_ACCESS_DENIED;
break;
case ENOENT:
rc = STATUS_NO_SUCH_FILE;
break;
case EBUSY:
rc = STATUS_DEVICE_BUSY;
break;
case EEXIST:
rc = STATUS_OBJECT_NAME_COLLISION;
break;
case EISDIR:
rc = STATUS_FILE_IS_A_DIRECTORY;
break;
default:
rc = STATUS_UNSUCCESSFUL;
break;
}
DEBUG_SVC("errno 0x%x mapped to 0x%x", fs_errno, rc);
return rc;
}
示例6: drive_process_irp_set_information
static void drive_process_irp_set_information(DRIVE_DEVICE* disk, IRP* irp)
{
DRIVE_FILE* file;
UINT32 FsInformationClass;
UINT32 Length;
stream_read_UINT32(irp->input, FsInformationClass);
stream_read_UINT32(irp->input, Length);
stream_seek(irp->input, 24); /* Padding */
file = drive_get_file_by_id(disk, irp->FileId);
if (file == NULL)
{
irp->IoStatus = STATUS_UNSUCCESSFUL;
DEBUG_WARN("FileId %d not valid.", irp->FileId);
}
else if (!drive_file_set_information(file, FsInformationClass, Length, irp->input))
{
irp->IoStatus = STATUS_UNSUCCESSFUL;
DEBUG_WARN("FsInformationClass %d on %s(%d) failed.", FsInformationClass, file->fullpath, file->id);
}
else
{
DEBUG_SVC("FsInformationClass %d on %s(%d) ok.", FsInformationClass, file->fullpath, file->id);
}
stream_write_UINT32(irp->output, Length);
irp->Complete(irp);
}
示例7: serial_set_fds
static void serial_set_fds(SERIAL_DEVICE* serial)
{
fd_set* fds;
IRP* irp;
SERIAL_TTY* tty;
DEBUG_SVC("[in] pending size %d", list_size(serial->pending_irps));
tty = serial->tty;
irp = (IRP*)list_peek(serial->pending_irps);
while (irp)
{
fds = NULL;
switch (irp->MajorFunction)
{
case IRP_MJ_WRITE:
fds = &serial->write_fds;
break;
case IRP_MJ_READ:
fds = &serial->read_fds;
break;
}
if (fds && (tty->fd >= 0))
{
FD_SET(tty->fd, fds);
serial->nfds = MAX(serial->nfds, tty->fd);
}
irp = (IRP*)list_next(serial->pending_irps, irp);
}
}
示例8: svc_plugin_init_event
static void svc_plugin_init_event(void* pInitHandle, UINT32 event, void* pData, UINT32 dataLength)
{
rdpSvcPlugin* plugin;
DEBUG_SVC("event %d", event);
plugin = (rdpSvcPlugin*) svc_plugin_find_by_init_handle(pInitHandle);
if (!plugin)
{
fprintf(stderr, "svc_plugin_init_event: error no match\n");
return;
}
switch (event)
{
case CHANNEL_EVENT_CONNECTED:
svc_plugin_process_connected(plugin, pData, dataLength);
break;
case CHANNEL_EVENT_DISCONNECTED:
break;
case CHANNEL_EVENT_TERMINATED:
svc_plugin_process_terminated(plugin);
break;
}
}
示例9: svc_plugin_open_event
static void svc_plugin_open_event(UINT32 openHandle, UINT32 event, void* pData, UINT32 dataLength,
UINT32 totalLength, UINT32 dataFlags)
{
rdpSvcPlugin* plugin;
DEBUG_SVC("openHandle %d event %d dataLength %d totalLength %d dataFlags %d",
openHandle, event, dataLength, totalLength, dataFlags);
plugin = (rdpSvcPlugin*) svc_plugin_find_by_open_handle(openHandle);
if (!plugin)
{
fprintf(stderr, "svc_plugin_open_event: error no match\n");
return;
}
switch (event)
{
case CHANNEL_EVENT_DATA_RECEIVED:
svc_plugin_process_received(plugin, pData, dataLength, totalLength, dataFlags);
break;
case CHANNEL_EVENT_WRITE_COMPLETE:
stream_free((wStream*) pData);
break;
case CHANNEL_EVENT_USER:
svc_plugin_process_event(plugin, (wMessage*) pData);
break;
}
}
示例10: printer_process_irp_write
static void printer_process_irp_write(PRINTER_DEVICE* printer_dev, IRP* irp)
{
UINT32 Length;
UINT64 Offset;
rdpPrintJob* printjob = NULL;
stream_read_UINT32(irp->input, Length);
stream_read_UINT64(irp->input, Offset);
stream_seek(irp->input, 20); /* Padding */
if (printer_dev->printer != NULL)
printjob = printer_dev->printer->FindPrintJob(printer_dev->printer, irp->FileId);
if (printjob == NULL)
{
irp->IoStatus = STATUS_UNSUCCESSFUL;
Length = 0;
DEBUG_WARN("printjob id %d not found.", irp->FileId);
}
else
{
printjob->Write(printjob, stream_get_tail(irp->input), Length);
DEBUG_SVC("printjob id %d written %d bytes.", irp->FileId, Length);
}
stream_write_UINT32(irp->output, Length);
stream_write_BYTE(irp->output, 0); /* Padding */
irp->Complete(irp);
}
示例11: svc_plugin_open_event
static VOID VCAPITYPE svc_plugin_open_event(DWORD openHandle, UINT event, LPVOID pData, UINT32 dataLength,
UINT32 totalLength, UINT32 dataFlags)
{
rdpSvcPlugin* plugin;
DEBUG_SVC("openHandle %d event %d dataLength %d totalLength %d dataFlags %d",
openHandle, event, dataLength, totalLength, dataFlags);
plugin = (rdpSvcPlugin*) svc_plugin_get_open_handle_data(openHandle);
if (!plugin)
{
fprintf(stderr, "svc_plugin_open_event: error no match\n");
return;
}
switch (event)
{
case CHANNEL_EVENT_DATA_RECEIVED:
svc_plugin_process_received(plugin, pData, dataLength, totalLength, dataFlags);
break;
case CHANNEL_EVENT_WRITE_COMPLETE:
Stream_Free((wStream*) pData, TRUE);
break;
case CHANNEL_EVENT_USER:
svc_plugin_process_event(plugin, (wMessage*) pData);
break;
}
}
示例12: rdpsnd_process_message_close
static void rdpsnd_process_message_close(rdpsndPlugin* rdpsnd)
{
DEBUG_SVC("server closes.");
if (rdpsnd->device)
IFCALL(rdpsnd->device->Close, rdpsnd->device);
rdpsnd->is_open = false;
}
示例13: serial_free
static void serial_free(DEVICE* device)
{
SERIAL_DEVICE* serial = (SERIAL_DEVICE*) device;
DEBUG_SVC("freeing device");
/* Stop thread */
SetEvent(serial->stopEvent);
if(serial->mthread)
{
TerminateThread(serial->mthread, 0);
WaitForSingleObject(serial->mthread, INFINITE);
CloseHandle(serial->mthread);
}
WaitForSingleObject(serial->thread, INFINITE);
serial_tty_free(serial->tty);
/* Clean up resources */
Stream_Free(serial->device.data, TRUE);
Queue_Free(serial->queue);
list_free(serial->pending_irps);
CloseHandle(serial->stopEvent);
CloseHandle(serial->newEvent);
CloseHandle(serial->thread);
free(serial);
}
示例14: serial_process_irp_close
static void serial_process_irp_close(SERIAL_DEVICE* serial, IRP* irp)
{
SERIAL_TTY* tty;
tty = serial->tty;
if (tty == NULL)
{
irp->IoStatus = STATUS_UNSUCCESSFUL;
DEBUG_WARN("tty not valid.");
}
else
{
DEBUG_SVC("%s(%d) closed.", serial->path, tty->id);
TerminateThread(serial->mthread, 0);
WaitForSingleObject(serial->mthread, INFINITE);
CloseHandle(serial->mthread);
serial->mthread = NULL;
serial_tty_free(tty);
serial->tty = NULL;
}
Stream_Zero(irp->output, 5); /* Padding(5) */
irp->Complete(irp);
}
示例15: svc_plugin_init_event
static VOID VCAPITYPE svc_plugin_init_event(LPVOID pInitHandle, UINT event, LPVOID pData, UINT dataLength)
{
rdpSvcPlugin* plugin;
DEBUG_SVC("event %d", event);
plugin = (rdpSvcPlugin*) svc_plugin_get_init_handle_data(pInitHandle);
if (!plugin)
{
fprintf(stderr, "svc_plugin_init_event: error no match\n");
return;
}
switch (event)
{
case CHANNEL_EVENT_CONNECTED:
svc_plugin_process_connected(plugin, pData, dataLength);
break;
case CHANNEL_EVENT_DISCONNECTED:
break;
case CHANNEL_EVENT_TERMINATED:
svc_plugin_process_terminated(plugin);
break;
}
}