winapi createfile



Автор Filowie задал вопрос в разделе Другие языки и технологии

Вопрос к программистам WinAPI. Почему вам нравятся такие функции, как CreateFile, вместо NtCreateFile, например? и получил лучший ответ

Ответ от Зло[гуру]
CreateFile - Documented public Win API used in user mode. CreateFile does some initialization and then calls NtCreateFile.
NtCreateFile - Undocumented Windows internal API that is used in user mode. Note some internal API's are documented.
ZwCreateFile - Windows API to be called from kernel mode (e.g. Device Drivers ).
Note: NtCreateFile and ZwCreateFile are identical when calling from user mode. However when calling from Kernel mode the ZwCreateFile sets the previous mode to kernel mode before calling create file function. This gives the ZwCreateFile kernel mode access where Nt version gets user mode access.
Basically the difference between Zw and Nt in kernel mode is that the Zw prefix functions set the previous mode to kernel mode and the Nt prefix functions leave it unchanged. The previous mode is used in parameter validation to determine if the function is called from user mode or kernel mode.
Take a look at these links:
).aspx
).aspx
Источник: ссылка
Зло
Просветленный
(32751)
а главное, там и написано, по сути, то же, что и я написал. Вы разницу между public и internal API улавливаете?

Ответ от 3 ответа[гуру]
Привет! Вот подборка тем с похожими вопросами и ответами на Ваш вопрос: Вопрос к программистам WinAPI. Почему вам нравятся такие функции, как CreateFile, вместо NtCreateFile, например?
 

Ответить на вопрос:

Имя*

E-mail:*

Текст ответа:*
Проверочный код(введите 22):*