1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

BeefySysLib point/rect updates, async pipe fixes

This commit is contained in:
Brian Fiete 2025-03-28 08:08:33 -04:00
parent 81a9478e77
commit fe1aa3c26e
32 changed files with 282 additions and 120 deletions

View file

@ -76,6 +76,9 @@ namespace System.IO
Platform.BfpFileCreateKind createKind = .CreateAlways;
Platform.BfpFileCreateFlags createFlags = .Pipe;
if (options.HasFlag(.AllowTimeouts))
createFlags |= .AllowTimeouts;
createKind = .OpenExisting;
createFlags |= .Read;
createFlags |= .Write;

View file

@ -392,8 +392,11 @@ namespace System.Net
service.sin_addr = address;
service.sin_port = (uint16)htons((int16)port);
if (bind(mHandle, &service, sizeof(SockAddr_in)) == SOCKET_ERROR)
int32 size = sizeof(SockAddr_in);
if (bind(mHandle, &service, size) == SOCKET_ERROR)
{
int err = WSAGetLastError();
Close();
return .Err;
}

View file

@ -107,6 +107,11 @@ namespace System
public int32 Height => bottom - top;
}
public struct Point : this(int32 x, int32 y)
{
}
[CRepr]
public struct OpenFileName
{
@ -1703,6 +1708,12 @@ namespace System
[Import("user32.lib"), CLink, CallingConvention(.Stdcall)]
public static extern HWnd SetActiveWindow(HWnd wnd);
[Import("user32.lib"), CLink, CallingConvention(.Stdcall)]
public static extern HWnd SetForegroundWindow(HWnd wnd);
[Import("user32.lib"), CLink, CallingConvention(.Stdcall)]
public static extern HWnd GetForegroundWindow();
[CLink, CallingConvention(.Stdcall)]
public static extern int CallWindowProcA(int wndProc, HWnd hWnd, int32 msg, int wParam, int lParam);
@ -1749,6 +1760,12 @@ namespace System
[Import("user32.lib"), CLink, CallingConvention(.Stdcall)]
public static extern IntBool SetWindowPos(HWnd hWnd, HWnd hWndAfter, int x, int y, int cx, int cy, int flags);
[Import("user32.lib"), CLink, CallingConvention(.Stdcall)]
public static extern IntBool GetClientRect(HWnd hWnd, out Rect rect);
[Import("user32.lib"), CLink, CallingConvention(.Stdcall)]
public static extern IntBool ClientToScreen(HWnd hWnd, ref Point rect);
[Import("user32.lib"), CLink, CallingConvention(.Stdcall)]
public static extern IntBool PostMessageW(HWnd hWnd, int32 msg, int wParam, int lParam);