开发者

CRT AND WIN32 API

hI,

I'm wondering under windows where the CRT lib is used. In each dll forming t开发者_如何学JAVAhe win32 API? Only by software developped under visual studio ?

In other words, is Windows OS perform malloc, write/read on files and so on, by using other thing than CRT?

THanks


The C runtime (in case of Visual Studio 2010 msvcr100.dll) contains the implementation of the C standard library functions.

The C runtime is implemented in a platform-specific way, and in the Windows case, it uses functions from kernel32.dll (part of the Win32 API) to perform its tasks.

You can have a look at the exported and imported functions and DLL dependencies using Dependency Walker.


I have no idea what you wanted to ask in your first question. About the second though: CRT is not windows-specific but VS-specific. Your C programs that you compile with VS will use the MSVCRTxx DLLs to provide (most) C library functions. In turn, the C library functions will use the WINAPI to do actual stuff. The WINAPI is the last layer that talks to the OS.

Other compilers, such as g++ in MINGW will not use the MSVCRTxx DLLs but have their own. In the end, that will also use the WINAPI. For example, malloc will most likely call VirtualAlloc in any implementation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜