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();

View File

@@ -32,6 +32,7 @@ class XUserModule : public XModule {
const xex2_header* xex_header() const { return xex_module()->xex_header(); }
uint32_t guest_xex_header() const { return guest_xex_header_; }
bool dll_module() const { return dll_module_; }
uint32_t entry_point() const { return entry_point_; }
uint32_t stack_size() const { return stack_size_; }
@@ -67,6 +68,7 @@ class XUserModule : public XModule {
private:
uint32_t guest_xex_header_;
bool dll_module_;
uint32_t entry_point_;
uint32_t stack_size_;
};