4 * Copied and modified heavily from loader/resource.c
16 const wrc_resource32_t * const * Resources; /* NULL-terminated array of pointers */
20 static ResListE* ResourceList=NULL;
22 void LIBRES_RegisterResources(const wrc_resource32_t * const * Res)
26 for(Curr=&ResourceList; *Curr; Curr=&((*Curr)->next)) { }
27 n=xmalloc(sizeof(ResListE));
33 /**********************************************************************
36 HRSRC32 LIBRES_FindResource( HINSTANCE32 hModule, LPCWSTR name, LPCWSTR type )
40 const wrc_resource32_t* const * Res;
46 LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, name );
47 nameid = atoi(nameA+1);
48 HeapFree( GetProcessHeap(), 0, nameA );
61 LPSTR typeA = HEAP_strdupWtoA( GetProcessHeap(), 0, type );
63 HeapFree( GetProcessHeap(), 0, typeA );
67 TRACE(resource, "(*,*,type=string): Returning 0\n");
74 /* FIXME: types can be strings */
75 for(ResBlock=ResourceList; ResBlock; ResBlock=ResBlock->next)
76 for(Res=ResBlock->Resources; *Res; Res++)
79 if((*Res)->restype==typeid && !lstrncmpi32W((LPCWSTR)((*Res)->resname+1), name, *((*Res)->resname)))
83 if((*Res)->restype==typeid && (*Res)->resid==nameid)
89 /**********************************************************************
92 HGLOBAL32 LIBRES_LoadResource( HINSTANCE32 hModule, HRSRC32 hRsrc )
94 return (HGLOBAL32)(((wrc_resource32_t*)hRsrc)->data);
98 /**********************************************************************
99 * LIBRES_SizeofResource
101 DWORD LIBRES_SizeofResource( HINSTANCE32 hModule, HRSRC32 hRsrc )
103 return (DWORD)(((wrc_resource32_t*)hRsrc)->datasize);