mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-01 16:58:30 +00:00
Fix fork() on Windows after chdir()
This commit is contained in:
parent
21e1023d28
commit
b8d26e2418
7 changed files with 93 additions and 4 deletions
|
@ -32,6 +32,7 @@ int64_t LoadLibraryEx(const char16_t *lpLibFileName, int64_t hFile,
|
|||
uint32_t dwFlags);
|
||||
uint32_t GetModuleFileName(int64_t hModule, char16_t *lpFilename,
|
||||
uint32_t nSize);
|
||||
uint32_t GetModuleFileNameA(int64_t hModule, char *lpFilename, uint32_t nSize);
|
||||
intptr_t GetModuleHandle(const char *opt_lpModuleName);
|
||||
intptr_t GetModuleHandleW(const char16_t *opt_lpModuleName);
|
||||
void *GetProcAddress(int64_t hModule, const char *lpProcName);
|
||||
|
|
|
@ -199,6 +199,15 @@ bool32 WriteFileGather(int64_t hFileOpenedWithOverlappedAndNoBuffering,
|
|||
uint32_t nNumberOfBytesToWrite, uint32_t *lpReserved,
|
||||
struct NtOverlapped inout_lpOverlapped) paramsnonnull();
|
||||
|
||||
#define kNtFileNameNormalized 0x0
|
||||
#define kNtVolumeNameDos 0x0
|
||||
#define kNtVolumeNameGuid 0x1
|
||||
#define kNtVolumeNameNt 0x2
|
||||
#define kNtVolumeNameNone 0x4
|
||||
#define kNtFileNameOpened 0x8
|
||||
uint32_t GetFinalPathNameByHandle(int64_t hFile, char16_t *out_path,
|
||||
uint32_t size, uint32_t flags);
|
||||
|
||||
#if ShouldUseMsabiAttribute()
|
||||
#include "libc/nt/thunk/files.inc"
|
||||
#endif /* ShouldUseMsabiAttribute() */
|
||||
|
|
|
@ -1,2 +1,12 @@
|
|||
.include "o/libc/nt/codegen.inc"
|
||||
.imp kernel32,__imp_GetFinalPathNameByHandleA,GetFinalPathNameByHandleA,0
|
||||
|
||||
.text.windows
|
||||
GetFinalPathNameByHandleA:
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_GetFinalPathNameByHandleA(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
.endfn GetFinalPathNameByHandleA,globl
|
||||
.previous
|
||||
|
|
|
@ -1,2 +1,12 @@
|
|||
.include "o/libc/nt/codegen.inc"
|
||||
.imp kernel32,__imp_GetFinalPathNameByHandleW,GetFinalPathNameByHandleW,0
|
||||
|
||||
.text.windows
|
||||
GetFinalPathNameByHandle:
|
||||
push %rbp
|
||||
mov %rsp,%rbp
|
||||
.profilable
|
||||
mov __imp_GetFinalPathNameByHandleW(%rip),%rax
|
||||
jmp __sysv2nt
|
||||
.endfn GetFinalPathNameByHandle,globl
|
||||
.previous
|
||||
|
|
|
@ -2176,8 +2176,8 @@ imp 'GetFileVersionInfoSizeExA' GetFileVersionInfoSizeExA KernelBase 561
|
|||
imp 'GetFileVersionInfoSizeEx' GetFileVersionInfoSizeExW KernelBase 562
|
||||
imp 'GetFileVersionInfoSize' GetFileVersionInfoSizeW KernelBase 563
|
||||
imp 'GetFileVersionInfo' GetFileVersionInfoW KernelBase 564
|
||||
imp 'GetFinalPathNameByHandleA' GetFinalPathNameByHandleA kernel32 0 # KernelBase
|
||||
imp 'GetFinalPathNameByHandle' GetFinalPathNameByHandleW kernel32 0 # KernelBase
|
||||
imp 'GetFinalPathNameByHandleA' GetFinalPathNameByHandleA kernel32 0 4 # KernelBase
|
||||
imp 'GetFinalPathNameByHandle' GetFinalPathNameByHandleW kernel32 0 4 # KernelBase
|
||||
imp 'GetFirmwareEnvironmentVariableA' GetFirmwareEnvironmentVariableA kernel32 597
|
||||
imp 'GetFirmwareEnvironmentVariableExA' GetFirmwareEnvironmentVariableExA kernel32 598
|
||||
imp 'GetFirmwareEnvironmentVariableEx' GetFirmwareEnvironmentVariableExW kernel32 599
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue