Benjamin
Benjamin

Reputation: 10393

Why isn't there ReadDirectoryChangesA?

There is ReadDirectoryChangesW in Winapis. But there is no ReadDirectoryChangesA.

Curious.
Why is it treated specially? Is there anyone who knows the reason or history?

Upvotes: 5

Views: 414

Answers (2)

John
John

Reputation: 5635

The kernel internally is using unicode encoding. Win32 APIs with W suffix usually translate to the internal NtXxx APIs. The A version of the Win32 API needs to translate from ASCII to Unicode, call the W-version, and then translate any output back to ASCII.

In the case of ReadDirectoryChangesW the last part is impossible to do because the data is read directly from the file system to the caller's buffer, and potentially after the API returns so it is impossible to implement ReadDirectoryChangesA.

Upvotes: 2

Jerry Coffin
Jerry Coffin

Reputation: 490048

It never existed in Win98/98/SE/Me. Many (most?) of the functions that have been NT-only from the beginning (e.g., the Net* API) are only available in "wide" versions (though in the case of Net*, they omitted the "W" suffix).

Upvotes: 2

Related Questions