setupapi: Check for NULL module to avoid an exception in RtlImageNtHeader.

This allows creating a wineprefix on 64-bit, where exception handling
doesn't quite work yet.
This commit is contained in:
Alexandre Julliard 2009-03-12 11:52:51 +01:00
parent 85f8f30a65
commit c1b411e321
1 changed files with 1 additions and 1 deletions

View File

@ -193,7 +193,7 @@ static BOOL build_fake_dll( HANDLE file, HMODULE module )
memcpy( dos + 1, fakedll_signature, sizeof(fakedll_signature) );
nt = info.nt = (IMAGE_NT_HEADERS *)(buffer + lfanew);
src_nt = RtlImageNtHeader( module );
if (module) src_nt = RtlImageNtHeader( module );
/* some fields are copied from the source dll */
#define SET(field,def) nt->field = src_nt ? src_nt->field : def
SET( FileHeader.Machine, IMAGE_FILE_MACHINE_I386 );