root = RtlImageDirectoryEntryToData( hmod, TRUE, IMAGE_DIRECTORY_ENTRY_RESOURCE, &size );
if (!root) return STATUS_RESOURCE_DATA_NOT_FOUND;
+ if (size < sizeof(*resdirptr)) return STATUS_RESOURCE_DATA_NOT_FOUND;
resdirptr = root;
if (!level--) goto done;
* "call access_resource" instruction being there.
*/
#ifdef __i386__
-__ASM_GLOBAL_FUNC( LdrAccessResource,
+__ASM_STDCALL_FUNC( LdrAccessResource, 16,
"pushl %ebp\n\t"
"movl %esp, %ebp\n\t"
"subl $4,%esp\n\t"