diff options
Diffstat (limited to 'get_cdm_version.c')
-rw-r--r-- | get_cdm_version.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/get_cdm_version.c b/get_cdm_version.c new file mode 100644 index 000000000000..ac77bd7cf05a --- /dev/null +++ b/get_cdm_version.c @@ -0,0 +1,25 @@ +#include <stdio.h> +#include <stdlib.h> +#include <dlfcn.h> + +int main(int argc, char *argv[]) { + void *handle; + const char *(*get_cdm_version)(); + + handle = dlopen("./libwidevinecdm.so", RTLD_LAZY); + if (!handle) { + fprintf(stderr, "%s\n", dlerror()); + exit(EXIT_FAILURE); + } + + get_cdm_version = dlsym(handle, "GetCdmVersion"); + if (!get_cdm_version) { + fprintf(stderr, "%s\n", dlerror()); + exit(EXIT_FAILURE); + } + + printf("%s\n", get_cdm_version()); + dlclose(handle); + exit(EXIT_SUCCESS); +} + |