System calls on Windows

后端 未结 2 1076
Happy的楠姐
Happy的楠姐 2021-02-01 08:22

I just want to ask, I know that standart system calls in Linux are done by int instruction pointing into Interrupt Vector Table. I assume this is similiar on Windows. But, how d

2条回答
  •  再見小時候
    2021-02-01 09:19

    Making a Win32 call to create a window is not really related to an interrupt. The client application is already linked with the .dll that provides the call which exposes the address for the linker to use. Since you are asking about the difference in calling mechanism, I'm limiting the discussion here to those Win32 calls that are available to any application as opposed to kernel-level calls or device drivers. At an assembly language level, it would be the same as any other function call since most Win32 calls are user-level calls which internally make the needed kernel calls. The linker provides the address of the Win32 function as the target for some sort of branching instruction, the specifics would depend on the compiler.

    [Edit] It looks like you are right about the interrupts and the int. vector table. CodeGuru has a good article with the OS details on how NT kernel calls work. Link:
    http://www.codeguru.com/cpp/w-p/system/devicedriverdevelopment/article.php/c8035

提交回复
热议问题