CreateDirectory function kernel32
Win32Result<bool>
CreateDirectory(
- PCWSTR lpPathName,
- Pointer<
SECURITY_ATTRIBUTES> ? lpSecurityAttributes
Creates a new directory.
To learn more, see learn.microsoft.com/windows/win32/api/fileapi/nf-fileapi-createdirectoryw.
Implementation
Win32Result<bool> CreateDirectory(
PCWSTR lpPathName,
Pointer<SECURITY_ATTRIBUTES>? lpSecurityAttributes,
) {
resolveGetLastError();
final result_ = _CreateDirectory(lpPathName, lpSecurityAttributes ?? nullptr);
return .new(value: result_ != FALSE, error: GetLastError());
}