4 * Copied and modified heavily from loader/resource.c
15 const struct resource
* const * Resources
; /* NULL-terminated array of pointers */
19 static ResListE
* ResourceList
=NULL
;
21 void LIBRES_RegisterResources(const struct resource
* const * Res
)
25 for(Curr
=&ResourceList
; *Curr
; Curr
=&((*Curr
)->next
)) { }
26 n
=xmalloc(sizeof(ResListE
));
32 /**********************************************************************
35 HRSRC
LIBRES_FindResource( HINSTANCE hModule
, LPCSTR name
, LPCSTR type
)
39 const struct resource
* const * Res
;
60 WINELIB_UNIMP("LIBRES_FindResource(*,*,type=string)");
67 for(ResBlock
=ResourceList
; ResBlock
; ResBlock
=ResBlock
->next
)
68 for(Res
=ResBlock
->Resources
; *Res
; Res
++)
71 if((*Res
)->type
==typeid && !strcmp((*Res
)->name
,name
))
75 if((*Res
)->type
==typeid && (*Res
)->id
==nameid
)
81 /**********************************************************************
84 HGLOBAL
LIBRES_LoadResource( HINSTANCE hModule
, HRSRC hRsrc
)
86 return (HGLOBAL
)(((struct resource
*)hRsrc
)->bytes
);
90 /**********************************************************************
93 LPVOID
LIBRES_LockResource( HGLOBAL handle
)
99 /**********************************************************************
100 * LIBRES_FreeResource
102 BOOL
LIBRES_FreeResource( HGLOBAL handle
)
104 WINELIB_UNIMP("LIBRES_FreeResource()");
105 return 0; /* Obsolete in Win32 */
109 /**********************************************************************
110 * LIBRES_AccessResource
112 INT
LIBRES_AccessResource( HINSTANCE hModule
, HRSRC hRsrc
)
114 WINELIB_UNIMP("LIBRES_AccessResource()");
115 return -1; /* Obsolete in Win32 */
119 /**********************************************************************
120 * LIBRES_SizeofResource
122 DWORD
LIBRES_SizeofResource( HINSTANCE hModule
, HRSRC hRsrc
)
124 return (DWORD
)(((struct resource
*)hRsrc
)->size
);
128 /**********************************************************************
129 * LIBRES_AllocResource
131 HGLOBAL
LIBRES_AllocResource( HINSTANCE hModule
, HRSRC hRsrc
, DWORD size
)
133 WINELIB_UNIMP("LIBRES_AllocResource()");
134 return 0; /* Obsolete in Win32 */