Hacker News new | ask | show | jobs
by c4mpute 996 days ago
No. Because the API is fragmented into old, not-so-old and new parts, some higher-, some lower-level[0]. You need things from all of them, the new API isn't complete enough and has warts in places where using one of the older ones is better/easier/safer. So in the end you will have to use all the ways, and know when to use which one.

All this can of course be fixed with another layer of indirection. But if you ever wanted to know why Windows file APIs and filesystems are so dog-slow, here is (part of) your answer.

[0] e.g. there are lower level APIs that can create and access files and filenames that higher level APIs will filter out or disallow.

2 comments

I feel inclined to bypass all that Win32 gubbins and talk to the Kernel directly.

Back in my day we just walked into the office of the man in charge and shook hands, we struck deals like real men. If we ask ask the NT kernel politely in a language it understands, we will get our filepath. Right?

http://undocumented.ntinternals.net/index.html?page=UserMode...

NT API is now documented by Microsoft. The coverage is not complete, but enough to be useful. E.g. https://learn.microsoft.com/en-us/windows/win32/api/winternl....
> new API isn't complete enough and has warts in places where using one of the older ones is better/easier/safer

Describes Windows Forms vs everything else MS has been trying to do in the past 15 years.