Question

Sous Windows, le point d'entrée standard DLL est appelé DllMain. Le second paramètre est un DWORD, ul_reason_for_call.

Je l'ai regardé les valeurs possibles pour ce second paramètre sur MSDN. Les éléments suivants sont évidents:

DLL_PROCESS_ATTACH:
DLL_THREAD_ATTACH:
DLL_THREAD_DETACH:
DLL_PROCESS_DETACH:

Mais qu'en est:

DLL_PROCESS_VERIFIER

Quand le point d'entrée est appelé avec ce drapeau? Dois-je craindre pendant le fonctionnement « normal » de la DLL?

Notez que je ne vois DLL_PROCESS_VERIFIER dans les fichiers d'en-tête à partir de Visual Studio 2005, et non 2008.

Était-ce utile?

La solution

I guess in theory Microsoft could invent new usages and flags any time they feel they need a new one. So the simple rule is to ensure that your code tolerates unexpected values: i.e. write it to handle the cases that you need to handle and ignore the rest, by returning zero.

Autres conseils

This is really obscure. It is not ever documented in the SDK and doesn't appear in the SDK header files. Google produces only a few hits, most sites are down or untrusted. The only decent hit I get is XBox code, it only declares it but doesn't actually use it.

I'm not sufficiently convinced that this is a real code that you'd ever encounter in a regular Windows program.

I think it can have then value if it is run through Application Verifier. Kind of guessing :)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top