82 lines
6.0 KiB
C
82 lines
6.0 KiB
C
#ifndef COSMOPOLITAN_LIBC_NT_NT_FILE_H_
|
|
#define COSMOPOLITAN_LIBC_NT_NT_FILE_H_
|
|
#include "libc/nt/enum/fileinformationclass.h"
|
|
#include "libc/nt/enum/status.h"
|
|
#include "libc/nt/thunk/msabi.h"
|
|
#include "libc/nt/typedef/ioapcroutine.h"
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
COSMOPOLITAN_C_START_
|
|
#if 0
|
|
/* ░░░░
|
|
▒▒▒░░░▒▒▒▒▒▒▒▓▓▓░
|
|
▒▒▒▒░░░▒▒▒▒▒▒▓▓▓▓▓▓░
|
|
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓▓ ▒▓░
|
|
▒▒▒░░░░▒▒▒▒▒▒▓▓▓▓▓▓ ▓▓▓▓▓▓▒ ▒▒▒▓▓█
|
|
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓
|
|
░▒▒▒░░░░▒▒▒▒▒▒▓▓▓▓▓▓ █▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓█
|
|
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓░ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓
|
|
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓▓ ▒▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▒
|
|
▒▒▒▒▓▓ ▓▒▒▓▓▓▓ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓█
|
|
▒▓ ▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓
|
|
░░░░░░░░░░░▒▒▒▒ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓█
|
|
▒▒░░░░░░░░░░▒▒▒▒▒▓▓▓ ▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓
|
|
░▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▓░ ░▓███▓
|
|
▒▒░░░░░░░░░░▒▒▒▒▒▓▓░ ▒▓▓▓▒▒▒ ░▒▒▒▓ ████████████
|
|
▒▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▒▓▓▓▓▒▒▒▒▒▒▒▒░░░▒▒▒▒▒░ ░███
|
|
▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▓▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▓ ███
|
|
▒▒░░░░░░░░░░▒▒▒▒▒▒▓▓ ▒▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒ ▓██
|
|
▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▓▓▓▓▒▒▒▒▒▒▒▒░░░▒▒▒▒▒▓ ▓██
|
|
▒▒░░░▒▒▒░░░▒▒░▒▒▒▓▓▒ ▒▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒ ███
|
|
░▒▓ ░▓▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▓ ▓██
|
|
╔────────────────────────────────────────────────────────────────▀▀▀─────────│─╗
|
|
│ cosmopolitan § new technology » beyond the pale » files ─╬─│┼
|
|
╚────────────────────────────────────────────────────────────────────────────│─╝
|
|
“The functions and structures in [for these APIs] are internal to
|
|
the operating system and subject to change from one release of
|
|
Windows to the next, and possibly even between service packs for
|
|
each release.” ──Quoth MSDN */
|
|
#endif
|
|
|
|
struct NtIoStatusBlock;
|
|
struct NtObjectAttributes;
|
|
|
|
NtStatus NtCreateFile(int64_t *out_FileHandle, uint32_t DesiredAccess,
|
|
struct NtObjectAttributes *ObjectAttributes,
|
|
struct NtIoStatusBlock *out_IoStatusBlock,
|
|
int64_t *opt_AllocationSize, uint32_t FileAttributes,
|
|
uint32_t ShareAccess, uint32_t CreateDisposition,
|
|
uint32_t CreateOptions, void *opt_EaBuffer,
|
|
uint32_t EaLength);
|
|
NtStatus NtReadFile(int64_t FileHandle, void *opt_Event,
|
|
NtIoApcRoutine opt_ApcRoutine, void *opt_ApcContext,
|
|
struct NtIoStatusBlock *out_IoStatusBlock, void *out_Buffer,
|
|
uint32_t Length, int64_t *opt_ByteOffset,
|
|
uint32_t *opt_Key);
|
|
NtStatus NtWriteFile(int64_t FileHandle, void *opt_Event,
|
|
NtIoApcRoutine opt_ApcRoutine, void *opt_ApcContext,
|
|
struct NtIoStatusBlock *out_IoStatusBlock,
|
|
const void *Buffer, uint32_t Length,
|
|
int64_t *opt_ByteOffset, uint32_t *opt_Key);
|
|
NtStatus NtClose(int64_t handle);
|
|
NtStatus NtDuplicateObject(int64_t SourceProcessHandle, void *SourceHandle,
|
|
void *TargetProcessHandle,
|
|
void **opt_out_TargetHandle, uint32_t DesiredAcess,
|
|
uint32_t Atrributes, uint32_t options_t);
|
|
NtStatus NtQueryInformationFile(int64_t FileHandle,
|
|
struct NtIoStatusBlock *out_IoStatusBlock,
|
|
void *out_FileInformation,
|
|
uint32_t FileInformationLength,
|
|
uint32_t FileInformationClass);
|
|
NtStatus NtSetInformationFile(int64_t FileHandle,
|
|
struct NtIoStatusBlock *out_IoStatusBlock,
|
|
void *FileInformation,
|
|
uint32_t FileInformationLength,
|
|
uint32_t FileInformationClass);
|
|
|
|
#if ShouldUseMsabiAttribute()
|
|
#include "libc/nt/thunk/ntfile.inc"
|
|
#endif /* ShouldUseMsabiAttribute() */
|
|
COSMOPOLITAN_C_END_
|
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
|
#endif /* COSMOPOLITAN_LIBC_NT_NT_FILE_H_ */
|