Code fixes to get things somewhat compiling on Windows.
This commit is contained in:
@@ -41,7 +41,7 @@ KernelExport* ExportResolver::GetExportByOrdinal(const char* library_name,
|
||||
const uint32_t ordinal) {
|
||||
for (std::vector<ExportTable>::iterator it = tables_.begin();
|
||||
it != tables_.end(); ++it) {
|
||||
if (!xestrcmp(library_name, it->name)) {
|
||||
if (!xestrcmpa(library_name, it->name)) {
|
||||
// TODO(benvanik): binary search?
|
||||
for (size_t n = 0; n < it->count; n++) {
|
||||
if (it->exports[n].ordinal == ordinal) {
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace xbdm {
|
||||
|
||||
|
||||
static KernelExport xbdm_export_table[] = {
|
||||
0,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -85,8 +85,13 @@ int Runtime::LoadBinaryModule(const xechar_t* path, uint32_t start_address) {
|
||||
addr, length));
|
||||
|
||||
// Prepare the module.
|
||||
char name_a[2048];
|
||||
XEEXPECTTRUE(xestrnarrow(name_a, XECOUNT(name_a), name));
|
||||
char path_a[2048];
|
||||
XEEXPECTTRUE(xestrnarrow(path_a, XECOUNT(path_a), path));
|
||||
XEEXPECTZERO(processor_->PrepareModule(
|
||||
name, path, start_address, start_address + length, export_resolver_));
|
||||
name_a, path_a, start_address, start_address + length,
|
||||
export_resolver_));
|
||||
|
||||
result_code = 0;
|
||||
XECLEANUP:
|
||||
|
||||
@@ -205,8 +205,8 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length,
|
||||
size_t count = XEGETUINT32BE(pp + 0x08);
|
||||
XEASSERT(count <= max_count);
|
||||
if (count > max_count) {
|
||||
XELOGW(XT("ignoring %zu extra entries in "
|
||||
"XEX_HEADER_IMPORT_LIBRARIES"), (max_count - count));
|
||||
XELOGW(XT("ignoring %zu extra entries in ")
|
||||
XT("XEX_HEADER_IMPORT_LIBRARIES"), (max_count - count));
|
||||
count = max_count;
|
||||
}
|
||||
header->import_library_count = count;
|
||||
@@ -259,8 +259,8 @@ int xe_xex2_read_header(const uint8_t *addr, const size_t length,
|
||||
size_t count = (opt_header->length - 4) / 16;
|
||||
XEASSERT(count <= max_count);
|
||||
if (count > max_count) {
|
||||
XELOGW(XT("ignoring %zu extra entries in "
|
||||
"XEX_HEADER_STATIC_LIBRARIES"), (max_count - count));
|
||||
XELOGW(XT("ignoring %zu extra entries in ")
|
||||
XT("XEX_HEADER_STATIC_LIBRARIES"), (max_count - count));
|
||||
count = max_count;
|
||||
}
|
||||
header->static_library_count = count;
|
||||
|
||||
Reference in New Issue
Block a user