Don't call DllMain on non-DLLs

Gracefully handle the kernel dispatch thread already running
This commit is contained in:
Dr. Chat
2015-07-05 13:31:13 -05:00
parent 8d4582a7a4
commit fbfdfc8914
3 changed files with 26 additions and 21 deletions

View File

@@ -104,6 +104,7 @@ X_STATUS XUserModule::LoadFromMemory(const void* addr, const size_t length) {
// Cache some commonly used headers...
this->xex_module()->GetOptHeader(XEX_HEADER_ENTRY_POINT, &entry_point_);
this->xex_module()->GetOptHeader(XEX_HEADER_DEFAULT_STACK_SIZE, &stack_size_);
dll_module_ = !!(header->module_flags & XEX_MODULE_DLL_MODULE);
OnLoad();