Don't call DllMain on non-DLLs
Gracefully handle the kernel dispatch thread already running
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user