-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move win32 libc bindings from winbase.cr to approriate files (#10771)
- Loading branch information
1 parent
bf809ac
commit 93a65e3
Showing
19 changed files
with
120 additions
and
73 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
require "c/processthreadsapi" | ||
require "c/handleapi" | ||
require "process/shell" | ||
|
||
struct Crystal::System::Process | ||
|
This file contains 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 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,6 @@ | ||
require "c/int_safe" | ||
|
||
lib LibC | ||
fun GetLastError : DWORD | ||
fun SetLastError(dwErrCode : DWORD) | ||
end |
This file contains 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 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,11 @@ | ||
require "c/winnt" | ||
|
||
lib LibC | ||
INVALID_HANDLE_VALUE = HANDLE.new(-1) | ||
|
||
fun CloseHandle(hObject : HANDLE) : BOOL | ||
|
||
fun DuplicateHandle(hSourceProcessHandle : HANDLE, hSourceHandle : HANDLE, | ||
hTargetProcessHandle : HANDLE, lpTargetHandle : HANDLE*, | ||
dwDesiredAccess : DWORD, bInheritHandle : BOOL, dwOptions : DWORD) : BOOL | ||
end |
This file contains 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,26 @@ | ||
# part of winbase | ||
lib LibC | ||
struct FILETIME | ||
dwLowDateTime : DWORD | ||
dwHighDateTime : DWORD | ||
end | ||
|
||
struct SYSTEMTIME | ||
wYear : WORD | ||
wMonth : WORD | ||
wDayOfWeek : WORD | ||
wDay : WORD | ||
wHour : WORD | ||
wMinute : WORD | ||
wSecond : WORD | ||
wMilliseconds : WORD | ||
end | ||
|
||
enum GET_FILEEX_INFO_LEVELS | ||
GetFileExInfoStandard | ||
GetFileExMaxInfoLevel | ||
end | ||
|
||
STATUS_PENDING = 0x103 | ||
STILL_ACTIVE = STATUS_PENDING | ||
end |
This file contains 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,11 @@ | ||
require "c/winnt" | ||
|
||
lib LibC | ||
fun GetCurrentDirectoryW(nBufferLength : DWORD, lpBuffer : LPWSTR) : DWORD | ||
fun SetCurrentDirectoryW(lpPathname : LPWSTR) : BOOL | ||
|
||
fun GetEnvironmentVariableW(lpName : LPWSTR, lpBuffer : LPWSTR, nSize : DWORD) : DWORD | ||
fun GetEnvironmentStringsW : LPWCH | ||
fun FreeEnvironmentStringsW(lpszEnvironmentBlock : LPWCH) : BOOL | ||
fun SetEnvironmentVariableW(lpName : LPWSTR, lpValue : LPWSTR) : BOOL | ||
end |
This file contains 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
require "./basetsd" | ||
require "c/wtypesbase" | ||
|
||
lib LibC | ||
CREATE_UNICODE_ENVIRONMENT = 0x00000400 | ||
|
This file contains 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,6 @@ | ||
# part of windows | ||
|
||
lib LibC | ||
fun QueryPerformanceCounter(lpPerformanceCount : LARGE_INTEGER*) : BOOL | ||
fun QueryPerformanceFrequency(lpFrequency : LARGE_INTEGER*) : BOOL | ||
end |
This file contains 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 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,21 @@ | ||
require "c/winnt" | ||
require "c/winbase" | ||
|
||
lib LibC | ||
struct TIME_ZONE_INFORMATION | ||
bias : LONG | ||
standardName : StaticArray(WCHAR, 32) | ||
standardDate : SYSTEMTIME | ||
standardBias : LONG | ||
daylightName : StaticArray(WCHAR, 32) | ||
daylightDate : SYSTEMTIME | ||
daylightBias : LONG | ||
end | ||
|
||
TIME_TONE_ID_INVALID = 0xffffffff_u32 | ||
TIME_ZONE_ID_UNKNOWN = 0_u32 | ||
TIME_ZONE_ID_STANDARD = 1_u32 | ||
TIME_ZONE_ID_DAYLIGHT = 2_u32 | ||
|
||
fun GetTimeZoneInformation(tz_info : TIME_ZONE_INFORMATION*) : DWORD | ||
end |
This file contains 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 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,3 @@ | ||
require "c/winnt" | ||
|
||
require "c/profileapi" |
This file contains 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 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,9 @@ | ||
require "c/winnt" | ||
|
||
lib LibC | ||
struct SECURITY_ATTRIBUTES | ||
nLength : DWORD | ||
lpSecurityDescriptor : Void* | ||
bInheritHandle : BOOL | ||
end | ||
end |
This file contains 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