Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
core.sys.windows.dll
This module provides OS specific helper function for DLL support
License:
Distributed under the
Boost Software License 1.0.
(See accompanying file LICENSE)
Authors:
Rainer Schuetze
Source core/sys/windows/dll.d
- bool
dll_process_attach(HINSTANCEhInstance, boolattach_threads, void*tlsstart, void*tlsend, void*tls_callbacks_a, int*tlsindex); - To be called from DllMain with reason DLL_PROCESS_ATTACHfixup TLS storage, initialize runtime and attach to threadsReturns:true = success, false = failure
- bool
dll_process_attach(HINSTANCEhInstance, boolattach_threads= true); - same as above, but checking for shared runtime
- void
dll_process_detach(HINSTANCEhInstance, booldetach_threads= true); - to be called from DllMain with reason DLL_PROCESS_DETACH
- bool
isSharedDRuntime(); - Check whether the D runtime is built as a DLL or linked staticallyReturns:true = DLL, false = static library
- bool
dll_thread_attach(boolattach_thread= true, boolinitTls= true, HINSTANCEhInstance= null); - To be called from DllMain with reason DLL_THREAD_ATTACHReturns:true for success, false for failure
- bool
dll_thread_detach(booldetach_thread= true, boolexitTls= true, HINSTANCEhInstance= null); - To be called from DllMain with reason DLL_THREAD_DETACHReturns:true for success, false for failure
- template
SimpleDllMain() - A mixin to provide a DllMain which calls the necessary D runtime initialization and termination functions automatically.
Example
module dllmain; import core.sys.windows.dll; mixin SimpleDllMain;
Copyright © 1999-2026 by the D Language Foundation | Page generated by
Ddoc on Wed Aug 5 15:39:51 2026