From: Alexandre Julliard Subject: Re: [PATCH v2] ntdll: Cache LDR_IMAGE_IS_DLL for InitDLL Message-Id: <871rp0hmxg.fsf@wine> Date: Mon, 06 Apr 2020 13:29:47 +0200 In-Reply-To: (Myah Caron's message of "Mon, 06 Apr 2020 11:08:30 +0000") References: <87blo4hpy4.fsf@wine> Myah Caron writes: > Sorry, I'm not quite sure I understand... how could I tweak the usage of ldr.EntryPoint in order to achieve the same result? > > To clarify, the issue is that under Windows, it seems like Flags & > LDR_IMAGE_IS_DLL is only evaluated once at the beginning, and then > cached for the rest of the DLL's lifetime. No matter how Flags is > subsequently modified (even if it's modified before the initial > DllMain call), it will always seem to call DllMain if the > Characteristics was set as IMAGE_FILE_DLL. You'd make sure ldr.EntryPoint is set only when we actually have a dll entry point to call. -- Alexandre Julliard julliard@winehq.org