summaryrefslogtreecommitdiffstats
path: root/loader/qtx/list.c
blob: 0ce232b88be3695eb79a9b6a0926d555c2da3668 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* to compile:
   edit ../win32.c, change the #if 0 to 1 at line 1326 to enabel quicktime fix!
   (cd ..;make distclean;make)
   gcc -o list list.c ../libloader.a -lpthread -ldl -lm -ggdb ../../cpudetect.o
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "qtxsdk/components.h"
#include "qtxsdk/select.h"

char* get_path(char* x){  return strdup(x);}
void* LoadLibraryA(char* name);
void* GetProcAddress(void* handle,char* func);

#define __stdcall __attribute__((__stdcall__))
#define __cdecl   __attribute__((__cdecl__))
#define APIENTRY 

int main(int argc, char *argv[]){
    void *handler;
    ComponentDescription desc;
    Component (*FindNextComponent)(Component prev,ComponentDescription* desc);
    long (*CountComponents)(ComponentDescription* desc);

    Setup_LDT_Keeper();
    handler = LoadLibraryA("/usr/lib/win32/qtmlClient.dll");
    FindNextComponent = GetProcAddress(handler, "FindNextComponent");
    CountComponents = GetProcAddress(handler, "CountComponents");
    printf("handler: %p, funcs: %p, %p\n", handler, FindNextComponent,CountComponents);

    memset(&desc,0,sizeof(desc));
    desc.componentType=0;
    desc.componentSubType=0;
    desc.componentManufacturer=0;
    desc.componentFlags=0;
    desc.componentFlagsMask=0;
    
    printf("Count = %d\n",CountComponents(&desc));
    
    Restore_LDT_Keeper();
    exit(0);
}