-
-
Notifications
You must be signed in to change notification settings - Fork 695
Adds some NT functions #1358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Adds some NT functions #1358
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "libc/nt/codegen.h" | ||
.imp advapi32,__imp_RegOpenKeyExA,RegOpenKeyExA | ||
|
||
.text.windows | ||
.ftrace1 | ||
RegOpenKeyExA: | ||
.ftrace2 | ||
#ifdef __x86_64__ | ||
push %rbp | ||
mov %rsp,%rbp | ||
mov __imp_RegOpenKeyExA(%rip),%rax | ||
jmp __sysv2nt6 | ||
#elif defined(__aarch64__) | ||
mov x0,#0 | ||
ret | ||
#endif | ||
.endfn RegOpenKeyExA,globl | ||
.previous |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "libc/nt/codegen.h" | ||
.imp kernel32,__imp_GetACP,GetACP | ||
|
||
.text.windows | ||
.ftrace1 | ||
GetACP: | ||
.ftrace2 | ||
#ifdef __x86_64__ | ||
push %rbp | ||
mov %rsp,%rbp | ||
sub $32,%rsp | ||
call *__imp_GetACP(%rip) | ||
leave | ||
#elif defined(__aarch64__) | ||
mov x0,#0 | ||
#endif | ||
ret | ||
.endfn GetACP,globl | ||
.previous |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "libc/nt/codegen.h" | ||
.imp kernel32,__imp_GetCPInfoExW,GetCPInfoExW | ||
|
||
.text.windows | ||
.ftrace1 | ||
GetCPInfoEx: | ||
.ftrace2 | ||
#ifdef __x86_64__ | ||
push %rbp | ||
mov %rsp,%rbp | ||
mov __imp_GetCPInfoExW(%rip),%rax | ||
jmp __sysv2nt | ||
#elif defined(__aarch64__) | ||
mov x0,#0 | ||
ret | ||
#endif | ||
.endfn GetCPInfoEx,globl | ||
.previous |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "libc/nt/codegen.h" | ||
.imp kernel32,__imp_GetLogicalDriveStringsA,GetLogicalDriveStringsA | ||
|
||
.text.windows | ||
.ftrace1 | ||
GetLogicalDriveStringsA: | ||
.ftrace2 | ||
#ifdef __x86_64__ | ||
push %rbp | ||
mov %rsp,%rbp | ||
mov __imp_GetLogicalDriveStringsA(%rip),%rax | ||
jmp __sysv2nt | ||
#elif defined(__aarch64__) | ||
mov x0,#0 | ||
ret | ||
#endif | ||
.endfn GetLogicalDriveStringsA,globl | ||
.previous |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "libc/nt/codegen.h" | ||
.imp kernel32,__imp_GetOEMCP,GetOEMCP | ||
|
||
.text.windows | ||
.ftrace1 | ||
GetOEMCP: | ||
.ftrace2 | ||
#ifdef __x86_64__ | ||
push %rbp | ||
mov %rsp,%rbp | ||
sub $32,%rsp | ||
call *__imp_GetOEMCP(%rip) | ||
leave | ||
#elif defined(__aarch64__) | ||
mov x0,#0 | ||
#endif | ||
ret | ||
.endfn GetOEMCP,globl | ||
.previous |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "libc/nt/codegen.h" | ||
.imp kernel32,__imp_GetShortPathNameW,GetShortPathNameW | ||
|
||
.text.windows | ||
.ftrace1 | ||
GetShortPathName: | ||
.ftrace2 | ||
#ifdef __x86_64__ | ||
push %rbp | ||
mov %rsp,%rbp | ||
mov __imp_GetShortPathNameW(%rip),%rax | ||
jmp __sysv2nt | ||
#elif defined(__aarch64__) | ||
mov x0,#0 | ||
ret | ||
#endif | ||
.endfn GetShortPathName,globl | ||
.previous |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef COSMOPOLITAN_LIBC_NT_NLS_H_ | ||
#define COSMOPOLITAN_LIBC_NT_NLS_H_ | ||
#include "libc/nt/struct/cpinfoex.h" | ||
/* ░░░░ | ||
▒▒▒░░░▒▒▒▒▒▒▒▓▓▓░ | ||
▒▒▒▒░░░▒▒▒▒▒▒▓▓▓▓▓▓░ | ||
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓▓ ▒▓░ | ||
▒▒▒░░░░▒▒▒▒▒▒▓▓▓▓▓▓ ▓▓▓▓▓▓▒ ▒▒▒▓▓█ | ||
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓ | ||
░▒▒▒░░░░▒▒▒▒▒▒▓▓▓▓▓▓ █▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓█ | ||
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓░ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓ | ||
▒▒▒▒░░░▒▒▒▒▒▒▒▓▓▓▓▓▓ ▒▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▒ | ||
▒▒▒▒▓▓ ▓▒▒▓▓▓▓ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓█ | ||
▒▓ ▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓ | ||
░░░░░░░░░░░▒▒▒▒ ▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓█ | ||
▒▒░░░░░░░░░░▒▒▒▒▒▓▓▓ ▓▓▓▓▓▒▒▒▒▒▒▒▒▒▒▓▓▓ | ||
░▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▓░ ░▓███▓ | ||
▒▒░░░░░░░░░░▒▒▒▒▒▓▓░ ▒▓▓▓▒▒▒ ░▒▒▒▓ ████████████ | ||
▒▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▒▓▓▓▓▒▒▒▒▒▒▒▒░░░▒▒▒▒▒░ ░███ | ||
▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▓▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▓ ███ | ||
▒▒░░░░░░░░░░▒▒▒▒▒▒▓▓ ▒▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒ ▓██ | ||
▒░░░░░░░░░░░▒▒▒▒▒▓▓ ▓▓▓▓▒▒▒▒▒▒▒▒░░░▒▒▒▒▒▓ ▓██ | ||
▒▒░░░▒▒▒░░░▒▒░▒▒▒▓▓▒ ▒▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒ ███ | ||
░▒▓ ░▓▓▓▓▒▒▒▒▒▒▒▒░░░░▒▒▒▒▓ ▓██ | ||
╔────────────────────────────────────────────────────────────────▀▀▀─────────│─╗ | ||
│ cosmopolitan § new technology » internationalization ─╬─│┼ | ||
╚────────────────────────────────────────────────────────────────────────────│*/ | ||
COSMOPOLITAN_C_START_ | ||
|
||
uint32_t GetOEMCP(); | ||
uint32_t GetACP(); | ||
bool32 GetCPInfoEx(uint32_t CodePage, uint32_t dwFlags, struct NtCpInfoEx *out_lpCPInfoEx) paramsnonnull((3)); | ||
|
||
COSMOPOLITAN_C_END_ | ||
#endif /* COSMOPOLITAN_LIBC_NT_NLS_H_ */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef COSMOPOLITAN_LIBC_NT_STRUCT_CPINFOEX_H_ | ||
#define COSMOPOLITAN_LIBC_NT_STRUCT_CPINFOEX_H_ | ||
|
||
struct NtCpInfoEx { | ||
uint32_t MaxCharSize; | ||
uint8_t DefaultChar[2]; | ||
uint8_t LeadByte[12]; | ||
char16_t UnicodeDefaultChar; | ||
uint32_t CodePage; | ||
char16_t CodePageName[260]; | ||
}; | ||
|
||
#endif /* COSMOPOLITAN_LIBC_NT_STRUCT_CPINFOEX_H_ */ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.