4 * Copied and modified heavily from loader/resource.c
17 const struct resource* const * Resources; /* NULL-terminated array of pointers */
21 static ResListE* ResourceList=NULL;
23 void LIBRES_RegisterResources(const struct resource* const * Res)
27 for(Curr=&ResourceList; *Curr; Curr=&((*Curr)->next)) { }
28 n=xmalloc(sizeof(ResListE));
34 /**********************************************************************
37 HRSRC32 LIBRES_FindResource( HINSTANCE32 hModule, LPCWSTR name, LPCWSTR type )
41 const struct resource* 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 for(ResBlock=ResourceList; ResBlock; ResBlock=ResBlock->next)
76 for(Res=ResBlock->Resources; *Res; Res++)
79 if((*Res)->type==typeid && !lstrcmpi32W((LPCWSTR)(*Res)->name,name))
83 if((*Res)->type==typeid && (*Res)->id==nameid)
89 /**********************************************************************
92 HGLOBAL32 LIBRES_LoadResource( HINSTANCE32 hModule, HRSRC32 hRsrc )
94 return (HGLOBAL32)(((struct resource*)hRsrc)->bytes);
98 /**********************************************************************
99 * LIBRES_SizeofResource
101 DWORD LIBRES_SizeofResource( HINSTANCE32 hModule, HRSRC32 hRsrc )
103 return (DWORD)(((struct resource*)hRsrc)->size);