26 lines
1.1 KiB
C
26 lines
1.1 KiB
C
// POSIX compatibility support for posix path.
|
|
|
|
#pragma once
|
|
#include <ntlite/module_loader.h>
|
|
// posix_path.h - POSIX <-> native path translation.
|
|
|
|
// SYNTHETIC sentinel returned from PosixTranslatePath for /dev/null and
|
|
// /dev/zero; the caller must handle these before passing to any syscall.
|
|
#define SYNTH_DEVNULL "\x01<devnull>"
|
|
#define SYNTH_DEVZERO "\x01<devzero>"
|
|
|
|
// Translate a POSIX path to a native kernel path.
|
|
// Returns a pointer to 'out' on success, or SYNTH_DEVNULL / SYNTH_DEVZERO
|
|
// for those synthetic devices. 'out' must be at least 512 bytes.
|
|
const char* PosixTranslatePath(const char* in, char* out, size_t outSize);
|
|
|
|
// Translate a native kernel path back to a POSIX-style path.
|
|
// Strips the drive letter prefix and flips backslashes.
|
|
void NativeToPosix(const char* in, char* out, size_t outSize);
|
|
|
|
// Maps POSIX executable syntax to a canonical path relative to /SystemRoot.
|
|
KSTATUS PosixProcessPath(const char* in, char* out, size_t outSize);
|
|
|
|
// Maps POSIX/CRT import aliases to their canonical system personality module.
|
|
KSTATUS PosixResolveModuleName(void* context, SYS_STRING_VIEW requested, SYS_STRING_VIEW* canonicalOut);
|