mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-03-16 05:46:25 +00:00
Introduce AddDllDirectory()
This commit is contained in:
parent
32b97f2d25
commit
2c9d2943d6
3 changed files with 23 additions and 1 deletions
|
@ -37,6 +37,7 @@ void *GetProcAddress(int64_t hModule, const char *lpProcName);
|
||||||
int32_t FreeResource(int64_t hResData);
|
int32_t FreeResource(int64_t hResData);
|
||||||
intptr_t LockResource(int64_t hResData);
|
intptr_t LockResource(int64_t hResData);
|
||||||
int32_t FreeLibrary(int64_t hLibModule);
|
int32_t FreeLibrary(int64_t hLibModule);
|
||||||
|
void *AddDllDirectory(const char16_t *NewDirectory);
|
||||||
|
|
||||||
COSMOPOLITAN_C_END_
|
COSMOPOLITAN_C_END_
|
||||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||||
|
|
20
libc/nt/kernel32/AddDllDirectory.S
Normal file
20
libc/nt/kernel32/AddDllDirectory.S
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#include "libc/nt/codegen.h"
|
||||||
|
.imp kernel32,__imp_AddDllDirectory,AddDllDirectory
|
||||||
|
|
||||||
|
.text.windows
|
||||||
|
.ftrace1
|
||||||
|
AddDllDirectory:
|
||||||
|
.ftrace2
|
||||||
|
#ifdef __x86_64__
|
||||||
|
push %rbp
|
||||||
|
mov %rsp,%rbp
|
||||||
|
mov %rdi,%rcx
|
||||||
|
sub $32,%rsp
|
||||||
|
call *__imp_AddDllDirectory(%rip)
|
||||||
|
leave
|
||||||
|
#elif defined(__aarch64__)
|
||||||
|
mov x0,#0
|
||||||
|
#endif
|
||||||
|
ret
|
||||||
|
.endfn AddDllDirectory,globl
|
||||||
|
.previous
|
|
@ -45,6 +45,7 @@ imp '' WaitForMultipleObjects kernel32 4
|
||||||
imp '' WaitForSingleObject kernel32 2
|
imp '' WaitForSingleObject kernel32 2
|
||||||
imp 'AcquireSRWLockExclusive' AcquireSRWLockExclusive kernel32 1
|
imp 'AcquireSRWLockExclusive' AcquireSRWLockExclusive kernel32 1
|
||||||
imp 'AcquireSRWLockShared' AcquireSRWLockShared kernel32 1
|
imp 'AcquireSRWLockShared' AcquireSRWLockShared kernel32 1
|
||||||
|
imp 'AddDllDirectory' AddDllDirectory kernel32 1
|
||||||
imp 'AddVectoredContinueHandler' AddVectoredContinueHandler kernel32 2
|
imp 'AddVectoredContinueHandler' AddVectoredContinueHandler kernel32 2
|
||||||
imp 'AddVectoredExceptionHandler' AddVectoredExceptionHandler kernel32 2
|
imp 'AddVectoredExceptionHandler' AddVectoredExceptionHandler kernel32 2
|
||||||
imp 'AllocConsole' AllocConsole kernel32 0
|
imp 'AllocConsole' AllocConsole kernel32 0
|
||||||
|
@ -244,9 +245,9 @@ imp 'SetEndOfFile' SetEndOfFile kernel32 1
|
||||||
imp 'SetEnvironmentVariable' SetEnvironmentVariableW kernel32 2
|
imp 'SetEnvironmentVariable' SetEnvironmentVariableW kernel32 2
|
||||||
imp 'SetErrorMode' SetErrorMode kernel32 1
|
imp 'SetErrorMode' SetErrorMode kernel32 1
|
||||||
imp 'SetEvent' SetEvent kernel32 1
|
imp 'SetEvent' SetEvent kernel32 1
|
||||||
imp 'SetFileInformationByHandle' SetFileInformationByHandle kernel32 4
|
|
||||||
imp 'SetFileAttributes' SetFileAttributesW kernel32 2
|
imp 'SetFileAttributes' SetFileAttributesW kernel32 2
|
||||||
imp 'SetFileCompletionNotificationModes' SetFileCompletionNotificationModes kernel32 2
|
imp 'SetFileCompletionNotificationModes' SetFileCompletionNotificationModes kernel32 2
|
||||||
|
imp 'SetFileInformationByHandle' SetFileInformationByHandle kernel32 4
|
||||||
imp 'SetFileTime' SetFileTime kernel32 4
|
imp 'SetFileTime' SetFileTime kernel32 4
|
||||||
imp 'SetFileValidData' SetFileValidData kernel32 2
|
imp 'SetFileValidData' SetFileValidData kernel32 2
|
||||||
imp 'SetHandleCount' SetHandleCount kernel32 1
|
imp 'SetHandleCount' SetHandleCount kernel32 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue