Thank you for the response.
However, the contradiction remains unresolved.
The official CreateDirectory2A documentation explicitly states that failure returns INVALID_HANDLE_VALUE, while CreateDirectory2W states zero. Both functions return HANDLE and have otherwise equivalent signatures.
The older CreateDirectoryW API returns BOOL, so its zero-on-failure behavior does not necessarily establish the contract for CreateDirectory2W.
Furthermore, Microsoft's example checks INVALID_HANDLE_VALUE for CreateDirectory2.
Could a Microsoft Win32 API expert confirm the actual failure sentinel for CreateDirectory2W, ideally based on the implementation or an authoritative API contract, rather than inferring it from the currently inconsistent documentation?
Please also clarify whether the returned handle must be closed with CloseHandle and whether the documentation will be corrected.