Skip to content

Commit b36d698

Browse files
committed
Fix open syscall for window creation. #62
1 parent bbf7b3a commit b36d698

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/syscall.cc

+7-3
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,16 @@ __attribute__((ms_abi)) extern "C" void SyscallHandler(uint64_t* args) {
480480
kprintf("file name: %s\n", file_name);
481481

482482
if (IsEqualString(".", file_name)) {
483-
// for getdents64
484483
ppdata.num_getdents64_called = 0;
485484
args[0] = 5;
486485
return;
487486
}
488487

488+
if (IsEqualString("window.bmp", file_name)) {
489+
args[0] = 7;
490+
return;
491+
}
492+
489493
int found_idx = -1;
490494

491495
LoaderInfo& loader_info = *reinterpret_cast<LoaderInfo*>(
@@ -517,8 +521,8 @@ __attribute__((ms_abi)) extern "C" void SyscallHandler(uint64_t* args) {
517521
if (idx == kSyscallIndex_sys_mmap) {
518522
uint64_t size = args[2];
519523
uint64_t fd = args[5];
520-
if (fd != 5) {
521-
kprintf("fd != 5\n");
524+
if (fd != 7) {
525+
kprintf("fd != 7\n");
522526
args[0] = static_cast<uint64_t>(-1);
523527
return;
524528
}

0 commit comments

Comments
 (0)