Add new IPC function to get information for a plugin by filepath

This commit is contained in:
Maschell 2019-11-16 15:14:17 +01:00
parent 532d6f8454
commit 7d7a668210
2 changed files with 20 additions and 0 deletions

View File

@ -263,6 +263,25 @@ int ipc_ioctl(ipcmessage *message) {
}
break;
}
case IOCTL_PLUGIN_INFORMATION_GET_INFORMATION_FOR_FILEPATH: {
DEBUG_FUNCTION_LINE("IOCTL_PLUGIN_INFORMATION_GET_INFORMATION_FOR_FILEPATH\n");
if(message->ioctl.length_in != 4 || message->ioctl.length_io != 4) {
DEBUG_FUNCTION_LINE("IPC_ERROR_INVALID_SIZE\n");
res = IPC_ERROR_INVALID_SIZE;
} else {
char * path = (char *) message->ioctl.buffer_in[0];
plugin_information_handle * io_handle = (plugin_information_handle *) &(message->ioctl.buffer_io[0]);
//DEBUG_FUNCTION_LINE("filepath %08X %s\n", path,path);
PluginInformation * plugin= PluginInformation::loadPluginInformation(path);
*io_handle = (plugin_information_handle) plugin;
DCFlushRange(message->ioctl.buffer_io,message->ioctl.length_io);
ICInvalidateRange(message->ioctl.buffer_io,message->ioctl.length_io);
}
break;
}
default:
res = IPC_ERROR_INVALID_ARG;
break;

View File

@ -24,6 +24,7 @@ extern "C" {
#define IOCTL_PLUGIN_LOADER_DELETE_INFORMATION 0x06
#define IOCTL_PLUGIN_LOADER_LINK_VIA_INFORMATION 0x07
#define IOCTL_PLUGIN_LOADER_LINK_VIA_INFORMATION_ON_RESTART 0x08
#define IOCTL_PLUGIN_INFORMATION_GET_INFORMATION_FOR_FILEPATH 0x09
/* IPC message */
typedef struct ipcmessage {