4 * Copied and modified heavily from loader/resource.c
13 struct resource
** Resources
; /* NULL-terminated array of pointers */
17 static ResListE
* ResourceList
=NULL
;
19 void LIBRES_RegisterResources(struct resource
** Res
)
23 for(Curr
=&ResourceList
; *Curr
; Curr
=&((*Curr
)->next
)) { }
24 n
=xmalloc(sizeof(ResListE
));
32 fprintf(stderr
,"LIBRES_RegisterResources(): Out of memory.\n");
35 /**********************************************************************
38 HRSRC
LIBRES_FindResource( HINSTANCE hModule
, LPCSTR name
, LPCSTR type
)
42 struct resource
** Res
;
63 WINELIB_UNIMP("LIBRES_FindResource(*,*,type=string)");
70 for(ResBlock
=ResourceList
; ResBlock
; ResBlock
=ResBlock
->next
)
71 for(Res
=ResBlock
->Resources
; *Res
; Res
++)
74 if((*Res
)->type
==typeid && !strcmp((*Res
)->name
,name
))
78 if((*Res
)->type
==typeid && (*Res
)->id
==nameid
)
84 /**********************************************************************
87 HGLOBAL
LIBRES_LoadResource( HINSTANCE hModule
, HRSRC hRsrc
)
89 return (HGLOBAL
)(((struct resource
*)hRsrc
)->bytes
);
93 /**********************************************************************
96 LPVOID
LIBRES_LockResource( HGLOBAL handle
)
102 /**********************************************************************
103 * LIBRES_FreeResource
105 BOOL
LIBRES_FreeResource( HGLOBAL handle
)
107 WINELIB_UNIMP("LIBRES_FreeResource()");
108 return 0; /* Obsolete in Win32 */
112 /**********************************************************************
113 * LIBRES_AccessResource
115 INT
LIBRES_AccessResource( HINSTANCE hModule
, HRSRC hRsrc
)
117 WINELIB_UNIMP("LIBRES_AccessResource()");
118 return -1; /* Obsolete in Win32 */
122 /**********************************************************************
123 * LIBRES_SizeofResource
125 DWORD
LIBRES_SizeofResource( HINSTANCE hModule
, HRSRC hRsrc
)
127 return (DWORD
)(((struct resource
*)hRsrc
)->size
);
131 /**********************************************************************
132 * LIBRES_AllocResource
134 HGLOBAL
LIBRES_AllocResource( HINSTANCE hModule
, HRSRC hRsrc
, DWORD size
)
136 WINELIB_UNIMP("LIBRES_AllocResource()");
137 return 0; /* Obsolete in Win32 */