4 * Copied and modified heavily from loader/resource.c
8 #include "wine/winestring.h"
17 const wrc_resource32_t * const * Resources; /* NULL-terminated array of pointers */
21 static ResListE* ResourceList=NULL;
23 void LIBRES_RegisterResources(const wrc_resource32_t * const * Res)
27 for(Curr=&ResourceList; *Curr; Curr=&((*Curr)->next)) { }
28 n=xmalloc(sizeof(ResListE));
34 /**********************************************************************
37 HRSRC LIBRES_FindResource( HINSTANCE hModule, LPCWSTR name, LPCWSTR type )
41 const wrc_resource32_t* const * Res;
47 LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, name );
48 nameid = atoi(nameA+1);
49 HeapFree( GetProcessHeap(), 0, nameA );
62 LPSTR typeA = HEAP_strdupWtoA( GetProcessHeap(), 0, type );
64 HeapFree( GetProcessHeap(), 0, typeA );
68 TRACE(resource, "(*,*,type=string): Returning 0\n");
75 /* FIXME: types can be strings */
76 for(ResBlock=ResourceList; ResBlock; ResBlock=ResBlock->next)
77 for(Res=ResBlock->Resources; *Res; Res++)
80 if((*Res)->restype==typeid && !lstrncmpiW((LPCWSTR)((*Res)->resname+1), name, *((*Res)->resname)))
84 if((*Res)->restype==typeid && (*Res)->resid==nameid)
90 /**********************************************************************
93 HGLOBAL LIBRES_LoadResource( HINSTANCE hModule, HRSRC hRsrc )
95 return (HGLOBAL)(((wrc_resource32_t*)hRsrc)->data);
99 /**********************************************************************
100 * LIBRES_SizeofResource
102 DWORD LIBRES_SizeofResource( HINSTANCE hModule, HRSRC hRsrc )
104 return (DWORD)(((wrc_resource32_t*)hRsrc)->datasize);